Make debug_msg.sh more open-minded about line numbers (needed for s390).
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
2
3 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
4
5 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
6
7 PR gold/18959
8 * stringpool.cc (Stringpool_template::new_key_offset): Align all
9 strings, even zero-length.
10 (Stringpool_template::set_string_offsets): Likewise.
11
12 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
13
14 * s390.cc: New file.
15 * Makefile.am (TARGETSOURCES): Add s390.cc.
16 (ALL_TARGETOBJS): Add s390.o.
17 * Makefile.in: Regenerate.
18 * configure.ac: Add s390 support.
19 * configure: Regenerate.
20 * configure.tgt: Add s390-*-* and s390x-*-*.
21 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
22 support.
23
24 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
25
26 * archive.cc (Archive::sym64name): New const.
27 (Archive::setup): Add support for SYM64 armap.
28 (Archive::read_armap): Likewise.
29 (Archive::interpret_header): Likewise.
30 (Archive::const_iterator::read_next_header): Likewise.
31 * archive.h (Archive::sym64name): New const.
32 (Archive::read_armap): Add mapsize template parameter.
33
34 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
35
36 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
37 target-specific entry size.
38 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
39 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
40 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
41 hash_entry_size.
42 * target.h (Target::hash_entry_size): New method.
43 (Target::Target_info::hash_entry_size): New data member.
44
45 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
46 * arm.cc (Target_arm::arm_info): Likewise.
47 (Target_arm_nacl::arm_nacl_info): Likewise.
48 * i386.cc (Target_i386::i386_info): Likewise.
49 (Target_i386_nacl::i386_nacl_info): Likewise.
50 (Target_iamcu::iamcu_info): Likewise.
51 * mips.cc (Target_mips::mips_info): Likewise.
52 (Target_mips_nacl::mips_nacl_info): Likewise.
53 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
54 * sparc.cc (Target_sparc::sparc_info): Likewise.
55 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
56 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
57 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
58 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
59
60 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
61
62 PR gold/19177
63 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
64 and R_386_GOT32X relocations without base register.
65
66 2015-10.27 Han Shen <shenhan@google.com>
67
68 PR gold/19042 - unsupported reloc 311/312.
69
70 * aarch64.cc (Target_aarch64::Scan::local): Add support for
71 reloc 311/312.
72
73 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
74
75 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
76 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
77 as R_X86_64_GOTPCREL.
78 (Target_x86_64<size>::Scan::local): Likewise.
79 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
80 Likewise.
81 (Target_x86_64<size>::Scan::global): Likewise.
82 (Target_x86_64<size>::Relocate::relocate): Likewise.
83 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
84 Likewise.
85
86 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
87
88 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
89 R_386_GOT32X the same as R_386_GOT32.
90 (Target_i386::Scan::local): Likewise.
91 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
92 (Target_i386::Scan::global): Likewise.
93 (Target_i386::Relocate::relocate): Likewise.
94 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
95 Likewise.
96
97 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
98
99 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
100 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
101 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
102 x86_64_mov_to_lea1.o.
103 * testsuite/Makefile.in: Regenerated.
104
105 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
106
107 PR gold/19119
108 * options.h (General_options): Remove "obsolete" from -m.
109 * parameters.cc (set_parameters_target): Check if input target
110 is compatible with output emulation set by "-m emulation".
111
112 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
113
114 PR gold/19118
115 * i386.cc (Target_iamcu): New class.
116 (Target_selector_iamcu): Likewise.
117 (Target_iamcu::iamcu_info): New variable.
118 (target_selector_iamcu): Likewise.
119
120 2015-10-07 Andreas Schwab <schwab@suse.de>
121
122 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
123
124 2015-10-06 Cary Coutant <ccoutant@gmail.com>
125
126 PR gold/18855
127 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
128 parameter.
129 (Sparc_relocate_functions::gdop_lox10): Likewise.
130 (Target_sparc::Relocate::relocate): Use addend when computing
131 symbol value for R_SPARC_GOTDATA_OP*.
132
133 2015-09-07 Cary Coutant <ccoutant@gmail.com>
134
135 PR gold/18930
136 PR gold/18886
137 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
138 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
139
140 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
141
142 PR gold/18886
143 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
144 shared libraries into normal FUNC symbols.
145 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
146 symbols aren't from shared libraries.
147
148 2015-09-02 Alan Modra <amodra@gmail.com>
149
150 PR 18878
151 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
152 (Target_powerpc::Branch_info::make_stub): Determine whether long
153 branch stub is for save/restore function.
154 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
155 (Stub_table): Add need_save_res_.
156 (Stub_table:clear_stubs): Clear need_save_res_.
157 (Stub_table:set_address_and_size): Add save/restore section size.
158 (Stub_table::add_long_branch_entry): Add save_res param. Set
159 need_save_res_, but don't add space for save/restore stubs.
160 (Stub_table::find_long_branch_entry): Return offset to local copy
161 of save/restore func.
162 (Stub_table::do_write): Don't output save/restore stubs. Instead
163 copy the save/restore functions.
164 (Output_data_save_res:contents): New accessor.
165 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
166
167 2015-08-25 Cary Coutant <ccoutant@gmail.com>
168
169 PR gold/18847
170 * script-sections.cc (Memory_region::set_address): New method.
171 (Script_sections::find_memory_region): Add explicit_only parameter.
172 (Output_section_definition::set_section_addresses): Handle case where
173 script specifies both address and vma region.
174 * script-sections.h (Script_sections::find_memory_region): Add
175 explicit_only parameter.
176
177 2015-08-25 Cary Coutant <ccoutant@gmail.com>
178
179 PR gold/18859
180 * object.cc (Input_objects::add_object): Store objects in a map,
181 indexed by soname; update as-needed flag when necessary.
182 * object.h (Object::clear_as_needed): New method.
183 (Input_objects::so_names_): Change from set to map.
184
185 2015-08-25 Cary Coutant <ccoutant@gmail.com>
186
187 PR gold/14746
188 * expression.cc (Expression::Expression_eval_info): Add
189 is_valid_pointer field.
190 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
191 Adjust all callers.
192 (Addr_expression::value_from_output_section): Check whether address
193 is valid.
194 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
195 if evaluation failed due to address that is not yet valid.
196 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
197 parameter.
198
199 2015-08-25 Cary Coutant <ccoutant@gmail.com>
200
201 PR gold/18866
202 PR gold/18703
203 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
204
205 2015-08-20 Alan Modra <amodra@gmail.com>
206
207 PR gold/18846
208 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
209 Subtract os->address() from addend.
210 * powerpc.cc (relocate_relocs): Likewise.
211
212 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
213
214 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
215 lazy_stub_normal_1, lazy_stub_normal_1_n64,
216 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
217 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
218 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
219 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
220 of 'addu/daddu'.
221
222 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
223
224 * configure: Regenerated.
225
226 2015-07-26 Doug Kwan <dougkwan@google.com>
227
228 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
229 disassembler output format.
230
231 2015-07-23 Ian Coolidge <icoolidge@google.com>
232 Plumb --pic-veneer option for gold.
233
234 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
235 generation.
236 * options.h (General_options): Add --pic-veneer option.
237
238 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
239
240 PR gold/18663
241 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
242 script_test_1a.cc script_test_1b.cc.
243 (script_test_11_r.o): Replace script_test_11.o with
244 script_test_11a.o script_test_11b.o.
245 (script_test_11.o): Removed.
246 (script_test_11a.o): New.
247 (script_test_11b.o): Likewise.
248 * testsuite/Makefile.in: Regenerated.
249 * testsuite/script_test_1.h: New file.
250 * testsuite/script_test_1b.cc: Likewise.
251 * testsuite/script_test_11.h: Likewise.
252 * testsuite/script_test_11b.c: Likewise.
253 * testsuite/script_test_1.cc: Renamed to ...
254 * testsuite/script_test_1a.cc: This.
255 Include "script_test_1.h".
256 (main): Call check_int and check_ptr.
257 * testsuite/script_test_11.c: Renamed to ...
258 * testsuite/script_test_11a.c: This.
259 Include "script_test_11.h".
260 (main): Call ptr_equal.
261
262 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
263
264 PR gold/18628
265 * testsuite/ifuncdep2.c (global): Change protected to hidden.
266 * testsuite/ifuncmod1.c (global): Likewise.
267 * testsuite/ifuncmod5.c (global): Likewise.
268
269 2015-07-22 Alan Modra <amodra@gmail.com>
270
271 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
272
273 2015-07-21 Cary Coutant <ccoutant@gmail.com>
274
275 PR gold/18548
276 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
277 forced local symbol even when oldsym != NULL.
278 (Symbol_table::do_define_in_output_segment): Likewise.
279 (Symbol_table::do_define_as_constant): Likewise.
280
281 2015-07-21 Cary Coutant <ccoutant@gmail.com>
282
283 PR gold/18698
284 * archive.cc (Library_base::should_include_member): Don't use entry
285 point for relocatable links, or if target is not yet valid.
286 * parameters.cc (Parameters::entry): Check target_valid().
287
288 2015-07-20 Han Shen <shenhan@google.com>
289
290 Optimize erratum 843419 fix.
291
292 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
293 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
294 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
295 (E843419_stub): New sub-class of Erratum_stub.
296 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
297 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
298 (AArch64_relobj::create_erratum_stub): Add 1 argument.
299 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
300
301 2015-07-20 Han Shen <shenhan@google.com>
302
303 Fix arm elf header flags wrt hardfp bit.
304
305 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
306
307 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
308
309 PR gold/18689
310 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
311 from input group section for relocatable link.
312 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
313 (check_DATA): Add pr18689.stdout.
314 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
315 (pr18689.stdout): New rule.
316 (pr18689a.o): Likewise.
317 (pr18689b.o): Likewise.
318 (pr18689.o): Likewise.
319 * testsuite/pr18689.c: New file.
320 * testsuite/pr18689.sh: Likewise.
321 * testsuite/Makefile.in: Regenerated.
322
323 2015-07-20 Yiran Wang <yiran@google.com>
324 Cary Coutant <ccoutant@gmail.com>
325
326 PR gold/15574
327 * resolve.cc (Symbol_table): Remove warning about references
328 from shared objects to hidden symbols.
329 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
330 * testsuite/Makefile.in: Regenerate.
331 * testsuite/hidden_test.sh: Check dynamic symbol table; update
332 expected error messages.
333
334 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
335
336 * compressed_output.cc (Output_compressed_section::set_final_data_size):
337 Make --compress-debug-sections=zlib the same as
338 --compress-debug-sections=zlib-gabi.
339 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
340 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
341 ".zdebug_".
342 * testsuite/Makefile.in: Regenerated.
343
344 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
345
346 PR gold/18322
347 * compressed_output.cc (zlib_compress): Add argument for
348 compression header size. Set header size to compression header
349 size if it isn't 0. Don't write out the zlib header here.
350 (Output_compressed_section::set_final_data_size): Support
351 zlib-gnu and zlib-gabi compressions. Pass compression header
352 size to zlib_compress and write out compression header. Set
353 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
354 clear the SHF_COMPRESSED bit
355 * options.h (compress_debug_sections): Add zlib-gnu and
356 zlib-gabi.
357 * output.h (Output_section::set_flags): New.
358 * testsuite/Makefile.am (check_PROGRAMS): Add
359 flagstest_compress_debug_sections_none,
360 flagstest_compress_debug_sections_gnu and
361 flagstest_compress_debug_sections_gabi.
362 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
363 flagstest_compress_debug_sections.stdout,
364 flagstest_compress_debug_sections.cmp,
365 flagstest_compress_debug_sections.check,
366 flagstest_compress_debug_sections_gnu.stdout,
367 flagstest_compress_debug_sections_gnu.cmp,
368 flagstest_compress_debug_sections_gnu.check,
369 flagstest_compress_debug_sections_gabi.stdout,
370 flagstest_compress_debug_sections_gabi.cmp and
371 flagstest_compress_debug_sections_gabi.check.
372 (flagstest_compress_debug_sections_none): New.
373 (flagstest_compress_debug_sections_none.stdout): Likewise.
374 (flagstest_compress_debug_sections.stdout): Likewise.
375 (flagstest_compress_debug_sections.check): Likewise.
376 (flagstest_compress_debug_sections.cmp): Likewise.
377 (flagstest_compress_debug_sections_gnu): Likewise.
378 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
379 (flagstest_compress_debug_sections_gnu.check): Likewise.
380 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
381 (flagstest_compress_debug_sections_gabi): Likewise.
382 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
383 (flagstest_compress_debug_sections_gnu.check): Likewise.
384 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
385 * testsuite/Makefile.in: Regenerated.
386
387 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
388
389 PR gold/18321
390 * compressed_output.h (decompress_input_section): Add arguments
391 for ELF class, big endian and sh_flags.
392 * compressed_output.cc (decompress_input_section): Likewise.
393 Support the SHF_COMPRESSED section.
394 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
395 functions.
396 * plugin.h (Pluginobj): Likewise.
397 * layout.cc (Layout::get_output_section_flags): Also clear the
398 SHF_COMPRESSED bit.
399 * object.h (Compressed_section_info): Add flag to store sh_flags.
400 (Object): Add pure virtual elfsize and is_big_endian member
401 functions.
402 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
403 prefix here.
404 (build_compressed_section_map): Check SHF_COMPRESSED for
405 uncompressed size. Store sh_flags in Compressed_section_info.
406 Pass size, big_endian and sh_flags to decompress_input_section.
407 Skip the ".debug"/".zdebug" prefix when passing section name to
408 need_decompressed_section.
409 (Sized_relobj_file<size, big_endian>::do_find_special_section):
410 Don't check ".zdebug_*" sections.
411 (Object::decompressed_section_contents): Pass ELF class, big
412 endian and sh_flags to decompress_input_section.
413 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
414 Likewise.
415 * testsuite/Makefile.am (check_DATA): Add
416 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
417 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
418 gdb_index_test_2_gabi.stdout.
419 (debug_msg_cdebug_gabi.o): New.
420 (odr_violation1_cdebug_gabi.o): Likewise.
421 (odr_violation2_cdebug_gabi.o): Likewise.
422 (debug_msg_cdebug_gabi.err): Likewise.
423 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
424 (gdb_index_test_cdebug_gabi.o): Likewise.
425 (gdb_index_test_2_gabi): Likewise.
426 (gdb_index_test_2_gabi.stdout): Likewise.
427 * testsuite/gdb_index_test_2_gabi.sh: New file.
428 * testsuite/Makefile.in: Regenerated.
429
430 2015-07-09 Han Shen <shenhan@google.com>
431
432 Use "gold_info" instead of "gold_warning" for erratum fix.
433
434 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
435 'gold_info'.
436 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
437
438 2015-07-09 Han Shen <shenhan@google.com>
439
440 Drop missing symbol warning for arm/aarch64.
441
442 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
443 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
444 symbol warning.
445
446 2015-07-07 Han Shen <shenhan@google.com>
447
448 Make gold aarch64 accept long form of mapping symbols.
449
450 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
451 of mapping symbols.
452
453 2015-06-29 Doug Kwan <dougkwan@google.com>
454
455 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
456 at address expected by test.
457 * testsuite/arm_cortex_a8_b.s: Ditto.
458 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
459 * testsuite/arm_cortex_a8_bl.s: Ditto.
460 * testsuite/arm_cortex_a8_blx.s: Ditto.
461 * testsuite/arm_cortex_a8_local.s: Ditto.
462 * testsuite/arm_fix_v4bx.s: Ditto.
463 * testsuite/arm_unaligned_reloc.s: Ditto.
464 * testsuite/thumb_bl_out_of_range.s: Ditto.
465 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
466 * testsuite/thumb_blx_out_of_range.s: Ditto.
467
468 2015-06-29 Han Shen <shenhan@google.com>
469
470 Patch for erratum 843419 internal error.
471
472 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
473 (Erratum_stub::update_erratum_insn): New method.
474 (Stub_table::relocate_stubs): Modified to place relocated insn.
475 (AArch64_relobj::fix_errata): Modified gold_assert.
476
477 2015-06-12 Han Shen <shenhan@google.com>
478
479 Fix erratum 835769.
480
481 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
482 defintion outside class definition.
483 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
484 (AArch64_insn_utilities::aarch64_op31): New member.
485 (AArch64_insn_utilities::aarch64_ra): New member.
486 (AArch64_insn_utilities::aarch64_mac): New member.
487 (AArch64_insn_utilities::aarch64_mlxl): New member.
488 (ST_E_835769): New global enum member.
489 (Stub_table::relocate_stubs): Add 835769 handler.
490 (Stub_template_repertoire::Stub_template_repertoire): Install new
491 stub type.
492 (AArch64_relobj::scan_errata): This func is renamed from
493 scan_erratum_843419.
494 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
495 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
496 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
497 (Target_aarch64::scan_erratum_835769_span): New method.
498 (Target_aarch64::create_erratum_stub): New method.
499 (Target_aarch64::is_erratum_835769_sequence): New method.
500 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
501 code into create_erratum_stub.
502 * options.h (fix_cortex_a53_835769): New option.
503
504 2015-06-11 Cary Coutant <ccoutant@gmail.com>
505
506 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
507 outside class body.
508 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
509
510 2015-06-11 Cary Coutant <ccoutant@gmail.com>
511
512 PR gold/17731
513 * layout.cc (corresponding_uncompressed_section_name): New function.
514 (Layout::choose_output_section): Call it.
515 * layout.h (corresponding_uncompressed_section_name): New function.
516 * script-sections.cc (Input_section_info::set_section_name): Check
517 for compressed debug section (.zdebug style).
518
519 2015-06-11 Jing Yu <jingyu@google.com>
520
521 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
522 * testsuite/Makefile.in: Regenerate.
523
524 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
525
526 * gold.h (is_cident): Correct typo.
527
528 2015-06-10 Han Shen <shenhan@google.com>
529 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
530
531 Now fixing for 843419 is fully functional.
532
533 The first part of the erratum fix CL is here -
534 https://sourceware.org/ml/binutils/2015-04/msg00229.html
535
536 * aarch64.cc(global enum): New constants representing stub types.
537 (Stub_template): New POD struct.
538 (Stub_template_repertoire): New class.
539 (Stub_base): New class.
540 (Erratum_stub): New class.
541 (Reloc_stub): Refactored to be a subclass of Stub_base.
542 (Reloc_stub::Stub_type): Removed.
543 (Reloc_stub::offset): Moved to Stub_base.
544 (Reloc_stub::set_offset): Moved to Stub_base.
545 (Reloc_stub::destination_address): Moved to Stub_base.
546 (Reloc_stub::set_destination_address): Moved to Stub_base.
547 (Reloc_stub::reset_destination_address): Moved to Stub_base.
548 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
549 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
550 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
551 (Reloc_stub::write): Moved to Stub_base.
552 (Reloc_stub::invalid_offset): Moved to Stub_base.
553 (Reloc_stub::invalid_address): Moved to Stub_base.
554 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
555 (Reloc_stub::stub_insns_): Moved to Stub_base.
556 (Reloc_stub::offset_): Moved to Stub_base.
557 (Reloc_stub::destination_address_): Moved to Stub_base.
558 (Stub_table::The_aarch64_relobj): New typedef.
559 (Stub_table::The_erratum_stub): New typedef.
560 (Stub_table::The_erratum_stub_less): New typedef.
561 (Stub_table::The_erratum_stub_set): New typedef.
562 (Stub_table::The_erratum_stub_set_iter): New typedef.
563 (Stub_table::empty): Added emptiness testing for erratum stubs.
564 (Stub_table::add_erratum_stub): New method to add an erratum stub.
565 (Stub_table::find_erratum_stub): New method.
566 (Stub_table::find_erratum_stubs_for_input_section): New method.
567 (Stub_table::erratum_stub_address): New method.
568 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
569 (Stub_table::do_addralign): Modified to handle erratum stubs.
570 (Stub_table::erratum_stubs_): New member.
571 (Stub_table::erratum_stub_size_): New member.
572 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
573 (Stub_table::do_write): Modified to handle erratum stubs.
574 (AArch64_relobj::The_erratum_stub): New typedef.
575 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
576 (AArch64_relobj::fix_errata): New method.
577 (Target_aarch64::The_reloc_stub_type): Removed.
578 (Target_aarch64::The_erratum_stub): New typede.
579 (AArch64_relocate_functions::construct_b): New method.
580
581 2015-06-08 Nick Clifton <nickc@redhat.com>
582
583 * po/fr.po: New French Translation.
584
585 2015-06-07 Cary Coutant <ccoutant@gmail.com>
586
587 PR gold/18288
588 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
589 callers. Don't use STT_COMMON to check for common symbols.
590 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
591 symbol that's not in a common section.
592 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
593 common symbols.
594
595 2015-06-04 Cary Coutant <ccoutant@gmail.com>
596
597 PR gold/18200
598 * Makefile.am (diststuff): Add target.
599 * Makefile.in: Regenerate.
600
601 2015-06-04 Cary Coutant <ccoutant@gmail.com>
602
603 PR gold/17498
604 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
605 temporary locals in merge sections.
606 * options.cc (General_options::parse_discard_all): New method.
607 (General_options::parse_discard_locals): New method.
608 (General_options::parse_discard_none): New method.
609 (General_options::General_options): Initialize discard_locals_.
610 * options.h (--discard-all): Convert to special option.
611 (--discard-locals): Likewise.
612 (--discard-none): New option.
613 (General_options::discard_all): New method.
614 (General_options::discard_locals): New method.
615 (General_options::discard_sec_merge): New method.
616 (General_options::Discard_locals): New enum.
617 (General_options::discard_locals_): New data member.
618
619 2015-06-03 Cary Coutant <cary@google.com>
620
621 * script-sections.cc (Script_sections::Script_sections): Initialize
622 segments_created_.
623 (Script_sections::create_note_and_tls_segments): Set flag when
624 segments are created.
625 (Script_sections::expected_segment_count): Count PT_INTERP.
626 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
627 segments are created.
628 * script-sections.h (Script_sections::segments_created_): New data
629 member.
630
631 2015-06-03 Cary Coutant <ccoutant@gmail.com>
632
633 PR gold/15370
634 * script-sections.cc
635 (Output_section_element_input::set_section_addresses): When there
636 are several patterns with no sort spec, put all sections in the same
637 bin.
638 * testsuite/Makefile.am (script_test_12): New testcase.
639 (script_test_12i): New testcase.
640 * testsuite/Makefile.in: Regenerate.
641 * testsuite/script_test_12.t: New test linker script.
642 * testsuite/script_test_12i.t: New test linker script.
643 * testsuite/script_test_12a.c: New test source file.
644 * testsuite/script_test_12b.c: New test source file.
645
646 2015-06-02 Cary Coutant <ccoutant@gmail.com>
647
648 * nacl.h (Sniff_file): Switch parameters to get_view to get an
649 aligned view.
650
651 2015-06-03 Cary Coutant <ccoutant@gmail.com>
652
653 PR gold/17819
654 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
655 separate task to schedule the build id computation.
656 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
657 add Output_file and offset.
658 (Hash_task::run): Get and release the input views.
659 (Hash_task::is_runnable): Always return NULL (always runnable).
660 (Layout::queue_build_id_tasks): Remove.
661 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
662 parameters; use them instead of class members.
663 (Build_id_task_runner::run): New function.
664 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
665 to write_build_id.
666 * layout.h (Layout::queue_build_id_tasks): Remove.
667 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
668 parameters.
669 (Layout::array_of_hashes_): Remove.
670 (Layout::size_of_array_of_hashes_): Remove.
671 (Layout::input_view_): Remove.
672 (Build_id_task_runner): New class.
673 (Close_task_runner::Close_task_runner): Add array_of_hashes and
674 size_of_hashes parameters.
675 (Close_task_runner::array_of_hashes_): New data member.
676 (Close_task_runner::size_of_hashes_): New data member.
677 * testsuite/Makefile.am
678 (flagstest_compress_debug_sections_and_build_id_tree): New test.
679 * testsuite/Makefile.in: Regenerate.
680
681 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
682
683 * merge.cc (get_input_merge_map): Update for data structure change.
684 (get_or_make_input_merge_map): Update for data structure change.
685 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
686 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
687
688 2015-05-16 Alan Modra <amodra@gmail.com>
689
690 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
691 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
692 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
693 (lis_0): Rename from lis_0_0.
694
695 2015-04-29 Cary Coutant <cary@google.com>
696 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
697
698 * gc.h (Garbage_collection::is_section_garbage): Change Object*
699 to Relobj*.
700 (Garbage_collection::add_reference): Likewise.
701 (Garbage_collection::gc_process_relocs): Likewise. Don't push
702 object/shndx pair onto *secvec for dynamic objects. Don't follow
703 relocations pointing to dynamic objects for GC.
704 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
705 (Icf::unfold_section): Likewise.
706 (Icf::is_section_folded): Likewise.
707 (Icf::get_folded_section): Likewise.
708 * icf.h: (Icf::get_folded_section): Likewise.
709 (Icf::unfold_section): Likewise.
710 (Icf::is_section_folded): Likewise.
711 (Icf::section_has_function_pointers): Likewise.
712 (Icf::set_section_has_function_pointers): Likewise.
713 * object.h (Section_id): Likewise.
714 (Const_section_id): Likewise.
715 * output.cc (Output_section::update_section_layout): Likewise.
716 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
717 Likewise.
718 * plugin.cc (update_section_order): Likewise.
719 (unique_segment_for_sections): Likewise.
720 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
721 (Target_powerpc::do_gc_add_reference): Likewise.
722 (Target_powerpc::gc_process_relocs): Likewise.
723 (Target_powerpc::do_gc_add_reference): Likewise.
724 * symtab.cc (Symbol_table::is_section_folded): Likewise.
725 (Symbol_table::gc_mark_symbol): Likewise.
726 * symtab.h: (Symbol_table::is_section_folded): Likewise.
727 * target.h: (Sized_target::gc_add_reference): Likewise.
728 (Sized_target::do_gc_add_reference): Likewise.
729
730 2015-04-29 Nick Clifton <nickc@redhat.com>
731
732 * po/fi.po: Updated Finnish translation.
733
734 2015-04-28 Alan Modra <amodra@gmail.com>
735
736 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
737 than unsigned int for find_global_entry result temp. Compare
738 against invalid_address.
739 (Target_powerpc::do_plt_address_for_global): Likewise.
740 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
741 on plt call stub existence for debug info. Do assert for plt
742 and global entry stub existence if an alloc section.
743
744 2015-04-28 Alan Modra <amodra@gmail.com>
745
746 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
747 on missing global entry stub due to bogus debug info.
748
749 2015-04-27 Han Shen <shenhan@google.com>
750
751 * options.h (--fix-cortex-a53-843419): Rename option.
752 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
753 option.
754 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
755
756 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
757
758 PR gold/18327
759 * output.cc (Output_section::is_input_address_mapped): Assume a missing
760 entry is mapped.
761 * testsuite/Makefile.am: Add the eh_test test.
762 * testsuite/Makefile.in: Regenerate.
763 * testsuite/eh_test_a.cc: New test.
764 * testsuite/eh_test_b.cc: New test.
765
766 2015-04-23 Sriraman Tallam <tmsriram@google.com>
767
768 * options.h (--weak-unresolved-symbols): New option.
769 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
770 binding to weak with new option.
771 * symtab.h (is_weak_undefined): Check for new option.
772 (is_strong_undefined): Check for new option.
773 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
774 * testsuite/Makefile.in: Regenerate.
775 * testsuite/weak_unresolved_symbols_test.cc: New file.
776
777 2015-04-20 Ian Coolidge <icoolidge@google.com>
778
779 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
780 GNU_UNIQUE.
781
782 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
783
784 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
785 push_back.
786 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
787 * object.cc (Sized_relobj_file::do_layout): Use push_back.
788 * powerpc.cc (process_gc_mark): Use push_back.
789 (Target_powerpc::do_gc_mark_symbol): Use push_back.
790 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
791
792 2015-04-16 Han Shen <shenhan@google.com>
793
794 * aarch64.cc (AArch64_insn_utilities): New utility class.
795 (AArch64_relobj::Mapping_symbol_position): New struct.
796 (AArch64_relobj::Mapping_symbol_info): New typedef.
797 (AArch64_relobj::do_count_local_symbols): New function overriding
798 parent's implementation.
799 (AArch64_relobj::mapping_symbol_info_): New member
800 (AArch64_relobj::scan_erratum_843419): New method.
801 (Target_aarch64::scan_erratum_843419_span): New method.
802 (Target_aarch64::is_erratum_843419_sequence): New method.
803 * options.h (fix_cortex_a53): New option.
804
805 2015-04-09 Cary Coutant <ccoutant@google.com>
806
807 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
808 in a PIE link.
809 * testsuite/Makefile.am (tls_pie_test.sh): New test.
810 * testsuite/Makefile.in: Regenerate.
811 * testsuite/tls_pie_test.sh: New.
812
813 2015-04-09 Cary Coutant <ccoutant@google.com>
814
815 * debug.h (DEBUG_LOCATION): New.
816 (DEBUG_ALL): Include DEBUG_LOCATION.
817 (debug_string_to_enum): Add DEBUG_LOCATION.
818 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
819 output to print correct context.
820 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
821 up to 4 more locations at the beginning of the function.
822 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
823 result before sorting list of line numbers.
824 * testsuite/debug_msg.sh: Allow range of line numbers for
825 canonical results on optimized code.
826
827 2015-04-07 HC Yen <hc.yen@mediatek.com>
828
829 Add AArch32 support for gold linker.
830 gold/
831 * arm.cc: Add V8 arch combine table.
832
833 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
834
835 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
836
837 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
838
839 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
840 to find by using the return value of insert.
841
842 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
843
844 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
845 constructor call.
846
847 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
848
849 PR gold/17641
850 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
851 (Target_x86_64::Scan::local): Don't create GOT entry, when we
852 can convert mov to lea.
853 (Target_x86_64::Scan::global): Ditto.
854 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
855 %reg to lea foo(%rip), %reg if possible.
856 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
857 * testsuite/x86_64_mov_to_lea1.s: New.
858 * testsuite/x86_64_mov_to_lea2.s: Ditto.
859 * testsuite/x86_64_mov_to_lea3.s: Ditto.
860 * testsuite/x86_64_mov_to_lea4.s: Ditto.
861 * testsuite/x86_64_mov_to_lea.sh: Ditto.
862
863 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
864
865 * configure: Regenerated.
866
867 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
868
869 PR gold/17640
870 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
871 (Target_i386::Scan::local): Don't create GOT entry, when we
872 can convert GOT to GOTOFF.
873 (Target_i386::Scan::global): Ditto.
874 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
875 lea foo@GOTOFF(%reg), %reg if possible.
876 * testsuite/Makefile.am (i386_mov_to_lea): New test.
877 * testsuite/i386_mov_to_lea1.s: New.
878 * testsuite/i386_mov_to_lea2.s: Ditto.
879 * testsuite/i386_mov_to_lea3.s: Ditto.
880 * testsuite/i386_mov_to_lea4.s: Ditto.
881 * testsuite/i386_mov_to_lea5.s: Ditto.
882 * testsuite/i386_mov_to_lea.sh: Ditto.
883
884 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
885
886 * Makefile.am (ZLIB): New.
887 (ZLIBINC): Likewise.
888 (AM_CFLAGS): Add $(ZLIBINC).
889 (AM_CXXFLAGS): Likewise.
890 (ldadd_varldadd_var): Add $(ZLIB).
891 (incremental_dump_LDADD): Likewise.
892 (dwp_LDADD): Likewise.
893 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
894 <zlib.h>.
895 (zlib_compress): Don't check HAVE_ZLIB_H.
896 (zlib_decompress): Likewise.
897 * options.h (compress_debug_sections): Likewise.
898 * configure.ac (AM_CONDITIONAL): Removed.
899 * testsuite/Makefile.am (ZLIB): New.
900 (LDADD): Add $(ZLIB).
901 Don't check HAVE_ZLIB.
902 * Makefile.in: Regenerated.
903 * config.in: Likewise.
904 * configure: Likewise.
905 * testsuite/Makefile.in: Likewise.
906
907 2015-03-30 Jing Yu <jingyu@google.com>
908
909 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
910 TLSLD_ADD_DTPREL_LO12_NC.
911 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
912 _TLS_MODULE_BASE_ point to the start of tls segment.
913 (Target_aarch64::optimize_tls_reloc): Add cases for
914 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
915 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
916 (Target_aarch64::Scan::local): Likewise.
917 (Target_aarch64::Scan::global): Likewise.
918 (Target_aarch64::Relocate::relocate): Likewise.
919 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
920 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
921 relocations.
922
923 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
924
925 * merge.cc (Object_merge_map::add_mapping): call
926 Object_merge_map::Input_merge_map::add_mapping.
927 (Object_merge_map::Input_merge_map::add_mapping): New.
928 (Output_merge_data::do_add_input_section): Call
929 get_or_make_input_merge_map before a loop.
930 (Output_merge_string<Char_type>::finalize_merged_data): Call
931 get_or_make_input_merge_map before a loop.
932 * merge.h (Object_merge_map): Make Input_merge_map public.
933 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
934 (Relobj::get_or_create_merge_map): New.
935 * object.h (Relobj::get_or_create_merge_map): New.
936
937 2015-03-24 Alan Modra <amodra@gmail.com>
938
939 PR 18147
940 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
941 relocation errors for branches to strong undefined symbols.
942
943 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
944
945 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
946 (Object_merge_map::is_merge_section_for): Remove.
947 (Object_merge_map::find_merge_section): New.
948 * merge.h (Object_merge_map::is_merge_section_for): Remove.
949 (Object_merge_map::find_merge_section): New.
950 (Object_merge_map::get_input_merge_map): Add a const version.
951 * object.cc (Relobj::is_merge_section_for): Remove.
952 (Relobj::find_merge_section): New.
953 * object.h (Relobj::is_merge_section_for): Remove.
954 (Relobj::find_merge_section): New.
955 * output.cc
956 (Output_section::Input_section::is_merge_section_for): Remove.
957 (Output_section::add_merge_input_section): Don't call
958 add_merge_input_section.
959 (Output_section::find_merge_section): Return const. Use
960 object->find_merge_section.
961 (Output_section::build_lookup_maps): Don't build a map for
962 merge sections.
963 (Output_section::is_input_address_mapped): Return false if
964 section is not found.
965 (Output_section::find_starting_output_address): Use
966 find_merge_section instead of is_merge_section_for.
967 (Output_section::add_script_input_section): Don't build a map for
968 merge sections.
969 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
970 (Output_section_lookup_maps::find_merge_section): Remove.
971 (Output_section_lookup_maps::add_merge_input_section) Remove.
972 (Output_section::find_merge_section): Return const.
973
974 2015-03-22 Cary Coutant <cary@google.com>
975
976 PR gold/18106
977 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
978 non-SIB form of lea, with nop after the call.
979
980 2015-03-21 Cary Coutant <cary@google.com>
981
982 PR gold/14217
983 * output.cc (Output_segment::is_first_section_relro): Don't ignore
984 .tdata section.
985 (Output_segment::set_section_addresses): Don't align size of relro
986 segment for .tbss.
987
988 2015-03-21 Cary Coutant <cary@google.com>
989
990 PR gold/18010
991 * stringpool.cc (Stringpool_template): Don't optimize if section
992 alignment is greater than sizeof(char).
993
994 2015-03-21 Cary Coutant <cary@google.com>
995
996 PR gold/18048
997 * script-c.h (script_include_directive): Add first_token parameter.
998 * script.cc (script_include_directive): Add first_token parameter, and
999 pass it to read_script_file.
1000 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1001 (PARSING_MEMORY_DEF): New tokens.
1002 (top): Add new productions for INCLUDE files.
1003 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1004 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1005 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1006 (section_cmd): Pass PARSING_SECTION_CMDS.
1007 (file_or_sections_cmd): Remove.
1008 (memory_def): Pass PARSING_MEMORY_DEF.
1009 * testsuite/Makefile.am (memory_test_2): New test.
1010 * testsuite/Makefile.in: Regenerate.
1011 * testsuite/memory_test_inc.t: New script file.
1012 * testsuite/memory_test_inc_1.t.src: New script file.
1013 * testsuite/memory_test_inc_2.t.src: New script file.
1014 * testsuite/memory_test_inc_3.t.src: New script file.
1015
1016 2015-03-21 Cary Coutant <cary@google.com>
1017
1018 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1019 (Sized_relobj_dwo::setup): Build compressed section map.
1020 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1021 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1022 section map.
1023 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1024 compressed_sections_ field.
1025 (build_compressed_section_map): Take Object instead of
1026 Sized_relobj_file parameter; add decompress_if_needed parameter.
1027 (Sized_relobj_file::do_find_special_sections): Store compressed
1028 section map in parent Object.
1029 (Sized_relobj_file::do_decompressed_section_contents): Move
1030 implementation to Object::decompressed_section_contents.
1031 (Sized_relobj_file::do_discard_decompressed_sections): Move
1032 implementation to Object::discard_decompressed_sections.
1033 * object.h (build_compressed_section_map): Declare.
1034 (Object::Object): Add compressed_sections_ field.
1035 (Object::section_is_compressed): Move implementation here.
1036 (Object::decompressed_section_contents): De-virtualize.
1037 (Object::discard_decompressed_sections): De-virtualize.
1038 (Object::do_section_is_compressed): Delete.
1039 (Object::do_decompressed_section_contents): Delete.
1040 (Object::set_compressed_sections): New method.
1041 (Object::compressed_sections): New method.
1042 (Object::compressed_sections_): New data member.
1043 (Compressed_section_info, Compressed_section_map): Move to top of file.
1044 (Sized_relobj_file::do_section_is_compressed): Delete.
1045 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1046 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1047 (Sized_relobj_file::compressed_sections_): Move to Object class.
1048
1049 2015-03-21 Cary Coutant <ccoutant@google.com>
1050
1051 PR gold/18152
1052 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1053 deferred objects.
1054
1055 2015-03-11 Cary Coutant <ccoutant@google.com>
1056
1057 * options.cc (General_options::finalize): Don't allow -z relro
1058 with incremental linking.
1059 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1060 (incremental_test_2): Likewise.
1061 (incremental_test_3): Likewise.
1062 (incremental_test_4): Likewise.
1063 (incremental_test_5): Likewise.
1064 (incremental_test_6): Likewise.
1065 (incremental_copy_test): Likewise.
1066 (incremental_common_test_1): Likewise.
1067 (incremental_comdat_test_1): Likewise.
1068 * testsuite/Makefile.in: Regenerate.
1069
1070 2015-03-09 Cary Coutant <ccoutant@google.com>
1071
1072 PR gold/14675
1073 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1074 return enum indicating whether .eh_frame section is empty, optimizable,
1075 unrecognized, or an end marker. Adjust explicit instantiations.
1076 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1077 (Eh_frame::add_ehframe_input_section): Change return type.
1078 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1079 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1080 to the .eh_frame output section until we see the end marker.
1081 (Layout::finalize_eh_frame_section): New.
1082 * layout.h: (Layout::finalize_eh_frame_section): New.
1083
1084 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1085
1086 * output.cc (Relobj::initialize_input_to_output_map<size>):
1087 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1088
1089 2015-03-04 Cary Coutant <ccoutant@google.com>
1090
1091 * parameters.cc (Parameters::set_target_once): Call
1092 Target::select_as_default_target just once from here...
1093 (set_parameters_target): ...instead of from here.
1094
1095 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1096
1097 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1098 Output_section_data instead of a Merge_map.
1099 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1100 (Eh_frame::read_cie): Use add_merge_mapping instead of
1101 Merge_map::add_mapping.
1102 (Eh_frame::read_fde): Ditto.
1103 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1104 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1105 merge_map_->get_output_offset.
1106 (Eh_frame::do_is_merge_section_for): Delete.
1107 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1108 instead of a Merge_map.
1109 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1110 Merge_map.
1111 (Eh_frame::do_is_merge_section_for): Delete.
1112 (Eh_frame::merge_map_): Delete.
1113 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1114 and use a Output_section_data instead of a Merge_map.
1115 (Object_merge_map::add_mapping): Ditto.
1116 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1117 (Object_merge_map::is_merge_section_for): Pass in and use a
1118 Output_section_data instead of a Merge_map.
1119 (Merge_map): Delete.
1120 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1121 of merge_map_.get_output_offset.
1122 (Output_merge_base::do_is_merge_section_for): Delete.
1123 (Output_merge_data::do_add_input_section): Use
1124 object->add_merge_mapping instead of add_mapping.
1125 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1126 * merge.h (Merge_map): Delete forward declaration.
1127 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1128 instead of a Merge_map.
1129 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1130 (Object_merge_map::is_merge_section_for): Pass in and use a
1131 Output_section_data instead of a Merge_map.
1132 (Input_merge_map::Object_merge_map::merge_map): Replace with
1133 output_data.
1134 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1135 Output_section_data instead of a Merge_map.
1136 (Merge_map): Delete.
1137 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1138 (Output_merge_base::do_is_merge_section_for): Delete.
1139 (Output_merge_base::add_mapping): Delete.
1140 (Output_merge_base::merge_map_): Delete.
1141 * object.cc (Relobj::initialize_input_to_output_map): New.
1142 (Relobj::initialize_input_to_output_map): New.
1143 (Relobj::merge_output_offset): New.
1144 (Relobj::is_merge_section_for): New.
1145 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1146 bits.
1147 * object.h (Relobj::merge_map): Delete.
1148 (initialize_input_to_output_map): New.
1149 (set_merge_map): Delete.
1150 (add_merge_mapping): New.
1151 (merge_output_offset): New.
1152 (is_merge_section_for): New.
1153 * output.cc (Output_section::Input_section::is_merge_section_for):
1154 Use object->is_merge_section_for.
1155 * output.h (Output_section_data::is_merge_section_for): Delete.
1156 (Output_section_data::do_is_merge_section_for): Delete.
1157 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1158 Use object->initialize_input_to_output_map.
1159 (Merged_symbol_value<size>::value_from_output_section): Use
1160 object->merge_output_offset.
1161
1162 2015-03-02 Peter Collingbourne <pcc@google.com>
1163 Cary Coutant <ccoutant@google.com>
1164
1165 * output.cc (Output_section::add_merge_input_section): Do not
1166 attempt to merge sections with an entsize of 0.
1167
1168 2015-03-02 Khem Raj <raj.khem@gmail.com>
1169
1170 * attributes.h (class Output_attributes_section_data ): Add
1171 do_print_to_mapfile function.
1172
1173 2015-02-24 Alan Modra <amodra@gmail.com>
1174
1175 PR 18010
1176 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1177 complain if value is not a multiple of four.
1178 (Target_powerpc::Relocate::relocate): Correct handling of
1179 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1180
1181 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1182
1183 * configure.ac (default_size): Set to 32 for x32.
1184 * configure: Regenerated.
1185
1186 2015-02-18 Alan Modra <amodra@gmail.com>
1187
1188 PR 17954
1189 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1190 visibility.
1191
1192 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1193
1194 * gc.h (Garbage_collection::add_reference): Don't use find.
1195
1196 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1197
1198 * object.cc (write_local_symbols): avoid std::vector copy.
1199
1200 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1201
1202 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1203
1204 2015-02-09 Mark Wielaard <mjw@redhat.com>
1205
1206 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1207 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1208
1209 2015-02-16 Cary Coutant <ccoutant@google.com>
1210
1211 PR gold/13577
1212 PR gold/16992
1213 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1214 DF_SYMBOLIC if --dynamic-list option is used.
1215 * options.cc (General_options::finalize): --dynamic-list is not
1216 mutually exclusive with -Bsymbolic.
1217 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1218 listed in --dynamic-list.
1219 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1220 -Bsymbolic-functions.
1221 * testsuite/Makefile.in: Regenerate.
1222
1223 2015-02-16 Cary Coutant <ccoutant@google.com>
1224
1225 PR gold/17971
1226 * incremental.cc: Remove redundant include of "output.h".
1227
1228 2015-02-12 Jing Yu <jingyu@google.com>
1229
1230 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1231 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1232 New relocation.
1233 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1234 TLSLE_MOVW_* relocations.
1235 (Target_aarch64::Scan::global): Likewise.
1236 (Target_aarch64::Relocate::relocate): Likewise.
1237 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1238 for new TLSLE_MOVW_* relocations.
1239
1240 2015-02-11 Will Newton <will.newton@linaro.org>
1241
1242 PR gold/13321
1243 * arm.cc (Target_arm::make_plt_section): Create an ARM
1244 state mapping symbol at the start of the PLT.
1245
1246 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1247
1248 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1249 Replace two_file_shared_2.so with two_file_shared_1.so.
1250 * testsuite/Makefile.in: Regenerated.
1251
1252 2015-02-09 Alan Modra <amodra@gmail.com>
1253
1254 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1255 plugin_test_thin.a and defsym_test.
1256 * testsuite/Makefile.in: Regenerate.
1257
1258 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1259
1260 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1261 body.
1262
1263 2015-02-04 Peter Collingbourne <pcc@google.com>
1264
1265 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1266 forwarding symbols when computing symbol resolution info for plugins.
1267 * plugin.h (Plugin_manager::symtab): New method.
1268 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1269
1270 2015-02-03 Cary Coutant <ccoutant@google.com>
1271 Peter Collingbourne <pcc@google.com>
1272
1273 PR gold/15660
1274 * archive.cc (Thin_archive_object_unlocker): New class.
1275 (Archive::include_member): Unlock external members of thin archives.
1276 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1277 (plugin_test_2): Likewise.
1278 (plugin_test_3): Likewise.
1279 (plugin_test_4): Likewise.
1280 (plugin_test_5): Likewise.
1281 (plugin_test_6): Likewise.
1282 (plugin_test_7): Likewise.
1283 (plugin_test_8): Likewise.
1284 (plugin_test_9): Likewise.
1285 (plugin_test_10): Likewise.
1286 (plugin_test_11): New test case.
1287 * testsuite/Makefile.in: Regenerate.
1288 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1289 file to decide whether to claim file.
1290 (all_symbols_read_hook): Likewise.
1291 * testsuite/plugin_test_1.sh: Adjust expected output.
1292 * testsuite/plugin_test_2.sh: Likewise.
1293 * testsuite/plugin_test_3.sh: Likewise.
1294 * testsuite/plugin_test_6.sh: Likewise.
1295 * testsuite/plugin_test_tls.sh: Likewise.
1296 * testsuite/plugin_test_11.sh: New testcase.
1297
1298 2015-02-03 Cary Coutant <ccoutant@google.com>
1299
1300 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1301 file descriptors when debugging enabled. Add debug output.
1302 (Descriptors::release): Add debug output.
1303 (Descriptors::close_some_descriptor): Likewise.
1304 (Descriptors::close_all): Likewise.
1305 * fileread.cc (File_read::lock): Likewise.
1306 (File_read::unlock): Likewise.
1307
1308 2015-02-02 Cary Coutant <ccoutant@google.com>
1309
1310 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1311 executable output file.
1312
1313 2015-01-22 Han Shen <shenhan@google.com>
1314
1315 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1316 (Target_arm::do_plt_address_for_global): New method.
1317 (Target_arm::do_plt_address_for_local): New method.
1318 (Target_arm::rel_irelative_section): New method.
1319 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1320 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1321 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1322 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1323 (Target_arm::Scan::check_non_pic): Add ifunc support.
1324 (Target_arm::Scan::local): Add ifunc support.
1325 (Target_arm::Scan::global): Add ifunc support.
1326 (Target_arm::make_plt_section): New method.
1327 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1328 (Target_arm::make_local_ifunc_plt_entry): New method.
1329 (Target_arm::got_irelative_): New member.
1330 (Target_arm::rel_irelative_): New member.
1331 (Target_arm::got_section): Add creation for got_irelative_.
1332 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1333 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1334 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1335 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1336 (Output_data_plt_arm::IRelative_data): New type.
1337 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1338 (Output_data_plt_arm::add_entry): Add more parameters.
1339 (Output_data_plt_arm::add_relocation): New method.
1340 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1341 (Output_data_plt_arm::rel_irelative): New method.
1342 (Output_data_plt_arm::entry_count): Modified.
1343 (Output_data_plt_arm::address_for_global): New method.
1344 (Output_data_plt_arm::address_for_local): New method.
1345 gold/
1346 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1347 (Output_data_plt_arm::insert_irelative_data): New method.
1348 (Output_data_plt_arm::irelative_rel_): New member.
1349 (Output_data_plt_arm::got_): New member.
1350 (Output_data_plt_arm::got_irelative_): New member.
1351 (Output_data_plt_arm::irelative_count_): New member.
1352 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1353 (Output_data_plt_arm::irelative_data_vec_): New member.
1354 (Output_data_plt_arm::do_write): Write out irelative entries.
1355 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1356 more parameters to ctor.
1357 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1358 more parameters to ctor.
1359 * output.h (Output_data_reloc::add_local_relative): New method.
1360 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1361
1362 2015-01-29 Alan Modra <amodra@gmail.com>
1363
1364 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1365 and GOT_TLSGD to LE optimization.
1366
1367 2015-01-28 Cary Coutant <ccoutant@google.com>
1368
1369 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1370 for undef TLS symbols.
1371 (Target_x86_64::Relocate::relocate_tls): Likewise.
1372 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1373
1374 2015-01-25 Cary Coutant <ccoutant@google.com>
1375
1376 * output.cc (Output_segment::set_section_addresses): Fix calculation
1377 of size of relro segment.
1378
1379 2015-01-22 Alan Modra <amodra@gmail.com>
1380
1381 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1382 condition for need of ifunc plt entry.
1383 (Target_powerpc::Scan::global <got relocs>): Likewise.
1384
1385 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1386
1387 * mips.cc (reloc_high): Add r_sym.
1388 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1389 reloc_high constructor.
1390 (Mips_relocate_functions::relgot16_local): Likewise.
1391 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1392 r_type to decide whether LO16 matches HI16.
1393 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1394 rello16 and relgot16_local.
1395
1396 2015-01-09 Cary Coutant <ccoutant@google.com>
1397
1398 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1399 unless alignment is larger than page size.
1400
1401 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1402 Cary Coutant <ccoutant@google.com>
1403
1404 PR gold/17729
1405 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1406 (DEFAULT_TARGET_X32): Set for x32.
1407 * x86_64.cc (cmp_insn_32): New.
1408 (lea_r10_insn_32): Likewise.
1409 (lea_r11_insn_32): Likewise.
1410 (cmp_insn_64): Likewise.
1411 (lea_r10_insn_64): Likewise.
1412 (lea_r11_insn_64): Likewise.
1413 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1414 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1415 (check_DATA): Add split_x32 files.
1416 (split_x32_[1234n].o): New targets.
1417 (split_x32_[124]): New targets.
1418 (split_x32_[1234r].stdout): New targets.
1419 * testsuite/split_x32.sh: New file.
1420 * testsuite/split_x32_1.s: Likewise.
1421 * testsuite/split_x32_2.s: Likewise.
1422 * testsuite/split_x32_3.s: Likewise.
1423 * testsuite/split_x32_4.s: Likewise.
1424 * testsuite/split_x32_n.s: Likewise.
1425 * configure: Regenerated.
1426 * testsuite/Makefile.in: Likewise.
1427
1428 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1429
1430 PR gold/17809
1431 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1432 x32.
1433
1434 2015-01-02 Alan Modra <amodra@gmail.com>
1435
1436 * version.cc (print_version): Just print current year.
1437 * dwp.cc (print_version): Likewise.
1438
1439 2015-01-01 Alan Modra <amodra@gmail.com>
1440
1441 Update year range in copyright notice of all files.
1442
1443 2014-12-25 Alan Modra <amodra@gmail.com>
1444
1445 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1446 new enums.
1447 (Target_arm::merge_object_attributes, ): Likewise.
1448
1449 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1450
1451 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1452 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1453 AEABI_VFP_args_vfp to check that.
1454 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1455 value and replace hardcoded values by enum values.
1456
1457 2014-12-22 Cary Coutant <ccoutant@google.com>
1458
1459 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1460
1461 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1462
1463 PR gold/14608
1464 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1465 to "return i * i * 3;".
1466
1467 2014-12-16 Cary Coutant <ccoutant@google.com>
1468
1469 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1470 (Mapfile::print_output_data): Use current_data_size() to avoid
1471 assert for sections requiring postprocessing; if address is not valid,
1472 print 0.
1473 (Mapfile::print_output_section): Use current_data_size(); print note
1474 that addresses and sizes are before compression.
1475
1476 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1477
1478 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1479 Cast current_group_size to unsigned long when reporting error.
1480
1481 2014-12-10 Jing Yu <jingyu@google.com>
1482
1483 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1484 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1485 Update error message.
1486 (Target_aarch64::do_relax): Use absolute value of option
1487 stub_group_size. Replace local variable with class member
1488 stub_group_size_.
1489
1490 2014-12-04 Alan Modra <amodra@gmail.com>
1491
1492 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1493 addend of PLTREL24 reloc when not generating a plt stub. Make
1494 max_branch_offset an "Address".
1495 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1496 (Target_powerpc::Relocate::relocate): Likewise.
1497
1498 2014-12-04 Alan Modra <amodra@gmail.com>
1499
1500 PR 17670
1501 * symtab.cc (Symbol::set_undefined): Remove assertion.
1502 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1503 on symbols defined in discarded sections, instead return false.
1504 Rearrange params, update all callers.
1505 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1506 branches to syms in discarded sections.
1507 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1508 undefined and flag as discarded.
1509 (Target_powerpc::Relocate::relocate): Localize variable.
1510
1511 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1512
1513 PR gold/17675
1514 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1515 * testsuite/Makefile.in: Regenerated.
1516
1517 2014-12-03 Alan Modra <amodra@gmail.com>
1518
1519 PR 17566
1520 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1521 when adding dynamic relocations against section symbols.
1522
1523 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1524
1525 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1526 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1527 * options.h (General_options): New -z option (global).
1528
1529 2014-12-01 Cary Coutant <ccoutant@google.com>
1530
1531 PR gold/17578
1532 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1533 is given.
1534 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1535 given but some inputs require executable stack.
1536
1537 2014-11-26 Cary Coutant <ccoutant@google.com>
1538
1539 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1540 .debug_str_offsets; strip .debug_gnu_pubnames and
1541 .debug_gnu_pubtypes.
1542 (lines_only_debug_sections): Strip all four new sections.
1543
1544 2014-11-26 Jing Yu <jingyu@google.com>
1545
1546 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1547 register to be x0 when to relax TLSDESC_LD64_LO12.
1548
1549 2014-11-26 Alan Modra <amodra@gmail.com>
1550
1551 * powerpc.cc (struct Stub_table_owner): New.
1552 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1553 unsigned int vector. Update all references.
1554 (powerpc_relobj::set_stub_table): Take an unsigned int param
1555 rather than a Stub_table. Update callers.
1556 (Powerpc_relobj::clear_stub_table): New function.
1557 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1558 stub_group_size_ vars.
1559 (Target_powerpc::new_stub_table): Delete.
1560 (max_branch_delta): New function, extracted from..
1561 (Target_powerpc::Relocate::relocate): ..here..
1562 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1563 status on whether stub created successfully.
1564 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1565 default sizing to..
1566 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1567 reduce on relax failure.
1568 (Target_powerpc::group_sections): Add "no_size_errors" param.
1569 Use stub_group_size_. Set up group info in a temp vector,
1570 before building Stub_table vector. Account for input sections
1571 possibly already converted to relaxed sections.
1572 (Stub_table::init): Delete. Merge into..
1573 (Stub_table::Stub_table): ..here.
1574 (Stub_table::can_reach_stub): New function.
1575 (Stub_table::add_plt_call_entry): Add "from" parameter and
1576 return true iff stub could be reached.
1577 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1578 param too.
1579 (Stub_table::clear_stubs): Add "all" param.
1580
1581 2014-11-26 Alan Modra <amodra@gmail.com>
1582
1583 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1584 (Target_powerpc::group_sections): Use it.
1585
1586 2014-11-25 Cary Coutant <ccoutant@google.com>
1587
1588 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1589 (Binary_to_elf::write_symbol): Add st_size parameter.
1590 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1591
1592 2014-11-25 Cary Coutant <ccoutant@google.com>
1593
1594 PR gold/17639
1595 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1596 (Sized_relobj_file::do_layout): Handle deferred sections properly
1597 during GC pass 1. Don't add reloc sections to deferred list twice.
1598 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1599 (Sized_relobj_file::is_deferred_layout_): New data member.
1600
1601 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1602
1603 PR gold/17619
1604 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1605 Check PC-relative offset overflow in PLT entry.
1606
1607 2014-11-21 Alan Modra <amodra@gmail.com>
1608
1609 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1610 for undefined weaks.
1611
1612 2014-11-20 Alan Modra <amodra@gmail.com>
1613
1614 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1615 from --stub-group-size parameter divided by 1024.
1616 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1617 template parameter. Update all uses.
1618 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1619 has_stub_value. Set for long branches. Don't report overflow for
1620 branch to undefined weak symbols. Print info message on
1621 overflowing branch to stub.
1622
1623 2014-11-20 Alan Modra <amodra@gmail.com>
1624
1625 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1626
1627 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1628
1629 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1630 entry for R_X86_64_GOTPLT64.
1631 (Target_x86_64<size>::Relocate::relocate): Update comments for
1632 R_X86_64_GOTPLT64.
1633
1634 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1635
1636 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1637 * plugin.h: add lock definition
1638
1639 2014-10-29 Han Shen <shenhan@google.com>
1640 Jing Yu <jingyu@google.com>
1641
1642 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1643 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1644 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1645 Symbol::TLS_REF.
1646 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1647 method.
1648 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1649 (Target_aarch64::tls_ld_to_le): New method.
1650 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1651 for 64bit targets.
1652 (Output_data_plt_aarch64::irelative_rel_): New data member.
1653 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1654 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1655 (Output_data_plt_aarch64::add_relocation): New method.
1656 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1657 offset. Add got_irelative size to got size.
1658 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1659 type string with the new typename.
1660 (AArch64_relocate_functions::update_adr): Replace parameter x with
1661 immed.
1662 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1663 (AArch64_relocate_functions::reloc_common): New method.
1664 (AArch64_relocate_funcsions::rela_general): Extract common part out
1665 into reloc_common method.
1666 (AArch64_relocate_functions::rela_general): Likewise.
1667 (AArch64_relocate_functions::pcrela_general): Likewise.
1668 (AArch64_relocate_functions::adr): New method.
1669 (AArch64_relocate_functions::adrp): Calculate immed before calling
1670 update_adr.
1671 (AArch64_relocate_functions::adrp): Likewise.
1672 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1673 comparing x to 0. Calculate immed from ~x when x < 0.
1674 (Target_aarch64::optimize_tls_reloc): Add new cases for
1675 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1676 TLSLD_MOVW_DTPREL_G0_NC.
1677 (Target_aarch64::possible_function_pointer_reloc): Implement this
1678 method.
1679 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1680 comment.
1681 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1682 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1683 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1684 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1685 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1686 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1687 (Target_aarch64::make_plt_entry): Call add_entry with two more
1688 parameters.
1689 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1690 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1691 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1692 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1693 (Target_aarch64::Relocate::relocate_tls): Add cases for
1694 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1695 TLSLD_MOVW_DTPREL_G0_NC.
1696 * testsuite/icf_safe_so_test.cc: Correct test comment.
1697 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1698
1699 2014-10-22 Alan Modra <amodra@gmail.com>
1700
1701 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1702 thread_starter.
1703
1704 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1705
1706 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1707
1708 2014-10-17 Cary Coutant <ccoutant@google.com>
1709
1710 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1711 Add "typename" keyword.
1712
1713 2014-10-15 Han Shen <shenhan@google.com>
1714 Jing Yu <jingyu@google.com>
1715
1716 Patch for gold aarch64 backend to support relaxation.
1717 * aarch64-reloc.def: Change format.
1718 * aarch64.cc (class Reloc_stub): New class.
1719 (class Stub_table): New class.
1720 (class AArch64_relobj): New class.
1721 (class AArch64_input_section): New class.
1722 (class AArch64_output_section): New class.
1723 (Target_aarch64::new_stub_table): New method.
1724 (Target_aarch64::new_aarch64_input_section): New method.
1725 (Target_aarch64::find_aarch64_input_section): New method.
1726 (Target_aarch64::scan_section_for_stubs): New method.
1727 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1728 (Target_aarch64::relocate_stub): New method.
1729 (Target_aarch64::current_target): New method.
1730 (Target_aarch64::do_make_elf_object): New method.
1731 (Target_aarch64::do_may_relax): New method.
1732 (Target_aarch64::do_relax): New method.
1733 (Target_aarch64::group_sections): New method.
1734 (Target_aarch64::scan_reloc_for_stub): New method.
1735 (Target_aarch64::do_make_output_section): New method.
1736 (Target_aarch64::stub_tables_): New data member.
1737 (Target_aarch64::aarch64_input_section_map_): New data member.
1738 (AArch64_relocate_functions::maybe_apply_stub): New method.
1739
1740 2014-09-30 Cary Coutant <ccoutant@google.com>
1741
1742 PR gold/17432
1743 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1744
1745 2014-09-30 Kito Cheng <kito@0xlab.org>
1746
1747 PR gold/13597
1748 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1749 hash table before sysv-style hash table.
1750
1751 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1752
1753 * options.h (--pic-executable): Add negative to alias to -no-pie.
1754
1755 2014-09-26 Cary Coutant <ccoutant@google.com>
1756
1757 PR gold/16773
1758 * object.cc (Sized_relobj_file): Compute value of section symbols
1759 for TLS sections the same as TLS symbols.
1760
1761 2014-09-25 Cary Coutant <ccoutant@google.com>
1762
1763 PR gold/17432
1764 * resolve.cc (Symbol_table::resolve): Override common placeholder
1765 symbols, but adjust sizes.
1766 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1767 symbols to common lists.
1768
1769 2014-09-24 Alan Modra <amodra@gmail.com>
1770
1771 * po/POTFILES.in: Regenerate.
1772
1773 2014-09-23 Taiju Tsuiki <tzik@google.com>
1774 Cary Coutant <ccoutant@google.com>
1775
1776 PR gold/14860
1777 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1778 on input_sections_blocker.
1779 * layout.cc (Write_sections_task::locks): Unblock
1780 input_sections_blocker_.
1781 * layout.h (Write_sections_task::Write_sections_task): Add
1782 input_sections_blocker.
1783 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1784 to DEPENDENCIES.
1785 * testsuite/Makefile.in: Regenerate.
1786
1787 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1788
1789 * testsuite/Makefile.am (plugin_test_10): New test.
1790 * testsuite/Makefile.in: Regenerate
1791 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1792 * testsuite/plugin_test_10.sh: New file.
1793
1794 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1795
1796 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1797 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1798 during the replacement phase.
1799
1800 2014-09-17 Han Shen <shenhan@google.com>
1801 Jing Yu <jingyu@google.com>
1802
1803 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1804 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1805 * aarch64.cc (Target_aarch64): Add data members
1806 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1807 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1808 constructor.
1809 (Target_aarch64::do_reloc_symbol_index): New method.
1810 (Target_aarch64::do_reloc_addend): New method.
1811 (Target_aarch64::add_tlsdesc_info): New method.
1812 (Target_aarch64::do_dynsym_value): New method.
1813 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1814 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1815 (Target_aarch64::make_data_plt): Add new parameters: got,
1816 got_irelative. Pass them to do_make_data_plt.
1817 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1818 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1819 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1820 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1821 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1822 (Target_aarch64::got_tlsdesc_section): New method.
1823 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1824 (Target_aarch64::define_tls_base_symbol): New method.
1825 (Target_aarch64::reserve_tlsdesc_entries): New method.
1826 (Target_aarch64::got_mod_index_entry): New method.
1827 (Target_aarch64::rela_tlsdesc_section): New method.
1828 (Target_aarch64::rela_irelative_section): New method.
1829 (Target_aarch64::Tlsdesc_info): New struct.
1830 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1831 relocations and tlsdesc relocations.
1832 (Target_aarch64::optimize_tls_reloc): Implement method.
1833 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1834 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1835 in constructor.
1836 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1837 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1838 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1839 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1840 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1841 (Output_data_plt_aarch64::rela_irelative): New method.
1842 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1843 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1844 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1845 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1846 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1847 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1848 (Output_data_plt_aarch64_standard): New member variables:
1849 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1850 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1851 New parameter: got, got_irelative.
1852 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1853 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1854 (Output_data_plt_aarch64::do_write): Replace got_address with
1855 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1856 (AArch64_relocate_functions::update_movnz): New method.
1857 (AArch64_relocate_functions): Correct format.
1858 (AArch64_relocate_functions::movnz): New method.
1859 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1860 before the switch. Add new cases to switch.
1861 Check ie_to_le relaxation on tlsie relocations. Add code handling
1862 tlsgd tlsdesc cases.
1863 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1864 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1865 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1866 Call reloc_name_in_error_message to print unsupported reloc.
1867 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1868 make_data_plt.
1869 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1870 relocs. Fill in some more dynamic tags.
1871 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1872 Skip call tls_get_addr when tlsgd is relaxed.
1873 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1874 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1875 tlsdesc->ie relaxation.
1876
1877 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1878
1879 * mips.cc (Target_mips_nacl): New class.
1880 (Target_selector_mips_nacl): New class.
1881 (target_selector_mips32): Rename from target_selector_mips32be and use
1882 Target_selector_mips_nacl instead of Target_selector_mips.
1883 (target_selector_mips32el): Rename from target_selector_mips32 and use
1884 Target_selector_mips_nacl instead of Target_selector_mips.
1885 (target_selector_mips64): Rename from target_selector_mips64be and use
1886 Target_selector_mips_nacl instead of Target_selector_mips.
1887 (target_selector_mips64el): Rename from target_selector_mips64 and use
1888 Target_selector_mips_nacl instead of Target_selector_mips.
1889 (Target_mips::mips_info): Add const attribute.
1890
1891 2014-09-02 Cary Coutant <ccoutant@google.com>
1892
1893 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1894 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1895 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1896 (Sized_incr_dynobj::do_section_name): Likewise.
1897 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1898 (Sized_incr_dynobj::do_section_name): Likewise.
1899 * object.h (Object::section_name): Likewise.
1900 (Object::do_section_name): Likewise.
1901 (Sized_relobj_file::do_section_name): Likewise.
1902 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1903 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1904
1905 2014-09-02 Cary Coutant <ccoutant@google.com>
1906
1907 PR gold/17005
1908 * ehframe.cc (Fde::write): Add output_offset parameter.
1909 (Cie::write): Likewise.
1910 (Eh_frame::set_final_data_size): Account for offset within output
1911 section.
1912 (Eh_frame::do_sized_write): Likewise.
1913 * ehframe.h (Fde::write): Add output_offset parameter.
1914 (Cie::write): Likewise.
1915 * output.cc (Output_section::Input_section_sort_entry): Remove
1916 section_has_name_; add output_section_name parameter. Use
1917 output section name for non-input sections.
1918 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1919 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1920 (Output_section::Input_section_sort_compare): Remove logic for
1921 sections without names.
1922 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1923 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1924 Likewise.
1925 (Output_section::Input_section_sort_section_name_compare): Likewise.
1926
1927 2014-08-29 Han Shen <shenhan@google.com>
1928 Jing Yu <jingyu@google.com>
1929
1930 * aarch64-reloc-property.cc
1931 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1932 reference reloc property in the table.
1933 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1934 3 other entries.
1935 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1936 2 new overloaded methods.
1937 (Output_data_got_aarch64::do_write): Add code to write out
1938 static relocs.
1939 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1940 static relocs.
1941 (Output_data_got_aarch64::static_relocs): New vector to
1942 hold static relocs.
1943 (Target_aarch64::TCB_SIZE): New const static memeber.
1944 (Target_aarch64::tcb_size): New method.
1945 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1946 (Target_aarch64::Relocate::relocate_tls): New method.
1947 (Target_aarch64::Scan::local): Add code handling new reloc types.
1948 (Target_aarch64::Scan::global): Add code handling new reloc types.
1949
1950 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1951
1952 * options.h (-no-pie): Add option.
1953
1954 2014-08-08 Jing Yu <jingyu@google.com>
1955 Han Shen <shenhan@google.com>
1956
1957 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1958 (DEFFILES): add aarch64-reloc.def.
1959 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1960 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1961 * Makefile.in: Regenerate.
1962 * aarch64-reloc-property.cc: New file.
1963 * aarch64-reloc-property.h: New file.
1964 * aarch64-reloc.def: New file.
1965 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1966 with tab to make the format consistent.
1967 (Output_data_got_aarch64::symbol_table_): New method.
1968 (Target_aarch64::do_plt_address_for_global): New method.
1969 (Target_aarch64::do_plt_address_for_local): New method.
1970 (Target_aarch64::do_select_as_default_target): New method.
1971 (Target_aarch64::do_make_data_plt): New method.
1972 (Target_aarch64::make_data_plt): New method.
1973 (Output_data_plt_aarch64::has_irelative_section): New method.
1974 (Output_data_plt_aarch64::address_for_global): New method.
1975 (Output_data_plt_aarch64::address_for_local): New method.
1976 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1977 (Output_data_plt_aarch64::add_entry): Implement contents.
1978 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1979 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1980 the got_pov entry to plt0.
1981 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1982 Implement contents.
1983 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1984 (AArch64_howto): New struct.
1985 (aarch64_howto[]): New static const array.
1986 (AArch64_relocate_functions): New class.
1987 (Target_aarch64::Scan::get_reference_flags): Remove method.
1988 (Target_aarch64::Scan::local): Implement to support a few relocations.
1989 (Target_aarch64::Scan::global): Implement to support a few relocations.
1990 (Target_aarch64::make_plt_section): Implement contents.
1991 (Target_aarch64::make_plt_entry): Implement contents.
1992 (Target_aarch64::do_finalize_sections): Implement contents.
1993 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1994 (Target_aarch64::relocate_section): Implement contents.
1995
1996 2014-08-06 Alan Modra <amodra@gmail.com>
1997
1998 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1999
2000 2014-08-06 Alan Modra <amodra@gmail.com>
2001
2002 PR 13227
2003 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2004
2005 2014-07-21 Sriraman Tallam <tmsriram@google.com>
2006
2007 * object.cc (Relobj::is_section_name_included): Add
2008 ".rodata.nptl_version" to not garbage collect this section.
2009
2010 2014-07-08 Cary Coutant <ccoutant@google.com>
2011
2012 * expression.cc (struct Expression::Expression_eval_info): Add
2013 new fields type_pointer, vis_pointer, and nonvis_pointer.
2014 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2015 nonvis_pointer parameters. Adjust all calls.
2016 (Symbol_expression::value): Update type, visibility, and nonvis bits
2017 in caller.
2018 * script.cc (Symbol_assignment::sized_finalize): Update type,
2019 visibility, and remaining st_other bits for new symbol.
2020 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2021 vis_pointer, and nonvis_pointer parameters.
2022 * symtab.h (Symbol::set_type): New method.
2023
2024 * testsuite/Makefile.am (defsym_test): New test.
2025 * testsuite/Makefile.in: Regenerate.
2026 * testsuite/defsym_test.c: New file.
2027 * testsuite/defsym_test.sh: New file.
2028
2029 2014-07-08 Cary Coutant <ccoutant@google.com>
2030
2031 PR gold/15639
2032 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2033 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2034 (Sized_dynobj::base_read_symbols): ...new method.
2035 * object.h (Sized_relobj_file::base_read_symbols): New method.
2036 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2037 (Sized_relobj_file::base_read_symbols): ...new method.
2038 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2039 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2040 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2041
2042 2014-07-04 Alan Modra <amodra@gmail.com>
2043
2044 * po/POTFILES.in: Regenerate.
2045
2046 2014-07-02 Jing Yu <jingyu@google.com>
2047
2048 * aarch64.cc: New file
2049 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2050 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2051 * Makefile.in: Regenerate.
2052 * configure.tgt: Add entries for aarch64*.
2053 * configure.ac: Likewise.
2054 * configure: Likewise.
2055
2056 2014-06-27 Alan Modra <amodra@gmail.com>
2057
2058 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2059
2060 2014-06-24 Cary Coutant <ccoutant@google.com>
2061
2062 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2063 sections.
2064 (Dwo_file::sized_read_unit_index): Likewise.
2065
2066 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2067
2068 * mips.cc: New file.
2069 * Makefile.am (TARGETSOURCES): Add mips.cc
2070 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2071 * configure.tgt: Add entries for mips*.
2072 * configure.ac: Likewise.
2073 * Makefile.in: Regenerate.
2074 * configure: Likewise.
2075
2076 2014-06-09 Cary Coutant <ccoutant@google.com>
2077
2078 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2079 unit_length is within section bounds.
2080
2081 2014-06-09 Cary Coutant <ccoutant@google.com>
2082
2083 PR gold/16980
2084 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2085 map.
2086
2087 2014-06-07 Alan Modra <amodra@gmail.com>
2088
2089 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2090
2091 2014-06-06 Cary Coutant <ccoutant@google.com>
2092
2093 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2094 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2095 (Dwarf_pubnames_table::read_header): Likewise.
2096 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2097 .debug_gnu_pubtypes.
2098
2099 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2100
2101 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2102 * Makefile.in, configure: Regenerate.
2103
2104 2014-06-03 Alan Modra <amodra@gmail.com>
2105
2106 * powerpc.cc (addis_12_2): Define.
2107 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2108
2109 2014-06-03 Alan Modra <amodra@gmail.com>
2110
2111 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2112 st_other output.
2113
2114 2014-06-02 Alan Modra <amodra@gmail.com>
2115
2116 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2117 Only ignore relocs on ELFv1.
2118 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2119
2120 2014-05-30 Cary Coutant <ccoutant@google.com>
2121
2122 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2123 * testsuite/Makefile.in: Regenerate.
2124 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2125
2126 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2127
2128 PR gold/16945
2129 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2130 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2131
2132 2014-05-15 Alan Modra <amodra@gmail.com>
2133
2134 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2135 Compare FDE contents with DW_CFA_nop rather than 0.
2136
2137 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2138
2139 * symtab.h (may_need_copy_reloc): Remove check for position independent
2140 code.
2141 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2142 position independence before pc absolute may_need_copy_reloc call.
2143 Add check for executable output befor pc relative may_need_copy_reloc
2144 call.
2145 * i386.cc: Ditto.
2146 * arm.cc: Ditto.
2147 * sparc.cc: Ditto.
2148 * tilegx.cc: Ditto.
2149 * powerpc.cc: Add check for no position independence before
2150 may_need_copy_reloc calls.
2151 * testsuite/pie_copyrelocs_test.cc: New file.
2152 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2153 * Makefile.am (pie_copyrelocs_test): New test.
2154 * Makefile.in: Regenerate.
2155
2156 2014-05-08 Martin Liška <mliska@suse.cz>
2157
2158 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2159
2160 2014-05-06 Cary Coutant <ccoutant@google.com>
2161
2162 PR gold/16900
2163 * i386.cc (Output_data_got_plt_i386): New class.
2164 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2165 parameter. Change all callers.
2166 (Output_data_plt_i386::layout_): Remove.
2167 (Output_data_plt_i386::got_plt_): Change type.
2168 (Target_i386::got_plt_): Change type. Change all references.
2169 (Target_i386::got_section): Create instance of new class.
2170 (Output_data_got_plt_i386::do_write): New function.
2171 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2172 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2173 parameter. Change all callers.
2174 (Output_data_plt_x86_64::layout_): Remove.
2175 (Output_data_plt_x86_64::got_plt_): Change type.
2176 (Target_x86_64::got_plt_): Change type. Change all references.
2177 (Target_x86_64::got_section): Create instance of new class.
2178 (Output_data_got_plt_x86_64::do_write): New function.
2179 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2180 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2181 class.
2182
2183 2014-05-05 Cary Coutant <ccoutant@google.com>
2184
2185 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2186 if we have pubnames/pubtypes.
2187
2188 2014-05-02 Cary Coutant <ccoutant@google.com>
2189
2190 * defstd.cc (in_segment): Define __ehdr_start here...
2191 * layout.cc (Layout::finalize): ...Instead of here. Set the
2192 output segment when known.
2193 * resolve.cc (Symbol::override_base_with_special): Remember
2194 the original binding.
2195 * symtab.cc (Symbol::set_output_segment): New function.
2196 (Symbol::set_undefined): New function.
2197 * symtab.h (Symbol::is_weak_undefined): Check original undef
2198 binding.
2199 (Symbol::is_strong_undefined): New function.
2200 (Symbol::set_output_segment): New function.
2201 (Symbol::set_undefined): New function.
2202 * target-reloc.h (is_strong_undefined): Remove.
2203 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2204 Check for hidden undefs.
2205 (relocate_section): Call Symbol::is_strong_undefined.
2206
2207 * testsuite/Makefile.am (ehdr_start_test_1)
2208 (ehdr_start_test_2, ehdr_start_test_3)
2209 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2210 * testsuite/Makefile.in: Regenerate.
2211 * testsuite/ehdr_start_def.cc: New source file.
2212 * testsuite/ehdr_start_test.cc: New source file.
2213 * testsuite/ehdr_start_test.t: New linker script.
2214 * testsuite/ehdr_start_test_4.sh: New shell script.
2215
2216 2014-04-23 Cary Coutant <ccoutant@google.com>
2217
2218 PR gold/16870
2219 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2220
2221 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2222
2223 * layout.cc (Layout::include_section): Allow a target to decide
2224 whether to include a section.
2225 * target.h (Target::should_include_section): New function.
2226 (Target::do_should_include_section): New function.
2227
2228 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2229
2230 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2231 inline into ...
2232 (Copy_relocs::emit): ... here.
2233 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2234 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2235 (Copy_reloc_entry::entries_): Change from private to protected.
2236
2237 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2238
2239 * icf.cc (get_section_contents): Replace copies of reloc
2240 vectors with const references.
2241
2242 2014-04-02 Cary Coutant <ccoutant@google.com>
2243
2244 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2245 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2246 * configure: Regenerate.
2247 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2248 -fno-use-linker-plugin.
2249 (LINK1, CXXLINK1): Add it to the link command.
2250 * testsuite/Makefile.in: Regenerate.
2251
2252 2014-03-12 Alan Modra <amodra@gmail.com>
2253
2254 * Makefile.in: Regenerate.
2255
2256 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2257
2258 * symtab.h (Symbol::set_nonvis): New function.
2259
2260 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2261
2262 * symtab.cc (Sized_symbol<32>::init_output_data):
2263 Instantiate the template.
2264 (Sized_symbol<64>::init_output_data): Likewise.
2265
2266 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2267
2268 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2269 adjust dynamic symbol value.
2270 * target.h (Target::adjust_dyn_symbol): New function.
2271 (Target::do_adjust_dyn_symbol): New function.
2272
2273 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2274
2275 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2276 Get the value of DYNAMIC_CUSTOM dynamic entry.
2277 * output.h (Output_data_dynamic::add_custom): New function.
2278 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2279 dynamic entry.
2280 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2281 * target.h (Target::dynamic_tag_custom_value): New function.
2282 (Target::do_dynamic_tag_custom_value): New function.
2283
2284 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2285
2286 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2287 dynsym indexes.
2288 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2289 (Target::do_has_custom_set_dynsym_indexes): New function.
2290 (Target::set_dynsym_indexes): New function.
2291 (Target::do_set_dynsym_indexes): New function.
2292
2293 2014-03-07 Alan Modra <amodra@gmail.com>
2294
2295 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2296 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2297 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2298 (Powerpc_relocate_functions::has_overflow_bitfield,
2299 overflowed): Use the above.
2300 (Target_powerpc::Relocate::relocate): Correct overflow checking
2301 for a number of relocations. Modify overflow test for 16-bit
2302 fields in instructions to signed/unsigned according to whether
2303 the field takes a signed or unsigned value.
2304
2305 2014-03-05 Alan Modra <amodra@gmail.com>
2306
2307 Update copyright years.
2308
2309 2014-03-05 Alan Modra <amodra@gmail.com>
2310
2311 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2312 R_PPC64_ADDR64_LOCAL.
2313 (Target_powerpc::Relocate::relocate): Likewise.
2314
2315 2014-03-03 Alan Modra <amodra@gmail.com>
2316
2317 * dwp.cc (print_version): Update copyright year to current.
2318
2319 2014-02-10 Alan Modra <amodra@gmail.com>
2320
2321 * po/gold.pot: Regenerate.
2322
2323 2014-02-06 Cary Coutant <ccoutant@google.com>
2324
2325 Fix problem where -u is ignored when a weak undef is seen.
2326
2327 * archive.cc (Library_base::should_include_member): Reorder
2328 code to check for -u option if a weak undef has already been seen.
2329 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2330 * testsuite/Makefile.in: Regenerate.
2331 * testsuite/weak_undef_file3.cc: New file.
2332 * testsuite/weak_undef_file4.cc: New file.
2333 * testsuite/weak_undef_test_2.cc: New file.
2334
2335 2014-02-05 Cary Coutant <ccoutant@google.com>
2336
2337 Fix issues with gold undefined symbol diagnostics.
2338
2339 PR binutils/15435
2340 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2341 check to here.
2342 * target-reloc.h (is_strong_undefined): New function.
2343 (relocate_section): Move undef vtable symbol check from here.
2344 Check for is_strong_undefined.
2345
2346 2014-02-05 Cary Coutant <ccoutant@google.com>
2347
2348 Fix problems with the --dynamic-list option.
2349
2350 PR gold/13577
2351 * options.cc (General_options::parse_dynamic_list):
2352 Set have_dynamic_list_.
2353 (General_options::General_options): Initialize have_dynamic_list_.
2354 (General_options::finalize): Turn off -Bsymbolic and
2355 -Bsymbolic-functions if --dynamic-list provided.
2356 * options.h (General_options::have_dynamic_list): New function.
2357 (General_options::have_dynamic_list_): New data member.
2358 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2359 correctly.
2360
2361 PR gold/16530
2362 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2363 in --dynamic-list, mark it.
2364
2365 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2366 (dynamic_list_2): New test case.
2367 * testsuite/Makefile.in: Regenerate.
2368 * testsuite/dynamic_list_2.cc: New file.
2369 * testsuite/dynamic_list_2.t: New file.
2370 * testsuite/dynamic_list_lib1.cc: New file.
2371 * testsuite/dynamic_list_lib2.cc: New file.
2372 * testsuite/gc_dynamic_list_test.c: New file.
2373 * testsuite/gc_dynamic_list_test.sh: New file.
2374 * testsuite/gc_dynamic_list_test.t: New file.
2375
2376 2014-01-28 Cary Coutant <ccoutant@google.com>
2377
2378 Add .gdb_index version 7 support.
2379
2380 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2381 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2382 debug sections.
2383 (Dwarf_ranges_table::read_ranges_table): Likewise.
2384 (Dwarf_pubnames_table::read_section): Check for GNU-style
2385 sections, and for compressed debug sections.
2386 (Dwarf_pubnames_table::read_header): Compute end address of table.
2387 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2388 for end of list by offset, not by offset == 0.
2389 (Dwarf_info_reader::do_read_string_table): Check for compressed
2390 debug sections.
2391 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2392 Initialize new data members.
2393 (Dwarf_pubnames_table::next_name): return flag_byte.
2394 (Dwarf_pubnames_table::end_of_table_): New data member.
2395 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2396 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2397 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2398 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2399 read skeleton type unit DIEs.
2400 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2401 (Gdb_index::do_write): Write flag_byte.
2402 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2403 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2404 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2405 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2406
2407 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2408
2409 * version.cc (print_version): Update copyright year to 2014.
2410
2411 2013-12-19 Dimitry Andric <dimitry@andric.com>
2412
2413 * stringpool.cc (Stringpool_template::reserve): Add
2414 HAVE_UNORDERED_MAP case.
2415 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2416
2417 2013-12-18 Cary Coutant <ccoutant@google.com>
2418
2419 * configure.ac: Check for <unordered_set> and <unordered_map>.
2420 * config.in: Regenerate.
2421 * configure: Regenerate.
2422 * system.h: Use <unordered_set> and <unordered_map> if available.
2423
2424 2013-12-10 Roland McGrath <mcgrathr@google.com>
2425
2426 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2427 with $(INSTALL_PROGRAM_ENV).
2428 * Makefile.in: Regenerate.
2429
2430 2013-11-22 Cary Coutant <ccoutant@google.com>
2431
2432 * configure.ac: Add check for which library is needed for
2433 dlopen.
2434 * configure: Regenerate.
2435
2436 2013-11-22 Cary Coutant <ccoutant@google.com>
2437
2438 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2439 assembler.
2440 * testsuite/Makefile.in: Regenerate.
2441
2442 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2443
2444 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2445 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2446 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2447 (Target_x86_64<size>::Scan::local): Likewise.
2448 (Target_x86_64<size>::Scan::global): Likewise.
2449 (Target_x86_64<size>::Relocate::relocate): Likewise.
2450 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2451 Likewise.
2452 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2453 R_X86_64_PC32_BND.
2454
2455 * testsuite/Makefile.am (check_PROGRAMS): Add
2456 exception_x86_64_bnd_test.
2457 (exception_x86_64_bnd_test_SOURCES): New macro.
2458 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2459 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2460 (exception_x86_64_bnd_test_LDADD): Likewise.
2461 (exception_x86_64_bnd_1.o): New rule.
2462 (exception_x86_64_bnd_2.o): Likewise.
2463 * testsuite/Makefile.in: Regenerated.
2464
2465 2013-11-15 Alan Modra <amodra@gmail.com>
2466
2467 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2468 accessor.
2469 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2470 Only call ppc64_local_entry_offset for 64-bit. Restrict
2471 symval_for_branch lookup to ELFv1.
2472 (Stub_table::add_plt_call_entry): Use unsigned int off.
2473 (Output_data_glink::Address, invalid_address): New.
2474 (Output_data_glink::add_eh_frame): Move out of line. Add
2475 support for ELFv2.
2476 (Output_data_glink::add_global_entry, find_global_entry,
2477 global_entry_address): New functions.
2478 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2479 ge_size): New variables.
2480 (Output_data_glink::set_final_data_size): Add global entry
2481 stub sizing.
2482 (Output_data_glink::do_write): Write global entry stubs.
2483 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2484 parameter. Return true for ELFv2. Adjust callers.
2485 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2486 ELFv1. Similarly for ifunc and dynamic relocation processing
2487 specific to ELFv1. Recognize that symbols are defined on
2488 their plt entries for ELFv2.
2489 (Target_powerpc::symval_for_branch): Assert if called for
2490 ELFv2 or ppc32.
2491 (Target_powerpc::Relocate::relocate): Use global entry plt
2492 stub for symbol value if such exists on ELFv2.
2493 (Target_powerpc::Relocate::relocate): Don't call
2494 symval_for_branch when ELFv2. Do adjust for local entry
2495 offset when ELFv2.
2496 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2497 plt stub for ELFv2.
2498 (Target_powerpc::do_plt_address_for_global): Similarly.
2499
2500 2013-11-14 Cary Coutant <ccoutant@google.com>
2501
2502 Revert patch -- this did not fix the problem, and there is
2503 no race there.
2504
2505 2013-11-14 Cary Coutant <ccoutant@google.com>
2506
2507 PR gold/14860
2508 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2509 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2510 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2511 updating fde_offsets_.
2512 (Eh_frame_hdr::lock_): New data member.
2513
2514 2013-11-14 Cary Coutant <ccoutant@google.com>
2515
2516 * dwp.cc (Dwo_file_entry): New type.
2517 (File_list): Use Dwo_file_entry.
2518 (Dwo_file::verify): New function.
2519 (Dwo_file::verify_dwo_list): New function.
2520 (Dwo_file::sized_verify_dwo_list): New function.
2521 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2522 list.
2523 (Dwp_options): New enum type.
2524 (dwp_options): Add --verify-only.
2525 (usage): Likewise.
2526 (main): Likewise.
2527 * dwp.h (gold_info): Add declaration.
2528
2529 2013-11-14 Cary Coutant <ccoutant@google.com>
2530
2531 PR gold/14860
2532 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2533 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2534 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2535 updating fde_offsets_.
2536 (Eh_frame_hdr::lock_): New data member.
2537
2538 2013-11-06 Cary Coutant <ccoutant@google.com>
2539
2540 PR gold/15758
2541 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2542 before reloc sections.
2543
2544 2013-11-04 Alan Modra <amodra@gmail.com>
2545
2546 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2547 (Symbol::needs_dynamic_reloc): Test new flag.
2548 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2549 (Target_powerpc::Scan::get_reference_flags): Add target param.
2550 Return FUNC_DESC_ABI for 64-bit ELFv1.
2551 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2552 call.
2553 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2554 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2555
2556 2013-10-31 Cary Coutant <ccoutant@google.com>
2557
2558 Restore support for dwp v2 DWARF package file format.
2559
2560 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2561 tu_length parameter. Adjust all callers.
2562 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2563 * dwp.cc: Include dwarf.h.
2564 (Section_bounds): New struct type.
2565 (Unit_set): New struct type.
2566 (Dwo_file::Dwo_file): Initialize new data member.
2567 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2568 Combine and rename to...
2569 (Dwo_file::read_unit_index): ...this.
2570 (Dwo_file::sized_read_compunit_index)
2571 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2572 (Dwo_file::sized_read_unit_index): ...this.
2573 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2574 parameters; add section_id parameter.
2575 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2576 (Dwo_file::add_unit_set): ...this.
2577 (Dwo_file::shndx_map_): Remove.
2578 (Dwo_file::sect_offsets_): New data member.
2579 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2580 (Dwp_output_file::add_section): Rename to...
2581 (Dwp_output_file::add_contribution): ...this.
2582 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2583 (Dwp_output_file::add_tu_set): Likewise.
2584 (Dwp_output_file::Contribution): New type.
2585 (Dwp_output_file::Section::contributions): New data member.
2586 (Dwp_output_file::Cu_or_tu_set): Remove.
2587 (Dwp_output_file::Section::Section): New ctor.
2588 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2589 (Dwp_output_file::Dwp_index::Section_table): New type.
2590 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2591 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2592 parameter.
2593 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2594 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2595 (Dwp_output_file::Dwp_index::section_table): New member function.
2596 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2597 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2598 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2599 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2600 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2601 (Dwp_output_file::Dwp_index::section_table_): New data member.
2602 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2603 (Dwp_output_file::add_output_section): New member function.
2604 (Dwp_output_file::write_new_section): New member function.
2605 (Dwp_output_file::write_contributions): New member function.
2606 (Dwp_output_file::section_id_map_): New data member.
2607 (class Dwo_id_info_reader): Remove.
2608 (class Unit_reader): New class.
2609 (get_dwarf_section_name): New function.
2610 (Dwo_file::read_executable): Adjust initializations of class data.
2611 (Dwo_file::read): Add support for v2 package file format.
2612 (Dwo_file::read_unit_index): Likewise.
2613 (Dwo_file::sized_read_unit_index): Likewise.
2614 (Dwo_file::copy_section): Likewise.
2615 (Dwo_file::add_unit_set): Likewise.
2616 (Dwp_output_file::add_output_section): Likewise.
2617 (Dwp_output_file::add_contribution): Likewise.
2618 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2619 for empty slot.
2620 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2621 file format.
2622 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2623 slot.
2624 (Dwp_output_file::initialize): Remove unused function.
2625 (Dwp_output_file::finalize): Add support for v2 package file format.
2626 (Dwp_output_file::write_index): Likewise.
2627 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2628 function prototype.
2629
2630 2013-10-31 Cary Coutant <ccoutant@google.com>
2631
2632 * configure.ac: Fix check for -fmerge-constants.
2633 * configure.ac: Regenerate.
2634
2635 2013-10-30 Roland McGrath <mcgrathr@google.com>
2636
2637 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2638 Correct 9-byte nop sequence to match what the assembler generates.
2639
2640 2013-10-30 Alan Modra <amodra@gmail.com>
2641
2642 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2643 ppc64_local_entry_offset, ppc64_local_entry_offset,
2644 do_read_symbols): New functions.
2645 (Powerpc_relobj::e_flags_, st_other_): New vars.
2646 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2647 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2648 (Powerpc_relobj::e_flags_): New var.
2649 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2650 and adjust for ELFv2.
2651 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2652 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2653 (Powerpc_dynobj::do_find_special_sections): Likewise.
2654 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2655 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2656 to ELFv2 local entry.
2657 (Target_powerpc::do_relax): No thread safe barriers needed for
2658 ELFv2.
2659 (Output_data_plt_powerpc::initial_plt_entry_size_,
2660 plt_entry_size): Delete. Replace all uses with
2661 first_plt_entry_offset() and plt_entry_size().
2662 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2663 reserved_size parm. Update callers.
2664 (Output_data_plt_powerpc::entry_count): Update.
2665 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2666 and use Target_powerpc::first_plt_entry_offset().
2667 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2668 rename to plt_entry_size.
2669 (Output_data_plt_powerpc::add_ifunc_entry,
2670 add_local_ifunc_entry): Adjust reloc for ELFv2.
2671 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2672 (glink_eh_frame_fde_64v2): New.
2673 (Stub_table::plt_call_size): Support ELFv2 sizing.
2674 (Output_data_glink::add_eh_frame): Use the new FDE.
2675 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2676 (Stub_table::do_write): Write ELFv2 stubs and glink.
2677 (Target_powerpc::Relocate::relocate): Replaces nop after call
2678 with ld 2,24(1) and adjust local offset destination for ELFv2.
2679
2680 2013-10-30 Alan Modra <amodra@gmail.com>
2681
2682 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2683 (Target_powerpc::Scan::global, local): Likewise.
2684 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2685 on all ppc64 @h and @ha relocs.
2686
2687 2013-10-14 Alan Modra <amodra@gmail.com>
2688
2689 * output.h (Output_data_got::add_constant): Tidy.
2690 (Output_data_got::add_constant_pair): New function.
2691 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2692 methods used so as to first call reserve_ent().
2693
2694 2013-10-11 Roland McGrath <mcgrathr@google.com>
2695
2696 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2697 add_got_entry and add_got_entry_pair.
2698
2699 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2700 (HAVE_PUBNAMES): Likewise.
2701 * configure: Regenerate.
2702
2703 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2704 * testsuite/Makefile.in: Regenerate.
2705
2706 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2707 Remove const from declaration.
2708 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2709 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2710 * output.h (Output_file_header): Remove const from member target_
2711 and corresponding constructor argument.
2712 * output.cc (Output_file_header::Output_file_header): Update prototype.
2713 (Output_file_header::do_sized_write): Use this->target_ in place
2714 of parameters()->target().
2715
2716 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2717
2718 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2719 * configure: Regenerate.
2720 * Makefile.in: Regenerate.
2721 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2722 * testsuite/merge_string_literals_2.c: Likewise.
2723 * testsuite/Makefile.am
2724 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2725 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2726 literal -fmerge-constants.
2727 * testsuite/Makefile.in: Regenerate.
2728
2729 * i386.cc (Target_i386): Remove unused member dynbss_.
2730 * arm.cc (Target_arm): Likewise.
2731 * powerpc.cc (Target_powerpc): Likewise.
2732 * sparc.cc (Target_sparc): Likewise.
2733 * tilegx.cc (Target_tilegx): Likewise.
2734 * x86_64.cc (Target_x86_64): Likewise.
2735 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2736 type_signature_, type_offset_.
2737 * plugin.h (Plugin_hook): Remove unused member layout_.
2738 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2739 mapfile_.
2740 (Read_member): Remove unused members input_objects_, symtab_,
2741 mapfile_, layout_.
2742 (Check_library): Remove unused member symtab_.
2743 * archive.h (Lib_group): Remove unused member lib_.
2744 * archive.cc (Lib_group::Lib_group): Update initializer.
2745 * incremental.h (Incremental_binary): Remove unused member target_.
2746 (Incremental_script_entry): Removed unused member script_.
2747 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2748 * icf.h (Icf): Remove unused member num_tracked_relocs.
2749
2750 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2751 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2752 its only use.
2753 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2754
2755 * archive.h: Use struct rather than class for forward declaration
2756 of Read_symbols_data.
2757
2758 2013-10-07 Cary Coutant <ccoutant@google.com>
2759
2760 PR gold/16010
2761 * testsuite/Makefile.am (icf_test): Fix dependencies.
2762 (icf_safe_test): Likewise.
2763 (icf_safe_so_test): Likewise.
2764 (large_symbol_alignment): Add empty _LDADD rule.
2765 * testsuite/Makefile.in: Regenerate.
2766
2767 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2768
2769 PR gold/15927
2770 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2771 relocation for R_X86_64_32 on x32.
2772
2773 2013-08-27 Roland McGrath <mcgrathr@google.com>
2774
2775 * output.cc (Output_segment::set_section_addresses): Take new
2776 Target* argument. If target->isolate_execinstr() and the segment
2777 is executable and starts at a target->abi_pagesize() boundary,
2778 pad its end out to a target->abi_pagesize() boundary with code fill.
2779 * output.h (Output_segment::set_section_addresses): Update decl.
2780 * layout.h (Layout::check_output_data_for_reset_values): Take new
2781 argument RELAX_OUTPUTS.
2782 (Layout): New member relax_output_list_.
2783 (Layout::add_relax_output): New method.
2784 * layout.cc (Layout::Layout): Update constructor.
2785 (Layout::reset_relax_output): New method.
2786 (Layout::clean_up_after_relaxation): Call it.
2787 (Layout::prepare_for_relaxation): Update caller.
2788 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2789 Call reset_relax_output before re-processing segments for
2790 isolate_execinstr case.
2791 (Layout::write_data): Handle relax_output_list_.
2792 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2793 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2794
2795 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2796
2797 PR binutils/15834
2798 * object.h: Fix typos.
2799
2800 2013-08-16 Roland McGrath <mcgrathr@google.com>
2801
2802 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2803 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2804
2805 2013-08-07 Cary Coutant <ccoutant@google.com>
2806
2807 Revert support for v2 DWP files:
2808
2809 2013-03-01 Cary Coutant <ccoutant@google.com>
2810
2811 Add dwp support for v2 DWARF package file format.
2812 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2813 tu_length parameter. Adjust all callers.
2814 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2815 * dwp.cc: Include dwarf.h.
2816 (Section_bounds): New struct type.
2817 (Unit_set): New struct type.
2818 (Dwo_file::Dwo_file): Initialize new data member.
2819 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2820 Combine and rename to...
2821 (Dwo_file::read_unit_index): ...this.
2822 (Dwo_file::sized_read_compunit_index)
2823 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2824 (Dwo_file::sized_read_unit_index): ...this.
2825 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2826 parameters; add section_id parameter.
2827 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2828 (Dwo_file::add_unit_set): ...this.
2829 (Dwo_file::shndx_map_): Remove.
2830 (Dwo_file::sect_offsets_): New data member.
2831 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2832 (Dwp_output_file::add_section): Rename to...
2833 (Dwp_output_file::add_contribution): ...this.
2834 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2835 (Dwp_output_file::add_tu_set): Likewise.
2836 (Dwp_output_file::Contribution): New type.
2837 (Dwp_output_file::Section::contributions): New data member.
2838 (Dwp_output_file::Cu_or_tu_set): Remove.
2839 (Dwp_output_file::Section::Section): New ctor.
2840 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2841 (Dwp_output_file::Dwp_index::Section_table): New type.
2842 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2843 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2844 parameter.
2845 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2846 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2847 (Dwp_output_file::Dwp_index::section_table): New member function.
2848 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2849 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2850 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2851 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2852 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2853 (Dwp_output_file::Dwp_index::section_table_): New data member.
2854 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2855 (Dwp_output_file::add_output_section): New member function.
2856 (Dwp_output_file::write_new_section): New member function.
2857 (Dwp_output_file::write_contributions): New member function.
2858 (Dwp_output_file::section_id_map_): New data member.
2859 (class Dwo_id_info_reader): Remove.
2860 (class Unit_reader): New class.
2861 (get_dwarf_section_name): New function.
2862 (Dwo_file::read_executable): Adjust initializations of class data.
2863 (Dwo_file::read): Add support for v2 package file format.
2864 (Dwo_file::read_unit_index): Likewise.
2865 (Dwo_file::sized_read_unit_index): Likewise.
2866 (Dwo_file::copy_section): Likewise.
2867 (Dwo_file::add_unit_set): Likewise.
2868 (Dwp_output_file::add_output_section): Likewise.
2869 (Dwp_output_file::add_contribution): Likewise.
2870 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2871 for empty slot.
2872 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2873 file format.
2874 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2875 slot.
2876 (Dwp_output_file::initialize): Remove unused function.
2877 (Dwp_output_file::finalize): Add support for v2 package file format.
2878 (Dwp_output_file::write_index): Likewise.
2879 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2880 function prototype.
2881
2882 2013-07-31 Cary Coutant <ccoutant@google.com>
2883
2884 * object.cc (Sized_relobj::do_output_section_address): New function.
2885 (Sized_relobj): Instantiate explicitly.
2886 * object.h (Object::output_section_address): New function.
2887 (Object::do_output_section_address): New function.
2888 (Sized_relobj::do_output_section_address): New function.
2889 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2890
2891 2013-07-30 Cary Coutant <ccoutant@google.com>
2892 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2893
2894 * parameters.cc (Parameters::entry): Return target-specific entry
2895 symbol name.
2896 * target.h (Target::entry_symbol_name): New function.
2897 (Target_info::entry_symbol_name): New data member.
2898
2899 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2900 * i386.cc (Target_i386::i386_info): Likewise.
2901 (Target_i386_nacl::i386_nacl_info): Likewise.
2902 * sparc.cc (Target_sparc::sparc_info): Likewise.
2903 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2904 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2905 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2906 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2907
2908 2013-07-22 Sterling Augustine <saugustine@google.com>
2909
2910 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2911 Convert parameter shndx to local variable. Add parameters symtab
2912 and symtab_size. Scan over section names. Find relocation
2913 section corresponding to current section. Create and initialize
2914 reloc_mapper_ and reloc_type_.
2915 (Dwarf_pubnames_table::read_header): Add assertion. Change
2916 unit_length to off_t. Initialize member unit_length_. Fill in field
2917 cu_offset_.
2918 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2919 Initialize new fields unit_length_ and cu_offset_.
2920 (Dwarf_pubnames_table::read_section): Update prototype.
2921 (Dwarf_pubnames_table::cu_offset): New member function.
2922 (Dwarf_pubnames_table::subsection_size): Likewise.
2923 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2924 New fields.
2925 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2926 member functions public.
2927 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2928 Update comment. Rework logic. Move repeated parts to...
2929 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2930 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2931 pubtypes_table_, and stmt_list_offset.
2932 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2933 Gdb_index::find_pubtype_offset,
2934 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2935 (Gdb_index::pubnames_read): Update prototype and rework logic.
2936 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2937 Forward declare.
2938 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2939 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2940 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2941 Gdb_index::map_pubtable_to_dies):
2942 Declare functions.
2943 (Gdb_index::pubnames_read): Update declaration.
2944 (Gdb_index::Pubname_offset_map): New type.
2945 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2946 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2947 Gdb_index::stmt_list_offset): Declare.
2948 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2949 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2950 Gdb_index::pubtypes_offset_): Remove.
2951
2952 2013-07-19 Roland McGrath <mcgrathr@google.com>
2953
2954 * options.h (General_options): Add -Trodata-segment option.
2955 * parameters.cc (Parameters::check_rodata_segment): New function.
2956 (Parameters::set_target_once): Call it.
2957 * parameters.h (Parameters): Declare it (private member function).
2958 * layout.cc (load_seg_unusable_for_headers): New function, broken
2959 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2960 then validate rodata segment rather than text segment.
2961 (relaxation_loop_body): Call that.
2962 (is_text_segment): New function. Don't admit a non-executable
2963 segment if TARGET->isolate_execinstr().
2964 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2965
2966 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2967
2968 PR gold/15070
2969 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2970 * nacl.h (Sniff_file::View::View): Request aligned view.
2971
2972 2013-07-11 Cary Coutant <ccoutant@google.com>
2973
2974 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2975 correct BRLT entry size.
2976
2977 2013-07-03 Alan Modra <amodra@gmail.com>
2978
2979 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2980 comment.
2981
2982 2013-07-01 Cary Coutant <ccoutant@google.com>
2983
2984 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2985 reloc_type_.
2986 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2987 (Dwarf_ranges_table::lookup_reloc): New function.
2988 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2989 reloc_type_.
2990 (Dwarf_ranges_table::lookup_reloc): New function.
2991 (Dwarf_ranges_table::reloc_type_): New data member.
2992
2993 2013-06-27 Jing Yu <jingyu@google.com>
2994
2995 PR gold/15662
2996 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2997 function.
2998 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2999 (Target_powerpc::do_relax): Call the above.
3000
3001 2013-06-27 Cary Coutant <ccoutant@google.com>
3002
3003 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3004 on garbage collected .opd section.
3005
3006 2013-06-27 Alan Modra <amodra@gmail.com>
3007
3008 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3009 is non-zero.
3010 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3011 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3012
3013 2013-06-14 Cary Coutant <ccoutant@google.com>
3014
3015 * resolve.cc (Symbol::override_base): Don't override st_type
3016 from plugin placeholder symbols.
3017 (Symbol_table::resolve): Likewise.
3018 (Symbol_table::should_override): Don't complain about TLS mismatch
3019 if the TO symbol is a plugin placeholder.
3020 * testsuite/Makefile.am (plugin_test_tls): New test.
3021 * testsuite/Makefile.in: Regenerate.
3022 * testsuite/plugin_test_tls.sh: New test script.
3023 * testsuite/two_file_test_2_tls.cc: New test source.
3024 * testsuite/two_file_test_tls.cc: New test source.
3025
3026 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3027
3028 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3029 the maximum segment alignment is larger than the page size.
3030 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3031 correctly aligns the symbols with large alignemnt.
3032 * testsuite/Makefile.in: Regenerate.
3033 * testsuite/large_symbol_alignment.cc: New file.
3034
3035 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3036 Sriraman Tallam <tmsriram@google.com>
3037
3038 * options.h (sort_section): New option.
3039 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3040 Rename from Input_section_sort_section_name_special_ordering_compare.
3041 (Input_section_sort_section_name_compare): New struct.
3042 * output.cc (Output_section::Input_section_sort_section_name_compare::
3043 operator()): New function.
3044 (Output_section::sort_attached_input_sections): Use new sort function
3045 for .text if --sort-section=name is specified.
3046 * layout.cc (Layout::make_output_section):
3047 Add sorting by name when --sort-section=name is specified.
3048 * testsuite/Makefile.am (text_section_grouping): Test option
3049 --sort-section=name.
3050 * testsuite/Makefile.in: Regenerate.
3051 * testsuite/section_sorting_name.cc: New file.
3052 * testsuite/section_sorting_name.sh: New file.
3053
3054 2013-05-21 Cary Coutant <ccoutant@google.com>
3055
3056 * symtab.h (Symbol::is_cxx_vtable): New function.
3057 * target-reloc.h (relocate_section): Check for vtable symbol.
3058 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3059 * testsuite/Makefile.in: Regenerate.
3060 * testsuite/missing_key_func.cc: New test source.
3061 * testsuite/missing_key_func.sh: New test script.
3062
3063 2013-05-21 Cary Coutant <ccoutant@google.com>
3064
3065 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3066 type of enclosing symbol.
3067 (Relocate_info::location): Check symbol type when describing symbol.
3068 * object.h (Symbol_location_info): Remove unused line_number;
3069 add enclosing_symbol_type.
3070 * testsuite/debug_msg.sh: Adjust expected output.
3071
3072 2013-05-13 Cary Coutant <ccoutant@google.com>
3073
3074 * configure.ac: Export DEFAULT_TARGET.
3075 * configure: Regenerate.
3076 * Makefile.in: Regenerate.
3077 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3078 * testsuite/Makefile.in: Regenerate.
3079 * testsuite/debug_msg.sh: Delete duplicate tests.
3080 Don't check undef_int error message match for powerpc where the
3081 source file and line number aren't available.
3082
3083 2013-05-10 Roland McGrath <mcgrathr@google.com>
3084
3085 * options.h (General_options): Add --rosegment-gap option.
3086 * options.cc (finalize): --rosegment-gap implies --rosegment.
3087 * layout.cc (set_segment_offsets): Let user option override
3088 target->rosegment_gap().
3089
3090 2013-05-10 Roland McGrath <mcgrathr@google.com>
3091
3092 * options.h (General_options): Remove leading space from help
3093 messages for -nostdlib and --rosegment.
3094
3095 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3096
3097 PR ld/15365
3098 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3099
3100 2013-05-03 Alan Modra <amodra@gmail.com>
3101
3102 * merge.cc (Output_merge_string::do_add_input_section): Correct
3103 scan for number of strings. Rename vars to avoid shadowing.
3104 Include missing terminator in input_size_.
3105
3106 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3107
3108 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3109 Restore empty string handling.
3110
3111 2013-05-01 Cary Coutant <ccoutant@google.com>
3112
3113 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3114 uninitialized warning.
3115
3116 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3117
3118 * output.cc (Output_section::add_merge_input_section): Allow
3119 to merge sections if the alignment is more than character size.
3120 * merge.h (Output_merge_string::Output_merge_string): Remove
3121 assert.
3122 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3123 only not-null strings. Check the alignment of strings.
3124 * stringpool.h
3125 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3126 alignment as the argument.
3127 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3128 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3129 Align non-zero length strings according to the addralign_.
3130 (Stringpool_template<Stringpool_char>::set_string_offsets):
3131 Updating offsets according to the given alignment.
3132 * testsuite/Makefile.am (text_section_grouping): Test if string
3133 literals are getting merged.
3134 * testsuite/Makefile.in: Regenerate.
3135 * testsuite/merge_string_literals_1.c: New file.
3136 * testsuite/merge_string_literals_2.c: Ditto.
3137 * testsuite/merge_string_literals.sh: Ditto.
3138
3139 2013-04-26 Ian Lance Taylor <iant@google.com>
3140
3141 * target-reloc.h (relocate_section): If the reloc offset is out of
3142 range, pass VIEW as NULL to relocate.relocate.
3143 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3144 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3145 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3146 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3147 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3148 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3149
3150 2013-04-26 Geoff Pike <gpike@chromium.org>
3151
3152 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3153 * layout.cc (Hash_task): New class.
3154 (Layout::queue_build_id_tasks): New function.
3155 (Layout::write_build_id): Handle single-thread portion of build ID
3156 computation. (In some cases, all of it is single-threaded.) Replace
3157 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3158 functionality in fewer lines of code.
3159 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3160 * options.h (General_options): make "--build-id" default to tree
3161 rather than sha1. Add two new options related to --build-id=tree:
3162 --build-id-chunk-size-for-treehash and
3163 --build-id-min-file-size-for-treehash.
3164 * Makefile.am: add testing of --build-id=tree and related new options
3165 (these tests will be invoked by "make check").
3166 * Makefile.in: Regenerate.
3167
3168 2013-04-25 Alan Modra <amodra@gmail.com>
3169
3170 * configure.tgt: Add powerpcle and powerpc64le.
3171
3172 2013-04-22 Alan Modra <amodra@gmail.com>
3173
3174 PR gold/15355
3175 * layout.cc (Layout::segment_precedes): Allow more than one
3176 segment with the same type and flags.
3177
3178 2013-04-15 Cary Coutant <ccoutant@google.com>
3179
3180 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3181 allocate space in file for BSS sections.
3182
3183 2013-04-15 Cary Coutant <ccoutant@google.com>
3184
3185 * script-sections.cc (Orphan_output_section): Reset address
3186 to zero after each orphaned section for relocatable links.
3187
3188 2013-04-15 Cary Coutant <ccoutant@google.com>
3189
3190 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3191 section starting address for relocatable link.
3192 * testsuite/Makefile.am (script_test_11): New test.
3193 * testsuite/Makefile.in: Regenerate.
3194 * testsuite/script_test_11.c: New source file.
3195 * testsuite/script_test_11.t: New linker script.
3196
3197 2013-04-13 Alan Modra <amodra@gmail.com>
3198
3199 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3200 owner when sections are not adjacent and exceed group size.
3201 (Target_powerpc::group_sections): Handle corner case.
3202 (Target_powerpc::Branch_info::make_stub): Handle case where
3203 stub table doesn't exist due to branches in non-exec sections.
3204 (Target_powerpc::Relocate::relocate): Likewise.
3205
3206 2013-04-11 Alan Modra <amodra@gmail.com>
3207
3208 PR gold/15354
3209 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3210 .branch_lt to match bfd ld. Adjust comments throughout file.
3211
3212 2013-04-04 Ian Lance Taylor <iant@google.com>
3213
3214 GCC PR c++/56840
3215 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3216 sections before checking whether they are included in the link.
3217
3218 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3219
3220 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3221 object before calling the plugin claim_file handler. Pass the elf
3222 object of the archive to the plugin. Delete the elf object if the
3223 plugin claims the file.
3224
3225 2013-03-21 Alan Modra <amodra@gmail.com>
3226
3227 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3228 segment when omagic.
3229
3230 2013-03-21 Alan Modra <amodra@gmail.com>
3231
3232 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3233 comparison warning.
3234 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3235 uninitialized" warning.
3236
3237 2013-03-20 Alan Modra <amodra@gmail.com>
3238
3239 * symtab.h (Symbol::clear_version): New function.
3240 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3241 is_needed by weak references. Clear version for symbols defined
3242 in as-needed objects that are not needed.
3243
3244 2013-03-15 Alan Modra <amodra@gmail.com>
3245
3246 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3247 static and public. Add report_err param. Return false for data refs.
3248 (Target_powerpc::rela_dyn_section): New overloaded function.
3249 (Target_powerpc::plt_, iplt_): Elucidate.
3250 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3251 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3252 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3253 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3254 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3255 push_branch and make_plt_entry for ifunc syms when
3256 reloc_needs_plt_for_ifunc.
3257 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3258 for ifunc unless reloc_needs_plt_for_ifunc.
3259
3260 2013-03-15 Alan Modra <amodra@gmail.com>
3261
3262 * gc.h (gc_process_relocs): Don't look through function descriptors.
3263 * icf.cc (get_section_contents): Do so here instead.
3264
3265 2013-03-13 Alan Modra <amodra@gmail.com>
3266
3267 * powerpc.cc (is_branch_reloc): Forward declare.
3268 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3269 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3270 false for 64-bit, true for 32-bit non-branch relocs.
3271 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3272 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3273 nm output.
3274 (icf_safe_test): Generate linker map file as well as nm output.
3275 (icf_safe_so_test): Likewise.
3276 * testsuite/Makefile.in: Regenerate.
3277 * testsuite/icf_test.sh: Parse linker map file to determine
3278 section folding.
3279 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3280 * testsuite/icf_safe_so_test.sh: Likewise.
3281 (X86_32_or_ARM_specific_safe_fold): Merge into..
3282 (arch_specific_safe_fold): ..this.
3283 (X86_64_specific_safe_fold): Delete unused function.
3284
3285 2013-03-12 Alan Modra <amodra@gmail.com>
3286
3287 * gc.h (gc_process_relocs): Look through function descriptors
3288 to determine shndx, symvalue and addend used by ICF. Tidy
3289 variable duplication.
3290
3291 2013-03-11 Alan Modra <amodra@gmail.com>
3292
3293 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3294 * layout.cc (Layout_task_runner::run): ..to here.
3295 * symtab.h (struct Symbol_location): Extract from..
3296 (class Symbol_table): ..here.
3297 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3298 * target.h (class Target): Add function_location and
3299 do_function_location functions.
3300 (class Sized_target): Add do_function_location.
3301 * object.h (class Sized_relobj_file): Move find_shdr..
3302 (class Object): ..to here.
3303 * object.cc: Likewise. Update to suit. Instantiate.
3304 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3305 * powerpc.cc (class Powerpc_dynobj): New.
3306 (Target_powerpc::do_function_location): New function.
3307 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3308 (Powerpc_dynobj::do_read_symbols): New function.
3309 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3310
3311 2013-03-08 Ian Lance Taylor <iant@google.com>
3312
3313 * options.cc (General_options::string_to_object_format): Accept
3314 "default".
3315
3316 2013-03-08 Alan Modra <amodra@gmail.com>
3317
3318 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3319 pointer to Post_fde.
3320 (struct Post_fde): Move definition to here..
3321 * ehframe.cc (struct Post_fde): ..from here.
3322 (Cie::write): Don't alloc Post_fde.
3323 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3324
3325 2013-03-07 Alan Modra <amodra@gmail.com>
3326
3327 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3328 relocation referencing .LC0.
3329 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3330
3331 2013-03-07 Alan Modra <amodra@gmail.com>
3332
3333 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3334 always_inline. Add assembly for powerpc to avoid GOT.
3335
3336 2013-03-07 Alan Modra <amodra@gmail.com>
3337
3338 * testsuite/script_test_10.sh: Don't test .bss section
3339 header number.
3340
3341 2013-03-06 Alan Modra <amodra@gmail.com>
3342
3343 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3344 (Target_powerpc::symval_for_branch): Add symtab param. Update
3345 all callers. Handle folded sections.
3346 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3347 to Powerpc_relobj.
3348 (Global_symbol_visitor_opd::operator()): Likewise.
3349
3350 2013-03-04 Alan Modra <amodra@gmail.com>
3351
3352 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3353 * testsuite/Makefile.in: Regenerate.
3354
3355 2013-03-01 Cary Coutant <ccoutant@google.com>
3356
3357 Add dwp support for v2 DWARF package file format.
3358 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3359 tu_length parameter. Adjust all callers.
3360 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3361 * dwp.cc: Include dwarf.h.
3362 (Section_bounds): New struct type.
3363 (Unit_set): New struct type.
3364 (Dwo_file::Dwo_file): Initialize new data member.
3365 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3366 Combine and rename to...
3367 (Dwo_file::read_unit_index): ...this.
3368 (Dwo_file::sized_read_compunit_index)
3369 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3370 (Dwo_file::sized_read_unit_index): ...this.
3371 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3372 parameters; add section_id parameter.
3373 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3374 (Dwo_file::add_unit_set): ...this.
3375 (Dwo_file::shndx_map_): Remove.
3376 (Dwo_file::sect_offsets_): New data member.
3377 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3378 (Dwp_output_file::add_section): Rename to...
3379 (Dwp_output_file::add_contribution): ...this.
3380 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3381 (Dwp_output_file::add_tu_set): Likewise.
3382 (Dwp_output_file::Contribution): New type.
3383 (Dwp_output_file::Section::contributions): New data member.
3384 (Dwp_output_file::Cu_or_tu_set): Remove.
3385 (Dwp_output_file::Section::Section): New ctor.
3386 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3387 (Dwp_output_file::Dwp_index::Section_table): New type.
3388 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3389 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3390 parameter.
3391 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3392 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3393 (Dwp_output_file::Dwp_index::section_table): New member function.
3394 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3395 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3396 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3397 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3398 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3399 (Dwp_output_file::Dwp_index::section_table_): New data member.
3400 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3401 (Dwp_output_file::add_output_section): New member function.
3402 (Dwp_output_file::write_new_section): New member function.
3403 (Dwp_output_file::write_contributions): New member function.
3404 (Dwp_output_file::section_id_map_): New data member.
3405 (class Dwo_id_info_reader): Remove.
3406 (class Unit_reader): New class.
3407 (get_dwarf_section_name): New function.
3408 (Dwo_file::read_executable): Adjust initializations of class data.
3409 (Dwo_file::read): Add support for v2 package file format.
3410 (Dwo_file::read_unit_index): Likewise.
3411 (Dwo_file::sized_read_unit_index): Likewise.
3412 (Dwo_file::copy_section): Likewise.
3413 (Dwo_file::add_unit_set): Likewise.
3414 (Dwp_output_file::add_output_section): Likewise.
3415 (Dwp_output_file::add_contribution): Likewise.
3416 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3417 for empty slot.
3418 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3419 file format.
3420 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3421 slot.
3422 (Dwp_output_file::initialize): Remove unused function.
3423 (Dwp_output_file::finalize): Add support for v2 package file format.
3424 (Dwp_output_file::write_index): Likewise.
3425 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3426 function prototype.
3427
3428 2013-03-01 Cary Coutant <ccoutant@google.com>
3429
3430 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3431 function into class definition in header file.
3432 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3433 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3434 New function.
3435 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3436
3437 2013-02-28 Alan Modra <amodra@gmail.com>
3438
3439 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3440 * target.cc (Target::do_plt_fde_location): New function.
3441 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3442 accessor function, and constructor param.
3443 (struct Post_fde, Post_fdes): Declare.
3444 (Cie::write): Add post_fdes param.
3445 * ehframe.cc (Fde::write): Use plt_fde_location.
3446 (struct Post_fde): Define.
3447 (Cie::write): Stash FDEs added post merge mapping.
3448 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3449 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3450 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3451 other FDEs.
3452 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3453 (Target_powerpc::has_glink): New function.
3454 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3455 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3456 glink_eh_frame_fde_32, default_fde): New data.
3457 (Stub_table::eh_frame_added_): New var.
3458 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3459 Make const.
3460 (Stub_table::add_eh_frame): New function.
3461 (Output_data_glink::add_eh_frame): New function.
3462 (Target_powerpc::make_glink_section): Call add_eh_frame.
3463
3464 2013-02-15 Ian Lance Taylor <iant@google.com>
3465
3466 * options.h (DEFINE_uint64_alias): Define.
3467 (class General_options): Add -Ttext-segment as an alias for
3468 -Ttext.
3469
3470 2013-02-15 Alan Modra <amodra@gmail.com>
3471
3472 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3473 (Stub_table::do_write): ..here, two places.
3474 (Stub_table::plt_call_size): Use it here too.
3475
3476 2013-02-11 Ian Lance Taylor <iant@google.com>
3477
3478 * descriptors.cc (Descriptors::close_all): New function.
3479 * descriptors.h (class Descriptors): Declare close_all.
3480 (close_all_descriptors): New inline function.
3481 * plugin.cc: Include "descriptors.h".
3482 (Plugin_manager::cleanup): Call close_all_descriptors.
3483
3484 2013-02-06 Alan Modra <amodra@gmail.com>
3485
3486 * README: Update coding style link.
3487
3488 2013-01-28 Cary Coutant <ccoutant@google.com>
3489
3490 * dwp.cc (File_list): New typedef.
3491 (Dwo_name_info_reader): New class.
3492 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3493 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3494 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3495 (Dwo_file::read_executable): New function.
3496 (Dwo_file::read): Move common setup code to ...
3497 (Dwo_file::make_object): ... here.
3498 (dwp_options): Add --exec/-e.
3499 (usage): Likewise.
3500 (main): Likewise.
3501
3502 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3503
3504 * layout.cc (Layout::layout): Check for option text_reorder.
3505 (Layout::make_output_section): Ditto.
3506 * options.h (text_reorder): New option.
3507 * output.cc (Input_section_sort_compare): Remove special ordering
3508 of section names.
3509 (Output_section::
3510 Input_section_sort_section_name_special_ordering_compare::
3511 operator()): New function.
3512 (Output_section::sort_attached_input_sections): Use new sort function
3513 for .text.
3514 * output.h (Input_section_sort_section_name_special_ordering_compare):
3515 New struct.
3516 * testsuite/Makefile.am (text_section_grouping): Test option
3517 --no-text-reorder
3518 * testsuite/Makefile.in: Regenerate.
3519 * testsuite/text_section_grouping.sh: Check order of functions without
3520 default text reordering.
3521
3522 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3523
3524 * options.h (General_options): Change default to true for new_dtags.
3525
3526 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3527
3528 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3529 when enable_new_dtags is false. Only add DT_RUNPATH when
3530 enable_new_dtags is true.
3531
3532 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3533
3534 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3535 used in declaration and definition consistent.
3536 (Target_powerpc::symval_for_branch): Ditto.
3537
3538 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3539
3540 * testsuite/plugin_final_layout.cc: Fix comment.
3541
3542 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3543
3544 * layout.cc (Layout::layout): Do not do default sorting for
3545 text sections when section ordering is specified.
3546 (make_output_section): Ditto.
3547 * testsuite/plugin_final_layout.cc: Name the function sections
3548 to catch reordering issues.
3549
3550 2013-01-15 Alan Modra <amodra@gmail.com>
3551
3552 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3553 plt-thread-safe.
3554
3555 2013-01-15 Alan Modra <amodra@gmail.com>
3556
3557 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3558 * testsuite/Makefile.in: Regenerate.
3559
3560 2013-01-14 Alan Modra <amodra@gmail.com>
3561
3562 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3563 * testsuite/Makefile.in: Regenerate.
3564
3565 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3566
3567 PR bfd/14430
3568 Fix mingw gold build with plugins enabled
3569 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3570 * configure.ac: Export DLOPEN_LIBS and add headers check.
3571 * plugin.cc: Handle non-dlfcn case.
3572 * Makefile.in: Regenerate.
3573 * config.in: Regenerate.
3574 * configure: Regenerate.
3575 * testsuite/Makefile.in: Regenerate.
3576
3577 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3578
3579 * output.h (sort_attached_input_sections): Change to be public.
3580 * script-sections.cc
3581 (Output_section_definition::set_section_addresses): Sort
3582 attached input sections according to section order before linker
3583 script assigns section addresses.
3584 (Orphan_output_section::set_section_addresses): Sort
3585 attached input sections according to section order before linker
3586 script assigns section addresses.
3587 * Makefile.am (final_layout.sh): Use a simple linker script to
3588 check if section ordering still works.
3589 * Makefile.in: Regenerate.
3590
3591 2013-01-09 Ben Cheng <bccheng@google.com>
3592
3593 * arm.cc (Target_arm::attributes_accept_div): New function.
3594 (Target_arm::attributes_forbid_div): New function.
3595 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3596 attribute using the same new functions as what bfd/elf32_arm.c
3597 does.
3598
3599 2013-01-07 Cary Coutant <ccoutant@google.com>
3600
3601 PR gold/14993
3602 * output.cc (Output_section::add_input_section): For incremental
3603 updates, don't track input sections that are allocated from patch
3604 space.
3605
3606 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3607 Ian Lance Taylor <iant@google.com>
3608
3609 PR gold/14897
3610 * configure.ac (--enable-ld): Removed.
3611 (install_as_default): Set to yes only for --enable-gold=default
3612 or --disable-ld.
3613 * configure: Regenerated.
3614
3615 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3616
3617 * options.h (General_options): Add -fuse-ld= for GCC linker
3618 option compatibility.
3619
3620 2013-01-04 Cary Coutant <ccoutant@google.com>
3621
3622 * configure.ac: Fix typo restoring CXXFLAGS.
3623 * configure: Regenerate.
3624
3625 2013-01-04 Cary Coutant <ccoutant@google.com>
3626
3627 * testsuite/Makefile.am (CXXLINK_S): New macro.
3628 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3629 * testsuite/Makefile.in: Regenerate.
3630
3631 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3632
3633 * version.cc (print_version): Update copyright year to 2013.
3634
3635 2012-12-20 Ian Lance Taylor <iant@google.com>
3636
3637 * layout.cc (Layout::special_ordering_of_input_section): New
3638 function.
3639 (Layout::layout): If input section requires special ordering, must
3640 sort input sections.
3641 (Layout::make_output_section): May sort .text input sections.
3642 (Layout::is_section_name_prefix_grouped): Remove.
3643 * layout.h (class Layout): Declare
3644 special_ordering_of_input_section. Don't declare
3645 is_section_name_prefix_grouped.
3646 * output.cc (Output_section::add_input_section): Revert last
3647 change.
3648 (Output_section::Input_section_sort::match_file_name): Don't crash
3649 if called on output section data.
3650 (Output_section::Input_section_sort_compare): Sort based on
3651 special ordering.
3652 (Output_section::Input_section_sort_section_order_index_compare):
3653 Revert last patch.
3654 (Output_section::sort_attached_input_sections): Likewise.
3655
3656 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3657
3658 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3659 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3660 * output.cc (Output_section::add_input_section): Check if section
3661 name contains special prefix. Keep input sections to sort such
3662 sections.
3663 (Output_section::Input_section_sort_section_order_index_compare
3664 ::operator()): Group sections according to prefixes.
3665 (Output_section::sort_attached_input_sections): Add condition to
3666 Input_section_entry constructor call.
3667 * testsuite/Makefile.am (text_section_grouping): New test.
3668 * testsuite/Makefile.in: Regenerate.
3669 * testsuite/text_section_grouping.cc: New file.
3670 * testsuite/text_section_grouping.sh: New file.
3671
3672 2012-12-17 Nick Clifton <nickc@redhat.com>
3673
3674 * Makefile.am: Add copyright notice.
3675 * NEWS: Likewise.
3676 * README: Likewise.
3677 * configure.ac: Likewise.
3678 * ftruncate.c: Likewise.
3679 * Makefile.in: Regenerate.
3680
3681 2012-12-14 Cary Coutant <ccoutant@google.com>
3682
3683 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3684 --no-as-needed flag.
3685 (exception_separate_shared_12_test): Likewise.
3686 (incremental_copy_test): Likewise.
3687 * testsuite/Makefile.in: Regenerate.
3688
3689 2012-12-14 Cary Coutant <ccoutant@google.com>
3690
3691 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3692 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3693
3694 2012-12-12 Alan Modra <amodra@gmail.com>
3695
3696 * powerpc.cc (class Track_tls): New.
3697 (class Relocate, class Scan): Inherit Track_tls.
3698 (Target_powerpc::Scan::local, global): Track tls optimization
3699 and avoid creating plt entry for __tls_get_addr if all uses
3700 are optimized away.
3701 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3702
3703 2012-12-12 Alan Modra <amodra@gmail.com>
3704
3705 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3706 Replace no_toc_optimize with toc_optimize.
3707 * output.h (Output_section::input_sections): Provide non-const variant.
3708 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3709 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3710 accessors.
3711 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3712 (class Sort_toc_sections): New.
3713 (Target_powerpc::do_finalize_sections): Sort toc sections.
3714 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3715
3716 2012-12-10 Roland McGrath <mcgrathr@google.com>
3717
3718 * testsuite/binary_unittest.cc (read_all): New function.
3719 (Sized_binary_test): Use it instead of ::read.
3720 * fileread.cc (do_read): Don't assume pread always reads the whole
3721 amount in a single call.
3722
3723 2012-12-10 Alan Modra <amodra@gmail.com>
3724
3725 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3726 Set EM_PPC64 or EM_PPC here.
3727 (Target_selector_powerpc::do_recognize): Delete.
3728
3729 2012-12-10 Alan Modra <amodra@gmail.com>
3730
3731 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3732 stub_table_.
3733 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3734
3735 2012-12-07 Roland McGrath <mcgrathr@google.com>
3736
3737 * testsuite/binary_unittest.cc (Sized_binary_test):
3738 Use open_descriptor rather than ::open.
3739
3740 2012-12-07 Alan Modra <amodra@gmail.com>
3741
3742 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3743 typedef and invalid_address constant.
3744 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3745 instantiate constants.
3746
3747 2012-12-06 Roland McGrath <mcgrathr@google.com>
3748
3749 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3750 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3751 * aclocal.m4: Regenerate.
3752 * configure: Regenerate.
3753 * Makefile.in: Regenerate.
3754 * testsuite/Makefile.in: Regenerate.
3755
3756 2012-12-07 Alan Modra <amodra@gmail.com>
3757
3758 * options.h (General_options): Add no_toc_optimize.
3759 * powerpc.cc (ok_lo_toc_insn): New function.
3760 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3761
3762 2012-12-06 Alan Modra <amodra@gmail.com>
3763
3764 * options.h (General_options): Add plt_align, plt_static_chain,
3765 plt_thread_safe. Update stub_group_size help text.
3766 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3767 for new plt_thread_safe_ var.
3768 (use_plt_offset): Correct comments.
3769 (Target_powerpc::do_relax): Look for thread creation symbols to
3770 determine default plt_thread_safe value. Clear plt call stubs
3771 as well as branch stubs each iteration.
3772 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3773 insn constants.
3774 (l, hi, ha, write_insn): Move earlier.
3775 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3776 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3777 plt stubs too.
3778 (Stub_table::update_size): Adjust.
3779 (Stub_table::prev_size, set_prev_size): Delete.
3780 (Stub_table::stub_align): Let --plt-align affect result.
3781 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3782 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3783 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3784 (Stub_table::do_write): Support more stub variants.
3785
3786 2012-12-04 Alan Modra <amodra@gmail.com>
3787
3788 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3789 (Target_powerpc::do_define_standard_symbols): New function.
3790
3791 2012-12-03 Alan Modra <amodra@gmail.com>
3792
3793 * output.h: Formatting, whitespace.
3794
3795 2012-12-03 Alan Modra <amodra@gmail.com>
3796
3797 * layout.h (Layout::get_executable_sections): Declare.
3798 * layout.cc (Layout::get_executable_sections): New function.
3799 * arm.cc (Target_arm::group_sections): Use it.
3800 (Arm_output_section::group_sections): Delete now redundant test.
3801 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3802 param to handle relative relocs.
3803 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3804 (Output_data_reloc::add_absolute): Adjust.
3805 (Output_data_reloc::add_relative): New function.
3806 (Output_data::reset_data_size): New function.
3807 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3808 (Output_section::set_addralign): New function.
3809 (Output_section::checkpoint_set_addralign): New function.
3810 (Output_section::clear_section_offsets_need_adjustment): New function.
3811 (Output_section::input_sections): Make public.
3812 * powerpc.cc (class Output_data_brlt_powerpc): New.
3813 (class Stub_table, class Stub_control): New.
3814 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3815 stub_table_, set_stub_table, stub_table): New vectors and accessor
3816 functions.
3817 (Target_powerpc::do_may_relax, do_relax, push_branch,
3818 new_stub_table, stub_tables, brlt_section, group_sections,
3819 add_branch_lookup_table, find_branch_lookup_table,
3820 write_branch_lookup_table, make_brlt_section): New functions.
3821 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3822 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3823 branch_info_): New vars.
3824 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3825 make call stubs here.
3826 (Output_data_glink): Remove all call stub handling from this class.
3827 (Target_powerpc::Scan::local, global): Save interesting branch
3828 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3829 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3830 functions on final link.
3831 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3832 Handle long branch destinations too.
3833 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3834 do_plt_address_for_local): Adjust lookup of plt call stubs.
3835
3836 2012-11-30 Alan Modra <amodra@gmail.com>
3837
3838 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3839 relocs against protected symbols when building 32-bit shared libs.
3840
3841 2012-11-30 Alan Modra <amodra@gmail.com>
3842
3843 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3844 param. Call got_section() to make .got. Update all callers
3845 and their callers and so on.
3846
3847 2012-11-30 Alan Modra <amodra@gmail.com>
3848
3849 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3850 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3851 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3852 value if it already exists.
3853
3854 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3855
3856 PR gold/14858
3857 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3858
3859 2012-11-14 Roland McGrath <mcgrathr@google.com>
3860
3861 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3862 than bfc instruction for data sandboxing.
3863
3864 2012-11-08 Alan Modra <amodra@gmail.com>
3865
3866 * po/POTFILES.in: Regenerate.
3867
3868 2012-11-05 Alan Modra <amodra@gmail.com>
3869
3870 * configure.ac: Apply 2012-09-10 change to config.in here.
3871 * configure: Regenerate.
3872
3873 2012-11-05 Alan Modra <amodra@gmail.com>
3874
3875 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3876 (struct Opd_ent): Use "Address" rather than "Offset".
3877 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3878 (Target_powerpc::got_section): Make public.
3879 (Target_powerpc::scan_relocs): Move code setting symbols..
3880 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3881 Create _SDA_BASE_ only when referenced.
3882
3883 2012-11-02 Roland McGrath <mcgrathr@google.com>
3884
3885 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3886 from last change.
3887
3888 2012-11-01 Roland McGrath <mcgrathr@google.com>
3889
3890 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3891 for offset_in_output_section parameter.
3892 (Sized_target::relocate_special_relocatable): Likewise.
3893 * arm.cc (Target_arm::relocate_relocs): Likewise.
3894 (Target_arm::relocate_special_relocatable): Likewise.
3895 * i386.cc (Target_i386::relocate_relocs): Likewise.
3896 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3897 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3898 * target-reloc.h (relocate_relocs): Likewise.
3899 * testsuite/testfile.cc (Target_test): Likewise.
3900 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3901 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3902
3903 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3904 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3905
3906 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3907 parameter, which is unused in the [!F_SETFD] case.
3908
3909 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3910 SYMNDX to off_t before comparing it to this->data_size().
3911 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3912 * incremental.cc (Output_section_incremental_inputs::do_write):
3913 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3914
3915 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3916
3917 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3918
3919 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3920 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3921 in EABI_VER5.
3922
3923 2012-10-29 Cary Coutant <ccoutant@google.com>
3924
3925 * dwp.cc (usage): Add file and exit status parameters;
3926 add --help and --version options.
3927 (print_version): New function.
3928 (main): Add --help and --version options.
3929
3930 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3931
3932 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3933 final_layout_sequence.txt.
3934 * testsuite/Makefile.in: Regenerated.
3935
3936 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3937
3938 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3939 COMPILE generated by automake.
3940 (LINK1): Likewise.
3941 (CXXCOMPILE1): Likewise.
3942 (CXXLINK1): Likewise.
3943 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3944 (LINK): Likewise.
3945 (CXXCOMPILE): Likewise.
3946 (CXXLINK): Likewise.
3947 * testsuite/Makefile.in: Regenerated.
3948
3949 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3950
3951 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3952 on bad fwrite return.
3953
3954 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3955
3956 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3957 on val.
3958
3959 2012-10-23 Cary Coutant <ccoutant@google.com>
3960
3961 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3962 * testsuite/Makefile.in: Regenerate.
3963 * testsuite/dwp_test.h: New source file.
3964 * testsuite/dwp_test_1.cc: New source file.
3965 * testsuite/dwp_test_1.s: New source file.
3966 * testsuite/dwp_test_1.sh: New source file.
3967 * testsuite/dwp_test_1b.cc: New source file.
3968 * testsuite/dwp_test_1b.s: New source file.
3969 * testsuite/dwp_test_2.cc: New source file.
3970 * testsuite/dwp_test_2.s: New source file.
3971 * testsuite/dwp_test_2.sh: New source file.
3972 * testsuite/dwp_test_main.cc: New source file.
3973 * testsuite/dwp_test_main.s: New source file.
3974
3975 2012-10-23 Cary Coutant <ccoutant@google.com>
3976
3977 * dwp.h: New header file.
3978 * dwp.cc: New source file.
3979 * gold.h: Move shared declarations to system.h.
3980 * system.h: New header file.
3981 * Makefile.am: Add dwp.
3982 * Makefile.in: Regenerate.
3983
3984 2012-10-23 Cary Coutant <ccoutant@google.com>
3985
3986 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3987 Dwarf_info_reader::read_from_pointer.
3988 (Dwarf_pubnames_table::read_header): Likewise.
3989 (Dwarf_pubnames_table::next_name): Likewise.
3990 (Dwarf_die::read_attributes): Likewise.
3991 (Dwarf_die::skip_attributes): Likewise.
3992 (Dwarf_info_reader::read_from_pointer): New function template.
3993 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3994 (Dwarf_pubnames_table): Likewise.
3995 (Dwarf_info_reader::read_from_pointer): New function template.
3996 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3997 Dwarf_pubnames_table ctor.
3998
3999 2012-10-23 Cary Coutant <ccoutant@google.com>
4000
4001 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4002 abbrev_shndx.
4003 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4004 abbrev_shndx_.
4005 (Dwarf_info_reader::set_abbrev_shndx): New method.
4006 (Dwarf_info_reader::abbrev_shndx_): New data member.
4007
4008 2012-10-23 Cary Coutant <ccoutant@google.com>
4009
4010 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4011 from object, not parameters.
4012 (Dwarf_info_reader::parse): Likewise.
4013 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4014 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4015 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4016 methods.
4017
4018 2012-10-23 Cary Coutant <ccoutant@google.com>
4019
4020 * fileread.cc (Input_file::Input_file): New constructor.
4021 * fileread.h (class Input_file): Add new constructor.
4022
4023 2012-10-18 Alan Modra <amodra@gmail.com>
4024
4025 PR gold/14727
4026 * object.cc (Relobj::is_section_name_included): Also match
4027 .sdata personality section.
4028
4029 2012-10-18 Alan Modra <amodra@gmail.com>
4030
4031 * target-reloc.h (class Default_comdat_behavior): New, package up..
4032 (get_comdat_behaviour): ..this.
4033 (relocate_section): Add Relocate_comdat_behavior template arg,
4034 adjust code to suit.
4035 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4036 (Target_arm::scan_reloc_section): Likewise.
4037 * i386.cc (Target_i386::relocate_section): Likewise.
4038 * sparc.cc (Target_sparc::relocate_section): Likewise.
4039 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4040 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4041 * powerpc.cc (class Relocate_comdat_behavior): New.
4042 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4043 gold::relocate_section with new template arg.
4044
4045 2012-10-18 Alan Modra <amodra@gmail.com>
4046
4047 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4048 dynamic relocs for GOT_TPREL got entries, without symbol if
4049 resolving locally.
4050 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4051 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4052 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4053
4054 2012-10-17 Alan Modra <amodra@gmail.com>
4055
4056 PR gold/14726
4057 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4058
4059 2012-10-16 Sriraman Tallam <tmsriram@google.com>
4060
4061 * layout.cc (Layout::include_section): Keep sections marked
4062 SHF_EXCLUDE when doing relocatable links.
4063
4064 2012-10-16 Alan Modra <amodra@gmail.com>
4065
4066 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4067 (Target_powerpc::do_finalize_sections): Call it.
4068 (Output_data_save_res): New class and supporting functions.
4069 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4070 normal symbols defined in object files.
4071
4072 2012-10-12 Alan Modra <amodra@gmail.com>
4073
4074 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4075 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4076 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4077 section if scan_opd_relocs not yet called.
4078 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4079
4080 2012-10-12 Alan Modra <amodra@gmail.com>
4081
4082 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4083 add_local_ifunc_entry): Revert last change.
4084 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4085
4086 2012-10-05 Alan Modra <amodra@gmail.com>
4087
4088 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4089 do_plt_address_for_global): New functions.
4090 (Output_data_got_powerpc::do_write): Don't segfault when linking
4091 statically.
4092 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4093 add_local_ifunc_entry): Return true on adding entry..
4094 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4095 glink->add_entry call. Remove unused symtab param. Adjust calls.
4096 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4097 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4098 set up symbols here.
4099 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4100 syms here. Do so even when no .iplt. Don't segfault when linking
4101 statically.
4102 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4103 new variants without reloc param.
4104 (Glink_sym_ent::Glink_sym_ent): Likewise.
4105 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4106 reloc when refs will resolve to plt call stub.
4107 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4108 R_PPC_PLTREL24 to resolve locally.
4109 (Target_powerpc::Scan::global): Correct ifunc handling.
4110 (Target_powerpc::Relocate::relocate): Correct local sym glink
4111 lookup. Don't destroy "value" when we have a plt call stub,
4112 and when checking plt call validity.
4113 (Target_powerpc::do_dynsym_value): Simplify.
4114
4115 2012-10-05 Alan Modra <amodra@gmail.com>
4116
4117 * i386.cc (Output_data_plt_i386::address_for_global,
4118 address_for_local): Add plt offset to returned value. Adjust uses.
4119 * sparc.cc (Output_data_plt_sparc::address_for_global,
4120 address_for_local): Likewise.
4121 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4122 address_for_local): Likewise.
4123 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4124 address_for_local): Likewise.
4125 * target.h (Target::plt_address_for_global, plt_address_for_local):
4126 Update comment.
4127 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4128 (Output_data_got::Got_entry::write): Nor here.
4129 * output.h: Comment fix.
4130
4131 2012-10-02 Jiong Wang <jiwang@tilera.com>
4132
4133 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4134 global_offset_table_ value for larget got.
4135 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4136
4137 2012-09-29 Alan Modra <amodra@gmail.com>
4138
4139 * powerpc.cc (Target_powerpc::iplt_): New output section.
4140 (Target_powerpc::iplt_section, make_iplt_section,
4141 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4142 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4143 Target_powerpc::plt_entry_count): Count iplt entries too.
4144 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4145 reloc section in constructor. New params.
4146 (Target_powerpc::make_plt_section): Create reloc section here instead.
4147 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4148 functions.
4149 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4150 (Output_data_glink::add_entry, find_entry): New functions to
4151 deal with local syms.
4152 (Glink_sym_ent): Add support for local syms.
4153 (Output_data_glink::do_write): Handle ifunc plt entries.
4154 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4155 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4156 (Target_powerpc::Relocate::relocate): Likewise.
4157 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4158
4159 2012-09-25 Alan Modra <amodra@gmail.com>
4160
4161 * object.h (Sized_relobj_file::adjust_local_symbol,
4162 do_adjust_local_symbol): New functions.
4163 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4164 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4165 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4166 and irregular opd entry spacing.
4167 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4168 (Global_symbol_visitor_opd): New functor.
4169 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4170 on deleted opd entries.
4171
4172 2012-09-15 Jiong Wang <jiwang@tilera.com>
4173
4174 * tilegx.cc: New file.
4175 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4176 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4177 * configure.tgt: Add entries for tilegx*.
4178 * configure.ac: Likewise.
4179 * Makefile.in: Rebuild.
4180 * configure: Likewise.
4181 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4182 tilegx.
4183
4184 2012-09-13 Alan Modra <amodra@gmail.com>
4185
4186 * target-reloc.h (scan_relocs): Call scan.local for relocs
4187 against symbols in discarded sections. Pass is_discarded
4188 param.
4189 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4190 Add is_discarded param.
4191 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4192 is_discarded to flag opd entry as discarded. Don't emit dyn
4193 relocs on such entries.
4194 (Target_powerpc::Scan::global): Similarly detect and handle
4195 such opd entries.
4196 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4197 opd_ent_. Update all uses.
4198 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4199 (Target_powerpc::relocate_section): Zero out discarded opd
4200 entry relocs.
4201
4202 2012-09-12 Ian Lance Taylor <iant@google.com>
4203
4204 PR gold/14570
4205 * output.cc: Rename Output_data_got template parameter from size
4206 to got_size for all functions. Compile all variants of
4207 Output_data_got.
4208 (Output_data_got::Got_entry::write): Correct use of size for
4209 symbol value. Use local_is_tls rather than casting to
4210 Sized_relobj_file.
4211 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4212 (class Sized_relobj_file): Add do_local_is_tls.
4213 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4214
4215 2012-09-11 Alan Modra <amodra@gmail.com>
4216
4217 PR gold/14566
4218 * layout.cc (Layout::set_segment_offsets): When using
4219 common-page-size alignment, ensure we are on a new max-page-size
4220 page.
4221 * output.cc (Output_segment::set_section_addresses): Use
4222 abi_pagesize, not common_pagesize for relro boundary.
4223 (Output_segment::set_offset): Likewise.
4224
4225 2012-09-11 Alan Modra <amodra@gmail.com>
4226
4227 * output.h (Output_data_got::add_global_tls, add_local_tls,
4228 add_local_tls_pair): New functions.
4229 (Output_data_got::add_local_pair_with_rel): Remove second
4230 reloc param. Expand comment.
4231 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4232 use_plt_or_tls_offset_, similarly for constructor param.
4233 (Output_data_got::Got_entry::write): Add got_index param.
4234 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4235 add_local_tls_pair): New functions.
4236 (Output_data_got::Got_entry::write): Handle tls symbols
4237 with use_plt_or_tls_offset_ set specially.
4238 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4239 (Output_data_got::do_write): Replace iterator with index, pass
4240 index to entry write function.
4241 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4242 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4243 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4244 call.
4245 * i386.cc (Target_i386::Scan::local): Likewise.
4246 * sparc.cc (Target_sparc::Scan::local): Likewise.
4247 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4248 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4249 do_tls_offset_for_global): New functions.
4250 (Target_powerpc::Scan::local): Correct TLS relocations and got
4251 entry values.
4252 (Target_powerpc::Scan::global): Don't emit unnecessary
4253 dynamic relocations on TLS GOT entries.
4254
4255 2012-09-10 Matthias Klose <doko@ubuntu.com>
4256
4257 * config.in: Disable sanity check for kfreebsd.
4258
4259 2012-09-10 Sterling Augustine <saugustine@google.com>
4260
4261 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4262 (Gdb_index::pubtypes_read): New parameter.
4263 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4264 to calls.
4265 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4266 pubtypes_object_.
4267
4268 2012-09-09 Alan Modra <amodra@gmail.com>
4269
4270 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4271 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4272 * gc.h (gc_process_relocs): Call target gc_add_reference.
4273 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4274 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4275 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4276 unnecessary cast.
4277 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4278 to cater for when we don't need code offset. Update use.
4279 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4280 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4281 set_opd_valid): New functions.
4282 (Target_powerpc::do_gc_add_reference): New function.
4283 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4284 stashed refs.
4285 (Target_powerpc::do_gc_mark_symbol): New function.
4286
4287 2012-09-06 Cary Coutant <ccoutant@google.com>
4288
4289 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4290 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4291 (Dwarf_die::skip_attributes): Likewise.
4292 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4293 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4294 (main): Call it.
4295 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4296
4297 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4298
4299 * testsuite/script_test_3.t: Add .got.plt output section
4300 statement.
4301 * testsuite/script_test_4.t: Likewise.
4302
4303 2012-09-05 Alan Modra <amodra@gmail.com>
4304
4305 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4306 update all uses and lose "enum" when using type.
4307
4308 2012-09-05 Alan Modra <amodra@gmail.com>
4309
4310 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4311 * configure: Regenerate.
4312 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4313 (plugin_final_layout.stdout): Likewise.
4314 (memory_test): Set page sizes to 0x1000.
4315 * testsuite/Makefile.in: Regenerate.
4316 * testsuite/discard_locals_test.sh: Add FIXME comment.
4317 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4318 * testsuite/pr14265.t: Add .got output section statement.
4319 * testsuite/script_test_2.t: Likewise.
4320 * testsuite/script_test_3.t: Likewise.
4321 * testsuite/script_test_4.t: Likewise.
4322 * testsuite/script_test_5.t: Likewise.
4323 * testsuite/script_test_6.t: Likewise.
4324 * testsuite/script_test_7.t: Likewise.
4325 * testsuite/script_test_9.t: Likewise.
4326
4327 2012-09-05 Alan Modra <amodra@gmail.com>
4328
4329 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4330 (Powerpc_relocate_functions::Status): New typedef.
4331 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4332 (Target_powerpc::Scan::local): Handle REL64.
4333 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4334 for REL32 and REL64.
4335 (Target_powerpc::symval_for_branch): New function, extracted from..
4336 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4337 checks. Report overflow errors.
4338
4339 2012-09-05 Alan Modra <amodra@gmail.com>
4340
4341 * object.h (Sized_relobj_file::emit_relocs): Delete.
4342 (Sized_relobj_file::emit_relocs_reltype): Delete.
4343 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4344 relocate_relocs for --emit-relocs.
4345 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4346 * output.h: Update comment.
4347 (Output_segment::first_section): New function.
4348 (Output_segment::first_section_load_address): Use first_section.
4349 * output.cc (Output_segment::first_section): New function extracted..
4350 (Output_segment::first_section_load_address): ..from here. Delete.
4351 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4352 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4353 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4354 adjust call to target.h function.
4355 * i386.cc (Target_i386): Likewise.
4356 * sparc.cc (Target_sparc): Likewise.
4357 * x86_64.cc (Target_x86_64): Likewise.
4358 * powerpc.cc (Target_powerpc): Likewise.
4359 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4360 first tls section has section symbol for optimised local dynamic
4361 output relocs.
4362 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4363 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4364 optimised tls code.
4365 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4366 Rename to relocate_relocs. Update error message.
4367
4368 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4369
4370 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4371 --just-symbols.
4372
4373 2012-08-31 Alan Modra <amodra@gmail.com>
4374
4375 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4376 (Powerpc_relobj::toc_base_offset): New stub function.
4377 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4378 got_mod_index_offset to tlsld_got_offset. Update all refs.
4379 (Target_powerpc::Relocate::enum skip_tls): New.
4380 (Target_powerpc::call_tls_get_addr_): New var.
4381 (Target_powerpc::is_branch_reloc): Move to file scope.
4382 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4383 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4384 New functions.
4385 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4386 (powerpc_info): Correct common_pagesize for ppc64.
4387 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4388 (Powerpc_relocate_functions): Add overflow check enums and functions.
4389 Add non-shift version of rela, rela_ua. Delete all rel public
4390 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4391 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4392 addr16_ha3, addr14 functions.
4393 (Output_data_got_powerpc::add_constant_pair): New function.
4394 (Output_data_got_powerpc::got_base_offset): Likewise.
4395 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4396 (instruction constants): Sort, add some more.
4397 (Output_data_glink::do_write): Add and use Address typedef. Use
4398 object->toc_base_offset() stub for 64-bit.
4399 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4400 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4401 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4402 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4403 Always treat .opd relocs as against locally defined symbol.
4404 Correct condition for RELATIVE relocs.
4405 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4406 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4407 for 32-bit syms with a plt entry. Correct ppc64 toc base
4408 calculations. Handle TLS relocs, and more. Add overflow
4409 checking and adjust for Powerpc_relocate_functions changes.
4410 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4411 Reinstate --emit-relocs code with FIXME.
4412
4413 2012-08-30 Alan Modra <amodra@gmail.com>
4414
4415 * layout.cc (Layout::set_segment_offsets): Set p_align to
4416 abi_pagesize, not common_pagesize.
4417 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4418 to determine whether file header can go in segment.
4419
4420 2012-08-30 Alan Modra <amodra@gmail.com>
4421
4422 * output.h (Output_reloc::Output_reloc <output section>): Add
4423 is_relative param. Adjust calls.
4424 (Output_reloc::add_output_section_relative): New functions.
4425 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4426 is_relative.
4427 (Output_reloc::symbol_value): Handle SECTION_CODE.
4428
4429 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4430
4431 * gold.cc (queue_middle_tasks): Call layout again when unique
4432 segments for sections is desired.
4433 * layout.cc (Layout::Layout): Initialize new members.
4434 (Layout::get_output_section_flags): New function.
4435 (Layout::choose_output_section): Call get_output_section_flags.
4436 (Layout::layout): Make output section for mapping to a unique segment.
4437 (Layout::insert_section_segment_map): New function.
4438 (Layout::attach_allocated_section_to_segment): Make unique segment for
4439 output sections marked so.
4440 (Layout::segment_precedes): Check for unique segments when sorting.
4441 * layout.h (Layout::Unique_segment_info): New struct.
4442 (Layout::Section_segment_map): New typedef.
4443 (Layout::insert_section_segment_map): New function.
4444 (Layout::get_output_section_flags): New function.
4445 (Layout::is_unique_segment_for_sections_specified): New function.
4446 (Layout::set_unique_segment_for_sections_specified): New function.
4447 (Layout::unique_segment_for_sections_specified_): New member.
4448 (Layout::section_segment_map_): New member.
4449 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4450 Rename is_gc_pass_one to is_pass_one.
4451 Rename is_gc_pass_two to is_pass_two.
4452 Rename is_gc_or_icf to is_two_pass.
4453 Check for which pass based on whether symbols data is present.
4454 Make it two pass when unique segments for sections is desired.
4455 * output.cc (Output_section::Output_section): Initialize new
4456 members.
4457 * output.h (Output_section::is_unique_segment): New function.
4458 (Output_section::set_is_unique_segment): New function.
4459 (Output_section::is_unique_segment_): New member.
4460 (Output_section::extra_segment_flags): New function.
4461 (Output_section::set_extra_segment_flags): New function.
4462 (Output_section::extra_segment_flags_): New member.
4463 (Output_section::segment_alignment): New function.
4464 (Output_section::set_segment_alignment): New function.
4465 (Output_section::segment_alignment_): New member.
4466 (Output_segment::Output_segment): Initialize is_unique_segment_.
4467 (Output_segment::is_unique_segment): New function.
4468 (Output_segment::set_is_unique_segment): New function.
4469 (Output_segment::is_unique_segment_): New member.
4470 * plugin.cc (allow_unique_segment_for_sections): New function.
4471 (unique_segment_for_sections): New function.
4472 (Plugin::load): Add new functions to transfer vector.
4473 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4474 * Makefile.in: Regenerate.
4475 * testsuite/plugin_final_layout.sh: Check if unique segment
4476 functionality works.
4477 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4478 are available.
4479 (allow_unique_segment_for_sections): New global.
4480 (unique_segment_for_sections): New global.
4481 (claim_file_hook): Call allow_unique_segment_for_sections.
4482 (all_symbols_read_hook): Call unique_segment_for_sections.
4483
4484 2012-08-22 Cary Coutant <ccoutant@google.com>
4485
4486 * layout.cc (Layout::include_section): Don't assert on GROUP
4487 sections with --emit-relocs.
4488
4489 2012-08-21 Cary Coutant <ccoutant@google.com>
4490
4491 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4492 if --export-dynamic-symbol names an undef symbol.
4493
4494 2012-08-18 Alan Modra <amodra@gmail.com>
4495
4496 * powerpc.cc: Formatting and white space.
4497 (Powerpc_relobj): Rename got2_section_ to special_.
4498 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4499 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4500 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4501 (Target_powerpc): Add Address typedef and invalid_address. Use
4502 throughout.
4503 (Target_powerpc::is_branch_reloc): New function.
4504 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4505 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4506 for dst_mask, value and addend.
4507 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4508 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4509 (Output_data_glink::do_write): Correct toc base. Don't try to use
4510 uint16_t for 24-bit offset. Use get_output_section_offset and
4511 check return.
4512 (Target_powerpc::Scan::local): Handle more relocs.
4513 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4514 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4515 Plug in toc restoring insn after plt calls. Translate branches
4516 to function descriptor symbols to corresponding entry point.
4517 (Target_powerpc::relocate_for_relocatable): Check return from
4518 get_output_section_offset.
4519 * symtab.h: Comment typo.
4520
4521 2012-08-14 Ian Lance Taylor <iant@google.com>
4522
4523 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4524 unsupported_relocal_local to call unsupported_reloc_global.
4525
4526 2012-08-14 Nick Clifton <nickc@redhat.com>
4527
4528 PR ld/14265
4529 * script-sections.cc (Sections_element::output_section_name): Add
4530 keep return parameter.
4531 (Output_section_element::match_name): Add keep return parameter.
4532 Return the value of the keep_ member.
4533 * script-sections.h (class Output_section): Update
4534 output_section_name prototype.
4535 * layout.cc (Layout::keep_input_section): New public member
4536 function.
4537 (Layout::choose_output_section): Pass keep parameter to
4538 output_section_name.
4539 * layout.h (class Layout): Add keep_input_section.
4540 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4541 sections.
4542 * testsuite/Makefile.am: Add a test.
4543 * testsuite/Makefile.in: Regenerate.
4544 * testsuite/pr14265.c: Source file for the test.
4545 * testsuite/pr14265.t: Linker script for the test.
4546 * testsuite/pr14265.sh: Shell script for the test.
4547
4548 2012-08-14 Alan Modra <amodra@gmail.com>
4549
4550 * target.h (Target::output_section_name): New function.
4551 (Target::do_output_section_name): New function.
4552 * layout.cc (Layout::choose_output_section): Call the above.
4553 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4554
4555 2012-08-14 Alan Modra <amodra@gmail.com>
4556
4557 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4558 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4559 for replace_constant call.
4560 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4561 (Output_data_glink::do_print_to_mapfile): New function.
4562 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4563 (Target_powerpc::Relocate::relocate): Likewise.
4564
4565 2012-08-14 Alan Modra <amodra@gmail.com>
4566
4567 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4568 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4569 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4570 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4571 all references to shndx_. Handle special case for R_PPC_PLTREL24
4572 here.
4573 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4574 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4575 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4576 here.
4577 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4578 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4579
4580 2012-08-12 Alan Modra <amodra@gmail.com>
4581
4582 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4583 (glink insn constants): Use uint32_t.
4584 (Output_data_glink::add_entry): Use insert, not [] operator.
4585
4586 2012-08-11 Alan Modra <amodra@gmail.com>
4587
4588 * object.h (Sized_relobj_file::find_shdr): New function.
4589 (Sized_relobj_file::find_special_sections): New function.
4590 * object.cc (Sized_relobj_file::find_shdr): New function.
4591 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4592 (Sized_relobj_file::find_special_sections): New function, split out..
4593 (Sized_relobj_file::do_read_symbols): ..from here.
4594 * output.h (Output_data_got::replace_constant): New function.
4595 (Output_data_got::num_entries): New function.
4596 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4597 (Output_data_got::got_offset): Protected rather than private.
4598 (Output_data_got::replace_got_entry): New function.
4599 * output.cc (Output_data_got::replace_got_entry): New function.
4600 * powerpc.cc (class Powerpc_relobj): New.
4601 (class Powerpc_relocate_functions): Delete all psymval variants or
4602 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4603 Implement _ha functions using corresponding _hi function.
4604 (Powerpc_relobj::find_special_sections): New function.
4605 (Target_powerpc::do_make_elf_object): New function.
4606 (class Output_data_got_powerpc): New.
4607 (class Output_data_glink): New.
4608 (class Powerpc_scan_relocatable_reloc): New.
4609 Many more changes througout file.
4610
4611 2012-08-09 Nick Clifton <nickc@redhat.com>
4612
4613 * po/vi.po: Updated Vietnamese translation.
4614
4615 2012-08-07 Ian Lance Taylor <iant@google.com>
4616
4617 * layout.cc (Layout::add_target_dynamic_tags): If
4618 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4619 plt_rel.
4620
4621 2012-07-30 Nick Clifton <nickc@redhat.com>
4622
4623 * po/gold.pot: Updated template.
4624 * po/es.po: Updated Spanish translation.
4625
4626 2012-07-18 Cary Coutant <ccoutant@google.com>
4627
4628 PR gold/14344
4629 * configure.ac: Add check for -gpubnames support.
4630 * configure: Regenerate.
4631 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4632 support; force -gno-pubnames.
4633 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4634 support.
4635 (gdb_index_test_4): New test.
4636 * testsuite/Makefile.in: Regenerate.
4637 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4638 * testsuite/gdb_index_test_2.sh: Likewise.
4639 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4640 * testsuite/gdb_index_test_4.sh: New script.
4641 * testsuite/gdb_index_test_comm.sh: New script with common code;
4642 don't look for space after colon.
4643
4644 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4645
4646 * gold.cc (queue_middle_tasks): Update function order only after
4647 deferred objects due to plugins are processed.
4648
4649 2012-07-11 Ian Lance Taylor <iant@google.com>
4650
4651 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4652 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4653 (Target_arm::scan_reloc_for_stub): Likewise.
4654 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4655 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4656 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4657 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4658 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4659
4660 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4661 Ian Lance Taylor <iant@google.com>
4662
4663 PR gold/14309
4664 * configure.ac: Test whether std::tr1::hash<off_t> works.
4665 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4666 needed.
4667 * output.h (class Output_fill): Add virtual destructor.
4668 * configure, config.in: Rebuild.
4669
4670 2012-06-22 Roland McGrath <mcgrathr@google.com>
4671
4672 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4673
4674 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4675
4676 * plugin.cc (Plugin::load): Handle position independent executables.
4677
4678 2012-06-06 Cary Coutant <ccoutant@google.com>
4679
4680 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4681 add .debug_macro.
4682 (lines_only_debug_sections): Likewise.
4683 (gdb_fast_lookup_sections): New static array.
4684 (is_gdb_debug_section): Rename formal parameter.
4685 (is_lines_only_debug_section): Likewise.
4686 (is_gdb_fast_lookup_section): New function.
4687 (Layout::include_section): Check for ".zdebug_" prefix; pass
4688 section name suffix to is_gdb_debug_section, et al.; check for
4689 fast-lookup sections when building .gdb_index.
4690 * options.h (--strip-debug-gdb): Update GDB version number.
4691
4692 2012-06-06 Cary Coutant <ccoutant@google.com>
4693
4694 * configure.ac: Add check for fallocate.
4695 * configure: Regenerate.
4696 * config.in: Regenerate.
4697
4698 * options.h (class General_options): Add --mmap-output-file and
4699 --posix-fallocate options.
4700 * output.cc: (posix_fallocate): Remove; replace with...
4701 (gold_fallocate): New function.
4702 (Output_file::map_no_anonymous): Call gold_fallocate.
4703 (Output_file::map): Check --mmap-output-file option.
4704
4705 2012-06-05 Jing Yu <jingyu@google.com>
4706
4707 * gold.h (textdomain): Add do {} to empty while(0).
4708 (bindtextdomain): Likewise.
4709
4710 2012-06-04 Cary Coutant <ccoutant@google.com>
4711
4712 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4713 has_dynsym_index.
4714
4715 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4716
4717 * symtab.cc (Symbol_table::define_special_symbol):
4718 Initialize *poldsym to prevent uninitialized variable errors.
4719
4720 2012-05-23 Cary Coutant <ccoutant@google.com>
4721
4722 * layout.cc (Layout::section_name_mapping): Add rules to handle
4723 exact match on .data.rel.ro.local or .data.rel.ro.
4724 (Layout::output_section_name): Check for exact matches.
4725
4726 2012-05-23 Cary Coutant <ccoutant@google.com>
4727
4728 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4729 more carefully.
4730
4731 2012-05-22 Cary Coutant <ccoutant@google.com>
4732
4733 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4734 object before exporting symbol.
4735
4736 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4737
4738 * testsuite/tls_test.cc: Include "config.h" first.
4739 * testsuite/tls_test_c.c: Likewise.
4740
4741 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4742 Nick Clifton <nickc@redhat.com>
4743
4744 PR 14072
4745 * configure.in: Add check that sysdep.h has been included before
4746 any system header files.
4747 * configure: Regenerate.
4748 * config.in: Regenerate.
4749
4750 2012-05-14 Cary Coutant <ccoutant@google.com>
4751
4752 * layout.cc (Layout::make_output_section): Mark .tdata section
4753 as RELRO.
4754 * testsuite/relro_test.cc: Add a TLS variable.
4755
4756 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4757
4758 PR gold/14091
4759 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4760 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4761 R_X86_64_64.
4762
4763 2012-05-08 Cary Coutant <ccoutant@google.com>
4764
4765 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4766 (lines_only_debug_sections): Likewise.
4767
4768 2012-05-02 Roland McGrath <mcgrathr@google.com>
4769
4770 * nacl.cc: New file.
4771 * nacl.h: New file.
4772 * Makefile.am (CCFILES, HFILES): Add them.
4773 * Makefile.in: Regenerate.
4774 * i386.cc (Output_data_plt_i386_nacl): New class.
4775 (Output_data_plt_i386_nacl_exec): New class.
4776 (Output_data_plt_i386_nacl_dyn): New class.
4777 (Target_i386_nacl): New class.
4778 (Target_selector_i386_nacl): New class.
4779 (target_selector_i386): Use it instead of Target_selector_i386.
4780 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4781 (Target_x86_64_nacl): New class.
4782 (Target_selector_x86_64_nacl): New class.
4783 (target_selector_x86_64, target_selector_x32): Use it instead of
4784 Target_selector_x86_64.
4785 * arm.cc (Output_data_plt_arm_nacl): New class.
4786 (Target_arm_nacl): New class.
4787 (Target_selector_arm_nacl): New class.
4788 (target_selector_arm, target_selector_armbe): Use it instead of
4789 Target_selector_arm.
4790
4791 * target-select.cc (select_target): Take new Input_file* and off_t
4792 arguments, pass them on to recognize method of selector.
4793 * object.cc (make_elf_sized_object): Update caller.
4794 * parameters.cc (parameters_force_valid_target): Likewise.
4795 * incremental.cc (make_sized_incremental_binary): Likewise.
4796 * target-select.h: Update decl.
4797 (Target_selector::recognize): Take new Input_file* argument,
4798 pass it on to do_recognize.
4799 (Target_selector::do_recognize): Take new Input_file* argument.
4800 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4801 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4802 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4803 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4804
4805 * target.h (Target::Target_info): New members isolate_execinstr
4806 and rosegment_gap.
4807 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4808 * arm.cc (Target_arm::arm_info): Update initializer.
4809 * i386.cc (Target_i386::i386_info): Likewise.
4810 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4811 * sparc.cc (Target_sparc::sparc_info): Likewise.
4812 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4813 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4814 * layout.cc (Layout::attach_allocated_section_to_segment):
4815 Take new const Target* argument. If target->isolate_execinstr(), act
4816 like --rosegment.
4817 (Layout::find_first_load_seg): Take new const Target* argument;
4818 if target->isolate_execinstr(), reject PF_X segments.
4819 (Layout::relaxation_loop_body): Update caller.
4820 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4821 reset file offset to zero when we hit LOAD_SEG, and then do a second
4822 loop over the segments before LOAD_SEG to reassign offsets after
4823 addresses have been determined. Handle target->rosegment_gap().
4824 (Layout::attach_section_to_segment): Take new const Target* argument;
4825 pass it to attach_allocated_section_to_segment.
4826 (Layout::make_output_section): Update caller.
4827 (Layout::attach_sections_to_segments): Take new const Target* argument;
4828 pass it to attach_section_to_segment.
4829 * gold.cc (queue_middle_tasks): Update caller.
4830 * layout.h (Layout): Update method decls with new arguments.
4831
4832 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4833 Target_info pointer to use.
4834 (Target_arm::do_make_data_plt): New virtual method.
4835 (Target_arm::make_data_plt): New method that calls it.
4836 (Target_arm::make_plt_entry): Use it.
4837 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4838 for the section alignment.
4839 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4840 method.
4841 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4842 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4843 method.
4844 (Output_data_plt_arm::get_plt_entry_size): Call it.
4845 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4846 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4847 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4848 method.
4849 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4850 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4851 method instead of sizeof(plt_entry).
4852 (Output_data_plt_arm::add_entry): Likewise.
4853 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4854 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4855 than static method.
4856 (Target_arm::plt_entry_size): Likewise.
4857 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4858 Move to ...
4859 (Output_data_plt_arm_standard): ... here, new class.
4860 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4861 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4862 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4863
4864 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4865 Take additional argument for the PLT entry size.
4866 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4867 Use get_plt_entry_size method rather than plt_entry_size variable.
4868 (Output_data_plt_x86_64::reserve_slot): Likewise.
4869 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4870 (Output_data_plt_x86_64::add_entry): Likewise.
4871 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4872 (Output_data_plt_x86_64::address_for_global): Likewise.
4873 (Output_data_plt_x86_64::address_for_local): Likewise.
4874 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4875 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4876 Make method non-static.
4877 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4878 method.
4879 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4880 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4881 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4882 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4883 virtual method.
4884 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4885 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4886 virtual method.
4887 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4888 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4889 virtual method.
4890 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4891 (Output_data_plt_x86_64::plt_entry_size)
4892 (Output_data_plt_x86_64::first_plt_entry)
4893 (Output_data_plt_x86_64::plt_entry)
4894 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4895 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4896 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4897 (Output_data_plt_x86_64_standard): ... here, new class.
4898 (Target_x86_64::Target_x86_64): Take optional argument for the
4899 Target_info pointer to use.
4900 (Target_x86_64::do_make_data_plt): New virtual method.
4901 (Target_x86_64::make_data_plt): New method to call it.
4902 (Target_x86_64::init_got_plt_for_update): Use that.
4903 Call this->plt_->add_eh_frame method here.
4904 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4905 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4906 rather than static method.
4907 (Target_x86_64::plt_entry_size): Likewise.
4908 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4909 rather than plt_entry_size variable. Move guts of PLT filling to...
4910 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4911 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4912 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4913
4914 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4915 additional argument for the section alignment.
4916 Don't do add_eh_frame_for_plt here.
4917 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4918 non-static. Use get_plt_entry_size method rather than plt_entry_size
4919 variable.
4920 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4921 method.
4922 (Output_data_plt_i386::get_plt_entry_size): Call it.
4923 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4924 (Output_data_plt_i386::add_eh_frame): New method to call it.
4925 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4926 method.
4927 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4928 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4929 method.
4930 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4931 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4932 method instead of plt_entry_size.
4933 (Output_data_plt_i386::plt_entry_size)
4934 (Output_data_plt_i386::plt_eh_frame_fde_size)
4935 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4936 (Output_data_plt_i386_standard): ... here, new class.
4937 (Output_data_plt_i386_exec): New class.
4938 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4939 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4940 (Output_data_plt_i386::exec_plt_entry): Move to ...
4941 (Output_data_plt_i386_exec::plt_entry): ... here.
4942 (Output_data_plt_i386_dyn): New class.
4943 (Output_data_plt_i386::first_plt_entry): Move to ...
4944 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4945 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4946 (Output_data_plt_i386_dyn::plt_entry): ... here.
4947 (Target_i386::Target_i386): Take optional argument for the Target_info
4948 pointer to use.
4949 (Target_i386::do_make_data_plt): New virtual method.
4950 (Target_i386::make_data_plt): New method to call it.
4951 (Target_i386::make_plt_section): Use that.
4952 Call this->plt_->add_eh_frame method here.
4953 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4954 rather than plt_entry_size variable.
4955 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4956 (Output_data_plt_i386::address_for_local): Likewise.
4957 (Output_data_plt_i386::do_write): Likewise.
4958 Move guts of PLT filling to...
4959 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4960 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4961 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4962 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4963
4964 2012-05-01 Cary Coutant <ccoutant@google.com>
4965
4966 * dwarf_reader.cc (Dwarf_die::read_attributes)
4967 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4968 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4969 * reduced_debug_output.cc
4970 (Output_reduced_debug_info_section::get_die_end): Remove
4971 DW_FORM_GNU_ref_index. Add default case.
4972
4973 2012-04-26 Mark Wielaard <mjw@redhat.com>
4974
4975 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4976 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4977 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4978 DW_AT_high_pc as offset from DW_AT_low_pc.
4979
4980 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4981 * testsuite/Makefile.in: Regenerate.
4982 * testsuite/gdb_index_test_3.c: New test source file.
4983 * testsuite/gdb_index_test_3.sh: New test source file.
4984
4985 2012-04-25 Ian Lance Taylor <iant@google.com>
4986
4987 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4988 pointer.
4989 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4990 as a class, not a struct.
4991 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4992 (Target_arm::apply_cortex_a8_workaround): Likewise.
4993 * gc.h: Declare Reloc_types as a struct, not a class.
4994 * object.h: Declare Symbols_data as a struct.
4995 * reloc.h: Declare Read_relocs_data as a struct.
4996 * target.h: Declare Relocate_info as a struct.
4997
4998 2012-04-24 David S. Miller <davem@davemloft.net>
4999
5000 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5001 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5002 and R_SPARC_WPLT30.
5003
5004 2012-04-24 Cary Coutant <ccoutant@google.com>
5005
5006 * incremental-dump.cc (find_input_containing_global): Replace
5007 magic number with symbolic constant.
5008 (dump_incremental_inputs): Update version number.
5009 * incremental.cc (Output_section_incremental_inputs): Update version
5010 number; import symbolic constants from Incremental_inputs_reader.
5011 (Incremental_inputs::create_data_sections): Align relocations
5012 section correctly for 64-bit targets.
5013 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5014 constants; add padding.
5015 (Output_section_incremental_inputs::write_header): Add assert for
5016 header_size.
5017 (Output_section_incremental_inputs::write_input_files): Add assert
5018 for input_entry_size.
5019 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5020 add assert for object_info_size, input_section_entry_size,
5021 global_sym_entry_size.
5022 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5023 for data structure sizes; use them.
5024 (Incremental_input_entry_reader): Import symbolic constants from
5025 Incremental_inputs_reader; use them.
5026
5027 2012-04-23 David S. Miller <davem@davemloft.net>
5028
5029 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5030 and elf_flags_set_.
5031 (Target_sparc::Target_sparc): Initialize new fields.
5032 (Target_sparc::do_make_elf_object): New function.
5033 (Target_sparc::do_adjust_elf_header): New function.
5034
5035 2012-04-23 Cary Coutant <ccoutant@google.com>
5036
5037 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5038 CU range table of gdb index.
5039
5040 2012-04-20 David S. Miller <davem@davemloft.net>
5041
5042 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5043 instead of false.
5044
5045 2012-04-16 David S. Miller <davem@davemloft.net>
5046
5047 * sparc.cc (Target_sparc::got_address): New function.
5048 (Sparc_relocate_functions::gdop_hix22): New function.
5049 (Sparc_relocate_functions::gdop_lox10): New function.
5050 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5051 relocs.
5052 (Target_sparc::Scan::local): Likewise if the global symbol is not
5053 preemptible and is not IFUNC.
5054 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5055 transformations for local and non-preemptible non-IFUNC global
5056 symbols.
5057
5058 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5059 writing out 64-bit part of ranges.
5060
5061 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5062 -fpic and -fpie respectively.
5063 * Makefile.in: Regenerate.
5064
5065 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5066 (Target_sparc::Target_sparc): Initialize new field.
5067 (Target_sparc::do_plt_section_for_global): New function.
5068 (Target_sparc::do_plt_section_for_local): New function.
5069 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5070 (Target_sparc::make_plt_section): New function, broken out of
5071 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5072 (Target_sparc::make_plt_entry): Call make_plt_section.
5073 (Target_sparc::make_local_ifunc_plt_entry): New function.
5074 (Target_sparc::rela_ifunc_section): New function.
5075 (Target_sparc::plt_section): Remove const.
5076 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5077 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5078 and ifunc_count_ fields.
5079 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5080 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5081 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5082 (Output_data_plt_sparc::rela_ifunc): New function.
5083 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5084 (Output_data_plt_sparc::has_ifunc_section): New function.
5085 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5086 (Output_data_plt_sparc::address_for_global): New function.
5087 (Output_data_plt_sparc::address_for_local): New function.
5088 (Output_data_plt_sparc::plt_index_to_offset): New function.
5089 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5090 and entry_count.
5091 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5092 entry_count.
5093 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5094 R_SPARC_JMP_IREL to switch.
5095 (Target_sparc::Scan::check_non_pic): Likewise.
5096 (Target_sparc::Scan::local): Handle IFUNC symbols.
5097 (Target_sparc::Scan::local): Likewise.
5098 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5099 and plt_address_for_local.
5100 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5101 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5102
5103 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5104 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5105 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5106 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5107 global relocs too.
5108 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5109 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5110 calls.
5111 * sparc.cc (Target_sparc::Scan::global): Likewise.
5112 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5113
5114 2012-04-16 Cary Coutant <ccoutant@google.com>
5115
5116 * archive.cc (Library_base::should_include_member): Check for
5117 --export-dynamic-symbol.
5118 * options.h (class General_options): Add --export-dynamic-symbol.
5119 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5120 --export-dynamic-symbol.
5121 (Symbol_table::gc_mark_undef_symbols): Likewise.
5122 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5123
5124 2012-04-12 David S. Miller <davem@davemloft.net>
5125
5126 * sparc.cc (Reloc::wdisp10): New relocation method.
5127 (Reloc::h34): Likewise.
5128 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5129 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5130 R_SPARC_WDISP10.
5131 (Target_sparc::Scan::local): Likewise.
5132 (Target_sparc::Scan::global): Likewise.
5133 (Target_sparc::Relocate::relocate): Likewise.
5134
5135 2012-04-09 Cary Coutant <ccoutant@google.com>
5136
5137 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5138 low_pc == 0.
5139
5140 2012-04-06 Ian Lance Taylor <iant@google.com>
5141
5142 * timer.cc: #include <unistd.h>.
5143
5144 2012-04-06 Roland McGrath <mcgrathr@google.com>
5145
5146 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5147 * config.in: Regenerate.
5148 * configure: Regenerate.
5149
5150 2012-04-05 Nick Clifton <nickc@redhat.com>
5151
5152 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5153 (AM_LC_MESSAGES): Add.
5154 * aclocal.m4: Regenerate.
5155 * config.in: Regenerate.
5156 * configure: Regenerate.
5157
5158 2012-03-21 Cary Coutant <ccoutant@google.com>
5159
5160 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5161 * Makefile.in: Regenerate.
5162 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5163 (Sized_elf_reloc_mapper::symbol_section): New function.
5164 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5165 (make_elf_reloc_mapper): New function.
5166 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5167 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5168 (Dwarf_abbrev_table::do_get_abbrev): New function.
5169 (Dwarf_ranges_table::read_ranges_table): New function.
5170 (Dwarf_ranges_table::read_range_list): New function.
5171 (Dwarf_pubnames_table::read_section): New function.
5172 (Dwarf_pubnames_table::read_header): New function.
5173 (Dwarf_pubnames_table::next_name): New function.
5174 (Dwarf_die::Dwarf_die): New function.
5175 (Dwarf_die::read_attributes): New function.
5176 (Dwarf_die::skip_attributes): New function.
5177 (Dwarf_die::set_name): New function.
5178 (Dwarf_die::set_linkage_name): New function.
5179 (Dwarf_die::attribute): New function.
5180 (Dwarf_die::string_attribute): New function.
5181 (Dwarf_die::int_attribute): New function.
5182 (Dwarf_die::uint_attribute): New function.
5183 (Dwarf_die::ref_attribute): New function.
5184 (Dwarf_die::child_offset): New function.
5185 (Dwarf_die::sibling_offset): New function.
5186 (Dwarf_info_reader::check_buffer): New function.
5187 (Dwarf_info_reader::parse): New function.
5188 (Dwarf_info_reader::do_parse): New function.
5189 (Dwarf_info_reader::do_read_string_table): New function.
5190 (Dwarf_info_reader::lookup_reloc): New function.
5191 (Dwarf_info_reader::get_string): New function.
5192 (Dwarf_info_reader::visit_compilation_unit): New function.
5193 (Dwarf_info_reader::visit_type_unit): New function.
5194 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5195 Sized_elf_reloc_mapper.
5196 (Sized_dwarf_line_info::symbol_section): Remove function.
5197 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5198 (Sized_dwarf_line_info::read_line_mappings): Remove object
5199 parameter, adjust callers.
5200 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5201 * dwarf_reader.h: Include <sys/types.h>.
5202 (class Track_relocs): Remove forward declaration.
5203 (class Elf_reloc_mapper): New class.
5204 (class Sized_elf_reloc_mapper): New class.
5205 (class Dwarf_abbrev_table): New class.
5206 (class Dwarf_range_list): New class.
5207 (class Dwarf_ranges_table): New class.
5208 (class Dwarf_pubnames_table): New class.
5209 (class Dwarf_die): New class.
5210 (class Dwarf_info_reader): New class.
5211 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5212 (Sized_dwarf_line_info::symbol_section): Remove member function.
5213 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5214 base class.
5215 * gdb-index.cc: New source file.
5216 * gdb-index.h: New source file.
5217 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5218 and .debug_types sections, call Layout::add_to_gdb_index.
5219 (Sized_relobj_incr::do_section_name): Implement.
5220 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5221 return type; Implement.
5222 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5223 return type.
5224 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5225 parameter list and return type.
5226 (Sized_incr_dynobj::do_section_contents): Likewise.
5227 * layout.cc: Include gdb-index.h.
5228 (Layout::Layout): Initialize gdb_index_data_.
5229 (Layout::init_fixed_output_section): Check for .gdb_index section.
5230 (Layout::add_to_gdb_index): New function. Instantiate.
5231 * layout.h: Add forward declaration for class Gdb_index.
5232 (Layout::add_to_gdb_index): New member function.
5233 (Layout::gdb_index_data_): New data member.
5234 * main.cc: Include gdb-index.h.
5235 (main): Print statistics for gdb index.
5236 * object.cc (Object::section_contents): Move code into
5237 do_section_contents.
5238 (need_decompressed_section): Check for sections needed when building
5239 gdb index.
5240 (build_compressed_section_map): Likewise.
5241 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5242 gdb index.
5243 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5244 sections; call Layout::add_to_gdb_index.
5245 (Sized_relobj_file::do_decompressed_section_contents): Call
5246 do_section_contents directly.
5247 * object.h (Object::do_section_contents): Adjust parameter list and
5248 return type.
5249 (Object::do_decompressed_section_contents): Call do_section_contents
5250 directly.
5251 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5252 return type.
5253 * options.h (class General_options): Add --gdb-index option.
5254 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5255 list and return type.
5256 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5257 * reloc.h (Track_relocs::checkpoint): New function.
5258 (Track_relocs::reset): New function.
5259
5260 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5261 New test cases.
5262 * testsuite/Makefile.in: Regenerate.
5263 * testsuite/gdb_index_test.cc: New test source file.
5264 * testsuite/gdb_index_test_1.sh: New test source file.
5265 * testsuite/gdb_index_test_2.sh: New test source file.
5266
5267 2012-03-19 Doug Kwan <dougkwan@google.com>
5268
5269 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5270 (Target_arm::do_finalize_sections): Remove code which defines
5271 __exidx_start and __exidx_end. Make symbol table parameter
5272 anonymous as it is not used.
5273 * gold.cc (queue_middle_tasks): Call target hook to define any
5274 target-specific symbols.
5275 * target.h (Target::define_standard_symbols): New method.
5276 (Target::do_define_standard_symbols): Same.
5277 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5278 * testsuite/Makefile.in: Regenerate.
5279 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5280 and __exidx_end.
5281 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5282 relocations are generated for __exidx_start and __exidx_end.
5283
5284 2012-03-16 Doug Kwan <dougkwan@google.com>
5285
5286 * testsuite/Makefile.am: Disable test initpri3b.
5287 * testsuite/Makefile.in: Regenerate.
5288
5289 2012-03-15 Doug Kwan <dougkwan@google.com>
5290
5291 * arm.cc (Target_arm::got_section): Make .got section read-only
5292 if -z now is given.
5293
5294 2012-03-15 Ian Lance Taylor <iant@google.com>
5295
5296 PR gold/13850
5297 * layout.cc (Layout::make_output_section): Correctly mark
5298 SHT_INIT_ARRAY, et. al., as relro.
5299
5300 2012-03-14 Doug Kwan <dougkwan@google.com>
5301
5302 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5303 dynamic relocations for protected symbols in shared objects.
5304
5305 2012-03-13 Ian Lance Taylor <iant@google.com>
5306
5307 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5308 keep the larger alignment.
5309
5310 2012-03-12 Cary Coutant <ccoutant@google.com>
5311
5312 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5313 handling of DW_LNE_define_file.
5314
5315 2012-03-12 Cary Coutant <ccoutant@google.com>
5316
5317 * reduced_debug_output.cc
5318 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5319 codes to switch.
5320
5321 2012-02-29 Cary Coutant <ccoutant@google.com>
5322
5323 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5324
5325 2012-02-29 Cary Coutant <ccoutant@google.com>
5326
5327 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5328 Call Object::decompressed_section_contents.
5329 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5330 New dtor.
5331 (Sized_dwarf_line_info::buffer_start_): New data member.
5332 * merge.cc (Output_merge_data::do_add_input_section): Call
5333 Object::decompressed_section_contents.
5334 (Output_merge_string::do_add_input_section): Likewise.
5335 * object.cc (need_decompressed_section): New function.
5336 (build_compressed_section_map): Decompress sections needed later.
5337 (Sized_relobj_file::do_decompressed_section_contents): New function.
5338 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5339 * object.h (Object::decompressed_section_contents): New function.
5340 (Object::discard_decompressed_sections): New function.
5341 (Object::do_decompressed_section_contents): New function.
5342 (Object::do_discard_decompressed_sections): New function.
5343 (Compressed_section_info): New type.
5344 (Compressed_section_map): Include decompressed section contents.
5345 (Sized_relobj_file::do_decompressed_section_contents): New function.
5346 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5347
5348 2012-02-16 Cary Coutant <ccoutant@google.com>
5349
5350 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5351 * testsuite/Makefile.in: Regenerate.
5352
5353 2012-02-14 Cary Coutant <ccoutant@google.com>
5354
5355 * options.cc (General_options::finalize): Disallow -pie and -static.
5356
5357 2012-02-03 Doug Kwan <dougkwan@google.com>
5358
5359 * arm.cc (Arm_relocate_functions::abs8,
5360 Arm_relocate_functions::abs16): Use
5361 Bits::has_signed_unsigned_overflow32.
5362 (Arm_relocate_functions::thm_abs8): Correct range of
5363 overflow check.
5364 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5365 in assertions.
5366
5367 2012-02-02 Doug Kwan <dougkwan@google.com>
5368
5369 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5370 position independent outputs, not just shared objects.
5371
5372 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5373
5374 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5375 * configure: Regenerated.
5376
5377 2012-01-27 Ian Lance Taylor <iant@google.com>
5378
5379 * reloc.h (Bits): New class with static functions, copied from
5380 namespace utils in arm.cc.
5381 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5382 instead.
5383
5384 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5385
5386 * incremental.cc (write_info_blocks): Correct relocation offset.
5387
5388 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5389
5390 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5391 (Relocate::tls_gd_to_le): Likewise.
5392
5393 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5394
5395 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5396
5397 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5398
5399 * configure.ac: Check if -mcmodel=medium works.
5400 * configure: Regenerated.
5401
5402 2012-01-24 Cary Coutant <ccoutant@google.com>
5403
5404 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5405 definition and ...
5406 (read_unsigned_LEB_128_x): ... this new function.
5407 (read_signed_LEB_128): Replaced with inline definition and ...
5408 (read_signed_LEB_128_x): ... this new function.
5409 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5410 (read_unsigned_LEB_128): Add inline definition.
5411 (read_signed_LEB_128_x): New function.
5412 (read_signed_LEB_128): Add inline definition.
5413 * testsuite/Makefile.am (leb128_unittest): New unit test.
5414 * testsuite/Makefile.in: Regenerate.
5415 * testsuite/leb128_unittest.cc: New unit test.
5416
5417 2012-01-23 Ian Lance Taylor <iant@google.com>
5418
5419 PR gold/13617
5420 * i386.cc (Target_i386::do_code_fill): When using a jmp
5421 instruction, pad with nop instructions.
5422 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5423
5424 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5425
5426 * x86_64.cc (gc_process_relocs): Add typename on types used in
5427 template.
5428 (scan_relocs): Likewise.
5429 (relocate_section): Likewise.
5430 (apply_relocation): Likewise.
5431
5432 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5433
5434 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5435 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5436 under x32.
5437
5438 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5439
5440 * x86_64.cc: Initial support for x32.
5441
5442 2012-01-03 Cary Coutant <ccoutant@google.com>
5443
5444 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5445 Use abstract base class for GOT.
5446 * gold/output.h (class Output_data_got_base): New abstract base class.
5447 (class Output_data_got): Derive from new base class, adjust ctors.
5448 (Output_data_got::reserve_slot): Make virtual; rename to
5449 do_reserve_slot; Adjust callers.
5450 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5451 pointer to abstract base class.
5452 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5453
5454 2011-12-18 Ian Lance Taylor <iant@google.com>
5455
5456 * object.h (Relobj::local_symbol_value): New function.
5457 (Relobj::local_plt_offset): New function.
5458 (Relobj::local_has_got_offset): New function.
5459 (Relobj::local_got_offset): New function.
5460 (Relobj::set_local_got_offset): New function.
5461 (Relobj::do_local_symbol_value): New pure virtual function.
5462 (Relobj::do_local_plt_offset): Likewise.
5463 (Relobj::do_local_has_got_offset): Likewise.
5464 (Relobj::do_local_got_offset): Likewise.
5465 (Relobj::do_set_local_got_offset): Likewise.
5466 (Sized_relobj::do_local_has_got_offset): Rename from
5467 local_has_got_offset.
5468 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5469 (Sized_relobj::do_set_local_got_offset): Rename from
5470 set_local_got_offset.
5471 (Sized_relobj_file::do_local_plt_offset): Rename from
5472 local_plt_offset.
5473 (Sized_relobj_file::do_local_symbol_value): New function.
5474 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5475 local_plt_offset.
5476 * output.cc (Output_data_got::Got_entry::write): Change object to
5477 Relobj. Use local_symbol_value.
5478 (Output_data_got::add_global_with_rel): Change rel_dyn to
5479 Output_data_reloc_generic*. Use add_global_generic.
5480 (Output_data_got::add_global_with_rela): Remove. Change all
5481 callers to use add_global_with_rel.
5482 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5483 Output_data_reloc_generic*. Use add_global_generic.
5484 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5485 callers to use add_global_pair_with_rel.
5486 (Output_data_got::add_local): Change object to Relobj*.
5487 (Output_data_got::add_local_plt): Likewise.
5488 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5489 change rel_dyn to Output_data_reloc_generic*. Use
5490 add_local_generic.
5491 (Output_data_got::add_local_with_rela): Remove. Change all
5492 callers to use all_local_with_rel.
5493 (Output_data_got::add_local_pair_with_rel): Change object to
5494 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5495 add_output_section_generic.
5496 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5497 callers to use add_local_pair_with_rel.
5498 (Output_data_got::reserve_local): Change object to Relobj*.
5499 * output.h: (class Output_data_reloc_generic): Add pure virtual
5500 declarations for add_global_generic, add_local_generic,
5501 add_output_section_generic.
5502 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5503 functions for Output_data_reloc_generic. Update declarations for
5504 changes listed in output.cc.
5505 (class Output_data_got): Change template parameter to got_size.
5506 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5507 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5508 function.
5509 (Sized_relobj_incr::do_local_plt_offset): New function.
5510 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5511 add_global_generic.
5512
5513 2011-12-17 Cary Coutant <ccoutant@google.com>
5514
5515 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5516 * resolve.cc (Symbol_table::resolve): Likewise.
5517 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5518 arrays.
5519 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5520
5521 2011-12-16 Ian Lance Taylor <iant@google.com>
5522
5523 * output.h (Output_data_reloc_generic::add): Only call
5524 add_dynamic_reloc if this is a dynamic reloc section.
5525
5526 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5527
5528 PR gold/13505
5529 * target-reloc.h (apply_relocation): Replace <64, false> with
5530 <size, big_endian>.
5531
5532 2011-11-25 Nick Clifton <nickc@redhat.com>
5533
5534 * po/it.po: New Italian translation.
5535
5536 2011-11-17 Sterling Augustine <saugustine@google.com>
5537
5538 * script.cc (script_include_directive): Implement.
5539 (read_script_file): New local variables name and search_path. Update
5540 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5541 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5542 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5543
5544 2011-11-11 Sterling Augustine <saugustine@google.com>
5545
5546 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5547 (file_or_sections_cmd): Likewise.
5548
5549 2011-11-11 Doug Kwan <dougkwan@google.com>
5550
5551 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5552 if --just-symbols is given.
5553
5554 2011-11-10 Doug Kwan <dougkwan@google.com>
5555
5556 PR gold/13362
5557 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5558 when processing data relocs.
5559 * reloc.h (Relocate_functions::rel_unaligned): New method.
5560 (Relocate_functions::pcrel_unaligned): Ditto.
5561 (Relocate_functions::rel32_unaligned): Ditto.
5562 (Relocate_functions::pcrel32_unaligned): Ditto.
5563
5564 2011-11-09 Doug Kwan <dougkwan@google.com>
5565
5566 PR gold/13362
5567 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5568 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5569 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5570 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5571 (Relocate_functions::rel_unaligned): New.
5572 (Relocate_functions::rel32_unaligned): New.
5573 * target-reloc.h (relocate_for_relocatable): Add code to handle
5574 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5575 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5576 arm_unaligned_reloc_r): New targets.
5577 * testsuite/Makefile.in: Regenerate.
5578 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5579 linking.
5580
5581 2011-11-02 Ian Lance Taylor <iant@google.com>
5582
5583 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5584 NATIVE_LINKER.
5585 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5586 * options.cc (General_options::finalize): Use library search path
5587 from configure script if specified. If not native and no sysroot,
5588 only search TOOLLIBDIR.
5589 * options.h (Search_directory::Search_directory): Change name to
5590 const std::string&.
5591 (General_options::add_to_library_path_with_sysroot): Change arg to
5592 const std::string&.
5593 * configure, Makefile.in, config.in: Rebuild.
5594
5595 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5596
5597 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5598 we are working around the ARM1176 Erratum.
5599 * options.h (General_options::fix_arm1176): Add option.
5600 * testsuite/Makefile.am: Add testcases, and keep current ones
5601 working.
5602 * testsuite/Makefile.in: Regenerate.
5603 * testsuite/arm_fix_1176.s: New file.
5604 * testsuite/arm_fix_1176.sh: Likewise.
5605
5606 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5607
5608 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5609 may_use_blx_.
5610 (Target_arm::may_use_blx): Remove method.
5611 (Target_arm::set_may_use_blx): Likewise.
5612 (Target_arm::may_use_v4t_interworking): New method.
5613 (Target_arm::may_use_v5t_interworking): Likewise.
5614 (Target_arm::may_use_blx_): Remove member variable.
5615 (Arm_relocate_functions::arm_branch_common): Check for v5T
5616 interworking.
5617 (Arm_relocate_functions::thumb_branch_common): Likewise.
5618 (Reloc_stub::stub_type_for_reloc): Likewise.
5619 (Target_arm::do_finalize_sections): Correct interworking checks.
5620 * testsuite/Makefile.am: Add new tests.
5621 * testsuite/Makefile.in: Regenerate.
5622 * testsuite/arm_farcall_arm_arm.s: New test.
5623 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5624 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5625 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5626 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5627 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5628 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5629 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5630
5631 2011-10-31 Cary Coutant <ccoutant@google.com>
5632
5633 PR gold/13023
5634 * expression.cc (Expression::eval_with_dot): Add
5635 is_section_dot_assignment parameter.
5636 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5637 absolute and assigning to dot within a section.
5638 * script-sections.cc
5639 (Output_section_element_assignment::set_section_addresses): Pass
5640 dot_section to set_if_absolute.
5641 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5642 as is_section_dot_assignment flag to eval_with_dot.
5643 (Output_section_element_dot_assignment::set_section_addresses):
5644 Likewise.
5645 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5646 parameter. Also set value if relative to dot_section; set the
5647 symbol's output_section.
5648 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5649 parameter. Adjust all callers.
5650 (Expression::eval_maybe_dot): Likewise.
5651 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5652 Adjust all callers.
5653 * testsuite/script_test_2.t: Test assignment of an absolute value
5654 to dot within an output section element.
5655
5656 2011-10-31 Cary Coutant <ccoutant@google.com>
5657
5658 * options.h (class General_options): Add --[no-]gnu-unique options.
5659 * symtab.cc (Symbol_table::sized_write_globals): Convert
5660 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5661
5662 2011-10-31 Cary Coutant <ccoutant@google.com>
5663
5664 PR gold/13359
5665 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5666 unnecessary assertion.
5667 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5668
5669 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5670
5671 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5672 gc_mark_symbol.
5673 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5674 gc_mark_symbol.
5675 Change to just keep the section associated with symbol.
5676 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5677 they are externally visible and --export-dynamic is turned on.
5678 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5679
5680 2011-10-19 Ian Lance Taylor <iant@google.com>
5681
5682 PR gold/13163
5683 * script-sections.cc
5684 (Output_section_element_dot_assignment::needs_output_section): New
5685 function.
5686
5687 2011-10-19 Ian Lance Taylor <iant@google.com>
5688
5689 PR gold/13204
5690 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5691 --section-start option was seen.
5692 * options.h (General_options::any_section_start): New function.
5693
5694 2011-10-18 David S. Miller <davem@davemloft.net>
5695
5696 PR binutils/13301
5697 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5698 member to track relocation locations that have moved during TLS
5699 reloc optimizations.
5700 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5701 (Target_sparc::Relocate::relocate): Adjust view down by 4
5702 bytes if it matches reloc_adjust_addr_.
5703 (Target_sparc::Relocate::relocate_tls): Always move the
5704 __tls_get_addr call delay slot instruction forward 4 bytes when
5705 performing relaxation.
5706
5707 2011-10-18 Cary Coutant <ccoutant@google.com>
5708
5709 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5710 (Output_file::map_no_anonymous): Check for non-zero
5711 return code from posix_fallocate.
5712
5713 2011-10-17 Cary Coutant <ccoutant@google.com>
5714
5715 PR gold/13245
5716 * plugin.cc (is_visible_from_outside): Check for symbols
5717 referenced from dynamic objects.
5718 * resolve.cc (Symbol_table::resolve): Don't count references
5719 from dynamic objects as references from real ELF files.
5720 * testsuite/plugin_test_2.sh: Adjust expected result.
5721
5722 2011-10-17 Cary Coutant <ccoutant@google.com>
5723
5724 * gold.cc: Include timer.h.
5725 (queue_middle_tasks): Stamp time.
5726 (queue_final_tasks): Likewise.
5727 * main.cc (main): Store timer in parameters. Print timers
5728 for each pass.
5729 * parameters.cc (Parameters::Parameters): Initialize timer_.
5730 (Parameters::set_timer): New function.
5731 (set_parameters_timer): New function.
5732 * parameters.h (Parameters::set_timer): New function.
5733 (Parameters::timer): New function.
5734 (Parameters::timer_): New data member.
5735 (set_parameters_timer): New function.
5736 * timer.cc (Timer::stamp): New function.
5737 (Timer::get_pass_time): New function.
5738 * timer.h (Timer::stamp): New function.
5739 (Timer::get_pass_time): New function.
5740 (Timer::pass_times_): New data member.
5741
5742 2011-10-17 Cary Coutant <ccoutant@google.com>
5743
5744 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5745 task for members of lib groups.
5746
5747 2011-10-17 Cary Coutant <ccoutant@google.com>
5748
5749 PR gold/13288
5750 * fileread.cc (File_read::find_view): Add assert.
5751 (File_read::make_view): Move bounds check (replace with assert)...
5752 (File_read::find_or_make_view): ... to here.
5753
5754 2011-10-12 Cary Coutant <ccoutant@google.com>
5755
5756 * output.cc (Output_file::open_base_file): Handle case where
5757 ::read returns less than requested size.
5758
5759 2011-10-10 Cary Coutant <ccoutant@google.com>
5760
5761 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5762 Initialize defined_count_.
5763 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5764 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5765 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5766 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5767 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5768 * incremental.h (Sized_relobj_incr::defined_count_): New data
5769 member.
5770 (Sized_incr_dynobj::defined_count_): New data member.
5771 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5772 Return zeroes instead of internal error.
5773
5774 2011-10-10 Cary Coutant <ccoutant@google.com>
5775
5776 PR gold/13249
5777 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5778 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5779 * output.h (class Output_reloc): Add use_plt_offset flag.
5780 (Output_reloc::type_): Adjust size of bit field.
5781 (Output_reloc::use_plt_offset_): New bit field.
5782 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5783 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5784 flag. Adjust all callers.
5785 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5786 creating RELATIVE relocations.
5787
5788 2011-10-10 Nick Clifton <nickc@redhat.com>
5789
5790 * po/es.po: Updated Spanish translation.
5791 * po/fi.po: Updated Finnish translation.
5792
5793 2011-10-03 Diego Novillo <dnovillo@google.com>
5794
5795 * options.cc (parse_uint): Fix dereference of RETVAL.
5796
5797 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5798
5799 * layout.h (section_order_map_): New member.
5800 (get_section_order_map): New member function.
5801 * output.cc (Output_section::add_input_section): Check for patterns
5802 only when --section-ordering-file is specified.
5803 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5804 output_sections have been formed.
5805 * layout.cc (Layout_Layout): Initialize section_order_map_.
5806 * plugin.cc (update_section_order): Store order in order_map. Do not
5807 update the order.
5808 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5809 * testsuite/Makefile.in: Regenerate.
5810 * testsuite/plugin_section_order.c: New file.
5811 * testsuite/plugin_final_layout.cc: New file.
5812 * testsuite/plugin_final_layout.sh: New file.
5813
5814 2011-09-29 Cary Coutant <ccoutant@google.com>
5815
5816 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5817 Check for NULL.
5818 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5819 symbols during incremental update.
5820 (Symbol_table::add_from_dynobj): Likewise.
5821
5822 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5823 Ian Lance Taylor <iant@google.com>
5824
5825 * symtab.cc (Symbol_table::define_special_symbol): Always
5826 canonicalize version string.
5827
5828 2011-09-26 Cary Coutant <ccoutant@google.com>
5829
5830 * gold.cc (queue_initial_tasks): Move option checks ...
5831 * options.cc (General_options::finalize): ... to here. Disable
5832 some options; make others fatal.
5833
5834 2011-09-26 Cary Coutant <ccoutant@google.com>
5835
5836 gcc PR lto/47247
5837 * plugin.cc (get_symbols_v2): New function.
5838 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5839 (is_referenced_from_outside): New function.
5840 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5841 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5842 (get_symbols): Pass version parameter.
5843 (get_symbols_v2): New function.
5844 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5845 parameter.
5846 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5847 (onload): Add LDPT_GET_SYMBOLS_V2.
5848 (all_symbols_read_hook): Use get_symbols_v2; check for
5849 LDPR_PREVAILING_DEF_IRONLY_EXP.
5850 * testsuite/plugin_test_3.sh: Update expected results.
5851
5852 2011-09-23 Simon Baldwin <simonb@google.com>
5853
5854 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5855 configuration options.
5856 * configure: Regenerate.
5857 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5858 * Makefile.in: Regenerate.
5859 * testsuite/Makefile.in: Regenerate.
5860
5861 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5862
5863 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5864
5865 2011-09-19 Cary Coutant <ccoutant@google.com>
5866
5867 * incremental.cc (can_incremental_update): Fix typo in comment.
5868 * incremental.h (can_incremental_update): Likewise.
5869
5870 2011-09-18 Cary Coutant <ccoutant@google.com>
5871
5872 * incremental.cc (can_incremental_update): New function.
5873 * incremental.h (can_incremental_update): New function.
5874 * layout.cc (Layout::init_fixed_output_section): Call it.
5875 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5876 * object.cc (Sized_relobj_file::do_layout): Call
5877 can_incremental_update.
5878
5879 2011-09-13 Cary Coutant <ccoutant@google.com>
5880
5881 * configure.ac: Check for glibc support for gnu_indirect_function
5882 support with static linking, setting automake conditional
5883 IFUNC_STATIC.
5884 * Makefile.in: Regenerate.
5885 * configure: Regenerate.
5886
5887 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5888 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5889 for IFUNC_STATIC.
5890 * testsuite/Makefile.in: Regenerate.
5891
5892 2011-09-13 Cary Coutant <ccoutant@google.com>
5893
5894 * incremental.cc (Sized_relobj_incr::do_layout): Call
5895 report_comdat_group for kept comdat sections.
5896 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5897 * testsuite/Makefile.in: Regenerate.
5898 * testsuite/incr_comdat_test_1.cc: New source file.
5899 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5900 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5901 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5902
5903 2011-09-13 Ian Lance Taylor <iant@google.com>
5904
5905 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5906 variable external_symbols_offset.
5907
5908 2011-09-12 Ian Lance Taylor <iant@google.com>
5909
5910 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5911 triggered if object has no symbols.
5912
5913 2011-09-09 David S. Miller <davem@davemloft.net>
5914
5915 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5916 (Output_fill_debug_line::do_write): Likewise.
5917
5918 2011-08-29 Cary Coutant <ccoutant@google.com>
5919
5920 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5921 casts to match formatting specs.
5922 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5923
5924 2011-08-26 Cary Coutant <ccoutant@google.com>
5925
5926 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5927 remaining hole size when allocating.
5928 (Layout::make_output_section): Set fill methods for debug sections.
5929 * layout.h (Free_list::Free_list_node): Move from private to
5930 public.
5931 (Free_list::set_min_hole_size): New function.
5932 (Free_list::begin, Free_list::end): New functions.
5933 (Free_list::min_hole_): New data member.
5934 * output.cc: Include dwarf.h.
5935 (Output_fill_debug_info::do_minimum_hole_size): New function.
5936 (Output_fill_debug_info::do_write): New function.
5937 (Output_fill_debug_line::do_minimum_hole_size): New function.
5938 (Output_fill_debug_line::do_write): New function.
5939 (Output_section::Output_section): Initialize new data member.
5940 (Output_section::set_final_data_size): Ensure patch space is larger
5941 than minimum hole size.
5942 (Output_section::do_write): Fill holes in debug sections.
5943 * output.h (Output_fill): New class.
5944 (Output_fill_debug_info): New class.
5945 (Output_fill_debug_line): New class.
5946 (Output_section::set_free_space_fill): New function.
5947 (Output_section::free_space_fill_): New data member.
5948 * testsuite/Makefile.am (incremental_test_3): Add
5949 --incremental-patch option.
5950 (incremental_test_4): Likewise.
5951 (incremental_test_5): Likewise.
5952 (incremental_test_6): Likewise.
5953 (incremental_copy_test): Likewise.
5954 (incremental_common_test_1): Likewise.
5955 * testsuite/Makefile.in: Regenerate.
5956
5957 2011-08-26 Nick Clifton <nickc@redhat.com>
5958
5959 * po/es.po: Updated Spanish translation.
5960
5961 2011-08-01 Cary Coutant <ccoutant@google.com>
5962
5963 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5964 * gold/testsuite/Makefile.in: Regenerate.
5965 * gold/testsuite/justsyms_exec.c: New source file.
5966 * gold/testsuite/justsyms_lib.c: New source file.
5967
5968 2011-08-01 Cary Coutant <ccoutant@google.com>
5969
5970 * layout.cc (Layout::set_segment_offsets): Don't realign text
5971 segment if -Ttext was specified.
5972 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5973 file type.
5974 * object.h (Sized_relobj_file::e_type): New function.
5975 (Sized_relobj_file::e_type_): New data member.
5976 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5977 base address for ET_EXEC files.
5978 * target.cc (Target::do_make_elf_object_implementation): Allow
5979 ET_EXEC files with --just-symbols option.
5980
5981 2011-07-28 Cary Coutant <ccoutant@google.com>
5982
5983 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5984 Add thread_number parameter.
5985 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5986 * workqueue-threads.cc
5987 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5988 current thread if its thread number is greater than desired thread
5989 count.
5990 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5991 Add thread_number parameter.
5992 (Workqueue::should_cancel_thread): Likewise.
5993 (Workqueue::find_runnable_or_wait): Pass thread_number to
5994 should_cancel_thread.
5995 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5996 parameter.
5997
5998 2011-07-22 Sriraman Tallam <tmsriram@google.com>
5999
6000 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6001 only after checking if it cannot be forced local.
6002 * symtab.h (is_externally_visible): Check if the symbol is not forced
6003 local.
6004
6005 2011-07-15 Ian Lance Taylor <iant@google.com>
6006
6007 * options.h (class General_options): Add --print-output-format.
6008 Move -EL next to -EB, for better --help output.
6009 * target-select.cc: Include <cstdio>, "options.h", and
6010 "parameters.h".
6011 (Target_selector::do_target_bfd_name): New function.
6012 (print_output_format): New function.
6013 * target-select.h (class Target_selector): Update declarations.
6014 (Target_selector::target_bfd_name): New function.
6015 (print_output_format): Declare.
6016 * main.cc: Include "target-select.h".
6017 (main): Handle --print-output-format.
6018 * gold.cc: Include "target-select.h".
6019 (queue_initial_tasks): Handle --print-output-format when there are
6020 no input files.
6021 * parameters.cc (parameters_force_valid_target): Give a better
6022 error message if -EB/-EL does not match target.
6023 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6024 function.
6025
6026 2011-07-15 Ian Lance Taylor <iant@google.com>
6027
6028 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6029 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6030 (Output_data_plt_i386::do_write): Write address of .dynamic
6031 section to first entry in .got.plt section.
6032 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6033 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6034 Initialize layout_.
6035 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6036 section to first entry in .got.plt section.
6037 * layout.h (Layout::dynamic_section): New function.
6038
6039 2011-07-13 Sriraman Tallam <tmsriram@google.com>
6040
6041 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6042 to claim_file call.
6043 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6044 input_section_position_, and input_section_glob_.
6045 (read_layout_from_file): Call function section_ordering_specified.
6046 * layout.h (is_section_ordering_specified): New function.
6047 (section_ordering_specified): New function.
6048 (section_ordering_specified_): New boolean member.
6049 * main.cc(main): Call load_plugins after layout object is defined.
6050 * output.cc (Output_section::add_input_section): Use
6051 function section_ordering_specified to check if section ordering is
6052 needed.
6053 * output.cc (Output_section::add_relaxed_input_section): Use
6054 function section_ordering_specified to check if section ordering is
6055 needed.
6056 (Output_section::update_section_layout): New function.
6057 (Output_section::sort_attached_input_sections): Check if input section
6058 must be reordered.
6059 * output.h (Output_section::update_section_layout): New function.
6060 * plugin.cc (get_section_count): New function.
6061 (get_section_type): New function.
6062 (get_section_name): New function.
6063 (get_section_contents): New function.
6064 (update_section_order): New function.
6065 (allow_section_ordering): New function.
6066 (Plugin::load): Add the new interfaces to the transfer vector.
6067 (Plugin_manager::load_plugins): New parameter.
6068 (Plugin_manager::all_symbols_read): New parameter.
6069 (Plugin_manager::claim_file): New parameter. Save the elf object for
6070 unclaimed objects.
6071 (Plugin_manager::get_elf_object): New function.
6072 (Plugin_manager::get_view): Change to directly use the bool to check
6073 if get_view is called from claim_file_hook.
6074 * plugin.h (input_objects): New function
6075 (Plugin__manager::load_plugins): New parameter.
6076 (Plugin_manager::claim_file): New parameter.
6077 (Plugin_manager::get_elf_object): New function.
6078 (Plugin_manager::in_claim_file_handler): New function.
6079 (Plugin_manager::in_claim_file_handler_): New member.
6080 (layout): New function.
6081 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6082 handler with an extra parameter. Make the elf object before calling
6083 claim_file handler.
6084 * testsuite/plugin_test.c (get_section_count): New function pointer.
6085 (get_section_type): New function pointer.
6086 (get_section_name): New function pointer.
6087 (get_section_contents): New function pointer.
6088 (update_section_order): New function pointer.
6089 (allow_section_ordering): New function pointer.
6090 (onload): Check if the new interfaces exist.
6091
6092 2011-07-13 Ian Lance Taylor <iant@google.com>
6093
6094 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6095 relro section.
6096 * x86_64.cc (Target_x86_64::got_section): Likewise.
6097 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6098 (relro_now_test_SOURCES): New variable.
6099 (relro_now_test_DEPENDENCIES): New variable.
6100 (relro_now_test_LDFLAGS): New variable.
6101 (relro_now_test_LDADD): New variable.
6102 (relro_now_test.so): New target.
6103 * testsuite/Makefile.in: Rebuild.
6104
6105 2011-07-12 Ian Lance Taylor <iant@google.com>
6106
6107 PR gold/12980
6108 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6109 GLOB_DAT relocation rather than a RELATIVE relocation for a
6110 protected symbol when creating a shared library.
6111 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6112 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6113 * testsuite/protected_main_1.cc (main): Test that protected
6114 function has same address.
6115
6116 2011-07-11 Ian Lance Taylor <iant@google.com>
6117
6118 PR gold/12979
6119 * options.h (class General_options): Add -Bgroup.
6120 * options.cc (General_options::finalize): If -Bgroup is set,
6121 default to --unresolved-symbols=report-all.
6122 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6123 * target-reloc.h (issue_undefined_symbol_error): Handle
6124 --unresolved-symbols=report-all.
6125
6126 2011-07-08 Ian Lance Taylor <iant@google.com>
6127
6128 PR gold/11985
6129 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6130 if linker script discards key sections.
6131 (Layout::create_dynamic_symtab): Likewise.
6132 (Layout::assign_local_dynsym_offsets): Likewise.
6133 (Layout::sized_create_version_sections): Likewise.
6134 (Layout::create_interp): Likewise.
6135 (Layout::finish_dynamic_section): Likewise.
6136 (Layout::set_dynamic_symbol_size): Likewise.
6137
6138 2011-07-08 Ian Lance Taylor <iant@google.com>
6139
6140 PR gold/12386
6141 * options.h (class General_options): Add --unresolved-symbols.
6142 * target-reloc.h (issue_undefined_symbol_error): Check
6143 --unresolved-symbols. Add comments.
6144
6145 2011-07-08 Ian Lance Taylor <iant@google.com>
6146
6147 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6148 expression more complex.
6149
6150 2011-07-08 Ian Lance Taylor <iant@google.com>
6151
6152 PR gold/11317
6153 * target-reloc.h (issue_undefined_symbol_error): New inline
6154 function, broken out of relocate_section.
6155 (relocate_section): Call issue_undefined_symbol_error.
6156 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6157 there is no TLS segment if we are about to issue an undefined
6158 symbol error.
6159 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6160
6161 2011-07-08 Ian Lance Taylor <iant@google.com>
6162
6163 PR gold/12279
6164 * resolve.cc (Symbol_table::should_override): Add fromtype
6165 parameter. Change all callers. Give error when linking together
6166 TLS and non-TLS symbol.
6167 (Symbol_table::should_override_with_special): Add fromtype
6168 parameter. Change all callers.
6169 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6170 there is no TLS segment if we have reported some errors.
6171 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6172
6173 2011-07-08 Ian Lance Taylor <iant@google.com>
6174
6175 PR gold/12372
6176 * target.h (Target::plt_address_for_global): New function.
6177 (Target::plt_address_for_local): New function.
6178 (Target::plt_section_for_global): Remove.
6179 (Target::plt_section_for_local): Remove.
6180 (Target::do_plt_address_for_global): New virtual function.
6181 (Target::do_plt_address_for_local): New virtual function.
6182 (Target::do_plt_section_for_global): Remove.
6183 (Target::do_plt_section_for_local): Remove.
6184 (Target::register_global_plt_entry): Add Symbol_table and Layout
6185 parameters.
6186 * output.cc (Output_data_got::Got_entry::write): Use
6187 plt_address_for_global and plt_address_for_local.
6188 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6189 address of output section.
6190 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6191 got_irelative_, and irelative_count_ fields. Update
6192 declarations.
6193 (Output_data_plt_i386::has_irelative_section): New function.
6194 (Output_data_plt_i386::entry_count): Add irelative_count_.
6195 (Output_data_plt_i386::set_final_data_size): Likewise.
6196 (class Target_i386): Add got_irelative_ and rel_irelative_
6197 fields. Update declarations.
6198 (Target_i386::Target_i386): Initialize new fields.
6199 (Target_i386::do_plt_address_for_global): New function replacing
6200 do_plt_section_for_global.
6201 (Target_i386::do_plt_address_for_local): New function replacing
6202 do_plt_section_for_local.
6203 (Target_i386::got_section): Create got_irelative_.
6204 (Target_i386::rel_irelative_section): New function.
6205 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6206 fields. Don't define __rel_iplt_{start,end}.
6207 (Output_data_plt_i386::add_entry): Add symtab and layout
6208 parameters. Change all callers. Use different PLT and GOT for
6209 IFUNC symbols.
6210 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6211 layout parameters. Change all callers. Use different PLT and
6212 GOT.
6213 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6214 (Output_data_plt_i386::rel_irelative): New function.
6215 (Output_data_plt_i386::address_for_global): New function.
6216 (Output_data_plt_i386::address_for_local): New function.
6217 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6218 IRELATIVE GOT when changing IFUNC GOT entries.
6219 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6220 reloc.
6221 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6222 if we didn't create an IRELATIVE GOT.
6223 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6224 plt_address_for_local.
6225 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6226 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6227 got_irelative_, and irelative_count_ fields. Update
6228 declarations.
6229 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6230 Initialize new fields. Remove symtab parameter. Change all
6231 callers.
6232 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6233 irelative_count_.
6234 (Output_data_plt_x86_64::has_irelative_section): New function.
6235 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6236 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6237 fields. Update declarations.
6238 (Target_x86_64::Target_x86_64): Initialize new fields.
6239 (Target_x86_64::do_plt_address_for_global): New function replacing
6240 do_plt_section_for_global.
6241 (Target_x86_64::do_plt_address_for_local): New function replacing
6242 do_plt_section_for_local.
6243 (Target_x86_64::got_section): Create got_irelative_.
6244 (Target_x86_64::rela_irelative_section): New function.
6245 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6246 all callers. Don't create __rel_iplt_{start,end}.
6247 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6248 parameters. Change all callers. Use different PLT and GOT for
6249 IFUNC symbols.
6250 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6251 layout parameters. Change all callers. Use different PLT and
6252 GOT.
6253 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6254 parameters. Change all callers. Use different PLT and GOT for
6255 IFUNC symbols.
6256 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6257 (Output_data_plt_x86_64::rela_irelative): New function.
6258 (Output_data_plt_x86_64::address_for_global): New function.
6259 (Output_data_plt_x86_64::address_for_local): New function.
6260 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6261 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6262 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6263 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6264 parameters.
6265 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6266 reloc.
6267 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6268 symbols if we didn't create an IRELATIVE GOT.
6269 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6270 plt_address_for_local.
6271 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6272 * testsuite/ifuncvar1.c: New test file.
6273 * testsuite/ifuncvar2.c: New test file.
6274 * testsuite/ifuncvar3.c: New test file.
6275 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6276 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6277 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6278 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6279 * testsuite/Makefile.in: Rebuild.
6280
6281 2011-07-07 Cary Coutant <ccoutant@google.com>
6282
6283 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6284 (two_file_test_1_ndebug.o): Likewise.
6285 (two_file_test_1b_ndebug.o): Likewise.
6286 (two_file_test_2_ndebug.o): Likewise.
6287 (two_file_test_main_ndebug.o): Likewise.
6288 (incremental_test_2): Link with no-debug versions.
6289
6290 2011-07-06 Cary Coutant <ccoutant@google.com>
6291
6292 * gold/incremental.cc
6293 (Output_section_incremental_inputs::write_info_blocks): Check for
6294 hidden and internal symbols.
6295
6296 2011-07-06 Cary Coutant <ccoutant@google.com>
6297
6298 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6299 Check disposition for startup file.
6300 (Incremental_inputs::report_command_line): Ignore
6301 --incremental-startup-unchanged option.
6302 * options.cc (General_options::parse_incremental_startup_unchanged):
6303 New function.
6304 (General_options::General_options): Initialize new data member.
6305 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6306 (General_options): Add --incremental-startup-unchanged option.
6307 (General_options::incremental_startup_disposition): New function.
6308 (General_options::incremental_startup_disposition_): New data member.
6309
6310 2011-07-06 Cary Coutant <ccoutant@google.com>
6311
6312 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6313 input file index to Script_info ctor.
6314 (Sized_incremental_binary::do_file_has_changed): Find the
6315 command-line argument for files named in scripts.
6316 * incremental.h (Script_info::Script_info): New ctor
6317 with input file index.
6318 (Script_info::input_file_index): New function.
6319 (Script_info::input_file_index_): New data member.
6320 (Incremental_binary::get_library): Add const.
6321 (Incremental_binary::get_script_info): Add const.
6322 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6323 * testsuite/Makefile.am (incremental_test_5): New test case.
6324 (incremental_test_6): New test case.
6325 * testsuite/Makefile.in: Regenerate.
6326
6327 2011-07-06 Cary Coutant <ccoutant@google.com>
6328
6329 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6330 debug output when command lines differ.
6331
6332 2011-07-06 Cary Coutant <ccoutant@google.com>
6333
6334 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6335 --incremental-patch option.
6336 * layout.cc (Free_list::allocate): Extend allocation beyond original
6337 end if enabled.
6338 (Layout::make_output_section): Mark sections that should get
6339 patch space.
6340 * options.cc (parse_percent): New function.
6341 * options.h (parse_percent): New function.
6342 (DEFINE_percent): New macro.
6343 (General_options): Add --incremental-patch option.
6344 * output.cc (Output_section::Output_section): Initialize new data
6345 members.
6346 (Output_section::add_input_section): Print section name when out
6347 of patch space.
6348 (Output_section::add_output_section_data): Likewise.
6349 (Output_section::set_final_data_size): Add patch space when
6350 doing --incremental-full.
6351 (Output_section::do_reset_address_and_file_offset): Remove patch
6352 space.
6353 (Output_segment::set_section_list_addresses): Print debug output
6354 only if --incremental-update.
6355 * output.h (Output_section::set_is_patch_space_allowed): New function.
6356 (Output_section::is_patch_space_allowed_): New data member.
6357 (Output_section::patch_space_): New data member.
6358 * parameters.cc (Parameters::incremental_full): New function.
6359 * parameters.h (Parameters::incremental_full): New function
6360 * testsuite/Makefile.am (incremental_test_2): Add test for
6361 --incremental-patch option.
6362 * testsuite/Makefile.in: Regenerate.
6363 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6364 (t18): Remove function body.
6365
6366 2011-07-05 Doug Kwan <dougkwan@google.com>
6367
6368 PR gold/12771
6369 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6370 Arm_Address type for relocation result.
6371 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6372 overflow check.
6373 (Arm_relocate_functions::abs32): Use unaligned access.
6374 (Arm_relocate_functions::rel32): Ditto.
6375 (Arm_relocate_functions::prel31): Ditto.
6376 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6377 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6378 static data relocations.
6379 * testsuite/Makefile.in: Regnerate.
6380 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6381
6382 2011-07-05 Ian Lance Taylor <iant@google.com>
6383
6384 PR gold/12392
6385 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6386 symbols if necessary.
6387 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6388
6389 2011-07-05 Ian Lance Taylor <iant@google.com>
6390
6391 PR gold/12952
6392 * resolve.cc (Symbol::override_base_with_special): Simply override
6393 version with special symbol version, ignoring previous version.
6394
6395 2011-07-05 Ian Lance Taylor <iant@google.com>
6396
6397 * object.cc (Sized_relobj_file::include_section_group): Add
6398 information to comment about signature location.
6399
6400 2011-07-02 Ian Lance Taylor <iant@google.com>
6401
6402 PR gold/12957
6403 * options.h (class General_options): Add -f and -F.
6404 * options.cc (General_options::finalize): Fatal error if -f/-F
6405 are used without -shared.
6406 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6407
6408 2011-07-02 Ian Lance Taylor <iant@google.com>
6409
6410 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6411
6412 2011-07-01 Ian Lance Taylor <iant@google.com>
6413
6414 PR gold/12525
6415 PR gold/12952
6416 * resolve.cc (Symbol::override_base_with_special): Don't override
6417 the version if the overriding symbol has a different name.
6418 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6419 all callers. If we give an error about an undefined version,
6420 define the base version if necessary.
6421 * dynobj.h (class Versions): Update declaration.
6422 * testsuite/weak_alias_test_5.cc: New file.
6423 * testsuite/weak_alias_test.script: New file.
6424 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6425 and versioned_alias have the right value, and call t2.
6426 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6427 weak_alias_test_5.so.
6428 (weak_alias_test_LDADD): Likewise.
6429 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6430 * testsuite/Makefile.in: Rebuild.
6431
6432 2011-07-01 Ian Lance Taylor <iant@google.com>
6433
6434 PR gold/12525
6435 * options.h (class General_options): Support -z notext.
6436 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6437 -Wl,-z,notext.
6438 (two_file_shared_nonpic.so): Likewise.
6439 (two_file_shared_mixed.so): Likewise.
6440 (two_file_shared_mixed_1.so): Likewise.
6441 (weak_undef_lib_nonpic.so): Likewise.
6442 (alt/weak_undef_lib_nonpic.so): Likewise.
6443 (tls_test_shared_nonpic.so): Likewise.
6444 * testsuite/Makefile.in: Rebuild.
6445
6446 2011-07-01 Ian Lance Taylor <iant@google.com>
6447
6448 PR gold/12525
6449 * configure.ac: Test whether static linking works, setting
6450 the automake conditional HAVE_STATIC.
6451 * testsuite/Makefile.am: Disable tests using -static if
6452 HAVE_STATIC is not true.
6453 * configure, testsuite/Makefile.in: Rebuild.
6454
6455 2011-07-01 Ian Lance Taylor <iant@google.com>
6456
6457 PR gold/12525
6458 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6459 Assert if we see DW_EH_PE_indirect.
6460 * target.h (Target::ehframe_datarel_base): New function.
6461 (Target::do_ehframe_datarel_base): New target function.
6462 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6463 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6464 function.
6465
6466 2011-07-01 Ian Lance Taylor <iant@google.com>
6467
6468 PR gold/12571
6469 * options.h (class General_options): Add
6470 --ld-generated-unwind-info.
6471 * ehframe.cc (Fde::write): Add address parameter. Change all
6472 callers. If associated with PLT, fill in address and size.
6473 (Cie::set_output_offset): Only add merge mapping if there is an
6474 object.
6475 (Cie::write): Add address parameter. Change all callers.
6476 (Eh_frame::add_ehframe_for_plt): New function.
6477 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6478 input_offset_ fields into union u_, with new plt field.
6479 (Fde::Fde): Adjust for new union field.
6480 (Fde::Fde) [Output_data version]: New constructor.
6481 (Fde::add_mapping): Only add merge mapping if there is an object.
6482 (class Cie): Update declarations.
6483 (class Eh_frame): Declare add_ehframe_for_plt.
6484 * layout.cc (Layout::layout_eh_frame): Break out code into
6485 make_eh_frame_section, and call it.
6486 (Layout::make_eh_frame_section): New function.
6487 (Layout::add_eh_frame_for_plt): New function.
6488 * layout.h (class Layout): Update declarations.
6489 * merge.cc (Merge_map::add_mapping): Add assertion.
6490 * i386.cc: Include "dwarf.h".
6491 (class Output_data_plt_i386): Make first_plt_entry,
6492 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6493 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6494 and plt_eh_frame_fde.
6495 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6496 boundary. Call add_eh_frame_for_plt if appropriate.
6497 * x86_64.cc: Include "dwarf.h".
6498 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6499 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6500 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6501 and plt_eh_frame_fde.
6502 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6503 appropriate.
6504
6505 2011-06-29 Ian Lance Taylor <iant@google.com>
6506
6507 PR gold/12629
6508 * object.cc (Sized_relobj_file::layout_section): Change shdr
6509 parameter to be const.
6510 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6511 out of do_layout.
6512 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6513 appropriate. Call layout_eh_frame_section.
6514 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6515 sections.
6516 * object.h (class Sized_relobj_file): Update declarations.
6517
6518 2011-06-29 Ian Lance Taylor <iant@google.com>
6519
6520 PR gold/12652
6521 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6522 modifier.
6523 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6524
6525 2011-06-29 Ian Lance Taylor <iant@google.com>
6526
6527 PR gold/12675
6528 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6529 SHT_X86_64_UNWIND.
6530 * layout.cc (Layout::layout_eh_frame): Likewise.
6531
6532 2011-06-29 Ian Lance Taylor <iant@google.com>
6533
6534 PR gold/12695
6535 * layout.cc (Layout::symtab_section_shndx): New function.
6536 * layout.h (class Layout): Declare symtab_section_shndx.
6537 * output.cc (Output_section::write_header): Call it.
6538
6539 2011-06-29 Ian Lance Taylor <iant@google.com>
6540
6541 PR gold/12818
6542 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6543 symbols which are not used in a relocation.
6544
6545 2011-06-28 Ian Lance Taylor <iant@google.com>
6546
6547 PR gold/12898
6548 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6549 script create indistinguishable segments.
6550 (Layout::set_segment_offsets): Use stable_sort when sorting
6551 segments. Pass this to Compare_segments constructor.
6552 * layout.h (class Layout): Make segment_precedes non-static.
6553 (class Compare_segments): Change from struct to class. Add
6554 layout_ field. Add constructor.
6555 * script-sections.cc
6556 (Script_sections::attach_sections_using_phdrs_clause): Rename
6557 local orphan to is_orphan. Don't report failure to put empty
6558 section in segment. On attachment failure, report name of
6559 section, and attach to first PT_LOAD segment.
6560
6561 2011-06-28 Ian Lance Taylor <iant@google.com>
6562
6563 PR gold/12934
6564 * target-select.cc (Target_selector::Target_selector): Add
6565 emulation parameter. Change all callers.
6566 (select_target_by_bfd_name): Rename from select_target_by_name.
6567 Change all callers.
6568 (select_target_by_emulation): New function.
6569 (supported_emulation_names): New function.
6570 * target-select.h (class Target_selector): Add emulation_ field.
6571 Update declarations.
6572 (Target_selector::recognize_by_bfd_name): Rename from
6573 recognize_by_name. Change all callers.
6574 (Target_selector::supported_bfd_names): Rename from
6575 supported_names. Change all callers.
6576 (Target_selector::recognize_by_emulation): New function.
6577 (Target_selector::supported_emulations): New function.
6578 (Target_selector::emulation): New function.
6579 (Target_selector::do_recognize_by_bfd_name): Rename from
6580 do_recognize_by_name. Change all callers.
6581 (Target_selector::do_supported_bfd_names): Rename from
6582 do_supported_names. Change all callers.
6583 (Target_selector::do_recognize_by_emulation): New function.
6584 (Target_selector::do_supported_emulations): New function.
6585 (select_target_by_bfd_name): Change name in declaration.
6586 (select_target_by_emulation): Declare.
6587 (supported_emulation_names): Declare.
6588 * parameters.cc (parameters_force_valid_target): Try to find
6589 target based on emulation from -m option.
6590 * options.h (class General_options): Change doc string for -m.
6591 * options.cc (help): Print emulations.
6592 (General_options::parse_V): Likewise.
6593 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6594 Add emulation parameter. Change all callers.
6595
6596 2011-06-28 Ian Lance Taylor <iant@google.com>
6597
6598 * target.h (class Target): Add osabi_ field.
6599 (Target::osabi): New function.
6600 (Target::set_osabi): New function.
6601 (Target::Target): Initialize osabi_.
6602 (Target::do_adjust_elf_header): Make pure virtual.
6603 (Sized_target::do_adjust_elf_header): Declare.
6604 * target.cc (Sized_target::do_adjust_elf_header): New function.
6605 (class Sized_target): Instantiate all versions.
6606 * freebsd.h (class Target_freebsd): Remove.
6607 (Target_selector_freebsd::do_recognize): Call set_osabi on
6608 Target.
6609 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6610 (Target_selector_freebsd::set_osabi): Remove.
6611 * i386.cc (class Target_i386): Inherit from Sized_target rather
6612 than Target_freebsd.
6613 * x86_64.cc (class Target_x86_64): Likewise.
6614
6615 2011-06-28 Ian Lance Taylor <iant@google.com>
6616
6617 * target.h (Target::can_check_for_function_pointers): Rewrite.
6618 Make non-virtual.
6619 (Target::can_icf_inline_merge_sections): Likewise.
6620 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6621 (Target::Target_info): Add can_icf_inline_merge_sections field.
6622 (Target::do_can_check_for_function_pointers): New virtual
6623 function.
6624 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6625 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6626 from can_check_for_function_pointers, move in file.
6627 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6628 section_may_have_icf_unsafe_poineters, move in file.
6629 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6630 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6631 Rename from can_check_for_function_pointers, move in file.
6632 (Target_i386::can_icf_inline_merge_sections): Remove.
6633 (Target_i386::i386_info): Initialize
6634 can_icf_inline_merge_sections.
6635 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6636 Initialize can_icf_inline_merge_sections.
6637 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6638 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6639 Rename from can_check_for_function_pointers, move in file.
6640 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6641 (Target_x86_64::x86_64_info): Initialize
6642 can_icf_inline_merge_sections.
6643 * testsuite/testfile.cc (Target_test::test_target_info):
6644 Likewise.
6645 * icf.cc (get_section_contents): Correct formatting.
6646
6647 2011-06-27 Ian Lance Taylor <iant@google.com>
6648
6649 * symtab.cc (Symbol::versioned_name): New function.
6650 (Symbol_table::add_to_final_symtab): Use versioned_name when
6651 appropriate.
6652 (Symbol_table::sized_write_symbol): Likewise.
6653 * symtab.h (class Symbol): Declare versioned_name.
6654 * stringpool.h (class Stringpool_template): Add variant of add
6655 which takes a std::basic_string.
6656 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6657 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6658 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6659 (ver_test_12.o): New target.
6660 * testsuite/Makefile.in: Rebuild.
6661
6662 2011-06-27 Doug Kwan <dougkwan@google.com>
6663
6664 * arm.cc (Arm_relocate_functions::thm_jump8,
6665 Arm_relocate_functions::thm_jump11): Use a wider signed
6666 type to compute offset.
6667 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6668 arm_thm_jump8.
6669 * testsuite/Makefile.in: Regenerate.
6670 * testsuite/arm_branch_in_range.sh: Check test results of
6671 arm_thm_jump11 and arm_thm_jump8.
6672 * testsuite/arm_thm_jump11.s: New test source file.
6673 * testsuite/arm_thm_jump11.t: New linker script.
6674 * testsuite/arm_thm_jump8.s: New test source file.
6675 * testsuite/arm_thm_jump8.t: New linker script.
6676
6677 2011-06-24 Ian Lance Taylor <iant@google.com>
6678
6679 * layout.cc: Include "object.h".
6680 (ctors_sections_in_init_array): New static variable.
6681 (Layout::is_ctors_in_init_array): New function.
6682 (Layout::layout): Add entry to ctors_sections_in_init_array if
6683 appropriate.
6684 * layout.h (class Layout): Declare is_ctors_in_init_array.
6685 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6686 is_ctors_reverse_view is set.
6687 (Sized_relobj_file::write_sections): Add layout parameter. Change
6688 all callers. Set is_ctors_reverse_view field of View_size.
6689 (Sized_relobj_file::reverse_words): New function.
6690 * object.h (Sized_relobj_file::View_size): Add
6691 is_ctors_reverse_view field.
6692 (class Sized_relobj_file): Update declarations.
6693 * testsuite/initpri3.c: New test.
6694 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6695 initpri3b.
6696 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6697 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6698 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6699 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6700 * testsuite/Makefile.in: Rebuild.
6701
6702 2011-06-24 Cary Coutant <ccoutant@google.com>
6703
6704 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6705 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6706 (debug_msg_cdebug.err): New targets.
6707 * testsuite/Makefile.in: Regenerate.
6708 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6709 Fix checks for link with shared library.
6710
6711 2011-06-24 Doug Kwan <dougkwan@google.com>
6712
6713 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6714 skip empty text sections.
6715 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6716
6717 2011-06-22 Ian Lance Taylor <iant@google.com>
6718
6719 PR gold/12910
6720 * options.h (class General_options): Add --ctors-in-init-array.
6721 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6722 friends as SHT_PROGBITS for merging sections.
6723 (Layout::layout): Remove special handling of .init_array and
6724 friends. Don't sort if doing relocatable link. Sort for .ctors
6725 and .dtors if ctors_in_init_array.
6726 (Layout::make_output_section): Force correct section types for
6727 .init_array and friends. Don't sort if doing relocatable link,
6728 Don't sort .ctors and .dtors if ctors_in_init_array.
6729 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6730 (Layout::output_section_name): Add relobj parameter. Change all
6731 callers. Handle .ctors. and .dtors. in code rather than table.
6732 Handle .ctors and .dtors if ctors_in_init_array.
6733 (Layout::match_file_name): New function, moved from output.cc.
6734 * layout.h (class Layout): Update declarations.
6735 * output.cc: Include "layout.h".
6736 (Input_section_sort_entry::get_priority): New function.
6737 (Input_section_sort_entry::match_file_name): Just call
6738 Layout::match_file_name.
6739 (Output_section::Input_section_sort_init_fini_compare::operator()):
6740 Handle .ctors and .dtors. Sort by explicit priority rather than
6741 by name.
6742 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6743 * testsuite/initpri2.c: New test.
6744 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6745 (check_PROGRAMS): Add initpri2.
6746 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6747 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6748 * configure, testsuite/Makefile.in: Rebuild.
6749
6750 2011-06-19 Ian Lance Taylor <iant@google.com>
6751
6752 PR gold/12880
6753 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6754 .interp section to a PT_INTERP segment even if we have seen a
6755 --dynamic-linker option. Don't do it if we have seen a PHDRS
6756 clause in a linker script.
6757 (Layout::finalize): Don't create a .interp section if we've
6758 already create a PT_INTERP segment.
6759 (Layout::create_interp): Always call choose_output_section (revert
6760 patch of 2011-06-17). Don't create PT_INTERP segment.
6761 * script-sections.cc
6762 (Script_sections::create_note_and_tls_segments): Add a .interp
6763 section to a PT_INTERP segment even if we have seen a
6764 --dynamic-linker option.
6765
6766 2011-06-18 Ian Lance Taylor <iant@google.com>
6767
6768 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6769 merely because a non-PT_LOAD segment has a dynamic reloc.
6770
6771 2011-06-18 Ian Lance Taylor <iant@google.com>
6772
6773 * layout.cc (Layout::finish_dynamic_section): Don't create
6774 DT_FLAGS entry if not needed.
6775
6776 2011-06-18 Ian Lance Taylor <iant@google.com>
6777
6778 PR gold/12745
6779 * layout.cc (Layout::layout_eh_frame): Correct handling of
6780 writable .eh_frame section.
6781
6782 2011-06-17 Ian Lance Taylor <iant@google.com>
6783
6784 PR gold/12893
6785 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6786 symbol is redefined with the exact same object and value.
6787
6788 2011-06-17 Ian Lance Taylor <iant@google.com>
6789
6790 PR gold/12880
6791 * layout.h (class Layout): Add interp_segment_ field.
6792 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6793 (Layout::attach_allocated_section_to_segment): If making shared
6794 library, put .interp section in PT_INTERP segment.
6795 (Layout::finalize): Also call create_interp if -dynamic-linker
6796 option was used.
6797 (Layout::create_interp): Assert that there is no PT_INTERP
6798 segment. If not using a SECTIONS clause, use make_output_section.
6799 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6800 * script-sections.cc
6801 (Script_sections::create_note_and_tls_segments): If making shared
6802 library, put .interp section in PT_INTERP segment.
6803
6804 2011-06-17 Ian Lance Taylor <iant@google.com>
6805
6806 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6807 when making a shared library.
6808
6809 2011-06-17 Ian Lance Taylor <iant@google.com>
6810
6811 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6812 parameter. Change all callers. Don't issue warning about PC32
6813 against locally defined symbol.
6814
6815 2011-06-16 Ian Lance Taylor <iant@google.com>
6816
6817 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6818 occurs in same object.
6819
6820 2011-06-14 Alan Modra <amodra@gmail.com>
6821
6822 * po/POTFILES.in: Regenerate.
6823
6824 2011-06-09 Ian Lance Taylor <iant@google.com>
6825
6826 * script-sections.cc
6827 (Orphan_output_section::set_section_addresses): For a relocatable
6828 link set address to 0.
6829
6830 2011-06-09 Cary Coutant <ccoutant@google.com>
6831
6832 PR gold/12804
6833 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6834 used with --compress-debug-sections.
6835 * gold/object.cc (Sized_relobj_file::do_layout): Report
6836 uncompressed size of compressed input sections.
6837
6838 2011-06-08 Cary Coutant <ccoutant@google.com>
6839
6840 PR gold/12804
6841 * testsuite/two_file_test_2_v1.cc: Change initialization of
6842 v2 to keep it in .data.
6843
6844 2011-06-07 Cary Coutant <ccoutant@google.com>
6845
6846 * common.cc (Symbol_table::do_allocate_commons_list): Call
6847 gold_fallback.
6848 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6849 (Errors::fallback): New function.
6850 (gold_fallback): New function.
6851 * errors.h (Errors::fallback): New function.
6852 * gold.cc (gold_exit): Change status parameter to enum; adjust
6853 all callers.
6854 (queue_initial_tasks): Call gold_fallback.
6855 * gold.h: Include cstdlib.
6856 (Exit_status): New enum type.
6857 (gold_exit): Change status parameter to enum.
6858 (gold_fallback): New function.
6859 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6860 (Layout::create_symtab_sections): Likewise.
6861 (Layout::create_shdrs): Likewise.
6862 * main.cc (main): Adjust call to gold_exit.
6863 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6864 (Output_data_got::add_got_entry_pair): Likewise.
6865 (Output_section::add_input_section): Likewise.
6866 (Output_section::add_output_section_data): Likewise.
6867 (Output_segment::set_section_list_addresses): Likewise.
6868 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6869
6870 2011-06-07 Cary Coutant <ccoutant@google.com>
6871
6872 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6873 for incremental links.
6874 * output.cc (Output_segment::set_section_list_addresses): Remove
6875 FIXME and test for TLS or BSS.
6876
6877 2011-06-07 Cary Coutant <ccoutant@google.com>
6878
6879 * testsuite/Makefile.am: Add incremental_copy_test,
6880 incremental_common_test_1.
6881 * testsuite/Makefile.in: Regenerate.
6882 * testsuite/common_test_1_v1.c: New source file.
6883 * testsuite/common_test_1_v2.c: New source file.
6884 * testsuite/copy_test_v1.cc: New source file.
6885
6886 2011-06-07 Cary Coutant <ccoutant@google.com>
6887
6888 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6889 update, allocate common from bss section's free list.
6890 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6891 linker-defined symbols.
6892 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6893 Skip GOT and PLT entries that are no longer referenced.
6894 (Output_section_incremental_inputs::write_info_blocks): Mark
6895 linker-defined symbols.
6896 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6897 * output.cc (Output_section::allocate): New function.
6898 * output.h (Output_section::allocate): New function.
6899 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6900 linker-defined symbols.
6901 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6902 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6903 (Symbol::init_base_output_data): Likewise.
6904 (Symbol::init_base_output_segment): Likewise.
6905 (Symbol::init_base_constant): Likewise.
6906 (Sized_symbol::init_output_data): Likewise.
6907 (Sized_symbol::init_output_segment): Likewise.
6908 (Sized_symbol::init_constant): Likewise.
6909 (Symbol_table::do_define_in_output_data): Likewise.
6910 (Symbol_table::do_define_in_output_segment): Likewise.
6911 (Symbol_table::do_define_as_constant): Likewise.
6912 * symtab.h (Symbol::is_predefined): New function.
6913 (Symbol::init_base_output_data): Add is_predefined parameter.
6914 (Symbol::init_base_output_segment): Likewise.
6915 (Symbol::init_base_constant): Likewise.
6916 (Symbol::is_predefined_): New data member.
6917 (Sized_symbol::init_output_data): Add is_predefined parameter.
6918 (Sized_symbol::init_output_segment): Likewise.
6919 (Sized_symbol::init_constant): Likewise.
6920 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6921
6922 2011-06-07 Cary Coutant <ccoutant@google.com>
6923
6924 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6925 instead of emit_copy_reloc.
6926 (Copy_relocs::emit_copy_reloc): Refactor.
6927 (Copy_relocs::make_copy_reloc): New function.
6928 (Copy_relocs::add_copy_reloc): Remove.
6929 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6930 section.
6931 (Copy_relocs::make_copy_reloc): New function.
6932 (Copy_relocs::add_copy_reloc): Remove.
6933 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6934 unchanged input files.
6935 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6936 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6937 Reserve BSS space for COPY relocations.
6938 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6939 (Output_section_incremental_inputs::write_info_blocks): Record
6940 whether a symbol is copied from a shared object.
6941 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6942 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6943 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6944 (Incremental_input_entry_reader::get_output_symbol_index): Add
6945 is_copy parameter.
6946 (Incremental_binary::emit_copy_relocs): New function.
6947 (Incremental_binary::do_emit_copy_relocs): New function.
6948 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6949 new data member.
6950 (Sized_incremental_binary::add_copy_reloc): New function.
6951 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6952 (Sized_incremental_binary::Copy_reloc): New struct.
6953 (Sized_incremental_binary::Copy_relocs): New typedef.
6954 (Sized_incremental_binary::copy_relocs_): New data member.
6955 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6956 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6957 * target.h (Sized_target::emit_copy_reloc): New function.
6958 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6959
6960 2011-06-02 Cary Coutant <ccoutant@google.com>
6961
6962 PR gold/12163
6963 * gold/archive.cc (Archive::Archive): Initialize new data member.
6964 (Archive::include_all_members): Return if archive has already been
6965 included.
6966 * gold/archive.h (Archive::include_all_members_): New data member.
6967
6968 2011-06-02 Nick Clifton <nickc@redhat.com>
6969
6970 * dynobj.h: Fix spelling mistake in comment.
6971 * output.cc: Likewise.
6972
6973 2011-05-31 Doug Kwan <dougkwan@google.com>
6974 Asier Llano
6975
6976 PR gold/12826
6977 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
6978 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6979 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6980 redundant arm_exidx_test.so.
6981 * testsuite/Makefile.in: Regenerate.
6982 (check_SCRIPTS): Add pr12826.sh
6983 (check_DATA): Add pr12826.stdout
6984 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6985 * testsuite/pr12826.sh: New file.
6986 * testsuite/pr12826_1.s: Ditto.
6987 * testsuite/pr12826_1.s: Ditto.
6988
6989 2011-05-30 Ian Lance Taylor <iant@google.com>
6990
6991 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6992 sections.
6993
6994 2011-05-29 Ian Lance Taylor <iant@google.com>
6995
6996 PR gold/12804
6997 * testsuite/Makefile.am: Use different file name for two_file_test
6998 temporary file for each incremental test.
6999 * testsuite/Makefile.in: Rebuild.
7000
7001 2011-05-29 Ian Lance Taylor <iant@google.com>
7002
7003 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7004 binary input file is empty.
7005
7006 2011-05-27 Ian Lance Taylor <iant@google.com>
7007
7008 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7009 (ver_test_9.so): Likewise.
7010 * testsuite/Makefile.in: Rebuild.
7011
7012 2011-05-26 Cary Coutant <ccoutant@google.com>
7013
7014 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7015 * incremental.cc (Incremental_inputs::report_input_section): Fix
7016 comment, indentation.
7017 (Incremental_inputs::report_comdat_group): New function.
7018 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7019 of data for incremental input file entry.
7020 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7021 group count, COMDAT group signatures.
7022 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7023 an unchanged input file.
7024 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7025 Initialize new data member.
7026 (Incremental_object_entry::add_comdat_group): New function.
7027 (Incremental_object_entry::get_comdat_group_count): New function.
7028 (Incremental_object_entry::get_comdat_signature_key): New function.
7029 (Incremental_object_entry::groups_): New data member.
7030 (Incremental_inputs::report_comdat_group): New function.
7031 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7032 data for incremental input file entry.
7033 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7034 (Incremental_input_entry_reader::get_input_section): Adjust size of
7035 data for incremental input file entry.
7036 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7037 (Incremental_input_entry_reader::get_comdat_group_signature): New
7038 function.
7039 * object.cc (Sized_relobj::include_section_group): Report kept
7040 COMDAT groups for incremental links.
7041
7042 2011-05-24 David Meyer <pdox@google.com>
7043
7044 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7045 with name parameter. Add found_name parameter.
7046 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7047 * dirsearch.h (class Dirsearch): Update declaration.
7048
7049 2011-05-24 Ian Lance Taylor <iant@google.com>
7050
7051 * archive.cc (Library_base::should_include_member): Pull in object
7052 from archive if it defines the entry symbol.
7053 * parameters.cc (Parameters::entry): New function.
7054 * parameters.h (class Parameters): Declare entry.
7055 * output.h (class Output_file_header): Remove entry_ field.
7056 * output.cc (Output_file_header::Output_file_header): Remove entry
7057 parameter. Change all callers.
7058 (Output_file_header::entry): Use parameters->entry.
7059 * gold.cc (queue_middle_tasks): Likewise.
7060 * plugin.cc (Plugin_hook::run): Likewise.
7061
7062 2011-05-24 Cary Coutant <ccoutant@google.com>
7063
7064 * gold.cc (queue_initial_tasks): Pass incremental base filename
7065 to Output_file::open_base_file; don't print error message.
7066 * incremental-dump.cc (main): Adjust call to
7067 Output_file::open_for_modification.
7068 * incremental-dump.cc (main): Likewise.
7069 * incremental.cc (Incremental_inputs::report_command_line):
7070 Ignore --incremental-base option when comparing command lines.
7071 Ignore parameter when given as separate argument.
7072 * options.h (class General_options): Add --incremental-base.
7073 * output.cc (Output_file::Output_file):
7074 (Output_file::open_base_file): Add base_name and writable parameters;
7075 read base file into new file; print error message here.
7076 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7077 callers.
7078 * output.h (Output_file::open_for_modification): Rename to...
7079 (Output_file::open_base_file): ...this; add base_name and
7080 writable parameters; adjust all callers.
7081 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7082 callers.
7083 * testsuite/Makefile.am (incremental_test_4): Test
7084 --incremental-base.
7085 * testsuite/Makefile.in: Regenerate.
7086
7087 2011-05-24 Cary Coutant <ccoutant@google.com>
7088
7089 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7090 incremental_test_4.
7091 * testsuite/Makefile.in: Regenerate.
7092 * testsuite/two_file_test_1_v1.cc: New test source file.
7093 * testsuite/two_file_test_1b_v1.cc: New test source file.
7094 * testsuite/two_file_test_2_v1.cc: New test source file.
7095
7096 2011-05-24 Cary Coutant <ccoutant@google.com>
7097
7098 * dynobj.h (Dynobj::do_dynobj): New function.
7099 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7100 flag and soname for shared objects.
7101 * incremental.cc (Incremental_inputs::report_object): Make
7102 either Incremental_object_entry or Incremental_dynobj_entry; add
7103 soname to string table.
7104 (Incremental_inputs::report_input_section): Add assertion.
7105 (Output_section_incremental_inputs::set_final_data_size): Adjust
7106 type of input file entry for shared libraries; adjust size of
7107 shared library info entry.
7108 (Output_section_incremental_inputs::write_input_files): Write
7109 as_needed flag for shared libraries.
7110 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7111 of input file entry for shared libraries; write soname.
7112 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7113 soname from incremental info.
7114 * incremental.h (enum Incremental_input_flags): Add
7115 INCREMENTAL_INPUT_AS_NEEDED.
7116 (Incremental_input_entry::Incremental_input_entry): Initialize new
7117 data member.
7118 (Incremental_input_entry::set_as_needed): New function.
7119 (Incremental_input_entry::as_needed): New function.
7120 (Incremental_input_entry::do_dynobj_entry): New function.
7121 (Incremental_input_entry::as_needed_): New data member.
7122 (Incremental_object_entry::Incremental_object_entry): Don't check
7123 for shared library.
7124 (Incremental_object_entry::do_type): Likewise.
7125 (class Incremental_dynobj_entry): New class.
7126 (Incremental_input_entry_reader::as_needed): New function.
7127 (Incremental_input_entry_reader::get_soname): New function.
7128 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7129 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7130 size of shared library info entry.
7131 * layout.cc (Layout::finish_dynamic_section): Don't test for
7132 incremental link when adding DT_NEEDED entries.
7133 * object.h (Object::Object): Initialize new data member.
7134 (Object::dynobj): New function.
7135 (Object::set_as_needed): New function.
7136 (Object::as_needed): New function.
7137 (Object::do_dynobj): New function.
7138 (Object::as_needed_): New data member.
7139
7140 2011-05-24 Cary Coutant <ccoutant@google.com>
7141
7142 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7143 info; adjust display of GOT entries.
7144 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7145 vector of input objects; remove file_status_.
7146 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7147 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7148 got_plt reader; call target hooks to reserve GOT entries.
7149 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7150 of input file info header and GOT info entry.
7151 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7152 relocation info.
7153 (Got_plt_view_info::got_descriptor): Remove.
7154 (Got_plt_view_info::sym_index): New data member.
7155 (Got_plt_view_info::input_index): New data member.
7156 (Local_got_offset_visitor::visit): Write input file index.
7157 (Global_got_offset_visitor::visit): Write 0 for input file index.
7158 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7159 with sym_index and input_index.
7160 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7161 incremental info GOT entry; replace got_descriptor with input_index.
7162 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7163 map from input file index to object.
7164 (Sized_relobj_incr::do_layout): Replace direct data member reference
7165 with accessor function.
7166 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7167 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7168 Adjust size of input file info header.
7169 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7170 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7171 (Incremental_input_entry_reader::get_input_section): Adjust size of
7172 input file info header.
7173 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7174 of incremental info GOT entry.
7175 (Incremental_got_plt_reader::get_got_desc): Remove.
7176 (Incremental_got_plt_reader::get_got_symndx): New function.
7177 (Incremental_got_plt_reader::get_got_input_index): New function.
7178 (Sized_incremental_binary::Sized_incremental_binary): Remove
7179 file_status_; add input_objects_.
7180 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7181 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7182 (Sized_incremental_binary::file_is_unchanged): Remove.
7183 (Sized_incremental_binary::set_input_object): New function.
7184 (Sized_incremental_binary::input_object): New function.
7185 (Sized_incremental_binary::file_status_): Remove.
7186 (Sized_incremental_binary::input_objects_): New data member.
7187 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7188 references.
7189 (Sized_relobj_incr::invalid_address): Move to base class.
7190 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7191 class.
7192 (Sized_relobj_incr::do_output_section_offset): Likewise.
7193 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7194 (Sized_relobj_incr::section_offsets_): Likewise.
7195 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7196 function.
7197 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7198 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7199 with accessor function.
7200 (Sized_relobj_file::do_layout): Likewise.
7201 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7202 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7203 (Sized_relobj_file::compute_final_local_value): Replace refs to
7204 section_offsets_ with accessor function.
7205 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7206 * object.h (Relobj::Relobj): Initialize new data members.
7207 (Relobj::add_dyn_reloc): New function.
7208 (Relobj::first_dyn_reloc): New function.
7209 (Relobj::dyn_reloc_count): New function.
7210 (Relobj::first_dyn_reloc_): New data member.
7211 (Relobj::dyn_reloc_count_): New data member.
7212 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7213 references.
7214 (Sized_relobj::Address): New typedef.
7215 (Sized_relobj::invalid_address): Move here from child class.
7216 (Sized_relobj::Sized_relobj): Initialize new data members.
7217 (Sized_relobj::sized_relobj): New function.
7218 (Sized_relobj::is_output_section_offset_invalid): Move here from
7219 child class.
7220 (Sized_relobj::get_output_section_offset): Likewise.
7221 (Sized_relobj::local_has_got_offset): Likewise.
7222 (Sized_relobj::local_got_offset): Likewise.
7223 (Sized_relobj::set_local_got_offset): Likewise.
7224 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7225 (Sized_relobj::clear_got_offsets): New function.
7226 (Sized_relobj::section_offsets): Move here from child class.
7227 (Sized_relobj::do_output_section_offset): Likewise.
7228 (Sized_relobj::do_set_section_offset): Likewise.
7229 (Sized_relobj::Local_got_offsets): Likewise.
7230 (Sized_relobj::local_got_offsets_): Likewise.
7231 (Sized_relobj::section_offsets_): Likewise.
7232 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7233 references.
7234 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7235 class.
7236 (Sized_relobj_file::sized_relobj): New function
7237 (Sized_relobj_file::local_has_got_offset): Move to base class.
7238 (Sized_relobj_file::local_got_offset): Likewise.
7239 (Sized_relobj_file::set_local_got_offset): Likewise.
7240 (Sized_relobj_file::get_output_section_offset): Likewise.
7241 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7242 (Sized_relobj_file::do_output_section_offset): Likewise.
7243 (Sized_relobj_file::do_set_section_offset): Likewise.
7244 (Sized_relobj_file::Local_got_offsets): Likewise.
7245 (Sized_relobj_file::local_got_offsets_): Likewise.
7246 (Sized_relobj_file::section_offsets_): Likewise.
7247 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7248 (all constructors).
7249 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7250 (Output_reloc::get_symbol_index): Likewise.
7251 (Output_reloc::local_section_offset): Likewise.
7252 (Output_reloc::get_address): Likewise.
7253 (Output_reloc::symbol_value): Likewise.
7254 (Output_data_got::reserve_slot): Move to class definition.
7255 (Output_data_got::reserve_local): New function.
7256 (Output_data_got::reserve_slot_for_global): Remove.
7257 (Output_data_got::reserve_global): New function.
7258 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7259 (all constructors, two instantiations).
7260 (Output_reloc::get_relobj): New function (two instantiations).
7261 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7262 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7263 (Output_data_reloc::add_global): Adjust type of relobj.
7264 (Output_data_reloc::add_global_relative): Likewise.
7265 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7266 (Output_data_reloc::add_local): Likewise.
7267 (Output_data_reloc::add_local_relative): Likewise.
7268 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7269 (Output_data_reloc::add_local_section): Likewise.
7270 (Output_data_reloc::add_output_section): Likewise.
7271 (Output_data_reloc::add_absolute): Likewise.
7272 (Output_data_reloc::add_target_specific): Likewise.
7273 (Output_data_got::reserve_slot): Move definition here.
7274 (Output_data_got::reserve_local): New function.
7275 (Output_data_got::reserve_global): New function.
7276 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7277 section_offsets_ with accessor function.
7278 (Sized_relobj_file::write_sections): Likewise.
7279 (Sized_relobj_file::do_relocate_sections): Likewise.
7280 * target.h (Sized_target::reserve_local_got_entry): New function.
7281 (Sized_target::reserve_global_got_entry): New function.
7282 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7283 (Target_x86_64::reserve_global_got_entry): New function.
7284 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7285
7286 2011-05-23 Cary Coutant <ccoutant@google.com>
7287
7288 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7289 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7290 bit when checking got_type.
7291 * incremental.cc (Sized_incremental_binary::setup_readers):
7292 Store symbol table and string table locations; initialize bit vector
7293 of file status flags.
7294 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7295 unchanged files.
7296 (Sized_incremental_binary::do_process_got_plt): New function.
7297 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7298 (Output_section_incremental_inputs::set_final_data_size): Record
7299 file index for each input file.
7300 (Output_section_incremental_inputs::write_got_plt): Store file index
7301 instead of input entry offset for each GOT entry.
7302 * incremental.h
7303 (Incremental_input_entry::Incremental_input_entry): Initialize new
7304 data member.
7305 (Incremental_input_entry::set_offset): Store file index.
7306 (Incremental_input_entry::get_file_index): New function.
7307 (Incremental_input_entry::file_index_): New data member.
7308 (Incremental_binary::process_got_plt): New function.
7309 (Incremental_binary::do_process_got_plt): New function.
7310 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7311 data members.
7312 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7313 (Sized_incremental_binary::set_file_is_unchanged): New function.
7314 (Sized_incremental_binary::file_is_unchanged): New function.
7315 (Sized_incremental_binary::do_process_got_plt): New function.
7316 (Sized_incremental_binary::file_status_): New data member.
7317 (Sized_incremental_binary::main_symtab_loc_): New data member.
7318 (Sized_incremental_binary::main_strtab_loc_): New data member.
7319 * output.cc (Output_data_got::Got_entry::write): Add case
7320 RESERVED_CODE.
7321 (Output_data_got::add_global): Call add_got_entry.
7322 (Output_data_got::add_global_plt): Likewise.
7323 (Output_data_got::add_global_with_rel): Likewise.
7324 (Output_data_got::add_global_with_rela): Likewise.
7325 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7326 (Output_data_got::add_global_pair_with_rela): Likewise.
7327 (Output_data_got::add_local): Call add_got_entry.
7328 (Output_data_got::add_local_plt): Likewise.
7329 (Output_data_got::add_local_with_rel): Likewise.
7330 (Output_data_got::add_local_with_rela): Likewise.
7331 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7332 (Output_data_got::add_local_pair_with_rela): Likewise.
7333 (Output_data_got::reserve_slot): New function.
7334 (Output_data_got::reserve_slot_for_global): New function.
7335 (Output_data_got::add_got_entry): New function.
7336 (Output_data_got::add_got_entry_pair): New function.
7337 (Output_section::add_output_section_data): Edit FIXME.
7338 * output.h
7339 (Output_section_data_build::Output_section_data_build): New
7340 constructor with size parameter.
7341 (Output_data_space::Output_data_space): Likewise.
7342 (Output_data_got::Output_data_got): Initialize new data member; new
7343 constructor with size parameter.
7344 (Output_data_got::add_constant): Call add_got_entry.
7345 (Output_data_got::reserve_slot): New function.
7346 (Output_data_got::reserve_slot_for_global): New function.
7347 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7348 (Output_data_got::add_got_entry): New function.
7349 (Output_data_got::add_got_entry_pair): New function.
7350 (Output_data_got::free_list_): New data member.
7351 * target.h (Sized_target::init_got_plt_for_update): New function.
7352 (Sized_target::register_global_plt_entry): New function.
7353 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7354 Initialize new data member; call init; add constructor with PLT count.
7355 (Output_data_plt_x86_64::init): New function.
7356 (Output_data_plt_x86_64::add_relocation): New function.
7357 (Output_data_plt_x86_64::reserve_slot): New function.
7358 (Output_data_plt_x86_64::free_list_): New data member.
7359 (Target_x86_64::init_got_plt_for_update): New function.
7360 (Target_x86_64::register_global_plt_entry): New function.
7361 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7362 incremental updates.
7363 (Output_data_plt_x86_64::add_relocation): New function.
7364 * testsuite/object_unittest.cc (Object_test): Set default options.
7365
7366 2011-05-16 Ian Lance Taylor <iant@google.com>
7367
7368 * options.h (class General_options): Make -i a synonym for -r.
7369
7370 2011-05-16 Ian Lance Taylor <iant@google.com>
7371
7372 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7373
7374 2011-05-10 Cary Coutant <ccoutant@google.com>
7375
7376 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7377 strip_all (-s).
7378
7379 2011-05-06 Ian Lance Taylor <iant@google.com>
7380
7381 * layout.cc (Layout::layout): If the output section flags change,
7382 update the ordering.
7383
7384 2011-04-25 Cary Coutant <ccoutant@google.com>
7385
7386 * incremental-dump.cc (dump_incremental_inputs): Print local
7387 symbol info for each input file.
7388 * incremental.cc
7389 (Output_section_incremental_inputs::set_final_data_size): Add local
7390 symbol info to input file entries in incremental info.
7391 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7392 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7393 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7394 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7395 implementation.
7396 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7397 (Sized_incr_relobj::do_relocate): Write the local symbols.
7398 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7399 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7400 Adjust size of input file header.
7401 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7402 (Incremental_inputs_reader::get_local_symbol_count): New function.
7403 (Incremental_inputs_reader::get_input_section): Adjust size of input
7404 file header.
7405 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7406 (Sized_incr_relobj::This): New typedef.
7407 (Sized_incr_relobj::sym_size): New const data member.
7408 (Sized_incr_relobj::Local_symbol): New struct.
7409 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7410 (Sized_incr_relobj::do_local_symbol_offset): New function.
7411 (Sized_incr_relobj::local_symbol_count_): New data member.
7412 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7413 (Sized_incr_relobj::local_symbol_index_): New data member.
7414 (Sized_incr_relobj::local_symbol_offset_): New data member.
7415 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7416 (Sized_incr_relobj::local_symbols_): New data member.
7417 * object.h (Relobj::output_local_symbol_count): New function.
7418 (Relobj::local_symbol_offset): New function.
7419 (Relobj::do_output_local_symbol_count): New function.
7420 (Relobj::do_local_symbol_offset): New function.
7421 (Sized_relobj::do_output_local_symbol_count): New function.
7422 (Sized_relobj::do_local_symbol_offset): New function.
7423
7424 2011-04-22 Vladimir Simonov <sv@sw.ru>
7425
7426 * descriptors.cc (set_close_on_exec): New function.
7427 (Descriptors::open): Use set_close_on_exec.
7428 * output.cc (S_ISLNK): Define if not defined.
7429
7430 2011-04-22 Cary Coutant <ccoutant@google.com>
7431
7432 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7433 global symbol map.
7434 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7435 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7436 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7437 relocations.
7438 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7439 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7440 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7441 * incremental.h
7442 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7443 function.
7444 (Incremental_binary::apply_incremental_relocs): New function.
7445 (Incremental_binary::do_apply_incremental_relocs): New function.
7446 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7447 data member.
7448 (Sized_incremental_binary::add_global_symbol): New function.
7449 (Sized_incremental_binary::global_symbol): New function.
7450 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7451 (Sized_incremental_binary::symbol_map_): New data member.
7452 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7453 * target.h (Sized_target::apply_relocation): New function.
7454 * target-reloc.h (apply_relocation): New function.
7455 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7456
7457 2011-04-22 Doug Kwan <dougkwan@google.com>
7458
7459 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7460 flag of a SHT_ARM_EXIDX section.
7461 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7462 * testsuite/Makefile.in: Regenerate.
7463 * testsuite/arm_exidx_test.s: New file.
7464 * testsuite/arm_exidx_test.sh: Same.
7465
7466 2011-04-20 Cary Coutant <ccoutant@google.com>
7467
7468 PR gold/12689
7469 * archive.h (Incremental_archive_entry::Archive_member):
7470 Initialize arg_serial_ (second constructor).
7471
7472 2011-04-17 Ian Lance Taylor <iant@google.com>
7473
7474 * object.cc (Relocate_info::location): Simplify location string.
7475 * errors.cc (Errors::error_at_location): Don't print program
7476 name.
7477 (Errors::warning_at_location): Likewise.
7478 (Errors::undefined_symbol): Likewise.
7479 * testsuite/debug_msg.sh: Update accordingly.
7480
7481 2011-04-14 Cary Coutant <ccoutant@google.com>
7482
7483 * gold/layout.cc (Layout::symtab_section_offset): New function.
7484 * gold/layout.h (Layout::symtab_section_offset): New function.
7485 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7486
7487 2011-04-12 Ian Lance Taylor <iant@google.com>
7488
7489 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7490 with MREMAP_MAYMOVE.
7491 * output.h (class Output_file): Add map_is_allocated_ field.
7492 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7493 not available, provide stubs. If mremap is not available, #define
7494 it to gold_mremap.
7495 (MREMAP_MAYMOVE): Define if not defined.
7496 (Output_file::Output_file): Initialize map_is_allocated_.
7497 (Output_file::resize): Check map_is_allocated_.
7498 (Output_file::map_anonymous): If mmap fails, use malloc.
7499 (Output_file::unmap): Don't do anything for an anonymous map.
7500 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7501 is not available, provide stubs.
7502 (File_read::View::~View): Use free rather than delete[].
7503 (File_read::make_view): Use malloc rather than new[]. If mmap
7504 fails, use malloc.
7505 (File_read::find_or_make_view): Use malloc rather than new[].
7506 * gold.h: Remove HAVE_REMAP code.
7507 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7508 exists. Rename mremap to gold_mremap. If mmap is not available
7509 don't do anything.
7510 * configure, config.in: Rebuild.
7511
7512 2011-04-11 Ian Lance Taylor <iant@google.com>
7513
7514 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7515 initialize local variable v.
7516
7517 2011-04-11 Cary Coutant <ccoutant@google.com>
7518
7519 * archive.cc (Archive::include_member): Adjust call to
7520 report_object.
7521 (Add_archive_symbols::run): Track argument serial numbers.
7522 (Lib_group::include_member): Likewise.
7523 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7524 * archive.h (Incremental_archive_entry::Archive_member):
7525 Initialize arg_serial_.
7526 (Archive_member::arg_serial_): New data member.
7527 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7528 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7529 incremental link.
7530 (Sized_dynobj::do_for_all_local_got_entries): New function.
7531 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7532 function.
7533 * fileread.cc (get_mtime): New function.
7534 * fileread.h (get_mtime): New function.
7535 * gold.cc (queue_initial_tasks): Check for incremental update.
7536 (process_incremental_input): New function.
7537 (queue_middle_tasks): Don't force valid target for incremental
7538 update.
7539 * incremental-dump.cc (find_input_containing_global): Adjust
7540 size of symbol info entry.
7541 (dump_incremental_inputs): Dump argument serial number and
7542 in_system_directory flag; bias shndx by 1; print symbol names
7543 when dumping per-file symbol lists; use new symbol info readers.
7544 * incremental.cc
7545 (Output_section_incremental_inputs:update_data_size): New function.
7546 (Sized_incremental_binary::setup_readers): Setup input readers
7547 for each input file; build maps for files added from libraries
7548 and scripts.
7549 (Sized_incremental_binary::check_input_args): New function.
7550 (Sized_incremental_binary::do_check_inputs): Build map of argument
7551 serial numbers to input arguments.
7552 (Sized_incremental_binary::do_file_has_changed): Rename
7553 do_file_is_unchanged to this; compare file modification times.
7554 (Sized_incremental_binary::do_init_layout): New function.
7555 (Sized_incremental_binary::do_reserve_layout): New function.
7556 (Sized_incremental_binary::do_get_input_reader): Remove.
7557 (Sized_incremental_binary::get_symtab_view): New function.
7558 (Incremental_checker::can_incrementally_link_output_file): Remove.
7559 (Incremental_inputs::report_command_line): Exclude --debug options.
7560 (Incremental_inputs::report_archive_begin): Add parameter; track
7561 argument serial numbers; don't put input file entry for archive
7562 before archive members.
7563 (Incremental_inputs::report_archive_end): Put input file entry
7564 for archive after archive members.
7565 (Incremental_inputs::report_object): Add parameter; track argument
7566 serial numbers and in_system_directory flag.
7567 (Incremental_inputs::report_script): Add parameter; track argument
7568 serial numbers.
7569 (Output_section_incremental_inputs::set_final_data_size): Adjust
7570 size of symbol info entry; check for forwarding symbols.
7571 (Output_section_incremental_inputs::write_input_files): Write
7572 in_system_directory flag and argument serial number.
7573 (Output_section_incremental_inputs::write_info_blocks): Map section
7574 indices between incremental info and original input file; store
7575 input section index for each symbol.
7576 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7577 change operator() to visit().
7578 (class Global_got_offset_visitor): Likewise.
7579 (class Global_symbol_visitor_got_plt):
7580 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7581 classes.
7582 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7583 (Sized_incr_relobj::do_read_symbols): New function.
7584 (Sized_incr_relobj::do_layout): New function.
7585 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7586 (Sized_incr_relobj::do_add_symbols): New function.
7587 (Sized_incr_relobj::do_should_include_member): New function.
7588 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7589 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7590 (Sized_incr_relobj::do_section_size): New function.
7591 (Sized_incr_relobj::do_section_name): New function.
7592 (Sized_incr_relobj::do_section_contents): New function.
7593 (Sized_incr_relobj::do_section_flags): New function.
7594 (Sized_incr_relobj::do_section_entsize): New function.
7595 (Sized_incr_relobj::do_section_address): New function.
7596 (Sized_incr_relobj::do_section_type): New function.
7597 (Sized_incr_relobj::do_section_link): New function.
7598 (Sized_incr_relobj::do_section_info): New function.
7599 (Sized_incr_relobj::do_section_addralign): New function.
7600 (Sized_incr_relobj::do_initialize_xindex): New function.
7601 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7602 (Sized_incr_relobj::do_read_relocs): New function.
7603 (Sized_incr_relobj::do_gc_process_relocs): New function.
7604 (Sized_incr_relobj::do_scan_relocs): New function.
7605 (Sized_incr_relobj::do_count_local_symbols): New function.
7606 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7607 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7608 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7609 (Sized_incr_relobj::do_relocate): New function.
7610 (Sized_incr_relobj::do_set_section_offset): New function.
7611 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7612 (Sized_incr_dynobj::do_read_symbols): New function.
7613 (Sized_incr_dynobj::do_layout): New function.
7614 (Sized_incr_dynobj::do_add_symbols): New function.
7615 (Sized_incr_dynobj::do_should_include_member): New function.
7616 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7617 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7618 (Sized_incr_dynobj::do_section_size): New function.
7619 (Sized_incr_dynobj::do_section_name): New function.
7620 (Sized_incr_dynobj::do_section_contents): New function.
7621 (Sized_incr_dynobj::do_section_flags): New function.
7622 (Sized_incr_dynobj::do_section_entsize): New function.
7623 (Sized_incr_dynobj::do_section_address): New function.
7624 (Sized_incr_dynobj::do_section_type): New function.
7625 (Sized_incr_dynobj::do_section_link): New function.
7626 (Sized_incr_dynobj::do_section_info): New function.
7627 (Sized_incr_dynobj::do_section_addralign): New function.
7628 (Sized_incr_dynobj::do_initialize_xindex): New function.
7629 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7630 (make_sized_incremental_object): New function.
7631 (Incremental_library::copy_unused_symbols): New function.
7632 (Incremental_library::do_for_all_unused_symbols): New function.
7633 * incremental.h (enum Incremental_input_flags): New type.
7634 (class Incremental_checker): Remove.
7635 (Incremental_input_entry::Incremental_input_entry): Add argument
7636 serial number.
7637 (Incremental_input_entry::arg_serial): New function.
7638 (Incremental_input_entry::set_is_in_system_directory): New function.
7639 (Incremental_input_entry::is_in_system_directory): New function.
7640 (Incremental_input_entry::arg_serial_): New data member.
7641 (Incremental_input_entry::is_in_system_directory_): New data member.
7642 (class Script_info): Move here from script.h.
7643 (Script_info::Script_info): Add filename parameter.
7644 (Script_info::filename): New function.
7645 (Script_info::filename_): New data member.
7646 (Incremental_script_entry::Incremental_script_entry): Add argument
7647 serial number.
7648 (Incremental_object_entry::Incremental_object_entry): Likewise.
7649 (Incremental_object_entry::add_input_section): Build list of input
7650 sections with map to original shndx.
7651 (Incremental_object_entry::get_input_section_index): New function.
7652 (Incremental_object_entry::shndx_): New data member.
7653 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7654 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7655 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7656 serial number.
7657 (Incremental_inputs::report_archive_begin): Likewise.
7658 (Incremental_inputs::report_object): Likewise.
7659 (Incremental_inputs::report_script): Likewise.
7660 (class Incremental_global_symbol_reader): New class.
7661 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7662 and store flags and input file type.
7663 (Incremental_input_entry_reader::arg_serial): New function.
7664 (Incremental_input_entry_reader::type): Extract type from flags.
7665 (Incremental_input_entry_reader::is_in_system_directory): New function.
7666 (Incremental_input_entry_reader::get_input_section_count): Call
7667 accessor function for type.
7668 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7669 function for type; adjust size of global symbol entry.
7670 (Incremental_input_entry_reader::get_global_symbol_count): Call
7671 accessor function for type.
7672 (Incremental_input_entry_reader::get_object_count): Likewise.
7673 (Incremental_input_entry_reader::get_object_offset): Likewise.
7674 (Incremental_input_entry_reader::get_member_count): Likewise.
7675 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7676 (Incremental_input_entry_reader::get_member_offset): Likewise.
7677 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7678 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7679 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7680 (Incremental_input_entry_reader::get_global_symbol_reader): New
7681 function.
7682 (Incremental_input_entry_reader::get_output_symbol_index): New
7683 function.
7684 (Incremental_input_entry_reader::type_): Remove.
7685 (Incremental_input_entry_reader::flags_): New data member.
7686 (Incremental_inputs_reader::input_file_offset): New function.
7687 (Incremental_inputs_reader::input_file_index): New function.
7688 (Incremental_inputs_reader::input_file): Call input_file_offset.
7689 (Incremental_inputs_reader::input_file_at_offset): New function.
7690 (Incremental_relocs_reader::get_r_type): Reformat.
7691 (Incremental_relocs_reader::get_r_shndx): Reformat.
7692 (Incremental_relocs_reader::get_r_offset): Reformat.
7693 (Incremental_relocs_reader::data): New function.
7694 (Incremental_binary::Incremental_binary): Initialize new data members.
7695 (Incremental_binary::check_inputs): Add cmdline parameter.
7696 (Incremental_binary::file_is_unchanged): Remove.
7697 (Input_reader::arg_serial): New function.
7698 (Input_reader::get_unused_symbol_count): New function.
7699 (Input_reader::get_unused_symbol): New function.
7700 (Input_reader::do_arg_serial): New function.
7701 (Input_reader::do_get_unused_symbol_count): New function.
7702 (Input_reader::do_get_unused_symbol): New function.
7703 (Incremental_binary::input_file_count): New function.
7704 (Incremental_binary::get_input_reader): Change signature to use
7705 index instead of filename.
7706 (Incremental_binary::file_has_changed): New function.
7707 (Incremental_binary::get_input_argument): New function.
7708 (Incremental_binary::get_library): New function.
7709 (Incremental_binary::get_script_info): New function.
7710 (Incremental_binary::init_layout): New function.
7711 (Incremental_binary::reserve_layout): New function.
7712 (Incremental_binary::output_file): New function.
7713 (Incremental_binary::do_check_inputs): New function.
7714 (Incremental_binary::do_file_is_unchanged): Remove.
7715 (Incremental_binary::do_file_has_changed): New function.
7716 (Incremental_binary::do_init_layout): New function.
7717 (Incremental_binary::do_reserve_layout): New function.
7718 (Incremental_binary::do_input_file_count): New function.
7719 (Incremental_binary::do_get_input_reader): Change signature.
7720 (Incremental_binary::input_args_map_): New data member.
7721 (Incremental_binary::library_map_): New data member.
7722 (Incremental_binary::script_map_): New data member.
7723 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7724 new data members.
7725 (Sized_incremental_binary::output_section): New function.
7726 (Sized_incremental_binary::inputs_reader): Add const.
7727 (Sized_incremental_binary::symtab_reader): Add const.
7728 (Sized_incremental_binary::relocs_reader): Add const.
7729 (Sized_incremental_binary::got_plt_reader): Add const.
7730 (Sized_incremental_binary::get_symtab_view): New function.
7731 (Sized_incremental_binary::Inputs_reader): New typedef.
7732 (Sized_incremental_binary::Input_entry_reader): New typedef.
7733 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7734 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7735 (Sized_incremental_binary::do_file_has_changed): New function.
7736 (Sized_incremental_binary::do_init_layout): New function.
7737 (Sized_incremental_binary::do_reserve_layout): New function.
7738 (Sized_input_reader::Inputs_reader): Remove.
7739 (Sized_input_reader::Input_entry_reader): Remove.
7740 (Sized_input_reader::do_arg_serial): New function.
7741 (Sized_input_reader::do_get_unused_symbol_count): New function.
7742 (Sized_input_reader::do_get_unused_symbol): New function.
7743 (Sized_incremental_binary::do_input_file_count): New function.
7744 (Sized_incremental_binary::do_get_input_reader): Change signature;
7745 use index instead of filename.
7746 (Sized_incremental_binary::section_map_): New data member.
7747 (Sized_incremental_binary::input_entry_readers_): New data member.
7748 (class Sized_incr_relobj): New class.
7749 (class Sized_incr_dynobj): New class.
7750 (make_sized_incremental_object): New function.
7751 (class Incremental_library): New class.
7752 * layout.cc (Free_list::num_lists): New static data member.
7753 (Free_list::num_nodes): New static data member.
7754 (Free_list::num_removes): New static data member.
7755 (Free_list::num_remove_visits): New static data member.
7756 (Free_list::num_allocates): New static data member.
7757 (Free_list::num_allocate_visits): New static data member.
7758 (Free_list::init): New function.
7759 (Free_list::remove): New function.
7760 (Free_list::allocate): New function.
7761 (Free_list::dump): New function.
7762 (Free_list::print_stats): New function.
7763 (Layout_task_runner::run): Resize output file for incremental updates.
7764 (Layout::Layout): Initialize new data members.
7765 (Layout::set_incremental_base): New function.
7766 (Layout::init_fixed_output_section): New function.
7767 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7768 incremental updates.
7769 (Layout::create_gold_note): Do not create gold note section for
7770 incremental updates.
7771 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7772 for incremental updates.
7773 (Layout::set_section_offsets): For incremental updates, allocate space
7774 from free list.
7775 (Layout::create_symtab_sections): Layout with offsets relative to
7776 start of section; for incremental updates, allocate space from free
7777 list.
7778 (Layout::create_shdrs): For incremental updates, allocate space from
7779 free list.
7780 (Layout::finish_dynamic_section): For incremental updates, do not
7781 check --as-needed (fixed in subsequent patch).
7782 * layout.h (class Free_list): New class.
7783 (Layout::set_incremental_base): New function.
7784 (Layout::incremental_base): New function.
7785 (Layout::init_fixed_output_section): New function.
7786 (Layout::allocate): New function.
7787 (Layout::incremental_base_): New data member.
7788 (Layout::free_list_): New data member.
7789 * main.cc (main): Print Free_list statistics.
7790 * object.cc (Relobj::finalize_incremental_relocs): Add
7791 clear_counts parameter; clear counts only when clear_counts is set.
7792 (Sized_relobj::Sized_relobj): Initialize new base class.
7793 (Sized_relobj::do_layout): Don't report special sections.
7794 (Sized_relobj::do_for_all_local_got_entries): New function.
7795 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7796 symtab_off to all symbol table offsets.
7797 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7798 * object.h (class Got_offset_list): Move to top of file.
7799 (Object::Object): Allow case where input_file == NULL.
7800 (Object::~Object): Likewise.
7801 (Object::input_file): Assert that input_file != NULL.
7802 (Object::lock): Allow case where input_file == NULL.
7803 (Object::unlock): Likewise.
7804 (Object::is_locked): Likewise.
7805 (Object::token): Likewise.
7806 (Object::release): Likewise.
7807 (Object::is_incremental): New function.
7808 (Object::get_mtime): New function.
7809 (Object::for_all_local_got_entries): New function.
7810 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7811 (Object::set_is_in_system_directory): New function.
7812 (Object::is_in_system_directory): New function.
7813 (Object::do_is_incremental): New function.
7814 (Object::do_get_mtime): New function.
7815 (Object::do_for_all_local_got_entries): New function.
7816 (Object::is_in_system_directory_): New data member.
7817 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7818 (class Sized_relobj_base): New class.
7819 (class Sized_relobj): Derive from Sized_relobj_base.
7820 (class Sized_relobj::Symbols): Redeclare from base class.
7821 (class Sized_relobj::local_got_offset_list): Remove.
7822 (class Sized_relobj::Output_sections): Redeclare from base class.
7823 (class Sized_relobj::do_for_all_local_got_entries): New function.
7824 (class Sized_relobj::write_local_symbols): Add offset parameter.
7825 (class Sized_relobj::local_symbol_offset_): Update comment.
7826 (class Sized_relobj::local_dynsym_offset_): Update comment.
7827 * options.cc (Input_arguments::add_file): Remove const.
7828 * options.h (Input_file_argument::Input_file_argument):
7829 Initialize arg_serial_ (all constructors).
7830 (Input_file_argument::set_arg_serial): New function.
7831 (Input_file_argument::arg_serial): New function.
7832 (Input_file_argument::arg_serial_): New data member.
7833 (Input_arguments::Input_arguments): Initialize file_count_.
7834 (Input_arguments::add_file): Remove const.
7835 (Input_arguments::number_of_input_files): New function.
7836 (Input_arguments::file_count_): New data member.
7837 (Command_line::number_of_input_files): Call
7838 Input_arguments::number_of_input_files.
7839 * output.cc (Output_segment_headers::Output_segment_headers):
7840 Set current size.
7841 (Output_section::Input_section::current_data_size): New function.
7842 (Output_section::Output_section): Initialize new data members.
7843 (Output_section::add_input_section): Don't do merge sections for
7844 an incremental link; allocate space from free list for an
7845 incremental update.
7846 (Output_section::add_output_section_data): Allocate space from
7847 free list for an incremental update.
7848 (Output_section::update_data_size): New function.
7849 (Output_section::set_fixed_layout): New function.
7850 (Output_section::reserve): New function.
7851 (Output_segment::set_section_addresses): Remove const.
7852 (Output_segment::set_section_list_addresses): Remove const; allocate
7853 space from free list for an incremental update.
7854 (Output_segment::set_offset): Adjust size of RELRO segment for an
7855 incremental update.
7856 * output.h (Output_data::current_data_size): Move here from
7857 child classes.
7858 (Output_data::pre_finalize_data_size): New function.
7859 (Output_data::update_data_size): New function.
7860 (Output_section_headers::update_data_size): new function.
7861 (Output_section_data_build::current_data_size): Move to Output_data.
7862 (Output_data_strtab::update_data_size): New function.
7863 (Output_section::current_data_size): Move to Output_data.
7864 (Output_section::set_fixed_layout): New function.
7865 (Output_section::has_fixed_layout): New function.
7866 (Output_section::reserve): New function.
7867 (Output_section::update_data_size): New function.
7868 (Output_section::has_fixed_layout_): New data member.
7869 (Output_section::free_list_): New data member.
7870 (Output_segment::set_section_addresses): Remove const.
7871 (Output_segment::set_section_list_addresses): Remove const.
7872 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7873 New function.
7874 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7875 New function.
7876 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7877 parameter when calling Add_symbols constructor; store argument
7878 serial number for members of a lib group.
7879 (Add_symbols::locks): Allow case where token == NULL.
7880 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7881 (Read_member::~Read_member): New function.
7882 (Read_member::is_runnable): New function.
7883 (Read_member::locks): New function.
7884 (Read_member::run): New function.
7885 (Check_script::~Check_script): New function.
7886 (Check_script::is_runnable): New function.
7887 (Check_script::locks): New function.
7888 (Check_script::run): New function.
7889 (Check_library::~Check_library): New function.
7890 (Check_library::is_runnable): New function.
7891 (Check_library::locks): New function.
7892 (Check_library::run): New function.
7893 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7894 (Add_symbols::library_): New data member.
7895 (class Read_member): New class.
7896 (class Check_script): New class.
7897 (class Check_library): New class.
7898 * reloc.cc (Read_relocs::is_runnable): Allow case where
7899 token == NULL.
7900 (Read_relocs::locks): Likewise.
7901 (Scan_relocs::locks): Likewise.
7902 (Relocate_task::locks): Likewise.
7903 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7904 to clear counters.
7905 (Sized_relobj::incremental_relocs_scan): Fix comment.
7906 (Sized_relobj::do_relocate): Pass output file offset to
7907 write_local_symbols.
7908 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7909 from class declaration.
7910 * script.cc (read_input_script): Allocate Script_info; pass
7911 argument serial number to report_script.
7912 * script.h (class Script_info): Move to incremental.h.
7913 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7914 * symtab.h (Symbol_table::add_from_incrobj): New function.
7915 (Symbol_table::set_file_offset): New function.
7916
7917 2011-04-05 Cary Coutant <ccoutant@google.com>
7918
7919 * incremental-dump.cc (dump_incremental_inputs): Change signature
7920 to take a Sized_incremental_binary; change caller. Use readers
7921 in Sized_incremental_binary.
7922 * incremental.cc
7923 (Sized_incremental_binary::find_incremental_inputs_sections):
7924 Rename do_find_incremental_inputs_sections to this.
7925 (Sized_incremental_binary::setup_readers): New function.
7926 (Sized_incremental_binary::do_check_inputs): Check
7927 has_incremental_info_ flag; move setup code to setup_readers;
7928 use input readers.
7929 (Sized_incremental_binary::do_file_is_unchanged): New function.
7930 (Sized_incremental_binary::do_get_input_reader): New function.
7931 * incremental.h (class Incremental_binary): Move to end of file.
7932 (Incremental_binary::file_is_unchanged): New function.
7933 (Incremental_binary::do_file_is_unchanged): New function.
7934 (Incremental_binary::Input_reader): New class.
7935 (Incremental_binary::get_input_reader): New function.
7936 (class Sized_incremental_binary): Move to end of file.
7937 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7938 input section reader classes.
7939 (Sized_incremental_binary::has_incremental_info): New function.
7940 (Sized_incremental_binary::inputs_reader): New function.
7941 (Sized_incremental_binary::symtab_reader): New function.
7942 (Sized_incremental_binary::relocs_reader): New function.
7943 (Sized_incremental_binary::got_plt_reader): New function.
7944 (Sized_incremental_binary::do_file_is_unchanged): New function.
7945 (Sized_incremental_binary::Sized_input_reader): New class.
7946 (Sized_incremental_binary::get_input_reader): New function.
7947 (Sized_incremental_binary::find_incremental_inputs_sections):
7948 Rename do_find_incremental_inputs_sections to this.
7949 (Sized_incremental_binary::setup_readers): New function.
7950 (Sized_incremental_binary::has_incremental_info_): New data member.
7951 (Sized_incremental_binary::inputs_reader_): New data member.
7952 (Sized_incremental_binary::symtab_reader_): New data member.
7953 (Sized_incremental_binary::relocs_reader_): New data member.
7954 (Sized_incremental_binary::got_plt_reader_): New data member.
7955 (Sized_incremental_binary::current_input_file_): New data member.
7956
7957 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7958
7959 PR gold/12640
7960 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7961 violation.
7962
7963 2011-03-30 Cary Coutant <ccoutant@google.com>
7964
7965 * archive.cc (Archive::include_member): Adjust call to report_object.
7966 (Add_archive_symbols::run): Add script_info to call to
7967 report_archive_begin.
7968 (Lib_group::include_member): Adjust call to report_object.
7969 (Add_lib_group_symbols::run): Adjust call to report_object.
7970 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7971 blocks. Add object count for script input files.
7972 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7973 script_info parameter; change all callers.
7974 (Incremental_inputs::report_object): Add script_info parameter;
7975 change all callers.
7976 (Incremental_inputs::report_script): Store backpointer to
7977 incremental info entry.
7978 (Output_section_incremental_inputs::set_final_data_size): Record
7979 additional information for scripts.
7980 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7981 * incremental.h (Incremental_script_entry::add_object): New function.
7982 (Incremental_script_entry::get_object_count): New function.
7983 (Incremental_script_entry::get_object): New function.
7984 (Incremental_script_entry::objects_): New data member; adjust
7985 constructor.
7986 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7987 (Incremental_inputs::report_object): Add script_info parameter.
7988 (Incremental_inputs_reader::get_object_count): New function.
7989 (Incremental_inputs_reader::get_object_offset): New function.
7990 * options.cc (Input_arguments::add_file): Return reference to
7991 new input argument.
7992 * options.h (Input_argument::set_script_info): New function.
7993 (Input_argument::script_info): New function.
7994 (Input_argument::script_info_): New data member; adjust all
7995 constructors.
7996 (Input_file_group::add_file): Return reference to new input argument.
7997 (Input_file_lib::add_file): Likewise.
7998 (Input_arguments::add_file): Likewise.
7999 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8000 * script.cc (Parser_closure::Parser_closure): Add script_info
8001 parameter; adjust all callers.
8002 (Parser_closure::script_info): New function.
8003 (Parser_closure::script_info_): New data member.
8004 (read_input_script): Report scripts earlier to incremental info.
8005 (script_add_file): Set script_info in Input_argument.
8006 (script_add_library): Likewise.
8007 * script.h (Script_options::Script_info): Rewrite class.
8008
8009 2011-03-29 Cary Coutant <ccoutant@google.com>
8010
8011 * archive.cc (Library_base::should_include_member): Move
8012 method here from class Archive.
8013 (Archive::Archive): Initialize base class.
8014 (Archive::should_include_member): Move to base class.
8015 (Archive::do_for_all_unused_symbols): New function.
8016 (Add_archive_symbols::run): Remove redundant access to
8017 incremental_inputs.
8018 (Lib_group::Lib_group): Initialize base class.
8019 (Lib_group::do_filename): New function.
8020 (Lib_group::include_member): Pass pointer to Lib_group to
8021 report_object.
8022 (Lib_group::do_for_all_unused_symbols): New function.
8023 (Add_lib_group_symbols::run): Report archive information for
8024 incremental links.
8025 * archive.h (class Library_base): New base class.
8026 (class Archive): Derive from Library_base.
8027 (Archive::filename): Move to base class.
8028 (Archive::set_incremental_info): Likewise.
8029 (Archive::incremental_info): Likewise.
8030 (Archive::Should_include): Likewise.
8031 (Archive::should_include_member): Likewise.
8032 (Archive::Armap_entry): Remove.
8033 (Archive::Unused_symbol_iterator): Remove.
8034 (Archive::unused_symbols_begin): Remove.
8035 (Archive::unused_symbols_end): Remove.
8036 (Archive::do_filename): New function.
8037 (Archive::do_get_mtime): New function.
8038 (Archive::do_for_all_unused_symbols): New function.
8039 (Archive::task_): Move to base class.
8040 (Archive::incremental_info_): Likewise.
8041 (class Lib_group): Derive from Library_base.
8042 (Lib_group::do_filename): New function.
8043 (Lib_group::do_get_mtime): New function.
8044 (Lib_group::do_for_all_unused_symbols): New function.
8045 (Lib_group::task_): Move to base class.
8046 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8047 function.
8048 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8049 function.
8050 * incremental.cc (Incremental_inputs::report_archive_begin):
8051 Use Library_base; call library's get_mtime; add incremental inputs
8052 entry before members.
8053 (class Unused_symbol_visitor): New class.
8054 (Incremental_inputs::report_archive_end): Use Library_base; use
8055 visitor class to record unused symbols; don't add incremental inputs
8056 entry after members.
8057 (Incremental_inputs::report_object): Use Library_base.
8058 * incremental.h
8059 (Incremental_archive_entry::Incremental_archive_entry): Remove
8060 unused Archive parameter.
8061 (Incremental_inputs::report_archive_begin): Use Library_base.
8062 (Incremental_inputs::report_archive_end): Likewise.
8063 (Incremental_inputs::report_object): Likewise.
8064 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8065 function.
8066 * object.h (Object::for_all_global_symbols): New function.
8067 (Object::do_for_all_global_symbols): New function.
8068 (Sized_relobj::do_for_all_global_symbols): New function.
8069 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8070 function.
8071 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8072 function.
8073
8074 2011-03-27 Ian Lance Taylor <iant@google.com>
8075
8076 * archive.cc (Archive::interpret_header): Return -1 if something
8077 goes wrong. Change callers accordingly.
8078
8079 2011-03-25 Cary Coutant <ccoutant@google.com>
8080
8081 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8082 * testsuite/Makefile.in: Regenerate.
8083
8084 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8085
8086 * plugin.cc (get_view): New.
8087 (Plugin::load): Pass get_view to the plugin.
8088 (Plugin_manager::get_view): New.
8089
8090 2011-03-21 Ian Lance Taylor <iant@google.com>
8091
8092 * testsuite/final_layout.sh: Rewrite to not use dc.
8093 * testsuite/relro_test.sh: Fail if dc is not present.
8094
8095 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8096
8097 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8098 Change == to -eq.
8099 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8100 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8101 Change == to -eq.
8102 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8103 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8104
8105 2011-03-14 Ian Lance Taylor <iant@google.com>
8106
8107 * script-sections.cc (Sort_output_sections::script_compare):
8108 Rename from is_before, change return type.
8109 (Sort_output_sections::operator()): Adjust accordingly.
8110
8111 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8112
8113 PR gold/12572
8114 * testsuite/odr_violation2.cc: Add comment to make all error line
8115 numbers double digits.
8116 * testsuite/debug_msg.sh: Adjust expected errors.
8117
8118 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8119
8120 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8121 but mark earlier ones as non-canonical
8122 (offset_to_iterator): Update search target and example
8123 (do_addr2line): Return extra lines in a vector*
8124 (format_file_lineno): Extract from do_addr2line
8125 (one_addr2line): Add vector* out-param
8126 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8127 when a lineno entry appeared last for its instruction
8128 (Dwarf_line_info): Add vector* out-param
8129 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8130 * symtab.cc (Odr_violation_compare): Include the lineno in the
8131 comparison again.
8132 (linenos_from_loc): New. Combine the canonical line for an
8133 address with its other lines.
8134 (True_if_intersect): New. Helper functor to make
8135 std::set_intersection a query.
8136 (detect_odr_violations): Compare sets of lines instead of just
8137 one line for each function. This became less deterministic, but
8138 has fewer false positives.
8139 * symtab.h: Declarations.
8140 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8141 mix an optimized and non-optimized object in the same binary
8142 (odr_violation2.so): Same.
8143 * testsuite/Makefile.in: Regenerate from Makefile.am.
8144 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8145 * testsuite/debug_msg.sh: Update line numbers and add
8146 assertions.
8147 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8148 non-optimized context.
8149 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8150 isn't inlined, and use OdrDerived in an optimized context.
8151 * testsuite/odr_header1.h: Defines OdrDerived, where
8152 optimization will change the
8153 first-instruction-in-the-destructor's file and line number.
8154 * testsuite/odr_header2.h: Defines OdrBase.
8155
8156 2011-03-09 Ian Lance Taylor <iant@google.com>
8157
8158 * fileread.cc (File_read::clear_views): Don't delete the whole
8159 file view.
8160
8161 2011-03-08 Ian Lance Taylor <iant@google.com>
8162
8163 PR gold/12525
8164 * fileread.cc: #include <climits>.
8165 (GOLD_IOV_MAX): Define.
8166 (File_read::read_multiple): Limit number of entries by iov_max.
8167 * fileread.h (class File_read): Always set max_readv_entries to
8168 128.
8169
8170 2011-03-07 Ian Lance Taylor <iant@google.com>
8171
8172 PR gold/12525
8173 * options.h (class General_options): Add -dy and -dn.
8174
8175 2011-03-02 Cary Coutant <ccoutant@google.com>
8176
8177 * testsuite/script_test_9.t: Add TLS segment.
8178
8179 2011-03-02 Simon Baldwin <simonb@google.com>
8180
8181 * configure.ac: Add check for gnu_indirect_function support in
8182 the toolchain building binutils.
8183 * configure: Rebuild.
8184
8185 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8186
8187 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8188 plugin only symbols.
8189 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8190 in plugin files as not needed in the symbol table.
8191
8192 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8193
8194 * output.cc (Output_section::add_input_section): Delay fill
8195 generation for section ordering.
8196
8197 2011-02-09 Ian Lance Taylor <iant@google.com>
8198
8199 PR gold/12316
8200 * object.h (class Sized_relobj): Remove clear_local_symbols.
8201 * reloc.cc (Sized_relobj::do_relocate): Don't call
8202 clear_local_symbols.
8203
8204 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8205
8206 * plugin.cc (is_visible_from_outside): Return true for symbols
8207 in the -u option.
8208
8209 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8210
8211 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8212 filename.
8213
8214 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8215
8216 * icf.h (is_section_foldable_candidate): Change type of parameter
8217 to std::string.
8218 * icf.cc (Icf::find_identical_sections): Change type of local variable
8219 section_name to be std::string.
8220 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8221
8222 2011-01-25 Ian Lance Taylor <iant@google.com>
8223
8224 * script.cc (script_add_extern): Rewrite to use
8225 add_symbol_reference.
8226
8227 2011-01-25 Doug Kwan <dougkwan@google.com>
8228
8229 * icf.cc (get_section_contents): Always lock section's object.
8230
8231 2011-01-24 Ian Lance Taylor <iant@google.com>
8232
8233 * options.h (class General_options): Accept
8234 --no-detect-odr-violations.
8235
8236 2011-01-24 Ian Lance Taylor <iant@google.com>
8237
8238 * version.cc (version_string): Bump to 1.11.
8239
8240 2011-01-24 Ian Lance Taylor <iant@google.com>
8241
8242 * plugin.cc (class Plugin_rescan): Define new class.
8243 (Plugin_manager::claim_file): Set any_claimed_.
8244 (Plugin_manager::save_archive): New function.
8245 (Plugin_manager::save_input_group): New function.
8246 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8247 necessary.
8248 (Plugin_manager::new_undefined_symbol): New function.
8249 (Plugin_manager::rescan): New function.
8250 (Plugin_manager::rescannable_defines): New function.
8251 (Plugin_manager::add_input_file): Set any_added_.
8252 * plugin.h (class Plugin_manager): define new fields rescannable_,
8253 undefined_symbols_, any_claimed_, and any_added_. Declare
8254 Plugin_rescan as friend. Declare new functions.
8255 (Plugin_manager::Rescannable): Define type.
8256 (Plugin_manager::Rescannable_list): Define type.
8257 (Plugin_manager::Undefined_symbol_list): Define type.
8258 (Plugin_manager::Plugin_manager): Initialize new fields.
8259 * archive.cc (Archive::defines_symbol): New function.
8260 (Add_archive_symbols::run): Pass archive to plugins if any.
8261 * archive.h (class Archive): Declare defines_symbol.
8262 * readsyms.cc (Input_group::~Input_group): New function.
8263 (Finish_group::run): Pass input_group to plugins if any.
8264 * readsyms.h (class Input_group): Declare destructor.
8265 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8266 any.
8267
8268 2011-01-10 Ian Lance Taylor <iant@google.com>
8269
8270 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8271 section as relro.
8272 (Layout::set_segment_offsets): Reset increase_relro before calling
8273 set_section_addresses a second time.
8274
8275 2011-01-04 Cary Coutant <ccoutant@google.com>
8276
8277 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8278 sections before NOBITS sections.
8279
8280 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8281
8282 * version.cc (print_version): Update copyright to 2011.
8283
8284 2010-12-23 Cary Coutant <ccoutant@google.com>
8285
8286 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8287 of OS to this->add. Add OD parameter to second form of the function.
8288
8289 2010-12-20 Ian Lance Taylor <iant@google.com>
8290
8291 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8292 second of two consecutive entries with same offset.
8293
8294 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8295
8296 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8297 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8298 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8299 to avoid unneeded links against $(LDADD).
8300 * testsuite/Makefile.in: Regenerate.
8301
8302 2010-12-15 Ian Lance Taylor <iant@google.com>
8303
8304 PR gold/12324
8305 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8306 for R_X86_64_32 and R_X86_64_PC32.
8307 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8308 ver_matching_def_pic.o.
8309 (ver_matching_def_pic.o): New target.
8310
8311 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8312
8313 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8314 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8315 Move definition before File_read::View member definitions.
8316 (File_read::View::~View): Initialize and hold lock before
8317 updating current_mapped_bytes.
8318
8319 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8320
8321 * dwarf_reader.cc: Remove outdated comment.
8322 * gold-threads.cc: Fix typo in error message.
8323 * archive.cc: Fix typos in comments.
8324 * archive.h: Likewise.
8325 * arm-reloc-property.cc: Likewise.
8326 * arm-reloc-property.h: Likewise.
8327 * arm-reloc.def: Likewise.
8328 * arm.cc: Likewise.
8329 * attributes.h: Likewise.
8330 * cref.cc: Likewise.
8331 * ehframe.cc: Likewise.
8332 * fileread.h: Likewise.
8333 * gold.h: Likewise.
8334 * i386.cc: Likewise.
8335 * icf.cc: Likewise.
8336 * incremental.h: Likewise.
8337 * int_encoding.cc: Likewise.
8338 * layout.h: Likewise.
8339 * main.cc: Likewise.
8340 * merge.h: Likewise.
8341 * object.cc: Likewise.
8342 * object.h: Likewise.
8343 * options.cc: Likewise.
8344 * readsyms.cc: Likewise.
8345 * reduced_debug_output.cc: Likewise.
8346 * reloc.cc: Likewise.
8347 * script-sections.cc: Likewise.
8348 * sparc.cc: Likewise.
8349 * symtab.h: Likewise.
8350 * target-reloc.h: Likewise.
8351 * target.cc: Likewise.
8352 * target.h: Likewise.
8353 * timer.cc: Likewise.
8354 * timer.h: Likewise.
8355 * x86_64.cc: Likewise.
8356
8357 2010-12-09 Cary Coutant <ccoutant@google.com>
8358
8359 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8360 stack.
8361 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8362 parameter; change all callers.
8363 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8364 * options.h (warn_execstack): New option.
8365
8366 2010-12-07 Doug Kwan <dougkwan@google.com>
8367
8368 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8369 like function call relocations.
8370
8371 2010-12-07 Ian Lance Taylor <iant@google.com>
8372
8373 * archive.cc (Archive::get_elf_object_for_member): Permit
8374 punconfigured to be NULL.
8375 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8376 (Archive::include_member): Pass NULL to get_elf_object_for_member
8377 if we searched for the archive and this is the first included
8378 object.
8379
8380 2010-12-01 Ian Lance Taylor <iant@google.com>
8381
8382 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8383 track_relocs_type_ field.
8384 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8385 Set track_relocs_type_.
8386 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8387 contents when using RELA relocs.
8388 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8389 reloc_map_.
8390 * reloc.cc (Track_relocs::next_addend): New function.
8391 * reloc.h (class Track_relocs): Declare next_addend.
8392
8393 2010-12-01 Ian Lance Taylor <iant@google.com>
8394
8395 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8396 virtual destructor.
8397
8398 2010-12-01 Ian Lance Taylor <iant@google.com>
8399
8400 * README: Update compilers known to work and fail.
8401
8402 2010-11-23 Matthias Klose <doko@ubuntu.com>
8403
8404 * configure.in: For --enable-gold, handle value `default' instead of
8405 `both*'. Always install ld as ld.bfd, install as ld if gold is
8406 not the default.
8407 * configure: Regenerate.
8408
8409 2010-11-18 Doug Kwan <dougkwan@google.com>
8410
8411 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8412 and right_alignment to be zero. Store result alignment only if it is
8413 greater than existing alignment.
8414
8415 2010-11-16 Cary Coutant <ccoutant@google.com>
8416
8417 PR gold/12220
8418 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8419 Check for ".zdebug_line".
8420
8421 2010-11-16 Doug Kwan <dougkwan@google.com>
8422 Cary Coutant <ccoutant@google.com>
8423
8424 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8425 by reference; adjust all callers.
8426 * output.cc (Output_segment::set_section_addresses): Adjust references
8427 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8428 list is empty.
8429 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8430 end at page boundary.
8431
8432 2010-11-16 Cary Coutant <ccoutant@google.com>
8433
8434 PR gold/12220
8435 * layout.cc (Layout::choose_output_section): Transform names of
8436 compressed sections even when using a script with a SECTIONS clause.
8437 (Layout::output_section_name): Remove code to transform
8438 compressed debug section names.
8439 * output.cc (Output_section::add_input_section): Use uncompressed
8440 section size when tracking input sections.
8441
8442 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8443
8444 * symtab.h (Symbol::NON_PIC_REF): Remove.
8445 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8446 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8447 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8448 (Symbol::use_plt_offset): Take a flags argument and pass it
8449 directly to needs_dynamic_reloc. Restrict check for undefined
8450 weak symbols to function calls.
8451 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8452 (Target_arm::Scan::global): Use it.
8453 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8454 (Target_arm::Relocate::relocate): Likewise.
8455 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8456 parameter with an r_type parameter. Use get_reference_flags
8457 to get the flags.
8458 (Target_arm::Relocate::relocate): Update accordingly.
8459 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8460 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8461 (Target_i386::Scan::global): Likewise.
8462 (Target_i386::Relocate::relocate): Likewise.
8463 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8464 parameter with an r_type parameter. Use get_reference_flags
8465 to get the flags.
8466 (Target_i386::Relocate::relocate): Update accordingly.
8467 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8468 (Target_powerpc::Scan::global): Use it.
8469 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8470 (Target_powerpc::Relocate::relocate): Likewise.
8471 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8472 (Target_sparc::Scan::global): Use it.
8473 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8474 (Target_sparc::Relocate::relocate): Likewise.
8475 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8476 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8477 (Target_x86_64::Scan::global): Likewise.
8478 (Target_x86_64::Relocate::relocate): Likewise.
8479
8480 2010-11-08 Doug Kwan <dougkwan@google.com>
8481 Cary Coutant <ccoutant@google.com>
8482
8483 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8484 (Arm_exidx_merge_section::section_contents_): New data member.
8485 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8486 (Arm_input_section::~Arm_input_section): De-allocate memory.
8487 (Arm_input_section::original_contents_): New data member.
8488 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8489 in parameters instead of calling Object::section_contents without
8490 locking.
8491 (Arm_output_section::group_section): New parameter TASK. Pass it
8492 to callees that need locking objects.
8493 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8494 to lock EXIDX input sections. Fix a formatting issue. Call
8495 Arm_exidx_merged_section::build_contents to create merged section
8496 contents.
8497 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8498 to lock object of stub table owner.
8499 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8500 TEXT_SIZE to initialize data member TEXT_SIZE_.
8501 (Arm_exidx_input_section::addralign): Fix typo in comment.
8502 (Arm_exidx_input_section::text_size): New method.
8503 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8504 that require locking objects. Lock objects before scanning for stubs
8505 and updating local symbols.
8506 (Arm_input_section<big_endian>::init): Copy contents of original
8507 input section.
8508 (Arm_input_section<big_endian>::do_write): Use saved contents of
8509 original input section instead of calling Object::section_contents
8510 without locking.
8511 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8512 size without calling Object::section_size().
8513 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8514 for size. Allocate a buffer for merged EXIDX entries.
8515 (Arm_exidx_merged_section::build_contents): New method.
8516 (Arm_exidx_merged_section::do_write): Move merge section contents
8517 building code to Arm_exidx_merged_section::build_contetns. Write
8518 out contetns in buffer instead of building it on the fly.
8519 (Arm_relobj::make_exidx_input_section): Also pass text section size
8520 to Arm_exidx_input_section constructor.
8521 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8522 (Arm_dynobj::do_read_symbols): Fix memory leak.
8523 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8524 * target.h: (class Task): Add forward declaration.
8525 (Target::relax): Add new parameter TASK and pass it to
8526 Target::do_relax().
8527 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8528
8529 2010-11-05 Cary Coutant <ccoutant@google.com>
8530
8531 PR gold/10708
8532 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8533 object when reading from the file.
8534 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8535 second layout pass.
8536 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8537 when reading section contents.
8538 (get_section_contents): Likewise.
8539 (icf::find_identical_sections): Likewise.
8540 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8541 object when reading from the file.
8542 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8543 the object when doing deferred section layout.
8544
8545 2010-11-03 Nick Clifton <nickc@redhat.com>
8546
8547 PR gold/12001
8548 * script.h (class Symbol_assignment: name): New member. Returns
8549 the name of the symbol.
8550 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8551 Returns true if the given symbol name is on the list of
8552 assignments wating to be processed.
8553 * archive.cc (should_incldue_member): If the symbol is undefined,
8554 check to see if it is on the list of symbols pending assignment.
8555
8556 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8557
8558 * script-sections.cc (Script_sections::find_memory_region): Check
8559 for a NULL output section pointer.
8560
8561 2010-10-29 Doug Kwan <dougkwan@google.com>
8562
8563 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8564 Output_section::add_relaxed_input_section.
8565 * output.cc (Output_section::add_relaxed_input_section): Add new
8566 arguments LAYOUT and NAME. Set section order index.
8567 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8568 Copy section order index.
8569 * output.h (Output_section::add_relaxed_input_section): Add new
8570 arguments LAYOUT and NAME.
8571
8572 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8573
8574 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8575 NATIVE_OR_CROSS_LINKER.
8576 * testsuite/Makefile.in: Regenerate.
8577
8578 2010-10-20 Doug Kwan <dougkwan@google.com>
8579
8580 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8581 without SHF_LINK_ORDER flags.
8582 * layout.cc (Layout::choose_output_section): Do not filter
8583 SHF_LINK_ORDER flag in a relocatable link.
8584
8585 2010-10-17 Cary Coutant <ccoutant@google.com>
8586
8587 * output.h (Output_segment::set_section_addresses): Change function
8588 signature. Update all callers.
8589 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8590 sections.
8591 (Output_segment::set_section_addresses): Align after last TLS
8592 section. Add padding before last relro section instead of after.
8593
8594 2010-10-17 Doug Kwan <dougkwan@google.com>
8595
8596 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8597 GOT output section to be writable.
8598
8599 2010-10-14 Cary Coutant <ccoutant@google.com>
8600
8601 * debug.h (DEBUG_INCREMENTAL): New flag.
8602 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8603 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8604 mode.
8605 * incremental.cc (report_command_line): Ignore all forms of
8606 --incremental.
8607 * layout.cc (Layout::Layout): Check parameters for incremental link
8608 mode.
8609 * options.cc (General_options::parse_incremental): New function.
8610 (General_options::parse_no_incremental): New function.
8611 (General_options::parse_incremental_full): New function.
8612 (General_options::parse_incremental_update): New function.
8613 (General_options::incremental_mode_): New data member.
8614 (General_options::finalize): Check incremental_mode_.
8615 * options.h (General_options): Update help text for --incremental.
8616 Add --no-incremental, --incremental-full, --incremental-update.
8617 (General_options::Incremental_mode): New enum type.
8618 (General_options::incremental_mode): New function.
8619 (General_options::incremental_mode_): New data member.
8620 * parameters.cc (Parameters::incremental_mode_): New data member.
8621 (Parameters::set_options): Set incremental_mode_.
8622 (Parameters::set_incremental_full): New function.
8623 (Parameters::incremental): New function.
8624 (Parameters::incremental_update): New function.
8625 (set_parameters_incremental_full): New function.
8626 * parameters.h (Parameters::set_incremental_full): New function.
8627 (Parameters::incremental): New function.
8628 (Parameters::incremental_update): New function.
8629 (Parameters::incremental_mode_): New data member.
8630 (set_parameters_incremental_full): New function.
8631 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8632 incremental link mode.
8633 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8634 (Sized_relobj::do_relocate_sections): Likewise.
8635 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8636 option.
8637 * testsuite/Makefile.in: Regenerate.
8638 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8639
8640 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8641
8642 * script-sections.h (class Script_sections): Make
8643 Sections_elements typedef public.
8644 * script-sections.cc (class Sort_output_sections): Add elements_
8645 field. Add constructor which sets it; change all callers.
8646 (Sort_output_sections::is_before): New function.
8647 (Sort_output_sections::operator()): Call is_before.
8648 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8649 conditional.
8650 * testsuite/script_test_10.sh: New test. Test script section
8651 order.
8652 * testsuite/script_test_10.t: Likewise.
8653 * testsuite/script_test_10.s: Likewise.
8654 * testsuite/Makefile.am: Wrap the cross linker tests and the
8655 common tests into NATIVE_OR_CROSS_LINKER.
8656 (check_SCRIPTS): Add script_test_10.sh.
8657 (check_DATA): Add script_test_10.stdout.
8658 (script_test_10.o, script_test_10): New targets.
8659 (script_test_10.stdout): New target.
8660 * configure, testsuite/Makefile.in: Regenerate.
8661
8662 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8663
8664 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8665 error for the deprecated relocations.
8666 (Target_arm::Scan::global): Likewise.
8667 (Target_arm::Relocate::relocate): Likewise.
8668
8669 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8670
8671 * fileread.cc (Input_file::find_file): Initialize *found_name
8672 and *namep when using the fallback search for case 4.
8673
8674 2010-10-11 Cary Coutant <ccoutant@google.com>
8675
8676 * options.h (class General_options): Redefine -z lazy as an alias for
8677 the negation of -z now.
8678
8679 2010-10-11 Ian Lance Taylor <iant@google.com>
8680
8681 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8682 binding.
8683
8684 2010-10-06 Nick Clifton <nickc@redhat.com>
8685
8686 * script-sections.cc(class Memory_region): Remove
8687 current_lma_offset_ field. Rename current_vma_offset_ to
8688 current_offset_. Add last_section_ field.
8689 (Memory_region::get_current_vma_address): Rename to
8690 get_current_address.
8691 (Memory_region::get_current_lma_address): Delete.
8692 (Memory_region::increment_vma_offset): Rename to
8693 increment_offset.
8694 (Memory_region::increment_lma_offset): Delete.
8695 (Memory_region::attributes_compatible): New method. Returns
8696 true if the provided section is compatible with the region.
8697 (Memory_region::get_last_section): New method. Returns the last
8698 section to use the region.
8699 (Memory_region::set_last_section): New method. Stores the last
8700 section to use the region.
8701 (Script_sections::block_in_region): New method. Returns true if
8702 a block of memory is contained within a region.
8703 (Script_sections::find_memory_region): New method. Locates a
8704 memory region to be used to set a VMA or LMA address.
8705 (Output_section_definition::set_section_addresses): Add code to
8706 check for addresses set by memory regions.
8707 (Output_segment::set_section_addresses): Remove memory region
8708 walking code.
8709 (Script_sections::create_segment): Add a warning if a header
8710 segment is created outside of any region.
8711 * script-sections.h (class Script_sections): Add prototypes for
8712 find_memory_region and block_in_region methods.
8713 * testsuite/memory_test.s: Use .long instead of .word.
8714 * testsuite/memory_test.t: Add some more output sections.
8715 * testsuite/memory_test.sh: Update expected output.
8716
8717 2010-10-02 Doug Kwan <dougkwan@google.com>
8718
8719 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8720 defintion to symtab.h
8721 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8722 declaration to defintion.
8723
8724 2010-10-01 Nick Clifton <nickc@redhat.com>
8725
8726 * expression.cc (eval): Replace dummy argument with NULL.
8727 (eval_maybe_dot): Check for a NULL result section pointer.
8728 (Symbol_expression::value): Likewise.
8729 (Dot_expression::value): Likewise.
8730 (BINARY_EXPRESSION): Likewise.
8731 (Max_expression::value): Likewise.
8732 (Min_expression::value): Likewise.
8733 (Absolute_expression::value): Likewise.
8734 (Addr_expression::value_from_output_section): Likewise.
8735 (Loaddddr_expression::value_from_output_section): Likewise.
8736 (Segment_start_expression::value): Likewise.
8737 * script-sections.cc
8738 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8739 argument with NULL.
8740 (Sections_elememt_dot_assignment::set_section_addresses):
8741 Likewise.
8742 (Output_data_expression::do_write_to_buffer): Likewise.
8743 (Output_section_definition::finalize_symbols): Likewise.
8744 (Output_section_definition::set_section_addresses): Likewise.
8745
8746 2010-09-30 Doug Kwan <dougkwan@google.com>
8747
8748 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8749
8750 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8751
8752 * target.h (Target::can_icf_inline_merge_sections): New virtual
8753 function.
8754 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8755 virtual function.
8756 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8757 virtual function.
8758 * icf.cc (get_section_contents): Inline merge sections only when
8759 target allows it.
8760
8761 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8762
8763 * configure: Regenerate.
8764
8765 2010-09-17 Ian Lance Taylor <iant@google.com>
8766
8767 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8768 * testsuite/Makefile.am (memory_test.o): New target.
8769 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8770 memory_test.t.
8771 * testsuite/Makefile.in: Rebuild.
8772
8773 2010-09-17 Doug Kwan <dougkwan@google.com>
8774
8775 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8776 defintion if relocation uses GOT entries of the symbol.
8777 * testsuite/icf_safe_test.sh: Fix test.
8778 * testsuite/icf_safe_so_test.sh: Fix test.
8779
8780 2010-09-16 Cary Coutant <ccoutant@google.com>
8781
8782 * script_sections.cc (class Memory_region): Remove "NULL" from
8783 vector initializations.
8784
8785 2010-09-15 Cary Coutant <ccoutant@google.com>
8786
8787 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8788 Resolve forwarding symbols.
8789
8790 2010-09-15 Doug Kwan <dougkwan@google.com>
8791
8792 * gold/testsuite/script_test_3.t: Add ARM special sections.
8793 * gold/testsuite/script_test_4.t: Same.
8794 * gold/testsuite/script_test_5.t: Same.
8795 * gold/testsuite/script_test_6.t: Same.
8796 * gold/testsuite/script_test_7.t: Same.
8797 * gold/testsuite/script_test_7.t: Same.
8798 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8799
8800 2010-09-14 Cary Coutant <ccoutant@google.com>
8801
8802 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8803 (Target_x86_64::Relocate::relocate_tls): Replace check for
8804 saw_tls_block_reloc_ with test for executable section.
8805
8806 2010-09-12 Cary Coutant <ccoutant@google.com>
8807
8808 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8809 position-independent executables to shared libraries need dynamic
8810 relocations.
8811 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8812 position-independent executables.
8813 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8814 * testsuite/Makefile.in: Regenerate.
8815
8816 2010-09-10 Nick Clifton <nickc@redhat.com>
8817
8818 PR gold/11997
8819 * testsuite/memory_test.t: Discard any sections that are not
8820 needed.
8821
8822 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8823
8824 PR gold/11996
8825 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8826 "This::" to work around a bug in gcc 4.2.
8827
8828 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8829
8830 2010-09-09 Rafael Espindola <espindola@google.com>
8831
8832 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8833 sections with different PF_X flags in the same segment.
8834 (Layout::find_first_load_seg): Search all segments to find the first
8835 one.
8836 * options.h (rosegment): New.
8837
8838 2010-09-08 Rafael Espindola <espindola@google.com>
8839
8840 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8841
8842 2010-09-08 Doug Kwan <dougkwan@google.com>
8843
8844 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8845 (Arm_relobj::do_relocate_sections): Add new parameter for output
8846 file to match the parent.
8847 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8848 of local symbols instead of input values. Update code to track
8849 changes in gold::relocate_section.
8850 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8851 (Sized_relobj::compute_final_local_value_internal): New methods.
8852 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8853 body into private version of Sized_relobj::compute_final_local_value.
8854 Call the inline method.
8855 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8856 merged symbol value if there is one.
8857 (Symbol_value::has_output_value): New method defintiion.
8858 (Sized_relobj::Compute_final_local_value_status): New enum type.
8859 (Sized_relobj::compute_final_local_value): New methods.
8860 (Sized_relobj::compute_final_local_value_internal): New methods.
8861 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8862 and arm_cortex_a8.sh.
8863 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8864 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8865 New tests.
8866 * Makefile.in: Regenerate.
8867 * testsuite/arm_bl_out_of_range.s: Update test.
8868 * testsuite/thumb_bl_out_of_range.s: Ditto.
8869 * testsuite/thumb_blx_out_of_range.s: Ditto.
8870 * testsuite/arm_branch_out_of_range.sh: New file.
8871 * testsuite/arm_cortex_a8.sh: Ditto.
8872 * testsuite/arm_cortex_a8_b.s: Ditto.
8873 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8874 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8875 * testsuite/arm_cortex_a8_bl.s: Ditto.
8876 * testsuite/arm_cortex_a8_blx.s: Ditto.
8877 * testsuite/arm_cortex_a8_local.s: Ditto.
8878 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8879 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8880
8881 2010-09-08 Rafael Espindola <espindola@google.com>
8882
8883 * Makefile.am (memory_test.stdout): Run readelf with -W.
8884 * Makefile.in: Regenerate.
8885 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8886 64 bit output.
8887
8888 2010-09-08 Rafael Espindola <espindola@google.com>
8889
8890 * script-sections.cc (Script_sections::add_memory_region): Convert
8891 field precision to int.
8892 * script.cc (script_set_section_region, script_set_section_region):
8893 Convert field precision to int.
8894
8895 2010-09-08 Rafael Espindola <espindola@google.com>
8896
8897 * arm.cc (do_finalize_sections): Create the __exidx_start and
8898 __exdix_end symbols even when the section is missing.
8899
8900 2010-09-08 Nick Clifton <nickc@redhat.com>
8901
8902 * README: Remove claim that MEMORY is not supported.
8903 * expression.cc (script_exp_function_origin)
8904 (script_exp_function_length): Move from here to ...
8905 * script.cc: ... here.
8906 (script_set_section_region, script_add_memory)
8907 (script_parse_memory_attr, script_include_directive): New
8908 functions.
8909 * script-sections.cc
8910 (class Memory_region): New class.
8911 (class Output_section_definition): Add set_memory_region,
8912 set_section_vma, set_section_lma and get_section_name methods.
8913 (class Script_Sections): Add add_memory_region,
8914 find_memory_region, find_memory_region_origin,
8915 find_memory_region_length and set_memory_region methods.
8916 Have set_section_addresses method walk the list of set memory
8917 regions.
8918 Extend the print methos to display memory regions.
8919 * script-sections.h: Add prototypes for new methods.
8920 Add enum for MEMORY region attributes.
8921 * yyscript.y: Add support for parsing MEMORY regions.
8922 * script-c.h: Add prototypes for new functions.
8923 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8924 * testsuite/Makefile.in: Regenerate.
8925 * testsuite/memory_test.sh: New script.
8926 * testsuite/memory_test.s: New assembler source file.
8927 * testsuite/memory_test.t: New linker script.
8928
8929 2010-08-27 Doug Kwan <dougkwan@google.com>
8930
8931 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8932 reference override an existing dynamic weak reference.
8933 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8934 * testsuite/Makefile.in: Regenerate.
8935 * testsuite/dyn_weak_ref.sh: New file.
8936 * testsuite/dyn_weak_ref_1.c: Ditto.
8937 * testsuite/dyn_weak_ref_2.c: Ditto.
8938
8939 2010-08-27 Ian Lance Taylor <iant@google.com>
8940
8941 * incremental.h (class Incremental_input_entry): Add virtual
8942 destructor.
8943
8944 2010-08-27 Ian Lance Taylor <iant@google.com>
8945
8946 * testsuite/start_lib_test_3.c: Mark t3 as used.
8947
8948 2010-08-27 Nick Clifton <nickc@redhat.com>
8949
8950 * options.cc (version_script): Fix small typo in previous
8951 whitespace tidyup.
8952
8953 2010-08-25 Nick Clifton <nickc@redhat.com>
8954
8955 * archive.cc: Formatting fixes: Remove whitespace between
8956 typename and following asterisk. Remove whitespace between
8957 function name and opening parenthesis.
8958 * archive.h: Likewise.
8959 * arm.cc: Likewise.
8960 * attributes.cc: Likewise.
8961 * attributes.h: Likewise.
8962 * common.cc: Likewise.
8963 * copy-relocs.cc: Likewise.
8964 * dirsearch.h: Likewise.
8965 * dynobj.cc: Likewise.
8966 * ehframe.cc: Likewise.
8967 * ehframe.h: Likewise.
8968 * expression.cc: Likewise.
8969 * fileread.cc: Likewise.
8970 * fileread.h: Likewise.
8971 * gc.h: Likewise.
8972 * gold-threads.cc: Likewise.
8973 * gold.cc: Likewise.
8974 * i386.cc: Likewise.
8975 * icf.h: Likewise.
8976 * incremental-dump.cc: Likewise.
8977 * incremental.cc: Likewise.
8978 * layout.cc: Likewise.
8979 * layout.h: Likewise.
8980 * main.cc: Likewise.
8981 * merge.cc: Likewise.
8982 * merge.h: Likewise.
8983 * object.cc: Likewise.
8984 * object.h: Likewise.
8985 * options.cc: Likewise.
8986 * options.h: Likewise.
8987 * output.cc: Likewise.
8988 * output.h: Likewise.
8989 * plugin.cc: Likewise.
8990 * plugin.h: Likewise.
8991 * powerpc.cc: Likewise.
8992 * reloc.cc: Likewise.
8993 * script-c.h: Likewise.
8994 * script-sections.cc: Likewise.
8995 * script.cc: Likewise.
8996 * stringpool.cc: Likewise.
8997 * symtab.cc: Likewise.
8998 * symtab.h: Likewise.
8999 * target.cc: Likewise.
9000 * timer.cc: Likewise.
9001 * timer.h: Likewise.
9002 * version.cc: Likewise.
9003 * x86_64.cc: Likewise.
9004
9005 2010-08-24 Nick Clifton <nickc@redhat.com>
9006
9007 PR 11899
9008 * layout.cc (segment_precedes): Sort segments by their physical
9009 addresses, if they have been set.
9010
9011 2010-08-23 Cary Coutant <ccoutant@google.com>
9012
9013 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9014 symbols data.
9015 (Lib_group::include_member): Unlock object after deleting its
9016 symbols data.
9017 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9018 the bug fixed here.
9019
9020 2010-08-19 Neil Vachharajani <nvachhar@google.com>
9021 Cary Coutant <ccoutant@google.com>
9022
9023 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9024 constructor, and set_blocker.
9025 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9026 readsyms_blocker_.
9027 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9028 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9029 * testsuite/Makefile.am (start_lib_test): New test case.
9030 * testsuite/Makefile.in: Regenerate.
9031 * testsuite/start_lib_test_main.c: New file.
9032 * testsuite/start_lib_test_1.c: New file.
9033 * testsuite/start_lib_test_2.c: New file.
9034 * testsuite/start_lib_test_3.c: New file.
9035
9036 2010-08-19 Ian Lance Taylor <iant@google.com>
9037
9038 * Makefile.in: Rebuild with automake 1.11.1.
9039 * aclocal.m4: Likewise.
9040 * testsuite/Makefile.in: Likewise.
9041
9042 2010-08-19 Ian Lance Taylor <iant@google.com>
9043
9044 PR 10893
9045 * i386.cc (class Output_data_plt_i386): Update declarations.
9046 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9047 local_ifuncs_ fields.
9048 (Target_i386::do_plt_section_for_global): New function.
9049 (Target_i386::do_plt_section_for_local): New function.
9050 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9051 parameter; change all callers. Initialize global_ifuncs_ and
9052 local_ifuncs_. If doing a static link define __rel_iplt_start and
9053 __rel_iplt_end.
9054 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9055 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9056 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9057 symbols.
9058 (Target_i386::make_plt_section): New function, broken out of
9059 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9060 (Target_i386::make_plt_entry): Call make_plt_section.
9061 (Target_i386::make_local_ifunc_plt_entry): New function.
9062 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9063 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9064 R_386_IRELATIVE to switch.
9065 (Target_i386::Scan::global): Likewise.
9066 (Target_i386::Relocate::relocate): Likewise.
9067 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9068 switch.
9069 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9070 (Target_x86_64::do_plt_section_for_global): New function.
9071 (Target_x86_64::do_plt_section_for_local): New function.
9072 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9073 parameter; change all callers. If doing a static link define
9074 __rela_iplt_start and __rela_iplt_end.
9075 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9076 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9077 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9078 to point to .plt.
9079 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9080 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9081 switch.
9082 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9083 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9084 R_X86_64_IRELATIVE to switch.
9085 (Target_x86_64::Scan::global): Likewise.
9086 (Target_x86_64::Relocate::relocate): Likewise.
9087 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9088 switch.
9089 * target.h (class Target): Add plt_section_for_global and
9090 plt_section_for_local functions. Add do_plt_section_for_global
9091 and do_plt_section_for_local virtual functions.
9092 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9093 clarifying comments.
9094 (Symbol::use_plt_offset): Handle IFUNC symbol.
9095 * object.cc (Sized_relobj::Sized_relobj): Initialize
9096 local_plt_offsets_.
9097 (Sized_relobj::local_has_plt_offset): New function.
9098 (Sized_relobj::local_plt_offset): New function.
9099 (Sized_relobj::set_local_plt_offset): New function.
9100 (Sized_relobj::do_count): Handle IFUNC symbol.
9101 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9102 a bit away from input_shndx_ field. Add set_is_func_symbol and
9103 is_ifunc_symbol functions.
9104 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9105 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9106 local_plt_offsets_ field.
9107 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9108 * output.h (class Output_section_data): Add non-const
9109 output_section function.
9110 (class Output_data_got): Update declarations.
9111 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9112 Add use_plt_offset parameter to global and local constructors.
9113 Change all callers. Change local_sym_index_ field to 31 bits.
9114 Change GSYM_CODE and CONSTANT_CODE accordingly.
9115 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9116 doing a static link don't set sh_link field.
9117 (Output_data_got::Got_entry::write): Use PLT offset if
9118 appropriate.
9119 (Output_data_got::add_global_plt): New function.
9120 (Output_data_got::add_local_plt): New function.
9121 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9122 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9123 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9124 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9125 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9126 IFUNC conditional.
9127 * testsuite/ifunc-sel.h: New file.
9128 * testsuite/ifuncmain1.c: New file.
9129 * testsuite/ifuncmain1vis.c: New file.
9130 * testsuite/ifuncmod1.c: New file.
9131 * testsuite/ifuncdep2.c: New file.
9132 * testsuite/ifuncmain2.c: New file.
9133 * testsuite/ifuncmain3.c: New file.
9134 * testsuite/ifuncmod3.c: New file.
9135 * testsuite/ifuncmain4.c: New file.
9136 * testsuite/ifuncmain5.c: New file.
9137 * testsuite/ifuncmod5.c: New file.
9138 * testsuite/ifuncmain6pie.c: New file.
9139 * testsuite/ifuncmod6.c: New file.
9140 * testsuite/ifuncmain7.c: New file.
9141 * configure, testsuite/Makefile.in: Rebuild.
9142
9143 2010-08-18 Ian Lance Taylor <iant@google.com>
9144
9145 * incremental.cc
9146 (Output_section_incremental_inputs::write_input_files): Add cast
9147 to avoid signed/unsigned comparison warning.
9148 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9149
9150 2010-08-12 Cary Coutant <ccoutant@google.com>
9151
9152 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9153
9154 2010-08-13 Ian Lance Taylor <iant@google.com>
9155
9156 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9157
9158 2010-08-12 Cary Coutant <ccoutant@google.com>
9159 Doug Kwan <dougkwan@google.com>
9160
9161 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9162 defintion overrides non-weak undef, remember that the original undef
9163 is not weak.
9164 * symtab.cc (Symbol_table::sized_write_global): For undef without
9165 an original weak binding, set binding to global in output.
9166 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9167 * testsuite/Makefile.in: Regenerate.
9168 * testsuite/strong_ref_weak_def.sh: New file.
9169 * testsuite/strong_ref_weak_def_1.c: Ditto.
9170 * testsuite/strong_ref_weak_def_2.c: Ditto.
9171
9172 2010-08-12 Cary Coutant <ccoutant@google.com>
9173
9174 * testsuite/incremental_test.sh: Rewrite.
9175 * testsuite/incremental_test_1.c: Rewrite.
9176 * testsuite/incremental_test_2.c: Rewrite.
9177
9178 2010-08-12 Cary Coutant <ccoutant@google.com>
9179
9180 * arm.cc (Target_arm::got_size): Add const.
9181 (Target_arm::got_entry_count): New function.
9182 (Target_arm::plt_entry_count): New function.
9183 (Target_arm::first_plt_entry_offset): New function.
9184 (Target_arm::plt_entry_size): New function.
9185 (Output_data_plt_arm::entry_count): New function.
9186 (Output_data_plt_arm::first_plt_entry_offset): New function.
9187 (Output_data_plt_arm::get_plt_entry_size): New function.
9188 * i386.cc (Target_i386::got_size): Add const.
9189 (Target_i386::got_entry_count): New function.
9190 (Target_i386::plt_entry_count): New function.
9191 (Target_i386::first_plt_entry_offset): New function.
9192 (Target_i386::plt_entry_size): New function.
9193 (Output_data_plt_i386::entry_count): New function.
9194 (Output_data_plt_i386::first_plt_entry_offset): New function.
9195 (Output_data_plt_i386::get_plt_entry_size): New function.
9196 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9197 find_incremental_inputs_sections. Dump incremental_got_plt section.
9198 * incremental.cc: Include target.h.
9199 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9200 parameter. Adjust all callers. Find incremental_got_plt section.
9201 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9202 section.
9203 (Output_section_incremental_inputs::set_final_data_size): Calculate
9204 size of incremental_got_plt section.
9205 (Output_section_incremental_inputs::do_write): Write the
9206 incremental_got_plt section.
9207 (Got_plt_view_info): New struct.
9208 (Local_got_offset_visitor): New class.
9209 (Global_got_offset_visitor): New class.
9210 (Global_symbol_visitor_got_plt): New class.
9211 (Output_section_incremental_inputs::write_got_plt): New function.
9212 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9213 Add parameter. Adjust all callers.
9214 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9215 (Incremental_inputs::got_plt_section): New function.
9216 (Incremental_inputs::got_plt_section_): New data member.
9217 (Incremental_got_plt_reader): New class.
9218 * layout.cc (Layout::create_incremental_info_sections): Add the
9219 incremental_got_plt section.
9220 * object.h (Got_offset_list::get_list): New function.
9221 (Got offset_list::for_all_got_offsets): New function.
9222 (Sized_relobj::local_got_offset_list): New function.
9223 * powerpc.cc (Target_powerpc::got_size): Add const.
9224 (Target_powerpc::got_entry_count): New function.
9225 (Target_powerpc::plt_entry_count): New function.
9226 (Target_powerpc::first_plt_entry_offset): New function.
9227 (Target_powerpc::plt_entry_size): New function.
9228 (Output_data_plt_powerpc::entry_count): New function.
9229 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9230 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9231 * sparc.cc (Target_sparc::got_size): Add const.
9232 (Target_sparc::got_entry_count): New function.
9233 (Target_sparc::plt_entry_count): New function.
9234 (Target_sparc::first_plt_entry_offset): New function.
9235 (Target_sparc::plt_entry_size): New function.
9236 (Output_data_plt_sparc::entry_count): New function.
9237 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9238 (Output_data_plt_sparc::get_plt_entry_size): New function.
9239 * symtab.h (Symbol::got_offset_list): New function.
9240 (Symbol_table::for_all_symbols): New function.
9241 * target.h (Sized_target::got_entry_count): New function.
9242 (Sized_target::plt_entry_count): New function.
9243 (Sized_target::plt_entry_size): New function.
9244 * x86_64.cc (Target_x86_64::got_size): Add const.
9245 (Target_x86_64::got_entry_count): New function.
9246 (Target_x86_64::plt_entry_count): New function.
9247 (Target_x86_64::first_plt_entry_offset): New function.
9248 (Target_x86_64::plt_entry_size): New function.
9249 (Output_data_plt_x86_64::entry_count): New function.
9250 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9251 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9252
9253 2010-08-12 Cary Coutant <ccoutant@google.com>
9254
9255 * archive.cc: Include incremental.h.
9256 (Archive::Archive): Initialize incremental_info_.
9257 (Archive::include_member): Record archive members in incremental info.
9258 (Add_archive_symbols::run): Record begin and end of an archive in
9259 incremental info.
9260 (Lib_group::include_member): Record objects in incremental info.
9261 * archive.h (Incremental_archive_entry): Forward declaration.
9262 (Archive::set_incremental_info): New member function.
9263 (Archive::incremental_info): New member function.
9264 (Archive::Unused_symbol_iterator): New class.
9265 (Archive::unused_symbols_begin): New member function.
9266 (Archive::unused_symbols_end): New member function.
9267 (Archive::incremental_info_): New data member.
9268 * incremental-dump.cc (find_input_containing_global): New function.
9269 (dump_incremental_inputs): Dump new incremental info sections.
9270 * incremental.cc: Include symtab.h.
9271 (Output_section_incremental_inputs): New class.
9272 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9273 new incremental info sections.
9274 (Sized_incremental_binary::do_check_inputs): Likewise.
9275 (Incremental_inputs::report_archive): Remove.
9276 (Incremental_inputs::report_archive_begin): New function.
9277 (Incremental_inputs::report_archive_end): New function.
9278 (Incremental_inputs::report_object): New function.
9279 (Incremental_inputs::finalize_inputs): Remove.
9280 (Incremental_inputs::report_input_section): New function.
9281 (Incremental_inputs::report_script): Rewrite.
9282 (Incremental_inputs::finalize): Do nothing but finalize string table.
9283 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9284 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9285 (Incremental_inputs::create_data_sections): New function.
9286 (Incremental_inputs::relocs_entsize): New function.
9287 (Output_section_incremental_inputs::set_final_data_size): New function.
9288 (Output_section_incremental_inputs::do_write): New function.
9289 (Output_section_incremental_inputs::write_header): New function.
9290 (Output_section_incremental_inputs::write_input_files): New function.
9291 (Output_section_incremental_inputs::write_info_blocks): New function.
9292 (Output_section_incremental_inputs::write_symtab): New function.
9293 * incremental.h (Incremental_script_entry): Forward declaration.
9294 (Incremental_object_entry): Forward declaration.
9295 (Incremental_archive_entry): Forward declaration.
9296 (Incremental_inputs): Forward declaration.
9297 (Incremental_inputs_header_data): Remove.
9298 (Incremental_inputs_header): Remove.
9299 (Incremental_inputs_header_write): Remove.
9300 (Incremental_inputs_entry_data): Remove.
9301 (Incremental_inputs_entry): Remove.
9302 (Incremental_inputs_entry_write): Remove.
9303 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9304 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9305 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9306 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9307 Likewise.
9308 (Incremental_input_entry): New class.
9309 (Incremental_script_entry): New class.
9310 (Incremental_object_entry): New class.
9311 (Incremental_archive_entry): New class.
9312 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9313 (Incremental_inputs::report_inputs): Remove.
9314 (Incremental_inputs::report_archive): Remove.
9315 (Incremental_inputs::report_archive_begin): New function.
9316 (Incremental_inputs::report_archive_end): New function.
9317 (Incremental_inputs::report_object): Change prototype.
9318 (Incremental_inputs::report_input_section): New function.
9319 (Incremental_inputs::report_script): Change prototype.
9320 (Incremental_inputs::get_reloc_count): New function.
9321 (Incremental_inputs::set_reloc_count): New function.
9322 (Incremental_inputs::create_data_sections): New function.
9323 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9324 (Incremental_inputs::inputs_section): New function.
9325 (Incremental_inputs::symtab_section): New function.
9326 (Incremental_inputs::relocs_section): New function.
9327 (Incremental_inputs::get_stringpool): Add const.
9328 (Incremental_inputs::command_line): Add const.
9329 (Incremental_inputs::inputs): Remove.
9330 (Incremental_inputs::command_line_key): New function.
9331 (Incremental_inputs::input_file_count): New function.
9332 (Incremental_inputs::input_files): New function.
9333 (Incremental_inputs::relocs_entsize): New function.
9334 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9335 (Incremental_inputs::finalize_inputs): Remove.
9336 (Incremental_inputs::Input_info): Remove.
9337 (Incremental_inputs::lock_): Remove.
9338 (Incremental_inputs::inputs_): Change type.
9339 (Incremental_inputs::inputs_map_): Remove.
9340 (Incremental_inputs::current_object_entry_): New data member.
9341 (Incremental_inputs::inputs_section_): New data member.
9342 (Incremental_inputs::symtab_section_): New data member.
9343 (Incremental_inputs::relocs_section_): New data member.
9344 (Incremental_inputs::reloc_count_): New data member.
9345 (Incremental_inputs_reader): New class.
9346 (Incremental_symtab_reader): New class.
9347 (Incremental_relocs_reader): New class.
9348 * layout.cc (Layout::finalize): Move finalization of incremental info
9349 and creation of incremental info sections to follow finalization of
9350 symbol table. Set offsets for postprocessing sections.
9351 (Layout::create_incremental_info_sections): Call
9352 Incremental_inputs::create_data_sections. Add incremental symtab
9353 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9354 sections to layout after input sections.
9355 * layout.h (struct Timespec): Forward declaration.
9356 (Layout::incremental_inputs): Add const.
9357 (Layout::create_incremental_info_sections): Add parameter.
9358 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9359 * object.cc: Include incremental.h.
9360 (Relobj::finalize_incremental_relocs): New function.
9361 (Sized_relobj::do_layout): Record input sections in incremental info.
9362 * object.h (Object::output_section): New function.
9363 (Object::output_section_offset): Moved from Relobj.
9364 (Object::get_incremental_reloc_base): New function.
9365 (Object::get_incremental_reloc_count): New function.
9366 (Object::do_output_section): New function.
9367 (Object::do_output_section_offset): Moved from Relobj.
9368 (Object::do_get_incremental_reloc_base): New function.
9369 (Object::do_get_incremental_reloc_count): New function.
9370 (Object::Object): Initialize new data members.
9371 (Relobj::output_section): Renamed do_output_section and moved to
9372 protected.
9373 (Relobj::output_section_offset): Moved to Object.
9374 (Relobj::do_get_incremental_reloc_base): New function.
9375 (Relobj::do_get_incremental_reloc_count): New function.
9376 (Relobj::allocate_incremental_reloc_counts): New function.
9377 (Relobj::count_incremental_reloc): New function.
9378 (Relobj::finalize_incremental_relocs): New function.
9379 (Relobj::next_incremental_reloc_index): New function.
9380 (Relobj::reloc_counts_): New data member.
9381 (Relobj::reloc_bases_): New data member.
9382 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9383 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9384 (Sized_relobj::incremental_relocs_scan): New function.
9385 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9386 (Sized_relobj::incremental_relocs_write): New function.
9387 (Sized_relobj::incremental_relocs_write_reltype): New function.
9388 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9389 incremental link.
9390 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9391 archives and object files elsewhere.
9392 (Add_symbols::run): Report object files here.
9393 (Finish_group::run): Report end of archive at end of group.
9394 * reloc.cc: Include layout.h, incremental.h.
9395 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9396 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9397 (Sized_relobj::incremental_relocs_scan): New function.
9398 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9399 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9400 (Sized_relobj::incremental_relocs_write): New function.
9401 (Sized_relobj::incremental_relocs_write_reltype): New function.
9402 * script.cc (read_input_script): Rewrite test for incremental link.
9403 Change call to Incremental_inputs::report_script.
9404 * symtab.h (Symbol_table::first_global_index): New function.
9405 (Symbol_table::output_count): New function.
9406
9407 2010-08-12 Doug Kwan <dougkwan@google.com>
9408
9409 * arm.cc (Target_arm::merge_object_attributes): Check command line
9410 options --no-wchar-size-warning and --no-enum-size-warning.
9411 * options.h (General_options): Add ld-compatible options
9412 --no-enum-size-warning and --no-wchar-size-warning.
9413
9414 2010-08-04 Ian Lance Taylor <iant@google.com>
9415
9416 * x86_64.cc (Target_x86_64::Scan::local): Use
9417 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9418 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9419 (Target_x86_64::Scan::global): Likewise.
9420 (Target_x86_64::Relocate::relocate): Likewise.
9421 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9422 Likewise.
9423
9424 2010-08-03 Cary Coutant <ccoutant@google.com>
9425
9426 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9427 to reserve space in merged_strings vector. Keep total input size
9428 for stats.
9429 (Output_merge_string::do_print_merge_stats): Print total input size.
9430 * merge.h (Output_merge_string): Add input_size_ field.
9431 * stringpool.cc (Stringpool_template::string_length): Move
9432 implementations out of Stringpool_template class and place in
9433 stringpool.h.
9434 * stringpool.h (string_length): Move out of Stringpool_template.
9435
9436 2010-08-03 Ian Lance Taylor <iant@google.com>
9437
9438 PR 11712
9439 * layout.cc (relaxation_loop_body): If address of load segment is
9440 set, adjust address to include headers if possible.
9441
9442 2010-08-03 Ian Lance Taylor <iant@google.com>
9443
9444 * version.cc (version_string): Bump to 1.10.
9445
9446 2010-08-03 Ian Lance Taylor <iant@google.com>
9447
9448 PR 11805
9449 * layout.h (enum Output_section_order): Define.
9450 (class Layout): Update declarations.
9451 * layout.cc (Layout::get_output_section): Add order parameter.
9452 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9453 is_first_non_relro parameters. Change all callers.
9454 (Layout::choose_output_section): Likewise.
9455 (Layout::add_output_section_data): Likewise.
9456 (Layout::make_output_section): Likewise. Set order.
9457 (Layout::default_section_order): New function.
9458 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9459 * output.cc (Output_section::Output_section): Initialize order_.
9460 Don't initialize deleted fields.
9461 (Output_segment::Output_segment): Don't initialize deleted
9462 fields.
9463 (Output_segment::add_output_section_to_load): New function
9464 replacing add_output_section. Change all callers to call this or
9465 add_output_section_to_nonload.
9466 (Output_segment::add_output_section_to_nonload): New function.
9467 (Output_segment::remove_output_section): Rewrite.
9468 (Output_segment::add_initial_output_data): Likewise.
9469 (Output_segment::has_any_data_sections): Likewise.
9470 (Output_segment::is_first_section_relro): Likewise.
9471 (Output_segment::maximum_alignment): Likewise.
9472 (Output_segment::has_dynamic_reloc): New function replacing
9473 dynamic_reloc_count. Change all callers.
9474 (Output_segment::has_dynamic_reloc_list): New function replacing
9475 dynamic_reloc_count_list. Change all callers.
9476 (Output_segment::set_section_addresses): Rewrite.
9477 (Output_segment::set_offset): Rewrite.
9478 (Output_segment::find_first_and_last_list): Remove.
9479 (Output_segment::set_tls_offsets): Rewrite.
9480 (Output_segment::first_section_load_address): Likewise.
9481 (Output_segment::output_section_count): Likewise.
9482 (Output_segment::section_with_lowest_load_address): Likewise.
9483 (Output_segment::write_section_headers): Likewise.
9484 (Output_segment::print_sections_to_map): Likewise.
9485 * output.h (class Output_data): Remove dynamic_reloc_count_
9486 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9487 (Output_data::add_dynamic_reloc): Rewrite.
9488 (Output_data::has_dynamic_reloc): New function.
9489 (Output_data::dynamic_reloc_count): Remove.
9490 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9491 is_last_relro_, is_first_non_relro_, is_interp_,
9492 is_dynamic_linker_section_ fields. Add order and set_order
9493 functions. Remove is_relro_local, set_is_relro_local,
9494 is_last_relro, set_is_last_relro, is_first_non_relro,
9495 set_is_first_non_relro functions, is_interp, set_is_interp,
9496 is_dynamic_linker_section, and set_is_dynamic_linker_section
9497 functions.
9498 (class Output_segment): Change Output_data_list from std::list to
9499 std:;vector. Add output_lists_ field. Remove output_data_ and
9500 output_bss_ fields. Update declarations.
9501
9502 2010-08-02 Ian Lance Taylor <iant@google.com>
9503
9504 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9505 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9506 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9507
9508 2010-08-02 Ian Lance Taylor <iant@google.com>
9509
9510 PR 11855
9511 * script.cc (Script_options::Script_options): Initialize
9512 symbol_definitions_ and symbol_references_.
9513 (Script_options::add_symbol_assignment): Update
9514 symbol_definitions_ and symbol_references_.
9515 (Script_options::add_symbol_reference): New function.
9516 (script_symbol): New function.
9517 * script.h (class Script_options): Add symbol_definitions_ and
9518 symbol_references_ fields.
9519 (Script_options::referenced_const_iterator): New type.
9520 (Script_options::referenced_begin): New function.
9521 (Script_options::referenced_end): New function.
9522 (Script_options::is_referenced): New function.
9523 (Script_options::any_unreferenced): New function.
9524 * script-c.h (script_symbol): Declare.
9525 * yyscript.y (exp): Call script_symbol.
9526 * symtab.cc: Include "script.h".
9527 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9528 Change all callers. Check symbols referenced by scripts.
9529 (Symbol_table::add_undefined_symbols_from_command_line): Add
9530 layout parameter. Change all callers.
9531 (Symbol_table::do_add_undefined_symbols_from_command_line):
9532 Likewise. Break out loop body. Check symbols referenced by
9533 scripts.
9534 (Symbol_table::add_undefined_symbol_from_command_line): New
9535 function broken out of
9536 do_add_undefined_symbols_from_command_line.
9537 * symtab.h (class Symbol_table): Update declarations.
9538 * archive.cc: Include "layout.h".
9539 (Archive::should_include_member): Add layout parameter. Change
9540 all callers. Check for symbol mentioned in expression.
9541 * archive.h (class Archive): Update declaration.
9542 * object.cc (Sized_relobj::do_should_include_member): Add layout
9543 parameter.
9544 * object.h (Object::should_include_member): Add layout parameter.
9545 Change all callers.
9546 (Object::do_should_include_member): Add layout parameter.
9547 (class Sized_relobj): Update declaration.
9548 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9549 parameter.
9550 * dynobj.h (class Sized_dynobj): Update declaration.
9551 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9552 layout parameter.
9553 * plugin.h (class Sized_pluginobj): Update declaration.
9554
9555 2010-08-02 Ian Lance Taylor <iant@google.com>
9556
9557 PR 11866
9558 * output.cc (Output_segment::set_offset): Search for the first and
9559 last sections rather than assuming that the list is in order.
9560 (Output_segment::find_first_and_last_list): New function.
9561 * output.h (class Output_segment): Update declarations.
9562 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9563 (relro_strip_test_SOURCES): New variable.
9564 (relro_strip_test_DEPENDENCIES): New variable.
9565 (relro_strip_test_LDFLAGS): New variable.
9566 (relro_strip_test_LDADD): New variable.
9567 (relro_strip_test.so): New target.
9568
9569 2010-08-02 Ian Lance Taylor <iant@google.com>
9570
9571 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9572 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9573 (Target_i386::got_tlsdesc_section): New function.
9574 (Target_i386::got_section): Create space for GOT entries for
9575 TLSDESC relocations.
9576 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9577 R_386_TLS_GOTDESC.
9578 (Target_i386::Scan::global): Likewise.
9579 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9580 using TLSDESC GOT.
9581 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9582 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9583 (Target_x86_64::got_tlsdesc_section): New function.
9584 (Target_x86_64::got_section): Create space for GOT entries for
9585 TLSDESC relocations.
9586 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9587 R_386_TLS_GOTDESC.
9588 (Target_x86_64::Scan::global): Likewise.
9589 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9590 using TLSDESC GOT.
9591
9592 2010-08-02 Ian Lance Taylor <iant@google.com>
9593
9594 * testsuite/final_layout.sh: Use dc to convert from hex to
9595 decimal.
9596
9597 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9598
9599 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9600 paramter to the call to gold::gc_process_relocs.
9601 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9602 paramter to the call to gold::gc_process_relocs.
9603 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9604 parameter to the call to gold::gc_process_relocs.
9605 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9606 template parameter to the call to gold::gc_process_relocs.
9607 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9608 paramter to the call to gold::gc_process_relocs.
9609 * gc.h (get_embedded_addend_size): New function.
9610 (gc_process_relocs): Save the size of the reloc for use by ICF.
9611 * icf.cc (get_section_contents): Get the addend from the text section
9612 for SHT_REL relocation sections.
9613 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9614 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9615 * int_encoding.h (read_from_pointer): New overloaded function.
9616 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9617 * testsuite/icf_sht_rel_addend_test.sh: New file.
9618 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9619 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9620
9621 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9622
9623 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9624 * Makefile.in: Regenerate.
9625 * testsuite/Makefile.in: Regenerate.
9626
9627 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9628
9629 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9630 * gold/testsuite/debug_msg.cc: Likewise.
9631 * gold/testsuite/odr_violation1.cc
9632 * gold/testsuite/odr_violation2.cc
9633
9634 2010-07-21 Cary Coutant <ccoutant@google.com>
9635
9636 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9637 string, and length fields.
9638 (Output_merge_string::Merged_strings_list): New type.
9639 (Output_merge_string::Merged_strings_lists): New typedef.
9640 (Output_merge_string): Replace merged_strings_ with
9641 merged_strings_lists_.
9642 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9643 Merged_strings_list per input object and section. Don't store pointer
9644 to the string. Don't store length with each merged string entry.
9645 (Output_merge_string::finalize_merged_data): Loop over list of merged
9646 strings lists. Recompute length of each merged string.
9647
9648 2010-07-15 Cary Coutant <ccoutant@google.com>
9649
9650 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9651 here.
9652
9653 2010-07-14 Ian Lance Taylor <iant@google.com>
9654
9655 * descriptors.cc (Descriptors::open): Report correct name in error
9656 message.
9657
9658 2010-07-13 Doug Kwan <dougkwan@google.com>
9659
9660 * arm.cc (Arm_input_section::Arm_input_section): For a
9661 SHT_ARM_EXIDX section, always keeps the input sections.
9662 (Arm_input_section::set_exidx_section_link): New method.
9663 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9664 has_errors_ to false.
9665 (Arm_exidx_input_section::has_errors,
9666 Arm_exidx_input_section::set_has_errors): New methods.
9667 (Arm_exidx_input_section::has_errors_): New data member.
9668 (Arm_relobj::get_exidx_shndx_list): New method.
9669 (Arm_output_section::append_text_sections_to_list): Do not skip
9670 section without SHF_EXECINSTR.
9671 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9672 errors.
9673 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9674 section header. Make error messages more verbose. Check for
9675 a non-executable section linked to an EXIDX section.
9676 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9677 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9678 check that there is no deferred EXIDX section if we exit early.
9679 Instead of not making an EXIDX section in case of an error, make one
9680 and set the has_errors flag of it.
9681 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9682 in a relocatable link.
9683 (Target_arm::do_relax): Look for the EXIDX output section instead of
9684 assuming that it is called .ARM.exidx.
9685 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9686 section list. Do not check for SHF_EXECINSTR section flags but
9687 skip any input section with errors.
9688 * output.cc (Output_section::Output_section): Initialize
9689 always_keeps_input_sections_ to false.
9690 (Output_section::add_input_section): Check for
9691 always_keeps_input_sections_.
9692 * output.h (Output_section::always_keeps_input_sections,
9693 Output_section::set_always_keeps_input_sections): New methods.
9694 (Output_section::always_keeps_input_sections): New data member.
9695
9696 2010-07-13 Rafael Espindola <espindola@google.com>
9697
9698 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9699 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9700
9701 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9702 Ian Lance Taylor <iant@google.com>
9703
9704 * output.h (Output_section_lookup_maps::add_merge_section):
9705 Correct check of whether value was inserted.
9706 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9707 (Output_section_lookup_maps::add_relaxed_input_section):
9708 Likewise.
9709 * arm.cc (Target_arm::got_section): Remove used local os.
9710 * i386.cc (Target_i386::got_section): Likewise.
9711 * x86_64.cc (Target_x86_64::got_section): Likewise.
9712 * sparc.cc (Target_sparc::got_section): Likewise.
9713 (Target_sparc::relocate): Remove unused local have_got_offset.
9714 * powerpc.cc (Target_powerpc::relocate): Likewise.
9715
9716 2010-07-13 Ian Lance Taylor <iant@google.com>
9717
9718 * compressed_output.cc (zlib_decompress): Fix signature in
9719 !HAVE_ZLIB_H case.
9720
9721 * archive.cc (Archive::include_member): Unlock an external member
9722 of a thin archive. Don't bother to delete an object we know is
9723 NULL.
9724
9725 2010-07-12 Cary Coutant <ccoutant@google.com>
9726
9727 * compressed_output.cc (zlib_decompress): New function.
9728 (get_uncompressed_size): New function.
9729 (decompress_input_section): New function.
9730 * compressed_output.h (get_uncompressed_size): New function.
9731 (decompress_input_section): New function.
9732 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9733 Handle compressed debug sections.
9734 * layout.cc (is_compressed_debug_section): New function.
9735 (Layout::output_section_name): Map compressed section names to
9736 canonical names.
9737 * layout.h (is_compressed_debug_section): New function.
9738 (is_debug_info_section): Recognize compressed debug sections.
9739 * merge.cc: Include compressed_output.h.
9740 (Output_merge_data::do_add_input_section): Handle compressed
9741 debug sections.
9742 (Output_merge_string::do_add_input_section): Handle compressed
9743 debug sections.
9744 * object.cc: Include compressed_output.h.
9745 (Sized_relobj::Sized_relobj): Initialize new data members.
9746 (build_compressed_section_map): New function.
9747 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9748 * object.h (Object::section_is_compressed): New method.
9749 (Object::do_section_is_compressed): New method.
9750 (Sized_relobj::Compressed_section_map): New type.
9751 (Sized_relobj::do_section_is_compressed): New method.
9752 (Sized_relobj::compressed_sections_): New data member.
9753 * output.cc (Output_section::add_input_section): Handle compressed
9754 debug sections.
9755 * reloc.cc: Include compressed_output.h.
9756 (Sized_relobj::write_sections): Handle compressed debug sections.
9757
9758 2010-07-08 Cary Coutant <ccoutant@google.com>
9759
9760 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9761 weak when resolving to a dynamic def.
9762 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9763 for weak undef/dynamic def cases. Adjust callers.
9764 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9765 undef_binding_weak_.
9766 (Symbol_table::sized_write_globals): Adjust symbol binding.
9767 (Symbol_table::sized_write_symbol): Add binding parameter.
9768 * symtab.h (Symbol::set_undef_binding): New method.
9769 (Symbol::is_undef_binding_weak): New method.
9770 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9771 (Symbol_table::should_override): Add new parameter.
9772 (Symbol_table::sized_write_symbol): Add new parameter.
9773
9774 * testsuite/weak_undef_file1.cc: Add new test case.
9775 * testsuite/weak_undef_file2.cc: Fix header comment.
9776 * testsuite/weak_undef_test.cc: Add new test case.
9777
9778 2010-06-29 Doug Kwan <dougkwan@google.com>
9779
9780 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9781 Initialize USE_SYMBOL_.
9782 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9783 definition.
9784 (Arm_reloc_property::uses_symbol_): New data member declaration.
9785 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9786 uses symbol value and symbol is undefined but not weakly undefined.
9787
9788 2010-06-28 Rafael Espindola <espindola@google.com>
9789
9790 * plugin.cc (Plugin::load): Use dlerror.
9791
9792 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9793
9794 * symtab.cc (detect_odr_violations): When reporting an ODR
9795 violation, report an object where the symbol is defined.
9796
9797 2010-06-25 Doug Kwan <dougkwan@google.com>
9798
9799 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9800 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9801 definition.
9802 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9803 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9804 target hook to detect function points.
9805 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9806 * icf.h (Icf::check_section_for_function_pointers): Change type of
9807 parameter SECTION_NAME to const reference to std::string. Use
9808 target hook to determine if section may have unsafe pointers.
9809 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9810 method definition.
9811
9812 2010-06-21 Rafael Espindola <espindola@google.com>
9813
9814 * fileread.cc (Input_file::find_fie): New
9815 (Input_file::open): Use Input_file::find_fie.
9816 * fileread.h (Input_file::find_fie): New
9817 * plugin.cc (set_extra_library_path): New.
9818 (Plugin::load): Add set_extra_library_path to the transfer vector.
9819 (Plugin_manager::set_extra_library_path): New.
9820 (Plugin_manager::add_input_file): Use the extra search path if set.
9821 (set_extra_library_path(): New.
9822 * plugin.h (Plugin_manager): Add set_extra_library_path and
9823 extra_search_path_.
9824
9825 2010-06-19 Cary Coutant <ccoutant@google.com>
9826
9827 * layout.cc (gdb_sections): Add .debug_types.
9828 (lines_only_debug_sections): Likewise.
9829
9830 2010-06-18 Rafael Espindola <espindola@google.com>
9831
9832 * plugin.cc (add_input_file,add_input_library)
9833 (Plugin_manager::add_input_file): Make filename arguments const.
9834 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9835 const.
9836
9837 2010-06-16 Doug Kwan <dougkwan@google.com>
9838
9839 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9840 .ARM.attributes section if we have not merged any input
9841 attributes sections.
9842
9843 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9844
9845 * arm.cc: Allow combining objects with no EABI version
9846 information.
9847
9848 2010-06-15 Rafael Espindola <espindola@google.com>
9849
9850 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9851
9852 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9853
9854 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9855 (struct iovec): Correct !HAVE_READV definition.
9856
9857 2010-06-10 Cary Coutant <ccoutant@google.com>
9858
9859 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9860 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9861 reloc sections.
9862 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9863
9864 PR 11683
9865 * symtab.h (Symbol::is_placeholder): New member function.
9866 * target-reloc.h (relocate_section): Check for placeholder symbols.
9867
9868 * testsuite/Makefile.am (plugin_test_8): New test.
9869 (plugin_test_9): New test.
9870 * testsuite/Makefile.in: Regenerate.
9871
9872 2010-06-09 Nick Clifton <nickc@redhat.com>
9873
9874 * yyscript.y (input_list_element): Allow strings prefixed with
9875 the '-' character. Treat these as libraries.
9876 * script.cc (script_add_library): New function. Adds a library
9877 specified by "-l<name>" found in an input script.
9878 * script-c.h: Add prototype for script_add_library.
9879
9880 2010-06-07 Doug Kwan <dougkwan@google.com>
9881
9882 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9883 Restrict stub-group size to be within long conditional branch
9884 range when working around cortex-A8 erratum.
9885
9886 2010-06-07 Damien Diederen <dd@crosstwine.com>
9887
9888 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9889 #ifdef typo.
9890
9891 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9892
9893 PR gold/11658
9894 * output.cc
9895 (Output_section::Input_section_sort_entry::compare_section_ordering):
9896 Change to return non-zero correctly.
9897 (Output_section::Input_section_sort_section_order_index_compare
9898 ::operator()): Change to fix ambiguity in comparisons.
9899
9900 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9901
9902 * gold.h (is_wildcard_string): New function.
9903 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9904 (Layout::layout_eh_frame): Ditto.
9905 (Layout::find_section_order_index): New method.
9906 (Layout::read_layout_from_file): New method.
9907 * layout.h (Layout::find_section_order_index): New method.
9908 (Layout::read_layout_from_file): New method.
9909 (Layout::input_section_position_): New private member.
9910 (Layout::input_section_glob_): New private member.
9911 * main.cc (main): Call read_layout_from_file here.
9912 * options.h (--section-ordering-file): New option.
9913 * output.cc (Output_section::input_section_order_specified_): New
9914 member.
9915 (Output_section::Output_section): Initialize new member.
9916 (Output_section::add_input_section): Add new parameter.
9917 Keep input sections when --section-ordering-file is used.
9918 (Output_section::set_final_data_size): Sort input sections when
9919 section ordering file is specified.
9920 (Output_section::Input_section_sort_entry): Add new parameter.
9921 Check sorting type.
9922 (Output_section::Input_section_sort_entry::compare_section_ordering):
9923 New method.
9924 (Output_section::Input_section_sort_compare::operator()): Change to
9925 consider section_order_index.
9926 (Output_section::Input_section_sort_init_fini_compare::operator()):
9927 Change to consider section_order_index.
9928 (Output_section::Input_section_sort_section_order_index_compare
9929 ::operator()): New method.
9930 (Output_section::sort_attached_input_sections): Change to sort
9931 according to section order when specified.
9932 (Output_section::add_input_section<32, true>): Add new parameter.
9933 (Output_section::add_input_section<64, true>): Add new parameter.
9934 (Output_section::add_input_section<32, false>): Add new parameter.
9935 (Output_section::add_input_section<64, false>): Add new parameter.
9936 * output.h (Output_section::add_input_section): Add new parameter.
9937 (Output_section::input_section_order_specified): New
9938 method.
9939 (Output_section::set_input_section_order_specified): New method.
9940 (Input_section::Input_section): Initialize section_order_index_.
9941 (Input_section::section_order_index): New method.
9942 (Input_section::set_section_order_index): New method.
9943 (Input_section::section_order_index_): New member.
9944 (Input_section::Input_section_sort_section_order_index_compare): New
9945 struct.
9946 (Output_section::input_section_order_specified_): New member.
9947 * script-sections.cc (is_wildcard_string): Delete and move modified
9948 method to gold.h.
9949 (Output_section_element_input::Output_section_element_input): Modify
9950 call to is_wildcard_string.
9951 (Output_section_element_input::Input_section_pattern
9952 ::Input_section_pattern): Ditto.
9953 (Output_section_element_input::Output_section_element_input): Ditto.
9954 * testsuite/Makefile.am (final_layout): New test case.
9955 * testsuite/Makefile.in: Regenerate.
9956 * testsuite/final_layout.cc: New file.
9957 * testsuite/final_layout.sh: New file.
9958
9959 2010-06-01 Rafael Espindola <espindola@google.com>
9960
9961 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9962
9963 2010-06-01 Rafael Espindola <espindola@google.com>
9964
9965 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9966 visibility of symbols.
9967
9968 2010-05-27 Doug Kwan <dougkwan@google.com>
9969
9970 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9971 from start of output section instead of address for a local symbol
9972 in a merged or relaxed section when doing a relocatable link.
9973
9974 2010-05-26 Rafael Espindola <espindola@google.com>
9975
9976 PR 11604
9977 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9978 adding sections the garbage collector removed.
9979 * gold/testsuite/Makefile.am: Add test.
9980 * gold/testsuite/Makefile.in: Regenerate.
9981 * gold/testsuite/plugin_test_7.sh: New.
9982 * gold/testsuite/plugin_test_7_1.c: New.
9983 * gold/testsuite/plugin_test_7_2.c: New.
9984
9985 2010-05-26 Rafael Espindola <espindola@google.com>
9986
9987 * script-sections.cc (Output_section_definition::set_section_addresses):
9988 Check for --section-start.
9989
9990 2010-05-26 Doug Kwan <dougkwan@google.com>
9991
9992 * arm.cc (Arm_scan_relocatable_relocs): New class.
9993 (Target_arm::relocate_special_relocatable): New method.
9994 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9995 (Arm_relocate_functions::thumb_branch_common): Same.
9996 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9997 instead of Default_scan_relocatable_relocs.
9998 * target-reloc.h (relocate_for_relocatable): Let target handle
9999 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10000 * target.h (Sized_target::relocate_special_relocatable): New method.
10001
10002 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10003
10004 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10005
10006 2010-05-23 Doug Kwan <dougkwan@google.com>
10007
10008 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10009 instead of a cast.
10010 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10011 with a direct branch, not a conditional branch, to a stub.
10012 * merge.cc (Output_merge_base::record_input_section): New method
10013 defintion.
10014 (Output_merge_data::do_add_input_section): Record input section if
10015 keeps-input-sections flag is set.
10016 (Output_merge_string::do_add_input_section): Ditto.
10017 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10018 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10019 INPUT_SECTIONS_.
10020 (Output_merge_base::keeps_input_sections,
10021 Output_merge_base::set_keeps_input_sections,
10022 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10023 method definitions.
10024 (Output_merge_base::Input_sections): New type declaration.
10025 (Output_merge_base::input_sections_begin,
10026 Output_merge_base::input_sections_end,
10027 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10028 (Output_merge_base::bool keeps_input_sections_,
10029 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10030 Output_merge_base::input_sections_): New data members.
10031 (Output_merge_data::do_set_keeps_input_sections): New method
10032 defintion.
10033 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10034 * output.cc (Output_section::Input_section::relobj): Move method
10035 defintion from class declaration to here and handle merge sections.
10036 (Output_section::Input_section::shndx): Ditto.
10037 (Output_section::Output_section): Remove initializations of removed
10038 data members and initialize new data member LOOKUP_MAPS_.
10039 (Output_section::add_input_section): Set keeps-input-sections flag
10040 for a newly created merge output section as appropriate. Adjust code
10041 to use Output_section_lookup_maps class.
10042 (Output_section::add_relaxed_input_section): Adjst code for lookup
10043 maps code refactoring.
10044 (Output_section::add_merge_input_section): Add a new parameter
10045 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10046 class. If adding input section to a newly created merge output
10047 section fails, remove the new merge section.
10048 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
10049 Adjust code for use of the Output_section_lookup_maps class.
10050 (Output_section::find_merge_section): Ditto.
10051 (Output_section::build_lookup_maps): New method defintion.
10052 (Output_section::find_relaxed_input_section): Adjust code to use
10053 Output_section_lookup_maps class.
10054 (Output_section::get_input_sections): Export merge sections. Adjust
10055 code to use Output_section_lookup_maps class.
10056 (Output_section:::add_script_input_section): Adjust code to use
10057 Output_section_lookup_maps class. Update lookup maps for merge
10058 sections also.
10059 (Output_section::discard_states): Use Output_section_lookup_maps.
10060 (Output_section::restore_states): Same.
10061 * output.h (Merge_section_properties): Move class defintion out of
10062 Output_section.
10063 (Output_section_lookup_maps): New class.
10064 (Output_section::Input_section::is_merge_section): New method
10065 defintion.
10066 (Output_section::Input_section::relobj): Move defintion out of class
10067 defintion. Declare method only.
10068 (Output_section::Input_section::shndx): Ditto.
10069 (Output_section::Input_section::output_merge_base): New method defintion.
10070 (Output_section::Input_section::u2_.pomb): New union field.
10071 (Output_section::Merge_section_by_properties_map,
10072 Output_section::Output_section_data_by_input_section_map,
10073 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10074 Remove types.
10075 (Output_section::add_merge_input_section): Add new parameter
10076 KEEPS_INPUT_SECTIONS.
10077 (Output_section::build_lookup_maps): New method declaration.
10078 (Output_section::merge_section_map_,
10079 Output_section::merge_section_by_properties_map_,
10080 Output_section::relaxed_input_section_map_,
10081 Output_section::is_relaxed_input_section_map_valid_): Remove data
10082 members.
10083 (Output_section::lookup_maps_): New data member.
10084
10085 2010-05-21 Doug Kwan <dougkwan@google.com>
10086
10087 PR gold/11619
10088 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10089 avoid a compilation error.
10090
10091 2010-05-19 Rafael Espindola <espindola@google.com>
10092
10093 * script-sections.cc (Output_section_definition::allocate_to_segment):
10094 Update the phdrs_list even when the output section is NULL.
10095 * testsuite/Makefile.am: Add test.
10096 * testsuite/Makefile.in: Regenerate.
10097 * testsuite/script_test_9.cc: New.
10098 * testsuite/script_test_9.sh: New.
10099 * testsuite/script_test_9.t: New.
10100
10101 2010-05-19 Doug Kwan <dougkwan@google.com>
10102
10103 * arm.cc (Arm_input_section::original_size): New method.
10104 (Arm_input_section::do_addralign): Add a cast.
10105 (Arm_input_section::do_output_offset): Remove static cast.
10106 (Arm_input_section::original_addralign,
10107 Arm_input_section::original_size_): Change type to uint32_t.
10108 (Arm_input_section::init): Add safe casts for section alignment
10109 and size.
10110 (Arm_input_section::set_final_data_size): Do not set address and
10111 offset of stub table.
10112 (Arm_output_section::fix_exidx_coverage): Change use of of
10113 Output_section::Simple_input_section to that of
10114 Output_section::Input_section.
10115 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10116 except for the first pass.
10117 * output.cc (Output_section::get_input_sections): Change type of
10118 input_sections to std::list<Input_section>.
10119 (Output_section::add_script_input_section): Rename from
10120 Output_section::add_simple_input_section. Change type of SIS
10121 parameter from Simple_input_section to Input_section.
10122 * output.h (Output_section::Simple_input_section): Remove class.
10123 (Output_section::Input_section): Change class visibility to public.
10124 (Output_section::Input_section::addralign): Use stored alignments
10125 for special input sections if set.
10126 (Output_section::Input_section::set_addralign): New method.
10127 (Output_section::get_input_sections): Change parameter type from
10128 list of Simple_input_section to list of Input_section.
10129 (Output_section::add_script_input_section): Rename from
10130 Output_section::add_simple_input_section. Change first parameter's
10131 type from Simple_input_section to Input_section and remove the
10132 second and third parameters.
10133 * script-sections.cc (Input_section::Input_section_list): Change
10134 type to list of Output_section::Input_section/
10135 (Input_section_info::Input_section_info): Change parameter type of
10136 INPUT_SECTION to Output_section::Input_section.
10137 (Input_section_info::input_section): Change return type.
10138 (Input_section_info::input_section_): Change type to
10139 Output_section::Input_section.
10140 (Output_section_element_input::set_section_addresses): Adjust code
10141 to use Output_section::Input_section instead of
10142 Output_section::Simple_input_section. Adjust code for renaming
10143 of Output_section::add_simple_input_section.
10144 (Orphan_output_section::set_section_addresses): Ditto.
10145
10146 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10147
10148 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10149 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10150
10151 2010-05-18 Rafael Espindola <espindola@google.com>
10152
10153 * options.cc (General_options::finalize): Handle -nostdlib.
10154 * options.h (nostdlib): New option.
10155 * script.cc (script_add_search_dir): Handle -nostdlib.
10156
10157 2010-05-12 Doug Kwan <dougkwan@google.com>
10158
10159 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10160 attributes section only if there no attributes section after merging.
10161 (Target_arm::merge_object_attributes): Move value of
10162 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10163 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10164 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10165 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10166 and arm_attr_merge_7.stdout.
10167 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10168 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10169 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10170 arm_attr_merge_7b.o): New rules.
10171 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10172 arm_attr_merge_7
10173 * testsuite/Makefile.in: Regenerate.
10174 * testsuite/arm_attr_merge.sh: New file.
10175 * testsuite/arm_attr_merge_[67][ab].s: Same.
10176
10177 2010-05-05 Nick Clifton <nickc@redhat.com>
10178
10179 * po/es.po: Updated Spanish translation.
10180
10181 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10182
10183 * Makefile.am (install-exec-local): Properly install gold as
10184 default cross linker.
10185 * Makefile.in: Regenerated.
10186
10187 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10188 Nick Clifton <nickc@redhat.com>
10189
10190 * configure.ac (install_as_default): Define and set to false
10191 unless --enable-gold or --enable-gold=both/gold has been
10192 specified.
10193 * configure: Regenerate.
10194
10195 * Makefile.am (install-exec-local): Install the executable as
10196 'ld.gold'. If install_as_default is true then also install it as
10197 'ld'.
10198 * Makefile.in: Regenerated.
10199
10200 2010-04-24 Ian Lance Taylor <iant@google.com>
10201
10202 * layout.cc (Layout::layout_reloc): In relocatable link don't
10203 combine reloc sections for grouped sections.
10204
10205 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10206
10207 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10208 sections that are not ordinary to icf.
10209 * icf.cc (get_section_contents): Handle relocation pointing to section
10210 with no object or shndx information.
10211 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10212 * testsuite/Makefile.in: Regenerate.
10213 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10214 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10215
10216 2010-04-22 Ian Lance Taylor <iant@google.com>
10217
10218 * expression.cc (Expression::Expression_eval_info): Add
10219 result_alignment_pointer field.
10220 (Expression::eval_with_dot): Add result_alignment_pointer
10221 parameter. Change all callers.
10222 (Expression::eval_maybe_dot): Likewise.
10223 (class Binary_expression): Add alignment_pointer parameter to
10224 left_value and right_value. Change all callers.
10225 (BINARY_EXPRESSION): Set result alignment.
10226 (class Trinary_expression): Add alignment_pointer parameter to
10227 arg2_value and arg3_value. Change all callers.
10228 (Trinary_cond::value): Set result alignment.
10229 (Max_expression::value, Min_expression::value): Likewise.
10230 (Align_expression::value): Likewise.
10231 * script-sections.cc (class Sections_element): Add dot_alignment
10232 parameter to set_section_addresses virtual function. Update
10233 instantiations.
10234 (class Output_section_element): Likewise.
10235 (Script_sections::create_segments): Add dot_alignment parameter.
10236 Change all callers.
10237 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10238 (Script_sections::set_phdrs_clause_addresses): Likewise.
10239 * script-sections.h: Update declarations.
10240 * script.h: Update declarations.
10241 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10242 min_p_align.
10243 * testsuite/script_test_3.t: Set large alignment.
10244 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10245 segment has expected alignment.
10246
10247 2010-04-22 Nick Clifton <nickc@redhat.com>
10248
10249 * po/gold.pot: Updated by the Translation project.
10250 * po/vi.po: Updated Vietnamese translation.
10251
10252 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10253
10254 * testsuite/Makefile.am (check_PROGRAMS): Add
10255 icf_virtual_function_folding_test.
10256 * testsuite/Makefile.in: Regenerated.
10257
10258 2010-04-15 Andrew Haley <aph@redhat.com>
10259
10260 * options.h (merge_exidx_entries): New option.
10261 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10262 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10263 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10264 (Target_arm::merge_exidx_entries): New function.
10265 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10266 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10267 to Arm_exidx_fixup constructor.
10268 Add new arg, merge_exidx_entries.
10269 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10270 Arm_output_section::fix_exidx_coverage.
10271
10272 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10273
10274 * icf.cc (get_section_contents): Check for preemptible functions.
10275 Ignore addend when appropriate.
10276 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10277 section folded.
10278 (add_from_relobj): Check for section folded.
10279 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10280 * symtab.h (should_add_dynsym_entry): Add new parameter.
10281 * target-reloc.h (scan_relocs): Check for section folded.
10282 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10283 Check reloc types for function pointers in shared objects.
10284 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10285 case.
10286 (icf_preemptible_functions_test): New test case.
10287 (icf_string_merge_test): New test case.
10288 * testsuite.Makefile.in: Regenerate.
10289 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10290 bar_glob. Refactor code.
10291 * testsuite/icf_preemptible_functions_test.cc: New file.
10292 * testsuite/icf_preemptible_functions_test.sh: New file.
10293 * testsuite/icf_string_merge_test.cc: New file.
10294 * testsuite/icf_string_merge_test.sh: New file.
10295 * testsuite/icf_virtual_function_folding_test.cc: New file.
10296 * testsuite/icf_virtual_function_folding_test.sh: New file.
10297
10298 2010-04-14 Doug Kwan <dougkwan@google.com>
10299
10300 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10301 for local symbol recounting if we remove a section due to ICF.
10302 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10303 there are no regular objects in input.
10304
10305 2010-04-13 Doug Kwan <dougkwan@google.com>
10306
10307 * arm.cc (Arm_input_section::set_final_data_size): Compute
10308 accurate final data size instead of using current data size.
10309
10310 2010-04-09 Doug Kwan <dougkwan@google.com>
10311
10312 * layout.cc (Layout::choose_output_section): Handle script section
10313 types.
10314 (Layout::make_output_section_for_script): Add section type parameter.
10315 Handle script section types.
10316 * layout.h (Layout::make_output_section_for_script): Add section
10317 type parameter.
10318 * output.cc (Output_section::Output_section): Initialize data member
10319 is_noload_.
10320 (Output_section::do_reset_address_and_file_offset): Do not set address
10321 to 0 if section is a NOLOAD section.
10322 * output.h (Output_section::is_noload): New method.
10323 (Output_section::set_is_noload): Ditto.
10324 (Output_section::is_noload_): New data member.
10325 * script-c.h (Script_section_type): New enum type.
10326 (struct Parser_output_section_header): Add new file section_type.
10327 * script-sections.cc (Sections_element::output_section_name): Add
10328 parameter for returning script section type.
10329 (Output_section_definition::output_section_name): Ditto.
10330 (Output_section_definition::section_type)P; New method.
10331 (Output_section_definiton::script_section_type_name): Ditto.
10332 (Output_section_definition::script_section_type_): New data member.
10333 (Output_section_definition::Output_section_definition): Initialize
10334 data member Output_section_definition::script_section_type_.
10335 (Output_section_definition::create_sections): Pass script section type
10336 to Layout::make_output_section_for_script.
10337 (Output_section_definition::output_section_name): Return script
10338 section type to caller.
10339 (Output_section_definition::set_section_address): Do not advance
10340 dot value and load address if section type is NOLOAD. Set address
10341 of NOLOAD sections regardless of section flags.
10342 (Output_section_definition::print): Print section type if it is
10343 not SCRIPT_SECTION_TYPE_NONE.
10344 (Output_section_definition::section_type): New method.
10345 (Output_section_definition::script_section_type_name): Ditto.
10346 (Script_sections::output_section_name): Add new parameter
10347 PSECTION_TYPE for returning script section type. Pass it to
10348 section elements. Handle discard sections.
10349 (Sort_output_sections::operator()): Handle NOLOAD sections.
10350 * script-sections.h (Script_sections::Section_type): New enum type.
10351 (Script_sections::output_section_name): Add a new parameter for
10352 returning script section type.
10353 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10354 INFO and NOLOAD.
10355 * yyscript.y (union): Add new field SECTION_TYPE.
10356 (COPY, DSECT, INFO, NOLOAD): New tokens.
10357 (opt_address_and_section_type): Change type to output_section_header.
10358 (section_type): New non-terminal
10359 (section_header): Handle section type.
10360 (opt_address_and_section_type): Return section type value.
10361
10362 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10363
10364 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10365 * testsuite/plugin_common_test_2.c (foo): Likewise.
10366
10367 2010-04-08 Doug Kwan <dougkwan@google.com>
10368
10369 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10370 Output_merge_data.
10371 * output.cc (Output_section::add_merge_input_section): Simplify
10372 code and return status of Output_merge_base::add_input_section.
10373 Update merge section map only if Output_merge_base::add_input_section
10374 returns true.
10375
10376 2010-04-07 Doug Kwan <dougkwan@google.com>
10377
10378 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10379 if section is marked as containing instructions but has no mapping
10380 symbols.
10381 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10382 correct section index.
10383 (Arm_relobj::find_linked_text_section): Ditto.
10384
10385 2010-04-07 Cary Coutant <ccoutant@google.com>
10386
10387 * archive.cc (include_member): Destroy Read_symbols_data object before
10388 releasing file.
10389 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10390 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10391 (Read_symbols_data::~Read_symbols_data) New destructor.
10392 (Section_relocs::Section_relocs) New constructor.
10393 (Section_relocs::~Section_relocs) New destructor.
10394 (Read_relocs_data::Read_relocs_data) New constructor.
10395 (Read_relocs_data::~Read_relocs_data) New destructor.
10396 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10397 pointers to NULL after deleting.
10398
10399 2010-04-07 Doug Kwan <dougkwan@google.com>
10400
10401 * arm.cc: Replace "endianity" with "endianness" in comments.
10402 (Arm_exidx_cantunwind): Ditto.
10403 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10404 (Arm_relobj::merge_flags_and_attributes): New method.
10405 (Arm_relobj::merge_flags_and_attributes_): New data member.
10406 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10407 (Arm_relobj::scan_sections_for_stubs): Ditto.
10408 (Arm_relobj::do_read_symbols): Check to see if we really want to
10409 merge processor-specific flags and attributes. Exit early if
10410 an object is empty except for section names and the undefined symbol.
10411 (Target_arm::do_finalize_sections): Move check for ELF format to
10412 Arm_relobj::do_read_symbols. Merge processor specific flags and
10413 attributes from a regular object only when we have determined that
10414 it is aapropriate. Do not create an .ARM.attributes section in
10415 output if there is no regular input object.
10416 (Target_arm::merge_processor_specific_flags): Check
10417 --warn-mismatch before printing any error.
10418 (Target_arm::merge_object_attributes): Ditto.
10419 * gold.cc (queue_middle_tasks): Handle the case in which there is
10420 no regular object in input.
10421 * options.cc (General_options::parse_EB): New method.
10422 (General_options::parse_EL): Same.
10423 (General_options::General_options): Initialize endianness_.
10424 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10425 New options.
10426 (General_options::Endianness): New enum.
10427 (General_options::endianness): New method.
10428 (General_options::endianness_): New data member.
10429 * parameters.cc (Parameters::set_options): Check target endianness.
10430 (Parameters::set_target_once): Ditto.
10431 (Parameters::check_target_endianness): New method.
10432 (parameters_force_valid_target): If either -EL or -EB is specified,
10433 use it to define endianness of default target.
10434 * parameters.h (Parameters::check_target_endianness): New method
10435 declaration.
10436 * target.h (class Target): Change "endianity" to "endianness"
10437 in comments.
10438
10439 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10440
10441 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10442 * configure: Regenerate.
10443 * Makefile.in: Regenerate.
10444 * testsuite/Makefile.in: Regenerate.
10445
10446 2010-04-06 Cary Coutant <ccoutant@google.com>
10447
10448 gcc PR lto/42757
10449 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10450 prevailing definitions of common symbols.
10451 * testsuite/plugin_test_6.sh: New test case.
10452 * testsuite/plugin_common_test_1.c: New test case.
10453 * testsuite/plugin_common_test_2.c: New test case.
10454 * testsuite/Makefile.am (plugin_test_6): New test case.
10455 * testsuite/Makefile.in: Regenerate.
10456
10457 2010-04-06 Nick Clifton <nickc@redhat.com>
10458
10459 * po/vi.po: New Vietnamese translation.
10460
10461 2010-03-30 Doug Kwan <dougkwan@google.com>
10462
10463 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10464
10465 2010-03-25 Doug Kwan <dougkwan@google.com>
10466
10467 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10468 to avoid a conversion warning on a 32-bit host.
10469
10470 2010-03-24 Ian Lance Taylor <iant@google.com>
10471
10472 * testsuite/script_test_3.t: Add a TLS segment.
10473 * testsuite/Makefile.am (check_PROGRAMS): Add
10474 tls_phdrs_script_test.
10475 (tls_phdrs_script_test_SOURCES): Define.
10476 (tls_phdrs_script_test_DEPENDENCIES): Define.
10477 (tls_phdrs_script_test_LDFLAGS): Define.
10478 (tls_phdrs_script_test_LDADD): Define.
10479 * testsuite/Makefile.in: Rebuild.
10480
10481 2010-03-23 Cary Coutant <ccoutant@google.com>
10482
10483 * fileread.cc (find_or_make_view): Fix comment.
10484
10485 2010-03-23 Ian Lance Taylor <iant@google.com>
10486
10487 * script-sections.cc (class Orphan_section_placement): Define
10488 PLACE_TLS and PLACE_TLS_BSS.
10489 (Orphan_section_placement::Orphan_section_placement): Initialize
10490 new places.
10491 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10492 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10493 (tls_script_test_SOURCES): Define.
10494 (tls_script_test_DEPENDENCIES): Define.
10495 (tls_script_test_LDFLAGS): Define.
10496 (tls_script_test_LDADD): Define.
10497 * testsuite/Makefile.in: Rebuild.
10498
10499 2010-03-22 Doug Kwan <dougkwan@google.com>
10500
10501 * arm.cc (Arm_relocate_functions::abs8,
10502 Arm_relocate_functions::abs16): Use correct check for overflow
10503 specified in the ARM ELF specs.
10504 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10505 target of a BLX instruction specially.
10506 (Reloc_stub::stub_type_for_reloc): Ditto.
10507 (Relocate::relocate): Use symbolic names instead of numeric relocation
10508 codes to report error.
10509 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10510 workaround.
10511 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10512 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10513 thumb2_blx_out_of_range.stdout
10514 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10515 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10516 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10517 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10518 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10519 thumb2_blx_in_range, thumb2_blx_in_range.o,
10520 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10521 thumb2_blx_out_of_range.o): New rules.
10522 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10523 thumb2_blx_in_range and thumb2_blx_out_of_range.
10524 * testsuite/Makefile.in: Regenerate.
10525 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10526 * testsuite/thumb_blx_in_range.s: New file.
10527 * testsuite/thumb_blx_out_of_range.s: New file.
10528
10529 2010-03-22 Rafael Espindola <espindola@google.com>
10530
10531 * archive.cc (Should_include): Move to archive.h.
10532 (should_include_member): Make it a member of Archive.
10533 (Lib_group): New.
10534 (Add_lib_group_symbols): New.
10535 * archive.h: Include options.h.
10536 (Archive_member): Moved from Archive.
10537 (Should_include): Moved from archive.cc.
10538 (Lib_group): New.
10539 (Add_lib_group_symbols): New.
10540 * dynobj.cc (do_should_include_member): New.
10541 * dynobj.h (do_should_include_member): New.
10542 * gold.cc (queue_initial_tasks): Update call to queue.
10543 * main.cc (main): Print lib group stats.
10544 * object.cc (do_should_include_member): New.
10545 * object.h: Include archive.h.
10546 (Object::should_include_member): New.
10547 (Object::do_should_include_member): New.
10548 (Sized_relobj::do_should_include_member): New.
10549 * options.cc (General_options::parse_start_lib): New.
10550 (General_options::parse_end_lib): New.
10551 (Input_arguments::add_file): Handle lib groups.
10552 (Input_arguments::start_group): Check we are not in a lib.
10553 (Input_arguments::start_lib): New.
10554 (Input_arguments::end_lib): New.
10555 * options.h (General_options): Add start_lib and end_lib.
10556 (Input_argument::lib_): New.
10557 (Input_argument::lib): New.
10558 (Input_argument::is_lib): New.
10559 (Input_file_lib): New.
10560 (Input_arguments::in_lib_): New.
10561 (Input_arguments::in_lib): New.
10562 (Input_arguments::start_lib): New.
10563 (Input_arguments::end_lib_): New.
10564 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10565 in unused members as preempted.
10566 (Sized_pluginobj::do_should_include_member): New.
10567 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10568 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10569 return the blocker.
10570 (Read_symbols::do_whole_lib_group): New.
10571 (Read_symbols::do_lib_group): New.
10572 (Read_symbols::do_read_symbols): Handle lib groups.
10573 (Read_symbols::get_name): Handle lib groups.
10574 * readsyms.h (Read_symbols): Add an archive member pointer.
10575 (Read_symbols::do_whole_lib_group): New.
10576 (Read_symbols::do_lib_group): New.
10577 (Read_symbols::member_): New.
10578 * script.cc (read_input_script): Update call to queue_soon.
10579
10580 2010-03-19 Doug Kwan <dougkwan@google.com>
10581
10582 * arm.cc (Stub_table::Stub_table): Initialize new data members
10583 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10584 (Stub_table::add_reloc_stub): Assign stub offset and update
10585 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10586 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10587 New data members.
10588 (Stub_table::update_data_size_and_addralign): Use
10589 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10590 instead of going over all reloc stubs.
10591 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10592 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10593 Stringpool_template::offset_ to size of Stringpool_char.
10594 (Stringpool_template::new_key_offset): Remove code to initialize
10595 Stringpool_template::offset_.
10596 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10597 Stringpool_template::offset_ to zero.
10598
10599 2010-03-15 Doug Kwan <dougkwan@google.com>
10600
10601 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10602 offset_.
10603 (Stringpool_template::new_key_offset): New method.
10604 (Stringpool_template::add_string): Assign offsets when adding new
10605 strings.
10606 (Stringpool_template::set_string_offsets): Do not set string offsets
10607 when not optimizing.
10608 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10609 member size_.
10610 (Chunked_vector::clear): Clear size_.
10611 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10612 (Chunked_vector::size): Return size_.
10613 (Chunked_vector::push_back): Use size_ to find insert position.
10614 (Chunked_vector::size_): New data member.
10615 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10616 (Stringpool_template::new_key_offset): New method declaration.
10617 (Stringpool_template::offset_): New data member.
10618
10619 2010-03-15 Rafael Espindola <espindola@google.com>
10620
10621 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10622 Add_symbols' constructor.
10623 * readsyms.h (Add_symbols): Remove the input_group member.
10624
10625 2010-03-10 Ian Lance Taylor <iant@google.com>
10626
10627 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10628 target to ask whether a reference to a symbol requires a stack
10629 split.
10630 * target.h (Target::is_call_to_non_split): New function.
10631 (Target::do_is_call_to_non_split): Declare virtual function.
10632 * target.cc: Include "symtab.h".
10633 (Target::do_is_call_to_non_split): New function.
10634 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10635
10636 2010-03-10 Cary Coutant <ccoutant@google.com>
10637
10638 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10639 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10640 (File_read::open[2]): Add whole_file_view_ to list of views.
10641 (File_read::make_view): Remove test of whole_file_view_.
10642 (File_read::find_or_make_view): Create whole_file_view_ if
10643 necessary.
10644 (File_read::clear_views): Replace bool parameter with enum;
10645 adjust all callers. Don't delete views with permanent data;
10646 do delete cached views and views from archives if
10647 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10648 if clearing the corresponding view.
10649 * fileread.h (File_read::Clear_views_mode): New enum.
10650 (File_read::View::is_permanent_view): New method.
10651 (File_read::clear_views): Replace bool parameter
10652 with enum; adjust all callers.
10653 * options.h (General_options): Change keep_files_mapped option;
10654 add map_whole_files.
10655 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10656 releasing the file.
10657 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10658 the file.
10659
10660 2010-03-10 David S. Miller <davem@davemloft.net>
10661
10662 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10663
10664 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10665
10666 * icf.cc (get_section_contents): Add '@' marker after processing the
10667 merge reloc.
10668
10669 2010-03-08 Doug Kwan <dougkwan@google.com>
10670
10671 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10672 due to a conversion warning.
10673 (Arm_relobj::update_output_local_symbol_count): Check for local
10674 symbol with unset output index.
10675
10676 2010-03-05 Ian Lance Taylor <iant@google.com>
10677
10678 * options.h (class General_options): Add --spare-dynamic-tags.
10679 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10680 --spare-dynamic-tags.
10681
10682 2010-03-05 Ian Lance Taylor <iant@google.com>
10683
10684 * incremental.cc: Include "libiberty.h".
10685
10686 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10687
10688 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10689 function, is_info_ member.
10690 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10691 (Versions::Versions): Update caller.
10692 (Versions::define_base_version): Likewise.
10693 (Versions::add_def): Likewise.
10694
10695 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10696
10697 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10698 (Scan::possible_function_pointer_reloc): New function.
10699 (Scan::local_reloc_may_be_function_pointer): Change to call
10700 possible_function_pointer_reloc.
10701 (Scan::global_reloc_may_be_function_pointer): Ditto.
10702 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10703 relocations in ".data.rel.ro._ZTV" section.
10704 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10705 * testsuite/icf_safe_so_test.cc: Ditto.
10706 * testsuite/icf_safe_test.cc: Ditto.
10707 * testsuite/icf_safe_test.sh: Ditto.
10708
10709 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10710 Ian Lance Taylor <iant@google.com>
10711
10712 * target-reloc.h (relocate_section): Check the symbol table index
10713 for -1U before setting the local symbol index.
10714 (scan_relocatable_relocs): If copying the relocation, record that
10715 the local symbol is required.
10716 * object.h (Symbol_value::is_output_symtab_index_set): New
10717 function.
10718 (Symbol_value::may_be_discarded_from_output_symtab): New
10719 function.
10720 (Symbol_value::has_output_symtab_entry): New function.
10721 (Symbol_value::needs_output_symtab_entry): Remove.
10722 (Symbol_value::output_symtab_index): Make sure the symbol index is
10723 set.
10724 (Symbol_value::set_output_symtab_index): Make sure the symbol
10725 index is not set. Make sure the new index is valid.
10726 (Symbol_value::set_must_have_output_symtab_entry): New function.
10727 (Symbol_value::has_output_dynsym_entry): New function.
10728 (Symbol_value::set_output_dynsym_index): Make sure the new index
10729 is valid.
10730 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10731 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10732 local symbol if permitted.
10733 (Sized_relobj::do_finalize_local_symbols): Call
10734 is_output_symtab_index_set rather than needs_output_symtab_entry.
10735 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10736 rather than needs_output_symtab_entry. Call
10737 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10738 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10739 is_output_symtab_index_set rather than needs_output_symtab_entry.
10740 * testsuite/discard_locals_relocatable_test.c: New file.
10741 * testsuite/discard_locals_test.sh: Test -r.
10742 * testsuite/Makefile.am (check_DATA): Add
10743 discard_locals_relocatable_test1.syms,
10744 discard_local_relocatable_test2.syms.
10745 (MOSTLYCLEANFILES): Likewise. Also add
10746 discard_locals_relocatable_test1.lout and
10747 discard_locals_relocatable_test2.out.
10748 (discard_locals_relocatable_test1.syms): New target.
10749 (discard_locals_relocatable_test.o): New target.
10750 (discard_locals_relocatable_test1.out): New target.
10751 (discard_locals_relocatable_test2.syms): New target.
10752 (discard_locals_relocatable_test2.out): New target.
10753 (various): Add missing ../ld-new dependencies.
10754 * testsuite/Makefile.in: Rebuild.
10755
10756 2010-03-03 Nick Clifton <nickc@redhat.com>
10757
10758 * po/fi.po: New Finnish translation.
10759
10760 2010-03-01 Doug Kwan <dougkwan@google.com>
10761
10762 * layout.cc (Layout::Layout): Force section types of .init_array*,
10763 .preinit_array* and .fini_array* sections.
10764 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10765 Fix check of return value of std::string::find.().
10766 (Output_section::Input_section_sort_compare::operator()): Remove
10767 comment about .init_array.
10768 (Output_section::Input_section_sort_init_fini_compare::operator()):
10769 New method.
10770 (Output_section::sort_attached_input_sections): Handle .init_array
10771 and .fini_array specially.
10772 * output.h (Output_section::Inut_section_sort_compare): Update
10773 comment.
10774 (Output_section::Input_section_sort_init_fini_compare): New struct.
10775
10776 2010-02-26 Doug Kwan <dougkwan@google.com>
10777
10778 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10779 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10780 * testsuite/debug_msg.sh: Avoid matching source line number for
10781 use of global variable undef_int.
10782
10783 2010-02-26 Doug Kwan <dougkwan@google.com>
10784
10785 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10786 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10787 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10788 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10789 * options.cc (General_options::General_options): Initialize member
10790 fix_v4bx_.
10791 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10792 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10793 and rm_no_fix_v4bx.stdout
10794 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10795 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10796 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10797 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10798 and arm_no_fix_v4bx.
10799 * Makefile.in: Regenerate.
10800 * testsuite/arm_fix_v4bx.s: New file.
10801 * testsuite/arm_fix_v4bx.sh: Ditto.
10802
10803 2010-02-24 Doug Kwan <dougkwan@google.com>
10804
10805 * arm.cc (Target_arm::got_section): Make the .got section the first
10806 non RELRO section in the data segment.
10807 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10808 suffixes of section names.
10809
10810 2010-02-24 Doug Kwan <dougkwan@google.com>
10811
10812 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10813 flags and attributes merging if an input file is a binary file.
10814 * fileread.cc (Input_file::open): Record format of original file.
10815 * fileread.h (Input_file::Format): New enum type.
10816 (Input_file::Input_file): Initialize data member format_.
10817 (Input_file::format): New method definition.
10818 (Input_file::format_):: New data member.
10819
10820 2010-02-24 Doug Kwan <dougkwan@google.com>
10821
10822 * arm.cc (Arm_output_data_got): New class.
10823 (ARM_TCB_SIZE): New constant
10824 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10825 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10826 If user uses a script with a SECTIONS clause, issue only a warning
10827 for a misplaced EXIDX input section. Otherwise, issue an error.
10828 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10829 garbage collection.
10830 (Target_arm::got_mode_index_entry): Handle static linking.
10831 (Target_arm::Scan::local): Ditto.
10832 (Target_arm::Scan::global): Ditto.
10833 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10834 all incorrectly implemented relocations.
10835 (Target_arm::fix_exidx_coverage): Pass layout to
10836 Arm_output_section::fix_exidx_coverage.
10837 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10838 from ".ARM.exidx." and ".ARM.extab.".
10839
10840 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10841
10842 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10843 section if it does not already exist.
10844 * attributes.cc (Attributes_section_data::Attributes_section_data):
10845 Don't crash if size is zero.
10846
10847 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10848 Ian Lance Taylor <iant@google.com>
10849
10850 * gold.cc (queue_middle_tasks): If no input files were opened,
10851 exit.
10852 * workqueue.h (Task_function::Task_function): Assert that there is
10853 a blocker.
10854
10855 2010-02-22 Doug Kwan <dougkwan@google.com>
10856
10857 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10858 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10859 types to avoid warnings due to different uint64_t implementations
10860 on different hosts.
10861
10862 2010-02-21 Doug Kwan <dougkwan@google.com>
10863
10864 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10865 handling of the maximum backward branch offset.
10866 (Arm_relocate_functions::thumb_branch_common): Ditto.
10867 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10868 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10869 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10870 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10871 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10872 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10873 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10874 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10875 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10876 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10877 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10878 thumb2_bl_out_of_range.o): New rules.
10879 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10880 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10881 thumb2_bl_out_of_range
10882 * testsuite/Makefile.in: Regenerate.
10883 * testsuite/arm_bl_in_range.s: New file.
10884 * testsuite/arm_bl_out_of_range.s: Ditto.
10885 * testsuite/arm_branch_in_range.sh: Ditto.
10886 * testsuite/arm_branch_range.t: Ditto.
10887 * testsuite/thumb2_branch_range.t: Ditto.
10888 * testsuite/thumb_bl_in_range.s: Ditto.
10889 * testsuite/thumb_bl_out_of_range.s: Ditto.
10890 * testsuite/thumb_branch_range.t: Ditto.
10891
10892 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10893
10894 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10895 Add reloc offset information.
10896 * icf.cc (get_section_contents): Change iterators to point to the new
10897 vectors. Add reloc offset information to the contents.
10898 * icf.h (Icf::Sections_reachable_info): New typedef.
10899 (Icf::Sections_reachable_list): New typedef.
10900 (Icf::Offset_info): New typedef.
10901 (Icf::Reloc_info): New struct typedef.
10902 (Icf::Reloc_info_list): New typedef.
10903 (Icf::symbol_reloc_list): Delete method.
10904 (Icf::addend_reloc_list): Delete method.
10905 (Icf::section_reloc_list): Delete method.
10906 (Icf::reloc_info_list): New method.
10907 (Icf::reloc_info_list_): New member.
10908
10909 2010-02-19 Doug Kwan <dougkwan@google.com>
10910
10911 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10912 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10913 * arm.cc (Arm_relocation_functions): New forward declaration.
10914 (Target_arm::Target_arm): Initialize new data members
10915 got_mod_index_offset_ and tls_base_symbol_defined_.
10916 (Target_arm::Relocate::relocate_tls): New method.
10917 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10918 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10919 New methods.
10920 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10921 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10922 (Target_arm::got_mod_index_offset_,
10923 Target_arm::tls_base_symbol_defined_): New data members.
10924 (Target_arm::Scan::local, Target::Scan::global,
10925 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10926 relocations.
10927
10928 2010-02-18 Doug Kwan <dougkwan@google.com>
10929
10930 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10931 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10932 text section as a parameter becuase some broken tools may not set
10933 the link in section header.
10934 (Target_arm::has_got_section): New method.
10935 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10936 without any mapping symbol as data only. Remove warning.
10937 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10938 link in its section header, try to discover the link by inspecting the
10939 REL31 relocation at the beginning of the section.
10940 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10941 in error message.
10942 (Target_arm::Scan::global): Treat any reference to the symbol
10943 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10944
10945 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10946
10947 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10948 (Scan::global_reloc_may_be_function_pointer): New function.
10949 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10950 (Scan::global_reloc_may_be_function_pointer): New function.
10951 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10952 (Scan::global_reloc_may_be_function_pointer): New function.
10953 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10954 (Scan::global_reloc_may_be_function_pointer): New function.
10955 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10956 (Scan::global_reloc_may_be_function_pointer): New function.
10957 (Scan::possible_function_pointer_reloc): New function.
10958 (Target_x86_64::can_check_for_function_pointers): New function.
10959 * gc.h (gc_process_relocs): Scan relocation types to determine if
10960 function pointers were taken for targets that support it.
10961 * icf.cc (Icf::find_identical_sections): Include functions for
10962 folding in safe ICF whose pointer is not taken.
10963 * icf.h (Secn_fptr_taken_set): New typedef.
10964 (fptr_section_id_): New member.
10965 (section_has_function_pointers): New function.
10966 (set_section_has_function_pointers): New function.
10967 (check_section_for_function_pointers): New function.
10968 * options.h: Fix comment for safe ICF option.
10969 * target.h (can_check_for_function_pointers): New function.
10970 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10971 Modify icf_safe_test for X86-64.
10972 * testsuite/Makefile.in: Regenerate.
10973 * testsuite/icf_safe_so_test.cc: New file.
10974 * testsuite/icf_safe_so_test.sh: New file.
10975 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10976 (main): Change to take pointer to function kept_func_3.
10977 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10978 folding is done correctly for X86-64.
10979
10980 2010-02-12 David S. Miller <davem@davemloft.net>
10981
10982 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10983 is_symbolless parameter.
10984 (Output_reloc<SHT_REL>::is_symbolless): New.
10985 (Output_reloc<SHT_REL>::is_symbolless_): New.
10986 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10987 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10988 (Output_reloc<SHT_RELA>::is_symbolless): New.
10989 (Output_data_reloc::add_global): Handle is_symbolless.
10990 (Output_data_reloc::add_global_relative): Likewise.
10991 (Output_data_reloc::add_local): Likewise.
10992 (Output_data_reloc::add_local_relative): Likewise.
10993 (Output_data_reloc::add_symbolless_global_addend): New.
10994 (Output_data_reloc::add_symbolless_local_addend): New.
10995 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10996 is_symbolless.
10997 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10998 instead of ->is_relative_
10999 (Output_reloc::write): Likewise.
11000 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11001 (Output_reloc::write_rel): Simplify.
11002
11003 * sparc.cc (Target_sparc::Scan::local): Use
11004 ->add_symbolless_local_addend as needed.
11005 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11006 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11007 based upon relocation offset.
11008
11009 2010-02-11 Doug Kwan <dougkwan@google.com>
11010
11011 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11012 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11013 beginning of function.
11014 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11015 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11016 parameter is_32bit in calls to should_apply_static_reloc.
11017 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11018 (check_DATA): Add arm_abs_global.stdout.
11019 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11020 arm_abs_global.stdout): New rules.
11021 (MOSTLLYCLEANFILES): Add arm_abs_global
11022 * Makefile.in: Regenerate.
11023 * testsuite/arm_abs_global.s: New file.
11024 * testsuite/arm_abs_global.sh: Ditto.
11025 * testsuite/arm_abs_lib.s: Ditto.
11026
11027 2010-02-11 Ian Lance Taylor <iant@google.com>
11028
11029 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11030 Read_relocs task.
11031 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11032 Allocate_commons_task first.
11033 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11034 task, rather than symtab_lock_.
11035 (Gc_process_relocs::~Gc_process_relocs): New function.
11036 (Gc_process_relocs::is_runnable): Check this_blocker_.
11037 (Gc_process_relocs::locks): Use next_blocker_ rather than
11038 blocker_.
11039 (Scan_relocs::~Scan_relocs): New function.
11040 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11041 symtab_lock_.
11042 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11043 next_blocker_.
11044 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11045 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11046 constructor accordingly.
11047 (class Gc_process_relocs): Likewise.
11048 (class Scan_relocs): Likewise.
11049 * common.h (class Allocate_commons_task): Remove symtab_lock_
11050 field, and corresponding constructor parameter.
11051 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11052 symtab_lock_.
11053 (Allocate_commons_task::locks): Likewise.
11054
11055 2010-02-11 Ian Lance Taylor <iant@google.com>
11056
11057 * gold-threads.h (class Once): Define.
11058 (class Initialize_lock): Rewrite as child of Once.
11059 * gold-threads.cc (class Once_initialize): Define.
11060 (once_pointer_control): New static variable.
11061 (once_pointer, once_arg): New static variables.
11062 (c_run_once): New static function.
11063 (Once::Once, Once::run_once, Once::internal_run): New functions.
11064 (class Initialize_lock_once): Remove.
11065 (initialize_lock_control): Remove.
11066 (initialize_lock_pointer): Remove.
11067 (initialize_lock_once): Remove.
11068 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11069 (Initialize_lock::initialize): Rewrite.
11070 (Initialize_lock::do_run_once): New function.
11071 * archive.cc (Archive::interpret_header): Only clear name if it is
11072 not already empty.
11073 * fileread.cc: Include "gold-threads.h"
11074 (file_counts_lock): New static variable.
11075 (file_counts_initialize_lock): Likewise.
11076 (File_read::release): Only increment counts when using --stats.
11077 Use a lock around the increment.
11078 * parameters.cc (class Set_parameters_target_once): Define.
11079 (set_parameters_target_once): New static variable.
11080 (Parameters::Parameters): Move here from parameters.h.
11081 (Parameters::set_target): Rewrite.
11082 (Parameters::set_target_once): New function.
11083 (Parameters::clear_target): Move here and rewrite.
11084 * parameters.h (class Parameters): Update declarations. Add
11085 set_parameters_target_once_ field.
11086 (Parameters::Parameters): Move to parameters.cc.
11087 (Parameters::clear_target): Likewise.
11088 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11089 task.
11090 (Start_group::~Start_group): New function.
11091 (Start_group::is_runnable): New function.
11092 (Start_group::locks, Start_group::run): New functions.
11093 (Finish_group::run): Change saw_undefined to size_t.
11094 * readsyms.h (class Start_group): Define.
11095 (class Finish_group): Change saw_undefined_ field to size_t.
11096 (Finish_group::Finish_group): Remove saw_undefined and
11097 this_blocker parameters. Change all callers.
11098 (Finish_group::set_saw_undefined): New function.
11099 (Finish_group::set_blocker): New function.
11100 * symtab.h (class Symbol_table): Change saw_undefined to return
11101 size_t. Change saw_undefined_ field to size_t.
11102 * target-select.cc (Set_target_once::do_run_once): New function.
11103 (Target_selector::Target_selector): Initialize set_target_once_
11104 field. Don't initialize lock_ and initialize_lock_ fields.
11105 (Target_selector::instantiate_target): Rewrite.
11106 (Target_selector::set_target): New function.
11107 * target-select.h (class Set_target_once): Define.
11108 (class Target_selector): Update declarations. Make
11109 Set_target_once a friend. Remove lock_ and initialize_lock_
11110 fields. Add set_target_once_ field.
11111
11112 2010-02-10 Ian Lance Taylor <iant@google.com>
11113
11114 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11115 queueing any tasks.
11116 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11117 (queue_middle_tasks): Add all blockers before queueing any tasks.
11118 (queue_final_tasks): Likewise.
11119 * token.h (Task_token::add_blockers): New function.
11120 * object.h (Input_objects::number_of_relobjs): New function.
11121
11122 2010-02-10 Ian Lance Taylor <iant@google.com>
11123
11124 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11125 shared, not if not position independent.
11126 * x86_64.cc (Relocate::relocate_tls): Likewise.
11127 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11128 (tls_pie_pic_test): New target.
11129 * testsuite/Makefile.in: Rebuild.
11130
11131 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11132 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11133 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11134 * testsuite/Makefile.in: Rebuild.
11135
11136 2010-02-09 David S. Miller <davem@davemloft.net>
11137
11138 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11139 R_SPARC_RELATIVE using ->add_local_relative().
11140 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11141
11142 * output.h (Output_data_dynamic::add_section_size): New method
11143 that takes two Output_data objects.
11144 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11145 entry param. Handle it in initializers.
11146 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11147 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11148 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11149 arg.
11150 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11151 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11152 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11153 for dynrel_includes_plt.
11154 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11155 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11156 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11157 before .rela.plt
11158 (Target_sparc::do_finalize_sections): Update to pass true for
11159 dynrel_includes_plt.
11160 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11161 output before .rela.plt
11162 (Target_powerpc::do_finalize_sections): Update to pass true for
11163 dynrel_includes_plt when 32-bit.
11164
11165 2010-02-08 Doug Kwan <dougkwan@google.com>
11166
11167 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11168 method.
11169 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11170 Arm_relobj::scan_section_for_cortex_a8_stubs,
11171 Arm_relobj::do_relocation_section): Instead of calling
11172 Output_section::output_address, use faster
11173 Arm_relobj::simple_input_section_output_address.
11174
11175 2010-02-08 David S. Miller <davem@davemloft.net>
11176
11177 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11178 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11179 relocation helper function.
11180
11181 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11182 just like R_SPARC_GOT{10,13,22}.
11183 (Target_sparc::Scan::local): Likewise.
11184 (Target_sparc::Relocate:relocate): Likewise.
11185
11186 2010-02-06 Ian Lance Taylor <iant@google.com>
11187
11188 * configure.ac: Rewrite targetobjs duplicate removal code to use
11189 only shell constructs.
11190 * configure: Rebuild.
11191
11192 2010-02-05 Doug Kwan <dougkwan@google.com>
11193
11194 PR 11247
11195 * arm.cc (Arm_relobj::section_is_scannable): New method.
11196 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11197 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11198
11199 2010-02-04 Doug Kwan <dougkwan@google.com>
11200
11201 PR 11247
11202 * arm-reloc-property.cc (cstdio): Include.
11203 * configure.ac (targetobjs): Remove duplicates.
11204 * configure: Regenerate.
11205 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11206 big and little endian version for a given address size.
11207
11208 2010-02-03 Doug Kwan <dougkwan@google.com>
11209
11210 * arm-reloc-property.cc
11211 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11212 definition.
11213 * arm-reloc-property.h
11214 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11215 New method definition.
11216 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11217 declaration.
11218 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11219 overflow to N.
11220 (GOT_PREL): Change implemented to Y.
11221 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11222 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11223 (Arm_relocate_functions::movw_abs_nc): Remove method.
11224 (Arm_relocate_functions::movt_abs): Ditto.
11225 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11226 (Arm_relocate_functions::thm_movt_abs): Ditto.
11227 (Arm_relocate_functions::movw_rel_nc): Ditto.
11228 (Arm_relocate_functions::movw_rel): Ditto.
11229 (Arm_relocate_functions::movt_rel): Ditto.
11230 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11231 (Arm_relocate_functions:thm_movw_rel): Ditto.
11232 (Arm_relocate_functions:thm_movt_rel): Ditto.
11233 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11234 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11235 New method definitions.
11236 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11237 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11238 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11239 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11240 (Target_arm::Relocate::relocate): Check for non-static or
11241 unimplemented relocation code and exit early. Change calls to
11242 Target_arm::reloc_uses_thumb_bit and
11243 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11244 instead. Refactor code to handle similar relocations to increase
11245 code sharing. Remove check for unsupported relocation code in switch
11246 statement.
11247 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11248 relocation property table to find out size. Change error message to
11249 print out the name of a relocation code instead of the numeric value.
11250 (Target_arm::scan_reloc_for_stub): Use relocation property table
11251 instead of calling Target_arm::reloc_uses_thumb_bit().
11252
11253 2010-02-02 Doug Kwan <dougkwan@google.com>
11254
11255 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11256 types of relaxed input section.
11257
11258 2010-02-02 Doug Kwan <dougkwan@google.com>
11259
11260 * Makefile.am (HFILES): Add arm-reloc-property.h.
11261 (DEFFILES): New.
11262 (TARGETSOURCES): Add arm-reloc-property.cc
11263 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11264 (libgold_a_SOURCES): $(DEFFILES)
11265 * Makefile.in: Regenerate.
11266 * arm-reloc-property.cc: New file.
11267 * arm-reloc-property.h: New file.
11268 * arm-reloc.def: New file.
11269 * arm.cc: Update comments.
11270 (arm-reloc-property.h): New included header.
11271 (arm_reloc_property_table): New global variable.
11272 (Target_arm::do_select_as_default_target): New method definition.
11273 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11274 arm-reloc-property to targ_extra_obj.
11275 * parameters.cc (set_parameters_target): Call
11276 Target::select_as_default_target().
11277 * target.h (Target::select_as_default_target): New method definition.
11278 (Target::do_select_as_default_target): Same.
11279
11280 2010-02-01 Doug Kwan <dougkwan@google.com>
11281
11282 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11283 first_output_text_section_.
11284 (Arm_exidx_fixup::first_output_text_section): New method definition.
11285 (Arm_exidx_fixup::first_output_text_section_): New data member.
11286 (Arm_exidx_fixup::process_exidx_section): Record the first text
11287 output section seen.
11288 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11289 and entsize in output section header.
11290
11291 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11292
11293 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11294 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11295 (Arm_relocate_functions::thm_alu11): New Method.
11296 (Arm_relocate_functions::thm_pc8): New Method.
11297 (Arm_relocate_functions::thm_pc12): New Method.
11298 (Target_arm::Scan::local): Handle the relocations.
11299 (Target_arm::Scan::global): Likewise.
11300 (Target_arm::Relocate::relocate): Likewise.
11301 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11302
11303 2010-01-29 Doug Kwan <dougkwan@google.com>
11304
11305 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11306 of relocation types as ld.
11307
11308 2010-01-29 Doug Kwan <dougkwan@google.com>
11309
11310 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11311 to public.
11312 (Arm_relocate_functions::thumb_branch_common): Ditto.
11313 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11314 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11315 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11316 Arm_relocate_functions::jump24): Remove.
11317 (Target_arm::Relocate::relocate): Adjust code to call
11318 Arm_relocation_functions::arm_branch_common and
11319 Arm_relocation_functions::thumb_branch_common instead of their removed
11320 wrappers. Merge switch-cases together to reduce source code size.
11321
11322 2010-01-29 Doug Kwan <dougkwan@google.com>
11323
11324 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11325 output_local_symbol_count_needs_update_.
11326 (Arm_relobj::output_local_symbol_count_needs_update,
11327 Arm_relobj::set_output_local_symbol_count_needs_update,
11328 Arm_relobj::update_output_local_symbol_count): New methods.
11329 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11330 member.
11331 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11332 of pointed function as in a R_ARM_PREL31 relocation.
11333 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11334 for output local symbol count updating.
11335 (Target_arm::do_relax): Update output local symbol counts in objects
11336 if necessary.
11337 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11338
11339 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11340
11341 * arm.cc: Added support for the ARM relocations:
11342 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11343 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11344 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11345 movw_prel_nc).
11346 (Arm_relocate_functions::movw_rel): New method.
11347 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11348 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11349 thm_movw_prel_nc).
11350 (Arm_relocate_functions::thm_movw_rel): New method.
11351 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11352 thm_movt_prel).
11353 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11354 relocations.
11355 (Target_arm::Scan::global): Likewise.
11356 (Target_arm::Relocate::relocate): Likewise.
11357 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11358 Likewise.
11359
11360 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11361
11362 * arm.cc: Added support for ARM group relocations.
11363 (Target_arm::reloc_needs_sym_origin): New method.
11364 (Arm_relocate_functions::calc_grp_kn): New method.
11365 (Arm_relocate_functions::calc_grp_residual): New method.
11366 (Arm_relocate_functions::calc_grp_gn): New method.
11367 (Arm_relocate_functions::arm_grp_alu): New Method.
11368 (Arm_relocate_functions::arm_grp_ldr): New Method.
11369 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11370 (Arm_relocate_functions::arm_grp_ldc): New Method.
11371 (Target_arm::Scan::local): Handle the ARM group relocations.
11372 (Target_arm::Scan::global): Likewise.
11373 (Target_arm::Relocate::relocate): Likewise.
11374 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11375 Likewise.
11376
11377 2010-01-26 Doug Kwan <dougkwan@google.com>
11378
11379 * arm.cc (set): Include.
11380 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11381 pointer type.
11382 (Arm_output_section::Text_section_list): New type.
11383 (Arm_output_section::append_text_sections_to_list): New method.
11384 (Arm_output_section::fix_exidx_coverage): Ditto.
11385 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11386 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11387 Relobj::set_section_offset() instead of
11388 Sized_relobj::invalidate_section_offset().
11389 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11390 parameter for section headers. Ignore relocation sections for
11391 unallocated sections and EXIDX sections.
11392 (Target_arm::fix_exidx_coverage): New method.
11393 (Target_arm::output_section_address_less_than): New type.
11394 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11395 linked text section instead of the EXIDX section.
11396 (Arm_output_section::create_stub_group): Add an assertion to check
11397 that this is not an EXIDX output section.
11398 (Arm_output_section::append_text_sections_to_list): New method.
11399 (Arm_output_section::fix_exidx_coverage): Ditto.
11400 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11401 Arm_relobj::section_needs_reloc_stub_scanning.
11402 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11403 first pass.
11404 (Target_arm::fix_exidx_coverage): New method.
11405 * object.h (Relobj::set_output_section): New method.
11406 (Sized_relobj::invalidate_section_offset): Remove method.
11407 (Sized_relobj::do_invalidate_section_offset): Remove method.
11408 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11409
11410 2010-01-25 Doug Kwan <dougkwan@google.com>
11411
11412 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11413 Fix warning due to signed and unsigned comparison on a 32-bit host.
11414
11415 2010-01-22 Doug Kwan <dougkwan@google.com>
11416
11417 * arm.cc (Target_arm::do_relax): Record an output section for section
11418 offset adjustment it contains any stub table that has changed.
11419 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11420 offsets in an output section if necessary.
11421 * output.cc (Output_section::Output_section): Initialize
11422 section_offsets_need_adjustments_.
11423 (Output_section::add_input_section_for_script): Renamed to
11424 Output_section::add_simple_input_section.
11425 (Output_section::save_states): Add a comment.
11426 (Output_section::discard_states): New method defintion.
11427 (Output_section::adjust_section_offsets): Same.
11428 * output.h (Output_section::add_input_section_for_script): Renamed to
11429 Output_section::add_simple_input_section.
11430 (Output_section::discard_states): New method declaration.
11431 (Output_section::adjust_section_offsets): Same.
11432 (Output_section::section_offsets_need_adjustment,
11433 Output_section::set_section_offsets_need_adjustment): New method
11434 definitions.
11435 (Output_section::section_offsets_need_adjustment_): New data member.
11436 * script-sections.cc
11437 (Output_section_element_input::set_section_address): Adjust code for
11438 renaming of Output_section::add_input_section_for_script.
11439 (Orphan_output_section::set_section_address): Same.
11440
11441 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11442
11443 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11444 Fix_v4bx enum values .
11445 * gold/options.h (General_options): New option definitions.
11446 (General_options::fix_v4bx): New method.
11447 (General_options::Fix_v4bx): New enum.
11448 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11449 (General_options::parse_fix_v4bx_interworking): New method.
11450
11451 2010-01-22 Doug Kwan <dougkwan@google.com>
11452
11453 * arm.cc (Arm_exidx_fixup): New class.
11454
11455 2010-01-21 Doug Kwan <dougkwan@google.com>
11456
11457 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11458 classes.
11459 (Arm_exidx_section_offset_map): New type.
11460
11461 2010-01-21 Doug Kwan <dougkwan@google.com>
11462
11463 * arm.cc (Arm_exidx_input_section): New class.
11464 (Arm_relobj::exidx_input_section_by_link,
11465 Arm_relobj::exidx_input_section_by_shndx,
11466 Arm_relobj::make_exidx_input_section): New methods.
11467 (read_arm_attributes_section): Remove.
11468 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11469 information about them.
11470 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11471 to here.
11472
11473 2010-01-20 Doug Kwan <dougkwan@google.com>
11474
11475 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11476 Input_section_specifier to Section_id.
11477 (Target_arm::new_arm_input_section: Adjust code for change of key
11478 type.
11479 (Target_arm::find_arm_input_section): Ditto.
11480 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11481 (Section_id): Remove.
11482 (Garbage_collection::Section_id_hash): Remove.
11483 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11484 (Section_id): Remove.
11485 (Icf::Section_id_hash): Remove.
11486 * object.h (Section_id, Const_section_id, Section_id_hash,
11487 Const_section_id_hash): New type definitions.
11488 * output.cc (Output_section::add_relaxed_input_section): Change to
11489 use Const_section_id instead of Input_section_specifier as key type.
11490 (Output_section::add_merge_input_section): Ditto.
11491 (Output_section::build_relaxation_map): Change to use Section_id
11492 instead of Input_section_specifier as key type.
11493 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11494 Ditto.
11495 (Output_section::convert_input_sections_to_relaxed_sections): Change
11496 to use Const_section_id instead of Input_section_specifier as key type.
11497 (Output_section::find_merge_section): Ditto.
11498 (Output_section::find_relaxed_input_section): Ditto.
11499 * output.h (Input_section_specifier): Remove class.
11500 (Output_section::Output_section_data_by_input_section_map): Change
11501 key type to Const_section_id.
11502 (Output_section::Output_relaxed_input_section_by_input_section_map):
11503 Ditto.
11504 (Output_section::Relaxation_map): Change key type to Section_id.
11505
11506 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11507
11508 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11509 (class Arm_v4bx_stub): New class.
11510 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11511 (Stub_factory::make_arm_v4bx_stub): New method.
11512 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11513 (Stub_table::empty): Handle v4bx stubs.
11514 (Stub_table::add_arm_v4bx_stub): New method.
11515 (Stub_table::find_arm_v4bx_stub): New method.
11516 (Arm_relocate_functions::v4bx): New method.
11517 (Target_arm::fix_v4bx): New method.
11518 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11519 (Stub_table::relocate_stubs): Likewise.
11520 (Stub_table::do_write): Likewise.
11521 (Stub_table::update_data_size_and_addralign): Likewise.
11522 (Stub_table::finalize_stubs): Likewise.
11523 (Target_arm::Scan::local): Likewise.
11524 (Target_arm::Scan::global): Likewise.
11525 (Target_arm::do_finalize_sections): Likewise.
11526 (Target_arm::Relocate::relocate): Likewise.
11527 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11528 Likewise.
11529 (Target_arm::scan_reloc_for_stub): Likewise.
11530 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11531
11532 2010-01-19 Ian Lance Taylor <iant@google.com>
11533
11534 * output.cc (Output_section_headers::do_sized_write): Write large
11535 segment count to sh_info field.
11536 (Output_file_header::do_sized_write): For large segment count,
11537 write PN_XNUM to e_phnum field.
11538
11539 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11540
11541 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11542 (Arm_relocate_functions::thm_jump8): New function.
11543 (Arm_relocate_functions::thm_jump11): New function.
11544 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11545 R_ARM_THM_JUMP11.
11546 (Target_arm::Scan::global): Likewise.
11547 (Target_arm::Relocate::relocate): Likewise.
11548 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11549 Likewise.
11550
11551 2010-01-14 Doug Kwan <dougkwan@google.com>
11552
11553 * arm.cc (map, utility): Include headers.
11554 (Target_arm::apply_cortex_a8_workaround): New method.
11555 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11556 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11557 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11558 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11559 the --[no-]fix-cortex-a8 command line options.
11560 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11561 (Target_arm::relocate_stub): Use addend in instruction template.
11562 * options.h (DEFINE_bool): Set the user-set flag.
11563 (General_options): Add --[no-]-fix-cortex options.
11564 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11565 : Update fast look-up map after conversion.
11566
11567 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11568
11569 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11570 in the first pass of do_layout.
11571
11572 2010-01-13 Doug Kwan <dougkwan@google.com>
11573
11574 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11575 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11576 apparent compiler problem of not folding static constant integral
11577 data members of elfcpp::Elf_sizes<32>.
11578
11579 2010-01-13 Doug Kwan <dougkwan@google.com>
11580
11581 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11582 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11583 Arm_relobj::scan_section_for_cortex_a8_erratum,
11584 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11585 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11586 sections to scan for relocation stubs into a new method
11587 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11588 relocation and Cortex-A8 stub scanning.
11589 (Target_arm::do_relax): Force stubs to be after stubbed sections
11590 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11591 the beginning of a new relaxation pass. Update a comment.
11592 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11593
11594 2010-01-12 Ian Lance Taylor <iant@google.com>
11595
11596 * target-reloc.h (visibility_error): New inline function.
11597 (relocate_section): Call visibility_error.
11598 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11599 (MOSTLYCLEANFILES): Likewise.
11600 (protected_4_pic.o, protected_3.err): New targets.
11601 * testsuite/protected_4.cc: New file.
11602
11603 2010-01-12 Doug Kwan <dougkwan@google.com>
11604
11605 * arm.cc (Cortex_a8_reloc): New class.
11606 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11607 and cortex_a8_relocs_info_.
11608 (Target_arm::fix_cortex_a8): New method definition.
11609 (Target_arm::Cortex_a8_relocs_info): New type.
11610 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11611 New data member declarations.
11612 (Target_arm::scan_reloc_for_stub): Record information about
11613 relocations for THUMB branches that might be exempted from the
11614 Cortex-A8 workaround.
11615 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11616 at the beginning of a relaxation pass.
11617
11618 2010-01-12 Doug Kwan <dougkwan@google.com>
11619
11620 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11621 (Arm_relobj::Mapping_symbol_position,
11622 Arm_reloj::Mapping_symbol_position_less,
11623 Arm_relobj::Mapping_symbols_info): New types.
11624 (Target_arm::is_mapping_symbol_name): New method definition.
11625 (Arm_relobj::do_count_local_symbols): Save information about mapping
11626 symbols.
11627
11628 2010-01-11 Doug Kwan <dougkwan@google.com>
11629
11630 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11631 Arm_relocate_functions::thumb32_branch_upper,
11632 Arm_relocate_functions::thumb32_branch_lower,
11633 Arm_relocate_functions::thumb32_cond_branch_offset,
11634 Arm_relocate_functions::thumb32_cond_branch_upper,
11635 Arm_relocate_functions::thumb32_cond_branch_lower,
11636 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11637 branch offset encoding.
11638 (Arm_relocate_functions::thumb_branch_common): Use new branch
11639 offset encoding methods to avoid code duplication.
11640 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11641 (Stub_addend_reader::operator()): Use new branch encoding method
11642 to avoid code duplication.
11643
11644 2010-01-11 Doug Kwan <dougkwan@google.com>
11645
11646 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11647 (Target_arm::do_finalize_sections): Define special EXIDX section
11648 symbols only if referenced.
11649 * gc.h (Garbage_collection::add_reference): New method.
11650 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11651 code duplication.
11652
11653 2010-01-11 Ian Lance Taylor <iant@google.com>
11654
11655 * script.cc (Version_script_info::build_expression_list_lookup):
11656 Change complaing about duplicate wildcard match from error to
11657 warning.
11658
11659 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11660 of 2009-12-30.
11661 (Version_script_info::Version_script_info): Initialize globs_,
11662 default_version_, default_is_global_, and exact_. Don't
11663 initialize globals_ or locals_.
11664 (Version_script_info::build_lookup_tables): Build local symbols
11665 first.
11666 (Version_script_info::unquote): New function.
11667 (Version_script_info::add_exact_match): New function.
11668 (Version_script_info::build_expression_list_lookup): Remove lookup
11669 parameter. Add is_global parameter. Change all callers. Handle
11670 wildcard pattern specially. Unquote pattern. Call
11671 add_exact_match.
11672 (Version_script_info::get_name_to_match): New function.
11673 (Version_script_info::get_symbol_version): New function.
11674 (Version_script_info::get_symbol_version_helper): Remove.
11675 (Version_script_info::check_unmatched_names): Call unquote.
11676 * script.h (class Version_script_info): Change get_symbol_version
11677 to be non-inline and add is_global parameter; change all callers.
11678 Rewrite symbol_is_local. Update declarations. Define struct
11679 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11680 Remove globals_ and locals_ members. Add exact_, globs_,
11681 default_version_, is_global_.
11682 (Version_script_info::Glob): Remove pattern, add expression and
11683 is_global. Update constructor. Change all callers.
11684 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11685 default version.
11686 (Versions::symbol_section_contents): If a symbol is undefined, or
11687 defined in a dynamic object, set the version index to
11688 VER_NDX_LOCAL.
11689 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11690 symbol_is_local.
11691 (Symbol_table::add_from_pluginobj): Likewise.
11692 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11693
11694 2010-01-11 Doug Kwan <dougkwan@google.com>
11695
11696 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11697 (incremental_dump_LDADD): Add linking option for libintl.
11698 * Makefile.in: Regenerate.
11699
11700 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11701
11702 PR gold/11144
11703 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11704 instead of -Ds.
11705 * testsuite/Makefile.in: Regenerated.
11706
11707 2010-01-10 Doug Kwan <dougkwan@google.com>
11708
11709 * options.h (DEFINE_var): Use parentheses around argument varname__
11710 in macro body to avoid any unintended subsequent substitutions.
11711
11712 2010-01-10 Ian Lance Taylor <iant@google.com>
11713
11714 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11715 candidates before doing symbol resolution.
11716
11717 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11718 ODR candidates if only one is weak.
11719
11720 2010-01-08 Ian Lance Taylor <iant@google.com>
11721
11722 * script.cc (Version_script_info::build_expression_list_lookup):
11723 Don't warn about ambiguous version, just record the ambiguity.
11724 (Version_script_info::get_symbol_version_helper): Give error if
11725 version is ambiguous.
11726
11727 2010-01-08 Doug Kwan <dougkwan@google.com>
11728
11729 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11730 prev_data_size_ and prev_addralign_. Remove initializer for
11731 deleted data member has_been_changed_.
11732 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11733 to determine if the table is empty.
11734 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11735 Remove.
11736 (Stub_table::add_reloc_stub): Define method in class definition
11737 instead of just declaring it there.
11738 (Stub_table::add_cortex_a8_stub): New method definition.
11739 (Stub_table::update_data_size_and_addralign): Ditto.
11740 (Stub_table::finalize_stubs): Ditto.
11741 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11742 (Stub_table::do_addralign_): Return address alignment in the
11743 (Stub_table::do_reset_address_and_file_offset): Define method in
11744 class definition instead of declaring it there. Set current data
11745 size to be the data size of the previous pass.
11746 (Stub_table::set_final_data_size): Use current data size as the
11747 final data size.
11748 (Stub_table::relocate_stub): Change parameter type of stub from
11749 Reloc_stub pointer to Stub pointer.
11750 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11751 (Stub_table::Cortex_a8_stub_list): New typedef.
11752 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11753 Stub_table::prev_addralign_): New data member.
11754 (Arm_relobj::Arm_relobj): Initialize data member
11755 section_has_cortex_a8_workaround_.
11756 (Arm_relobj::section_has_cortex_a8_workaround,
11757 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11758 definitions.
11759 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11760 declarations.
11761 (Target_arm::relocate_stub): Change parameter type of stub from
11762 Reloc_stub pointer to Stub pointer.
11763 (Insn_template::size, Insn_template::alignment): Handle
11764 THUMB16_SPECIAL_TYPE.
11765 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11766 Stub_table::update_data_size_and_addralign,
11767 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11768 definitions.
11769 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11770 (Stub_table::do_write): Ditto.
11771 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11772
11773 2010-01-08 Ian Lance Taylor <iant@google.com>
11774
11775 PR 11108
11776 * symtab.h (class Symbol): Remove fields is_target_special_ and
11777 has_plt_offset_. Add field is_defined_in_discarded_section_.
11778 (Symbol::is_defined_in_discarded_section): New function.
11779 (Symbol::set_is_defined_in_discarded_section): New function.
11780 (Symbol::has_plt_offset): Rewrite.
11781 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11782 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11783 Don't initialize is_target_special_ or has_plt_offset_.
11784 Initialize is_defined_in_discarded_section_.
11785 (Symbol_table::add_from_relobj): If appropriate, set
11786 is_defined_in_discarded_section.
11787 * resolve.cc (Symbol::override_base_with_special): Don't test
11788 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11789 * target-reloc.h (relocate_section): Do special handling for
11790 symbols defined in discarded sections for global symbols as well
11791 as local symbols.
11792
11793 2010-01-08 Ian Lance Taylor <iant@google.com>
11794
11795 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11796 the SHT_SYMTAB case.
11797
11798 2010-01-08 Ian Lance Taylor <iant@google.com>
11799
11800 * object.cc (Sized_relobj::do_layout): Don't get confused if
11801 layout_eh_frame returns NULL.
11802
11803 2010-01-08 Ian Lance Taylor <iant@google.com>
11804
11805 PR 11084
11806 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11807 dynamic symbol table, use the normal symbol table.
11808 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11809 symbol table.
11810
11811 2010-01-08 Ian Lance Taylor <iant@google.com>
11812
11813 PR 11072
11814 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11815 sections.
11816
11817 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11818
11819 * version.cc (print_version): Change to "Copyright 2010".
11820
11821 2010-01-08 Ian Lance Taylor <iant@google.com>
11822
11823 PR 10287
11824 PR 11063
11825 * i386.cc (class Target_i386): Change return type of plt_section
11826 to be non-const.
11827 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11828 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11829 tls_desc_rel_ field.
11830 (Output_data_plt_i386::rel_tls_desc): New function.
11831 (Target_i386::rel_tls_desc_section): New function.
11832 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11833 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11834 R_386_TLS_DESC reloc in rel_tls_desc_section.
11835 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11836 Define struct Tlsdesc_info.
11837 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11838 (Target_x86_64::do_reloc_symbol_index): New function.
11839 (Target_x86_64::add_tlsdesc_info): New function.
11840 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11841 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11842 tlsdesc_rel_ field.
11843 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11844 all callers.
11845 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11846 (Target_x86_64::rela_tlsdesc_section): New function.
11847 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11848 handling.
11849 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11850 (Target_x86_64::do_reloc_addend): New function.
11851 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11852 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11853 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11854 (Output_reloc::type): New function.
11855 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11856 (Output_reloc::is_target_specific): New function.
11857 (Output_reloc::target_arg): New function.
11858 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11859 absolute relocs and target specific relocs.
11860 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11861 add_target_specific.
11862 (class Output_data_reloc) [SHT_RELA]: Likewise.
11863 * output.cc (Output_reloc::Output_reloc): Add four new versions
11864 for absolute relocs and target specific relocs.
11865 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11866 (Output_reloc::get_symbol_index): Likewise.
11867 (Output_reloc::local_section_offset): Check that local_sym_index_
11868 is not TARGET_CODE or 0.
11869 (Output_reloc::symbol_value): Likewise.
11870 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11871 reloc.
11872 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11873 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11874 functions.
11875 * layout.cc (add_target_dynamic_tags): Use output section for
11876 DT_PLTRELSZ and DT_JMPREL.
11877
11878 2010-01-07 Ian Lance Taylor <iant@google.com>
11879
11880 PR 11061
11881 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11882 function.
11883 (class Output_data_reloc_generic): Define.
11884 (class Output_data_reloc_base): Change base class to
11885 Output_data_reloc_generic. Change add() method to call
11886 bump_relative_reloc_count for a relative reloc. Remove
11887 sort_relocs_ field.
11888 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11889 to sort_relocs().
11890 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11891 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11892 appropriate.
11893 * layout.h (class Layout): Update declaration.
11894
11895 2010-01-07 Ian Lance Taylor <iant@google.com>
11896
11897 * output.h (class Output_data): Add const version of
11898 output_section and do_output_section.
11899 (class Output_section_data): Add const version of
11900 do_output_section.
11901 (class Output_section): Likewise.
11902 * layout.cc (Layout::add_target_dynamic_tags): New function.
11903 * layout.h (class Layout): Update declarations.
11904 * arm.cc (Target_arm::do_finalize_sections): Use
11905 add_target_dynamic_tags.
11906 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11907 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11908 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11909 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11910
11911 2010-01-07 Ian Lance Taylor <iant@google.com>
11912
11913 PR 11042
11914 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11915 object as needed.
11916
11917 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11918 Ian Lance Taylor <iant@google.com>
11919
11920 PR 11019
11921 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11922 Xindex::read_symtab_xindex.
11923
11924 2010-01-07 Doug Kwan <dougkwan@google.com>
11925
11926 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11927 (Insn_template::thumb16_bcond_insn): New method declaration.
11928 (Insn_template): Fix spelling.
11929 (Stub::thumb16_special): New method declaration.
11930 (Stub::do_write): Define virtual method which was previously pure
11931 virtual.
11932 (Stub::do_thumb16_special): New method declaration.
11933 (Stub::do_fixed_endian_write): New template member.
11934 (Reloc_stub::do_write): Remove.
11935 (Reloc_stub::do_fixed_endian_write): Remove.
11936 (Cortex_a8_stub): New class definition.
11937 (Stub_factory::make_cortex_a8_stub): New method definition.
11938 (Stub_factory::Stub_factory): Add missing static storage class
11939 qualifier for elf32_arm_stub_a8_veneer_blx.
11940
11941 2010-01-07 Ian Lance Taylor <iant@google.com>
11942
11943 PR 10980
11944 * options.h (class General_options): Add --warn-unresolved-symbols
11945 and --error-unresolved-symbols.
11946 * errors.cc (Errors::undefined_symbol): Implement
11947 --warn-unresolved-symbols.
11948
11949 * options.h (class General_options): Add -z text and -z textoff.
11950 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11951
11952 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11953
11954 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11955 (Garbage_collection::cident_sections): New function.
11956 (Garbage_collection::add_cident_section): New function.
11957 (Garbage_collection::cident_sections_): New member.
11958 (gc_process_relocs): Add references to sections whose names are C
11959 identifiers.
11960 * gold.h (cident_section_start_prefix): New constant.
11961 (cident_section_stop_prefix): New constant.
11962 (is_cident): New function.
11963 * layout.cc (Layout::define_section_symbols): Replace string constants
11964 with the newly defined constants.
11965 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11966 C identifiers.
11967 * testsuite/Makefile.am: Add gc_orphan_section_test.
11968 * testsuite/Makefile.in: Regenerate.
11969 * testsuite/gc_orphan_section_test.cc: New file.
11970 * testsuite/gc_orphan_section_test.sh: New file.
11971
11972 2010-01-06 Ian Lance Taylor <iant@google.com>
11973
11974 PR 10980
11975 * options.h (class General_options): Add --warn-shared-textrel.
11976 * layout.cc (Layout::finish_dynamic_section): Implement
11977 --warn-shared-textrel.
11978
11979 PR 10980
11980 * options.h (class General_options): Add --warn-multiple-gp.
11981
11982 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11983
11984 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11985 $(THREADSLIB) and $(LIBDL).
11986 * Makefile.in: Rebuild.
11987
11988 2010-01-06 Ian Lance Taylor <iant@google.com>
11989
11990 PR 10980
11991 * options.cc (General_options::parse_section_start): New function.
11992 (General_options::section_start): New function.
11993 (General_options::General_options): Initialize all members.
11994 * options.h: Include <map>
11995 (class General_options): Add --section-start. Add section_starts_
11996 member.
11997 * layout.cc (Layout::attach_allocated_section_to_segment): If
11998 --section-start was used, set the address of the segment. Remove
11999 local sort_sections.
12000 (Layout::relaxation_loop_body): If the address of the load segment
12001 has been set by --section-start, don't use it.
12002 * output.h (Output_segment::update_flags_for_output_section): New
12003 function.
12004 * output.cc (Output_segment::add_output_section): Call
12005 update_flags_for_output_section.
12006
12007 2010-01-05 Ian Lance Taylor <iant@google.com>
12008
12009 PR 10980
12010 * options.h (class General_options): Add --undefined-version.
12011 * script.cc (struct Version_expression): Add was_matched_by_symbol
12012 field.
12013 (Version_script_info::matched_symbol): New function.
12014 (Version_script_info::get_symbol_version_helper): Call
12015 matched_symbol.
12016 (Version_script_info::check_unmatched_names): New function.
12017 * script.h (class Version_script_info): Update declarations.
12018 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12019
12020 * options.h (class General_options): Use DEFINE_bool_alias for
12021 allow_multiple_definition.
12022 * resolve.cc (Symbol_table::should_override): Don't test
12023 allow_multiple_definition.
12024
12025 PR 10980
12026 * options.h (class General_options): Add --cref.
12027 * main.cc (main): Print cref table if --cref. Don't close mapfile
12028 until after printing cref table.
12029 * cref.cc: Include "symtab.h".
12030 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12031 (Cref_table_compare::operator()): New function.
12032 (Cref_inputs::gather_cref): New function.
12033 (filecol): New static const.
12034 (Cref_inputs::print_cref): New function.
12035 (Cref::print_cref): New function.
12036 * cref.h: Include <cstdio>.
12037 (class Cref): Update declarations.
12038 * mapfile.h (Mapfile::file): New function.
12039 * object.h (class Object): Define Symbols. Declare virtual
12040 do_get_global_symbols.
12041 (Object::get_global_symbols): New function.
12042 * object.cc (Input_objects::add_object): Pass object to cref_ if
12043 --cref.
12044 (Input_objects::archive_start): Likewise.
12045 (Input_objects::archive_stop): Likewise.
12046 (Input_objects::print_cref): New function.
12047 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12048 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12049 --cref.
12050 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12051 function.
12052 * plugin.h (class Sized_pluginobj): Update declarations.
12053
12054 2010-01-05 Ian Lance Taylor <iant@google.com>
12055
12056 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12057 to is_default_version. Rename insdef to insdefault.
12058 (Symbol_table::add_from_relobj): Rename def to is_default_version
12059 and local to is_forced_local.
12060 (Symbol_table::add_from_pluginobj): Likewise.
12061 (Symbol_table::add_from_dynobj): Likewise.
12062 (Symbol_table::define_special_symbol): Rename insdef to
12063 insdefault.
12064
12065 2010-01-04 Ian Lance Taylor <iant@google.com>
12066
12067 PR 10980
12068 * options.h (class General_options): Add
12069 --allow-multiple-definition and -z muldefs.
12070 * resolve.cc (Symbol_table::should_override): Don't warn about a
12071 multiple symbol definition if --allow-multiple-definition or -z
12072 muldefs.
12073
12074 PR 10980
12075 * options.h (class General_options): Add --add-needed and
12076 --copy-dt-needed-entries. Tweak --as-needed help entry.
12077 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12078 error if --copy-dt-needed-entries aka --add-needed is used and
12079 would cause a change in behaviour.
12080
12081 PR 10980
12082 * options.h (class General_options): Add -G as a short version of
12083 --shared. Add no-op options -assert, -g, and -i.
12084
12085 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12086
12087 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12088 check for .text or .gnu.linkonce.t sections.
12089 * icf.cc (Icf::find_identical_sections): Ditto.
12090 Change the detection for mangled function name within the section
12091 name.
12092 * icf.h (is_section_foldable_candidate): New function.
12093
12094 2009-12-30 Ian Lance Taylor <iant@google.com>
12095
12096 PR 10980
12097 * options.h (class General_options): Permit two dashes with
12098 --retain-symbols-file.
12099
12100 2009-12-30 Ian Lance Taylor <iant@google.com>
12101
12102 PR 10979
12103 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12104 don't put the file header and segment headers in the text
12105 segment.
12106
12107 PR 10979
12108 * common.cc (Sort_commons::operator()): Stabilize sort when both
12109 entries are NULL.
12110 (Symbol_table::do_allocate_commons_list): When allocating common
12111 symbols, skip a symbol which is no longer common.
12112 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12113 an object before checking its type.
12114 * testsuite/common_test_2.c: New file.
12115 * testsuite/common_test_3.c: New file.
12116 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12117 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12118 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12119 (common_test_2_pic.o, common_test_2.so): New targets.
12120 (common_test_3_pic.o, common_test_3.so): New targets.
12121 * testsuite/Makefile.in: Rebuild.
12122
12123 PR 10979
12124 * script.cc (read_input_script): If we see a new SECTIONS clause,
12125 and we have added an input section, give an error.
12126 * layout.h (class Layout): Add have_added_input_section function.
12127 Add have_added_input_section_ field.
12128 * layout.cc (Layout::Layout): Initialize
12129 have_added_input_section_.
12130 (Layout::layout): Set have_added_input_section_.
12131 (Layout::layout_eh_frame): Likewise.
12132
12133 2009-12-30 Ian Lance Taylor <iant@google.com>
12134
12135 PR 10931
12136 * options.h (class General_options): Add --sort-common option.
12137 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12138 * common.cc (Sort_common): Add sort_order parameter to
12139 constructor. Add sort_order_ field.
12140 (Sort_commons::operator): Check sort_order_.
12141 (Symbol_table::allocate_commons): Determine the sort order.
12142 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12143 Change all callers.
12144 (Symbol_table::do_allocate_commons_list): Likewise.
12145
12146 2009-12-30 Ian Lance Taylor <iant@google.com>
12147
12148 PR 10916
12149 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12150 symbols from this object, don't change the visibility of an
12151 undefined symbol.
12152 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12153
12154 2009-12-30 Ian Lance Taylor <iant@google.com>
12155
12156 PR 10861
12157 * script.h (class Version_script_info): Define Language enum.
12158 Update declarations. Define Glob, Exact, and Lookup types. Add
12159 new fields globals_, locals_, and is_finalized_.
12160 * script.cc: Various formatting fixes.
12161 (class Parser_closure): Change language_stack_ from a vector of
12162 std::string to one of Version_script_info::Language. Adjust all
12163 uses accordingly.
12164 (class Lazy_demangler): Remove.
12165 (struct Version_expression): Change language from std::string to
12166 Version_script_info::Language.
12167 (Version_script_info::Version_script_info): New function.
12168 (Version_script_info::~Version_script_info): Don't call clear.
12169 (Version_script_info::finalize): New function.
12170 (Version_script_info::build_lookup_tables): New function.
12171 (Version_script_info::build_expression_list_lookup): New
12172 function.
12173 (Version_script_info::get_symbol_version_helper): Rewrite to use
12174 lookup tables.
12175 (Version_script_info::print_expression_list): Adjust to use
12176 Version_script_info::Language.
12177 (script_push_lex_into_version_mode): Check that the version script
12178 has not been finalized.
12179 (version_script_push_lang): Change language string to
12180 Version_script_info::Language.
12181 * options.cc (Command_line::version_script): New function.
12182 * options.h (class General_options): Add finalize_dynamic_list
12183 function. Change version_script from declaration to definition.
12184 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12185 * testsuite/version_script.map: Remove duplicate def of foo.
12186 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12187 version_script.map.
12188 * testsuite/Makefile.in: Rebuild.
12189
12190 2009-12-30 Ian Lance Taylor <iant@google.com>
12191
12192 PR 10843
12193 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12194 if the input symbol index is 0, make the output symbol index 0.
12195
12196 2009-12-30 Ian Lance Taylor <iant@google.com>
12197
12198 PR 10670
12199 * options.h (class General_options): Add -x/--discard-all.
12200 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12201 --discard-all. If the local symbol needs a dynamic entry, check
12202 that before handling --discard-locals.
12203
12204 2009-12-30 Ian Lance Taylor <iant@google.com>
12205
12206 PR 10450
12207 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12208 flags to PF_R.
12209 (Output_segment::add_output_section): Don't change the flags if
12210 the type is PT_TLS.
12211
12212 PR 10450
12213 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12214 GNU hash table if they need a dynamic value. Otherwise, don't add
12215 them if they are defined in a dynamic object or are forced local.
12216
12217 2009-12-29 Ian Lance Taylor <iant@google.com>
12218
12219 PR 10450
12220 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12221 .gnu.hash table for a 32-bit target.
12222
12223 PR 10450
12224 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12225 regular and a dynamic object only needs a dynamic symbol table
12226 entry if it is externally visible.
12227
12228 PR 10450
12229 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12230 constructor. Add global_offset_table_ field.
12231 (Target_i386::got_section): Set global_offset_table_.
12232 (Target_i386::do_finalize_sections): Set global_offset_table_
12233 size.
12234 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12235 in constructor. Add global_offset_table_ field.
12236 (Target_x86_64::got_section): Set global_offset_table_.
12237 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12238 size.
12239
12240 * layout.cc (Layout::Layout): Initialize increase_relro_.
12241 (Layout::get_output_section): Add is_relro, is_last_relro, and
12242 is_first_non_relro parameters. Change all callers.
12243 (Layout::choose_output_section): Likewise.
12244 (Layout::add_output_section_data): Likewise.
12245 (Layout::make_output_section): Likewise.
12246 (Layout::set_segment_offsets): Clear increase_relro when using a
12247 linker script.
12248 * layout.h (class Layout): Add increase_relro method. Add
12249 increase_relro_ field. Update declarations.
12250 * output.cc (Output_section::Output_section): Initialize
12251 is_last_relro_ and is_first_non_relro_.
12252 (Output_segment::add_output_section): Group relro sections is
12253 do_sort is true. Handle is_last_relro and is_first_non_relro.
12254 (Output_segment::maximum_alignment): Remove relro handling.
12255 (Output_segment::set_section_addresses): Add increase_relro
12256 parameter. Change all callers. Add initial alignment to align
12257 relro sections on separate page. Remove old relro handling.
12258 (Output_segment::set_section_list_addresses): Remove in_relro
12259 parameter. Change all callers.
12260 (Output_segment::set_offset): Add increase parameter. Change all
12261 callers. Remove old relro handling.
12262 * output.h (class Output_section): Add new methods: is_last_relro,
12263 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12264 Add is_last_relro_ and is_first_non_relro_ fields.
12265 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12266 Create separate .got.plt section. Call increase_relro.
12267 * x86_64.cc (Target_x86_64::got_section): Likewise.
12268 * testsuite/relro_script_test.t: Add .got.plt.
12269
12270 PR 10450
12271 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12272 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12273 (Layout::finalize): Call set_dynamic_symbol_size.
12274 (Layout::set_dynamic_symbol_size): New function.
12275 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12276 set_dynamic_symbol_size.
12277
12278 PR 10450
12279 * output.h (class Output_section): Add is_entsize_zero_ field.
12280 * output.cc (Output_section::Output_section): Initialize
12281 is_entsize_zero_.
12282 (Output_section::set_entsize): If two different entsizes are
12283 requested, force it to zero.
12284 (Output_section::add_input_section): Set flags for .debug_str
12285 before updating section flags. Set entsize.
12286 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12287 and SHF_STRING if all input sections have those flags.
12288
12289 2009-12-29 Rafael Espindola <espindola@google.com>
12290
12291 * main.cc (main): Fix the sys time reporting.
12292 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12293 reporting.
12294
12295 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12296
12297 * options.cc (General_options::parse_version): Allow -v to exit
12298 without an error if there is nothing to link.
12299
12300 2009-12-29 Ian Lance Taylor <iant@google.com>
12301
12302 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12303 using a version of gcc before 4.1.
12304 * configure: Rebuild.
12305
12306 2009-12-28 Chris Demetriou <cgd@google.com>
12307
12308 * attributes.cc (Output_attributes_section_data::do_write): Use
12309 std::vector::front rather than std::vector::data.
12310
12311 2009-12-28 Ian Lance Taylor <iant@google.com>
12312
12313 * symtab.h (class Symbol_table): Add enum Defined.
12314 * resolve.cc (Symbol_table::should_override): Add defined
12315 parameter. Change all callers. Test whether object is NULL
12316 before calling a method on it.
12317 (Symbol_table::report_resolve_problem): Add defined parameter.
12318 Change all callers.
12319 (Symbol_table::should_override_with_special): Likewise.
12320 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12321 parameter. Change all callers.
12322 (Symbol_table::do_define_in_output_data): Likewise.
12323 (Symbol_table::define_in_output_segment): Likewise.
12324 (Symbol_table::do_define_in_output_segment): Likewise.
12325 (Symbol_table::define_as_constant): Likewise.
12326 (Symbol_table::do_define_as_constant): Likewise.
12327 * script.h (class Symbol_assignment): Add is_defsym parameter to
12328 constructor; change all callers.
12329 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12330 parameter. Change all callers. Add is_defsym_ field.
12331 (class Parser_closure): Add parsing_defsym parameter to
12332 constructor; change all callers. Add parsing_defsym accessor
12333 function. Add parsing_defsym_ field.
12334
12335 2009-12-28 Ian Lance Taylor <iant@google.com>
12336
12337 * gold.cc (queue_middle_tasks): Fix formatting.
12338 * object.cc (Relobj::is_section_name_included): Likewise.
12339
12340 2009-12-23 Ian Lance Taylor <iant@google.com>
12341
12342 * i386.cc (Target_i386::do_calls_non_split): Recognize
12343 -fsplit-stack prologue for a function with a static chain.
12344 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12345 -fsplit-stack prologue when using %r11.
12346
12347 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12348
12349 * options.cc (General_options::parse_version): Make -v continue and do
12350 the link like GNU ld does.
12351
12352 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12353
12354 * Makefile.am (CCFILES): Add timer.cc.
12355 (HFILES): Add timer.h.
12356 * configure.ac: Check for sysconf and times.
12357 * main.cc: include timer.h.
12358 (main): Use Timer instead of get_run_time.
12359 * timer.cc: New.
12360 * timer.h: New.
12361 * workqueue.cc: include timer.h.
12362 (Workqueue::find_and_run_task):
12363 Report user, sys and wall time.
12364 * Makefile.in: Regenerate.
12365 * config.in: Regenerate.
12366 * configure: Regenerate.
12367
12368 2009-12-16 Doug Kwan <dougkwan@google.com>
12369
12370 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12371 sections.
12372 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12373 relaxed input sections.
12374 * output.cc (Output_section::find_relaxed_input_section): Change
12375 return type to Output_relaxed_input_section pointer. Adjust code
12376 for new type of relaxed_input_section_map_.
12377 * output.h (Output_section::find_relaxed_input_section): Change
12378 return type to Output_relaxed_input_section pointer.
12379 (Output_section::Output_relaxed_input_section_by_input_section_map):
12380 New type.
12381 (Output_section::relaxed_input_section_map_): Change type to
12382 Output_section::Output_relaxed_input_section_by_input_section_map.
12383 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12384 input section.
12385
12386 2009-12-15 Ian Lance Taylor <iant@google.com>
12387
12388 * layout.cc (Layout::create_shstrtab): Only write out after input
12389 sections if we are compressing debug sections.
12390
12391 2009-12-15 Ian Lance Taylor <iant@google.com>
12392
12393 * archive.cc (Archive::add_symbols): Only look up a symbol without
12394 a version if there is, in fact, a version.
12395
12396 2009-12-14 Ian Lance Taylor <iant@google.com>
12397
12398 Revert -Wshadow changes, all changes from:
12399 2009-12-11 Doug Kwan <dougkwan@google.com>
12400 2009-12-11 Nick Clifton <nickc@redhat.com>
12401 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12402
12403 2009-12-11 Doug Kwan <dougkwan@google.com>
12404
12405 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12406 due to -Wshadow.
12407 * attributes.cc (Object_attribute::size): Ditto.
12408 (Attributes_section_data::size): Ditto.
12409 (Attributes_section_data::Attributes_section_data): Ditto.
12410 (Output_attributes_section_data::do_write): Ditto.
12411 * attributes.h (Object_attribute::set_type): Ditto.
12412 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12413
12414 2009-12-11 Nick Clifton <nickc@redhat.com>
12415
12416 * archive.cc: Fix shadowed variable warnings.
12417 * arm.cc: Likewise.
12418 * compressed_output.cc: Likewise.
12419 * compressed_output.h: Likewise.
12420 * configure: Likewise.
12421 * dwarf_reader.cc: Likewise.
12422 * dynobj.cc: Likewise.
12423 * dynobj.h: Likewise.
12424 * ehframe.cc: Likewise.
12425 * ehframe.h: Likewise.
12426 * errors.cc: Likewise.
12427 * expression.cc: Likewise.
12428 * fileread.cc: Likewise.
12429 * fileread.h: Likewise.
12430 * freebsd.h: Likewise.
12431 * i386.cc: Likewise.
12432 * icf.cc: Likewise.
12433 * incremental.h: Likewise.
12434 * layout.cc: Likewise.
12435 * layout.h: Likewise.
12436 * mapfile.cc: Likewise.
12437 * merge.cc: Likewise.
12438 * merge.h: Likewise.
12439 * object.cc: Likewise.
12440 * object.h: Likewise.
12441 * options.h: Likewise.
12442 * output.cc: Likewise.
12443 * output.h: Likewise.
12444 * parameters.cc: Likewise.
12445 * plugin.cc: Likewise.
12446 * powerpc.cc: Likewise.
12447 * reduced_debug_output.cc: Likewise.
12448 * reduced_debug_output.h: Likewise.
12449 * reloc.cc: Likewise.
12450 * reloc.h: Likewise.
12451 * resolve.cc: Likewise.
12452 * script-sections.cc: Likewise.
12453 * script.cc: Likewise.
12454 * script.h: Likewise.
12455 * sparc.cc: Likewise.
12456 * symtab.cc: Likewise.
12457 * symtab.h: Likewise.
12458 * target-select.cc: Likewise.
12459 * target-select.h: Likewise.
12460 * token.h: Likewise.
12461 * workqueue.cc: Likewise.
12462 * workqueue.h: Likewise.
12463 * x86_64.cc: Likewise.
12464
12465 2009-12-10 Doug Kwan <dougkwan@google.com>
12466
12467 * arm.cc (attributes.h): New include.
12468 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12469 (Arm_relobj::~Arm_relobj): Delete object pointed by
12470 attributes_section_data_.
12471 (Arm_relobj::attributes_section_data): New method definition.
12472 (Arm_relobj::attributes_section_data_): New data member declaration.
12473 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12474 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12475 attributes_section_data_.
12476 (Arm_dynobj::attributes_section_data): New method definition.
12477 (Arm_dynobj::attributes_section_data_): New data member declaration.
12478 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12479 initialization value of may_use_blx_ to false.
12480 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12481 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12482 object attributes to compute results instead of hard-coding.
12483 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12484 Target_arm::get_secondary_compatible_arch,
12485 Target_arm::set_secondary_compatible_arch
12486 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12487 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12488 New method declarations.
12489 (Target_arm::get_aeabi_object_attribute): New method definition.
12490 (Target_arm::attributes_section_data_): New data member declaration.
12491 (read_arm_attributes_section): New template definition.
12492 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12493 (Arm_dynobj::do_read_symbols): Ditto.
12494 (Target_arm::do_finalize_sections): Merge attributes sections from
12495 input. Check for BLX use after attributes section merging.
12496 Fix __exidx_start and __exidx_end visibility. Create an
12497 .ARM.attributes section if necessary.
12498 (Target_arm::get_secondary_compatible_arch,
12499 Target_arm::set_secondary_compatible_arch,
12500 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12501 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12502 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12503 New method definitions.
12504
12505 2009-12-09 Ian Lance Taylor <iant@google.com>
12506
12507 * plugin.cc (Plugin::load): Don't cast from void* to a function
12508 pointer.
12509
12510 2009-12-09 Ian Lance Taylor <iant@google.com>
12511
12512 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12513 information fields.
12514
12515 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12516
12517 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12518 Replace two_file_shared_1.so with two_file_shared_2.so.
12519 * testsuite/Makefile.in: Regenerated.
12520
12521 2009-12-08 Doug Kwan <dougkwan@google.com>
12522
12523 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12524 (HFILES): Add attributes.h and int_encoding.h.
12525 * Makefile.in: Regenerate.
12526 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12527 function definitions to int_encoding.cc
12528 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12529 prototypes to int_encoding.h
12530 * reduced_debug_output.cc (int_encoding.h): New include.
12531 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12532 function definitions to int_encoding.cc
12533 (insert_into_vector, read_from_pointer): Move template definitions to
12534 int_encoding.h
12535 * attributes.cc: New file.
12536 * attributes.h: New file.
12537 * int_encoding.cc: New file.
12538 * int_encoding.h: New file.
12539
12540 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12541
12542 PR gold/11055
12543 * incremental-dump.cc (dump_incremental_inputs): New.
12544 (main): Use dump_incremental_inputs.
12545
12546 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12547
12548 PR gold/10893
12549 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12550 checking elfcpp::STT_FUNC.
12551 (Target_i386::Relocate::relocate): Likewise.
12552 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12553
12554 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12555 symbols from shared libraries into normal FUNC symbols.
12556
12557 * symtab.h (Symbol): Add is_func and use it.
12558
12559 2009-12-05 Doug Kwan <dougkwan@google.com>
12560
12561 * arm.cc (Target_arm::arm_info): Initialize new fields
12562 attributes_section and attributes_vendor.
12563 * i386.cc (Target_i386::i386_info): Same.
12564 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12565 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12566 fields attributes_section and attributes_vendor.
12567 * sparc.cc (Target_sparc::sparc_info): Same.
12568 * target.h (Target::attributes_section, Target::attributes_vendor,
12569 Target::is_attributes_section, Target::attribute_arg_type,
12570 Target::attributes_order): New method definitions.
12571 (Target::Target_info::attributes_section,
12572 Target::Target_info::attributes_vendor): New fields.
12573 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12574 virtual method definitions.
12575 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12576 attributes_section and attributes_vendor.
12577 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12578
12579 2009-12-05 Doug Kwan <dougkwan@google.com>
12580
12581 * arm.cc: Update comments about interworking and stub generation.
12582 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12583 considered as non-PIC.
12584 (Arm_relocate_functions::base_abs): Fix formatting.
12585 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12586 of function to use GOT entry address instead of offset.
12587 (Target_arm::Scan::global): Issue an error if a symbol would need a
12588 PLT does not get one because it is untyped. Remove code to create
12589 dynamic symbols for relative branches.
12590 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12591 takes unsigned integer instead of boolean.
12592
12593 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12594
12595 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12596 (two_file_test_LDADD): Likewise.
12597 (common_test_1_LDADD): Likewise.
12598 (exception_test_LDADD) Likewise.
12599 (weak_test_LDADD): Likewise.
12600 (many_sections_test_LDADD): Likewise.
12601 (initpri1_LDADD): Likewise.
12602 (script_test_1_LDADD): Likewise.
12603 (script_test_2_LDADD): Likewise.
12604 (justsyms_LDADD): Likewise.
12605 (binary_test_LDADD): Likewise.
12606 (large_LDADD): Likewise.
12607 * testsuite/Makefile.in: Regenerated.
12608
12609 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12610
12611 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12612 (Symbol_table::override_with_special): Likewise.
12613 (Symbol_table::add_from_object): Likewise.
12614
12615 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12616
12617 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12618 Don't set the data_offset twice.
12619
12620 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12621
12622 * testsuite/Makefile.in: Regenerate.
12623
12624 2009-12-03 Doug Kwan <dougkwan@google.com>
12625
12626 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12627 (Target_arm::do_finalize_sections): Add parameter for symbol table
12628 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12629 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12630 parameter for symbol table pointer.
12631 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12632 an additional parameter for a pointer to symbol table.
12633 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12634 parameter for a symbol table pointer.
12635 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12636 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12637 Ditto.
12638 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12639 parameter for a symbol table pointer.
12640
12641 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12642
12643 * incremental.cc (Incremental_inputs_header)
12644 (Incremental_inputs_header_write, Incremental_inputs_entry)
12645 (Incremental_inputs_entry_write): Move ...
12646 * incremental.h (Incremental_inputs_header)
12647 (Incremental_inputs_header_write, Incremental_inputs_entry)
12648 (Incremental_inputs_entry_write): here.
12649
12650 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12651
12652 * incremental.cc (make_sized_incremental_binary): Set the target.
12653 Error if it is incompatible.
12654 * output.h (Output_file): Add filename method.
12655
12656 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12657
12658 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12659 from the get_* methods.
12660
12661 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12662
12663 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12664 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12665 Write 0 for the data_offset of scripts.
12666
12667 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12668
12669 * testsuite/Makefile.am: Add the incremental_test.sh test.
12670 * testsuite/incremental_test.sh: New.
12671 * testsuite/incremental_test_1.c: New.
12672 * testsuite/incremental_test_2.c: New.
12673
12674 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12675
12676 * incremental-dump.cc (main): Fix typos.
12677
12678 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12679
12680 PR gold/11025
12681 * incremental-dump.cc (main): Use llu to print 64 bit values.
12682
12683 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12684 H.J. Lu <hongjiu.lu@intel.com>
12685
12686 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12687 $(LIBDL).
12688 (incremental_dump_LDADD): Likewise.
12689 * Makefile.in: Regenerated.
12690
12691 2009-11-25 Doug Kwan <dougkwan@google.com>
12692
12693 Revert:
12694
12695 2009-11-25 Doug Kwan <dougkwan@google.com>
12696
12697 * arm.cc (Target_arm::Target_arm): Move method definition
12698 outside of class definition. Add code to handle
12699 --target1-rel, --target1-abs and --target2= options.
12700 (Target_arm::get_reloc_reloc_type): Change method to be
12701 non-static and const.
12702 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12703 New data member declaration.
12704 (Target_arm::Scan::local, Target_arm::Scan::global,
12705 Target_arm::Relocate::relocate,
12706 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12707 Adjust call to Target_arm::get_real_reloc_type.
12708 (Target_arm::get_real_reloc_type): Use command line options
12709 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12710 * options.h (--target1-rel, --target1-abs, --target2): New
12711 ARM-only options.
12712
12713 2009-11-25 Doug Kwan <dougkwan@google.com>
12714
12715 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12716 class definition. Add code to handle --target1-rel, --target1-abs
12717 and --target2= options.
12718 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12719 and const.
12720 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12721 member declaration.
12722 (Target_arm::Scan::local, Target_arm::Scan::global,
12723 Target_arm::Relocate::relocate,
12724 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12725 call to Target_arm::get_real_reloc_type.
12726 (Target_arm::get_real_reloc_type): Use command line options to
12727 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12728 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12729 options.
12730
12731 2009-11-25 Doug Kwan <dougkwan@google.com>
12732
12733 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12734 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12735 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12736 formatting.
12737 (Arm_relocate_functions::thm_call): Replace body with a call to
12738 Arm_relocate_functions::thumb_branch_common.
12739 (Arm_relocate_functions::thm_jump24,
12740 Arm_relocate_functions::thm_xpc22): New method definitions.
12741 (Arm_relocate_functions::thumb_branch_common): New method definition.
12742 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12743 operator.
12744 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12745 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12746
12747 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12748
12749 * Makefile.am: Build incremental-dump
12750 * Makefile.in: Regenerate.
12751 * incremental-dump.cc: New.
12752 * incremental.cc (Incremental_inputs_header_data,
12753 Incremental_inputs_entry_data): Move to incremental.h
12754 * incremental.h: (Incremental_inputs_header_data,
12755 Incremental_inputs_entry_data): Move from incremental.cc
12756
12757 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12758
12759 * incremental.cc (Incremental_inputs_header,
12760 Incremental_inputs_header_write, Incremental_inputs_entry,
12761 Incremental_inputs_entry_write): Add a typedef with the data type.
12762
12763 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12764
12765 * incremental.cc (Incremental_inputs_header,
12766 Incremental_inputs_header_write, Incremental_inputs_entry,
12767 Incremental_inputs_entry_write): Update comment about which
12768 type has the filed descriptions.
12769
12770 2009-11-15 Doug Kwan <dougkwan@google.com>
12771
12772 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12773 (Arm_relocate_functions::arm_branch_common): Change method defintion
12774 in class definition to a method declaration and update list of formal
12775 parameters.
12776 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12777 Arm_relocation_functions::jump24): Adjust call to
12778 Arm_relocate_functions::arm_branch_common. Update list of formal
12779 parameters.
12780 (Arm_relocate_functions::xpc25): New method definition.
12781 (Arm_relocate_functions::arm_branch_common): Move method defintion
12782 out from class definition. Use stubs for mode-switching and extending
12783 branch ranges.
12784 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12785 specially. Change code to enable use of stubs in ARM branches.
12786
12787 2009-11-10 Doug Kwan <dougkwan@google.com>
12788
12789 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12790 in method declaration.
12791 (Target_arm::relocate_stub): New method declaration.
12792 (Target_arm::default_target): Change to return a pointer instead of
12793 a const reference.
12794 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12795 Target_arm::default_target.
12796 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12797 method definition.
12798 (Target_arm::relocate_section): Adjust view.
12799 (Target_arm::relocate_stub): New method definition.
12800
12801 2009-11-10 Doug Kwan <dougkwan@google.com>
12802
12803 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12804 a format warning.
12805 * incremental.cc (open_incremental_binary): Initialized local
12806 variables to avoid warnings.
12807 * object.cc (make_elf_object): Ditto.
12808 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12809 a format warning.
12810
12811 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12812
12813 PR gold/10930
12814 * testsuite/plugin_test.c: Include "config.h".
12815
12816 2009-11-09 Doug Kwan <dougkwan@google.com>
12817
12818 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12819 (arm_symbol_value): Remove.
12820 (Arm_relocate_functions::arm_branch_common,
12821 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12822 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12823 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12824 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12825 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12826 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12827 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12828 Arm_relocate_functions::thm_mobw_abs_nc,
12829 Arm_relocate_functions::thm_mov_abs,
12830 Arm_relocate_functions::movw_prel_nc,
12831 Arm_relocate_functions::thm_movt_abs,
12832 Arm_relocate_functions::movt_prel,
12833 Arm_relocate_functions::thm_movw_prel_nc,
12834 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12835 (Target_arm::Relocate::relocate): Only decompose address into two
12836 parts if relocation type uses the thumb-bit and pass the actual
12837 bit instead of a flag indicating that the thumb-bit is used. Adjust
12838 calls to methods in Arm_relocate_functions for this change.
12839
12840 2009-11-08 Ian Lance Taylor <iant@google.com>
12841
12842 PR 10925
12843 * reloc.cc: Instantiate
12844 Sized_relobj::initialize_input_to_output_maps and
12845 Sized_relobj:free_input_to_output_maps.
12846
12847 2009-11-06 Ian Lance Taylor <iant@google.com>
12848
12849 PR 10876
12850 * defstd.cc (in_segment): Set only_if_ref true for "end".
12851
12852 2009-11-06 Doug Kwan <dougkwan@google.com>
12853
12854 * arm.cc (class Reloc_stub): Correct a comment.
12855 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12856 (Target_arm::scan_section_for_stubs): New method declaration.
12857 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12858 Change methods from private to protected.
12859 (Target_arm::do_may_relax): New method definition.
12860 (Target_arm::do_relax, Target_arm::group_sections,
12861 Target_arm::scan_reloc_for_stub,
12862 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12863 (Target_arm::arm_input_section_map_): New data member declaration.
12864 (Target_arm::scan_reloc_for_stub,
12865 Target_arm::scan_reloc_section_for_stubs,
12866 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12867 Target_arm::do_relax): New method definitions.
12868
12869 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12870
12871 * configure.ac: Check for (struct stat)::st_mtim
12872 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12873 * config.in: Regenerate.
12874 * configure: Regenerate.
12875
12876 2009-11-05 Ian Lance Taylor <iant@google.com>
12877
12878 PR 10910
12879 * output.cc (Output_segment::add_output_section): Add missing
12880 return statement.
12881
12882 2009-11-04 Ian Lance Taylor <iant@google.com>
12883
12884 PR 10880
12885 * object.h (class Object): Add is_needed and set_is_needed
12886 methods. Add is_needed_ field. Make bool fields into bitfields.
12887 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12888 defined in a dynamic object and referenced by a regular object,
12889 set is_needed for the dynamic object.
12890 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12891 if the file is marked with as_needed and it is not needed.
12892
12893 2009-11-04 Ian Lance Taylor <iant@google.com>
12894
12895 PR 10887
12896 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12897 tags if data is discarded by linker script.
12898 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12899 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12900 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12901 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12902
12903 2009-11-04 Ian Lance Taylor <iant@google.com>
12904
12905 * layout.cc (Layout::get_output_section): Add is_interp and
12906 is_dynamic_linker_section parameters. Change all callers.
12907 (Layout::choose_output_section): Likewise.
12908 (Layout::make_output_section): Likewise.
12909 (Layout::add_output_section_data): Add is_dynamic_linker_section
12910 parameter. Change all callers.
12911 * layout.h (class Layout): Update declarations.
12912 * output.h (class Output_section): Add is_interp, set_is_interp,
12913 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12914 Add is_interp_, is_dynamic_linker_section_ fields. Change
12915 generate_code_fills_at_write_ to a bitfield.
12916 * output.cc (Output_section::Output_sections): Initialize new
12917 fields.
12918 (Output_segment::add_output_section): Add do_sort parameter.
12919 Change all callers.
12920
12921 2009-11-03 Ian Lance Taylor <iant@google.com>
12922
12923 PR 10860
12924 * options.h (class General_options): Add --warn-common.
12925 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12926 merging two common symbols.
12927 (Symbol_table::should_override): Handle --warn-common when merging
12928 a common symbol with a defined symbol. Use report_resolve_problem
12929 for multiple definitions.
12930 (Symbol_table::report_resolve_problem): New function.
12931 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12932
12933 2009-11-03 Doug Kwan <dougkwan@google.com>
12934
12935 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12936 stub_factory_.
12937 (Target_arm::stub_factory): New method definition.
12938 (Target_arm::new_arm_input_section,
12939 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12940 Target_arm::reloc_uses_thumb_bit): New method declarations.
12941 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12942 New type definitions.
12943 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12944 member declarations.
12945 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12946 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12947 New method definitions.
12948
12949 2009-11-03 Ian Lance Taylor <iant@google.com>
12950
12951 * options.h (class General_options): Add --warn_constructors.
12952
12953 2009-11-03 Ian Lance Taylor <iant@google.com>
12954
12955 PR 10893
12956 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12957 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12958
12959 2009-11-03 Ian Lance Taylor <iant@google.com>
12960
12961 PR 10895
12962 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12963 --msgid-bugs-address.
12964 (install-pdf): New target.
12965 (install-data_yes): Look up one directory to find mkinstalldirs.
12966
12967 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12968
12969 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12970 tree.
12971
12972 2009-10-30 Doug Kwan <dougkwan@google.com>
12973
12974 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12975
12976 2009-10-30 Doug Kwan <dougkwan@google.com>
12977
12978 * arm.cc (Stub_addend_reader): New struct template definition
12979 and partial specializations.
12980 (Stub_addend_reader::operator()): New method definition for a
12981 partially specialized template.
12982
12983 2009-10-30 Doug Kwan <dougkwan@google.com>
12984
12985 * arm.cc (Arm_relobj::processor_specific_flags): New method
12986 definition.
12987 (Arm_relobj::do_read_symbols): New method declaration.
12988 (Arm_relobj::processor_specific_flags_): New data member declaration.
12989 (Arm_dynobj): New class definition.
12990 (Target_arm::do_finalize_sections): Add input_objects parameter.
12991 (Target_arm::do_adjust_elf_header): New method declaration.
12992 (Target_arm::are_eabi_versions_compatible,
12993 (Target_arm::merge_processor_specific_flags): New method declaration.
12994 (Target_arm::do_make_elf_object): New overloaded method definitions
12995 and declaration.
12996 (Arm_relobj::do_read_symbols): New method definition.
12997 (Arm_dynobj::do_read_symbols): Ditto.
12998 (Target_arm::do_finalize_sections): Add input_objects parameters.
12999 Merge processor-specific flags from all input objects.
13000 (Target_arm::are_eabi_versions_compatible,
13001 Target_arm::merge_processor_specific_flags,
13002 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13003 New method definitions.
13004 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13005 Input_objects pointer type parameter.
13006 * layout.cc (Layout::finalize): Pass input objects to target's.
13007 finalize_sections function.
13008 * output.cc (Output_file_header::do_sized_write): Set ELF file
13009 header's processor-specific flags.
13010 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13011 Input_objects pointer type parameter.
13012 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13013 * target.h (Input_objects): New forward class declaration.
13014 (Target::processor_specific_flags,
13015 Target::are_processor_specific_flags_sect): New method definitions.
13016 (Target::finalize_sections): Add input_objects parameter.
13017 (Target::Target): Initialize processor_specific_flags_ and
13018 are_processor_specific_flags_set_.
13019 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13020 parameter.
13021 (Target::set_processor_specific_flags): New method definition.
13022 (Target::processor_specific_flags_,
13023 Target::are_processor_specific_flags_set_): New data member
13024 declarations.
13025 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13026 Input_objects pointer type parameter.
13027
13028 2009-10-30 Doug Kwan <dougkwan@google.com>
13029
13030 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13031
13032 2009-10-28 Ian Lance Taylor <iant@google.com>
13033
13034 * object.h (class Relobj): Drop options parameter from
13035 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13036 do_scan_relocs, do_relocate. Change all callers.
13037 (class Sized_relobj): Drop options parameters from
13038 do_gc_process_relocs, do_scan_relocs, do_relocate,
13039 do_relocate_sections, relocate_sections, emit_relocs_scan,
13040 emit_relocs_scan_reltype. Change all callers.
13041 (struct Relocate_info): Remove options field and all references to
13042 it.
13043 * reloc.h (class Read_relocs): Remove options constructor
13044 parameter and options_ field. Change all callers.
13045 (class Gc_process_relocs, class Scan_relocs): Likewise.
13046 (class Relocate_task): Likewise.
13047 * target-reloc.h (scan_relocs): Remove options parameter. Change
13048 all callers.
13049 (scan_relocatable_relocs): Likewise.
13050 * target.h (class Sized_target): Remove options parameter from
13051 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13052 all callers.
13053 * gc.h (gc_process_relocs): Remove options parameter. Change all
13054 callers.
13055 * arm.cc: Update functions to remove options parameters.
13056 * i386.cc: Likewise.
13057 * powerpc.cc: Likewise.
13058 * sparc.cc: Likewise.
13059 * x86_64.cc: Likewise.
13060 * testsuite/testfile.cc: Likewise.
13061
13062 2009-10-28 Doug Kwan <dougkwan@google.com>
13063
13064 * arm.cc (Arm_relobj): New class definition.
13065 (Arm_relobj::scan_sections_for_stubs,
13066 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13067 New method definitions.
13068
13069 2009-10-28 Cary Coutant <ccoutant@google.com>
13070
13071 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13072 (Plugin::cleanup_done_): New member.
13073 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13074 (Plugin_manager::cleanup_done_): Remove.
13075 (Plugin_manager::add_input_file): Edit error message.
13076 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13077 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13078
13079 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13080
13081 * fileread.cc: (File_read::View::~View): Use the new
13082 data_ownership_ filed.
13083 (File_read::~File_read): Dispose the new whole_file_view_.
13084 (File_read::open): Mmap the whole file if needed.
13085 (File_read::open): Use whole_file_view_ instead of contents_.
13086 (File_read::find_view): Use whole_file_view_ if applicable.
13087 (File_read::do_read): Use whole_file_view_ instead of contents_.
13088 (File_read::make_view): Use whole_file_view_ instead of contents_,
13089 update File_read::View::View call.
13090 (File_read::find_or_make_view): Update File_read::View::View
13091 call.
13092 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13093 remove contents_
13094 (File_read::View::Data_ownership): New enum.
13095 (File_read::View::View): Replace bool mapped_ with Data_ownership
13096 argument.
13097 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13098 (File_read::View::data_ownership_): New field.
13099 (File_read::contents_): Remove (replaced by whole_file_view_).
13100 (File_read::whole_file_view_): New field.
13101 * options.h (class General_options): Add --keep-files-mapped.
13102
13103 2009-10-27 Cary Coutant <ccoutant@google.com>
13104
13105 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13106 * testsuite/Makefile.am (plugin_test_5): New test case.
13107 * testsuite/Makefile.in: Regenerate.
13108
13109 2009-10-25 Doug Kwan <dougkwan@google.com>
13110
13111 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13112 from private to protected to allow access by child class.
13113 (Sized_relobj::do_relocate_sections): New method declaration.
13114 (Sized_relobj::relocate_sections): Virtualize.
13115 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13116 Sized_relobj::relocate_sections. Instantiate template explicitly
13117 for different target sizes and endianity.
13118
13119 2009-10-24 Doug Kwan <dougkwan@google.com>
13120
13121 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13122 (Arm_input_section::as_arm_input_section): New method.
13123 (Arm_output_section): New class definition.
13124 (Arm_output_section::create_stub_group,
13125 Arm_output_section::group_sections): New method definitions.
13126
13127 2009-10-22 Doug Kwan <dougkwan@google.com>
13128
13129 * arm.cc (Arm_input_section): New class definition.
13130 (Arm_input_section::init, Arm_input_section:do_write,
13131 Arm_input_section::set_final_data_size,
13132 Arm_input_section::do_reset_address_and_file_offset): New method
13133 definitions.
13134
13135 2009-10-21 Doug Kwan <dougkwan@google.com>
13136
13137 * arm.cc (Stub_table, Arm_input_section): New forward class
13138 declarations.
13139 (Stub_table): New class defintion.
13140 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13141 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13142 New method definition.
13143
13144 2009-10-21 Doug Kwan <dougkwan@google.com>
13145
13146 * arm.cc: Update copyright comments.
13147 (Target_arm): New forward class template declaration.
13148 (Arm_address): New type.
13149 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13150 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13151 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13152 constants.
13153 (Insn_template): Same.
13154 (DEF_STUBS): New macro.
13155 (Stub_type): New enum type.
13156 (Stub_template): New class definition.
13157 (Stub): Same.
13158 (Reloc_stub): Same.
13159 (Stub_factory): Same.
13160 (Target_arm::Target_arm): Initialize may_use_blx_ and
13161 should_force_pic_veneer_.
13162 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13163 Target_arm::should_force_pic_veneer,
13164 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13165 Target_arm::using_thumb_only, Target_arm:;default_target): New
13166 method defintions.
13167 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13168 New data member declarations.
13169 (Insn_template::size, Insn_template::alignment): New method defintions.
13170 (Stub_template::Stub_template): New method definition.
13171 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13172 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13173 (Stub_factory::Stub_factory): New method definition.
13174 * gold.h (string_hash): New template.
13175 * output.h (Input_section_specifier::hash_value): Use
13176 gold::string_hash.
13177 (Input_section_specifier::string_hash): Remove.
13178 * stringpool.cc (Stringpool_template::string_hash): Use
13179 gold::string_hash.
13180
13181 2009-10-20 Doug Kwan <dougkwan@google.com>
13182
13183 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13184 symbols of relaxed input sections.
13185 * output.h (Output_section::find_relaxed_input_section): Make
13186 method public.
13187
13188 2009-10-16 Doug Kwan <dougkwan@google.com>
13189
13190 * dynobj.cc (Versions::Versions): Initialize version_script_.
13191 Only insert base version symbol definition for a shared object
13192 if version script defines any version versions.
13193 (Versions::define_base_version): New method definition.
13194 (Versions::add_def): Check that base version is not needed.
13195 (Versions::add_need): Define base version lazily.
13196 * dynobj.h (Versions::define_base_version): New method declaration.
13197 (Versions::needs_base_version_): New data member declaration.
13198 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13199 (check_DATA): Add no_version_test.stdout.
13200 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13201 New make rules.
13202 * testsuite/Makefile.in: Regenerate.
13203 * testsuite/no_version_test.c: New file.
13204 * testsuite/no_version_test.sh: Ditto.
13205
13206 2009-10-16 Doug Kwan <dougkwan@google.com>
13207
13208 * expression.cc (class Segment_start_expression): New class definition.
13209 (Segment_start_expression::value): New method definition.
13210 (script_exp_function_segment_start): Return a new
13211 Segment_start_expression.
13212 * gold/script-c.h (script_saw_segment_start_expression): New function
13213 prototype.
13214 * script-sections.cc (Script_sections::Script_sections): Initialize
13215 SAW_SEGMENT_START_EXPRESSION_ to false.
13216 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13217 and -Tbbs options to specify section addresses if given in
13218 command line and no SEGMENT_START expression is seen in a script.
13219 * script-sections.h (Script_sections::saw_segment_start_expression,
13220 Script_sections::set_saw_segment_start_expression): New method
13221 definition.
13222 (Script_sections::saw_segment_start_expression_): New data member
13223 declaration.
13224 * script.cc (script_saw_segment_start_expression): New function.
13225 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13226 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13227 script_test_7.sh and script_test_8.sh.
13228 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13229 script_test_8.stdout.
13230 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13231 (script_test_6, script_test_6.stdout, script_test_7,
13232 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13233 * Makefile.in: Regenerate.
13234 * testsuite/script_test_6.sh: New file.
13235 * testsuite/script_test_6.t: Same.
13236 * testsuite/script_test_7.sh: Same.
13237 * testsuite/script_test_7.t: Same.
13238 * testsuite/script_test_8.sh: Same.
13239
13240 2009-10-16 Doug Kwan <dougkwan@google.com>
13241
13242 * output.cc (Output_segment::set_section_list_address): Cast
13243 expressions to unsigned long long type to avoid format warnings.
13244
13245 2009-10-15 Ian Lance Taylor <iant@google.com>
13246
13247 * script.cc (Script_options::add_symbol_assignment): Always add a
13248 dot assignment to script_sections_.
13249 * script-sections.cc (Script_sections::add_dot_assignment):
13250 Initialize if necessary.
13251
13252 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13253 program headers with no load segment if there is a linker script.
13254
13255 * layout.cc (Layout::set_segment_offsets): Align the file offset
13256 to the segment aligment for -N or -n with no load segment.
13257 * output.cc (Output_segment::add_output_section): Don't crash if
13258 the first section is a TLS section.
13259 (Output_segment::set_section_list_addresses): Print an error
13260 message if the address moves backward in a linker script.
13261 * script-sections.cc
13262 (Output_section_element_input::set_section_addresses): Don't
13263 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13264 (Orphan_output_section::set_section_addresses): Likewise.
13265
13266 2009-10-15 Doug Kwan <dougkwan@google.com>
13267
13268 * layout.cc (Layout::finish_dynamic_section): Generate tags
13269 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13270 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13271 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13272
13273 2009-10-14 Ian Lance Taylor <iant@google.com>
13274
13275 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13276 fields.
13277 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13278 data_shdr fields of relinfo.
13279 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13280 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13281 R_386_TLS_LDO_32, adjust based on section flags.
13282 (Target_i386::Relocate::fix_up_ldo): Remove.
13283
13284 2009-10-13 Ian Lance Taylor <iant@google.com>
13285
13286 Add support for -pie.
13287 * options.h (class General_options): Add -pie and
13288 --pic-executable.
13289 (General_options::output_is_position_independent): Test -pie.
13290 (General_options::output_is_executable): Return true if not shared
13291 and not relocatable.
13292 (General_options::output_is_pie): Remove.
13293 * options.cc (General_options::finalize): Reject incompatible uses
13294 of -pie.
13295 * gold.cc (queue_middle_tasks): A -pie link is not static.
13296 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13297 * symtab.cc (Symbol::final_value_is_known): Return false if
13298 output_is_position_independent.
13299 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13300 output_is_position_independent.
13301 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13302 output_is_position_independent.
13303 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13304 output_is_position_independent.
13305 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13306 two_file_pie_test.
13307 (basic_pie_test.o, basic_pie_test): New targets.
13308 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13309 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13310 (two_file_pie_test): New target.
13311 * testsuite/Makefile.in: Rebuild.
13312 * README: Remove note saying that -pie is not supported.
13313
13314 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13315
13316 * options.h (class General_options): Add -init and -fini.
13317 * layout.cc (Layout::finish_dynamic_section): Emit
13318 given init and fini functions.
13319
13320 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13321
13322 * gc.h (gc_process_relocs): Check if icf is enabled using new
13323 function.
13324 * gold.cc (queue_initial_tasks): Likewise.
13325 (queue_middle_tasks): Likewise.
13326 * object.cc (do_layout): Likewise.
13327 * symtab.cc (is_section_folded): Likewise.
13328 * main.cc (main): Likewise.
13329 * reloc.cc (Read_relocs::run): Likewise.
13330 (Sized_relobj::do_scan_relocs): Likewise.
13331 * icf.cc (is_function_ctor_or_dtor): New function.
13332 (Icf::find_identical_sections): Check if function is ctor or dtor when
13333 safe icf is chosen.
13334 * options.h (General_options::icf): Change option to be an enum.
13335 (Icf_status): New enum.
13336 (icf_enabled): New method.
13337 (icf_safe_folding): New method.
13338 (set_icf_status): New method.
13339 (icf_status_): New variable.
13340 * (options.cc) (General_options::finalize): Set icf_status_.
13341 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13342 icf_test and icf_keep_unique_test to use the --icf enum flag.
13343 * testsuite/icf_safe_test.sh: New file.
13344 * testsuite/icf_safe_test.cc: New file.
13345
13346 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13347
13348 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13349 includes to gc.h and icf.h.
13350 * arm.cc: Include gc.h.
13351 * gold.cc: Likewise.
13352 * i386.cc: Likewise.
13353 * powerpc.cc: Likewise.
13354 * sparc.cc: Likewise.
13355 * x86_64.cc: Likewise.
13356 * gc.h: Include icf.h.
13357
13358 2009-10-11 Ian Lance Taylor <iant@google.com>
13359
13360 * plugin.cc: Include "gold.h" before other header files.
13361
13362 2009-10-10 Chris Demetriou <cgd@google.com>
13363
13364 * options.h (Input_file_argument::Input_file_type): New enum.
13365 (Input_file_argument::is_lib_): Replace with...
13366 (Input_file_argument::type_): New member.
13367 (Input_file_argument::Input_file_argument): Take Input_file_type
13368 'type' rather than boolean 'is_lib' as second argument.
13369 (Input_file_argument::is_lib): Use type_.
13370 (Input_file_argument::is_searched_file): New function.
13371 (Input_file_argument::may_need_search): Handle is_searched_file.
13372 * options.cc (General_options::parse_library): Support -l:filename.
13373 (General_options::parse_just_symbols): Update for Input_file_argument
13374 changes.
13375 (Command_line::process): Likewise.
13376 * archive.cc (Archive::get_file_and_offset): Likewise.
13377 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13378 * script.cc (read_script_file, script_add_file): Likewise.
13379 * fileread.cc (Input_file::Input_file): Likewise.
13380 (Input_file::will_search_for): Handle is_searched_file.
13381 (Input_file::open): Likewise.
13382 * readsyms.cc (Read_symbols::get_name): Likewise.
13383 * testsuite/Makefile.am (searched_file_test): New test.
13384 * testsuite/Makefile.in: Regenerate.
13385 * testsuite/searched_file_test.cc: New file.
13386 * testsuite/searched_file_test_lib.cc: New file.
13387
13388 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13389 Ian Lance Taylor <iant@google.com>
13390
13391 * descriptor.cc: Include <cstdio> and "binary-io.h".
13392 (Descriptors::open): Open the files in binary mode always.
13393 * script.cc (Lex::get_token): Treat \r as whitespace.
13394
13395 2009-10-09 Ian Lance Taylor <iant@google.com>
13396
13397 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13398
13399 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13400 Ian Lance Taylor <iant@google.com>
13401
13402 * configure.ac: Check for readv function also.
13403 * fileread.cc (readv): Define if not HAVE_READV.
13404 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13405 does not exist.
13406 * config.in: Regenerate.
13407 * configure: Regenerate.
13408
13409 2009-10-09 Doug Kwan <dougkwan@google.com>
13410
13411 * layout.cc (Layout::make_output_section): Call target hook to make
13412 ordinary output section.
13413 (Layout::finalize): Adjust parameter list of call the
13414 Target::may_relax().
13415 * layout.h (class Layout::section_list): New method.
13416 * merge.h (Output_merge_base::entsize): Change visibility to public.
13417 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13418 New methods.
13419 (Output_merge_string::do_is_string): New method.
13420 * object.cc (Sized_relobj::do_setup): renamed from
13421 Sized_relobj::set_up.
13422 * object.h (Sized_relobj::adjust_shndx,
13423 Sized_relobj::initializ_input_to_output_maps,
13424 Sized_relobj::free_input_to_output_maps): Change visibilities to
13425 protected.
13426 (Sized_relobj::setup): Virtualize.
13427 (Sized_relobj::do_setup): New method declaration.
13428 (Sized_relobj::invalidate_section_offset,
13429 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13430 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13431 * options.cc (parse_int): New function.
13432 * options.h (parse_int): New declaration.
13433 (DEFINE_int): New macro.
13434 (stub_group_size): New option.
13435 * output.cc (Output_section::Output_section): Initialize memebers
13436 merge_section_map_, merge_section_by_properties_map_,
13437 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13438 (Output_section::add_input_section): Handled deferred code-fill
13439 generation and remove an old comment.
13440 (Output_section::add_relaxed_input_section): New method definition.
13441 (Output_section::add_merge_input_section): Use merge section by
13442 properties map to speed to search. Update merge section maps
13443 as appropriate.
13444 (Output_section::build_relaxation_map): New method definition.
13445 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13446 Same.
13447 (Output_section::relax_input_section): Renamed to
13448 Output_section::convert_input_sections_to_relaxed_sections and change
13449 interface to take a vector of pointers to relaxed sections.
13450 (Output_section::find_merge_section,
13451 Output_section::find_relaxed_input_section): New method definitions.
13452 (Output_section::is_input_address_mapped,
13453 Output_section::output_offset, Output_section::output_address):
13454 Use output section data maps to speed up searching.
13455 (Output_section::find_starting_output_address): Add comments.
13456 (Output_section::do_write,
13457 Output_section::write_to_postprocessing_buffer): Do code-fill
13458 generation as appropriate.
13459 (Output_section::get_input_sections): Invalidate relaxed input section
13460 map.
13461 (Output_section::restore_states): Adjust type of checkpoint .
13462 Invalidate relaxed input section map.
13463 * output.h (Output_merge_base): New class declaration.
13464 (Input_section_specifier): New class defintion.
13465 (class Output_relaxed_input_section) Change base class to
13466 Output_section_data_build.
13467 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13468 base class initializer.
13469 (Output_section::add_relaxed_input_section): New method declaration.
13470 (Output_section::Input_section): Change visibility to protected.
13471 (Output_section::Input_section::relobj,
13472 Output_section::Input_section::shndx): Handle relaxed input sections.
13473 Output_section::input_sections) Change visibility to protected. Also
13474 define overload to return a non-const pointer.
13475 (Output_section::Merge_section_properties): New class defintion.
13476 (Output_section::Merge_section_by_properties_map,
13477 Output_section::Output_section_data_by_input_section_map,
13478 Output_section::Relaxation_map): New types.
13479 (Output_section::relax_input_section): Rename method to
13480 Output_section::convert_input_sections_to_relaxed_sections and change
13481 interface to take a vector of relaxed section pointers.
13482 (Output_section::find_merge_section,
13483 Output_section::find_relaxed_input_section,
13484 Output_section::build_relaxation_map,
13485 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13486 New method declarations.
13487 (Output_section::merge_section_map_
13488 Output_section::merge_section_by_properties_map_,
13489 Output_section::relaxed_input_section_map_,
13490 Output_section::is_relaxed_input_section_map_valid_,
13491 Output_section::generate_code_fills_at_write_): New data members.
13492 * script-sections.cc
13493 (Output_section_element_input::set_section_addresses): Call
13494 current_data_size and addralign methods of relaxed input sections.
13495 (Orphan_output_section::set_section_addresses): Call current_data_size
13496 and addralign methods of relaxed input sections.
13497 * symtab.cc (Symbol_table::compute_final_value): Extract template
13498 from the body of Symbol_table::sized_finalize_symbol.
13499 (Symbol_table::sized_finalized_symbol): Call
13500 Symbol_table::compute_final_value.
13501 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13502 (Symbol_table::compute_final_value): New templated method declaration.
13503 * target.cc (Target::do_make_output_section): New method defintion.
13504 * target.h (Target::make_output_section): New method declaration.
13505 (Target::relax): Add more parameters for input objects, symbol table
13506 and layout. Adjust call to do_relax.
13507 (Target::do_make_output_section): New method declaration.
13508 (Target::do_relax): Add parameters for input objects, symbol table
13509 and layout.
13510
13511 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13512
13513 * pread.c: Include stdio.h.
13514
13515 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13516
13517 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13518 defined.
13519
13520 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13521
13522 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13523 Change read_shndx type to unsigned int.
13524 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13525 int.
13526 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13527 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13528 Change read_shndx type to unsigned int.
13529 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13530 int.
13531 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13532 * layout.cc (Layout::create_symtab_sections): Cast the result of
13533 local_symcount * symsize to off_t in the gold_assert.
13534
13535 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13536
13537 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13538 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13539 R_ARM_BASE_ABS.
13540 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13541 (Arm_relocate_functions::thm_abs5): New function.
13542 (Arm_relocate_functions::abs12): New function.
13543 (Arm_relocate_functions::abs16): New function.
13544 (Arm_relocate_functions::base_abs): New function.
13545 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13546 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13547 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13548 R_ARM_BASE_ABS.
13549 (Scan::global): Likewise.
13550 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13551 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13552 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13553 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13554 R_ARM_BASE_ABS.
13555
13556 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13557
13558 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13559 (Arm_relocate_functions::movt_prel): New function.
13560 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13561 (Arm_relocate_functions::thm_movt_prel): New function.
13562 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13563 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13564 (Scan::global, Relocate::relocate): Likewise.
13565 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13566
13567 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13568
13569 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13570 Incremental_checker.
13571 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13572 unsigned int.
13573 (class Incremental_inputs_header): New class.
13574 (Incremental_inputs_header_writer): Edit comment.
13575 (Incremental_inputs_entry): New class.
13576 (Incremental_inputs_entry_writer): Edit comment.
13577 (Sized_incremental_binary::do_find_incremental_inputs_section):
13578 Add *strtab_shndx parameter, fill it.
13579 (Sized_incremental_binary::do_check_inputs): New method.
13580 (Incremental_checker::can_incrementally_link_output_file): Use
13581 Sized_incremental_binary::check_inputs.
13582 (Incremental_inputs::report_command_line): Save command line in
13583 command_line_.
13584 * incremental.h:
13585 (Incremental_binary::find_incremental_inputs_section): New
13586 method.
13587 (Incremental_binary::do_find_incremental_inputs_section): Add
13588 strtab_shndx parameter.
13589 (Incremental_binary::do_check_inputs): New pure virtual method.
13590 (Sized_incremental_binary::do_check_inputs): Declare.
13591 (Incremental_checker::Incremental_checker): Add incremental_inputs
13592 parameter, use it to initialize incremental_inputs_.
13593 (Incremental_checker::incremental_inputs_): New field.
13594 (Incremental_checker::command_line): New method.
13595 (Incremental_checker::inputs): New method.
13596 (Incremental_checker::command_line_): New field.
13597
13598 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13599
13600 * incremental.cc: Include <cstdarg> and "target-select.h".
13601 (vexplain_no_incremental): New function.
13602 (explain_no_incremental): New function.
13603 (Incremental_binary::error): New method.
13604 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13605 method.
13606 (make_sized_incremental_binary): New function.
13607 (open_incremental_binary): New function.
13608 (can_incrementally_link_file): Add checks if output is ELF and has
13609 inputs section.
13610 * incremental.h: Include "elfcpp_file.h" and "output.h".
13611 (Incremental_binary): New class.
13612 (Sized_incremental_binary): New class.
13613 (open_incremental_binary): Declare.
13614 * object.cc (is_elf_object): Use
13615 elfcpp::Elf_recognizer::is_elf_file.
13616 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13617 * output.h (Output_file::filesize): New method.
13618
13619 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13620
13621 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13622 New function.
13623 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13624 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13625 function.
13626 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13627 function.
13628 (Arm_relocate_functions::movw_abs_nc): New function.
13629 (Arm_relocate_functions::movt_abs): New function.
13630 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13631 (Arm_relocate_functions::thm_movt_abs): New function.
13632 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13633 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13634 (Scan::global): Likewise.
13635 (Relocate::relocate): Likewise.
13636 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13637
13638 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13639
13640 * arm.cc (Arm_relocate_functions::got_prel) New function.
13641 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13642 (Relocate::relocate): Likewise.
13643 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13644
13645 2009-10-06 Ian Lance Taylor <iant@google.com>
13646
13647 * options.h (class General_options): Define
13648 split_stack_adjust_size parameter.
13649 * object.h (class Object): Add uses_split_stack_ and
13650 has_no_split_stack_ fields. Add uses_split_stack and
13651 has_no_split_stack accessor functions. Declare
13652 handle_split_stack_section.
13653 (class Reloc_symbol_changes): Define.
13654 (class Sized_relobj): Define Function_offsets. Declare
13655 split_stack_adjust, split_stack_adjust_reltype, and
13656 find_functions.
13657 * object.cc (Object::handle_split_stack_section): New function.
13658 (Sized_relobj::do_layout): Call handle_split_stack_section.
13659 * dynobj.cc (Sized_dynobj::do_layout): Call
13660 handle_split_stack_section.
13661 * reloc.cc (Sized_relobj::relocate_sections): Call
13662 split_stack_adjust for executable sections in split_stack
13663 objects. Pass reloc_map to relocate_section.
13664 (Sized_relobj::split_stack_adjust): New function.
13665 (Sized_relobj::split_stack_adjust_reltype): New function.
13666 (Sized_relobj::find_functions): New function.
13667 * target-reloc.h: Include "object.h".
13668 (relocate_section): Add reloc_symbol_changes parameter. Change
13669 all callers.
13670 * target.h (class Target): Add calls_non_split method. Declare
13671 do_calls_non_split virtual method. Declare match_view and
13672 set_view_to_nop.
13673 * target.cc: Include "elfcpp.h".
13674 (Target::do_calls_non_split): New function.
13675 (Target::match_view): New function.
13676 (Target::set_view_to_nop): New function.
13677 * gold.cc (queue_middle_tasks): Give an error if mixing
13678 split-stack and non-split-stack objects with -r.
13679 * i386.cc (Target_i386::relocate_section): Add
13680 reloc_symbol_changes parameter.
13681 (Target_i386::do_calls_non_split): New function.
13682 * x86_64.cc (Target_x86_64::relocate_section): Add
13683 reloc_symbol_changes parameter.
13684 (Target_x86_64::do_calls_non_split): New function.
13685 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13686 parameter.
13687 * powerpc.cc (Target_powerpc::relocate_section): Add
13688 reloc_symbol_changes parameter.
13689 * sparc.cc (Target_sparc::relocate_section): Add
13690 reloc_symbol_changes parameter.
13691 * configure.ac: Call AM_CONDITIONAL for the default target.
13692 * configure: Rebuild.
13693 * testsuite/Makefile.am (TEST_AS): New variable.
13694 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13695 (check_DATA): Add split_i386 and split_x86_64 files.
13696 (SPLIT_DEFSYMS): Define.
13697 (split_i386_[1234n].o): New targets.
13698 (split_i386_[124]): New targets.
13699 (split_i386_[1234r].stdout): New targets.
13700 (split_x86_64_[1234n].o): New targets.
13701 (split_x86_64_[124]): New targets.
13702 (split_x86_64_[1234r].stdout): New targets.
13703 (MOSTLYCLEANFILES): Add new executables.
13704 * testsuite/split_i386.sh: New file.
13705 * testsuite/split_x86_64.sh: New file.
13706 * testsuite/split_i386_1.s: New file.
13707 * testsuite/split_i386_2.s: New file.
13708 * testsuite/split_i386_3.s: New file.
13709 * testsuite/split_i386_4.s: New file.
13710 * testsuite/split_i386_n.s: New file.
13711 * testsuite/split_x86_64_1.s: New file.
13712 * testsuite/split_x86_64_2.s: New file.
13713 * testsuite/split_x86_64_3.s: New file.
13714 * testsuite/split_x86_64_4.s: New file.
13715 * testsuite/split_x86_64_n.s: New file.
13716 * testsuite/testfile.cc (Target_test): Update relocation_section
13717 function.
13718 * testsuite/Makefile.in: Rebuild.
13719
13720 2009-10-06 Ian Lance Taylor <iant@google.com>
13721
13722 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13723 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13724 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13725 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13726 the address on ldo_addrs_.
13727 (Target_i386::Relocate::fix_up_ldo): New function.
13728
13729 2009-10-06 Rafael Espindola <espindola@google.com>
13730
13731 * plugin.cc (add_input_library): New.
13732 (Plugin::load): Add add_input_library to tv.
13733 (Plugin_manager::add_input_file): Add the is_lib argument.
13734 (add_input_file): Update call to Plugin_manager::add_input_file.
13735 (add_input_library): New.
13736 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13737
13738 2009-09-30 Doug Kwan <dougkwan@google.com>
13739
13740 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13741 symbol and call Symbol::may_need_copy_reloc to determine if
13742 a copy reloc is needed.
13743 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13744 nocopyreloc is given in command line.
13745 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13746 given in command line.
13747 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13748 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13749 of the removed Target_i386::may_need_copy_reloc.
13750 * options.h (copyreloc): New option with default value false.
13751 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13752 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13753 instead of the removed Target_powerpc::may_need_copy_reloc.
13754 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13755 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13756 instead of the removed Target_sparc::may_need_copy_reloc.
13757 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13758 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13759 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13760 instead of the removed Target_x86_64::may_need_copy_reloc.
13761
13762 2009-09-30 Ian Lance Taylor <iant@google.com>
13763
13764 * object.h (class Object): Remove target_ field, and target,
13765 sized_target, and set_target methods.
13766 (Object::sized_target): Remove.
13767 (class Sized_relobj): Update declarations. Remove sized_target.
13768 * object.cc (Sized_relobj::setup): Remove target parameter.
13769 Change all callers.
13770 (Input_objects::add_object): Don't do anything with the target.
13771 (make_elf_sized_object): Add punconfigured parameter. Change all
13772 callers. Set or test parameter target.
13773 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13774 Change all callers.
13775 * parameters.cc (Parameters::set_target): Change parameter type to
13776 be non-const.
13777 (Parameters::default_target): Remove.
13778 (set_parameters_target): Change parameter type to be non-const.
13779 (parameters_force_valid_target): New function.
13780 (parameters_clear_target): New function.
13781 * parameters.h (class Parameters): Update declarations. Remove
13782 default_target method. Add sized_target and clear_target
13783 methods. Change target_ to be non-const.
13784 (set_parameters_target): Update declaration.
13785 (parameters_force_valid_target): Declare.
13786 (parameters_clear_target): Declare.
13787 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13788 as NULL if we aren't searching.
13789 (Add_symbols::run): Don't check for compatible target.
13790 * fileread.cc (Input_file::open_binary): Call
13791 parameters_force_valid_target.
13792 * gold.cc (queue_middle_tasks): Likewise.
13793 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13794 set_target on object.
13795 * dynobj.h (class Sized_dynobj): Update declarations.
13796 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13797 make_elf_object returns NULL.
13798 (Archive::include_member): Don't check whether object target is
13799 compatible.
13800 * output.cc (Output_section::add_input_section): Get target from
13801 parameters.
13802 (Output_section::relax_input_section): Likewise.
13803 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13804 parameters.
13805 (Sized_relobj::do_scan_relocs): Likewise.
13806 (Sized_relobj::relocate_sections): Likewise.
13807 * resolve.cc (Symbol_table::resolve): Likewise.
13808 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13809 parameter. Change all callers.
13810 (Symbol_table::add_from_object): Get target from parameters.
13811 (Symbol_table::add_from_relobj): Don't check object target.
13812 (Symbol_table::add_from_dynobj): Likewise.
13813 (Symbol_table::define_special_symbol): Get target from
13814 parameters.
13815 * symtab.h (class Symbol_table): Update declaration.
13816 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13817 parameter. Change all callers. Clear parameter target.
13818 (Binary_test): Test target here.
13819 * testsuite/object_unittest.cc (gold_testsuite): Remove
13820 target_test_pointer parameter. Change all callers.
13821 (Object_test): Test target here.
13822
13823 2009-09-26 Ian Lance Taylor <iant@google.com>
13824
13825 * testsuite/initpri1.c: Don't try to use constructor priorities if
13826 compiling with gcc before 4.3.
13827
13828 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13829
13830 * testsuite/retain_symbols_file_test.sh (check_present): Change
13831 output file name to retain_symbols_file_test.stdout.
13832 (check_absent): Likewise.
13833
13834 2009-09-18 Craig Silverstein <csilvers@google.com>
13835
13836 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13837 * options.cc: Include <cerrno> and <fstream>.
13838 (General_options::finalize): Parse -retain-symbols-file tag.
13839 * options.h: New flag.
13840 (General_options): New method should_retain_symbol, new
13841 variable symbols_to_retain.
13842 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13843 should_retain_symbol map.
13844 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13845 * testsuite/Makefile.in: Regenerate.
13846 * testsuite/retain_symbols_file_test.sh: New file.
13847
13848 2009-09-18 Nick Clifton <nickc@redhat.com>
13849
13850 * po/es.po: Updated Spanish translation.
13851
13852 2009-09-17 Doug Kwan <dougkwan@google.com>
13853
13854 * debug.h (DEBUG_RELAXATION): New constant.
13855 (DEBUG_ALL): Add DEBUG_RELAXATION.
13856 (debug_string_to_enum): Add relaxation debug option.
13857 * layout.cc
13858 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13859 Layout::Relaxation_debug_check::read_sections,
13860 Layout::Relaxation_debug_check::read_sections): New method definitions.
13861 (Layout::Layout): Initialize data members
13862 record_output_section_data_from_scrips_,
13863 script_output_section_data_list_ and relaxation_debug_check_.
13864 (Layout::save_segments, Layout::restore_segments,
13865 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13866 Layout::relaxation_loop_body): New method definitions.
13867 (Layout::finalize): Support relaxation. Move section layout code to
13868 Layout::relaxation_loop_body.
13869 (Layout::set_asection_address_from_script): Move code for orphan
13870 section placement out.
13871 (Layout::place_orphan_sections_in_script): New method definition.
13872 * layout.h (Output_segment_headers, Output_file_header):
13873 New forward class declarations.
13874 (Layout::~Layout): Define.
13875 (Layout::new_output_section_data_from_script): New method definition.
13876 (Layout::place_orphan_sections_in_script): New method declaration.
13877 (Layout::Segment_states): New type declaration.
13878 (Layout::save_segments, Layout::restore_segments,
13879 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13880 Layout::relaxation_loop_body): New method declarations.
13881 (Layout::Output_section_data_list): New type declaration.
13882 (Layout::Relaxation_debug_check): New class definition.
13883 (Layout::record_output_section_data_from_script_,
13884 Layout::script_output_section_data_list_, Layout::segment_states_,
13885 Layout::relaxation_debug_check_): New data members.
13886 * output.cc: (Output_section_headers::do_size): New method definition.
13887 (Output_section_headers::Output_section_headers): Move size
13888 computation to Output_section_headers::do_size.
13889 (Output_segment_headers::do_size): New method definition.
13890 (Output_file_header::Output_file_header): Move size computation to
13891 Output_file_header::do_size and call it.
13892 (Output_file_header::do_size): New method definition.
13893 (Output_data_group::Output_data_group): Adjust call to
13894 Output_section_data.
13895 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13896 (Output_symtab_xindex::do_write): Add array bound check.
13897 (Output_section::Input_section::print_to_mapfile): Handle
13898 RELAXED_INPUT_SECTION_CODE.
13899 (Output_section::Output_section): Initialize data member checkpoint_.
13900 (Output_section::~Output_section): Delete checkpoint object pointed
13901 by checkpoint_.
13902 (Output_section::add_input_section): Always add an Input_section if
13903 relaxing.
13904 (Output_section::add_merge_input_section): Add assert.
13905 (Output_section::relax_input_section): New method definition.
13906 (Output_section::set_final_data_size): Set load address to zero for
13907 an unallocated section.
13908 (Output_section::do_address_and_file_offset_have_reset_values):
13909 New method definition.
13910 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13911 Handle relaxed input section.
13912 (Output_section::sort_attached_input_sections): Checkpoint input
13913 section list lazily.
13914 (Output_section::get_input_sections): Change type of input_sections to
13915 list of Simple_input_section pointers. Checkpoint input section list
13916 lazily. Also handle relaxed input sections.
13917 (Output_section::add_input_section_for_script): Take a reference to
13918 a Simple_input_section object instead of Relobj pointer and section
13919 index as parameter. Handle relaxed input sections.
13920 (Output_section::save_states, Output_section::restore_states): New
13921 method definitions.
13922 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13923 (Output_data::is_data_size_fixed): New method definition.
13924 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13925 if it is fixed.
13926 (Output_data::address_and_file_offset_have_reset_values): New method
13927 definition.
13928 (Output_data::do_address_and_file_offset_have_reset_values): New method
13929 definition.
13930 (Output_data::set_data_size): Check that data size is not fixed.
13931 (Output_data::fix_data_size): New method definition.
13932 (Output_data::is_data_size_fixed_): New data member.
13933 (Output_section_headers::set_final_data_size): New method definition.
13934 (Output_section_headers::do_size): New method declaration.
13935 (Output_segment_headers::set_final_data_size): New method definition.
13936 (Output_segment_headers::do_size): New method declaration.
13937 (Output_file_header::set_final_data_size)::New method definition.
13938 (Output_file_header::do_size)::New method declaration.
13939 (Output_section_data::Output_section_data): Add new parameter
13940 is_data_size_fixed and use it to fix data size.
13941 (Output_data_const::Output_data_const): Adjust call to base class
13942 constructor and fix data size.
13943 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13944 base class constructor and fix data size.
13945 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13946 base class constructor and fix data size.
13947 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13948 class constructor and fix data size.
13949 (Output_data_group::set_final_data_size): New method definition.
13950 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13951 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13952 class constructor and fix data size.
13953 (Output_relaxed_input_section): New class definition.
13954 (Output_section::Simple_input_section): New class definition.
13955 (Output_section::get_input_sections): Adjust parameter list.
13956 (Output_section::add_input_section_for_script): Same.
13957 (Output_section::save_states, Output_section::restore_states,
13958 Output_section::do_address_and_file_offset_have_reset_values,
13959 (Output_section::Input_section::Input_section): Handle
13960 RELAXED_INPUT_SECTION_CODE. Add new overload for
13961 Output_relaxed_input_section.
13962 (Output_section::Input_section::is_input_section,
13963 Output_section::Input_section::set_output_section): Handle relaxed
13964 input section.
13965 (Output_section::Input_section::is_relaxed_input_section,
13966 Output_section::Input_section::output_section_data,
13967 Output_section::Input_section::relaxed_input_section): New method
13968 definitions.
13969 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13970 value.
13971 (Output_section::Input_section::u1_): Update comments.
13972 (Output_section::Input_section::u2_): Add new union member poris.
13973 (Output_section::Checkpoint_output_section): New classs definition.
13974 (Output_section::relax_input_section): New method declaration.
13975 (Output_section::checkpoint_): New data member.
13976 (Output_segment): Update comments.
13977 (Output_segment::Output_segment): Un-privatize copy constructor.
13978 (Output_segment::operator=): Un-privatize.
13979 * script-sections.cc (Output_section_element::Input_section_list):
13980 Change element type to Output_section::Simple_input_section.
13981 (Output_section_element_dot_assignment::set_section_addresses):
13982 Register output section data for relaxation clean up.
13983 (Output_data_exression::Output_data_expression): Adjust call to base
13984 constructor to fix data size.
13985 (Output_section_element_data::set_section_addresses): Register
13986 Output_data_expression object for relaxation clean up.
13987 (struct Input_section_info): Replace Relobj pointer and section index
13988 pair with Output_section::Simple_input_section and Convert struct to a
13989 class.
13990 (Input_section_sorter::operator()): Adjust access to
13991 Input_section_info data member to use accessors.
13992 (Output_section_element_input::set_section_addresses): Use layout
13993 parameter. Adjust code to use Output_section::Simple_input_section
13994 and Input_secction_info classes. Register filler for relaxation
13995 clean up.
13996 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13997 and section index pair with Output_section::Simple_input_section
13998 class. Adjust code accordingly.
13999 (Phdrs_element::release_segment): New method definition.
14000 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14001 segment list.
14002 (Script_sections::release_segments): New method definition.
14003 * gold/script-sections.h (Script_sections::release_segments): New
14004 method declaration.
14005 * gold/target.h (Target::may_relax, Target::relax,
14006 Target::do_may_relax, Target::do_relax): New method definitions.
14007
14008 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14009
14010 * arm.cc (has_signed_unsigned_overflow): New function.
14011 (Arm_relocate_functions::abs8): New function.
14012 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14013 (Target_arm::Scan::global): Likewise.
14014 (Target_arm::relocate::relocate): Likewise.
14015 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14016 Likewise.
14017
14018 2009-09-16 Cary Coutant <ccoutant@google.com>
14019
14020 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14021 * testsuite/Makefile.in: Regenerate.
14022
14023 2009-09-11 Nick Clifton <nickc@redhat.com>
14024
14025 * po/gold.pot: Updated by the Translation project.
14026
14027 2009-09-08 Cary Coutant <ccoutant@google.com>
14028
14029 * output.cc (Output_file::open): Add execute permission to empty file.
14030 * testsuite/Makefile.am (permission_test): New test.
14031 * testsuite/Makefile.in: Regenerate.
14032
14033 2009-09-02 Ian Lance Taylor <iant@google.com>
14034
14035 * output.cc (Output_file::resize): Call map_no_anonymous rather
14036 than map.
14037
14038 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14039
14040 * gold.cc: Include "incremental.h".
14041 (queue_initial_tasks): Call Incremental_checker methods.
14042 * incremental.cc: Include "output.h".
14043 (Incremental_checker::can_incrementally_link_output_file): New
14044 method.
14045 * incremental.h (Incremental_checker): New class.
14046
14047 * output.cc (Output_file::open_for_modification): New method.
14048 (Output_file::map_anonymous): Changed return type to bool. Record
14049 map in base_ field.
14050 (Output_file::map_no_anonymous): New method, broken out of map.
14051 (Output_file::map): Use map_no_anonymous and map_anonymous.
14052 * output.h (class Output_file): Update declarations.
14053
14054 2009-08-24 Cary Coutant <ccoutant@google.com>
14055
14056 * options.h (Command_line::Pre_options): New class.
14057 (Command_line::pre_options): New member.
14058 * options.cc (gold::options::ready_to_register): New variable.
14059 (One_option::register_option): Do nothing if not registering options.
14060 Assert if same short option registered twice.
14061 (General_options::General_options): Turn off option registration when
14062 done constructing.
14063 (Command_line::Pre_options::Pre_options): New constructor.
14064
14065 2009-08-24 Cary Coutant <ccoutant@google.com>
14066
14067 * options.h (General_options::no_keep_memory): Remove incorrect
14068 short option.
14069
14070 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14071
14072 * Makefile.am (am__skiplex, am__skipyacc): New.
14073 * Makefile.in: Regenerate.
14074
14075 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14076
14077 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14078 (INCLUDES): ... this.
14079 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14080 (AM_CPPFLAGS): Renamed from ...
14081 (INCLUDE): ... this.
14082 * Makefile.in, testsuite/Makefile.in: Regenerate.
14083
14084 * Makefile.in: Regenerate.
14085 * aclocal.m4: Likewise.
14086 * config.in: Likewise.
14087 * configure: Likewise.
14088 * testsuite/Makefile.in: Likewise.
14089
14090 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14091 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14092 * Makefile.in: Regenerate.
14093 * testsuite/Makefile.in: Regenerate.
14094
14095 2009-08-19 Cary Coutant <ccoutant@google.com>
14096
14097 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14098 symbols in shared libraries overridden by hidden or internal symbols
14099 in the main program.
14100
14101 2009-08-19 Chris Demetriou <cgd@google.com>
14102
14103 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14104 checking source file names in error messages.
14105
14106 2009-08-18 Doug Kwan <dougkwan@google.com>
14107
14108 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14109 an elcpp::Ehdr as parameter. Adjust call to set_target.
14110 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14111 an elfcpp::Ehdr as parameter.
14112 * object.cc (Object::set_target): Remove the version that looks up
14113 a target and sets it.
14114 (Sized_relobj::setup): Take a Target object instead of
14115 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14116 (make_elf_sized_object): Find target and ask target to
14117 make an ELF object.
14118 * object.h: (Object::set_target): Remove the version that looks up
14119 a target and sets it.
14120 (Sized_relobj::setup): Take a Target object instead of
14121 an elfcpp:Ehdr as parameter.
14122 * target.cc: Include dynobj.h.
14123 (Target::do_make_elf_object_implementation): New.
14124 (Target::do_make_elf_object): New.
14125 * target.h (Target::make_elf_object): New template declaration.
14126 (Target::do_make_elf_object): New method declarations.
14127 (Target::do_make_elf_object_implementation): New template declaration.
14128
14129 2009-08-14 Ian Lance Taylor <iant@google.com>
14130
14131 * gold.h (FUNCTION_NAME): Define.
14132 (gold_unreachable): Use FUNCTION_NAME.
14133
14134 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14135
14136 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14137 symbol in the --keep-unique list is not found.
14138
14139 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14140
14141 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14142 been maked as --keep-unique.
14143 (Icf::unfold_section): New function.
14144 * icf.h (Icf::unfold_section): New function.
14145 * options.h (General_options::keep_unique): New option.
14146 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14147 * testsuite/Makefile.in: Regenerate.
14148 * testsuite/icf_keep_unique_test.sh: New file.
14149 * testsuite/icf_keep_unique_test.cc: New file.
14150
14151 2009-08-12 Cary Coutant <ccoutant@google.com>
14152
14153 PR 10471
14154 * resolve.cc (Symbol_table::resolve): Check for references from
14155 dynamic objects to hidden and internal symbols.
14156 * testsuite/Makefile.am (hidden_test.sh): New test.
14157 * testsuite/Makefile.in: Regenerate.
14158 * testsuite/hidden_test.sh: New script.
14159 * testsuite/hidden_test_1.c: New test source.
14160 * testsuite/hidden_test_main.c: New test source.
14161
14162 2009-08-11 Doug Kwan <dougkwan@google.com>
14163
14164 * arm.cc: Update comments.
14165 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14166 segment to locate the .ARM.exidx section if present.
14167
14168 2009-08-09 Doug Kwan <dougkwan@google.com>
14169
14170 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14171 patch.
14172
14173 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14174 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14175 compiler warnings.
14176
14177 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14178
14179 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14180 valid tls_segment only for non-debug-section relocations.
14181 * testsuite/Makefile.am: Add gc_tls_test.
14182 * testsuite/Makefile.in: Regenerate.
14183 * testsuite/gc_tls_test.cc: New file.
14184 * testsuite/gc_tls_test.sh: New file.
14185
14186 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14187
14188 * icf.cc: New file.
14189 * icf.h: New file.
14190 * Makefile.am (CCFILES): Add icf.cc.
14191 (HFILES): Add icf.h
14192 * Makefile.in: Regenerate.
14193 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14194 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14195 section, symbol and addend information for the relocs.
14196 * gold.cc (queue_middle_tasks): Call identical code folding.
14197 * gold.h: Add defines for multimap.
14198 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14199 to the call of finalize_local_symbols.
14200 * main.cc (main): Create object of class Icf.
14201 * object.cc (Sized_relobj::do_layout): Allow this function to be
14202 called twice during icf.
14203 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14204 to sections marked as identical by icf.
14205 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14206 when available.
14207 (Sized_relobj::do_section_entsize): New function.
14208 * object.h (Object::section_entsize): New function.
14209 (Object::do_section_entsize): New pure virtual function.
14210 (Relobj::finalize_local_symbols): Add new parameter.
14211 (Relobj::do_section_entsize): New function.
14212 * options.h (General_options::icf): New option.
14213 (General_options::icf_iterations): New option.
14214 (General_options::print_icf_sections): New option.
14215 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14216 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14217 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14218 icf.
14219 * symtab.cc (Symbol_table::is_section_folded): New function.
14220 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14221 to sections marked as identical by icf.
14222 * symtab.h (Symbol_table::set_icf): New function.
14223 (Symbol_table::icf): New function.
14224 (Symbol_table::is_section_folded): New function.
14225 (Symbol_table::icf_): New data member.
14226 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14227 * testsuite/Makefile.am: Add commands to build icf_test.
14228 * testsuite/Makefile.in: Regenerate.
14229 * testsuite/icf_test.sh: New file.
14230 * testsuite/icf_test.cc: New file.
14231
14232 2009-07-24 Chris Demetriou <cgd@google.com>
14233
14234 * layout.cc (is_compressible_debug_section): Fix incorrect
14235 comment about compressed section names.
14236
14237 2009-07-20 Ian Lance Taylor <ian@airs.com>
14238
14239 PR 10419
14240 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14241
14242 2009-07-16 Ian Lance Taylor <iant@google.com>
14243
14244 PR 10400
14245 * layout.h: #include <map>.
14246 (class Kept_section): Change from struct to class. Add accessors
14247 and setters. Add section size to Comdat_group mapping. Change
14248 Comdat_group to std::map. Add is_comdat_ field. Add
14249 linkonce_size field in union.
14250 (class Layout): Update declaration of find_or_add_kept_section.
14251 Don't declare find_kept_object.
14252 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14253 parameter. Add object, shndx, is_comdat, and is_group_name
14254 parameters. Change all callers. Adjust for new Kept_section.
14255 (Layout::find_kept_object): Remove.
14256 * object.cc (Sized_relobj::include_section_group): Update use of
14257 Kept_section. Rename secnum to shndx. Only record
14258 Kept_comdat_section if sections are the same size.
14259 (Sized_relobj::include_linkonce_section): Update use of
14260 Kept_section. Only record Kept_comdat_section if sections are the
14261 same size. Set size of linkonce section.
14262 (Sized_relobj::map_to_kept_section): Update call to
14263 get_kept_comdat_section.
14264 * object.h (class Sized_relobj): Rename fields in
14265 Kept_comdat_section to drop trailing underscores; change object
14266 field to Relobj*. Change Kept_comdat_section_table to store
14267 struct rather than pointer.
14268 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14269 Add kept_object and kept_shndx parameters. Change all callers.
14270 (Sized_relobj::get_kept_comdat_section): Change return type to
14271 bool. Add kept_object and kept_shndx parameters. Change all
14272 callers.
14273 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14274 Layout::find_or_add_kept_section.
14275
14276 2009-07-09 Ian Lance Taylor <iant@google.com>
14277
14278 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14279 Reserve space in the hash table.
14280
14281 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14282
14283 * fileread.cc (File_read::get_mtime): New method.
14284 * fileread.h (Timespec): New structure.
14285 (File_read::get_mtime): New method.
14286 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14287 Renamed from timestamp_nsec.
14288 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14289 Elf_Xword.
14290 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14291 timestamp_nsec.
14292 (Incremental_inputs::report_archive): Save mtime; style fix.
14293 (Incremental_inputs::report_obejct): Save mtime; style fix.
14294 (Incremental_inputs::report_script): Save mtime; style fix.
14295 (Incremental_inputs::finalize_inputs): Style fix.
14296 (Incremental_inputs::finalize): Style fix.
14297 (Incremental_inputs::create_input_section_data): Store inputs
14298 mtime.
14299 * incremental.h (Incremental_inputs::report_script): Add mtime
14300 argument.
14301 (Incremental_inputs::Input_info::Input_info): Intialize only one
14302 union member.
14303 (Incremental_inputs::Input_info::archive): Move to nameless
14304 union.
14305 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14306 (Incremental_inputs::Input_info::script): Move to nameless union.
14307 (Incremental_inputs::mtime): New field.
14308 * script.cc (read_input_script): Pass file mtime to
14309 Incremental_input.
14310 * script.h (Script_info::inputs): Style fix.
14311
14312 2009-07-01 Ian Lance Taylor <ian@airs.com>
14313
14314 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14315 instead of 32.
14316
14317 2009-06-24 Ian Lance Taylor <iant@google.com>
14318
14319 PR 10156
14320 * layout.cc (Layout::choose_output_section): If we find an
14321 existing section, update the flags.
14322 (Layout::create_notes): New function, broken out of
14323 Layout::finalize.
14324 (Layout::finalize): Don't create note sections.
14325 (Layout::create_note): Don't crash if linker script discards
14326 section.
14327 (Layout::create_gold_note): Likewise.
14328 (Layout::create_build_id): Likewise. Don't set
14329 after_input_sections on the section.
14330 (Layout::create_executable_stack_info): Remove target parameter.
14331 Change caller.
14332 * layout.h (class Layout): Declare create_notes. Update
14333 declaration of create_executable_stack_info.
14334 * gold.cc (queue_middle_tasks): Call create_notes.
14335 * output.cc (Output_section::update_flags_for_input_section): Move
14336 here from output.h. If SHF_ALLOC flag is newly set, mark address
14337 invalid.
14338 * output.h (Output_data::mark_address_invalid): New function.
14339 (class Output_section): Only declare, not define,
14340 update_flags_for_input_section. Remove set_flags.
14341
14342 2009-06-24 Ian Lance Taylor <iant@google.com>
14343
14344 * script-sections.cc (Output_section_definition::
14345 set_section_addresses): Rename shadowing local load_address to
14346 laddr.
14347
14348 2009-06-24 Ian Lance Taylor <iant@google.com>
14349
14350 PR 10244
14351 * reloc.cc (relocate_sections): Skip empty relocation sections.
14352
14353 2009-06-23 Ian Lance Taylor <iant@google.com>
14354
14355 PR 10156
14356 * layout.cc (Layout::create_note): Use choose_output_section
14357 rather than make_output_section.
14358
14359 2009-06-23 Ian Lance Taylor <iant@google.com>
14360
14361 PR 10237
14362 * options.cc (General_options::parse_V): Set printed_version_.
14363 (General_options::General_options): Initialize printed_version_.
14364 * options.h (class General_options): Add printed_version_ field.
14365 * gold.cc (queue_initial_tasks): If there are no input files,
14366 don't give a fatal error if we printed the version information.
14367 (queue_middle_tasks): If using -r with a shared object, give a
14368 fatal error rather than an ordinary error.
14369
14370 2009-06-23 Ian Lance Taylor <iant@google.com>
14371
14372 PR 10219
14373 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14374 (Layout::make_output_section): Set have_stabstr_section_ if we see
14375 a .stab*str section.
14376 (Layout::finalize): Call link_stabs_sections.
14377 (Layout::link_stabs_sections): New file.
14378 * layout.h (class Layout): Add have_stabstr_section_ field.
14379 Declare link_stabs_sections.
14380
14381 2009-06-23 Doug Kwan <dougkwan@google.com>
14382
14383 * Makefile.am (libgold_a_LIBADD): New.
14384 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14385 * Makefile.in: Regenerate.
14386 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14387 * configure: Regenerate.
14388 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14389 * fileread.cc: Include sys/state.h
14390 * gold.h: Declare memmem and strndup if found missing.
14391 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14392
14393 2009-06-23 Ian Lance Taylor <iant@google.com>
14394
14395 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14396 * configure: Rebuild.
14397
14398 2009-06-23 Ian Lance Taylor <iant@google.com>
14399
14400 PR 10147
14401 * object.cc (Object::section_contents): Don't try to get a view if
14402 the section has length zero.
14403 (Object::handle_gnu_warning_section): If the section is empty, use
14404 the name of the section as the warning.
14405
14406 2009-06-23 Ian Lance Taylor <iant@google.com>
14407
14408 PR 10133
14409 * stringpool.h (class Stringpool_template): Add optimize_ field.
14410 (Stringpool_template::set_optimize): New function.
14411 * stringpool.cc (Stringpool_template::Stringpool_template):
14412 Initialize optimize_ field.
14413 (Stringpool_template::set_string_offsets): Test local optimize
14414 fild rather than parameter.
14415 * layout.cc (Layout::Layout): Call set_optimize on the section
14416 name stringpool.
14417
14418 2009-06-22 Ian Lance Taylor <iant@google.com>
14419
14420 PR 10030
14421 * yyscript.y: Parse TARGET.
14422 * script.cc (script_set_target): New function.
14423 * script-c.h (script_set_target): Declare.
14424 * options.cc (General_options::string_to_object_format): Rename
14425 from string_to_object_format in anonymous namespace. Change
14426 callers.
14427 * options.h (class General_options): Declare
14428 string_to_object_format.
14429
14430 2009-06-22 Ian Lance Taylor <iant@google.com>
14431
14432 * script-sections.cc (Script_sections::create_segments): Don't put
14433 program headers in a PT_LOAD segment if -n or -N.
14434
14435 2009-06-22 Ian Lance Taylor <iant@google.com>
14436
14437 PR 10141
14438 * options.h (class General_options): Add -z lazy and -z now. Sort
14439 -z options into alphabetical order.
14440 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14441
14442 2009-06-21 Ian Lance Taylor <iant@google.com>
14443
14444 * layout.cc (Layout::make_output_section): Call
14445 Target::new_output_section.
14446 (Layout::attach_allocated_section_to_segment): Put large section
14447 sections in a separate load segment with the large segment flag
14448 set.
14449 (Layout::segment_precedes): Sort large data segments after other
14450 load segments.
14451 (align_file_offset): New static function.
14452 (Layout::set_segment_offsets): Use align_file_offset.
14453 * output.h (class Output_section): Add is_small_section_ and
14454 is_large_section_ fields.
14455 (Output_section::is_small_section): New function.
14456 (Output_section::set_is_small_section): New function.
14457 (Output_section::is_large_section): New function.
14458 (Output_section::set_is_large_section): New function.
14459 (Output_section::is_large_data_section): New function.
14460 (class Output_segment): Add is_large_data_segment_ field.
14461 (Output_segment::is_large_data_segment): New function.
14462 (Output_segment::set_is_large_data_segment): New function.
14463 * output.cc (Output_section::Output_section): Initialize new
14464 fields.
14465 (Output_segment::Output_segment): Likewise.
14466 (Output_segment::add_output_section): Add assertion that large
14467 data sections always go in large data segments. Force small data
14468 sections to the end of the list of data sections. Force small BSS
14469 sections to the start of the list of BSS sections. For large BSS
14470 sections to the end of the list of BSS sections.
14471 * symtab.h (class Symbol): Declare is_common_shndx.
14472 (Symbol::is_defined): Check Symbol::is_common_shndx.
14473 (Symbol::is_common): Likewise.
14474 (class Symbol_table): Define enum Commons_section_type. Update
14475 declarations. Add small_commons_ and large_commons_ fields.
14476 * symtab.cc (Symbol::is_common_shndx): New function.
14477 (Symbol_table::Symbol_table): Initialize new fields.
14478 (Symbol_table::add_from_object): Put small and large common
14479 symbols in the right list.
14480 (Symbol_table::sized_finalized_symbol): Check
14481 Symbol::is_common_shndx.
14482 (Symbol_table::sized_write_globals): Likewise.
14483 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14484 common symbol lists. Don't call do_allocate_commons_list if the
14485 list is empty.
14486 (Symbol_table::do_allocate_commons_list): Remove is_tls
14487 parameter. Add comons_section_type parameter. Change all
14488 callers. Handle small and large common symbols.
14489 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14490 Symbol::is_common_shndx.
14491 * resolve.cc (symbol_to_bits): Likewise.
14492 * target.h (Target::small_common_shndx): New function.
14493 (Target::small_common_section_flags): New function.
14494 (Target::large_common_shndx): New function.
14495 (Target::large_common_section_flags): New function.
14496 (Target::new_output_section): New function.
14497 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14498 small_common_section_flags, and large_common_section_flags
14499 fields.
14500 (Target::do_new_output_section): New virtual function.
14501 * arm.cc (Target_arm::arm_info): Initialize new fields.
14502 * i386.cc (Target_i386::i386_info): Likewise.
14503 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14504 Likewise.
14505 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14506 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14507 (Target_x86_64::do_new_output_section): New function.
14508 * configure.ac: Define conditional MCMODEL_MEDIUM.
14509 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14510 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14511 (large_LDFLAGS): Define.
14512 * testsuite/large.c: New file.
14513 * testsuite/testfile.cc (Target_test::test_target_info):
14514 Initialize new fields.
14515 * configure, testsuite/Makefile.in: Rebuild.
14516
14517 2009-06-05 Doug Kwan <dougkwan@google.com>
14518
14519 * Makefile.am (CCFILES): Add target.cc.
14520 * Makefile.in: Regenerate.
14521 * i386.cc (class Target_i386): Define new virtual method to
14522 override do_is_local_label_name in parent.
14523 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14524 local symbols if --discard-locals or -X is given.
14525 * options.h (class General_options): Declare new options
14526 '--discard-locals' and '-X' for discarding locals.
14527 * target.h (class Target): Define new methods is_local_label_name.
14528 Declare new virtual method do_is_local_label_name.
14529 * target.cc: New file.
14530 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14531 (check_SCRIPTS): Add discard_locals_test.sh.
14532 (check_DATA): Add discard_local_tests.syms.
14533 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14534 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14535 * testsuite/Makefile.in: Regenerate.
14536 * testsuite/discard_locals_test.c: New file.
14537 * testsuite/discard_locals_test.sh: Same.
14538
14539 2009-06-05 Doug Kwan <dougkwan@google.com>
14540
14541 * object.cc (Sized_relobj::Sized_relobj): Initialize
14542 discarded_eh_frame_shndx_ to -1U.
14543 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14544 section.
14545 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14546 a discarded .eh_frame section.
14547 (Sized_relobj::do_finalize_local_symbols): Ditto.
14548 * object.h (class Sized_relobj): Declare new member
14549 discarded_eh_frame_shndx_.
14550 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14551 (local_labels_test.o, local_labels_test): New rules.
14552 * testsuite/Makefile.in: Regenerate.
14553
14554 2009-06-04 Doug Kwan <dougkwan@google.com>
14555
14556 * layout.cc (Layout::section_name_mapping): Add mapping for
14557 special ARM sections.
14558
14559 2009-06-03 Doug Kwan <dougkwan@google.com>
14560
14561 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14562 (utils::has_overflow): Same.
14563
14564 2009-06-03 Ian Lance Taylor <iant@google.com>
14565
14566 * layout.cc (Layout::section_name_mapping): New array, replacing
14567 Layout::linkonce_mapping.
14568 (Layout::section_name_mapping_count): New variable, replacing
14569 Layout::linkonce_mapping_count.
14570 (Layout::linkonce_output_name): Remove.
14571 (Layout::output_section_name): Rewrite.
14572 * layout.h (class Layout): Rename Linkonce_mapping to
14573 Section_name_mapping, linkonce_mapping to section_name_mapping,
14574 linkonce_mapping_count to section_name_mapping_count. Don't
14575 declare linkonce_output_name.
14576
14577 2009-06-03 Doug Kwan <dougkwan@google.com>
14578
14579 * gold/arm.cc (namespace utils): New.
14580 (Target_arm::reloc_is_non_pic): Define new method.
14581 (class Arm_relocate_functions): New.
14582 (Target_arm::Relocate::relocate): Handle relocation types used by
14583 Android.
14584
14585 2009-06-03 Ian Lance Taylor <iant@google.com>
14586
14587 * arm.cc (Target_arm::scan::global): Use || instead of |.
14588
14589 2009-06-02 Doug Kwan <dougkwan@google.com>
14590
14591 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14592 issued_non_pic_error_.
14593 (class Target_arm::Scan): Declare new method check_non_pic.
14594 Define new method symbol_needs_plt_entry.
14595 Declare new data member issued_non_pic_error_.
14596 (class Target_arm::Relocate): Declare new method
14597 should_apply_static_reloc.
14598 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14599 (Target_arm::Scan::check_non_pic): Define new method.
14600 (Target_arm::Scan::local): Handle a small subset of reloc types used
14601 by Android.
14602 (Target_arm::Scan::local): Same.
14603 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14604
14605 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14606
14607 * incremental.cc (Incremental_inputs::report_command_line): Filter
14608 out --incremental-* options.
14609
14610 2009-05-29 Doug Kwan <dougkwan@google.com>
14611
14612 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14613 template class.
14614 (class Target_arm): Update comment.
14615 (Target_arm::Target_arm): Initialize new data members GOT_,
14616 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14617 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14618 and Target_arm::rel_dyn_section.
14619 Declare new_enum Target_arm::Got_type.
14620 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14621 and DYNBSS_.
14622 Update commments for member do_dynsym_value.
14623 (Target_arm::got_size, Target_arm::plt_section,
14624 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14625 new methods inside class defintion.
14626 (Target_arm::got_section): Define new method.
14627 (Target_arm::rel_dyn_section): Same.
14628 (Output_data_plt_arm): New template class.
14629 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14630 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14631 (Output_data_plt_arm::add_entry): Same.
14632 (Output_data_plt_arm::first_plt_entry): Define new
14633 static data member for PLT instruction template.
14634 (Output_data_plt_arm::plt_entry): Same.
14635 (Output_data_plt_arm::do_write): Define new method.
14636 (Target_arm::make_plt_entry): Same.
14637 (Target_arm::do_finalize_sections): Same.
14638 (Target_arm::do_dynsym_value): Same.
14639
14640 2009-05-28 Doug Kwan <dougkwan@google.com>
14641
14642 * Makefile.am (TARGETSOURCES): Add arm.cc.
14643 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14644 * Makefile.in: Regenerate.
14645 * arm.cc: New file.
14646 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14647
14648 2009-05-26 Doug Kwan <dougkwan@google.com>
14649
14650 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14651 (General_options::check_excluded_libs): Strip off directories in
14652 archive name before matching like GNU ld does.
14653 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14654 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14655 (exclude_libs_test_LDFLAGS): Add linker option
14656 -Wl,--exclude-libs,libexclude_libs_test_3
14657 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14658 an explicit archive without using -l.
14659 (alt/libexclude_libs_test_3.a): New make rule.
14660 * testsuite/Makefile.in: Regenerate.
14661 * testsuite/exclude_libs_test.c : Declare lib3_default().
14662 (main): Call it.
14663 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14664 * exclude_libs_test_3.c: New file.
14665
14666 2009-05-26 Nick Clifton <nickc@redhat.com>
14667
14668 * po/id.po: New Indonesian translation.
14669 * po/gold.pot: Updated template file.
14670
14671 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14672
14673 * testsuite/Makefile.am: Add -ffunction-sections to compile
14674 gc_comdat_test files. Add -Wl,--gc-sections to build
14675 gc_comdat_test.
14676 * testsuite/Makefile.in: Regenerate.
14677 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14678
14679 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14680
14681 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14682 kept comdat section was garbage collected.
14683 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14684 * testsuite/Makefile.in: Regenerate.
14685 * testsuite/gc_comdat_test.sh: New file.
14686 * testsuite/gc_comdat_test_1.cc: New file.
14687 * testsuite/gc_comdat_test_2.cc: New file.
14688
14689 2009-05-19 Doug Kwan <dougkwan@google.com>
14690
14691 * archive.cc (Archive::Archive): Move constructor from archive.h
14692 to here. Initialize no_export_.
14693 (Archive::get_elf_object_for_member): Set no_export flag of object.
14694 * archive.h (Archive::Archive): Move constructor body to
14695 archive.cc.
14696 (Archive::no_export): New method.
14697 (Archive::no_export_): New field.
14698 * object.h (Object::Object): Initialize no_export_ to false.
14699 (Object::no_export, Object::set_no_export): New methods.
14700 (Object::no_export_): New field.
14701 * options.cc (General_options::parse_exclude_libs): New method.
14702 (General_options::check_excluded_libs) Same.
14703 * options.h (exclude_libs): New option.
14704 (General_options::check_excluded_libs): New method declaration.
14705 (General_options::excluded_libs_): New field.
14706 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14707 default or protected visibility if an object has no-export flag set.
14708 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14709 (check_SCRIPTS): Add exclude_libs_test.sh.
14710 (check_DATA): Add exclude_libs_test.syms.
14711 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14712 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14713 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14714 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14715 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14716 libexclude_libs_test_2.a): New rules.
14717 * testsuite/Makefile.in: Regenerate.
14718 * testsuite/exclude_libs_test.c: New file.
14719 * testsuite/exclude_libs_test.sh: Ditto.
14720 * testsuite/exclude_libs_test_1.c: Ditto.
14721 * testsuite/exclude_libs_test_2.c: Ditto.
14722
14723 2009-05-15 Ian Lance Taylor <iant@google.com>
14724
14725 * configure.ac: Check for declarations for cases where libiberty.h
14726 checks HAVE_DECL_xxx.
14727 * configure, config.in: Rebuild.
14728
14729 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14730
14731 * gold.h (Incremental_argument_list): Remove (invalid) forward
14732 declaration.
14733 * incremental.cc (Incremental_inputs::report_achive): New method.
14734 (Incremental_inputs::report_object): New method.
14735 (Incremental_inputs::report_script): New method.
14736 (Incremental_inputs::finalize_inputs): New method.
14737 (Incremental_inputs::finalize): Call finalize_inputs().
14738 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14739 Create inputs entries.
14740 * incremental.h (Incremental_input_type): New enum.
14741 (Incremental_inputs::Incremental_input): Initialize new fields.
14742 (Incremental_inputs::report_inputs): New method.
14743 (Incremental_inputs::report_achive): New method.
14744 (Incremental_inputs::report_object): New method.
14745 (Incremental_inputs::report_script): New method.
14746 (Incremental_inputs::finalize_inputs): New method.
14747 (Incremental_inputs::Input_info): New struct.
14748 (Incremental_inputs::Input_info_map): New typedef.
14749 (Incremental_inputs::lock_): New field.
14750 (Incremental_inputs::Inputs_): New field.
14751 (Incremental_inputs::Inputs_map): New field.
14752 * main.cc (main): Call Incremental_input::report_inputs.
14753 * options.h (Input_argument_list): Typedef moved from
14754 Input_arguments.
14755 (Input_file_group::Files): Remove, use ::Input_argument_list.
14756 (Input_file_group::Input_argument_list): Remove, use
14757 ::Input_argument_list.
14758 * plugin.cc (Plugin_manager::add_input_file): Add error in
14759 incremental build.
14760 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14761 functions.
14762 * script.cc (read_input_script): Call
14763 Incremental_input::report_script.
14764 * script.h (Script_info): New class.
14765
14766 2009-04-27 Ian Lance Taylor <iant@google.com>
14767
14768 * x86_64.cc (do_adjust_output_section): Set entsize to
14769 plt_entry_size.
14770
14771 2009-04-23 Elliott Hughes <enh@google.com>
14772
14773 * output.cc (Output_file::close): After short writes, continue
14774 writing from the correct offset in the buffer being written.
14775
14776 2009-04-23 Chris Demetriou <cgd@google.com>
14777
14778 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14779 * configure: Regenerate.
14780 * config.in: Regenerate.
14781 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14782 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14783
14784 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14785
14786 * incremental.cc (Incremental_inputs_header_data): Renamed from
14787 Incremental_input_header_data.
14788 (Incremental_inputs_header_data::data_size): New field.
14789 (Incremental_inputs_header_data::put_input_file_count): Renamed
14790 from input_file_count.
14791 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14792 from command_line_offset.
14793 (Incremental_inputs_header_data::put_reserved): Renamed from
14794 put_reserved.
14795 (Incremental_inputs_entry_data): Renamed from
14796 Incremental_input_entry_data.
14797 (Incremental_inputs_entry_data::data_size): New field.
14798 (Incremental_inputs::report_command_line): New method.
14799 (Incremental_inputs::finalize): New method.
14800 (Incremental_inputs::create_incremental_inputs_data): New method.
14801 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14802 * incremental.h: New file.
14803 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14804 (Layout::finalize): Create incremental inputs section in
14805 incremental builds.
14806 (Layout::create_incremental_info_sections): New method.
14807 * layout.h (Layout::incremental_inputs): New method.
14808 (Layout::create_incremental_info_sections): New method.
14809 (Layout::incremental_inputs_): New field.
14810 * main.cc (main): Notify Incremental_input of the command line.
14811
14812 2009-04-01 Ian Lance Taylor <iant@google.com>
14813 Mikolaj Zalewski <mikolajz@google.com>
14814
14815 * gold.h (reserve_unordered_map): Define, three versions, one for
14816 each version of Unordered_map.
14817 * layout.cc (Layout::Layout): Remove options parameter. Add
14818 number_of_input_files parameter. Don't initialize options_.
14819 Initialize number_of_input_files_ and resized_signatures_. Move
14820 sections_are_attached_.
14821 (Layout::layout_group): Reserve space for group_signatures_.
14822 (Layout::find_or_add_kept_section): Change name parameter to be a
14823 reference. Resize signatures_ map when it gets large enough.
14824 (Layout::layout_eh_frame): Use parameters->options() instead of
14825 this->options_.
14826 (Layout::make_output_section): Likewise.
14827 (Layout::attach_allocated_section_to_segment): Likewise.
14828 (Layout::finalize, Layout::create_executable_stack): Likewise.
14829 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14830 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14831 * layout.h (class Layout): Update declarations. Remove options_
14832 field. Add number_of_input_files_ and resized_signatures_
14833 fields. Move sections_are_attached_ field.
14834 * main.cc (main): Pass number of input files to Layout
14835 constructor. Don't pass options.
14836
14837 2009-03-30 Ian Lance Taylor <iant@google.com>
14838
14839 * ffsll.c (ffsll): Correct implementation.
14840
14841 2009-03-27 Ian Lance Taylor <iant@google.com>
14842
14843 * ffsll.c: New file.
14844 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14845 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14846 * ftruncate.c (ftruncate): Declare before definition.
14847 * mremap.c (mremap): Likewise.
14848 * pread.c (pread): Likewise.
14849 * configure, Makefile.in, config.in: Rebuild.
14850
14851 * mremap.c: New file.
14852 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14853 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14854 (mremap): Declare if HAVE_MREMAP is not defined.
14855 * configure, Makefile.in, config.in: Rebuild.
14856
14857 2009-03-27 Cary Coutant <ccoutant@google.com>
14858
14859 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14860 position independent.
14861 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14862 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14863
14864 2009-03-24 Cary Coutant <ccoutant@google.com>
14865
14866 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14867 an executable.
14868 (needs_dynamic_reloc): Likewise.
14869
14870 2009-03-24 Ian Lance Taylor <iant@google.com>
14871
14872 * yyscript.y (file_cmd): Recognize EXTERN.
14873 (extern_name_list, extern_name_list_body): New nonterminals.
14874 * script.cc (script_add_extern): Define.
14875 * script-c.h (script_add_extern): Declare.
14876
14877 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14878
14879 * object.cc (is_elf_object): Define.
14880 * object.h (is_elf_object): Declare.
14881 * archive.cc (Archive::get_elf_object_for_member): Call
14882 is_elf_object.
14883 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14884
14885 2009-03-24 Elliott Hughes <enh@google.com>
14886
14887 * output.cc (Output_file::map_anonymous): Define.
14888 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14889 try an anonymous one. Report the size if the mmap fails.
14890 * output.h (class Output_file): Declare map_anonymous.
14891
14892 2009-03-24 Ian Lance Taylor <iant@google.com>
14893
14894 * target-select.cc (instantiate_target): Don't acquire the lock if
14895 the instantiated_target_ field has already been set.
14896
14897 2009-03-23 Ian Lance Taylor <iant@google.com>
14898
14899 * gold-threads.h (class Initialize_lock): Define.
14900 * gold-threads.cc (class Initialize_lock_once): Define.
14901 (initialize_lock_control): New static variable.
14902 (initialize_lock_pointer): New static variable.
14903 (initialize_lock_once): New static function.
14904 (Initialize_lock::Initialize_lock): Define.
14905 (Initialize_lock::initialize): Define.
14906 * target-select.h: Include "gold-threads.h".
14907 (class Target_selector): Add lock_ and initialize_lock_ fields.
14908 Don't define instantiate_target, just declare it.
14909 * target-select.cc (Target_selector::Target_selector): Initialize
14910 new fields.
14911 (Target_selector::instantiate_target): Define.
14912 * descriptors.h: Include "gold-threads.h".
14913 (class Descriptors): Add initialize_lock_ field.
14914 * descriptors.cc (Descriptors::Descriptors): Initialize new
14915 field.
14916 (Descriptors::open): Use initialize_lock_ field
14917 * errors.h (class Errors): Add initialize_lock_ field.
14918 * errors.cc (Errors::Errors): Initialize new field.
14919 (Errors::initialize_lock): Use initialize_lock_ field.
14920 * powerpc.cc (class Target_selector_powerpc): Remove
14921 instantiated_target_ field. In do_recognize call
14922 instantiate_target rather than do_instantiate_target. In
14923 do_instantiate_target just allocate a new target.
14924 * sparc.cc (class Target_selector_sparc): Likewise.
14925
14926 * freebsd.h: New file.
14927 * i386.cc: Include "freebsd.h".
14928 (Target_i386): Derive from Target_freebsd rather than
14929 Sized_target.
14930 (Target_selector_i386): Derive from Target_selector_freebsd rather
14931 than Target_selector.
14932 * x86_64.cc: Include "freebsd.h".
14933 (Target_x86_64): Derive from Target_freebsd rather than
14934 Sized_target.
14935 (Target_selector_x86_64): Derive from Target_selector_freebsd
14936 rather than Target_selector.
14937 * target.h (class Target): Add adjust_elf_header and
14938 do_adjust_elf_header.
14939 * output.cc (Output_file_header:: do_sized_write): Call target
14940 adjust_elf_header routine.
14941 * configure.tgt: Set targ_osabi.
14942 * configure.ac: Define GOLD_DEFAULT_OSABI.
14943 * parameters.cc (Parameters::default_target): Pass
14944 GOLD_DEFAULT_OSABI to select_target.
14945 * target-select.h (class Target_selector): Make instantiate_target
14946 protected rather than private.
14947 * Makefile.am (HFILES): Add freebsd.h.
14948 * configure, Makefile.in, config.in: Rebuild.
14949
14950 * merge.cc (do_add_input_section): Correct pend value. Change
14951 message about last entry not being null terminated from error to
14952 warning.
14953
14954 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14955
14956 * incremental.cc: New file.
14957 * Makefile.am (CCFILES): Add incremental.cc.
14958 * Makefile.in: Rebuild.
14959
14960 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14961
14962 * layout.cc (Layout::output_section_name): Preserve names
14963 of '.note.' sections.
14964
14965 2009-03-19 Ian Lance Taylor <iant@google.com>
14966
14967 * descriptors.cc (Descriptors::open): Check that the options are
14968 valid before using them.
14969
14970 2009-03-18 Ian Lance Taylor <iant@google.com>
14971
14972 * script-sections.h: Include <list>.
14973 (class Script_sections): Change Sections_elements from std::vector
14974 to std::list. Typedef public Elements_iterator. Add
14975 orphan_section_placement_, data_segment_align_start_, and
14976 saw_data_segment_align_ fields. Remove data_segment_align_index_
14977 field.
14978 * script-sections.cc (class Orphan_section_placement): New class.
14979 (class Sections_element): Add virtual functions is_relro and
14980 orphan_section_init. Remove virtual function place_orphan_here.
14981 (class Output_section_definition): Add is_relro and
14982 orphan_section_init. Remove place_orphan_here.
14983 (class Orphan_output_section): Likewise.
14984 (Script_sections::Script_sections): Update for field changes.
14985 (Script_sections::data_segment_align): Set saw_data_segment_align_
14986 and data_segment_align_start_, not data_segment_align_index.
14987 (Script_sections::data_segment_relro_end): Check
14988 saw_data_segment_align_. Use data_segment_align_start_ rather
14989 than data_segment_align_index_.
14990 (Script_sections::place_orphan): Rewrite to use
14991 Orphan_section_placement.
14992
14993 2009-03-17 Ian Lance Taylor <iant@google.com>
14994
14995 * archive.cc (Archive::add_symbols): Check for a version attached
14996 to the symbol name in the archive map.
14997 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14998 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14999 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15000 (ver_test_11.a): New target.
15001 * testsuite/Makefile.in: Rebuild.
15002
15003 * configure.ac: Check for chsize and posix_fallocate. Replace
15004 ftruncate.
15005 * ftruncate.c: New file, from gnulib.
15006 * output.cc (posix_fallocate): Define dummy version if not
15007 HAVE_POSIX_FALLOCATE.
15008 (Output_file::map): Call posix_fallocate rather than lseek and
15009 write.
15010 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15011 * configure, Makefile.in, config.in: Rebuild.
15012
15013 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
15014
15015 * layout.h (Layout::create_note): Add section_name parameter.
15016 * layout.cc (Layout::create_note): Likewise.
15017 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
15018
15019 2009-03-17 Ian Lance Taylor <iant@google.com>
15020
15021 * descriptors.cc: Include "options.h".
15022 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15023 (Descriptors::open): Always use O_CLOEXEC when opening a new
15024 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15025 then set FD_CLOEXEC.
15026
15027 * sparc.cc (class Target_sparc): Add has_got_section.
15028 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15029 make sure we have a GOT section.
15030
15031 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15032 (Target_sparc::Scan::local): Likewise.
15033 (Target_sparc::Scan::global): Likewise.
15034 (Target_sparc::Relocate::relocate): Likewise.
15035 (Target_sparc::Relocate::relocate_tls): Likewise.
15036
15037 * symtab.cc (Symbol_table::define_default_version): New function,
15038 broken out of add_from_object.
15039 (Symbol_table::add_from_object): Call define_default_version.
15040 (Symbol_table::define_special_symbol): Add resolve_oldsym
15041 parameter. Change all callers. If the version for a symbol comes
15042 from a version script, resolve it with the symbol with the same
15043 name with no version. Also add the symbol without a version if
15044 appropriate.
15045 (do_define_in_output_data): If resolving with oldsym, don't delete
15046 sym.
15047 (do_define_in_output_segment): Likewise.
15048 (do_define_as_constant): Likewise.
15049 * symtab.h (class Symbol_table): Update declarations.
15050
15051 2009-03-13 Ian Lance Taylor <iant@google.com>
15052
15053 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15054 (Read_symbols::requeue): New function.
15055 (Read_symbols::do_read_symbols): If make_elf_object fails because
15056 the target type is not configured, and the file was searched for,
15057 issue a warning and retry with the next directory.
15058 (Add_symbols::run): If the file has an incompatible format, and
15059 it was searched for, requeue the Read_symbols task. On error,
15060 release the object.
15061 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15062 dirindex parameter to constructor. Change all callers. Declare
15063 incompatible_warning and requeue.
15064 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15065 input_argument_ and input_group_ fields. Add them to
15066 constructor. Change all callers.
15067 (class Read_script): Add dirindex_ field. Add it to constructor.
15068 Change all callers.
15069 * archive.cc (Archive::setup): Remove input_objects parameter.
15070 Change all callers.
15071 (Archive::get_file_and_offset): Likewise.
15072 (Archive::read_all_symbols): Likewise.
15073 (Archive::read_symbols): Likewise.
15074 (Archive::get_elf_object_for_member): Remove input_objects
15075 parameter. Add punconfigured parameter. Change all callers.
15076 (Archive::add_symbols): Change return type to bool. Check return
15077 value of include_member.
15078 (Archive::include_all_members): Likewise.
15079 (Archive::include_member): Change return type to bool. Return
15080 false if first included object has incompatible target. Set
15081 included_member_ field.
15082 (Add_archive_symbols::run): If add_symbols returns false, requeue
15083 Read_symbols task.
15084 * archive.h (class Archive): Add included_member_ field.
15085 Initialize it in constructor. Add input_file and searched_for
15086 methods. Update declarations.
15087 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15088 input_argument_ fields. Add them to constructor. Change all
15089 callers.
15090 * script.cc: Include "target-select.h".
15091 (class Parser_closure): Add skip_on_incompatible_target_ and
15092 found_incompatible_target_ fields. Add
15093 skip_on_incompatible_target parameter to constructor. Change all
15094 callers. Add methods skip_on_incompatible_target,
15095 clear_skip_on_incompatible_target, found_incompatible_target, and
15096 set_found_incompatible_target.
15097 (read_input_script): Add dirindex parameter. Change all callers.
15098 If parser finds an incompatible target, requeue Read_symbols
15099 task.
15100 (script_set_symbol): Clear skip_on_incompatible_target in
15101 closure.
15102 (script_add_assertion, script_parse_option): Likewise.
15103 (script_start_sections, script_add_phdr): Likewise.
15104 (script_check_output_format): New function.
15105 * script.h (read_input_script): Update declaration.
15106 * script-c.h (script_check_output_format): Declare.
15107 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15108 (ignore_cmd): Remove OUTPUT_FORMAT.
15109 * fileread.cc (Input_file::Input_file): Add explicit this.
15110 (Input_file::will_search_for): New function.
15111 (Input_file::open): Add pindex parameter. Change all callers.
15112 * fileread.h (class Input_file): Add input_file_argument method.
15113 Declare will_search_for. Update declarations.
15114 * object.cc (make_elf_object): Add punconfigured parameter.
15115 Change all callers.
15116 * object.h (class Object): Make input_file public. Add
15117 searched_for method.
15118 (make_elf_object): Update declaration.
15119 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15120 restart search.
15121 * dirsearch.h (class Dirsearch): Update declaration.
15122 * options.h (class General_options): Add --warn-search-mismatch.
15123 * parameters.cc (Parameters::is_compatible_target): New function.
15124 * parameters.h (class Parameters): Declare is_compatible_target.
15125 * workqueue.cc (Workqueue::add_blocker): New function.
15126 * workqueue.h (class Workqueue): Declare add_blocker.
15127
15128 * fileread.cc (Input_file::open): Remove options parameter.
15129 Change all callers.
15130 (Input_file::open_binary): Likewise.
15131 * script.cc (read_input_script): Likewise.
15132 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15133 options parameter from constructor. Change all callers.
15134 (class Read_script): Likewise.
15135 * fileread.h (class Input_file): Update declarations.
15136 * script.h (read_input_script): Update declaration.
15137
15138 2009-03-10 Nick Clifton <nickc@redhat.com>
15139
15140 * po/es.po: New Spanish translation.
15141
15142 2009-03-06 Cary Coutant <ccoutant@google.com>
15143
15144 * options.cc (parse_short_option): Keep dash_z from registering itself.
15145
15146 2009-03-03 Ian Lance Taylor <iant@google.com>
15147
15148 PR 9918
15149 * target-reloc.h (relocate_section): Pass output_section to
15150 relocate.
15151 * i386.cc (Target_i386::should_apply_static_reloc): Add
15152 output_section parameter. Change all callers.
15153 (Target_i386::Relocate::relocate): Add output_section parameter.
15154 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15155 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15156 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15157 * testsuite/two_file_shared.sh: New script.
15158 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15159 (check_DATA): Add two_file_shared.dbg.
15160 (two_file_shared.dbg): New target.
15161 * testsuite/Makefile.in: Rebuild.
15162
15163 2009-03-01 Ian Lance Taylor <iant@google.com>
15164
15165 * configure.ac: Check for byteswap.h.
15166 * configure: Rebuild.
15167 * config.in: Rebuild.
15168
15169 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15170
15171 * layout.cc (Layout::find_or_add_kept_section): New function.
15172 (Layout::add_comdat): Removed.
15173 * layout.h (struct Kept_section): Move out of class Layout.
15174 Remove trailing underscores from field names. Add group_sections
15175 field. Rename group_ field to is_group. Change all uses.
15176 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15177 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15178 comdat_groups_ field.
15179 (Sized_relobj::include_section_group): Use
15180 find_or_add_kept_section and Kept_section::group_sections.
15181 (Sized_relobj::include_linkonce_section): Likewise.
15182 * object.cc (class Sized_relobj): Don't define Comdat_group or
15183 Comdat_group_table. Remove find_comdat_group and
15184 add_comdat_group. Remove comdat_groups_ field.
15185 * plugin.cc (include_comdat_group): Use
15186 Layout::find_or_add_kept_section.
15187
15188 2009-02-28 Ian Lance Taylor <iant@google.com>
15189
15190 * README: --gc-sections and map files are now supported. Document
15191 some build requirements.
15192
15193 PR 6992
15194 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15195 relocatable link set the value of the section symbol to zero.
15196 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15197 relocatable link don't include the section address in the local
15198 symbol value.
15199
15200 2009-02-27 Ian Lance Taylor <iant@google.com>
15201
15202 PR 6811
15203 * options.h (class Search_directory): Add is_system_directory.
15204 (class General_options): Declare is_in_system_directory.
15205 * options.cc (get_relative_sysroot): Make static.
15206 (get_default_sysroot): Make static.
15207 (General_optoins::is_in_system_directory): New function.
15208 * fileread.cc (Input_file::is_in_system_directory): New function.
15209 * fileread.h (class Input_file): Declare is_in_system_directory.
15210 * object.h (class Object): Add is_in_system_directory.
15211 (class Input_objects): Remove system_library_directory_ field.
15212 * object.cc (Input_objects::add_object): Don't set
15213 system_library_directory_.
15214 (input_objects::found_in_system_library_directory): Remove.
15215 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15216 parameter. Change all callers.
15217 (Symbol_table::sized_write_globals): Likewise.
15218 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15219 Call Object::is_in_system_directory.
15220 * symtab.h (class Symbol_table): Update declarations.
15221
15222 PR 5990
15223 * descriptors.h (Open_descriptor): Add is_on_stack field.
15224 * descriptors.cc (Descriptors::open): If the descriptor is on the
15225 top of the stack, remove it. Initialize is_on_stack field.
15226 (Descriptors::release): Only add pod to stack if it is not on the
15227 stack already.
15228 (Descriptors::close_some_descriptor): Clear stack_next and
15229 is_on_stack fields.
15230
15231 PR 7091
15232 * output.cc (Output_section::find_starting_output_address): Rename
15233 from starting_output_address; add PADDR parameter; change return
15234 type.
15235 * output.h (class Output_section): Declare
15236 find_starting_output_address instead of starting_output_address.
15237 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15238 section symbol for which we can't find a merge section.
15239
15240 PR 9836
15241 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15242 hidden or internal, force the symbol to be local.
15243 * resolve.cc (Symbol::override_visibility): Define.
15244 (Symbol::override_base): Use override_visibility.
15245 (Symbol_table::resolve): Likewise.
15246 (Symbol::override_base_with_special): Likewise.
15247 (Symbol_table::override_with_special): If the visibility is hidden
15248 or internal, force the symbol to be local.
15249 * symtab.h (class Symbol): Add set_visibility and
15250 override_visibility.
15251 * testsuite/ver_test_1.sh: New file.
15252 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15253 (check_DATA): Add ver_test_1.syms.
15254 (ver_test_1.syms): New target.
15255 * testsuite/Makefile.in: Rebuild.
15256
15257 2009-02-25 Cary Coutant <ccoutant@google.com>
15258
15259 * layout.cc (Layout::choose_output_section): Don't rename sections
15260 when using a linker script that has a SECTIONS clause.
15261 * Makefile.in: Regenerate.
15262
15263 * testsuite/Makefile.am (script_test_5.sh): New test case.
15264 * testsuite/Makefile.in: Regenerate.
15265 * testsuite/script_test_5.cc: New file.
15266 * testsuite/script_test_5.sh: New file.
15267 * testsuite/script_test_5.t: New file.
15268
15269 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15270
15271 * archive.cc (Archive::include_member): Update calls to add_symbols.
15272 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15273 the Layout argument.
15274 * dynobj.h (do_add_symbols): Add the Layout argument.
15275 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15276 Layout argument.
15277 * object.h (Object::add_symbols): Add the Layout argument.
15278 (Object::do_add_symbols): Add the Layout argument.
15279 (Sized_relobj::do_add_symbols): Add the Layout argument.
15280 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15281 Unify the two versions.
15282 (Add_plugin_symbols): Remove.
15283 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15284 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15285 (Add_plugin_symbols): Remove.
15286 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15287 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15288 (Add_symbols::run): Make it work with Pulginobj.
15289
15290 2009-02-06 Ian Lance Taylor <iant@google.com>
15291
15292 * object.cc (Sized_relobj::do_layout): Make info message start
15293 with lower case letter.
15294
15295 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15296
15297 * binary.cc: Fix file comment.
15298
15299 * options.h (enum Incremental_disposition): Define.
15300 (class General_options): Add new options: --incremental,
15301 --incremental_changed, --incremental_unchanged,
15302 --incremental_unknown. Add incremental_disposition_ and
15303 implicit_incremental_ fields.
15304 (General_options::incremental_disposition): New function.
15305 (class Position_dependent_options): Add incremental_disposition
15306 option.
15307 (Position_dependent_options::copy_from_options): Set incremental
15308 dispositions.
15309 * options.cc (General_options::parse_incremental_changed): New
15310 function.
15311 (General_options::parse_incremental_unchanged): New function.
15312 (General_options::parse_incremental_unknown): New function.
15313 (General_options::General_options): Initialize new fields
15314 incremental_disposition_ and implicit_incremental_.
15315 (General_options::finalize): Check for uasge of --incremental-*
15316 without --incremental.
15317
15318 2009-02-06 Chris Demetriou <cgd@google.com>
15319
15320 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15321 pointer and to report location as the file name associated with
15322 the symbol.
15323 (gold_undefined_symbol_at_location): New function to replace the
15324 old gold_undefined_symbol functionality.
15325 * target-reloc.h (relocate_section): Update to use
15326 gold_undefined_symbol_at_location.
15327 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15328 Call gold_undefined_symbol function rather than gold_error.
15329 * errors.h (Errors::undefined_symbol): Take location as a
15330 string, rather than calculating it from a relocation.
15331 * errors.cc (Errors::fatal): Print "fatal error:" before the
15332 formatted message.
15333 (Errors::error, Errors::error_at_location): Print "error: "
15334 before the formatted message.
15335 (Errors::undefined_symbol): Take location as a string, rather
15336 than calculating it from a relocation.
15337 (gold_undefined_symbol_at_location): New function akin to
15338 old gold_undefined_symbol, calculates location from relocation.
15339 (gold_undefined_symbol): Change to take only a Symbol pointer
15340 and to report location as the file name associated with the symbol.
15341 * testsuite/debug_msg.sh: Update for changed error messages.
15342 * testsuite/undef_symbol.sh: Likewise.
15343
15344 2009-02-04 Duncan Sands <baldrick@free.fr>
15345
15346 PR 9812
15347 * reduced_debug_output.h
15348 (Output_reduced_debug_abbrev_section::failed): Use format for
15349 gold_warning.
15350 (Output_reduced_debug_info_section::faild): Likewise.
15351
15352 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15353
15354 * script.cc (Lazy_demangler): New class.
15355 (Version_script_info::get_symbol_version_helper): Demangle a
15356 symbol only once.
15357
15358 2009-01-29 Cary Coutant <ccoutant@google.com>
15359
15360 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15361 to __tls_get_addr.
15362 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15363
15364 2009-01-28 Ian Lance Taylor <iant@google.com>
15365
15366 * version.cc (version_string): Bump to 1.9.
15367
15368 * gold.h: Include <cstring> and <stdint.h>.
15369 * version.cc: Include <cstdio>.
15370 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15371 warning.
15372 * reduced_debug_output.cc (insert_into_vector): Rename from
15373 Insert_into_vector; change all callers. Use Swap_unaligned to
15374 avoid aliasing issue; remove union since it is unnecessary.
15375
15376 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15377
15378 * Makefile.am (CCFILES): Add gc.cc.
15379 (HFILES): Add gc.h.
15380 * Makefile.in: Regenerate.
15381 * gold.cc (Gc_runner): New class.
15382 (queue_initial_tasks): Call garbage collection related tasks
15383 when corresponding options are invoked.
15384 (queue_middle_gc_tasks): New function.
15385 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15386 processed early before laying out sections during garbage collection.
15387 * gold.h (queue_middle_gc_tasks): New function.
15388 (is_prefix_of): Move from "layout.cc".
15389 * i386.cc (Target_i386::gc_process_relocs): New function.
15390 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15391 * main.cc (main): Create object of class "Garbage_collection".
15392 * object.cc (Relobj::copy_symbols_data): New function.
15393 (Relobj::is_section_name_included): New function.
15394 (Sized_relobj::do_layout): Allow this function to be called twice
15395 during garbage collection and defer layout of section during the
15396 first call.
15397 * object.h (Relobj::get_symbols_data): New function.
15398 (Relobj::is_section_name_included): New function.
15399 (Relobj::copy_symbols_data): New function.
15400 (Relobj::set_symbols_data): New function.
15401 (Relobj::get_relocs_data): New function.
15402 (Relobj::set_relocs_data): New function.
15403 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15404 (Relobj::gc_process_relocs): New function.
15405 (Relobj::do_gc_process_relocs): New pure virtual function.
15406 (Relobj::sd_): New data member.
15407 (Sized_relobj::is_output_section_offset_invalid): New function.
15408 (Sized_relobj::do_gc_process_relocs): New function.
15409 * options.h (General_options::gc_sections): Modify to not be a no-op.
15410 (General_options::print_gc_sections): New option.
15411 * plugin.cc (Plugin_finish::run): Remove function call to
15412 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15413 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15414 * reloc.cc (Read_relocs::run): Add task to process relocs and
15415 determine unreferenced sections when doing garbage collection.
15416 (Gc_process_relocs): New class.
15417 (Sized_relobj::do_gc_process_relocs): New function.
15418 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15419 sections that are garbage collected.
15420 * reloc.h (Gc_process_relocs): New class.
15421 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15422 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15423 symbols whose corresponding sections are garbage collected.
15424 (Symbol_table::Symbol_table): Add new parameter for the garbage
15425 collection object.
15426 (Symbol_table::gc_mark_undef_symbols): New function.
15427 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15428 (Symbol_table::gc_mark_dyn_syms): New function.
15429 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15430 as garbage.
15431 (Symbol_table::add_from_object): Likewise.
15432 (Symbol_table::add_from_relobj): When building shared objects, do not
15433 treat externally visible symbols as garbage.
15434 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15435 table information for static and relocatable links.
15436 * symtab.h (Symbol_table::set_gc): New function.
15437 (Symbol_table::gc): New function.
15438 (Symbol_table::gc_mark_undef_symbols): New function.
15439 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15440 (Symbol_table::gc_mark_dyn_syms): New function.
15441 (Symbol_table::gc_): New data member.
15442 * target.h (Sized_target::gc_process_relocs): New pure virtual
15443 function.
15444 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15445 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15446
15447 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15448
15449 * options.h (General_options::gc_sections): Define as a no-op for now.
15450 (General_options::no_keep_memory): Ditto.
15451 (General_options::Bshareable): Define.
15452 * options.cc (General_options::finalize): Honor -Bshareable.
15453
15454 2009-01-20 Andreas Schwab <schwab@suse.de>
15455
15456 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15457 read the value in the contents, since we don't use it. Use the
15458 template endianness when writing.
15459 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15460
15461 2009-01-19 Andreas Schwab <schwab@suse.de>
15462
15463 * configure.tgt (powerpc64-*): Fix targ_obj.
15464
15465 2009-01-15 Ian Lance Taylor <iant@google.com>
15466
15467 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15468 local symbols when stripping all symbols.
15469
15470 2009-01-14 Cary Coutant <ccoutant@google.com>
15471
15472 * output.cc (Output_reloc): Add explicit instantiations.
15473
15474 2009-01-14 Cary Coutant <ccoutant@google.com>
15475
15476 * archive.cc (Archive::get_elf_object_for_member): Remove call
15477 to File_read::claim_for_plugin.
15478 * descriptors.cc (Descriptors::open): Remove reference to
15479 is_claimed.
15480 (Descriptors::claim_for_plugin): Remove.
15481 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15482 (Descriptors::is_claimed): Remove.
15483 (claim_descriptor_for_plugin): Remove.
15484 * fileread.cc (File_read::claim_for_plugin): Remove.
15485 * fileread.h (File_read::claim_for_plugin): Remove.
15486 (File_read::descriptor): Reopen descriptor if necessary.
15487 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15488 (Plugin_manager::all_symbols_read): Add task parameter. Change
15489 all callers.
15490 (Plugin_manager::get_input_file): New function.
15491 (Plugin_manager::release_input_file): New function.
15492 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15493 corresponding data member.
15494 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15495 and pass to base constructor. Change all callers.
15496 (get_input_file, release_input_file): New functions.
15497 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15498 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15499 (Plugin_manager::all_symbols_read): Add task parameter.
15500 (Plugin_manager::get_input_file): New function.
15501 (Plugin_manager::release_input_file): New function.
15502 (Plugin_manager::task_): New data member.
15503 (Pluginobj::Pluginobj): Add filesize parameter.
15504 (Pluginobj::filename): New function.
15505 (Pluginobj::descriptor): New function.
15506 (Pluginobj::filesize): New function.
15507 (Pluginobj::filesize_): New data member.
15508 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15509 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15510 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15511
15512 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15513 with archive libraries.
15514 * testsuite/Makefile.in: Regenerate.
15515 * testsuite/plugin_test.c (struct sym_info): New type.
15516 (get_input_file, release_input_file): New static variables.
15517 (onload): Capture new transfer vector entries.
15518 (claim_file_hook): Stop reading at end of file according to filesize.
15519 Factor out parsing of readelf output into separate function.
15520 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15521 APIs and get the source file name from the symbol table. Convert
15522 source file name to corresponding object file name. Print info
15523 message when adding new input files.
15524 (parse_readelf_line): New function.
15525 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15526 * testsuite/plugin_test_2.sh: Likewise.
15527 * testsuite/plugin_test_3.sh: Likewise.
15528 * testsuite/plugin_test_4.sh: New test case.
15529
15530 2009-01-07 Ian Lance Taylor <iant@google.com>
15531
15532 * version.cc (version_string): Bump to 1.8.
15533
15534 2008-12-23 Cary Coutant <ccoutant@google.com>
15535
15536 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15537 * plugin.cc (Plugin_manager::finish): Rename as
15538 layout_deferred_objects. Move cleanup to separate function.
15539 (Plugin_manager::cleanup): New function.
15540 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15541 separately.
15542 * plugin.h (Plugin_manager::finish): Rename as
15543 layout_deferred_objects.
15544 (Plugin_manager::cleanup): New function.
15545 (Plugin_manager::cleanup_done): New field.
15546
15547 2008-12-23 Cary Coutant <ccoutant@google.com>
15548
15549 * plugin.cc (is_visible_from_outside): New function.
15550 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15551 so we don't return "IR only" status for exported symbols or -r links.
15552
15553 * testsuite/Makefile.am (plugin_test_3): New test case.
15554 * testsuite/Makefile.in: Regenerate.
15555 * testsuite/plugin_test_3.sh: New file.
15556
15557 2008-12-22 Cary Coutant <ccoutant@google.com>
15558
15559 * object.cc (Sized_relobj::layout_section): New function.
15560 (Sized_relobj::do_layout): Defer layout of input sections until after
15561 plugin has provided replacement files.
15562 (Sized_relobj::do_layout_deferred_sections): New function.
15563 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15564 (Relobj::layout_deferred_sections): New function.
15565 (Relobj::do_layout_deferred_sections): New function.
15566 (Sized_relobj::do_layout_deferred_sections): New function.
15567 (Sized_relobj::layout_section): New function.
15568 (Sized_relobj::Deferred_layout): New structure.
15569 (Sized_relobj::deferred_layout_): New field.
15570 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15571 Change all callers. Layout deferred sections.
15572 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15573 references.
15574 (Plugin_hook::run): Move code from do_plugin_hook inline.
15575 (Plugin_hook::do_plugin_hook): Remove.
15576 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15577 (Plugin_manager::finish): Renamed, was cleanup.
15578 (Plugin_manager::should_defer_layout): New function.
15579 (Plugin_manager::add_deferred_layout_object): New function.
15580 (Plugin_manager::Deferred_layout_list): New type.
15581 (Plugin_manager::deferred_layout_objects_): New field.
15582 (Plugin_hook::do_plugin_hook): Remove.
15583
15584 2008-12-17 Ian Lance Taylor <iant@google.com>
15585
15586 * options.h (class General_options): Add --no case for
15587 --export-dynamic.
15588
15589 2008-12-16 Cary Coutant <ccoutant@google.com>
15590
15591 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15592 vector.
15593 (Plugin_manager::claim_file): Create plugin object even if
15594 plugin did not call the add_symbols callback.
15595 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15596 asking for more symbols than were added.
15597 * testsuite/Makefile.am (plugin_test_1): Add test case with
15598 no global symbols.
15599 (empty.syms): New target.
15600 * testsuite/Makefile.in: Regenerate.
15601 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15602 message. Don't call add_symbols if no globals.
15603 (all_symbols_read_hook): Don't provide replacement for empty
15604 claimed file.
15605
15606 2008-12-12 Ian Lance Taylor <iant@google.com>
15607
15608 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15609 r_type == 0 for a local symbol with r_sym == 0.
15610 (scan_relocatable_relocs): Pass r_sym to
15611 local_non_section_strategy.
15612 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15613 r_sym parameter.
15614
15615 * configure.ac: Update test for TLS descriptors: they are
15616 supported as of glibc 2.9.
15617 * configure: Rebuild.
15618
15619 2008-12-11 Ian Lance Taylor <iant@google.com>
15620
15621 PR 7091
15622 * target-reloc.h (Default_scan_relocatable_relocs): For each
15623 function, map r_type == 0 to RELOC_DISCARD.
15624
15625 2008-12-10 Cary Coutant <ccoutant@google.com>
15626
15627 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15628 object to override a kept COMDAT group from a plugin object.
15629
15630 2008-12-09 Ian Lance Taylor <iant@google.com>
15631
15632 PR 7088
15633 * yyscript.y (file_cmd): Handle INPUT.
15634
15635 * testsuite/initpri1.c: Change all declarations to be full
15636 prototypes by adding void, to avoid compiler warnings.
15637
15638 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15639
15640 * options.cc (General_options::parse_plugin_opt): New.
15641 (General_options::add_plugin): The argument now is just the filename.
15642 (General_options::add_plugin_option): New.
15643 * options.h (plugin_opt): New.
15644 (add_plugin): Change argument name.
15645 (add_plugin_option): New.
15646 * plugin.cc (Plugin::load): Don't parse the plugin option.
15647 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15648 (Plugin::add_option): New.
15649 (Plugin::args_): Change type.
15650 (Plugin::filename_): New.
15651 (Plugin_manager::add_plugin_option): New.
15652 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15653 * testsuite/Makefile.in: Regenerate.
15654
15655 2008-12-05 Cary Coutant <ccoutant@google.com>
15656
15657 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15658 Handle --strip-lto-sections option.
15659 * options.h (strip_lto_sections): New option.
15660
15661 2008-12-01 Cary Coutant <ccoutant@google.com>
15662
15663 * plugin.cc (ld_plugin_message): Change format parameter to const.
15664 Fix mismatch between new[] and delete.
15665
15666 2008-11-14 Cary Coutant <ccoutant@google.com>
15667
15668 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15669 instead of -1U.
15670
15671 2008-11-05 Craig Silverstein <csilvers@google.com>
15672
15673 * options.cc (General_options::parse_dynamic_list): New function.
15674 * options.h (General_options): New flags dynamic_list,
15675 dynamic_list_data, dynamic_list_cpp_new, and
15676 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15677 (General_options::in_dynamic_list): New function.
15678 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15679 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15680 (Lex::can_continue_name): Likewise.
15681 (yylex): Likewise.
15682 (read_script_file): New parameter script_options.
15683 (read_dynamic_list): New function.
15684 (Script_options::define_dynamic_list): New function.
15685 (dynamic_list_keyword_parsecodes): New variable.
15686 (dynamic_list_keywords): New variable.
15687 * script.h (Script_options::define_dynamic_list): New function
15688 prototype.
15689 (read_dynamic_list): New function prototype.
15690 * symtab.cc (strprefix): New macro.
15691 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15692 dynamic_list_data, dynamic_list_cpp_new, and
15693 dynamic_list_cpp_typeinfo.
15694 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15695 (dynamic_list_expr): New rule.
15696 (dynamic_list_nodes): Likewise.
15697 (dynamic_list_node): Likewise.
15698 * testsuite/Makefile.am (dynamic_list): New test.
15699 * testsuite/Makefile.in: Regenerated.
15700 * testsuite/dynamic_list.t: New file.
15701 * testsuite/dynamic_list.sh: New file.
15702
15703 2008-11-05 Craig Silverstein <csilvers@google.com>
15704
15705 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15706 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15707 (t11_last): Likewise.
15708 * testsuite/ver_test_6.c (main): Likewise.
15709
15710 2008-10-07 Cary Coutant <ccoutant@google.com>
15711
15712 * options.c (General_options::finalize): Add check for -static and
15713 -shared.
15714 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15715 is not empty.
15716
15717 2008-10-02 Cary Coutant <ccoutant@google.com>
15718
15719 * plugin.cc (make_sized_plugin_object): Fix conditional
15720 compilation to work when not all targets are enabled.
15721
15722 2008-09-29 Cary Coutant <ccoutant@google.com>
15723
15724 * archive.cc (Archive::get_file_and_offset): Use filename instead
15725 of name to get library path.
15726 (Archive::include_member): Unlock external member of a thin archive.
15727
15728 * testsuite/Makefile.am (TEST_AR): New variable.
15729 (thin_archive_test_1): New test.
15730 (thin_archive_test_2): New test.
15731 * testsuite/Makefile.in: Regenerate.
15732 * testsuite/thin_archive_main.cc: New file.
15733 * testsuite/thin_archive_test_1.cc: New file.
15734 * testsuite/thin_archive_test_2.cc: New file.
15735 * testsuite/thin_archive_test_3.cc: New file.
15736 * testsuite/thin_archive_test_4.cc: New file.
15737
15738 2008-09-29 Cary Coutant <ccoutant@google.com>
15739
15740 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15741 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15742 instead of -1U.
15743 (Sized_relobj::do_finalize_local_symbols): Likewise.
15744 (Sized_relobj::map_to_kept_section): Likewise.
15745 * object.h (Sized_relobj::invalid_address): New constant.
15746 (Sized_relobj::do_output_section_offset): Check for invalid_address
15747 and return -1ULL.
15748 * output.cc (Output_reloc::local_section_offset): Use constant
15749 invalid_address instead of -1U.
15750 (Output_reloc::get_address): Likewise.
15751 (Output_section::output_address): Change -1U to -1ULL.
15752 * output.h (Output_reloc::invalid_address): New constant.
15753 * reloc.cc (Sized_relobj::write_sections): Use constant
15754 invalid_address instead of -1U.
15755 (Sized_relobj::relocate_sections): Likewise.
15756 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15757 values for merge sections.
15758 * target-reloc.h (relocate_for_relocatable): Use constant
15759 invalid_address instead of -1U.
15760
15761 2008-09-19 Cary Coutant <ccoutant@google.com>
15762
15763 Add plugin functionality for link-time optimization (LTO).
15764 * configure.ac (plugins): Add --enable-plugins option.
15765 * configure: Regenerate.
15766 * config.in: Regenerate.
15767 * Makefile.am (LIBDL): New variable.
15768 (CCFILES): Add plugin.cc.
15769 (HFILES): Add plugin.h.
15770 (ldadd_var): Add LIBDL.
15771 * Makefile.in: Regenerate.
15772
15773 * archive.cc: Include "plugin.h".
15774 (Archive::setup): Don't preread archive symbols when using a plugin.
15775 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15776 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15777 files.
15778 (Archive::include_member): Add symbols from plugin objects.
15779 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15780 * descriptors.cc (Descriptors::open): Check for file descriptors
15781 abandoned by plugins.
15782 (Descriptors::claim_for_plugin): New function.
15783 * descriptors.h (Descriptors::claim_for_plugin): New function.
15784 (Open_descriptor::is_claimed): New field.
15785 (claim_descriptor_for_plugin): New function.
15786 * fileread.cc (File_read::claim_for_plugin): New function.
15787 * fileread.h (File_read::claim_for_plugin): New function.
15788 (File_read::descriptor): New function.
15789 * gold.cc: Include "plugin.h".
15790 (queue_initial_tasks): Add task to call plugin hooks for generating
15791 new object files.
15792 * main.cc: Include "plugin.h".
15793 (main): Load plugin libraries.
15794 * object.h (Pluginobj): Declare.
15795 (Object::pluginobj): New function.
15796 (Object::do_pluginobj): New function.
15797 (Object::set_target): New function.
15798 * options.cc: Include "plugin.h".
15799 (General_options::parse_plugin): New function.
15800 (General_options::General_options): Initialize plugins_ field.
15801 (General_options::add_plugin): New function.
15802 * options.h (Plugin_manager): Declare.
15803 (General_options): Add --plugin option.
15804 (General_options::has_plugins): New function.
15805 (General_options::plugins): New function.
15806 (General_options::add_plugin): New function.
15807 (General_options::plugins_): New field.
15808 * plugin.cc: New file.
15809 * plugin.h: New file.
15810 * readsyms.cc: Include "plugin.h".
15811 (Read_symbols::do_read_symbols): Check for archive before checking
15812 for ELF file. Call plugin hooks to claim files.
15813 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15814 from a real object file; force override when processing replacement
15815 files.
15816 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15817 (Symbol::init_base_object): Likewise.
15818 (Symbol::init_base_output_data): Likewise.
15819 (Symbol::init_base_output_segment): Likewise.
15820 (Symbol::init_base_constant): Likewise.
15821 (Symbol::init_base_undefined): Likewise.
15822 (Symbol::output_section): Assert that object is not a plugin.
15823 (Symbol_table::add_from_pluginobj): New function.
15824 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15825 undefined.
15826 (Symbol_table::sized_write_globals): Likewise.
15827 (Symbol_table::add_from_pluginobj): Instantiate template.
15828 * symtab.h (Sized_pluginobj): Declare.
15829 (Symbol::in_real_elf): New function.
15830 (Symbol::set_in_real_elf): New function.
15831 (Symbol::in_real_elf_): New field.
15832 (Symbol_table::add_from_pluginobj): New function.
15833
15834 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15835 (LIBDL): New variable.
15836 (LDADD): Add LIBDL.
15837 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15838 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15839 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15840 (MOSTLYCLEANFILES): Likewise.
15841 * testsuite/Makefile.in: Regenerate.
15842 * testsuite/plugin_test.c: New file.
15843 * testsuite/plugin_test_1.sh: New file.
15844 * testsuite/plugin_test_2.sh: New file.
15845
15846 2008-09-16 Ian Lance Taylor <iant@google.com>
15847
15848 * target-reloc.h (relocate_section): Check whether a symbol is
15849 defined by the ABI before reporting an undefined symbol error.
15850 * target.h (Target::is_defined_by_abi): Make parameter const.
15851 (Target::do_is_defined_by_abi): Likewise.
15852 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15853 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15854 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15855 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15856 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15857 * testsuite/Makefile.in: Rebuild.
15858
15859 * fileread.cc (make_view): Add casts to avoid warning.
15860
15861 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15862
15863 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15864 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15865
15866 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15867
15868 * options.h (General_options::output_is_executable): New.
15869 (General_options::output_is_pie): New.
15870 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15871 for shared libraries.
15872 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15873
15874 2008-09-11 Chris Demetriou <cgd@google.com>
15875
15876 * options.h (origin): New -z option.
15877 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15878 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15879 in DT_FLAGS_1.
15880
15881 2008-09-05 Cary Coutant <ccoutant@google.com>
15882
15883 * fileread.cc (File_read::make_view): Add check for attempt to map
15884 beyond end of file.
15885
15886 2008-09-05 Cary Coutant <ccoutant@google.com>
15887
15888 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15889 explicit instantiations.
15890
15891 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15892
15893 PR gold/6858
15894 * options.cc (General_options::finalize): Allow undefined symbols
15895 in shlibs if linking -shared.
15896
15897 PR gold/6859
15898 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15899 symbols as not needing a dynsym entry.
15900
15901 2008-08-20 Craig Silverstein <csilvers@google.com>
15902
15903 * fileread.cc (File_read::open): Do not lock the file unless it
15904 was successfully opened.
15905
15906 2008-08-14 Cary Coutant <ccoutant@google.com>
15907
15908 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15909 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15910 * testsuite/tls_test.cc (struct int128): 128-bit struct
15911 for testing TLS relocs with non-zero addend.
15912 (v12): New TLS variable.
15913 (t12): New test.
15914 (t_last): Add check for v12.
15915 * testsuite/tls_test.h (t12): New function.
15916 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15917
15918 2008-08-13 Ian Lance Taylor <iant@google.com>
15919
15920 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15921 set tls_segment_ or relro_segment_.
15922 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15923 when appropriate.
15924 * output.h (Output_section::clear_is_relro): New function.
15925 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15926 sections specially even when output_data_ is empty.
15927 (Output_segment::maximum_alignment): When first section is relro,
15928 only force alignment for PT_LOAD segments.
15929 * script.cc (script_data_segment_align): New function.
15930 (script_data_segment_relro_end): New function.
15931 * script-c.h (script_data_segment_align): Declare.
15932 (script_data_segment_relro_end): Declare.
15933 * script-sections.h (class Script_sections): Declare
15934 data_segment_align and data_segment_relro_end. Add fields
15935 segment_align_index_ and saw_relro_end_.
15936 * script-sections.cc (class Sections_element): Add set_is_relro
15937 virtual function. Add new bool* parameter to place_orphan_here.
15938 Add get_output_section virtual function.
15939 (class Output_section_definition): Add set_is_relro. Add new
15940 bool* parameter to place_orphan_here. Add get_output_section.
15941 Add is_relro_ field.
15942 (Output_section_definition::Output_section_definition): Initialize
15943 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15944 and is_relro_ fields.
15945 (Output_section_definition::place_orphan_here): Add is_relro
15946 parameter.
15947 (Output_section_definition::set_section_addresses): Set relro for
15948 output section.
15949 (Output_section_definition::alternate_constraint): Likewise.
15950 (class Orphan_output_section): Add new bool* parameter to
15951 place_orphan_here. Add get_output_section.
15952 (Orphan_output_section::place_orphan_here): Add is_relro
15953 parameter.
15954 (Script_sections::Script_sections): Initialize
15955 data_segment_align_index_ and saw_relro_end_.
15956 (Script_sections::data_segment_align): New function.
15957 (Script_sections::data_segment_relro_end): New function.
15958 (Script_sections::place_orphan): Set or clear is_relro.
15959 (Script_sections::set_section_addresses): Force alignment of first
15960 TLS section.
15961 * yyscript.y (exp): Call script_data_segment_align and
15962 script_data_segment_relro_end.
15963 * testsuite/relro_script_test.t: New file.
15964 * testsuite/relro_test.cc (using_script): Declare.
15965 (t1, t2): Test using_script.
15966 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15967 (relro_script_test_SOURCES): Define.
15968 (relro_script_test_DEPENDENCIES): Define.
15969 (relro_script_test_LDFLAGS): Define.
15970 (relro_script_test_LDADD): Define.
15971 (relro_script_test.so): New target.
15972 * testsuite/Makefile.in: Rebuild.
15973
15974 2008-08-06 Cary Coutant <ccoutant@google.com>
15975
15976 * archive.cc (Archive::total_archives, Archive::total_members)
15977 (Archive::total_members_loaded): New variables.
15978 (Archive::setup): Add parameter. Add option to preread
15979 archive symbols.
15980 (Archive::read_armap): Add counter.
15981 (Archive::get_file_and_offset): New function.
15982 (Archive::get_elf_object_for_member): New function.
15983 (Archive::read_all_symbols): New function.
15984 (Archive::read_symbols): New function.
15985 (Archive::add_symbols): Add counters.
15986 (Archive::include_all_members): Use armap to find members if it's
15987 already built.
15988 (Archive::include_member): Skip reading symbols if already read.
15989 Factored code into Archive::get_file_and_offset and
15990 Archive::get_elf_object_for_member. Changed call to
15991 Mapfile::report_include_archive_member.
15992 (Archive::print_stats): New function.
15993 * archive.h: Declare Object and Read_symbols_data classes.
15994 (Archive::Archive): Add initializers for new members.
15995 (Archive::setup): Add parameter.
15996 (Archive::print_stats): New function.
15997 (Archive::total_archives, Archive::total_members)
15998 (Archive::total_members_loaded): New variables.
15999 (Archive::get_file_and_offset): New function.
16000 (Archive::get_elf_object_for_member): New function.
16001 (Archive::read_all_symbols): New function.
16002 (Archive::read_symbols): New function.
16003 (Archive::Archive_member): New class.
16004 (Archive::members_): New member.
16005 (Archive::num_members_): New member.
16006 * main.cc: Include archive.h.
16007 (main): Call Archive::print_stats.
16008 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16009 archive parameter; member_name is now the fully-decorated name.
16010 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16011 * options.h: (General_options): Add --preread-archive-symbols option.
16012 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16013 Archive::setup.
16014
16015 2008-08-04 Ian Lance Taylor <iant@google.com>
16016
16017 * symtab.h (Symbol::use_plt_offset): New function.
16018 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16019 * powerpc.cc (Relocate::relocate): Likewise.
16020 * sparc.cc (Relocate::relocate): Likewise.
16021 * x86_64.cc (Relocate::relocate): Likewise.
16022 * testsuite/weak_plt.sh: New test.
16023 * testsuite/weak_plt_main.cc: New test.
16024 * testsuite/weak_plt_shared.cc: New test.
16025 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16026 (check_PROGRAMS): Add weak_plt.
16027 (check_DATA): Add weak_plt_shared.so.
16028 (weak_plt_main_pic.o, weak_plt): New targets.
16029 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16030 * testsuite/Makefile.in: Rebuild.
16031
16032 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16033 gcctestdir/ld.
16034 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16035 * testsuite/Makefile.in: Rebuild.
16036
16037 2008-08-04 Alan Modra <amodra@bigpond.net.au>
16038
16039 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16040 * Makefile.in: Regenerate.
16041 * po/POTFILES.in: Regenerate.
16042
16043 2008-07-29 Ian Lance Taylor <iant@google.com>
16044
16045 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16046 symbols before other symbols.
16047 * testsuite/script_test_2.cc (test_addr): Declare.
16048 (test_addr_alias): Declare.
16049 (main): Check that test_addr and test_addr_alias have the right
16050 values.
16051 * testsuite/script_test_2.t: Define test_addr_alias and
16052 test_addr.
16053
16054 2008-07-24 Ian Lance Taylor <iant@google.com>
16055
16056 PR 5990
16057 * descriptors.cc: New file.
16058 * descriptors.h: New file.
16059 * gold-threads.h (class Hold_optional_lock): New class.
16060 * fileread.cc: Include "descriptors.h".
16061 (File_read::~File_read): Release descriptor rather than closing
16062 it.
16063 (File_read::open) [file]: Call open_descriptor rather than open.
16064 Set is_descriptor_opened_.
16065 (File_read::open) [memory]: Assert that descriptor is not open.
16066 (File_read::reopen_descriptor): New function.
16067 (File_read::release): Release descriptor.
16068 (File_read::do_read): Make non-const. Reopen descriptor.
16069 (File_read::read): Make non-const.
16070 (File_read::make_view): Reopen descriptor.
16071 (File_read::do_readv): Likewise.
16072 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16073 Update declarations.
16074 * layout.cc: Include "descriptors.h".
16075 (Layout::create_build_id): Use open_descriptor rather than open.
16076 * output.cc: Include "descriptors.h".
16077 (Output_file::open): Use open_descriptor rather than open.
16078 * archive.cc (Archive::const_iterator): Change Archive to be
16079 non-const.
16080 (Archive::begin, Archive::end): Make non-const.
16081 (Archive::count_members): Likewise.
16082 * archive.h (class Archive): Update declarations.
16083 * object.h (Object::read): Make non-const.
16084 * Makefile.am (CCFILES): Add descriptors.cc.
16085 (HFILES): Add descriptors.h.
16086 * Makefile.in: Rebuild.
16087
16088 PR 6716
16089 * gold.h: Always include <clocale>. Add Solaris workarounds
16090 following code in binutils/sysdep.h.
16091
16092 PR 6048
16093 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16094 this->eh_frame_hdr_ is NULL before using it.
16095
16096 * dynobj.cc (Versions::Versions): Update comment.
16097
16098 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16099 the base version name.
16100
16101 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16102 array size plus one.
16103 (Stringpool_template::set_string_offsets): Subtract one from key
16104 before using it as an array index.
16105 (Stringpool_template::get_offset_with_length): Likewise.
16106 (Stringpool_template::write_to_buffer): Likewise.
16107 * stringpool.h (Stringpool_template::get_offset_from_key):
16108 Likewise.
16109
16110 2008-07-23 Ian Lance Taylor <iant@google.com>
16111
16112 PR 6658
16113 * object.h (Merged_symbol_value::value): Do our best to handle a
16114 negative addend.
16115
16116 PR 6647
16117 * script.cc (Version_script_info::get_versions): Don't add empty
16118 version tag to return value.
16119 (Version_script_info::get_symbol_version_helper): Change return
16120 type to bool. Add pversion parameter. Change all callers.
16121 (script_register_vers_node): Don't require a non-NULL tag.
16122 * script.h (class Version_script_info): Update declarations.
16123 (Version_script_info::get_symbol_version): Change return type to
16124 bool. Add version parameter. Change all callers.
16125 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16126 handling. Handle an empty version from a version script.
16127 (Symbol_table::define_special_symbol): Likewise.
16128 * testsuite/ver_test_10.script: New file.
16129 * testsuite/ver_test_10.sh: New file.
16130 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16131 (check_DATA): Add ver_test_10.syms.
16132 (ver_test_10.syms, ver_test_10.so): New target.
16133 * testsuite/Makefile.in: Rebuild.
16134
16135 2008-07-23 Simon Baldwin <simonb@google.com>
16136
16137 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16138 to zero for undefined symbols from dynamic libraries.
16139
16140 2008-07-23 Ian Lance Taylor <iant@google.com>
16141
16142 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16143 Change all callers.
16144 * symtab.h (class Symbol_table): Update declaration.
16145 * testsuite/ver_test_9.cc: New file.
16146 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16147 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16148 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16149 (ver_test_9.so, ver_test_9.o): New targets.
16150 * testsuite/Makefile.in: Rebuild.
16151
16152 2008-07-22 Ian Lance Taylor <iant@google.com>
16153
16154 * options.h (class General_options): Define --check-sections.
16155 * layout.cc (Layout::set_segment_offsets): Handle
16156 --check-sections.
16157
16158 * options.h (class General_options): Define -n/--nmagic and
16159 -N/--omagic.
16160 * options.cc (General_options::finalize): For -n/--nmagic or
16161 -N/--omagic, set -static.
16162 * layout.cc (Layout::attach_allocated_section_to_segment): If
16163 -N/--omagic, don't put read-only and read-write sections in
16164 different segments.
16165 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16166 finding a read-only segment.
16167 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16168 don't set the minimum segment alignment to the common page size,
16169 and don't set the file offset to the address modulo the page size.
16170 * script-sections.cc (Script_sections::create_segments): If
16171 -n/--omagic, don't put read-only and read-write sections in
16172 different segments.
16173
16174 * cref.cc: New file.
16175 * cref.h: New file.
16176 * options.h (class General_options): Add --print-symbol-counts.
16177 * main.cc (main): Issue defined symbol report if requested.
16178 * archive.cc (Archive::interpret_header): Make into a const member
16179 function.
16180 (Archive::add_symbols): Call Input_objects::archive_start and
16181 archive_stop.
16182 (Archive::const_iterator): Define new class.
16183 (Archive::begin, Archive::end): New functions.
16184 (Archive::include_all_members): Rewrite to use iterator.
16185 (Archive::count_members): New function.
16186 * archive.h (class Archive): Update declarations.
16187 (Archive::filename): New function.
16188 * object.cc: Include "cref.h".
16189 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16190 (Sized_relobj::do_get_global_symbol_counts): New function.
16191 (Input_objects::add_object): Add object to cross-referencer.
16192 (Input_objects::archive_start): New function.
16193 (Input_objects::archive_stop): New function.
16194 (Input_objects::print_symbol_counts): New function.
16195 * object.h: Declare Cref and Archive.
16196 (Object::get_global_symbol_counts): New function.
16197 (Object::do_get_global_symbol_counts): New pure virtual function.
16198 (class Sized_relobj): Add defined_count_ field. Update
16199 declarations.
16200 (class Input_objects): Add cref_ field. Update constructor.
16201 Update declarations.
16202 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16203 defined_count_.
16204 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16205 symbol counts.
16206 (Sized_dynobj::do_get_global_symbol_counts): New function.
16207 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16208 defined_count_. Update declarations. Define Symbols typedef.
16209 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16210 parameter. Change all callers.
16211 (Symbol_table::add_from_dynobj): Add sympointers and defined
16212 parameters. Change all callers.
16213 * symtab.h (class Symbol_table): Update declarations.
16214 * Makefile.am (CCFILES): Add cref.cc.
16215 (HFILES): Add cref.h.
16216 * Makefile.in: Rebuild.
16217
16218 2008-07-22 Simon Baldwin <simonb@google.com>
16219
16220 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16221 to zero when writing undefined symbols.
16222
16223 2008-07-22 Ian Lance Taylor <iant@google.com>
16224
16225 * output.cc (Output_section::add_input_section): Don't try to
16226 merge empty merge sections.
16227
16228 2008-07-21 Craig Silverstein <csilvers@google.com>
16229
16230 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16231 Include symbol version in error message.
16232
16233 2008-07-20 Chris Demetriou <cgd@google.com>
16234
16235 * configure.ac (gold_cv_c_random_seed): New configured variable.
16236 (RANDOM_SEED_CFLAGS): New substituted variable.
16237 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16238 * configure: Rebuild.
16239 * Makefile.in: Likewise.
16240 * testsuite/Makefile.in: Likewise.
16241
16242 2008-07-18 Ian Lance Taylor <iant@google.com>
16243
16244 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16245 where we see NAME/NULL and NAME/VERSION as separate symbols.
16246 * testsuite/ver_test_main.cc (main): Call t4.
16247 (t4, t4_2a): Define.
16248 * testsuite/ver_test_2.cc (t4_2): Define.
16249 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16250 * testsuite/ver_test_4.cc (t4_2a): Define.
16251 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16252 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16253
16254 2008-07-17 Ian Lance Taylor <iant@google.com>
16255
16256 * dynobj.cc (Versions::add_def): If we give an error about a
16257 missing version, go ahead and create the version anyhow.
16258
16259 2008-07-10 Ian Lance Taylor <iant@google.com>
16260
16261 Handle output sections with more than 0x7fffffff bytes.
16262 * object.h (class Relobj): Change map_to_output_ to
16263 output_sections_, and just keep a section pointer. Change all
16264 uses. Move comdat group support to Sized_relobj.
16265 (Relobj::is_section_specially_mapped): Remove.
16266 (Relobj::output_section): Remove poff parameter. Change all
16267 callers.
16268 (Relobj::output_section_offset): New function.
16269 (Relobj::set_section_offset): Rewrite.
16270 (Relobj::map_to_output): Remove.
16271 (Relobj::output_sections): New function.
16272 (Relobj::do_output_section_offset): New pure virtual function.
16273 (Relobj::do_set_section_offset): Likewise.
16274 (class Sized_relobj): Add section_offsets_ field. Add comdat
16275 group support from Relobj. Update declarations.
16276 (Sized_relobj::get_output_section_offset): New function.
16277 (Sized_relobj::do_output_section_offset): New function.
16278 (Sized_relobj::do_set_section_offset): New function.
16279 * object.cc (Relobj::output_section_address): Remove.
16280 (Sized_relobj::Sized_relobj): Initialize new fields.
16281 (Sized_relobj::include_section_group): Cast find_kept_object to
16282 Sized_relobj.
16283 (Sized_relobj::include_linkonce_section): Likewise.
16284 (Sized_relobj::do_layout): Use separate arrays for output section
16285 and output offset.
16286 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16287 output_sections.
16288 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16289 output_sections and section_offsets.
16290 (Sized_relobj::write_local_symbols): Likewise.
16291 (map_to_kept_section): Compute output address directly.
16292 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16293 output_sections and section_offsets.
16294 (Sized_relobj::write_sections): Likewise.
16295 (Sized_relobj::relocate_sections): Likewise.
16296 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16297 * output.h (class Output_reloc): Update declarations. Change
16298 u2_.relobj to Sized_relobj*.
16299 (class Output_data_reloc): Change add functions to use
16300 Sized_relobj*.
16301 * output.cc (Output_reloc::Output_reloc): Change relobj to
16302 Sized_relobj*.
16303 (Output_reloc::local_section_offset): Change return type to
16304 Elf_Addr. Use get_output_section_offset.
16305 (Output_reloc::get_address): Likewise.
16306 (Output_section::is_input_address_mapped): Don't call
16307 is_section_specially_mapped.
16308 (Output_section::output_offset): Likewise.
16309 (Output_section::output_address): Likewise.
16310 (Output_section::starting_output_address): Likewise.
16311 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16312 parameter to Sized_relobj*.
16313 (Copy_relocs::need_copy_reloc): Likewise.
16314 (Copy_relocs::save): Likewise.
16315 * copy-relocs.h (class Copy_relocs): Update declarations.
16316 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16317 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16318 * target-reloc.h (relocate_for_relocatable): Change
16319 offset_in_output_section type to Elf_Addr. Change code that uses
16320 it as well.
16321 * layout.cc (Layout::layout): Always set *off.
16322 * mapfile.cc (Mapfile::print_input_section): Use
16323 output_section_offset.
16324 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16325 Sized_relobj*.
16326 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16327 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16328 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16329
16330 2008-07-03 Ian Lance Taylor <iant@google.com>
16331
16332 * layout.cc (Layout::include_section): Do not discard unrecognized
16333 SHT_STRTAB sections.
16334
16335 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16336
16337 * script.cc (Lex::can_continue_name): Make '?' allowable in
16338 version-script names.
16339 * testsuite/version_script.map: Change glob pattern to use '?'
16340
16341 2008-06-30 Manish Singh <yosh@gimp.org>
16342
16343 PR 6585
16344 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16345 Correct typo.
16346
16347 2008-06-30 Ian Lance Taylor <iant@google.com>
16348
16349 PR 6660
16350 PR 6682
16351 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16352 versions]: Don't try to read the value in the contents, since we
16353 don't use it. Use the template endianness when writing.
16354
16355 2008-06-25 Cary Coutant <ccoutant@google.com>
16356
16357 * fileread.cc (File_read::make_view): Assert on zero-length view.
16358 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16359 symbol table when there are no symbols to read.
16360
16361 2008-06-23 Craig Silverstein <csilvers@google.com>
16362
16363 * version.cc (version_string): Bump to 1.7
16364
16365 2008-06-18 Craig Silverstein <csilvers@google.com>
16366
16367 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16368 constant 0xFFFF to type Valtype.
16369 (Powerpc_relocate_functions::rel16_ha): Likewise.
16370
16371 2008-06-17 Ian Lance Taylor <iant@google.com>
16372
16373 * output.h (Output_section::Input_section): Initialize p2align_ to
16374 zero for Output_section_data constructors.
16375 (Output_section::Input_section::addralign): If not an input
16376 section, return the alignment of the Output_section_data.
16377 * testsuite/copy_test.cc: New file.
16378 * testsuite/copy_test_1.cc: New file.
16379 * testsuite/copy_test_2.cc: New file.
16380 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16381 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16382 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16383 (copy_test_1_pic.o, copy_test_1.so): New targets.
16384 (copy_test_2_pic.o, copy_test_2.so): New targets.
16385 * testsuite/Makefile.in: Rebuild.
16386
16387 * script-sections.cc (Script_sections::place_orphan): Initialize
16388 local variable exact.
16389
16390 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16391
16392 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16393
16394 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16395 David S. Miller <davem@davemloft.net>
16396
16397 * powerpc.cc: New file.
16398 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16399 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16400 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16401 * Makefile.in: Rebuild.
16402
16403 2008-06-09 Ian Lance Taylor <iant@google.com>
16404
16405 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16406 <exception>.
16407 (throwing, orig_terminate): New static variables.
16408 (terminate_handler): New static function.
16409 (t2): Set terminate handler.
16410
16411 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16412
16413 PR 6584
16414 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16415 alignment.
16416
16417 2008-05-30 Cary Coutant <ccoutant@google.com>
16418
16419 * archive.cc (Archive::include_all_members) Correct to step
16420 over symbol table and extended name table in thin archives.
16421
16422 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16423
16424 PR 6407
16425 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16426 calculation.
16427
16428 2008-05-28 Caleb Howe <cshowe@google.com>
16429
16430 * reduced_debug_output.cc: New file.
16431 * reduced_debug_output.h: New file.
16432 * options.h (class General_options): Add --strip-debug-non-line.
16433 * options.cc (General_options::finalize): Add strip_debug_non_line
16434 to the strip heirarchy.
16435 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16436 fields.
16437 * layout.cc: Include "reduced_debug_output.h".
16438 (Layout::Layout): Initialize new fields.
16439 (line_only_debug_sections): New static array.
16440 (is_lines_only_debug_sections): New static inline function.
16441 (Layout::include_section): Handle --strip-debug-non-line.
16442 (Layout::make_output_section): If --strip-debug-non-line, build
16443 new output sections for .debug_abbrev and .debug_info.
16444 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16445 gold. Warn about possible overflow.
16446 (read_signed_LEB_128): Likewise.
16447 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16448 (read_signed_LEB_128): Declare.
16449 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16450 (HFILES): Add reduced_debug_output.h.
16451 * Makefile.in: Rebuild.
16452
16453 2008-05-21 Ian Lance Taylor <iant@google.com>
16454
16455 * mapfile.cc: New file.
16456 * mapfile.h: New file.
16457 * options.h (class General_options): Add -M/--print-map and -Map.
16458 * options.cc (General_options::finalize): Make -M equivalent to
16459 -Map -.
16460 * main.cc: Include <cstdio> and "mapfile.h".
16461 (main): Open mapfile if requested.
16462 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16463 constructor. Change caller.
16464 (queue_initial_tasks): Add mapfile parameter. Change caller.
16465 (queue_middle_tasks): Likewise.
16466 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16467 declarations.
16468 * archive.cc: Include "mapfile.h".
16469 (Archive::add_symbols): Add mapfile parameter. Change all
16470 callers. Pass mapfile, symbol, and reason to include_member.
16471 (Archive::include_all_members): Add mapfile parameter. Change all
16472 callers.
16473 (Archive::include_member): Add mapfile, sym, and why parameters.
16474 Change all callers. Report inclusion to map file.
16475 * archive.h: Include "fileread.h".
16476 (class Archive): Update declarations.
16477 (Archive::file): New const method.
16478 (class Add_archive_symbols): Add mapfile_ field. Update
16479 constructor. Change all callers.
16480 * readsyms.h (class Read_symbols): Likewise.
16481 (class Finish_group): Likewise.
16482 (class Read_script): Likewise.
16483 * common.cc: Include "mapfile.h".
16484 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16485 all callers.
16486 (Symbol_table::do_allocate_commons): Likewise.
16487 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16488 symbol allocation to mapfile.
16489 * common.h (class Allocate_commons_task): Add mapfile_ field.
16490 Update constructor. Change all callers.
16491 * symtab.h (class Symbol_table): Update declarations.
16492 * layout.cc: Include "mapfile.h".
16493 (Layout_task_runner::run): Print information to mapfile.
16494 (Layout::create_gold_note): Change Output_data_fixed_space to
16495 Output_data_zero_fill.
16496 (Layout::create_build_id): Likewise.
16497 (Layout::print_to_mapfile): New function.
16498 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16499 constructor. Change caller.
16500 (class Layout): Declare print_to_mapfile.
16501 * output.cc (Output_section::Input_section::print_to_mapfile): New
16502 function.
16503 (Output_section::add_input_section): If producing a map, always
16504 add to input_sections_ list.
16505 (Output_section::do_print_to_mapfile): New function.
16506 (Output_segment::print_sections_to_mapfile): New function.
16507 (Output_segment::print_section_list_to_mapfile): New function.
16508 * output.h: Include "mapfile.h".
16509 (Output_data::print_to_mapfile): New function.
16510 (Output_data::do_print_to_mapfile): New virtual function.
16511 (Output_segment_headers::do_print_to_mapfile): New function.
16512 (Output_file_header::do_print_to_mapfile): New function.
16513 (Output_data_const::do_print_to_mapfile): New function.
16514 (class Output_data_const_buffer): Add map_name_ field. Update
16515 constructor. Change all callers. Add do_print_to_mapfile
16516 function.
16517 (class Output_data_fixed_space): Likewise.
16518 (class Output_data_space): Likewise.
16519 (class Output_data_zero_fill): New class.
16520 (Output_data_strtab::do_print_to_mapfile): New function.
16521 (Output_data_reloc_base::do_print_to_mapfile): New function.
16522 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16523 (Output_data_group::do_print_to_mapfile): New function.
16524 (Output_data_got::do_print_to_mapfile): New function.
16525 (Output_data_dynamic::do_print_to_mapfile): New function.
16526 (Output_symtab_xindex::do_print_to_mapfile): New function.
16527 (class Output_section): Declare do_print_to_mapflie. Declare
16528 print_to_mapfile in Input_section.
16529 (class Output_segment): Declare new functions.
16530 * object.h (Sized_relobj::symbol_count): New function.
16531 * script-sections.cc
16532 (Output_section_element_dot_assignment::set_section_addresses):
16533 Change Output_data_fixed_space to Output_data_zero_fill.
16534 (Output_data_expression::do_print_to_mapfile): New function.
16535 * script.cc (read_input_script): Add mapfile parameter. Change
16536 all callers.
16537 * script.h (read_input_script): Update declaration.
16538 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16539 (Eh_frame::do_print_to_mapfile): New function.
16540 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16541 (Output_merge_string::do_print_to_mapfile): New function.
16542 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16543 function.
16544 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16545 function.
16546 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16547 function.
16548 * Makefile.am (CCFILES): Add mapfile.cc.
16549 (HFILES): Add mapfile.h.
16550 * Makefile.in: Rebuild.
16551
16552 2008-05-19 Ian Lance Taylor <iant@google.com>
16553
16554 * options.h (class General_options): Add -z relro.
16555 * layout.cc (Layout::Layout): Initialize relro_segment_.
16556 (Layout::add_output_section_data): Return the output section.
16557 (Layout::make_output_section): Rcognize relro sections and mark
16558 them appropriately.
16559 (Layout::attach_allocated_section_to_segment): Put relro sections
16560 in a PT_GNU_RELRO segment.
16561 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16562 section as relro.
16563 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16564 PT_TLS segments.
16565 (Layout::linkonce_mapping): Map d.rel.ro.local to
16566 .data.rel.ro.local.
16567 (Layout::output_section_name): Us .data.rel.ro.local for any
16568 section which begins with that.
16569 * layout.h (class Layout): Update add_output_section_data
16570 declaration. Add relro_segment_ field.
16571 * output.cc (Output_section::Output_section): Initialize is_relro_
16572 and is_relro_local_ fields.
16573 (Output_segment::add_output_section): Group relro sections.
16574 (Output_segment::is_first_section_relro): New function.
16575 (Output_segment::maximum_alignment): If there is a relro section,
16576 align the segment to the common page size.
16577 (Output_segment::set_section_addresses): Track whether we are
16578 looking at relro sections. If the last section is a relro
16579 section, align to the common page size.
16580 (Output_segment::set_section_list_addresses): Add in_relro
16581 parameter. Change all callers. Align to the page size when
16582 moving from relro to non-relro section.
16583 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16584 segment.
16585 * output.h (class Output_section): Add is_relro_ and
16586 is_relro_local_ fields.
16587 (Output_section::is_relro): New function.
16588 (Output_section::set_is_relro): New function.
16589 (Output_section::is_relro_local): New function.
16590 (Output_section::set_is_relro_local): New function.
16591 (class Output_segment): Update declarations.
16592 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16593 * sparc.cc (Target_sparc::got_section): Likewise.
16594 * x86_64.cc (Target_x86_64::got_section): Likewise.
16595 * testsuite/relro_test_main.cc: New file.
16596 * testsuite/relro_test.cc: New file.
16597 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16598 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16599 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16600 (relro_test.so, relro_test_pic.o): New targets.
16601 * testsuite/Makefile.in: Rebuild.
16602
16603 2008-05-16 Ian Lance Taylor <iant@google.com>
16604
16605 * output.cc (Output_segment::add_output_section): Remove front
16606 parameter.
16607 * output.h (class Output_segment): Remove
16608 add_initial_output_section and overloaded add_output_section.
16609 Update declaration of remaining add_output_section.
16610 * layout.cc (Layout::create_interp): Call add_output_section
16611 rather than add_initial_output_section.
16612 (Layout::finish_dynamic_section): Likewise.
16613
16614 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16615 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16616 know the dynamic type.
16617 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16618 field. Initialize it in constructor.
16619 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16620 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16621 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16622 reloc.
16623
16624 * output.cc (Output_reloc::get_address): Change return type to
16625 Elf_Addr.
16626 * output.h (class Output_reloc): Update get_address declaration.
16627 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16628 for section addresses.
16629
16630 2008-05-09 Ian Lance Taylor <iant@google.com>
16631
16632 PR 6493
16633 * gold.cc (gold_nomem): Use return value of write.
16634
16635 2008-05-08 Ian Lance Taylor <iant@google.com>
16636
16637 * symtab.c (Symbol::init_base_output_data): Add version
16638 parameter. Change all callers.
16639 (Symbol::init_base_output_segment): Likewise.
16640 (Symbol::init_base_constant): Likewise.
16641 (Symbol::init_base_undefined): Likewise.
16642 (Sized_symbol::init_output_data): Likewise.
16643 (Sized_symbol::init_output_segment): Likewise.
16644 (Sized_symbol::init_constant): Likewise.
16645 (Sized_symbol::init_undefined): Likewise.
16646 (Symbol_table::do_define_in_output_data): If the new symbol has a
16647 version, mark it as the default.
16648 (Symbol_table::do_define_in_output_segment): Likewise.
16649 (Symbol_table::do_define_as_constant): Likewise.
16650 * symtab.h (class Symbol): Update declarations.
16651 (class Sized_symbol): Likewise.
16652 * resolve.cc (Symbol::override_version): New function.
16653 (Symbol::override_base): Call override_version.
16654 (Symbol::override_base_with_special): Likewise.
16655 * testsuite/ver_script_8.script: New file.
16656 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16657 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16658 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16659 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16660
16661 2008-05-06 Ian Lance Taylor <iant@google.com>
16662
16663 PR 6049
16664 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16665 functions.
16666 (class General_options): Remove existing --undefined, and add
16667 --no-undefined instead. Add new --undefined as synonym for -u.
16668 * archive.cc (Archive::add_symbols): Check whether symbol was
16669 named with -u.
16670 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16671 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16672 all uses. Add IS_UNDEFINED. Update declarations to split
16673 different versions of init_base. Declare init_base_undefined.
16674 (Symbol::is_defined): Handle IS_UNDEFINED.
16675 (Symbol::is_undefined): Likewise.
16676 (Symbol::is_weak_undefined): Call is_undefined.
16677 (Symbol::is_absolute): Handle IS_CONSTANT.
16678 (class Sized_symbol): Update declarations to split different
16679 versions of init. Declare init_undefined.
16680 (class Symbol_table): Declare new functions.
16681 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16682 Change all callers.
16683 (Symbol::init_base_output_data): Likewise.
16684 (Symbol::init_base_output_segment): Likewise.
16685 (Symbol::init_base_constant): Likewise.
16686 (Symbol::init_base_undefined): New function.
16687 (Sized_symbol::init_object): Rename from init. Change all
16688 callers.
16689 (Sized_symbol::init_output_data): Likewise.
16690 (Sized_symbol::init_output_segment): Likewise.
16691 (Sized_symbol::init_constant): Likewise.
16692 (Sized_symbol::init_undefined): New function.
16693 (Symbol_table::add_undefined_symbols_from_command_line): New
16694 function.
16695 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16696 function.
16697 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16698 (Symbol::output_section): Likewise.
16699 (Symbol::set_output_section): Likewise.
16700 (Symbol_table::sized_finalize_symbol): Likewise.
16701 (Symbol_table::sized_write_globals): Likewise.
16702 * resolve.cc (Symbol_table::should_override): Likewise.
16703 (Symbol::override_base_with_special): Likewise.
16704
16705 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16706 symbol, change it to have default visibility.
16707 * testsuite/protected_1.cc: New file.
16708 * testsuite/protected_2.cc: New file.
16709 * testsuite/protected_3.cc: New file.
16710 * testsuite/protected_main_1.cc: New file.
16711 * testsuite/protected_main_2.cc: New file.
16712 * testsuite/protected_main_3.cc: New file.
16713 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16714 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16715 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16716 (protected_1.so): New target.
16717 (protected_1_pic.o, protected_2_pic.o): New targets.
16718 (protected_3_pic.o): New target.
16719 (check_PROGRAMS): Add protected_2.
16720 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16721 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16722 * testsuite/Makefile.in: Rebuild.
16723
16724 * options.h (DEFINE_var): Add set_user_set_##varname__.
16725 (DEFINE_bool_alias): New macro.
16726 (class General_options): Define -Bstatic using DEFINE_bool_alias
16727 rather than DEFINE_special. Add --undefined as an alias for -z
16728 defs.
16729 * options.cc (General_options::parse_Bstatic): Remove.
16730
16731 * options.h (class General_options): Add --fatal-warnings.
16732 * main.cc (main): Implement --fatal-warnings.
16733 * errors.h (Errors::warning_count): New function.
16734
16735 * options.h (class General_options): Add -Bsymbolic-functions.
16736 * symtab.h (Symbol::is_preemptible): Check for
16737 -Bsymbolic-functions.
16738
16739 2008-05-05 Ian Lance Taylor <iant@google.com>
16740
16741 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16742 as noVARNAME rather than no-VARNAME.
16743 (class General_options): Add option -z combreloc.
16744 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16745 get_address.
16746 (Output_reloc::sort_before) [SHT_REL]: New function.
16747 (Output_reloc::sort_before) [SHT_RELA]: New function.
16748 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16749 Sort_relocs_comparison.
16750 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16751 parameter. Change all callers.
16752 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16753 sort_relocs parameter. Change all callers.
16754 * output.cc (Output_reloc::get_address): New function, broken out
16755 of write_rel.
16756 (Output_reloc::write_rel): Call it.
16757 (Output_reloc::compare): New function.
16758 (Output_data_reloc_base::do_write): Optionally sort relocs.
16759
16760 * configure.ac: If targ_extra_obj is set, link it in.
16761 * configure.tgt: Initialize all variables.
16762 (x86_64*): Set targ_extra_obj and targ_extra_size.
16763 * configure: Rebuild.
16764
16765 * object.cc (Sized_relobj::include_section_group): Adjust section
16766 indexes read from group data. Build vector to pass to
16767 layout_group.
16768 * layout.cc (Layout::layout_group): Add flags and shndxes
16769 parameters. Remove contents parameter. Change caller. Update
16770 explicit instantiations.
16771 * layout.h (class Layout): Update layout_group declaration.
16772 * output.cc (Output_data_group::Output_data_group): Add flags and
16773 input_shndxes parameters. Remove contents parameter. Change
16774 caller.
16775 (Output_data_group::do_write): Change input_sections_ to
16776 input_shndxes_.
16777 * output.h (class Output_data_group): Update constructor
16778 declaration. Rename input_sections_ to input_shndxes_.
16779 * testsuite/many_sections_test.cc: Add template.
16780
16781 2008-04-30 Cary Coutant <ccoutant@google.com>
16782
16783 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16784
16785 * layout.cc (Layout::include_section): Refactored check for debug
16786 info section.
16787 (Layout::add_comdat): Add new parameters. Change type
16788 of signature parameter. Add object and shndx to signatures table.
16789 (Layout::find_kept_object): New function.
16790 * layout.h: Include <cstring>.
16791 (Layout::is_debug_info_section): New function.
16792 (Layout::add_comdat): Add new parameters.
16793 (Layout::find_kept_object): New function.
16794 (Layout::Kept_section): New struct.
16795 (Layout::Signatures): Change type of map range.
16796 * object.cc (Relobj::output_section_address): New function.
16797 (Sized_relobj::include_section_group): Add new parameters. Change
16798 calls to Layout::add_comdat. Change to build table of kept comdat
16799 groups and table mapping discarded sections to kept sections.
16800 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16801 (Sized_relobj::do_layout): Change calls to include_section_group and
16802 include_linkonce_section.
16803 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16804 value to zero when section is discarded.
16805 (Sized_relobj::map_to_kept_section): New function.
16806 * object.h (Relobj::output_section_address): New function.
16807 (Relobj::Comdat_group): New type.
16808 (Relobj::find_comdat_group): New function.
16809 (Relobj::Comdat_group_table): New type.
16810 (Relobj::Kept_comdat_section): New type.
16811 (Relobj::Kept_comdat_section_table): New type.
16812 (Relobj::add_comdat_group): New function.
16813 (Relobj::set_kept_comdat_section): New function.
16814 (Relobj::get_kept_comdat_section): New function.
16815 (Relobj::comdat_groups_): New field.
16816 (Relobj::kept_comdat_sections_): New field.
16817 (Symbol_value::input_value): Update comment.
16818 (Sized_relobj::map_to_kept_section) New function.
16819 (Sized_relobj::include_linkonce_section): Add new parameter.
16820 * target-reloc.h (Comdat_behavior): New type.
16821 (get_comdat_behavior): New function.
16822 (relocate_section): Add code to map a discarded section to the
16823 corresponding kept section when applying a relocation.
16824
16825 2008-04-30 Craig Silverstein <csilvers@google.com>
16826
16827 * dwarf_reader.cc (next_generation_count): New static var.
16828 (Addr2line_cache_entry): New struct.
16829 (addr2line_cache): New static var.
16830 (Dwarf_line_info::one_addr2line): Added caching.
16831 (Dwarf_line_info::clear_addr2line_cache): New function.
16832 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16833 cache-size parameter.
16834 (Dwarf_line_info::one_addr2line_cache): New function.
16835 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16836 new cache-size argument to one_addr2line(), and clear cache.
16837
16838 2008-04-28 Cary Coutant <ccoutant@google.com>
16839
16840 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16841 R_386_PC8 relocations.
16842
16843 2008-04-23 Ian Lance Taylor <iant@google.com>
16844
16845 * object.cc (Sized_relobj::include_section_group): Check for
16846 invalid section group.
16847
16848 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16849 header size.
16850
16851 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16852 than read for file header.
16853 * archive.cc (Archive::include_member): Likewise.
16854
16855 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16856
16857 * aclocal.m4: Regenerate.
16858 * configure: Regenerate.
16859
16860 2008-04-19 Ian Lance Taylor <iant@google.com>
16861
16862 * version.cc (version_string): Bump to 1.6.
16863
16864 * testsuite/Makefile.am (many_sections_r_test): New target.
16865 (many_sections_r_test_SOURCES): Remove.
16866 (many_sections_r_test_DEPENDENCIES): Remove.
16867 (many_sections_r_test_LDFLAGS): Remove.
16868 (many_sections_r_test_LDADD): Remove.
16869
16870 * object.cc (Sized_relobj::do_add_symbols): Always pass
16871 local_symbol_count_ to add_from_relobj.
16872
16873 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16874 every thousand variables.
16875 * testsuite/Makefile.in: Rebuild.
16876
16877 * object.cc (Xindex::initialize_symtab_xindex): New function.
16878 (Xindex::read_symtab_xindex): New function.
16879 (Xindex::sym_xindex_to_shndx): New function.
16880 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16881 available.
16882 (Sized_relobj::do_initialize_xindex): New function.
16883 (Sized_relobj::do_read_symbols): Adjust section links.
16884 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16885 parameter. Change all callers.
16886 (Sized_relobj::include_section_group): Adjust section links and
16887 symbol section indexes.
16888 (Sized_relobj::do_layout): Adjust section links.
16889 (Sized_relobj::do_count_local_symbols): Adjust section links and
16890 symbol section indexes.
16891 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16892 ordinary and special symbols.
16893 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16894 dynsym_xindex parameters. Change all callers. Adjust section
16895 links. Use SHN_XINDEX when needed.
16896 (Sized_relobj::get_symbol_location_info): Adjust section links.
16897 Don't get fooled by special symbols.
16898 * object.h (class Xindex): Define.
16899 (class Object): Add xindex_ parameter. Declare virtual functoin
16900 do_initialize_xindex.
16901 (Object::adjust_sym_shndx): New function.
16902 (Object::set_xindex): New protected function.
16903 (class Symbol_value): Add is_ordinary_shndx_ field.
16904 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16905 (Symbol_value::value): Assert ordinary section.
16906 (Symbol_value::initialize_input_to_output_map): Likewise.
16907 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16908 Change all callers.
16909 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16910 all callers.
16911 (class Sized_relobj): Update declarations.
16912 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16913 parameter. Change all callers.
16914 (Sized_relobj::adjust_shndx): New function.
16915 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16916 field.
16917 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16918 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16919 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16920 (Sized_dynobj::read_dynsym_section): Adjust section links.
16921 (Sized_dynobj::read_dynamic): Likewise.
16922 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16923 section links.
16924 (Sized_dynobj::do_initialize_xindex): New function.
16925 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16926 do_initialize_xindex.
16927 (Sized_dynobj::adjust_shndx): New function.
16928 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16929 dynsym_xindex_ fields.
16930 (Layout::finalize): Add a call to set_section_indexes before
16931 creating the symtab sections.
16932 (Layout::set_section_indexes): Don't do anything if the section
16933 already has a section index.
16934 (Layout::create_symtab_sections): Add shnum parameter. Change
16935 caller. Create .symtab_shndx section if needed.
16936 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16937 caller.
16938 (Layout::allocated_output_section_count): New function.
16939 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16940 needed.
16941 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16942 fields. Update declarations.
16943 (Layout::symtab_xindex): New function.
16944 (Layout::dynsym_xindex): New function.
16945 (class Write_symbols_task): Add layout_ field.
16946 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16947 Change caller.
16948 * output.cc (Output_section_headers::Output_section_headers): Add
16949 shstrtab_section parameter. Change all callers.
16950 (Output_section_headers::do_sized_write): Store overflow values
16951 for section count and section string table section index in
16952 section header zero.
16953 (Output_file_header::do_sized_write): Check for overflow of
16954 section count and section string table section index.
16955 (Output_symtab_xindex::do_write): New function.
16956 (Output_symtab_xindex::endian_do_write): New function.
16957 * output.h (class Output_section_headers): Add shstrtab_section_.
16958 Update declarations.
16959 (class Output_symtab_xindex): Define.
16960 (Output_section::has_out_shndx): New function.
16961 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16962 field.
16963 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16964 Change all callers.
16965 (Sized_symbol::init): Likewise.
16966 (Symbol::output_section): Check for ordinary symbol.
16967 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16968 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16969 callers.
16970 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16971 Change all callers. Simplify handling of symbols from sections
16972 not included in the link.
16973 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16974 distinction.
16975 (Weak_alias_sorter::operator()): Assert that symbols are
16976 ordinary.
16977 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16978 distinction.
16979 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16980 parameters. Change all callers.
16981 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16982 symbol distinction. Use SHN_XINDEX when needed.
16983 (Symbol_table::write_section_symbol): Add symtab_xindex
16984 parameter. Change all callers.
16985 (Symbol_table::sized_write_section_symbol): Likewise. Use
16986 SHN_XINDEX when needed.
16987 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16988 declarations.
16989 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16990 (Symbol::is_defined): Check is_ordinary.
16991 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16992 (Symbol::is_absolute, Symbol::is_common): Likewise.
16993 (class Sized_symbol): Update declarations.
16994 (class Symbol_table): Update declarations.
16995 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16996 parameters. Change all callers.
16997 (Sized_symbol::override): Likewise.
16998 (Symbol_table::override): Likewise.
16999 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17000 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17001 is_ordinary, and orig_st_shndx parameters. Change all callers.
17002 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17003 to be in an ordinary section.
17004 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17005 object and is_ordinary parameters. Change all callers.
17006 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17007 Change all callers. Don't add undefined or non-ordinary symbols
17008 to reloc_map_.
17009 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17010 Change all callers.
17011 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17012 declarations.
17013 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17014 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17015 (Sized_relobj::relocate_sections): Likewise.
17016 * target-reloc.h (scan_relocs): Adjust section symbol index.
17017 (scan_relocatable_relocs): Likewise.
17018 * i386.cc (Scan::local): Check for ordinary symbols.
17019 * sparc.cc (Scan::local): Likewise.
17020 * x86_64.cc (Scan::local): Likewise.
17021 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17022 to symbol_section_and_value.
17023 * testsuite/many_sections_test.cc: New file.
17024 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17025 (check_PROGRAMS): Add many_sections_test.
17026 (many_sections_test_SOURCES): Define.
17027 (many_sections_test_DEPENDENCIES): Define.
17028 (many_sections_test_LDFLAGS): Define.
17029 (BUILT_SOURCES): Add many_sections_define.h.
17030 (many_sections_define.h): New target.
17031 (BUILT_SOURCES): Add many_sections_check.h.
17032 (many_sections_check.h): New target.
17033 (check_PROGRAMS): Add many_sections_r_test.
17034 (many_sections_r_test_SOURCES): Define.
17035 (many_sections_r_test_DEPENDENCIES): Define.
17036 (many_sections_r_test_LDFLAGS): Define.
17037 (many_sections_r_test_LDADD): Define.
17038 (many_sections_r_test.o): New target.
17039 * testsuite/Makefile.in: Rebuild.
17040
17041 2008-04-17 Cary Coutant <ccoutant@google.com>
17042
17043 * errors.cc (Errors::info): New function.
17044 (gold_info): New function.
17045 * errors.h (Errors::info): New function.
17046 * gold.h (gold_info): New function.
17047 * object.cc (Input_objects::add_object): Print trace output.
17048 * options.cc (options::parse_set): New function.
17049 (General_options::parse_wrap): Deleted.
17050 (General_options::General_options): Deleted initializer.
17051 * options.h (options::String_set): New typedef.
17052 (options::parse_set): New function.
17053 (DEFINE_set): New macro.
17054 (General_options::wrap): Changed to use DEFINE_set. Changed
17055 callers of any_wrap_symbols and is_wrap_symbol.
17056 (General_options::trace, General_options::trace_symbol):
17057 New options.
17058 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17059 (General_options::wrap_symbols_): Deleted.
17060 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17061
17062 2008-04-17 David S. Miller <davem@davemloft.net>
17063
17064 * options.cc (General_options::parse_V): New function.
17065 * options.h: Add entries for -V and -Qy.
17066
17067 2008-04-17 Ian Lance Taylor <iant@google.com>
17068
17069 * common.cc (Symbol_table::allocate_commons): Remove options
17070 parameter. Change caller.
17071 (Symbol_table::do_allocate_commons): Remove options parameter.
17072 Change caller. Just call do_allocate_commons_list twice.
17073 (Symbol_table::do_allocate_commons_list): New function, broken out
17074 of do_allocate_commons.
17075 * common.h (class Allocate_commons_task): Remove options_ field.
17076 Update constructor.
17077 * symtab.cc (Symbol_table::Symbol_table): Initialize
17078 tls_commons_.
17079 (Symbol_table::add_from_object): Put TLS common symbols on
17080 tls_commons_ list.
17081 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17082 which are IN_OUTPUT_DATA.
17083 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17084 allocate_commons and do_allocate_commons declarations. Declare
17085 do_allocate_commons_list.
17086 * gold.cc (queue_middle_tasks): Update creation of
17087 Allocate_commons_task to not pass options.
17088 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17089 (TLS_TEST_C_FLAGS): New variable.
17090 (tls_test_c_pic.o): New target.
17091 (tls_test_shared.so): Link in tls_test_c_pic.o.
17092 (tls_test_c_pic_ie.o): New target.
17093 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17094 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17095 (tls_test_c.o): New target.
17096 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17097 (tls_pic_test_LDADD): Likewise.
17098 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17099 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17100 (tls_test_c_gnu2.o): New target.
17101 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17102 tls_test_c_gnu2.o.
17103 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17104 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17105 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17106 * testsuite/tls_test.cc: Include "config.h".
17107 (t_last): Call t11_last.
17108 * testsuite/tls_test.h (t11, t11_last): Declare.
17109 * testsuite/tls_test_c.c: New file.
17110 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17111 * configure.ac: Check for OpenMP support.
17112 * configure, config.in, Makefile.in: Rebuild.
17113 * testsuite/Makefile.in: Rebuild.
17114
17115 2008-04-16 Cary Coutant <ccoutant@google.com>
17116
17117 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17118 (Target_i386::tls_base_symbol_defined_): New field.
17119 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17120 (Target_i386::Scan::global): Likewise.
17121 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17122 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17123 (Target_x86_64::tls_base_symbol_defined_): New field.
17124 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17125 (Target_x86_64::Scan::global): Likewise.
17126
17127 2008-04-16 Cary Coutant <ccoutant@google.com>
17128
17129 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17130 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17131 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17132 building shared libraries.
17133 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17134 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17135 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17136 * testsuite/Makefile.in: Rebuild.
17137 * testsuite/weak_undef.h: New file.
17138 * testsuite/weak_undef_file1.cc: Add extra test cases.
17139 * testsuite/weak_undef_file2.cc: Likewise.
17140 * testsuite/weak_undef_test.cc: Likewise.
17141
17142 2008-04-16 David S. Miller <davem@davemloft.net>
17143
17144 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17145 Add issued_non_pic_error_ field. Declare check_non_pic.
17146 (Target_sparc::Scan::check_non_pic): New function.
17147 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17148 (Target_sparc::Scan::global): Likewise.
17149
17150 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17151 * configure: Rebuild.
17152
17153 * options.h (DEFINE_enable): New macro.
17154 (new_dtags): New enable option.
17155 (initfirst, interpose, loadfltr, nodefaultlib,
17156 nodelete, nodlopen, nodump): New -z options.
17157 * layout.cc (Layout:finish_dynamic_section): If new
17158 dtags enabled, emit DT_RUNPATH. Also, emit a
17159 DT_FLAGS_1 containing any specified -z flags.
17160
17161 2008-04-16 Ian Lance Taylor <iant@google.com>
17162
17163 * copy-relocs.cc: New file.
17164 * copy-relocs.h: New file.
17165 * reloc.cc: Remove Copy_relocs code.
17166 * reloc.h: Likewise.
17167 * reloc-types.h (struct Reloc_types) [both versions]: Add
17168 get_reloc_addend_noerror.
17169 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17170 variants of add_global which take an addend which must be zero.
17171 * i386.cc: Include "copy-relocs.h".
17172 (class Target_i386): Change type of copy_relocs_ to variable,
17173 update initializer.
17174 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17175 Change all callers.
17176 (Target_i386::do_finalize_sections): Change handling of
17177 copy_relocs_.
17178 * sparc.cc: Include "copy-relocs.h".
17179 (class Target_sparc): Change type of copy_relocs_ to variable,
17180 update initializer.
17181 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17182 Change all callers.
17183 (Target_sparc::do_finalize_sections): Change handling of
17184 copy_relocs_.
17185 * x86_64.cc: Include "copy-relocs.h".
17186 (class Target_x86_64): Change type of copy_relocs_ to variable,
17187 update initializer.
17188 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17189 class. Change all callers.
17190 (Target_x86_64::do_finalize_sections): Change handling of
17191 copy_relocs_.
17192 * Makefile.am (CCFILES): Add copy-relocs.cc.
17193 (HFILES): Add copy-relocs.h.
17194
17195 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17196
17197 * testsuite/script_test_4.sh: Permit leading zeroes.
17198
17199 2008-04-15 Ian Lance Taylor <iant@google.com>
17200
17201 * script-sections.cc (Script_sections::create_segments): Use
17202 header_size_adjustment even when there is enough room for the
17203 headers.
17204 * testsuite/script_test_4.sh: New file.
17205 * testsuite/script_test_4.t: New file.
17206 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17207 (check_DATA): Add script_test_4.stdout.
17208 (MOSTLYCLEANFILES): Likewise.
17209 (script_test_4): New target.
17210 (script_test_4.stdout): New target.
17211 * testsuite/Makefile.in: Rebuild.
17212
17213 * sparc.cc: Add definitions for Output_data_plt_sparc class
17214 constants.
17215
17216 2008-04-14 David S. Miller <davem@davemloft.net>
17217
17218 * sparc.cc: New file.
17219 * Makefile.am (TARGETSOURCES): Add sparc.cc
17220 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17221 * configure.tgt: Document targ_extra_size and
17222 targ_extra_big_endian. Add entries for sparc-* and
17223 sparc64-*.
17224 * configure.ac: Handle targ_extra_size and
17225 targ_extra_big_endian.
17226 * Makefile.in: Rebuild.
17227 * configure: Likewise.
17228 * po/POTFILES.in: Likewise.
17229 * po/gold.pot: Likewise.
17230
17231 2008-04-14 Ian Lance Taylor <iant@google.com>
17232
17233 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17234 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17235 in the name/type/flags to section mapping. Don't call
17236 allocate_output_section.
17237 (Layout::choose_output_section): Change parameter from adjust_name
17238 to is_input_section. Don't permit input sections after sections
17239 are attached to segments. Don't call allocate_output_section.
17240 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17241 not write_enable_output_section.
17242 (Layout::make_output_section): Don't push to
17243 unattached_section_list_ nor call attach_to_segment. Call
17244 attach_section_to_segment if sections are attached.
17245 (Layout::attach_sections_to_segments): New function.
17246 (Layout::attach_section_to_segment): New function.
17247 (Layout::attach_allocated_section_to_segment): Rename from
17248 attach_to_segment. Remove flags parameter.
17249 (Layout::allocate_output_section): Remove function.
17250 (Layout::write_enable_output_section): Remove function.
17251 * layout.h (class Layout): Update for above changes. Add new
17252 field sections_are_attached_.
17253 * output.h (Output_section::update_flags_for_input_section): New
17254 function.
17255 * output.cc (Output_section::add_input_section): Call
17256 update_flags_for_input_section.
17257 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17258
17259 2008-04-11 Cary Coutant <ccoutant@google.com>
17260
17261 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17262 thought unnecessary.
17263 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17264
17265 2008-04-11 Ian Lance Taylor <iant@google.com>
17266
17267 * output.h (class Output_section_data): Remove inline definition
17268 of set_addralign.
17269 * output.cc (Output_section_data::set_addralign): New function.
17270
17271 2008-04-11 Cary Coutant <ccoutant@google.com>
17272
17273 Add support for TLS descriptors for i386 and x86_64.
17274 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17275 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17276 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17277 GOT_TYPE_TLS_DESC.
17278 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17279 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17280 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17281 relocations.
17282 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17283 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17284 Fix problem with initial-exec relocations.
17285 (Target_i386::Relocate::relocate_tls): Likewise.
17286 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17287 relaxation.
17288 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17289 support for section-plus-offset dynamic table entries.
17290 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17291 (Output_data_dynamic::Dynamic_entry): Add support for
17292 section-plus-offset dynamic table entries.
17293 (Output_data_dynamic::Classification): Likewise.
17294 (Output_data_dynamic::classification_): Renamed offset_.
17295 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17296 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17297 (Target_x86_64::make_plt_section): New function.
17298 (Target_x86_64::reserve_tlsdesc_entries): New function.
17299 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17300 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17301 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17302 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17303 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17304 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17305 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17306 add extra PLT entry for TLS descriptors.
17307 (Output_data_plt_x86_64::got_): New field.
17308 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17309 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17310 fields.
17311 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17312 descriptors.
17313 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17314 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17315 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17316 R_386_TLS_DESC_CALL relocations.
17317 (Target_x86_64::Scan::global): Likewise.
17318 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17319 for TLS descriptors.
17320 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17321 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17322 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17323 GD-to-IE relaxation.
17324 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17325 and TLS_DESCRIPTORS.
17326 * Makefile.in: Rebuild.
17327 * configure: Rebuild.
17328 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17329 (tls_test_shared2.so): New target.
17330 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17331 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17332 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17333 (tls_shared_gd_to_ie_test_LDADD): New variable.
17334 (tls_shared_gnu2_gd_to_ie_test): New target.
17335 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17336 New targets.
17337 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17338 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17339 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17340 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17341 (tls_shared_gnu2_test): New target.
17342 (tls_test_gnu2_shared.so): New target.
17343 (tls_shared_gnu2_test_SOURCES): New variable.
17344 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17345 (tls_shared_gnu2_test_LDFLAGS): New variable.
17346 (tls_shared_gnu2_test_LDADD): New variable.
17347 * testsuite/Makefile.in: Rebuild.
17348 * testsuite/Makefile.
17349
17350 2008-04-11 Ian Lance Taylor <iant@google.com>
17351
17352 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17353 justsyms.t.
17354 * testsuite/Makefile.in: Rebuild.
17355
17356 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17357 long.
17358 * testsuite/script_test_2.cc (main): Adjust test.
17359
17360 2008-04-11 David S. Miller <davem@davemloft.net>
17361 Ian Lance Taylor <iant@google.com>
17362
17363 * options.h (General_options): Add entries for '-Y' and
17364 '-relax'.
17365 * options.cc (General_options:finalize): If -Y was used, add those
17366 entries to the library path instead of the default "/lib" and
17367 "/usr/lib".
17368
17369 2008-04-11 David S. Miller <davem@davemloft.net>
17370
17371 * testsuite/justsyms.t: Start at 0x100.
17372 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17373 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17374 long.
17375 * testsuite/script_test_2.cc: Adjust string and section length
17376 checks.
17377
17378 2008-04-09 Ian Lance Taylor <iant@google.com>
17379
17380 PR gold/5996
17381 * script-sections.cc (Sections_element::allocate_to_segment): Add
17382 orphan parameter.
17383 (Output_section_definition::allocate_to_segment): Likewise.
17384 (Orphan_output_section::allocate_to_segment): Likewise.
17385 (Script_sections::attach_sections_using_phdrs_clause): Don't
17386 propagate non-PT_LOAD segments to orphan sections.
17387 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17388 readelf rather than objdump.
17389 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17390 .interp section and PT_INTERP segment are the same size.
17391 * testsuite/Makefile.in: Rebuild.
17392
17393 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17394 aliases for symbols defined in the same object.
17395 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17396 (weak_alias_test_SOURCES): New variable.
17397 (weak_alias_test_DEPENDENCIES): New variable.
17398 (weak_alias_test_LDFLAGS): New variable.
17399 (weak_alias_test_LDADD): New variable.
17400 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17401 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17402 (weak_alias_test_3.o): New target.
17403 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17404 * testsuite/weak_alias_test_main.cc: New file.
17405 * testsuite/weak_alias_test_1.cc: New file.
17406 * testsuite/weak_alias_test_2.cc: New file.
17407 * testsuite/weak_alias_test_3.cc: New file.
17408
17409 2008-04-08 Ian Lance Taylor <iant@google.com>
17410
17411 * options.h (class General_options): Add --noinhibit-exec option.
17412 * main.cc (main): Check --noinhibit-exec.
17413
17414 * options.h (class General_options): Define --wrap as a special
17415 option. Add wrap_symbols_ field.
17416 (General_options::any_wrap_symbols): New function.
17417 (General_options::is_wrap_symbol): New function.
17418 * options.cc (General_options::parse_wrap): New function.
17419 (General_options::General_options): Initialize wrap_symbols_.
17420 * symtab.cc (Symbol_table::wrap_symbol): New function.
17421 (Symbol_table::add_from_object): Handle --wrap.
17422 * symtab.h (class Symbol_table): Declare wrap_symbol.
17423 * target.h (Target::wrap_char): New function.
17424 (Target::Target_info): Add wrap_char field.
17425 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17426 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17427 * testsuite/testfile.cc (Target_test::test_target_info):
17428 Likewise.
17429
17430 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17431 there is one.
17432
17433 * layout.h (class Layout): Add added_eh_frame_data_ field.
17434 * layout.cc (Layout::Layout): Initialize new field.
17435 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17436 output section until we find a section we merged successfully.
17437 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17438 that the size be non-zero.
17439
17440 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17441 qualifier.
17442
17443 2008-04-08 Craig Silverstein <csilvers@google.com>
17444
17445 * configure.ac: Export new conditional variable HAVE_ZLIB.
17446 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17447 on HAVE_ZLIB.
17448 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17449 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17450
17451 2008-04-07 Ian Lance Taylor <iant@google.com>
17452
17453 * version.cc (version_string): Set to "1.5".
17454
17455 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17456 Add issued_non_pic_error_ field. Declare check_non_pic.
17457 (Target_x86_64::Scan::check_non_pic): New function.
17458 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17459 (Target_x86_64::Scan::global): Likewise.
17460
17461 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17462 addend parameter. Change caller. Handle merge sections.
17463 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17464 Address to Addend. Don't add in the result of
17465 local_section_offset, pass down the addend and use the returned
17466 value.
17467 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17468 Update declarations of local_section_offset and symbol_value.
17469 * testsuite/two_file_test_1.cc (t18): New function.
17470 * testsuite/two_file_test_2.cc (f18): New function.
17471 * testsuite/two_file_test_main.cc (main): Call t18.
17472 * testsuite/two_file_test.h (t18, f18): Declare.
17473
17474 * configure.ac: Don't test for objdump, c++filt, or readelf.
17475 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17476 conditionals.
17477 (TEST_READELF): New variable.
17478 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17479 (check_PROGRAMS): Add two_file_strip_test.
17480 (two_file_strip_test): New target.
17481 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17482 (two_file_same_shared_strip_test_SOURCES): New variable.
17483 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17484 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17485 (two_file_same_shared_strip_test_LDADD): New variable.
17486 (two_file_shared_strip.so): New target.
17487 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17488 (ver_test_5.syms, ver_test_7.syms): Likewise.
17489 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17490 (strip_test_3.stdout): Use TEST_OBJDUMP.
17491 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17492
17493 2008-04-04 Cary Coutant <ccoutant@google.com>
17494
17495 * symtab.h (Symbol::is_weak_undefined): New function.
17496 (Symbol::is_strong_undefined): New function.
17497 (Symbol::is_absolute): New function.
17498 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17499 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17500 absolute symbols.
17501 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17502 (weak_undef_test): New target.
17503 * testsuite/Makefile.in: Rebuild.
17504 * testsuite/weak_undef_file1.cc: New file.
17505 * testsuite/weak_undef_file2.cc: New file.
17506 * testsuite/weak_undef_test.cc: New file.
17507
17508 2008-04-03 Craig Silverstein <csilvers@google.com>
17509
17510 * compressed_output.h (class Output_compressed_section): Use
17511 unsigned buffer.
17512 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17513 add zlib header.
17514 (zlib_compressed_suffix): Removed.
17515 (Output_compressed_section::set_final_data_size): Use unsigned
17516 buffers.
17517 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17518 Fix linker invocation.
17519 (flagstest_o_specialfile_and_compress_debug_sections):
17520 Likewise.
17521 * testsuite/Makefile.in: Regenerated.
17522
17523 2008-04-02 David S. Miller <davem@davemloft.net>
17524
17525 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17526 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17527
17528 2008-04-02 Craig Silverstein <csilvers@google.com>
17529
17530 * TODO: New file.
17531
17532 2008-04-02 Ian Lance Taylor <iant@google.com>
17533
17534 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17535 parameters. Update for new key type to views_. Change all
17536 callers.
17537 (File_read::read): Adjust for byteshift in returned view.
17538 (File_read::add_view): New function, broken out of
17539 find_and_make_view.
17540 (File_read::make_view): New function, broken out of
17541 find_and_make_view.
17542 (File_read::find_or_make_view): Add offset and aligned
17543 parameters. Rewrite accordingly. Change all callers.
17544 (File_read::get_view): Add offset and aligned parameters. Adjust
17545 for byteshift in return value.
17546 (File_read::get_lasting_view): Likewise.
17547 * fileread.h (class File_read): Update declarations.
17548 (class File_read::View): Add byteshift_ field. Add byteshift to
17549 constructor. Add byteshift method.
17550 * archive.h (Archive::clear_uncached_views): New function.
17551 (Archive::get_view): Add aligned parameter. Change all callers.
17552 * object.h (Object::get_view): Add aligned parameter. Change all
17553 callers.
17554 (Object::get_lasting_view): Likewise.
17555
17556 * fileread.cc (File_read::release): Don't call clear_views if
17557 there are multiple objects.
17558 * fileread.h (File_read::clear_uncached_views): New function.
17559 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17560 on the archive.
17561
17562 2008-03-31 Cary Coutant <ccoutant@google.com>
17563
17564 Add thin archive support.
17565 * archive.cc (Archive::armagt): New const.
17566 (Archive::setup): Remove task parameter and calls to unlock.
17567 (Archive::unlock_nested_archives): New function.
17568 (Archive::read_header): Add nested_off parameter. Change
17569 all callers.
17570 (Archive::interpret_header): Likewise.
17571 (Archive::include_all_members): Change to handle thin
17572 archives.
17573 (Archive::include_member): Likewise.
17574 * archive.h (Archive::Archive): Add new parameters and
17575 initializers.
17576 (Archive::armagt): New const.
17577 (Archive::setup): Remove task parameter.
17578 (Archive::unlock_nested_archives): New function.
17579 (Archive::read_header): Add nested_off parameter.
17580 (Archive::interpret_header): Likewise.
17581 (Archive::Nested_archive_table): New typedef.
17582 (Archive::is_thin_archive_): New field.
17583 (Archive::nested_archives_): New field.
17584 (Archive::options_): New field.
17585 (Archive::dirpath_): New field.
17586 (Archive::task_): New field.
17587 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17588 for thin archives. Pass additional parameters to
17589 Archive::Archive. Unlock the archive file after calling
17590 Archive::setup.
17591
17592 2008-03-29 Ian Lance Taylor <iant@google.com>
17593
17594 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17595 version symbol to be local.
17596 * testsuite/ver_test_4.sh: New file.
17597 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17598 (check_DATA): Add ver_test_4.syms.
17599 (ver_test_4.syms): New target.
17600 * testsuite/Makefile.in: Rebuild.
17601
17602 * output.cc
17603 (Output_section::Input_section_sort_entry::has_priority): New
17604 function.
17605 (Output_section::Input_section_sort_entry::match_file_name): New
17606 function.
17607 (Output_section::Input_section_sort_entry::match_section_name):
17608 Remove.
17609 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17610 Remove.
17611 (Output_section::Input_section_sort_entry::match_section_file):
17612 Remove.
17613 (Output_section::Input_section_sort_compare::operator()): Rewrite
17614 using new Input_section_sort_entry functions. Sort crtbegin and
17615 crtend first. Sort sections with no priority before sections with
17616 a priority.
17617 * testsuite/initpri1.c (d3): Check j != 4.
17618 (cd5): New constructor/destructor function.
17619 (main): Check j != 2.
17620
17621 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17622 new symbol when resolving, don't call set_is_default.
17623 * testsuite/ver_test_7.cc: New file.
17624 * testsuite/ver_test_7.sh: New file.
17625 * testsuite/Makefile.am (ver_test_7.so): New target.
17626 (ver_test_7.o): New target.
17627 (check_SCRIPTS): Add ver_test_7.sh.
17628 (check_DATA): Add ver_test_7.syms.
17629 (ver_test_7.syms): New target.
17630
17631 2008-03-28 Ian Lance Taylor <iant@google.com>
17632
17633 * layout.cc (Layout::layout): If we see an input section with a
17634 name that needs sorting, set the must_sort flag for the output
17635 section.
17636 (Layout::make_output_section): If the name of the output section
17637 indicates that it might require sorting, set the may_sort flag.
17638 * output.h (Output_section::may_sort_attached_input_sections): New
17639 function.
17640 (Output_section::set_may_sort_attached_input_sections): New
17641 function.
17642 (Output_section::must_sort_attached_input_sections): New
17643 function.
17644 (Output_section::set_must_sort_attached_input_sections): New
17645 function.
17646 (class Output_section): Declare Input_section_sort_entry. Define
17647 Input_section_sort_compare. Declare
17648 sort_attached_input_sections. Add new fields:
17649 may_sort_attached_input_sections_,
17650 must_sort_attached_input_sections_,
17651 attached_input_sections_are_sorted_.
17652 * output.cc (Output_section::Output_section): Initialize new
17653 fields.
17654 (Output_section::add_input_section): Add an entry to
17655 input_sections_ if may_sort or must_sort are true.
17656 (Output_section::set_final_data_size): Call
17657 sort_attached_input_sections if necessary.
17658 (Output_section::Input_section_sort_entry): Define new class.
17659 (Output_section::Input_section_sort_compare::operator()): New
17660 function.
17661 (Output_section::sort_attached_input_sections): New function.
17662 * configure.ac: Check whether the compiler supports constructor
17663 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17664 * testsuite/initpri1.c: New file.
17665 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17666 CONSTRUCTOR_PRIORITY.
17667 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17668 (initpri1_LDFLAGS): New variable.
17669 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17670
17671 2008-03-27 Ian Lance Taylor <iant@google.com>
17672
17673 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17674 * testsuite/common_test_1.c: New file.
17675 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17676 (common_test_1_SOURCES): New variable.
17677 (common_test_1_DEPENDENCIES): New variable.
17678 (common_test_1_LDFLAGS): New variable.
17679
17680 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17681 and commons_ correctly when NAME/VERSION does not override
17682 NAME/NULL.
17683 * testsuite/ver_test_6.c: New file.
17684 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17685 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17686 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17687
17688 2008-03-26 Ian Lance Taylor <iant@google.com>
17689
17690 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17691 of an undefined symbol from a version script.
17692 * testsuite/Makefile.am (ver_test_5.so): New target.
17693 (ver_test_5.o): New target.
17694 (check_SCRIPTS): Add ver_test_5.sh.
17695 (check_DATA): Add ver_test_5.syms.
17696 (ver_test_5.syms): New target.
17697 * testsuite/ver_test_5.cc: New file.
17698 * testsuite/ver_test_5.script: New file.
17699 * testsuite/ver_test_5.sh: New file.
17700 * Makefile.in, testsuite/Makefile.in: Rebuild.
17701
17702 PR gold/5986
17703 Fix problems building gold with gcc 4.3.0.
17704 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17705 (gold_error_at_location, gold_warning_at_location): Use it.
17706 * configure.ac: Check whether we can compile and use a template
17707 function with a printf attribute.
17708 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17709 when jumping over bytes.
17710 * object.cc: Instantiate Object::read_section_data.
17711 * debug.h: Include <cstring>
17712 * dwarf_reader.cc: Include <algorithm>
17713 * main.cc: Include <cstring>.
17714 * options.cc: Include <cstring>.
17715 * output.cc: Include <cstring>.
17716 * script.cc: Include <cstring>.
17717 * script.h: Include <string>.
17718 * symtab.cc: Include <cstring> and <algorithm>.
17719 * target-select.cc: Include <cstring>.
17720 * version.cc: Include <string>.
17721 * testsuite/testmain.cc: Include <cstdlib>.
17722 * configure, config.in: Rebuild.
17723
17724 2008-03-25 Ian Lance Taylor <iant@google.com>
17725
17726 * options.cc: Include "../bfd/bfdver.h".
17727 (options::help): Print bug reporting address.
17728
17729 * version.cc (print_version): Adjust output for current value of
17730 BFD_VERSION_STRING.
17731
17732 * NEWS: New file.
17733
17734 * options.cc (options::help): Print list of supported targets.
17735 * target-select.h: Include <vector>.
17736 (class Target_selector): Make machine_, size_, and is_big_endian_
17737 fields const. Add bfd_name_ and instantiated_target_ fields.
17738 (Target_selector::Target_selector): Add bfd_name parameter.
17739 (Target_selector::recognize): Make non-virtual, call
17740 do_recognize.
17741 (Target_selector::recognize_by_name): Make non-virtual, call
17742 do_recognize_by_name.
17743 (Target_selector::supported_names): New function.
17744 (Target_selector::bfd_name): New function.
17745 (Target_selector::do_instantiate_target): New pure virtual
17746 function.
17747 (Target_selector::do_recognize): New virtual function.
17748 (Target_selector::do_recognize_by_name): New virtual function.
17749 (Target_selector::instantiate_target): New private function.
17750 (supported_target_names): Declare.
17751 * target-select.cc (Target_selector::Target_selector): Update for
17752 new parameter and fields.
17753 (select_target_by_name): Check that the name matches before
17754 calling recognize_by_name.
17755 (supported_target_names): New function.
17756 * i386.cc (class Target_selector_i386): Update Target_selector
17757 constructor call. Remove recognize and recognize_by_name. Add
17758 do_instantiate_target.
17759 * x86_64.cc (class Target_selector_x86_64): Likewise.
17760 * testsuite/testfile.cc (class Target_selector_test): Update for
17761 changes to Target_selector.
17762
17763 * README: Rewrite, with some notes on unsupported features.
17764
17765 2008-03-24 Cary Coutant <ccoutant@google.com>
17766
17767 * i386.cc (Target_i386::Got_type): New enum declaration.
17768 (Target_i386::Scan::local): Updated callers of Output_data_got
17769 member functions.
17770 (Target_i386::Scan::global): Likewise.
17771 (Target_i386::Relocate::relocate): Likewise.
17772 (Target_i386::Relocate::relocate_tls): Likewise.
17773 * object.h (Got_offset_list): New class.
17774 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17775 (Sized_relobj::local_got_offset): Likewise.
17776 (Sized_relobj::set_local_got_offset): Likewise.
17777 (Sized_relobj::local_has_tls_got_offset): Removed.
17778 (Sized_relobj::local_tls_got_offset): Removed.
17779 (Sized_relobj::set_local_tls_got_offset): Removed.
17780 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17781 * output.cc (Output_data_got::add_global): Added got_type parameter.
17782 (Output_data_got::add_global_with_rel): Likewise.
17783 (Output_data_got::add_global_with_rela): Likewise.
17784 (Output_data_got::add_global_pair_with_rel): New function.
17785 (Output_data_got::add_global_pair_with_rela): New function.
17786 (Output_data_got::add_local): Added got_type parameter.
17787 (Output_data_got::add_local_with_rel): Likewise.
17788 (Output_data_got::add_local_with_rela): Likewise.
17789 (Output_data_got::add_local_pair_with_rel): New function.
17790 (Output_data_got::add_local_pair_with_rela): New function.
17791 (Output_data_got::add_global_tls): Removed.
17792 (Output_data_got::add_global_tls_with_rel): Removed.
17793 (Output_data_got::add_global_tls_with_rela): Removed.
17794 (Output_data_got::add_local_tls): Removed.
17795 (Output_data_got::add_local_tls_with_rel): Removed.
17796 (Output_data_got::add_local_tls_with_rela): Removed.
17797 * output.h (Output_data_got::add_global): Added got_type parameter.
17798 (Output_data_got::add_global_with_rel): Likewise.
17799 (Output_data_got::add_global_with_rela): Likewise.
17800 (Output_data_got::add_global_pair_with_rel): New function.
17801 (Output_data_got::add_global_pair_with_rela): New function.
17802 (Output_data_got::add_local): Added got_type parameter.
17803 (Output_data_got::add_local_with_rel): Likewise.
17804 (Output_data_got::add_local_with_rela): Likewise.
17805 (Output_data_got::add_local_pair_with_rel): New function.
17806 (Output_data_got::add_local_pair_with_rela): New function.
17807 (Output_data_got::add_global_tls): Removed.
17808 (Output_data_got::add_global_tls_with_rel): Removed.
17809 (Output_data_got::add_global_tls_with_rela): Removed.
17810 (Output_data_got::add_local_tls): Removed.
17811 (Output_data_got::add_local_tls_with_rel): Removed.
17812 (Output_data_got::add_local_tls_with_rela): Removed.
17813 * resolve.cc (Symbol::override_base_with_special): Removed
17814 reference to has_got_offset_ field.
17815 * symtab.cc (Symbol::init_fields): Replaced initialization
17816 of got_offset_ with got_offsets_. Removed initialization
17817 of has_got_offset_
17818 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17819 (Symbol::got_offset): Likewise.
17820 (Symbol::set_got_offset): Likewise.
17821 (Symbol::has_tls_got_offset): Removed.
17822 (Symbol::tls_got_offset): Removed.
17823 (Symbol::set_tls_got_offset): Removed.
17824 (Symbol::got_offset_): Removed.
17825 (Symbol::tls_mod_got_offset_): Removed.
17826 (Symbol::tls_pair_got_offset_): Removed.
17827 (Symbol::got_offsets_): New field.
17828 (Symbol::has_got_offset): Removed.
17829 (Symbol::has_tls_mod_got_offset): Removed.
17830 (Symbol::has_tls_pair_got_offset): Removed.
17831 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17832 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17833 member functions.
17834 (Target_x86_64::Scan::global): Likewise.
17835 (Target_x86_64::Relocate::relocate): Likewise.
17836 (Target_x86_64::Relocate::relocate_tls): Likewise.
17837
17838 2008-03-25 Ben Elliston <bje@au.ibm.com>
17839
17840 * yyscript.y: Fix spelling error in comment.
17841
17842 2008-03-24 Ian Lance Taylor <iant@google.com>
17843
17844 * options.h (class General_options): Define build_id option.
17845 * layout.h (class Layout): Declare write_build_id, create_note,
17846 create_build_id. Add build_id_note_ member.
17847 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17848 "libiberty.h", "md5.h", "sha1.h".
17849 (Layout::Layout): Initialize eh_frame_data_,
17850 eh_frame_hdr_section_, and build_id_note_.
17851 (Layout::finalize): Call create_build_id.
17852 (Layout::create_note): New function, broken out of
17853 Layout::create_gold_note.
17854 (Layout::create_gold_note): Call create_note.
17855 (Layout::create_build_id): New function.
17856 (Layout::write_build_id): New function.
17857 (Close_task_runner::run): Call write_build_id.
17858
17859 * x86_64.cc: Correct license to GPLv3.
17860
17861 2008-03-23 Ian Lance Taylor <iant@google.com>
17862
17863 * options.cc: Include "demangle.h".
17864 (parse_optional_string): New function.
17865 (parse_long_option): Handle takes_optional_argument.
17866 (parse_short_option): Update dash_z initializer. Handle
17867 takes_optional_argument.
17868 (General_options::General_options): Initialize do_demangle_.
17869 (General_options::finalize): Set do_demangle_. Handle demangling
17870 style.
17871 * options.h (parse_optional_string): Declare.
17872 (struct One_option): Add optional_arg field. Update constructor.
17873 Update call constructor calls. Add takes_optional_argument
17874 function.
17875 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17876 (DEFINE_optional_string): Define.
17877 (General_options::demangle): Change from DEFINE_bool to
17878 DEFINE_optional_string.
17879 (General_options::no_demangle): New function.
17880 (General_options::do_demangle): New function.
17881 (General_options::set_do_demangle): New function.
17882 (General_options::execstack_status_): Move definition to end of
17883 class definition.
17884 (General_options::static_): Likewise.
17885 (General_options::do_demangle_): New field.
17886 * object.cc (big_endian>::get_symbol_location_info): Call
17887 Options::do_demangle, not Options::demangle.
17888 * symtab.cc (demangle): Likewise.
17889
17890 2008-03-22 Ian Lance Taylor <iant@google.com>
17891
17892 * gold.h: Include <cstddef> and <sys/types.h>
17893 * options.h: Include <cstring>.
17894
17895 2008-03-21 Ian Lance Taylor <iant@google.com>
17896
17897 * Added source code to GNU binutils.
17898 \f
17899 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17900
17901 Copying and distribution of this file, with or without modification,
17902 are permitted in any medium without royalty provided the copyright
17903 notice and this notice are preserved.
17904
17905 Local Variables:
17906 mode: change-log
17907 left-margin: 8
17908 fill-column: 74
17909 version-control: never
17910 End:
This page took 0.428522 seconds and 5 git commands to generate.