Mark global with hidden attribute
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR gold/18628
4 * testsuite/ifuncdep2.c (global): Change protected to hidden.
5 * testsuite/ifuncmod1.c (global): Likewise.
6 * testsuite/ifuncmod5.c (global): Likewise.
7
8 2015-07-22 Alan Modra <amodra@gmail.com>
9
10 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
11
12 2015-07-21 Cary Coutant <ccoutant@gmail.com>
13
14 PR gold/18548
15 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
16 forced local symbol even when oldsym != NULL.
17 (Symbol_table::do_define_in_output_segment): Likewise.
18 (Symbol_table::do_define_as_constant): Likewise.
19
20 2015-07-21 Cary Coutant <ccoutant@gmail.com>
21
22 PR gold/18698
23 * archive.cc (Library_base::should_include_member): Don't use entry
24 point for relocatable links, or if target is not yet valid.
25 * parameters.cc (Parameters::entry): Check target_valid().
26
27 2015-07-20 Han Shen <shenhan@google.com>
28
29 Optimize erratum 843419 fix.
30
31 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
32 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
33 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
34 (E843419_stub): New sub-class of Erratum_stub.
35 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
36 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
37 (AArch64_relobj::create_erratum_stub): Add 1 argument.
38 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
39
40 2015-07-20 Han Shen <shenhan@google.com>
41
42 Fix arm elf header flags wrt hardfp bit.
43
44 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
45
46 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
47
48 PR gold/18689
49 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
50 from input group section for relocatable link.
51 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
52 (check_DATA): Add pr18689.stdout.
53 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
54 (pr18689.stdout): New rule.
55 (pr18689a.o): Likewise.
56 (pr18689b.o): Likewise.
57 (pr18689.o): Likewise.
58 * testsuite/pr18689.c: New file.
59 * testsuite/pr18689.sh: Likewise.
60 * testsuite/Makefile.in: Regenerated.
61
62 2015-07-20 Yiran Wang <yiran@google.com>
63 Cary Coutant <ccoutant@gmail.com>
64
65 PR gold/15574
66 * resolve.cc (Symbol_table): Remove warning about references
67 from shared objects to hidden symbols.
68 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
69 * testsuite/Makefile.in: Regenerate.
70 * testsuite/hidden_test.sh: Check dynamic symbol table; update
71 expected error messages.
72
73 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
74
75 * compressed_output.cc (Output_compressed_section::set_final_data_size):
76 Make --compress-debug-sections=zlib the same as
77 --compress-debug-sections=zlib-gabi.
78 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
79 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
80 ".zdebug_".
81 * testsuite/Makefile.in: Regenerated.
82
83 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
84
85 PR gold/18322
86 * compressed_output.cc (zlib_compress): Add argument for
87 compression header size. Set header size to compression header
88 size if it isn't 0. Don't write out the zlib header here.
89 (Output_compressed_section::set_final_data_size): Support
90 zlib-gnu and zlib-gabi compressions. Pass compression header
91 size to zlib_compress and write out compression header. Set
92 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
93 clear the SHF_COMPRESSED bit
94 * options.h (compress_debug_sections): Add zlib-gnu and
95 zlib-gabi.
96 * output.h (Output_section::set_flags): New.
97 * testsuite/Makefile.am (check_PROGRAMS): Add
98 flagstest_compress_debug_sections_none,
99 flagstest_compress_debug_sections_gnu and
100 flagstest_compress_debug_sections_gabi.
101 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
102 flagstest_compress_debug_sections.stdout,
103 flagstest_compress_debug_sections.cmp,
104 flagstest_compress_debug_sections.check,
105 flagstest_compress_debug_sections_gnu.stdout,
106 flagstest_compress_debug_sections_gnu.cmp,
107 flagstest_compress_debug_sections_gnu.check,
108 flagstest_compress_debug_sections_gabi.stdout,
109 flagstest_compress_debug_sections_gabi.cmp and
110 flagstest_compress_debug_sections_gabi.check.
111 (flagstest_compress_debug_sections_none): New.
112 (flagstest_compress_debug_sections_none.stdout): Likewise.
113 (flagstest_compress_debug_sections.stdout): Likewise.
114 (flagstest_compress_debug_sections.check): Likewise.
115 (flagstest_compress_debug_sections.cmp): Likewise.
116 (flagstest_compress_debug_sections_gnu): Likewise.
117 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
118 (flagstest_compress_debug_sections_gnu.check): Likewise.
119 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
120 (flagstest_compress_debug_sections_gabi): Likewise.
121 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
122 (flagstest_compress_debug_sections_gnu.check): Likewise.
123 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
124 * testsuite/Makefile.in: Regenerated.
125
126 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
127
128 PR gold/18321
129 * compressed_output.h (decompress_input_section): Add arguments
130 for ELF class, big endian and sh_flags.
131 * compressed_output.cc (decompress_input_section): Likewise.
132 Support the SHF_COMPRESSED section.
133 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
134 functions.
135 * plugin.h (Pluginobj): Likewise.
136 * layout.cc (Layout::get_output_section_flags): Also clear the
137 SHF_COMPRESSED bit.
138 * object.h (Compressed_section_info): Add flag to store sh_flags.
139 (Object): Add pure virtual elfsize and is_big_endian member
140 functions.
141 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
142 prefix here.
143 (build_compressed_section_map): Check SHF_COMPRESSED for
144 uncompressed size. Store sh_flags in Compressed_section_info.
145 Pass size, big_endian and sh_flags to decompress_input_section.
146 Skip the ".debug"/".zdebug" prefix when passing section name to
147 need_decompressed_section.
148 (Sized_relobj_file<size, big_endian>::do_find_special_section):
149 Don't check ".zdebug_*" sections.
150 (Object::decompressed_section_contents): Pass ELF class, big
151 endian and sh_flags to decompress_input_section.
152 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
153 Likewise.
154 * testsuite/Makefile.am (check_DATA): Add
155 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
156 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
157 gdb_index_test_2_gabi.stdout.
158 (debug_msg_cdebug_gabi.o): New.
159 (odr_violation1_cdebug_gabi.o): Likewise.
160 (odr_violation2_cdebug_gabi.o): Likewise.
161 (debug_msg_cdebug_gabi.err): Likewise.
162 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
163 (gdb_index_test_cdebug_gabi.o): Likewise.
164 (gdb_index_test_2_gabi): Likewise.
165 (gdb_index_test_2_gabi.stdout): Likewise.
166 * testsuite/gdb_index_test_2_gabi.sh: New file.
167 * testsuite/Makefile.in: Regenerated.
168
169 2015-07-09 Han Shen <shenhan@google.com>
170
171 Use "gold_info" instead of "gold_warning" for erratum fix.
172
173 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
174 'gold_info'.
175 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
176
177 2015-07-09 Han Shen <shenhan@google.com>
178
179 Drop missing symbol warning for arm/aarch64.
180
181 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
182 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
183 symbol warning.
184
185 2015-07-07 Han Shen <shenhan@google.com>
186
187 Make gold aarch64 accept long form of mapping symbols.
188
189 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
190 of mapping symbols.
191
192 2015-06-29 Doug Kwan <dougkwan@google.com>
193
194 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
195 at address expected by test.
196 * testsuite/arm_cortex_a8_b.s: Ditto.
197 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
198 * testsuite/arm_cortex_a8_bl.s: Ditto.
199 * testsuite/arm_cortex_a8_blx.s: Ditto.
200 * testsuite/arm_cortex_a8_local.s: Ditto.
201 * testsuite/arm_fix_v4bx.s: Ditto.
202 * testsuite/arm_unaligned_reloc.s: Ditto.
203 * testsuite/thumb_bl_out_of_range.s: Ditto.
204 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
205 * testsuite/thumb_blx_out_of_range.s: Ditto.
206
207 2015-06-29 Han Shen <shenhan@google.com>
208
209 Patch for erratum 843419 internal error.
210
211 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
212 (Erratum_stub::update_erratum_insn): New method.
213 (Stub_table::relocate_stubs): Modified to place relocated insn.
214 (AArch64_relobj::fix_errata): Modified gold_assert.
215
216 2015-06-12 Han Shen <shenhan@google.com>
217
218 Fix erratum 835769.
219
220 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
221 defintion outside class definition.
222 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
223 (AArch64_insn_utilities::aarch64_op31): New member.
224 (AArch64_insn_utilities::aarch64_ra): New member.
225 (AArch64_insn_utilities::aarch64_mac): New member.
226 (AArch64_insn_utilities::aarch64_mlxl): New member.
227 (ST_E_835769): New global enum member.
228 (Stub_table::relocate_stubs): Add 835769 handler.
229 (Stub_template_repertoire::Stub_template_repertoire): Install new
230 stub type.
231 (AArch64_relobj::scan_errata): This func is renamed from
232 scan_erratum_843419.
233 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
234 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
235 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
236 (Target_aarch64::scan_erratum_835769_span): New method.
237 (Target_aarch64::create_erratum_stub): New method.
238 (Target_aarch64::is_erratum_835769_sequence): New method.
239 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
240 code into create_erratum_stub.
241 * options.h (fix_cortex_a53_835769): New option.
242
243 2015-06-11 Cary Coutant <ccoutant@gmail.com>
244
245 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
246 outside class body.
247 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
248
249 2015-06-11 Cary Coutant <ccoutant@gmail.com>
250
251 PR gold/17731
252 * layout.cc (corresponding_uncompressed_section_name): New function.
253 (Layout::choose_output_section): Call it.
254 * layout.h (corresponding_uncompressed_section_name): New function.
255 * script-sections.cc (Input_section_info::set_section_name): Check
256 for compressed debug section (.zdebug style).
257
258 2015-06-11 Jing Yu <jingyu@google.com>
259
260 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
261 * testsuite/Makefile.in: Regenerate.
262
263 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
264
265 * gold.h (is_cident): Correct typo.
266
267 2015-06-10 Han Shen <shenhan@google.com>
268 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
269
270 Now fixing for 843419 is fully functional.
271
272 The first part of the erratum fix CL is here -
273 https://sourceware.org/ml/binutils/2015-04/msg00229.html
274
275 * aarch64.cc(global enum): New constants representing stub types.
276 (Stub_template): New POD struct.
277 (Stub_template_repertoire): New class.
278 (Stub_base): New class.
279 (Erratum_stub): New class.
280 (Reloc_stub): Refactored to be a subclass of Stub_base.
281 (Reloc_stub::Stub_type): Removed.
282 (Reloc_stub::offset): Moved to Stub_base.
283 (Reloc_stub::set_offset): Moved to Stub_base.
284 (Reloc_stub::destination_address): Moved to Stub_base.
285 (Reloc_stub::set_destination_address): Moved to Stub_base.
286 (Reloc_stub::reset_destination_address): Moved to Stub_base.
287 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
288 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
289 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
290 (Reloc_stub::write): Moved to Stub_base.
291 (Reloc_stub::invalid_offset): Moved to Stub_base.
292 (Reloc_stub::invalid_address): Moved to Stub_base.
293 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
294 (Reloc_stub::stub_insns_): Moved to Stub_base.
295 (Reloc_stub::offset_): Moved to Stub_base.
296 (Reloc_stub::destination_address_): Moved to Stub_base.
297 (Stub_table::The_aarch64_relobj): New typedef.
298 (Stub_table::The_erratum_stub): New typedef.
299 (Stub_table::The_erratum_stub_less): New typedef.
300 (Stub_table::The_erratum_stub_set): New typedef.
301 (Stub_table::The_erratum_stub_set_iter): New typedef.
302 (Stub_table::empty): Added emptiness testing for erratum stubs.
303 (Stub_table::add_erratum_stub): New method to add an erratum stub.
304 (Stub_table::find_erratum_stub): New method.
305 (Stub_table::find_erratum_stubs_for_input_section): New method.
306 (Stub_table::erratum_stub_address): New method.
307 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
308 (Stub_table::do_addralign): Modified to handle erratum stubs.
309 (Stub_table::erratum_stubs_): New member.
310 (Stub_table::erratum_stub_size_): New member.
311 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
312 (Stub_table::do_write): Modified to handle erratum stubs.
313 (AArch64_relobj::The_erratum_stub): New typedef.
314 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
315 (AArch64_relobj::fix_errata): New method.
316 (Target_aarch64::The_reloc_stub_type): Removed.
317 (Target_aarch64::The_erratum_stub): New typede.
318 (AArch64_relocate_functions::construct_b): New method.
319
320 2015-06-08 Nick Clifton <nickc@redhat.com>
321
322 * po/fr.po: New French Translation.
323
324 2015-06-07 Cary Coutant <ccoutant@gmail.com>
325
326 PR gold/18288
327 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
328 callers. Don't use STT_COMMON to check for common symbols.
329 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
330 symbol that's not in a common section.
331 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
332 common symbols.
333
334 2015-06-04 Cary Coutant <ccoutant@gmail.com>
335
336 PR gold/18200
337 * Makefile.am (diststuff): Add target.
338 * Makefile.in: Regenerate.
339
340 2015-06-04 Cary Coutant <ccoutant@gmail.com>
341
342 PR gold/17498
343 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
344 temporary locals in merge sections.
345 * options.cc (General_options::parse_discard_all): New method.
346 (General_options::parse_discard_locals): New method.
347 (General_options::parse_discard_none): New method.
348 (General_options::General_options): Initialize discard_locals_.
349 * options.h (--discard-all): Convert to special option.
350 (--discard-locals): Likewise.
351 (--discard-none): New option.
352 (General_options::discard_all): New method.
353 (General_options::discard_locals): New method.
354 (General_options::discard_sec_merge): New method.
355 (General_options::Discard_locals): New enum.
356 (General_options::discard_locals_): New data member.
357
358 2015-06-03 Cary Coutant <cary@google.com>
359
360 * script-sections.cc (Script_sections::Script_sections): Initialize
361 segments_created_.
362 (Script_sections::create_note_and_tls_segments): Set flag when
363 segments are created.
364 (Script_sections::expected_segment_count): Count PT_INTERP.
365 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
366 segments are created.
367 * script-sections.h (Script_sections::segments_created_): New data
368 member.
369
370 2015-06-03 Cary Coutant <ccoutant@gmail.com>
371
372 PR gold/15370
373 * script-sections.cc
374 (Output_section_element_input::set_section_addresses): When there
375 are several patterns with no sort spec, put all sections in the same
376 bin.
377 * testsuite/Makefile.am (script_test_12): New testcase.
378 (script_test_12i): New testcase.
379 * testsuite/Makefile.in: Regenerate.
380 * testsuite/script_test_12.t: New test linker script.
381 * testsuite/script_test_12i.t: New test linker script.
382 * testsuite/script_test_12a.c: New test source file.
383 * testsuite/script_test_12b.c: New test source file.
384
385 2015-06-02 Cary Coutant <ccoutant@gmail.com>
386
387 * nacl.h (Sniff_file): Switch parameters to get_view to get an
388 aligned view.
389
390 2015-06-03 Cary Coutant <ccoutant@gmail.com>
391
392 PR gold/17819
393 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
394 separate task to schedule the build id computation.
395 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
396 add Output_file and offset.
397 (Hash_task::run): Get and release the input views.
398 (Hash_task::is_runnable): Always return NULL (always runnable).
399 (Layout::queue_build_id_tasks): Remove.
400 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
401 parameters; use them instead of class members.
402 (Build_id_task_runner::run): New function.
403 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
404 to write_build_id.
405 * layout.h (Layout::queue_build_id_tasks): Remove.
406 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
407 parameters.
408 (Layout::array_of_hashes_): Remove.
409 (Layout::size_of_array_of_hashes_): Remove.
410 (Layout::input_view_): Remove.
411 (Build_id_task_runner): New class.
412 (Close_task_runner::Close_task_runner): Add array_of_hashes and
413 size_of_hashes parameters.
414 (Close_task_runner::array_of_hashes_): New data member.
415 (Close_task_runner::size_of_hashes_): New data member.
416 * testsuite/Makefile.am
417 (flagstest_compress_debug_sections_and_build_id_tree): New test.
418 * testsuite/Makefile.in: Regenerate.
419
420 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
421
422 * merge.cc (get_input_merge_map): Update for data structure change.
423 (get_or_make_input_merge_map): Update for data structure change.
424 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
425 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
426
427 2015-05-16 Alan Modra <amodra@gmail.com>
428
429 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
430 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
431 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
432 (lis_0): Rename from lis_0_0.
433
434 2015-04-29 Cary Coutant <cary@google.com>
435 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
436
437 * gc.h (Garbage_collection::is_section_garbage): Change Object*
438 to Relobj*.
439 (Garbage_collection::add_reference): Likewise.
440 (Garbage_collection::gc_process_relocs): Likewise. Don't push
441 object/shndx pair onto *secvec for dynamic objects. Don't follow
442 relocations pointing to dynamic objects for GC.
443 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
444 (Icf::unfold_section): Likewise.
445 (Icf::is_section_folded): Likewise.
446 (Icf::get_folded_section): Likewise.
447 * icf.h: (Icf::get_folded_section): Likewise.
448 (Icf::unfold_section): Likewise.
449 (Icf::is_section_folded): Likewise.
450 (Icf::section_has_function_pointers): Likewise.
451 (Icf::set_section_has_function_pointers): Likewise.
452 * object.h (Section_id): Likewise.
453 (Const_section_id): Likewise.
454 * output.cc (Output_section::update_section_layout): Likewise.
455 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
456 Likewise.
457 * plugin.cc (update_section_order): Likewise.
458 (unique_segment_for_sections): Likewise.
459 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
460 (Target_powerpc::do_gc_add_reference): Likewise.
461 (Target_powerpc::gc_process_relocs): Likewise.
462 (Target_powerpc::do_gc_add_reference): Likewise.
463 * symtab.cc (Symbol_table::is_section_folded): Likewise.
464 (Symbol_table::gc_mark_symbol): Likewise.
465 * symtab.h: (Symbol_table::is_section_folded): Likewise.
466 * target.h: (Sized_target::gc_add_reference): Likewise.
467 (Sized_target::do_gc_add_reference): Likewise.
468
469 2015-04-29 Nick Clifton <nickc@redhat.com>
470
471 * po/fi.po: Updated Finnish translation.
472
473 2015-04-28 Alan Modra <amodra@gmail.com>
474
475 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
476 than unsigned int for find_global_entry result temp. Compare
477 against invalid_address.
478 (Target_powerpc::do_plt_address_for_global): Likewise.
479 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
480 on plt call stub existence for debug info. Do assert for plt
481 and global entry stub existence if an alloc section.
482
483 2015-04-28 Alan Modra <amodra@gmail.com>
484
485 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
486 on missing global entry stub due to bogus debug info.
487
488 2015-04-27 Han Shen <shenhan@google.com>
489
490 * options.h (--fix-cortex-a53-843419): Rename option.
491 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
492 option.
493 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
494
495 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
496
497 PR gold/18327
498 * output.cc (Output_section::is_input_address_mapped): Assume a missing
499 entry is mapped.
500 * testsuite/Makefile.am: Add the eh_test test.
501 * testsuite/Makefile.in: Regenerate.
502 * testsuite/eh_test_a.cc: New test.
503 * testsuite/eh_test_b.cc: New test.
504
505 2015-04-23 Sriraman Tallam <tmsriram@google.com>
506
507 * options.h (--weak-unresolved-symbols): New option.
508 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
509 binding to weak with new option.
510 * symtab.h (is_weak_undefined): Check for new option.
511 (is_strong_undefined): Check for new option.
512 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
513 * testsuite/Makefile.in: Regenerate.
514 * testsuite/weak_unresolved_symbols_test.cc: New file.
515
516 2015-04-20 Ian Coolidge <icoolidge@google.com>
517
518 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
519 GNU_UNIQUE.
520
521 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
522
523 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
524 push_back.
525 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
526 * object.cc (Sized_relobj_file::do_layout): Use push_back.
527 * powerpc.cc (process_gc_mark): Use push_back.
528 (Target_powerpc::do_gc_mark_symbol): Use push_back.
529 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
530
531 2015-04-16 Han Shen <shenhan@google.com>
532
533 * aarch64.cc (AArch64_insn_utilities): New utility class.
534 (AArch64_relobj::Mapping_symbol_position): New struct.
535 (AArch64_relobj::Mapping_symbol_info): New typedef.
536 (AArch64_relobj::do_count_local_symbols): New function overriding
537 parent's implementation.
538 (AArch64_relobj::mapping_symbol_info_): New member
539 (AArch64_relobj::scan_erratum_843419): New method.
540 (Target_aarch64::scan_erratum_843419_span): New method.
541 (Target_aarch64::is_erratum_843419_sequence): New method.
542 * options.h (fix_cortex_a53): New option.
543
544 2015-04-09 Cary Coutant <ccoutant@google.com>
545
546 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
547 in a PIE link.
548 * testsuite/Makefile.am (tls_pie_test.sh): New test.
549 * testsuite/Makefile.in: Regenerate.
550 * testsuite/tls_pie_test.sh: New.
551
552 2015-04-09 Cary Coutant <ccoutant@google.com>
553
554 * debug.h (DEBUG_LOCATION): New.
555 (DEBUG_ALL): Include DEBUG_LOCATION.
556 (debug_string_to_enum): Add DEBUG_LOCATION.
557 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
558 output to print correct context.
559 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
560 up to 4 more locations at the beginning of the function.
561 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
562 result before sorting list of line numbers.
563 * testsuite/debug_msg.sh: Allow range of line numbers for
564 canonical results on optimized code.
565
566 2015-04-07 HC Yen <hc.yen@mediatek.com>
567
568 Add AArch32 support for gold linker.
569 gold/
570 * arm.cc: Add V8 arch combine table.
571
572 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
573
574 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
575
576 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
577
578 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
579 to find by using the return value of insert.
580
581 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
582
583 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
584 constructor call.
585
586 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
587
588 PR gold/17641
589 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
590 (Target_x86_64::Scan::local): Don't create GOT entry, when we
591 can convert mov to lea.
592 (Target_x86_64::Scan::global): Ditto.
593 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
594 %reg to lea foo(%rip), %reg if possible.
595 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
596 * testsuite/x86_64_mov_to_lea1.s: New.
597 * testsuite/x86_64_mov_to_lea2.s: Ditto.
598 * testsuite/x86_64_mov_to_lea3.s: Ditto.
599 * testsuite/x86_64_mov_to_lea4.s: Ditto.
600 * testsuite/x86_64_mov_to_lea.sh: Ditto.
601
602 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
603
604 * configure: Regenerated.
605
606 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
607
608 PR gold/17640
609 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
610 (Target_i386::Scan::local): Don't create GOT entry, when we
611 can convert GOT to GOTOFF.
612 (Target_i386::Scan::global): Ditto.
613 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
614 lea foo@GOTOFF(%reg), %reg if possible.
615 * testsuite/Makefile.am (i386_mov_to_lea): New test.
616 * testsuite/i386_mov_to_lea1.s: New.
617 * testsuite/i386_mov_to_lea2.s: Ditto.
618 * testsuite/i386_mov_to_lea3.s: Ditto.
619 * testsuite/i386_mov_to_lea4.s: Ditto.
620 * testsuite/i386_mov_to_lea5.s: Ditto.
621 * testsuite/i386_mov_to_lea.sh: Ditto.
622
623 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
624
625 * Makefile.am (ZLIB): New.
626 (ZLIBINC): Likewise.
627 (AM_CFLAGS): Add $(ZLIBINC).
628 (AM_CXXFLAGS): Likewise.
629 (ldadd_varldadd_var): Add $(ZLIB).
630 (incremental_dump_LDADD): Likewise.
631 (dwp_LDADD): Likewise.
632 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
633 <zlib.h>.
634 (zlib_compress): Don't check HAVE_ZLIB_H.
635 (zlib_decompress): Likewise.
636 * options.h (compress_debug_sections): Likewise.
637 * configure.ac (AM_CONDITIONAL): Removed.
638 * testsuite/Makefile.am (ZLIB): New.
639 (LDADD): Add $(ZLIB).
640 Don't check HAVE_ZLIB.
641 * Makefile.in: Regenerated.
642 * config.in: Likewise.
643 * configure: Likewise.
644 * testsuite/Makefile.in: Likewise.
645
646 2015-03-30 Jing Yu <jingyu@google.com>
647
648 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
649 TLSLD_ADD_DTPREL_LO12_NC.
650 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
651 _TLS_MODULE_BASE_ point to the start of tls segment.
652 (Target_aarch64::optimize_tls_reloc): Add cases for
653 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
654 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
655 (Target_aarch64::Scan::local): Likewise.
656 (Target_aarch64::Scan::global): Likewise.
657 (Target_aarch64::Relocate::relocate): Likewise.
658 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
659 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
660 relocations.
661
662 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
663
664 * merge.cc (Object_merge_map::add_mapping): call
665 Object_merge_map::Input_merge_map::add_mapping.
666 (Object_merge_map::Input_merge_map::add_mapping): New.
667 (Output_merge_data::do_add_input_section): Call
668 get_or_make_input_merge_map before a loop.
669 (Output_merge_string<Char_type>::finalize_merged_data): Call
670 get_or_make_input_merge_map before a loop.
671 * merge.h (Object_merge_map): Make Input_merge_map public.
672 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
673 (Relobj::get_or_create_merge_map): New.
674 * object.h (Relobj::get_or_create_merge_map): New.
675
676 2015-03-24 Alan Modra <amodra@gmail.com>
677
678 PR 18147
679 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
680 relocation errors for branches to strong undefined symbols.
681
682 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
683
684 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
685 (Object_merge_map::is_merge_section_for): Remove.
686 (Object_merge_map::find_merge_section): New.
687 * merge.h (Object_merge_map::is_merge_section_for): Remove.
688 (Object_merge_map::find_merge_section): New.
689 (Object_merge_map::get_input_merge_map): Add a const version.
690 * object.cc (Relobj::is_merge_section_for): Remove.
691 (Relobj::find_merge_section): New.
692 * object.h (Relobj::is_merge_section_for): Remove.
693 (Relobj::find_merge_section): New.
694 * output.cc
695 (Output_section::Input_section::is_merge_section_for): Remove.
696 (Output_section::add_merge_input_section): Don't call
697 add_merge_input_section.
698 (Output_section::find_merge_section): Return const. Use
699 object->find_merge_section.
700 (Output_section::build_lookup_maps): Don't build a map for
701 merge sections.
702 (Output_section::is_input_address_mapped): Return false if
703 section is not found.
704 (Output_section::find_starting_output_address): Use
705 find_merge_section instead of is_merge_section_for.
706 (Output_section::add_script_input_section): Don't build a map for
707 merge sections.
708 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
709 (Output_section_lookup_maps::find_merge_section): Remove.
710 (Output_section_lookup_maps::add_merge_input_section) Remove.
711 (Output_section::find_merge_section): Return const.
712
713 2015-03-22 Cary Coutant <cary@google.com>
714
715 PR gold/18106
716 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
717 non-SIB form of lea, with nop after the call.
718
719 2015-03-21 Cary Coutant <cary@google.com>
720
721 PR gold/14217
722 * output.cc (Output_segment::is_first_section_relro): Don't ignore
723 .tdata section.
724 (Output_segment::set_section_addresses): Don't align size of relro
725 segment for .tbss.
726
727 2015-03-21 Cary Coutant <cary@google.com>
728
729 PR gold/18010
730 * stringpool.cc (Stringpool_template): Don't optimize if section
731 alignment is greater than sizeof(char).
732
733 2015-03-21 Cary Coutant <cary@google.com>
734
735 PR gold/18048
736 * script-c.h (script_include_directive): Add first_token parameter.
737 * script.cc (script_include_directive): Add first_token parameter, and
738 pass it to read_script_file.
739 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
740 (PARSING_MEMORY_DEF): New tokens.
741 (top): Add new productions for INCLUDE files.
742 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
743 Pass PARSING_LINKER_SCRIPT to script_include_directive.
744 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
745 (section_cmd): Pass PARSING_SECTION_CMDS.
746 (file_or_sections_cmd): Remove.
747 (memory_def): Pass PARSING_MEMORY_DEF.
748 * testsuite/Makefile.am (memory_test_2): New test.
749 * testsuite/Makefile.in: Regenerate.
750 * testsuite/memory_test_inc.t: New script file.
751 * testsuite/memory_test_inc_1.t.src: New script file.
752 * testsuite/memory_test_inc_2.t.src: New script file.
753 * testsuite/memory_test_inc_3.t.src: New script file.
754
755 2015-03-21 Cary Coutant <cary@google.com>
756
757 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
758 (Sized_relobj_dwo::setup): Build compressed section map.
759 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
760 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
761 section map.
762 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
763 compressed_sections_ field.
764 (build_compressed_section_map): Take Object instead of
765 Sized_relobj_file parameter; add decompress_if_needed parameter.
766 (Sized_relobj_file::do_find_special_sections): Store compressed
767 section map in parent Object.
768 (Sized_relobj_file::do_decompressed_section_contents): Move
769 implementation to Object::decompressed_section_contents.
770 (Sized_relobj_file::do_discard_decompressed_sections): Move
771 implementation to Object::discard_decompressed_sections.
772 * object.h (build_compressed_section_map): Declare.
773 (Object::Object): Add compressed_sections_ field.
774 (Object::section_is_compressed): Move implementation here.
775 (Object::decompressed_section_contents): De-virtualize.
776 (Object::discard_decompressed_sections): De-virtualize.
777 (Object::do_section_is_compressed): Delete.
778 (Object::do_decompressed_section_contents): Delete.
779 (Object::set_compressed_sections): New method.
780 (Object::compressed_sections): New method.
781 (Object::compressed_sections_): New data member.
782 (Compressed_section_info, Compressed_section_map): Move to top of file.
783 (Sized_relobj_file::do_section_is_compressed): Delete.
784 (Sized_relobj_file::do_decompressed_section_contents): Delete.
785 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
786 (Sized_relobj_file::compressed_sections_): Move to Object class.
787
788 2015-03-21 Cary Coutant <ccoutant@google.com>
789
790 PR gold/18152
791 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
792 deferred objects.
793
794 2015-03-11 Cary Coutant <ccoutant@google.com>
795
796 * options.cc (General_options::finalize): Don't allow -z relro
797 with incremental linking.
798 * testsuite/Makefile.am (incremental_test): Add -z norelro.
799 (incremental_test_2): Likewise.
800 (incremental_test_3): Likewise.
801 (incremental_test_4): Likewise.
802 (incremental_test_5): Likewise.
803 (incremental_test_6): Likewise.
804 (incremental_copy_test): Likewise.
805 (incremental_common_test_1): Likewise.
806 (incremental_comdat_test_1): Likewise.
807 * testsuite/Makefile.in: Regenerate.
808
809 2015-03-09 Cary Coutant <ccoutant@google.com>
810
811 PR gold/14675
812 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
813 return enum indicating whether .eh_frame section is empty, optimizable,
814 unrecognized, or an end marker. Adjust explicit instantiations.
815 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
816 (Eh_frame::add_ehframe_input_section): Change return type.
817 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
818 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
819 to the .eh_frame output section until we see the end marker.
820 (Layout::finalize_eh_frame_section): New.
821 * layout.h: (Layout::finalize_eh_frame_section): New.
822
823 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
824
825 * output.cc (Relobj::initialize_input_to_output_map<size>):
826 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
827
828 2015-03-04 Cary Coutant <ccoutant@google.com>
829
830 * parameters.cc (Parameters::set_target_once): Call
831 Target::select_as_default_target just once from here...
832 (set_parameters_target): ...instead of from here.
833
834 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
835
836 * ehframe.cc (Cie::set_output_offset): Pass in and use a
837 Output_section_data instead of a Merge_map.
838 (Eh_frame::Eh_frame): Don't initialize merge_map_.
839 (Eh_frame::read_cie): Use add_merge_mapping instead of
840 Merge_map::add_mapping.
841 (Eh_frame::read_fde): Ditto.
842 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
843 (Eh_frame::do_output_offset): Use merge_output_offset istead of
844 merge_map_->get_output_offset.
845 (Eh_frame::do_is_merge_section_for): Delete.
846 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
847 instead of a Merge_map.
848 (Cie::set_output_offset): Pass in a Output_section_data instead of a
849 Merge_map.
850 (Eh_frame::do_is_merge_section_for): Delete.
851 (Eh_frame::merge_map_): Delete.
852 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
853 and use a Output_section_data instead of a Merge_map.
854 (Object_merge_map::add_mapping): Ditto.
855 (Object_merge_map::get_output_offset): Remove the merge_map argument.
856 (Object_merge_map::is_merge_section_for): Pass in and use a
857 Output_section_data instead of a Merge_map.
858 (Merge_map): Delete.
859 (Output_merge_base::do_output_offset): Use merge_output_offset instead
860 of merge_map_.get_output_offset.
861 (Output_merge_base::do_is_merge_section_for): Delete.
862 (Output_merge_data::do_add_input_section): Use
863 object->add_merge_mapping instead of add_mapping.
864 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
865 * merge.h (Merge_map): Delete forward declaration.
866 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
867 instead of a Merge_map.
868 (Object_merge_map::get_output_offset): Remove the merge_map argument.
869 (Object_merge_map::is_merge_section_for): Pass in and use a
870 Output_section_data instead of a Merge_map.
871 (Input_merge_map::Object_merge_map::merge_map): Replace with
872 output_data.
873 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
874 Output_section_data instead of a Merge_map.
875 (Merge_map): Delete.
876 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
877 (Output_merge_base::do_is_merge_section_for): Delete.
878 (Output_merge_base::add_mapping): Delete.
879 (Output_merge_base::merge_map_): Delete.
880 * object.cc (Relobj::initialize_input_to_output_map): New.
881 (Relobj::initialize_input_to_output_map): New.
882 (Relobj::merge_output_offset): New.
883 (Relobj::is_merge_section_for): New.
884 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
885 bits.
886 * object.h (Relobj::merge_map): Delete.
887 (initialize_input_to_output_map): New.
888 (set_merge_map): Delete.
889 (add_merge_mapping): New.
890 (merge_output_offset): New.
891 (is_merge_section_for): New.
892 * output.cc (Output_section::Input_section::is_merge_section_for):
893 Use object->is_merge_section_for.
894 * output.h (Output_section_data::is_merge_section_for): Delete.
895 (Output_section_data::do_is_merge_section_for): Delete.
896 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
897 Use object->initialize_input_to_output_map.
898 (Merged_symbol_value<size>::value_from_output_section): Use
899 object->merge_output_offset.
900
901 2015-03-02 Peter Collingbourne <pcc@google.com>
902 Cary Coutant <ccoutant@google.com>
903
904 * output.cc (Output_section::add_merge_input_section): Do not
905 attempt to merge sections with an entsize of 0.
906
907 2015-03-02 Khem Raj <raj.khem@gmail.com>
908
909 * attributes.h (class Output_attributes_section_data ): Add
910 do_print_to_mapfile function.
911
912 2015-02-24 Alan Modra <amodra@gmail.com>
913
914 PR 18010
915 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
916 complain if value is not a multiple of four.
917 (Target_powerpc::Relocate::relocate): Correct handling of
918 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
919
920 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
921
922 * configure.ac (default_size): Set to 32 for x32.
923 * configure: Regenerated.
924
925 2015-02-18 Alan Modra <amodra@gmail.com>
926
927 PR 17954
928 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
929 visibility.
930
931 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
932
933 * gc.h (Garbage_collection::add_reference): Don't use find.
934
935 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
936
937 * object.cc (write_local_symbols): avoid std::vector copy.
938
939 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
940
941 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
942
943 2015-02-09 Mark Wielaard <mjw@redhat.com>
944
945 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
946 DW_LANG_Fortran03 and DW_LANG_Fortran08.
947
948 2015-02-16 Cary Coutant <ccoutant@google.com>
949
950 PR gold/13577
951 PR gold/16992
952 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
953 DF_SYMBOLIC if --dynamic-list option is used.
954 * options.cc (General_options::finalize): --dynamic-list is not
955 mutually exclusive with -Bsymbolic.
956 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
957 listed in --dynamic-list.
958 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
959 -Bsymbolic-functions.
960 * testsuite/Makefile.in: Regenerate.
961
962 2015-02-16 Cary Coutant <ccoutant@google.com>
963
964 PR gold/17971
965 * incremental.cc: Remove redundant include of "output.h".
966
967 2015-02-12 Jing Yu <jingyu@google.com>
968
969 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
970 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
971 New relocation.
972 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
973 TLSLE_MOVW_* relocations.
974 (Target_aarch64::Scan::global): Likewise.
975 (Target_aarch64::Relocate::relocate): Likewise.
976 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
977 for new TLSLE_MOVW_* relocations.
978
979 2015-02-11 Will Newton <will.newton@linaro.org>
980
981 PR gold/13321
982 * arm.cc (Target_arm::make_plt_section): Create an ARM
983 state mapping symbol at the start of the PLT.
984
985 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
986
987 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
988 Replace two_file_shared_2.so with two_file_shared_1.so.
989 * testsuite/Makefile.in: Regenerated.
990
991 2015-02-09 Alan Modra <amodra@gmail.com>
992
993 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
994 plugin_test_thin.a and defsym_test.
995 * testsuite/Makefile.in: Regenerate.
996
997 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
998
999 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1000 body.
1001
1002 2015-02-04 Peter Collingbourne <pcc@google.com>
1003
1004 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1005 forwarding symbols when computing symbol resolution info for plugins.
1006 * plugin.h (Plugin_manager::symtab): New method.
1007 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1008
1009 2015-02-03 Cary Coutant <ccoutant@google.com>
1010 Peter Collingbourne <pcc@google.com>
1011
1012 PR gold/15660
1013 * archive.cc (Thin_archive_object_unlocker): New class.
1014 (Archive::include_member): Unlock external members of thin archives.
1015 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1016 (plugin_test_2): Likewise.
1017 (plugin_test_3): Likewise.
1018 (plugin_test_4): Likewise.
1019 (plugin_test_5): Likewise.
1020 (plugin_test_6): Likewise.
1021 (plugin_test_7): Likewise.
1022 (plugin_test_8): Likewise.
1023 (plugin_test_9): Likewise.
1024 (plugin_test_10): Likewise.
1025 (plugin_test_11): New test case.
1026 * testsuite/Makefile.in: Regenerate.
1027 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1028 file to decide whether to claim file.
1029 (all_symbols_read_hook): Likewise.
1030 * testsuite/plugin_test_1.sh: Adjust expected output.
1031 * testsuite/plugin_test_2.sh: Likewise.
1032 * testsuite/plugin_test_3.sh: Likewise.
1033 * testsuite/plugin_test_6.sh: Likewise.
1034 * testsuite/plugin_test_tls.sh: Likewise.
1035 * testsuite/plugin_test_11.sh: New testcase.
1036
1037 2015-02-03 Cary Coutant <ccoutant@google.com>
1038
1039 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1040 file descriptors when debugging enabled. Add debug output.
1041 (Descriptors::release): Add debug output.
1042 (Descriptors::close_some_descriptor): Likewise.
1043 (Descriptors::close_all): Likewise.
1044 * fileread.cc (File_read::lock): Likewise.
1045 (File_read::unlock): Likewise.
1046
1047 2015-02-02 Cary Coutant <ccoutant@google.com>
1048
1049 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1050 executable output file.
1051
1052 2015-01-22 Han Shen <shenhan@google.com>
1053
1054 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1055 (Target_arm::do_plt_address_for_global): New method.
1056 (Target_arm::do_plt_address_for_local): New method.
1057 (Target_arm::rel_irelative_section): New method.
1058 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1059 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1060 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1061 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1062 (Target_arm::Scan::check_non_pic): Add ifunc support.
1063 (Target_arm::Scan::local): Add ifunc support.
1064 (Target_arm::Scan::global): Add ifunc support.
1065 (Target_arm::make_plt_section): New method.
1066 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1067 (Target_arm::make_local_ifunc_plt_entry): New method.
1068 (Target_arm::got_irelative_): New member.
1069 (Target_arm::rel_irelative_): New member.
1070 (Target_arm::got_section): Add creation for got_irelative_.
1071 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1072 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1073 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1074 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1075 (Output_data_plt_arm::IRelative_data): New type.
1076 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1077 (Output_data_plt_arm::add_entry): Add more parameters.
1078 (Output_data_plt_arm::add_relocation): New method.
1079 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1080 (Output_data_plt_arm::rel_irelative): New method.
1081 (Output_data_plt_arm::entry_count): Modified.
1082 (Output_data_plt_arm::address_for_global): New method.
1083 (Output_data_plt_arm::address_for_local): New method.
1084 gold/
1085 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1086 (Output_data_plt_arm::insert_irelative_data): New method.
1087 (Output_data_plt_arm::irelative_rel_): New member.
1088 (Output_data_plt_arm::got_): New member.
1089 (Output_data_plt_arm::got_irelative_): New member.
1090 (Output_data_plt_arm::irelative_count_): New member.
1091 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1092 (Output_data_plt_arm::irelative_data_vec_): New member.
1093 (Output_data_plt_arm::do_write): Write out irelative entries.
1094 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1095 more parameters to ctor.
1096 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1097 more parameters to ctor.
1098 * output.h (Output_data_reloc::add_local_relative): New method.
1099 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1100
1101 2015-01-29 Alan Modra <amodra@gmail.com>
1102
1103 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1104 and GOT_TLSGD to LE optimization.
1105
1106 2015-01-28 Cary Coutant <ccoutant@google.com>
1107
1108 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1109 for undef TLS symbols.
1110 (Target_x86_64::Relocate::relocate_tls): Likewise.
1111 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1112
1113 2015-01-25 Cary Coutant <ccoutant@google.com>
1114
1115 * output.cc (Output_segment::set_section_addresses): Fix calculation
1116 of size of relro segment.
1117
1118 2015-01-22 Alan Modra <amodra@gmail.com>
1119
1120 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1121 condition for need of ifunc plt entry.
1122 (Target_powerpc::Scan::global <got relocs>): Likewise.
1123
1124 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1125
1126 * mips.cc (reloc_high): Add r_sym.
1127 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1128 reloc_high constructor.
1129 (Mips_relocate_functions::relgot16_local): Likewise.
1130 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1131 r_type to decide whether LO16 matches HI16.
1132 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1133 rello16 and relgot16_local.
1134
1135 2015-01-09 Cary Coutant <ccoutant@google.com>
1136
1137 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1138 unless alignment is larger than page size.
1139
1140 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1141 Cary Coutant <ccoutant@google.com>
1142
1143 PR gold/17729
1144 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1145 (DEFAULT_TARGET_X32): Set for x32.
1146 * x86_64.cc (cmp_insn_32): New.
1147 (lea_r10_insn_32): Likewise.
1148 (lea_r11_insn_32): Likewise.
1149 (cmp_insn_64): Likewise.
1150 (lea_r10_insn_64): Likewise.
1151 (lea_r11_insn_64): Likewise.
1152 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1153 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1154 (check_DATA): Add split_x32 files.
1155 (split_x32_[1234n].o): New targets.
1156 (split_x32_[124]): New targets.
1157 (split_x32_[1234r].stdout): New targets.
1158 * testsuite/split_x32.sh: New file.
1159 * testsuite/split_x32_1.s: Likewise.
1160 * testsuite/split_x32_2.s: Likewise.
1161 * testsuite/split_x32_3.s: Likewise.
1162 * testsuite/split_x32_4.s: Likewise.
1163 * testsuite/split_x32_n.s: Likewise.
1164 * configure: Regenerated.
1165 * testsuite/Makefile.in: Likewise.
1166
1167 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1168
1169 PR gold/17809
1170 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1171 x32.
1172
1173 2015-01-02 Alan Modra <amodra@gmail.com>
1174
1175 * version.cc (print_version): Just print current year.
1176 * dwp.cc (print_version): Likewise.
1177
1178 2015-01-01 Alan Modra <amodra@gmail.com>
1179
1180 Update year range in copyright notice of all files.
1181
1182 2014-12-25 Alan Modra <amodra@gmail.com>
1183
1184 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1185 new enums.
1186 (Target_arm::merge_object_attributes, ): Likewise.
1187
1188 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1189
1190 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1191 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1192 AEABI_VFP_args_vfp to check that.
1193 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1194 value and replace hardcoded values by enum values.
1195
1196 2014-12-22 Cary Coutant <ccoutant@google.com>
1197
1198 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1199
1200 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1201
1202 PR gold/14608
1203 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1204 to "return i * i * 3;".
1205
1206 2014-12-16 Cary Coutant <ccoutant@google.com>
1207
1208 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1209 (Mapfile::print_output_data): Use current_data_size() to avoid
1210 assert for sections requiring postprocessing; if address is not valid,
1211 print 0.
1212 (Mapfile::print_output_section): Use current_data_size(); print note
1213 that addresses and sizes are before compression.
1214
1215 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1216
1217 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1218 Cast current_group_size to unsigned long when reporting error.
1219
1220 2014-12-10 Jing Yu <jingyu@google.com>
1221
1222 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1223 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1224 Update error message.
1225 (Target_aarch64::do_relax): Use absolute value of option
1226 stub_group_size. Replace local variable with class member
1227 stub_group_size_.
1228
1229 2014-12-04 Alan Modra <amodra@gmail.com>
1230
1231 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1232 addend of PLTREL24 reloc when not generating a plt stub. Make
1233 max_branch_offset an "Address".
1234 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1235 (Target_powerpc::Relocate::relocate): Likewise.
1236
1237 2014-12-04 Alan Modra <amodra@gmail.com>
1238
1239 PR 17670
1240 * symtab.cc (Symbol::set_undefined): Remove assertion.
1241 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1242 on symbols defined in discarded sections, instead return false.
1243 Rearrange params, update all callers.
1244 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1245 branches to syms in discarded sections.
1246 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1247 undefined and flag as discarded.
1248 (Target_powerpc::Relocate::relocate): Localize variable.
1249
1250 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1251
1252 PR gold/17675
1253 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1254 * testsuite/Makefile.in: Regenerated.
1255
1256 2014-12-03 Alan Modra <amodra@gmail.com>
1257
1258 PR 17566
1259 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1260 when adding dynamic relocations against section symbols.
1261
1262 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1263
1264 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1265 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1266 * options.h (General_options): New -z option (global).
1267
1268 2014-12-01 Cary Coutant <ccoutant@google.com>
1269
1270 PR gold/17578
1271 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1272 is given.
1273 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1274 given but some inputs require executable stack.
1275
1276 2014-11-26 Cary Coutant <ccoutant@google.com>
1277
1278 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1279 .debug_str_offsets; strip .debug_gnu_pubnames and
1280 .debug_gnu_pubtypes.
1281 (lines_only_debug_sections): Strip all four new sections.
1282
1283 2014-11-26 Jing Yu <jingyu@google.com>
1284
1285 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1286 register to be x0 when to relax TLSDESC_LD64_LO12.
1287
1288 2014-11-26 Alan Modra <amodra@gmail.com>
1289
1290 * powerpc.cc (struct Stub_table_owner): New.
1291 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1292 unsigned int vector. Update all references.
1293 (powerpc_relobj::set_stub_table): Take an unsigned int param
1294 rather than a Stub_table. Update callers.
1295 (Powerpc_relobj::clear_stub_table): New function.
1296 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1297 stub_group_size_ vars.
1298 (Target_powerpc::new_stub_table): Delete.
1299 (max_branch_delta): New function, extracted from..
1300 (Target_powerpc::Relocate::relocate): ..here..
1301 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1302 status on whether stub created successfully.
1303 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1304 default sizing to..
1305 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1306 reduce on relax failure.
1307 (Target_powerpc::group_sections): Add "no_size_errors" param.
1308 Use stub_group_size_. Set up group info in a temp vector,
1309 before building Stub_table vector. Account for input sections
1310 possibly already converted to relaxed sections.
1311 (Stub_table::init): Delete. Merge into..
1312 (Stub_table::Stub_table): ..here.
1313 (Stub_table::can_reach_stub): New function.
1314 (Stub_table::add_plt_call_entry): Add "from" parameter and
1315 return true iff stub could be reached.
1316 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1317 param too.
1318 (Stub_table::clear_stubs): Add "all" param.
1319
1320 2014-11-26 Alan Modra <amodra@gmail.com>
1321
1322 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1323 (Target_powerpc::group_sections): Use it.
1324
1325 2014-11-25 Cary Coutant <ccoutant@google.com>
1326
1327 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1328 (Binary_to_elf::write_symbol): Add st_size parameter.
1329 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1330
1331 2014-11-25 Cary Coutant <ccoutant@google.com>
1332
1333 PR gold/17639
1334 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1335 (Sized_relobj_file::do_layout): Handle deferred sections properly
1336 during GC pass 1. Don't add reloc sections to deferred list twice.
1337 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1338 (Sized_relobj_file::is_deferred_layout_): New data member.
1339
1340 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1341
1342 PR gold/17619
1343 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1344 Check PC-relative offset overflow in PLT entry.
1345
1346 2014-11-21 Alan Modra <amodra@gmail.com>
1347
1348 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1349 for undefined weaks.
1350
1351 2014-11-20 Alan Modra <amodra@gmail.com>
1352
1353 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1354 from --stub-group-size parameter divided by 1024.
1355 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1356 template parameter. Update all uses.
1357 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1358 has_stub_value. Set for long branches. Don't report overflow for
1359 branch to undefined weak symbols. Print info message on
1360 overflowing branch to stub.
1361
1362 2014-11-20 Alan Modra <amodra@gmail.com>
1363
1364 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1365
1366 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1367
1368 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1369 entry for R_X86_64_GOTPLT64.
1370 (Target_x86_64<size>::Relocate::relocate): Update comments for
1371 R_X86_64_GOTPLT64.
1372
1373 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1374
1375 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1376 * plugin.h: add lock definition
1377
1378 2014-10-29 Han Shen <shenhan@google.com>
1379 Jing Yu <jingyu@google.com>
1380
1381 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1382 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1383 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1384 Symbol::TLS_REF.
1385 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1386 method.
1387 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1388 (Target_aarch64::tls_ld_to_le): New method.
1389 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1390 for 64bit targets.
1391 (Output_data_plt_aarch64::irelative_rel_): New data member.
1392 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1393 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1394 (Output_data_plt_aarch64::add_relocation): New method.
1395 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1396 offset. Add got_irelative size to got size.
1397 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1398 type string with the new typename.
1399 (AArch64_relocate_functions::update_adr): Replace parameter x with
1400 immed.
1401 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1402 (AArch64_relocate_functions::reloc_common): New method.
1403 (AArch64_relocate_funcsions::rela_general): Extract common part out
1404 into reloc_common method.
1405 (AArch64_relocate_functions::rela_general): Likewise.
1406 (AArch64_relocate_functions::pcrela_general): Likewise.
1407 (AArch64_relocate_functions::adr): New method.
1408 (AArch64_relocate_functions::adrp): Calculate immed before calling
1409 update_adr.
1410 (AArch64_relocate_functions::adrp): Likewise.
1411 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1412 comparing x to 0. Calculate immed from ~x when x < 0.
1413 (Target_aarch64::optimize_tls_reloc): Add new cases for
1414 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1415 TLSLD_MOVW_DTPREL_G0_NC.
1416 (Target_aarch64::possible_function_pointer_reloc): Implement this
1417 method.
1418 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1419 comment.
1420 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1421 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1422 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1423 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1424 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1425 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1426 (Target_aarch64::make_plt_entry): Call add_entry with two more
1427 parameters.
1428 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1429 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1430 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1431 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1432 (Target_aarch64::Relocate::relocate_tls): Add cases for
1433 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1434 TLSLD_MOVW_DTPREL_G0_NC.
1435 * testsuite/icf_safe_so_test.cc: Correct test comment.
1436 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1437
1438 2014-10-22 Alan Modra <amodra@gmail.com>
1439
1440 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1441 thread_starter.
1442
1443 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1444
1445 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1446
1447 2014-10-17 Cary Coutant <ccoutant@google.com>
1448
1449 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1450 Add "typename" keyword.
1451
1452 2014-10-15 Han Shen <shenhan@google.com>
1453 Jing Yu <jingyu@google.com>
1454
1455 Patch for gold aarch64 backend to support relaxation.
1456 * aarch64-reloc.def: Change format.
1457 * aarch64.cc (class Reloc_stub): New class.
1458 (class Stub_table): New class.
1459 (class AArch64_relobj): New class.
1460 (class AArch64_input_section): New class.
1461 (class AArch64_output_section): New class.
1462 (Target_aarch64::new_stub_table): New method.
1463 (Target_aarch64::new_aarch64_input_section): New method.
1464 (Target_aarch64::find_aarch64_input_section): New method.
1465 (Target_aarch64::scan_section_for_stubs): New method.
1466 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1467 (Target_aarch64::relocate_stub): New method.
1468 (Target_aarch64::current_target): New method.
1469 (Target_aarch64::do_make_elf_object): New method.
1470 (Target_aarch64::do_may_relax): New method.
1471 (Target_aarch64::do_relax): New method.
1472 (Target_aarch64::group_sections): New method.
1473 (Target_aarch64::scan_reloc_for_stub): New method.
1474 (Target_aarch64::do_make_output_section): New method.
1475 (Target_aarch64::stub_tables_): New data member.
1476 (Target_aarch64::aarch64_input_section_map_): New data member.
1477 (AArch64_relocate_functions::maybe_apply_stub): New method.
1478
1479 2014-09-30 Cary Coutant <ccoutant@google.com>
1480
1481 PR gold/17432
1482 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1483
1484 2014-09-30 Kito Cheng <kito@0xlab.org>
1485
1486 PR gold/13597
1487 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1488 hash table before sysv-style hash table.
1489
1490 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1491
1492 * options.h (--pic-executable): Add negative to alias to -no-pie.
1493
1494 2014-09-26 Cary Coutant <ccoutant@google.com>
1495
1496 PR gold/16773
1497 * object.cc (Sized_relobj_file): Compute value of section symbols
1498 for TLS sections the same as TLS symbols.
1499
1500 2014-09-25 Cary Coutant <ccoutant@google.com>
1501
1502 PR gold/17432
1503 * resolve.cc (Symbol_table::resolve): Override common placeholder
1504 symbols, but adjust sizes.
1505 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1506 symbols to common lists.
1507
1508 2014-09-24 Alan Modra <amodra@gmail.com>
1509
1510 * po/POTFILES.in: Regenerate.
1511
1512 2014-09-23 Taiju Tsuiki <tzik@google.com>
1513 Cary Coutant <ccoutant@google.com>
1514
1515 PR gold/14860
1516 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1517 on input_sections_blocker.
1518 * layout.cc (Write_sections_task::locks): Unblock
1519 input_sections_blocker_.
1520 * layout.h (Write_sections_task::Write_sections_task): Add
1521 input_sections_blocker.
1522 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1523 to DEPENDENCIES.
1524 * testsuite/Makefile.in: Regenerate.
1525
1526 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1527
1528 * testsuite/Makefile.am (plugin_test_10): New test.
1529 * testsuite/Makefile.in: Regenerate
1530 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1531 * testsuite/plugin_test_10.sh: New file.
1532
1533 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1534
1535 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1536 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1537 during the replacement phase.
1538
1539 2014-09-17 Han Shen <shenhan@google.com>
1540 Jing Yu <jingyu@google.com>
1541
1542 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1543 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1544 * aarch64.cc (Target_aarch64): Add data members
1545 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1546 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1547 constructor.
1548 (Target_aarch64::do_reloc_symbol_index): New method.
1549 (Target_aarch64::do_reloc_addend): New method.
1550 (Target_aarch64::add_tlsdesc_info): New method.
1551 (Target_aarch64::do_dynsym_value): New method.
1552 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1553 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1554 (Target_aarch64::make_data_plt): Add new parameters: got,
1555 got_irelative. Pass them to do_make_data_plt.
1556 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1557 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1558 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1559 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1560 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1561 (Target_aarch64::got_tlsdesc_section): New method.
1562 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1563 (Target_aarch64::define_tls_base_symbol): New method.
1564 (Target_aarch64::reserve_tlsdesc_entries): New method.
1565 (Target_aarch64::got_mod_index_entry): New method.
1566 (Target_aarch64::rela_tlsdesc_section): New method.
1567 (Target_aarch64::rela_irelative_section): New method.
1568 (Target_aarch64::Tlsdesc_info): New struct.
1569 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1570 relocations and tlsdesc relocations.
1571 (Target_aarch64::optimize_tls_reloc): Implement method.
1572 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1573 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1574 in constructor.
1575 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1576 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1577 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1578 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1579 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1580 (Output_data_plt_aarch64::rela_irelative): New method.
1581 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1582 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1583 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1584 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1585 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1586 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1587 (Output_data_plt_aarch64_standard): New member variables:
1588 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1589 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1590 New parameter: got, got_irelative.
1591 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1592 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1593 (Output_data_plt_aarch64::do_write): Replace got_address with
1594 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1595 (AArch64_relocate_functions::update_movnz): New method.
1596 (AArch64_relocate_functions): Correct format.
1597 (AArch64_relocate_functions::movnz): New method.
1598 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1599 before the switch. Add new cases to switch.
1600 Check ie_to_le relaxation on tlsie relocations. Add code handling
1601 tlsgd tlsdesc cases.
1602 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1603 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1604 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1605 Call reloc_name_in_error_message to print unsupported reloc.
1606 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1607 make_data_plt.
1608 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1609 relocs. Fill in some more dynamic tags.
1610 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1611 Skip call tls_get_addr when tlsgd is relaxed.
1612 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1613 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1614 tlsdesc->ie relaxation.
1615
1616 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1617
1618 * mips.cc (Target_mips_nacl): New class.
1619 (Target_selector_mips_nacl): New class.
1620 (target_selector_mips32): Rename from target_selector_mips32be and use
1621 Target_selector_mips_nacl instead of Target_selector_mips.
1622 (target_selector_mips32el): Rename from target_selector_mips32 and use
1623 Target_selector_mips_nacl instead of Target_selector_mips.
1624 (target_selector_mips64): Rename from target_selector_mips64be and use
1625 Target_selector_mips_nacl instead of Target_selector_mips.
1626 (target_selector_mips64el): Rename from target_selector_mips64 and use
1627 Target_selector_mips_nacl instead of Target_selector_mips.
1628 (Target_mips::mips_info): Add const attribute.
1629
1630 2014-09-02 Cary Coutant <ccoutant@google.com>
1631
1632 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1633 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1634 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1635 (Sized_incr_dynobj::do_section_name): Likewise.
1636 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1637 (Sized_incr_dynobj::do_section_name): Likewise.
1638 * object.h (Object::section_name): Likewise.
1639 (Object::do_section_name): Likewise.
1640 (Sized_relobj_file::do_section_name): Likewise.
1641 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1642 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1643
1644 2014-09-02 Cary Coutant <ccoutant@google.com>
1645
1646 PR gold/17005
1647 * ehframe.cc (Fde::write): Add output_offset parameter.
1648 (Cie::write): Likewise.
1649 (Eh_frame::set_final_data_size): Account for offset within output
1650 section.
1651 (Eh_frame::do_sized_write): Likewise.
1652 * ehframe.h (Fde::write): Add output_offset parameter.
1653 (Cie::write): Likewise.
1654 * output.cc (Output_section::Input_section_sort_entry): Remove
1655 section_has_name_; add output_section_name parameter. Use
1656 output section name for non-input sections.
1657 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1658 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1659 (Output_section::Input_section_sort_compare): Remove logic for
1660 sections without names.
1661 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1662 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1663 Likewise.
1664 (Output_section::Input_section_sort_section_name_compare): Likewise.
1665
1666 2014-08-29 Han Shen <shenhan@google.com>
1667 Jing Yu <jingyu@google.com>
1668
1669 * aarch64-reloc-property.cc
1670 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1671 reference reloc property in the table.
1672 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1673 3 other entries.
1674 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1675 2 new overloaded methods.
1676 (Output_data_got_aarch64::do_write): Add code to write out
1677 static relocs.
1678 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1679 static relocs.
1680 (Output_data_got_aarch64::static_relocs): New vector to
1681 hold static relocs.
1682 (Target_aarch64::TCB_SIZE): New const static memeber.
1683 (Target_aarch64::tcb_size): New method.
1684 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1685 (Target_aarch64::Relocate::relocate_tls): New method.
1686 (Target_aarch64::Scan::local): Add code handling new reloc types.
1687 (Target_aarch64::Scan::global): Add code handling new reloc types.
1688
1689 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1690
1691 * options.h (-no-pie): Add option.
1692
1693 2014-08-08 Jing Yu <jingyu@google.com>
1694 Han Shen <shenhan@google.com>
1695
1696 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1697 (DEFFILES): add aarch64-reloc.def.
1698 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1699 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1700 * Makefile.in: Regenerate.
1701 * aarch64-reloc-property.cc: New file.
1702 * aarch64-reloc-property.h: New file.
1703 * aarch64-reloc.def: New file.
1704 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1705 with tab to make the format consistent.
1706 (Output_data_got_aarch64::symbol_table_): New method.
1707 (Target_aarch64::do_plt_address_for_global): New method.
1708 (Target_aarch64::do_plt_address_for_local): New method.
1709 (Target_aarch64::do_select_as_default_target): New method.
1710 (Target_aarch64::do_make_data_plt): New method.
1711 (Target_aarch64::make_data_plt): New method.
1712 (Output_data_plt_aarch64::has_irelative_section): New method.
1713 (Output_data_plt_aarch64::address_for_global): New method.
1714 (Output_data_plt_aarch64::address_for_local): New method.
1715 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1716 (Output_data_plt_aarch64::add_entry): Implement contents.
1717 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1718 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1719 the got_pov entry to plt0.
1720 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1721 Implement contents.
1722 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1723 (AArch64_howto): New struct.
1724 (aarch64_howto[]): New static const array.
1725 (AArch64_relocate_functions): New class.
1726 (Target_aarch64::Scan::get_reference_flags): Remove method.
1727 (Target_aarch64::Scan::local): Implement to support a few relocations.
1728 (Target_aarch64::Scan::global): Implement to support a few relocations.
1729 (Target_aarch64::make_plt_section): Implement contents.
1730 (Target_aarch64::make_plt_entry): Implement contents.
1731 (Target_aarch64::do_finalize_sections): Implement contents.
1732 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1733 (Target_aarch64::relocate_section): Implement contents.
1734
1735 2014-08-06 Alan Modra <amodra@gmail.com>
1736
1737 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1738
1739 2014-08-06 Alan Modra <amodra@gmail.com>
1740
1741 PR 13227
1742 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1743
1744 2014-07-21 Sriraman Tallam <tmsriram@google.com>
1745
1746 * object.cc (Relobj::is_section_name_included): Add
1747 ".rodata.nptl_version" to not garbage collect this section.
1748
1749 2014-07-08 Cary Coutant <ccoutant@google.com>
1750
1751 * expression.cc (struct Expression::Expression_eval_info): Add
1752 new fields type_pointer, vis_pointer, and nonvis_pointer.
1753 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1754 nonvis_pointer parameters. Adjust all calls.
1755 (Symbol_expression::value): Update type, visibility, and nonvis bits
1756 in caller.
1757 * script.cc (Symbol_assignment::sized_finalize): Update type,
1758 visibility, and remaining st_other bits for new symbol.
1759 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1760 vis_pointer, and nonvis_pointer parameters.
1761 * symtab.h (Symbol::set_type): New method.
1762
1763 * testsuite/Makefile.am (defsym_test): New test.
1764 * testsuite/Makefile.in: Regenerate.
1765 * testsuite/defsym_test.c: New file.
1766 * testsuite/defsym_test.sh: New file.
1767
1768 2014-07-08 Cary Coutant <ccoutant@google.com>
1769
1770 PR gold/15639
1771 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1772 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1773 (Sized_dynobj::base_read_symbols): ...new method.
1774 * object.h (Sized_relobj_file::base_read_symbols): New method.
1775 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1776 (Sized_relobj_file::base_read_symbols): ...new method.
1777 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1778 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1779 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1780
1781 2014-07-04 Alan Modra <amodra@gmail.com>
1782
1783 * po/POTFILES.in: Regenerate.
1784
1785 2014-07-02 Jing Yu <jingyu@google.com>
1786
1787 * aarch64.cc: New file
1788 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1789 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1790 * Makefile.in: Regenerate.
1791 * configure.tgt: Add entries for aarch64*.
1792 * configure.ac: Likewise.
1793 * configure: Likewise.
1794
1795 2014-06-27 Alan Modra <amodra@gmail.com>
1796
1797 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1798
1799 2014-06-24 Cary Coutant <ccoutant@google.com>
1800
1801 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1802 sections.
1803 (Dwo_file::sized_read_unit_index): Likewise.
1804
1805 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1806
1807 * mips.cc: New file.
1808 * Makefile.am (TARGETSOURCES): Add mips.cc
1809 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1810 * configure.tgt: Add entries for mips*.
1811 * configure.ac: Likewise.
1812 * Makefile.in: Regenerate.
1813 * configure: Likewise.
1814
1815 2014-06-09 Cary Coutant <ccoutant@google.com>
1816
1817 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1818 unit_length is within section bounds.
1819
1820 2014-06-09 Cary Coutant <ccoutant@google.com>
1821
1822 PR gold/16980
1823 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1824 map.
1825
1826 2014-06-07 Alan Modra <amodra@gmail.com>
1827
1828 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1829
1830 2014-06-06 Cary Coutant <ccoutant@google.com>
1831
1832 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1833 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1834 (Dwarf_pubnames_table::read_header): Likewise.
1835 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1836 .debug_gnu_pubtypes.
1837
1838 2014-06-05 Joel Brobecker <brobecker@adacore.com>
1839
1840 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1841 * Makefile.in, configure: Regenerate.
1842
1843 2014-06-03 Alan Modra <amodra@gmail.com>
1844
1845 * powerpc.cc (addis_12_2): Define.
1846 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1847
1848 2014-06-03 Alan Modra <amodra@gmail.com>
1849
1850 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1851 st_other output.
1852
1853 2014-06-02 Alan Modra <amodra@gmail.com>
1854
1855 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1856 Only ignore relocs on ELFv1.
1857 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1858
1859 2014-05-30 Cary Coutant <ccoutant@google.com>
1860
1861 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1862 * testsuite/Makefile.in: Regenerate.
1863 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1864
1865 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1866
1867 PR gold/16945
1868 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1869 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1870
1871 2014-05-15 Alan Modra <amodra@gmail.com>
1872
1873 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1874 Compare FDE contents with DW_CFA_nop rather than 0.
1875
1876 2014-05-13 Sriraman Tallam <tmsriram@google.com>
1877
1878 * symtab.h (may_need_copy_reloc): Remove check for position independent
1879 code.
1880 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1881 position independence before pc absolute may_need_copy_reloc call.
1882 Add check for executable output befor pc relative may_need_copy_reloc
1883 call.
1884 * i386.cc: Ditto.
1885 * arm.cc: Ditto.
1886 * sparc.cc: Ditto.
1887 * tilegx.cc: Ditto.
1888 * powerpc.cc: Add check for no position independence before
1889 may_need_copy_reloc calls.
1890 * testsuite/pie_copyrelocs_test.cc: New file.
1891 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1892 * Makefile.am (pie_copyrelocs_test): New test.
1893 * Makefile.in: Regenerate.
1894
1895 2014-05-08 Martin Liška <mliska@suse.cz>
1896
1897 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1898
1899 2014-05-06 Cary Coutant <ccoutant@google.com>
1900
1901 PR gold/16900
1902 * i386.cc (Output_data_got_plt_i386): New class.
1903 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1904 parameter. Change all callers.
1905 (Output_data_plt_i386::layout_): Remove.
1906 (Output_data_plt_i386::got_plt_): Change type.
1907 (Target_i386::got_plt_): Change type. Change all references.
1908 (Target_i386::got_section): Create instance of new class.
1909 (Output_data_got_plt_i386::do_write): New function.
1910 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1911 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1912 parameter. Change all callers.
1913 (Output_data_plt_x86_64::layout_): Remove.
1914 (Output_data_plt_x86_64::got_plt_): Change type.
1915 (Target_x86_64::got_plt_): Change type. Change all references.
1916 (Target_x86_64::got_section): Create instance of new class.
1917 (Output_data_got_plt_x86_64::do_write): New function.
1918 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1919 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1920 class.
1921
1922 2014-05-05 Cary Coutant <ccoutant@google.com>
1923
1924 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1925 if we have pubnames/pubtypes.
1926
1927 2014-05-02 Cary Coutant <ccoutant@google.com>
1928
1929 * defstd.cc (in_segment): Define __ehdr_start here...
1930 * layout.cc (Layout::finalize): ...Instead of here. Set the
1931 output segment when known.
1932 * resolve.cc (Symbol::override_base_with_special): Remember
1933 the original binding.
1934 * symtab.cc (Symbol::set_output_segment): New function.
1935 (Symbol::set_undefined): New function.
1936 * symtab.h (Symbol::is_weak_undefined): Check original undef
1937 binding.
1938 (Symbol::is_strong_undefined): New function.
1939 (Symbol::set_output_segment): New function.
1940 (Symbol::set_undefined): New function.
1941 * target-reloc.h (is_strong_undefined): Remove.
1942 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1943 Check for hidden undefs.
1944 (relocate_section): Call Symbol::is_strong_undefined.
1945
1946 * testsuite/Makefile.am (ehdr_start_test_1)
1947 (ehdr_start_test_2, ehdr_start_test_3)
1948 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1949 * testsuite/Makefile.in: Regenerate.
1950 * testsuite/ehdr_start_def.cc: New source file.
1951 * testsuite/ehdr_start_test.cc: New source file.
1952 * testsuite/ehdr_start_test.t: New linker script.
1953 * testsuite/ehdr_start_test_4.sh: New shell script.
1954
1955 2014-04-23 Cary Coutant <ccoutant@google.com>
1956
1957 PR gold/16870
1958 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1959
1960 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1961
1962 * layout.cc (Layout::include_section): Allow a target to decide
1963 whether to include a section.
1964 * target.h (Target::should_include_section): New function.
1965 (Target::do_should_include_section): New function.
1966
1967 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1968
1969 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1970 inline into ...
1971 (Copy_relocs::emit): ... here.
1972 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1973 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1974 (Copy_reloc_entry::entries_): Change from private to protected.
1975
1976 2014-04-02 Sriraman Tallam <tmsriram@google.com>
1977
1978 * icf.cc (get_section_contents): Replace copies of reloc
1979 vectors with const references.
1980
1981 2014-04-02 Cary Coutant <ccoutant@google.com>
1982
1983 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1984 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1985 * configure: Regenerate.
1986 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1987 -fno-use-linker-plugin.
1988 (LINK1, CXXLINK1): Add it to the link command.
1989 * testsuite/Makefile.in: Regenerate.
1990
1991 2014-03-12 Alan Modra <amodra@gmail.com>
1992
1993 * Makefile.in: Regenerate.
1994
1995 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1996
1997 * symtab.h (Symbol::set_nonvis): New function.
1998
1999 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2000
2001 * symtab.cc (Sized_symbol<32>::init_output_data):
2002 Instantiate the template.
2003 (Sized_symbol<64>::init_output_data): Likewise.
2004
2005 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2006
2007 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2008 adjust dynamic symbol value.
2009 * target.h (Target::adjust_dyn_symbol): New function.
2010 (Target::do_adjust_dyn_symbol): New function.
2011
2012 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2013
2014 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2015 Get the value of DYNAMIC_CUSTOM dynamic entry.
2016 * output.h (Output_data_dynamic::add_custom): New function.
2017 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2018 dynamic entry.
2019 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2020 * target.h (Target::dynamic_tag_custom_value): New function.
2021 (Target::do_dynamic_tag_custom_value): New function.
2022
2023 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2024
2025 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2026 dynsym indexes.
2027 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2028 (Target::do_has_custom_set_dynsym_indexes): New function.
2029 (Target::set_dynsym_indexes): New function.
2030 (Target::do_set_dynsym_indexes): New function.
2031
2032 2014-03-07 Alan Modra <amodra@gmail.com>
2033
2034 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2035 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2036 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2037 (Powerpc_relocate_functions::has_overflow_bitfield,
2038 overflowed): Use the above.
2039 (Target_powerpc::Relocate::relocate): Correct overflow checking
2040 for a number of relocations. Modify overflow test for 16-bit
2041 fields in instructions to signed/unsigned according to whether
2042 the field takes a signed or unsigned value.
2043
2044 2014-03-05 Alan Modra <amodra@gmail.com>
2045
2046 Update copyright years.
2047
2048 2014-03-05 Alan Modra <amodra@gmail.com>
2049
2050 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2051 R_PPC64_ADDR64_LOCAL.
2052 (Target_powerpc::Relocate::relocate): Likewise.
2053
2054 2014-03-03 Alan Modra <amodra@gmail.com>
2055
2056 * dwp.cc (print_version): Update copyright year to current.
2057
2058 2014-02-10 Alan Modra <amodra@gmail.com>
2059
2060 * po/gold.pot: Regenerate.
2061
2062 2014-02-06 Cary Coutant <ccoutant@google.com>
2063
2064 Fix problem where -u is ignored when a weak undef is seen.
2065
2066 * archive.cc (Library_base::should_include_member): Reorder
2067 code to check for -u option if a weak undef has already been seen.
2068 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2069 * testsuite/Makefile.in: Regenerate.
2070 * testsuite/weak_undef_file3.cc: New file.
2071 * testsuite/weak_undef_file4.cc: New file.
2072 * testsuite/weak_undef_test_2.cc: New file.
2073
2074 2014-02-05 Cary Coutant <ccoutant@google.com>
2075
2076 Fix issues with gold undefined symbol diagnostics.
2077
2078 PR binutils/15435
2079 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2080 check to here.
2081 * target-reloc.h (is_strong_undefined): New function.
2082 (relocate_section): Move undef vtable symbol check from here.
2083 Check for is_strong_undefined.
2084
2085 2014-02-05 Cary Coutant <ccoutant@google.com>
2086
2087 Fix problems with the --dynamic-list option.
2088
2089 PR gold/13577
2090 * options.cc (General_options::parse_dynamic_list):
2091 Set have_dynamic_list_.
2092 (General_options::General_options): Initialize have_dynamic_list_.
2093 (General_options::finalize): Turn off -Bsymbolic and
2094 -Bsymbolic-functions if --dynamic-list provided.
2095 * options.h (General_options::have_dynamic_list): New function.
2096 (General_options::have_dynamic_list_): New data member.
2097 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2098 correctly.
2099
2100 PR gold/16530
2101 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2102 in --dynamic-list, mark it.
2103
2104 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2105 (dynamic_list_2): New test case.
2106 * testsuite/Makefile.in: Regenerate.
2107 * testsuite/dynamic_list_2.cc: New file.
2108 * testsuite/dynamic_list_2.t: New file.
2109 * testsuite/dynamic_list_lib1.cc: New file.
2110 * testsuite/dynamic_list_lib2.cc: New file.
2111 * testsuite/gc_dynamic_list_test.c: New file.
2112 * testsuite/gc_dynamic_list_test.sh: New file.
2113 * testsuite/gc_dynamic_list_test.t: New file.
2114
2115 2014-01-28 Cary Coutant <ccoutant@google.com>
2116
2117 Add .gdb_index version 7 support.
2118
2119 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2120 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2121 debug sections.
2122 (Dwarf_ranges_table::read_ranges_table): Likewise.
2123 (Dwarf_pubnames_table::read_section): Check for GNU-style
2124 sections, and for compressed debug sections.
2125 (Dwarf_pubnames_table::read_header): Compute end address of table.
2126 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2127 for end of list by offset, not by offset == 0.
2128 (Dwarf_info_reader::do_read_string_table): Check for compressed
2129 debug sections.
2130 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2131 Initialize new data members.
2132 (Dwarf_pubnames_table::next_name): return flag_byte.
2133 (Dwarf_pubnames_table::end_of_table_): New data member.
2134 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2135 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2136 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2137 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2138 read skeleton type unit DIEs.
2139 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2140 (Gdb_index::do_write): Write flag_byte.
2141 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2142 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2143 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2144 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2145
2146 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2147
2148 * version.cc (print_version): Update copyright year to 2014.
2149
2150 2013-12-19 Dimitry Andric <dimitry@andric.com>
2151
2152 * stringpool.cc (Stringpool_template::reserve): Add
2153 HAVE_UNORDERED_MAP case.
2154 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2155
2156 2013-12-18 Cary Coutant <ccoutant@google.com>
2157
2158 * configure.ac: Check for <unordered_set> and <unordered_map>.
2159 * config.in: Regenerate.
2160 * configure: Regenerate.
2161 * system.h: Use <unordered_set> and <unordered_map> if available.
2162
2163 2013-12-10 Roland McGrath <mcgrathr@google.com>
2164
2165 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2166 with $(INSTALL_PROGRAM_ENV).
2167 * Makefile.in: Regenerate.
2168
2169 2013-11-22 Cary Coutant <ccoutant@google.com>
2170
2171 * configure.ac: Add check for which library is needed for
2172 dlopen.
2173 * configure: Regenerate.
2174
2175 2013-11-22 Cary Coutant <ccoutant@google.com>
2176
2177 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2178 assembler.
2179 * testsuite/Makefile.in: Regenerate.
2180
2181 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2182
2183 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2184 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2185 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2186 (Target_x86_64<size>::Scan::local): Likewise.
2187 (Target_x86_64<size>::Scan::global): Likewise.
2188 (Target_x86_64<size>::Relocate::relocate): Likewise.
2189 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2190 Likewise.
2191 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2192 R_X86_64_PC32_BND.
2193
2194 * testsuite/Makefile.am (check_PROGRAMS): Add
2195 exception_x86_64_bnd_test.
2196 (exception_x86_64_bnd_test_SOURCES): New macro.
2197 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2198 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2199 (exception_x86_64_bnd_test_LDADD): Likewise.
2200 (exception_x86_64_bnd_1.o): New rule.
2201 (exception_x86_64_bnd_2.o): Likewise.
2202 * testsuite/Makefile.in: Regenerated.
2203
2204 2013-11-15 Alan Modra <amodra@gmail.com>
2205
2206 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2207 accessor.
2208 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2209 Only call ppc64_local_entry_offset for 64-bit. Restrict
2210 symval_for_branch lookup to ELFv1.
2211 (Stub_table::add_plt_call_entry): Use unsigned int off.
2212 (Output_data_glink::Address, invalid_address): New.
2213 (Output_data_glink::add_eh_frame): Move out of line. Add
2214 support for ELFv2.
2215 (Output_data_glink::add_global_entry, find_global_entry,
2216 global_entry_address): New functions.
2217 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2218 ge_size): New variables.
2219 (Output_data_glink::set_final_data_size): Add global entry
2220 stub sizing.
2221 (Output_data_glink::do_write): Write global entry stubs.
2222 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2223 parameter. Return true for ELFv2. Adjust callers.
2224 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2225 ELFv1. Similarly for ifunc and dynamic relocation processing
2226 specific to ELFv1. Recognize that symbols are defined on
2227 their plt entries for ELFv2.
2228 (Target_powerpc::symval_for_branch): Assert if called for
2229 ELFv2 or ppc32.
2230 (Target_powerpc::Relocate::relocate): Use global entry plt
2231 stub for symbol value if such exists on ELFv2.
2232 (Target_powerpc::Relocate::relocate): Don't call
2233 symval_for_branch when ELFv2. Do adjust for local entry
2234 offset when ELFv2.
2235 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2236 plt stub for ELFv2.
2237 (Target_powerpc::do_plt_address_for_global): Similarly.
2238
2239 2013-11-14 Cary Coutant <ccoutant@google.com>
2240
2241 Revert patch -- this did not fix the problem, and there is
2242 no race there.
2243
2244 2013-11-14 Cary Coutant <ccoutant@google.com>
2245
2246 PR gold/14860
2247 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2248 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2249 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2250 updating fde_offsets_.
2251 (Eh_frame_hdr::lock_): New data member.
2252
2253 2013-11-14 Cary Coutant <ccoutant@google.com>
2254
2255 * dwp.cc (Dwo_file_entry): New type.
2256 (File_list): Use Dwo_file_entry.
2257 (Dwo_file::verify): New function.
2258 (Dwo_file::verify_dwo_list): New function.
2259 (Dwo_file::sized_verify_dwo_list): New function.
2260 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2261 list.
2262 (Dwp_options): New enum type.
2263 (dwp_options): Add --verify-only.
2264 (usage): Likewise.
2265 (main): Likewise.
2266 * dwp.h (gold_info): Add declaration.
2267
2268 2013-11-14 Cary Coutant <ccoutant@google.com>
2269
2270 PR gold/14860
2271 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2272 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2273 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2274 updating fde_offsets_.
2275 (Eh_frame_hdr::lock_): New data member.
2276
2277 2013-11-06 Cary Coutant <ccoutant@google.com>
2278
2279 PR gold/15758
2280 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2281 before reloc sections.
2282
2283 2013-11-04 Alan Modra <amodra@gmail.com>
2284
2285 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2286 (Symbol::needs_dynamic_reloc): Test new flag.
2287 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2288 (Target_powerpc::Scan::get_reference_flags): Add target param.
2289 Return FUNC_DESC_ABI for 64-bit ELFv1.
2290 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2291 call.
2292 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2293 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2294
2295 2013-10-31 Cary Coutant <ccoutant@google.com>
2296
2297 Restore support for dwp v2 DWARF package file format.
2298
2299 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2300 tu_length parameter. Adjust all callers.
2301 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2302 * dwp.cc: Include dwarf.h.
2303 (Section_bounds): New struct type.
2304 (Unit_set): New struct type.
2305 (Dwo_file::Dwo_file): Initialize new data member.
2306 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2307 Combine and rename to...
2308 (Dwo_file::read_unit_index): ...this.
2309 (Dwo_file::sized_read_compunit_index)
2310 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2311 (Dwo_file::sized_read_unit_index): ...this.
2312 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2313 parameters; add section_id parameter.
2314 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2315 (Dwo_file::add_unit_set): ...this.
2316 (Dwo_file::shndx_map_): Remove.
2317 (Dwo_file::sect_offsets_): New data member.
2318 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2319 (Dwp_output_file::add_section): Rename to...
2320 (Dwp_output_file::add_contribution): ...this.
2321 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2322 (Dwp_output_file::add_tu_set): Likewise.
2323 (Dwp_output_file::Contribution): New type.
2324 (Dwp_output_file::Section::contributions): New data member.
2325 (Dwp_output_file::Cu_or_tu_set): Remove.
2326 (Dwp_output_file::Section::Section): New ctor.
2327 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2328 (Dwp_output_file::Dwp_index::Section_table): New type.
2329 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2330 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2331 parameter.
2332 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2333 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2334 (Dwp_output_file::Dwp_index::section_table): New member function.
2335 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2336 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2337 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2338 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2339 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2340 (Dwp_output_file::Dwp_index::section_table_): New data member.
2341 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2342 (Dwp_output_file::add_output_section): New member function.
2343 (Dwp_output_file::write_new_section): New member function.
2344 (Dwp_output_file::write_contributions): New member function.
2345 (Dwp_output_file::section_id_map_): New data member.
2346 (class Dwo_id_info_reader): Remove.
2347 (class Unit_reader): New class.
2348 (get_dwarf_section_name): New function.
2349 (Dwo_file::read_executable): Adjust initializations of class data.
2350 (Dwo_file::read): Add support for v2 package file format.
2351 (Dwo_file::read_unit_index): Likewise.
2352 (Dwo_file::sized_read_unit_index): Likewise.
2353 (Dwo_file::copy_section): Likewise.
2354 (Dwo_file::add_unit_set): Likewise.
2355 (Dwp_output_file::add_output_section): Likewise.
2356 (Dwp_output_file::add_contribution): Likewise.
2357 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2358 for empty slot.
2359 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2360 file format.
2361 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2362 slot.
2363 (Dwp_output_file::initialize): Remove unused function.
2364 (Dwp_output_file::finalize): Add support for v2 package file format.
2365 (Dwp_output_file::write_index): Likewise.
2366 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2367 function prototype.
2368
2369 2013-10-31 Cary Coutant <ccoutant@google.com>
2370
2371 * configure.ac: Fix check for -fmerge-constants.
2372 * configure.ac: Regenerate.
2373
2374 2013-10-30 Roland McGrath <mcgrathr@google.com>
2375
2376 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2377 Correct 9-byte nop sequence to match what the assembler generates.
2378
2379 2013-10-30 Alan Modra <amodra@gmail.com>
2380
2381 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2382 ppc64_local_entry_offset, ppc64_local_entry_offset,
2383 do_read_symbols): New functions.
2384 (Powerpc_relobj::e_flags_, st_other_): New vars.
2385 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2386 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2387 (Powerpc_relobj::e_flags_): New var.
2388 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2389 and adjust for ELFv2.
2390 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2391 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2392 (Powerpc_dynobj::do_find_special_sections): Likewise.
2393 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2394 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2395 to ELFv2 local entry.
2396 (Target_powerpc::do_relax): No thread safe barriers needed for
2397 ELFv2.
2398 (Output_data_plt_powerpc::initial_plt_entry_size_,
2399 plt_entry_size): Delete. Replace all uses with
2400 first_plt_entry_offset() and plt_entry_size().
2401 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2402 reserved_size parm. Update callers.
2403 (Output_data_plt_powerpc::entry_count): Update.
2404 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2405 and use Target_powerpc::first_plt_entry_offset().
2406 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2407 rename to plt_entry_size.
2408 (Output_data_plt_powerpc::add_ifunc_entry,
2409 add_local_ifunc_entry): Adjust reloc for ELFv2.
2410 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2411 (glink_eh_frame_fde_64v2): New.
2412 (Stub_table::plt_call_size): Support ELFv2 sizing.
2413 (Output_data_glink::add_eh_frame): Use the new FDE.
2414 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2415 (Stub_table::do_write): Write ELFv2 stubs and glink.
2416 (Target_powerpc::Relocate::relocate): Replaces nop after call
2417 with ld 2,24(1) and adjust local offset destination for ELFv2.
2418
2419 2013-10-30 Alan Modra <amodra@gmail.com>
2420
2421 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2422 (Target_powerpc::Scan::global, local): Likewise.
2423 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2424 on all ppc64 @h and @ha relocs.
2425
2426 2013-10-14 Alan Modra <amodra@gmail.com>
2427
2428 * output.h (Output_data_got::add_constant): Tidy.
2429 (Output_data_got::add_constant_pair): New function.
2430 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2431 methods used so as to first call reserve_ent().
2432
2433 2013-10-11 Roland McGrath <mcgrathr@google.com>
2434
2435 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2436 add_got_entry and add_got_entry_pair.
2437
2438 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2439 (HAVE_PUBNAMES): Likewise.
2440 * configure: Regenerate.
2441
2442 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2443 * testsuite/Makefile.in: Regenerate.
2444
2445 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2446 Remove const from declaration.
2447 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2448 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2449 * output.h (Output_file_header): Remove const from member target_
2450 and corresponding constructor argument.
2451 * output.cc (Output_file_header::Output_file_header): Update prototype.
2452 (Output_file_header::do_sized_write): Use this->target_ in place
2453 of parameters()->target().
2454
2455 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2456
2457 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2458 * configure: Regenerate.
2459 * Makefile.in: Regenerate.
2460 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2461 * testsuite/merge_string_literals_2.c: Likewise.
2462 * testsuite/Makefile.am
2463 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2464 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2465 literal -fmerge-constants.
2466 * testsuite/Makefile.in: Regenerate.
2467
2468 * i386.cc (Target_i386): Remove unused member dynbss_.
2469 * arm.cc (Target_arm): Likewise.
2470 * powerpc.cc (Target_powerpc): Likewise.
2471 * sparc.cc (Target_sparc): Likewise.
2472 * tilegx.cc (Target_tilegx): Likewise.
2473 * x86_64.cc (Target_x86_64): Likewise.
2474 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2475 type_signature_, type_offset_.
2476 * plugin.h (Plugin_hook): Remove unused member layout_.
2477 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2478 mapfile_.
2479 (Read_member): Remove unused members input_objects_, symtab_,
2480 mapfile_, layout_.
2481 (Check_library): Remove unused member symtab_.
2482 * archive.h (Lib_group): Remove unused member lib_.
2483 * archive.cc (Lib_group::Lib_group): Update initializer.
2484 * incremental.h (Incremental_binary): Remove unused member target_.
2485 (Incremental_script_entry): Removed unused member script_.
2486 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2487 * icf.h (Icf): Remove unused member num_tracked_relocs.
2488
2489 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2490 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2491 its only use.
2492 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2493
2494 * archive.h: Use struct rather than class for forward declaration
2495 of Read_symbols_data.
2496
2497 2013-10-07 Cary Coutant <ccoutant@google.com>
2498
2499 PR gold/16010
2500 * testsuite/Makefile.am (icf_test): Fix dependencies.
2501 (icf_safe_test): Likewise.
2502 (icf_safe_so_test): Likewise.
2503 (large_symbol_alignment): Add empty _LDADD rule.
2504 * testsuite/Makefile.in: Regenerate.
2505
2506 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2507
2508 PR gold/15927
2509 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2510 relocation for R_X86_64_32 on x32.
2511
2512 2013-08-27 Roland McGrath <mcgrathr@google.com>
2513
2514 * output.cc (Output_segment::set_section_addresses): Take new
2515 Target* argument. If target->isolate_execinstr() and the segment
2516 is executable and starts at a target->abi_pagesize() boundary,
2517 pad its end out to a target->abi_pagesize() boundary with code fill.
2518 * output.h (Output_segment::set_section_addresses): Update decl.
2519 * layout.h (Layout::check_output_data_for_reset_values): Take new
2520 argument RELAX_OUTPUTS.
2521 (Layout): New member relax_output_list_.
2522 (Layout::add_relax_output): New method.
2523 * layout.cc (Layout::Layout): Update constructor.
2524 (Layout::reset_relax_output): New method.
2525 (Layout::clean_up_after_relaxation): Call it.
2526 (Layout::prepare_for_relaxation): Update caller.
2527 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2528 Call reset_relax_output before re-processing segments for
2529 isolate_execinstr case.
2530 (Layout::write_data): Handle relax_output_list_.
2531 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2532 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2533
2534 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2535
2536 PR binutils/15834
2537 * object.h: Fix typos.
2538
2539 2013-08-16 Roland McGrath <mcgrathr@google.com>
2540
2541 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2542 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2543
2544 2013-08-07 Cary Coutant <ccoutant@google.com>
2545
2546 Revert support for v2 DWP files:
2547
2548 2013-03-01 Cary Coutant <ccoutant@google.com>
2549
2550 Add dwp support for v2 DWARF package file format.
2551 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2552 tu_length parameter. Adjust all callers.
2553 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2554 * dwp.cc: Include dwarf.h.
2555 (Section_bounds): New struct type.
2556 (Unit_set): New struct type.
2557 (Dwo_file::Dwo_file): Initialize new data member.
2558 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2559 Combine and rename to...
2560 (Dwo_file::read_unit_index): ...this.
2561 (Dwo_file::sized_read_compunit_index)
2562 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2563 (Dwo_file::sized_read_unit_index): ...this.
2564 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2565 parameters; add section_id parameter.
2566 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2567 (Dwo_file::add_unit_set): ...this.
2568 (Dwo_file::shndx_map_): Remove.
2569 (Dwo_file::sect_offsets_): New data member.
2570 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2571 (Dwp_output_file::add_section): Rename to...
2572 (Dwp_output_file::add_contribution): ...this.
2573 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2574 (Dwp_output_file::add_tu_set): Likewise.
2575 (Dwp_output_file::Contribution): New type.
2576 (Dwp_output_file::Section::contributions): New data member.
2577 (Dwp_output_file::Cu_or_tu_set): Remove.
2578 (Dwp_output_file::Section::Section): New ctor.
2579 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2580 (Dwp_output_file::Dwp_index::Section_table): New type.
2581 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2582 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2583 parameter.
2584 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2585 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2586 (Dwp_output_file::Dwp_index::section_table): New member function.
2587 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2588 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2589 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2590 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2591 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2592 (Dwp_output_file::Dwp_index::section_table_): New data member.
2593 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2594 (Dwp_output_file::add_output_section): New member function.
2595 (Dwp_output_file::write_new_section): New member function.
2596 (Dwp_output_file::write_contributions): New member function.
2597 (Dwp_output_file::section_id_map_): New data member.
2598 (class Dwo_id_info_reader): Remove.
2599 (class Unit_reader): New class.
2600 (get_dwarf_section_name): New function.
2601 (Dwo_file::read_executable): Adjust initializations of class data.
2602 (Dwo_file::read): Add support for v2 package file format.
2603 (Dwo_file::read_unit_index): Likewise.
2604 (Dwo_file::sized_read_unit_index): Likewise.
2605 (Dwo_file::copy_section): Likewise.
2606 (Dwo_file::add_unit_set): Likewise.
2607 (Dwp_output_file::add_output_section): Likewise.
2608 (Dwp_output_file::add_contribution): Likewise.
2609 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2610 for empty slot.
2611 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2612 file format.
2613 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2614 slot.
2615 (Dwp_output_file::initialize): Remove unused function.
2616 (Dwp_output_file::finalize): Add support for v2 package file format.
2617 (Dwp_output_file::write_index): Likewise.
2618 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2619 function prototype.
2620
2621 2013-07-31 Cary Coutant <ccoutant@google.com>
2622
2623 * object.cc (Sized_relobj::do_output_section_address): New function.
2624 (Sized_relobj): Instantiate explicitly.
2625 * object.h (Object::output_section_address): New function.
2626 (Object::do_output_section_address): New function.
2627 (Sized_relobj::do_output_section_address): New function.
2628 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2629
2630 2013-07-30 Cary Coutant <ccoutant@google.com>
2631 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2632
2633 * parameters.cc (Parameters::entry): Return target-specific entry
2634 symbol name.
2635 * target.h (Target::entry_symbol_name): New function.
2636 (Target_info::entry_symbol_name): New data member.
2637
2638 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2639 * i386.cc (Target_i386::i386_info): Likewise.
2640 (Target_i386_nacl::i386_nacl_info): Likewise.
2641 * sparc.cc (Target_sparc::sparc_info): Likewise.
2642 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2643 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2644 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2645 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2646
2647 2013-07-22 Sterling Augustine <saugustine@google.com>
2648
2649 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2650 Convert parameter shndx to local variable. Add parameters symtab
2651 and symtab_size. Scan over section names. Find relocation
2652 section corresponding to current section. Create and initialize
2653 reloc_mapper_ and reloc_type_.
2654 (Dwarf_pubnames_table::read_header): Add assertion. Change
2655 unit_length to off_t. Initialize member unit_length_. Fill in field
2656 cu_offset_.
2657 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2658 Initialize new fields unit_length_ and cu_offset_.
2659 (Dwarf_pubnames_table::read_section): Update prototype.
2660 (Dwarf_pubnames_table::cu_offset): New member function.
2661 (Dwarf_pubnames_table::subsection_size): Likewise.
2662 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2663 New fields.
2664 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2665 member functions public.
2666 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2667 Update comment. Rework logic. Move repeated parts to...
2668 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2669 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2670 pubtypes_table_, and stmt_list_offset.
2671 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2672 Gdb_index::find_pubtype_offset,
2673 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2674 (Gdb_index::pubnames_read): Update prototype and rework logic.
2675 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2676 Forward declare.
2677 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2678 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2679 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2680 Gdb_index::map_pubtable_to_dies):
2681 Declare functions.
2682 (Gdb_index::pubnames_read): Update declaration.
2683 (Gdb_index::Pubname_offset_map): New type.
2684 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2685 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2686 Gdb_index::stmt_list_offset): Declare.
2687 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2688 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2689 Gdb_index::pubtypes_offset_): Remove.
2690
2691 2013-07-19 Roland McGrath <mcgrathr@google.com>
2692
2693 * options.h (General_options): Add -Trodata-segment option.
2694 * parameters.cc (Parameters::check_rodata_segment): New function.
2695 (Parameters::set_target_once): Call it.
2696 * parameters.h (Parameters): Declare it (private member function).
2697 * layout.cc (load_seg_unusable_for_headers): New function, broken
2698 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2699 then validate rodata segment rather than text segment.
2700 (relaxation_loop_body): Call that.
2701 (is_text_segment): New function. Don't admit a non-executable
2702 segment if TARGET->isolate_execinstr().
2703 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2704
2705 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2706
2707 PR gold/15070
2708 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2709 * nacl.h (Sniff_file::View::View): Request aligned view.
2710
2711 2013-07-11 Cary Coutant <ccoutant@google.com>
2712
2713 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2714 correct BRLT entry size.
2715
2716 2013-07-03 Alan Modra <amodra@gmail.com>
2717
2718 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2719 comment.
2720
2721 2013-07-01 Cary Coutant <ccoutant@google.com>
2722
2723 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2724 reloc_type_.
2725 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2726 (Dwarf_ranges_table::lookup_reloc): New function.
2727 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2728 reloc_type_.
2729 (Dwarf_ranges_table::lookup_reloc): New function.
2730 (Dwarf_ranges_table::reloc_type_): New data member.
2731
2732 2013-06-27 Jing Yu <jingyu@google.com>
2733
2734 PR gold/15662
2735 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2736 function.
2737 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2738 (Target_powerpc::do_relax): Call the above.
2739
2740 2013-06-27 Cary Coutant <ccoutant@google.com>
2741
2742 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2743 on garbage collected .opd section.
2744
2745 2013-06-27 Alan Modra <amodra@gmail.com>
2746
2747 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2748 is non-zero.
2749 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2750 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2751
2752 2013-06-14 Cary Coutant <ccoutant@google.com>
2753
2754 * resolve.cc (Symbol::override_base): Don't override st_type
2755 from plugin placeholder symbols.
2756 (Symbol_table::resolve): Likewise.
2757 (Symbol_table::should_override): Don't complain about TLS mismatch
2758 if the TO symbol is a plugin placeholder.
2759 * testsuite/Makefile.am (plugin_test_tls): New test.
2760 * testsuite/Makefile.in: Regenerate.
2761 * testsuite/plugin_test_tls.sh: New test script.
2762 * testsuite/two_file_test_2_tls.cc: New test source.
2763 * testsuite/two_file_test_tls.cc: New test source.
2764
2765 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2766
2767 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2768 the maximum segment alignment is larger than the page size.
2769 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2770 correctly aligns the symbols with large alignemnt.
2771 * testsuite/Makefile.in: Regenerate.
2772 * testsuite/large_symbol_alignment.cc: New file.
2773
2774 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2775 Sriraman Tallam <tmsriram@google.com>
2776
2777 * options.h (sort_section): New option.
2778 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2779 Rename from Input_section_sort_section_name_special_ordering_compare.
2780 (Input_section_sort_section_name_compare): New struct.
2781 * output.cc (Output_section::Input_section_sort_section_name_compare::
2782 operator()): New function.
2783 (Output_section::sort_attached_input_sections): Use new sort function
2784 for .text if --sort-section=name is specified.
2785 * layout.cc (Layout::make_output_section):
2786 Add sorting by name when --sort-section=name is specified.
2787 * testsuite/Makefile.am (text_section_grouping): Test option
2788 --sort-section=name.
2789 * testsuite/Makefile.in: Regenerate.
2790 * testsuite/section_sorting_name.cc: New file.
2791 * testsuite/section_sorting_name.sh: New file.
2792
2793 2013-05-21 Cary Coutant <ccoutant@google.com>
2794
2795 * symtab.h (Symbol::is_cxx_vtable): New function.
2796 * target-reloc.h (relocate_section): Check for vtable symbol.
2797 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2798 * testsuite/Makefile.in: Regenerate.
2799 * testsuite/missing_key_func.cc: New test source.
2800 * testsuite/missing_key_func.sh: New test script.
2801
2802 2013-05-21 Cary Coutant <ccoutant@google.com>
2803
2804 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2805 type of enclosing symbol.
2806 (Relocate_info::location): Check symbol type when describing symbol.
2807 * object.h (Symbol_location_info): Remove unused line_number;
2808 add enclosing_symbol_type.
2809 * testsuite/debug_msg.sh: Adjust expected output.
2810
2811 2013-05-13 Cary Coutant <ccoutant@google.com>
2812
2813 * configure.ac: Export DEFAULT_TARGET.
2814 * configure: Regenerate.
2815 * Makefile.in: Regenerate.
2816 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2817 * testsuite/Makefile.in: Regenerate.
2818 * testsuite/debug_msg.sh: Delete duplicate tests.
2819 Don't check undef_int error message match for powerpc where the
2820 source file and line number aren't available.
2821
2822 2013-05-10 Roland McGrath <mcgrathr@google.com>
2823
2824 * options.h (General_options): Add --rosegment-gap option.
2825 * options.cc (finalize): --rosegment-gap implies --rosegment.
2826 * layout.cc (set_segment_offsets): Let user option override
2827 target->rosegment_gap().
2828
2829 2013-05-10 Roland McGrath <mcgrathr@google.com>
2830
2831 * options.h (General_options): Remove leading space from help
2832 messages for -nostdlib and --rosegment.
2833
2834 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2835
2836 PR ld/15365
2837 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2838
2839 2013-05-03 Alan Modra <amodra@gmail.com>
2840
2841 * merge.cc (Output_merge_string::do_add_input_section): Correct
2842 scan for number of strings. Rename vars to avoid shadowing.
2843 Include missing terminator in input_size_.
2844
2845 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2846
2847 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2848 Restore empty string handling.
2849
2850 2013-05-01 Cary Coutant <ccoutant@google.com>
2851
2852 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2853 uninitialized warning.
2854
2855 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2856
2857 * output.cc (Output_section::add_merge_input_section): Allow
2858 to merge sections if the alignment is more than character size.
2859 * merge.h (Output_merge_string::Output_merge_string): Remove
2860 assert.
2861 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2862 only not-null strings. Check the alignment of strings.
2863 * stringpool.h
2864 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2865 alignment as the argument.
2866 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2867 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2868 Align non-zero length strings according to the addralign_.
2869 (Stringpool_template<Stringpool_char>::set_string_offsets):
2870 Updating offsets according to the given alignment.
2871 * testsuite/Makefile.am (text_section_grouping): Test if string
2872 literals are getting merged.
2873 * testsuite/Makefile.in: Regenerate.
2874 * testsuite/merge_string_literals_1.c: New file.
2875 * testsuite/merge_string_literals_2.c: Ditto.
2876 * testsuite/merge_string_literals.sh: Ditto.
2877
2878 2013-04-26 Ian Lance Taylor <iant@google.com>
2879
2880 * target-reloc.h (relocate_section): If the reloc offset is out of
2881 range, pass VIEW as NULL to relocate.relocate.
2882 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2883 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2884 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2885 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2886 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2887 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2888
2889 2013-04-26 Geoff Pike <gpike@chromium.org>
2890
2891 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2892 * layout.cc (Hash_task): New class.
2893 (Layout::queue_build_id_tasks): New function.
2894 (Layout::write_build_id): Handle single-thread portion of build ID
2895 computation. (In some cases, all of it is single-threaded.) Replace
2896 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2897 functionality in fewer lines of code.
2898 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2899 * options.h (General_options): make "--build-id" default to tree
2900 rather than sha1. Add two new options related to --build-id=tree:
2901 --build-id-chunk-size-for-treehash and
2902 --build-id-min-file-size-for-treehash.
2903 * Makefile.am: add testing of --build-id=tree and related new options
2904 (these tests will be invoked by "make check").
2905 * Makefile.in: Regenerate.
2906
2907 2013-04-25 Alan Modra <amodra@gmail.com>
2908
2909 * configure.tgt: Add powerpcle and powerpc64le.
2910
2911 2013-04-22 Alan Modra <amodra@gmail.com>
2912
2913 PR gold/15355
2914 * layout.cc (Layout::segment_precedes): Allow more than one
2915 segment with the same type and flags.
2916
2917 2013-04-15 Cary Coutant <ccoutant@google.com>
2918
2919 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2920 allocate space in file for BSS sections.
2921
2922 2013-04-15 Cary Coutant <ccoutant@google.com>
2923
2924 * script-sections.cc (Orphan_output_section): Reset address
2925 to zero after each orphaned section for relocatable links.
2926
2927 2013-04-15 Cary Coutant <ccoutant@google.com>
2928
2929 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2930 section starting address for relocatable link.
2931 * testsuite/Makefile.am (script_test_11): New test.
2932 * testsuite/Makefile.in: Regenerate.
2933 * testsuite/script_test_11.c: New source file.
2934 * testsuite/script_test_11.t: New linker script.
2935
2936 2013-04-13 Alan Modra <amodra@gmail.com>
2937
2938 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2939 owner when sections are not adjacent and exceed group size.
2940 (Target_powerpc::group_sections): Handle corner case.
2941 (Target_powerpc::Branch_info::make_stub): Handle case where
2942 stub table doesn't exist due to branches in non-exec sections.
2943 (Target_powerpc::Relocate::relocate): Likewise.
2944
2945 2013-04-11 Alan Modra <amodra@gmail.com>
2946
2947 PR gold/15354
2948 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2949 .branch_lt to match bfd ld. Adjust comments throughout file.
2950
2951 2013-04-04 Ian Lance Taylor <iant@google.com>
2952
2953 GCC PR c++/56840
2954 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2955 sections before checking whether they are included in the link.
2956
2957 2013-03-29 Sriraman Tallam <tmsriram@google.com>
2958
2959 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2960 object before calling the plugin claim_file handler. Pass the elf
2961 object of the archive to the plugin. Delete the elf object if the
2962 plugin claims the file.
2963
2964 2013-03-21 Alan Modra <amodra@gmail.com>
2965
2966 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2967 segment when omagic.
2968
2969 2013-03-21 Alan Modra <amodra@gmail.com>
2970
2971 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2972 comparison warning.
2973 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2974 uninitialized" warning.
2975
2976 2013-03-20 Alan Modra <amodra@gmail.com>
2977
2978 * symtab.h (Symbol::clear_version): New function.
2979 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2980 is_needed by weak references. Clear version for symbols defined
2981 in as-needed objects that are not needed.
2982
2983 2013-03-15 Alan Modra <amodra@gmail.com>
2984
2985 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2986 static and public. Add report_err param. Return false for data refs.
2987 (Target_powerpc::rela_dyn_section): New overloaded function.
2988 (Target_powerpc::plt_, iplt_): Elucidate.
2989 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2990 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2991 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2992 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2993 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2994 push_branch and make_plt_entry for ifunc syms when
2995 reloc_needs_plt_for_ifunc.
2996 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2997 for ifunc unless reloc_needs_plt_for_ifunc.
2998
2999 2013-03-15 Alan Modra <amodra@gmail.com>
3000
3001 * gc.h (gc_process_relocs): Don't look through function descriptors.
3002 * icf.cc (get_section_contents): Do so here instead.
3003
3004 2013-03-13 Alan Modra <amodra@gmail.com>
3005
3006 * powerpc.cc (is_branch_reloc): Forward declare.
3007 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3008 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3009 false for 64-bit, true for 32-bit non-branch relocs.
3010 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3011 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3012 nm output.
3013 (icf_safe_test): Generate linker map file as well as nm output.
3014 (icf_safe_so_test): Likewise.
3015 * testsuite/Makefile.in: Regenerate.
3016 * testsuite/icf_test.sh: Parse linker map file to determine
3017 section folding.
3018 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3019 * testsuite/icf_safe_so_test.sh: Likewise.
3020 (X86_32_or_ARM_specific_safe_fold): Merge into..
3021 (arch_specific_safe_fold): ..this.
3022 (X86_64_specific_safe_fold): Delete unused function.
3023
3024 2013-03-12 Alan Modra <amodra@gmail.com>
3025
3026 * gc.h (gc_process_relocs): Look through function descriptors
3027 to determine shndx, symvalue and addend used by ICF. Tidy
3028 variable duplication.
3029
3030 2013-03-11 Alan Modra <amodra@gmail.com>
3031
3032 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3033 * layout.cc (Layout_task_runner::run): ..to here.
3034 * symtab.h (struct Symbol_location): Extract from..
3035 (class Symbol_table): ..here.
3036 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3037 * target.h (class Target): Add function_location and
3038 do_function_location functions.
3039 (class Sized_target): Add do_function_location.
3040 * object.h (class Sized_relobj_file): Move find_shdr..
3041 (class Object): ..to here.
3042 * object.cc: Likewise. Update to suit. Instantiate.
3043 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3044 * powerpc.cc (class Powerpc_dynobj): New.
3045 (Target_powerpc::do_function_location): New function.
3046 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3047 (Powerpc_dynobj::do_read_symbols): New function.
3048 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3049
3050 2013-03-08 Ian Lance Taylor <iant@google.com>
3051
3052 * options.cc (General_options::string_to_object_format): Accept
3053 "default".
3054
3055 2013-03-08 Alan Modra <amodra@gmail.com>
3056
3057 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3058 pointer to Post_fde.
3059 (struct Post_fde): Move definition to here..
3060 * ehframe.cc (struct Post_fde): ..from here.
3061 (Cie::write): Don't alloc Post_fde.
3062 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3063
3064 2013-03-07 Alan Modra <amodra@gmail.com>
3065
3066 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3067 relocation referencing .LC0.
3068 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3069
3070 2013-03-07 Alan Modra <amodra@gmail.com>
3071
3072 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3073 always_inline. Add assembly for powerpc to avoid GOT.
3074
3075 2013-03-07 Alan Modra <amodra@gmail.com>
3076
3077 * testsuite/script_test_10.sh: Don't test .bss section
3078 header number.
3079
3080 2013-03-06 Alan Modra <amodra@gmail.com>
3081
3082 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3083 (Target_powerpc::symval_for_branch): Add symtab param. Update
3084 all callers. Handle folded sections.
3085 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3086 to Powerpc_relobj.
3087 (Global_symbol_visitor_opd::operator()): Likewise.
3088
3089 2013-03-04 Alan Modra <amodra@gmail.com>
3090
3091 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3092 * testsuite/Makefile.in: Regenerate.
3093
3094 2013-03-01 Cary Coutant <ccoutant@google.com>
3095
3096 Add dwp support for v2 DWARF package file format.
3097 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3098 tu_length parameter. Adjust all callers.
3099 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3100 * dwp.cc: Include dwarf.h.
3101 (Section_bounds): New struct type.
3102 (Unit_set): New struct type.
3103 (Dwo_file::Dwo_file): Initialize new data member.
3104 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3105 Combine and rename to...
3106 (Dwo_file::read_unit_index): ...this.
3107 (Dwo_file::sized_read_compunit_index)
3108 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3109 (Dwo_file::sized_read_unit_index): ...this.
3110 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3111 parameters; add section_id parameter.
3112 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3113 (Dwo_file::add_unit_set): ...this.
3114 (Dwo_file::shndx_map_): Remove.
3115 (Dwo_file::sect_offsets_): New data member.
3116 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3117 (Dwp_output_file::add_section): Rename to...
3118 (Dwp_output_file::add_contribution): ...this.
3119 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3120 (Dwp_output_file::add_tu_set): Likewise.
3121 (Dwp_output_file::Contribution): New type.
3122 (Dwp_output_file::Section::contributions): New data member.
3123 (Dwp_output_file::Cu_or_tu_set): Remove.
3124 (Dwp_output_file::Section::Section): New ctor.
3125 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3126 (Dwp_output_file::Dwp_index::Section_table): New type.
3127 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3128 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3129 parameter.
3130 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3131 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3132 (Dwp_output_file::Dwp_index::section_table): New member function.
3133 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3134 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3135 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3136 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3137 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3138 (Dwp_output_file::Dwp_index::section_table_): New data member.
3139 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3140 (Dwp_output_file::add_output_section): New member function.
3141 (Dwp_output_file::write_new_section): New member function.
3142 (Dwp_output_file::write_contributions): New member function.
3143 (Dwp_output_file::section_id_map_): New data member.
3144 (class Dwo_id_info_reader): Remove.
3145 (class Unit_reader): New class.
3146 (get_dwarf_section_name): New function.
3147 (Dwo_file::read_executable): Adjust initializations of class data.
3148 (Dwo_file::read): Add support for v2 package file format.
3149 (Dwo_file::read_unit_index): Likewise.
3150 (Dwo_file::sized_read_unit_index): Likewise.
3151 (Dwo_file::copy_section): Likewise.
3152 (Dwo_file::add_unit_set): Likewise.
3153 (Dwp_output_file::add_output_section): Likewise.
3154 (Dwp_output_file::add_contribution): Likewise.
3155 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3156 for empty slot.
3157 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3158 file format.
3159 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3160 slot.
3161 (Dwp_output_file::initialize): Remove unused function.
3162 (Dwp_output_file::finalize): Add support for v2 package file format.
3163 (Dwp_output_file::write_index): Likewise.
3164 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3165 function prototype.
3166
3167 2013-03-01 Cary Coutant <ccoutant@google.com>
3168
3169 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3170 function into class definition in header file.
3171 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3172 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3173 New function.
3174 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3175
3176 2013-02-28 Alan Modra <amodra@gmail.com>
3177
3178 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3179 * target.cc (Target::do_plt_fde_location): New function.
3180 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3181 accessor function, and constructor param.
3182 (struct Post_fde, Post_fdes): Declare.
3183 (Cie::write): Add post_fdes param.
3184 * ehframe.cc (Fde::write): Use plt_fde_location.
3185 (struct Post_fde): Define.
3186 (Cie::write): Stash FDEs added post merge mapping.
3187 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3188 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3189 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3190 other FDEs.
3191 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3192 (Target_powerpc::has_glink): New function.
3193 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3194 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3195 glink_eh_frame_fde_32, default_fde): New data.
3196 (Stub_table::eh_frame_added_): New var.
3197 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3198 Make const.
3199 (Stub_table::add_eh_frame): New function.
3200 (Output_data_glink::add_eh_frame): New function.
3201 (Target_powerpc::make_glink_section): Call add_eh_frame.
3202
3203 2013-02-15 Ian Lance Taylor <iant@google.com>
3204
3205 * options.h (DEFINE_uint64_alias): Define.
3206 (class General_options): Add -Ttext-segment as an alias for
3207 -Ttext.
3208
3209 2013-02-15 Alan Modra <amodra@gmail.com>
3210
3211 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3212 (Stub_table::do_write): ..here, two places.
3213 (Stub_table::plt_call_size): Use it here too.
3214
3215 2013-02-11 Ian Lance Taylor <iant@google.com>
3216
3217 * descriptors.cc (Descriptors::close_all): New function.
3218 * descriptors.h (class Descriptors): Declare close_all.
3219 (close_all_descriptors): New inline function.
3220 * plugin.cc: Include "descriptors.h".
3221 (Plugin_manager::cleanup): Call close_all_descriptors.
3222
3223 2013-02-06 Alan Modra <amodra@gmail.com>
3224
3225 * README: Update coding style link.
3226
3227 2013-01-28 Cary Coutant <ccoutant@google.com>
3228
3229 * dwp.cc (File_list): New typedef.
3230 (Dwo_name_info_reader): New class.
3231 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3232 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3233 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3234 (Dwo_file::read_executable): New function.
3235 (Dwo_file::read): Move common setup code to ...
3236 (Dwo_file::make_object): ... here.
3237 (dwp_options): Add --exec/-e.
3238 (usage): Likewise.
3239 (main): Likewise.
3240
3241 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3242
3243 * layout.cc (Layout::layout): Check for option text_reorder.
3244 (Layout::make_output_section): Ditto.
3245 * options.h (text_reorder): New option.
3246 * output.cc (Input_section_sort_compare): Remove special ordering
3247 of section names.
3248 (Output_section::
3249 Input_section_sort_section_name_special_ordering_compare::
3250 operator()): New function.
3251 (Output_section::sort_attached_input_sections): Use new sort function
3252 for .text.
3253 * output.h (Input_section_sort_section_name_special_ordering_compare):
3254 New struct.
3255 * testsuite/Makefile.am (text_section_grouping): Test option
3256 --no-text-reorder
3257 * testsuite/Makefile.in: Regenerate.
3258 * testsuite/text_section_grouping.sh: Check order of functions without
3259 default text reordering.
3260
3261 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3262
3263 * options.h (General_options): Change default to true for new_dtags.
3264
3265 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3266
3267 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3268 when enable_new_dtags is false. Only add DT_RUNPATH when
3269 enable_new_dtags is true.
3270
3271 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3272
3273 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3274 used in declaration and definition consistent.
3275 (Target_powerpc::symval_for_branch): Ditto.
3276
3277 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3278
3279 * testsuite/plugin_final_layout.cc: Fix comment.
3280
3281 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3282
3283 * layout.cc (Layout::layout): Do not do default sorting for
3284 text sections when section ordering is specified.
3285 (make_output_section): Ditto.
3286 * testsuite/plugin_final_layout.cc: Name the function sections
3287 to catch reordering issues.
3288
3289 2013-01-15 Alan Modra <amodra@gmail.com>
3290
3291 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3292 plt-thread-safe.
3293
3294 2013-01-15 Alan Modra <amodra@gmail.com>
3295
3296 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3297 * testsuite/Makefile.in: Regenerate.
3298
3299 2013-01-14 Alan Modra <amodra@gmail.com>
3300
3301 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3302 * testsuite/Makefile.in: Regenerate.
3303
3304 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3305
3306 PR bfd/14430
3307 Fix mingw gold build with plugins enabled
3308 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3309 * configure.ac: Export DLOPEN_LIBS and add headers check.
3310 * plugin.cc: Handle non-dlfcn case.
3311 * Makefile.in: Regenerate.
3312 * config.in: Regenerate.
3313 * configure: Regenerate.
3314 * testsuite/Makefile.in: Regenerate.
3315
3316 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3317
3318 * output.h (sort_attached_input_sections): Change to be public.
3319 * script-sections.cc
3320 (Output_section_definition::set_section_addresses): Sort
3321 attached input sections according to section order before linker
3322 script assigns section addresses.
3323 (Orphan_output_section::set_section_addresses): Sort
3324 attached input sections according to section order before linker
3325 script assigns section addresses.
3326 * Makefile.am (final_layout.sh): Use a simple linker script to
3327 check if section ordering still works.
3328 * Makefile.in: Regenerate.
3329
3330 2013-01-09 Ben Cheng <bccheng@google.com>
3331
3332 * arm.cc (Target_arm::attributes_accept_div): New function.
3333 (Target_arm::attributes_forbid_div): New function.
3334 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3335 attribute using the same new functions as what bfd/elf32_arm.c
3336 does.
3337
3338 2013-01-07 Cary Coutant <ccoutant@google.com>
3339
3340 PR gold/14993
3341 * output.cc (Output_section::add_input_section): For incremental
3342 updates, don't track input sections that are allocated from patch
3343 space.
3344
3345 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3346 Ian Lance Taylor <iant@google.com>
3347
3348 PR gold/14897
3349 * configure.ac (--enable-ld): Removed.
3350 (install_as_default): Set to yes only for --enable-gold=default
3351 or --disable-ld.
3352 * configure: Regenerated.
3353
3354 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3355
3356 * options.h (General_options): Add -fuse-ld= for GCC linker
3357 option compatibility.
3358
3359 2013-01-04 Cary Coutant <ccoutant@google.com>
3360
3361 * configure.ac: Fix typo restoring CXXFLAGS.
3362 * configure: Regenerate.
3363
3364 2013-01-04 Cary Coutant <ccoutant@google.com>
3365
3366 * testsuite/Makefile.am (CXXLINK_S): New macro.
3367 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3368 * testsuite/Makefile.in: Regenerate.
3369
3370 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3371
3372 * version.cc (print_version): Update copyright year to 2013.
3373
3374 2012-12-20 Ian Lance Taylor <iant@google.com>
3375
3376 * layout.cc (Layout::special_ordering_of_input_section): New
3377 function.
3378 (Layout::layout): If input section requires special ordering, must
3379 sort input sections.
3380 (Layout::make_output_section): May sort .text input sections.
3381 (Layout::is_section_name_prefix_grouped): Remove.
3382 * layout.h (class Layout): Declare
3383 special_ordering_of_input_section. Don't declare
3384 is_section_name_prefix_grouped.
3385 * output.cc (Output_section::add_input_section): Revert last
3386 change.
3387 (Output_section::Input_section_sort::match_file_name): Don't crash
3388 if called on output section data.
3389 (Output_section::Input_section_sort_compare): Sort based on
3390 special ordering.
3391 (Output_section::Input_section_sort_section_order_index_compare):
3392 Revert last patch.
3393 (Output_section::sort_attached_input_sections): Likewise.
3394
3395 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3396
3397 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3398 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3399 * output.cc (Output_section::add_input_section): Check if section
3400 name contains special prefix. Keep input sections to sort such
3401 sections.
3402 (Output_section::Input_section_sort_section_order_index_compare
3403 ::operator()): Group sections according to prefixes.
3404 (Output_section::sort_attached_input_sections): Add condition to
3405 Input_section_entry constructor call.
3406 * testsuite/Makefile.am (text_section_grouping): New test.
3407 * testsuite/Makefile.in: Regenerate.
3408 * testsuite/text_section_grouping.cc: New file.
3409 * testsuite/text_section_grouping.sh: New file.
3410
3411 2012-12-17 Nick Clifton <nickc@redhat.com>
3412
3413 * Makefile.am: Add copyright notice.
3414 * NEWS: Likewise.
3415 * README: Likewise.
3416 * configure.ac: Likewise.
3417 * ftruncate.c: Likewise.
3418 * Makefile.in: Regenerate.
3419
3420 2012-12-14 Cary Coutant <ccoutant@google.com>
3421
3422 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3423 --no-as-needed flag.
3424 (exception_separate_shared_12_test): Likewise.
3425 (incremental_copy_test): Likewise.
3426 * testsuite/Makefile.in: Regenerate.
3427
3428 2012-12-14 Cary Coutant <ccoutant@google.com>
3429
3430 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3431 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3432
3433 2012-12-12 Alan Modra <amodra@gmail.com>
3434
3435 * powerpc.cc (class Track_tls): New.
3436 (class Relocate, class Scan): Inherit Track_tls.
3437 (Target_powerpc::Scan::local, global): Track tls optimization
3438 and avoid creating plt entry for __tls_get_addr if all uses
3439 are optimized away.
3440 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3441
3442 2012-12-12 Alan Modra <amodra@gmail.com>
3443
3444 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3445 Replace no_toc_optimize with toc_optimize.
3446 * output.h (Output_section::input_sections): Provide non-const variant.
3447 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3448 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3449 accessors.
3450 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3451 (class Sort_toc_sections): New.
3452 (Target_powerpc::do_finalize_sections): Sort toc sections.
3453 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3454
3455 2012-12-10 Roland McGrath <mcgrathr@google.com>
3456
3457 * testsuite/binary_unittest.cc (read_all): New function.
3458 (Sized_binary_test): Use it instead of ::read.
3459 * fileread.cc (do_read): Don't assume pread always reads the whole
3460 amount in a single call.
3461
3462 2012-12-10 Alan Modra <amodra@gmail.com>
3463
3464 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3465 Set EM_PPC64 or EM_PPC here.
3466 (Target_selector_powerpc::do_recognize): Delete.
3467
3468 2012-12-10 Alan Modra <amodra@gmail.com>
3469
3470 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3471 stub_table_.
3472 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3473
3474 2012-12-07 Roland McGrath <mcgrathr@google.com>
3475
3476 * testsuite/binary_unittest.cc (Sized_binary_test):
3477 Use open_descriptor rather than ::open.
3478
3479 2012-12-07 Alan Modra <amodra@gmail.com>
3480
3481 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3482 typedef and invalid_address constant.
3483 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3484 instantiate constants.
3485
3486 2012-12-06 Roland McGrath <mcgrathr@google.com>
3487
3488 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3489 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3490 * aclocal.m4: Regenerate.
3491 * configure: Regenerate.
3492 * Makefile.in: Regenerate.
3493 * testsuite/Makefile.in: Regenerate.
3494
3495 2012-12-07 Alan Modra <amodra@gmail.com>
3496
3497 * options.h (General_options): Add no_toc_optimize.
3498 * powerpc.cc (ok_lo_toc_insn): New function.
3499 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3500
3501 2012-12-06 Alan Modra <amodra@gmail.com>
3502
3503 * options.h (General_options): Add plt_align, plt_static_chain,
3504 plt_thread_safe. Update stub_group_size help text.
3505 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3506 for new plt_thread_safe_ var.
3507 (use_plt_offset): Correct comments.
3508 (Target_powerpc::do_relax): Look for thread creation symbols to
3509 determine default plt_thread_safe value. Clear plt call stubs
3510 as well as branch stubs each iteration.
3511 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3512 insn constants.
3513 (l, hi, ha, write_insn): Move earlier.
3514 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3515 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3516 plt stubs too.
3517 (Stub_table::update_size): Adjust.
3518 (Stub_table::prev_size, set_prev_size): Delete.
3519 (Stub_table::stub_align): Let --plt-align affect result.
3520 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3521 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3522 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3523 (Stub_table::do_write): Support more stub variants.
3524
3525 2012-12-04 Alan Modra <amodra@gmail.com>
3526
3527 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3528 (Target_powerpc::do_define_standard_symbols): New function.
3529
3530 2012-12-03 Alan Modra <amodra@gmail.com>
3531
3532 * output.h: Formatting, whitespace.
3533
3534 2012-12-03 Alan Modra <amodra@gmail.com>
3535
3536 * layout.h (Layout::get_executable_sections): Declare.
3537 * layout.cc (Layout::get_executable_sections): New function.
3538 * arm.cc (Target_arm::group_sections): Use it.
3539 (Arm_output_section::group_sections): Delete now redundant test.
3540 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3541 param to handle relative relocs.
3542 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3543 (Output_data_reloc::add_absolute): Adjust.
3544 (Output_data_reloc::add_relative): New function.
3545 (Output_data::reset_data_size): New function.
3546 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3547 (Output_section::set_addralign): New function.
3548 (Output_section::checkpoint_set_addralign): New function.
3549 (Output_section::clear_section_offsets_need_adjustment): New function.
3550 (Output_section::input_sections): Make public.
3551 * powerpc.cc (class Output_data_brlt_powerpc): New.
3552 (class Stub_table, class Stub_control): New.
3553 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3554 stub_table_, set_stub_table, stub_table): New vectors and accessor
3555 functions.
3556 (Target_powerpc::do_may_relax, do_relax, push_branch,
3557 new_stub_table, stub_tables, brlt_section, group_sections,
3558 add_branch_lookup_table, find_branch_lookup_table,
3559 write_branch_lookup_table, make_brlt_section): New functions.
3560 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3561 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3562 branch_info_): New vars.
3563 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3564 make call stubs here.
3565 (Output_data_glink): Remove all call stub handling from this class.
3566 (Target_powerpc::Scan::local, global): Save interesting branch
3567 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3568 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3569 functions on final link.
3570 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3571 Handle long branch destinations too.
3572 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3573 do_plt_address_for_local): Adjust lookup of plt call stubs.
3574
3575 2012-11-30 Alan Modra <amodra@gmail.com>
3576
3577 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3578 relocs against protected symbols when building 32-bit shared libs.
3579
3580 2012-11-30 Alan Modra <amodra@gmail.com>
3581
3582 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3583 param. Call got_section() to make .got. Update all callers
3584 and their callers and so on.
3585
3586 2012-11-30 Alan Modra <amodra@gmail.com>
3587
3588 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3589 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3590 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3591 value if it already exists.
3592
3593 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3594
3595 PR gold/14858
3596 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3597
3598 2012-11-14 Roland McGrath <mcgrathr@google.com>
3599
3600 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3601 than bfc instruction for data sandboxing.
3602
3603 2012-11-08 Alan Modra <amodra@gmail.com>
3604
3605 * po/POTFILES.in: Regenerate.
3606
3607 2012-11-05 Alan Modra <amodra@gmail.com>
3608
3609 * configure.ac: Apply 2012-09-10 change to config.in here.
3610 * configure: Regenerate.
3611
3612 2012-11-05 Alan Modra <amodra@gmail.com>
3613
3614 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3615 (struct Opd_ent): Use "Address" rather than "Offset".
3616 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3617 (Target_powerpc::got_section): Make public.
3618 (Target_powerpc::scan_relocs): Move code setting symbols..
3619 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3620 Create _SDA_BASE_ only when referenced.
3621
3622 2012-11-02 Roland McGrath <mcgrathr@google.com>
3623
3624 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3625 from last change.
3626
3627 2012-11-01 Roland McGrath <mcgrathr@google.com>
3628
3629 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3630 for offset_in_output_section parameter.
3631 (Sized_target::relocate_special_relocatable): Likewise.
3632 * arm.cc (Target_arm::relocate_relocs): Likewise.
3633 (Target_arm::relocate_special_relocatable): Likewise.
3634 * i386.cc (Target_i386::relocate_relocs): Likewise.
3635 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3636 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3637 * target-reloc.h (relocate_relocs): Likewise.
3638 * testsuite/testfile.cc (Target_test): Likewise.
3639 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3640 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3641
3642 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3643 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3644
3645 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3646 parameter, which is unused in the [!F_SETFD] case.
3647
3648 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3649 SYMNDX to off_t before comparing it to this->data_size().
3650 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3651 * incremental.cc (Output_section_incremental_inputs::do_write):
3652 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3653
3654 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3655
3656 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3657
3658 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3659 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3660 in EABI_VER5.
3661
3662 2012-10-29 Cary Coutant <ccoutant@google.com>
3663
3664 * dwp.cc (usage): Add file and exit status parameters;
3665 add --help and --version options.
3666 (print_version): New function.
3667 (main): Add --help and --version options.
3668
3669 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3670
3671 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3672 final_layout_sequence.txt.
3673 * testsuite/Makefile.in: Regenerated.
3674
3675 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3676
3677 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3678 COMPILE generated by automake.
3679 (LINK1): Likewise.
3680 (CXXCOMPILE1): Likewise.
3681 (CXXLINK1): Likewise.
3682 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3683 (LINK): Likewise.
3684 (CXXCOMPILE): Likewise.
3685 (CXXLINK): Likewise.
3686 * testsuite/Makefile.in: Regenerated.
3687
3688 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3689
3690 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3691 on bad fwrite return.
3692
3693 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3694
3695 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3696 on val.
3697
3698 2012-10-23 Cary Coutant <ccoutant@google.com>
3699
3700 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3701 * testsuite/Makefile.in: Regenerate.
3702 * testsuite/dwp_test.h: New source file.
3703 * testsuite/dwp_test_1.cc: New source file.
3704 * testsuite/dwp_test_1.s: New source file.
3705 * testsuite/dwp_test_1.sh: New source file.
3706 * testsuite/dwp_test_1b.cc: New source file.
3707 * testsuite/dwp_test_1b.s: New source file.
3708 * testsuite/dwp_test_2.cc: New source file.
3709 * testsuite/dwp_test_2.s: New source file.
3710 * testsuite/dwp_test_2.sh: New source file.
3711 * testsuite/dwp_test_main.cc: New source file.
3712 * testsuite/dwp_test_main.s: New source file.
3713
3714 2012-10-23 Cary Coutant <ccoutant@google.com>
3715
3716 * dwp.h: New header file.
3717 * dwp.cc: New source file.
3718 * gold.h: Move shared declarations to system.h.
3719 * system.h: New header file.
3720 * Makefile.am: Add dwp.
3721 * Makefile.in: Regenerate.
3722
3723 2012-10-23 Cary Coutant <ccoutant@google.com>
3724
3725 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3726 Dwarf_info_reader::read_from_pointer.
3727 (Dwarf_pubnames_table::read_header): Likewise.
3728 (Dwarf_pubnames_table::next_name): Likewise.
3729 (Dwarf_die::read_attributes): Likewise.
3730 (Dwarf_die::skip_attributes): Likewise.
3731 (Dwarf_info_reader::read_from_pointer): New function template.
3732 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3733 (Dwarf_pubnames_table): Likewise.
3734 (Dwarf_info_reader::read_from_pointer): New function template.
3735 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3736 Dwarf_pubnames_table ctor.
3737
3738 2012-10-23 Cary Coutant <ccoutant@google.com>
3739
3740 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3741 abbrev_shndx.
3742 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3743 abbrev_shndx_.
3744 (Dwarf_info_reader::set_abbrev_shndx): New method.
3745 (Dwarf_info_reader::abbrev_shndx_): New data member.
3746
3747 2012-10-23 Cary Coutant <ccoutant@google.com>
3748
3749 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3750 from object, not parameters.
3751 (Dwarf_info_reader::parse): Likewise.
3752 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3753 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3754 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3755 methods.
3756
3757 2012-10-23 Cary Coutant <ccoutant@google.com>
3758
3759 * fileread.cc (Input_file::Input_file): New constructor.
3760 * fileread.h (class Input_file): Add new constructor.
3761
3762 2012-10-18 Alan Modra <amodra@gmail.com>
3763
3764 PR gold/14727
3765 * object.cc (Relobj::is_section_name_included): Also match
3766 .sdata personality section.
3767
3768 2012-10-18 Alan Modra <amodra@gmail.com>
3769
3770 * target-reloc.h (class Default_comdat_behavior): New, package up..
3771 (get_comdat_behaviour): ..this.
3772 (relocate_section): Add Relocate_comdat_behavior template arg,
3773 adjust code to suit.
3774 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3775 (Target_arm::scan_reloc_section): Likewise.
3776 * i386.cc (Target_i386::relocate_section): Likewise.
3777 * sparc.cc (Target_sparc::relocate_section): Likewise.
3778 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3779 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3780 * powerpc.cc (class Relocate_comdat_behavior): New.
3781 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3782 gold::relocate_section with new template arg.
3783
3784 2012-10-18 Alan Modra <amodra@gmail.com>
3785
3786 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3787 dynamic relocs for GOT_TPREL got entries, without symbol if
3788 resolving locally.
3789 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3790 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3791 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3792
3793 2012-10-17 Alan Modra <amodra@gmail.com>
3794
3795 PR gold/14726
3796 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3797
3798 2012-10-16 Sriraman Tallam <tmsriram@google.com>
3799
3800 * layout.cc (Layout::include_section): Keep sections marked
3801 SHF_EXCLUDE when doing relocatable links.
3802
3803 2012-10-16 Alan Modra <amodra@gmail.com>
3804
3805 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3806 (Target_powerpc::do_finalize_sections): Call it.
3807 (Output_data_save_res): New class and supporting functions.
3808 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3809 normal symbols defined in object files.
3810
3811 2012-10-12 Alan Modra <amodra@gmail.com>
3812
3813 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3814 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3815 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3816 section if scan_opd_relocs not yet called.
3817 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3818
3819 2012-10-12 Alan Modra <amodra@gmail.com>
3820
3821 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3822 add_local_ifunc_entry): Revert last change.
3823 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3824
3825 2012-10-05 Alan Modra <amodra@gmail.com>
3826
3827 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3828 do_plt_address_for_global): New functions.
3829 (Output_data_got_powerpc::do_write): Don't segfault when linking
3830 statically.
3831 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3832 add_local_ifunc_entry): Return true on adding entry..
3833 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3834 glink->add_entry call. Remove unused symtab param. Adjust calls.
3835 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3836 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3837 set up symbols here.
3838 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3839 syms here. Do so even when no .iplt. Don't segfault when linking
3840 statically.
3841 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3842 new variants without reloc param.
3843 (Glink_sym_ent::Glink_sym_ent): Likewise.
3844 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3845 reloc when refs will resolve to plt call stub.
3846 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3847 R_PPC_PLTREL24 to resolve locally.
3848 (Target_powerpc::Scan::global): Correct ifunc handling.
3849 (Target_powerpc::Relocate::relocate): Correct local sym glink
3850 lookup. Don't destroy "value" when we have a plt call stub,
3851 and when checking plt call validity.
3852 (Target_powerpc::do_dynsym_value): Simplify.
3853
3854 2012-10-05 Alan Modra <amodra@gmail.com>
3855
3856 * i386.cc (Output_data_plt_i386::address_for_global,
3857 address_for_local): Add plt offset to returned value. Adjust uses.
3858 * sparc.cc (Output_data_plt_sparc::address_for_global,
3859 address_for_local): Likewise.
3860 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3861 address_for_local): Likewise.
3862 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3863 address_for_local): Likewise.
3864 * target.h (Target::plt_address_for_global, plt_address_for_local):
3865 Update comment.
3866 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3867 (Output_data_got::Got_entry::write): Nor here.
3868 * output.h: Comment fix.
3869
3870 2012-10-02 Jiong Wang <jiwang@tilera.com>
3871
3872 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3873 global_offset_table_ value for larget got.
3874 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3875
3876 2012-09-29 Alan Modra <amodra@gmail.com>
3877
3878 * powerpc.cc (Target_powerpc::iplt_): New output section.
3879 (Target_powerpc::iplt_section, make_iplt_section,
3880 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3881 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3882 Target_powerpc::plt_entry_count): Count iplt entries too.
3883 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3884 reloc section in constructor. New params.
3885 (Target_powerpc::make_plt_section): Create reloc section here instead.
3886 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3887 functions.
3888 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3889 (Output_data_glink::add_entry, find_entry): New functions to
3890 deal with local syms.
3891 (Glink_sym_ent): Add support for local syms.
3892 (Output_data_glink::do_write): Handle ifunc plt entries.
3893 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3894 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3895 (Target_powerpc::Relocate::relocate): Likewise.
3896 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3897
3898 2012-09-25 Alan Modra <amodra@gmail.com>
3899
3900 * object.h (Sized_relobj_file::adjust_local_symbol,
3901 do_adjust_local_symbol): New functions.
3902 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3903 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3904 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3905 and irregular opd entry spacing.
3906 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3907 (Global_symbol_visitor_opd): New functor.
3908 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3909 on deleted opd entries.
3910
3911 2012-09-15 Jiong Wang <jiwang@tilera.com>
3912
3913 * tilegx.cc: New file.
3914 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3915 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3916 * configure.tgt: Add entries for tilegx*.
3917 * configure.ac: Likewise.
3918 * Makefile.in: Rebuild.
3919 * configure: Likewise.
3920 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3921 tilegx.
3922
3923 2012-09-13 Alan Modra <amodra@gmail.com>
3924
3925 * target-reloc.h (scan_relocs): Call scan.local for relocs
3926 against symbols in discarded sections. Pass is_discarded
3927 param.
3928 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3929 Add is_discarded param.
3930 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3931 is_discarded to flag opd entry as discarded. Don't emit dyn
3932 relocs on such entries.
3933 (Target_powerpc::Scan::global): Similarly detect and handle
3934 such opd entries.
3935 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3936 opd_ent_. Update all uses.
3937 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3938 (Target_powerpc::relocate_section): Zero out discarded opd
3939 entry relocs.
3940
3941 2012-09-12 Ian Lance Taylor <iant@google.com>
3942
3943 PR gold/14570
3944 * output.cc: Rename Output_data_got template parameter from size
3945 to got_size for all functions. Compile all variants of
3946 Output_data_got.
3947 (Output_data_got::Got_entry::write): Correct use of size for
3948 symbol value. Use local_is_tls rather than casting to
3949 Sized_relobj_file.
3950 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3951 (class Sized_relobj_file): Add do_local_is_tls.
3952 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3953
3954 2012-09-11 Alan Modra <amodra@gmail.com>
3955
3956 PR gold/14566
3957 * layout.cc (Layout::set_segment_offsets): When using
3958 common-page-size alignment, ensure we are on a new max-page-size
3959 page.
3960 * output.cc (Output_segment::set_section_addresses): Use
3961 abi_pagesize, not common_pagesize for relro boundary.
3962 (Output_segment::set_offset): Likewise.
3963
3964 2012-09-11 Alan Modra <amodra@gmail.com>
3965
3966 * output.h (Output_data_got::add_global_tls, add_local_tls,
3967 add_local_tls_pair): New functions.
3968 (Output_data_got::add_local_pair_with_rel): Remove second
3969 reloc param. Expand comment.
3970 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3971 use_plt_or_tls_offset_, similarly for constructor param.
3972 (Output_data_got::Got_entry::write): Add got_index param.
3973 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3974 add_local_tls_pair): New functions.
3975 (Output_data_got::Got_entry::write): Handle tls symbols
3976 with use_plt_or_tls_offset_ set specially.
3977 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3978 (Output_data_got::do_write): Replace iterator with index, pass
3979 index to entry write function.
3980 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3981 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3982 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3983 call.
3984 * i386.cc (Target_i386::Scan::local): Likewise.
3985 * sparc.cc (Target_sparc::Scan::local): Likewise.
3986 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3987 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3988 do_tls_offset_for_global): New functions.
3989 (Target_powerpc::Scan::local): Correct TLS relocations and got
3990 entry values.
3991 (Target_powerpc::Scan::global): Don't emit unnecessary
3992 dynamic relocations on TLS GOT entries.
3993
3994 2012-09-10 Matthias Klose <doko@ubuntu.com>
3995
3996 * config.in: Disable sanity check for kfreebsd.
3997
3998 2012-09-10 Sterling Augustine <saugustine@google.com>
3999
4000 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4001 (Gdb_index::pubtypes_read): New parameter.
4002 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4003 to calls.
4004 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4005 pubtypes_object_.
4006
4007 2012-09-09 Alan Modra <amodra@gmail.com>
4008
4009 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4010 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4011 * gc.h (gc_process_relocs): Call target gc_add_reference.
4012 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4013 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4014 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4015 unnecessary cast.
4016 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4017 to cater for when we don't need code offset. Update use.
4018 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4019 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4020 set_opd_valid): New functions.
4021 (Target_powerpc::do_gc_add_reference): New function.
4022 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4023 stashed refs.
4024 (Target_powerpc::do_gc_mark_symbol): New function.
4025
4026 2012-09-06 Cary Coutant <ccoutant@google.com>
4027
4028 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4029 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4030 (Dwarf_die::skip_attributes): Likewise.
4031 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4032 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4033 (main): Call it.
4034 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4035
4036 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4037
4038 * testsuite/script_test_3.t: Add .got.plt output section
4039 statement.
4040 * testsuite/script_test_4.t: Likewise.
4041
4042 2012-09-05 Alan Modra <amodra@gmail.com>
4043
4044 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4045 update all uses and lose "enum" when using type.
4046
4047 2012-09-05 Alan Modra <amodra@gmail.com>
4048
4049 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4050 * configure: Regenerate.
4051 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4052 (plugin_final_layout.stdout): Likewise.
4053 (memory_test): Set page sizes to 0x1000.
4054 * testsuite/Makefile.in: Regenerate.
4055 * testsuite/discard_locals_test.sh: Add FIXME comment.
4056 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4057 * testsuite/pr14265.t: Add .got output section statement.
4058 * testsuite/script_test_2.t: Likewise.
4059 * testsuite/script_test_3.t: Likewise.
4060 * testsuite/script_test_4.t: Likewise.
4061 * testsuite/script_test_5.t: Likewise.
4062 * testsuite/script_test_6.t: Likewise.
4063 * testsuite/script_test_7.t: Likewise.
4064 * testsuite/script_test_9.t: Likewise.
4065
4066 2012-09-05 Alan Modra <amodra@gmail.com>
4067
4068 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4069 (Powerpc_relocate_functions::Status): New typedef.
4070 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4071 (Target_powerpc::Scan::local): Handle REL64.
4072 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4073 for REL32 and REL64.
4074 (Target_powerpc::symval_for_branch): New function, extracted from..
4075 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4076 checks. Report overflow errors.
4077
4078 2012-09-05 Alan Modra <amodra@gmail.com>
4079
4080 * object.h (Sized_relobj_file::emit_relocs): Delete.
4081 (Sized_relobj_file::emit_relocs_reltype): Delete.
4082 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4083 relocate_relocs for --emit-relocs.
4084 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4085 * output.h: Update comment.
4086 (Output_segment::first_section): New function.
4087 (Output_segment::first_section_load_address): Use first_section.
4088 * output.cc (Output_segment::first_section): New function extracted..
4089 (Output_segment::first_section_load_address): ..from here. Delete.
4090 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4091 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4092 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4093 adjust call to target.h function.
4094 * i386.cc (Target_i386): Likewise.
4095 * sparc.cc (Target_sparc): Likewise.
4096 * x86_64.cc (Target_x86_64): Likewise.
4097 * powerpc.cc (Target_powerpc): Likewise.
4098 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4099 first tls section has section symbol for optimised local dynamic
4100 output relocs.
4101 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4102 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4103 optimised tls code.
4104 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4105 Rename to relocate_relocs. Update error message.
4106
4107 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4108
4109 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4110 --just-symbols.
4111
4112 2012-08-31 Alan Modra <amodra@gmail.com>
4113
4114 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4115 (Powerpc_relobj::toc_base_offset): New stub function.
4116 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4117 got_mod_index_offset to tlsld_got_offset. Update all refs.
4118 (Target_powerpc::Relocate::enum skip_tls): New.
4119 (Target_powerpc::call_tls_get_addr_): New var.
4120 (Target_powerpc::is_branch_reloc): Move to file scope.
4121 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4122 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4123 New functions.
4124 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4125 (powerpc_info): Correct common_pagesize for ppc64.
4126 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4127 (Powerpc_relocate_functions): Add overflow check enums and functions.
4128 Add non-shift version of rela, rela_ua. Delete all rel public
4129 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4130 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4131 addr16_ha3, addr14 functions.
4132 (Output_data_got_powerpc::add_constant_pair): New function.
4133 (Output_data_got_powerpc::got_base_offset): Likewise.
4134 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4135 (instruction constants): Sort, add some more.
4136 (Output_data_glink::do_write): Add and use Address typedef. Use
4137 object->toc_base_offset() stub for 64-bit.
4138 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4139 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4140 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4141 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4142 Always treat .opd relocs as against locally defined symbol.
4143 Correct condition for RELATIVE relocs.
4144 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4145 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4146 for 32-bit syms with a plt entry. Correct ppc64 toc base
4147 calculations. Handle TLS relocs, and more. Add overflow
4148 checking and adjust for Powerpc_relocate_functions changes.
4149 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4150 Reinstate --emit-relocs code with FIXME.
4151
4152 2012-08-30 Alan Modra <amodra@gmail.com>
4153
4154 * layout.cc (Layout::set_segment_offsets): Set p_align to
4155 abi_pagesize, not common_pagesize.
4156 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4157 to determine whether file header can go in segment.
4158
4159 2012-08-30 Alan Modra <amodra@gmail.com>
4160
4161 * output.h (Output_reloc::Output_reloc <output section>): Add
4162 is_relative param. Adjust calls.
4163 (Output_reloc::add_output_section_relative): New functions.
4164 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4165 is_relative.
4166 (Output_reloc::symbol_value): Handle SECTION_CODE.
4167
4168 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4169
4170 * gold.cc (queue_middle_tasks): Call layout again when unique
4171 segments for sections is desired.
4172 * layout.cc (Layout::Layout): Initialize new members.
4173 (Layout::get_output_section_flags): New function.
4174 (Layout::choose_output_section): Call get_output_section_flags.
4175 (Layout::layout): Make output section for mapping to a unique segment.
4176 (Layout::insert_section_segment_map): New function.
4177 (Layout::attach_allocated_section_to_segment): Make unique segment for
4178 output sections marked so.
4179 (Layout::segment_precedes): Check for unique segments when sorting.
4180 * layout.h (Layout::Unique_segment_info): New struct.
4181 (Layout::Section_segment_map): New typedef.
4182 (Layout::insert_section_segment_map): New function.
4183 (Layout::get_output_section_flags): New function.
4184 (Layout::is_unique_segment_for_sections_specified): New function.
4185 (Layout::set_unique_segment_for_sections_specified): New function.
4186 (Layout::unique_segment_for_sections_specified_): New member.
4187 (Layout::section_segment_map_): New member.
4188 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4189 Rename is_gc_pass_one to is_pass_one.
4190 Rename is_gc_pass_two to is_pass_two.
4191 Rename is_gc_or_icf to is_two_pass.
4192 Check for which pass based on whether symbols data is present.
4193 Make it two pass when unique segments for sections is desired.
4194 * output.cc (Output_section::Output_section): Initialize new
4195 members.
4196 * output.h (Output_section::is_unique_segment): New function.
4197 (Output_section::set_is_unique_segment): New function.
4198 (Output_section::is_unique_segment_): New member.
4199 (Output_section::extra_segment_flags): New function.
4200 (Output_section::set_extra_segment_flags): New function.
4201 (Output_section::extra_segment_flags_): New member.
4202 (Output_section::segment_alignment): New function.
4203 (Output_section::set_segment_alignment): New function.
4204 (Output_section::segment_alignment_): New member.
4205 (Output_segment::Output_segment): Initialize is_unique_segment_.
4206 (Output_segment::is_unique_segment): New function.
4207 (Output_segment::set_is_unique_segment): New function.
4208 (Output_segment::is_unique_segment_): New member.
4209 * plugin.cc (allow_unique_segment_for_sections): New function.
4210 (unique_segment_for_sections): New function.
4211 (Plugin::load): Add new functions to transfer vector.
4212 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4213 * Makefile.in: Regenerate.
4214 * testsuite/plugin_final_layout.sh: Check if unique segment
4215 functionality works.
4216 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4217 are available.
4218 (allow_unique_segment_for_sections): New global.
4219 (unique_segment_for_sections): New global.
4220 (claim_file_hook): Call allow_unique_segment_for_sections.
4221 (all_symbols_read_hook): Call unique_segment_for_sections.
4222
4223 2012-08-22 Cary Coutant <ccoutant@google.com>
4224
4225 * layout.cc (Layout::include_section): Don't assert on GROUP
4226 sections with --emit-relocs.
4227
4228 2012-08-21 Cary Coutant <ccoutant@google.com>
4229
4230 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4231 if --export-dynamic-symbol names an undef symbol.
4232
4233 2012-08-18 Alan Modra <amodra@gmail.com>
4234
4235 * powerpc.cc: Formatting and white space.
4236 (Powerpc_relobj): Rename got2_section_ to special_.
4237 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4238 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4239 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4240 (Target_powerpc): Add Address typedef and invalid_address. Use
4241 throughout.
4242 (Target_powerpc::is_branch_reloc): New function.
4243 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4244 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4245 for dst_mask, value and addend.
4246 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4247 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4248 (Output_data_glink::do_write): Correct toc base. Don't try to use
4249 uint16_t for 24-bit offset. Use get_output_section_offset and
4250 check return.
4251 (Target_powerpc::Scan::local): Handle more relocs.
4252 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4253 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4254 Plug in toc restoring insn after plt calls. Translate branches
4255 to function descriptor symbols to corresponding entry point.
4256 (Target_powerpc::relocate_for_relocatable): Check return from
4257 get_output_section_offset.
4258 * symtab.h: Comment typo.
4259
4260 2012-08-14 Ian Lance Taylor <iant@google.com>
4261
4262 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4263 unsupported_relocal_local to call unsupported_reloc_global.
4264
4265 2012-08-14 Nick Clifton <nickc@redhat.com>
4266
4267 PR ld/14265
4268 * script-sections.cc (Sections_element::output_section_name): Add
4269 keep return parameter.
4270 (Output_section_element::match_name): Add keep return parameter.
4271 Return the value of the keep_ member.
4272 * script-sections.h (class Output_section): Update
4273 output_section_name prototype.
4274 * layout.cc (Layout::keep_input_section): New public member
4275 function.
4276 (Layout::choose_output_section): Pass keep parameter to
4277 output_section_name.
4278 * layout.h (class Layout): Add keep_input_section.
4279 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4280 sections.
4281 * testsuite/Makefile.am: Add a test.
4282 * testsuite/Makefile.in: Regenerate.
4283 * testsuite/pr14265.c: Source file for the test.
4284 * testsuite/pr14265.t: Linker script for the test.
4285 * testsuite/pr14265.sh: Shell script for the test.
4286
4287 2012-08-14 Alan Modra <amodra@gmail.com>
4288
4289 * target.h (Target::output_section_name): New function.
4290 (Target::do_output_section_name): New function.
4291 * layout.cc (Layout::choose_output_section): Call the above.
4292 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4293
4294 2012-08-14 Alan Modra <amodra@gmail.com>
4295
4296 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4297 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4298 for replace_constant call.
4299 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4300 (Output_data_glink::do_print_to_mapfile): New function.
4301 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4302 (Target_powerpc::Relocate::relocate): Likewise.
4303
4304 2012-08-14 Alan Modra <amodra@gmail.com>
4305
4306 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4307 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4308 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4309 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4310 all references to shndx_. Handle special case for R_PPC_PLTREL24
4311 here.
4312 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4313 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4314 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4315 here.
4316 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4317 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4318
4319 2012-08-12 Alan Modra <amodra@gmail.com>
4320
4321 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4322 (glink insn constants): Use uint32_t.
4323 (Output_data_glink::add_entry): Use insert, not [] operator.
4324
4325 2012-08-11 Alan Modra <amodra@gmail.com>
4326
4327 * object.h (Sized_relobj_file::find_shdr): New function.
4328 (Sized_relobj_file::find_special_sections): New function.
4329 * object.cc (Sized_relobj_file::find_shdr): New function.
4330 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4331 (Sized_relobj_file::find_special_sections): New function, split out..
4332 (Sized_relobj_file::do_read_symbols): ..from here.
4333 * output.h (Output_data_got::replace_constant): New function.
4334 (Output_data_got::num_entries): New function.
4335 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4336 (Output_data_got::got_offset): Protected rather than private.
4337 (Output_data_got::replace_got_entry): New function.
4338 * output.cc (Output_data_got::replace_got_entry): New function.
4339 * powerpc.cc (class Powerpc_relobj): New.
4340 (class Powerpc_relocate_functions): Delete all psymval variants or
4341 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4342 Implement _ha functions using corresponding _hi function.
4343 (Powerpc_relobj::find_special_sections): New function.
4344 (Target_powerpc::do_make_elf_object): New function.
4345 (class Output_data_got_powerpc): New.
4346 (class Output_data_glink): New.
4347 (class Powerpc_scan_relocatable_reloc): New.
4348 Many more changes througout file.
4349
4350 2012-08-09 Nick Clifton <nickc@redhat.com>
4351
4352 * po/vi.po: Updated Vietnamese translation.
4353
4354 2012-08-07 Ian Lance Taylor <iant@google.com>
4355
4356 * layout.cc (Layout::add_target_dynamic_tags): If
4357 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4358 plt_rel.
4359
4360 2012-07-30 Nick Clifton <nickc@redhat.com>
4361
4362 * po/gold.pot: Updated template.
4363 * po/es.po: Updated Spanish translation.
4364
4365 2012-07-18 Cary Coutant <ccoutant@google.com>
4366
4367 PR gold/14344
4368 * configure.ac: Add check for -gpubnames support.
4369 * configure: Regenerate.
4370 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4371 support; force -gno-pubnames.
4372 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4373 support.
4374 (gdb_index_test_4): New test.
4375 * testsuite/Makefile.in: Regenerate.
4376 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4377 * testsuite/gdb_index_test_2.sh: Likewise.
4378 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4379 * testsuite/gdb_index_test_4.sh: New script.
4380 * testsuite/gdb_index_test_comm.sh: New script with common code;
4381 don't look for space after colon.
4382
4383 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4384
4385 * gold.cc (queue_middle_tasks): Update function order only after
4386 deferred objects due to plugins are processed.
4387
4388 2012-07-11 Ian Lance Taylor <iant@google.com>
4389
4390 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4391 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4392 (Target_arm::scan_reloc_for_stub): Likewise.
4393 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4394 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4395 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4396 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4397 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4398
4399 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4400 Ian Lance Taylor <iant@google.com>
4401
4402 PR gold/14309
4403 * configure.ac: Test whether std::tr1::hash<off_t> works.
4404 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4405 needed.
4406 * output.h (class Output_fill): Add virtual destructor.
4407 * configure, config.in: Rebuild.
4408
4409 2012-06-22 Roland McGrath <mcgrathr@google.com>
4410
4411 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4412
4413 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4414
4415 * plugin.cc (Plugin::load): Handle position independent executables.
4416
4417 2012-06-06 Cary Coutant <ccoutant@google.com>
4418
4419 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4420 add .debug_macro.
4421 (lines_only_debug_sections): Likewise.
4422 (gdb_fast_lookup_sections): New static array.
4423 (is_gdb_debug_section): Rename formal parameter.
4424 (is_lines_only_debug_section): Likewise.
4425 (is_gdb_fast_lookup_section): New function.
4426 (Layout::include_section): Check for ".zdebug_" prefix; pass
4427 section name suffix to is_gdb_debug_section, et al.; check for
4428 fast-lookup sections when building .gdb_index.
4429 * options.h (--strip-debug-gdb): Update GDB version number.
4430
4431 2012-06-06 Cary Coutant <ccoutant@google.com>
4432
4433 * configure.ac: Add check for fallocate.
4434 * configure: Regenerate.
4435 * config.in: Regenerate.
4436
4437 * options.h (class General_options): Add --mmap-output-file and
4438 --posix-fallocate options.
4439 * output.cc: (posix_fallocate): Remove; replace with...
4440 (gold_fallocate): New function.
4441 (Output_file::map_no_anonymous): Call gold_fallocate.
4442 (Output_file::map): Check --mmap-output-file option.
4443
4444 2012-06-05 Jing Yu <jingyu@google.com>
4445
4446 * gold.h (textdomain): Add do {} to empty while(0).
4447 (bindtextdomain): Likewise.
4448
4449 2012-06-04 Cary Coutant <ccoutant@google.com>
4450
4451 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4452 has_dynsym_index.
4453
4454 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4455
4456 * symtab.cc (Symbol_table::define_special_symbol):
4457 Initialize *poldsym to prevent uninitialized variable errors.
4458
4459 2012-05-23 Cary Coutant <ccoutant@google.com>
4460
4461 * layout.cc (Layout::section_name_mapping): Add rules to handle
4462 exact match on .data.rel.ro.local or .data.rel.ro.
4463 (Layout::output_section_name): Check for exact matches.
4464
4465 2012-05-23 Cary Coutant <ccoutant@google.com>
4466
4467 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4468 more carefully.
4469
4470 2012-05-22 Cary Coutant <ccoutant@google.com>
4471
4472 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4473 object before exporting symbol.
4474
4475 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4476
4477 * testsuite/tls_test.cc: Include "config.h" first.
4478 * testsuite/tls_test_c.c: Likewise.
4479
4480 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4481 Nick Clifton <nickc@redhat.com>
4482
4483 PR 14072
4484 * configure.in: Add check that sysdep.h has been included before
4485 any system header files.
4486 * configure: Regenerate.
4487 * config.in: Regenerate.
4488
4489 2012-05-14 Cary Coutant <ccoutant@google.com>
4490
4491 * layout.cc (Layout::make_output_section): Mark .tdata section
4492 as RELRO.
4493 * testsuite/relro_test.cc: Add a TLS variable.
4494
4495 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4496
4497 PR gold/14091
4498 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4499 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4500 R_X86_64_64.
4501
4502 2012-05-08 Cary Coutant <ccoutant@google.com>
4503
4504 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4505 (lines_only_debug_sections): Likewise.
4506
4507 2012-05-02 Roland McGrath <mcgrathr@google.com>
4508
4509 * nacl.cc: New file.
4510 * nacl.h: New file.
4511 * Makefile.am (CCFILES, HFILES): Add them.
4512 * Makefile.in: Regenerate.
4513 * i386.cc (Output_data_plt_i386_nacl): New class.
4514 (Output_data_plt_i386_nacl_exec): New class.
4515 (Output_data_plt_i386_nacl_dyn): New class.
4516 (Target_i386_nacl): New class.
4517 (Target_selector_i386_nacl): New class.
4518 (target_selector_i386): Use it instead of Target_selector_i386.
4519 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4520 (Target_x86_64_nacl): New class.
4521 (Target_selector_x86_64_nacl): New class.
4522 (target_selector_x86_64, target_selector_x32): Use it instead of
4523 Target_selector_x86_64.
4524 * arm.cc (Output_data_plt_arm_nacl): New class.
4525 (Target_arm_nacl): New class.
4526 (Target_selector_arm_nacl): New class.
4527 (target_selector_arm, target_selector_armbe): Use it instead of
4528 Target_selector_arm.
4529
4530 * target-select.cc (select_target): Take new Input_file* and off_t
4531 arguments, pass them on to recognize method of selector.
4532 * object.cc (make_elf_sized_object): Update caller.
4533 * parameters.cc (parameters_force_valid_target): Likewise.
4534 * incremental.cc (make_sized_incremental_binary): Likewise.
4535 * target-select.h: Update decl.
4536 (Target_selector::recognize): Take new Input_file* argument,
4537 pass it on to do_recognize.
4538 (Target_selector::do_recognize): Take new Input_file* argument.
4539 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4540 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4541 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4542 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4543
4544 * target.h (Target::Target_info): New members isolate_execinstr
4545 and rosegment_gap.
4546 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4547 * arm.cc (Target_arm::arm_info): Update initializer.
4548 * i386.cc (Target_i386::i386_info): Likewise.
4549 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4550 * sparc.cc (Target_sparc::sparc_info): Likewise.
4551 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4552 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4553 * layout.cc (Layout::attach_allocated_section_to_segment):
4554 Take new const Target* argument. If target->isolate_execinstr(), act
4555 like --rosegment.
4556 (Layout::find_first_load_seg): Take new const Target* argument;
4557 if target->isolate_execinstr(), reject PF_X segments.
4558 (Layout::relaxation_loop_body): Update caller.
4559 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4560 reset file offset to zero when we hit LOAD_SEG, and then do a second
4561 loop over the segments before LOAD_SEG to reassign offsets after
4562 addresses have been determined. Handle target->rosegment_gap().
4563 (Layout::attach_section_to_segment): Take new const Target* argument;
4564 pass it to attach_allocated_section_to_segment.
4565 (Layout::make_output_section): Update caller.
4566 (Layout::attach_sections_to_segments): Take new const Target* argument;
4567 pass it to attach_section_to_segment.
4568 * gold.cc (queue_middle_tasks): Update caller.
4569 * layout.h (Layout): Update method decls with new arguments.
4570
4571 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4572 Target_info pointer to use.
4573 (Target_arm::do_make_data_plt): New virtual method.
4574 (Target_arm::make_data_plt): New method that calls it.
4575 (Target_arm::make_plt_entry): Use it.
4576 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4577 for the section alignment.
4578 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4579 method.
4580 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4581 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4582 method.
4583 (Output_data_plt_arm::get_plt_entry_size): Call it.
4584 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4585 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4586 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4587 method.
4588 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4589 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4590 method instead of sizeof(plt_entry).
4591 (Output_data_plt_arm::add_entry): Likewise.
4592 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4593 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4594 than static method.
4595 (Target_arm::plt_entry_size): Likewise.
4596 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4597 Move to ...
4598 (Output_data_plt_arm_standard): ... here, new class.
4599 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4600 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4601 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4602
4603 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4604 Take additional argument for the PLT entry size.
4605 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4606 Use get_plt_entry_size method rather than plt_entry_size variable.
4607 (Output_data_plt_x86_64::reserve_slot): Likewise.
4608 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4609 (Output_data_plt_x86_64::add_entry): Likewise.
4610 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4611 (Output_data_plt_x86_64::address_for_global): Likewise.
4612 (Output_data_plt_x86_64::address_for_local): Likewise.
4613 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4614 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4615 Make method non-static.
4616 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4617 method.
4618 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4619 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4620 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4621 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4622 virtual method.
4623 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4624 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4625 virtual method.
4626 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4627 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4628 virtual method.
4629 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4630 (Output_data_plt_x86_64::plt_entry_size)
4631 (Output_data_plt_x86_64::first_plt_entry)
4632 (Output_data_plt_x86_64::plt_entry)
4633 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4634 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4635 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4636 (Output_data_plt_x86_64_standard): ... here, new class.
4637 (Target_x86_64::Target_x86_64): Take optional argument for the
4638 Target_info pointer to use.
4639 (Target_x86_64::do_make_data_plt): New virtual method.
4640 (Target_x86_64::make_data_plt): New method to call it.
4641 (Target_x86_64::init_got_plt_for_update): Use that.
4642 Call this->plt_->add_eh_frame method here.
4643 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4644 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4645 rather than static method.
4646 (Target_x86_64::plt_entry_size): Likewise.
4647 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4648 rather than plt_entry_size variable. Move guts of PLT filling to...
4649 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4650 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4651 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4652
4653 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4654 additional argument for the section alignment.
4655 Don't do add_eh_frame_for_plt here.
4656 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4657 non-static. Use get_plt_entry_size method rather than plt_entry_size
4658 variable.
4659 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4660 method.
4661 (Output_data_plt_i386::get_plt_entry_size): Call it.
4662 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4663 (Output_data_plt_i386::add_eh_frame): New method to call it.
4664 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4665 method.
4666 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4667 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4668 method.
4669 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4670 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4671 method instead of plt_entry_size.
4672 (Output_data_plt_i386::plt_entry_size)
4673 (Output_data_plt_i386::plt_eh_frame_fde_size)
4674 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4675 (Output_data_plt_i386_standard): ... here, new class.
4676 (Output_data_plt_i386_exec): New class.
4677 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4678 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4679 (Output_data_plt_i386::exec_plt_entry): Move to ...
4680 (Output_data_plt_i386_exec::plt_entry): ... here.
4681 (Output_data_plt_i386_dyn): New class.
4682 (Output_data_plt_i386::first_plt_entry): Move to ...
4683 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4684 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4685 (Output_data_plt_i386_dyn::plt_entry): ... here.
4686 (Target_i386::Target_i386): Take optional argument for the Target_info
4687 pointer to use.
4688 (Target_i386::do_make_data_plt): New virtual method.
4689 (Target_i386::make_data_plt): New method to call it.
4690 (Target_i386::make_plt_section): Use that.
4691 Call this->plt_->add_eh_frame method here.
4692 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4693 rather than plt_entry_size variable.
4694 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4695 (Output_data_plt_i386::address_for_local): Likewise.
4696 (Output_data_plt_i386::do_write): Likewise.
4697 Move guts of PLT filling to...
4698 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4699 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4700 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4701 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4702
4703 2012-05-01 Cary Coutant <ccoutant@google.com>
4704
4705 * dwarf_reader.cc (Dwarf_die::read_attributes)
4706 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4707 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4708 * reduced_debug_output.cc
4709 (Output_reduced_debug_info_section::get_die_end): Remove
4710 DW_FORM_GNU_ref_index. Add default case.
4711
4712 2012-04-26 Mark Wielaard <mjw@redhat.com>
4713
4714 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4715 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4716 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4717 DW_AT_high_pc as offset from DW_AT_low_pc.
4718
4719 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4720 * testsuite/Makefile.in: Regenerate.
4721 * testsuite/gdb_index_test_3.c: New test source file.
4722 * testsuite/gdb_index_test_3.sh: New test source file.
4723
4724 2012-04-25 Ian Lance Taylor <iant@google.com>
4725
4726 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4727 pointer.
4728 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4729 as a class, not a struct.
4730 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4731 (Target_arm::apply_cortex_a8_workaround): Likewise.
4732 * gc.h: Declare Reloc_types as a struct, not a class.
4733 * object.h: Declare Symbols_data as a struct.
4734 * reloc.h: Declare Read_relocs_data as a struct.
4735 * target.h: Declare Relocate_info as a struct.
4736
4737 2012-04-24 David S. Miller <davem@davemloft.net>
4738
4739 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4740 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4741 and R_SPARC_WPLT30.
4742
4743 2012-04-24 Cary Coutant <ccoutant@google.com>
4744
4745 * incremental-dump.cc (find_input_containing_global): Replace
4746 magic number with symbolic constant.
4747 (dump_incremental_inputs): Update version number.
4748 * incremental.cc (Output_section_incremental_inputs): Update version
4749 number; import symbolic constants from Incremental_inputs_reader.
4750 (Incremental_inputs::create_data_sections): Align relocations
4751 section correctly for 64-bit targets.
4752 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4753 constants; add padding.
4754 (Output_section_incremental_inputs::write_header): Add assert for
4755 header_size.
4756 (Output_section_incremental_inputs::write_input_files): Add assert
4757 for input_entry_size.
4758 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4759 add assert for object_info_size, input_section_entry_size,
4760 global_sym_entry_size.
4761 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4762 for data structure sizes; use them.
4763 (Incremental_input_entry_reader): Import symbolic constants from
4764 Incremental_inputs_reader; use them.
4765
4766 2012-04-23 David S. Miller <davem@davemloft.net>
4767
4768 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4769 and elf_flags_set_.
4770 (Target_sparc::Target_sparc): Initialize new fields.
4771 (Target_sparc::do_make_elf_object): New function.
4772 (Target_sparc::do_adjust_elf_header): New function.
4773
4774 2012-04-23 Cary Coutant <ccoutant@google.com>
4775
4776 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4777 CU range table of gdb index.
4778
4779 2012-04-20 David S. Miller <davem@davemloft.net>
4780
4781 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4782 instead of false.
4783
4784 2012-04-16 David S. Miller <davem@davemloft.net>
4785
4786 * sparc.cc (Target_sparc::got_address): New function.
4787 (Sparc_relocate_functions::gdop_hix22): New function.
4788 (Sparc_relocate_functions::gdop_lox10): New function.
4789 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4790 relocs.
4791 (Target_sparc::Scan::local): Likewise if the global symbol is not
4792 preemptible and is not IFUNC.
4793 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4794 transformations for local and non-preemptible non-IFUNC global
4795 symbols.
4796
4797 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4798 writing out 64-bit part of ranges.
4799
4800 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4801 -fpic and -fpie respectively.
4802 * Makefile.in: Regenerate.
4803
4804 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4805 (Target_sparc::Target_sparc): Initialize new field.
4806 (Target_sparc::do_plt_section_for_global): New function.
4807 (Target_sparc::do_plt_section_for_local): New function.
4808 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4809 (Target_sparc::make_plt_section): New function, broken out of
4810 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4811 (Target_sparc::make_plt_entry): Call make_plt_section.
4812 (Target_sparc::make_local_ifunc_plt_entry): New function.
4813 (Target_sparc::rela_ifunc_section): New function.
4814 (Target_sparc::plt_section): Remove const.
4815 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4816 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4817 and ifunc_count_ fields.
4818 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4819 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4820 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4821 (Output_data_plt_sparc::rela_ifunc): New function.
4822 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4823 (Output_data_plt_sparc::has_ifunc_section): New function.
4824 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4825 (Output_data_plt_sparc::address_for_global): New function.
4826 (Output_data_plt_sparc::address_for_local): New function.
4827 (Output_data_plt_sparc::plt_index_to_offset): New function.
4828 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4829 and entry_count.
4830 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4831 entry_count.
4832 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4833 R_SPARC_JMP_IREL to switch.
4834 (Target_sparc::Scan::check_non_pic): Likewise.
4835 (Target_sparc::Scan::local): Handle IFUNC symbols.
4836 (Target_sparc::Scan::local): Likewise.
4837 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4838 and plt_address_for_local.
4839 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4840 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4841
4842 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4843 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4844 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4845 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4846 global relocs too.
4847 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4848 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4849 calls.
4850 * sparc.cc (Target_sparc::Scan::global): Likewise.
4851 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4852
4853 2012-04-16 Cary Coutant <ccoutant@google.com>
4854
4855 * archive.cc (Library_base::should_include_member): Check for
4856 --export-dynamic-symbol.
4857 * options.h (class General_options): Add --export-dynamic-symbol.
4858 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4859 --export-dynamic-symbol.
4860 (Symbol_table::gc_mark_undef_symbols): Likewise.
4861 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4862
4863 2012-04-12 David S. Miller <davem@davemloft.net>
4864
4865 * sparc.cc (Reloc::wdisp10): New relocation method.
4866 (Reloc::h34): Likewise.
4867 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4868 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4869 R_SPARC_WDISP10.
4870 (Target_sparc::Scan::local): Likewise.
4871 (Target_sparc::Scan::global): Likewise.
4872 (Target_sparc::Relocate::relocate): Likewise.
4873
4874 2012-04-09 Cary Coutant <ccoutant@google.com>
4875
4876 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4877 low_pc == 0.
4878
4879 2012-04-06 Ian Lance Taylor <iant@google.com>
4880
4881 * timer.cc: #include <unistd.h>.
4882
4883 2012-04-06 Roland McGrath <mcgrathr@google.com>
4884
4885 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4886 * config.in: Regenerate.
4887 * configure: Regenerate.
4888
4889 2012-04-05 Nick Clifton <nickc@redhat.com>
4890
4891 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4892 (AM_LC_MESSAGES): Add.
4893 * aclocal.m4: Regenerate.
4894 * config.in: Regenerate.
4895 * configure: Regenerate.
4896
4897 2012-03-21 Cary Coutant <ccoutant@google.com>
4898
4899 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4900 * Makefile.in: Regenerate.
4901 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4902 (Sized_elf_reloc_mapper::symbol_section): New function.
4903 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4904 (make_elf_reloc_mapper): New function.
4905 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4906 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4907 (Dwarf_abbrev_table::do_get_abbrev): New function.
4908 (Dwarf_ranges_table::read_ranges_table): New function.
4909 (Dwarf_ranges_table::read_range_list): New function.
4910 (Dwarf_pubnames_table::read_section): New function.
4911 (Dwarf_pubnames_table::read_header): New function.
4912 (Dwarf_pubnames_table::next_name): New function.
4913 (Dwarf_die::Dwarf_die): New function.
4914 (Dwarf_die::read_attributes): New function.
4915 (Dwarf_die::skip_attributes): New function.
4916 (Dwarf_die::set_name): New function.
4917 (Dwarf_die::set_linkage_name): New function.
4918 (Dwarf_die::attribute): New function.
4919 (Dwarf_die::string_attribute): New function.
4920 (Dwarf_die::int_attribute): New function.
4921 (Dwarf_die::uint_attribute): New function.
4922 (Dwarf_die::ref_attribute): New function.
4923 (Dwarf_die::child_offset): New function.
4924 (Dwarf_die::sibling_offset): New function.
4925 (Dwarf_info_reader::check_buffer): New function.
4926 (Dwarf_info_reader::parse): New function.
4927 (Dwarf_info_reader::do_parse): New function.
4928 (Dwarf_info_reader::do_read_string_table): New function.
4929 (Dwarf_info_reader::lookup_reloc): New function.
4930 (Dwarf_info_reader::get_string): New function.
4931 (Dwarf_info_reader::visit_compilation_unit): New function.
4932 (Dwarf_info_reader::visit_type_unit): New function.
4933 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4934 Sized_elf_reloc_mapper.
4935 (Sized_dwarf_line_info::symbol_section): Remove function.
4936 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4937 (Sized_dwarf_line_info::read_line_mappings): Remove object
4938 parameter, adjust callers.
4939 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4940 * dwarf_reader.h: Include <sys/types.h>.
4941 (class Track_relocs): Remove forward declaration.
4942 (class Elf_reloc_mapper): New class.
4943 (class Sized_elf_reloc_mapper): New class.
4944 (class Dwarf_abbrev_table): New class.
4945 (class Dwarf_range_list): New class.
4946 (class Dwarf_ranges_table): New class.
4947 (class Dwarf_pubnames_table): New class.
4948 (class Dwarf_die): New class.
4949 (class Dwarf_info_reader): New class.
4950 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4951 (Sized_dwarf_line_info::symbol_section): Remove member function.
4952 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4953 base class.
4954 * gdb-index.cc: New source file.
4955 * gdb-index.h: New source file.
4956 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4957 and .debug_types sections, call Layout::add_to_gdb_index.
4958 (Sized_relobj_incr::do_section_name): Implement.
4959 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4960 return type; Implement.
4961 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4962 return type.
4963 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4964 parameter list and return type.
4965 (Sized_incr_dynobj::do_section_contents): Likewise.
4966 * layout.cc: Include gdb-index.h.
4967 (Layout::Layout): Initialize gdb_index_data_.
4968 (Layout::init_fixed_output_section): Check for .gdb_index section.
4969 (Layout::add_to_gdb_index): New function. Instantiate.
4970 * layout.h: Add forward declaration for class Gdb_index.
4971 (Layout::add_to_gdb_index): New member function.
4972 (Layout::gdb_index_data_): New data member.
4973 * main.cc: Include gdb-index.h.
4974 (main): Print statistics for gdb index.
4975 * object.cc (Object::section_contents): Move code into
4976 do_section_contents.
4977 (need_decompressed_section): Check for sections needed when building
4978 gdb index.
4979 (build_compressed_section_map): Likewise.
4980 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4981 gdb index.
4982 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4983 sections; call Layout::add_to_gdb_index.
4984 (Sized_relobj_file::do_decompressed_section_contents): Call
4985 do_section_contents directly.
4986 * object.h (Object::do_section_contents): Adjust parameter list and
4987 return type.
4988 (Object::do_decompressed_section_contents): Call do_section_contents
4989 directly.
4990 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4991 return type.
4992 * options.h (class General_options): Add --gdb-index option.
4993 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4994 list and return type.
4995 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4996 * reloc.h (Track_relocs::checkpoint): New function.
4997 (Track_relocs::reset): New function.
4998
4999 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5000 New test cases.
5001 * testsuite/Makefile.in: Regenerate.
5002 * testsuite/gdb_index_test.cc: New test source file.
5003 * testsuite/gdb_index_test_1.sh: New test source file.
5004 * testsuite/gdb_index_test_2.sh: New test source file.
5005
5006 2012-03-19 Doug Kwan <dougkwan@google.com>
5007
5008 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5009 (Target_arm::do_finalize_sections): Remove code which defines
5010 __exidx_start and __exidx_end. Make symbol table parameter
5011 anonymous as it is not used.
5012 * gold.cc (queue_middle_tasks): Call target hook to define any
5013 target-specific symbols.
5014 * target.h (Target::define_standard_symbols): New method.
5015 (Target::do_define_standard_symbols): Same.
5016 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5017 * testsuite/Makefile.in: Regenerate.
5018 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5019 and __exidx_end.
5020 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5021 relocations are generated for __exidx_start and __exidx_end.
5022
5023 2012-03-16 Doug Kwan <dougkwan@google.com>
5024
5025 * testsuite/Makefile.am: Disable test initpri3b.
5026 * testsuite/Makefile.in: Regenerate.
5027
5028 2012-03-15 Doug Kwan <dougkwan@google.com>
5029
5030 * arm.cc (Target_arm::got_section): Make .got section read-only
5031 if -z now is given.
5032
5033 2012-03-15 Ian Lance Taylor <iant@google.com>
5034
5035 PR gold/13850
5036 * layout.cc (Layout::make_output_section): Correctly mark
5037 SHT_INIT_ARRAY, et. al., as relro.
5038
5039 2012-03-14 Doug Kwan <dougkwan@google.com>
5040
5041 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5042 dynamic relocations for protected symbols in shared objects.
5043
5044 2012-03-13 Ian Lance Taylor <iant@google.com>
5045
5046 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5047 keep the larger alignment.
5048
5049 2012-03-12 Cary Coutant <ccoutant@google.com>
5050
5051 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5052 handling of DW_LNE_define_file.
5053
5054 2012-03-12 Cary Coutant <ccoutant@google.com>
5055
5056 * reduced_debug_output.cc
5057 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5058 codes to switch.
5059
5060 2012-02-29 Cary Coutant <ccoutant@google.com>
5061
5062 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5063
5064 2012-02-29 Cary Coutant <ccoutant@google.com>
5065
5066 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5067 Call Object::decompressed_section_contents.
5068 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5069 New dtor.
5070 (Sized_dwarf_line_info::buffer_start_): New data member.
5071 * merge.cc (Output_merge_data::do_add_input_section): Call
5072 Object::decompressed_section_contents.
5073 (Output_merge_string::do_add_input_section): Likewise.
5074 * object.cc (need_decompressed_section): New function.
5075 (build_compressed_section_map): Decompress sections needed later.
5076 (Sized_relobj_file::do_decompressed_section_contents): New function.
5077 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5078 * object.h (Object::decompressed_section_contents): New function.
5079 (Object::discard_decompressed_sections): New function.
5080 (Object::do_decompressed_section_contents): New function.
5081 (Object::do_discard_decompressed_sections): New function.
5082 (Compressed_section_info): New type.
5083 (Compressed_section_map): Include decompressed section contents.
5084 (Sized_relobj_file::do_decompressed_section_contents): New function.
5085 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5086
5087 2012-02-16 Cary Coutant <ccoutant@google.com>
5088
5089 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5090 * testsuite/Makefile.in: Regenerate.
5091
5092 2012-02-14 Cary Coutant <ccoutant@google.com>
5093
5094 * options.cc (General_options::finalize): Disallow -pie and -static.
5095
5096 2012-02-03 Doug Kwan <dougkwan@google.com>
5097
5098 * arm.cc (Arm_relocate_functions::abs8,
5099 Arm_relocate_functions::abs16): Use
5100 Bits::has_signed_unsigned_overflow32.
5101 (Arm_relocate_functions::thm_abs8): Correct range of
5102 overflow check.
5103 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5104 in assertions.
5105
5106 2012-02-02 Doug Kwan <dougkwan@google.com>
5107
5108 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5109 position independent outputs, not just shared objects.
5110
5111 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5112
5113 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5114 * configure: Regenerated.
5115
5116 2012-01-27 Ian Lance Taylor <iant@google.com>
5117
5118 * reloc.h (Bits): New class with static functions, copied from
5119 namespace utils in arm.cc.
5120 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5121 instead.
5122
5123 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5124
5125 * incremental.cc (write_info_blocks): Correct relocation offset.
5126
5127 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5128
5129 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5130 (Relocate::tls_gd_to_le): Likewise.
5131
5132 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5133
5134 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5135
5136 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5137
5138 * configure.ac: Check if -mcmodel=medium works.
5139 * configure: Regenerated.
5140
5141 2012-01-24 Cary Coutant <ccoutant@google.com>
5142
5143 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5144 definition and ...
5145 (read_unsigned_LEB_128_x): ... this new function.
5146 (read_signed_LEB_128): Replaced with inline definition and ...
5147 (read_signed_LEB_128_x): ... this new function.
5148 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5149 (read_unsigned_LEB_128): Add inline definition.
5150 (read_signed_LEB_128_x): New function.
5151 (read_signed_LEB_128): Add inline definition.
5152 * testsuite/Makefile.am (leb128_unittest): New unit test.
5153 * testsuite/Makefile.in: Regenerate.
5154 * testsuite/leb128_unittest.cc: New unit test.
5155
5156 2012-01-23 Ian Lance Taylor <iant@google.com>
5157
5158 PR gold/13617
5159 * i386.cc (Target_i386::do_code_fill): When using a jmp
5160 instruction, pad with nop instructions.
5161 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5162
5163 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5164
5165 * x86_64.cc (gc_process_relocs): Add typename on types used in
5166 template.
5167 (scan_relocs): Likewise.
5168 (relocate_section): Likewise.
5169 (apply_relocation): Likewise.
5170
5171 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5172
5173 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5174 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5175 under x32.
5176
5177 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5178
5179 * x86_64.cc: Initial support for x32.
5180
5181 2012-01-03 Cary Coutant <ccoutant@google.com>
5182
5183 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5184 Use abstract base class for GOT.
5185 * gold/output.h (class Output_data_got_base): New abstract base class.
5186 (class Output_data_got): Derive from new base class, adjust ctors.
5187 (Output_data_got::reserve_slot): Make virtual; rename to
5188 do_reserve_slot; Adjust callers.
5189 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5190 pointer to abstract base class.
5191 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5192
5193 2011-12-18 Ian Lance Taylor <iant@google.com>
5194
5195 * object.h (Relobj::local_symbol_value): New function.
5196 (Relobj::local_plt_offset): New function.
5197 (Relobj::local_has_got_offset): New function.
5198 (Relobj::local_got_offset): New function.
5199 (Relobj::set_local_got_offset): New function.
5200 (Relobj::do_local_symbol_value): New pure virtual function.
5201 (Relobj::do_local_plt_offset): Likewise.
5202 (Relobj::do_local_has_got_offset): Likewise.
5203 (Relobj::do_local_got_offset): Likewise.
5204 (Relobj::do_set_local_got_offset): Likewise.
5205 (Sized_relobj::do_local_has_got_offset): Rename from
5206 local_has_got_offset.
5207 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5208 (Sized_relobj::do_set_local_got_offset): Rename from
5209 set_local_got_offset.
5210 (Sized_relobj_file::do_local_plt_offset): Rename from
5211 local_plt_offset.
5212 (Sized_relobj_file::do_local_symbol_value): New function.
5213 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5214 local_plt_offset.
5215 * output.cc (Output_data_got::Got_entry::write): Change object to
5216 Relobj. Use local_symbol_value.
5217 (Output_data_got::add_global_with_rel): Change rel_dyn to
5218 Output_data_reloc_generic*. Use add_global_generic.
5219 (Output_data_got::add_global_with_rela): Remove. Change all
5220 callers to use add_global_with_rel.
5221 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5222 Output_data_reloc_generic*. Use add_global_generic.
5223 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5224 callers to use add_global_pair_with_rel.
5225 (Output_data_got::add_local): Change object to Relobj*.
5226 (Output_data_got::add_local_plt): Likewise.
5227 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5228 change rel_dyn to Output_data_reloc_generic*. Use
5229 add_local_generic.
5230 (Output_data_got::add_local_with_rela): Remove. Change all
5231 callers to use all_local_with_rel.
5232 (Output_data_got::add_local_pair_with_rel): Change object to
5233 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5234 add_output_section_generic.
5235 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5236 callers to use add_local_pair_with_rel.
5237 (Output_data_got::reserve_local): Change object to Relobj*.
5238 * output.h: (class Output_data_reloc_generic): Add pure virtual
5239 declarations for add_global_generic, add_local_generic,
5240 add_output_section_generic.
5241 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5242 functions for Output_data_reloc_generic. Update declarations for
5243 changes listed in output.cc.
5244 (class Output_data_got): Change template parameter to got_size.
5245 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5246 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5247 function.
5248 (Sized_relobj_incr::do_local_plt_offset): New function.
5249 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5250 add_global_generic.
5251
5252 2011-12-17 Cary Coutant <ccoutant@google.com>
5253
5254 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5255 * resolve.cc (Symbol_table::resolve): Likewise.
5256 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5257 arrays.
5258 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5259
5260 2011-12-16 Ian Lance Taylor <iant@google.com>
5261
5262 * output.h (Output_data_reloc_generic::add): Only call
5263 add_dynamic_reloc if this is a dynamic reloc section.
5264
5265 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5266
5267 PR gold/13505
5268 * target-reloc.h (apply_relocation): Replace <64, false> with
5269 <size, big_endian>.
5270
5271 2011-11-25 Nick Clifton <nickc@redhat.com>
5272
5273 * po/it.po: New Italian translation.
5274
5275 2011-11-17 Sterling Augustine <saugustine@google.com>
5276
5277 * script.cc (script_include_directive): Implement.
5278 (read_script_file): New local variables name and search_path. Update
5279 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5280 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5281 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5282
5283 2011-11-11 Sterling Augustine <saugustine@google.com>
5284
5285 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5286 (file_or_sections_cmd): Likewise.
5287
5288 2011-11-11 Doug Kwan <dougkwan@google.com>
5289
5290 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5291 if --just-symbols is given.
5292
5293 2011-11-10 Doug Kwan <dougkwan@google.com>
5294
5295 PR gold/13362
5296 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5297 when processing data relocs.
5298 * reloc.h (Relocate_functions::rel_unaligned): New method.
5299 (Relocate_functions::pcrel_unaligned): Ditto.
5300 (Relocate_functions::rel32_unaligned): Ditto.
5301 (Relocate_functions::pcrel32_unaligned): Ditto.
5302
5303 2011-11-09 Doug Kwan <dougkwan@google.com>
5304
5305 PR gold/13362
5306 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5307 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5308 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5309 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5310 (Relocate_functions::rel_unaligned): New.
5311 (Relocate_functions::rel32_unaligned): New.
5312 * target-reloc.h (relocate_for_relocatable): Add code to handle
5313 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5314 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5315 arm_unaligned_reloc_r): New targets.
5316 * testsuite/Makefile.in: Regenerate.
5317 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5318 linking.
5319
5320 2011-11-02 Ian Lance Taylor <iant@google.com>
5321
5322 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5323 NATIVE_LINKER.
5324 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5325 * options.cc (General_options::finalize): Use library search path
5326 from configure script if specified. If not native and no sysroot,
5327 only search TOOLLIBDIR.
5328 * options.h (Search_directory::Search_directory): Change name to
5329 const std::string&.
5330 (General_options::add_to_library_path_with_sysroot): Change arg to
5331 const std::string&.
5332 * configure, Makefile.in, config.in: Rebuild.
5333
5334 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5335
5336 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5337 we are working around the ARM1176 Erratum.
5338 * options.h (General_options::fix_arm1176): Add option.
5339 * testsuite/Makefile.am: Add testcases, and keep current ones
5340 working.
5341 * testsuite/Makefile.in: Regenerate.
5342 * testsuite/arm_fix_1176.s: New file.
5343 * testsuite/arm_fix_1176.sh: Likewise.
5344
5345 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5346
5347 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5348 may_use_blx_.
5349 (Target_arm::may_use_blx): Remove method.
5350 (Target_arm::set_may_use_blx): Likewise.
5351 (Target_arm::may_use_v4t_interworking): New method.
5352 (Target_arm::may_use_v5t_interworking): Likewise.
5353 (Target_arm::may_use_blx_): Remove member variable.
5354 (Arm_relocate_functions::arm_branch_common): Check for v5T
5355 interworking.
5356 (Arm_relocate_functions::thumb_branch_common): Likewise.
5357 (Reloc_stub::stub_type_for_reloc): Likewise.
5358 (Target_arm::do_finalize_sections): Correct interworking checks.
5359 * testsuite/Makefile.am: Add new tests.
5360 * testsuite/Makefile.in: Regenerate.
5361 * testsuite/arm_farcall_arm_arm.s: New test.
5362 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5363 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5364 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5365 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5366 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5367 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5368 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5369
5370 2011-10-31 Cary Coutant <ccoutant@google.com>
5371
5372 PR gold/13023
5373 * expression.cc (Expression::eval_with_dot): Add
5374 is_section_dot_assignment parameter.
5375 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5376 absolute and assigning to dot within a section.
5377 * script-sections.cc
5378 (Output_section_element_assignment::set_section_addresses): Pass
5379 dot_section to set_if_absolute.
5380 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5381 as is_section_dot_assignment flag to eval_with_dot.
5382 (Output_section_element_dot_assignment::set_section_addresses):
5383 Likewise.
5384 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5385 parameter. Also set value if relative to dot_section; set the
5386 symbol's output_section.
5387 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5388 parameter. Adjust all callers.
5389 (Expression::eval_maybe_dot): Likewise.
5390 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5391 Adjust all callers.
5392 * testsuite/script_test_2.t: Test assignment of an absolute value
5393 to dot within an output section element.
5394
5395 2011-10-31 Cary Coutant <ccoutant@google.com>
5396
5397 * options.h (class General_options): Add --[no-]gnu-unique options.
5398 * symtab.cc (Symbol_table::sized_write_globals): Convert
5399 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5400
5401 2011-10-31 Cary Coutant <ccoutant@google.com>
5402
5403 PR gold/13359
5404 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5405 unnecessary assertion.
5406 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5407
5408 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5409
5410 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5411 gc_mark_symbol.
5412 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5413 gc_mark_symbol.
5414 Change to just keep the section associated with symbol.
5415 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5416 they are externally visible and --export-dynamic is turned on.
5417 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5418
5419 2011-10-19 Ian Lance Taylor <iant@google.com>
5420
5421 PR gold/13163
5422 * script-sections.cc
5423 (Output_section_element_dot_assignment::needs_output_section): New
5424 function.
5425
5426 2011-10-19 Ian Lance Taylor <iant@google.com>
5427
5428 PR gold/13204
5429 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5430 --section-start option was seen.
5431 * options.h (General_options::any_section_start): New function.
5432
5433 2011-10-18 David S. Miller <davem@davemloft.net>
5434
5435 PR binutils/13301
5436 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5437 member to track relocation locations that have moved during TLS
5438 reloc optimizations.
5439 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5440 (Target_sparc::Relocate::relocate): Adjust view down by 4
5441 bytes if it matches reloc_adjust_addr_.
5442 (Target_sparc::Relocate::relocate_tls): Always move the
5443 __tls_get_addr call delay slot instruction forward 4 bytes when
5444 performing relaxation.
5445
5446 2011-10-18 Cary Coutant <ccoutant@google.com>
5447
5448 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5449 (Output_file::map_no_anonymous): Check for non-zero
5450 return code from posix_fallocate.
5451
5452 2011-10-17 Cary Coutant <ccoutant@google.com>
5453
5454 PR gold/13245
5455 * plugin.cc (is_visible_from_outside): Check for symbols
5456 referenced from dynamic objects.
5457 * resolve.cc (Symbol_table::resolve): Don't count references
5458 from dynamic objects as references from real ELF files.
5459 * testsuite/plugin_test_2.sh: Adjust expected result.
5460
5461 2011-10-17 Cary Coutant <ccoutant@google.com>
5462
5463 * gold.cc: Include timer.h.
5464 (queue_middle_tasks): Stamp time.
5465 (queue_final_tasks): Likewise.
5466 * main.cc (main): Store timer in parameters. Print timers
5467 for each pass.
5468 * parameters.cc (Parameters::Parameters): Initialize timer_.
5469 (Parameters::set_timer): New function.
5470 (set_parameters_timer): New function.
5471 * parameters.h (Parameters::set_timer): New function.
5472 (Parameters::timer): New function.
5473 (Parameters::timer_): New data member.
5474 (set_parameters_timer): New function.
5475 * timer.cc (Timer::stamp): New function.
5476 (Timer::get_pass_time): New function.
5477 * timer.h (Timer::stamp): New function.
5478 (Timer::get_pass_time): New function.
5479 (Timer::pass_times_): New data member.
5480
5481 2011-10-17 Cary Coutant <ccoutant@google.com>
5482
5483 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5484 task for members of lib groups.
5485
5486 2011-10-17 Cary Coutant <ccoutant@google.com>
5487
5488 PR gold/13288
5489 * fileread.cc (File_read::find_view): Add assert.
5490 (File_read::make_view): Move bounds check (replace with assert)...
5491 (File_read::find_or_make_view): ... to here.
5492
5493 2011-10-12 Cary Coutant <ccoutant@google.com>
5494
5495 * output.cc (Output_file::open_base_file): Handle case where
5496 ::read returns less than requested size.
5497
5498 2011-10-10 Cary Coutant <ccoutant@google.com>
5499
5500 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5501 Initialize defined_count_.
5502 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5503 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5504 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5505 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5506 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5507 * incremental.h (Sized_relobj_incr::defined_count_): New data
5508 member.
5509 (Sized_incr_dynobj::defined_count_): New data member.
5510 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5511 Return zeroes instead of internal error.
5512
5513 2011-10-10 Cary Coutant <ccoutant@google.com>
5514
5515 PR gold/13249
5516 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5517 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5518 * output.h (class Output_reloc): Add use_plt_offset flag.
5519 (Output_reloc::type_): Adjust size of bit field.
5520 (Output_reloc::use_plt_offset_): New bit field.
5521 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5522 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5523 flag. Adjust all callers.
5524 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5525 creating RELATIVE relocations.
5526
5527 2011-10-10 Nick Clifton <nickc@redhat.com>
5528
5529 * po/es.po: Updated Spanish translation.
5530 * po/fi.po: Updated Finnish translation.
5531
5532 2011-10-03 Diego Novillo <dnovillo@google.com>
5533
5534 * options.cc (parse_uint): Fix dereference of RETVAL.
5535
5536 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5537
5538 * layout.h (section_order_map_): New member.
5539 (get_section_order_map): New member function.
5540 * output.cc (Output_section::add_input_section): Check for patterns
5541 only when --section-ordering-file is specified.
5542 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5543 output_sections have been formed.
5544 * layout.cc (Layout_Layout): Initialize section_order_map_.
5545 * plugin.cc (update_section_order): Store order in order_map. Do not
5546 update the order.
5547 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5548 * testsuite/Makefile.in: Regenerate.
5549 * testsuite/plugin_section_order.c: New file.
5550 * testsuite/plugin_final_layout.cc: New file.
5551 * testsuite/plugin_final_layout.sh: New file.
5552
5553 2011-09-29 Cary Coutant <ccoutant@google.com>
5554
5555 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5556 Check for NULL.
5557 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5558 symbols during incremental update.
5559 (Symbol_table::add_from_dynobj): Likewise.
5560
5561 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5562 Ian Lance Taylor <iant@google.com>
5563
5564 * symtab.cc (Symbol_table::define_special_symbol): Always
5565 canonicalize version string.
5566
5567 2011-09-26 Cary Coutant <ccoutant@google.com>
5568
5569 * gold.cc (queue_initial_tasks): Move option checks ...
5570 * options.cc (General_options::finalize): ... to here. Disable
5571 some options; make others fatal.
5572
5573 2011-09-26 Cary Coutant <ccoutant@google.com>
5574
5575 gcc PR lto/47247
5576 * plugin.cc (get_symbols_v2): New function.
5577 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5578 (is_referenced_from_outside): New function.
5579 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5580 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5581 (get_symbols): Pass version parameter.
5582 (get_symbols_v2): New function.
5583 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5584 parameter.
5585 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5586 (onload): Add LDPT_GET_SYMBOLS_V2.
5587 (all_symbols_read_hook): Use get_symbols_v2; check for
5588 LDPR_PREVAILING_DEF_IRONLY_EXP.
5589 * testsuite/plugin_test_3.sh: Update expected results.
5590
5591 2011-09-23 Simon Baldwin <simonb@google.com>
5592
5593 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5594 configuration options.
5595 * configure: Regenerate.
5596 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5597 * Makefile.in: Regenerate.
5598 * testsuite/Makefile.in: Regenerate.
5599
5600 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5601
5602 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5603
5604 2011-09-19 Cary Coutant <ccoutant@google.com>
5605
5606 * incremental.cc (can_incremental_update): Fix typo in comment.
5607 * incremental.h (can_incremental_update): Likewise.
5608
5609 2011-09-18 Cary Coutant <ccoutant@google.com>
5610
5611 * incremental.cc (can_incremental_update): New function.
5612 * incremental.h (can_incremental_update): New function.
5613 * layout.cc (Layout::init_fixed_output_section): Call it.
5614 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5615 * object.cc (Sized_relobj_file::do_layout): Call
5616 can_incremental_update.
5617
5618 2011-09-13 Cary Coutant <ccoutant@google.com>
5619
5620 * configure.ac: Check for glibc support for gnu_indirect_function
5621 support with static linking, setting automake conditional
5622 IFUNC_STATIC.
5623 * Makefile.in: Regenerate.
5624 * configure: Regenerate.
5625
5626 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5627 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5628 for IFUNC_STATIC.
5629 * testsuite/Makefile.in: Regenerate.
5630
5631 2011-09-13 Cary Coutant <ccoutant@google.com>
5632
5633 * incremental.cc (Sized_relobj_incr::do_layout): Call
5634 report_comdat_group for kept comdat sections.
5635 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5636 * testsuite/Makefile.in: Regenerate.
5637 * testsuite/incr_comdat_test_1.cc: New source file.
5638 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5639 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5640 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5641
5642 2011-09-13 Ian Lance Taylor <iant@google.com>
5643
5644 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5645 variable external_symbols_offset.
5646
5647 2011-09-12 Ian Lance Taylor <iant@google.com>
5648
5649 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5650 triggered if object has no symbols.
5651
5652 2011-09-09 David S. Miller <davem@davemloft.net>
5653
5654 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5655 (Output_fill_debug_line::do_write): Likewise.
5656
5657 2011-08-29 Cary Coutant <ccoutant@google.com>
5658
5659 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5660 casts to match formatting specs.
5661 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5662
5663 2011-08-26 Cary Coutant <ccoutant@google.com>
5664
5665 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5666 remaining hole size when allocating.
5667 (Layout::make_output_section): Set fill methods for debug sections.
5668 * layout.h (Free_list::Free_list_node): Move from private to
5669 public.
5670 (Free_list::set_min_hole_size): New function.
5671 (Free_list::begin, Free_list::end): New functions.
5672 (Free_list::min_hole_): New data member.
5673 * output.cc: Include dwarf.h.
5674 (Output_fill_debug_info::do_minimum_hole_size): New function.
5675 (Output_fill_debug_info::do_write): New function.
5676 (Output_fill_debug_line::do_minimum_hole_size): New function.
5677 (Output_fill_debug_line::do_write): New function.
5678 (Output_section::Output_section): Initialize new data member.
5679 (Output_section::set_final_data_size): Ensure patch space is larger
5680 than minimum hole size.
5681 (Output_section::do_write): Fill holes in debug sections.
5682 * output.h (Output_fill): New class.
5683 (Output_fill_debug_info): New class.
5684 (Output_fill_debug_line): New class.
5685 (Output_section::set_free_space_fill): New function.
5686 (Output_section::free_space_fill_): New data member.
5687 * testsuite/Makefile.am (incremental_test_3): Add
5688 --incremental-patch option.
5689 (incremental_test_4): Likewise.
5690 (incremental_test_5): Likewise.
5691 (incremental_test_6): Likewise.
5692 (incremental_copy_test): Likewise.
5693 (incremental_common_test_1): Likewise.
5694 * testsuite/Makefile.in: Regenerate.
5695
5696 2011-08-26 Nick Clifton <nickc@redhat.com>
5697
5698 * po/es.po: Updated Spanish translation.
5699
5700 2011-08-01 Cary Coutant <ccoutant@google.com>
5701
5702 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5703 * gold/testsuite/Makefile.in: Regenerate.
5704 * gold/testsuite/justsyms_exec.c: New source file.
5705 * gold/testsuite/justsyms_lib.c: New source file.
5706
5707 2011-08-01 Cary Coutant <ccoutant@google.com>
5708
5709 * layout.cc (Layout::set_segment_offsets): Don't realign text
5710 segment if -Ttext was specified.
5711 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5712 file type.
5713 * object.h (Sized_relobj_file::e_type): New function.
5714 (Sized_relobj_file::e_type_): New data member.
5715 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5716 base address for ET_EXEC files.
5717 * target.cc (Target::do_make_elf_object_implementation): Allow
5718 ET_EXEC files with --just-symbols option.
5719
5720 2011-07-28 Cary Coutant <ccoutant@google.com>
5721
5722 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5723 Add thread_number parameter.
5724 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5725 * workqueue-threads.cc
5726 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5727 current thread if its thread number is greater than desired thread
5728 count.
5729 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5730 Add thread_number parameter.
5731 (Workqueue::should_cancel_thread): Likewise.
5732 (Workqueue::find_runnable_or_wait): Pass thread_number to
5733 should_cancel_thread.
5734 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5735 parameter.
5736
5737 2011-07-22 Sriraman Tallam <tmsriram@google.com>
5738
5739 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5740 only after checking if it cannot be forced local.
5741 * symtab.h (is_externally_visible): Check if the symbol is not forced
5742 local.
5743
5744 2011-07-15 Ian Lance Taylor <iant@google.com>
5745
5746 * options.h (class General_options): Add --print-output-format.
5747 Move -EL next to -EB, for better --help output.
5748 * target-select.cc: Include <cstdio>, "options.h", and
5749 "parameters.h".
5750 (Target_selector::do_target_bfd_name): New function.
5751 (print_output_format): New function.
5752 * target-select.h (class Target_selector): Update declarations.
5753 (Target_selector::target_bfd_name): New function.
5754 (print_output_format): Declare.
5755 * main.cc: Include "target-select.h".
5756 (main): Handle --print-output-format.
5757 * gold.cc: Include "target-select.h".
5758 (queue_initial_tasks): Handle --print-output-format when there are
5759 no input files.
5760 * parameters.cc (parameters_force_valid_target): Give a better
5761 error message if -EB/-EL does not match target.
5762 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5763 function.
5764
5765 2011-07-15 Ian Lance Taylor <iant@google.com>
5766
5767 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5768 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5769 (Output_data_plt_i386::do_write): Write address of .dynamic
5770 section to first entry in .got.plt section.
5771 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5772 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5773 Initialize layout_.
5774 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5775 section to first entry in .got.plt section.
5776 * layout.h (Layout::dynamic_section): New function.
5777
5778 2011-07-13 Sriraman Tallam <tmsriram@google.com>
5779
5780 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5781 to claim_file call.
5782 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5783 input_section_position_, and input_section_glob_.
5784 (read_layout_from_file): Call function section_ordering_specified.
5785 * layout.h (is_section_ordering_specified): New function.
5786 (section_ordering_specified): New function.
5787 (section_ordering_specified_): New boolean member.
5788 * main.cc(main): Call load_plugins after layout object is defined.
5789 * output.cc (Output_section::add_input_section): Use
5790 function section_ordering_specified to check if section ordering is
5791 needed.
5792 * output.cc (Output_section::add_relaxed_input_section): Use
5793 function section_ordering_specified to check if section ordering is
5794 needed.
5795 (Output_section::update_section_layout): New function.
5796 (Output_section::sort_attached_input_sections): Check if input section
5797 must be reordered.
5798 * output.h (Output_section::update_section_layout): New function.
5799 * plugin.cc (get_section_count): New function.
5800 (get_section_type): New function.
5801 (get_section_name): New function.
5802 (get_section_contents): New function.
5803 (update_section_order): New function.
5804 (allow_section_ordering): New function.
5805 (Plugin::load): Add the new interfaces to the transfer vector.
5806 (Plugin_manager::load_plugins): New parameter.
5807 (Plugin_manager::all_symbols_read): New parameter.
5808 (Plugin_manager::claim_file): New parameter. Save the elf object for
5809 unclaimed objects.
5810 (Plugin_manager::get_elf_object): New function.
5811 (Plugin_manager::get_view): Change to directly use the bool to check
5812 if get_view is called from claim_file_hook.
5813 * plugin.h (input_objects): New function
5814 (Plugin__manager::load_plugins): New parameter.
5815 (Plugin_manager::claim_file): New parameter.
5816 (Plugin_manager::get_elf_object): New function.
5817 (Plugin_manager::in_claim_file_handler): New function.
5818 (Plugin_manager::in_claim_file_handler_): New member.
5819 (layout): New function.
5820 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5821 handler with an extra parameter. Make the elf object before calling
5822 claim_file handler.
5823 * testsuite/plugin_test.c (get_section_count): New function pointer.
5824 (get_section_type): New function pointer.
5825 (get_section_name): New function pointer.
5826 (get_section_contents): New function pointer.
5827 (update_section_order): New function pointer.
5828 (allow_section_ordering): New function pointer.
5829 (onload): Check if the new interfaces exist.
5830
5831 2011-07-13 Ian Lance Taylor <iant@google.com>
5832
5833 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5834 relro section.
5835 * x86_64.cc (Target_x86_64::got_section): Likewise.
5836 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5837 (relro_now_test_SOURCES): New variable.
5838 (relro_now_test_DEPENDENCIES): New variable.
5839 (relro_now_test_LDFLAGS): New variable.
5840 (relro_now_test_LDADD): New variable.
5841 (relro_now_test.so): New target.
5842 * testsuite/Makefile.in: Rebuild.
5843
5844 2011-07-12 Ian Lance Taylor <iant@google.com>
5845
5846 PR gold/12980
5847 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5848 GLOB_DAT relocation rather than a RELATIVE relocation for a
5849 protected symbol when creating a shared library.
5850 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5851 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5852 * testsuite/protected_main_1.cc (main): Test that protected
5853 function has same address.
5854
5855 2011-07-11 Ian Lance Taylor <iant@google.com>
5856
5857 PR gold/12979
5858 * options.h (class General_options): Add -Bgroup.
5859 * options.cc (General_options::finalize): If -Bgroup is set,
5860 default to --unresolved-symbols=report-all.
5861 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5862 * target-reloc.h (issue_undefined_symbol_error): Handle
5863 --unresolved-symbols=report-all.
5864
5865 2011-07-08 Ian Lance Taylor <iant@google.com>
5866
5867 PR gold/11985
5868 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5869 if linker script discards key sections.
5870 (Layout::create_dynamic_symtab): Likewise.
5871 (Layout::assign_local_dynsym_offsets): Likewise.
5872 (Layout::sized_create_version_sections): Likewise.
5873 (Layout::create_interp): Likewise.
5874 (Layout::finish_dynamic_section): Likewise.
5875 (Layout::set_dynamic_symbol_size): Likewise.
5876
5877 2011-07-08 Ian Lance Taylor <iant@google.com>
5878
5879 PR gold/12386
5880 * options.h (class General_options): Add --unresolved-symbols.
5881 * target-reloc.h (issue_undefined_symbol_error): Check
5882 --unresolved-symbols. Add comments.
5883
5884 2011-07-08 Ian Lance Taylor <iant@google.com>
5885
5886 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5887 expression more complex.
5888
5889 2011-07-08 Ian Lance Taylor <iant@google.com>
5890
5891 PR gold/11317
5892 * target-reloc.h (issue_undefined_symbol_error): New inline
5893 function, broken out of relocate_section.
5894 (relocate_section): Call issue_undefined_symbol_error.
5895 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5896 there is no TLS segment if we are about to issue an undefined
5897 symbol error.
5898 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5899
5900 2011-07-08 Ian Lance Taylor <iant@google.com>
5901
5902 PR gold/12279
5903 * resolve.cc (Symbol_table::should_override): Add fromtype
5904 parameter. Change all callers. Give error when linking together
5905 TLS and non-TLS symbol.
5906 (Symbol_table::should_override_with_special): Add fromtype
5907 parameter. Change all callers.
5908 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5909 there is no TLS segment if we have reported some errors.
5910 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5911
5912 2011-07-08 Ian Lance Taylor <iant@google.com>
5913
5914 PR gold/12372
5915 * target.h (Target::plt_address_for_global): New function.
5916 (Target::plt_address_for_local): New function.
5917 (Target::plt_section_for_global): Remove.
5918 (Target::plt_section_for_local): Remove.
5919 (Target::do_plt_address_for_global): New virtual function.
5920 (Target::do_plt_address_for_local): New virtual function.
5921 (Target::do_plt_section_for_global): Remove.
5922 (Target::do_plt_section_for_local): Remove.
5923 (Target::register_global_plt_entry): Add Symbol_table and Layout
5924 parameters.
5925 * output.cc (Output_data_got::Got_entry::write): Use
5926 plt_address_for_global and plt_address_for_local.
5927 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5928 address of output section.
5929 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5930 got_irelative_, and irelative_count_ fields. Update
5931 declarations.
5932 (Output_data_plt_i386::has_irelative_section): New function.
5933 (Output_data_plt_i386::entry_count): Add irelative_count_.
5934 (Output_data_plt_i386::set_final_data_size): Likewise.
5935 (class Target_i386): Add got_irelative_ and rel_irelative_
5936 fields. Update declarations.
5937 (Target_i386::Target_i386): Initialize new fields.
5938 (Target_i386::do_plt_address_for_global): New function replacing
5939 do_plt_section_for_global.
5940 (Target_i386::do_plt_address_for_local): New function replacing
5941 do_plt_section_for_local.
5942 (Target_i386::got_section): Create got_irelative_.
5943 (Target_i386::rel_irelative_section): New function.
5944 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5945 fields. Don't define __rel_iplt_{start,end}.
5946 (Output_data_plt_i386::add_entry): Add symtab and layout
5947 parameters. Change all callers. Use different PLT and GOT for
5948 IFUNC symbols.
5949 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5950 layout parameters. Change all callers. Use different PLT and
5951 GOT.
5952 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5953 (Output_data_plt_i386::rel_irelative): New function.
5954 (Output_data_plt_i386::address_for_global): New function.
5955 (Output_data_plt_i386::address_for_local): New function.
5956 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5957 IRELATIVE GOT when changing IFUNC GOT entries.
5958 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5959 reloc.
5960 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5961 if we didn't create an IRELATIVE GOT.
5962 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5963 plt_address_for_local.
5964 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5965 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5966 got_irelative_, and irelative_count_ fields. Update
5967 declarations.
5968 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5969 Initialize new fields. Remove symtab parameter. Change all
5970 callers.
5971 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5972 irelative_count_.
5973 (Output_data_plt_x86_64::has_irelative_section): New function.
5974 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5975 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5976 fields. Update declarations.
5977 (Target_x86_64::Target_x86_64): Initialize new fields.
5978 (Target_x86_64::do_plt_address_for_global): New function replacing
5979 do_plt_section_for_global.
5980 (Target_x86_64::do_plt_address_for_local): New function replacing
5981 do_plt_section_for_local.
5982 (Target_x86_64::got_section): Create got_irelative_.
5983 (Target_x86_64::rela_irelative_section): New function.
5984 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5985 all callers. Don't create __rel_iplt_{start,end}.
5986 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5987 parameters. Change all callers. Use different PLT and GOT for
5988 IFUNC symbols.
5989 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5990 layout parameters. Change all callers. Use different PLT and
5991 GOT.
5992 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5993 parameters. Change all callers. Use different PLT and GOT for
5994 IFUNC symbols.
5995 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5996 (Output_data_plt_x86_64::rela_irelative): New function.
5997 (Output_data_plt_x86_64::address_for_global): New function.
5998 (Output_data_plt_x86_64::address_for_local): New function.
5999 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6000 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6001 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6002 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6003 parameters.
6004 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6005 reloc.
6006 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6007 symbols if we didn't create an IRELATIVE GOT.
6008 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6009 plt_address_for_local.
6010 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6011 * testsuite/ifuncvar1.c: New test file.
6012 * testsuite/ifuncvar2.c: New test file.
6013 * testsuite/ifuncvar3.c: New test file.
6014 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6015 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6016 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6017 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6018 * testsuite/Makefile.in: Rebuild.
6019
6020 2011-07-07 Cary Coutant <ccoutant@google.com>
6021
6022 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6023 (two_file_test_1_ndebug.o): Likewise.
6024 (two_file_test_1b_ndebug.o): Likewise.
6025 (two_file_test_2_ndebug.o): Likewise.
6026 (two_file_test_main_ndebug.o): Likewise.
6027 (incremental_test_2): Link with no-debug versions.
6028
6029 2011-07-06 Cary Coutant <ccoutant@google.com>
6030
6031 * gold/incremental.cc
6032 (Output_section_incremental_inputs::write_info_blocks): Check for
6033 hidden and internal symbols.
6034
6035 2011-07-06 Cary Coutant <ccoutant@google.com>
6036
6037 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6038 Check disposition for startup file.
6039 (Incremental_inputs::report_command_line): Ignore
6040 --incremental-startup-unchanged option.
6041 * options.cc (General_options::parse_incremental_startup_unchanged):
6042 New function.
6043 (General_options::General_options): Initialize new data member.
6044 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6045 (General_options): Add --incremental-startup-unchanged option.
6046 (General_options::incremental_startup_disposition): New function.
6047 (General_options::incremental_startup_disposition_): New data member.
6048
6049 2011-07-06 Cary Coutant <ccoutant@google.com>
6050
6051 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6052 input file index to Script_info ctor.
6053 (Sized_incremental_binary::do_file_has_changed): Find the
6054 command-line argument for files named in scripts.
6055 * incremental.h (Script_info::Script_info): New ctor
6056 with input file index.
6057 (Script_info::input_file_index): New function.
6058 (Script_info::input_file_index_): New data member.
6059 (Incremental_binary::get_library): Add const.
6060 (Incremental_binary::get_script_info): Add const.
6061 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6062 * testsuite/Makefile.am (incremental_test_5): New test case.
6063 (incremental_test_6): New test case.
6064 * testsuite/Makefile.in: Regenerate.
6065
6066 2011-07-06 Cary Coutant <ccoutant@google.com>
6067
6068 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6069 debug output when command lines differ.
6070
6071 2011-07-06 Cary Coutant <ccoutant@google.com>
6072
6073 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6074 --incremental-patch option.
6075 * layout.cc (Free_list::allocate): Extend allocation beyond original
6076 end if enabled.
6077 (Layout::make_output_section): Mark sections that should get
6078 patch space.
6079 * options.cc (parse_percent): New function.
6080 * options.h (parse_percent): New function.
6081 (DEFINE_percent): New macro.
6082 (General_options): Add --incremental-patch option.
6083 * output.cc (Output_section::Output_section): Initialize new data
6084 members.
6085 (Output_section::add_input_section): Print section name when out
6086 of patch space.
6087 (Output_section::add_output_section_data): Likewise.
6088 (Output_section::set_final_data_size): Add patch space when
6089 doing --incremental-full.
6090 (Output_section::do_reset_address_and_file_offset): Remove patch
6091 space.
6092 (Output_segment::set_section_list_addresses): Print debug output
6093 only if --incremental-update.
6094 * output.h (Output_section::set_is_patch_space_allowed): New function.
6095 (Output_section::is_patch_space_allowed_): New data member.
6096 (Output_section::patch_space_): New data member.
6097 * parameters.cc (Parameters::incremental_full): New function.
6098 * parameters.h (Parameters::incremental_full): New function
6099 * testsuite/Makefile.am (incremental_test_2): Add test for
6100 --incremental-patch option.
6101 * testsuite/Makefile.in: Regenerate.
6102 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6103 (t18): Remove function body.
6104
6105 2011-07-05 Doug Kwan <dougkwan@google.com>
6106
6107 PR gold/12771
6108 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6109 Arm_Address type for relocation result.
6110 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6111 overflow check.
6112 (Arm_relocate_functions::abs32): Use unaligned access.
6113 (Arm_relocate_functions::rel32): Ditto.
6114 (Arm_relocate_functions::prel31): Ditto.
6115 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6116 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6117 static data relocations.
6118 * testsuite/Makefile.in: Regnerate.
6119 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6120
6121 2011-07-05 Ian Lance Taylor <iant@google.com>
6122
6123 PR gold/12392
6124 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6125 symbols if necessary.
6126 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6127
6128 2011-07-05 Ian Lance Taylor <iant@google.com>
6129
6130 PR gold/12952
6131 * resolve.cc (Symbol::override_base_with_special): Simply override
6132 version with special symbol version, ignoring previous version.
6133
6134 2011-07-05 Ian Lance Taylor <iant@google.com>
6135
6136 * object.cc (Sized_relobj_file::include_section_group): Add
6137 information to comment about signature location.
6138
6139 2011-07-02 Ian Lance Taylor <iant@google.com>
6140
6141 PR gold/12957
6142 * options.h (class General_options): Add -f and -F.
6143 * options.cc (General_options::finalize): Fatal error if -f/-F
6144 are used without -shared.
6145 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6146
6147 2011-07-02 Ian Lance Taylor <iant@google.com>
6148
6149 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6150
6151 2011-07-01 Ian Lance Taylor <iant@google.com>
6152
6153 PR gold/12525
6154 PR gold/12952
6155 * resolve.cc (Symbol::override_base_with_special): Don't override
6156 the version if the overriding symbol has a different name.
6157 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6158 all callers. If we give an error about an undefined version,
6159 define the base version if necessary.
6160 * dynobj.h (class Versions): Update declaration.
6161 * testsuite/weak_alias_test_5.cc: New file.
6162 * testsuite/weak_alias_test.script: New file.
6163 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6164 and versioned_alias have the right value, and call t2.
6165 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6166 weak_alias_test_5.so.
6167 (weak_alias_test_LDADD): Likewise.
6168 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6169 * testsuite/Makefile.in: Rebuild.
6170
6171 2011-07-01 Ian Lance Taylor <iant@google.com>
6172
6173 PR gold/12525
6174 * options.h (class General_options): Support -z notext.
6175 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6176 -Wl,-z,notext.
6177 (two_file_shared_nonpic.so): Likewise.
6178 (two_file_shared_mixed.so): Likewise.
6179 (two_file_shared_mixed_1.so): Likewise.
6180 (weak_undef_lib_nonpic.so): Likewise.
6181 (alt/weak_undef_lib_nonpic.so): Likewise.
6182 (tls_test_shared_nonpic.so): Likewise.
6183 * testsuite/Makefile.in: Rebuild.
6184
6185 2011-07-01 Ian Lance Taylor <iant@google.com>
6186
6187 PR gold/12525
6188 * configure.ac: Test whether static linking works, setting
6189 the automake conditional HAVE_STATIC.
6190 * testsuite/Makefile.am: Disable tests using -static if
6191 HAVE_STATIC is not true.
6192 * configure, testsuite/Makefile.in: Rebuild.
6193
6194 2011-07-01 Ian Lance Taylor <iant@google.com>
6195
6196 PR gold/12525
6197 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6198 Assert if we see DW_EH_PE_indirect.
6199 * target.h (Target::ehframe_datarel_base): New function.
6200 (Target::do_ehframe_datarel_base): New target function.
6201 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6202 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6203 function.
6204
6205 2011-07-01 Ian Lance Taylor <iant@google.com>
6206
6207 PR gold/12571
6208 * options.h (class General_options): Add
6209 --ld-generated-unwind-info.
6210 * ehframe.cc (Fde::write): Add address parameter. Change all
6211 callers. If associated with PLT, fill in address and size.
6212 (Cie::set_output_offset): Only add merge mapping if there is an
6213 object.
6214 (Cie::write): Add address parameter. Change all callers.
6215 (Eh_frame::add_ehframe_for_plt): New function.
6216 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6217 input_offset_ fields into union u_, with new plt field.
6218 (Fde::Fde): Adjust for new union field.
6219 (Fde::Fde) [Output_data version]: New constructor.
6220 (Fde::add_mapping): Only add merge mapping if there is an object.
6221 (class Cie): Update declarations.
6222 (class Eh_frame): Declare add_ehframe_for_plt.
6223 * layout.cc (Layout::layout_eh_frame): Break out code into
6224 make_eh_frame_section, and call it.
6225 (Layout::make_eh_frame_section): New function.
6226 (Layout::add_eh_frame_for_plt): New function.
6227 * layout.h (class Layout): Update declarations.
6228 * merge.cc (Merge_map::add_mapping): Add assertion.
6229 * i386.cc: Include "dwarf.h".
6230 (class Output_data_plt_i386): Make first_plt_entry,
6231 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6232 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6233 and plt_eh_frame_fde.
6234 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6235 boundary. Call add_eh_frame_for_plt if appropriate.
6236 * x86_64.cc: Include "dwarf.h".
6237 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6238 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6239 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6240 and plt_eh_frame_fde.
6241 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6242 appropriate.
6243
6244 2011-06-29 Ian Lance Taylor <iant@google.com>
6245
6246 PR gold/12629
6247 * object.cc (Sized_relobj_file::layout_section): Change shdr
6248 parameter to be const.
6249 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6250 out of do_layout.
6251 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6252 appropriate. Call layout_eh_frame_section.
6253 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6254 sections.
6255 * object.h (class Sized_relobj_file): Update declarations.
6256
6257 2011-06-29 Ian Lance Taylor <iant@google.com>
6258
6259 PR gold/12652
6260 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6261 modifier.
6262 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6263
6264 2011-06-29 Ian Lance Taylor <iant@google.com>
6265
6266 PR gold/12675
6267 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6268 SHT_X86_64_UNWIND.
6269 * layout.cc (Layout::layout_eh_frame): Likewise.
6270
6271 2011-06-29 Ian Lance Taylor <iant@google.com>
6272
6273 PR gold/12695
6274 * layout.cc (Layout::symtab_section_shndx): New function.
6275 * layout.h (class Layout): Declare symtab_section_shndx.
6276 * output.cc (Output_section::write_header): Call it.
6277
6278 2011-06-29 Ian Lance Taylor <iant@google.com>
6279
6280 PR gold/12818
6281 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6282 symbols which are not used in a relocation.
6283
6284 2011-06-28 Ian Lance Taylor <iant@google.com>
6285
6286 PR gold/12898
6287 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6288 script create indistinguishable segments.
6289 (Layout::set_segment_offsets): Use stable_sort when sorting
6290 segments. Pass this to Compare_segments constructor.
6291 * layout.h (class Layout): Make segment_precedes non-static.
6292 (class Compare_segments): Change from struct to class. Add
6293 layout_ field. Add constructor.
6294 * script-sections.cc
6295 (Script_sections::attach_sections_using_phdrs_clause): Rename
6296 local orphan to is_orphan. Don't report failure to put empty
6297 section in segment. On attachment failure, report name of
6298 section, and attach to first PT_LOAD segment.
6299
6300 2011-06-28 Ian Lance Taylor <iant@google.com>
6301
6302 PR gold/12934
6303 * target-select.cc (Target_selector::Target_selector): Add
6304 emulation parameter. Change all callers.
6305 (select_target_by_bfd_name): Rename from select_target_by_name.
6306 Change all callers.
6307 (select_target_by_emulation): New function.
6308 (supported_emulation_names): New function.
6309 * target-select.h (class Target_selector): Add emulation_ field.
6310 Update declarations.
6311 (Target_selector::recognize_by_bfd_name): Rename from
6312 recognize_by_name. Change all callers.
6313 (Target_selector::supported_bfd_names): Rename from
6314 supported_names. Change all callers.
6315 (Target_selector::recognize_by_emulation): New function.
6316 (Target_selector::supported_emulations): New function.
6317 (Target_selector::emulation): New function.
6318 (Target_selector::do_recognize_by_bfd_name): Rename from
6319 do_recognize_by_name. Change all callers.
6320 (Target_selector::do_supported_bfd_names): Rename from
6321 do_supported_names. Change all callers.
6322 (Target_selector::do_recognize_by_emulation): New function.
6323 (Target_selector::do_supported_emulations): New function.
6324 (select_target_by_bfd_name): Change name in declaration.
6325 (select_target_by_emulation): Declare.
6326 (supported_emulation_names): Declare.
6327 * parameters.cc (parameters_force_valid_target): Try to find
6328 target based on emulation from -m option.
6329 * options.h (class General_options): Change doc string for -m.
6330 * options.cc (help): Print emulations.
6331 (General_options::parse_V): Likewise.
6332 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6333 Add emulation parameter. Change all callers.
6334
6335 2011-06-28 Ian Lance Taylor <iant@google.com>
6336
6337 * target.h (class Target): Add osabi_ field.
6338 (Target::osabi): New function.
6339 (Target::set_osabi): New function.
6340 (Target::Target): Initialize osabi_.
6341 (Target::do_adjust_elf_header): Make pure virtual.
6342 (Sized_target::do_adjust_elf_header): Declare.
6343 * target.cc (Sized_target::do_adjust_elf_header): New function.
6344 (class Sized_target): Instantiate all versions.
6345 * freebsd.h (class Target_freebsd): Remove.
6346 (Target_selector_freebsd::do_recognize): Call set_osabi on
6347 Target.
6348 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6349 (Target_selector_freebsd::set_osabi): Remove.
6350 * i386.cc (class Target_i386): Inherit from Sized_target rather
6351 than Target_freebsd.
6352 * x86_64.cc (class Target_x86_64): Likewise.
6353
6354 2011-06-28 Ian Lance Taylor <iant@google.com>
6355
6356 * target.h (Target::can_check_for_function_pointers): Rewrite.
6357 Make non-virtual.
6358 (Target::can_icf_inline_merge_sections): Likewise.
6359 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6360 (Target::Target_info): Add can_icf_inline_merge_sections field.
6361 (Target::do_can_check_for_function_pointers): New virtual
6362 function.
6363 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6364 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6365 from can_check_for_function_pointers, move in file.
6366 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6367 section_may_have_icf_unsafe_poineters, move in file.
6368 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6369 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6370 Rename from can_check_for_function_pointers, move in file.
6371 (Target_i386::can_icf_inline_merge_sections): Remove.
6372 (Target_i386::i386_info): Initialize
6373 can_icf_inline_merge_sections.
6374 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6375 Initialize can_icf_inline_merge_sections.
6376 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6377 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6378 Rename from can_check_for_function_pointers, move in file.
6379 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6380 (Target_x86_64::x86_64_info): Initialize
6381 can_icf_inline_merge_sections.
6382 * testsuite/testfile.cc (Target_test::test_target_info):
6383 Likewise.
6384 * icf.cc (get_section_contents): Correct formatting.
6385
6386 2011-06-27 Ian Lance Taylor <iant@google.com>
6387
6388 * symtab.cc (Symbol::versioned_name): New function.
6389 (Symbol_table::add_to_final_symtab): Use versioned_name when
6390 appropriate.
6391 (Symbol_table::sized_write_symbol): Likewise.
6392 * symtab.h (class Symbol): Declare versioned_name.
6393 * stringpool.h (class Stringpool_template): Add variant of add
6394 which takes a std::basic_string.
6395 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6396 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6397 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6398 (ver_test_12.o): New target.
6399 * testsuite/Makefile.in: Rebuild.
6400
6401 2011-06-27 Doug Kwan <dougkwan@google.com>
6402
6403 * arm.cc (Arm_relocate_functions::thm_jump8,
6404 Arm_relocate_functions::thm_jump11): Use a wider signed
6405 type to compute offset.
6406 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6407 arm_thm_jump8.
6408 * testsuite/Makefile.in: Regenerate.
6409 * testsuite/arm_branch_in_range.sh: Check test results of
6410 arm_thm_jump11 and arm_thm_jump8.
6411 * testsuite/arm_thm_jump11.s: New test source file.
6412 * testsuite/arm_thm_jump11.t: New linker script.
6413 * testsuite/arm_thm_jump8.s: New test source file.
6414 * testsuite/arm_thm_jump8.t: New linker script.
6415
6416 2011-06-24 Ian Lance Taylor <iant@google.com>
6417
6418 * layout.cc: Include "object.h".
6419 (ctors_sections_in_init_array): New static variable.
6420 (Layout::is_ctors_in_init_array): New function.
6421 (Layout::layout): Add entry to ctors_sections_in_init_array if
6422 appropriate.
6423 * layout.h (class Layout): Declare is_ctors_in_init_array.
6424 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6425 is_ctors_reverse_view is set.
6426 (Sized_relobj_file::write_sections): Add layout parameter. Change
6427 all callers. Set is_ctors_reverse_view field of View_size.
6428 (Sized_relobj_file::reverse_words): New function.
6429 * object.h (Sized_relobj_file::View_size): Add
6430 is_ctors_reverse_view field.
6431 (class Sized_relobj_file): Update declarations.
6432 * testsuite/initpri3.c: New test.
6433 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6434 initpri3b.
6435 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6436 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6437 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6438 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6439 * testsuite/Makefile.in: Rebuild.
6440
6441 2011-06-24 Cary Coutant <ccoutant@google.com>
6442
6443 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6444 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6445 (debug_msg_cdebug.err): New targets.
6446 * testsuite/Makefile.in: Regenerate.
6447 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6448 Fix checks for link with shared library.
6449
6450 2011-06-24 Doug Kwan <dougkwan@google.com>
6451
6452 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6453 skip empty text sections.
6454 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6455
6456 2011-06-22 Ian Lance Taylor <iant@google.com>
6457
6458 PR gold/12910
6459 * options.h (class General_options): Add --ctors-in-init-array.
6460 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6461 friends as SHT_PROGBITS for merging sections.
6462 (Layout::layout): Remove special handling of .init_array and
6463 friends. Don't sort if doing relocatable link. Sort for .ctors
6464 and .dtors if ctors_in_init_array.
6465 (Layout::make_output_section): Force correct section types for
6466 .init_array and friends. Don't sort if doing relocatable link,
6467 Don't sort .ctors and .dtors if ctors_in_init_array.
6468 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6469 (Layout::output_section_name): Add relobj parameter. Change all
6470 callers. Handle .ctors. and .dtors. in code rather than table.
6471 Handle .ctors and .dtors if ctors_in_init_array.
6472 (Layout::match_file_name): New function, moved from output.cc.
6473 * layout.h (class Layout): Update declarations.
6474 * output.cc: Include "layout.h".
6475 (Input_section_sort_entry::get_priority): New function.
6476 (Input_section_sort_entry::match_file_name): Just call
6477 Layout::match_file_name.
6478 (Output_section::Input_section_sort_init_fini_compare::operator()):
6479 Handle .ctors and .dtors. Sort by explicit priority rather than
6480 by name.
6481 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6482 * testsuite/initpri2.c: New test.
6483 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6484 (check_PROGRAMS): Add initpri2.
6485 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6486 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6487 * configure, testsuite/Makefile.in: Rebuild.
6488
6489 2011-06-19 Ian Lance Taylor <iant@google.com>
6490
6491 PR gold/12880
6492 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6493 .interp section to a PT_INTERP segment even if we have seen a
6494 --dynamic-linker option. Don't do it if we have seen a PHDRS
6495 clause in a linker script.
6496 (Layout::finalize): Don't create a .interp section if we've
6497 already create a PT_INTERP segment.
6498 (Layout::create_interp): Always call choose_output_section (revert
6499 patch of 2011-06-17). Don't create PT_INTERP segment.
6500 * script-sections.cc
6501 (Script_sections::create_note_and_tls_segments): Add a .interp
6502 section to a PT_INTERP segment even if we have seen a
6503 --dynamic-linker option.
6504
6505 2011-06-18 Ian Lance Taylor <iant@google.com>
6506
6507 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6508 merely because a non-PT_LOAD segment has a dynamic reloc.
6509
6510 2011-06-18 Ian Lance Taylor <iant@google.com>
6511
6512 * layout.cc (Layout::finish_dynamic_section): Don't create
6513 DT_FLAGS entry if not needed.
6514
6515 2011-06-18 Ian Lance Taylor <iant@google.com>
6516
6517 PR gold/12745
6518 * layout.cc (Layout::layout_eh_frame): Correct handling of
6519 writable .eh_frame section.
6520
6521 2011-06-17 Ian Lance Taylor <iant@google.com>
6522
6523 PR gold/12893
6524 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6525 symbol is redefined with the exact same object and value.
6526
6527 2011-06-17 Ian Lance Taylor <iant@google.com>
6528
6529 PR gold/12880
6530 * layout.h (class Layout): Add interp_segment_ field.
6531 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6532 (Layout::attach_allocated_section_to_segment): If making shared
6533 library, put .interp section in PT_INTERP segment.
6534 (Layout::finalize): Also call create_interp if -dynamic-linker
6535 option was used.
6536 (Layout::create_interp): Assert that there is no PT_INTERP
6537 segment. If not using a SECTIONS clause, use make_output_section.
6538 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6539 * script-sections.cc
6540 (Script_sections::create_note_and_tls_segments): If making shared
6541 library, put .interp section in PT_INTERP segment.
6542
6543 2011-06-17 Ian Lance Taylor <iant@google.com>
6544
6545 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6546 when making a shared library.
6547
6548 2011-06-17 Ian Lance Taylor <iant@google.com>
6549
6550 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6551 parameter. Change all callers. Don't issue warning about PC32
6552 against locally defined symbol.
6553
6554 2011-06-16 Ian Lance Taylor <iant@google.com>
6555
6556 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6557 occurs in same object.
6558
6559 2011-06-14 Alan Modra <amodra@gmail.com>
6560
6561 * po/POTFILES.in: Regenerate.
6562
6563 2011-06-09 Ian Lance Taylor <iant@google.com>
6564
6565 * script-sections.cc
6566 (Orphan_output_section::set_section_addresses): For a relocatable
6567 link set address to 0.
6568
6569 2011-06-09 Cary Coutant <ccoutant@google.com>
6570
6571 PR gold/12804
6572 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6573 used with --compress-debug-sections.
6574 * gold/object.cc (Sized_relobj_file::do_layout): Report
6575 uncompressed size of compressed input sections.
6576
6577 2011-06-08 Cary Coutant <ccoutant@google.com>
6578
6579 PR gold/12804
6580 * testsuite/two_file_test_2_v1.cc: Change initialization of
6581 v2 to keep it in .data.
6582
6583 2011-06-07 Cary Coutant <ccoutant@google.com>
6584
6585 * common.cc (Symbol_table::do_allocate_commons_list): Call
6586 gold_fallback.
6587 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6588 (Errors::fallback): New function.
6589 (gold_fallback): New function.
6590 * errors.h (Errors::fallback): New function.
6591 * gold.cc (gold_exit): Change status parameter to enum; adjust
6592 all callers.
6593 (queue_initial_tasks): Call gold_fallback.
6594 * gold.h: Include cstdlib.
6595 (Exit_status): New enum type.
6596 (gold_exit): Change status parameter to enum.
6597 (gold_fallback): New function.
6598 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6599 (Layout::create_symtab_sections): Likewise.
6600 (Layout::create_shdrs): Likewise.
6601 * main.cc (main): Adjust call to gold_exit.
6602 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6603 (Output_data_got::add_got_entry_pair): Likewise.
6604 (Output_section::add_input_section): Likewise.
6605 (Output_section::add_output_section_data): Likewise.
6606 (Output_segment::set_section_list_addresses): Likewise.
6607 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6608
6609 2011-06-07 Cary Coutant <ccoutant@google.com>
6610
6611 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6612 for incremental links.
6613 * output.cc (Output_segment::set_section_list_addresses): Remove
6614 FIXME and test for TLS or BSS.
6615
6616 2011-06-07 Cary Coutant <ccoutant@google.com>
6617
6618 * testsuite/Makefile.am: Add incremental_copy_test,
6619 incremental_common_test_1.
6620 * testsuite/Makefile.in: Regenerate.
6621 * testsuite/common_test_1_v1.c: New source file.
6622 * testsuite/common_test_1_v2.c: New source file.
6623 * testsuite/copy_test_v1.cc: New source file.
6624
6625 2011-06-07 Cary Coutant <ccoutant@google.com>
6626
6627 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6628 update, allocate common from bss section's free list.
6629 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6630 linker-defined symbols.
6631 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6632 Skip GOT and PLT entries that are no longer referenced.
6633 (Output_section_incremental_inputs::write_info_blocks): Mark
6634 linker-defined symbols.
6635 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6636 * output.cc (Output_section::allocate): New function.
6637 * output.h (Output_section::allocate): New function.
6638 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6639 linker-defined symbols.
6640 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6641 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6642 (Symbol::init_base_output_data): Likewise.
6643 (Symbol::init_base_output_segment): Likewise.
6644 (Symbol::init_base_constant): Likewise.
6645 (Sized_symbol::init_output_data): Likewise.
6646 (Sized_symbol::init_output_segment): Likewise.
6647 (Sized_symbol::init_constant): Likewise.
6648 (Symbol_table::do_define_in_output_data): Likewise.
6649 (Symbol_table::do_define_in_output_segment): Likewise.
6650 (Symbol_table::do_define_as_constant): Likewise.
6651 * symtab.h (Symbol::is_predefined): New function.
6652 (Symbol::init_base_output_data): Add is_predefined parameter.
6653 (Symbol::init_base_output_segment): Likewise.
6654 (Symbol::init_base_constant): Likewise.
6655 (Symbol::is_predefined_): New data member.
6656 (Sized_symbol::init_output_data): Add is_predefined parameter.
6657 (Sized_symbol::init_output_segment): Likewise.
6658 (Sized_symbol::init_constant): Likewise.
6659 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6660
6661 2011-06-07 Cary Coutant <ccoutant@google.com>
6662
6663 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6664 instead of emit_copy_reloc.
6665 (Copy_relocs::emit_copy_reloc): Refactor.
6666 (Copy_relocs::make_copy_reloc): New function.
6667 (Copy_relocs::add_copy_reloc): Remove.
6668 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6669 section.
6670 (Copy_relocs::make_copy_reloc): New function.
6671 (Copy_relocs::add_copy_reloc): Remove.
6672 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6673 unchanged input files.
6674 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6675 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6676 Reserve BSS space for COPY relocations.
6677 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6678 (Output_section_incremental_inputs::write_info_blocks): Record
6679 whether a symbol is copied from a shared object.
6680 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6681 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6682 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6683 (Incremental_input_entry_reader::get_output_symbol_index): Add
6684 is_copy parameter.
6685 (Incremental_binary::emit_copy_relocs): New function.
6686 (Incremental_binary::do_emit_copy_relocs): New function.
6687 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6688 new data member.
6689 (Sized_incremental_binary::add_copy_reloc): New function.
6690 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6691 (Sized_incremental_binary::Copy_reloc): New struct.
6692 (Sized_incremental_binary::Copy_relocs): New typedef.
6693 (Sized_incremental_binary::copy_relocs_): New data member.
6694 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6695 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6696 * target.h (Sized_target::emit_copy_reloc): New function.
6697 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6698
6699 2011-06-02 Cary Coutant <ccoutant@google.com>
6700
6701 PR gold/12163
6702 * gold/archive.cc (Archive::Archive): Initialize new data member.
6703 (Archive::include_all_members): Return if archive has already been
6704 included.
6705 * gold/archive.h (Archive::include_all_members_): New data member.
6706
6707 2011-06-02 Nick Clifton <nickc@redhat.com>
6708
6709 * dynobj.h: Fix spelling mistake in comment.
6710 * output.cc: Likewise.
6711
6712 2011-05-31 Doug Kwan <dougkwan@google.com>
6713 Asier Llano
6714
6715 PR gold/12826
6716 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
6717 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6718 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6719 redundant arm_exidx_test.so.
6720 * testsuite/Makefile.in: Regenerate.
6721 (check_SCRIPTS): Add pr12826.sh
6722 (check_DATA): Add pr12826.stdout
6723 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6724 * testsuite/pr12826.sh: New file.
6725 * testsuite/pr12826_1.s: Ditto.
6726 * testsuite/pr12826_1.s: Ditto.
6727
6728 2011-05-30 Ian Lance Taylor <iant@google.com>
6729
6730 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6731 sections.
6732
6733 2011-05-29 Ian Lance Taylor <iant@google.com>
6734
6735 PR gold/12804
6736 * testsuite/Makefile.am: Use different file name for two_file_test
6737 temporary file for each incremental test.
6738 * testsuite/Makefile.in: Rebuild.
6739
6740 2011-05-29 Ian Lance Taylor <iant@google.com>
6741
6742 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6743 binary input file is empty.
6744
6745 2011-05-27 Ian Lance Taylor <iant@google.com>
6746
6747 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6748 (ver_test_9.so): Likewise.
6749 * testsuite/Makefile.in: Rebuild.
6750
6751 2011-05-26 Cary Coutant <ccoutant@google.com>
6752
6753 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6754 * incremental.cc (Incremental_inputs::report_input_section): Fix
6755 comment, indentation.
6756 (Incremental_inputs::report_comdat_group): New function.
6757 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6758 of data for incremental input file entry.
6759 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6760 group count, COMDAT group signatures.
6761 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6762 an unchanged input file.
6763 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6764 Initialize new data member.
6765 (Incremental_object_entry::add_comdat_group): New function.
6766 (Incremental_object_entry::get_comdat_group_count): New function.
6767 (Incremental_object_entry::get_comdat_signature_key): New function.
6768 (Incremental_object_entry::groups_): New data member.
6769 (Incremental_inputs::report_comdat_group): New function.
6770 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6771 data for incremental input file entry.
6772 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6773 (Incremental_input_entry_reader::get_input_section): Adjust size of
6774 data for incremental input file entry.
6775 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6776 (Incremental_input_entry_reader::get_comdat_group_signature): New
6777 function.
6778 * object.cc (Sized_relobj::include_section_group): Report kept
6779 COMDAT groups for incremental links.
6780
6781 2011-05-24 David Meyer <pdox@google.com>
6782
6783 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6784 with name parameter. Add found_name parameter.
6785 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6786 * dirsearch.h (class Dirsearch): Update declaration.
6787
6788 2011-05-24 Ian Lance Taylor <iant@google.com>
6789
6790 * archive.cc (Library_base::should_include_member): Pull in object
6791 from archive if it defines the entry symbol.
6792 * parameters.cc (Parameters::entry): New function.
6793 * parameters.h (class Parameters): Declare entry.
6794 * output.h (class Output_file_header): Remove entry_ field.
6795 * output.cc (Output_file_header::Output_file_header): Remove entry
6796 parameter. Change all callers.
6797 (Output_file_header::entry): Use parameters->entry.
6798 * gold.cc (queue_middle_tasks): Likewise.
6799 * plugin.cc (Plugin_hook::run): Likewise.
6800
6801 2011-05-24 Cary Coutant <ccoutant@google.com>
6802
6803 * gold.cc (queue_initial_tasks): Pass incremental base filename
6804 to Output_file::open_base_file; don't print error message.
6805 * incremental-dump.cc (main): Adjust call to
6806 Output_file::open_for_modification.
6807 * incremental-dump.cc (main): Likewise.
6808 * incremental.cc (Incremental_inputs::report_command_line):
6809 Ignore --incremental-base option when comparing command lines.
6810 Ignore parameter when given as separate argument.
6811 * options.h (class General_options): Add --incremental-base.
6812 * output.cc (Output_file::Output_file):
6813 (Output_file::open_base_file): Add base_name and writable parameters;
6814 read base file into new file; print error message here.
6815 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6816 callers.
6817 * output.h (Output_file::open_for_modification): Rename to...
6818 (Output_file::open_base_file): ...this; add base_name and
6819 writable parameters; adjust all callers.
6820 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6821 callers.
6822 * testsuite/Makefile.am (incremental_test_4): Test
6823 --incremental-base.
6824 * testsuite/Makefile.in: Regenerate.
6825
6826 2011-05-24 Cary Coutant <ccoutant@google.com>
6827
6828 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6829 incremental_test_4.
6830 * testsuite/Makefile.in: Regenerate.
6831 * testsuite/two_file_test_1_v1.cc: New test source file.
6832 * testsuite/two_file_test_1b_v1.cc: New test source file.
6833 * testsuite/two_file_test_2_v1.cc: New test source file.
6834
6835 2011-05-24 Cary Coutant <ccoutant@google.com>
6836
6837 * dynobj.h (Dynobj::do_dynobj): New function.
6838 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6839 flag and soname for shared objects.
6840 * incremental.cc (Incremental_inputs::report_object): Make
6841 either Incremental_object_entry or Incremental_dynobj_entry; add
6842 soname to string table.
6843 (Incremental_inputs::report_input_section): Add assertion.
6844 (Output_section_incremental_inputs::set_final_data_size): Adjust
6845 type of input file entry for shared libraries; adjust size of
6846 shared library info entry.
6847 (Output_section_incremental_inputs::write_input_files): Write
6848 as_needed flag for shared libraries.
6849 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6850 of input file entry for shared libraries; write soname.
6851 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6852 soname from incremental info.
6853 * incremental.h (enum Incremental_input_flags): Add
6854 INCREMENTAL_INPUT_AS_NEEDED.
6855 (Incremental_input_entry::Incremental_input_entry): Initialize new
6856 data member.
6857 (Incremental_input_entry::set_as_needed): New function.
6858 (Incremental_input_entry::as_needed): New function.
6859 (Incremental_input_entry::do_dynobj_entry): New function.
6860 (Incremental_input_entry::as_needed_): New data member.
6861 (Incremental_object_entry::Incremental_object_entry): Don't check
6862 for shared library.
6863 (Incremental_object_entry::do_type): Likewise.
6864 (class Incremental_dynobj_entry): New class.
6865 (Incremental_input_entry_reader::as_needed): New function.
6866 (Incremental_input_entry_reader::get_soname): New function.
6867 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6868 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6869 size of shared library info entry.
6870 * layout.cc (Layout::finish_dynamic_section): Don't test for
6871 incremental link when adding DT_NEEDED entries.
6872 * object.h (Object::Object): Initialize new data member.
6873 (Object::dynobj): New function.
6874 (Object::set_as_needed): New function.
6875 (Object::as_needed): New function.
6876 (Object::do_dynobj): New function.
6877 (Object::as_needed_): New data member.
6878
6879 2011-05-24 Cary Coutant <ccoutant@google.com>
6880
6881 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6882 info; adjust display of GOT entries.
6883 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6884 vector of input objects; remove file_status_.
6885 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6886 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6887 got_plt reader; call target hooks to reserve GOT entries.
6888 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6889 of input file info header and GOT info entry.
6890 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6891 relocation info.
6892 (Got_plt_view_info::got_descriptor): Remove.
6893 (Got_plt_view_info::sym_index): New data member.
6894 (Got_plt_view_info::input_index): New data member.
6895 (Local_got_offset_visitor::visit): Write input file index.
6896 (Global_got_offset_visitor::visit): Write 0 for input file index.
6897 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6898 with sym_index and input_index.
6899 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6900 incremental info GOT entry; replace got_descriptor with input_index.
6901 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6902 map from input file index to object.
6903 (Sized_relobj_incr::do_layout): Replace direct data member reference
6904 with accessor function.
6905 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6906 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6907 Adjust size of input file info header.
6908 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6909 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6910 (Incremental_input_entry_reader::get_input_section): Adjust size of
6911 input file info header.
6912 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6913 of incremental info GOT entry.
6914 (Incremental_got_plt_reader::get_got_desc): Remove.
6915 (Incremental_got_plt_reader::get_got_symndx): New function.
6916 (Incremental_got_plt_reader::get_got_input_index): New function.
6917 (Sized_incremental_binary::Sized_incremental_binary): Remove
6918 file_status_; add input_objects_.
6919 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6920 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6921 (Sized_incremental_binary::file_is_unchanged): Remove.
6922 (Sized_incremental_binary::set_input_object): New function.
6923 (Sized_incremental_binary::input_object): New function.
6924 (Sized_incremental_binary::file_status_): Remove.
6925 (Sized_incremental_binary::input_objects_): New data member.
6926 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6927 references.
6928 (Sized_relobj_incr::invalid_address): Move to base class.
6929 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6930 class.
6931 (Sized_relobj_incr::do_output_section_offset): Likewise.
6932 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6933 (Sized_relobj_incr::section_offsets_): Likewise.
6934 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6935 function.
6936 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6937 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6938 with accessor function.
6939 (Sized_relobj_file::do_layout): Likewise.
6940 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6941 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6942 (Sized_relobj_file::compute_final_local_value): Replace refs to
6943 section_offsets_ with accessor function.
6944 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6945 * object.h (Relobj::Relobj): Initialize new data members.
6946 (Relobj::add_dyn_reloc): New function.
6947 (Relobj::first_dyn_reloc): New function.
6948 (Relobj::dyn_reloc_count): New function.
6949 (Relobj::first_dyn_reloc_): New data member.
6950 (Relobj::dyn_reloc_count_): New data member.
6951 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6952 references.
6953 (Sized_relobj::Address): New typedef.
6954 (Sized_relobj::invalid_address): Move here from child class.
6955 (Sized_relobj::Sized_relobj): Initialize new data members.
6956 (Sized_relobj::sized_relobj): New function.
6957 (Sized_relobj::is_output_section_offset_invalid): Move here from
6958 child class.
6959 (Sized_relobj::get_output_section_offset): Likewise.
6960 (Sized_relobj::local_has_got_offset): Likewise.
6961 (Sized_relobj::local_got_offset): Likewise.
6962 (Sized_relobj::set_local_got_offset): Likewise.
6963 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6964 (Sized_relobj::clear_got_offsets): New function.
6965 (Sized_relobj::section_offsets): Move here from child class.
6966 (Sized_relobj::do_output_section_offset): Likewise.
6967 (Sized_relobj::do_set_section_offset): Likewise.
6968 (Sized_relobj::Local_got_offsets): Likewise.
6969 (Sized_relobj::local_got_offsets_): Likewise.
6970 (Sized_relobj::section_offsets_): Likewise.
6971 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6972 references.
6973 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6974 class.
6975 (Sized_relobj_file::sized_relobj): New function
6976 (Sized_relobj_file::local_has_got_offset): Move to base class.
6977 (Sized_relobj_file::local_got_offset): Likewise.
6978 (Sized_relobj_file::set_local_got_offset): Likewise.
6979 (Sized_relobj_file::get_output_section_offset): Likewise.
6980 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6981 (Sized_relobj_file::do_output_section_offset): Likewise.
6982 (Sized_relobj_file::do_set_section_offset): Likewise.
6983 (Sized_relobj_file::Local_got_offsets): Likewise.
6984 (Sized_relobj_file::local_got_offsets_): Likewise.
6985 (Sized_relobj_file::section_offsets_): Likewise.
6986 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6987 (all constructors).
6988 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6989 (Output_reloc::get_symbol_index): Likewise.
6990 (Output_reloc::local_section_offset): Likewise.
6991 (Output_reloc::get_address): Likewise.
6992 (Output_reloc::symbol_value): Likewise.
6993 (Output_data_got::reserve_slot): Move to class definition.
6994 (Output_data_got::reserve_local): New function.
6995 (Output_data_got::reserve_slot_for_global): Remove.
6996 (Output_data_got::reserve_global): New function.
6997 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6998 (all constructors, two instantiations).
6999 (Output_reloc::get_relobj): New function (two instantiations).
7000 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7001 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7002 (Output_data_reloc::add_global): Adjust type of relobj.
7003 (Output_data_reloc::add_global_relative): Likewise.
7004 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7005 (Output_data_reloc::add_local): Likewise.
7006 (Output_data_reloc::add_local_relative): Likewise.
7007 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7008 (Output_data_reloc::add_local_section): Likewise.
7009 (Output_data_reloc::add_output_section): Likewise.
7010 (Output_data_reloc::add_absolute): Likewise.
7011 (Output_data_reloc::add_target_specific): Likewise.
7012 (Output_data_got::reserve_slot): Move definition here.
7013 (Output_data_got::reserve_local): New function.
7014 (Output_data_got::reserve_global): New function.
7015 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7016 section_offsets_ with accessor function.
7017 (Sized_relobj_file::write_sections): Likewise.
7018 (Sized_relobj_file::do_relocate_sections): Likewise.
7019 * target.h (Sized_target::reserve_local_got_entry): New function.
7020 (Sized_target::reserve_global_got_entry): New function.
7021 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7022 (Target_x86_64::reserve_global_got_entry): New function.
7023 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7024
7025 2011-05-23 Cary Coutant <ccoutant@google.com>
7026
7027 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7028 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7029 bit when checking got_type.
7030 * incremental.cc (Sized_incremental_binary::setup_readers):
7031 Store symbol table and string table locations; initialize bit vector
7032 of file status flags.
7033 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7034 unchanged files.
7035 (Sized_incremental_binary::do_process_got_plt): New function.
7036 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7037 (Output_section_incremental_inputs::set_final_data_size): Record
7038 file index for each input file.
7039 (Output_section_incremental_inputs::write_got_plt): Store file index
7040 instead of input entry offset for each GOT entry.
7041 * incremental.h
7042 (Incremental_input_entry::Incremental_input_entry): Initialize new
7043 data member.
7044 (Incremental_input_entry::set_offset): Store file index.
7045 (Incremental_input_entry::get_file_index): New function.
7046 (Incremental_input_entry::file_index_): New data member.
7047 (Incremental_binary::process_got_plt): New function.
7048 (Incremental_binary::do_process_got_plt): New function.
7049 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7050 data members.
7051 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7052 (Sized_incremental_binary::set_file_is_unchanged): New function.
7053 (Sized_incremental_binary::file_is_unchanged): New function.
7054 (Sized_incremental_binary::do_process_got_plt): New function.
7055 (Sized_incremental_binary::file_status_): New data member.
7056 (Sized_incremental_binary::main_symtab_loc_): New data member.
7057 (Sized_incremental_binary::main_strtab_loc_): New data member.
7058 * output.cc (Output_data_got::Got_entry::write): Add case
7059 RESERVED_CODE.
7060 (Output_data_got::add_global): Call add_got_entry.
7061 (Output_data_got::add_global_plt): Likewise.
7062 (Output_data_got::add_global_with_rel): Likewise.
7063 (Output_data_got::add_global_with_rela): Likewise.
7064 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7065 (Output_data_got::add_global_pair_with_rela): Likewise.
7066 (Output_data_got::add_local): Call add_got_entry.
7067 (Output_data_got::add_local_plt): Likewise.
7068 (Output_data_got::add_local_with_rel): Likewise.
7069 (Output_data_got::add_local_with_rela): Likewise.
7070 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7071 (Output_data_got::add_local_pair_with_rela): Likewise.
7072 (Output_data_got::reserve_slot): New function.
7073 (Output_data_got::reserve_slot_for_global): New function.
7074 (Output_data_got::add_got_entry): New function.
7075 (Output_data_got::add_got_entry_pair): New function.
7076 (Output_section::add_output_section_data): Edit FIXME.
7077 * output.h
7078 (Output_section_data_build::Output_section_data_build): New
7079 constructor with size parameter.
7080 (Output_data_space::Output_data_space): Likewise.
7081 (Output_data_got::Output_data_got): Initialize new data member; new
7082 constructor with size parameter.
7083 (Output_data_got::add_constant): Call add_got_entry.
7084 (Output_data_got::reserve_slot): New function.
7085 (Output_data_got::reserve_slot_for_global): New function.
7086 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7087 (Output_data_got::add_got_entry): New function.
7088 (Output_data_got::add_got_entry_pair): New function.
7089 (Output_data_got::free_list_): New data member.
7090 * target.h (Sized_target::init_got_plt_for_update): New function.
7091 (Sized_target::register_global_plt_entry): New function.
7092 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7093 Initialize new data member; call init; add constructor with PLT count.
7094 (Output_data_plt_x86_64::init): New function.
7095 (Output_data_plt_x86_64::add_relocation): New function.
7096 (Output_data_plt_x86_64::reserve_slot): New function.
7097 (Output_data_plt_x86_64::free_list_): New data member.
7098 (Target_x86_64::init_got_plt_for_update): New function.
7099 (Target_x86_64::register_global_plt_entry): New function.
7100 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7101 incremental updates.
7102 (Output_data_plt_x86_64::add_relocation): New function.
7103 * testsuite/object_unittest.cc (Object_test): Set default options.
7104
7105 2011-05-16 Ian Lance Taylor <iant@google.com>
7106
7107 * options.h (class General_options): Make -i a synonym for -r.
7108
7109 2011-05-16 Ian Lance Taylor <iant@google.com>
7110
7111 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7112
7113 2011-05-10 Cary Coutant <ccoutant@google.com>
7114
7115 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7116 strip_all (-s).
7117
7118 2011-05-06 Ian Lance Taylor <iant@google.com>
7119
7120 * layout.cc (Layout::layout): If the output section flags change,
7121 update the ordering.
7122
7123 2011-04-25 Cary Coutant <ccoutant@google.com>
7124
7125 * incremental-dump.cc (dump_incremental_inputs): Print local
7126 symbol info for each input file.
7127 * incremental.cc
7128 (Output_section_incremental_inputs::set_final_data_size): Add local
7129 symbol info to input file entries in incremental info.
7130 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7131 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7132 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7133 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7134 implementation.
7135 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7136 (Sized_incr_relobj::do_relocate): Write the local symbols.
7137 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7138 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7139 Adjust size of input file header.
7140 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7141 (Incremental_inputs_reader::get_local_symbol_count): New function.
7142 (Incremental_inputs_reader::get_input_section): Adjust size of input
7143 file header.
7144 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7145 (Sized_incr_relobj::This): New typedef.
7146 (Sized_incr_relobj::sym_size): New const data member.
7147 (Sized_incr_relobj::Local_symbol): New struct.
7148 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7149 (Sized_incr_relobj::do_local_symbol_offset): New function.
7150 (Sized_incr_relobj::local_symbol_count_): New data member.
7151 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7152 (Sized_incr_relobj::local_symbol_index_): New data member.
7153 (Sized_incr_relobj::local_symbol_offset_): New data member.
7154 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7155 (Sized_incr_relobj::local_symbols_): New data member.
7156 * object.h (Relobj::output_local_symbol_count): New function.
7157 (Relobj::local_symbol_offset): New function.
7158 (Relobj::do_output_local_symbol_count): New function.
7159 (Relobj::do_local_symbol_offset): New function.
7160 (Sized_relobj::do_output_local_symbol_count): New function.
7161 (Sized_relobj::do_local_symbol_offset): New function.
7162
7163 2011-04-22 Vladimir Simonov <sv@sw.ru>
7164
7165 * descriptors.cc (set_close_on_exec): New function.
7166 (Descriptors::open): Use set_close_on_exec.
7167 * output.cc (S_ISLNK): Define if not defined.
7168
7169 2011-04-22 Cary Coutant <ccoutant@google.com>
7170
7171 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7172 global symbol map.
7173 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7174 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7175 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7176 relocations.
7177 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7178 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7179 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7180 * incremental.h
7181 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7182 function.
7183 (Incremental_binary::apply_incremental_relocs): New function.
7184 (Incremental_binary::do_apply_incremental_relocs): New function.
7185 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7186 data member.
7187 (Sized_incremental_binary::add_global_symbol): New function.
7188 (Sized_incremental_binary::global_symbol): New function.
7189 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7190 (Sized_incremental_binary::symbol_map_): New data member.
7191 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7192 * target.h (Sized_target::apply_relocation): New function.
7193 * target-reloc.h (apply_relocation): New function.
7194 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7195
7196 2011-04-22 Doug Kwan <dougkwan@google.com>
7197
7198 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7199 flag of a SHT_ARM_EXIDX section.
7200 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7201 * testsuite/Makefile.in: Regenerate.
7202 * testsuite/arm_exidx_test.s: New file.
7203 * testsuite/arm_exidx_test.sh: Same.
7204
7205 2011-04-20 Cary Coutant <ccoutant@google.com>
7206
7207 PR gold/12689
7208 * archive.h (Incremental_archive_entry::Archive_member):
7209 Initialize arg_serial_ (second constructor).
7210
7211 2011-04-17 Ian Lance Taylor <iant@google.com>
7212
7213 * object.cc (Relocate_info::location): Simplify location string.
7214 * errors.cc (Errors::error_at_location): Don't print program
7215 name.
7216 (Errors::warning_at_location): Likewise.
7217 (Errors::undefined_symbol): Likewise.
7218 * testsuite/debug_msg.sh: Update accordingly.
7219
7220 2011-04-14 Cary Coutant <ccoutant@google.com>
7221
7222 * gold/layout.cc (Layout::symtab_section_offset): New function.
7223 * gold/layout.h (Layout::symtab_section_offset): New function.
7224 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7225
7226 2011-04-12 Ian Lance Taylor <iant@google.com>
7227
7228 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7229 with MREMAP_MAYMOVE.
7230 * output.h (class Output_file): Add map_is_allocated_ field.
7231 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7232 not available, provide stubs. If mremap is not available, #define
7233 it to gold_mremap.
7234 (MREMAP_MAYMOVE): Define if not defined.
7235 (Output_file::Output_file): Initialize map_is_allocated_.
7236 (Output_file::resize): Check map_is_allocated_.
7237 (Output_file::map_anonymous): If mmap fails, use malloc.
7238 (Output_file::unmap): Don't do anything for an anonymous map.
7239 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7240 is not available, provide stubs.
7241 (File_read::View::~View): Use free rather than delete[].
7242 (File_read::make_view): Use malloc rather than new[]. If mmap
7243 fails, use malloc.
7244 (File_read::find_or_make_view): Use malloc rather than new[].
7245 * gold.h: Remove HAVE_REMAP code.
7246 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7247 exists. Rename mremap to gold_mremap. If mmap is not available
7248 don't do anything.
7249 * configure, config.in: Rebuild.
7250
7251 2011-04-11 Ian Lance Taylor <iant@google.com>
7252
7253 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7254 initialize local variable v.
7255
7256 2011-04-11 Cary Coutant <ccoutant@google.com>
7257
7258 * archive.cc (Archive::include_member): Adjust call to
7259 report_object.
7260 (Add_archive_symbols::run): Track argument serial numbers.
7261 (Lib_group::include_member): Likewise.
7262 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7263 * archive.h (Incremental_archive_entry::Archive_member):
7264 Initialize arg_serial_.
7265 (Archive_member::arg_serial_): New data member.
7266 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7267 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7268 incremental link.
7269 (Sized_dynobj::do_for_all_local_got_entries): New function.
7270 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7271 function.
7272 * fileread.cc (get_mtime): New function.
7273 * fileread.h (get_mtime): New function.
7274 * gold.cc (queue_initial_tasks): Check for incremental update.
7275 (process_incremental_input): New function.
7276 (queue_middle_tasks): Don't force valid target for incremental
7277 update.
7278 * incremental-dump.cc (find_input_containing_global): Adjust
7279 size of symbol info entry.
7280 (dump_incremental_inputs): Dump argument serial number and
7281 in_system_directory flag; bias shndx by 1; print symbol names
7282 when dumping per-file symbol lists; use new symbol info readers.
7283 * incremental.cc
7284 (Output_section_incremental_inputs:update_data_size): New function.
7285 (Sized_incremental_binary::setup_readers): Setup input readers
7286 for each input file; build maps for files added from libraries
7287 and scripts.
7288 (Sized_incremental_binary::check_input_args): New function.
7289 (Sized_incremental_binary::do_check_inputs): Build map of argument
7290 serial numbers to input arguments.
7291 (Sized_incremental_binary::do_file_has_changed): Rename
7292 do_file_is_unchanged to this; compare file modification times.
7293 (Sized_incremental_binary::do_init_layout): New function.
7294 (Sized_incremental_binary::do_reserve_layout): New function.
7295 (Sized_incremental_binary::do_get_input_reader): Remove.
7296 (Sized_incremental_binary::get_symtab_view): New function.
7297 (Incremental_checker::can_incrementally_link_output_file): Remove.
7298 (Incremental_inputs::report_command_line): Exclude --debug options.
7299 (Incremental_inputs::report_archive_begin): Add parameter; track
7300 argument serial numbers; don't put input file entry for archive
7301 before archive members.
7302 (Incremental_inputs::report_archive_end): Put input file entry
7303 for archive after archive members.
7304 (Incremental_inputs::report_object): Add parameter; track argument
7305 serial numbers and in_system_directory flag.
7306 (Incremental_inputs::report_script): Add parameter; track argument
7307 serial numbers.
7308 (Output_section_incremental_inputs::set_final_data_size): Adjust
7309 size of symbol info entry; check for forwarding symbols.
7310 (Output_section_incremental_inputs::write_input_files): Write
7311 in_system_directory flag and argument serial number.
7312 (Output_section_incremental_inputs::write_info_blocks): Map section
7313 indices between incremental info and original input file; store
7314 input section index for each symbol.
7315 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7316 change operator() to visit().
7317 (class Global_got_offset_visitor): Likewise.
7318 (class Global_symbol_visitor_got_plt):
7319 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7320 classes.
7321 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7322 (Sized_incr_relobj::do_read_symbols): New function.
7323 (Sized_incr_relobj::do_layout): New function.
7324 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7325 (Sized_incr_relobj::do_add_symbols): New function.
7326 (Sized_incr_relobj::do_should_include_member): New function.
7327 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7328 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7329 (Sized_incr_relobj::do_section_size): New function.
7330 (Sized_incr_relobj::do_section_name): New function.
7331 (Sized_incr_relobj::do_section_contents): New function.
7332 (Sized_incr_relobj::do_section_flags): New function.
7333 (Sized_incr_relobj::do_section_entsize): New function.
7334 (Sized_incr_relobj::do_section_address): New function.
7335 (Sized_incr_relobj::do_section_type): New function.
7336 (Sized_incr_relobj::do_section_link): New function.
7337 (Sized_incr_relobj::do_section_info): New function.
7338 (Sized_incr_relobj::do_section_addralign): New function.
7339 (Sized_incr_relobj::do_initialize_xindex): New function.
7340 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7341 (Sized_incr_relobj::do_read_relocs): New function.
7342 (Sized_incr_relobj::do_gc_process_relocs): New function.
7343 (Sized_incr_relobj::do_scan_relocs): New function.
7344 (Sized_incr_relobj::do_count_local_symbols): New function.
7345 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7346 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7347 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7348 (Sized_incr_relobj::do_relocate): New function.
7349 (Sized_incr_relobj::do_set_section_offset): New function.
7350 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7351 (Sized_incr_dynobj::do_read_symbols): New function.
7352 (Sized_incr_dynobj::do_layout): New function.
7353 (Sized_incr_dynobj::do_add_symbols): New function.
7354 (Sized_incr_dynobj::do_should_include_member): New function.
7355 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7356 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7357 (Sized_incr_dynobj::do_section_size): New function.
7358 (Sized_incr_dynobj::do_section_name): New function.
7359 (Sized_incr_dynobj::do_section_contents): New function.
7360 (Sized_incr_dynobj::do_section_flags): New function.
7361 (Sized_incr_dynobj::do_section_entsize): New function.
7362 (Sized_incr_dynobj::do_section_address): New function.
7363 (Sized_incr_dynobj::do_section_type): New function.
7364 (Sized_incr_dynobj::do_section_link): New function.
7365 (Sized_incr_dynobj::do_section_info): New function.
7366 (Sized_incr_dynobj::do_section_addralign): New function.
7367 (Sized_incr_dynobj::do_initialize_xindex): New function.
7368 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7369 (make_sized_incremental_object): New function.
7370 (Incremental_library::copy_unused_symbols): New function.
7371 (Incremental_library::do_for_all_unused_symbols): New function.
7372 * incremental.h (enum Incremental_input_flags): New type.
7373 (class Incremental_checker): Remove.
7374 (Incremental_input_entry::Incremental_input_entry): Add argument
7375 serial number.
7376 (Incremental_input_entry::arg_serial): New function.
7377 (Incremental_input_entry::set_is_in_system_directory): New function.
7378 (Incremental_input_entry::is_in_system_directory): New function.
7379 (Incremental_input_entry::arg_serial_): New data member.
7380 (Incremental_input_entry::is_in_system_directory_): New data member.
7381 (class Script_info): Move here from script.h.
7382 (Script_info::Script_info): Add filename parameter.
7383 (Script_info::filename): New function.
7384 (Script_info::filename_): New data member.
7385 (Incremental_script_entry::Incremental_script_entry): Add argument
7386 serial number.
7387 (Incremental_object_entry::Incremental_object_entry): Likewise.
7388 (Incremental_object_entry::add_input_section): Build list of input
7389 sections with map to original shndx.
7390 (Incremental_object_entry::get_input_section_index): New function.
7391 (Incremental_object_entry::shndx_): New data member.
7392 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7393 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7394 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7395 serial number.
7396 (Incremental_inputs::report_archive_begin): Likewise.
7397 (Incremental_inputs::report_object): Likewise.
7398 (Incremental_inputs::report_script): Likewise.
7399 (class Incremental_global_symbol_reader): New class.
7400 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7401 and store flags and input file type.
7402 (Incremental_input_entry_reader::arg_serial): New function.
7403 (Incremental_input_entry_reader::type): Extract type from flags.
7404 (Incremental_input_entry_reader::is_in_system_directory): New function.
7405 (Incremental_input_entry_reader::get_input_section_count): Call
7406 accessor function for type.
7407 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7408 function for type; adjust size of global symbol entry.
7409 (Incremental_input_entry_reader::get_global_symbol_count): Call
7410 accessor function for type.
7411 (Incremental_input_entry_reader::get_object_count): Likewise.
7412 (Incremental_input_entry_reader::get_object_offset): Likewise.
7413 (Incremental_input_entry_reader::get_member_count): Likewise.
7414 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7415 (Incremental_input_entry_reader::get_member_offset): Likewise.
7416 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7417 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7418 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7419 (Incremental_input_entry_reader::get_global_symbol_reader): New
7420 function.
7421 (Incremental_input_entry_reader::get_output_symbol_index): New
7422 function.
7423 (Incremental_input_entry_reader::type_): Remove.
7424 (Incremental_input_entry_reader::flags_): New data member.
7425 (Incremental_inputs_reader::input_file_offset): New function.
7426 (Incremental_inputs_reader::input_file_index): New function.
7427 (Incremental_inputs_reader::input_file): Call input_file_offset.
7428 (Incremental_inputs_reader::input_file_at_offset): New function.
7429 (Incremental_relocs_reader::get_r_type): Reformat.
7430 (Incremental_relocs_reader::get_r_shndx): Reformat.
7431 (Incremental_relocs_reader::get_r_offset): Reformat.
7432 (Incremental_relocs_reader::data): New function.
7433 (Incremental_binary::Incremental_binary): Initialize new data members.
7434 (Incremental_binary::check_inputs): Add cmdline parameter.
7435 (Incremental_binary::file_is_unchanged): Remove.
7436 (Input_reader::arg_serial): New function.
7437 (Input_reader::get_unused_symbol_count): New function.
7438 (Input_reader::get_unused_symbol): New function.
7439 (Input_reader::do_arg_serial): New function.
7440 (Input_reader::do_get_unused_symbol_count): New function.
7441 (Input_reader::do_get_unused_symbol): New function.
7442 (Incremental_binary::input_file_count): New function.
7443 (Incremental_binary::get_input_reader): Change signature to use
7444 index instead of filename.
7445 (Incremental_binary::file_has_changed): New function.
7446 (Incremental_binary::get_input_argument): New function.
7447 (Incremental_binary::get_library): New function.
7448 (Incremental_binary::get_script_info): New function.
7449 (Incremental_binary::init_layout): New function.
7450 (Incremental_binary::reserve_layout): New function.
7451 (Incremental_binary::output_file): New function.
7452 (Incremental_binary::do_check_inputs): New function.
7453 (Incremental_binary::do_file_is_unchanged): Remove.
7454 (Incremental_binary::do_file_has_changed): New function.
7455 (Incremental_binary::do_init_layout): New function.
7456 (Incremental_binary::do_reserve_layout): New function.
7457 (Incremental_binary::do_input_file_count): New function.
7458 (Incremental_binary::do_get_input_reader): Change signature.
7459 (Incremental_binary::input_args_map_): New data member.
7460 (Incremental_binary::library_map_): New data member.
7461 (Incremental_binary::script_map_): New data member.
7462 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7463 new data members.
7464 (Sized_incremental_binary::output_section): New function.
7465 (Sized_incremental_binary::inputs_reader): Add const.
7466 (Sized_incremental_binary::symtab_reader): Add const.
7467 (Sized_incremental_binary::relocs_reader): Add const.
7468 (Sized_incremental_binary::got_plt_reader): Add const.
7469 (Sized_incremental_binary::get_symtab_view): New function.
7470 (Sized_incremental_binary::Inputs_reader): New typedef.
7471 (Sized_incremental_binary::Input_entry_reader): New typedef.
7472 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7473 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7474 (Sized_incremental_binary::do_file_has_changed): New function.
7475 (Sized_incremental_binary::do_init_layout): New function.
7476 (Sized_incremental_binary::do_reserve_layout): New function.
7477 (Sized_input_reader::Inputs_reader): Remove.
7478 (Sized_input_reader::Input_entry_reader): Remove.
7479 (Sized_input_reader::do_arg_serial): New function.
7480 (Sized_input_reader::do_get_unused_symbol_count): New function.
7481 (Sized_input_reader::do_get_unused_symbol): New function.
7482 (Sized_incremental_binary::do_input_file_count): New function.
7483 (Sized_incremental_binary::do_get_input_reader): Change signature;
7484 use index instead of filename.
7485 (Sized_incremental_binary::section_map_): New data member.
7486 (Sized_incremental_binary::input_entry_readers_): New data member.
7487 (class Sized_incr_relobj): New class.
7488 (class Sized_incr_dynobj): New class.
7489 (make_sized_incremental_object): New function.
7490 (class Incremental_library): New class.
7491 * layout.cc (Free_list::num_lists): New static data member.
7492 (Free_list::num_nodes): New static data member.
7493 (Free_list::num_removes): New static data member.
7494 (Free_list::num_remove_visits): New static data member.
7495 (Free_list::num_allocates): New static data member.
7496 (Free_list::num_allocate_visits): New static data member.
7497 (Free_list::init): New function.
7498 (Free_list::remove): New function.
7499 (Free_list::allocate): New function.
7500 (Free_list::dump): New function.
7501 (Free_list::print_stats): New function.
7502 (Layout_task_runner::run): Resize output file for incremental updates.
7503 (Layout::Layout): Initialize new data members.
7504 (Layout::set_incremental_base): New function.
7505 (Layout::init_fixed_output_section): New function.
7506 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7507 incremental updates.
7508 (Layout::create_gold_note): Do not create gold note section for
7509 incremental updates.
7510 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7511 for incremental updates.
7512 (Layout::set_section_offsets): For incremental updates, allocate space
7513 from free list.
7514 (Layout::create_symtab_sections): Layout with offsets relative to
7515 start of section; for incremental updates, allocate space from free
7516 list.
7517 (Layout::create_shdrs): For incremental updates, allocate space from
7518 free list.
7519 (Layout::finish_dynamic_section): For incremental updates, do not
7520 check --as-needed (fixed in subsequent patch).
7521 * layout.h (class Free_list): New class.
7522 (Layout::set_incremental_base): New function.
7523 (Layout::incremental_base): New function.
7524 (Layout::init_fixed_output_section): New function.
7525 (Layout::allocate): New function.
7526 (Layout::incremental_base_): New data member.
7527 (Layout::free_list_): New data member.
7528 * main.cc (main): Print Free_list statistics.
7529 * object.cc (Relobj::finalize_incremental_relocs): Add
7530 clear_counts parameter; clear counts only when clear_counts is set.
7531 (Sized_relobj::Sized_relobj): Initialize new base class.
7532 (Sized_relobj::do_layout): Don't report special sections.
7533 (Sized_relobj::do_for_all_local_got_entries): New function.
7534 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7535 symtab_off to all symbol table offsets.
7536 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7537 * object.h (class Got_offset_list): Move to top of file.
7538 (Object::Object): Allow case where input_file == NULL.
7539 (Object::~Object): Likewise.
7540 (Object::input_file): Assert that input_file != NULL.
7541 (Object::lock): Allow case where input_file == NULL.
7542 (Object::unlock): Likewise.
7543 (Object::is_locked): Likewise.
7544 (Object::token): Likewise.
7545 (Object::release): Likewise.
7546 (Object::is_incremental): New function.
7547 (Object::get_mtime): New function.
7548 (Object::for_all_local_got_entries): New function.
7549 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7550 (Object::set_is_in_system_directory): New function.
7551 (Object::is_in_system_directory): New function.
7552 (Object::do_is_incremental): New function.
7553 (Object::do_get_mtime): New function.
7554 (Object::do_for_all_local_got_entries): New function.
7555 (Object::is_in_system_directory_): New data member.
7556 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7557 (class Sized_relobj_base): New class.
7558 (class Sized_relobj): Derive from Sized_relobj_base.
7559 (class Sized_relobj::Symbols): Redeclare from base class.
7560 (class Sized_relobj::local_got_offset_list): Remove.
7561 (class Sized_relobj::Output_sections): Redeclare from base class.
7562 (class Sized_relobj::do_for_all_local_got_entries): New function.
7563 (class Sized_relobj::write_local_symbols): Add offset parameter.
7564 (class Sized_relobj::local_symbol_offset_): Update comment.
7565 (class Sized_relobj::local_dynsym_offset_): Update comment.
7566 * options.cc (Input_arguments::add_file): Remove const.
7567 * options.h (Input_file_argument::Input_file_argument):
7568 Initialize arg_serial_ (all constructors).
7569 (Input_file_argument::set_arg_serial): New function.
7570 (Input_file_argument::arg_serial): New function.
7571 (Input_file_argument::arg_serial_): New data member.
7572 (Input_arguments::Input_arguments): Initialize file_count_.
7573 (Input_arguments::add_file): Remove const.
7574 (Input_arguments::number_of_input_files): New function.
7575 (Input_arguments::file_count_): New data member.
7576 (Command_line::number_of_input_files): Call
7577 Input_arguments::number_of_input_files.
7578 * output.cc (Output_segment_headers::Output_segment_headers):
7579 Set current size.
7580 (Output_section::Input_section::current_data_size): New function.
7581 (Output_section::Output_section): Initialize new data members.
7582 (Output_section::add_input_section): Don't do merge sections for
7583 an incremental link; allocate space from free list for an
7584 incremental update.
7585 (Output_section::add_output_section_data): Allocate space from
7586 free list for an incremental update.
7587 (Output_section::update_data_size): New function.
7588 (Output_section::set_fixed_layout): New function.
7589 (Output_section::reserve): New function.
7590 (Output_segment::set_section_addresses): Remove const.
7591 (Output_segment::set_section_list_addresses): Remove const; allocate
7592 space from free list for an incremental update.
7593 (Output_segment::set_offset): Adjust size of RELRO segment for an
7594 incremental update.
7595 * output.h (Output_data::current_data_size): Move here from
7596 child classes.
7597 (Output_data::pre_finalize_data_size): New function.
7598 (Output_data::update_data_size): New function.
7599 (Output_section_headers::update_data_size): new function.
7600 (Output_section_data_build::current_data_size): Move to Output_data.
7601 (Output_data_strtab::update_data_size): New function.
7602 (Output_section::current_data_size): Move to Output_data.
7603 (Output_section::set_fixed_layout): New function.
7604 (Output_section::has_fixed_layout): New function.
7605 (Output_section::reserve): New function.
7606 (Output_section::update_data_size): New function.
7607 (Output_section::has_fixed_layout_): New data member.
7608 (Output_section::free_list_): New data member.
7609 (Output_segment::set_section_addresses): Remove const.
7610 (Output_segment::set_section_list_addresses): Remove const.
7611 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7612 New function.
7613 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7614 New function.
7615 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7616 parameter when calling Add_symbols constructor; store argument
7617 serial number for members of a lib group.
7618 (Add_symbols::locks): Allow case where token == NULL.
7619 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7620 (Read_member::~Read_member): New function.
7621 (Read_member::is_runnable): New function.
7622 (Read_member::locks): New function.
7623 (Read_member::run): New function.
7624 (Check_script::~Check_script): New function.
7625 (Check_script::is_runnable): New function.
7626 (Check_script::locks): New function.
7627 (Check_script::run): New function.
7628 (Check_library::~Check_library): New function.
7629 (Check_library::is_runnable): New function.
7630 (Check_library::locks): New function.
7631 (Check_library::run): New function.
7632 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7633 (Add_symbols::library_): New data member.
7634 (class Read_member): New class.
7635 (class Check_script): New class.
7636 (class Check_library): New class.
7637 * reloc.cc (Read_relocs::is_runnable): Allow case where
7638 token == NULL.
7639 (Read_relocs::locks): Likewise.
7640 (Scan_relocs::locks): Likewise.
7641 (Relocate_task::locks): Likewise.
7642 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7643 to clear counters.
7644 (Sized_relobj::incremental_relocs_scan): Fix comment.
7645 (Sized_relobj::do_relocate): Pass output file offset to
7646 write_local_symbols.
7647 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7648 from class declaration.
7649 * script.cc (read_input_script): Allocate Script_info; pass
7650 argument serial number to report_script.
7651 * script.h (class Script_info): Move to incremental.h.
7652 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7653 * symtab.h (Symbol_table::add_from_incrobj): New function.
7654 (Symbol_table::set_file_offset): New function.
7655
7656 2011-04-05 Cary Coutant <ccoutant@google.com>
7657
7658 * incremental-dump.cc (dump_incremental_inputs): Change signature
7659 to take a Sized_incremental_binary; change caller. Use readers
7660 in Sized_incremental_binary.
7661 * incremental.cc
7662 (Sized_incremental_binary::find_incremental_inputs_sections):
7663 Rename do_find_incremental_inputs_sections to this.
7664 (Sized_incremental_binary::setup_readers): New function.
7665 (Sized_incremental_binary::do_check_inputs): Check
7666 has_incremental_info_ flag; move setup code to setup_readers;
7667 use input readers.
7668 (Sized_incremental_binary::do_file_is_unchanged): New function.
7669 (Sized_incremental_binary::do_get_input_reader): New function.
7670 * incremental.h (class Incremental_binary): Move to end of file.
7671 (Incremental_binary::file_is_unchanged): New function.
7672 (Incremental_binary::do_file_is_unchanged): New function.
7673 (Incremental_binary::Input_reader): New class.
7674 (Incremental_binary::get_input_reader): New function.
7675 (class Sized_incremental_binary): Move to end of file.
7676 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7677 input section reader classes.
7678 (Sized_incremental_binary::has_incremental_info): New function.
7679 (Sized_incremental_binary::inputs_reader): New function.
7680 (Sized_incremental_binary::symtab_reader): New function.
7681 (Sized_incremental_binary::relocs_reader): New function.
7682 (Sized_incremental_binary::got_plt_reader): New function.
7683 (Sized_incremental_binary::do_file_is_unchanged): New function.
7684 (Sized_incremental_binary::Sized_input_reader): New class.
7685 (Sized_incremental_binary::get_input_reader): New function.
7686 (Sized_incremental_binary::find_incremental_inputs_sections):
7687 Rename do_find_incremental_inputs_sections to this.
7688 (Sized_incremental_binary::setup_readers): New function.
7689 (Sized_incremental_binary::has_incremental_info_): New data member.
7690 (Sized_incremental_binary::inputs_reader_): New data member.
7691 (Sized_incremental_binary::symtab_reader_): New data member.
7692 (Sized_incremental_binary::relocs_reader_): New data member.
7693 (Sized_incremental_binary::got_plt_reader_): New data member.
7694 (Sized_incremental_binary::current_input_file_): New data member.
7695
7696 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7697
7698 PR gold/12640
7699 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7700 violation.
7701
7702 2011-03-30 Cary Coutant <ccoutant@google.com>
7703
7704 * archive.cc (Archive::include_member): Adjust call to report_object.
7705 (Add_archive_symbols::run): Add script_info to call to
7706 report_archive_begin.
7707 (Lib_group::include_member): Adjust call to report_object.
7708 (Add_lib_group_symbols::run): Adjust call to report_object.
7709 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7710 blocks. Add object count for script input files.
7711 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7712 script_info parameter; change all callers.
7713 (Incremental_inputs::report_object): Add script_info parameter;
7714 change all callers.
7715 (Incremental_inputs::report_script): Store backpointer to
7716 incremental info entry.
7717 (Output_section_incremental_inputs::set_final_data_size): Record
7718 additional information for scripts.
7719 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7720 * incremental.h (Incremental_script_entry::add_object): New function.
7721 (Incremental_script_entry::get_object_count): New function.
7722 (Incremental_script_entry::get_object): New function.
7723 (Incremental_script_entry::objects_): New data member; adjust
7724 constructor.
7725 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7726 (Incremental_inputs::report_object): Add script_info parameter.
7727 (Incremental_inputs_reader::get_object_count): New function.
7728 (Incremental_inputs_reader::get_object_offset): New function.
7729 * options.cc (Input_arguments::add_file): Return reference to
7730 new input argument.
7731 * options.h (Input_argument::set_script_info): New function.
7732 (Input_argument::script_info): New function.
7733 (Input_argument::script_info_): New data member; adjust all
7734 constructors.
7735 (Input_file_group::add_file): Return reference to new input argument.
7736 (Input_file_lib::add_file): Likewise.
7737 (Input_arguments::add_file): Likewise.
7738 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7739 * script.cc (Parser_closure::Parser_closure): Add script_info
7740 parameter; adjust all callers.
7741 (Parser_closure::script_info): New function.
7742 (Parser_closure::script_info_): New data member.
7743 (read_input_script): Report scripts earlier to incremental info.
7744 (script_add_file): Set script_info in Input_argument.
7745 (script_add_library): Likewise.
7746 * script.h (Script_options::Script_info): Rewrite class.
7747
7748 2011-03-29 Cary Coutant <ccoutant@google.com>
7749
7750 * archive.cc (Library_base::should_include_member): Move
7751 method here from class Archive.
7752 (Archive::Archive): Initialize base class.
7753 (Archive::should_include_member): Move to base class.
7754 (Archive::do_for_all_unused_symbols): New function.
7755 (Add_archive_symbols::run): Remove redundant access to
7756 incremental_inputs.
7757 (Lib_group::Lib_group): Initialize base class.
7758 (Lib_group::do_filename): New function.
7759 (Lib_group::include_member): Pass pointer to Lib_group to
7760 report_object.
7761 (Lib_group::do_for_all_unused_symbols): New function.
7762 (Add_lib_group_symbols::run): Report archive information for
7763 incremental links.
7764 * archive.h (class Library_base): New base class.
7765 (class Archive): Derive from Library_base.
7766 (Archive::filename): Move to base class.
7767 (Archive::set_incremental_info): Likewise.
7768 (Archive::incremental_info): Likewise.
7769 (Archive::Should_include): Likewise.
7770 (Archive::should_include_member): Likewise.
7771 (Archive::Armap_entry): Remove.
7772 (Archive::Unused_symbol_iterator): Remove.
7773 (Archive::unused_symbols_begin): Remove.
7774 (Archive::unused_symbols_end): Remove.
7775 (Archive::do_filename): New function.
7776 (Archive::do_get_mtime): New function.
7777 (Archive::do_for_all_unused_symbols): New function.
7778 (Archive::task_): Move to base class.
7779 (Archive::incremental_info_): Likewise.
7780 (class Lib_group): Derive from Library_base.
7781 (Lib_group::do_filename): New function.
7782 (Lib_group::do_get_mtime): New function.
7783 (Lib_group::do_for_all_unused_symbols): New function.
7784 (Lib_group::task_): Move to base class.
7785 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7786 function.
7787 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7788 function.
7789 * incremental.cc (Incremental_inputs::report_archive_begin):
7790 Use Library_base; call library's get_mtime; add incremental inputs
7791 entry before members.
7792 (class Unused_symbol_visitor): New class.
7793 (Incremental_inputs::report_archive_end): Use Library_base; use
7794 visitor class to record unused symbols; don't add incremental inputs
7795 entry after members.
7796 (Incremental_inputs::report_object): Use Library_base.
7797 * incremental.h
7798 (Incremental_archive_entry::Incremental_archive_entry): Remove
7799 unused Archive parameter.
7800 (Incremental_inputs::report_archive_begin): Use Library_base.
7801 (Incremental_inputs::report_archive_end): Likewise.
7802 (Incremental_inputs::report_object): Likewise.
7803 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7804 function.
7805 * object.h (Object::for_all_global_symbols): New function.
7806 (Object::do_for_all_global_symbols): New function.
7807 (Sized_relobj::do_for_all_global_symbols): New function.
7808 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7809 function.
7810 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7811 function.
7812
7813 2011-03-27 Ian Lance Taylor <iant@google.com>
7814
7815 * archive.cc (Archive::interpret_header): Return -1 if something
7816 goes wrong. Change callers accordingly.
7817
7818 2011-03-25 Cary Coutant <ccoutant@google.com>
7819
7820 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7821 * testsuite/Makefile.in: Regenerate.
7822
7823 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
7824
7825 * plugin.cc (get_view): New.
7826 (Plugin::load): Pass get_view to the plugin.
7827 (Plugin_manager::get_view): New.
7828
7829 2011-03-21 Ian Lance Taylor <iant@google.com>
7830
7831 * testsuite/final_layout.sh: Rewrite to not use dc.
7832 * testsuite/relro_test.sh: Fail if dc is not present.
7833
7834 2011-03-21 Sriraman Tallam <tmsriram@google.com>
7835
7836 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7837 Change == to -eq.
7838 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7839 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7840 Change == to -eq.
7841 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7842 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7843
7844 2011-03-14 Ian Lance Taylor <iant@google.com>
7845
7846 * script-sections.cc (Sort_output_sections::script_compare):
7847 Rename from is_before, change return type.
7848 (Sort_output_sections::operator()): Adjust accordingly.
7849
7850 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7851
7852 PR gold/12572
7853 * testsuite/odr_violation2.cc: Add comment to make all error line
7854 numbers double digits.
7855 * testsuite/debug_msg.sh: Adjust expected errors.
7856
7857 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7858
7859 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7860 but mark earlier ones as non-canonical
7861 (offset_to_iterator): Update search target and example
7862 (do_addr2line): Return extra lines in a vector*
7863 (format_file_lineno): Extract from do_addr2line
7864 (one_addr2line): Add vector* out-param
7865 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7866 when a lineno entry appeared last for its instruction
7867 (Dwarf_line_info): Add vector* out-param
7868 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7869 * symtab.cc (Odr_violation_compare): Include the lineno in the
7870 comparison again.
7871 (linenos_from_loc): New. Combine the canonical line for an
7872 address with its other lines.
7873 (True_if_intersect): New. Helper functor to make
7874 std::set_intersection a query.
7875 (detect_odr_violations): Compare sets of lines instead of just
7876 one line for each function. This became less deterministic, but
7877 has fewer false positives.
7878 * symtab.h: Declarations.
7879 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7880 mix an optimized and non-optimized object in the same binary
7881 (odr_violation2.so): Same.
7882 * testsuite/Makefile.in: Regenerate from Makefile.am.
7883 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7884 * testsuite/debug_msg.sh: Update line numbers and add
7885 assertions.
7886 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7887 non-optimized context.
7888 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7889 isn't inlined, and use OdrDerived in an optimized context.
7890 * testsuite/odr_header1.h: Defines OdrDerived, where
7891 optimization will change the
7892 first-instruction-in-the-destructor's file and line number.
7893 * testsuite/odr_header2.h: Defines OdrBase.
7894
7895 2011-03-09 Ian Lance Taylor <iant@google.com>
7896
7897 * fileread.cc (File_read::clear_views): Don't delete the whole
7898 file view.
7899
7900 2011-03-08 Ian Lance Taylor <iant@google.com>
7901
7902 PR gold/12525
7903 * fileread.cc: #include <climits>.
7904 (GOLD_IOV_MAX): Define.
7905 (File_read::read_multiple): Limit number of entries by iov_max.
7906 * fileread.h (class File_read): Always set max_readv_entries to
7907 128.
7908
7909 2011-03-07 Ian Lance Taylor <iant@google.com>
7910
7911 PR gold/12525
7912 * options.h (class General_options): Add -dy and -dn.
7913
7914 2011-03-02 Cary Coutant <ccoutant@google.com>
7915
7916 * testsuite/script_test_9.t: Add TLS segment.
7917
7918 2011-03-02 Simon Baldwin <simonb@google.com>
7919
7920 * configure.ac: Add check for gnu_indirect_function support in
7921 the toolchain building binutils.
7922 * configure: Rebuild.
7923
7924 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
7925
7926 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7927 plugin only symbols.
7928 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7929 in plugin files as not needed in the symbol table.
7930
7931 2011-02-11 Sriraman Tallam <tmsriram@google.com>
7932
7933 * output.cc (Output_section::add_input_section): Delay fill
7934 generation for section ordering.
7935
7936 2011-02-09 Ian Lance Taylor <iant@google.com>
7937
7938 PR gold/12316
7939 * object.h (class Sized_relobj): Remove clear_local_symbols.
7940 * reloc.cc (Sized_relobj::do_relocate): Don't call
7941 clear_local_symbols.
7942
7943 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
7944
7945 * plugin.cc (is_visible_from_outside): Return true for symbols
7946 in the -u option.
7947
7948 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7949
7950 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7951 filename.
7952
7953 2011-02-02 Sriraman Tallam <tmsriram@google.com>
7954
7955 * icf.h (is_section_foldable_candidate): Change type of parameter
7956 to std::string.
7957 * icf.cc (Icf::find_identical_sections): Change type of local variable
7958 section_name to be std::string.
7959 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7960
7961 2011-01-25 Ian Lance Taylor <iant@google.com>
7962
7963 * script.cc (script_add_extern): Rewrite to use
7964 add_symbol_reference.
7965
7966 2011-01-25 Doug Kwan <dougkwan@google.com>
7967
7968 * icf.cc (get_section_contents): Always lock section's object.
7969
7970 2011-01-24 Ian Lance Taylor <iant@google.com>
7971
7972 * options.h (class General_options): Accept
7973 --no-detect-odr-violations.
7974
7975 2011-01-24 Ian Lance Taylor <iant@google.com>
7976
7977 * version.cc (version_string): Bump to 1.11.
7978
7979 2011-01-24 Ian Lance Taylor <iant@google.com>
7980
7981 * plugin.cc (class Plugin_rescan): Define new class.
7982 (Plugin_manager::claim_file): Set any_claimed_.
7983 (Plugin_manager::save_archive): New function.
7984 (Plugin_manager::save_input_group): New function.
7985 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7986 necessary.
7987 (Plugin_manager::new_undefined_symbol): New function.
7988 (Plugin_manager::rescan): New function.
7989 (Plugin_manager::rescannable_defines): New function.
7990 (Plugin_manager::add_input_file): Set any_added_.
7991 * plugin.h (class Plugin_manager): define new fields rescannable_,
7992 undefined_symbols_, any_claimed_, and any_added_. Declare
7993 Plugin_rescan as friend. Declare new functions.
7994 (Plugin_manager::Rescannable): Define type.
7995 (Plugin_manager::Rescannable_list): Define type.
7996 (Plugin_manager::Undefined_symbol_list): Define type.
7997 (Plugin_manager::Plugin_manager): Initialize new fields.
7998 * archive.cc (Archive::defines_symbol): New function.
7999 (Add_archive_symbols::run): Pass archive to plugins if any.
8000 * archive.h (class Archive): Declare defines_symbol.
8001 * readsyms.cc (Input_group::~Input_group): New function.
8002 (Finish_group::run): Pass input_group to plugins if any.
8003 * readsyms.h (class Input_group): Declare destructor.
8004 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8005 any.
8006
8007 2011-01-10 Ian Lance Taylor <iant@google.com>
8008
8009 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8010 section as relro.
8011 (Layout::set_segment_offsets): Reset increase_relro before calling
8012 set_section_addresses a second time.
8013
8014 2011-01-04 Cary Coutant <ccoutant@google.com>
8015
8016 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8017 sections before NOBITS sections.
8018
8019 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8020
8021 * version.cc (print_version): Update copyright to 2011.
8022
8023 2010-12-23 Cary Coutant <ccoutant@google.com>
8024
8025 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8026 of OS to this->add. Add OD parameter to second form of the function.
8027
8028 2010-12-20 Ian Lance Taylor <iant@google.com>
8029
8030 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8031 second of two consecutive entries with same offset.
8032
8033 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8034
8035 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8036 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8037 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8038 to avoid unneeded links against $(LDADD).
8039 * testsuite/Makefile.in: Regenerate.
8040
8041 2010-12-15 Ian Lance Taylor <iant@google.com>
8042
8043 PR gold/12324
8044 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8045 for R_X86_64_32 and R_X86_64_PC32.
8046 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8047 ver_matching_def_pic.o.
8048 (ver_matching_def_pic.o): New target.
8049
8050 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8051
8052 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8053 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8054 Move definition before File_read::View member definitions.
8055 (File_read::View::~View): Initialize and hold lock before
8056 updating current_mapped_bytes.
8057
8058 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8059
8060 * dwarf_reader.cc: Remove outdated comment.
8061 * gold-threads.cc: Fix typo in error message.
8062 * archive.cc: Fix typos in comments.
8063 * archive.h: Likewise.
8064 * arm-reloc-property.cc: Likewise.
8065 * arm-reloc-property.h: Likewise.
8066 * arm-reloc.def: Likewise.
8067 * arm.cc: Likewise.
8068 * attributes.h: Likewise.
8069 * cref.cc: Likewise.
8070 * ehframe.cc: Likewise.
8071 * fileread.h: Likewise.
8072 * gold.h: Likewise.
8073 * i386.cc: Likewise.
8074 * icf.cc: Likewise.
8075 * incremental.h: Likewise.
8076 * int_encoding.cc: Likewise.
8077 * layout.h: Likewise.
8078 * main.cc: Likewise.
8079 * merge.h: Likewise.
8080 * object.cc: Likewise.
8081 * object.h: Likewise.
8082 * options.cc: Likewise.
8083 * readsyms.cc: Likewise.
8084 * reduced_debug_output.cc: Likewise.
8085 * reloc.cc: Likewise.
8086 * script-sections.cc: Likewise.
8087 * sparc.cc: Likewise.
8088 * symtab.h: Likewise.
8089 * target-reloc.h: Likewise.
8090 * target.cc: Likewise.
8091 * target.h: Likewise.
8092 * timer.cc: Likewise.
8093 * timer.h: Likewise.
8094 * x86_64.cc: Likewise.
8095
8096 2010-12-09 Cary Coutant <ccoutant@google.com>
8097
8098 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8099 stack.
8100 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8101 parameter; change all callers.
8102 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8103 * options.h (warn_execstack): New option.
8104
8105 2010-12-07 Doug Kwan <dougkwan@google.com>
8106
8107 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8108 like function call relocations.
8109
8110 2010-12-07 Ian Lance Taylor <iant@google.com>
8111
8112 * archive.cc (Archive::get_elf_object_for_member): Permit
8113 punconfigured to be NULL.
8114 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8115 (Archive::include_member): Pass NULL to get_elf_object_for_member
8116 if we searched for the archive and this is the first included
8117 object.
8118
8119 2010-12-01 Ian Lance Taylor <iant@google.com>
8120
8121 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8122 track_relocs_type_ field.
8123 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8124 Set track_relocs_type_.
8125 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8126 contents when using RELA relocs.
8127 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8128 reloc_map_.
8129 * reloc.cc (Track_relocs::next_addend): New function.
8130 * reloc.h (class Track_relocs): Declare next_addend.
8131
8132 2010-12-01 Ian Lance Taylor <iant@google.com>
8133
8134 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8135 virtual destructor.
8136
8137 2010-12-01 Ian Lance Taylor <iant@google.com>
8138
8139 * README: Update compilers known to work and fail.
8140
8141 2010-11-23 Matthias Klose <doko@ubuntu.com>
8142
8143 * configure.in: For --enable-gold, handle value `default' instead of
8144 `both*'. Always install ld as ld.bfd, install as ld if gold is
8145 not the default.
8146 * configure: Regenerate.
8147
8148 2010-11-18 Doug Kwan <dougkwan@google.com>
8149
8150 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8151 and right_alignment to be zero. Store result alignment only if it is
8152 greater than existing alignment.
8153
8154 2010-11-16 Cary Coutant <ccoutant@google.com>
8155
8156 PR gold/12220
8157 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8158 Check for ".zdebug_line".
8159
8160 2010-11-16 Doug Kwan <dougkwan@google.com>
8161 Cary Coutant <ccoutant@google.com>
8162
8163 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8164 by reference; adjust all callers.
8165 * output.cc (Output_segment::set_section_addresses): Adjust references
8166 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8167 list is empty.
8168 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8169 end at page boundary.
8170
8171 2010-11-16 Cary Coutant <ccoutant@google.com>
8172
8173 PR gold/12220
8174 * layout.cc (Layout::choose_output_section): Transform names of
8175 compressed sections even when using a script with a SECTIONS clause.
8176 (Layout::output_section_name): Remove code to transform
8177 compressed debug section names.
8178 * output.cc (Output_section::add_input_section): Use uncompressed
8179 section size when tracking input sections.
8180
8181 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8182
8183 * symtab.h (Symbol::NON_PIC_REF): Remove.
8184 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8185 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8186 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8187 (Symbol::use_plt_offset): Take a flags argument and pass it
8188 directly to needs_dynamic_reloc. Restrict check for undefined
8189 weak symbols to function calls.
8190 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8191 (Target_arm::Scan::global): Use it.
8192 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8193 (Target_arm::Relocate::relocate): Likewise.
8194 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8195 parameter with an r_type parameter. Use get_reference_flags
8196 to get the flags.
8197 (Target_arm::Relocate::relocate): Update accordingly.
8198 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8199 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8200 (Target_i386::Scan::global): Likewise.
8201 (Target_i386::Relocate::relocate): Likewise.
8202 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8203 parameter with an r_type parameter. Use get_reference_flags
8204 to get the flags.
8205 (Target_i386::Relocate::relocate): Update accordingly.
8206 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8207 (Target_powerpc::Scan::global): Use it.
8208 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8209 (Target_powerpc::Relocate::relocate): Likewise.
8210 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8211 (Target_sparc::Scan::global): Use it.
8212 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8213 (Target_sparc::Relocate::relocate): Likewise.
8214 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8215 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8216 (Target_x86_64::Scan::global): Likewise.
8217 (Target_x86_64::Relocate::relocate): Likewise.
8218
8219 2010-11-08 Doug Kwan <dougkwan@google.com>
8220 Cary Coutant <ccoutant@google.com>
8221
8222 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8223 (Arm_exidx_merge_section::section_contents_): New data member.
8224 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8225 (Arm_input_section::~Arm_input_section): De-allocate memory.
8226 (Arm_input_section::original_contents_): New data member.
8227 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8228 in parameters instead of calling Object::section_contents without
8229 locking.
8230 (Arm_output_section::group_section): New parameter TASK. Pass it
8231 to callees that need locking objects.
8232 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8233 to lock EXIDX input sections. Fix a formatting issue. Call
8234 Arm_exidx_merged_section::build_contents to create merged section
8235 contents.
8236 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8237 to lock object of stub table owner.
8238 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8239 TEXT_SIZE to initialize data member TEXT_SIZE_.
8240 (Arm_exidx_input_section::addralign): Fix typo in comment.
8241 (Arm_exidx_input_section::text_size): New method.
8242 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8243 that require locking objects. Lock objects before scanning for stubs
8244 and updating local symbols.
8245 (Arm_input_section<big_endian>::init): Copy contents of original
8246 input section.
8247 (Arm_input_section<big_endian>::do_write): Use saved contents of
8248 original input section instead of calling Object::section_contents
8249 without locking.
8250 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8251 size without calling Object::section_size().
8252 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8253 for size. Allocate a buffer for merged EXIDX entries.
8254 (Arm_exidx_merged_section::build_contents): New method.
8255 (Arm_exidx_merged_section::do_write): Move merge section contents
8256 building code to Arm_exidx_merged_section::build_contetns. Write
8257 out contetns in buffer instead of building it on the fly.
8258 (Arm_relobj::make_exidx_input_section): Also pass text section size
8259 to Arm_exidx_input_section constructor.
8260 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8261 (Arm_dynobj::do_read_symbols): Fix memory leak.
8262 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8263 * target.h: (class Task): Add forward declaration.
8264 (Target::relax): Add new parameter TASK and pass it to
8265 Target::do_relax().
8266 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8267
8268 2010-11-05 Cary Coutant <ccoutant@google.com>
8269
8270 PR gold/10708
8271 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8272 object when reading from the file.
8273 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8274 second layout pass.
8275 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8276 when reading section contents.
8277 (get_section_contents): Likewise.
8278 (icf::find_identical_sections): Likewise.
8279 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8280 object when reading from the file.
8281 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8282 the object when doing deferred section layout.
8283
8284 2010-11-03 Nick Clifton <nickc@redhat.com>
8285
8286 PR gold/12001
8287 * script.h (class Symbol_assignment: name): New member. Returns
8288 the name of the symbol.
8289 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8290 Returns true if the given symbol name is on the list of
8291 assignments wating to be processed.
8292 * archive.cc (should_incldue_member): If the symbol is undefined,
8293 check to see if it is on the list of symbols pending assignment.
8294
8295 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8296
8297 * script-sections.cc (Script_sections::find_memory_region): Check
8298 for a NULL output section pointer.
8299
8300 2010-10-29 Doug Kwan <dougkwan@google.com>
8301
8302 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8303 Output_section::add_relaxed_input_section.
8304 * output.cc (Output_section::add_relaxed_input_section): Add new
8305 arguments LAYOUT and NAME. Set section order index.
8306 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8307 Copy section order index.
8308 * output.h (Output_section::add_relaxed_input_section): Add new
8309 arguments LAYOUT and NAME.
8310
8311 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8312
8313 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8314 NATIVE_OR_CROSS_LINKER.
8315 * testsuite/Makefile.in: Regenerate.
8316
8317 2010-10-20 Doug Kwan <dougkwan@google.com>
8318
8319 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8320 without SHF_LINK_ORDER flags.
8321 * layout.cc (Layout::choose_output_section): Do not filter
8322 SHF_LINK_ORDER flag in a relocatable link.
8323
8324 2010-10-17 Cary Coutant <ccoutant@google.com>
8325
8326 * output.h (Output_segment::set_section_addresses): Change function
8327 signature. Update all callers.
8328 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8329 sections.
8330 (Output_segment::set_section_addresses): Align after last TLS
8331 section. Add padding before last relro section instead of after.
8332
8333 2010-10-17 Doug Kwan <dougkwan@google.com>
8334
8335 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8336 GOT output section to be writable.
8337
8338 2010-10-14 Cary Coutant <ccoutant@google.com>
8339
8340 * debug.h (DEBUG_INCREMENTAL): New flag.
8341 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8342 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8343 mode.
8344 * incremental.cc (report_command_line): Ignore all forms of
8345 --incremental.
8346 * layout.cc (Layout::Layout): Check parameters for incremental link
8347 mode.
8348 * options.cc (General_options::parse_incremental): New function.
8349 (General_options::parse_no_incremental): New function.
8350 (General_options::parse_incremental_full): New function.
8351 (General_options::parse_incremental_update): New function.
8352 (General_options::incremental_mode_): New data member.
8353 (General_options::finalize): Check incremental_mode_.
8354 * options.h (General_options): Update help text for --incremental.
8355 Add --no-incremental, --incremental-full, --incremental-update.
8356 (General_options::Incremental_mode): New enum type.
8357 (General_options::incremental_mode): New function.
8358 (General_options::incremental_mode_): New data member.
8359 * parameters.cc (Parameters::incremental_mode_): New data member.
8360 (Parameters::set_options): Set incremental_mode_.
8361 (Parameters::set_incremental_full): New function.
8362 (Parameters::incremental): New function.
8363 (Parameters::incremental_update): New function.
8364 (set_parameters_incremental_full): New function.
8365 * parameters.h (Parameters::set_incremental_full): New function.
8366 (Parameters::incremental): New function.
8367 (Parameters::incremental_update): New function.
8368 (Parameters::incremental_mode_): New data member.
8369 (set_parameters_incremental_full): New function.
8370 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8371 incremental link mode.
8372 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8373 (Sized_relobj::do_relocate_sections): Likewise.
8374 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8375 option.
8376 * testsuite/Makefile.in: Regenerate.
8377 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8378
8379 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8380
8381 * script-sections.h (class Script_sections): Make
8382 Sections_elements typedef public.
8383 * script-sections.cc (class Sort_output_sections): Add elements_
8384 field. Add constructor which sets it; change all callers.
8385 (Sort_output_sections::is_before): New function.
8386 (Sort_output_sections::operator()): Call is_before.
8387 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8388 conditional.
8389 * testsuite/script_test_10.sh: New test. Test script section
8390 order.
8391 * testsuite/script_test_10.t: Likewise.
8392 * testsuite/script_test_10.s: Likewise.
8393 * testsuite/Makefile.am: Wrap the cross linker tests and the
8394 common tests into NATIVE_OR_CROSS_LINKER.
8395 (check_SCRIPTS): Add script_test_10.sh.
8396 (check_DATA): Add script_test_10.stdout.
8397 (script_test_10.o, script_test_10): New targets.
8398 (script_test_10.stdout): New target.
8399 * configure, testsuite/Makefile.in: Regenerate.
8400
8401 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8402
8403 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8404 error for the deprecated relocations.
8405 (Target_arm::Scan::global): Likewise.
8406 (Target_arm::Relocate::relocate): Likewise.
8407
8408 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8409
8410 * fileread.cc (Input_file::find_file): Initialize *found_name
8411 and *namep when using the fallback search for case 4.
8412
8413 2010-10-11 Cary Coutant <ccoutant@google.com>
8414
8415 * options.h (class General_options): Redefine -z lazy as an alias for
8416 the negation of -z now.
8417
8418 2010-10-11 Ian Lance Taylor <iant@google.com>
8419
8420 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8421 binding.
8422
8423 2010-10-06 Nick Clifton <nickc@redhat.com>
8424
8425 * script-sections.cc(class Memory_region): Remove
8426 current_lma_offset_ field. Rename current_vma_offset_ to
8427 current_offset_. Add last_section_ field.
8428 (Memory_region::get_current_vma_address): Rename to
8429 get_current_address.
8430 (Memory_region::get_current_lma_address): Delete.
8431 (Memory_region::increment_vma_offset): Rename to
8432 increment_offset.
8433 (Memory_region::increment_lma_offset): Delete.
8434 (Memory_region::attributes_compatible): New method. Returns
8435 true if the provided section is compatible with the region.
8436 (Memory_region::get_last_section): New method. Returns the last
8437 section to use the region.
8438 (Memory_region::set_last_section): New method. Stores the last
8439 section to use the region.
8440 (Script_sections::block_in_region): New method. Returns true if
8441 a block of memory is contained within a region.
8442 (Script_sections::find_memory_region): New method. Locates a
8443 memory region to be used to set a VMA or LMA address.
8444 (Output_section_definition::set_section_addresses): Add code to
8445 check for addresses set by memory regions.
8446 (Output_segment::set_section_addresses): Remove memory region
8447 walking code.
8448 (Script_sections::create_segment): Add a warning if a header
8449 segment is created outside of any region.
8450 * script-sections.h (class Script_sections): Add prototypes for
8451 find_memory_region and block_in_region methods.
8452 * testsuite/memory_test.s: Use .long instead of .word.
8453 * testsuite/memory_test.t: Add some more output sections.
8454 * testsuite/memory_test.sh: Update expected output.
8455
8456 2010-10-02 Doug Kwan <dougkwan@google.com>
8457
8458 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8459 defintion to symtab.h
8460 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8461 declaration to defintion.
8462
8463 2010-10-01 Nick Clifton <nickc@redhat.com>
8464
8465 * expression.cc (eval): Replace dummy argument with NULL.
8466 (eval_maybe_dot): Check for a NULL result section pointer.
8467 (Symbol_expression::value): Likewise.
8468 (Dot_expression::value): Likewise.
8469 (BINARY_EXPRESSION): Likewise.
8470 (Max_expression::value): Likewise.
8471 (Min_expression::value): Likewise.
8472 (Absolute_expression::value): Likewise.
8473 (Addr_expression::value_from_output_section): Likewise.
8474 (Loaddddr_expression::value_from_output_section): Likewise.
8475 (Segment_start_expression::value): Likewise.
8476 * script-sections.cc
8477 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8478 argument with NULL.
8479 (Sections_elememt_dot_assignment::set_section_addresses):
8480 Likewise.
8481 (Output_data_expression::do_write_to_buffer): Likewise.
8482 (Output_section_definition::finalize_symbols): Likewise.
8483 (Output_section_definition::set_section_addresses): Likewise.
8484
8485 2010-09-30 Doug Kwan <dougkwan@google.com>
8486
8487 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8488
8489 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8490
8491 * target.h (Target::can_icf_inline_merge_sections): New virtual
8492 function.
8493 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8494 virtual function.
8495 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8496 virtual function.
8497 * icf.cc (get_section_contents): Inline merge sections only when
8498 target allows it.
8499
8500 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8501
8502 * configure: Regenerate.
8503
8504 2010-09-17 Ian Lance Taylor <iant@google.com>
8505
8506 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8507 * testsuite/Makefile.am (memory_test.o): New target.
8508 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8509 memory_test.t.
8510 * testsuite/Makefile.in: Rebuild.
8511
8512 2010-09-17 Doug Kwan <dougkwan@google.com>
8513
8514 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8515 defintion if relocation uses GOT entries of the symbol.
8516 * testsuite/icf_safe_test.sh: Fix test.
8517 * testsuite/icf_safe_so_test.sh: Fix test.
8518
8519 2010-09-16 Cary Coutant <ccoutant@google.com>
8520
8521 * script_sections.cc (class Memory_region): Remove "NULL" from
8522 vector initializations.
8523
8524 2010-09-15 Cary Coutant <ccoutant@google.com>
8525
8526 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8527 Resolve forwarding symbols.
8528
8529 2010-09-15 Doug Kwan <dougkwan@google.com>
8530
8531 * gold/testsuite/script_test_3.t: Add ARM special sections.
8532 * gold/testsuite/script_test_4.t: Same.
8533 * gold/testsuite/script_test_5.t: Same.
8534 * gold/testsuite/script_test_6.t: Same.
8535 * gold/testsuite/script_test_7.t: Same.
8536 * gold/testsuite/script_test_7.t: Same.
8537 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8538
8539 2010-09-14 Cary Coutant <ccoutant@google.com>
8540
8541 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8542 (Target_x86_64::Relocate::relocate_tls): Replace check for
8543 saw_tls_block_reloc_ with test for executable section.
8544
8545 2010-09-12 Cary Coutant <ccoutant@google.com>
8546
8547 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8548 position-independent executables to shared libraries need dynamic
8549 relocations.
8550 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8551 position-independent executables.
8552 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8553 * testsuite/Makefile.in: Regenerate.
8554
8555 2010-09-10 Nick Clifton <nickc@redhat.com>
8556
8557 PR gold/11997
8558 * testsuite/memory_test.t: Discard any sections that are not
8559 needed.
8560
8561 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8562
8563 PR gold/11996
8564 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8565 "This::" to work around a bug in gcc 4.2.
8566
8567 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8568
8569 2010-09-09 Rafael Espindola <espindola@google.com>
8570
8571 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8572 sections with different PF_X flags in the same segment.
8573 (Layout::find_first_load_seg): Search all segments to find the first
8574 one.
8575 * options.h (rosegment): New.
8576
8577 2010-09-08 Rafael Espindola <espindola@google.com>
8578
8579 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8580
8581 2010-09-08 Doug Kwan <dougkwan@google.com>
8582
8583 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8584 (Arm_relobj::do_relocate_sections): Add new parameter for output
8585 file to match the parent.
8586 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8587 of local symbols instead of input values. Update code to track
8588 changes in gold::relocate_section.
8589 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8590 (Sized_relobj::compute_final_local_value_internal): New methods.
8591 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8592 body into private version of Sized_relobj::compute_final_local_value.
8593 Call the inline method.
8594 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8595 merged symbol value if there is one.
8596 (Symbol_value::has_output_value): New method defintiion.
8597 (Sized_relobj::Compute_final_local_value_status): New enum type.
8598 (Sized_relobj::compute_final_local_value): New methods.
8599 (Sized_relobj::compute_final_local_value_internal): New methods.
8600 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8601 and arm_cortex_a8.sh.
8602 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8603 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8604 New tests.
8605 * Makefile.in: Regenerate.
8606 * testsuite/arm_bl_out_of_range.s: Update test.
8607 * testsuite/thumb_bl_out_of_range.s: Ditto.
8608 * testsuite/thumb_blx_out_of_range.s: Ditto.
8609 * testsuite/arm_branch_out_of_range.sh: New file.
8610 * testsuite/arm_cortex_a8.sh: Ditto.
8611 * testsuite/arm_cortex_a8_b.s: Ditto.
8612 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8613 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8614 * testsuite/arm_cortex_a8_bl.s: Ditto.
8615 * testsuite/arm_cortex_a8_blx.s: Ditto.
8616 * testsuite/arm_cortex_a8_local.s: Ditto.
8617 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8618 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8619
8620 2010-09-08 Rafael Espindola <espindola@google.com>
8621
8622 * Makefile.am (memory_test.stdout): Run readelf with -W.
8623 * Makefile.in: Regenerate.
8624 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8625 64 bit output.
8626
8627 2010-09-08 Rafael Espindola <espindola@google.com>
8628
8629 * script-sections.cc (Script_sections::add_memory_region): Convert
8630 field precision to int.
8631 * script.cc (script_set_section_region, script_set_section_region):
8632 Convert field precision to int.
8633
8634 2010-09-08 Rafael Espindola <espindola@google.com>
8635
8636 * arm.cc (do_finalize_sections): Create the __exidx_start and
8637 __exdix_end symbols even when the section is missing.
8638
8639 2010-09-08 Nick Clifton <nickc@redhat.com>
8640
8641 * README: Remove claim that MEMORY is not supported.
8642 * expression.cc (script_exp_function_origin)
8643 (script_exp_function_length): Move from here to ...
8644 * script.cc: ... here.
8645 (script_set_section_region, script_add_memory)
8646 (script_parse_memory_attr, script_include_directive): New
8647 functions.
8648 * script-sections.cc
8649 (class Memory_region): New class.
8650 (class Output_section_definition): Add set_memory_region,
8651 set_section_vma, set_section_lma and get_section_name methods.
8652 (class Script_Sections): Add add_memory_region,
8653 find_memory_region, find_memory_region_origin,
8654 find_memory_region_length and set_memory_region methods.
8655 Have set_section_addresses method walk the list of set memory
8656 regions.
8657 Extend the print methos to display memory regions.
8658 * script-sections.h: Add prototypes for new methods.
8659 Add enum for MEMORY region attributes.
8660 * yyscript.y: Add support for parsing MEMORY regions.
8661 * script-c.h: Add prototypes for new functions.
8662 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8663 * testsuite/Makefile.in: Regenerate.
8664 * testsuite/memory_test.sh: New script.
8665 * testsuite/memory_test.s: New assembler source file.
8666 * testsuite/memory_test.t: New linker script.
8667
8668 2010-08-27 Doug Kwan <dougkwan@google.com>
8669
8670 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8671 reference override an existing dynamic weak reference.
8672 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8673 * testsuite/Makefile.in: Regenerate.
8674 * testsuite/dyn_weak_ref.sh: New file.
8675 * testsuite/dyn_weak_ref_1.c: Ditto.
8676 * testsuite/dyn_weak_ref_2.c: Ditto.
8677
8678 2010-08-27 Ian Lance Taylor <iant@google.com>
8679
8680 * incremental.h (class Incremental_input_entry): Add virtual
8681 destructor.
8682
8683 2010-08-27 Ian Lance Taylor <iant@google.com>
8684
8685 * testsuite/start_lib_test_3.c: Mark t3 as used.
8686
8687 2010-08-27 Nick Clifton <nickc@redhat.com>
8688
8689 * options.cc (version_script): Fix small typo in previous
8690 whitespace tidyup.
8691
8692 2010-08-25 Nick Clifton <nickc@redhat.com>
8693
8694 * archive.cc: Formatting fixes: Remove whitespace between
8695 typename and following asterisk. Remove whitespace between
8696 function name and opening parenthesis.
8697 * archive.h: Likewise.
8698 * arm.cc: Likewise.
8699 * attributes.cc: Likewise.
8700 * attributes.h: Likewise.
8701 * common.cc: Likewise.
8702 * copy-relocs.cc: Likewise.
8703 * dirsearch.h: Likewise.
8704 * dynobj.cc: Likewise.
8705 * ehframe.cc: Likewise.
8706 * ehframe.h: Likewise.
8707 * expression.cc: Likewise.
8708 * fileread.cc: Likewise.
8709 * fileread.h: Likewise.
8710 * gc.h: Likewise.
8711 * gold-threads.cc: Likewise.
8712 * gold.cc: Likewise.
8713 * i386.cc: Likewise.
8714 * icf.h: Likewise.
8715 * incremental-dump.cc: Likewise.
8716 * incremental.cc: Likewise.
8717 * layout.cc: Likewise.
8718 * layout.h: Likewise.
8719 * main.cc: Likewise.
8720 * merge.cc: Likewise.
8721 * merge.h: Likewise.
8722 * object.cc: Likewise.
8723 * object.h: Likewise.
8724 * options.cc: Likewise.
8725 * options.h: Likewise.
8726 * output.cc: Likewise.
8727 * output.h: Likewise.
8728 * plugin.cc: Likewise.
8729 * plugin.h: Likewise.
8730 * powerpc.cc: Likewise.
8731 * reloc.cc: Likewise.
8732 * script-c.h: Likewise.
8733 * script-sections.cc: Likewise.
8734 * script.cc: Likewise.
8735 * stringpool.cc: Likewise.
8736 * symtab.cc: Likewise.
8737 * symtab.h: Likewise.
8738 * target.cc: Likewise.
8739 * timer.cc: Likewise.
8740 * timer.h: Likewise.
8741 * version.cc: Likewise.
8742 * x86_64.cc: Likewise.
8743
8744 2010-08-24 Nick Clifton <nickc@redhat.com>
8745
8746 PR 11899
8747 * layout.cc (segment_precedes): Sort segments by their physical
8748 addresses, if they have been set.
8749
8750 2010-08-23 Cary Coutant <ccoutant@google.com>
8751
8752 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8753 symbols data.
8754 (Lib_group::include_member): Unlock object after deleting its
8755 symbols data.
8756 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8757 the bug fixed here.
8758
8759 2010-08-19 Neil Vachharajani <nvachhar@google.com>
8760 Cary Coutant <ccoutant@google.com>
8761
8762 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8763 constructor, and set_blocker.
8764 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8765 readsyms_blocker_.
8766 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8767 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8768 * testsuite/Makefile.am (start_lib_test): New test case.
8769 * testsuite/Makefile.in: Regenerate.
8770 * testsuite/start_lib_test_main.c: New file.
8771 * testsuite/start_lib_test_1.c: New file.
8772 * testsuite/start_lib_test_2.c: New file.
8773 * testsuite/start_lib_test_3.c: New file.
8774
8775 2010-08-19 Ian Lance Taylor <iant@google.com>
8776
8777 * Makefile.in: Rebuild with automake 1.11.1.
8778 * aclocal.m4: Likewise.
8779 * testsuite/Makefile.in: Likewise.
8780
8781 2010-08-19 Ian Lance Taylor <iant@google.com>
8782
8783 PR 10893
8784 * i386.cc (class Output_data_plt_i386): Update declarations.
8785 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8786 local_ifuncs_ fields.
8787 (Target_i386::do_plt_section_for_global): New function.
8788 (Target_i386::do_plt_section_for_local): New function.
8789 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8790 parameter; change all callers. Initialize global_ifuncs_ and
8791 local_ifuncs_. If doing a static link define __rel_iplt_start and
8792 __rel_iplt_end.
8793 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8794 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8795 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8796 symbols.
8797 (Target_i386::make_plt_section): New function, broken out of
8798 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8799 (Target_i386::make_plt_entry): Call make_plt_section.
8800 (Target_i386::make_local_ifunc_plt_entry): New function.
8801 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8802 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8803 R_386_IRELATIVE to switch.
8804 (Target_i386::Scan::global): Likewise.
8805 (Target_i386::Relocate::relocate): Likewise.
8806 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8807 switch.
8808 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8809 (Target_x86_64::do_plt_section_for_global): New function.
8810 (Target_x86_64::do_plt_section_for_local): New function.
8811 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8812 parameter; change all callers. If doing a static link define
8813 __rela_iplt_start and __rela_iplt_end.
8814 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8815 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8816 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8817 to point to .plt.
8818 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8819 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8820 switch.
8821 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8822 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8823 R_X86_64_IRELATIVE to switch.
8824 (Target_x86_64::Scan::global): Likewise.
8825 (Target_x86_64::Relocate::relocate): Likewise.
8826 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8827 switch.
8828 * target.h (class Target): Add plt_section_for_global and
8829 plt_section_for_local functions. Add do_plt_section_for_global
8830 and do_plt_section_for_local virtual functions.
8831 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8832 clarifying comments.
8833 (Symbol::use_plt_offset): Handle IFUNC symbol.
8834 * object.cc (Sized_relobj::Sized_relobj): Initialize
8835 local_plt_offsets_.
8836 (Sized_relobj::local_has_plt_offset): New function.
8837 (Sized_relobj::local_plt_offset): New function.
8838 (Sized_relobj::set_local_plt_offset): New function.
8839 (Sized_relobj::do_count): Handle IFUNC symbol.
8840 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8841 a bit away from input_shndx_ field. Add set_is_func_symbol and
8842 is_ifunc_symbol functions.
8843 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8844 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8845 local_plt_offsets_ field.
8846 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8847 * output.h (class Output_section_data): Add non-const
8848 output_section function.
8849 (class Output_data_got): Update declarations.
8850 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8851 Add use_plt_offset parameter to global and local constructors.
8852 Change all callers. Change local_sym_index_ field to 31 bits.
8853 Change GSYM_CODE and CONSTANT_CODE accordingly.
8854 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8855 doing a static link don't set sh_link field.
8856 (Output_data_got::Got_entry::write): Use PLT offset if
8857 appropriate.
8858 (Output_data_got::add_global_plt): New function.
8859 (Output_data_got::add_local_plt): New function.
8860 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8861 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8862 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8863 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8864 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8865 IFUNC conditional.
8866 * testsuite/ifunc-sel.h: New file.
8867 * testsuite/ifuncmain1.c: New file.
8868 * testsuite/ifuncmain1vis.c: New file.
8869 * testsuite/ifuncmod1.c: New file.
8870 * testsuite/ifuncdep2.c: New file.
8871 * testsuite/ifuncmain2.c: New file.
8872 * testsuite/ifuncmain3.c: New file.
8873 * testsuite/ifuncmod3.c: New file.
8874 * testsuite/ifuncmain4.c: New file.
8875 * testsuite/ifuncmain5.c: New file.
8876 * testsuite/ifuncmod5.c: New file.
8877 * testsuite/ifuncmain6pie.c: New file.
8878 * testsuite/ifuncmod6.c: New file.
8879 * testsuite/ifuncmain7.c: New file.
8880 * configure, testsuite/Makefile.in: Rebuild.
8881
8882 2010-08-18 Ian Lance Taylor <iant@google.com>
8883
8884 * incremental.cc
8885 (Output_section_incremental_inputs::write_input_files): Add cast
8886 to avoid signed/unsigned comparison warning.
8887 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8888
8889 2010-08-12 Cary Coutant <ccoutant@google.com>
8890
8891 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8892
8893 2010-08-13 Ian Lance Taylor <iant@google.com>
8894
8895 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8896
8897 2010-08-12 Cary Coutant <ccoutant@google.com>
8898 Doug Kwan <dougkwan@google.com>
8899
8900 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8901 defintion overrides non-weak undef, remember that the original undef
8902 is not weak.
8903 * symtab.cc (Symbol_table::sized_write_global): For undef without
8904 an original weak binding, set binding to global in output.
8905 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8906 * testsuite/Makefile.in: Regenerate.
8907 * testsuite/strong_ref_weak_def.sh: New file.
8908 * testsuite/strong_ref_weak_def_1.c: Ditto.
8909 * testsuite/strong_ref_weak_def_2.c: Ditto.
8910
8911 2010-08-12 Cary Coutant <ccoutant@google.com>
8912
8913 * testsuite/incremental_test.sh: Rewrite.
8914 * testsuite/incremental_test_1.c: Rewrite.
8915 * testsuite/incremental_test_2.c: Rewrite.
8916
8917 2010-08-12 Cary Coutant <ccoutant@google.com>
8918
8919 * arm.cc (Target_arm::got_size): Add const.
8920 (Target_arm::got_entry_count): New function.
8921 (Target_arm::plt_entry_count): New function.
8922 (Target_arm::first_plt_entry_offset): New function.
8923 (Target_arm::plt_entry_size): New function.
8924 (Output_data_plt_arm::entry_count): New function.
8925 (Output_data_plt_arm::first_plt_entry_offset): New function.
8926 (Output_data_plt_arm::get_plt_entry_size): New function.
8927 * i386.cc (Target_i386::got_size): Add const.
8928 (Target_i386::got_entry_count): New function.
8929 (Target_i386::plt_entry_count): New function.
8930 (Target_i386::first_plt_entry_offset): New function.
8931 (Target_i386::plt_entry_size): New function.
8932 (Output_data_plt_i386::entry_count): New function.
8933 (Output_data_plt_i386::first_plt_entry_offset): New function.
8934 (Output_data_plt_i386::get_plt_entry_size): New function.
8935 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8936 find_incremental_inputs_sections. Dump incremental_got_plt section.
8937 * incremental.cc: Include target.h.
8938 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8939 parameter. Adjust all callers. Find incremental_got_plt section.
8940 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8941 section.
8942 (Output_section_incremental_inputs::set_final_data_size): Calculate
8943 size of incremental_got_plt section.
8944 (Output_section_incremental_inputs::do_write): Write the
8945 incremental_got_plt section.
8946 (Got_plt_view_info): New struct.
8947 (Local_got_offset_visitor): New class.
8948 (Global_got_offset_visitor): New class.
8949 (Global_symbol_visitor_got_plt): New class.
8950 (Output_section_incremental_inputs::write_got_plt): New function.
8951 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8952 Add parameter. Adjust all callers.
8953 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8954 (Incremental_inputs::got_plt_section): New function.
8955 (Incremental_inputs::got_plt_section_): New data member.
8956 (Incremental_got_plt_reader): New class.
8957 * layout.cc (Layout::create_incremental_info_sections): Add the
8958 incremental_got_plt section.
8959 * object.h (Got_offset_list::get_list): New function.
8960 (Got offset_list::for_all_got_offsets): New function.
8961 (Sized_relobj::local_got_offset_list): New function.
8962 * powerpc.cc (Target_powerpc::got_size): Add const.
8963 (Target_powerpc::got_entry_count): New function.
8964 (Target_powerpc::plt_entry_count): New function.
8965 (Target_powerpc::first_plt_entry_offset): New function.
8966 (Target_powerpc::plt_entry_size): New function.
8967 (Output_data_plt_powerpc::entry_count): New function.
8968 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8969 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8970 * sparc.cc (Target_sparc::got_size): Add const.
8971 (Target_sparc::got_entry_count): New function.
8972 (Target_sparc::plt_entry_count): New function.
8973 (Target_sparc::first_plt_entry_offset): New function.
8974 (Target_sparc::plt_entry_size): New function.
8975 (Output_data_plt_sparc::entry_count): New function.
8976 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8977 (Output_data_plt_sparc::get_plt_entry_size): New function.
8978 * symtab.h (Symbol::got_offset_list): New function.
8979 (Symbol_table::for_all_symbols): New function.
8980 * target.h (Sized_target::got_entry_count): New function.
8981 (Sized_target::plt_entry_count): New function.
8982 (Sized_target::plt_entry_size): New function.
8983 * x86_64.cc (Target_x86_64::got_size): Add const.
8984 (Target_x86_64::got_entry_count): New function.
8985 (Target_x86_64::plt_entry_count): New function.
8986 (Target_x86_64::first_plt_entry_offset): New function.
8987 (Target_x86_64::plt_entry_size): New function.
8988 (Output_data_plt_x86_64::entry_count): New function.
8989 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8990 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8991
8992 2010-08-12 Cary Coutant <ccoutant@google.com>
8993
8994 * archive.cc: Include incremental.h.
8995 (Archive::Archive): Initialize incremental_info_.
8996 (Archive::include_member): Record archive members in incremental info.
8997 (Add_archive_symbols::run): Record begin and end of an archive in
8998 incremental info.
8999 (Lib_group::include_member): Record objects in incremental info.
9000 * archive.h (Incremental_archive_entry): Forward declaration.
9001 (Archive::set_incremental_info): New member function.
9002 (Archive::incremental_info): New member function.
9003 (Archive::Unused_symbol_iterator): New class.
9004 (Archive::unused_symbols_begin): New member function.
9005 (Archive::unused_symbols_end): New member function.
9006 (Archive::incremental_info_): New data member.
9007 * incremental-dump.cc (find_input_containing_global): New function.
9008 (dump_incremental_inputs): Dump new incremental info sections.
9009 * incremental.cc: Include symtab.h.
9010 (Output_section_incremental_inputs): New class.
9011 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9012 new incremental info sections.
9013 (Sized_incremental_binary::do_check_inputs): Likewise.
9014 (Incremental_inputs::report_archive): Remove.
9015 (Incremental_inputs::report_archive_begin): New function.
9016 (Incremental_inputs::report_archive_end): New function.
9017 (Incremental_inputs::report_object): New function.
9018 (Incremental_inputs::finalize_inputs): Remove.
9019 (Incremental_inputs::report_input_section): New function.
9020 (Incremental_inputs::report_script): Rewrite.
9021 (Incremental_inputs::finalize): Do nothing but finalize string table.
9022 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9023 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9024 (Incremental_inputs::create_data_sections): New function.
9025 (Incremental_inputs::relocs_entsize): New function.
9026 (Output_section_incremental_inputs::set_final_data_size): New function.
9027 (Output_section_incremental_inputs::do_write): New function.
9028 (Output_section_incremental_inputs::write_header): New function.
9029 (Output_section_incremental_inputs::write_input_files): New function.
9030 (Output_section_incremental_inputs::write_info_blocks): New function.
9031 (Output_section_incremental_inputs::write_symtab): New function.
9032 * incremental.h (Incremental_script_entry): Forward declaration.
9033 (Incremental_object_entry): Forward declaration.
9034 (Incremental_archive_entry): Forward declaration.
9035 (Incremental_inputs): Forward declaration.
9036 (Incremental_inputs_header_data): Remove.
9037 (Incremental_inputs_header): Remove.
9038 (Incremental_inputs_header_write): Remove.
9039 (Incremental_inputs_entry_data): Remove.
9040 (Incremental_inputs_entry): Remove.
9041 (Incremental_inputs_entry_write): Remove.
9042 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9043 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9044 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9045 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9046 Likewise.
9047 (Incremental_input_entry): New class.
9048 (Incremental_script_entry): New class.
9049 (Incremental_object_entry): New class.
9050 (Incremental_archive_entry): New class.
9051 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9052 (Incremental_inputs::report_inputs): Remove.
9053 (Incremental_inputs::report_archive): Remove.
9054 (Incremental_inputs::report_archive_begin): New function.
9055 (Incremental_inputs::report_archive_end): New function.
9056 (Incremental_inputs::report_object): Change prototype.
9057 (Incremental_inputs::report_input_section): New function.
9058 (Incremental_inputs::report_script): Change prototype.
9059 (Incremental_inputs::get_reloc_count): New function.
9060 (Incremental_inputs::set_reloc_count): New function.
9061 (Incremental_inputs::create_data_sections): New function.
9062 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9063 (Incremental_inputs::inputs_section): New function.
9064 (Incremental_inputs::symtab_section): New function.
9065 (Incremental_inputs::relocs_section): New function.
9066 (Incremental_inputs::get_stringpool): Add const.
9067 (Incremental_inputs::command_line): Add const.
9068 (Incremental_inputs::inputs): Remove.
9069 (Incremental_inputs::command_line_key): New function.
9070 (Incremental_inputs::input_file_count): New function.
9071 (Incremental_inputs::input_files): New function.
9072 (Incremental_inputs::relocs_entsize): New function.
9073 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9074 (Incremental_inputs::finalize_inputs): Remove.
9075 (Incremental_inputs::Input_info): Remove.
9076 (Incremental_inputs::lock_): Remove.
9077 (Incremental_inputs::inputs_): Change type.
9078 (Incremental_inputs::inputs_map_): Remove.
9079 (Incremental_inputs::current_object_entry_): New data member.
9080 (Incremental_inputs::inputs_section_): New data member.
9081 (Incremental_inputs::symtab_section_): New data member.
9082 (Incremental_inputs::relocs_section_): New data member.
9083 (Incremental_inputs::reloc_count_): New data member.
9084 (Incremental_inputs_reader): New class.
9085 (Incremental_symtab_reader): New class.
9086 (Incremental_relocs_reader): New class.
9087 * layout.cc (Layout::finalize): Move finalization of incremental info
9088 and creation of incremental info sections to follow finalization of
9089 symbol table. Set offsets for postprocessing sections.
9090 (Layout::create_incremental_info_sections): Call
9091 Incremental_inputs::create_data_sections. Add incremental symtab
9092 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9093 sections to layout after input sections.
9094 * layout.h (struct Timespec): Forward declaration.
9095 (Layout::incremental_inputs): Add const.
9096 (Layout::create_incremental_info_sections): Add parameter.
9097 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9098 * object.cc: Include incremental.h.
9099 (Relobj::finalize_incremental_relocs): New function.
9100 (Sized_relobj::do_layout): Record input sections in incremental info.
9101 * object.h (Object::output_section): New function.
9102 (Object::output_section_offset): Moved from Relobj.
9103 (Object::get_incremental_reloc_base): New function.
9104 (Object::get_incremental_reloc_count): New function.
9105 (Object::do_output_section): New function.
9106 (Object::do_output_section_offset): Moved from Relobj.
9107 (Object::do_get_incremental_reloc_base): New function.
9108 (Object::do_get_incremental_reloc_count): New function.
9109 (Object::Object): Initialize new data members.
9110 (Relobj::output_section): Renamed do_output_section and moved to
9111 protected.
9112 (Relobj::output_section_offset): Moved to Object.
9113 (Relobj::do_get_incremental_reloc_base): New function.
9114 (Relobj::do_get_incremental_reloc_count): New function.
9115 (Relobj::allocate_incremental_reloc_counts): New function.
9116 (Relobj::count_incremental_reloc): New function.
9117 (Relobj::finalize_incremental_relocs): New function.
9118 (Relobj::next_incremental_reloc_index): New function.
9119 (Relobj::reloc_counts_): New data member.
9120 (Relobj::reloc_bases_): New data member.
9121 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9122 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9123 (Sized_relobj::incremental_relocs_scan): New function.
9124 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9125 (Sized_relobj::incremental_relocs_write): New function.
9126 (Sized_relobj::incremental_relocs_write_reltype): New function.
9127 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9128 incremental link.
9129 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9130 archives and object files elsewhere.
9131 (Add_symbols::run): Report object files here.
9132 (Finish_group::run): Report end of archive at end of group.
9133 * reloc.cc: Include layout.h, incremental.h.
9134 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9135 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9136 (Sized_relobj::incremental_relocs_scan): New function.
9137 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9138 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9139 (Sized_relobj::incremental_relocs_write): New function.
9140 (Sized_relobj::incremental_relocs_write_reltype): New function.
9141 * script.cc (read_input_script): Rewrite test for incremental link.
9142 Change call to Incremental_inputs::report_script.
9143 * symtab.h (Symbol_table::first_global_index): New function.
9144 (Symbol_table::output_count): New function.
9145
9146 2010-08-12 Doug Kwan <dougkwan@google.com>
9147
9148 * arm.cc (Target_arm::merge_object_attributes): Check command line
9149 options --no-wchar-size-warning and --no-enum-size-warning.
9150 * options.h (General_options): Add ld-compatible options
9151 --no-enum-size-warning and --no-wchar-size-warning.
9152
9153 2010-08-04 Ian Lance Taylor <iant@google.com>
9154
9155 * x86_64.cc (Target_x86_64::Scan::local): Use
9156 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9157 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9158 (Target_x86_64::Scan::global): Likewise.
9159 (Target_x86_64::Relocate::relocate): Likewise.
9160 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9161 Likewise.
9162
9163 2010-08-03 Cary Coutant <ccoutant@google.com>
9164
9165 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9166 to reserve space in merged_strings vector. Keep total input size
9167 for stats.
9168 (Output_merge_string::do_print_merge_stats): Print total input size.
9169 * merge.h (Output_merge_string): Add input_size_ field.
9170 * stringpool.cc (Stringpool_template::string_length): Move
9171 implementations out of Stringpool_template class and place in
9172 stringpool.h.
9173 * stringpool.h (string_length): Move out of Stringpool_template.
9174
9175 2010-08-03 Ian Lance Taylor <iant@google.com>
9176
9177 PR 11712
9178 * layout.cc (relaxation_loop_body): If address of load segment is
9179 set, adjust address to include headers if possible.
9180
9181 2010-08-03 Ian Lance Taylor <iant@google.com>
9182
9183 * version.cc (version_string): Bump to 1.10.
9184
9185 2010-08-03 Ian Lance Taylor <iant@google.com>
9186
9187 PR 11805
9188 * layout.h (enum Output_section_order): Define.
9189 (class Layout): Update declarations.
9190 * layout.cc (Layout::get_output_section): Add order parameter.
9191 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9192 is_first_non_relro parameters. Change all callers.
9193 (Layout::choose_output_section): Likewise.
9194 (Layout::add_output_section_data): Likewise.
9195 (Layout::make_output_section): Likewise. Set order.
9196 (Layout::default_section_order): New function.
9197 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9198 * output.cc (Output_section::Output_section): Initialize order_.
9199 Don't initialize deleted fields.
9200 (Output_segment::Output_segment): Don't initialize deleted
9201 fields.
9202 (Output_segment::add_output_section_to_load): New function
9203 replacing add_output_section. Change all callers to call this or
9204 add_output_section_to_nonload.
9205 (Output_segment::add_output_section_to_nonload): New function.
9206 (Output_segment::remove_output_section): Rewrite.
9207 (Output_segment::add_initial_output_data): Likewise.
9208 (Output_segment::has_any_data_sections): Likewise.
9209 (Output_segment::is_first_section_relro): Likewise.
9210 (Output_segment::maximum_alignment): Likewise.
9211 (Output_segment::has_dynamic_reloc): New function replacing
9212 dynamic_reloc_count. Change all callers.
9213 (Output_segment::has_dynamic_reloc_list): New function replacing
9214 dynamic_reloc_count_list. Change all callers.
9215 (Output_segment::set_section_addresses): Rewrite.
9216 (Output_segment::set_offset): Rewrite.
9217 (Output_segment::find_first_and_last_list): Remove.
9218 (Output_segment::set_tls_offsets): Rewrite.
9219 (Output_segment::first_section_load_address): Likewise.
9220 (Output_segment::output_section_count): Likewise.
9221 (Output_segment::section_with_lowest_load_address): Likewise.
9222 (Output_segment::write_section_headers): Likewise.
9223 (Output_segment::print_sections_to_map): Likewise.
9224 * output.h (class Output_data): Remove dynamic_reloc_count_
9225 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9226 (Output_data::add_dynamic_reloc): Rewrite.
9227 (Output_data::has_dynamic_reloc): New function.
9228 (Output_data::dynamic_reloc_count): Remove.
9229 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9230 is_last_relro_, is_first_non_relro_, is_interp_,
9231 is_dynamic_linker_section_ fields. Add order and set_order
9232 functions. Remove is_relro_local, set_is_relro_local,
9233 is_last_relro, set_is_last_relro, is_first_non_relro,
9234 set_is_first_non_relro functions, is_interp, set_is_interp,
9235 is_dynamic_linker_section, and set_is_dynamic_linker_section
9236 functions.
9237 (class Output_segment): Change Output_data_list from std::list to
9238 std:;vector. Add output_lists_ field. Remove output_data_ and
9239 output_bss_ fields. Update declarations.
9240
9241 2010-08-02 Ian Lance Taylor <iant@google.com>
9242
9243 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9244 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9245 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9246
9247 2010-08-02 Ian Lance Taylor <iant@google.com>
9248
9249 PR 11855
9250 * script.cc (Script_options::Script_options): Initialize
9251 symbol_definitions_ and symbol_references_.
9252 (Script_options::add_symbol_assignment): Update
9253 symbol_definitions_ and symbol_references_.
9254 (Script_options::add_symbol_reference): New function.
9255 (script_symbol): New function.
9256 * script.h (class Script_options): Add symbol_definitions_ and
9257 symbol_references_ fields.
9258 (Script_options::referenced_const_iterator): New type.
9259 (Script_options::referenced_begin): New function.
9260 (Script_options::referenced_end): New function.
9261 (Script_options::is_referenced): New function.
9262 (Script_options::any_unreferenced): New function.
9263 * script-c.h (script_symbol): Declare.
9264 * yyscript.y (exp): Call script_symbol.
9265 * symtab.cc: Include "script.h".
9266 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9267 Change all callers. Check symbols referenced by scripts.
9268 (Symbol_table::add_undefined_symbols_from_command_line): Add
9269 layout parameter. Change all callers.
9270 (Symbol_table::do_add_undefined_symbols_from_command_line):
9271 Likewise. Break out loop body. Check symbols referenced by
9272 scripts.
9273 (Symbol_table::add_undefined_symbol_from_command_line): New
9274 function broken out of
9275 do_add_undefined_symbols_from_command_line.
9276 * symtab.h (class Symbol_table): Update declarations.
9277 * archive.cc: Include "layout.h".
9278 (Archive::should_include_member): Add layout parameter. Change
9279 all callers. Check for symbol mentioned in expression.
9280 * archive.h (class Archive): Update declaration.
9281 * object.cc (Sized_relobj::do_should_include_member): Add layout
9282 parameter.
9283 * object.h (Object::should_include_member): Add layout parameter.
9284 Change all callers.
9285 (Object::do_should_include_member): Add layout parameter.
9286 (class Sized_relobj): Update declaration.
9287 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9288 parameter.
9289 * dynobj.h (class Sized_dynobj): Update declaration.
9290 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9291 layout parameter.
9292 * plugin.h (class Sized_pluginobj): Update declaration.
9293
9294 2010-08-02 Ian Lance Taylor <iant@google.com>
9295
9296 PR 11866
9297 * output.cc (Output_segment::set_offset): Search for the first and
9298 last sections rather than assuming that the list is in order.
9299 (Output_segment::find_first_and_last_list): New function.
9300 * output.h (class Output_segment): Update declarations.
9301 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9302 (relro_strip_test_SOURCES): New variable.
9303 (relro_strip_test_DEPENDENCIES): New variable.
9304 (relro_strip_test_LDFLAGS): New variable.
9305 (relro_strip_test_LDADD): New variable.
9306 (relro_strip_test.so): New target.
9307
9308 2010-08-02 Ian Lance Taylor <iant@google.com>
9309
9310 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9311 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9312 (Target_i386::got_tlsdesc_section): New function.
9313 (Target_i386::got_section): Create space for GOT entries for
9314 TLSDESC relocations.
9315 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9316 R_386_TLS_GOTDESC.
9317 (Target_i386::Scan::global): Likewise.
9318 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9319 using TLSDESC GOT.
9320 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9321 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9322 (Target_x86_64::got_tlsdesc_section): New function.
9323 (Target_x86_64::got_section): Create space for GOT entries for
9324 TLSDESC relocations.
9325 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9326 R_386_TLS_GOTDESC.
9327 (Target_x86_64::Scan::global): Likewise.
9328 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9329 using TLSDESC GOT.
9330
9331 2010-08-02 Ian Lance Taylor <iant@google.com>
9332
9333 * testsuite/final_layout.sh: Use dc to convert from hex to
9334 decimal.
9335
9336 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9337
9338 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9339 paramter to the call to gold::gc_process_relocs.
9340 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9341 paramter to the call to gold::gc_process_relocs.
9342 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9343 parameter to the call to gold::gc_process_relocs.
9344 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9345 template parameter to the call to gold::gc_process_relocs.
9346 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9347 paramter to the call to gold::gc_process_relocs.
9348 * gc.h (get_embedded_addend_size): New function.
9349 (gc_process_relocs): Save the size of the reloc for use by ICF.
9350 * icf.cc (get_section_contents): Get the addend from the text section
9351 for SHT_REL relocation sections.
9352 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9353 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9354 * int_encoding.h (read_from_pointer): New overloaded function.
9355 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9356 * testsuite/icf_sht_rel_addend_test.sh: New file.
9357 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9358 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9359
9360 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9361
9362 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9363 * Makefile.in: Regenerate.
9364 * testsuite/Makefile.in: Regenerate.
9365
9366 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9367
9368 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9369 * gold/testsuite/debug_msg.cc: Likewise.
9370 * gold/testsuite/odr_violation1.cc
9371 * gold/testsuite/odr_violation2.cc
9372
9373 2010-07-21 Cary Coutant <ccoutant@google.com>
9374
9375 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9376 string, and length fields.
9377 (Output_merge_string::Merged_strings_list): New type.
9378 (Output_merge_string::Merged_strings_lists): New typedef.
9379 (Output_merge_string): Replace merged_strings_ with
9380 merged_strings_lists_.
9381 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9382 Merged_strings_list per input object and section. Don't store pointer
9383 to the string. Don't store length with each merged string entry.
9384 (Output_merge_string::finalize_merged_data): Loop over list of merged
9385 strings lists. Recompute length of each merged string.
9386
9387 2010-07-15 Cary Coutant <ccoutant@google.com>
9388
9389 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9390 here.
9391
9392 2010-07-14 Ian Lance Taylor <iant@google.com>
9393
9394 * descriptors.cc (Descriptors::open): Report correct name in error
9395 message.
9396
9397 2010-07-13 Doug Kwan <dougkwan@google.com>
9398
9399 * arm.cc (Arm_input_section::Arm_input_section): For a
9400 SHT_ARM_EXIDX section, always keeps the input sections.
9401 (Arm_input_section::set_exidx_section_link): New method.
9402 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9403 has_errors_ to false.
9404 (Arm_exidx_input_section::has_errors,
9405 Arm_exidx_input_section::set_has_errors): New methods.
9406 (Arm_exidx_input_section::has_errors_): New data member.
9407 (Arm_relobj::get_exidx_shndx_list): New method.
9408 (Arm_output_section::append_text_sections_to_list): Do not skip
9409 section without SHF_EXECINSTR.
9410 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9411 errors.
9412 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9413 section header. Make error messages more verbose. Check for
9414 a non-executable section linked to an EXIDX section.
9415 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9416 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9417 check that there is no deferred EXIDX section if we exit early.
9418 Instead of not making an EXIDX section in case of an error, make one
9419 and set the has_errors flag of it.
9420 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9421 in a relocatable link.
9422 (Target_arm::do_relax): Look for the EXIDX output section instead of
9423 assuming that it is called .ARM.exidx.
9424 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9425 section list. Do not check for SHF_EXECINSTR section flags but
9426 skip any input section with errors.
9427 * output.cc (Output_section::Output_section): Initialize
9428 always_keeps_input_sections_ to false.
9429 (Output_section::add_input_section): Check for
9430 always_keeps_input_sections_.
9431 * output.h (Output_section::always_keeps_input_sections,
9432 Output_section::set_always_keeps_input_sections): New methods.
9433 (Output_section::always_keeps_input_sections): New data member.
9434
9435 2010-07-13 Rafael Espindola <espindola@google.com>
9436
9437 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9438 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9439
9440 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9441 Ian Lance Taylor <iant@google.com>
9442
9443 * output.h (Output_section_lookup_maps::add_merge_section):
9444 Correct check of whether value was inserted.
9445 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9446 (Output_section_lookup_maps::add_relaxed_input_section):
9447 Likewise.
9448 * arm.cc (Target_arm::got_section): Remove used local os.
9449 * i386.cc (Target_i386::got_section): Likewise.
9450 * x86_64.cc (Target_x86_64::got_section): Likewise.
9451 * sparc.cc (Target_sparc::got_section): Likewise.
9452 (Target_sparc::relocate): Remove unused local have_got_offset.
9453 * powerpc.cc (Target_powerpc::relocate): Likewise.
9454
9455 2010-07-13 Ian Lance Taylor <iant@google.com>
9456
9457 * compressed_output.cc (zlib_decompress): Fix signature in
9458 !HAVE_ZLIB_H case.
9459
9460 * archive.cc (Archive::include_member): Unlock an external member
9461 of a thin archive. Don't bother to delete an object we know is
9462 NULL.
9463
9464 2010-07-12 Cary Coutant <ccoutant@google.com>
9465
9466 * compressed_output.cc (zlib_decompress): New function.
9467 (get_uncompressed_size): New function.
9468 (decompress_input_section): New function.
9469 * compressed_output.h (get_uncompressed_size): New function.
9470 (decompress_input_section): New function.
9471 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9472 Handle compressed debug sections.
9473 * layout.cc (is_compressed_debug_section): New function.
9474 (Layout::output_section_name): Map compressed section names to
9475 canonical names.
9476 * layout.h (is_compressed_debug_section): New function.
9477 (is_debug_info_section): Recognize compressed debug sections.
9478 * merge.cc: Include compressed_output.h.
9479 (Output_merge_data::do_add_input_section): Handle compressed
9480 debug sections.
9481 (Output_merge_string::do_add_input_section): Handle compressed
9482 debug sections.
9483 * object.cc: Include compressed_output.h.
9484 (Sized_relobj::Sized_relobj): Initialize new data members.
9485 (build_compressed_section_map): New function.
9486 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9487 * object.h (Object::section_is_compressed): New method.
9488 (Object::do_section_is_compressed): New method.
9489 (Sized_relobj::Compressed_section_map): New type.
9490 (Sized_relobj::do_section_is_compressed): New method.
9491 (Sized_relobj::compressed_sections_): New data member.
9492 * output.cc (Output_section::add_input_section): Handle compressed
9493 debug sections.
9494 * reloc.cc: Include compressed_output.h.
9495 (Sized_relobj::write_sections): Handle compressed debug sections.
9496
9497 2010-07-08 Cary Coutant <ccoutant@google.com>
9498
9499 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9500 weak when resolving to a dynamic def.
9501 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9502 for weak undef/dynamic def cases. Adjust callers.
9503 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9504 undef_binding_weak_.
9505 (Symbol_table::sized_write_globals): Adjust symbol binding.
9506 (Symbol_table::sized_write_symbol): Add binding parameter.
9507 * symtab.h (Symbol::set_undef_binding): New method.
9508 (Symbol::is_undef_binding_weak): New method.
9509 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9510 (Symbol_table::should_override): Add new parameter.
9511 (Symbol_table::sized_write_symbol): Add new parameter.
9512
9513 * testsuite/weak_undef_file1.cc: Add new test case.
9514 * testsuite/weak_undef_file2.cc: Fix header comment.
9515 * testsuite/weak_undef_test.cc: Add new test case.
9516
9517 2010-06-29 Doug Kwan <dougkwan@google.com>
9518
9519 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9520 Initialize USE_SYMBOL_.
9521 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9522 definition.
9523 (Arm_reloc_property::uses_symbol_): New data member declaration.
9524 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9525 uses symbol value and symbol is undefined but not weakly undefined.
9526
9527 2010-06-28 Rafael Espindola <espindola@google.com>
9528
9529 * plugin.cc (Plugin::load): Use dlerror.
9530
9531 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9532
9533 * symtab.cc (detect_odr_violations): When reporting an ODR
9534 violation, report an object where the symbol is defined.
9535
9536 2010-06-25 Doug Kwan <dougkwan@google.com>
9537
9538 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9539 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9540 definition.
9541 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9542 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9543 target hook to detect function points.
9544 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9545 * icf.h (Icf::check_section_for_function_pointers): Change type of
9546 parameter SECTION_NAME to const reference to std::string. Use
9547 target hook to determine if section may have unsafe pointers.
9548 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9549 method definition.
9550
9551 2010-06-21 Rafael Espindola <espindola@google.com>
9552
9553 * fileread.cc (Input_file::find_fie): New
9554 (Input_file::open): Use Input_file::find_fie.
9555 * fileread.h (Input_file::find_fie): New
9556 * plugin.cc (set_extra_library_path): New.
9557 (Plugin::load): Add set_extra_library_path to the transfer vector.
9558 (Plugin_manager::set_extra_library_path): New.
9559 (Plugin_manager::add_input_file): Use the extra search path if set.
9560 (set_extra_library_path(): New.
9561 * plugin.h (Plugin_manager): Add set_extra_library_path and
9562 extra_search_path_.
9563
9564 2010-06-19 Cary Coutant <ccoutant@google.com>
9565
9566 * layout.cc (gdb_sections): Add .debug_types.
9567 (lines_only_debug_sections): Likewise.
9568
9569 2010-06-18 Rafael Espindola <espindola@google.com>
9570
9571 * plugin.cc (add_input_file,add_input_library)
9572 (Plugin_manager::add_input_file): Make filename arguments const.
9573 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9574 const.
9575
9576 2010-06-16 Doug Kwan <dougkwan@google.com>
9577
9578 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9579 .ARM.attributes section if we have not merged any input
9580 attributes sections.
9581
9582 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9583
9584 * arm.cc: Allow combining objects with no EABI version
9585 information.
9586
9587 2010-06-15 Rafael Espindola <espindola@google.com>
9588
9589 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9590
9591 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9592
9593 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9594 (struct iovec): Correct !HAVE_READV definition.
9595
9596 2010-06-10 Cary Coutant <ccoutant@google.com>
9597
9598 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9599 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9600 reloc sections.
9601 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9602
9603 PR 11683
9604 * symtab.h (Symbol::is_placeholder): New member function.
9605 * target-reloc.h (relocate_section): Check for placeholder symbols.
9606
9607 * testsuite/Makefile.am (plugin_test_8): New test.
9608 (plugin_test_9): New test.
9609 * testsuite/Makefile.in: Regenerate.
9610
9611 2010-06-09 Nick Clifton <nickc@redhat.com>
9612
9613 * yyscript.y (input_list_element): Allow strings prefixed with
9614 the '-' character. Treat these as libraries.
9615 * script.cc (script_add_library): New function. Adds a library
9616 specified by "-l<name>" found in an input script.
9617 * script-c.h: Add prototype for script_add_library.
9618
9619 2010-06-07 Doug Kwan <dougkwan@google.com>
9620
9621 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9622 Restrict stub-group size to be within long conditional branch
9623 range when working around cortex-A8 erratum.
9624
9625 2010-06-07 Damien Diederen <dd@crosstwine.com>
9626
9627 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9628 #ifdef typo.
9629
9630 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9631
9632 PR gold/11658
9633 * output.cc
9634 (Output_section::Input_section_sort_entry::compare_section_ordering):
9635 Change to return non-zero correctly.
9636 (Output_section::Input_section_sort_section_order_index_compare
9637 ::operator()): Change to fix ambiguity in comparisons.
9638
9639 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9640
9641 * gold.h (is_wildcard_string): New function.
9642 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9643 (Layout::layout_eh_frame): Ditto.
9644 (Layout::find_section_order_index): New method.
9645 (Layout::read_layout_from_file): New method.
9646 * layout.h (Layout::find_section_order_index): New method.
9647 (Layout::read_layout_from_file): New method.
9648 (Layout::input_section_position_): New private member.
9649 (Layout::input_section_glob_): New private member.
9650 * main.cc (main): Call read_layout_from_file here.
9651 * options.h (--section-ordering-file): New option.
9652 * output.cc (Output_section::input_section_order_specified_): New
9653 member.
9654 (Output_section::Output_section): Initialize new member.
9655 (Output_section::add_input_section): Add new parameter.
9656 Keep input sections when --section-ordering-file is used.
9657 (Output_section::set_final_data_size): Sort input sections when
9658 section ordering file is specified.
9659 (Output_section::Input_section_sort_entry): Add new parameter.
9660 Check sorting type.
9661 (Output_section::Input_section_sort_entry::compare_section_ordering):
9662 New method.
9663 (Output_section::Input_section_sort_compare::operator()): Change to
9664 consider section_order_index.
9665 (Output_section::Input_section_sort_init_fini_compare::operator()):
9666 Change to consider section_order_index.
9667 (Output_section::Input_section_sort_section_order_index_compare
9668 ::operator()): New method.
9669 (Output_section::sort_attached_input_sections): Change to sort
9670 according to section order when specified.
9671 (Output_section::add_input_section<32, true>): Add new parameter.
9672 (Output_section::add_input_section<64, true>): Add new parameter.
9673 (Output_section::add_input_section<32, false>): Add new parameter.
9674 (Output_section::add_input_section<64, false>): Add new parameter.
9675 * output.h (Output_section::add_input_section): Add new parameter.
9676 (Output_section::input_section_order_specified): New
9677 method.
9678 (Output_section::set_input_section_order_specified): New method.
9679 (Input_section::Input_section): Initialize section_order_index_.
9680 (Input_section::section_order_index): New method.
9681 (Input_section::set_section_order_index): New method.
9682 (Input_section::section_order_index_): New member.
9683 (Input_section::Input_section_sort_section_order_index_compare): New
9684 struct.
9685 (Output_section::input_section_order_specified_): New member.
9686 * script-sections.cc (is_wildcard_string): Delete and move modified
9687 method to gold.h.
9688 (Output_section_element_input::Output_section_element_input): Modify
9689 call to is_wildcard_string.
9690 (Output_section_element_input::Input_section_pattern
9691 ::Input_section_pattern): Ditto.
9692 (Output_section_element_input::Output_section_element_input): Ditto.
9693 * testsuite/Makefile.am (final_layout): New test case.
9694 * testsuite/Makefile.in: Regenerate.
9695 * testsuite/final_layout.cc: New file.
9696 * testsuite/final_layout.sh: New file.
9697
9698 2010-06-01 Rafael Espindola <espindola@google.com>
9699
9700 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9701
9702 2010-06-01 Rafael Espindola <espindola@google.com>
9703
9704 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9705 visibility of symbols.
9706
9707 2010-05-27 Doug Kwan <dougkwan@google.com>
9708
9709 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9710 from start of output section instead of address for a local symbol
9711 in a merged or relaxed section when doing a relocatable link.
9712
9713 2010-05-26 Rafael Espindola <espindola@google.com>
9714
9715 PR 11604
9716 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9717 adding sections the garbage collector removed.
9718 * gold/testsuite/Makefile.am: Add test.
9719 * gold/testsuite/Makefile.in: Regenerate.
9720 * gold/testsuite/plugin_test_7.sh: New.
9721 * gold/testsuite/plugin_test_7_1.c: New.
9722 * gold/testsuite/plugin_test_7_2.c: New.
9723
9724 2010-05-26 Rafael Espindola <espindola@google.com>
9725
9726 * script-sections.cc (Output_section_definition::set_section_addresses):
9727 Check for --section-start.
9728
9729 2010-05-26 Doug Kwan <dougkwan@google.com>
9730
9731 * arm.cc (Arm_scan_relocatable_relocs): New class.
9732 (Target_arm::relocate_special_relocatable): New method.
9733 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9734 (Arm_relocate_functions::thumb_branch_common): Same.
9735 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9736 instead of Default_scan_relocatable_relocs.
9737 * target-reloc.h (relocate_for_relocatable): Let target handle
9738 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9739 * target.h (Sized_target::relocate_special_relocatable): New method.
9740
9741 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9742
9743 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9744
9745 2010-05-23 Doug Kwan <dougkwan@google.com>
9746
9747 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9748 instead of a cast.
9749 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9750 with a direct branch, not a conditional branch, to a stub.
9751 * merge.cc (Output_merge_base::record_input_section): New method
9752 defintion.
9753 (Output_merge_data::do_add_input_section): Record input section if
9754 keeps-input-sections flag is set.
9755 (Output_merge_string::do_add_input_section): Ditto.
9756 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9757 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9758 INPUT_SECTIONS_.
9759 (Output_merge_base::keeps_input_sections,
9760 Output_merge_base::set_keeps_input_sections,
9761 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9762 method definitions.
9763 (Output_merge_base::Input_sections): New type declaration.
9764 (Output_merge_base::input_sections_begin,
9765 Output_merge_base::input_sections_end,
9766 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9767 (Output_merge_base::bool keeps_input_sections_,
9768 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9769 Output_merge_base::input_sections_): New data members.
9770 (Output_merge_data::do_set_keeps_input_sections): New method
9771 defintion.
9772 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9773 * output.cc (Output_section::Input_section::relobj): Move method
9774 defintion from class declaration to here and handle merge sections.
9775 (Output_section::Input_section::shndx): Ditto.
9776 (Output_section::Output_section): Remove initializations of removed
9777 data members and initialize new data member LOOKUP_MAPS_.
9778 (Output_section::add_input_section): Set keeps-input-sections flag
9779 for a newly created merge output section as appropriate. Adjust code
9780 to use Output_section_lookup_maps class.
9781 (Output_section::add_relaxed_input_section): Adjst code for lookup
9782 maps code refactoring.
9783 (Output_section::add_merge_input_section): Add a new parameter
9784 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9785 class. If adding input section to a newly created merge output
9786 section fails, remove the new merge section.
9787 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
9788 Adjust code for use of the Output_section_lookup_maps class.
9789 (Output_section::find_merge_section): Ditto.
9790 (Output_section::build_lookup_maps): New method defintion.
9791 (Output_section::find_relaxed_input_section): Adjust code to use
9792 Output_section_lookup_maps class.
9793 (Output_section::get_input_sections): Export merge sections. Adjust
9794 code to use Output_section_lookup_maps class.
9795 (Output_section:::add_script_input_section): Adjust code to use
9796 Output_section_lookup_maps class. Update lookup maps for merge
9797 sections also.
9798 (Output_section::discard_states): Use Output_section_lookup_maps.
9799 (Output_section::restore_states): Same.
9800 * output.h (Merge_section_properties): Move class defintion out of
9801 Output_section.
9802 (Output_section_lookup_maps): New class.
9803 (Output_section::Input_section::is_merge_section): New method
9804 defintion.
9805 (Output_section::Input_section::relobj): Move defintion out of class
9806 defintion. Declare method only.
9807 (Output_section::Input_section::shndx): Ditto.
9808 (Output_section::Input_section::output_merge_base): New method defintion.
9809 (Output_section::Input_section::u2_.pomb): New union field.
9810 (Output_section::Merge_section_by_properties_map,
9811 Output_section::Output_section_data_by_input_section_map,
9812 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9813 Remove types.
9814 (Output_section::add_merge_input_section): Add new parameter
9815 KEEPS_INPUT_SECTIONS.
9816 (Output_section::build_lookup_maps): New method declaration.
9817 (Output_section::merge_section_map_,
9818 Output_section::merge_section_by_properties_map_,
9819 Output_section::relaxed_input_section_map_,
9820 Output_section::is_relaxed_input_section_map_valid_): Remove data
9821 members.
9822 (Output_section::lookup_maps_): New data member.
9823
9824 2010-05-21 Doug Kwan <dougkwan@google.com>
9825
9826 PR gold/11619
9827 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9828 avoid a compilation error.
9829
9830 2010-05-19 Rafael Espindola <espindola@google.com>
9831
9832 * script-sections.cc (Output_section_definition::allocate_to_segment):
9833 Update the phdrs_list even when the output section is NULL.
9834 * testsuite/Makefile.am: Add test.
9835 * testsuite/Makefile.in: Regenerate.
9836 * testsuite/script_test_9.cc: New.
9837 * testsuite/script_test_9.sh: New.
9838 * testsuite/script_test_9.t: New.
9839
9840 2010-05-19 Doug Kwan <dougkwan@google.com>
9841
9842 * arm.cc (Arm_input_section::original_size): New method.
9843 (Arm_input_section::do_addralign): Add a cast.
9844 (Arm_input_section::do_output_offset): Remove static cast.
9845 (Arm_input_section::original_addralign,
9846 Arm_input_section::original_size_): Change type to uint32_t.
9847 (Arm_input_section::init): Add safe casts for section alignment
9848 and size.
9849 (Arm_input_section::set_final_data_size): Do not set address and
9850 offset of stub table.
9851 (Arm_output_section::fix_exidx_coverage): Change use of of
9852 Output_section::Simple_input_section to that of
9853 Output_section::Input_section.
9854 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9855 except for the first pass.
9856 * output.cc (Output_section::get_input_sections): Change type of
9857 input_sections to std::list<Input_section>.
9858 (Output_section::add_script_input_section): Rename from
9859 Output_section::add_simple_input_section. Change type of SIS
9860 parameter from Simple_input_section to Input_section.
9861 * output.h (Output_section::Simple_input_section): Remove class.
9862 (Output_section::Input_section): Change class visibility to public.
9863 (Output_section::Input_section::addralign): Use stored alignments
9864 for special input sections if set.
9865 (Output_section::Input_section::set_addralign): New method.
9866 (Output_section::get_input_sections): Change parameter type from
9867 list of Simple_input_section to list of Input_section.
9868 (Output_section::add_script_input_section): Rename from
9869 Output_section::add_simple_input_section. Change first parameter's
9870 type from Simple_input_section to Input_section and remove the
9871 second and third parameters.
9872 * script-sections.cc (Input_section::Input_section_list): Change
9873 type to list of Output_section::Input_section/
9874 (Input_section_info::Input_section_info): Change parameter type of
9875 INPUT_SECTION to Output_section::Input_section.
9876 (Input_section_info::input_section): Change return type.
9877 (Input_section_info::input_section_): Change type to
9878 Output_section::Input_section.
9879 (Output_section_element_input::set_section_addresses): Adjust code
9880 to use Output_section::Input_section instead of
9881 Output_section::Simple_input_section. Adjust code for renaming
9882 of Output_section::add_simple_input_section.
9883 (Orphan_output_section::set_section_addresses): Ditto.
9884
9885 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9886
9887 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9888 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9889
9890 2010-05-18 Rafael Espindola <espindola@google.com>
9891
9892 * options.cc (General_options::finalize): Handle -nostdlib.
9893 * options.h (nostdlib): New option.
9894 * script.cc (script_add_search_dir): Handle -nostdlib.
9895
9896 2010-05-12 Doug Kwan <dougkwan@google.com>
9897
9898 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9899 attributes section only if there no attributes section after merging.
9900 (Target_arm::merge_object_attributes): Move value of
9901 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
9902 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9903 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9904 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9905 and arm_attr_merge_7.stdout.
9906 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9907 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9908 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9909 arm_attr_merge_7b.o): New rules.
9910 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9911 arm_attr_merge_7
9912 * testsuite/Makefile.in: Regenerate.
9913 * testsuite/arm_attr_merge.sh: New file.
9914 * testsuite/arm_attr_merge_[67][ab].s: Same.
9915
9916 2010-05-05 Nick Clifton <nickc@redhat.com>
9917
9918 * po/es.po: Updated Spanish translation.
9919
9920 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9921
9922 * Makefile.am (install-exec-local): Properly install gold as
9923 default cross linker.
9924 * Makefile.in: Regenerated.
9925
9926 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9927 Nick Clifton <nickc@redhat.com>
9928
9929 * configure.ac (install_as_default): Define and set to false
9930 unless --enable-gold or --enable-gold=both/gold has been
9931 specified.
9932 * configure: Regenerate.
9933
9934 * Makefile.am (install-exec-local): Install the executable as
9935 'ld.gold'. If install_as_default is true then also install it as
9936 'ld'.
9937 * Makefile.in: Regenerated.
9938
9939 2010-04-24 Ian Lance Taylor <iant@google.com>
9940
9941 * layout.cc (Layout::layout_reloc): In relocatable link don't
9942 combine reloc sections for grouped sections.
9943
9944 2010-04-23 Sriraman Tallam <tmsriram@google.com>
9945
9946 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9947 sections that are not ordinary to icf.
9948 * icf.cc (get_section_contents): Handle relocation pointing to section
9949 with no object or shndx information.
9950 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9951 * testsuite/Makefile.in: Regenerate.
9952 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9953 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9954
9955 2010-04-22 Ian Lance Taylor <iant@google.com>
9956
9957 * expression.cc (Expression::Expression_eval_info): Add
9958 result_alignment_pointer field.
9959 (Expression::eval_with_dot): Add result_alignment_pointer
9960 parameter. Change all callers.
9961 (Expression::eval_maybe_dot): Likewise.
9962 (class Binary_expression): Add alignment_pointer parameter to
9963 left_value and right_value. Change all callers.
9964 (BINARY_EXPRESSION): Set result alignment.
9965 (class Trinary_expression): Add alignment_pointer parameter to
9966 arg2_value and arg3_value. Change all callers.
9967 (Trinary_cond::value): Set result alignment.
9968 (Max_expression::value, Min_expression::value): Likewise.
9969 (Align_expression::value): Likewise.
9970 * script-sections.cc (class Sections_element): Add dot_alignment
9971 parameter to set_section_addresses virtual function. Update
9972 instantiations.
9973 (class Output_section_element): Likewise.
9974 (Script_sections::create_segments): Add dot_alignment parameter.
9975 Change all callers.
9976 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9977 (Script_sections::set_phdrs_clause_addresses): Likewise.
9978 * script-sections.h: Update declarations.
9979 * script.h: Update declarations.
9980 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9981 min_p_align.
9982 * testsuite/script_test_3.t: Set large alignment.
9983 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9984 segment has expected alignment.
9985
9986 2010-04-22 Nick Clifton <nickc@redhat.com>
9987
9988 * po/gold.pot: Updated by the Translation project.
9989 * po/vi.po: Updated Vietnamese translation.
9990
9991 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9992
9993 * testsuite/Makefile.am (check_PROGRAMS): Add
9994 icf_virtual_function_folding_test.
9995 * testsuite/Makefile.in: Regenerated.
9996
9997 2010-04-15 Andrew Haley <aph@redhat.com>
9998
9999 * options.h (merge_exidx_entries): New option.
10000 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10001 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10002 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10003 (Target_arm::merge_exidx_entries): New function.
10004 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10005 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10006 to Arm_exidx_fixup constructor.
10007 Add new arg, merge_exidx_entries.
10008 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10009 Arm_output_section::fix_exidx_coverage.
10010
10011 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10012
10013 * icf.cc (get_section_contents): Check for preemptible functions.
10014 Ignore addend when appropriate.
10015 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10016 section folded.
10017 (add_from_relobj): Check for section folded.
10018 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10019 * symtab.h (should_add_dynsym_entry): Add new parameter.
10020 * target-reloc.h (scan_relocs): Check for section folded.
10021 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10022 Check reloc types for function pointers in shared objects.
10023 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10024 case.
10025 (icf_preemptible_functions_test): New test case.
10026 (icf_string_merge_test): New test case.
10027 * testsuite.Makefile.in: Regenerate.
10028 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10029 bar_glob. Refactor code.
10030 * testsuite/icf_preemptible_functions_test.cc: New file.
10031 * testsuite/icf_preemptible_functions_test.sh: New file.
10032 * testsuite/icf_string_merge_test.cc: New file.
10033 * testsuite/icf_string_merge_test.sh: New file.
10034 * testsuite/icf_virtual_function_folding_test.cc: New file.
10035 * testsuite/icf_virtual_function_folding_test.sh: New file.
10036
10037 2010-04-14 Doug Kwan <dougkwan@google.com>
10038
10039 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10040 for local symbol recounting if we remove a section due to ICF.
10041 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10042 there are no regular objects in input.
10043
10044 2010-04-13 Doug Kwan <dougkwan@google.com>
10045
10046 * arm.cc (Arm_input_section::set_final_data_size): Compute
10047 accurate final data size instead of using current data size.
10048
10049 2010-04-09 Doug Kwan <dougkwan@google.com>
10050
10051 * layout.cc (Layout::choose_output_section): Handle script section
10052 types.
10053 (Layout::make_output_section_for_script): Add section type parameter.
10054 Handle script section types.
10055 * layout.h (Layout::make_output_section_for_script): Add section
10056 type parameter.
10057 * output.cc (Output_section::Output_section): Initialize data member
10058 is_noload_.
10059 (Output_section::do_reset_address_and_file_offset): Do not set address
10060 to 0 if section is a NOLOAD section.
10061 * output.h (Output_section::is_noload): New method.
10062 (Output_section::set_is_noload): Ditto.
10063 (Output_section::is_noload_): New data member.
10064 * script-c.h (Script_section_type): New enum type.
10065 (struct Parser_output_section_header): Add new file section_type.
10066 * script-sections.cc (Sections_element::output_section_name): Add
10067 parameter for returning script section type.
10068 (Output_section_definition::output_section_name): Ditto.
10069 (Output_section_definition::section_type)P; New method.
10070 (Output_section_definiton::script_section_type_name): Ditto.
10071 (Output_section_definition::script_section_type_): New data member.
10072 (Output_section_definition::Output_section_definition): Initialize
10073 data member Output_section_definition::script_section_type_.
10074 (Output_section_definition::create_sections): Pass script section type
10075 to Layout::make_output_section_for_script.
10076 (Output_section_definition::output_section_name): Return script
10077 section type to caller.
10078 (Output_section_definition::set_section_address): Do not advance
10079 dot value and load address if section type is NOLOAD. Set address
10080 of NOLOAD sections regardless of section flags.
10081 (Output_section_definition::print): Print section type if it is
10082 not SCRIPT_SECTION_TYPE_NONE.
10083 (Output_section_definition::section_type): New method.
10084 (Output_section_definition::script_section_type_name): Ditto.
10085 (Script_sections::output_section_name): Add new parameter
10086 PSECTION_TYPE for returning script section type. Pass it to
10087 section elements. Handle discard sections.
10088 (Sort_output_sections::operator()): Handle NOLOAD sections.
10089 * script-sections.h (Script_sections::Section_type): New enum type.
10090 (Script_sections::output_section_name): Add a new parameter for
10091 returning script section type.
10092 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10093 INFO and NOLOAD.
10094 * yyscript.y (union): Add new field SECTION_TYPE.
10095 (COPY, DSECT, INFO, NOLOAD): New tokens.
10096 (opt_address_and_section_type): Change type to output_section_header.
10097 (section_type): New non-terminal
10098 (section_header): Handle section type.
10099 (opt_address_and_section_type): Return section type value.
10100
10101 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10102
10103 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10104 * testsuite/plugin_common_test_2.c (foo): Likewise.
10105
10106 2010-04-08 Doug Kwan <dougkwan@google.com>
10107
10108 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10109 Output_merge_data.
10110 * output.cc (Output_section::add_merge_input_section): Simplify
10111 code and return status of Output_merge_base::add_input_section.
10112 Update merge section map only if Output_merge_base::add_input_section
10113 returns true.
10114
10115 2010-04-07 Doug Kwan <dougkwan@google.com>
10116
10117 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10118 if section is marked as containing instructions but has no mapping
10119 symbols.
10120 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10121 correct section index.
10122 (Arm_relobj::find_linked_text_section): Ditto.
10123
10124 2010-04-07 Cary Coutant <ccoutant@google.com>
10125
10126 * archive.cc (include_member): Destroy Read_symbols_data object before
10127 releasing file.
10128 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10129 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10130 (Read_symbols_data::~Read_symbols_data) New destructor.
10131 (Section_relocs::Section_relocs) New constructor.
10132 (Section_relocs::~Section_relocs) New destructor.
10133 (Read_relocs_data::Read_relocs_data) New constructor.
10134 (Read_relocs_data::~Read_relocs_data) New destructor.
10135 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10136 pointers to NULL after deleting.
10137
10138 2010-04-07 Doug Kwan <dougkwan@google.com>
10139
10140 * arm.cc: Replace "endianity" with "endianness" in comments.
10141 (Arm_exidx_cantunwind): Ditto.
10142 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10143 (Arm_relobj::merge_flags_and_attributes): New method.
10144 (Arm_relobj::merge_flags_and_attributes_): New data member.
10145 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10146 (Arm_relobj::scan_sections_for_stubs): Ditto.
10147 (Arm_relobj::do_read_symbols): Check to see if we really want to
10148 merge processor-specific flags and attributes. Exit early if
10149 an object is empty except for section names and the undefined symbol.
10150 (Target_arm::do_finalize_sections): Move check for ELF format to
10151 Arm_relobj::do_read_symbols. Merge processor specific flags and
10152 attributes from a regular object only when we have determined that
10153 it is aapropriate. Do not create an .ARM.attributes section in
10154 output if there is no regular input object.
10155 (Target_arm::merge_processor_specific_flags): Check
10156 --warn-mismatch before printing any error.
10157 (Target_arm::merge_object_attributes): Ditto.
10158 * gold.cc (queue_middle_tasks): Handle the case in which there is
10159 no regular object in input.
10160 * options.cc (General_options::parse_EB): New method.
10161 (General_options::parse_EL): Same.
10162 (General_options::General_options): Initialize endianness_.
10163 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10164 New options.
10165 (General_options::Endianness): New enum.
10166 (General_options::endianness): New method.
10167 (General_options::endianness_): New data member.
10168 * parameters.cc (Parameters::set_options): Check target endianness.
10169 (Parameters::set_target_once): Ditto.
10170 (Parameters::check_target_endianness): New method.
10171 (parameters_force_valid_target): If either -EL or -EB is specified,
10172 use it to define endianness of default target.
10173 * parameters.h (Parameters::check_target_endianness): New method
10174 declaration.
10175 * target.h (class Target): Change "endianity" to "endianness"
10176 in comments.
10177
10178 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10179
10180 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10181 * configure: Regenerate.
10182 * Makefile.in: Regenerate.
10183 * testsuite/Makefile.in: Regenerate.
10184
10185 2010-04-06 Cary Coutant <ccoutant@google.com>
10186
10187 gcc PR lto/42757
10188 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10189 prevailing definitions of common symbols.
10190 * testsuite/plugin_test_6.sh: New test case.
10191 * testsuite/plugin_common_test_1.c: New test case.
10192 * testsuite/plugin_common_test_2.c: New test case.
10193 * testsuite/Makefile.am (plugin_test_6): New test case.
10194 * testsuite/Makefile.in: Regenerate.
10195
10196 2010-04-06 Nick Clifton <nickc@redhat.com>
10197
10198 * po/vi.po: New Vietnamese translation.
10199
10200 2010-03-30 Doug Kwan <dougkwan@google.com>
10201
10202 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10203
10204 2010-03-25 Doug Kwan <dougkwan@google.com>
10205
10206 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10207 to avoid a conversion warning on a 32-bit host.
10208
10209 2010-03-24 Ian Lance Taylor <iant@google.com>
10210
10211 * testsuite/script_test_3.t: Add a TLS segment.
10212 * testsuite/Makefile.am (check_PROGRAMS): Add
10213 tls_phdrs_script_test.
10214 (tls_phdrs_script_test_SOURCES): Define.
10215 (tls_phdrs_script_test_DEPENDENCIES): Define.
10216 (tls_phdrs_script_test_LDFLAGS): Define.
10217 (tls_phdrs_script_test_LDADD): Define.
10218 * testsuite/Makefile.in: Rebuild.
10219
10220 2010-03-23 Cary Coutant <ccoutant@google.com>
10221
10222 * fileread.cc (find_or_make_view): Fix comment.
10223
10224 2010-03-23 Ian Lance Taylor <iant@google.com>
10225
10226 * script-sections.cc (class Orphan_section_placement): Define
10227 PLACE_TLS and PLACE_TLS_BSS.
10228 (Orphan_section_placement::Orphan_section_placement): Initialize
10229 new places.
10230 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10231 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10232 (tls_script_test_SOURCES): Define.
10233 (tls_script_test_DEPENDENCIES): Define.
10234 (tls_script_test_LDFLAGS): Define.
10235 (tls_script_test_LDADD): Define.
10236 * testsuite/Makefile.in: Rebuild.
10237
10238 2010-03-22 Doug Kwan <dougkwan@google.com>
10239
10240 * arm.cc (Arm_relocate_functions::abs8,
10241 Arm_relocate_functions::abs16): Use correct check for overflow
10242 specified in the ARM ELF specs.
10243 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10244 target of a BLX instruction specially.
10245 (Reloc_stub::stub_type_for_reloc): Ditto.
10246 (Relocate::relocate): Use symbolic names instead of numeric relocation
10247 codes to report error.
10248 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10249 workaround.
10250 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10251 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10252 thumb2_blx_out_of_range.stdout
10253 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10254 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10255 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10256 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10257 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10258 thumb2_blx_in_range, thumb2_blx_in_range.o,
10259 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10260 thumb2_blx_out_of_range.o): New rules.
10261 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10262 thumb2_blx_in_range and thumb2_blx_out_of_range.
10263 * testsuite/Makefile.in: Regenerate.
10264 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10265 * testsuite/thumb_blx_in_range.s: New file.
10266 * testsuite/thumb_blx_out_of_range.s: New file.
10267
10268 2010-03-22 Rafael Espindola <espindola@google.com>
10269
10270 * archive.cc (Should_include): Move to archive.h.
10271 (should_include_member): Make it a member of Archive.
10272 (Lib_group): New.
10273 (Add_lib_group_symbols): New.
10274 * archive.h: Include options.h.
10275 (Archive_member): Moved from Archive.
10276 (Should_include): Moved from archive.cc.
10277 (Lib_group): New.
10278 (Add_lib_group_symbols): New.
10279 * dynobj.cc (do_should_include_member): New.
10280 * dynobj.h (do_should_include_member): New.
10281 * gold.cc (queue_initial_tasks): Update call to queue.
10282 * main.cc (main): Print lib group stats.
10283 * object.cc (do_should_include_member): New.
10284 * object.h: Include archive.h.
10285 (Object::should_include_member): New.
10286 (Object::do_should_include_member): New.
10287 (Sized_relobj::do_should_include_member): New.
10288 * options.cc (General_options::parse_start_lib): New.
10289 (General_options::parse_end_lib): New.
10290 (Input_arguments::add_file): Handle lib groups.
10291 (Input_arguments::start_group): Check we are not in a lib.
10292 (Input_arguments::start_lib): New.
10293 (Input_arguments::end_lib): New.
10294 * options.h (General_options): Add start_lib and end_lib.
10295 (Input_argument::lib_): New.
10296 (Input_argument::lib): New.
10297 (Input_argument::is_lib): New.
10298 (Input_file_lib): New.
10299 (Input_arguments::in_lib_): New.
10300 (Input_arguments::in_lib): New.
10301 (Input_arguments::start_lib): New.
10302 (Input_arguments::end_lib_): New.
10303 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10304 in unused members as preempted.
10305 (Sized_pluginobj::do_should_include_member): New.
10306 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10307 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10308 return the blocker.
10309 (Read_symbols::do_whole_lib_group): New.
10310 (Read_symbols::do_lib_group): New.
10311 (Read_symbols::do_read_symbols): Handle lib groups.
10312 (Read_symbols::get_name): Handle lib groups.
10313 * readsyms.h (Read_symbols): Add an archive member pointer.
10314 (Read_symbols::do_whole_lib_group): New.
10315 (Read_symbols::do_lib_group): New.
10316 (Read_symbols::member_): New.
10317 * script.cc (read_input_script): Update call to queue_soon.
10318
10319 2010-03-19 Doug Kwan <dougkwan@google.com>
10320
10321 * arm.cc (Stub_table::Stub_table): Initialize new data members
10322 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10323 (Stub_table::add_reloc_stub): Assign stub offset and update
10324 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10325 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10326 New data members.
10327 (Stub_table::update_data_size_and_addralign): Use
10328 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10329 instead of going over all reloc stubs.
10330 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10331 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10332 Stringpool_template::offset_ to size of Stringpool_char.
10333 (Stringpool_template::new_key_offset): Remove code to initialize
10334 Stringpool_template::offset_.
10335 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10336 Stringpool_template::offset_ to zero.
10337
10338 2010-03-15 Doug Kwan <dougkwan@google.com>
10339
10340 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10341 offset_.
10342 (Stringpool_template::new_key_offset): New method.
10343 (Stringpool_template::add_string): Assign offsets when adding new
10344 strings.
10345 (Stringpool_template::set_string_offsets): Do not set string offsets
10346 when not optimizing.
10347 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10348 member size_.
10349 (Chunked_vector::clear): Clear size_.
10350 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10351 (Chunked_vector::size): Return size_.
10352 (Chunked_vector::push_back): Use size_ to find insert position.
10353 (Chunked_vector::size_): New data member.
10354 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10355 (Stringpool_template::new_key_offset): New method declaration.
10356 (Stringpool_template::offset_): New data member.
10357
10358 2010-03-15 Rafael Espindola <espindola@google.com>
10359
10360 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10361 Add_symbols' constructor.
10362 * readsyms.h (Add_symbols): Remove the input_group member.
10363
10364 2010-03-10 Ian Lance Taylor <iant@google.com>
10365
10366 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10367 target to ask whether a reference to a symbol requires a stack
10368 split.
10369 * target.h (Target::is_call_to_non_split): New function.
10370 (Target::do_is_call_to_non_split): Declare virtual function.
10371 * target.cc: Include "symtab.h".
10372 (Target::do_is_call_to_non_split): New function.
10373 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10374
10375 2010-03-10 Cary Coutant <ccoutant@google.com>
10376
10377 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10378 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10379 (File_read::open[2]): Add whole_file_view_ to list of views.
10380 (File_read::make_view): Remove test of whole_file_view_.
10381 (File_read::find_or_make_view): Create whole_file_view_ if
10382 necessary.
10383 (File_read::clear_views): Replace bool parameter with enum;
10384 adjust all callers. Don't delete views with permanent data;
10385 do delete cached views and views from archives if
10386 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10387 if clearing the corresponding view.
10388 * fileread.h (File_read::Clear_views_mode): New enum.
10389 (File_read::View::is_permanent_view): New method.
10390 (File_read::clear_views): Replace bool parameter
10391 with enum; adjust all callers.
10392 * options.h (General_options): Change keep_files_mapped option;
10393 add map_whole_files.
10394 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10395 releasing the file.
10396 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10397 the file.
10398
10399 2010-03-10 David S. Miller <davem@davemloft.net>
10400
10401 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10402
10403 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10404
10405 * icf.cc (get_section_contents): Add '@' marker after processing the
10406 merge reloc.
10407
10408 2010-03-08 Doug Kwan <dougkwan@google.com>
10409
10410 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10411 due to a conversion warning.
10412 (Arm_relobj::update_output_local_symbol_count): Check for local
10413 symbol with unset output index.
10414
10415 2010-03-05 Ian Lance Taylor <iant@google.com>
10416
10417 * options.h (class General_options): Add --spare-dynamic-tags.
10418 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10419 --spare-dynamic-tags.
10420
10421 2010-03-05 Ian Lance Taylor <iant@google.com>
10422
10423 * incremental.cc: Include "libiberty.h".
10424
10425 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10426
10427 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10428 function, is_info_ member.
10429 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10430 (Versions::Versions): Update caller.
10431 (Versions::define_base_version): Likewise.
10432 (Versions::add_def): Likewise.
10433
10434 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10435
10436 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10437 (Scan::possible_function_pointer_reloc): New function.
10438 (Scan::local_reloc_may_be_function_pointer): Change to call
10439 possible_function_pointer_reloc.
10440 (Scan::global_reloc_may_be_function_pointer): Ditto.
10441 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10442 relocations in ".data.rel.ro._ZTV" section.
10443 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10444 * testsuite/icf_safe_so_test.cc: Ditto.
10445 * testsuite/icf_safe_test.cc: Ditto.
10446 * testsuite/icf_safe_test.sh: Ditto.
10447
10448 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10449 Ian Lance Taylor <iant@google.com>
10450
10451 * target-reloc.h (relocate_section): Check the symbol table index
10452 for -1U before setting the local symbol index.
10453 (scan_relocatable_relocs): If copying the relocation, record that
10454 the local symbol is required.
10455 * object.h (Symbol_value::is_output_symtab_index_set): New
10456 function.
10457 (Symbol_value::may_be_discarded_from_output_symtab): New
10458 function.
10459 (Symbol_value::has_output_symtab_entry): New function.
10460 (Symbol_value::needs_output_symtab_entry): Remove.
10461 (Symbol_value::output_symtab_index): Make sure the symbol index is
10462 set.
10463 (Symbol_value::set_output_symtab_index): Make sure the symbol
10464 index is not set. Make sure the new index is valid.
10465 (Symbol_value::set_must_have_output_symtab_entry): New function.
10466 (Symbol_value::has_output_dynsym_entry): New function.
10467 (Symbol_value::set_output_dynsym_index): Make sure the new index
10468 is valid.
10469 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10470 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10471 local symbol if permitted.
10472 (Sized_relobj::do_finalize_local_symbols): Call
10473 is_output_symtab_index_set rather than needs_output_symtab_entry.
10474 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10475 rather than needs_output_symtab_entry. Call
10476 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10477 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10478 is_output_symtab_index_set rather than needs_output_symtab_entry.
10479 * testsuite/discard_locals_relocatable_test.c: New file.
10480 * testsuite/discard_locals_test.sh: Test -r.
10481 * testsuite/Makefile.am (check_DATA): Add
10482 discard_locals_relocatable_test1.syms,
10483 discard_local_relocatable_test2.syms.
10484 (MOSTLYCLEANFILES): Likewise. Also add
10485 discard_locals_relocatable_test1.lout and
10486 discard_locals_relocatable_test2.out.
10487 (discard_locals_relocatable_test1.syms): New target.
10488 (discard_locals_relocatable_test.o): New target.
10489 (discard_locals_relocatable_test1.out): New target.
10490 (discard_locals_relocatable_test2.syms): New target.
10491 (discard_locals_relocatable_test2.out): New target.
10492 (various): Add missing ../ld-new dependencies.
10493 * testsuite/Makefile.in: Rebuild.
10494
10495 2010-03-03 Nick Clifton <nickc@redhat.com>
10496
10497 * po/fi.po: New Finnish translation.
10498
10499 2010-03-01 Doug Kwan <dougkwan@google.com>
10500
10501 * layout.cc (Layout::Layout): Force section types of .init_array*,
10502 .preinit_array* and .fini_array* sections.
10503 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10504 Fix check of return value of std::string::find.().
10505 (Output_section::Input_section_sort_compare::operator()): Remove
10506 comment about .init_array.
10507 (Output_section::Input_section_sort_init_fini_compare::operator()):
10508 New method.
10509 (Output_section::sort_attached_input_sections): Handle .init_array
10510 and .fini_array specially.
10511 * output.h (Output_section::Inut_section_sort_compare): Update
10512 comment.
10513 (Output_section::Input_section_sort_init_fini_compare): New struct.
10514
10515 2010-02-26 Doug Kwan <dougkwan@google.com>
10516
10517 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10518 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10519 * testsuite/debug_msg.sh: Avoid matching source line number for
10520 use of global variable undef_int.
10521
10522 2010-02-26 Doug Kwan <dougkwan@google.com>
10523
10524 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10525 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10526 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10527 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10528 * options.cc (General_options::General_options): Initialize member
10529 fix_v4bx_.
10530 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10531 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10532 and rm_no_fix_v4bx.stdout
10533 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10534 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10535 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10536 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10537 and arm_no_fix_v4bx.
10538 * Makefile.in: Regenerate.
10539 * testsuite/arm_fix_v4bx.s: New file.
10540 * testsuite/arm_fix_v4bx.sh: Ditto.
10541
10542 2010-02-24 Doug Kwan <dougkwan@google.com>
10543
10544 * arm.cc (Target_arm::got_section): Make the .got section the first
10545 non RELRO section in the data segment.
10546 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10547 suffixes of section names.
10548
10549 2010-02-24 Doug Kwan <dougkwan@google.com>
10550
10551 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10552 flags and attributes merging if an input file is a binary file.
10553 * fileread.cc (Input_file::open): Record format of original file.
10554 * fileread.h (Input_file::Format): New enum type.
10555 (Input_file::Input_file): Initialize data member format_.
10556 (Input_file::format): New method definition.
10557 (Input_file::format_):: New data member.
10558
10559 2010-02-24 Doug Kwan <dougkwan@google.com>
10560
10561 * arm.cc (Arm_output_data_got): New class.
10562 (ARM_TCB_SIZE): New constant
10563 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10564 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10565 If user uses a script with a SECTIONS clause, issue only a warning
10566 for a misplaced EXIDX input section. Otherwise, issue an error.
10567 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10568 garbage collection.
10569 (Target_arm::got_mode_index_entry): Handle static linking.
10570 (Target_arm::Scan::local): Ditto.
10571 (Target_arm::Scan::global): Ditto.
10572 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10573 all incorrectly implemented relocations.
10574 (Target_arm::fix_exidx_coverage): Pass layout to
10575 Arm_output_section::fix_exidx_coverage.
10576 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10577 from ".ARM.exidx." and ".ARM.extab.".
10578
10579 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10580
10581 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10582 section if it does not already exist.
10583 * attributes.cc (Attributes_section_data::Attributes_section_data):
10584 Don't crash if size is zero.
10585
10586 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10587 Ian Lance Taylor <iant@google.com>
10588
10589 * gold.cc (queue_middle_tasks): If no input files were opened,
10590 exit.
10591 * workqueue.h (Task_function::Task_function): Assert that there is
10592 a blocker.
10593
10594 2010-02-22 Doug Kwan <dougkwan@google.com>
10595
10596 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10597 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10598 types to avoid warnings due to different uint64_t implementations
10599 on different hosts.
10600
10601 2010-02-21 Doug Kwan <dougkwan@google.com>
10602
10603 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10604 handling of the maximum backward branch offset.
10605 (Arm_relocate_functions::thumb_branch_common): Ditto.
10606 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10607 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10608 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10609 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10610 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10611 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10612 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10613 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10614 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10615 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10616 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10617 thumb2_bl_out_of_range.o): New rules.
10618 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10619 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10620 thumb2_bl_out_of_range
10621 * testsuite/Makefile.in: Regenerate.
10622 * testsuite/arm_bl_in_range.s: New file.
10623 * testsuite/arm_bl_out_of_range.s: Ditto.
10624 * testsuite/arm_branch_in_range.sh: Ditto.
10625 * testsuite/arm_branch_range.t: Ditto.
10626 * testsuite/thumb2_branch_range.t: Ditto.
10627 * testsuite/thumb_bl_in_range.s: Ditto.
10628 * testsuite/thumb_bl_out_of_range.s: Ditto.
10629 * testsuite/thumb_branch_range.t: Ditto.
10630
10631 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10632
10633 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10634 Add reloc offset information.
10635 * icf.cc (get_section_contents): Change iterators to point to the new
10636 vectors. Add reloc offset information to the contents.
10637 * icf.h (Icf::Sections_reachable_info): New typedef.
10638 (Icf::Sections_reachable_list): New typedef.
10639 (Icf::Offset_info): New typedef.
10640 (Icf::Reloc_info): New struct typedef.
10641 (Icf::Reloc_info_list): New typedef.
10642 (Icf::symbol_reloc_list): Delete method.
10643 (Icf::addend_reloc_list): Delete method.
10644 (Icf::section_reloc_list): Delete method.
10645 (Icf::reloc_info_list): New method.
10646 (Icf::reloc_info_list_): New member.
10647
10648 2010-02-19 Doug Kwan <dougkwan@google.com>
10649
10650 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10651 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10652 * arm.cc (Arm_relocation_functions): New forward declaration.
10653 (Target_arm::Target_arm): Initialize new data members
10654 got_mod_index_offset_ and tls_base_symbol_defined_.
10655 (Target_arm::Relocate::relocate_tls): New method.
10656 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10657 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10658 New methods.
10659 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10660 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10661 (Target_arm::got_mod_index_offset_,
10662 Target_arm::tls_base_symbol_defined_): New data members.
10663 (Target_arm::Scan::local, Target::Scan::global,
10664 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10665 relocations.
10666
10667 2010-02-18 Doug Kwan <dougkwan@google.com>
10668
10669 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10670 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10671 text section as a parameter becuase some broken tools may not set
10672 the link in section header.
10673 (Target_arm::has_got_section): New method.
10674 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10675 without any mapping symbol as data only. Remove warning.
10676 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10677 link in its section header, try to discover the link by inspecting the
10678 REL31 relocation at the beginning of the section.
10679 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10680 in error message.
10681 (Target_arm::Scan::global): Treat any reference to the symbol
10682 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10683
10684 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10685
10686 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10687 (Scan::global_reloc_may_be_function_pointer): New function.
10688 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10689 (Scan::global_reloc_may_be_function_pointer): New function.
10690 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10691 (Scan::global_reloc_may_be_function_pointer): New function.
10692 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10693 (Scan::global_reloc_may_be_function_pointer): New function.
10694 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10695 (Scan::global_reloc_may_be_function_pointer): New function.
10696 (Scan::possible_function_pointer_reloc): New function.
10697 (Target_x86_64::can_check_for_function_pointers): New function.
10698 * gc.h (gc_process_relocs): Scan relocation types to determine if
10699 function pointers were taken for targets that support it.
10700 * icf.cc (Icf::find_identical_sections): Include functions for
10701 folding in safe ICF whose pointer is not taken.
10702 * icf.h (Secn_fptr_taken_set): New typedef.
10703 (fptr_section_id_): New member.
10704 (section_has_function_pointers): New function.
10705 (set_section_has_function_pointers): New function.
10706 (check_section_for_function_pointers): New function.
10707 * options.h: Fix comment for safe ICF option.
10708 * target.h (can_check_for_function_pointers): New function.
10709 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10710 Modify icf_safe_test for X86-64.
10711 * testsuite/Makefile.in: Regenerate.
10712 * testsuite/icf_safe_so_test.cc: New file.
10713 * testsuite/icf_safe_so_test.sh: New file.
10714 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10715 (main): Change to take pointer to function kept_func_3.
10716 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10717 folding is done correctly for X86-64.
10718
10719 2010-02-12 David S. Miller <davem@davemloft.net>
10720
10721 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10722 is_symbolless parameter.
10723 (Output_reloc<SHT_REL>::is_symbolless): New.
10724 (Output_reloc<SHT_REL>::is_symbolless_): New.
10725 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10726 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10727 (Output_reloc<SHT_RELA>::is_symbolless): New.
10728 (Output_data_reloc::add_global): Handle is_symbolless.
10729 (Output_data_reloc::add_global_relative): Likewise.
10730 (Output_data_reloc::add_local): Likewise.
10731 (Output_data_reloc::add_local_relative): Likewise.
10732 (Output_data_reloc::add_symbolless_global_addend): New.
10733 (Output_data_reloc::add_symbolless_local_addend): New.
10734 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10735 is_symbolless.
10736 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10737 instead of ->is_relative_
10738 (Output_reloc::write): Likewise.
10739 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10740 (Output_reloc::write_rel): Simplify.
10741
10742 * sparc.cc (Target_sparc::Scan::local): Use
10743 ->add_symbolless_local_addend as needed.
10744 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10745 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10746 based upon relocation offset.
10747
10748 2010-02-11 Doug Kwan <dougkwan@google.com>
10749
10750 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10751 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10752 beginning of function.
10753 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10754 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10755 parameter is_32bit in calls to should_apply_static_reloc.
10756 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10757 (check_DATA): Add arm_abs_global.stdout.
10758 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10759 arm_abs_global.stdout): New rules.
10760 (MOSTLLYCLEANFILES): Add arm_abs_global
10761 * Makefile.in: Regenerate.
10762 * testsuite/arm_abs_global.s: New file.
10763 * testsuite/arm_abs_global.sh: Ditto.
10764 * testsuite/arm_abs_lib.s: Ditto.
10765
10766 2010-02-11 Ian Lance Taylor <iant@google.com>
10767
10768 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10769 Read_relocs task.
10770 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10771 Allocate_commons_task first.
10772 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10773 task, rather than symtab_lock_.
10774 (Gc_process_relocs::~Gc_process_relocs): New function.
10775 (Gc_process_relocs::is_runnable): Check this_blocker_.
10776 (Gc_process_relocs::locks): Use next_blocker_ rather than
10777 blocker_.
10778 (Scan_relocs::~Scan_relocs): New function.
10779 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10780 symtab_lock_.
10781 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10782 next_blocker_.
10783 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10784 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10785 constructor accordingly.
10786 (class Gc_process_relocs): Likewise.
10787 (class Scan_relocs): Likewise.
10788 * common.h (class Allocate_commons_task): Remove symtab_lock_
10789 field, and corresponding constructor parameter.
10790 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10791 symtab_lock_.
10792 (Allocate_commons_task::locks): Likewise.
10793
10794 2010-02-11 Ian Lance Taylor <iant@google.com>
10795
10796 * gold-threads.h (class Once): Define.
10797 (class Initialize_lock): Rewrite as child of Once.
10798 * gold-threads.cc (class Once_initialize): Define.
10799 (once_pointer_control): New static variable.
10800 (once_pointer, once_arg): New static variables.
10801 (c_run_once): New static function.
10802 (Once::Once, Once::run_once, Once::internal_run): New functions.
10803 (class Initialize_lock_once): Remove.
10804 (initialize_lock_control): Remove.
10805 (initialize_lock_pointer): Remove.
10806 (initialize_lock_once): Remove.
10807 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10808 (Initialize_lock::initialize): Rewrite.
10809 (Initialize_lock::do_run_once): New function.
10810 * archive.cc (Archive::interpret_header): Only clear name if it is
10811 not already empty.
10812 * fileread.cc: Include "gold-threads.h"
10813 (file_counts_lock): New static variable.
10814 (file_counts_initialize_lock): Likewise.
10815 (File_read::release): Only increment counts when using --stats.
10816 Use a lock around the increment.
10817 * parameters.cc (class Set_parameters_target_once): Define.
10818 (set_parameters_target_once): New static variable.
10819 (Parameters::Parameters): Move here from parameters.h.
10820 (Parameters::set_target): Rewrite.
10821 (Parameters::set_target_once): New function.
10822 (Parameters::clear_target): Move here and rewrite.
10823 * parameters.h (class Parameters): Update declarations. Add
10824 set_parameters_target_once_ field.
10825 (Parameters::Parameters): Move to parameters.cc.
10826 (Parameters::clear_target): Likewise.
10827 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10828 task.
10829 (Start_group::~Start_group): New function.
10830 (Start_group::is_runnable): New function.
10831 (Start_group::locks, Start_group::run): New functions.
10832 (Finish_group::run): Change saw_undefined to size_t.
10833 * readsyms.h (class Start_group): Define.
10834 (class Finish_group): Change saw_undefined_ field to size_t.
10835 (Finish_group::Finish_group): Remove saw_undefined and
10836 this_blocker parameters. Change all callers.
10837 (Finish_group::set_saw_undefined): New function.
10838 (Finish_group::set_blocker): New function.
10839 * symtab.h (class Symbol_table): Change saw_undefined to return
10840 size_t. Change saw_undefined_ field to size_t.
10841 * target-select.cc (Set_target_once::do_run_once): New function.
10842 (Target_selector::Target_selector): Initialize set_target_once_
10843 field. Don't initialize lock_ and initialize_lock_ fields.
10844 (Target_selector::instantiate_target): Rewrite.
10845 (Target_selector::set_target): New function.
10846 * target-select.h (class Set_target_once): Define.
10847 (class Target_selector): Update declarations. Make
10848 Set_target_once a friend. Remove lock_ and initialize_lock_
10849 fields. Add set_target_once_ field.
10850
10851 2010-02-10 Ian Lance Taylor <iant@google.com>
10852
10853 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10854 queueing any tasks.
10855 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10856 (queue_middle_tasks): Add all blockers before queueing any tasks.
10857 (queue_final_tasks): Likewise.
10858 * token.h (Task_token::add_blockers): New function.
10859 * object.h (Input_objects::number_of_relobjs): New function.
10860
10861 2010-02-10 Ian Lance Taylor <iant@google.com>
10862
10863 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10864 shared, not if not position independent.
10865 * x86_64.cc (Relocate::relocate_tls): Likewise.
10866 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10867 (tls_pie_pic_test): New target.
10868 * testsuite/Makefile.in: Rebuild.
10869
10870 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10871 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10872 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10873 * testsuite/Makefile.in: Rebuild.
10874
10875 2010-02-09 David S. Miller <davem@davemloft.net>
10876
10877 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10878 R_SPARC_RELATIVE using ->add_local_relative().
10879 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10880
10881 * output.h (Output_data_dynamic::add_section_size): New method
10882 that takes two Output_data objects.
10883 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10884 entry param. Handle it in initializers.
10885 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10886 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10887 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10888 arg.
10889 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10890 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10891 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10892 for dynrel_includes_plt.
10893 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10894 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10895 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10896 before .rela.plt
10897 (Target_sparc::do_finalize_sections): Update to pass true for
10898 dynrel_includes_plt.
10899 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10900 output before .rela.plt
10901 (Target_powerpc::do_finalize_sections): Update to pass true for
10902 dynrel_includes_plt when 32-bit.
10903
10904 2010-02-08 Doug Kwan <dougkwan@google.com>
10905
10906 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10907 method.
10908 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10909 Arm_relobj::scan_section_for_cortex_a8_stubs,
10910 Arm_relobj::do_relocation_section): Instead of calling
10911 Output_section::output_address, use faster
10912 Arm_relobj::simple_input_section_output_address.
10913
10914 2010-02-08 David S. Miller <davem@davemloft.net>
10915
10916 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10917 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10918 relocation helper function.
10919
10920 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10921 just like R_SPARC_GOT{10,13,22}.
10922 (Target_sparc::Scan::local): Likewise.
10923 (Target_sparc::Relocate:relocate): Likewise.
10924
10925 2010-02-06 Ian Lance Taylor <iant@google.com>
10926
10927 * configure.ac: Rewrite targetobjs duplicate removal code to use
10928 only shell constructs.
10929 * configure: Rebuild.
10930
10931 2010-02-05 Doug Kwan <dougkwan@google.com>
10932
10933 PR 11247
10934 * arm.cc (Arm_relobj::section_is_scannable): New method.
10935 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10936 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10937
10938 2010-02-04 Doug Kwan <dougkwan@google.com>
10939
10940 PR 11247
10941 * arm-reloc-property.cc (cstdio): Include.
10942 * configure.ac (targetobjs): Remove duplicates.
10943 * configure: Regenerate.
10944 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10945 big and little endian version for a given address size.
10946
10947 2010-02-03 Doug Kwan <dougkwan@google.com>
10948
10949 * arm-reloc-property.cc
10950 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10951 definition.
10952 * arm-reloc-property.h
10953 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10954 New method definition.
10955 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10956 declaration.
10957 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10958 overflow to N.
10959 (GOT_PREL): Change implemented to Y.
10960 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10961 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10962 (Arm_relocate_functions::movw_abs_nc): Remove method.
10963 (Arm_relocate_functions::movt_abs): Ditto.
10964 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10965 (Arm_relocate_functions::thm_movt_abs): Ditto.
10966 (Arm_relocate_functions::movw_rel_nc): Ditto.
10967 (Arm_relocate_functions::movw_rel): Ditto.
10968 (Arm_relocate_functions::movt_rel): Ditto.
10969 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10970 (Arm_relocate_functions:thm_movw_rel): Ditto.
10971 (Arm_relocate_functions:thm_movt_rel): Ditto.
10972 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10973 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10974 New method definitions.
10975 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10976 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10977 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10978 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10979 (Target_arm::Relocate::relocate): Check for non-static or
10980 unimplemented relocation code and exit early. Change calls to
10981 Target_arm::reloc_uses_thumb_bit and
10982 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10983 instead. Refactor code to handle similar relocations to increase
10984 code sharing. Remove check for unsupported relocation code in switch
10985 statement.
10986 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10987 relocation property table to find out size. Change error message to
10988 print out the name of a relocation code instead of the numeric value.
10989 (Target_arm::scan_reloc_for_stub): Use relocation property table
10990 instead of calling Target_arm::reloc_uses_thumb_bit().
10991
10992 2010-02-02 Doug Kwan <dougkwan@google.com>
10993
10994 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10995 types of relaxed input section.
10996
10997 2010-02-02 Doug Kwan <dougkwan@google.com>
10998
10999 * Makefile.am (HFILES): Add arm-reloc-property.h.
11000 (DEFFILES): New.
11001 (TARGETSOURCES): Add arm-reloc-property.cc
11002 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11003 (libgold_a_SOURCES): $(DEFFILES)
11004 * Makefile.in: Regenerate.
11005 * arm-reloc-property.cc: New file.
11006 * arm-reloc-property.h: New file.
11007 * arm-reloc.def: New file.
11008 * arm.cc: Update comments.
11009 (arm-reloc-property.h): New included header.
11010 (arm_reloc_property_table): New global variable.
11011 (Target_arm::do_select_as_default_target): New method definition.
11012 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11013 arm-reloc-property to targ_extra_obj.
11014 * parameters.cc (set_parameters_target): Call
11015 Target::select_as_default_target().
11016 * target.h (Target::select_as_default_target): New method definition.
11017 (Target::do_select_as_default_target): Same.
11018
11019 2010-02-01 Doug Kwan <dougkwan@google.com>
11020
11021 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11022 first_output_text_section_.
11023 (Arm_exidx_fixup::first_output_text_section): New method definition.
11024 (Arm_exidx_fixup::first_output_text_section_): New data member.
11025 (Arm_exidx_fixup::process_exidx_section): Record the first text
11026 output section seen.
11027 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11028 and entsize in output section header.
11029
11030 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11031
11032 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11033 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11034 (Arm_relocate_functions::thm_alu11): New Method.
11035 (Arm_relocate_functions::thm_pc8): New Method.
11036 (Arm_relocate_functions::thm_pc12): New Method.
11037 (Target_arm::Scan::local): Handle the relocations.
11038 (Target_arm::Scan::global): Likewise.
11039 (Target_arm::Relocate::relocate): Likewise.
11040 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11041
11042 2010-01-29 Doug Kwan <dougkwan@google.com>
11043
11044 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11045 of relocation types as ld.
11046
11047 2010-01-29 Doug Kwan <dougkwan@google.com>
11048
11049 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11050 to public.
11051 (Arm_relocate_functions::thumb_branch_common): Ditto.
11052 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11053 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11054 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11055 Arm_relocate_functions::jump24): Remove.
11056 (Target_arm::Relocate::relocate): Adjust code to call
11057 Arm_relocation_functions::arm_branch_common and
11058 Arm_relocation_functions::thumb_branch_common instead of their removed
11059 wrappers. Merge switch-cases together to reduce source code size.
11060
11061 2010-01-29 Doug Kwan <dougkwan@google.com>
11062
11063 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11064 output_local_symbol_count_needs_update_.
11065 (Arm_relobj::output_local_symbol_count_needs_update,
11066 Arm_relobj::set_output_local_symbol_count_needs_update,
11067 Arm_relobj::update_output_local_symbol_count): New methods.
11068 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11069 member.
11070 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11071 of pointed function as in a R_ARM_PREL31 relocation.
11072 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11073 for output local symbol count updating.
11074 (Target_arm::do_relax): Update output local symbol counts in objects
11075 if necessary.
11076 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11077
11078 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11079
11080 * arm.cc: Added support for the ARM relocations:
11081 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11082 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11083 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11084 movw_prel_nc).
11085 (Arm_relocate_functions::movw_rel): New method.
11086 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11087 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11088 thm_movw_prel_nc).
11089 (Arm_relocate_functions::thm_movw_rel): New method.
11090 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11091 thm_movt_prel).
11092 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11093 relocations.
11094 (Target_arm::Scan::global): Likewise.
11095 (Target_arm::Relocate::relocate): Likewise.
11096 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11097 Likewise.
11098
11099 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11100
11101 * arm.cc: Added support for ARM group relocations.
11102 (Target_arm::reloc_needs_sym_origin): New method.
11103 (Arm_relocate_functions::calc_grp_kn): New method.
11104 (Arm_relocate_functions::calc_grp_residual): New method.
11105 (Arm_relocate_functions::calc_grp_gn): New method.
11106 (Arm_relocate_functions::arm_grp_alu): New Method.
11107 (Arm_relocate_functions::arm_grp_ldr): New Method.
11108 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11109 (Arm_relocate_functions::arm_grp_ldc): New Method.
11110 (Target_arm::Scan::local): Handle the ARM group relocations.
11111 (Target_arm::Scan::global): Likewise.
11112 (Target_arm::Relocate::relocate): Likewise.
11113 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11114 Likewise.
11115
11116 2010-01-26 Doug Kwan <dougkwan@google.com>
11117
11118 * arm.cc (set): Include.
11119 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11120 pointer type.
11121 (Arm_output_section::Text_section_list): New type.
11122 (Arm_output_section::append_text_sections_to_list): New method.
11123 (Arm_output_section::fix_exidx_coverage): Ditto.
11124 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11125 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11126 Relobj::set_section_offset() instead of
11127 Sized_relobj::invalidate_section_offset().
11128 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11129 parameter for section headers. Ignore relocation sections for
11130 unallocated sections and EXIDX sections.
11131 (Target_arm::fix_exidx_coverage): New method.
11132 (Target_arm::output_section_address_less_than): New type.
11133 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11134 linked text section instead of the EXIDX section.
11135 (Arm_output_section::create_stub_group): Add an assertion to check
11136 that this is not an EXIDX output section.
11137 (Arm_output_section::append_text_sections_to_list): New method.
11138 (Arm_output_section::fix_exidx_coverage): Ditto.
11139 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11140 Arm_relobj::section_needs_reloc_stub_scanning.
11141 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11142 first pass.
11143 (Target_arm::fix_exidx_coverage): New method.
11144 * object.h (Relobj::set_output_section): New method.
11145 (Sized_relobj::invalidate_section_offset): Remove method.
11146 (Sized_relobj::do_invalidate_section_offset): Remove method.
11147 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11148
11149 2010-01-25 Doug Kwan <dougkwan@google.com>
11150
11151 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11152 Fix warning due to signed and unsigned comparison on a 32-bit host.
11153
11154 2010-01-22 Doug Kwan <dougkwan@google.com>
11155
11156 * arm.cc (Target_arm::do_relax): Record an output section for section
11157 offset adjustment it contains any stub table that has changed.
11158 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11159 offsets in an output section if necessary.
11160 * output.cc (Output_section::Output_section): Initialize
11161 section_offsets_need_adjustments_.
11162 (Output_section::add_input_section_for_script): Renamed to
11163 Output_section::add_simple_input_section.
11164 (Output_section::save_states): Add a comment.
11165 (Output_section::discard_states): New method defintion.
11166 (Output_section::adjust_section_offsets): Same.
11167 * output.h (Output_section::add_input_section_for_script): Renamed to
11168 Output_section::add_simple_input_section.
11169 (Output_section::discard_states): New method declaration.
11170 (Output_section::adjust_section_offsets): Same.
11171 (Output_section::section_offsets_need_adjustment,
11172 Output_section::set_section_offsets_need_adjustment): New method
11173 definitions.
11174 (Output_section::section_offsets_need_adjustment_): New data member.
11175 * script-sections.cc
11176 (Output_section_element_input::set_section_address): Adjust code for
11177 renaming of Output_section::add_input_section_for_script.
11178 (Orphan_output_section::set_section_address): Same.
11179
11180 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11181
11182 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11183 Fix_v4bx enum values .
11184 * gold/options.h (General_options): New option definitions.
11185 (General_options::fix_v4bx): New method.
11186 (General_options::Fix_v4bx): New enum.
11187 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11188 (General_options::parse_fix_v4bx_interworking): New method.
11189
11190 2010-01-22 Doug Kwan <dougkwan@google.com>
11191
11192 * arm.cc (Arm_exidx_fixup): New class.
11193
11194 2010-01-21 Doug Kwan <dougkwan@google.com>
11195
11196 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11197 classes.
11198 (Arm_exidx_section_offset_map): New type.
11199
11200 2010-01-21 Doug Kwan <dougkwan@google.com>
11201
11202 * arm.cc (Arm_exidx_input_section): New class.
11203 (Arm_relobj::exidx_input_section_by_link,
11204 Arm_relobj::exidx_input_section_by_shndx,
11205 Arm_relobj::make_exidx_input_section): New methods.
11206 (read_arm_attributes_section): Remove.
11207 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11208 information about them.
11209 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11210 to here.
11211
11212 2010-01-20 Doug Kwan <dougkwan@google.com>
11213
11214 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11215 Input_section_specifier to Section_id.
11216 (Target_arm::new_arm_input_section: Adjust code for change of key
11217 type.
11218 (Target_arm::find_arm_input_section): Ditto.
11219 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11220 (Section_id): Remove.
11221 (Garbage_collection::Section_id_hash): Remove.
11222 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11223 (Section_id): Remove.
11224 (Icf::Section_id_hash): Remove.
11225 * object.h (Section_id, Const_section_id, Section_id_hash,
11226 Const_section_id_hash): New type definitions.
11227 * output.cc (Output_section::add_relaxed_input_section): Change to
11228 use Const_section_id instead of Input_section_specifier as key type.
11229 (Output_section::add_merge_input_section): Ditto.
11230 (Output_section::build_relaxation_map): Change to use Section_id
11231 instead of Input_section_specifier as key type.
11232 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11233 Ditto.
11234 (Output_section::convert_input_sections_to_relaxed_sections): Change
11235 to use Const_section_id instead of Input_section_specifier as key type.
11236 (Output_section::find_merge_section): Ditto.
11237 (Output_section::find_relaxed_input_section): Ditto.
11238 * output.h (Input_section_specifier): Remove class.
11239 (Output_section::Output_section_data_by_input_section_map): Change
11240 key type to Const_section_id.
11241 (Output_section::Output_relaxed_input_section_by_input_section_map):
11242 Ditto.
11243 (Output_section::Relaxation_map): Change key type to Section_id.
11244
11245 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11246
11247 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11248 (class Arm_v4bx_stub): New class.
11249 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11250 (Stub_factory::make_arm_v4bx_stub): New method.
11251 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11252 (Stub_table::empty): Handle v4bx stubs.
11253 (Stub_table::add_arm_v4bx_stub): New method.
11254 (Stub_table::find_arm_v4bx_stub): New method.
11255 (Arm_relocate_functions::v4bx): New method.
11256 (Target_arm::fix_v4bx): New method.
11257 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11258 (Stub_table::relocate_stubs): Likewise.
11259 (Stub_table::do_write): Likewise.
11260 (Stub_table::update_data_size_and_addralign): Likewise.
11261 (Stub_table::finalize_stubs): Likewise.
11262 (Target_arm::Scan::local): Likewise.
11263 (Target_arm::Scan::global): Likewise.
11264 (Target_arm::do_finalize_sections): Likewise.
11265 (Target_arm::Relocate::relocate): Likewise.
11266 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11267 Likewise.
11268 (Target_arm::scan_reloc_for_stub): Likewise.
11269 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11270
11271 2010-01-19 Ian Lance Taylor <iant@google.com>
11272
11273 * output.cc (Output_section_headers::do_sized_write): Write large
11274 segment count to sh_info field.
11275 (Output_file_header::do_sized_write): For large segment count,
11276 write PN_XNUM to e_phnum field.
11277
11278 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11279
11280 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11281 (Arm_relocate_functions::thm_jump8): New function.
11282 (Arm_relocate_functions::thm_jump11): New function.
11283 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11284 R_ARM_THM_JUMP11.
11285 (Target_arm::Scan::global): Likewise.
11286 (Target_arm::Relocate::relocate): Likewise.
11287 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11288 Likewise.
11289
11290 2010-01-14 Doug Kwan <dougkwan@google.com>
11291
11292 * arm.cc (map, utility): Include headers.
11293 (Target_arm::apply_cortex_a8_workaround): New method.
11294 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11295 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11296 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11297 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11298 the --[no-]fix-cortex-a8 command line options.
11299 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11300 (Target_arm::relocate_stub): Use addend in instruction template.
11301 * options.h (DEFINE_bool): Set the user-set flag.
11302 (General_options): Add --[no-]-fix-cortex options.
11303 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11304 : Update fast look-up map after conversion.
11305
11306 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11307
11308 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11309 in the first pass of do_layout.
11310
11311 2010-01-13 Doug Kwan <dougkwan@google.com>
11312
11313 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11314 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11315 apparent compiler problem of not folding static constant integral
11316 data members of elfcpp::Elf_sizes<32>.
11317
11318 2010-01-13 Doug Kwan <dougkwan@google.com>
11319
11320 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11321 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11322 Arm_relobj::scan_section_for_cortex_a8_erratum,
11323 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11324 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11325 sections to scan for relocation stubs into a new method
11326 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11327 relocation and Cortex-A8 stub scanning.
11328 (Target_arm::do_relax): Force stubs to be after stubbed sections
11329 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11330 the beginning of a new relaxation pass. Update a comment.
11331 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11332
11333 2010-01-12 Ian Lance Taylor <iant@google.com>
11334
11335 * target-reloc.h (visibility_error): New inline function.
11336 (relocate_section): Call visibility_error.
11337 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11338 (MOSTLYCLEANFILES): Likewise.
11339 (protected_4_pic.o, protected_3.err): New targets.
11340 * testsuite/protected_4.cc: New file.
11341
11342 2010-01-12 Doug Kwan <dougkwan@google.com>
11343
11344 * arm.cc (Cortex_a8_reloc): New class.
11345 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11346 and cortex_a8_relocs_info_.
11347 (Target_arm::fix_cortex_a8): New method definition.
11348 (Target_arm::Cortex_a8_relocs_info): New type.
11349 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11350 New data member declarations.
11351 (Target_arm::scan_reloc_for_stub): Record information about
11352 relocations for THUMB branches that might be exempted from the
11353 Cortex-A8 workaround.
11354 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11355 at the beginning of a relaxation pass.
11356
11357 2010-01-12 Doug Kwan <dougkwan@google.com>
11358
11359 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11360 (Arm_relobj::Mapping_symbol_position,
11361 Arm_reloj::Mapping_symbol_position_less,
11362 Arm_relobj::Mapping_symbols_info): New types.
11363 (Target_arm::is_mapping_symbol_name): New method definition.
11364 (Arm_relobj::do_count_local_symbols): Save information about mapping
11365 symbols.
11366
11367 2010-01-11 Doug Kwan <dougkwan@google.com>
11368
11369 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11370 Arm_relocate_functions::thumb32_branch_upper,
11371 Arm_relocate_functions::thumb32_branch_lower,
11372 Arm_relocate_functions::thumb32_cond_branch_offset,
11373 Arm_relocate_functions::thumb32_cond_branch_upper,
11374 Arm_relocate_functions::thumb32_cond_branch_lower,
11375 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11376 branch offset encoding.
11377 (Arm_relocate_functions::thumb_branch_common): Use new branch
11378 offset encoding methods to avoid code duplication.
11379 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11380 (Stub_addend_reader::operator()): Use new branch encoding method
11381 to avoid code duplication.
11382
11383 2010-01-11 Doug Kwan <dougkwan@google.com>
11384
11385 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11386 (Target_arm::do_finalize_sections): Define special EXIDX section
11387 symbols only if referenced.
11388 * gc.h (Garbage_collection::add_reference): New method.
11389 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11390 code duplication.
11391
11392 2010-01-11 Ian Lance Taylor <iant@google.com>
11393
11394 * script.cc (Version_script_info::build_expression_list_lookup):
11395 Change complaing about duplicate wildcard match from error to
11396 warning.
11397
11398 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11399 of 2009-12-30.
11400 (Version_script_info::Version_script_info): Initialize globs_,
11401 default_version_, default_is_global_, and exact_. Don't
11402 initialize globals_ or locals_.
11403 (Version_script_info::build_lookup_tables): Build local symbols
11404 first.
11405 (Version_script_info::unquote): New function.
11406 (Version_script_info::add_exact_match): New function.
11407 (Version_script_info::build_expression_list_lookup): Remove lookup
11408 parameter. Add is_global parameter. Change all callers. Handle
11409 wildcard pattern specially. Unquote pattern. Call
11410 add_exact_match.
11411 (Version_script_info::get_name_to_match): New function.
11412 (Version_script_info::get_symbol_version): New function.
11413 (Version_script_info::get_symbol_version_helper): Remove.
11414 (Version_script_info::check_unmatched_names): Call unquote.
11415 * script.h (class Version_script_info): Change get_symbol_version
11416 to be non-inline and add is_global parameter; change all callers.
11417 Rewrite symbol_is_local. Update declarations. Define struct
11418 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11419 Remove globals_ and locals_ members. Add exact_, globs_,
11420 default_version_, is_global_.
11421 (Version_script_info::Glob): Remove pattern, add expression and
11422 is_global. Update constructor. Change all callers.
11423 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11424 default version.
11425 (Versions::symbol_section_contents): If a symbol is undefined, or
11426 defined in a dynamic object, set the version index to
11427 VER_NDX_LOCAL.
11428 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11429 symbol_is_local.
11430 (Symbol_table::add_from_pluginobj): Likewise.
11431 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11432
11433 2010-01-11 Doug Kwan <dougkwan@google.com>
11434
11435 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11436 (incremental_dump_LDADD): Add linking option for libintl.
11437 * Makefile.in: Regenerate.
11438
11439 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11440
11441 PR gold/11144
11442 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11443 instead of -Ds.
11444 * testsuite/Makefile.in: Regenerated.
11445
11446 2010-01-10 Doug Kwan <dougkwan@google.com>
11447
11448 * options.h (DEFINE_var): Use parentheses around argument varname__
11449 in macro body to avoid any unintended subsequent substitutions.
11450
11451 2010-01-10 Ian Lance Taylor <iant@google.com>
11452
11453 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11454 candidates before doing symbol resolution.
11455
11456 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11457 ODR candidates if only one is weak.
11458
11459 2010-01-08 Ian Lance Taylor <iant@google.com>
11460
11461 * script.cc (Version_script_info::build_expression_list_lookup):
11462 Don't warn about ambiguous version, just record the ambiguity.
11463 (Version_script_info::get_symbol_version_helper): Give error if
11464 version is ambiguous.
11465
11466 2010-01-08 Doug Kwan <dougkwan@google.com>
11467
11468 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11469 prev_data_size_ and prev_addralign_. Remove initializer for
11470 deleted data member has_been_changed_.
11471 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11472 to determine if the table is empty.
11473 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11474 Remove.
11475 (Stub_table::add_reloc_stub): Define method in class definition
11476 instead of just declaring it there.
11477 (Stub_table::add_cortex_a8_stub): New method definition.
11478 (Stub_table::update_data_size_and_addralign): Ditto.
11479 (Stub_table::finalize_stubs): Ditto.
11480 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11481 (Stub_table::do_addralign_): Return address alignment in the
11482 (Stub_table::do_reset_address_and_file_offset): Define method in
11483 class definition instead of declaring it there. Set current data
11484 size to be the data size of the previous pass.
11485 (Stub_table::set_final_data_size): Use current data size as the
11486 final data size.
11487 (Stub_table::relocate_stub): Change parameter type of stub from
11488 Reloc_stub pointer to Stub pointer.
11489 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11490 (Stub_table::Cortex_a8_stub_list): New typedef.
11491 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11492 Stub_table::prev_addralign_): New data member.
11493 (Arm_relobj::Arm_relobj): Initialize data member
11494 section_has_cortex_a8_workaround_.
11495 (Arm_relobj::section_has_cortex_a8_workaround,
11496 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11497 definitions.
11498 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11499 declarations.
11500 (Target_arm::relocate_stub): Change parameter type of stub from
11501 Reloc_stub pointer to Stub pointer.
11502 (Insn_template::size, Insn_template::alignment): Handle
11503 THUMB16_SPECIAL_TYPE.
11504 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11505 Stub_table::update_data_size_and_addralign,
11506 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11507 definitions.
11508 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11509 (Stub_table::do_write): Ditto.
11510 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11511
11512 2010-01-08 Ian Lance Taylor <iant@google.com>
11513
11514 PR 11108
11515 * symtab.h (class Symbol): Remove fields is_target_special_ and
11516 has_plt_offset_. Add field is_defined_in_discarded_section_.
11517 (Symbol::is_defined_in_discarded_section): New function.
11518 (Symbol::set_is_defined_in_discarded_section): New function.
11519 (Symbol::has_plt_offset): Rewrite.
11520 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11521 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11522 Don't initialize is_target_special_ or has_plt_offset_.
11523 Initialize is_defined_in_discarded_section_.
11524 (Symbol_table::add_from_relobj): If appropriate, set
11525 is_defined_in_discarded_section.
11526 * resolve.cc (Symbol::override_base_with_special): Don't test
11527 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11528 * target-reloc.h (relocate_section): Do special handling for
11529 symbols defined in discarded sections for global symbols as well
11530 as local symbols.
11531
11532 2010-01-08 Ian Lance Taylor <iant@google.com>
11533
11534 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11535 the SHT_SYMTAB case.
11536
11537 2010-01-08 Ian Lance Taylor <iant@google.com>
11538
11539 * object.cc (Sized_relobj::do_layout): Don't get confused if
11540 layout_eh_frame returns NULL.
11541
11542 2010-01-08 Ian Lance Taylor <iant@google.com>
11543
11544 PR 11084
11545 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11546 dynamic symbol table, use the normal symbol table.
11547 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11548 symbol table.
11549
11550 2010-01-08 Ian Lance Taylor <iant@google.com>
11551
11552 PR 11072
11553 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11554 sections.
11555
11556 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11557
11558 * version.cc (print_version): Change to "Copyright 2010".
11559
11560 2010-01-08 Ian Lance Taylor <iant@google.com>
11561
11562 PR 10287
11563 PR 11063
11564 * i386.cc (class Target_i386): Change return type of plt_section
11565 to be non-const.
11566 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11567 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11568 tls_desc_rel_ field.
11569 (Output_data_plt_i386::rel_tls_desc): New function.
11570 (Target_i386::rel_tls_desc_section): New function.
11571 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11572 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11573 R_386_TLS_DESC reloc in rel_tls_desc_section.
11574 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11575 Define struct Tlsdesc_info.
11576 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11577 (Target_x86_64::do_reloc_symbol_index): New function.
11578 (Target_x86_64::add_tlsdesc_info): New function.
11579 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11580 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11581 tlsdesc_rel_ field.
11582 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11583 all callers.
11584 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11585 (Target_x86_64::rela_tlsdesc_section): New function.
11586 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11587 handling.
11588 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11589 (Target_x86_64::do_reloc_addend): New function.
11590 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11591 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11592 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11593 (Output_reloc::type): New function.
11594 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11595 (Output_reloc::is_target_specific): New function.
11596 (Output_reloc::target_arg): New function.
11597 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11598 absolute relocs and target specific relocs.
11599 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11600 add_target_specific.
11601 (class Output_data_reloc) [SHT_RELA]: Likewise.
11602 * output.cc (Output_reloc::Output_reloc): Add four new versions
11603 for absolute relocs and target specific relocs.
11604 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11605 (Output_reloc::get_symbol_index): Likewise.
11606 (Output_reloc::local_section_offset): Check that local_sym_index_
11607 is not TARGET_CODE or 0.
11608 (Output_reloc::symbol_value): Likewise.
11609 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11610 reloc.
11611 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11612 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11613 functions.
11614 * layout.cc (add_target_dynamic_tags): Use output section for
11615 DT_PLTRELSZ and DT_JMPREL.
11616
11617 2010-01-07 Ian Lance Taylor <iant@google.com>
11618
11619 PR 11061
11620 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11621 function.
11622 (class Output_data_reloc_generic): Define.
11623 (class Output_data_reloc_base): Change base class to
11624 Output_data_reloc_generic. Change add() method to call
11625 bump_relative_reloc_count for a relative reloc. Remove
11626 sort_relocs_ field.
11627 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11628 to sort_relocs().
11629 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11630 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11631 appropriate.
11632 * layout.h (class Layout): Update declaration.
11633
11634 2010-01-07 Ian Lance Taylor <iant@google.com>
11635
11636 * output.h (class Output_data): Add const version of
11637 output_section and do_output_section.
11638 (class Output_section_data): Add const version of
11639 do_output_section.
11640 (class Output_section): Likewise.
11641 * layout.cc (Layout::add_target_dynamic_tags): New function.
11642 * layout.h (class Layout): Update declarations.
11643 * arm.cc (Target_arm::do_finalize_sections): Use
11644 add_target_dynamic_tags.
11645 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11646 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11647 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11648 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11649
11650 2010-01-07 Ian Lance Taylor <iant@google.com>
11651
11652 PR 11042
11653 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11654 object as needed.
11655
11656 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11657 Ian Lance Taylor <iant@google.com>
11658
11659 PR 11019
11660 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11661 Xindex::read_symtab_xindex.
11662
11663 2010-01-07 Doug Kwan <dougkwan@google.com>
11664
11665 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11666 (Insn_template::thumb16_bcond_insn): New method declaration.
11667 (Insn_template): Fix spelling.
11668 (Stub::thumb16_special): New method declaration.
11669 (Stub::do_write): Define virtual method which was previously pure
11670 virtual.
11671 (Stub::do_thumb16_special): New method declaration.
11672 (Stub::do_fixed_endian_write): New template member.
11673 (Reloc_stub::do_write): Remove.
11674 (Reloc_stub::do_fixed_endian_write): Remove.
11675 (Cortex_a8_stub): New class definition.
11676 (Stub_factory::make_cortex_a8_stub): New method definition.
11677 (Stub_factory::Stub_factory): Add missing static storage class
11678 qualifier for elf32_arm_stub_a8_veneer_blx.
11679
11680 2010-01-07 Ian Lance Taylor <iant@google.com>
11681
11682 PR 10980
11683 * options.h (class General_options): Add --warn-unresolved-symbols
11684 and --error-unresolved-symbols.
11685 * errors.cc (Errors::undefined_symbol): Implement
11686 --warn-unresolved-symbols.
11687
11688 * options.h (class General_options): Add -z text and -z textoff.
11689 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11690
11691 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11692
11693 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11694 (Garbage_collection::cident_sections): New function.
11695 (Garbage_collection::add_cident_section): New function.
11696 (Garbage_collection::cident_sections_): New member.
11697 (gc_process_relocs): Add references to sections whose names are C
11698 identifiers.
11699 * gold.h (cident_section_start_prefix): New constant.
11700 (cident_section_stop_prefix): New constant.
11701 (is_cident): New function.
11702 * layout.cc (Layout::define_section_symbols): Replace string constants
11703 with the newly defined constants.
11704 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11705 C identifiers.
11706 * testsuite/Makefile.am: Add gc_orphan_section_test.
11707 * testsuite/Makefile.in: Regenerate.
11708 * testsuite/gc_orphan_section_test.cc: New file.
11709 * testsuite/gc_orphan_section_test.sh: New file.
11710
11711 2010-01-06 Ian Lance Taylor <iant@google.com>
11712
11713 PR 10980
11714 * options.h (class General_options): Add --warn-shared-textrel.
11715 * layout.cc (Layout::finish_dynamic_section): Implement
11716 --warn-shared-textrel.
11717
11718 PR 10980
11719 * options.h (class General_options): Add --warn-multiple-gp.
11720
11721 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11722
11723 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11724 $(THREADSLIB) and $(LIBDL).
11725 * Makefile.in: Rebuild.
11726
11727 2010-01-06 Ian Lance Taylor <iant@google.com>
11728
11729 PR 10980
11730 * options.cc (General_options::parse_section_start): New function.
11731 (General_options::section_start): New function.
11732 (General_options::General_options): Initialize all members.
11733 * options.h: Include <map>
11734 (class General_options): Add --section-start. Add section_starts_
11735 member.
11736 * layout.cc (Layout::attach_allocated_section_to_segment): If
11737 --section-start was used, set the address of the segment. Remove
11738 local sort_sections.
11739 (Layout::relaxation_loop_body): If the address of the load segment
11740 has been set by --section-start, don't use it.
11741 * output.h (Output_segment::update_flags_for_output_section): New
11742 function.
11743 * output.cc (Output_segment::add_output_section): Call
11744 update_flags_for_output_section.
11745
11746 2010-01-05 Ian Lance Taylor <iant@google.com>
11747
11748 PR 10980
11749 * options.h (class General_options): Add --undefined-version.
11750 * script.cc (struct Version_expression): Add was_matched_by_symbol
11751 field.
11752 (Version_script_info::matched_symbol): New function.
11753 (Version_script_info::get_symbol_version_helper): Call
11754 matched_symbol.
11755 (Version_script_info::check_unmatched_names): New function.
11756 * script.h (class Version_script_info): Update declarations.
11757 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11758
11759 * options.h (class General_options): Use DEFINE_bool_alias for
11760 allow_multiple_definition.
11761 * resolve.cc (Symbol_table::should_override): Don't test
11762 allow_multiple_definition.
11763
11764 PR 10980
11765 * options.h (class General_options): Add --cref.
11766 * main.cc (main): Print cref table if --cref. Don't close mapfile
11767 until after printing cref table.
11768 * cref.cc: Include "symtab.h".
11769 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11770 (Cref_table_compare::operator()): New function.
11771 (Cref_inputs::gather_cref): New function.
11772 (filecol): New static const.
11773 (Cref_inputs::print_cref): New function.
11774 (Cref::print_cref): New function.
11775 * cref.h: Include <cstdio>.
11776 (class Cref): Update declarations.
11777 * mapfile.h (Mapfile::file): New function.
11778 * object.h (class Object): Define Symbols. Declare virtual
11779 do_get_global_symbols.
11780 (Object::get_global_symbols): New function.
11781 * object.cc (Input_objects::add_object): Pass object to cref_ if
11782 --cref.
11783 (Input_objects::archive_start): Likewise.
11784 (Input_objects::archive_stop): Likewise.
11785 (Input_objects::print_cref): New function.
11786 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11787 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11788 --cref.
11789 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11790 function.
11791 * plugin.h (class Sized_pluginobj): Update declarations.
11792
11793 2010-01-05 Ian Lance Taylor <iant@google.com>
11794
11795 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11796 to is_default_version. Rename insdef to insdefault.
11797 (Symbol_table::add_from_relobj): Rename def to is_default_version
11798 and local to is_forced_local.
11799 (Symbol_table::add_from_pluginobj): Likewise.
11800 (Symbol_table::add_from_dynobj): Likewise.
11801 (Symbol_table::define_special_symbol): Rename insdef to
11802 insdefault.
11803
11804 2010-01-04 Ian Lance Taylor <iant@google.com>
11805
11806 PR 10980
11807 * options.h (class General_options): Add
11808 --allow-multiple-definition and -z muldefs.
11809 * resolve.cc (Symbol_table::should_override): Don't warn about a
11810 multiple symbol definition if --allow-multiple-definition or -z
11811 muldefs.
11812
11813 PR 10980
11814 * options.h (class General_options): Add --add-needed and
11815 --copy-dt-needed-entries. Tweak --as-needed help entry.
11816 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11817 error if --copy-dt-needed-entries aka --add-needed is used and
11818 would cause a change in behaviour.
11819
11820 PR 10980
11821 * options.h (class General_options): Add -G as a short version of
11822 --shared. Add no-op options -assert, -g, and -i.
11823
11824 2010-01-04 Sriraman Tallam <tmsriram@google.com>
11825
11826 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11827 check for .text or .gnu.linkonce.t sections.
11828 * icf.cc (Icf::find_identical_sections): Ditto.
11829 Change the detection for mangled function name within the section
11830 name.
11831 * icf.h (is_section_foldable_candidate): New function.
11832
11833 2009-12-30 Ian Lance Taylor <iant@google.com>
11834
11835 PR 10980
11836 * options.h (class General_options): Permit two dashes with
11837 --retain-symbols-file.
11838
11839 2009-12-30 Ian Lance Taylor <iant@google.com>
11840
11841 PR 10979
11842 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11843 don't put the file header and segment headers in the text
11844 segment.
11845
11846 PR 10979
11847 * common.cc (Sort_commons::operator()): Stabilize sort when both
11848 entries are NULL.
11849 (Symbol_table::do_allocate_commons_list): When allocating common
11850 symbols, skip a symbol which is no longer common.
11851 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11852 an object before checking its type.
11853 * testsuite/common_test_2.c: New file.
11854 * testsuite/common_test_3.c: New file.
11855 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11856 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11857 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11858 (common_test_2_pic.o, common_test_2.so): New targets.
11859 (common_test_3_pic.o, common_test_3.so): New targets.
11860 * testsuite/Makefile.in: Rebuild.
11861
11862 PR 10979
11863 * script.cc (read_input_script): If we see a new SECTIONS clause,
11864 and we have added an input section, give an error.
11865 * layout.h (class Layout): Add have_added_input_section function.
11866 Add have_added_input_section_ field.
11867 * layout.cc (Layout::Layout): Initialize
11868 have_added_input_section_.
11869 (Layout::layout): Set have_added_input_section_.
11870 (Layout::layout_eh_frame): Likewise.
11871
11872 2009-12-30 Ian Lance Taylor <iant@google.com>
11873
11874 PR 10931
11875 * options.h (class General_options): Add --sort-common option.
11876 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11877 * common.cc (Sort_common): Add sort_order parameter to
11878 constructor. Add sort_order_ field.
11879 (Sort_commons::operator): Check sort_order_.
11880 (Symbol_table::allocate_commons): Determine the sort order.
11881 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11882 Change all callers.
11883 (Symbol_table::do_allocate_commons_list): Likewise.
11884
11885 2009-12-30 Ian Lance Taylor <iant@google.com>
11886
11887 PR 10916
11888 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11889 symbols from this object, don't change the visibility of an
11890 undefined symbol.
11891 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11892
11893 2009-12-30 Ian Lance Taylor <iant@google.com>
11894
11895 PR 10861
11896 * script.h (class Version_script_info): Define Language enum.
11897 Update declarations. Define Glob, Exact, and Lookup types. Add
11898 new fields globals_, locals_, and is_finalized_.
11899 * script.cc: Various formatting fixes.
11900 (class Parser_closure): Change language_stack_ from a vector of
11901 std::string to one of Version_script_info::Language. Adjust all
11902 uses accordingly.
11903 (class Lazy_demangler): Remove.
11904 (struct Version_expression): Change language from std::string to
11905 Version_script_info::Language.
11906 (Version_script_info::Version_script_info): New function.
11907 (Version_script_info::~Version_script_info): Don't call clear.
11908 (Version_script_info::finalize): New function.
11909 (Version_script_info::build_lookup_tables): New function.
11910 (Version_script_info::build_expression_list_lookup): New
11911 function.
11912 (Version_script_info::get_symbol_version_helper): Rewrite to use
11913 lookup tables.
11914 (Version_script_info::print_expression_list): Adjust to use
11915 Version_script_info::Language.
11916 (script_push_lex_into_version_mode): Check that the version script
11917 has not been finalized.
11918 (version_script_push_lang): Change language string to
11919 Version_script_info::Language.
11920 * options.cc (Command_line::version_script): New function.
11921 * options.h (class General_options): Add finalize_dynamic_list
11922 function. Change version_script from declaration to definition.
11923 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11924 * testsuite/version_script.map: Remove duplicate def of foo.
11925 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11926 version_script.map.
11927 * testsuite/Makefile.in: Rebuild.
11928
11929 2009-12-30 Ian Lance Taylor <iant@google.com>
11930
11931 PR 10843
11932 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11933 if the input symbol index is 0, make the output symbol index 0.
11934
11935 2009-12-30 Ian Lance Taylor <iant@google.com>
11936
11937 PR 10670
11938 * options.h (class General_options): Add -x/--discard-all.
11939 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11940 --discard-all. If the local symbol needs a dynamic entry, check
11941 that before handling --discard-locals.
11942
11943 2009-12-30 Ian Lance Taylor <iant@google.com>
11944
11945 PR 10450
11946 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11947 flags to PF_R.
11948 (Output_segment::add_output_section): Don't change the flags if
11949 the type is PT_TLS.
11950
11951 PR 10450
11952 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11953 GNU hash table if they need a dynamic value. Otherwise, don't add
11954 them if they are defined in a dynamic object or are forced local.
11955
11956 2009-12-29 Ian Lance Taylor <iant@google.com>
11957
11958 PR 10450
11959 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11960 .gnu.hash table for a 32-bit target.
11961
11962 PR 10450
11963 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11964 regular and a dynamic object only needs a dynamic symbol table
11965 entry if it is externally visible.
11966
11967 PR 10450
11968 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11969 constructor. Add global_offset_table_ field.
11970 (Target_i386::got_section): Set global_offset_table_.
11971 (Target_i386::do_finalize_sections): Set global_offset_table_
11972 size.
11973 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11974 in constructor. Add global_offset_table_ field.
11975 (Target_x86_64::got_section): Set global_offset_table_.
11976 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11977 size.
11978
11979 * layout.cc (Layout::Layout): Initialize increase_relro_.
11980 (Layout::get_output_section): Add is_relro, is_last_relro, and
11981 is_first_non_relro parameters. Change all callers.
11982 (Layout::choose_output_section): Likewise.
11983 (Layout::add_output_section_data): Likewise.
11984 (Layout::make_output_section): Likewise.
11985 (Layout::set_segment_offsets): Clear increase_relro when using a
11986 linker script.
11987 * layout.h (class Layout): Add increase_relro method. Add
11988 increase_relro_ field. Update declarations.
11989 * output.cc (Output_section::Output_section): Initialize
11990 is_last_relro_ and is_first_non_relro_.
11991 (Output_segment::add_output_section): Group relro sections is
11992 do_sort is true. Handle is_last_relro and is_first_non_relro.
11993 (Output_segment::maximum_alignment): Remove relro handling.
11994 (Output_segment::set_section_addresses): Add increase_relro
11995 parameter. Change all callers. Add initial alignment to align
11996 relro sections on separate page. Remove old relro handling.
11997 (Output_segment::set_section_list_addresses): Remove in_relro
11998 parameter. Change all callers.
11999 (Output_segment::set_offset): Add increase parameter. Change all
12000 callers. Remove old relro handling.
12001 * output.h (class Output_section): Add new methods: is_last_relro,
12002 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12003 Add is_last_relro_ and is_first_non_relro_ fields.
12004 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12005 Create separate .got.plt section. Call increase_relro.
12006 * x86_64.cc (Target_x86_64::got_section): Likewise.
12007 * testsuite/relro_script_test.t: Add .got.plt.
12008
12009 PR 10450
12010 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12011 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12012 (Layout::finalize): Call set_dynamic_symbol_size.
12013 (Layout::set_dynamic_symbol_size): New function.
12014 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12015 set_dynamic_symbol_size.
12016
12017 PR 10450
12018 * output.h (class Output_section): Add is_entsize_zero_ field.
12019 * output.cc (Output_section::Output_section): Initialize
12020 is_entsize_zero_.
12021 (Output_section::set_entsize): If two different entsizes are
12022 requested, force it to zero.
12023 (Output_section::add_input_section): Set flags for .debug_str
12024 before updating section flags. Set entsize.
12025 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12026 and SHF_STRING if all input sections have those flags.
12027
12028 2009-12-29 Rafael Espindola <espindola@google.com>
12029
12030 * main.cc (main): Fix the sys time reporting.
12031 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12032 reporting.
12033
12034 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12035
12036 * options.cc (General_options::parse_version): Allow -v to exit
12037 without an error if there is nothing to link.
12038
12039 2009-12-29 Ian Lance Taylor <iant@google.com>
12040
12041 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12042 using a version of gcc before 4.1.
12043 * configure: Rebuild.
12044
12045 2009-12-28 Chris Demetriou <cgd@google.com>
12046
12047 * attributes.cc (Output_attributes_section_data::do_write): Use
12048 std::vector::front rather than std::vector::data.
12049
12050 2009-12-28 Ian Lance Taylor <iant@google.com>
12051
12052 * symtab.h (class Symbol_table): Add enum Defined.
12053 * resolve.cc (Symbol_table::should_override): Add defined
12054 parameter. Change all callers. Test whether object is NULL
12055 before calling a method on it.
12056 (Symbol_table::report_resolve_problem): Add defined parameter.
12057 Change all callers.
12058 (Symbol_table::should_override_with_special): Likewise.
12059 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12060 parameter. Change all callers.
12061 (Symbol_table::do_define_in_output_data): Likewise.
12062 (Symbol_table::define_in_output_segment): Likewise.
12063 (Symbol_table::do_define_in_output_segment): Likewise.
12064 (Symbol_table::define_as_constant): Likewise.
12065 (Symbol_table::do_define_as_constant): Likewise.
12066 * script.h (class Symbol_assignment): Add is_defsym parameter to
12067 constructor; change all callers.
12068 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12069 parameter. Change all callers. Add is_defsym_ field.
12070 (class Parser_closure): Add parsing_defsym parameter to
12071 constructor; change all callers. Add parsing_defsym accessor
12072 function. Add parsing_defsym_ field.
12073
12074 2009-12-28 Ian Lance Taylor <iant@google.com>
12075
12076 * gold.cc (queue_middle_tasks): Fix formatting.
12077 * object.cc (Relobj::is_section_name_included): Likewise.
12078
12079 2009-12-23 Ian Lance Taylor <iant@google.com>
12080
12081 * i386.cc (Target_i386::do_calls_non_split): Recognize
12082 -fsplit-stack prologue for a function with a static chain.
12083 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12084 -fsplit-stack prologue when using %r11.
12085
12086 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12087
12088 * options.cc (General_options::parse_version): Make -v continue and do
12089 the link like GNU ld does.
12090
12091 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12092
12093 * Makefile.am (CCFILES): Add timer.cc.
12094 (HFILES): Add timer.h.
12095 * configure.ac: Check for sysconf and times.
12096 * main.cc: include timer.h.
12097 (main): Use Timer instead of get_run_time.
12098 * timer.cc: New.
12099 * timer.h: New.
12100 * workqueue.cc: include timer.h.
12101 (Workqueue::find_and_run_task):
12102 Report user, sys and wall time.
12103 * Makefile.in: Regenerate.
12104 * config.in: Regenerate.
12105 * configure: Regenerate.
12106
12107 2009-12-16 Doug Kwan <dougkwan@google.com>
12108
12109 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12110 sections.
12111 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12112 relaxed input sections.
12113 * output.cc (Output_section::find_relaxed_input_section): Change
12114 return type to Output_relaxed_input_section pointer. Adjust code
12115 for new type of relaxed_input_section_map_.
12116 * output.h (Output_section::find_relaxed_input_section): Change
12117 return type to Output_relaxed_input_section pointer.
12118 (Output_section::Output_relaxed_input_section_by_input_section_map):
12119 New type.
12120 (Output_section::relaxed_input_section_map_): Change type to
12121 Output_section::Output_relaxed_input_section_by_input_section_map.
12122 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12123 input section.
12124
12125 2009-12-15 Ian Lance Taylor <iant@google.com>
12126
12127 * layout.cc (Layout::create_shstrtab): Only write out after input
12128 sections if we are compressing debug sections.
12129
12130 2009-12-15 Ian Lance Taylor <iant@google.com>
12131
12132 * archive.cc (Archive::add_symbols): Only look up a symbol without
12133 a version if there is, in fact, a version.
12134
12135 2009-12-14 Ian Lance Taylor <iant@google.com>
12136
12137 Revert -Wshadow changes, all changes from:
12138 2009-12-11 Doug Kwan <dougkwan@google.com>
12139 2009-12-11 Nick Clifton <nickc@redhat.com>
12140 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12141
12142 2009-12-11 Doug Kwan <dougkwan@google.com>
12143
12144 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12145 due to -Wshadow.
12146 * attributes.cc (Object_attribute::size): Ditto.
12147 (Attributes_section_data::size): Ditto.
12148 (Attributes_section_data::Attributes_section_data): Ditto.
12149 (Output_attributes_section_data::do_write): Ditto.
12150 * attributes.h (Object_attribute::set_type): Ditto.
12151 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12152
12153 2009-12-11 Nick Clifton <nickc@redhat.com>
12154
12155 * archive.cc: Fix shadowed variable warnings.
12156 * arm.cc: Likewise.
12157 * compressed_output.cc: Likewise.
12158 * compressed_output.h: Likewise.
12159 * configure: Likewise.
12160 * dwarf_reader.cc: Likewise.
12161 * dynobj.cc: Likewise.
12162 * dynobj.h: Likewise.
12163 * ehframe.cc: Likewise.
12164 * ehframe.h: Likewise.
12165 * errors.cc: Likewise.
12166 * expression.cc: Likewise.
12167 * fileread.cc: Likewise.
12168 * fileread.h: Likewise.
12169 * freebsd.h: Likewise.
12170 * i386.cc: Likewise.
12171 * icf.cc: Likewise.
12172 * incremental.h: Likewise.
12173 * layout.cc: Likewise.
12174 * layout.h: Likewise.
12175 * mapfile.cc: Likewise.
12176 * merge.cc: Likewise.
12177 * merge.h: Likewise.
12178 * object.cc: Likewise.
12179 * object.h: Likewise.
12180 * options.h: Likewise.
12181 * output.cc: Likewise.
12182 * output.h: Likewise.
12183 * parameters.cc: Likewise.
12184 * plugin.cc: Likewise.
12185 * powerpc.cc: Likewise.
12186 * reduced_debug_output.cc: Likewise.
12187 * reduced_debug_output.h: Likewise.
12188 * reloc.cc: Likewise.
12189 * reloc.h: Likewise.
12190 * resolve.cc: Likewise.
12191 * script-sections.cc: Likewise.
12192 * script.cc: Likewise.
12193 * script.h: Likewise.
12194 * sparc.cc: Likewise.
12195 * symtab.cc: Likewise.
12196 * symtab.h: Likewise.
12197 * target-select.cc: Likewise.
12198 * target-select.h: Likewise.
12199 * token.h: Likewise.
12200 * workqueue.cc: Likewise.
12201 * workqueue.h: Likewise.
12202 * x86_64.cc: Likewise.
12203
12204 2009-12-10 Doug Kwan <dougkwan@google.com>
12205
12206 * arm.cc (attributes.h): New include.
12207 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12208 (Arm_relobj::~Arm_relobj): Delete object pointed by
12209 attributes_section_data_.
12210 (Arm_relobj::attributes_section_data): New method definition.
12211 (Arm_relobj::attributes_section_data_): New data member declaration.
12212 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12213 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12214 attributes_section_data_.
12215 (Arm_dynobj::attributes_section_data): New method definition.
12216 (Arm_dynobj::attributes_section_data_): New data member declaration.
12217 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12218 initialization value of may_use_blx_ to false.
12219 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12220 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12221 object attributes to compute results instead of hard-coding.
12222 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12223 Target_arm::get_secondary_compatible_arch,
12224 Target_arm::set_secondary_compatible_arch
12225 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12226 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12227 New method declarations.
12228 (Target_arm::get_aeabi_object_attribute): New method definition.
12229 (Target_arm::attributes_section_data_): New data member declaration.
12230 (read_arm_attributes_section): New template definition.
12231 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12232 (Arm_dynobj::do_read_symbols): Ditto.
12233 (Target_arm::do_finalize_sections): Merge attributes sections from
12234 input. Check for BLX use after attributes section merging.
12235 Fix __exidx_start and __exidx_end visibility. Create an
12236 .ARM.attributes section if necessary.
12237 (Target_arm::get_secondary_compatible_arch,
12238 Target_arm::set_secondary_compatible_arch,
12239 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12240 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12241 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12242 New method definitions.
12243
12244 2009-12-09 Ian Lance Taylor <iant@google.com>
12245
12246 * plugin.cc (Plugin::load): Don't cast from void* to a function
12247 pointer.
12248
12249 2009-12-09 Ian Lance Taylor <iant@google.com>
12250
12251 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12252 information fields.
12253
12254 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12255
12256 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12257 Replace two_file_shared_1.so with two_file_shared_2.so.
12258 * testsuite/Makefile.in: Regenerated.
12259
12260 2009-12-08 Doug Kwan <dougkwan@google.com>
12261
12262 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12263 (HFILES): Add attributes.h and int_encoding.h.
12264 * Makefile.in: Regenerate.
12265 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12266 function definitions to int_encoding.cc
12267 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12268 prototypes to int_encoding.h
12269 * reduced_debug_output.cc (int_encoding.h): New include.
12270 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12271 function definitions to int_encoding.cc
12272 (insert_into_vector, read_from_pointer): Move template definitions to
12273 int_encoding.h
12274 * attributes.cc: New file.
12275 * attributes.h: New file.
12276 * int_encoding.cc: New file.
12277 * int_encoding.h: New file.
12278
12279 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12280
12281 PR gold/11055
12282 * incremental-dump.cc (dump_incremental_inputs): New.
12283 (main): Use dump_incremental_inputs.
12284
12285 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12286
12287 PR gold/10893
12288 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12289 checking elfcpp::STT_FUNC.
12290 (Target_i386::Relocate::relocate): Likewise.
12291 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12292
12293 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12294 symbols from shared libraries into normal FUNC symbols.
12295
12296 * symtab.h (Symbol): Add is_func and use it.
12297
12298 2009-12-05 Doug Kwan <dougkwan@google.com>
12299
12300 * arm.cc (Target_arm::arm_info): Initialize new fields
12301 attributes_section and attributes_vendor.
12302 * i386.cc (Target_i386::i386_info): Same.
12303 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12304 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12305 fields attributes_section and attributes_vendor.
12306 * sparc.cc (Target_sparc::sparc_info): Same.
12307 * target.h (Target::attributes_section, Target::attributes_vendor,
12308 Target::is_attributes_section, Target::attribute_arg_type,
12309 Target::attributes_order): New method definitions.
12310 (Target::Target_info::attributes_section,
12311 Target::Target_info::attributes_vendor): New fields.
12312 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12313 virtual method definitions.
12314 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12315 attributes_section and attributes_vendor.
12316 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12317
12318 2009-12-05 Doug Kwan <dougkwan@google.com>
12319
12320 * arm.cc: Update comments about interworking and stub generation.
12321 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12322 considered as non-PIC.
12323 (Arm_relocate_functions::base_abs): Fix formatting.
12324 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12325 of function to use GOT entry address instead of offset.
12326 (Target_arm::Scan::global): Issue an error if a symbol would need a
12327 PLT does not get one because it is untyped. Remove code to create
12328 dynamic symbols for relative branches.
12329 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12330 takes unsigned integer instead of boolean.
12331
12332 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12333
12334 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12335 (two_file_test_LDADD): Likewise.
12336 (common_test_1_LDADD): Likewise.
12337 (exception_test_LDADD) Likewise.
12338 (weak_test_LDADD): Likewise.
12339 (many_sections_test_LDADD): Likewise.
12340 (initpri1_LDADD): Likewise.
12341 (script_test_1_LDADD): Likewise.
12342 (script_test_2_LDADD): Likewise.
12343 (justsyms_LDADD): Likewise.
12344 (binary_test_LDADD): Likewise.
12345 (large_LDADD): Likewise.
12346 * testsuite/Makefile.in: Regenerated.
12347
12348 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12349
12350 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12351 (Symbol_table::override_with_special): Likewise.
12352 (Symbol_table::add_from_object): Likewise.
12353
12354 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12355
12356 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12357 Don't set the data_offset twice.
12358
12359 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12360
12361 * testsuite/Makefile.in: Regenerate.
12362
12363 2009-12-03 Doug Kwan <dougkwan@google.com>
12364
12365 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12366 (Target_arm::do_finalize_sections): Add parameter for symbol table
12367 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12368 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12369 parameter for symbol table pointer.
12370 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12371 an additional parameter for a pointer to symbol table.
12372 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12373 parameter for a symbol table pointer.
12374 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12375 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12376 Ditto.
12377 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12378 parameter for a symbol table pointer.
12379
12380 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12381
12382 * incremental.cc (Incremental_inputs_header)
12383 (Incremental_inputs_header_write, Incremental_inputs_entry)
12384 (Incremental_inputs_entry_write): Move ...
12385 * incremental.h (Incremental_inputs_header)
12386 (Incremental_inputs_header_write, Incremental_inputs_entry)
12387 (Incremental_inputs_entry_write): here.
12388
12389 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12390
12391 * incremental.cc (make_sized_incremental_binary): Set the target.
12392 Error if it is incompatible.
12393 * output.h (Output_file): Add filename method.
12394
12395 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12396
12397 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12398 from the get_* methods.
12399
12400 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12401
12402 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12403 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12404 Write 0 for the data_offset of scripts.
12405
12406 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12407
12408 * testsuite/Makefile.am: Add the incremental_test.sh test.
12409 * testsuite/incremental_test.sh: New.
12410 * testsuite/incremental_test_1.c: New.
12411 * testsuite/incremental_test_2.c: New.
12412
12413 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12414
12415 * incremental-dump.cc (main): Fix typos.
12416
12417 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12418
12419 PR gold/11025
12420 * incremental-dump.cc (main): Use llu to print 64 bit values.
12421
12422 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12423 H.J. Lu <hongjiu.lu@intel.com>
12424
12425 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12426 $(LIBDL).
12427 (incremental_dump_LDADD): Likewise.
12428 * Makefile.in: Regenerated.
12429
12430 2009-11-25 Doug Kwan <dougkwan@google.com>
12431
12432 Revert:
12433
12434 2009-11-25 Doug Kwan <dougkwan@google.com>
12435
12436 * arm.cc (Target_arm::Target_arm): Move method definition
12437 outside of class definition. Add code to handle
12438 --target1-rel, --target1-abs and --target2= options.
12439 (Target_arm::get_reloc_reloc_type): Change method to be
12440 non-static and const.
12441 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12442 New data member declaration.
12443 (Target_arm::Scan::local, Target_arm::Scan::global,
12444 Target_arm::Relocate::relocate,
12445 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12446 Adjust call to Target_arm::get_real_reloc_type.
12447 (Target_arm::get_real_reloc_type): Use command line options
12448 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12449 * options.h (--target1-rel, --target1-abs, --target2): New
12450 ARM-only options.
12451
12452 2009-11-25 Doug Kwan <dougkwan@google.com>
12453
12454 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12455 class definition. Add code to handle --target1-rel, --target1-abs
12456 and --target2= options.
12457 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12458 and const.
12459 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12460 member declaration.
12461 (Target_arm::Scan::local, Target_arm::Scan::global,
12462 Target_arm::Relocate::relocate,
12463 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12464 call to Target_arm::get_real_reloc_type.
12465 (Target_arm::get_real_reloc_type): Use command line options to
12466 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12467 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12468 options.
12469
12470 2009-11-25 Doug Kwan <dougkwan@google.com>
12471
12472 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12473 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12474 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12475 formatting.
12476 (Arm_relocate_functions::thm_call): Replace body with a call to
12477 Arm_relocate_functions::thumb_branch_common.
12478 (Arm_relocate_functions::thm_jump24,
12479 Arm_relocate_functions::thm_xpc22): New method definitions.
12480 (Arm_relocate_functions::thumb_branch_common): New method definition.
12481 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12482 operator.
12483 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12484 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12485
12486 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12487
12488 * Makefile.am: Build incremental-dump
12489 * Makefile.in: Regenerate.
12490 * incremental-dump.cc: New.
12491 * incremental.cc (Incremental_inputs_header_data,
12492 Incremental_inputs_entry_data): Move to incremental.h
12493 * incremental.h: (Incremental_inputs_header_data,
12494 Incremental_inputs_entry_data): Move from incremental.cc
12495
12496 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12497
12498 * incremental.cc (Incremental_inputs_header,
12499 Incremental_inputs_header_write, Incremental_inputs_entry,
12500 Incremental_inputs_entry_write): Add a typedef with the data type.
12501
12502 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12503
12504 * incremental.cc (Incremental_inputs_header,
12505 Incremental_inputs_header_write, Incremental_inputs_entry,
12506 Incremental_inputs_entry_write): Update comment about which
12507 type has the filed descriptions.
12508
12509 2009-11-15 Doug Kwan <dougkwan@google.com>
12510
12511 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12512 (Arm_relocate_functions::arm_branch_common): Change method defintion
12513 in class definition to a method declaration and update list of formal
12514 parameters.
12515 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12516 Arm_relocation_functions::jump24): Adjust call to
12517 Arm_relocate_functions::arm_branch_common. Update list of formal
12518 parameters.
12519 (Arm_relocate_functions::xpc25): New method definition.
12520 (Arm_relocate_functions::arm_branch_common): Move method defintion
12521 out from class definition. Use stubs for mode-switching and extending
12522 branch ranges.
12523 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12524 specially. Change code to enable use of stubs in ARM branches.
12525
12526 2009-11-10 Doug Kwan <dougkwan@google.com>
12527
12528 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12529 in method declaration.
12530 (Target_arm::relocate_stub): New method declaration.
12531 (Target_arm::default_target): Change to return a pointer instead of
12532 a const reference.
12533 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12534 Target_arm::default_target.
12535 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12536 method definition.
12537 (Target_arm::relocate_section): Adjust view.
12538 (Target_arm::relocate_stub): New method definition.
12539
12540 2009-11-10 Doug Kwan <dougkwan@google.com>
12541
12542 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12543 a format warning.
12544 * incremental.cc (open_incremental_binary): Initialized local
12545 variables to avoid warnings.
12546 * object.cc (make_elf_object): Ditto.
12547 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12548 a format warning.
12549
12550 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12551
12552 PR gold/10930
12553 * testsuite/plugin_test.c: Include "config.h".
12554
12555 2009-11-09 Doug Kwan <dougkwan@google.com>
12556
12557 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12558 (arm_symbol_value): Remove.
12559 (Arm_relocate_functions::arm_branch_common,
12560 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12561 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12562 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12563 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12564 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12565 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12566 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12567 Arm_relocate_functions::thm_mobw_abs_nc,
12568 Arm_relocate_functions::thm_mov_abs,
12569 Arm_relocate_functions::movw_prel_nc,
12570 Arm_relocate_functions::thm_movt_abs,
12571 Arm_relocate_functions::movt_prel,
12572 Arm_relocate_functions::thm_movw_prel_nc,
12573 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12574 (Target_arm::Relocate::relocate): Only decompose address into two
12575 parts if relocation type uses the thumb-bit and pass the actual
12576 bit instead of a flag indicating that the thumb-bit is used. Adjust
12577 calls to methods in Arm_relocate_functions for this change.
12578
12579 2009-11-08 Ian Lance Taylor <iant@google.com>
12580
12581 PR 10925
12582 * reloc.cc: Instantiate
12583 Sized_relobj::initialize_input_to_output_maps and
12584 Sized_relobj:free_input_to_output_maps.
12585
12586 2009-11-06 Ian Lance Taylor <iant@google.com>
12587
12588 PR 10876
12589 * defstd.cc (in_segment): Set only_if_ref true for "end".
12590
12591 2009-11-06 Doug Kwan <dougkwan@google.com>
12592
12593 * arm.cc (class Reloc_stub): Correct a comment.
12594 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12595 (Target_arm::scan_section_for_stubs): New method declaration.
12596 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12597 Change methods from private to protected.
12598 (Target_arm::do_may_relax): New method definition.
12599 (Target_arm::do_relax, Target_arm::group_sections,
12600 Target_arm::scan_reloc_for_stub,
12601 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12602 (Target_arm::arm_input_section_map_): New data member declaration.
12603 (Target_arm::scan_reloc_for_stub,
12604 Target_arm::scan_reloc_section_for_stubs,
12605 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12606 Target_arm::do_relax): New method definitions.
12607
12608 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12609
12610 * configure.ac: Check for (struct stat)::st_mtim
12611 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12612 * config.in: Regenerate.
12613 * configure: Regenerate.
12614
12615 2009-11-05 Ian Lance Taylor <iant@google.com>
12616
12617 PR 10910
12618 * output.cc (Output_segment::add_output_section): Add missing
12619 return statement.
12620
12621 2009-11-04 Ian Lance Taylor <iant@google.com>
12622
12623 PR 10880
12624 * object.h (class Object): Add is_needed and set_is_needed
12625 methods. Add is_needed_ field. Make bool fields into bitfields.
12626 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12627 defined in a dynamic object and referenced by a regular object,
12628 set is_needed for the dynamic object.
12629 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12630 if the file is marked with as_needed and it is not needed.
12631
12632 2009-11-04 Ian Lance Taylor <iant@google.com>
12633
12634 PR 10887
12635 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12636 tags if data is discarded by linker script.
12637 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12638 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12639 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12640 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12641
12642 2009-11-04 Ian Lance Taylor <iant@google.com>
12643
12644 * layout.cc (Layout::get_output_section): Add is_interp and
12645 is_dynamic_linker_section parameters. Change all callers.
12646 (Layout::choose_output_section): Likewise.
12647 (Layout::make_output_section): Likewise.
12648 (Layout::add_output_section_data): Add is_dynamic_linker_section
12649 parameter. Change all callers.
12650 * layout.h (class Layout): Update declarations.
12651 * output.h (class Output_section): Add is_interp, set_is_interp,
12652 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12653 Add is_interp_, is_dynamic_linker_section_ fields. Change
12654 generate_code_fills_at_write_ to a bitfield.
12655 * output.cc (Output_section::Output_sections): Initialize new
12656 fields.
12657 (Output_segment::add_output_section): Add do_sort parameter.
12658 Change all callers.
12659
12660 2009-11-03 Ian Lance Taylor <iant@google.com>
12661
12662 PR 10860
12663 * options.h (class General_options): Add --warn-common.
12664 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12665 merging two common symbols.
12666 (Symbol_table::should_override): Handle --warn-common when merging
12667 a common symbol with a defined symbol. Use report_resolve_problem
12668 for multiple definitions.
12669 (Symbol_table::report_resolve_problem): New function.
12670 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12671
12672 2009-11-03 Doug Kwan <dougkwan@google.com>
12673
12674 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12675 stub_factory_.
12676 (Target_arm::stub_factory): New method definition.
12677 (Target_arm::new_arm_input_section,
12678 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12679 Target_arm::reloc_uses_thumb_bit): New method declarations.
12680 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12681 New type definitions.
12682 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12683 member declarations.
12684 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12685 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12686 New method definitions.
12687
12688 2009-11-03 Ian Lance Taylor <iant@google.com>
12689
12690 * options.h (class General_options): Add --warn_constructors.
12691
12692 2009-11-03 Ian Lance Taylor <iant@google.com>
12693
12694 PR 10893
12695 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12696 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12697
12698 2009-11-03 Ian Lance Taylor <iant@google.com>
12699
12700 PR 10895
12701 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12702 --msgid-bugs-address.
12703 (install-pdf): New target.
12704 (install-data_yes): Look up one directory to find mkinstalldirs.
12705
12706 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12707
12708 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12709 tree.
12710
12711 2009-10-30 Doug Kwan <dougkwan@google.com>
12712
12713 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12714
12715 2009-10-30 Doug Kwan <dougkwan@google.com>
12716
12717 * arm.cc (Stub_addend_reader): New struct template definition
12718 and partial specializations.
12719 (Stub_addend_reader::operator()): New method definition for a
12720 partially specialized template.
12721
12722 2009-10-30 Doug Kwan <dougkwan@google.com>
12723
12724 * arm.cc (Arm_relobj::processor_specific_flags): New method
12725 definition.
12726 (Arm_relobj::do_read_symbols): New method declaration.
12727 (Arm_relobj::processor_specific_flags_): New data member declaration.
12728 (Arm_dynobj): New class definition.
12729 (Target_arm::do_finalize_sections): Add input_objects parameter.
12730 (Target_arm::do_adjust_elf_header): New method declaration.
12731 (Target_arm::are_eabi_versions_compatible,
12732 (Target_arm::merge_processor_specific_flags): New method declaration.
12733 (Target_arm::do_make_elf_object): New overloaded method definitions
12734 and declaration.
12735 (Arm_relobj::do_read_symbols): New method definition.
12736 (Arm_dynobj::do_read_symbols): Ditto.
12737 (Target_arm::do_finalize_sections): Add input_objects parameters.
12738 Merge processor-specific flags from all input objects.
12739 (Target_arm::are_eabi_versions_compatible,
12740 Target_arm::merge_processor_specific_flags,
12741 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12742 New method definitions.
12743 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12744 Input_objects pointer type parameter.
12745 * layout.cc (Layout::finalize): Pass input objects to target's.
12746 finalize_sections function.
12747 * output.cc (Output_file_header::do_sized_write): Set ELF file
12748 header's processor-specific flags.
12749 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12750 Input_objects pointer type parameter.
12751 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12752 * target.h (Input_objects): New forward class declaration.
12753 (Target::processor_specific_flags,
12754 Target::are_processor_specific_flags_sect): New method definitions.
12755 (Target::finalize_sections): Add input_objects parameter.
12756 (Target::Target): Initialize processor_specific_flags_ and
12757 are_processor_specific_flags_set_.
12758 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12759 parameter.
12760 (Target::set_processor_specific_flags): New method definition.
12761 (Target::processor_specific_flags_,
12762 Target::are_processor_specific_flags_set_): New data member
12763 declarations.
12764 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12765 Input_objects pointer type parameter.
12766
12767 2009-10-30 Doug Kwan <dougkwan@google.com>
12768
12769 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12770
12771 2009-10-28 Ian Lance Taylor <iant@google.com>
12772
12773 * object.h (class Relobj): Drop options parameter from
12774 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12775 do_scan_relocs, do_relocate. Change all callers.
12776 (class Sized_relobj): Drop options parameters from
12777 do_gc_process_relocs, do_scan_relocs, do_relocate,
12778 do_relocate_sections, relocate_sections, emit_relocs_scan,
12779 emit_relocs_scan_reltype. Change all callers.
12780 (struct Relocate_info): Remove options field and all references to
12781 it.
12782 * reloc.h (class Read_relocs): Remove options constructor
12783 parameter and options_ field. Change all callers.
12784 (class Gc_process_relocs, class Scan_relocs): Likewise.
12785 (class Relocate_task): Likewise.
12786 * target-reloc.h (scan_relocs): Remove options parameter. Change
12787 all callers.
12788 (scan_relocatable_relocs): Likewise.
12789 * target.h (class Sized_target): Remove options parameter from
12790 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12791 all callers.
12792 * gc.h (gc_process_relocs): Remove options parameter. Change all
12793 callers.
12794 * arm.cc: Update functions to remove options parameters.
12795 * i386.cc: Likewise.
12796 * powerpc.cc: Likewise.
12797 * sparc.cc: Likewise.
12798 * x86_64.cc: Likewise.
12799 * testsuite/testfile.cc: Likewise.
12800
12801 2009-10-28 Doug Kwan <dougkwan@google.com>
12802
12803 * arm.cc (Arm_relobj): New class definition.
12804 (Arm_relobj::scan_sections_for_stubs,
12805 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12806 New method definitions.
12807
12808 2009-10-28 Cary Coutant <ccoutant@google.com>
12809
12810 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12811 (Plugin::cleanup_done_): New member.
12812 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12813 (Plugin_manager::cleanup_done_): Remove.
12814 (Plugin_manager::add_input_file): Edit error message.
12815 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12816 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12817
12818 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12819
12820 * fileread.cc: (File_read::View::~View): Use the new
12821 data_ownership_ filed.
12822 (File_read::~File_read): Dispose the new whole_file_view_.
12823 (File_read::open): Mmap the whole file if needed.
12824 (File_read::open): Use whole_file_view_ instead of contents_.
12825 (File_read::find_view): Use whole_file_view_ if applicable.
12826 (File_read::do_read): Use whole_file_view_ instead of contents_.
12827 (File_read::make_view): Use whole_file_view_ instead of contents_,
12828 update File_read::View::View call.
12829 (File_read::find_or_make_view): Update File_read::View::View
12830 call.
12831 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12832 remove contents_
12833 (File_read::View::Data_ownership): New enum.
12834 (File_read::View::View): Replace bool mapped_ with Data_ownership
12835 argument.
12836 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12837 (File_read::View::data_ownership_): New field.
12838 (File_read::contents_): Remove (replaced by whole_file_view_).
12839 (File_read::whole_file_view_): New field.
12840 * options.h (class General_options): Add --keep-files-mapped.
12841
12842 2009-10-27 Cary Coutant <ccoutant@google.com>
12843
12844 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12845 * testsuite/Makefile.am (plugin_test_5): New test case.
12846 * testsuite/Makefile.in: Regenerate.
12847
12848 2009-10-25 Doug Kwan <dougkwan@google.com>
12849
12850 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12851 from private to protected to allow access by child class.
12852 (Sized_relobj::do_relocate_sections): New method declaration.
12853 (Sized_relobj::relocate_sections): Virtualize.
12854 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
12855 Sized_relobj::relocate_sections. Instantiate template explicitly
12856 for different target sizes and endianity.
12857
12858 2009-10-24 Doug Kwan <dougkwan@google.com>
12859
12860 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12861 (Arm_input_section::as_arm_input_section): New method.
12862 (Arm_output_section): New class definition.
12863 (Arm_output_section::create_stub_group,
12864 Arm_output_section::group_sections): New method definitions.
12865
12866 2009-10-22 Doug Kwan <dougkwan@google.com>
12867
12868 * arm.cc (Arm_input_section): New class definition.
12869 (Arm_input_section::init, Arm_input_section:do_write,
12870 Arm_input_section::set_final_data_size,
12871 Arm_input_section::do_reset_address_and_file_offset): New method
12872 definitions.
12873
12874 2009-10-21 Doug Kwan <dougkwan@google.com>
12875
12876 * arm.cc (Stub_table, Arm_input_section): New forward class
12877 declarations.
12878 (Stub_table): New class defintion.
12879 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12880 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12881 New method definition.
12882
12883 2009-10-21 Doug Kwan <dougkwan@google.com>
12884
12885 * arm.cc: Update copyright comments.
12886 (Target_arm): New forward class template declaration.
12887 (Arm_address): New type.
12888 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12889 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12890 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12891 constants.
12892 (Insn_template): Same.
12893 (DEF_STUBS): New macro.
12894 (Stub_type): New enum type.
12895 (Stub_template): New class definition.
12896 (Stub): Same.
12897 (Reloc_stub): Same.
12898 (Stub_factory): Same.
12899 (Target_arm::Target_arm): Initialize may_use_blx_ and
12900 should_force_pic_veneer_.
12901 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12902 Target_arm::should_force_pic_veneer,
12903 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12904 Target_arm::using_thumb_only, Target_arm:;default_target): New
12905 method defintions.
12906 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12907 New data member declarations.
12908 (Insn_template::size, Insn_template::alignment): New method defintions.
12909 (Stub_template::Stub_template): New method definition.
12910 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12911 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12912 (Stub_factory::Stub_factory): New method definition.
12913 * gold.h (string_hash): New template.
12914 * output.h (Input_section_specifier::hash_value): Use
12915 gold::string_hash.
12916 (Input_section_specifier::string_hash): Remove.
12917 * stringpool.cc (Stringpool_template::string_hash): Use
12918 gold::string_hash.
12919
12920 2009-10-20 Doug Kwan <dougkwan@google.com>
12921
12922 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12923 symbols of relaxed input sections.
12924 * output.h (Output_section::find_relaxed_input_section): Make
12925 method public.
12926
12927 2009-10-16 Doug Kwan <dougkwan@google.com>
12928
12929 * dynobj.cc (Versions::Versions): Initialize version_script_.
12930 Only insert base version symbol definition for a shared object
12931 if version script defines any version versions.
12932 (Versions::define_base_version): New method definition.
12933 (Versions::add_def): Check that base version is not needed.
12934 (Versions::add_need): Define base version lazily.
12935 * dynobj.h (Versions::define_base_version): New method declaration.
12936 (Versions::needs_base_version_): New data member declaration.
12937 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12938 (check_DATA): Add no_version_test.stdout.
12939 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12940 New make rules.
12941 * testsuite/Makefile.in: Regenerate.
12942 * testsuite/no_version_test.c: New file.
12943 * testsuite/no_version_test.sh: Ditto.
12944
12945 2009-10-16 Doug Kwan <dougkwan@google.com>
12946
12947 * expression.cc (class Segment_start_expression): New class definition.
12948 (Segment_start_expression::value): New method definition.
12949 (script_exp_function_segment_start): Return a new
12950 Segment_start_expression.
12951 * gold/script-c.h (script_saw_segment_start_expression): New function
12952 prototype.
12953 * script-sections.cc (Script_sections::Script_sections): Initialize
12954 SAW_SEGMENT_START_EXPRESSION_ to false.
12955 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12956 and -Tbbs options to specify section addresses if given in
12957 command line and no SEGMENT_START expression is seen in a script.
12958 * script-sections.h (Script_sections::saw_segment_start_expression,
12959 Script_sections::set_saw_segment_start_expression): New method
12960 definition.
12961 (Script_sections::saw_segment_start_expression_): New data member
12962 declaration.
12963 * script.cc (script_saw_segment_start_expression): New function.
12964 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12965 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12966 script_test_7.sh and script_test_8.sh.
12967 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12968 script_test_8.stdout.
12969 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12970 (script_test_6, script_test_6.stdout, script_test_7,
12971 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12972 * Makefile.in: Regenerate.
12973 * testsuite/script_test_6.sh: New file.
12974 * testsuite/script_test_6.t: Same.
12975 * testsuite/script_test_7.sh: Same.
12976 * testsuite/script_test_7.t: Same.
12977 * testsuite/script_test_8.sh: Same.
12978
12979 2009-10-16 Doug Kwan <dougkwan@google.com>
12980
12981 * output.cc (Output_segment::set_section_list_address): Cast
12982 expressions to unsigned long long type to avoid format warnings.
12983
12984 2009-10-15 Ian Lance Taylor <iant@google.com>
12985
12986 * script.cc (Script_options::add_symbol_assignment): Always add a
12987 dot assignment to script_sections_.
12988 * script-sections.cc (Script_sections::add_dot_assignment):
12989 Initialize if necessary.
12990
12991 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12992 program headers with no load segment if there is a linker script.
12993
12994 * layout.cc (Layout::set_segment_offsets): Align the file offset
12995 to the segment aligment for -N or -n with no load segment.
12996 * output.cc (Output_segment::add_output_section): Don't crash if
12997 the first section is a TLS section.
12998 (Output_segment::set_section_list_addresses): Print an error
12999 message if the address moves backward in a linker script.
13000 * script-sections.cc
13001 (Output_section_element_input::set_section_addresses): Don't
13002 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13003 (Orphan_output_section::set_section_addresses): Likewise.
13004
13005 2009-10-15 Doug Kwan <dougkwan@google.com>
13006
13007 * layout.cc (Layout::finish_dynamic_section): Generate tags
13008 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13009 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13010 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13011
13012 2009-10-14 Ian Lance Taylor <iant@google.com>
13013
13014 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13015 fields.
13016 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13017 data_shdr fields of relinfo.
13018 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13019 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13020 R_386_TLS_LDO_32, adjust based on section flags.
13021 (Target_i386::Relocate::fix_up_ldo): Remove.
13022
13023 2009-10-13 Ian Lance Taylor <iant@google.com>
13024
13025 Add support for -pie.
13026 * options.h (class General_options): Add -pie and
13027 --pic-executable.
13028 (General_options::output_is_position_independent): Test -pie.
13029 (General_options::output_is_executable): Return true if not shared
13030 and not relocatable.
13031 (General_options::output_is_pie): Remove.
13032 * options.cc (General_options::finalize): Reject incompatible uses
13033 of -pie.
13034 * gold.cc (queue_middle_tasks): A -pie link is not static.
13035 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13036 * symtab.cc (Symbol::final_value_is_known): Return false if
13037 output_is_position_independent.
13038 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13039 output_is_position_independent.
13040 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13041 output_is_position_independent.
13042 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13043 output_is_position_independent.
13044 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13045 two_file_pie_test.
13046 (basic_pie_test.o, basic_pie_test): New targets.
13047 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13048 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13049 (two_file_pie_test): New target.
13050 * testsuite/Makefile.in: Rebuild.
13051 * README: Remove note saying that -pie is not supported.
13052
13053 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13054
13055 * options.h (class General_options): Add -init and -fini.
13056 * layout.cc (Layout::finish_dynamic_section): Emit
13057 given init and fini functions.
13058
13059 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13060
13061 * gc.h (gc_process_relocs): Check if icf is enabled using new
13062 function.
13063 * gold.cc (queue_initial_tasks): Likewise.
13064 (queue_middle_tasks): Likewise.
13065 * object.cc (do_layout): Likewise.
13066 * symtab.cc (is_section_folded): Likewise.
13067 * main.cc (main): Likewise.
13068 * reloc.cc (Read_relocs::run): Likewise.
13069 (Sized_relobj::do_scan_relocs): Likewise.
13070 * icf.cc (is_function_ctor_or_dtor): New function.
13071 (Icf::find_identical_sections): Check if function is ctor or dtor when
13072 safe icf is chosen.
13073 * options.h (General_options::icf): Change option to be an enum.
13074 (Icf_status): New enum.
13075 (icf_enabled): New method.
13076 (icf_safe_folding): New method.
13077 (set_icf_status): New method.
13078 (icf_status_): New variable.
13079 * (options.cc) (General_options::finalize): Set icf_status_.
13080 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13081 icf_test and icf_keep_unique_test to use the --icf enum flag.
13082 * testsuite/icf_safe_test.sh: New file.
13083 * testsuite/icf_safe_test.cc: New file.
13084
13085 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13086
13087 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13088 includes to gc.h and icf.h.
13089 * arm.cc: Include gc.h.
13090 * gold.cc: Likewise.
13091 * i386.cc: Likewise.
13092 * powerpc.cc: Likewise.
13093 * sparc.cc: Likewise.
13094 * x86_64.cc: Likewise.
13095 * gc.h: Include icf.h.
13096
13097 2009-10-11 Ian Lance Taylor <iant@google.com>
13098
13099 * plugin.cc: Include "gold.h" before other header files.
13100
13101 2009-10-10 Chris Demetriou <cgd@google.com>
13102
13103 * options.h (Input_file_argument::Input_file_type): New enum.
13104 (Input_file_argument::is_lib_): Replace with...
13105 (Input_file_argument::type_): New member.
13106 (Input_file_argument::Input_file_argument): Take Input_file_type
13107 'type' rather than boolean 'is_lib' as second argument.
13108 (Input_file_argument::is_lib): Use type_.
13109 (Input_file_argument::is_searched_file): New function.
13110 (Input_file_argument::may_need_search): Handle is_searched_file.
13111 * options.cc (General_options::parse_library): Support -l:filename.
13112 (General_options::parse_just_symbols): Update for Input_file_argument
13113 changes.
13114 (Command_line::process): Likewise.
13115 * archive.cc (Archive::get_file_and_offset): Likewise.
13116 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13117 * script.cc (read_script_file, script_add_file): Likewise.
13118 * fileread.cc (Input_file::Input_file): Likewise.
13119 (Input_file::will_search_for): Handle is_searched_file.
13120 (Input_file::open): Likewise.
13121 * readsyms.cc (Read_symbols::get_name): Likewise.
13122 * testsuite/Makefile.am (searched_file_test): New test.
13123 * testsuite/Makefile.in: Regenerate.
13124 * testsuite/searched_file_test.cc: New file.
13125 * testsuite/searched_file_test_lib.cc: New file.
13126
13127 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13128 Ian Lance Taylor <iant@google.com>
13129
13130 * descriptor.cc: Include <cstdio> and "binary-io.h".
13131 (Descriptors::open): Open the files in binary mode always.
13132 * script.cc (Lex::get_token): Treat \r as whitespace.
13133
13134 2009-10-09 Ian Lance Taylor <iant@google.com>
13135
13136 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13137
13138 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13139 Ian Lance Taylor <iant@google.com>
13140
13141 * configure.ac: Check for readv function also.
13142 * fileread.cc (readv): Define if not HAVE_READV.
13143 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13144 does not exist.
13145 * config.in: Regenerate.
13146 * configure: Regenerate.
13147
13148 2009-10-09 Doug Kwan <dougkwan@google.com>
13149
13150 * layout.cc (Layout::make_output_section): Call target hook to make
13151 ordinary output section.
13152 (Layout::finalize): Adjust parameter list of call the
13153 Target::may_relax().
13154 * layout.h (class Layout::section_list): New method.
13155 * merge.h (Output_merge_base::entsize): Change visibility to public.
13156 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13157 New methods.
13158 (Output_merge_string::do_is_string): New method.
13159 * object.cc (Sized_relobj::do_setup): renamed from
13160 Sized_relobj::set_up.
13161 * object.h (Sized_relobj::adjust_shndx,
13162 Sized_relobj::initializ_input_to_output_maps,
13163 Sized_relobj::free_input_to_output_maps): Change visibilities to
13164 protected.
13165 (Sized_relobj::setup): Virtualize.
13166 (Sized_relobj::do_setup): New method declaration.
13167 (Sized_relobj::invalidate_section_offset,
13168 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13169 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13170 * options.cc (parse_int): New function.
13171 * options.h (parse_int): New declaration.
13172 (DEFINE_int): New macro.
13173 (stub_group_size): New option.
13174 * output.cc (Output_section::Output_section): Initialize memebers
13175 merge_section_map_, merge_section_by_properties_map_,
13176 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13177 (Output_section::add_input_section): Handled deferred code-fill
13178 generation and remove an old comment.
13179 (Output_section::add_relaxed_input_section): New method definition.
13180 (Output_section::add_merge_input_section): Use merge section by
13181 properties map to speed to search. Update merge section maps
13182 as appropriate.
13183 (Output_section::build_relaxation_map): New method definition.
13184 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13185 Same.
13186 (Output_section::relax_input_section): Renamed to
13187 Output_section::convert_input_sections_to_relaxed_sections and change
13188 interface to take a vector of pointers to relaxed sections.
13189 (Output_section::find_merge_section,
13190 Output_section::find_relaxed_input_section): New method definitions.
13191 (Output_section::is_input_address_mapped,
13192 Output_section::output_offset, Output_section::output_address):
13193 Use output section data maps to speed up searching.
13194 (Output_section::find_starting_output_address): Add comments.
13195 (Output_section::do_write,
13196 Output_section::write_to_postprocessing_buffer): Do code-fill
13197 generation as appropriate.
13198 (Output_section::get_input_sections): Invalidate relaxed input section
13199 map.
13200 (Output_section::restore_states): Adjust type of checkpoint .
13201 Invalidate relaxed input section map.
13202 * output.h (Output_merge_base): New class declaration.
13203 (Input_section_specifier): New class defintion.
13204 (class Output_relaxed_input_section) Change base class to
13205 Output_section_data_build.
13206 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13207 base class initializer.
13208 (Output_section::add_relaxed_input_section): New method declaration.
13209 (Output_section::Input_section): Change visibility to protected.
13210 (Output_section::Input_section::relobj,
13211 Output_section::Input_section::shndx): Handle relaxed input sections.
13212 Output_section::input_sections) Change visibility to protected. Also
13213 define overload to return a non-const pointer.
13214 (Output_section::Merge_section_properties): New class defintion.
13215 (Output_section::Merge_section_by_properties_map,
13216 Output_section::Output_section_data_by_input_section_map,
13217 Output_section::Relaxation_map): New types.
13218 (Output_section::relax_input_section): Rename method to
13219 Output_section::convert_input_sections_to_relaxed_sections and change
13220 interface to take a vector of relaxed section pointers.
13221 (Output_section::find_merge_section,
13222 Output_section::find_relaxed_input_section,
13223 Output_section::build_relaxation_map,
13224 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13225 New method declarations.
13226 (Output_section::merge_section_map_
13227 Output_section::merge_section_by_properties_map_,
13228 Output_section::relaxed_input_section_map_,
13229 Output_section::is_relaxed_input_section_map_valid_,
13230 Output_section::generate_code_fills_at_write_): New data members.
13231 * script-sections.cc
13232 (Output_section_element_input::set_section_addresses): Call
13233 current_data_size and addralign methods of relaxed input sections.
13234 (Orphan_output_section::set_section_addresses): Call current_data_size
13235 and addralign methods of relaxed input sections.
13236 * symtab.cc (Symbol_table::compute_final_value): Extract template
13237 from the body of Symbol_table::sized_finalize_symbol.
13238 (Symbol_table::sized_finalized_symbol): Call
13239 Symbol_table::compute_final_value.
13240 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13241 (Symbol_table::compute_final_value): New templated method declaration.
13242 * target.cc (Target::do_make_output_section): New method defintion.
13243 * target.h (Target::make_output_section): New method declaration.
13244 (Target::relax): Add more parameters for input objects, symbol table
13245 and layout. Adjust call to do_relax.
13246 (Target::do_make_output_section): New method declaration.
13247 (Target::do_relax): Add parameters for input objects, symbol table
13248 and layout.
13249
13250 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13251
13252 * pread.c: Include stdio.h.
13253
13254 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13255
13256 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13257 defined.
13258
13259 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13260
13261 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13262 Change read_shndx type to unsigned int.
13263 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13264 int.
13265 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13266 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13267 Change read_shndx type to unsigned int.
13268 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13269 int.
13270 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13271 * layout.cc (Layout::create_symtab_sections): Cast the result of
13272 local_symcount * symsize to off_t in the gold_assert.
13273
13274 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13275
13276 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13277 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13278 R_ARM_BASE_ABS.
13279 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13280 (Arm_relocate_functions::thm_abs5): New function.
13281 (Arm_relocate_functions::abs12): New function.
13282 (Arm_relocate_functions::abs16): New function.
13283 (Arm_relocate_functions::base_abs): New function.
13284 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13285 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13286 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13287 R_ARM_BASE_ABS.
13288 (Scan::global): Likewise.
13289 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13290 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13291 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13292 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13293 R_ARM_BASE_ABS.
13294
13295 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13296
13297 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13298 (Arm_relocate_functions::movt_prel): New function.
13299 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13300 (Arm_relocate_functions::thm_movt_prel): New function.
13301 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13302 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13303 (Scan::global, Relocate::relocate): Likewise.
13304 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13305
13306 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13307
13308 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13309 Incremental_checker.
13310 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13311 unsigned int.
13312 (class Incremental_inputs_header): New class.
13313 (Incremental_inputs_header_writer): Edit comment.
13314 (Incremental_inputs_entry): New class.
13315 (Incremental_inputs_entry_writer): Edit comment.
13316 (Sized_incremental_binary::do_find_incremental_inputs_section):
13317 Add *strtab_shndx parameter, fill it.
13318 (Sized_incremental_binary::do_check_inputs): New method.
13319 (Incremental_checker::can_incrementally_link_output_file): Use
13320 Sized_incremental_binary::check_inputs.
13321 (Incremental_inputs::report_command_line): Save command line in
13322 command_line_.
13323 * incremental.h:
13324 (Incremental_binary::find_incremental_inputs_section): New
13325 method.
13326 (Incremental_binary::do_find_incremental_inputs_section): Add
13327 strtab_shndx parameter.
13328 (Incremental_binary::do_check_inputs): New pure virtual method.
13329 (Sized_incremental_binary::do_check_inputs): Declare.
13330 (Incremental_checker::Incremental_checker): Add incremental_inputs
13331 parameter, use it to initialize incremental_inputs_.
13332 (Incremental_checker::incremental_inputs_): New field.
13333 (Incremental_checker::command_line): New method.
13334 (Incremental_checker::inputs): New method.
13335 (Incremental_checker::command_line_): New field.
13336
13337 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13338
13339 * incremental.cc: Include <cstdarg> and "target-select.h".
13340 (vexplain_no_incremental): New function.
13341 (explain_no_incremental): New function.
13342 (Incremental_binary::error): New method.
13343 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13344 method.
13345 (make_sized_incremental_binary): New function.
13346 (open_incremental_binary): New function.
13347 (can_incrementally_link_file): Add checks if output is ELF and has
13348 inputs section.
13349 * incremental.h: Include "elfcpp_file.h" and "output.h".
13350 (Incremental_binary): New class.
13351 (Sized_incremental_binary): New class.
13352 (open_incremental_binary): Declare.
13353 * object.cc (is_elf_object): Use
13354 elfcpp::Elf_recognizer::is_elf_file.
13355 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13356 * output.h (Output_file::filesize): New method.
13357
13358 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13359
13360 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13361 New function.
13362 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13363 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13364 function.
13365 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13366 function.
13367 (Arm_relocate_functions::movw_abs_nc): New function.
13368 (Arm_relocate_functions::movt_abs): New function.
13369 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13370 (Arm_relocate_functions::thm_movt_abs): New function.
13371 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13372 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13373 (Scan::global): Likewise.
13374 (Relocate::relocate): Likewise.
13375 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13376
13377 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13378
13379 * arm.cc (Arm_relocate_functions::got_prel) New function.
13380 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13381 (Relocate::relocate): Likewise.
13382 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13383
13384 2009-10-06 Ian Lance Taylor <iant@google.com>
13385
13386 * options.h (class General_options): Define
13387 split_stack_adjust_size parameter.
13388 * object.h (class Object): Add uses_split_stack_ and
13389 has_no_split_stack_ fields. Add uses_split_stack and
13390 has_no_split_stack accessor functions. Declare
13391 handle_split_stack_section.
13392 (class Reloc_symbol_changes): Define.
13393 (class Sized_relobj): Define Function_offsets. Declare
13394 split_stack_adjust, split_stack_adjust_reltype, and
13395 find_functions.
13396 * object.cc (Object::handle_split_stack_section): New function.
13397 (Sized_relobj::do_layout): Call handle_split_stack_section.
13398 * dynobj.cc (Sized_dynobj::do_layout): Call
13399 handle_split_stack_section.
13400 * reloc.cc (Sized_relobj::relocate_sections): Call
13401 split_stack_adjust for executable sections in split_stack
13402 objects. Pass reloc_map to relocate_section.
13403 (Sized_relobj::split_stack_adjust): New function.
13404 (Sized_relobj::split_stack_adjust_reltype): New function.
13405 (Sized_relobj::find_functions): New function.
13406 * target-reloc.h: Include "object.h".
13407 (relocate_section): Add reloc_symbol_changes parameter. Change
13408 all callers.
13409 * target.h (class Target): Add calls_non_split method. Declare
13410 do_calls_non_split virtual method. Declare match_view and
13411 set_view_to_nop.
13412 * target.cc: Include "elfcpp.h".
13413 (Target::do_calls_non_split): New function.
13414 (Target::match_view): New function.
13415 (Target::set_view_to_nop): New function.
13416 * gold.cc (queue_middle_tasks): Give an error if mixing
13417 split-stack and non-split-stack objects with -r.
13418 * i386.cc (Target_i386::relocate_section): Add
13419 reloc_symbol_changes parameter.
13420 (Target_i386::do_calls_non_split): New function.
13421 * x86_64.cc (Target_x86_64::relocate_section): Add
13422 reloc_symbol_changes parameter.
13423 (Target_x86_64::do_calls_non_split): New function.
13424 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13425 parameter.
13426 * powerpc.cc (Target_powerpc::relocate_section): Add
13427 reloc_symbol_changes parameter.
13428 * sparc.cc (Target_sparc::relocate_section): Add
13429 reloc_symbol_changes parameter.
13430 * configure.ac: Call AM_CONDITIONAL for the default target.
13431 * configure: Rebuild.
13432 * testsuite/Makefile.am (TEST_AS): New variable.
13433 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13434 (check_DATA): Add split_i386 and split_x86_64 files.
13435 (SPLIT_DEFSYMS): Define.
13436 (split_i386_[1234n].o): New targets.
13437 (split_i386_[124]): New targets.
13438 (split_i386_[1234r].stdout): New targets.
13439 (split_x86_64_[1234n].o): New targets.
13440 (split_x86_64_[124]): New targets.
13441 (split_x86_64_[1234r].stdout): New targets.
13442 (MOSTLYCLEANFILES): Add new executables.
13443 * testsuite/split_i386.sh: New file.
13444 * testsuite/split_x86_64.sh: New file.
13445 * testsuite/split_i386_1.s: New file.
13446 * testsuite/split_i386_2.s: New file.
13447 * testsuite/split_i386_3.s: New file.
13448 * testsuite/split_i386_4.s: New file.
13449 * testsuite/split_i386_n.s: New file.
13450 * testsuite/split_x86_64_1.s: New file.
13451 * testsuite/split_x86_64_2.s: New file.
13452 * testsuite/split_x86_64_3.s: New file.
13453 * testsuite/split_x86_64_4.s: New file.
13454 * testsuite/split_x86_64_n.s: New file.
13455 * testsuite/testfile.cc (Target_test): Update relocation_section
13456 function.
13457 * testsuite/Makefile.in: Rebuild.
13458
13459 2009-10-06 Ian Lance Taylor <iant@google.com>
13460
13461 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13462 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13463 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13464 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13465 the address on ldo_addrs_.
13466 (Target_i386::Relocate::fix_up_ldo): New function.
13467
13468 2009-10-06 Rafael Espindola <espindola@google.com>
13469
13470 * plugin.cc (add_input_library): New.
13471 (Plugin::load): Add add_input_library to tv.
13472 (Plugin_manager::add_input_file): Add the is_lib argument.
13473 (add_input_file): Update call to Plugin_manager::add_input_file.
13474 (add_input_library): New.
13475 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13476
13477 2009-09-30 Doug Kwan <dougkwan@google.com>
13478
13479 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13480 symbol and call Symbol::may_need_copy_reloc to determine if
13481 a copy reloc is needed.
13482 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13483 nocopyreloc is given in command line.
13484 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13485 given in command line.
13486 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13487 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13488 of the removed Target_i386::may_need_copy_reloc.
13489 * options.h (copyreloc): New option with default value false.
13490 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13491 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13492 instead of the removed Target_powerpc::may_need_copy_reloc.
13493 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13494 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13495 instead of the removed Target_sparc::may_need_copy_reloc.
13496 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13497 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13498 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13499 instead of the removed Target_x86_64::may_need_copy_reloc.
13500
13501 2009-09-30 Ian Lance Taylor <iant@google.com>
13502
13503 * object.h (class Object): Remove target_ field, and target,
13504 sized_target, and set_target methods.
13505 (Object::sized_target): Remove.
13506 (class Sized_relobj): Update declarations. Remove sized_target.
13507 * object.cc (Sized_relobj::setup): Remove target parameter.
13508 Change all callers.
13509 (Input_objects::add_object): Don't do anything with the target.
13510 (make_elf_sized_object): Add punconfigured parameter. Change all
13511 callers. Set or test parameter target.
13512 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13513 Change all callers.
13514 * parameters.cc (Parameters::set_target): Change parameter type to
13515 be non-const.
13516 (Parameters::default_target): Remove.
13517 (set_parameters_target): Change parameter type to be non-const.
13518 (parameters_force_valid_target): New function.
13519 (parameters_clear_target): New function.
13520 * parameters.h (class Parameters): Update declarations. Remove
13521 default_target method. Add sized_target and clear_target
13522 methods. Change target_ to be non-const.
13523 (set_parameters_target): Update declaration.
13524 (parameters_force_valid_target): Declare.
13525 (parameters_clear_target): Declare.
13526 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13527 as NULL if we aren't searching.
13528 (Add_symbols::run): Don't check for compatible target.
13529 * fileread.cc (Input_file::open_binary): Call
13530 parameters_force_valid_target.
13531 * gold.cc (queue_middle_tasks): Likewise.
13532 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13533 set_target on object.
13534 * dynobj.h (class Sized_dynobj): Update declarations.
13535 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13536 make_elf_object returns NULL.
13537 (Archive::include_member): Don't check whether object target is
13538 compatible.
13539 * output.cc (Output_section::add_input_section): Get target from
13540 parameters.
13541 (Output_section::relax_input_section): Likewise.
13542 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13543 parameters.
13544 (Sized_relobj::do_scan_relocs): Likewise.
13545 (Sized_relobj::relocate_sections): Likewise.
13546 * resolve.cc (Symbol_table::resolve): Likewise.
13547 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13548 parameter. Change all callers.
13549 (Symbol_table::add_from_object): Get target from parameters.
13550 (Symbol_table::add_from_relobj): Don't check object target.
13551 (Symbol_table::add_from_dynobj): Likewise.
13552 (Symbol_table::define_special_symbol): Get target from
13553 parameters.
13554 * symtab.h (class Symbol_table): Update declaration.
13555 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13556 parameter. Change all callers. Clear parameter target.
13557 (Binary_test): Test target here.
13558 * testsuite/object_unittest.cc (gold_testsuite): Remove
13559 target_test_pointer parameter. Change all callers.
13560 (Object_test): Test target here.
13561
13562 2009-09-26 Ian Lance Taylor <iant@google.com>
13563
13564 * testsuite/initpri1.c: Don't try to use constructor priorities if
13565 compiling with gcc before 4.3.
13566
13567 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13568
13569 * testsuite/retain_symbols_file_test.sh (check_present): Change
13570 output file name to retain_symbols_file_test.stdout.
13571 (check_absent): Likewise.
13572
13573 2009-09-18 Craig Silverstein <csilvers@google.com>
13574
13575 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13576 * options.cc: Include <cerrno> and <fstream>.
13577 (General_options::finalize): Parse -retain-symbols-file tag.
13578 * options.h: New flag.
13579 (General_options): New method should_retain_symbol, new
13580 variable symbols_to_retain.
13581 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13582 should_retain_symbol map.
13583 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13584 * testsuite/Makefile.in: Regenerate.
13585 * testsuite/retain_symbols_file_test.sh: New file.
13586
13587 2009-09-18 Nick Clifton <nickc@redhat.com>
13588
13589 * po/es.po: Updated Spanish translation.
13590
13591 2009-09-17 Doug Kwan <dougkwan@google.com>
13592
13593 * debug.h (DEBUG_RELAXATION): New constant.
13594 (DEBUG_ALL): Add DEBUG_RELAXATION.
13595 (debug_string_to_enum): Add relaxation debug option.
13596 * layout.cc
13597 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13598 Layout::Relaxation_debug_check::read_sections,
13599 Layout::Relaxation_debug_check::read_sections): New method definitions.
13600 (Layout::Layout): Initialize data members
13601 record_output_section_data_from_scrips_,
13602 script_output_section_data_list_ and relaxation_debug_check_.
13603 (Layout::save_segments, Layout::restore_segments,
13604 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13605 Layout::relaxation_loop_body): New method definitions.
13606 (Layout::finalize): Support relaxation. Move section layout code to
13607 Layout::relaxation_loop_body.
13608 (Layout::set_asection_address_from_script): Move code for orphan
13609 section placement out.
13610 (Layout::place_orphan_sections_in_script): New method definition.
13611 * layout.h (Output_segment_headers, Output_file_header):
13612 New forward class declarations.
13613 (Layout::~Layout): Define.
13614 (Layout::new_output_section_data_from_script): New method definition.
13615 (Layout::place_orphan_sections_in_script): New method declaration.
13616 (Layout::Segment_states): New type declaration.
13617 (Layout::save_segments, Layout::restore_segments,
13618 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13619 Layout::relaxation_loop_body): New method declarations.
13620 (Layout::Output_section_data_list): New type declaration.
13621 (Layout::Relaxation_debug_check): New class definition.
13622 (Layout::record_output_section_data_from_script_,
13623 Layout::script_output_section_data_list_, Layout::segment_states_,
13624 Layout::relaxation_debug_check_): New data members.
13625 * output.cc: (Output_section_headers::do_size): New method definition.
13626 (Output_section_headers::Output_section_headers): Move size
13627 computation to Output_section_headers::do_size.
13628 (Output_segment_headers::do_size): New method definition.
13629 (Output_file_header::Output_file_header): Move size computation to
13630 Output_file_header::do_size and call it.
13631 (Output_file_header::do_size): New method definition.
13632 (Output_data_group::Output_data_group): Adjust call to
13633 Output_section_data.
13634 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13635 (Output_symtab_xindex::do_write): Add array bound check.
13636 (Output_section::Input_section::print_to_mapfile): Handle
13637 RELAXED_INPUT_SECTION_CODE.
13638 (Output_section::Output_section): Initialize data member checkpoint_.
13639 (Output_section::~Output_section): Delete checkpoint object pointed
13640 by checkpoint_.
13641 (Output_section::add_input_section): Always add an Input_section if
13642 relaxing.
13643 (Output_section::add_merge_input_section): Add assert.
13644 (Output_section::relax_input_section): New method definition.
13645 (Output_section::set_final_data_size): Set load address to zero for
13646 an unallocated section.
13647 (Output_section::do_address_and_file_offset_have_reset_values):
13648 New method definition.
13649 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13650 Handle relaxed input section.
13651 (Output_section::sort_attached_input_sections): Checkpoint input
13652 section list lazily.
13653 (Output_section::get_input_sections): Change type of input_sections to
13654 list of Simple_input_section pointers. Checkpoint input section list
13655 lazily. Also handle relaxed input sections.
13656 (Output_section::add_input_section_for_script): Take a reference to
13657 a Simple_input_section object instead of Relobj pointer and section
13658 index as parameter. Handle relaxed input sections.
13659 (Output_section::save_states, Output_section::restore_states): New
13660 method definitions.
13661 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13662 (Output_data::is_data_size_fixed): New method definition.
13663 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13664 if it is fixed.
13665 (Output_data::address_and_file_offset_have_reset_values): New method
13666 definition.
13667 (Output_data::do_address_and_file_offset_have_reset_values): New method
13668 definition.
13669 (Output_data::set_data_size): Check that data size is not fixed.
13670 (Output_data::fix_data_size): New method definition.
13671 (Output_data::is_data_size_fixed_): New data member.
13672 (Output_section_headers::set_final_data_size): New method definition.
13673 (Output_section_headers::do_size): New method declaration.
13674 (Output_segment_headers::set_final_data_size): New method definition.
13675 (Output_segment_headers::do_size): New method declaration.
13676 (Output_file_header::set_final_data_size)::New method definition.
13677 (Output_file_header::do_size)::New method declaration.
13678 (Output_section_data::Output_section_data): Add new parameter
13679 is_data_size_fixed and use it to fix data size.
13680 (Output_data_const::Output_data_const): Adjust call to base class
13681 constructor and fix data size.
13682 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13683 base class constructor and fix data size.
13684 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13685 base class constructor and fix data size.
13686 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13687 class constructor and fix data size.
13688 (Output_data_group::set_final_data_size): New method definition.
13689 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13690 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13691 class constructor and fix data size.
13692 (Output_relaxed_input_section): New class definition.
13693 (Output_section::Simple_input_section): New class definition.
13694 (Output_section::get_input_sections): Adjust parameter list.
13695 (Output_section::add_input_section_for_script): Same.
13696 (Output_section::save_states, Output_section::restore_states,
13697 Output_section::do_address_and_file_offset_have_reset_values,
13698 (Output_section::Input_section::Input_section): Handle
13699 RELAXED_INPUT_SECTION_CODE. Add new overload for
13700 Output_relaxed_input_section.
13701 (Output_section::Input_section::is_input_section,
13702 Output_section::Input_section::set_output_section): Handle relaxed
13703 input section.
13704 (Output_section::Input_section::is_relaxed_input_section,
13705 Output_section::Input_section::output_section_data,
13706 Output_section::Input_section::relaxed_input_section): New method
13707 definitions.
13708 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13709 value.
13710 (Output_section::Input_section::u1_): Update comments.
13711 (Output_section::Input_section::u2_): Add new union member poris.
13712 (Output_section::Checkpoint_output_section): New classs definition.
13713 (Output_section::relax_input_section): New method declaration.
13714 (Output_section::checkpoint_): New data member.
13715 (Output_segment): Update comments.
13716 (Output_segment::Output_segment): Un-privatize copy constructor.
13717 (Output_segment::operator=): Un-privatize.
13718 * script-sections.cc (Output_section_element::Input_section_list):
13719 Change element type to Output_section::Simple_input_section.
13720 (Output_section_element_dot_assignment::set_section_addresses):
13721 Register output section data for relaxation clean up.
13722 (Output_data_exression::Output_data_expression): Adjust call to base
13723 constructor to fix data size.
13724 (Output_section_element_data::set_section_addresses): Register
13725 Output_data_expression object for relaxation clean up.
13726 (struct Input_section_info): Replace Relobj pointer and section index
13727 pair with Output_section::Simple_input_section and Convert struct to a
13728 class.
13729 (Input_section_sorter::operator()): Adjust access to
13730 Input_section_info data member to use accessors.
13731 (Output_section_element_input::set_section_addresses): Use layout
13732 parameter. Adjust code to use Output_section::Simple_input_section
13733 and Input_secction_info classes. Register filler for relaxation
13734 clean up.
13735 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13736 and section index pair with Output_section::Simple_input_section
13737 class. Adjust code accordingly.
13738 (Phdrs_element::release_segment): New method definition.
13739 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13740 segment list.
13741 (Script_sections::release_segments): New method definition.
13742 * gold/script-sections.h (Script_sections::release_segments): New
13743 method declaration.
13744 * gold/target.h (Target::may_relax, Target::relax,
13745 Target::do_may_relax, Target::do_relax): New method definitions.
13746
13747 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13748
13749 * arm.cc (has_signed_unsigned_overflow): New function.
13750 (Arm_relocate_functions::abs8): New function.
13751 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13752 (Target_arm::Scan::global): Likewise.
13753 (Target_arm::relocate::relocate): Likewise.
13754 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13755 Likewise.
13756
13757 2009-09-16 Cary Coutant <ccoutant@google.com>
13758
13759 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13760 * testsuite/Makefile.in: Regenerate.
13761
13762 2009-09-11 Nick Clifton <nickc@redhat.com>
13763
13764 * po/gold.pot: Updated by the Translation project.
13765
13766 2009-09-08 Cary Coutant <ccoutant@google.com>
13767
13768 * output.cc (Output_file::open): Add execute permission to empty file.
13769 * testsuite/Makefile.am (permission_test): New test.
13770 * testsuite/Makefile.in: Regenerate.
13771
13772 2009-09-02 Ian Lance Taylor <iant@google.com>
13773
13774 * output.cc (Output_file::resize): Call map_no_anonymous rather
13775 than map.
13776
13777 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13778
13779 * gold.cc: Include "incremental.h".
13780 (queue_initial_tasks): Call Incremental_checker methods.
13781 * incremental.cc: Include "output.h".
13782 (Incremental_checker::can_incrementally_link_output_file): New
13783 method.
13784 * incremental.h (Incremental_checker): New class.
13785
13786 * output.cc (Output_file::open_for_modification): New method.
13787 (Output_file::map_anonymous): Changed return type to bool. Record
13788 map in base_ field.
13789 (Output_file::map_no_anonymous): New method, broken out of map.
13790 (Output_file::map): Use map_no_anonymous and map_anonymous.
13791 * output.h (class Output_file): Update declarations.
13792
13793 2009-08-24 Cary Coutant <ccoutant@google.com>
13794
13795 * options.h (Command_line::Pre_options): New class.
13796 (Command_line::pre_options): New member.
13797 * options.cc (gold::options::ready_to_register): New variable.
13798 (One_option::register_option): Do nothing if not registering options.
13799 Assert if same short option registered twice.
13800 (General_options::General_options): Turn off option registration when
13801 done constructing.
13802 (Command_line::Pre_options::Pre_options): New constructor.
13803
13804 2009-08-24 Cary Coutant <ccoutant@google.com>
13805
13806 * options.h (General_options::no_keep_memory): Remove incorrect
13807 short option.
13808
13809 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13810
13811 * Makefile.am (am__skiplex, am__skipyacc): New.
13812 * Makefile.in: Regenerate.
13813
13814 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13815
13816 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13817 (INCLUDES): ... this.
13818 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13819 (AM_CPPFLAGS): Renamed from ...
13820 (INCLUDE): ... this.
13821 * Makefile.in, testsuite/Makefile.in: Regenerate.
13822
13823 * Makefile.in: Regenerate.
13824 * aclocal.m4: Likewise.
13825 * config.in: Likewise.
13826 * configure: Likewise.
13827 * testsuite/Makefile.in: Likewise.
13828
13829 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13830 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13831 * Makefile.in: Regenerate.
13832 * testsuite/Makefile.in: Regenerate.
13833
13834 2009-08-19 Cary Coutant <ccoutant@google.com>
13835
13836 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13837 symbols in shared libraries overridden by hidden or internal symbols
13838 in the main program.
13839
13840 2009-08-19 Chris Demetriou <cgd@google.com>
13841
13842 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13843 checking source file names in error messages.
13844
13845 2009-08-18 Doug Kwan <dougkwan@google.com>
13846
13847 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13848 an elcpp::Ehdr as parameter. Adjust call to set_target.
13849 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13850 an elfcpp::Ehdr as parameter.
13851 * object.cc (Object::set_target): Remove the version that looks up
13852 a target and sets it.
13853 (Sized_relobj::setup): Take a Target object instead of
13854 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13855 (make_elf_sized_object): Find target and ask target to
13856 make an ELF object.
13857 * object.h: (Object::set_target): Remove the version that looks up
13858 a target and sets it.
13859 (Sized_relobj::setup): Take a Target object instead of
13860 an elfcpp:Ehdr as parameter.
13861 * target.cc: Include dynobj.h.
13862 (Target::do_make_elf_object_implementation): New.
13863 (Target::do_make_elf_object): New.
13864 * target.h (Target::make_elf_object): New template declaration.
13865 (Target::do_make_elf_object): New method declarations.
13866 (Target::do_make_elf_object_implementation): New template declaration.
13867
13868 2009-08-14 Ian Lance Taylor <iant@google.com>
13869
13870 * gold.h (FUNCTION_NAME): Define.
13871 (gold_unreachable): Use FUNCTION_NAME.
13872
13873 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13874
13875 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13876 symbol in the --keep-unique list is not found.
13877
13878 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13879
13880 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13881 been maked as --keep-unique.
13882 (Icf::unfold_section): New function.
13883 * icf.h (Icf::unfold_section): New function.
13884 * options.h (General_options::keep_unique): New option.
13885 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13886 * testsuite/Makefile.in: Regenerate.
13887 * testsuite/icf_keep_unique_test.sh: New file.
13888 * testsuite/icf_keep_unique_test.cc: New file.
13889
13890 2009-08-12 Cary Coutant <ccoutant@google.com>
13891
13892 PR 10471
13893 * resolve.cc (Symbol_table::resolve): Check for references from
13894 dynamic objects to hidden and internal symbols.
13895 * testsuite/Makefile.am (hidden_test.sh): New test.
13896 * testsuite/Makefile.in: Regenerate.
13897 * testsuite/hidden_test.sh: New script.
13898 * testsuite/hidden_test_1.c: New test source.
13899 * testsuite/hidden_test_main.c: New test source.
13900
13901 2009-08-11 Doug Kwan <dougkwan@google.com>
13902
13903 * arm.cc: Update comments.
13904 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13905 segment to locate the .ARM.exidx section if present.
13906
13907 2009-08-09 Doug Kwan <dougkwan@google.com>
13908
13909 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13910 patch.
13911
13912 2009-08-07 Sriraman Tallam <tmsriram@google.com>
13913 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13914 compiler warnings.
13915
13916 2009-08-06 Sriraman Tallam <tmsriram@google.com>
13917
13918 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13919 valid tls_segment only for non-debug-section relocations.
13920 * testsuite/Makefile.am: Add gc_tls_test.
13921 * testsuite/Makefile.in: Regenerate.
13922 * testsuite/gc_tls_test.cc: New file.
13923 * testsuite/gc_tls_test.sh: New file.
13924
13925 2009-08-05 Sriraman Tallam <tmsriram@google.com>
13926
13927 * icf.cc: New file.
13928 * icf.h: New file.
13929 * Makefile.am (CCFILES): Add icf.cc.
13930 (HFILES): Add icf.h
13931 * Makefile.in: Regenerate.
13932 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13933 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13934 section, symbol and addend information for the relocs.
13935 * gold.cc (queue_middle_tasks): Call identical code folding.
13936 * gold.h: Add defines for multimap.
13937 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13938 to the call of finalize_local_symbols.
13939 * main.cc (main): Create object of class Icf.
13940 * object.cc (Sized_relobj::do_layout): Allow this function to be
13941 called twice during icf.
13942 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13943 to sections marked as identical by icf.
13944 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13945 when available.
13946 (Sized_relobj::do_section_entsize): New function.
13947 * object.h (Object::section_entsize): New function.
13948 (Object::do_section_entsize): New pure virtual function.
13949 (Relobj::finalize_local_symbols): Add new parameter.
13950 (Relobj::do_section_entsize): New function.
13951 * options.h (General_options::icf): New option.
13952 (General_options::icf_iterations): New option.
13953 (General_options::print_icf_sections): New option.
13954 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13955 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13956 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13957 icf.
13958 * symtab.cc (Symbol_table::is_section_folded): New function.
13959 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13960 to sections marked as identical by icf.
13961 * symtab.h (Symbol_table::set_icf): New function.
13962 (Symbol_table::icf): New function.
13963 (Symbol_table::is_section_folded): New function.
13964 (Symbol_table::icf_): New data member.
13965 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13966 * testsuite/Makefile.am: Add commands to build icf_test.
13967 * testsuite/Makefile.in: Regenerate.
13968 * testsuite/icf_test.sh: New file.
13969 * testsuite/icf_test.cc: New file.
13970
13971 2009-07-24 Chris Demetriou <cgd@google.com>
13972
13973 * layout.cc (is_compressible_debug_section): Fix incorrect
13974 comment about compressed section names.
13975
13976 2009-07-20 Ian Lance Taylor <ian@airs.com>
13977
13978 PR 10419
13979 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13980
13981 2009-07-16 Ian Lance Taylor <iant@google.com>
13982
13983 PR 10400
13984 * layout.h: #include <map>.
13985 (class Kept_section): Change from struct to class. Add accessors
13986 and setters. Add section size to Comdat_group mapping. Change
13987 Comdat_group to std::map. Add is_comdat_ field. Add
13988 linkonce_size field in union.
13989 (class Layout): Update declaration of find_or_add_kept_section.
13990 Don't declare find_kept_object.
13991 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13992 parameter. Add object, shndx, is_comdat, and is_group_name
13993 parameters. Change all callers. Adjust for new Kept_section.
13994 (Layout::find_kept_object): Remove.
13995 * object.cc (Sized_relobj::include_section_group): Update use of
13996 Kept_section. Rename secnum to shndx. Only record
13997 Kept_comdat_section if sections are the same size.
13998 (Sized_relobj::include_linkonce_section): Update use of
13999 Kept_section. Only record Kept_comdat_section if sections are the
14000 same size. Set size of linkonce section.
14001 (Sized_relobj::map_to_kept_section): Update call to
14002 get_kept_comdat_section.
14003 * object.h (class Sized_relobj): Rename fields in
14004 Kept_comdat_section to drop trailing underscores; change object
14005 field to Relobj*. Change Kept_comdat_section_table to store
14006 struct rather than pointer.
14007 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14008 Add kept_object and kept_shndx parameters. Change all callers.
14009 (Sized_relobj::get_kept_comdat_section): Change return type to
14010 bool. Add kept_object and kept_shndx parameters. Change all
14011 callers.
14012 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14013 Layout::find_or_add_kept_section.
14014
14015 2009-07-09 Ian Lance Taylor <iant@google.com>
14016
14017 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14018 Reserve space in the hash table.
14019
14020 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14021
14022 * fileread.cc (File_read::get_mtime): New method.
14023 * fileread.h (Timespec): New structure.
14024 (File_read::get_mtime): New method.
14025 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14026 Renamed from timestamp_nsec.
14027 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14028 Elf_Xword.
14029 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14030 timestamp_nsec.
14031 (Incremental_inputs::report_archive): Save mtime; style fix.
14032 (Incremental_inputs::report_obejct): Save mtime; style fix.
14033 (Incremental_inputs::report_script): Save mtime; style fix.
14034 (Incremental_inputs::finalize_inputs): Style fix.
14035 (Incremental_inputs::finalize): Style fix.
14036 (Incremental_inputs::create_input_section_data): Store inputs
14037 mtime.
14038 * incremental.h (Incremental_inputs::report_script): Add mtime
14039 argument.
14040 (Incremental_inputs::Input_info::Input_info): Intialize only one
14041 union member.
14042 (Incremental_inputs::Input_info::archive): Move to nameless
14043 union.
14044 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14045 (Incremental_inputs::Input_info::script): Move to nameless union.
14046 (Incremental_inputs::mtime): New field.
14047 * script.cc (read_input_script): Pass file mtime to
14048 Incremental_input.
14049 * script.h (Script_info::inputs): Style fix.
14050
14051 2009-07-01 Ian Lance Taylor <ian@airs.com>
14052
14053 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14054 instead of 32.
14055
14056 2009-06-24 Ian Lance Taylor <iant@google.com>
14057
14058 PR 10156
14059 * layout.cc (Layout::choose_output_section): If we find an
14060 existing section, update the flags.
14061 (Layout::create_notes): New function, broken out of
14062 Layout::finalize.
14063 (Layout::finalize): Don't create note sections.
14064 (Layout::create_note): Don't crash if linker script discards
14065 section.
14066 (Layout::create_gold_note): Likewise.
14067 (Layout::create_build_id): Likewise. Don't set
14068 after_input_sections on the section.
14069 (Layout::create_executable_stack_info): Remove target parameter.
14070 Change caller.
14071 * layout.h (class Layout): Declare create_notes. Update
14072 declaration of create_executable_stack_info.
14073 * gold.cc (queue_middle_tasks): Call create_notes.
14074 * output.cc (Output_section::update_flags_for_input_section): Move
14075 here from output.h. If SHF_ALLOC flag is newly set, mark address
14076 invalid.
14077 * output.h (Output_data::mark_address_invalid): New function.
14078 (class Output_section): Only declare, not define,
14079 update_flags_for_input_section. Remove set_flags.
14080
14081 2009-06-24 Ian Lance Taylor <iant@google.com>
14082
14083 * script-sections.cc (Output_section_definition::
14084 set_section_addresses): Rename shadowing local load_address to
14085 laddr.
14086
14087 2009-06-24 Ian Lance Taylor <iant@google.com>
14088
14089 PR 10244
14090 * reloc.cc (relocate_sections): Skip empty relocation sections.
14091
14092 2009-06-23 Ian Lance Taylor <iant@google.com>
14093
14094 PR 10156
14095 * layout.cc (Layout::create_note): Use choose_output_section
14096 rather than make_output_section.
14097
14098 2009-06-23 Ian Lance Taylor <iant@google.com>
14099
14100 PR 10237
14101 * options.cc (General_options::parse_V): Set printed_version_.
14102 (General_options::General_options): Initialize printed_version_.
14103 * options.h (class General_options): Add printed_version_ field.
14104 * gold.cc (queue_initial_tasks): If there are no input files,
14105 don't give a fatal error if we printed the version information.
14106 (queue_middle_tasks): If using -r with a shared object, give a
14107 fatal error rather than an ordinary error.
14108
14109 2009-06-23 Ian Lance Taylor <iant@google.com>
14110
14111 PR 10219
14112 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14113 (Layout::make_output_section): Set have_stabstr_section_ if we see
14114 a .stab*str section.
14115 (Layout::finalize): Call link_stabs_sections.
14116 (Layout::link_stabs_sections): New file.
14117 * layout.h (class Layout): Add have_stabstr_section_ field.
14118 Declare link_stabs_sections.
14119
14120 2009-06-23 Doug Kwan <dougkwan@google.com>
14121
14122 * Makefile.am (libgold_a_LIBADD): New.
14123 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14124 * Makefile.in: Regenerate.
14125 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14126 * configure: Regenerate.
14127 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14128 * fileread.cc: Include sys/state.h
14129 * gold.h: Declare memmem and strndup if found missing.
14130 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14131
14132 2009-06-23 Ian Lance Taylor <iant@google.com>
14133
14134 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14135 * configure: Rebuild.
14136
14137 2009-06-23 Ian Lance Taylor <iant@google.com>
14138
14139 PR 10147
14140 * object.cc (Object::section_contents): Don't try to get a view if
14141 the section has length zero.
14142 (Object::handle_gnu_warning_section): If the section is empty, use
14143 the name of the section as the warning.
14144
14145 2009-06-23 Ian Lance Taylor <iant@google.com>
14146
14147 PR 10133
14148 * stringpool.h (class Stringpool_template): Add optimize_ field.
14149 (Stringpool_template::set_optimize): New function.
14150 * stringpool.cc (Stringpool_template::Stringpool_template):
14151 Initialize optimize_ field.
14152 (Stringpool_template::set_string_offsets): Test local optimize
14153 fild rather than parameter.
14154 * layout.cc (Layout::Layout): Call set_optimize on the section
14155 name stringpool.
14156
14157 2009-06-22 Ian Lance Taylor <iant@google.com>
14158
14159 PR 10030
14160 * yyscript.y: Parse TARGET.
14161 * script.cc (script_set_target): New function.
14162 * script-c.h (script_set_target): Declare.
14163 * options.cc (General_options::string_to_object_format): Rename
14164 from string_to_object_format in anonymous namespace. Change
14165 callers.
14166 * options.h (class General_options): Declare
14167 string_to_object_format.
14168
14169 2009-06-22 Ian Lance Taylor <iant@google.com>
14170
14171 * script-sections.cc (Script_sections::create_segments): Don't put
14172 program headers in a PT_LOAD segment if -n or -N.
14173
14174 2009-06-22 Ian Lance Taylor <iant@google.com>
14175
14176 PR 10141
14177 * options.h (class General_options): Add -z lazy and -z now. Sort
14178 -z options into alphabetical order.
14179 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14180
14181 2009-06-21 Ian Lance Taylor <iant@google.com>
14182
14183 * layout.cc (Layout::make_output_section): Call
14184 Target::new_output_section.
14185 (Layout::attach_allocated_section_to_segment): Put large section
14186 sections in a separate load segment with the large segment flag
14187 set.
14188 (Layout::segment_precedes): Sort large data segments after other
14189 load segments.
14190 (align_file_offset): New static function.
14191 (Layout::set_segment_offsets): Use align_file_offset.
14192 * output.h (class Output_section): Add is_small_section_ and
14193 is_large_section_ fields.
14194 (Output_section::is_small_section): New function.
14195 (Output_section::set_is_small_section): New function.
14196 (Output_section::is_large_section): New function.
14197 (Output_section::set_is_large_section): New function.
14198 (Output_section::is_large_data_section): New function.
14199 (class Output_segment): Add is_large_data_segment_ field.
14200 (Output_segment::is_large_data_segment): New function.
14201 (Output_segment::set_is_large_data_segment): New function.
14202 * output.cc (Output_section::Output_section): Initialize new
14203 fields.
14204 (Output_segment::Output_segment): Likewise.
14205 (Output_segment::add_output_section): Add assertion that large
14206 data sections always go in large data segments. Force small data
14207 sections to the end of the list of data sections. Force small BSS
14208 sections to the start of the list of BSS sections. For large BSS
14209 sections to the end of the list of BSS sections.
14210 * symtab.h (class Symbol): Declare is_common_shndx.
14211 (Symbol::is_defined): Check Symbol::is_common_shndx.
14212 (Symbol::is_common): Likewise.
14213 (class Symbol_table): Define enum Commons_section_type. Update
14214 declarations. Add small_commons_ and large_commons_ fields.
14215 * symtab.cc (Symbol::is_common_shndx): New function.
14216 (Symbol_table::Symbol_table): Initialize new fields.
14217 (Symbol_table::add_from_object): Put small and large common
14218 symbols in the right list.
14219 (Symbol_table::sized_finalized_symbol): Check
14220 Symbol::is_common_shndx.
14221 (Symbol_table::sized_write_globals): Likewise.
14222 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14223 common symbol lists. Don't call do_allocate_commons_list if the
14224 list is empty.
14225 (Symbol_table::do_allocate_commons_list): Remove is_tls
14226 parameter. Add comons_section_type parameter. Change all
14227 callers. Handle small and large common symbols.
14228 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14229 Symbol::is_common_shndx.
14230 * resolve.cc (symbol_to_bits): Likewise.
14231 * target.h (Target::small_common_shndx): New function.
14232 (Target::small_common_section_flags): New function.
14233 (Target::large_common_shndx): New function.
14234 (Target::large_common_section_flags): New function.
14235 (Target::new_output_section): New function.
14236 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14237 small_common_section_flags, and large_common_section_flags
14238 fields.
14239 (Target::do_new_output_section): New virtual function.
14240 * arm.cc (Target_arm::arm_info): Initialize new fields.
14241 * i386.cc (Target_i386::i386_info): Likewise.
14242 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14243 Likewise.
14244 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14245 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14246 (Target_x86_64::do_new_output_section): New function.
14247 * configure.ac: Define conditional MCMODEL_MEDIUM.
14248 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14249 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14250 (large_LDFLAGS): Define.
14251 * testsuite/large.c: New file.
14252 * testsuite/testfile.cc (Target_test::test_target_info):
14253 Initialize new fields.
14254 * configure, testsuite/Makefile.in: Rebuild.
14255
14256 2009-06-05 Doug Kwan <dougkwan@google.com>
14257
14258 * Makefile.am (CCFILES): Add target.cc.
14259 * Makefile.in: Regenerate.
14260 * i386.cc (class Target_i386): Define new virtual method to
14261 override do_is_local_label_name in parent.
14262 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14263 local symbols if --discard-locals or -X is given.
14264 * options.h (class General_options): Declare new options
14265 '--discard-locals' and '-X' for discarding locals.
14266 * target.h (class Target): Define new methods is_local_label_name.
14267 Declare new virtual method do_is_local_label_name.
14268 * target.cc: New file.
14269 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14270 (check_SCRIPTS): Add discard_locals_test.sh.
14271 (check_DATA): Add discard_local_tests.syms.
14272 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14273 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14274 * testsuite/Makefile.in: Regenerate.
14275 * testsuite/discard_locals_test.c: New file.
14276 * testsuite/discard_locals_test.sh: Same.
14277
14278 2009-06-05 Doug Kwan <dougkwan@google.com>
14279
14280 * object.cc (Sized_relobj::Sized_relobj): Initialize
14281 discarded_eh_frame_shndx_ to -1U.
14282 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14283 section.
14284 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14285 a discarded .eh_frame section.
14286 (Sized_relobj::do_finalize_local_symbols): Ditto.
14287 * object.h (class Sized_relobj): Declare new member
14288 discarded_eh_frame_shndx_.
14289 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14290 (local_labels_test.o, local_labels_test): New rules.
14291 * testsuite/Makefile.in: Regenerate.
14292
14293 2009-06-04 Doug Kwan <dougkwan@google.com>
14294
14295 * layout.cc (Layout::section_name_mapping): Add mapping for
14296 special ARM sections.
14297
14298 2009-06-03 Doug Kwan <dougkwan@google.com>
14299
14300 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14301 (utils::has_overflow): Same.
14302
14303 2009-06-03 Ian Lance Taylor <iant@google.com>
14304
14305 * layout.cc (Layout::section_name_mapping): New array, replacing
14306 Layout::linkonce_mapping.
14307 (Layout::section_name_mapping_count): New variable, replacing
14308 Layout::linkonce_mapping_count.
14309 (Layout::linkonce_output_name): Remove.
14310 (Layout::output_section_name): Rewrite.
14311 * layout.h (class Layout): Rename Linkonce_mapping to
14312 Section_name_mapping, linkonce_mapping to section_name_mapping,
14313 linkonce_mapping_count to section_name_mapping_count. Don't
14314 declare linkonce_output_name.
14315
14316 2009-06-03 Doug Kwan <dougkwan@google.com>
14317
14318 * gold/arm.cc (namespace utils): New.
14319 (Target_arm::reloc_is_non_pic): Define new method.
14320 (class Arm_relocate_functions): New.
14321 (Target_arm::Relocate::relocate): Handle relocation types used by
14322 Android.
14323
14324 2009-06-03 Ian Lance Taylor <iant@google.com>
14325
14326 * arm.cc (Target_arm::scan::global): Use || instead of |.
14327
14328 2009-06-02 Doug Kwan <dougkwan@google.com>
14329
14330 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14331 issued_non_pic_error_.
14332 (class Target_arm::Scan): Declare new method check_non_pic.
14333 Define new method symbol_needs_plt_entry.
14334 Declare new data member issued_non_pic_error_.
14335 (class Target_arm::Relocate): Declare new method
14336 should_apply_static_reloc.
14337 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14338 (Target_arm::Scan::check_non_pic): Define new method.
14339 (Target_arm::Scan::local): Handle a small subset of reloc types used
14340 by Android.
14341 (Target_arm::Scan::local): Same.
14342 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14343
14344 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14345
14346 * incremental.cc (Incremental_inputs::report_command_line): Filter
14347 out --incremental-* options.
14348
14349 2009-05-29 Doug Kwan <dougkwan@google.com>
14350
14351 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14352 template class.
14353 (class Target_arm): Update comment.
14354 (Target_arm::Target_arm): Initialize new data members GOT_,
14355 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14356 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14357 and Target_arm::rel_dyn_section.
14358 Declare new_enum Target_arm::Got_type.
14359 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14360 and DYNBSS_.
14361 Update commments for member do_dynsym_value.
14362 (Target_arm::got_size, Target_arm::plt_section,
14363 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14364 new methods inside class defintion.
14365 (Target_arm::got_section): Define new method.
14366 (Target_arm::rel_dyn_section): Same.
14367 (Output_data_plt_arm): New template class.
14368 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14369 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14370 (Output_data_plt_arm::add_entry): Same.
14371 (Output_data_plt_arm::first_plt_entry): Define new
14372 static data member for PLT instruction template.
14373 (Output_data_plt_arm::plt_entry): Same.
14374 (Output_data_plt_arm::do_write): Define new method.
14375 (Target_arm::make_plt_entry): Same.
14376 (Target_arm::do_finalize_sections): Same.
14377 (Target_arm::do_dynsym_value): Same.
14378
14379 2009-05-28 Doug Kwan <dougkwan@google.com>
14380
14381 * Makefile.am (TARGETSOURCES): Add arm.cc.
14382 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14383 * Makefile.in: Regenerate.
14384 * arm.cc: New file.
14385 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14386
14387 2009-05-26 Doug Kwan <dougkwan@google.com>
14388
14389 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14390 (General_options::check_excluded_libs): Strip off directories in
14391 archive name before matching like GNU ld does.
14392 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14393 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14394 (exclude_libs_test_LDFLAGS): Add linker option
14395 -Wl,--exclude-libs,libexclude_libs_test_3
14396 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14397 an explicit archive without using -l.
14398 (alt/libexclude_libs_test_3.a): New make rule.
14399 * testsuite/Makefile.in: Regenerate.
14400 * testsuite/exclude_libs_test.c : Declare lib3_default().
14401 (main): Call it.
14402 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14403 * exclude_libs_test_3.c: New file.
14404
14405 2009-05-26 Nick Clifton <nickc@redhat.com>
14406
14407 * po/id.po: New Indonesian translation.
14408 * po/gold.pot: Updated template file.
14409
14410 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14411
14412 * testsuite/Makefile.am: Add -ffunction-sections to compile
14413 gc_comdat_test files. Add -Wl,--gc-sections to build
14414 gc_comdat_test.
14415 * testsuite/Makefile.in: Regenerate.
14416 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14417
14418 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14419
14420 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14421 kept comdat section was garbage collected.
14422 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14423 * testsuite/Makefile.in: Regenerate.
14424 * testsuite/gc_comdat_test.sh: New file.
14425 * testsuite/gc_comdat_test_1.cc: New file.
14426 * testsuite/gc_comdat_test_2.cc: New file.
14427
14428 2009-05-19 Doug Kwan <dougkwan@google.com>
14429
14430 * archive.cc (Archive::Archive): Move constructor from archive.h
14431 to here. Initialize no_export_.
14432 (Archive::get_elf_object_for_member): Set no_export flag of object.
14433 * archive.h (Archive::Archive): Move constructor body to
14434 archive.cc.
14435 (Archive::no_export): New method.
14436 (Archive::no_export_): New field.
14437 * object.h (Object::Object): Initialize no_export_ to false.
14438 (Object::no_export, Object::set_no_export): New methods.
14439 (Object::no_export_): New field.
14440 * options.cc (General_options::parse_exclude_libs): New method.
14441 (General_options::check_excluded_libs) Same.
14442 * options.h (exclude_libs): New option.
14443 (General_options::check_excluded_libs): New method declaration.
14444 (General_options::excluded_libs_): New field.
14445 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14446 default or protected visibility if an object has no-export flag set.
14447 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14448 (check_SCRIPTS): Add exclude_libs_test.sh.
14449 (check_DATA): Add exclude_libs_test.syms.
14450 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14451 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14452 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14453 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14454 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14455 libexclude_libs_test_2.a): New rules.
14456 * testsuite/Makefile.in: Regenerate.
14457 * testsuite/exclude_libs_test.c: New file.
14458 * testsuite/exclude_libs_test.sh: Ditto.
14459 * testsuite/exclude_libs_test_1.c: Ditto.
14460 * testsuite/exclude_libs_test_2.c: Ditto.
14461
14462 2009-05-15 Ian Lance Taylor <iant@google.com>
14463
14464 * configure.ac: Check for declarations for cases where libiberty.h
14465 checks HAVE_DECL_xxx.
14466 * configure, config.in: Rebuild.
14467
14468 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14469
14470 * gold.h (Incremental_argument_list): Remove (invalid) forward
14471 declaration.
14472 * incremental.cc (Incremental_inputs::report_achive): New method.
14473 (Incremental_inputs::report_object): New method.
14474 (Incremental_inputs::report_script): New method.
14475 (Incremental_inputs::finalize_inputs): New method.
14476 (Incremental_inputs::finalize): Call finalize_inputs().
14477 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14478 Create inputs entries.
14479 * incremental.h (Incremental_input_type): New enum.
14480 (Incremental_inputs::Incremental_input): Initialize new fields.
14481 (Incremental_inputs::report_inputs): New method.
14482 (Incremental_inputs::report_achive): New method.
14483 (Incremental_inputs::report_object): New method.
14484 (Incremental_inputs::report_script): New method.
14485 (Incremental_inputs::finalize_inputs): New method.
14486 (Incremental_inputs::Input_info): New struct.
14487 (Incremental_inputs::Input_info_map): New typedef.
14488 (Incremental_inputs::lock_): New field.
14489 (Incremental_inputs::Inputs_): New field.
14490 (Incremental_inputs::Inputs_map): New field.
14491 * main.cc (main): Call Incremental_input::report_inputs.
14492 * options.h (Input_argument_list): Typedef moved from
14493 Input_arguments.
14494 (Input_file_group::Files): Remove, use ::Input_argument_list.
14495 (Input_file_group::Input_argument_list): Remove, use
14496 ::Input_argument_list.
14497 * plugin.cc (Plugin_manager::add_input_file): Add error in
14498 incremental build.
14499 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14500 functions.
14501 * script.cc (read_input_script): Call
14502 Incremental_input::report_script.
14503 * script.h (Script_info): New class.
14504
14505 2009-04-27 Ian Lance Taylor <iant@google.com>
14506
14507 * x86_64.cc (do_adjust_output_section): Set entsize to
14508 plt_entry_size.
14509
14510 2009-04-23 Elliott Hughes <enh@google.com>
14511
14512 * output.cc (Output_file::close): After short writes, continue
14513 writing from the correct offset in the buffer being written.
14514
14515 2009-04-23 Chris Demetriou <cgd@google.com>
14516
14517 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14518 * configure: Regenerate.
14519 * config.in: Regenerate.
14520 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14521 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14522
14523 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14524
14525 * incremental.cc (Incremental_inputs_header_data): Renamed from
14526 Incremental_input_header_data.
14527 (Incremental_inputs_header_data::data_size): New field.
14528 (Incremental_inputs_header_data::put_input_file_count): Renamed
14529 from input_file_count.
14530 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14531 from command_line_offset.
14532 (Incremental_inputs_header_data::put_reserved): Renamed from
14533 put_reserved.
14534 (Incremental_inputs_entry_data): Renamed from
14535 Incremental_input_entry_data.
14536 (Incremental_inputs_entry_data::data_size): New field.
14537 (Incremental_inputs::report_command_line): New method.
14538 (Incremental_inputs::finalize): New method.
14539 (Incremental_inputs::create_incremental_inputs_data): New method.
14540 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14541 * incremental.h: New file.
14542 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14543 (Layout::finalize): Create incremental inputs section in
14544 incremental builds.
14545 (Layout::create_incremental_info_sections): New method.
14546 * layout.h (Layout::incremental_inputs): New method.
14547 (Layout::create_incremental_info_sections): New method.
14548 (Layout::incremental_inputs_): New field.
14549 * main.cc (main): Notify Incremental_input of the command line.
14550
14551 2009-04-01 Ian Lance Taylor <iant@google.com>
14552 Mikolaj Zalewski <mikolajz@google.com>
14553
14554 * gold.h (reserve_unordered_map): Define, three versions, one for
14555 each version of Unordered_map.
14556 * layout.cc (Layout::Layout): Remove options parameter. Add
14557 number_of_input_files parameter. Don't initialize options_.
14558 Initialize number_of_input_files_ and resized_signatures_. Move
14559 sections_are_attached_.
14560 (Layout::layout_group): Reserve space for group_signatures_.
14561 (Layout::find_or_add_kept_section): Change name parameter to be a
14562 reference. Resize signatures_ map when it gets large enough.
14563 (Layout::layout_eh_frame): Use parameters->options() instead of
14564 this->options_.
14565 (Layout::make_output_section): Likewise.
14566 (Layout::attach_allocated_section_to_segment): Likewise.
14567 (Layout::finalize, Layout::create_executable_stack): Likewise.
14568 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14569 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14570 * layout.h (class Layout): Update declarations. Remove options_
14571 field. Add number_of_input_files_ and resized_signatures_
14572 fields. Move sections_are_attached_ field.
14573 * main.cc (main): Pass number of input files to Layout
14574 constructor. Don't pass options.
14575
14576 2009-03-30 Ian Lance Taylor <iant@google.com>
14577
14578 * ffsll.c (ffsll): Correct implementation.
14579
14580 2009-03-27 Ian Lance Taylor <iant@google.com>
14581
14582 * ffsll.c: New file.
14583 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14584 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14585 * ftruncate.c (ftruncate): Declare before definition.
14586 * mremap.c (mremap): Likewise.
14587 * pread.c (pread): Likewise.
14588 * configure, Makefile.in, config.in: Rebuild.
14589
14590 * mremap.c: New file.
14591 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14592 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14593 (mremap): Declare if HAVE_MREMAP is not defined.
14594 * configure, Makefile.in, config.in: Rebuild.
14595
14596 2009-03-27 Cary Coutant <ccoutant@google.com>
14597
14598 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14599 position independent.
14600 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14601 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14602
14603 2009-03-24 Cary Coutant <ccoutant@google.com>
14604
14605 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14606 an executable.
14607 (needs_dynamic_reloc): Likewise.
14608
14609 2009-03-24 Ian Lance Taylor <iant@google.com>
14610
14611 * yyscript.y (file_cmd): Recognize EXTERN.
14612 (extern_name_list, extern_name_list_body): New nonterminals.
14613 * script.cc (script_add_extern): Define.
14614 * script-c.h (script_add_extern): Declare.
14615
14616 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14617
14618 * object.cc (is_elf_object): Define.
14619 * object.h (is_elf_object): Declare.
14620 * archive.cc (Archive::get_elf_object_for_member): Call
14621 is_elf_object.
14622 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14623
14624 2009-03-24 Elliott Hughes <enh@google.com>
14625
14626 * output.cc (Output_file::map_anonymous): Define.
14627 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14628 try an anonymous one. Report the size if the mmap fails.
14629 * output.h (class Output_file): Declare map_anonymous.
14630
14631 2009-03-24 Ian Lance Taylor <iant@google.com>
14632
14633 * target-select.cc (instantiate_target): Don't acquire the lock if
14634 the instantiated_target_ field has already been set.
14635
14636 2009-03-23 Ian Lance Taylor <iant@google.com>
14637
14638 * gold-threads.h (class Initialize_lock): Define.
14639 * gold-threads.cc (class Initialize_lock_once): Define.
14640 (initialize_lock_control): New static variable.
14641 (initialize_lock_pointer): New static variable.
14642 (initialize_lock_once): New static function.
14643 (Initialize_lock::Initialize_lock): Define.
14644 (Initialize_lock::initialize): Define.
14645 * target-select.h: Include "gold-threads.h".
14646 (class Target_selector): Add lock_ and initialize_lock_ fields.
14647 Don't define instantiate_target, just declare it.
14648 * target-select.cc (Target_selector::Target_selector): Initialize
14649 new fields.
14650 (Target_selector::instantiate_target): Define.
14651 * descriptors.h: Include "gold-threads.h".
14652 (class Descriptors): Add initialize_lock_ field.
14653 * descriptors.cc (Descriptors::Descriptors): Initialize new
14654 field.
14655 (Descriptors::open): Use initialize_lock_ field
14656 * errors.h (class Errors): Add initialize_lock_ field.
14657 * errors.cc (Errors::Errors): Initialize new field.
14658 (Errors::initialize_lock): Use initialize_lock_ field.
14659 * powerpc.cc (class Target_selector_powerpc): Remove
14660 instantiated_target_ field. In do_recognize call
14661 instantiate_target rather than do_instantiate_target. In
14662 do_instantiate_target just allocate a new target.
14663 * sparc.cc (class Target_selector_sparc): Likewise.
14664
14665 * freebsd.h: New file.
14666 * i386.cc: Include "freebsd.h".
14667 (Target_i386): Derive from Target_freebsd rather than
14668 Sized_target.
14669 (Target_selector_i386): Derive from Target_selector_freebsd rather
14670 than Target_selector.
14671 * x86_64.cc: Include "freebsd.h".
14672 (Target_x86_64): Derive from Target_freebsd rather than
14673 Sized_target.
14674 (Target_selector_x86_64): Derive from Target_selector_freebsd
14675 rather than Target_selector.
14676 * target.h (class Target): Add adjust_elf_header and
14677 do_adjust_elf_header.
14678 * output.cc (Output_file_header:: do_sized_write): Call target
14679 adjust_elf_header routine.
14680 * configure.tgt: Set targ_osabi.
14681 * configure.ac: Define GOLD_DEFAULT_OSABI.
14682 * parameters.cc (Parameters::default_target): Pass
14683 GOLD_DEFAULT_OSABI to select_target.
14684 * target-select.h (class Target_selector): Make instantiate_target
14685 protected rather than private.
14686 * Makefile.am (HFILES): Add freebsd.h.
14687 * configure, Makefile.in, config.in: Rebuild.
14688
14689 * merge.cc (do_add_input_section): Correct pend value. Change
14690 message about last entry not being null terminated from error to
14691 warning.
14692
14693 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14694
14695 * incremental.cc: New file.
14696 * Makefile.am (CCFILES): Add incremental.cc.
14697 * Makefile.in: Rebuild.
14698
14699 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14700
14701 * layout.cc (Layout::output_section_name): Preserve names
14702 of '.note.' sections.
14703
14704 2009-03-19 Ian Lance Taylor <iant@google.com>
14705
14706 * descriptors.cc (Descriptors::open): Check that the options are
14707 valid before using them.
14708
14709 2009-03-18 Ian Lance Taylor <iant@google.com>
14710
14711 * script-sections.h: Include <list>.
14712 (class Script_sections): Change Sections_elements from std::vector
14713 to std::list. Typedef public Elements_iterator. Add
14714 orphan_section_placement_, data_segment_align_start_, and
14715 saw_data_segment_align_ fields. Remove data_segment_align_index_
14716 field.
14717 * script-sections.cc (class Orphan_section_placement): New class.
14718 (class Sections_element): Add virtual functions is_relro and
14719 orphan_section_init. Remove virtual function place_orphan_here.
14720 (class Output_section_definition): Add is_relro and
14721 orphan_section_init. Remove place_orphan_here.
14722 (class Orphan_output_section): Likewise.
14723 (Script_sections::Script_sections): Update for field changes.
14724 (Script_sections::data_segment_align): Set saw_data_segment_align_
14725 and data_segment_align_start_, not data_segment_align_index.
14726 (Script_sections::data_segment_relro_end): Check
14727 saw_data_segment_align_. Use data_segment_align_start_ rather
14728 than data_segment_align_index_.
14729 (Script_sections::place_orphan): Rewrite to use
14730 Orphan_section_placement.
14731
14732 2009-03-17 Ian Lance Taylor <iant@google.com>
14733
14734 * archive.cc (Archive::add_symbols): Check for a version attached
14735 to the symbol name in the archive map.
14736 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14737 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14738 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14739 (ver_test_11.a): New target.
14740 * testsuite/Makefile.in: Rebuild.
14741
14742 * configure.ac: Check for chsize and posix_fallocate. Replace
14743 ftruncate.
14744 * ftruncate.c: New file, from gnulib.
14745 * output.cc (posix_fallocate): Define dummy version if not
14746 HAVE_POSIX_FALLOCATE.
14747 (Output_file::map): Call posix_fallocate rather than lseek and
14748 write.
14749 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14750 * configure, Makefile.in, config.in: Rebuild.
14751
14752 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
14753
14754 * layout.h (Layout::create_note): Add section_name parameter.
14755 * layout.cc (Layout::create_note): Likewise.
14756 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
14757
14758 2009-03-17 Ian Lance Taylor <iant@google.com>
14759
14760 * descriptors.cc: Include "options.h".
14761 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14762 (Descriptors::open): Always use O_CLOEXEC when opening a new
14763 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14764 then set FD_CLOEXEC.
14765
14766 * sparc.cc (class Target_sparc): Add has_got_section.
14767 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14768 make sure we have a GOT section.
14769
14770 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14771 (Target_sparc::Scan::local): Likewise.
14772 (Target_sparc::Scan::global): Likewise.
14773 (Target_sparc::Relocate::relocate): Likewise.
14774 (Target_sparc::Relocate::relocate_tls): Likewise.
14775
14776 * symtab.cc (Symbol_table::define_default_version): New function,
14777 broken out of add_from_object.
14778 (Symbol_table::add_from_object): Call define_default_version.
14779 (Symbol_table::define_special_symbol): Add resolve_oldsym
14780 parameter. Change all callers. If the version for a symbol comes
14781 from a version script, resolve it with the symbol with the same
14782 name with no version. Also add the symbol without a version if
14783 appropriate.
14784 (do_define_in_output_data): If resolving with oldsym, don't delete
14785 sym.
14786 (do_define_in_output_segment): Likewise.
14787 (do_define_as_constant): Likewise.
14788 * symtab.h (class Symbol_table): Update declarations.
14789
14790 2009-03-13 Ian Lance Taylor <iant@google.com>
14791
14792 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14793 (Read_symbols::requeue): New function.
14794 (Read_symbols::do_read_symbols): If make_elf_object fails because
14795 the target type is not configured, and the file was searched for,
14796 issue a warning and retry with the next directory.
14797 (Add_symbols::run): If the file has an incompatible format, and
14798 it was searched for, requeue the Read_symbols task. On error,
14799 release the object.
14800 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14801 dirindex parameter to constructor. Change all callers. Declare
14802 incompatible_warning and requeue.
14803 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14804 input_argument_ and input_group_ fields. Add them to
14805 constructor. Change all callers.
14806 (class Read_script): Add dirindex_ field. Add it to constructor.
14807 Change all callers.
14808 * archive.cc (Archive::setup): Remove input_objects parameter.
14809 Change all callers.
14810 (Archive::get_file_and_offset): Likewise.
14811 (Archive::read_all_symbols): Likewise.
14812 (Archive::read_symbols): Likewise.
14813 (Archive::get_elf_object_for_member): Remove input_objects
14814 parameter. Add punconfigured parameter. Change all callers.
14815 (Archive::add_symbols): Change return type to bool. Check return
14816 value of include_member.
14817 (Archive::include_all_members): Likewise.
14818 (Archive::include_member): Change return type to bool. Return
14819 false if first included object has incompatible target. Set
14820 included_member_ field.
14821 (Add_archive_symbols::run): If add_symbols returns false, requeue
14822 Read_symbols task.
14823 * archive.h (class Archive): Add included_member_ field.
14824 Initialize it in constructor. Add input_file and searched_for
14825 methods. Update declarations.
14826 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14827 input_argument_ fields. Add them to constructor. Change all
14828 callers.
14829 * script.cc: Include "target-select.h".
14830 (class Parser_closure): Add skip_on_incompatible_target_ and
14831 found_incompatible_target_ fields. Add
14832 skip_on_incompatible_target parameter to constructor. Change all
14833 callers. Add methods skip_on_incompatible_target,
14834 clear_skip_on_incompatible_target, found_incompatible_target, and
14835 set_found_incompatible_target.
14836 (read_input_script): Add dirindex parameter. Change all callers.
14837 If parser finds an incompatible target, requeue Read_symbols
14838 task.
14839 (script_set_symbol): Clear skip_on_incompatible_target in
14840 closure.
14841 (script_add_assertion, script_parse_option): Likewise.
14842 (script_start_sections, script_add_phdr): Likewise.
14843 (script_check_output_format): New function.
14844 * script.h (read_input_script): Update declaration.
14845 * script-c.h (script_check_output_format): Declare.
14846 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14847 (ignore_cmd): Remove OUTPUT_FORMAT.
14848 * fileread.cc (Input_file::Input_file): Add explicit this.
14849 (Input_file::will_search_for): New function.
14850 (Input_file::open): Add pindex parameter. Change all callers.
14851 * fileread.h (class Input_file): Add input_file_argument method.
14852 Declare will_search_for. Update declarations.
14853 * object.cc (make_elf_object): Add punconfigured parameter.
14854 Change all callers.
14855 * object.h (class Object): Make input_file public. Add
14856 searched_for method.
14857 (make_elf_object): Update declaration.
14858 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14859 restart search.
14860 * dirsearch.h (class Dirsearch): Update declaration.
14861 * options.h (class General_options): Add --warn-search-mismatch.
14862 * parameters.cc (Parameters::is_compatible_target): New function.
14863 * parameters.h (class Parameters): Declare is_compatible_target.
14864 * workqueue.cc (Workqueue::add_blocker): New function.
14865 * workqueue.h (class Workqueue): Declare add_blocker.
14866
14867 * fileread.cc (Input_file::open): Remove options parameter.
14868 Change all callers.
14869 (Input_file::open_binary): Likewise.
14870 * script.cc (read_input_script): Likewise.
14871 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14872 options parameter from constructor. Change all callers.
14873 (class Read_script): Likewise.
14874 * fileread.h (class Input_file): Update declarations.
14875 * script.h (read_input_script): Update declaration.
14876
14877 2009-03-10 Nick Clifton <nickc@redhat.com>
14878
14879 * po/es.po: New Spanish translation.
14880
14881 2009-03-06 Cary Coutant <ccoutant@google.com>
14882
14883 * options.cc (parse_short_option): Keep dash_z from registering itself.
14884
14885 2009-03-03 Ian Lance Taylor <iant@google.com>
14886
14887 PR 9918
14888 * target-reloc.h (relocate_section): Pass output_section to
14889 relocate.
14890 * i386.cc (Target_i386::should_apply_static_reloc): Add
14891 output_section parameter. Change all callers.
14892 (Target_i386::Relocate::relocate): Add output_section parameter.
14893 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14894 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14895 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14896 * testsuite/two_file_shared.sh: New script.
14897 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14898 (check_DATA): Add two_file_shared.dbg.
14899 (two_file_shared.dbg): New target.
14900 * testsuite/Makefile.in: Rebuild.
14901
14902 2009-03-01 Ian Lance Taylor <iant@google.com>
14903
14904 * configure.ac: Check for byteswap.h.
14905 * configure: Rebuild.
14906 * config.in: Rebuild.
14907
14908 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14909
14910 * layout.cc (Layout::find_or_add_kept_section): New function.
14911 (Layout::add_comdat): Removed.
14912 * layout.h (struct Kept_section): Move out of class Layout.
14913 Remove trailing underscores from field names. Add group_sections
14914 field. Rename group_ field to is_group. Change all uses.
14915 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14916 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14917 comdat_groups_ field.
14918 (Sized_relobj::include_section_group): Use
14919 find_or_add_kept_section and Kept_section::group_sections.
14920 (Sized_relobj::include_linkonce_section): Likewise.
14921 * object.cc (class Sized_relobj): Don't define Comdat_group or
14922 Comdat_group_table. Remove find_comdat_group and
14923 add_comdat_group. Remove comdat_groups_ field.
14924 * plugin.cc (include_comdat_group): Use
14925 Layout::find_or_add_kept_section.
14926
14927 2009-02-28 Ian Lance Taylor <iant@google.com>
14928
14929 * README: --gc-sections and map files are now supported. Document
14930 some build requirements.
14931
14932 PR 6992
14933 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14934 relocatable link set the value of the section symbol to zero.
14935 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14936 relocatable link don't include the section address in the local
14937 symbol value.
14938
14939 2009-02-27 Ian Lance Taylor <iant@google.com>
14940
14941 PR 6811
14942 * options.h (class Search_directory): Add is_system_directory.
14943 (class General_options): Declare is_in_system_directory.
14944 * options.cc (get_relative_sysroot): Make static.
14945 (get_default_sysroot): Make static.
14946 (General_optoins::is_in_system_directory): New function.
14947 * fileread.cc (Input_file::is_in_system_directory): New function.
14948 * fileread.h (class Input_file): Declare is_in_system_directory.
14949 * object.h (class Object): Add is_in_system_directory.
14950 (class Input_objects): Remove system_library_directory_ field.
14951 * object.cc (Input_objects::add_object): Don't set
14952 system_library_directory_.
14953 (input_objects::found_in_system_library_directory): Remove.
14954 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14955 parameter. Change all callers.
14956 (Symbol_table::sized_write_globals): Likewise.
14957 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14958 Call Object::is_in_system_directory.
14959 * symtab.h (class Symbol_table): Update declarations.
14960
14961 PR 5990
14962 * descriptors.h (Open_descriptor): Add is_on_stack field.
14963 * descriptors.cc (Descriptors::open): If the descriptor is on the
14964 top of the stack, remove it. Initialize is_on_stack field.
14965 (Descriptors::release): Only add pod to stack if it is not on the
14966 stack already.
14967 (Descriptors::close_some_descriptor): Clear stack_next and
14968 is_on_stack fields.
14969
14970 PR 7091
14971 * output.cc (Output_section::find_starting_output_address): Rename
14972 from starting_output_address; add PADDR parameter; change return
14973 type.
14974 * output.h (class Output_section): Declare
14975 find_starting_output_address instead of starting_output_address.
14976 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14977 section symbol for which we can't find a merge section.
14978
14979 PR 9836
14980 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14981 hidden or internal, force the symbol to be local.
14982 * resolve.cc (Symbol::override_visibility): Define.
14983 (Symbol::override_base): Use override_visibility.
14984 (Symbol_table::resolve): Likewise.
14985 (Symbol::override_base_with_special): Likewise.
14986 (Symbol_table::override_with_special): If the visibility is hidden
14987 or internal, force the symbol to be local.
14988 * symtab.h (class Symbol): Add set_visibility and
14989 override_visibility.
14990 * testsuite/ver_test_1.sh: New file.
14991 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14992 (check_DATA): Add ver_test_1.syms.
14993 (ver_test_1.syms): New target.
14994 * testsuite/Makefile.in: Rebuild.
14995
14996 2009-02-25 Cary Coutant <ccoutant@google.com>
14997
14998 * layout.cc (Layout::choose_output_section): Don't rename sections
14999 when using a linker script that has a SECTIONS clause.
15000 * Makefile.in: Regenerate.
15001
15002 * testsuite/Makefile.am (script_test_5.sh): New test case.
15003 * testsuite/Makefile.in: Regenerate.
15004 * testsuite/script_test_5.cc: New file.
15005 * testsuite/script_test_5.sh: New file.
15006 * testsuite/script_test_5.t: New file.
15007
15008 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15009
15010 * archive.cc (Archive::include_member): Update calls to add_symbols.
15011 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15012 the Layout argument.
15013 * dynobj.h (do_add_symbols): Add the Layout argument.
15014 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15015 Layout argument.
15016 * object.h (Object::add_symbols): Add the Layout argument.
15017 (Object::do_add_symbols): Add the Layout argument.
15018 (Sized_relobj::do_add_symbols): Add the Layout argument.
15019 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15020 Unify the two versions.
15021 (Add_plugin_symbols): Remove.
15022 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15023 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15024 (Add_plugin_symbols): Remove.
15025 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15026 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15027 (Add_symbols::run): Make it work with Pulginobj.
15028
15029 2009-02-06 Ian Lance Taylor <iant@google.com>
15030
15031 * object.cc (Sized_relobj::do_layout): Make info message start
15032 with lower case letter.
15033
15034 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15035
15036 * binary.cc: Fix file comment.
15037
15038 * options.h (enum Incremental_disposition): Define.
15039 (class General_options): Add new options: --incremental,
15040 --incremental_changed, --incremental_unchanged,
15041 --incremental_unknown. Add incremental_disposition_ and
15042 implicit_incremental_ fields.
15043 (General_options::incremental_disposition): New function.
15044 (class Position_dependent_options): Add incremental_disposition
15045 option.
15046 (Position_dependent_options::copy_from_options): Set incremental
15047 dispositions.
15048 * options.cc (General_options::parse_incremental_changed): New
15049 function.
15050 (General_options::parse_incremental_unchanged): New function.
15051 (General_options::parse_incremental_unknown): New function.
15052 (General_options::General_options): Initialize new fields
15053 incremental_disposition_ and implicit_incremental_.
15054 (General_options::finalize): Check for uasge of --incremental-*
15055 without --incremental.
15056
15057 2009-02-06 Chris Demetriou <cgd@google.com>
15058
15059 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15060 pointer and to report location as the file name associated with
15061 the symbol.
15062 (gold_undefined_symbol_at_location): New function to replace the
15063 old gold_undefined_symbol functionality.
15064 * target-reloc.h (relocate_section): Update to use
15065 gold_undefined_symbol_at_location.
15066 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15067 Call gold_undefined_symbol function rather than gold_error.
15068 * errors.h (Errors::undefined_symbol): Take location as a
15069 string, rather than calculating it from a relocation.
15070 * errors.cc (Errors::fatal): Print "fatal error:" before the
15071 formatted message.
15072 (Errors::error, Errors::error_at_location): Print "error: "
15073 before the formatted message.
15074 (Errors::undefined_symbol): Take location as a string, rather
15075 than calculating it from a relocation.
15076 (gold_undefined_symbol_at_location): New function akin to
15077 old gold_undefined_symbol, calculates location from relocation.
15078 (gold_undefined_symbol): Change to take only a Symbol pointer
15079 and to report location as the file name associated with the symbol.
15080 * testsuite/debug_msg.sh: Update for changed error messages.
15081 * testsuite/undef_symbol.sh: Likewise.
15082
15083 2009-02-04 Duncan Sands <baldrick@free.fr>
15084
15085 PR 9812
15086 * reduced_debug_output.h
15087 (Output_reduced_debug_abbrev_section::failed): Use format for
15088 gold_warning.
15089 (Output_reduced_debug_info_section::faild): Likewise.
15090
15091 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15092
15093 * script.cc (Lazy_demangler): New class.
15094 (Version_script_info::get_symbol_version_helper): Demangle a
15095 symbol only once.
15096
15097 2009-01-29 Cary Coutant <ccoutant@google.com>
15098
15099 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15100 to __tls_get_addr.
15101 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15102
15103 2009-01-28 Ian Lance Taylor <iant@google.com>
15104
15105 * version.cc (version_string): Bump to 1.9.
15106
15107 * gold.h: Include <cstring> and <stdint.h>.
15108 * version.cc: Include <cstdio>.
15109 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15110 warning.
15111 * reduced_debug_output.cc (insert_into_vector): Rename from
15112 Insert_into_vector; change all callers. Use Swap_unaligned to
15113 avoid aliasing issue; remove union since it is unnecessary.
15114
15115 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15116
15117 * Makefile.am (CCFILES): Add gc.cc.
15118 (HFILES): Add gc.h.
15119 * Makefile.in: Regenerate.
15120 * gold.cc (Gc_runner): New class.
15121 (queue_initial_tasks): Call garbage collection related tasks
15122 when corresponding options are invoked.
15123 (queue_middle_gc_tasks): New function.
15124 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15125 processed early before laying out sections during garbage collection.
15126 * gold.h (queue_middle_gc_tasks): New function.
15127 (is_prefix_of): Move from "layout.cc".
15128 * i386.cc (Target_i386::gc_process_relocs): New function.
15129 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15130 * main.cc (main): Create object of class "Garbage_collection".
15131 * object.cc (Relobj::copy_symbols_data): New function.
15132 (Relobj::is_section_name_included): New function.
15133 (Sized_relobj::do_layout): Allow this function to be called twice
15134 during garbage collection and defer layout of section during the
15135 first call.
15136 * object.h (Relobj::get_symbols_data): New function.
15137 (Relobj::is_section_name_included): New function.
15138 (Relobj::copy_symbols_data): New function.
15139 (Relobj::set_symbols_data): New function.
15140 (Relobj::get_relocs_data): New function.
15141 (Relobj::set_relocs_data): New function.
15142 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15143 (Relobj::gc_process_relocs): New function.
15144 (Relobj::do_gc_process_relocs): New pure virtual function.
15145 (Relobj::sd_): New data member.
15146 (Sized_relobj::is_output_section_offset_invalid): New function.
15147 (Sized_relobj::do_gc_process_relocs): New function.
15148 * options.h (General_options::gc_sections): Modify to not be a no-op.
15149 (General_options::print_gc_sections): New option.
15150 * plugin.cc (Plugin_finish::run): Remove function call to
15151 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15152 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15153 * reloc.cc (Read_relocs::run): Add task to process relocs and
15154 determine unreferenced sections when doing garbage collection.
15155 (Gc_process_relocs): New class.
15156 (Sized_relobj::do_gc_process_relocs): New function.
15157 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15158 sections that are garbage collected.
15159 * reloc.h (Gc_process_relocs): New class.
15160 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15161 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15162 symbols whose corresponding sections are garbage collected.
15163 (Symbol_table::Symbol_table): Add new parameter for the garbage
15164 collection object.
15165 (Symbol_table::gc_mark_undef_symbols): New function.
15166 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15167 (Symbol_table::gc_mark_dyn_syms): New function.
15168 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15169 as garbage.
15170 (Symbol_table::add_from_object): Likewise.
15171 (Symbol_table::add_from_relobj): When building shared objects, do not
15172 treat externally visible symbols as garbage.
15173 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15174 table information for static and relocatable links.
15175 * symtab.h (Symbol_table::set_gc): New function.
15176 (Symbol_table::gc): New function.
15177 (Symbol_table::gc_mark_undef_symbols): New function.
15178 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15179 (Symbol_table::gc_mark_dyn_syms): New function.
15180 (Symbol_table::gc_): New data member.
15181 * target.h (Sized_target::gc_process_relocs): New pure virtual
15182 function.
15183 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15184 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15185
15186 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15187
15188 * options.h (General_options::gc_sections): Define as a no-op for now.
15189 (General_options::no_keep_memory): Ditto.
15190 (General_options::Bshareable): Define.
15191 * options.cc (General_options::finalize): Honor -Bshareable.
15192
15193 2009-01-20 Andreas Schwab <schwab@suse.de>
15194
15195 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15196 read the value in the contents, since we don't use it. Use the
15197 template endianness when writing.
15198 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15199
15200 2009-01-19 Andreas Schwab <schwab@suse.de>
15201
15202 * configure.tgt (powerpc64-*): Fix targ_obj.
15203
15204 2009-01-15 Ian Lance Taylor <iant@google.com>
15205
15206 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15207 local symbols when stripping all symbols.
15208
15209 2009-01-14 Cary Coutant <ccoutant@google.com>
15210
15211 * output.cc (Output_reloc): Add explicit instantiations.
15212
15213 2009-01-14 Cary Coutant <ccoutant@google.com>
15214
15215 * archive.cc (Archive::get_elf_object_for_member): Remove call
15216 to File_read::claim_for_plugin.
15217 * descriptors.cc (Descriptors::open): Remove reference to
15218 is_claimed.
15219 (Descriptors::claim_for_plugin): Remove.
15220 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15221 (Descriptors::is_claimed): Remove.
15222 (claim_descriptor_for_plugin): Remove.
15223 * fileread.cc (File_read::claim_for_plugin): Remove.
15224 * fileread.h (File_read::claim_for_plugin): Remove.
15225 (File_read::descriptor): Reopen descriptor if necessary.
15226 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15227 (Plugin_manager::all_symbols_read): Add task parameter. Change
15228 all callers.
15229 (Plugin_manager::get_input_file): New function.
15230 (Plugin_manager::release_input_file): New function.
15231 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15232 corresponding data member.
15233 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15234 and pass to base constructor. Change all callers.
15235 (get_input_file, release_input_file): New functions.
15236 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15237 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15238 (Plugin_manager::all_symbols_read): Add task parameter.
15239 (Plugin_manager::get_input_file): New function.
15240 (Plugin_manager::release_input_file): New function.
15241 (Plugin_manager::task_): New data member.
15242 (Pluginobj::Pluginobj): Add filesize parameter.
15243 (Pluginobj::filename): New function.
15244 (Pluginobj::descriptor): New function.
15245 (Pluginobj::filesize): New function.
15246 (Pluginobj::filesize_): New data member.
15247 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15248 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15249 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15250
15251 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15252 with archive libraries.
15253 * testsuite/Makefile.in: Regenerate.
15254 * testsuite/plugin_test.c (struct sym_info): New type.
15255 (get_input_file, release_input_file): New static variables.
15256 (onload): Capture new transfer vector entries.
15257 (claim_file_hook): Stop reading at end of file according to filesize.
15258 Factor out parsing of readelf output into separate function.
15259 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15260 APIs and get the source file name from the symbol table. Convert
15261 source file name to corresponding object file name. Print info
15262 message when adding new input files.
15263 (parse_readelf_line): New function.
15264 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15265 * testsuite/plugin_test_2.sh: Likewise.
15266 * testsuite/plugin_test_3.sh: Likewise.
15267 * testsuite/plugin_test_4.sh: New test case.
15268
15269 2009-01-07 Ian Lance Taylor <iant@google.com>
15270
15271 * version.cc (version_string): Bump to 1.8.
15272
15273 2008-12-23 Cary Coutant <ccoutant@google.com>
15274
15275 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15276 * plugin.cc (Plugin_manager::finish): Rename as
15277 layout_deferred_objects. Move cleanup to separate function.
15278 (Plugin_manager::cleanup): New function.
15279 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15280 separately.
15281 * plugin.h (Plugin_manager::finish): Rename as
15282 layout_deferred_objects.
15283 (Plugin_manager::cleanup): New function.
15284 (Plugin_manager::cleanup_done): New field.
15285
15286 2008-12-23 Cary Coutant <ccoutant@google.com>
15287
15288 * plugin.cc (is_visible_from_outside): New function.
15289 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15290 so we don't return "IR only" status for exported symbols or -r links.
15291
15292 * testsuite/Makefile.am (plugin_test_3): New test case.
15293 * testsuite/Makefile.in: Regenerate.
15294 * testsuite/plugin_test_3.sh: New file.
15295
15296 2008-12-22 Cary Coutant <ccoutant@google.com>
15297
15298 * object.cc (Sized_relobj::layout_section): New function.
15299 (Sized_relobj::do_layout): Defer layout of input sections until after
15300 plugin has provided replacement files.
15301 (Sized_relobj::do_layout_deferred_sections): New function.
15302 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15303 (Relobj::layout_deferred_sections): New function.
15304 (Relobj::do_layout_deferred_sections): New function.
15305 (Sized_relobj::do_layout_deferred_sections): New function.
15306 (Sized_relobj::layout_section): New function.
15307 (Sized_relobj::Deferred_layout): New structure.
15308 (Sized_relobj::deferred_layout_): New field.
15309 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15310 Change all callers. Layout deferred sections.
15311 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15312 references.
15313 (Plugin_hook::run): Move code from do_plugin_hook inline.
15314 (Plugin_hook::do_plugin_hook): Remove.
15315 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15316 (Plugin_manager::finish): Renamed, was cleanup.
15317 (Plugin_manager::should_defer_layout): New function.
15318 (Plugin_manager::add_deferred_layout_object): New function.
15319 (Plugin_manager::Deferred_layout_list): New type.
15320 (Plugin_manager::deferred_layout_objects_): New field.
15321 (Plugin_hook::do_plugin_hook): Remove.
15322
15323 2008-12-17 Ian Lance Taylor <iant@google.com>
15324
15325 * options.h (class General_options): Add --no case for
15326 --export-dynamic.
15327
15328 2008-12-16 Cary Coutant <ccoutant@google.com>
15329
15330 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15331 vector.
15332 (Plugin_manager::claim_file): Create plugin object even if
15333 plugin did not call the add_symbols callback.
15334 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15335 asking for more symbols than were added.
15336 * testsuite/Makefile.am (plugin_test_1): Add test case with
15337 no global symbols.
15338 (empty.syms): New target.
15339 * testsuite/Makefile.in: Regenerate.
15340 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15341 message. Don't call add_symbols if no globals.
15342 (all_symbols_read_hook): Don't provide replacement for empty
15343 claimed file.
15344
15345 2008-12-12 Ian Lance Taylor <iant@google.com>
15346
15347 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15348 r_type == 0 for a local symbol with r_sym == 0.
15349 (scan_relocatable_relocs): Pass r_sym to
15350 local_non_section_strategy.
15351 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15352 r_sym parameter.
15353
15354 * configure.ac: Update test for TLS descriptors: they are
15355 supported as of glibc 2.9.
15356 * configure: Rebuild.
15357
15358 2008-12-11 Ian Lance Taylor <iant@google.com>
15359
15360 PR 7091
15361 * target-reloc.h (Default_scan_relocatable_relocs): For each
15362 function, map r_type == 0 to RELOC_DISCARD.
15363
15364 2008-12-10 Cary Coutant <ccoutant@google.com>
15365
15366 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15367 object to override a kept COMDAT group from a plugin object.
15368
15369 2008-12-09 Ian Lance Taylor <iant@google.com>
15370
15371 PR 7088
15372 * yyscript.y (file_cmd): Handle INPUT.
15373
15374 * testsuite/initpri1.c: Change all declarations to be full
15375 prototypes by adding void, to avoid compiler warnings.
15376
15377 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15378
15379 * options.cc (General_options::parse_plugin_opt): New.
15380 (General_options::add_plugin): The argument now is just the filename.
15381 (General_options::add_plugin_option): New.
15382 * options.h (plugin_opt): New.
15383 (add_plugin): Change argument name.
15384 (add_plugin_option): New.
15385 * plugin.cc (Plugin::load): Don't parse the plugin option.
15386 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15387 (Plugin::add_option): New.
15388 (Plugin::args_): Change type.
15389 (Plugin::filename_): New.
15390 (Plugin_manager::add_plugin_option): New.
15391 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15392 * testsuite/Makefile.in: Regenerate.
15393
15394 2008-12-05 Cary Coutant <ccoutant@google.com>
15395
15396 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15397 Handle --strip-lto-sections option.
15398 * options.h (strip_lto_sections): New option.
15399
15400 2008-12-01 Cary Coutant <ccoutant@google.com>
15401
15402 * plugin.cc (ld_plugin_message): Change format parameter to const.
15403 Fix mismatch between new[] and delete.
15404
15405 2008-11-14 Cary Coutant <ccoutant@google.com>
15406
15407 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15408 instead of -1U.
15409
15410 2008-11-05 Craig Silverstein <csilvers@google.com>
15411
15412 * options.cc (General_options::parse_dynamic_list): New function.
15413 * options.h (General_options): New flags dynamic_list,
15414 dynamic_list_data, dynamic_list_cpp_new, and
15415 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15416 (General_options::in_dynamic_list): New function.
15417 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15418 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15419 (Lex::can_continue_name): Likewise.
15420 (yylex): Likewise.
15421 (read_script_file): New parameter script_options.
15422 (read_dynamic_list): New function.
15423 (Script_options::define_dynamic_list): New function.
15424 (dynamic_list_keyword_parsecodes): New variable.
15425 (dynamic_list_keywords): New variable.
15426 * script.h (Script_options::define_dynamic_list): New function
15427 prototype.
15428 (read_dynamic_list): New function prototype.
15429 * symtab.cc (strprefix): New macro.
15430 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15431 dynamic_list_data, dynamic_list_cpp_new, and
15432 dynamic_list_cpp_typeinfo.
15433 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15434 (dynamic_list_expr): New rule.
15435 (dynamic_list_nodes): Likewise.
15436 (dynamic_list_node): Likewise.
15437 * testsuite/Makefile.am (dynamic_list): New test.
15438 * testsuite/Makefile.in: Regenerated.
15439 * testsuite/dynamic_list.t: New file.
15440 * testsuite/dynamic_list.sh: New file.
15441
15442 2008-11-05 Craig Silverstein <csilvers@google.com>
15443
15444 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15445 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15446 (t11_last): Likewise.
15447 * testsuite/ver_test_6.c (main): Likewise.
15448
15449 2008-10-07 Cary Coutant <ccoutant@google.com>
15450
15451 * options.c (General_options::finalize): Add check for -static and
15452 -shared.
15453 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15454 is not empty.
15455
15456 2008-10-02 Cary Coutant <ccoutant@google.com>
15457
15458 * plugin.cc (make_sized_plugin_object): Fix conditional
15459 compilation to work when not all targets are enabled.
15460
15461 2008-09-29 Cary Coutant <ccoutant@google.com>
15462
15463 * archive.cc (Archive::get_file_and_offset): Use filename instead
15464 of name to get library path.
15465 (Archive::include_member): Unlock external member of a thin archive.
15466
15467 * testsuite/Makefile.am (TEST_AR): New variable.
15468 (thin_archive_test_1): New test.
15469 (thin_archive_test_2): New test.
15470 * testsuite/Makefile.in: Regenerate.
15471 * testsuite/thin_archive_main.cc: New file.
15472 * testsuite/thin_archive_test_1.cc: New file.
15473 * testsuite/thin_archive_test_2.cc: New file.
15474 * testsuite/thin_archive_test_3.cc: New file.
15475 * testsuite/thin_archive_test_4.cc: New file.
15476
15477 2008-09-29 Cary Coutant <ccoutant@google.com>
15478
15479 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15480 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15481 instead of -1U.
15482 (Sized_relobj::do_finalize_local_symbols): Likewise.
15483 (Sized_relobj::map_to_kept_section): Likewise.
15484 * object.h (Sized_relobj::invalid_address): New constant.
15485 (Sized_relobj::do_output_section_offset): Check for invalid_address
15486 and return -1ULL.
15487 * output.cc (Output_reloc::local_section_offset): Use constant
15488 invalid_address instead of -1U.
15489 (Output_reloc::get_address): Likewise.
15490 (Output_section::output_address): Change -1U to -1ULL.
15491 * output.h (Output_reloc::invalid_address): New constant.
15492 * reloc.cc (Sized_relobj::write_sections): Use constant
15493 invalid_address instead of -1U.
15494 (Sized_relobj::relocate_sections): Likewise.
15495 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15496 values for merge sections.
15497 * target-reloc.h (relocate_for_relocatable): Use constant
15498 invalid_address instead of -1U.
15499
15500 2008-09-19 Cary Coutant <ccoutant@google.com>
15501
15502 Add plugin functionality for link-time optimization (LTO).
15503 * configure.ac (plugins): Add --enable-plugins option.
15504 * configure: Regenerate.
15505 * config.in: Regenerate.
15506 * Makefile.am (LIBDL): New variable.
15507 (CCFILES): Add plugin.cc.
15508 (HFILES): Add plugin.h.
15509 (ldadd_var): Add LIBDL.
15510 * Makefile.in: Regenerate.
15511
15512 * archive.cc: Include "plugin.h".
15513 (Archive::setup): Don't preread archive symbols when using a plugin.
15514 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15515 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15516 files.
15517 (Archive::include_member): Add symbols from plugin objects.
15518 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15519 * descriptors.cc (Descriptors::open): Check for file descriptors
15520 abandoned by plugins.
15521 (Descriptors::claim_for_plugin): New function.
15522 * descriptors.h (Descriptors::claim_for_plugin): New function.
15523 (Open_descriptor::is_claimed): New field.
15524 (claim_descriptor_for_plugin): New function.
15525 * fileread.cc (File_read::claim_for_plugin): New function.
15526 * fileread.h (File_read::claim_for_plugin): New function.
15527 (File_read::descriptor): New function.
15528 * gold.cc: Include "plugin.h".
15529 (queue_initial_tasks): Add task to call plugin hooks for generating
15530 new object files.
15531 * main.cc: Include "plugin.h".
15532 (main): Load plugin libraries.
15533 * object.h (Pluginobj): Declare.
15534 (Object::pluginobj): New function.
15535 (Object::do_pluginobj): New function.
15536 (Object::set_target): New function.
15537 * options.cc: Include "plugin.h".
15538 (General_options::parse_plugin): New function.
15539 (General_options::General_options): Initialize plugins_ field.
15540 (General_options::add_plugin): New function.
15541 * options.h (Plugin_manager): Declare.
15542 (General_options): Add --plugin option.
15543 (General_options::has_plugins): New function.
15544 (General_options::plugins): New function.
15545 (General_options::add_plugin): New function.
15546 (General_options::plugins_): New field.
15547 * plugin.cc: New file.
15548 * plugin.h: New file.
15549 * readsyms.cc: Include "plugin.h".
15550 (Read_symbols::do_read_symbols): Check for archive before checking
15551 for ELF file. Call plugin hooks to claim files.
15552 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15553 from a real object file; force override when processing replacement
15554 files.
15555 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15556 (Symbol::init_base_object): Likewise.
15557 (Symbol::init_base_output_data): Likewise.
15558 (Symbol::init_base_output_segment): Likewise.
15559 (Symbol::init_base_constant): Likewise.
15560 (Symbol::init_base_undefined): Likewise.
15561 (Symbol::output_section): Assert that object is not a plugin.
15562 (Symbol_table::add_from_pluginobj): New function.
15563 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15564 undefined.
15565 (Symbol_table::sized_write_globals): Likewise.
15566 (Symbol_table::add_from_pluginobj): Instantiate template.
15567 * symtab.h (Sized_pluginobj): Declare.
15568 (Symbol::in_real_elf): New function.
15569 (Symbol::set_in_real_elf): New function.
15570 (Symbol::in_real_elf_): New field.
15571 (Symbol_table::add_from_pluginobj): New function.
15572
15573 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15574 (LIBDL): New variable.
15575 (LDADD): Add LIBDL.
15576 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15577 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15578 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15579 (MOSTLYCLEANFILES): Likewise.
15580 * testsuite/Makefile.in: Regenerate.
15581 * testsuite/plugin_test.c: New file.
15582 * testsuite/plugin_test_1.sh: New file.
15583 * testsuite/plugin_test_2.sh: New file.
15584
15585 2008-09-16 Ian Lance Taylor <iant@google.com>
15586
15587 * target-reloc.h (relocate_section): Check whether a symbol is
15588 defined by the ABI before reporting an undefined symbol error.
15589 * target.h (Target::is_defined_by_abi): Make parameter const.
15590 (Target::do_is_defined_by_abi): Likewise.
15591 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15592 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15593 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15594 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15595 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15596 * testsuite/Makefile.in: Rebuild.
15597
15598 * fileread.cc (make_view): Add casts to avoid warning.
15599
15600 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15601
15602 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15603 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15604
15605 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15606
15607 * options.h (General_options::output_is_executable): New.
15608 (General_options::output_is_pie): New.
15609 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15610 for shared libraries.
15611 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15612
15613 2008-09-11 Chris Demetriou <cgd@google.com>
15614
15615 * options.h (origin): New -z option.
15616 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15617 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15618 in DT_FLAGS_1.
15619
15620 2008-09-05 Cary Coutant <ccoutant@google.com>
15621
15622 * fileread.cc (File_read::make_view): Add check for attempt to map
15623 beyond end of file.
15624
15625 2008-09-05 Cary Coutant <ccoutant@google.com>
15626
15627 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15628 explicit instantiations.
15629
15630 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15631
15632 PR gold/6858
15633 * options.cc (General_options::finalize): Allow undefined symbols
15634 in shlibs if linking -shared.
15635
15636 PR gold/6859
15637 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15638 symbols as not needing a dynsym entry.
15639
15640 2008-08-20 Craig Silverstein <csilvers@google.com>
15641
15642 * fileread.cc (File_read::open): Do not lock the file unless it
15643 was successfully opened.
15644
15645 2008-08-14 Cary Coutant <ccoutant@google.com>
15646
15647 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15648 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15649 * testsuite/tls_test.cc (struct int128): 128-bit struct
15650 for testing TLS relocs with non-zero addend.
15651 (v12): New TLS variable.
15652 (t12): New test.
15653 (t_last): Add check for v12.
15654 * testsuite/tls_test.h (t12): New function.
15655 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15656
15657 2008-08-13 Ian Lance Taylor <iant@google.com>
15658
15659 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15660 set tls_segment_ or relro_segment_.
15661 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15662 when appropriate.
15663 * output.h (Output_section::clear_is_relro): New function.
15664 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15665 sections specially even when output_data_ is empty.
15666 (Output_segment::maximum_alignment): When first section is relro,
15667 only force alignment for PT_LOAD segments.
15668 * script.cc (script_data_segment_align): New function.
15669 (script_data_segment_relro_end): New function.
15670 * script-c.h (script_data_segment_align): Declare.
15671 (script_data_segment_relro_end): Declare.
15672 * script-sections.h (class Script_sections): Declare
15673 data_segment_align and data_segment_relro_end. Add fields
15674 segment_align_index_ and saw_relro_end_.
15675 * script-sections.cc (class Sections_element): Add set_is_relro
15676 virtual function. Add new bool* parameter to place_orphan_here.
15677 Add get_output_section virtual function.
15678 (class Output_section_definition): Add set_is_relro. Add new
15679 bool* parameter to place_orphan_here. Add get_output_section.
15680 Add is_relro_ field.
15681 (Output_section_definition::Output_section_definition): Initialize
15682 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15683 and is_relro_ fields.
15684 (Output_section_definition::place_orphan_here): Add is_relro
15685 parameter.
15686 (Output_section_definition::set_section_addresses): Set relro for
15687 output section.
15688 (Output_section_definition::alternate_constraint): Likewise.
15689 (class Orphan_output_section): Add new bool* parameter to
15690 place_orphan_here. Add get_output_section.
15691 (Orphan_output_section::place_orphan_here): Add is_relro
15692 parameter.
15693 (Script_sections::Script_sections): Initialize
15694 data_segment_align_index_ and saw_relro_end_.
15695 (Script_sections::data_segment_align): New function.
15696 (Script_sections::data_segment_relro_end): New function.
15697 (Script_sections::place_orphan): Set or clear is_relro.
15698 (Script_sections::set_section_addresses): Force alignment of first
15699 TLS section.
15700 * yyscript.y (exp): Call script_data_segment_align and
15701 script_data_segment_relro_end.
15702 * testsuite/relro_script_test.t: New file.
15703 * testsuite/relro_test.cc (using_script): Declare.
15704 (t1, t2): Test using_script.
15705 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15706 (relro_script_test_SOURCES): Define.
15707 (relro_script_test_DEPENDENCIES): Define.
15708 (relro_script_test_LDFLAGS): Define.
15709 (relro_script_test_LDADD): Define.
15710 (relro_script_test.so): New target.
15711 * testsuite/Makefile.in: Rebuild.
15712
15713 2008-08-06 Cary Coutant <ccoutant@google.com>
15714
15715 * archive.cc (Archive::total_archives, Archive::total_members)
15716 (Archive::total_members_loaded): New variables.
15717 (Archive::setup): Add parameter. Add option to preread
15718 archive symbols.
15719 (Archive::read_armap): Add counter.
15720 (Archive::get_file_and_offset): New function.
15721 (Archive::get_elf_object_for_member): New function.
15722 (Archive::read_all_symbols): New function.
15723 (Archive::read_symbols): New function.
15724 (Archive::add_symbols): Add counters.
15725 (Archive::include_all_members): Use armap to find members if it's
15726 already built.
15727 (Archive::include_member): Skip reading symbols if already read.
15728 Factored code into Archive::get_file_and_offset and
15729 Archive::get_elf_object_for_member. Changed call to
15730 Mapfile::report_include_archive_member.
15731 (Archive::print_stats): New function.
15732 * archive.h: Declare Object and Read_symbols_data classes.
15733 (Archive::Archive): Add initializers for new members.
15734 (Archive::setup): Add parameter.
15735 (Archive::print_stats): New function.
15736 (Archive::total_archives, Archive::total_members)
15737 (Archive::total_members_loaded): New variables.
15738 (Archive::get_file_and_offset): New function.
15739 (Archive::get_elf_object_for_member): New function.
15740 (Archive::read_all_symbols): New function.
15741 (Archive::read_symbols): New function.
15742 (Archive::Archive_member): New class.
15743 (Archive::members_): New member.
15744 (Archive::num_members_): New member.
15745 * main.cc: Include archive.h.
15746 (main): Call Archive::print_stats.
15747 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15748 archive parameter; member_name is now the fully-decorated name.
15749 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15750 * options.h: (General_options): Add --preread-archive-symbols option.
15751 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15752 Archive::setup.
15753
15754 2008-08-04 Ian Lance Taylor <iant@google.com>
15755
15756 * symtab.h (Symbol::use_plt_offset): New function.
15757 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15758 * powerpc.cc (Relocate::relocate): Likewise.
15759 * sparc.cc (Relocate::relocate): Likewise.
15760 * x86_64.cc (Relocate::relocate): Likewise.
15761 * testsuite/weak_plt.sh: New test.
15762 * testsuite/weak_plt_main.cc: New test.
15763 * testsuite/weak_plt_shared.cc: New test.
15764 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15765 (check_PROGRAMS): Add weak_plt.
15766 (check_DATA): Add weak_plt_shared.so.
15767 (weak_plt_main_pic.o, weak_plt): New targets.
15768 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15769 * testsuite/Makefile.in: Rebuild.
15770
15771 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15772 gcctestdir/ld.
15773 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15774 * testsuite/Makefile.in: Rebuild.
15775
15776 2008-08-04 Alan Modra <amodra@bigpond.net.au>
15777
15778 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15779 * Makefile.in: Regenerate.
15780 * po/POTFILES.in: Regenerate.
15781
15782 2008-07-29 Ian Lance Taylor <iant@google.com>
15783
15784 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15785 symbols before other symbols.
15786 * testsuite/script_test_2.cc (test_addr): Declare.
15787 (test_addr_alias): Declare.
15788 (main): Check that test_addr and test_addr_alias have the right
15789 values.
15790 * testsuite/script_test_2.t: Define test_addr_alias and
15791 test_addr.
15792
15793 2008-07-24 Ian Lance Taylor <iant@google.com>
15794
15795 PR 5990
15796 * descriptors.cc: New file.
15797 * descriptors.h: New file.
15798 * gold-threads.h (class Hold_optional_lock): New class.
15799 * fileread.cc: Include "descriptors.h".
15800 (File_read::~File_read): Release descriptor rather than closing
15801 it.
15802 (File_read::open) [file]: Call open_descriptor rather than open.
15803 Set is_descriptor_opened_.
15804 (File_read::open) [memory]: Assert that descriptor is not open.
15805 (File_read::reopen_descriptor): New function.
15806 (File_read::release): Release descriptor.
15807 (File_read::do_read): Make non-const. Reopen descriptor.
15808 (File_read::read): Make non-const.
15809 (File_read::make_view): Reopen descriptor.
15810 (File_read::do_readv): Likewise.
15811 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15812 Update declarations.
15813 * layout.cc: Include "descriptors.h".
15814 (Layout::create_build_id): Use open_descriptor rather than open.
15815 * output.cc: Include "descriptors.h".
15816 (Output_file::open): Use open_descriptor rather than open.
15817 * archive.cc (Archive::const_iterator): Change Archive to be
15818 non-const.
15819 (Archive::begin, Archive::end): Make non-const.
15820 (Archive::count_members): Likewise.
15821 * archive.h (class Archive): Update declarations.
15822 * object.h (Object::read): Make non-const.
15823 * Makefile.am (CCFILES): Add descriptors.cc.
15824 (HFILES): Add descriptors.h.
15825 * Makefile.in: Rebuild.
15826
15827 PR 6716
15828 * gold.h: Always include <clocale>. Add Solaris workarounds
15829 following code in binutils/sysdep.h.
15830
15831 PR 6048
15832 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15833 this->eh_frame_hdr_ is NULL before using it.
15834
15835 * dynobj.cc (Versions::Versions): Update comment.
15836
15837 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15838 the base version name.
15839
15840 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15841 array size plus one.
15842 (Stringpool_template::set_string_offsets): Subtract one from key
15843 before using it as an array index.
15844 (Stringpool_template::get_offset_with_length): Likewise.
15845 (Stringpool_template::write_to_buffer): Likewise.
15846 * stringpool.h (Stringpool_template::get_offset_from_key):
15847 Likewise.
15848
15849 2008-07-23 Ian Lance Taylor <iant@google.com>
15850
15851 PR 6658
15852 * object.h (Merged_symbol_value::value): Do our best to handle a
15853 negative addend.
15854
15855 PR 6647
15856 * script.cc (Version_script_info::get_versions): Don't add empty
15857 version tag to return value.
15858 (Version_script_info::get_symbol_version_helper): Change return
15859 type to bool. Add pversion parameter. Change all callers.
15860 (script_register_vers_node): Don't require a non-NULL tag.
15861 * script.h (class Version_script_info): Update declarations.
15862 (Version_script_info::get_symbol_version): Change return type to
15863 bool. Add version parameter. Change all callers.
15864 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15865 handling. Handle an empty version from a version script.
15866 (Symbol_table::define_special_symbol): Likewise.
15867 * testsuite/ver_test_10.script: New file.
15868 * testsuite/ver_test_10.sh: New file.
15869 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15870 (check_DATA): Add ver_test_10.syms.
15871 (ver_test_10.syms, ver_test_10.so): New target.
15872 * testsuite/Makefile.in: Rebuild.
15873
15874 2008-07-23 Simon Baldwin <simonb@google.com>
15875
15876 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15877 to zero for undefined symbols from dynamic libraries.
15878
15879 2008-07-23 Ian Lance Taylor <iant@google.com>
15880
15881 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15882 Change all callers.
15883 * symtab.h (class Symbol_table): Update declaration.
15884 * testsuite/ver_test_9.cc: New file.
15885 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15886 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15887 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15888 (ver_test_9.so, ver_test_9.o): New targets.
15889 * testsuite/Makefile.in: Rebuild.
15890
15891 2008-07-22 Ian Lance Taylor <iant@google.com>
15892
15893 * options.h (class General_options): Define --check-sections.
15894 * layout.cc (Layout::set_segment_offsets): Handle
15895 --check-sections.
15896
15897 * options.h (class General_options): Define -n/--nmagic and
15898 -N/--omagic.
15899 * options.cc (General_options::finalize): For -n/--nmagic or
15900 -N/--omagic, set -static.
15901 * layout.cc (Layout::attach_allocated_section_to_segment): If
15902 -N/--omagic, don't put read-only and read-write sections in
15903 different segments.
15904 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15905 finding a read-only segment.
15906 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15907 don't set the minimum segment alignment to the common page size,
15908 and don't set the file offset to the address modulo the page size.
15909 * script-sections.cc (Script_sections::create_segments): If
15910 -n/--omagic, don't put read-only and read-write sections in
15911 different segments.
15912
15913 * cref.cc: New file.
15914 * cref.h: New file.
15915 * options.h (class General_options): Add --print-symbol-counts.
15916 * main.cc (main): Issue defined symbol report if requested.
15917 * archive.cc (Archive::interpret_header): Make into a const member
15918 function.
15919 (Archive::add_symbols): Call Input_objects::archive_start and
15920 archive_stop.
15921 (Archive::const_iterator): Define new class.
15922 (Archive::begin, Archive::end): New functions.
15923 (Archive::include_all_members): Rewrite to use iterator.
15924 (Archive::count_members): New function.
15925 * archive.h (class Archive): Update declarations.
15926 (Archive::filename): New function.
15927 * object.cc: Include "cref.h".
15928 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15929 (Sized_relobj::do_get_global_symbol_counts): New function.
15930 (Input_objects::add_object): Add object to cross-referencer.
15931 (Input_objects::archive_start): New function.
15932 (Input_objects::archive_stop): New function.
15933 (Input_objects::print_symbol_counts): New function.
15934 * object.h: Declare Cref and Archive.
15935 (Object::get_global_symbol_counts): New function.
15936 (Object::do_get_global_symbol_counts): New pure virtual function.
15937 (class Sized_relobj): Add defined_count_ field. Update
15938 declarations.
15939 (class Input_objects): Add cref_ field. Update constructor.
15940 Update declarations.
15941 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15942 defined_count_.
15943 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15944 symbol counts.
15945 (Sized_dynobj::do_get_global_symbol_counts): New function.
15946 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15947 defined_count_. Update declarations. Define Symbols typedef.
15948 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15949 parameter. Change all callers.
15950 (Symbol_table::add_from_dynobj): Add sympointers and defined
15951 parameters. Change all callers.
15952 * symtab.h (class Symbol_table): Update declarations.
15953 * Makefile.am (CCFILES): Add cref.cc.
15954 (HFILES): Add cref.h.
15955 * Makefile.in: Rebuild.
15956
15957 2008-07-22 Simon Baldwin <simonb@google.com>
15958
15959 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15960 to zero when writing undefined symbols.
15961
15962 2008-07-22 Ian Lance Taylor <iant@google.com>
15963
15964 * output.cc (Output_section::add_input_section): Don't try to
15965 merge empty merge sections.
15966
15967 2008-07-21 Craig Silverstein <csilvers@google.com>
15968
15969 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15970 Include symbol version in error message.
15971
15972 2008-07-20 Chris Demetriou <cgd@google.com>
15973
15974 * configure.ac (gold_cv_c_random_seed): New configured variable.
15975 (RANDOM_SEED_CFLAGS): New substituted variable.
15976 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15977 * configure: Rebuild.
15978 * Makefile.in: Likewise.
15979 * testsuite/Makefile.in: Likewise.
15980
15981 2008-07-18 Ian Lance Taylor <iant@google.com>
15982
15983 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15984 where we see NAME/NULL and NAME/VERSION as separate symbols.
15985 * testsuite/ver_test_main.cc (main): Call t4.
15986 (t4, t4_2a): Define.
15987 * testsuite/ver_test_2.cc (t4_2): Define.
15988 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15989 * testsuite/ver_test_4.cc (t4_2a): Define.
15990 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15991 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15992
15993 2008-07-17 Ian Lance Taylor <iant@google.com>
15994
15995 * dynobj.cc (Versions::add_def): If we give an error about a
15996 missing version, go ahead and create the version anyhow.
15997
15998 2008-07-10 Ian Lance Taylor <iant@google.com>
15999
16000 Handle output sections with more than 0x7fffffff bytes.
16001 * object.h (class Relobj): Change map_to_output_ to
16002 output_sections_, and just keep a section pointer. Change all
16003 uses. Move comdat group support to Sized_relobj.
16004 (Relobj::is_section_specially_mapped): Remove.
16005 (Relobj::output_section): Remove poff parameter. Change all
16006 callers.
16007 (Relobj::output_section_offset): New function.
16008 (Relobj::set_section_offset): Rewrite.
16009 (Relobj::map_to_output): Remove.
16010 (Relobj::output_sections): New function.
16011 (Relobj::do_output_section_offset): New pure virtual function.
16012 (Relobj::do_set_section_offset): Likewise.
16013 (class Sized_relobj): Add section_offsets_ field. Add comdat
16014 group support from Relobj. Update declarations.
16015 (Sized_relobj::get_output_section_offset): New function.
16016 (Sized_relobj::do_output_section_offset): New function.
16017 (Sized_relobj::do_set_section_offset): New function.
16018 * object.cc (Relobj::output_section_address): Remove.
16019 (Sized_relobj::Sized_relobj): Initialize new fields.
16020 (Sized_relobj::include_section_group): Cast find_kept_object to
16021 Sized_relobj.
16022 (Sized_relobj::include_linkonce_section): Likewise.
16023 (Sized_relobj::do_layout): Use separate arrays for output section
16024 and output offset.
16025 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16026 output_sections.
16027 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16028 output_sections and section_offsets.
16029 (Sized_relobj::write_local_symbols): Likewise.
16030 (map_to_kept_section): Compute output address directly.
16031 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16032 output_sections and section_offsets.
16033 (Sized_relobj::write_sections): Likewise.
16034 (Sized_relobj::relocate_sections): Likewise.
16035 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16036 * output.h (class Output_reloc): Update declarations. Change
16037 u2_.relobj to Sized_relobj*.
16038 (class Output_data_reloc): Change add functions to use
16039 Sized_relobj*.
16040 * output.cc (Output_reloc::Output_reloc): Change relobj to
16041 Sized_relobj*.
16042 (Output_reloc::local_section_offset): Change return type to
16043 Elf_Addr. Use get_output_section_offset.
16044 (Output_reloc::get_address): Likewise.
16045 (Output_section::is_input_address_mapped): Don't call
16046 is_section_specially_mapped.
16047 (Output_section::output_offset): Likewise.
16048 (Output_section::output_address): Likewise.
16049 (Output_section::starting_output_address): Likewise.
16050 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16051 parameter to Sized_relobj*.
16052 (Copy_relocs::need_copy_reloc): Likewise.
16053 (Copy_relocs::save): Likewise.
16054 * copy-relocs.h (class Copy_relocs): Update declarations.
16055 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16056 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16057 * target-reloc.h (relocate_for_relocatable): Change
16058 offset_in_output_section type to Elf_Addr. Change code that uses
16059 it as well.
16060 * layout.cc (Layout::layout): Always set *off.
16061 * mapfile.cc (Mapfile::print_input_section): Use
16062 output_section_offset.
16063 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16064 Sized_relobj*.
16065 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16066 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16067 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16068
16069 2008-07-03 Ian Lance Taylor <iant@google.com>
16070
16071 * layout.cc (Layout::include_section): Do not discard unrecognized
16072 SHT_STRTAB sections.
16073
16074 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16075
16076 * script.cc (Lex::can_continue_name): Make '?' allowable in
16077 version-script names.
16078 * testsuite/version_script.map: Change glob pattern to use '?'
16079
16080 2008-06-30 Manish Singh <yosh@gimp.org>
16081
16082 PR 6585
16083 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16084 Correct typo.
16085
16086 2008-06-30 Ian Lance Taylor <iant@google.com>
16087
16088 PR 6660
16089 PR 6682
16090 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16091 versions]: Don't try to read the value in the contents, since we
16092 don't use it. Use the template endianness when writing.
16093
16094 2008-06-25 Cary Coutant <ccoutant@google.com>
16095
16096 * fileread.cc (File_read::make_view): Assert on zero-length view.
16097 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16098 symbol table when there are no symbols to read.
16099
16100 2008-06-23 Craig Silverstein <csilvers@google.com>
16101
16102 * version.cc (version_string): Bump to 1.7
16103
16104 2008-06-18 Craig Silverstein <csilvers@google.com>
16105
16106 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16107 constant 0xFFFF to type Valtype.
16108 (Powerpc_relocate_functions::rel16_ha): Likewise.
16109
16110 2008-06-17 Ian Lance Taylor <iant@google.com>
16111
16112 * output.h (Output_section::Input_section): Initialize p2align_ to
16113 zero for Output_section_data constructors.
16114 (Output_section::Input_section::addralign): If not an input
16115 section, return the alignment of the Output_section_data.
16116 * testsuite/copy_test.cc: New file.
16117 * testsuite/copy_test_1.cc: New file.
16118 * testsuite/copy_test_2.cc: New file.
16119 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16120 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16121 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16122 (copy_test_1_pic.o, copy_test_1.so): New targets.
16123 (copy_test_2_pic.o, copy_test_2.so): New targets.
16124 * testsuite/Makefile.in: Rebuild.
16125
16126 * script-sections.cc (Script_sections::place_orphan): Initialize
16127 local variable exact.
16128
16129 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16130
16131 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16132
16133 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16134 David S. Miller <davem@davemloft.net>
16135
16136 * powerpc.cc: New file.
16137 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16138 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16139 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16140 * Makefile.in: Rebuild.
16141
16142 2008-06-09 Ian Lance Taylor <iant@google.com>
16143
16144 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16145 <exception>.
16146 (throwing, orig_terminate): New static variables.
16147 (terminate_handler): New static function.
16148 (t2): Set terminate handler.
16149
16150 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16151
16152 PR 6584
16153 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16154 alignment.
16155
16156 2008-05-30 Cary Coutant <ccoutant@google.com>
16157
16158 * archive.cc (Archive::include_all_members) Correct to step
16159 over symbol table and extended name table in thin archives.
16160
16161 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16162
16163 PR 6407
16164 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16165 calculation.
16166
16167 2008-05-28 Caleb Howe <cshowe@google.com>
16168
16169 * reduced_debug_output.cc: New file.
16170 * reduced_debug_output.h: New file.
16171 * options.h (class General_options): Add --strip-debug-non-line.
16172 * options.cc (General_options::finalize): Add strip_debug_non_line
16173 to the strip heirarchy.
16174 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16175 fields.
16176 * layout.cc: Include "reduced_debug_output.h".
16177 (Layout::Layout): Initialize new fields.
16178 (line_only_debug_sections): New static array.
16179 (is_lines_only_debug_sections): New static inline function.
16180 (Layout::include_section): Handle --strip-debug-non-line.
16181 (Layout::make_output_section): If --strip-debug-non-line, build
16182 new output sections for .debug_abbrev and .debug_info.
16183 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16184 gold. Warn about possible overflow.
16185 (read_signed_LEB_128): Likewise.
16186 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16187 (read_signed_LEB_128): Declare.
16188 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16189 (HFILES): Add reduced_debug_output.h.
16190 * Makefile.in: Rebuild.
16191
16192 2008-05-21 Ian Lance Taylor <iant@google.com>
16193
16194 * mapfile.cc: New file.
16195 * mapfile.h: New file.
16196 * options.h (class General_options): Add -M/--print-map and -Map.
16197 * options.cc (General_options::finalize): Make -M equivalent to
16198 -Map -.
16199 * main.cc: Include <cstdio> and "mapfile.h".
16200 (main): Open mapfile if requested.
16201 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16202 constructor. Change caller.
16203 (queue_initial_tasks): Add mapfile parameter. Change caller.
16204 (queue_middle_tasks): Likewise.
16205 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16206 declarations.
16207 * archive.cc: Include "mapfile.h".
16208 (Archive::add_symbols): Add mapfile parameter. Change all
16209 callers. Pass mapfile, symbol, and reason to include_member.
16210 (Archive::include_all_members): Add mapfile parameter. Change all
16211 callers.
16212 (Archive::include_member): Add mapfile, sym, and why parameters.
16213 Change all callers. Report inclusion to map file.
16214 * archive.h: Include "fileread.h".
16215 (class Archive): Update declarations.
16216 (Archive::file): New const method.
16217 (class Add_archive_symbols): Add mapfile_ field. Update
16218 constructor. Change all callers.
16219 * readsyms.h (class Read_symbols): Likewise.
16220 (class Finish_group): Likewise.
16221 (class Read_script): Likewise.
16222 * common.cc: Include "mapfile.h".
16223 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16224 all callers.
16225 (Symbol_table::do_allocate_commons): Likewise.
16226 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16227 symbol allocation to mapfile.
16228 * common.h (class Allocate_commons_task): Add mapfile_ field.
16229 Update constructor. Change all callers.
16230 * symtab.h (class Symbol_table): Update declarations.
16231 * layout.cc: Include "mapfile.h".
16232 (Layout_task_runner::run): Print information to mapfile.
16233 (Layout::create_gold_note): Change Output_data_fixed_space to
16234 Output_data_zero_fill.
16235 (Layout::create_build_id): Likewise.
16236 (Layout::print_to_mapfile): New function.
16237 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16238 constructor. Change caller.
16239 (class Layout): Declare print_to_mapfile.
16240 * output.cc (Output_section::Input_section::print_to_mapfile): New
16241 function.
16242 (Output_section::add_input_section): If producing a map, always
16243 add to input_sections_ list.
16244 (Output_section::do_print_to_mapfile): New function.
16245 (Output_segment::print_sections_to_mapfile): New function.
16246 (Output_segment::print_section_list_to_mapfile): New function.
16247 * output.h: Include "mapfile.h".
16248 (Output_data::print_to_mapfile): New function.
16249 (Output_data::do_print_to_mapfile): New virtual function.
16250 (Output_segment_headers::do_print_to_mapfile): New function.
16251 (Output_file_header::do_print_to_mapfile): New function.
16252 (Output_data_const::do_print_to_mapfile): New function.
16253 (class Output_data_const_buffer): Add map_name_ field. Update
16254 constructor. Change all callers. Add do_print_to_mapfile
16255 function.
16256 (class Output_data_fixed_space): Likewise.
16257 (class Output_data_space): Likewise.
16258 (class Output_data_zero_fill): New class.
16259 (Output_data_strtab::do_print_to_mapfile): New function.
16260 (Output_data_reloc_base::do_print_to_mapfile): New function.
16261 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16262 (Output_data_group::do_print_to_mapfile): New function.
16263 (Output_data_got::do_print_to_mapfile): New function.
16264 (Output_data_dynamic::do_print_to_mapfile): New function.
16265 (Output_symtab_xindex::do_print_to_mapfile): New function.
16266 (class Output_section): Declare do_print_to_mapflie. Declare
16267 print_to_mapfile in Input_section.
16268 (class Output_segment): Declare new functions.
16269 * object.h (Sized_relobj::symbol_count): New function.
16270 * script-sections.cc
16271 (Output_section_element_dot_assignment::set_section_addresses):
16272 Change Output_data_fixed_space to Output_data_zero_fill.
16273 (Output_data_expression::do_print_to_mapfile): New function.
16274 * script.cc (read_input_script): Add mapfile parameter. Change
16275 all callers.
16276 * script.h (read_input_script): Update declaration.
16277 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16278 (Eh_frame::do_print_to_mapfile): New function.
16279 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16280 (Output_merge_string::do_print_to_mapfile): New function.
16281 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16282 function.
16283 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16284 function.
16285 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16286 function.
16287 * Makefile.am (CCFILES): Add mapfile.cc.
16288 (HFILES): Add mapfile.h.
16289 * Makefile.in: Rebuild.
16290
16291 2008-05-19 Ian Lance Taylor <iant@google.com>
16292
16293 * options.h (class General_options): Add -z relro.
16294 * layout.cc (Layout::Layout): Initialize relro_segment_.
16295 (Layout::add_output_section_data): Return the output section.
16296 (Layout::make_output_section): Rcognize relro sections and mark
16297 them appropriately.
16298 (Layout::attach_allocated_section_to_segment): Put relro sections
16299 in a PT_GNU_RELRO segment.
16300 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16301 section as relro.
16302 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16303 PT_TLS segments.
16304 (Layout::linkonce_mapping): Map d.rel.ro.local to
16305 .data.rel.ro.local.
16306 (Layout::output_section_name): Us .data.rel.ro.local for any
16307 section which begins with that.
16308 * layout.h (class Layout): Update add_output_section_data
16309 declaration. Add relro_segment_ field.
16310 * output.cc (Output_section::Output_section): Initialize is_relro_
16311 and is_relro_local_ fields.
16312 (Output_segment::add_output_section): Group relro sections.
16313 (Output_segment::is_first_section_relro): New function.
16314 (Output_segment::maximum_alignment): If there is a relro section,
16315 align the segment to the common page size.
16316 (Output_segment::set_section_addresses): Track whether we are
16317 looking at relro sections. If the last section is a relro
16318 section, align to the common page size.
16319 (Output_segment::set_section_list_addresses): Add in_relro
16320 parameter. Change all callers. Align to the page size when
16321 moving from relro to non-relro section.
16322 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16323 segment.
16324 * output.h (class Output_section): Add is_relro_ and
16325 is_relro_local_ fields.
16326 (Output_section::is_relro): New function.
16327 (Output_section::set_is_relro): New function.
16328 (Output_section::is_relro_local): New function.
16329 (Output_section::set_is_relro_local): New function.
16330 (class Output_segment): Update declarations.
16331 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16332 * sparc.cc (Target_sparc::got_section): Likewise.
16333 * x86_64.cc (Target_x86_64::got_section): Likewise.
16334 * testsuite/relro_test_main.cc: New file.
16335 * testsuite/relro_test.cc: New file.
16336 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16337 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16338 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16339 (relro_test.so, relro_test_pic.o): New targets.
16340 * testsuite/Makefile.in: Rebuild.
16341
16342 2008-05-16 Ian Lance Taylor <iant@google.com>
16343
16344 * output.cc (Output_segment::add_output_section): Remove front
16345 parameter.
16346 * output.h (class Output_segment): Remove
16347 add_initial_output_section and overloaded add_output_section.
16348 Update declaration of remaining add_output_section.
16349 * layout.cc (Layout::create_interp): Call add_output_section
16350 rather than add_initial_output_section.
16351 (Layout::finish_dynamic_section): Likewise.
16352
16353 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16354 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16355 know the dynamic type.
16356 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16357 field. Initialize it in constructor.
16358 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16359 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16360 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16361 reloc.
16362
16363 * output.cc (Output_reloc::get_address): Change return type to
16364 Elf_Addr.
16365 * output.h (class Output_reloc): Update get_address declaration.
16366 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16367 for section addresses.
16368
16369 2008-05-09 Ian Lance Taylor <iant@google.com>
16370
16371 PR 6493
16372 * gold.cc (gold_nomem): Use return value of write.
16373
16374 2008-05-08 Ian Lance Taylor <iant@google.com>
16375
16376 * symtab.c (Symbol::init_base_output_data): Add version
16377 parameter. Change all callers.
16378 (Symbol::init_base_output_segment): Likewise.
16379 (Symbol::init_base_constant): Likewise.
16380 (Symbol::init_base_undefined): Likewise.
16381 (Sized_symbol::init_output_data): Likewise.
16382 (Sized_symbol::init_output_segment): Likewise.
16383 (Sized_symbol::init_constant): Likewise.
16384 (Sized_symbol::init_undefined): Likewise.
16385 (Symbol_table::do_define_in_output_data): If the new symbol has a
16386 version, mark it as the default.
16387 (Symbol_table::do_define_in_output_segment): Likewise.
16388 (Symbol_table::do_define_as_constant): Likewise.
16389 * symtab.h (class Symbol): Update declarations.
16390 (class Sized_symbol): Likewise.
16391 * resolve.cc (Symbol::override_version): New function.
16392 (Symbol::override_base): Call override_version.
16393 (Symbol::override_base_with_special): Likewise.
16394 * testsuite/ver_script_8.script: New file.
16395 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16396 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16397 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16398 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16399
16400 2008-05-06 Ian Lance Taylor <iant@google.com>
16401
16402 PR 6049
16403 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16404 functions.
16405 (class General_options): Remove existing --undefined, and add
16406 --no-undefined instead. Add new --undefined as synonym for -u.
16407 * archive.cc (Archive::add_symbols): Check whether symbol was
16408 named with -u.
16409 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16410 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16411 all uses. Add IS_UNDEFINED. Update declarations to split
16412 different versions of init_base. Declare init_base_undefined.
16413 (Symbol::is_defined): Handle IS_UNDEFINED.
16414 (Symbol::is_undefined): Likewise.
16415 (Symbol::is_weak_undefined): Call is_undefined.
16416 (Symbol::is_absolute): Handle IS_CONSTANT.
16417 (class Sized_symbol): Update declarations to split different
16418 versions of init. Declare init_undefined.
16419 (class Symbol_table): Declare new functions.
16420 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16421 Change all callers.
16422 (Symbol::init_base_output_data): Likewise.
16423 (Symbol::init_base_output_segment): Likewise.
16424 (Symbol::init_base_constant): Likewise.
16425 (Symbol::init_base_undefined): New function.
16426 (Sized_symbol::init_object): Rename from init. Change all
16427 callers.
16428 (Sized_symbol::init_output_data): Likewise.
16429 (Sized_symbol::init_output_segment): Likewise.
16430 (Sized_symbol::init_constant): Likewise.
16431 (Sized_symbol::init_undefined): New function.
16432 (Symbol_table::add_undefined_symbols_from_command_line): New
16433 function.
16434 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16435 function.
16436 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16437 (Symbol::output_section): Likewise.
16438 (Symbol::set_output_section): Likewise.
16439 (Symbol_table::sized_finalize_symbol): Likewise.
16440 (Symbol_table::sized_write_globals): Likewise.
16441 * resolve.cc (Symbol_table::should_override): Likewise.
16442 (Symbol::override_base_with_special): Likewise.
16443
16444 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16445 symbol, change it to have default visibility.
16446 * testsuite/protected_1.cc: New file.
16447 * testsuite/protected_2.cc: New file.
16448 * testsuite/protected_3.cc: New file.
16449 * testsuite/protected_main_1.cc: New file.
16450 * testsuite/protected_main_2.cc: New file.
16451 * testsuite/protected_main_3.cc: New file.
16452 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16453 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16454 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16455 (protected_1.so): New target.
16456 (protected_1_pic.o, protected_2_pic.o): New targets.
16457 (protected_3_pic.o): New target.
16458 (check_PROGRAMS): Add protected_2.
16459 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16460 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16461 * testsuite/Makefile.in: Rebuild.
16462
16463 * options.h (DEFINE_var): Add set_user_set_##varname__.
16464 (DEFINE_bool_alias): New macro.
16465 (class General_options): Define -Bstatic using DEFINE_bool_alias
16466 rather than DEFINE_special. Add --undefined as an alias for -z
16467 defs.
16468 * options.cc (General_options::parse_Bstatic): Remove.
16469
16470 * options.h (class General_options): Add --fatal-warnings.
16471 * main.cc (main): Implement --fatal-warnings.
16472 * errors.h (Errors::warning_count): New function.
16473
16474 * options.h (class General_options): Add -Bsymbolic-functions.
16475 * symtab.h (Symbol::is_preemptible): Check for
16476 -Bsymbolic-functions.
16477
16478 2008-05-05 Ian Lance Taylor <iant@google.com>
16479
16480 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16481 as noVARNAME rather than no-VARNAME.
16482 (class General_options): Add option -z combreloc.
16483 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16484 get_address.
16485 (Output_reloc::sort_before) [SHT_REL]: New function.
16486 (Output_reloc::sort_before) [SHT_RELA]: New function.
16487 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16488 Sort_relocs_comparison.
16489 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16490 parameter. Change all callers.
16491 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16492 sort_relocs parameter. Change all callers.
16493 * output.cc (Output_reloc::get_address): New function, broken out
16494 of write_rel.
16495 (Output_reloc::write_rel): Call it.
16496 (Output_reloc::compare): New function.
16497 (Output_data_reloc_base::do_write): Optionally sort relocs.
16498
16499 * configure.ac: If targ_extra_obj is set, link it in.
16500 * configure.tgt: Initialize all variables.
16501 (x86_64*): Set targ_extra_obj and targ_extra_size.
16502 * configure: Rebuild.
16503
16504 * object.cc (Sized_relobj::include_section_group): Adjust section
16505 indexes read from group data. Build vector to pass to
16506 layout_group.
16507 * layout.cc (Layout::layout_group): Add flags and shndxes
16508 parameters. Remove contents parameter. Change caller. Update
16509 explicit instantiations.
16510 * layout.h (class Layout): Update layout_group declaration.
16511 * output.cc (Output_data_group::Output_data_group): Add flags and
16512 input_shndxes parameters. Remove contents parameter. Change
16513 caller.
16514 (Output_data_group::do_write): Change input_sections_ to
16515 input_shndxes_.
16516 * output.h (class Output_data_group): Update constructor
16517 declaration. Rename input_sections_ to input_shndxes_.
16518 * testsuite/many_sections_test.cc: Add template.
16519
16520 2008-04-30 Cary Coutant <ccoutant@google.com>
16521
16522 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16523
16524 * layout.cc (Layout::include_section): Refactored check for debug
16525 info section.
16526 (Layout::add_comdat): Add new parameters. Change type
16527 of signature parameter. Add object and shndx to signatures table.
16528 (Layout::find_kept_object): New function.
16529 * layout.h: Include <cstring>.
16530 (Layout::is_debug_info_section): New function.
16531 (Layout::add_comdat): Add new parameters.
16532 (Layout::find_kept_object): New function.
16533 (Layout::Kept_section): New struct.
16534 (Layout::Signatures): Change type of map range.
16535 * object.cc (Relobj::output_section_address): New function.
16536 (Sized_relobj::include_section_group): Add new parameters. Change
16537 calls to Layout::add_comdat. Change to build table of kept comdat
16538 groups and table mapping discarded sections to kept sections.
16539 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16540 (Sized_relobj::do_layout): Change calls to include_section_group and
16541 include_linkonce_section.
16542 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16543 value to zero when section is discarded.
16544 (Sized_relobj::map_to_kept_section): New function.
16545 * object.h (Relobj::output_section_address): New function.
16546 (Relobj::Comdat_group): New type.
16547 (Relobj::find_comdat_group): New function.
16548 (Relobj::Comdat_group_table): New type.
16549 (Relobj::Kept_comdat_section): New type.
16550 (Relobj::Kept_comdat_section_table): New type.
16551 (Relobj::add_comdat_group): New function.
16552 (Relobj::set_kept_comdat_section): New function.
16553 (Relobj::get_kept_comdat_section): New function.
16554 (Relobj::comdat_groups_): New field.
16555 (Relobj::kept_comdat_sections_): New field.
16556 (Symbol_value::input_value): Update comment.
16557 (Sized_relobj::map_to_kept_section) New function.
16558 (Sized_relobj::include_linkonce_section): Add new parameter.
16559 * target-reloc.h (Comdat_behavior): New type.
16560 (get_comdat_behavior): New function.
16561 (relocate_section): Add code to map a discarded section to the
16562 corresponding kept section when applying a relocation.
16563
16564 2008-04-30 Craig Silverstein <csilvers@google.com>
16565
16566 * dwarf_reader.cc (next_generation_count): New static var.
16567 (Addr2line_cache_entry): New struct.
16568 (addr2line_cache): New static var.
16569 (Dwarf_line_info::one_addr2line): Added caching.
16570 (Dwarf_line_info::clear_addr2line_cache): New function.
16571 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16572 cache-size parameter.
16573 (Dwarf_line_info::one_addr2line_cache): New function.
16574 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16575 new cache-size argument to one_addr2line(), and clear cache.
16576
16577 2008-04-28 Cary Coutant <ccoutant@google.com>
16578
16579 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16580 R_386_PC8 relocations.
16581
16582 2008-04-23 Ian Lance Taylor <iant@google.com>
16583
16584 * object.cc (Sized_relobj::include_section_group): Check for
16585 invalid section group.
16586
16587 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16588 header size.
16589
16590 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16591 than read for file header.
16592 * archive.cc (Archive::include_member): Likewise.
16593
16594 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16595
16596 * aclocal.m4: Regenerate.
16597 * configure: Regenerate.
16598
16599 2008-04-19 Ian Lance Taylor <iant@google.com>
16600
16601 * version.cc (version_string): Bump to 1.6.
16602
16603 * testsuite/Makefile.am (many_sections_r_test): New target.
16604 (many_sections_r_test_SOURCES): Remove.
16605 (many_sections_r_test_DEPENDENCIES): Remove.
16606 (many_sections_r_test_LDFLAGS): Remove.
16607 (many_sections_r_test_LDADD): Remove.
16608
16609 * object.cc (Sized_relobj::do_add_symbols): Always pass
16610 local_symbol_count_ to add_from_relobj.
16611
16612 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16613 every thousand variables.
16614 * testsuite/Makefile.in: Rebuild.
16615
16616 * object.cc (Xindex::initialize_symtab_xindex): New function.
16617 (Xindex::read_symtab_xindex): New function.
16618 (Xindex::sym_xindex_to_shndx): New function.
16619 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16620 available.
16621 (Sized_relobj::do_initialize_xindex): New function.
16622 (Sized_relobj::do_read_symbols): Adjust section links.
16623 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16624 parameter. Change all callers.
16625 (Sized_relobj::include_section_group): Adjust section links and
16626 symbol section indexes.
16627 (Sized_relobj::do_layout): Adjust section links.
16628 (Sized_relobj::do_count_local_symbols): Adjust section links and
16629 symbol section indexes.
16630 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16631 ordinary and special symbols.
16632 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16633 dynsym_xindex parameters. Change all callers. Adjust section
16634 links. Use SHN_XINDEX when needed.
16635 (Sized_relobj::get_symbol_location_info): Adjust section links.
16636 Don't get fooled by special symbols.
16637 * object.h (class Xindex): Define.
16638 (class Object): Add xindex_ parameter. Declare virtual functoin
16639 do_initialize_xindex.
16640 (Object::adjust_sym_shndx): New function.
16641 (Object::set_xindex): New protected function.
16642 (class Symbol_value): Add is_ordinary_shndx_ field.
16643 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16644 (Symbol_value::value): Assert ordinary section.
16645 (Symbol_value::initialize_input_to_output_map): Likewise.
16646 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16647 Change all callers.
16648 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16649 all callers.
16650 (class Sized_relobj): Update declarations.
16651 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16652 parameter. Change all callers.
16653 (Sized_relobj::adjust_shndx): New function.
16654 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16655 field.
16656 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16657 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16658 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16659 (Sized_dynobj::read_dynsym_section): Adjust section links.
16660 (Sized_dynobj::read_dynamic): Likewise.
16661 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16662 section links.
16663 (Sized_dynobj::do_initialize_xindex): New function.
16664 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16665 do_initialize_xindex.
16666 (Sized_dynobj::adjust_shndx): New function.
16667 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16668 dynsym_xindex_ fields.
16669 (Layout::finalize): Add a call to set_section_indexes before
16670 creating the symtab sections.
16671 (Layout::set_section_indexes): Don't do anything if the section
16672 already has a section index.
16673 (Layout::create_symtab_sections): Add shnum parameter. Change
16674 caller. Create .symtab_shndx section if needed.
16675 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16676 caller.
16677 (Layout::allocated_output_section_count): New function.
16678 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16679 needed.
16680 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16681 fields. Update declarations.
16682 (Layout::symtab_xindex): New function.
16683 (Layout::dynsym_xindex): New function.
16684 (class Write_symbols_task): Add layout_ field.
16685 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16686 Change caller.
16687 * output.cc (Output_section_headers::Output_section_headers): Add
16688 shstrtab_section parameter. Change all callers.
16689 (Output_section_headers::do_sized_write): Store overflow values
16690 for section count and section string table section index in
16691 section header zero.
16692 (Output_file_header::do_sized_write): Check for overflow of
16693 section count and section string table section index.
16694 (Output_symtab_xindex::do_write): New function.
16695 (Output_symtab_xindex::endian_do_write): New function.
16696 * output.h (class Output_section_headers): Add shstrtab_section_.
16697 Update declarations.
16698 (class Output_symtab_xindex): Define.
16699 (Output_section::has_out_shndx): New function.
16700 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16701 field.
16702 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16703 Change all callers.
16704 (Sized_symbol::init): Likewise.
16705 (Symbol::output_section): Check for ordinary symbol.
16706 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16707 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16708 callers.
16709 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16710 Change all callers. Simplify handling of symbols from sections
16711 not included in the link.
16712 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16713 distinction.
16714 (Weak_alias_sorter::operator()): Assert that symbols are
16715 ordinary.
16716 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16717 distinction.
16718 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16719 parameters. Change all callers.
16720 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16721 symbol distinction. Use SHN_XINDEX when needed.
16722 (Symbol_table::write_section_symbol): Add symtab_xindex
16723 parameter. Change all callers.
16724 (Symbol_table::sized_write_section_symbol): Likewise. Use
16725 SHN_XINDEX when needed.
16726 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16727 declarations.
16728 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16729 (Symbol::is_defined): Check is_ordinary.
16730 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16731 (Symbol::is_absolute, Symbol::is_common): Likewise.
16732 (class Sized_symbol): Update declarations.
16733 (class Symbol_table): Update declarations.
16734 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16735 parameters. Change all callers.
16736 (Sized_symbol::override): Likewise.
16737 (Symbol_table::override): Likewise.
16738 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16739 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16740 is_ordinary, and orig_st_shndx parameters. Change all callers.
16741 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16742 to be in an ordinary section.
16743 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16744 object and is_ordinary parameters. Change all callers.
16745 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16746 Change all callers. Don't add undefined or non-ordinary symbols
16747 to reloc_map_.
16748 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16749 Change all callers.
16750 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16751 declarations.
16752 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16753 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16754 (Sized_relobj::relocate_sections): Likewise.
16755 * target-reloc.h (scan_relocs): Adjust section symbol index.
16756 (scan_relocatable_relocs): Likewise.
16757 * i386.cc (Scan::local): Check for ordinary symbols.
16758 * sparc.cc (Scan::local): Likewise.
16759 * x86_64.cc (Scan::local): Likewise.
16760 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16761 to symbol_section_and_value.
16762 * testsuite/many_sections_test.cc: New file.
16763 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16764 (check_PROGRAMS): Add many_sections_test.
16765 (many_sections_test_SOURCES): Define.
16766 (many_sections_test_DEPENDENCIES): Define.
16767 (many_sections_test_LDFLAGS): Define.
16768 (BUILT_SOURCES): Add many_sections_define.h.
16769 (many_sections_define.h): New target.
16770 (BUILT_SOURCES): Add many_sections_check.h.
16771 (many_sections_check.h): New target.
16772 (check_PROGRAMS): Add many_sections_r_test.
16773 (many_sections_r_test_SOURCES): Define.
16774 (many_sections_r_test_DEPENDENCIES): Define.
16775 (many_sections_r_test_LDFLAGS): Define.
16776 (many_sections_r_test_LDADD): Define.
16777 (many_sections_r_test.o): New target.
16778 * testsuite/Makefile.in: Rebuild.
16779
16780 2008-04-17 Cary Coutant <ccoutant@google.com>
16781
16782 * errors.cc (Errors::info): New function.
16783 (gold_info): New function.
16784 * errors.h (Errors::info): New function.
16785 * gold.h (gold_info): New function.
16786 * object.cc (Input_objects::add_object): Print trace output.
16787 * options.cc (options::parse_set): New function.
16788 (General_options::parse_wrap): Deleted.
16789 (General_options::General_options): Deleted initializer.
16790 * options.h (options::String_set): New typedef.
16791 (options::parse_set): New function.
16792 (DEFINE_set): New macro.
16793 (General_options::wrap): Changed to use DEFINE_set. Changed
16794 callers of any_wrap_symbols and is_wrap_symbol.
16795 (General_options::trace, General_options::trace_symbol):
16796 New options.
16797 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16798 (General_options::wrap_symbols_): Deleted.
16799 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16800
16801 2008-04-17 David S. Miller <davem@davemloft.net>
16802
16803 * options.cc (General_options::parse_V): New function.
16804 * options.h: Add entries for -V and -Qy.
16805
16806 2008-04-17 Ian Lance Taylor <iant@google.com>
16807
16808 * common.cc (Symbol_table::allocate_commons): Remove options
16809 parameter. Change caller.
16810 (Symbol_table::do_allocate_commons): Remove options parameter.
16811 Change caller. Just call do_allocate_commons_list twice.
16812 (Symbol_table::do_allocate_commons_list): New function, broken out
16813 of do_allocate_commons.
16814 * common.h (class Allocate_commons_task): Remove options_ field.
16815 Update constructor.
16816 * symtab.cc (Symbol_table::Symbol_table): Initialize
16817 tls_commons_.
16818 (Symbol_table::add_from_object): Put TLS common symbols on
16819 tls_commons_ list.
16820 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16821 which are IN_OUTPUT_DATA.
16822 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16823 allocate_commons and do_allocate_commons declarations. Declare
16824 do_allocate_commons_list.
16825 * gold.cc (queue_middle_tasks): Update creation of
16826 Allocate_commons_task to not pass options.
16827 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16828 (TLS_TEST_C_FLAGS): New variable.
16829 (tls_test_c_pic.o): New target.
16830 (tls_test_shared.so): Link in tls_test_c_pic.o.
16831 (tls_test_c_pic_ie.o): New target.
16832 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16833 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16834 (tls_test_c.o): New target.
16835 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16836 (tls_pic_test_LDADD): Likewise.
16837 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16838 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16839 (tls_test_c_gnu2.o): New target.
16840 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16841 tls_test_c_gnu2.o.
16842 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16843 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16844 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16845 * testsuite/tls_test.cc: Include "config.h".
16846 (t_last): Call t11_last.
16847 * testsuite/tls_test.h (t11, t11_last): Declare.
16848 * testsuite/tls_test_c.c: New file.
16849 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16850 * configure.ac: Check for OpenMP support.
16851 * configure, config.in, Makefile.in: Rebuild.
16852 * testsuite/Makefile.in: Rebuild.
16853
16854 2008-04-16 Cary Coutant <ccoutant@google.com>
16855
16856 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16857 (Target_i386::tls_base_symbol_defined_): New field.
16858 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16859 (Target_i386::Scan::global): Likewise.
16860 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16861 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16862 (Target_x86_64::tls_base_symbol_defined_): New field.
16863 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16864 (Target_x86_64::Scan::global): Likewise.
16865
16866 2008-04-16 Cary Coutant <ccoutant@google.com>
16867
16868 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16869 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16870 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16871 building shared libraries.
16872 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16873 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16874 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16875 * testsuite/Makefile.in: Rebuild.
16876 * testsuite/weak_undef.h: New file.
16877 * testsuite/weak_undef_file1.cc: Add extra test cases.
16878 * testsuite/weak_undef_file2.cc: Likewise.
16879 * testsuite/weak_undef_test.cc: Likewise.
16880
16881 2008-04-16 David S. Miller <davem@davemloft.net>
16882
16883 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16884 Add issued_non_pic_error_ field. Declare check_non_pic.
16885 (Target_sparc::Scan::check_non_pic): New function.
16886 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16887 (Target_sparc::Scan::global): Likewise.
16888
16889 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16890 * configure: Rebuild.
16891
16892 * options.h (DEFINE_enable): New macro.
16893 (new_dtags): New enable option.
16894 (initfirst, interpose, loadfltr, nodefaultlib,
16895 nodelete, nodlopen, nodump): New -z options.
16896 * layout.cc (Layout:finish_dynamic_section): If new
16897 dtags enabled, emit DT_RUNPATH. Also, emit a
16898 DT_FLAGS_1 containing any specified -z flags.
16899
16900 2008-04-16 Ian Lance Taylor <iant@google.com>
16901
16902 * copy-relocs.cc: New file.
16903 * copy-relocs.h: New file.
16904 * reloc.cc: Remove Copy_relocs code.
16905 * reloc.h: Likewise.
16906 * reloc-types.h (struct Reloc_types) [both versions]: Add
16907 get_reloc_addend_noerror.
16908 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16909 variants of add_global which take an addend which must be zero.
16910 * i386.cc: Include "copy-relocs.h".
16911 (class Target_i386): Change type of copy_relocs_ to variable,
16912 update initializer.
16913 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16914 Change all callers.
16915 (Target_i386::do_finalize_sections): Change handling of
16916 copy_relocs_.
16917 * sparc.cc: Include "copy-relocs.h".
16918 (class Target_sparc): Change type of copy_relocs_ to variable,
16919 update initializer.
16920 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16921 Change all callers.
16922 (Target_sparc::do_finalize_sections): Change handling of
16923 copy_relocs_.
16924 * x86_64.cc: Include "copy-relocs.h".
16925 (class Target_x86_64): Change type of copy_relocs_ to variable,
16926 update initializer.
16927 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16928 class. Change all callers.
16929 (Target_x86_64::do_finalize_sections): Change handling of
16930 copy_relocs_.
16931 * Makefile.am (CCFILES): Add copy-relocs.cc.
16932 (HFILES): Add copy-relocs.h.
16933
16934 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16935
16936 * testsuite/script_test_4.sh: Permit leading zeroes.
16937
16938 2008-04-15 Ian Lance Taylor <iant@google.com>
16939
16940 * script-sections.cc (Script_sections::create_segments): Use
16941 header_size_adjustment even when there is enough room for the
16942 headers.
16943 * testsuite/script_test_4.sh: New file.
16944 * testsuite/script_test_4.t: New file.
16945 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16946 (check_DATA): Add script_test_4.stdout.
16947 (MOSTLYCLEANFILES): Likewise.
16948 (script_test_4): New target.
16949 (script_test_4.stdout): New target.
16950 * testsuite/Makefile.in: Rebuild.
16951
16952 * sparc.cc: Add definitions for Output_data_plt_sparc class
16953 constants.
16954
16955 2008-04-14 David S. Miller <davem@davemloft.net>
16956
16957 * sparc.cc: New file.
16958 * Makefile.am (TARGETSOURCES): Add sparc.cc
16959 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16960 * configure.tgt: Document targ_extra_size and
16961 targ_extra_big_endian. Add entries for sparc-* and
16962 sparc64-*.
16963 * configure.ac: Handle targ_extra_size and
16964 targ_extra_big_endian.
16965 * Makefile.in: Rebuild.
16966 * configure: Likewise.
16967 * po/POTFILES.in: Likewise.
16968 * po/gold.pot: Likewise.
16969
16970 2008-04-14 Ian Lance Taylor <iant@google.com>
16971
16972 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16973 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16974 in the name/type/flags to section mapping. Don't call
16975 allocate_output_section.
16976 (Layout::choose_output_section): Change parameter from adjust_name
16977 to is_input_section. Don't permit input sections after sections
16978 are attached to segments. Don't call allocate_output_section.
16979 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16980 not write_enable_output_section.
16981 (Layout::make_output_section): Don't push to
16982 unattached_section_list_ nor call attach_to_segment. Call
16983 attach_section_to_segment if sections are attached.
16984 (Layout::attach_sections_to_segments): New function.
16985 (Layout::attach_section_to_segment): New function.
16986 (Layout::attach_allocated_section_to_segment): Rename from
16987 attach_to_segment. Remove flags parameter.
16988 (Layout::allocate_output_section): Remove function.
16989 (Layout::write_enable_output_section): Remove function.
16990 * layout.h (class Layout): Update for above changes. Add new
16991 field sections_are_attached_.
16992 * output.h (Output_section::update_flags_for_input_section): New
16993 function.
16994 * output.cc (Output_section::add_input_section): Call
16995 update_flags_for_input_section.
16996 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16997
16998 2008-04-11 Cary Coutant <ccoutant@google.com>
16999
17000 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17001 thought unnecessary.
17002 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17003
17004 2008-04-11 Ian Lance Taylor <iant@google.com>
17005
17006 * output.h (class Output_section_data): Remove inline definition
17007 of set_addralign.
17008 * output.cc (Output_section_data::set_addralign): New function.
17009
17010 2008-04-11 Cary Coutant <ccoutant@google.com>
17011
17012 Add support for TLS descriptors for i386 and x86_64.
17013 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17014 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17015 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17016 GOT_TYPE_TLS_DESC.
17017 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17018 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17019 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17020 relocations.
17021 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17022 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17023 Fix problem with initial-exec relocations.
17024 (Target_i386::Relocate::relocate_tls): Likewise.
17025 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17026 relaxation.
17027 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17028 support for section-plus-offset dynamic table entries.
17029 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17030 (Output_data_dynamic::Dynamic_entry): Add support for
17031 section-plus-offset dynamic table entries.
17032 (Output_data_dynamic::Classification): Likewise.
17033 (Output_data_dynamic::classification_): Renamed offset_.
17034 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17035 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17036 (Target_x86_64::make_plt_section): New function.
17037 (Target_x86_64::reserve_tlsdesc_entries): New function.
17038 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17039 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17040 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17041 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17042 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17043 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17044 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17045 add extra PLT entry for TLS descriptors.
17046 (Output_data_plt_x86_64::got_): New field.
17047 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17048 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17049 fields.
17050 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17051 descriptors.
17052 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17053 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17054 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17055 R_386_TLS_DESC_CALL relocations.
17056 (Target_x86_64::Scan::global): Likewise.
17057 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17058 for TLS descriptors.
17059 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17060 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17061 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17062 GD-to-IE relaxation.
17063 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17064 and TLS_DESCRIPTORS.
17065 * Makefile.in: Rebuild.
17066 * configure: Rebuild.
17067 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17068 (tls_test_shared2.so): New target.
17069 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17070 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17071 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17072 (tls_shared_gd_to_ie_test_LDADD): New variable.
17073 (tls_shared_gnu2_gd_to_ie_test): New target.
17074 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17075 New targets.
17076 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17077 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17078 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17079 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17080 (tls_shared_gnu2_test): New target.
17081 (tls_test_gnu2_shared.so): New target.
17082 (tls_shared_gnu2_test_SOURCES): New variable.
17083 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17084 (tls_shared_gnu2_test_LDFLAGS): New variable.
17085 (tls_shared_gnu2_test_LDADD): New variable.
17086 * testsuite/Makefile.in: Rebuild.
17087 * testsuite/Makefile.
17088
17089 2008-04-11 Ian Lance Taylor <iant@google.com>
17090
17091 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17092 justsyms.t.
17093 * testsuite/Makefile.in: Rebuild.
17094
17095 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17096 long.
17097 * testsuite/script_test_2.cc (main): Adjust test.
17098
17099 2008-04-11 David S. Miller <davem@davemloft.net>
17100 Ian Lance Taylor <iant@google.com>
17101
17102 * options.h (General_options): Add entries for '-Y' and
17103 '-relax'.
17104 * options.cc (General_options:finalize): If -Y was used, add those
17105 entries to the library path instead of the default "/lib" and
17106 "/usr/lib".
17107
17108 2008-04-11 David S. Miller <davem@davemloft.net>
17109
17110 * testsuite/justsyms.t: Start at 0x100.
17111 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17112 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17113 long.
17114 * testsuite/script_test_2.cc: Adjust string and section length
17115 checks.
17116
17117 2008-04-09 Ian Lance Taylor <iant@google.com>
17118
17119 PR gold/5996
17120 * script-sections.cc (Sections_element::allocate_to_segment): Add
17121 orphan parameter.
17122 (Output_section_definition::allocate_to_segment): Likewise.
17123 (Orphan_output_section::allocate_to_segment): Likewise.
17124 (Script_sections::attach_sections_using_phdrs_clause): Don't
17125 propagate non-PT_LOAD segments to orphan sections.
17126 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17127 readelf rather than objdump.
17128 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17129 .interp section and PT_INTERP segment are the same size.
17130 * testsuite/Makefile.in: Rebuild.
17131
17132 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17133 aliases for symbols defined in the same object.
17134 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17135 (weak_alias_test_SOURCES): New variable.
17136 (weak_alias_test_DEPENDENCIES): New variable.
17137 (weak_alias_test_LDFLAGS): New variable.
17138 (weak_alias_test_LDADD): New variable.
17139 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17140 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17141 (weak_alias_test_3.o): New target.
17142 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17143 * testsuite/weak_alias_test_main.cc: New file.
17144 * testsuite/weak_alias_test_1.cc: New file.
17145 * testsuite/weak_alias_test_2.cc: New file.
17146 * testsuite/weak_alias_test_3.cc: New file.
17147
17148 2008-04-08 Ian Lance Taylor <iant@google.com>
17149
17150 * options.h (class General_options): Add --noinhibit-exec option.
17151 * main.cc (main): Check --noinhibit-exec.
17152
17153 * options.h (class General_options): Define --wrap as a special
17154 option. Add wrap_symbols_ field.
17155 (General_options::any_wrap_symbols): New function.
17156 (General_options::is_wrap_symbol): New function.
17157 * options.cc (General_options::parse_wrap): New function.
17158 (General_options::General_options): Initialize wrap_symbols_.
17159 * symtab.cc (Symbol_table::wrap_symbol): New function.
17160 (Symbol_table::add_from_object): Handle --wrap.
17161 * symtab.h (class Symbol_table): Declare wrap_symbol.
17162 * target.h (Target::wrap_char): New function.
17163 (Target::Target_info): Add wrap_char field.
17164 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17165 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17166 * testsuite/testfile.cc (Target_test::test_target_info):
17167 Likewise.
17168
17169 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17170 there is one.
17171
17172 * layout.h (class Layout): Add added_eh_frame_data_ field.
17173 * layout.cc (Layout::Layout): Initialize new field.
17174 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17175 output section until we find a section we merged successfully.
17176 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17177 that the size be non-zero.
17178
17179 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17180 qualifier.
17181
17182 2008-04-08 Craig Silverstein <csilvers@google.com>
17183
17184 * configure.ac: Export new conditional variable HAVE_ZLIB.
17185 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17186 on HAVE_ZLIB.
17187 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17188 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17189
17190 2008-04-07 Ian Lance Taylor <iant@google.com>
17191
17192 * version.cc (version_string): Set to "1.5".
17193
17194 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17195 Add issued_non_pic_error_ field. Declare check_non_pic.
17196 (Target_x86_64::Scan::check_non_pic): New function.
17197 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17198 (Target_x86_64::Scan::global): Likewise.
17199
17200 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17201 addend parameter. Change caller. Handle merge sections.
17202 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17203 Address to Addend. Don't add in the result of
17204 local_section_offset, pass down the addend and use the returned
17205 value.
17206 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17207 Update declarations of local_section_offset and symbol_value.
17208 * testsuite/two_file_test_1.cc (t18): New function.
17209 * testsuite/two_file_test_2.cc (f18): New function.
17210 * testsuite/two_file_test_main.cc (main): Call t18.
17211 * testsuite/two_file_test.h (t18, f18): Declare.
17212
17213 * configure.ac: Don't test for objdump, c++filt, or readelf.
17214 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17215 conditionals.
17216 (TEST_READELF): New variable.
17217 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17218 (check_PROGRAMS): Add two_file_strip_test.
17219 (two_file_strip_test): New target.
17220 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17221 (two_file_same_shared_strip_test_SOURCES): New variable.
17222 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17223 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17224 (two_file_same_shared_strip_test_LDADD): New variable.
17225 (two_file_shared_strip.so): New target.
17226 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17227 (ver_test_5.syms, ver_test_7.syms): Likewise.
17228 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17229 (strip_test_3.stdout): Use TEST_OBJDUMP.
17230 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17231
17232 2008-04-04 Cary Coutant <ccoutant@google.com>
17233
17234 * symtab.h (Symbol::is_weak_undefined): New function.
17235 (Symbol::is_strong_undefined): New function.
17236 (Symbol::is_absolute): New function.
17237 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17238 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17239 absolute symbols.
17240 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17241 (weak_undef_test): New target.
17242 * testsuite/Makefile.in: Rebuild.
17243 * testsuite/weak_undef_file1.cc: New file.
17244 * testsuite/weak_undef_file2.cc: New file.
17245 * testsuite/weak_undef_test.cc: New file.
17246
17247 2008-04-03 Craig Silverstein <csilvers@google.com>
17248
17249 * compressed_output.h (class Output_compressed_section): Use
17250 unsigned buffer.
17251 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17252 add zlib header.
17253 (zlib_compressed_suffix): Removed.
17254 (Output_compressed_section::set_final_data_size): Use unsigned
17255 buffers.
17256 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17257 Fix linker invocation.
17258 (flagstest_o_specialfile_and_compress_debug_sections):
17259 Likewise.
17260 * testsuite/Makefile.in: Regenerated.
17261
17262 2008-04-02 David S. Miller <davem@davemloft.net>
17263
17264 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17265 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17266
17267 2008-04-02 Craig Silverstein <csilvers@google.com>
17268
17269 * TODO: New file.
17270
17271 2008-04-02 Ian Lance Taylor <iant@google.com>
17272
17273 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17274 parameters. Update for new key type to views_. Change all
17275 callers.
17276 (File_read::read): Adjust for byteshift in returned view.
17277 (File_read::add_view): New function, broken out of
17278 find_and_make_view.
17279 (File_read::make_view): New function, broken out of
17280 find_and_make_view.
17281 (File_read::find_or_make_view): Add offset and aligned
17282 parameters. Rewrite accordingly. Change all callers.
17283 (File_read::get_view): Add offset and aligned parameters. Adjust
17284 for byteshift in return value.
17285 (File_read::get_lasting_view): Likewise.
17286 * fileread.h (class File_read): Update declarations.
17287 (class File_read::View): Add byteshift_ field. Add byteshift to
17288 constructor. Add byteshift method.
17289 * archive.h (Archive::clear_uncached_views): New function.
17290 (Archive::get_view): Add aligned parameter. Change all callers.
17291 * object.h (Object::get_view): Add aligned parameter. Change all
17292 callers.
17293 (Object::get_lasting_view): Likewise.
17294
17295 * fileread.cc (File_read::release): Don't call clear_views if
17296 there are multiple objects.
17297 * fileread.h (File_read::clear_uncached_views): New function.
17298 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17299 on the archive.
17300
17301 2008-03-31 Cary Coutant <ccoutant@google.com>
17302
17303 Add thin archive support.
17304 * archive.cc (Archive::armagt): New const.
17305 (Archive::setup): Remove task parameter and calls to unlock.
17306 (Archive::unlock_nested_archives): New function.
17307 (Archive::read_header): Add nested_off parameter. Change
17308 all callers.
17309 (Archive::interpret_header): Likewise.
17310 (Archive::include_all_members): Change to handle thin
17311 archives.
17312 (Archive::include_member): Likewise.
17313 * archive.h (Archive::Archive): Add new parameters and
17314 initializers.
17315 (Archive::armagt): New const.
17316 (Archive::setup): Remove task parameter.
17317 (Archive::unlock_nested_archives): New function.
17318 (Archive::read_header): Add nested_off parameter.
17319 (Archive::interpret_header): Likewise.
17320 (Archive::Nested_archive_table): New typedef.
17321 (Archive::is_thin_archive_): New field.
17322 (Archive::nested_archives_): New field.
17323 (Archive::options_): New field.
17324 (Archive::dirpath_): New field.
17325 (Archive::task_): New field.
17326 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17327 for thin archives. Pass additional parameters to
17328 Archive::Archive. Unlock the archive file after calling
17329 Archive::setup.
17330
17331 2008-03-29 Ian Lance Taylor <iant@google.com>
17332
17333 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17334 version symbol to be local.
17335 * testsuite/ver_test_4.sh: New file.
17336 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17337 (check_DATA): Add ver_test_4.syms.
17338 (ver_test_4.syms): New target.
17339 * testsuite/Makefile.in: Rebuild.
17340
17341 * output.cc
17342 (Output_section::Input_section_sort_entry::has_priority): New
17343 function.
17344 (Output_section::Input_section_sort_entry::match_file_name): New
17345 function.
17346 (Output_section::Input_section_sort_entry::match_section_name):
17347 Remove.
17348 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17349 Remove.
17350 (Output_section::Input_section_sort_entry::match_section_file):
17351 Remove.
17352 (Output_section::Input_section_sort_compare::operator()): Rewrite
17353 using new Input_section_sort_entry functions. Sort crtbegin and
17354 crtend first. Sort sections with no priority before sections with
17355 a priority.
17356 * testsuite/initpri1.c (d3): Check j != 4.
17357 (cd5): New constructor/destructor function.
17358 (main): Check j != 2.
17359
17360 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17361 new symbol when resolving, don't call set_is_default.
17362 * testsuite/ver_test_7.cc: New file.
17363 * testsuite/ver_test_7.sh: New file.
17364 * testsuite/Makefile.am (ver_test_7.so): New target.
17365 (ver_test_7.o): New target.
17366 (check_SCRIPTS): Add ver_test_7.sh.
17367 (check_DATA): Add ver_test_7.syms.
17368 (ver_test_7.syms): New target.
17369
17370 2008-03-28 Ian Lance Taylor <iant@google.com>
17371
17372 * layout.cc (Layout::layout): If we see an input section with a
17373 name that needs sorting, set the must_sort flag for the output
17374 section.
17375 (Layout::make_output_section): If the name of the output section
17376 indicates that it might require sorting, set the may_sort flag.
17377 * output.h (Output_section::may_sort_attached_input_sections): New
17378 function.
17379 (Output_section::set_may_sort_attached_input_sections): New
17380 function.
17381 (Output_section::must_sort_attached_input_sections): New
17382 function.
17383 (Output_section::set_must_sort_attached_input_sections): New
17384 function.
17385 (class Output_section): Declare Input_section_sort_entry. Define
17386 Input_section_sort_compare. Declare
17387 sort_attached_input_sections. Add new fields:
17388 may_sort_attached_input_sections_,
17389 must_sort_attached_input_sections_,
17390 attached_input_sections_are_sorted_.
17391 * output.cc (Output_section::Output_section): Initialize new
17392 fields.
17393 (Output_section::add_input_section): Add an entry to
17394 input_sections_ if may_sort or must_sort are true.
17395 (Output_section::set_final_data_size): Call
17396 sort_attached_input_sections if necessary.
17397 (Output_section::Input_section_sort_entry): Define new class.
17398 (Output_section::Input_section_sort_compare::operator()): New
17399 function.
17400 (Output_section::sort_attached_input_sections): New function.
17401 * configure.ac: Check whether the compiler supports constructor
17402 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17403 * testsuite/initpri1.c: New file.
17404 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17405 CONSTRUCTOR_PRIORITY.
17406 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17407 (initpri1_LDFLAGS): New variable.
17408 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17409
17410 2008-03-27 Ian Lance Taylor <iant@google.com>
17411
17412 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17413 * testsuite/common_test_1.c: New file.
17414 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17415 (common_test_1_SOURCES): New variable.
17416 (common_test_1_DEPENDENCIES): New variable.
17417 (common_test_1_LDFLAGS): New variable.
17418
17419 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17420 and commons_ correctly when NAME/VERSION does not override
17421 NAME/NULL.
17422 * testsuite/ver_test_6.c: New file.
17423 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17424 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17425 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17426
17427 2008-03-26 Ian Lance Taylor <iant@google.com>
17428
17429 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17430 of an undefined symbol from a version script.
17431 * testsuite/Makefile.am (ver_test_5.so): New target.
17432 (ver_test_5.o): New target.
17433 (check_SCRIPTS): Add ver_test_5.sh.
17434 (check_DATA): Add ver_test_5.syms.
17435 (ver_test_5.syms): New target.
17436 * testsuite/ver_test_5.cc: New file.
17437 * testsuite/ver_test_5.script: New file.
17438 * testsuite/ver_test_5.sh: New file.
17439 * Makefile.in, testsuite/Makefile.in: Rebuild.
17440
17441 PR gold/5986
17442 Fix problems building gold with gcc 4.3.0.
17443 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17444 (gold_error_at_location, gold_warning_at_location): Use it.
17445 * configure.ac: Check whether we can compile and use a template
17446 function with a printf attribute.
17447 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17448 when jumping over bytes.
17449 * object.cc: Instantiate Object::read_section_data.
17450 * debug.h: Include <cstring>
17451 * dwarf_reader.cc: Include <algorithm>
17452 * main.cc: Include <cstring>.
17453 * options.cc: Include <cstring>.
17454 * output.cc: Include <cstring>.
17455 * script.cc: Include <cstring>.
17456 * script.h: Include <string>.
17457 * symtab.cc: Include <cstring> and <algorithm>.
17458 * target-select.cc: Include <cstring>.
17459 * version.cc: Include <string>.
17460 * testsuite/testmain.cc: Include <cstdlib>.
17461 * configure, config.in: Rebuild.
17462
17463 2008-03-25 Ian Lance Taylor <iant@google.com>
17464
17465 * options.cc: Include "../bfd/bfdver.h".
17466 (options::help): Print bug reporting address.
17467
17468 * version.cc (print_version): Adjust output for current value of
17469 BFD_VERSION_STRING.
17470
17471 * NEWS: New file.
17472
17473 * options.cc (options::help): Print list of supported targets.
17474 * target-select.h: Include <vector>.
17475 (class Target_selector): Make machine_, size_, and is_big_endian_
17476 fields const. Add bfd_name_ and instantiated_target_ fields.
17477 (Target_selector::Target_selector): Add bfd_name parameter.
17478 (Target_selector::recognize): Make non-virtual, call
17479 do_recognize.
17480 (Target_selector::recognize_by_name): Make non-virtual, call
17481 do_recognize_by_name.
17482 (Target_selector::supported_names): New function.
17483 (Target_selector::bfd_name): New function.
17484 (Target_selector::do_instantiate_target): New pure virtual
17485 function.
17486 (Target_selector::do_recognize): New virtual function.
17487 (Target_selector::do_recognize_by_name): New virtual function.
17488 (Target_selector::instantiate_target): New private function.
17489 (supported_target_names): Declare.
17490 * target-select.cc (Target_selector::Target_selector): Update for
17491 new parameter and fields.
17492 (select_target_by_name): Check that the name matches before
17493 calling recognize_by_name.
17494 (supported_target_names): New function.
17495 * i386.cc (class Target_selector_i386): Update Target_selector
17496 constructor call. Remove recognize and recognize_by_name. Add
17497 do_instantiate_target.
17498 * x86_64.cc (class Target_selector_x86_64): Likewise.
17499 * testsuite/testfile.cc (class Target_selector_test): Update for
17500 changes to Target_selector.
17501
17502 * README: Rewrite, with some notes on unsupported features.
17503
17504 2008-03-24 Cary Coutant <ccoutant@google.com>
17505
17506 * i386.cc (Target_i386::Got_type): New enum declaration.
17507 (Target_i386::Scan::local): Updated callers of Output_data_got
17508 member functions.
17509 (Target_i386::Scan::global): Likewise.
17510 (Target_i386::Relocate::relocate): Likewise.
17511 (Target_i386::Relocate::relocate_tls): Likewise.
17512 * object.h (Got_offset_list): New class.
17513 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17514 (Sized_relobj::local_got_offset): Likewise.
17515 (Sized_relobj::set_local_got_offset): Likewise.
17516 (Sized_relobj::local_has_tls_got_offset): Removed.
17517 (Sized_relobj::local_tls_got_offset): Removed.
17518 (Sized_relobj::set_local_tls_got_offset): Removed.
17519 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17520 * output.cc (Output_data_got::add_global): Added got_type parameter.
17521 (Output_data_got::add_global_with_rel): Likewise.
17522 (Output_data_got::add_global_with_rela): Likewise.
17523 (Output_data_got::add_global_pair_with_rel): New function.
17524 (Output_data_got::add_global_pair_with_rela): New function.
17525 (Output_data_got::add_local): Added got_type parameter.
17526 (Output_data_got::add_local_with_rel): Likewise.
17527 (Output_data_got::add_local_with_rela): Likewise.
17528 (Output_data_got::add_local_pair_with_rel): New function.
17529 (Output_data_got::add_local_pair_with_rela): New function.
17530 (Output_data_got::add_global_tls): Removed.
17531 (Output_data_got::add_global_tls_with_rel): Removed.
17532 (Output_data_got::add_global_tls_with_rela): Removed.
17533 (Output_data_got::add_local_tls): Removed.
17534 (Output_data_got::add_local_tls_with_rel): Removed.
17535 (Output_data_got::add_local_tls_with_rela): Removed.
17536 * output.h (Output_data_got::add_global): Added got_type parameter.
17537 (Output_data_got::add_global_with_rel): Likewise.
17538 (Output_data_got::add_global_with_rela): Likewise.
17539 (Output_data_got::add_global_pair_with_rel): New function.
17540 (Output_data_got::add_global_pair_with_rela): New function.
17541 (Output_data_got::add_local): Added got_type parameter.
17542 (Output_data_got::add_local_with_rel): Likewise.
17543 (Output_data_got::add_local_with_rela): Likewise.
17544 (Output_data_got::add_local_pair_with_rel): New function.
17545 (Output_data_got::add_local_pair_with_rela): New function.
17546 (Output_data_got::add_global_tls): Removed.
17547 (Output_data_got::add_global_tls_with_rel): Removed.
17548 (Output_data_got::add_global_tls_with_rela): Removed.
17549 (Output_data_got::add_local_tls): Removed.
17550 (Output_data_got::add_local_tls_with_rel): Removed.
17551 (Output_data_got::add_local_tls_with_rela): Removed.
17552 * resolve.cc (Symbol::override_base_with_special): Removed
17553 reference to has_got_offset_ field.
17554 * symtab.cc (Symbol::init_fields): Replaced initialization
17555 of got_offset_ with got_offsets_. Removed initialization
17556 of has_got_offset_
17557 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17558 (Symbol::got_offset): Likewise.
17559 (Symbol::set_got_offset): Likewise.
17560 (Symbol::has_tls_got_offset): Removed.
17561 (Symbol::tls_got_offset): Removed.
17562 (Symbol::set_tls_got_offset): Removed.
17563 (Symbol::got_offset_): Removed.
17564 (Symbol::tls_mod_got_offset_): Removed.
17565 (Symbol::tls_pair_got_offset_): Removed.
17566 (Symbol::got_offsets_): New field.
17567 (Symbol::has_got_offset): Removed.
17568 (Symbol::has_tls_mod_got_offset): Removed.
17569 (Symbol::has_tls_pair_got_offset): Removed.
17570 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17571 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17572 member functions.
17573 (Target_x86_64::Scan::global): Likewise.
17574 (Target_x86_64::Relocate::relocate): Likewise.
17575 (Target_x86_64::Relocate::relocate_tls): Likewise.
17576
17577 2008-03-25 Ben Elliston <bje@au.ibm.com>
17578
17579 * yyscript.y: Fix spelling error in comment.
17580
17581 2008-03-24 Ian Lance Taylor <iant@google.com>
17582
17583 * options.h (class General_options): Define build_id option.
17584 * layout.h (class Layout): Declare write_build_id, create_note,
17585 create_build_id. Add build_id_note_ member.
17586 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17587 "libiberty.h", "md5.h", "sha1.h".
17588 (Layout::Layout): Initialize eh_frame_data_,
17589 eh_frame_hdr_section_, and build_id_note_.
17590 (Layout::finalize): Call create_build_id.
17591 (Layout::create_note): New function, broken out of
17592 Layout::create_gold_note.
17593 (Layout::create_gold_note): Call create_note.
17594 (Layout::create_build_id): New function.
17595 (Layout::write_build_id): New function.
17596 (Close_task_runner::run): Call write_build_id.
17597
17598 * x86_64.cc: Correct license to GPLv3.
17599
17600 2008-03-23 Ian Lance Taylor <iant@google.com>
17601
17602 * options.cc: Include "demangle.h".
17603 (parse_optional_string): New function.
17604 (parse_long_option): Handle takes_optional_argument.
17605 (parse_short_option): Update dash_z initializer. Handle
17606 takes_optional_argument.
17607 (General_options::General_options): Initialize do_demangle_.
17608 (General_options::finalize): Set do_demangle_. Handle demangling
17609 style.
17610 * options.h (parse_optional_string): Declare.
17611 (struct One_option): Add optional_arg field. Update constructor.
17612 Update call constructor calls. Add takes_optional_argument
17613 function.
17614 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17615 (DEFINE_optional_string): Define.
17616 (General_options::demangle): Change from DEFINE_bool to
17617 DEFINE_optional_string.
17618 (General_options::no_demangle): New function.
17619 (General_options::do_demangle): New function.
17620 (General_options::set_do_demangle): New function.
17621 (General_options::execstack_status_): Move definition to end of
17622 class definition.
17623 (General_options::static_): Likewise.
17624 (General_options::do_demangle_): New field.
17625 * object.cc (big_endian>::get_symbol_location_info): Call
17626 Options::do_demangle, not Options::demangle.
17627 * symtab.cc (demangle): Likewise.
17628
17629 2008-03-22 Ian Lance Taylor <iant@google.com>
17630
17631 * gold.h: Include <cstddef> and <sys/types.h>
17632 * options.h: Include <cstring>.
17633
17634 2008-03-21 Ian Lance Taylor <iant@google.com>
17635
17636 * Added source code to GNU binutils.
17637 \f
17638 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17639
17640 Copying and distribution of this file, with or without modification,
17641 are permitted in any medium without royalty provided the copyright
17642 notice and this notice are preserved.
17643
17644 Local Variables:
17645 mode: change-log
17646 left-margin: 8
17647 fill-column: 74
17648 version-control: never
17649 End:
This page took 0.399296 seconds and 5 git commands to generate.