6f396bf86a6436d6522edd0ec70c42a581be6d76
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-11-19 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
4 GOT16 and TOC16 relocs to RELATIVE_REF.
5
6 2015-11-14 Cary Coutant <ccoutant@gmail.com>
7
8 PR gold/19244
9 PR gold/18548
10 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
11 local symbols only for predefined symbols.
12
13 2015-11-11 Alan Modra <amodra@gmail.com>
14 Peter Bergner <bergner@vnet.ibm.com>
15
16 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
17 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
18 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
19 (Target_powerpc::Scan::global): Likewise.
20 (Target_powerpc::Relocate::relocate): Likewise.
21
22 2015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
23
24 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
25 sections.
26
27 2015-11-09 Cary Coutant <ccoutant@gmail.com>
28 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
29
30 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
31 with type, offset, addend.
32 (Copy_relocs::save): Likewise.
33 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
34 (Copy_relocs::save): Likewise.
35 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
36 and r_addend to Copy_relocs::copy_reloc.
37 * arm.cc (Target_arm::copy_reloc): Likewise.
38 * i386.cc (Target_i386::copy_reloc): Likewise.
39 * mips.cc (Target_mips::copy_reloc): Likewise.
40 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
41 * s390.cc (Target_s390::copy_reloc): Likewise.
42 * sparc.cc (Target_sparc::copy_reloc): Likewise.
43 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
44 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
45
46 2015-11-05 Cary Coutant <ccoutant@gmail.com>
47
48 PR gold/19119
49 PR gold/19172
50 PR gold/19197
51 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
52 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
53 * options.h (General_options): Remove "obsolete" from -m.
54 * parameters.cc (set_parameters_target): Check if input target
55 is compatible with output emulation set by "-m emulation".
56
57 2015-11-05 Cary Coutant <ccoutant@gmail.com>
58
59 PR gold/19163
60 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
61 certain relocations if --no-apply-dynamic-relocs is set.
62 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
63
64 2015-11-03 Alan Modra <amodra@gmail.com>
65
66 * po/POTFILES.in: Regenerate.
67
68 2015-10-30 Nick Clifton <nickc@redhat.com>
69
70 * po/zh_CN.po: New (simplified) Chinese translation.
71
72 2015-10-29 H.J. Lu <hongjiu.lu@intel.com>
73
74 PR gold/19184
75 * incremental.cc (Got_plt_view_info): Add got_entry_size.
76 (Local_got_offset_visitor::visit): Replace got_entry_size_
77 with info_.got_entry_size.
78 (Local_got_offset_visitor::got_entry_size_): Removed.
79 (Global_got_offset_visitor::visit): Replace got_entry_size_
80 with info_.got_entry_size.
81 (Global_got_offset_visitor::got_entry_size_): Removed.
82 (Output_section_incremental_inputs::write_got_plt): Initialize
83 view_info.got_entry_size.
84 * target.h (Sized_target::got_entry_size): New virtual function.
85 * x86_64.cc (Target_x86_64::got_entry_size): New function.
86
87 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
88
89 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
90 * testsuite/script_test_12a.c: Likewise.
91 * testsuite/script_test_1a.cc: Likewise.
92 * testsuite/script_test_2.cc: Likewise.
93
94 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
95
96 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
97
98 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
99
100 PR gold/18959
101 * stringpool.cc (Stringpool_template::new_key_offset): Align all
102 strings, even zero-length.
103 (Stringpool_template::set_string_offsets): Likewise.
104
105 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
106
107 * s390.cc: New file.
108 * Makefile.am (TARGETSOURCES): Add s390.cc.
109 (ALL_TARGETOBJS): Add s390.o.
110 * Makefile.in: Regenerate.
111 * configure.ac: Add s390 support.
112 * configure: Regenerate.
113 * configure.tgt: Add s390-*-* and s390x-*-*.
114 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
115 support.
116
117 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
118
119 * archive.cc (Archive::sym64name): New const.
120 (Archive::setup): Add support for SYM64 armap.
121 (Archive::read_armap): Likewise.
122 (Archive::interpret_header): Likewise.
123 (Archive::const_iterator::read_next_header): Likewise.
124 * archive.h (Archive::sym64name): New const.
125 (Archive::read_armap): Add mapsize template parameter.
126
127 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
128
129 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
130 target-specific entry size.
131 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
132 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
133 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
134 hash_entry_size.
135 * target.h (Target::hash_entry_size): New method.
136 (Target::Target_info::hash_entry_size): New data member.
137
138 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
139 * arm.cc (Target_arm::arm_info): Likewise.
140 (Target_arm_nacl::arm_nacl_info): Likewise.
141 * i386.cc (Target_i386::i386_info): Likewise.
142 (Target_i386_nacl::i386_nacl_info): Likewise.
143 (Target_iamcu::iamcu_info): Likewise.
144 * mips.cc (Target_mips::mips_info): Likewise.
145 (Target_mips_nacl::mips_nacl_info): Likewise.
146 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
147 * sparc.cc (Target_sparc::sparc_info): Likewise.
148 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
149 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
150 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
151 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
152
153 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
154
155 PR gold/19177
156 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
157 and R_386_GOT32X relocations without base register.
158
159 2015-10.27 Han Shen <shenhan@google.com>
160
161 PR gold/19042 - unsupported reloc 311/312.
162
163 * aarch64.cc (Target_aarch64::Scan::local): Add support for
164 reloc 311/312.
165
166 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
167
168 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
169 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
170 as R_X86_64_GOTPCREL.
171 (Target_x86_64<size>::Scan::local): Likewise.
172 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
173 Likewise.
174 (Target_x86_64<size>::Scan::global): Likewise.
175 (Target_x86_64<size>::Relocate::relocate): Likewise.
176 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
177 Likewise.
178
179 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
180
181 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
182 R_386_GOT32X the same as R_386_GOT32.
183 (Target_i386::Scan::local): Likewise.
184 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
185 (Target_i386::Scan::global): Likewise.
186 (Target_i386::Relocate::relocate): Likewise.
187 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
188 Likewise.
189
190 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
191
192 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
193 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
194 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
195 x86_64_mov_to_lea1.o.
196 * testsuite/Makefile.in: Regenerated.
197
198 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
199
200 PR gold/19119
201 * options.h (General_options): Remove "obsolete" from -m.
202 * parameters.cc (set_parameters_target): Check if input target
203 is compatible with output emulation set by "-m emulation".
204
205 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
206
207 PR gold/19118
208 * i386.cc (Target_iamcu): New class.
209 (Target_selector_iamcu): Likewise.
210 (Target_iamcu::iamcu_info): New variable.
211 (target_selector_iamcu): Likewise.
212
213 2015-10-07 Andreas Schwab <schwab@suse.de>
214
215 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
216
217 2015-10-06 Cary Coutant <ccoutant@gmail.com>
218
219 PR gold/18855
220 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
221 parameter.
222 (Sparc_relocate_functions::gdop_lox10): Likewise.
223 (Target_sparc::Relocate::relocate): Use addend when computing
224 symbol value for R_SPARC_GOTDATA_OP*.
225
226 2015-09-07 Cary Coutant <ccoutant@gmail.com>
227
228 PR gold/18930
229 PR gold/18886
230 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
231 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
232
233 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
234
235 PR gold/18886
236 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
237 shared libraries into normal FUNC symbols.
238 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
239 symbols aren't from shared libraries.
240
241 2015-09-02 Alan Modra <amodra@gmail.com>
242
243 PR 18878
244 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
245 (Target_powerpc::Branch_info::make_stub): Determine whether long
246 branch stub is for save/restore function.
247 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
248 (Stub_table): Add need_save_res_.
249 (Stub_table:clear_stubs): Clear need_save_res_.
250 (Stub_table:set_address_and_size): Add save/restore section size.
251 (Stub_table::add_long_branch_entry): Add save_res param. Set
252 need_save_res_, but don't add space for save/restore stubs.
253 (Stub_table::find_long_branch_entry): Return offset to local copy
254 of save/restore func.
255 (Stub_table::do_write): Don't output save/restore stubs. Instead
256 copy the save/restore functions.
257 (Output_data_save_res:contents): New accessor.
258 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
259
260 2015-08-25 Cary Coutant <ccoutant@gmail.com>
261
262 PR gold/18847
263 * script-sections.cc (Memory_region::set_address): New method.
264 (Script_sections::find_memory_region): Add explicit_only parameter.
265 (Output_section_definition::set_section_addresses): Handle case where
266 script specifies both address and vma region.
267 * script-sections.h (Script_sections::find_memory_region): Add
268 explicit_only parameter.
269
270 2015-08-25 Cary Coutant <ccoutant@gmail.com>
271
272 PR gold/18859
273 * object.cc (Input_objects::add_object): Store objects in a map,
274 indexed by soname; update as-needed flag when necessary.
275 * object.h (Object::clear_as_needed): New method.
276 (Input_objects::so_names_): Change from set to map.
277
278 2015-08-25 Cary Coutant <ccoutant@gmail.com>
279
280 PR gold/14746
281 * expression.cc (Expression::Expression_eval_info): Add
282 is_valid_pointer field.
283 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
284 Adjust all callers.
285 (Addr_expression::value_from_output_section): Check whether address
286 is valid.
287 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
288 if evaluation failed due to address that is not yet valid.
289 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
290 parameter.
291
292 2015-08-25 Cary Coutant <ccoutant@gmail.com>
293
294 PR gold/18866
295 PR gold/18703
296 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
297
298 2015-08-20 Alan Modra <amodra@gmail.com>
299
300 PR gold/18846
301 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
302 Subtract os->address() from addend.
303 * powerpc.cc (relocate_relocs): Likewise.
304
305 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
306
307 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
308 lazy_stub_normal_1, lazy_stub_normal_1_n64,
309 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
310 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
311 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
312 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
313 of 'addu/daddu'.
314
315 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
316
317 * configure: Regenerated.
318
319 2015-07-26 Doug Kwan <dougkwan@google.com>
320
321 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
322 disassembler output format.
323
324 2015-07-23 Ian Coolidge <icoolidge@google.com>
325 Plumb --pic-veneer option for gold.
326
327 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
328 generation.
329 * options.h (General_options): Add --pic-veneer option.
330
331 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
332
333 PR gold/18663
334 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
335 script_test_1a.cc script_test_1b.cc.
336 (script_test_11_r.o): Replace script_test_11.o with
337 script_test_11a.o script_test_11b.o.
338 (script_test_11.o): Removed.
339 (script_test_11a.o): New.
340 (script_test_11b.o): Likewise.
341 * testsuite/Makefile.in: Regenerated.
342 * testsuite/script_test_1.h: New file.
343 * testsuite/script_test_1b.cc: Likewise.
344 * testsuite/script_test_11.h: Likewise.
345 * testsuite/script_test_11b.c: Likewise.
346 * testsuite/script_test_1.cc: Renamed to ...
347 * testsuite/script_test_1a.cc: This.
348 Include "script_test_1.h".
349 (main): Call check_int and check_ptr.
350 * testsuite/script_test_11.c: Renamed to ...
351 * testsuite/script_test_11a.c: This.
352 Include "script_test_11.h".
353 (main): Call ptr_equal.
354
355 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
356
357 PR gold/18628
358 * testsuite/ifuncdep2.c (global): Change protected to hidden.
359 * testsuite/ifuncmod1.c (global): Likewise.
360 * testsuite/ifuncmod5.c (global): Likewise.
361
362 2015-07-22 Alan Modra <amodra@gmail.com>
363
364 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
365
366 2015-07-21 Cary Coutant <ccoutant@gmail.com>
367
368 PR gold/18548
369 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
370 forced local symbol even when oldsym != NULL.
371 (Symbol_table::do_define_in_output_segment): Likewise.
372 (Symbol_table::do_define_as_constant): Likewise.
373
374 2015-07-21 Cary Coutant <ccoutant@gmail.com>
375
376 PR gold/18698
377 * archive.cc (Library_base::should_include_member): Don't use entry
378 point for relocatable links, or if target is not yet valid.
379 * parameters.cc (Parameters::entry): Check target_valid().
380
381 2015-07-20 Han Shen <shenhan@google.com>
382
383 Optimize erratum 843419 fix.
384
385 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
386 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
387 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
388 (E843419_stub): New sub-class of Erratum_stub.
389 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
390 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
391 (AArch64_relobj::create_erratum_stub): Add 1 argument.
392 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
393
394 2015-07-20 Han Shen <shenhan@google.com>
395
396 Fix arm elf header flags wrt hardfp bit.
397
398 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
399
400 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
401
402 PR gold/18689
403 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
404 from input group section for relocatable link.
405 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
406 (check_DATA): Add pr18689.stdout.
407 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
408 (pr18689.stdout): New rule.
409 (pr18689a.o): Likewise.
410 (pr18689b.o): Likewise.
411 (pr18689.o): Likewise.
412 * testsuite/pr18689.c: New file.
413 * testsuite/pr18689.sh: Likewise.
414 * testsuite/Makefile.in: Regenerated.
415
416 2015-07-20 Yiran Wang <yiran@google.com>
417 Cary Coutant <ccoutant@gmail.com>
418
419 PR gold/15574
420 * resolve.cc (Symbol_table): Remove warning about references
421 from shared objects to hidden symbols.
422 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
423 * testsuite/Makefile.in: Regenerate.
424 * testsuite/hidden_test.sh: Check dynamic symbol table; update
425 expected error messages.
426
427 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
428
429 * compressed_output.cc (Output_compressed_section::set_final_data_size):
430 Make --compress-debug-sections=zlib the same as
431 --compress-debug-sections=zlib-gabi.
432 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
433 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
434 ".zdebug_".
435 * testsuite/Makefile.in: Regenerated.
436
437 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
438
439 PR gold/18322
440 * compressed_output.cc (zlib_compress): Add argument for
441 compression header size. Set header size to compression header
442 size if it isn't 0. Don't write out the zlib header here.
443 (Output_compressed_section::set_final_data_size): Support
444 zlib-gnu and zlib-gabi compressions. Pass compression header
445 size to zlib_compress and write out compression header. Set
446 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
447 clear the SHF_COMPRESSED bit
448 * options.h (compress_debug_sections): Add zlib-gnu and
449 zlib-gabi.
450 * output.h (Output_section::set_flags): New.
451 * testsuite/Makefile.am (check_PROGRAMS): Add
452 flagstest_compress_debug_sections_none,
453 flagstest_compress_debug_sections_gnu and
454 flagstest_compress_debug_sections_gabi.
455 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
456 flagstest_compress_debug_sections.stdout,
457 flagstest_compress_debug_sections.cmp,
458 flagstest_compress_debug_sections.check,
459 flagstest_compress_debug_sections_gnu.stdout,
460 flagstest_compress_debug_sections_gnu.cmp,
461 flagstest_compress_debug_sections_gnu.check,
462 flagstest_compress_debug_sections_gabi.stdout,
463 flagstest_compress_debug_sections_gabi.cmp and
464 flagstest_compress_debug_sections_gabi.check.
465 (flagstest_compress_debug_sections_none): New.
466 (flagstest_compress_debug_sections_none.stdout): Likewise.
467 (flagstest_compress_debug_sections.stdout): Likewise.
468 (flagstest_compress_debug_sections.check): Likewise.
469 (flagstest_compress_debug_sections.cmp): Likewise.
470 (flagstest_compress_debug_sections_gnu): Likewise.
471 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
472 (flagstest_compress_debug_sections_gnu.check): Likewise.
473 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
474 (flagstest_compress_debug_sections_gabi): Likewise.
475 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
476 (flagstest_compress_debug_sections_gnu.check): Likewise.
477 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
478 * testsuite/Makefile.in: Regenerated.
479
480 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
481
482 PR gold/18321
483 * compressed_output.h (decompress_input_section): Add arguments
484 for ELF class, big endian and sh_flags.
485 * compressed_output.cc (decompress_input_section): Likewise.
486 Support the SHF_COMPRESSED section.
487 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
488 functions.
489 * plugin.h (Pluginobj): Likewise.
490 * layout.cc (Layout::get_output_section_flags): Also clear the
491 SHF_COMPRESSED bit.
492 * object.h (Compressed_section_info): Add flag to store sh_flags.
493 (Object): Add pure virtual elfsize and is_big_endian member
494 functions.
495 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
496 prefix here.
497 (build_compressed_section_map): Check SHF_COMPRESSED for
498 uncompressed size. Store sh_flags in Compressed_section_info.
499 Pass size, big_endian and sh_flags to decompress_input_section.
500 Skip the ".debug"/".zdebug" prefix when passing section name to
501 need_decompressed_section.
502 (Sized_relobj_file<size, big_endian>::do_find_special_section):
503 Don't check ".zdebug_*" sections.
504 (Object::decompressed_section_contents): Pass ELF class, big
505 endian and sh_flags to decompress_input_section.
506 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
507 Likewise.
508 * testsuite/Makefile.am (check_DATA): Add
509 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
510 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
511 gdb_index_test_2_gabi.stdout.
512 (debug_msg_cdebug_gabi.o): New.
513 (odr_violation1_cdebug_gabi.o): Likewise.
514 (odr_violation2_cdebug_gabi.o): Likewise.
515 (debug_msg_cdebug_gabi.err): Likewise.
516 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
517 (gdb_index_test_cdebug_gabi.o): Likewise.
518 (gdb_index_test_2_gabi): Likewise.
519 (gdb_index_test_2_gabi.stdout): Likewise.
520 * testsuite/gdb_index_test_2_gabi.sh: New file.
521 * testsuite/Makefile.in: Regenerated.
522
523 2015-07-09 Han Shen <shenhan@google.com>
524
525 Use "gold_info" instead of "gold_warning" for erratum fix.
526
527 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
528 'gold_info'.
529 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
530
531 2015-07-09 Han Shen <shenhan@google.com>
532
533 Drop missing symbol warning for arm/aarch64.
534
535 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
536 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
537 symbol warning.
538
539 2015-07-07 Han Shen <shenhan@google.com>
540
541 Make gold aarch64 accept long form of mapping symbols.
542
543 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
544 of mapping symbols.
545
546 2015-06-29 Doug Kwan <dougkwan@google.com>
547
548 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
549 at address expected by test.
550 * testsuite/arm_cortex_a8_b.s: Ditto.
551 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
552 * testsuite/arm_cortex_a8_bl.s: Ditto.
553 * testsuite/arm_cortex_a8_blx.s: Ditto.
554 * testsuite/arm_cortex_a8_local.s: Ditto.
555 * testsuite/arm_fix_v4bx.s: Ditto.
556 * testsuite/arm_unaligned_reloc.s: Ditto.
557 * testsuite/thumb_bl_out_of_range.s: Ditto.
558 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
559 * testsuite/thumb_blx_out_of_range.s: Ditto.
560
561 2015-06-29 Han Shen <shenhan@google.com>
562
563 Patch for erratum 843419 internal error.
564
565 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
566 (Erratum_stub::update_erratum_insn): New method.
567 (Stub_table::relocate_stubs): Modified to place relocated insn.
568 (AArch64_relobj::fix_errata): Modified gold_assert.
569
570 2015-06-12 Han Shen <shenhan@google.com>
571
572 Fix erratum 835769.
573
574 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
575 defintion outside class definition.
576 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
577 (AArch64_insn_utilities::aarch64_op31): New member.
578 (AArch64_insn_utilities::aarch64_ra): New member.
579 (AArch64_insn_utilities::aarch64_mac): New member.
580 (AArch64_insn_utilities::aarch64_mlxl): New member.
581 (ST_E_835769): New global enum member.
582 (Stub_table::relocate_stubs): Add 835769 handler.
583 (Stub_template_repertoire::Stub_template_repertoire): Install new
584 stub type.
585 (AArch64_relobj::scan_errata): This func is renamed from
586 scan_erratum_843419.
587 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
588 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
589 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
590 (Target_aarch64::scan_erratum_835769_span): New method.
591 (Target_aarch64::create_erratum_stub): New method.
592 (Target_aarch64::is_erratum_835769_sequence): New method.
593 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
594 code into create_erratum_stub.
595 * options.h (fix_cortex_a53_835769): New option.
596
597 2015-06-11 Cary Coutant <ccoutant@gmail.com>
598
599 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
600 outside class body.
601 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
602
603 2015-06-11 Cary Coutant <ccoutant@gmail.com>
604
605 PR gold/17731
606 * layout.cc (corresponding_uncompressed_section_name): New function.
607 (Layout::choose_output_section): Call it.
608 * layout.h (corresponding_uncompressed_section_name): New function.
609 * script-sections.cc (Input_section_info::set_section_name): Check
610 for compressed debug section (.zdebug style).
611
612 2015-06-11 Jing Yu <jingyu@google.com>
613
614 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
615 * testsuite/Makefile.in: Regenerate.
616
617 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
618
619 * gold.h (is_cident): Correct typo.
620
621 2015-06-10 Han Shen <shenhan@google.com>
622 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
623
624 Now fixing for 843419 is fully functional.
625
626 The first part of the erratum fix CL is here -
627 https://sourceware.org/ml/binutils/2015-04/msg00229.html
628
629 * aarch64.cc(global enum): New constants representing stub types.
630 (Stub_template): New POD struct.
631 (Stub_template_repertoire): New class.
632 (Stub_base): New class.
633 (Erratum_stub): New class.
634 (Reloc_stub): Refactored to be a subclass of Stub_base.
635 (Reloc_stub::Stub_type): Removed.
636 (Reloc_stub::offset): Moved to Stub_base.
637 (Reloc_stub::set_offset): Moved to Stub_base.
638 (Reloc_stub::destination_address): Moved to Stub_base.
639 (Reloc_stub::set_destination_address): Moved to Stub_base.
640 (Reloc_stub::reset_destination_address): Moved to Stub_base.
641 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
642 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
643 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
644 (Reloc_stub::write): Moved to Stub_base.
645 (Reloc_stub::invalid_offset): Moved to Stub_base.
646 (Reloc_stub::invalid_address): Moved to Stub_base.
647 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
648 (Reloc_stub::stub_insns_): Moved to Stub_base.
649 (Reloc_stub::offset_): Moved to Stub_base.
650 (Reloc_stub::destination_address_): Moved to Stub_base.
651 (Stub_table::The_aarch64_relobj): New typedef.
652 (Stub_table::The_erratum_stub): New typedef.
653 (Stub_table::The_erratum_stub_less): New typedef.
654 (Stub_table::The_erratum_stub_set): New typedef.
655 (Stub_table::The_erratum_stub_set_iter): New typedef.
656 (Stub_table::empty): Added emptiness testing for erratum stubs.
657 (Stub_table::add_erratum_stub): New method to add an erratum stub.
658 (Stub_table::find_erratum_stub): New method.
659 (Stub_table::find_erratum_stubs_for_input_section): New method.
660 (Stub_table::erratum_stub_address): New method.
661 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
662 (Stub_table::do_addralign): Modified to handle erratum stubs.
663 (Stub_table::erratum_stubs_): New member.
664 (Stub_table::erratum_stub_size_): New member.
665 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
666 (Stub_table::do_write): Modified to handle erratum stubs.
667 (AArch64_relobj::The_erratum_stub): New typedef.
668 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
669 (AArch64_relobj::fix_errata): New method.
670 (Target_aarch64::The_reloc_stub_type): Removed.
671 (Target_aarch64::The_erratum_stub): New typede.
672 (AArch64_relocate_functions::construct_b): New method.
673
674 2015-06-08 Nick Clifton <nickc@redhat.com>
675
676 * po/fr.po: New French Translation.
677
678 2015-06-07 Cary Coutant <ccoutant@gmail.com>
679
680 PR gold/18288
681 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
682 callers. Don't use STT_COMMON to check for common symbols.
683 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
684 symbol that's not in a common section.
685 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
686 common symbols.
687
688 2015-06-04 Cary Coutant <ccoutant@gmail.com>
689
690 PR gold/18200
691 * Makefile.am (diststuff): Add target.
692 * Makefile.in: Regenerate.
693
694 2015-06-04 Cary Coutant <ccoutant@gmail.com>
695
696 PR gold/17498
697 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
698 temporary locals in merge sections.
699 * options.cc (General_options::parse_discard_all): New method.
700 (General_options::parse_discard_locals): New method.
701 (General_options::parse_discard_none): New method.
702 (General_options::General_options): Initialize discard_locals_.
703 * options.h (--discard-all): Convert to special option.
704 (--discard-locals): Likewise.
705 (--discard-none): New option.
706 (General_options::discard_all): New method.
707 (General_options::discard_locals): New method.
708 (General_options::discard_sec_merge): New method.
709 (General_options::Discard_locals): New enum.
710 (General_options::discard_locals_): New data member.
711
712 2015-06-03 Cary Coutant <cary@google.com>
713
714 * script-sections.cc (Script_sections::Script_sections): Initialize
715 segments_created_.
716 (Script_sections::create_note_and_tls_segments): Set flag when
717 segments are created.
718 (Script_sections::expected_segment_count): Count PT_INTERP.
719 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
720 segments are created.
721 * script-sections.h (Script_sections::segments_created_): New data
722 member.
723
724 2015-06-03 Cary Coutant <ccoutant@gmail.com>
725
726 PR gold/15370
727 * script-sections.cc
728 (Output_section_element_input::set_section_addresses): When there
729 are several patterns with no sort spec, put all sections in the same
730 bin.
731 * testsuite/Makefile.am (script_test_12): New testcase.
732 (script_test_12i): New testcase.
733 * testsuite/Makefile.in: Regenerate.
734 * testsuite/script_test_12.t: New test linker script.
735 * testsuite/script_test_12i.t: New test linker script.
736 * testsuite/script_test_12a.c: New test source file.
737 * testsuite/script_test_12b.c: New test source file.
738
739 2015-06-02 Cary Coutant <ccoutant@gmail.com>
740
741 * nacl.h (Sniff_file): Switch parameters to get_view to get an
742 aligned view.
743
744 2015-06-03 Cary Coutant <ccoutant@gmail.com>
745
746 PR gold/17819
747 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
748 separate task to schedule the build id computation.
749 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
750 add Output_file and offset.
751 (Hash_task::run): Get and release the input views.
752 (Hash_task::is_runnable): Always return NULL (always runnable).
753 (Layout::queue_build_id_tasks): Remove.
754 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
755 parameters; use them instead of class members.
756 (Build_id_task_runner::run): New function.
757 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
758 to write_build_id.
759 * layout.h (Layout::queue_build_id_tasks): Remove.
760 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
761 parameters.
762 (Layout::array_of_hashes_): Remove.
763 (Layout::size_of_array_of_hashes_): Remove.
764 (Layout::input_view_): Remove.
765 (Build_id_task_runner): New class.
766 (Close_task_runner::Close_task_runner): Add array_of_hashes and
767 size_of_hashes parameters.
768 (Close_task_runner::array_of_hashes_): New data member.
769 (Close_task_runner::size_of_hashes_): New data member.
770 * testsuite/Makefile.am
771 (flagstest_compress_debug_sections_and_build_id_tree): New test.
772 * testsuite/Makefile.in: Regenerate.
773
774 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
775
776 * merge.cc (get_input_merge_map): Update for data structure change.
777 (get_or_make_input_merge_map): Update for data structure change.
778 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
779 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
780
781 2015-05-16 Alan Modra <amodra@gmail.com>
782
783 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
784 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
785 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
786 (lis_0): Rename from lis_0_0.
787
788 2015-04-29 Cary Coutant <cary@google.com>
789 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
790
791 * gc.h (Garbage_collection::is_section_garbage): Change Object*
792 to Relobj*.
793 (Garbage_collection::add_reference): Likewise.
794 (Garbage_collection::gc_process_relocs): Likewise. Don't push
795 object/shndx pair onto *secvec for dynamic objects. Don't follow
796 relocations pointing to dynamic objects for GC.
797 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
798 (Icf::unfold_section): Likewise.
799 (Icf::is_section_folded): Likewise.
800 (Icf::get_folded_section): Likewise.
801 * icf.h: (Icf::get_folded_section): Likewise.
802 (Icf::unfold_section): Likewise.
803 (Icf::is_section_folded): Likewise.
804 (Icf::section_has_function_pointers): Likewise.
805 (Icf::set_section_has_function_pointers): Likewise.
806 * object.h (Section_id): Likewise.
807 (Const_section_id): Likewise.
808 * output.cc (Output_section::update_section_layout): Likewise.
809 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
810 Likewise.
811 * plugin.cc (update_section_order): Likewise.
812 (unique_segment_for_sections): Likewise.
813 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
814 (Target_powerpc::do_gc_add_reference): Likewise.
815 (Target_powerpc::gc_process_relocs): Likewise.
816 (Target_powerpc::do_gc_add_reference): Likewise.
817 * symtab.cc (Symbol_table::is_section_folded): Likewise.
818 (Symbol_table::gc_mark_symbol): Likewise.
819 * symtab.h: (Symbol_table::is_section_folded): Likewise.
820 * target.h: (Sized_target::gc_add_reference): Likewise.
821 (Sized_target::do_gc_add_reference): Likewise.
822
823 2015-04-29 Nick Clifton <nickc@redhat.com>
824
825 * po/fi.po: Updated Finnish translation.
826
827 2015-04-28 Alan Modra <amodra@gmail.com>
828
829 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
830 than unsigned int for find_global_entry result temp. Compare
831 against invalid_address.
832 (Target_powerpc::do_plt_address_for_global): Likewise.
833 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
834 on plt call stub existence for debug info. Do assert for plt
835 and global entry stub existence if an alloc section.
836
837 2015-04-28 Alan Modra <amodra@gmail.com>
838
839 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
840 on missing global entry stub due to bogus debug info.
841
842 2015-04-27 Han Shen <shenhan@google.com>
843
844 * options.h (--fix-cortex-a53-843419): Rename option.
845 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
846 option.
847 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
848
849 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
850
851 PR gold/18327
852 * output.cc (Output_section::is_input_address_mapped): Assume a missing
853 entry is mapped.
854 * testsuite/Makefile.am: Add the eh_test test.
855 * testsuite/Makefile.in: Regenerate.
856 * testsuite/eh_test_a.cc: New test.
857 * testsuite/eh_test_b.cc: New test.
858
859 2015-04-23 Sriraman Tallam <tmsriram@google.com>
860
861 * options.h (--weak-unresolved-symbols): New option.
862 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
863 binding to weak with new option.
864 * symtab.h (is_weak_undefined): Check for new option.
865 (is_strong_undefined): Check for new option.
866 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
867 * testsuite/Makefile.in: Regenerate.
868 * testsuite/weak_unresolved_symbols_test.cc: New file.
869
870 2015-04-20 Ian Coolidge <icoolidge@google.com>
871
872 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
873 GNU_UNIQUE.
874
875 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
876
877 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
878 push_back.
879 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
880 * object.cc (Sized_relobj_file::do_layout): Use push_back.
881 * powerpc.cc (process_gc_mark): Use push_back.
882 (Target_powerpc::do_gc_mark_symbol): Use push_back.
883 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
884
885 2015-04-16 Han Shen <shenhan@google.com>
886
887 * aarch64.cc (AArch64_insn_utilities): New utility class.
888 (AArch64_relobj::Mapping_symbol_position): New struct.
889 (AArch64_relobj::Mapping_symbol_info): New typedef.
890 (AArch64_relobj::do_count_local_symbols): New function overriding
891 parent's implementation.
892 (AArch64_relobj::mapping_symbol_info_): New member
893 (AArch64_relobj::scan_erratum_843419): New method.
894 (Target_aarch64::scan_erratum_843419_span): New method.
895 (Target_aarch64::is_erratum_843419_sequence): New method.
896 * options.h (fix_cortex_a53): New option.
897
898 2015-04-09 Cary Coutant <ccoutant@google.com>
899
900 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
901 in a PIE link.
902 * testsuite/Makefile.am (tls_pie_test.sh): New test.
903 * testsuite/Makefile.in: Regenerate.
904 * testsuite/tls_pie_test.sh: New.
905
906 2015-04-09 Cary Coutant <ccoutant@google.com>
907
908 * debug.h (DEBUG_LOCATION): New.
909 (DEBUG_ALL): Include DEBUG_LOCATION.
910 (debug_string_to_enum): Add DEBUG_LOCATION.
911 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
912 output to print correct context.
913 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
914 up to 4 more locations at the beginning of the function.
915 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
916 result before sorting list of line numbers.
917 * testsuite/debug_msg.sh: Allow range of line numbers for
918 canonical results on optimized code.
919
920 2015-04-07 HC Yen <hc.yen@mediatek.com>
921
922 Add AArch32 support for gold linker.
923 gold/
924 * arm.cc: Add V8 arch combine table.
925
926 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
927
928 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
929
930 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
931
932 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
933 to find by using the return value of insert.
934
935 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
936
937 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
938 constructor call.
939
940 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
941
942 PR gold/17641
943 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
944 (Target_x86_64::Scan::local): Don't create GOT entry, when we
945 can convert mov to lea.
946 (Target_x86_64::Scan::global): Ditto.
947 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
948 %reg to lea foo(%rip), %reg if possible.
949 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
950 * testsuite/x86_64_mov_to_lea1.s: New.
951 * testsuite/x86_64_mov_to_lea2.s: Ditto.
952 * testsuite/x86_64_mov_to_lea3.s: Ditto.
953 * testsuite/x86_64_mov_to_lea4.s: Ditto.
954 * testsuite/x86_64_mov_to_lea.sh: Ditto.
955
956 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
957
958 * configure: Regenerated.
959
960 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
961
962 PR gold/17640
963 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
964 (Target_i386::Scan::local): Don't create GOT entry, when we
965 can convert GOT to GOTOFF.
966 (Target_i386::Scan::global): Ditto.
967 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
968 lea foo@GOTOFF(%reg), %reg if possible.
969 * testsuite/Makefile.am (i386_mov_to_lea): New test.
970 * testsuite/i386_mov_to_lea1.s: New.
971 * testsuite/i386_mov_to_lea2.s: Ditto.
972 * testsuite/i386_mov_to_lea3.s: Ditto.
973 * testsuite/i386_mov_to_lea4.s: Ditto.
974 * testsuite/i386_mov_to_lea5.s: Ditto.
975 * testsuite/i386_mov_to_lea.sh: Ditto.
976
977 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
978
979 * Makefile.am (ZLIB): New.
980 (ZLIBINC): Likewise.
981 (AM_CFLAGS): Add $(ZLIBINC).
982 (AM_CXXFLAGS): Likewise.
983 (ldadd_varldadd_var): Add $(ZLIB).
984 (incremental_dump_LDADD): Likewise.
985 (dwp_LDADD): Likewise.
986 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
987 <zlib.h>.
988 (zlib_compress): Don't check HAVE_ZLIB_H.
989 (zlib_decompress): Likewise.
990 * options.h (compress_debug_sections): Likewise.
991 * configure.ac (AM_CONDITIONAL): Removed.
992 * testsuite/Makefile.am (ZLIB): New.
993 (LDADD): Add $(ZLIB).
994 Don't check HAVE_ZLIB.
995 * Makefile.in: Regenerated.
996 * config.in: Likewise.
997 * configure: Likewise.
998 * testsuite/Makefile.in: Likewise.
999
1000 2015-03-30 Jing Yu <jingyu@google.com>
1001
1002 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1003 TLSLD_ADD_DTPREL_LO12_NC.
1004 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1005 _TLS_MODULE_BASE_ point to the start of tls segment.
1006 (Target_aarch64::optimize_tls_reloc): Add cases for
1007 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1008 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1009 (Target_aarch64::Scan::local): Likewise.
1010 (Target_aarch64::Scan::global): Likewise.
1011 (Target_aarch64::Relocate::relocate): Likewise.
1012 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1013 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1014 relocations.
1015
1016 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1017
1018 * merge.cc (Object_merge_map::add_mapping): call
1019 Object_merge_map::Input_merge_map::add_mapping.
1020 (Object_merge_map::Input_merge_map::add_mapping): New.
1021 (Output_merge_data::do_add_input_section): Call
1022 get_or_make_input_merge_map before a loop.
1023 (Output_merge_string<Char_type>::finalize_merged_data): Call
1024 get_or_make_input_merge_map before a loop.
1025 * merge.h (Object_merge_map): Make Input_merge_map public.
1026 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1027 (Relobj::get_or_create_merge_map): New.
1028 * object.h (Relobj::get_or_create_merge_map): New.
1029
1030 2015-03-24 Alan Modra <amodra@gmail.com>
1031
1032 PR 18147
1033 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1034 relocation errors for branches to strong undefined symbols.
1035
1036 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1037
1038 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1039 (Object_merge_map::is_merge_section_for): Remove.
1040 (Object_merge_map::find_merge_section): New.
1041 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1042 (Object_merge_map::find_merge_section): New.
1043 (Object_merge_map::get_input_merge_map): Add a const version.
1044 * object.cc (Relobj::is_merge_section_for): Remove.
1045 (Relobj::find_merge_section): New.
1046 * object.h (Relobj::is_merge_section_for): Remove.
1047 (Relobj::find_merge_section): New.
1048 * output.cc
1049 (Output_section::Input_section::is_merge_section_for): Remove.
1050 (Output_section::add_merge_input_section): Don't call
1051 add_merge_input_section.
1052 (Output_section::find_merge_section): Return const. Use
1053 object->find_merge_section.
1054 (Output_section::build_lookup_maps): Don't build a map for
1055 merge sections.
1056 (Output_section::is_input_address_mapped): Return false if
1057 section is not found.
1058 (Output_section::find_starting_output_address): Use
1059 find_merge_section instead of is_merge_section_for.
1060 (Output_section::add_script_input_section): Don't build a map for
1061 merge sections.
1062 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1063 (Output_section_lookup_maps::find_merge_section): Remove.
1064 (Output_section_lookup_maps::add_merge_input_section) Remove.
1065 (Output_section::find_merge_section): Return const.
1066
1067 2015-03-22 Cary Coutant <cary@google.com>
1068
1069 PR gold/18106
1070 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1071 non-SIB form of lea, with nop after the call.
1072
1073 2015-03-21 Cary Coutant <cary@google.com>
1074
1075 PR gold/14217
1076 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1077 .tdata section.
1078 (Output_segment::set_section_addresses): Don't align size of relro
1079 segment for .tbss.
1080
1081 2015-03-21 Cary Coutant <cary@google.com>
1082
1083 PR gold/18010
1084 * stringpool.cc (Stringpool_template): Don't optimize if section
1085 alignment is greater than sizeof(char).
1086
1087 2015-03-21 Cary Coutant <cary@google.com>
1088
1089 PR gold/18048
1090 * script-c.h (script_include_directive): Add first_token parameter.
1091 * script.cc (script_include_directive): Add first_token parameter, and
1092 pass it to read_script_file.
1093 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1094 (PARSING_MEMORY_DEF): New tokens.
1095 (top): Add new productions for INCLUDE files.
1096 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1097 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1098 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1099 (section_cmd): Pass PARSING_SECTION_CMDS.
1100 (file_or_sections_cmd): Remove.
1101 (memory_def): Pass PARSING_MEMORY_DEF.
1102 * testsuite/Makefile.am (memory_test_2): New test.
1103 * testsuite/Makefile.in: Regenerate.
1104 * testsuite/memory_test_inc.t: New script file.
1105 * testsuite/memory_test_inc_1.t.src: New script file.
1106 * testsuite/memory_test_inc_2.t.src: New script file.
1107 * testsuite/memory_test_inc_3.t.src: New script file.
1108
1109 2015-03-21 Cary Coutant <cary@google.com>
1110
1111 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1112 (Sized_relobj_dwo::setup): Build compressed section map.
1113 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1114 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1115 section map.
1116 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1117 compressed_sections_ field.
1118 (build_compressed_section_map): Take Object instead of
1119 Sized_relobj_file parameter; add decompress_if_needed parameter.
1120 (Sized_relobj_file::do_find_special_sections): Store compressed
1121 section map in parent Object.
1122 (Sized_relobj_file::do_decompressed_section_contents): Move
1123 implementation to Object::decompressed_section_contents.
1124 (Sized_relobj_file::do_discard_decompressed_sections): Move
1125 implementation to Object::discard_decompressed_sections.
1126 * object.h (build_compressed_section_map): Declare.
1127 (Object::Object): Add compressed_sections_ field.
1128 (Object::section_is_compressed): Move implementation here.
1129 (Object::decompressed_section_contents): De-virtualize.
1130 (Object::discard_decompressed_sections): De-virtualize.
1131 (Object::do_section_is_compressed): Delete.
1132 (Object::do_decompressed_section_contents): Delete.
1133 (Object::set_compressed_sections): New method.
1134 (Object::compressed_sections): New method.
1135 (Object::compressed_sections_): New data member.
1136 (Compressed_section_info, Compressed_section_map): Move to top of file.
1137 (Sized_relobj_file::do_section_is_compressed): Delete.
1138 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1139 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1140 (Sized_relobj_file::compressed_sections_): Move to Object class.
1141
1142 2015-03-21 Cary Coutant <ccoutant@google.com>
1143
1144 PR gold/18152
1145 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1146 deferred objects.
1147
1148 2015-03-11 Cary Coutant <ccoutant@google.com>
1149
1150 * options.cc (General_options::finalize): Don't allow -z relro
1151 with incremental linking.
1152 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1153 (incremental_test_2): Likewise.
1154 (incremental_test_3): Likewise.
1155 (incremental_test_4): Likewise.
1156 (incremental_test_5): Likewise.
1157 (incremental_test_6): Likewise.
1158 (incremental_copy_test): Likewise.
1159 (incremental_common_test_1): Likewise.
1160 (incremental_comdat_test_1): Likewise.
1161 * testsuite/Makefile.in: Regenerate.
1162
1163 2015-03-09 Cary Coutant <ccoutant@google.com>
1164
1165 PR gold/14675
1166 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1167 return enum indicating whether .eh_frame section is empty, optimizable,
1168 unrecognized, or an end marker. Adjust explicit instantiations.
1169 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1170 (Eh_frame::add_ehframe_input_section): Change return type.
1171 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1172 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1173 to the .eh_frame output section until we see the end marker.
1174 (Layout::finalize_eh_frame_section): New.
1175 * layout.h: (Layout::finalize_eh_frame_section): New.
1176
1177 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1178
1179 * output.cc (Relobj::initialize_input_to_output_map<size>):
1180 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1181
1182 2015-03-04 Cary Coutant <ccoutant@google.com>
1183
1184 * parameters.cc (Parameters::set_target_once): Call
1185 Target::select_as_default_target just once from here...
1186 (set_parameters_target): ...instead of from here.
1187
1188 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1189
1190 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1191 Output_section_data instead of a Merge_map.
1192 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1193 (Eh_frame::read_cie): Use add_merge_mapping instead of
1194 Merge_map::add_mapping.
1195 (Eh_frame::read_fde): Ditto.
1196 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1197 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1198 merge_map_->get_output_offset.
1199 (Eh_frame::do_is_merge_section_for): Delete.
1200 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1201 instead of a Merge_map.
1202 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1203 Merge_map.
1204 (Eh_frame::do_is_merge_section_for): Delete.
1205 (Eh_frame::merge_map_): Delete.
1206 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1207 and use a Output_section_data instead of a Merge_map.
1208 (Object_merge_map::add_mapping): Ditto.
1209 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1210 (Object_merge_map::is_merge_section_for): Pass in and use a
1211 Output_section_data instead of a Merge_map.
1212 (Merge_map): Delete.
1213 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1214 of merge_map_.get_output_offset.
1215 (Output_merge_base::do_is_merge_section_for): Delete.
1216 (Output_merge_data::do_add_input_section): Use
1217 object->add_merge_mapping instead of add_mapping.
1218 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1219 * merge.h (Merge_map): Delete forward declaration.
1220 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1221 instead of a Merge_map.
1222 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1223 (Object_merge_map::is_merge_section_for): Pass in and use a
1224 Output_section_data instead of a Merge_map.
1225 (Input_merge_map::Object_merge_map::merge_map): Replace with
1226 output_data.
1227 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1228 Output_section_data instead of a Merge_map.
1229 (Merge_map): Delete.
1230 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1231 (Output_merge_base::do_is_merge_section_for): Delete.
1232 (Output_merge_base::add_mapping): Delete.
1233 (Output_merge_base::merge_map_): Delete.
1234 * object.cc (Relobj::initialize_input_to_output_map): New.
1235 (Relobj::initialize_input_to_output_map): New.
1236 (Relobj::merge_output_offset): New.
1237 (Relobj::is_merge_section_for): New.
1238 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1239 bits.
1240 * object.h (Relobj::merge_map): Delete.
1241 (initialize_input_to_output_map): New.
1242 (set_merge_map): Delete.
1243 (add_merge_mapping): New.
1244 (merge_output_offset): New.
1245 (is_merge_section_for): New.
1246 * output.cc (Output_section::Input_section::is_merge_section_for):
1247 Use object->is_merge_section_for.
1248 * output.h (Output_section_data::is_merge_section_for): Delete.
1249 (Output_section_data::do_is_merge_section_for): Delete.
1250 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1251 Use object->initialize_input_to_output_map.
1252 (Merged_symbol_value<size>::value_from_output_section): Use
1253 object->merge_output_offset.
1254
1255 2015-03-02 Peter Collingbourne <pcc@google.com>
1256 Cary Coutant <ccoutant@google.com>
1257
1258 * output.cc (Output_section::add_merge_input_section): Do not
1259 attempt to merge sections with an entsize of 0.
1260
1261 2015-03-02 Khem Raj <raj.khem@gmail.com>
1262
1263 * attributes.h (class Output_attributes_section_data ): Add
1264 do_print_to_mapfile function.
1265
1266 2015-02-24 Alan Modra <amodra@gmail.com>
1267
1268 PR 18010
1269 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1270 complain if value is not a multiple of four.
1271 (Target_powerpc::Relocate::relocate): Correct handling of
1272 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1273
1274 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1275
1276 * configure.ac (default_size): Set to 32 for x32.
1277 * configure: Regenerated.
1278
1279 2015-02-18 Alan Modra <amodra@gmail.com>
1280
1281 PR 17954
1282 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1283 visibility.
1284
1285 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1286
1287 * gc.h (Garbage_collection::add_reference): Don't use find.
1288
1289 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1290
1291 * object.cc (write_local_symbols): avoid std::vector copy.
1292
1293 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1294
1295 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1296
1297 2015-02-09 Mark Wielaard <mjw@redhat.com>
1298
1299 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1300 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1301
1302 2015-02-16 Cary Coutant <ccoutant@google.com>
1303
1304 PR gold/13577
1305 PR gold/16992
1306 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1307 DF_SYMBOLIC if --dynamic-list option is used.
1308 * options.cc (General_options::finalize): --dynamic-list is not
1309 mutually exclusive with -Bsymbolic.
1310 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1311 listed in --dynamic-list.
1312 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1313 -Bsymbolic-functions.
1314 * testsuite/Makefile.in: Regenerate.
1315
1316 2015-02-16 Cary Coutant <ccoutant@google.com>
1317
1318 PR gold/17971
1319 * incremental.cc: Remove redundant include of "output.h".
1320
1321 2015-02-12 Jing Yu <jingyu@google.com>
1322
1323 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1324 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1325 New relocation.
1326 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1327 TLSLE_MOVW_* relocations.
1328 (Target_aarch64::Scan::global): Likewise.
1329 (Target_aarch64::Relocate::relocate): Likewise.
1330 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1331 for new TLSLE_MOVW_* relocations.
1332
1333 2015-02-11 Will Newton <will.newton@linaro.org>
1334
1335 PR gold/13321
1336 * arm.cc (Target_arm::make_plt_section): Create an ARM
1337 state mapping symbol at the start of the PLT.
1338
1339 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1340
1341 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1342 Replace two_file_shared_2.so with two_file_shared_1.so.
1343 * testsuite/Makefile.in: Regenerated.
1344
1345 2015-02-09 Alan Modra <amodra@gmail.com>
1346
1347 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1348 plugin_test_thin.a and defsym_test.
1349 * testsuite/Makefile.in: Regenerate.
1350
1351 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1352
1353 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1354 body.
1355
1356 2015-02-04 Peter Collingbourne <pcc@google.com>
1357
1358 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1359 forwarding symbols when computing symbol resolution info for plugins.
1360 * plugin.h (Plugin_manager::symtab): New method.
1361 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1362
1363 2015-02-03 Cary Coutant <ccoutant@google.com>
1364 Peter Collingbourne <pcc@google.com>
1365
1366 PR gold/15660
1367 * archive.cc (Thin_archive_object_unlocker): New class.
1368 (Archive::include_member): Unlock external members of thin archives.
1369 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1370 (plugin_test_2): Likewise.
1371 (plugin_test_3): Likewise.
1372 (plugin_test_4): Likewise.
1373 (plugin_test_5): Likewise.
1374 (plugin_test_6): Likewise.
1375 (plugin_test_7): Likewise.
1376 (plugin_test_8): Likewise.
1377 (plugin_test_9): Likewise.
1378 (plugin_test_10): Likewise.
1379 (plugin_test_11): New test case.
1380 * testsuite/Makefile.in: Regenerate.
1381 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1382 file to decide whether to claim file.
1383 (all_symbols_read_hook): Likewise.
1384 * testsuite/plugin_test_1.sh: Adjust expected output.
1385 * testsuite/plugin_test_2.sh: Likewise.
1386 * testsuite/plugin_test_3.sh: Likewise.
1387 * testsuite/plugin_test_6.sh: Likewise.
1388 * testsuite/plugin_test_tls.sh: Likewise.
1389 * testsuite/plugin_test_11.sh: New testcase.
1390
1391 2015-02-03 Cary Coutant <ccoutant@google.com>
1392
1393 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1394 file descriptors when debugging enabled. Add debug output.
1395 (Descriptors::release): Add debug output.
1396 (Descriptors::close_some_descriptor): Likewise.
1397 (Descriptors::close_all): Likewise.
1398 * fileread.cc (File_read::lock): Likewise.
1399 (File_read::unlock): Likewise.
1400
1401 2015-02-02 Cary Coutant <ccoutant@google.com>
1402
1403 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1404 executable output file.
1405
1406 2015-01-22 Han Shen <shenhan@google.com>
1407
1408 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1409 (Target_arm::do_plt_address_for_global): New method.
1410 (Target_arm::do_plt_address_for_local): New method.
1411 (Target_arm::rel_irelative_section): New method.
1412 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1413 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1414 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1415 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1416 (Target_arm::Scan::check_non_pic): Add ifunc support.
1417 (Target_arm::Scan::local): Add ifunc support.
1418 (Target_arm::Scan::global): Add ifunc support.
1419 (Target_arm::make_plt_section): New method.
1420 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1421 (Target_arm::make_local_ifunc_plt_entry): New method.
1422 (Target_arm::got_irelative_): New member.
1423 (Target_arm::rel_irelative_): New member.
1424 (Target_arm::got_section): Add creation for got_irelative_.
1425 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1426 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1427 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1428 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1429 (Output_data_plt_arm::IRelative_data): New type.
1430 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1431 (Output_data_plt_arm::add_entry): Add more parameters.
1432 (Output_data_plt_arm::add_relocation): New method.
1433 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1434 (Output_data_plt_arm::rel_irelative): New method.
1435 (Output_data_plt_arm::entry_count): Modified.
1436 (Output_data_plt_arm::address_for_global): New method.
1437 (Output_data_plt_arm::address_for_local): New method.
1438 gold/
1439 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1440 (Output_data_plt_arm::insert_irelative_data): New method.
1441 (Output_data_plt_arm::irelative_rel_): New member.
1442 (Output_data_plt_arm::got_): New member.
1443 (Output_data_plt_arm::got_irelative_): New member.
1444 (Output_data_plt_arm::irelative_count_): New member.
1445 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1446 (Output_data_plt_arm::irelative_data_vec_): New member.
1447 (Output_data_plt_arm::do_write): Write out irelative entries.
1448 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1449 more parameters to ctor.
1450 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1451 more parameters to ctor.
1452 * output.h (Output_data_reloc::add_local_relative): New method.
1453 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1454
1455 2015-01-29 Alan Modra <amodra@gmail.com>
1456
1457 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1458 and GOT_TLSGD to LE optimization.
1459
1460 2015-01-28 Cary Coutant <ccoutant@google.com>
1461
1462 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1463 for undef TLS symbols.
1464 (Target_x86_64::Relocate::relocate_tls): Likewise.
1465 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1466
1467 2015-01-25 Cary Coutant <ccoutant@google.com>
1468
1469 * output.cc (Output_segment::set_section_addresses): Fix calculation
1470 of size of relro segment.
1471
1472 2015-01-22 Alan Modra <amodra@gmail.com>
1473
1474 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1475 condition for need of ifunc plt entry.
1476 (Target_powerpc::Scan::global <got relocs>): Likewise.
1477
1478 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1479
1480 * mips.cc (reloc_high): Add r_sym.
1481 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1482 reloc_high constructor.
1483 (Mips_relocate_functions::relgot16_local): Likewise.
1484 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1485 r_type to decide whether LO16 matches HI16.
1486 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1487 rello16 and relgot16_local.
1488
1489 2015-01-09 Cary Coutant <ccoutant@google.com>
1490
1491 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1492 unless alignment is larger than page size.
1493
1494 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1495 Cary Coutant <ccoutant@google.com>
1496
1497 PR gold/17729
1498 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1499 (DEFAULT_TARGET_X32): Set for x32.
1500 * x86_64.cc (cmp_insn_32): New.
1501 (lea_r10_insn_32): Likewise.
1502 (lea_r11_insn_32): Likewise.
1503 (cmp_insn_64): Likewise.
1504 (lea_r10_insn_64): Likewise.
1505 (lea_r11_insn_64): Likewise.
1506 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1507 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1508 (check_DATA): Add split_x32 files.
1509 (split_x32_[1234n].o): New targets.
1510 (split_x32_[124]): New targets.
1511 (split_x32_[1234r].stdout): New targets.
1512 * testsuite/split_x32.sh: New file.
1513 * testsuite/split_x32_1.s: Likewise.
1514 * testsuite/split_x32_2.s: Likewise.
1515 * testsuite/split_x32_3.s: Likewise.
1516 * testsuite/split_x32_4.s: Likewise.
1517 * testsuite/split_x32_n.s: Likewise.
1518 * configure: Regenerated.
1519 * testsuite/Makefile.in: Likewise.
1520
1521 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1522
1523 PR gold/17809
1524 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1525 x32.
1526
1527 2015-01-02 Alan Modra <amodra@gmail.com>
1528
1529 * version.cc (print_version): Just print current year.
1530 * dwp.cc (print_version): Likewise.
1531
1532 2015-01-01 Alan Modra <amodra@gmail.com>
1533
1534 Update year range in copyright notice of all files.
1535
1536 2014-12-25 Alan Modra <amodra@gmail.com>
1537
1538 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1539 new enums.
1540 (Target_arm::merge_object_attributes, ): Likewise.
1541
1542 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1543
1544 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1545 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1546 AEABI_VFP_args_vfp to check that.
1547 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1548 value and replace hardcoded values by enum values.
1549
1550 2014-12-22 Cary Coutant <ccoutant@google.com>
1551
1552 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1553
1554 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1555
1556 PR gold/14608
1557 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1558 to "return i * i * 3;".
1559
1560 2014-12-16 Cary Coutant <ccoutant@google.com>
1561
1562 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1563 (Mapfile::print_output_data): Use current_data_size() to avoid
1564 assert for sections requiring postprocessing; if address is not valid,
1565 print 0.
1566 (Mapfile::print_output_section): Use current_data_size(); print note
1567 that addresses and sizes are before compression.
1568
1569 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1570
1571 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1572 Cast current_group_size to unsigned long when reporting error.
1573
1574 2014-12-10 Jing Yu <jingyu@google.com>
1575
1576 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1577 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1578 Update error message.
1579 (Target_aarch64::do_relax): Use absolute value of option
1580 stub_group_size. Replace local variable with class member
1581 stub_group_size_.
1582
1583 2014-12-04 Alan Modra <amodra@gmail.com>
1584
1585 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1586 addend of PLTREL24 reloc when not generating a plt stub. Make
1587 max_branch_offset an "Address".
1588 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1589 (Target_powerpc::Relocate::relocate): Likewise.
1590
1591 2014-12-04 Alan Modra <amodra@gmail.com>
1592
1593 PR 17670
1594 * symtab.cc (Symbol::set_undefined): Remove assertion.
1595 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1596 on symbols defined in discarded sections, instead return false.
1597 Rearrange params, update all callers.
1598 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1599 branches to syms in discarded sections.
1600 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1601 undefined and flag as discarded.
1602 (Target_powerpc::Relocate::relocate): Localize variable.
1603
1604 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1605
1606 PR gold/17675
1607 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1608 * testsuite/Makefile.in: Regenerated.
1609
1610 2014-12-03 Alan Modra <amodra@gmail.com>
1611
1612 PR 17566
1613 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1614 when adding dynamic relocations against section symbols.
1615
1616 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1617
1618 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1619 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1620 * options.h (General_options): New -z option (global).
1621
1622 2014-12-01 Cary Coutant <ccoutant@google.com>
1623
1624 PR gold/17578
1625 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1626 is given.
1627 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1628 given but some inputs require executable stack.
1629
1630 2014-11-26 Cary Coutant <ccoutant@google.com>
1631
1632 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1633 .debug_str_offsets; strip .debug_gnu_pubnames and
1634 .debug_gnu_pubtypes.
1635 (lines_only_debug_sections): Strip all four new sections.
1636
1637 2014-11-26 Jing Yu <jingyu@google.com>
1638
1639 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1640 register to be x0 when to relax TLSDESC_LD64_LO12.
1641
1642 2014-11-26 Alan Modra <amodra@gmail.com>
1643
1644 * powerpc.cc (struct Stub_table_owner): New.
1645 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1646 unsigned int vector. Update all references.
1647 (powerpc_relobj::set_stub_table): Take an unsigned int param
1648 rather than a Stub_table. Update callers.
1649 (Powerpc_relobj::clear_stub_table): New function.
1650 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1651 stub_group_size_ vars.
1652 (Target_powerpc::new_stub_table): Delete.
1653 (max_branch_delta): New function, extracted from..
1654 (Target_powerpc::Relocate::relocate): ..here..
1655 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1656 status on whether stub created successfully.
1657 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1658 default sizing to..
1659 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1660 reduce on relax failure.
1661 (Target_powerpc::group_sections): Add "no_size_errors" param.
1662 Use stub_group_size_. Set up group info in a temp vector,
1663 before building Stub_table vector. Account for input sections
1664 possibly already converted to relaxed sections.
1665 (Stub_table::init): Delete. Merge into..
1666 (Stub_table::Stub_table): ..here.
1667 (Stub_table::can_reach_stub): New function.
1668 (Stub_table::add_plt_call_entry): Add "from" parameter and
1669 return true iff stub could be reached.
1670 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1671 param too.
1672 (Stub_table::clear_stubs): Add "all" param.
1673
1674 2014-11-26 Alan Modra <amodra@gmail.com>
1675
1676 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1677 (Target_powerpc::group_sections): Use it.
1678
1679 2014-11-25 Cary Coutant <ccoutant@google.com>
1680
1681 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1682 (Binary_to_elf::write_symbol): Add st_size parameter.
1683 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1684
1685 2014-11-25 Cary Coutant <ccoutant@google.com>
1686
1687 PR gold/17639
1688 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1689 (Sized_relobj_file::do_layout): Handle deferred sections properly
1690 during GC pass 1. Don't add reloc sections to deferred list twice.
1691 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1692 (Sized_relobj_file::is_deferred_layout_): New data member.
1693
1694 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1695
1696 PR gold/17619
1697 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1698 Check PC-relative offset overflow in PLT entry.
1699
1700 2014-11-21 Alan Modra <amodra@gmail.com>
1701
1702 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1703 for undefined weaks.
1704
1705 2014-11-20 Alan Modra <amodra@gmail.com>
1706
1707 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1708 from --stub-group-size parameter divided by 1024.
1709 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1710 template parameter. Update all uses.
1711 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1712 has_stub_value. Set for long branches. Don't report overflow for
1713 branch to undefined weak symbols. Print info message on
1714 overflowing branch to stub.
1715
1716 2014-11-20 Alan Modra <amodra@gmail.com>
1717
1718 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1719
1720 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1721
1722 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1723 entry for R_X86_64_GOTPLT64.
1724 (Target_x86_64<size>::Relocate::relocate): Update comments for
1725 R_X86_64_GOTPLT64.
1726
1727 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1728
1729 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1730 * plugin.h: add lock definition
1731
1732 2014-10-29 Han Shen <shenhan@google.com>
1733 Jing Yu <jingyu@google.com>
1734
1735 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1736 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1737 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1738 Symbol::TLS_REF.
1739 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1740 method.
1741 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1742 (Target_aarch64::tls_ld_to_le): New method.
1743 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1744 for 64bit targets.
1745 (Output_data_plt_aarch64::irelative_rel_): New data member.
1746 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1747 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1748 (Output_data_plt_aarch64::add_relocation): New method.
1749 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1750 offset. Add got_irelative size to got size.
1751 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1752 type string with the new typename.
1753 (AArch64_relocate_functions::update_adr): Replace parameter x with
1754 immed.
1755 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1756 (AArch64_relocate_functions::reloc_common): New method.
1757 (AArch64_relocate_funcsions::rela_general): Extract common part out
1758 into reloc_common method.
1759 (AArch64_relocate_functions::rela_general): Likewise.
1760 (AArch64_relocate_functions::pcrela_general): Likewise.
1761 (AArch64_relocate_functions::adr): New method.
1762 (AArch64_relocate_functions::adrp): Calculate immed before calling
1763 update_adr.
1764 (AArch64_relocate_functions::adrp): Likewise.
1765 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1766 comparing x to 0. Calculate immed from ~x when x < 0.
1767 (Target_aarch64::optimize_tls_reloc): Add new cases for
1768 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1769 TLSLD_MOVW_DTPREL_G0_NC.
1770 (Target_aarch64::possible_function_pointer_reloc): Implement this
1771 method.
1772 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1773 comment.
1774 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1775 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1776 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1777 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1778 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1779 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1780 (Target_aarch64::make_plt_entry): Call add_entry with two more
1781 parameters.
1782 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1783 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1784 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1785 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1786 (Target_aarch64::Relocate::relocate_tls): Add cases for
1787 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1788 TLSLD_MOVW_DTPREL_G0_NC.
1789 * testsuite/icf_safe_so_test.cc: Correct test comment.
1790 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1791
1792 2014-10-22 Alan Modra <amodra@gmail.com>
1793
1794 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1795 thread_starter.
1796
1797 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1798
1799 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1800
1801 2014-10-17 Cary Coutant <ccoutant@google.com>
1802
1803 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1804 Add "typename" keyword.
1805
1806 2014-10-15 Han Shen <shenhan@google.com>
1807 Jing Yu <jingyu@google.com>
1808
1809 Patch for gold aarch64 backend to support relaxation.
1810 * aarch64-reloc.def: Change format.
1811 * aarch64.cc (class Reloc_stub): New class.
1812 (class Stub_table): New class.
1813 (class AArch64_relobj): New class.
1814 (class AArch64_input_section): New class.
1815 (class AArch64_output_section): New class.
1816 (Target_aarch64::new_stub_table): New method.
1817 (Target_aarch64::new_aarch64_input_section): New method.
1818 (Target_aarch64::find_aarch64_input_section): New method.
1819 (Target_aarch64::scan_section_for_stubs): New method.
1820 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1821 (Target_aarch64::relocate_stub): New method.
1822 (Target_aarch64::current_target): New method.
1823 (Target_aarch64::do_make_elf_object): New method.
1824 (Target_aarch64::do_may_relax): New method.
1825 (Target_aarch64::do_relax): New method.
1826 (Target_aarch64::group_sections): New method.
1827 (Target_aarch64::scan_reloc_for_stub): New method.
1828 (Target_aarch64::do_make_output_section): New method.
1829 (Target_aarch64::stub_tables_): New data member.
1830 (Target_aarch64::aarch64_input_section_map_): New data member.
1831 (AArch64_relocate_functions::maybe_apply_stub): New method.
1832
1833 2014-09-30 Cary Coutant <ccoutant@google.com>
1834
1835 PR gold/17432
1836 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1837
1838 2014-09-30 Kito Cheng <kito@0xlab.org>
1839
1840 PR gold/13597
1841 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1842 hash table before sysv-style hash table.
1843
1844 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1845
1846 * options.h (--pic-executable): Add negative to alias to -no-pie.
1847
1848 2014-09-26 Cary Coutant <ccoutant@google.com>
1849
1850 PR gold/16773
1851 * object.cc (Sized_relobj_file): Compute value of section symbols
1852 for TLS sections the same as TLS symbols.
1853
1854 2014-09-25 Cary Coutant <ccoutant@google.com>
1855
1856 PR gold/17432
1857 * resolve.cc (Symbol_table::resolve): Override common placeholder
1858 symbols, but adjust sizes.
1859 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1860 symbols to common lists.
1861
1862 2014-09-24 Alan Modra <amodra@gmail.com>
1863
1864 * po/POTFILES.in: Regenerate.
1865
1866 2014-09-23 Taiju Tsuiki <tzik@google.com>
1867 Cary Coutant <ccoutant@google.com>
1868
1869 PR gold/14860
1870 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1871 on input_sections_blocker.
1872 * layout.cc (Write_sections_task::locks): Unblock
1873 input_sections_blocker_.
1874 * layout.h (Write_sections_task::Write_sections_task): Add
1875 input_sections_blocker.
1876 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1877 to DEPENDENCIES.
1878 * testsuite/Makefile.in: Regenerate.
1879
1880 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1881
1882 * testsuite/Makefile.am (plugin_test_10): New test.
1883 * testsuite/Makefile.in: Regenerate
1884 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1885 * testsuite/plugin_test_10.sh: New file.
1886
1887 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1888
1889 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1890 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1891 during the replacement phase.
1892
1893 2014-09-17 Han Shen <shenhan@google.com>
1894 Jing Yu <jingyu@google.com>
1895
1896 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1897 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1898 * aarch64.cc (Target_aarch64): Add data members
1899 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1900 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1901 constructor.
1902 (Target_aarch64::do_reloc_symbol_index): New method.
1903 (Target_aarch64::do_reloc_addend): New method.
1904 (Target_aarch64::add_tlsdesc_info): New method.
1905 (Target_aarch64::do_dynsym_value): New method.
1906 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1907 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1908 (Target_aarch64::make_data_plt): Add new parameters: got,
1909 got_irelative. Pass them to do_make_data_plt.
1910 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1911 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1912 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1913 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1914 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1915 (Target_aarch64::got_tlsdesc_section): New method.
1916 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1917 (Target_aarch64::define_tls_base_symbol): New method.
1918 (Target_aarch64::reserve_tlsdesc_entries): New method.
1919 (Target_aarch64::got_mod_index_entry): New method.
1920 (Target_aarch64::rela_tlsdesc_section): New method.
1921 (Target_aarch64::rela_irelative_section): New method.
1922 (Target_aarch64::Tlsdesc_info): New struct.
1923 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1924 relocations and tlsdesc relocations.
1925 (Target_aarch64::optimize_tls_reloc): Implement method.
1926 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1927 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1928 in constructor.
1929 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1930 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1931 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1932 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1933 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1934 (Output_data_plt_aarch64::rela_irelative): New method.
1935 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1936 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1937 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1938 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1939 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1940 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1941 (Output_data_plt_aarch64_standard): New member variables:
1942 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1943 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1944 New parameter: got, got_irelative.
1945 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1946 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1947 (Output_data_plt_aarch64::do_write): Replace got_address with
1948 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1949 (AArch64_relocate_functions::update_movnz): New method.
1950 (AArch64_relocate_functions): Correct format.
1951 (AArch64_relocate_functions::movnz): New method.
1952 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1953 before the switch. Add new cases to switch.
1954 Check ie_to_le relaxation on tlsie relocations. Add code handling
1955 tlsgd tlsdesc cases.
1956 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1957 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1958 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1959 Call reloc_name_in_error_message to print unsupported reloc.
1960 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1961 make_data_plt.
1962 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1963 relocs. Fill in some more dynamic tags.
1964 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1965 Skip call tls_get_addr when tlsgd is relaxed.
1966 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1967 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1968 tlsdesc->ie relaxation.
1969
1970 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1971
1972 * mips.cc (Target_mips_nacl): New class.
1973 (Target_selector_mips_nacl): New class.
1974 (target_selector_mips32): Rename from target_selector_mips32be and use
1975 Target_selector_mips_nacl instead of Target_selector_mips.
1976 (target_selector_mips32el): Rename from target_selector_mips32 and use
1977 Target_selector_mips_nacl instead of Target_selector_mips.
1978 (target_selector_mips64): Rename from target_selector_mips64be and use
1979 Target_selector_mips_nacl instead of Target_selector_mips.
1980 (target_selector_mips64el): Rename from target_selector_mips64 and use
1981 Target_selector_mips_nacl instead of Target_selector_mips.
1982 (Target_mips::mips_info): Add const attribute.
1983
1984 2014-09-02 Cary Coutant <ccoutant@google.com>
1985
1986 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1987 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1988 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1989 (Sized_incr_dynobj::do_section_name): Likewise.
1990 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1991 (Sized_incr_dynobj::do_section_name): Likewise.
1992 * object.h (Object::section_name): Likewise.
1993 (Object::do_section_name): Likewise.
1994 (Sized_relobj_file::do_section_name): Likewise.
1995 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1996 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1997
1998 2014-09-02 Cary Coutant <ccoutant@google.com>
1999
2000 PR gold/17005
2001 * ehframe.cc (Fde::write): Add output_offset parameter.
2002 (Cie::write): Likewise.
2003 (Eh_frame::set_final_data_size): Account for offset within output
2004 section.
2005 (Eh_frame::do_sized_write): Likewise.
2006 * ehframe.h (Fde::write): Add output_offset parameter.
2007 (Cie::write): Likewise.
2008 * output.cc (Output_section::Input_section_sort_entry): Remove
2009 section_has_name_; add output_section_name parameter. Use
2010 output section name for non-input sections.
2011 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2012 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2013 (Output_section::Input_section_sort_compare): Remove logic for
2014 sections without names.
2015 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2016 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2017 Likewise.
2018 (Output_section::Input_section_sort_section_name_compare): Likewise.
2019
2020 2014-08-29 Han Shen <shenhan@google.com>
2021 Jing Yu <jingyu@google.com>
2022
2023 * aarch64-reloc-property.cc
2024 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2025 reference reloc property in the table.
2026 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2027 3 other entries.
2028 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2029 2 new overloaded methods.
2030 (Output_data_got_aarch64::do_write): Add code to write out
2031 static relocs.
2032 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2033 static relocs.
2034 (Output_data_got_aarch64::static_relocs): New vector to
2035 hold static relocs.
2036 (Target_aarch64::TCB_SIZE): New const static memeber.
2037 (Target_aarch64::tcb_size): New method.
2038 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2039 (Target_aarch64::Relocate::relocate_tls): New method.
2040 (Target_aarch64::Scan::local): Add code handling new reloc types.
2041 (Target_aarch64::Scan::global): Add code handling new reloc types.
2042
2043 2014-08-13 Sriraman Tallam <tmsriram@google.com>
2044
2045 * options.h (-no-pie): Add option.
2046
2047 2014-08-08 Jing Yu <jingyu@google.com>
2048 Han Shen <shenhan@google.com>
2049
2050 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2051 (DEFFILES): add aarch64-reloc.def.
2052 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2053 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2054 * Makefile.in: Regenerate.
2055 * aarch64-reloc-property.cc: New file.
2056 * aarch64-reloc-property.h: New file.
2057 * aarch64-reloc.def: New file.
2058 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2059 with tab to make the format consistent.
2060 (Output_data_got_aarch64::symbol_table_): New method.
2061 (Target_aarch64::do_plt_address_for_global): New method.
2062 (Target_aarch64::do_plt_address_for_local): New method.
2063 (Target_aarch64::do_select_as_default_target): New method.
2064 (Target_aarch64::do_make_data_plt): New method.
2065 (Target_aarch64::make_data_plt): New method.
2066 (Output_data_plt_aarch64::has_irelative_section): New method.
2067 (Output_data_plt_aarch64::address_for_global): New method.
2068 (Output_data_plt_aarch64::address_for_local): New method.
2069 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2070 (Output_data_plt_aarch64::add_entry): Implement contents.
2071 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2072 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2073 the got_pov entry to plt0.
2074 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2075 Implement contents.
2076 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2077 (AArch64_howto): New struct.
2078 (aarch64_howto[]): New static const array.
2079 (AArch64_relocate_functions): New class.
2080 (Target_aarch64::Scan::get_reference_flags): Remove method.
2081 (Target_aarch64::Scan::local): Implement to support a few relocations.
2082 (Target_aarch64::Scan::global): Implement to support a few relocations.
2083 (Target_aarch64::make_plt_section): Implement contents.
2084 (Target_aarch64::make_plt_entry): Implement contents.
2085 (Target_aarch64::do_finalize_sections): Implement contents.
2086 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2087 (Target_aarch64::relocate_section): Implement contents.
2088
2089 2014-08-06 Alan Modra <amodra@gmail.com>
2090
2091 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2092
2093 2014-08-06 Alan Modra <amodra@gmail.com>
2094
2095 PR 13227
2096 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2097
2098 2014-07-21 Sriraman Tallam <tmsriram@google.com>
2099
2100 * object.cc (Relobj::is_section_name_included): Add
2101 ".rodata.nptl_version" to not garbage collect this section.
2102
2103 2014-07-08 Cary Coutant <ccoutant@google.com>
2104
2105 * expression.cc (struct Expression::Expression_eval_info): Add
2106 new fields type_pointer, vis_pointer, and nonvis_pointer.
2107 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2108 nonvis_pointer parameters. Adjust all calls.
2109 (Symbol_expression::value): Update type, visibility, and nonvis bits
2110 in caller.
2111 * script.cc (Symbol_assignment::sized_finalize): Update type,
2112 visibility, and remaining st_other bits for new symbol.
2113 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2114 vis_pointer, and nonvis_pointer parameters.
2115 * symtab.h (Symbol::set_type): New method.
2116
2117 * testsuite/Makefile.am (defsym_test): New test.
2118 * testsuite/Makefile.in: Regenerate.
2119 * testsuite/defsym_test.c: New file.
2120 * testsuite/defsym_test.sh: New file.
2121
2122 2014-07-08 Cary Coutant <ccoutant@google.com>
2123
2124 PR gold/15639
2125 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2126 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2127 (Sized_dynobj::base_read_symbols): ...new method.
2128 * object.h (Sized_relobj_file::base_read_symbols): New method.
2129 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2130 (Sized_relobj_file::base_read_symbols): ...new method.
2131 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2132 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2133 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2134
2135 2014-07-04 Alan Modra <amodra@gmail.com>
2136
2137 * po/POTFILES.in: Regenerate.
2138
2139 2014-07-02 Jing Yu <jingyu@google.com>
2140
2141 * aarch64.cc: New file
2142 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2143 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2144 * Makefile.in: Regenerate.
2145 * configure.tgt: Add entries for aarch64*.
2146 * configure.ac: Likewise.
2147 * configure: Likewise.
2148
2149 2014-06-27 Alan Modra <amodra@gmail.com>
2150
2151 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2152
2153 2014-06-24 Cary Coutant <ccoutant@google.com>
2154
2155 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2156 sections.
2157 (Dwo_file::sized_read_unit_index): Likewise.
2158
2159 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2160
2161 * mips.cc: New file.
2162 * Makefile.am (TARGETSOURCES): Add mips.cc
2163 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2164 * configure.tgt: Add entries for mips*.
2165 * configure.ac: Likewise.
2166 * Makefile.in: Regenerate.
2167 * configure: Likewise.
2168
2169 2014-06-09 Cary Coutant <ccoutant@google.com>
2170
2171 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2172 unit_length is within section bounds.
2173
2174 2014-06-09 Cary Coutant <ccoutant@google.com>
2175
2176 PR gold/16980
2177 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2178 map.
2179
2180 2014-06-07 Alan Modra <amodra@gmail.com>
2181
2182 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2183
2184 2014-06-06 Cary Coutant <ccoutant@google.com>
2185
2186 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2187 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2188 (Dwarf_pubnames_table::read_header): Likewise.
2189 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2190 .debug_gnu_pubtypes.
2191
2192 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2193
2194 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2195 * Makefile.in, configure: Regenerate.
2196
2197 2014-06-03 Alan Modra <amodra@gmail.com>
2198
2199 * powerpc.cc (addis_12_2): Define.
2200 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2201
2202 2014-06-03 Alan Modra <amodra@gmail.com>
2203
2204 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2205 st_other output.
2206
2207 2014-06-02 Alan Modra <amodra@gmail.com>
2208
2209 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2210 Only ignore relocs on ELFv1.
2211 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2212
2213 2014-05-30 Cary Coutant <ccoutant@google.com>
2214
2215 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2216 * testsuite/Makefile.in: Regenerate.
2217 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2218
2219 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2220
2221 PR gold/16945
2222 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2223 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2224
2225 2014-05-15 Alan Modra <amodra@gmail.com>
2226
2227 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2228 Compare FDE contents with DW_CFA_nop rather than 0.
2229
2230 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2231
2232 * symtab.h (may_need_copy_reloc): Remove check for position independent
2233 code.
2234 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2235 position independence before pc absolute may_need_copy_reloc call.
2236 Add check for executable output befor pc relative may_need_copy_reloc
2237 call.
2238 * i386.cc: Ditto.
2239 * arm.cc: Ditto.
2240 * sparc.cc: Ditto.
2241 * tilegx.cc: Ditto.
2242 * powerpc.cc: Add check for no position independence before
2243 may_need_copy_reloc calls.
2244 * testsuite/pie_copyrelocs_test.cc: New file.
2245 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2246 * Makefile.am (pie_copyrelocs_test): New test.
2247 * Makefile.in: Regenerate.
2248
2249 2014-05-08 Martin Liška <mliska@suse.cz>
2250
2251 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2252
2253 2014-05-06 Cary Coutant <ccoutant@google.com>
2254
2255 PR gold/16900
2256 * i386.cc (Output_data_got_plt_i386): New class.
2257 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2258 parameter. Change all callers.
2259 (Output_data_plt_i386::layout_): Remove.
2260 (Output_data_plt_i386::got_plt_): Change type.
2261 (Target_i386::got_plt_): Change type. Change all references.
2262 (Target_i386::got_section): Create instance of new class.
2263 (Output_data_got_plt_i386::do_write): New function.
2264 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2265 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2266 parameter. Change all callers.
2267 (Output_data_plt_x86_64::layout_): Remove.
2268 (Output_data_plt_x86_64::got_plt_): Change type.
2269 (Target_x86_64::got_plt_): Change type. Change all references.
2270 (Target_x86_64::got_section): Create instance of new class.
2271 (Output_data_got_plt_x86_64::do_write): New function.
2272 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2273 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2274 class.
2275
2276 2014-05-05 Cary Coutant <ccoutant@google.com>
2277
2278 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2279 if we have pubnames/pubtypes.
2280
2281 2014-05-02 Cary Coutant <ccoutant@google.com>
2282
2283 * defstd.cc (in_segment): Define __ehdr_start here...
2284 * layout.cc (Layout::finalize): ...Instead of here. Set the
2285 output segment when known.
2286 * resolve.cc (Symbol::override_base_with_special): Remember
2287 the original binding.
2288 * symtab.cc (Symbol::set_output_segment): New function.
2289 (Symbol::set_undefined): New function.
2290 * symtab.h (Symbol::is_weak_undefined): Check original undef
2291 binding.
2292 (Symbol::is_strong_undefined): New function.
2293 (Symbol::set_output_segment): New function.
2294 (Symbol::set_undefined): New function.
2295 * target-reloc.h (is_strong_undefined): Remove.
2296 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2297 Check for hidden undefs.
2298 (relocate_section): Call Symbol::is_strong_undefined.
2299
2300 * testsuite/Makefile.am (ehdr_start_test_1)
2301 (ehdr_start_test_2, ehdr_start_test_3)
2302 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2303 * testsuite/Makefile.in: Regenerate.
2304 * testsuite/ehdr_start_def.cc: New source file.
2305 * testsuite/ehdr_start_test.cc: New source file.
2306 * testsuite/ehdr_start_test.t: New linker script.
2307 * testsuite/ehdr_start_test_4.sh: New shell script.
2308
2309 2014-04-23 Cary Coutant <ccoutant@google.com>
2310
2311 PR gold/16870
2312 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2313
2314 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2315
2316 * layout.cc (Layout::include_section): Allow a target to decide
2317 whether to include a section.
2318 * target.h (Target::should_include_section): New function.
2319 (Target::do_should_include_section): New function.
2320
2321 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2322
2323 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2324 inline into ...
2325 (Copy_relocs::emit): ... here.
2326 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2327 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2328 (Copy_reloc_entry::entries_): Change from private to protected.
2329
2330 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2331
2332 * icf.cc (get_section_contents): Replace copies of reloc
2333 vectors with const references.
2334
2335 2014-04-02 Cary Coutant <ccoutant@google.com>
2336
2337 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2338 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2339 * configure: Regenerate.
2340 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2341 -fno-use-linker-plugin.
2342 (LINK1, CXXLINK1): Add it to the link command.
2343 * testsuite/Makefile.in: Regenerate.
2344
2345 2014-03-12 Alan Modra <amodra@gmail.com>
2346
2347 * Makefile.in: Regenerate.
2348
2349 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2350
2351 * symtab.h (Symbol::set_nonvis): New function.
2352
2353 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2354
2355 * symtab.cc (Sized_symbol<32>::init_output_data):
2356 Instantiate the template.
2357 (Sized_symbol<64>::init_output_data): Likewise.
2358
2359 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2360
2361 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2362 adjust dynamic symbol value.
2363 * target.h (Target::adjust_dyn_symbol): New function.
2364 (Target::do_adjust_dyn_symbol): New function.
2365
2366 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2367
2368 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2369 Get the value of DYNAMIC_CUSTOM dynamic entry.
2370 * output.h (Output_data_dynamic::add_custom): New function.
2371 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2372 dynamic entry.
2373 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2374 * target.h (Target::dynamic_tag_custom_value): New function.
2375 (Target::do_dynamic_tag_custom_value): New function.
2376
2377 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2378
2379 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2380 dynsym indexes.
2381 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2382 (Target::do_has_custom_set_dynsym_indexes): New function.
2383 (Target::set_dynsym_indexes): New function.
2384 (Target::do_set_dynsym_indexes): New function.
2385
2386 2014-03-07 Alan Modra <amodra@gmail.com>
2387
2388 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2389 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2390 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2391 (Powerpc_relocate_functions::has_overflow_bitfield,
2392 overflowed): Use the above.
2393 (Target_powerpc::Relocate::relocate): Correct overflow checking
2394 for a number of relocations. Modify overflow test for 16-bit
2395 fields in instructions to signed/unsigned according to whether
2396 the field takes a signed or unsigned value.
2397
2398 2014-03-05 Alan Modra <amodra@gmail.com>
2399
2400 Update copyright years.
2401
2402 2014-03-05 Alan Modra <amodra@gmail.com>
2403
2404 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2405 R_PPC64_ADDR64_LOCAL.
2406 (Target_powerpc::Relocate::relocate): Likewise.
2407
2408 2014-03-03 Alan Modra <amodra@gmail.com>
2409
2410 * dwp.cc (print_version): Update copyright year to current.
2411
2412 2014-02-10 Alan Modra <amodra@gmail.com>
2413
2414 * po/gold.pot: Regenerate.
2415
2416 2014-02-06 Cary Coutant <ccoutant@google.com>
2417
2418 Fix problem where -u is ignored when a weak undef is seen.
2419
2420 * archive.cc (Library_base::should_include_member): Reorder
2421 code to check for -u option if a weak undef has already been seen.
2422 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2423 * testsuite/Makefile.in: Regenerate.
2424 * testsuite/weak_undef_file3.cc: New file.
2425 * testsuite/weak_undef_file4.cc: New file.
2426 * testsuite/weak_undef_test_2.cc: New file.
2427
2428 2014-02-05 Cary Coutant <ccoutant@google.com>
2429
2430 Fix issues with gold undefined symbol diagnostics.
2431
2432 PR binutils/15435
2433 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2434 check to here.
2435 * target-reloc.h (is_strong_undefined): New function.
2436 (relocate_section): Move undef vtable symbol check from here.
2437 Check for is_strong_undefined.
2438
2439 2014-02-05 Cary Coutant <ccoutant@google.com>
2440
2441 Fix problems with the --dynamic-list option.
2442
2443 PR gold/13577
2444 * options.cc (General_options::parse_dynamic_list):
2445 Set have_dynamic_list_.
2446 (General_options::General_options): Initialize have_dynamic_list_.
2447 (General_options::finalize): Turn off -Bsymbolic and
2448 -Bsymbolic-functions if --dynamic-list provided.
2449 * options.h (General_options::have_dynamic_list): New function.
2450 (General_options::have_dynamic_list_): New data member.
2451 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2452 correctly.
2453
2454 PR gold/16530
2455 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2456 in --dynamic-list, mark it.
2457
2458 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2459 (dynamic_list_2): New test case.
2460 * testsuite/Makefile.in: Regenerate.
2461 * testsuite/dynamic_list_2.cc: New file.
2462 * testsuite/dynamic_list_2.t: New file.
2463 * testsuite/dynamic_list_lib1.cc: New file.
2464 * testsuite/dynamic_list_lib2.cc: New file.
2465 * testsuite/gc_dynamic_list_test.c: New file.
2466 * testsuite/gc_dynamic_list_test.sh: New file.
2467 * testsuite/gc_dynamic_list_test.t: New file.
2468
2469 2014-01-28 Cary Coutant <ccoutant@google.com>
2470
2471 Add .gdb_index version 7 support.
2472
2473 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2474 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2475 debug sections.
2476 (Dwarf_ranges_table::read_ranges_table): Likewise.
2477 (Dwarf_pubnames_table::read_section): Check for GNU-style
2478 sections, and for compressed debug sections.
2479 (Dwarf_pubnames_table::read_header): Compute end address of table.
2480 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2481 for end of list by offset, not by offset == 0.
2482 (Dwarf_info_reader::do_read_string_table): Check for compressed
2483 debug sections.
2484 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2485 Initialize new data members.
2486 (Dwarf_pubnames_table::next_name): return flag_byte.
2487 (Dwarf_pubnames_table::end_of_table_): New data member.
2488 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2489 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2490 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2491 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2492 read skeleton type unit DIEs.
2493 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2494 (Gdb_index::do_write): Write flag_byte.
2495 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2496 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2497 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2498 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2499
2500 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2501
2502 * version.cc (print_version): Update copyright year to 2014.
2503
2504 2013-12-19 Dimitry Andric <dimitry@andric.com>
2505
2506 * stringpool.cc (Stringpool_template::reserve): Add
2507 HAVE_UNORDERED_MAP case.
2508 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2509
2510 2013-12-18 Cary Coutant <ccoutant@google.com>
2511
2512 * configure.ac: Check for <unordered_set> and <unordered_map>.
2513 * config.in: Regenerate.
2514 * configure: Regenerate.
2515 * system.h: Use <unordered_set> and <unordered_map> if available.
2516
2517 2013-12-10 Roland McGrath <mcgrathr@google.com>
2518
2519 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2520 with $(INSTALL_PROGRAM_ENV).
2521 * Makefile.in: Regenerate.
2522
2523 2013-11-22 Cary Coutant <ccoutant@google.com>
2524
2525 * configure.ac: Add check for which library is needed for
2526 dlopen.
2527 * configure: Regenerate.
2528
2529 2013-11-22 Cary Coutant <ccoutant@google.com>
2530
2531 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2532 assembler.
2533 * testsuite/Makefile.in: Regenerate.
2534
2535 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2536
2537 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2538 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2539 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2540 (Target_x86_64<size>::Scan::local): Likewise.
2541 (Target_x86_64<size>::Scan::global): Likewise.
2542 (Target_x86_64<size>::Relocate::relocate): Likewise.
2543 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2544 Likewise.
2545 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2546 R_X86_64_PC32_BND.
2547
2548 * testsuite/Makefile.am (check_PROGRAMS): Add
2549 exception_x86_64_bnd_test.
2550 (exception_x86_64_bnd_test_SOURCES): New macro.
2551 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2552 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2553 (exception_x86_64_bnd_test_LDADD): Likewise.
2554 (exception_x86_64_bnd_1.o): New rule.
2555 (exception_x86_64_bnd_2.o): Likewise.
2556 * testsuite/Makefile.in: Regenerated.
2557
2558 2013-11-15 Alan Modra <amodra@gmail.com>
2559
2560 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2561 accessor.
2562 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2563 Only call ppc64_local_entry_offset for 64-bit. Restrict
2564 symval_for_branch lookup to ELFv1.
2565 (Stub_table::add_plt_call_entry): Use unsigned int off.
2566 (Output_data_glink::Address, invalid_address): New.
2567 (Output_data_glink::add_eh_frame): Move out of line. Add
2568 support for ELFv2.
2569 (Output_data_glink::add_global_entry, find_global_entry,
2570 global_entry_address): New functions.
2571 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2572 ge_size): New variables.
2573 (Output_data_glink::set_final_data_size): Add global entry
2574 stub sizing.
2575 (Output_data_glink::do_write): Write global entry stubs.
2576 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2577 parameter. Return true for ELFv2. Adjust callers.
2578 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2579 ELFv1. Similarly for ifunc and dynamic relocation processing
2580 specific to ELFv1. Recognize that symbols are defined on
2581 their plt entries for ELFv2.
2582 (Target_powerpc::symval_for_branch): Assert if called for
2583 ELFv2 or ppc32.
2584 (Target_powerpc::Relocate::relocate): Use global entry plt
2585 stub for symbol value if such exists on ELFv2.
2586 (Target_powerpc::Relocate::relocate): Don't call
2587 symval_for_branch when ELFv2. Do adjust for local entry
2588 offset when ELFv2.
2589 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2590 plt stub for ELFv2.
2591 (Target_powerpc::do_plt_address_for_global): Similarly.
2592
2593 2013-11-14 Cary Coutant <ccoutant@google.com>
2594
2595 Revert patch -- this did not fix the problem, and there is
2596 no race there.
2597
2598 2013-11-14 Cary Coutant <ccoutant@google.com>
2599
2600 PR gold/14860
2601 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2602 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2603 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2604 updating fde_offsets_.
2605 (Eh_frame_hdr::lock_): New data member.
2606
2607 2013-11-14 Cary Coutant <ccoutant@google.com>
2608
2609 * dwp.cc (Dwo_file_entry): New type.
2610 (File_list): Use Dwo_file_entry.
2611 (Dwo_file::verify): New function.
2612 (Dwo_file::verify_dwo_list): New function.
2613 (Dwo_file::sized_verify_dwo_list): New function.
2614 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2615 list.
2616 (Dwp_options): New enum type.
2617 (dwp_options): Add --verify-only.
2618 (usage): Likewise.
2619 (main): Likewise.
2620 * dwp.h (gold_info): Add declaration.
2621
2622 2013-11-14 Cary Coutant <ccoutant@google.com>
2623
2624 PR gold/14860
2625 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2626 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2627 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2628 updating fde_offsets_.
2629 (Eh_frame_hdr::lock_): New data member.
2630
2631 2013-11-06 Cary Coutant <ccoutant@google.com>
2632
2633 PR gold/15758
2634 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2635 before reloc sections.
2636
2637 2013-11-04 Alan Modra <amodra@gmail.com>
2638
2639 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2640 (Symbol::needs_dynamic_reloc): Test new flag.
2641 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2642 (Target_powerpc::Scan::get_reference_flags): Add target param.
2643 Return FUNC_DESC_ABI for 64-bit ELFv1.
2644 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2645 call.
2646 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2647 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2648
2649 2013-10-31 Cary Coutant <ccoutant@google.com>
2650
2651 Restore support for dwp v2 DWARF package file format.
2652
2653 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2654 tu_length parameter. Adjust all callers.
2655 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2656 * dwp.cc: Include dwarf.h.
2657 (Section_bounds): New struct type.
2658 (Unit_set): New struct type.
2659 (Dwo_file::Dwo_file): Initialize new data member.
2660 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2661 Combine and rename to...
2662 (Dwo_file::read_unit_index): ...this.
2663 (Dwo_file::sized_read_compunit_index)
2664 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2665 (Dwo_file::sized_read_unit_index): ...this.
2666 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2667 parameters; add section_id parameter.
2668 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2669 (Dwo_file::add_unit_set): ...this.
2670 (Dwo_file::shndx_map_): Remove.
2671 (Dwo_file::sect_offsets_): New data member.
2672 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2673 (Dwp_output_file::add_section): Rename to...
2674 (Dwp_output_file::add_contribution): ...this.
2675 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2676 (Dwp_output_file::add_tu_set): Likewise.
2677 (Dwp_output_file::Contribution): New type.
2678 (Dwp_output_file::Section::contributions): New data member.
2679 (Dwp_output_file::Cu_or_tu_set): Remove.
2680 (Dwp_output_file::Section::Section): New ctor.
2681 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2682 (Dwp_output_file::Dwp_index::Section_table): New type.
2683 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2684 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2685 parameter.
2686 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2687 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2688 (Dwp_output_file::Dwp_index::section_table): New member function.
2689 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2690 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2691 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2692 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2693 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2694 (Dwp_output_file::Dwp_index::section_table_): New data member.
2695 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2696 (Dwp_output_file::add_output_section): New member function.
2697 (Dwp_output_file::write_new_section): New member function.
2698 (Dwp_output_file::write_contributions): New member function.
2699 (Dwp_output_file::section_id_map_): New data member.
2700 (class Dwo_id_info_reader): Remove.
2701 (class Unit_reader): New class.
2702 (get_dwarf_section_name): New function.
2703 (Dwo_file::read_executable): Adjust initializations of class data.
2704 (Dwo_file::read): Add support for v2 package file format.
2705 (Dwo_file::read_unit_index): Likewise.
2706 (Dwo_file::sized_read_unit_index): Likewise.
2707 (Dwo_file::copy_section): Likewise.
2708 (Dwo_file::add_unit_set): Likewise.
2709 (Dwp_output_file::add_output_section): Likewise.
2710 (Dwp_output_file::add_contribution): Likewise.
2711 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2712 for empty slot.
2713 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2714 file format.
2715 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2716 slot.
2717 (Dwp_output_file::initialize): Remove unused function.
2718 (Dwp_output_file::finalize): Add support for v2 package file format.
2719 (Dwp_output_file::write_index): Likewise.
2720 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2721 function prototype.
2722
2723 2013-10-31 Cary Coutant <ccoutant@google.com>
2724
2725 * configure.ac: Fix check for -fmerge-constants.
2726 * configure.ac: Regenerate.
2727
2728 2013-10-30 Roland McGrath <mcgrathr@google.com>
2729
2730 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2731 Correct 9-byte nop sequence to match what the assembler generates.
2732
2733 2013-10-30 Alan Modra <amodra@gmail.com>
2734
2735 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2736 ppc64_local_entry_offset, ppc64_local_entry_offset,
2737 do_read_symbols): New functions.
2738 (Powerpc_relobj::e_flags_, st_other_): New vars.
2739 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2740 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2741 (Powerpc_relobj::e_flags_): New var.
2742 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2743 and adjust for ELFv2.
2744 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2745 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2746 (Powerpc_dynobj::do_find_special_sections): Likewise.
2747 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2748 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2749 to ELFv2 local entry.
2750 (Target_powerpc::do_relax): No thread safe barriers needed for
2751 ELFv2.
2752 (Output_data_plt_powerpc::initial_plt_entry_size_,
2753 plt_entry_size): Delete. Replace all uses with
2754 first_plt_entry_offset() and plt_entry_size().
2755 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2756 reserved_size parm. Update callers.
2757 (Output_data_plt_powerpc::entry_count): Update.
2758 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2759 and use Target_powerpc::first_plt_entry_offset().
2760 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2761 rename to plt_entry_size.
2762 (Output_data_plt_powerpc::add_ifunc_entry,
2763 add_local_ifunc_entry): Adjust reloc for ELFv2.
2764 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2765 (glink_eh_frame_fde_64v2): New.
2766 (Stub_table::plt_call_size): Support ELFv2 sizing.
2767 (Output_data_glink::add_eh_frame): Use the new FDE.
2768 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2769 (Stub_table::do_write): Write ELFv2 stubs and glink.
2770 (Target_powerpc::Relocate::relocate): Replaces nop after call
2771 with ld 2,24(1) and adjust local offset destination for ELFv2.
2772
2773 2013-10-30 Alan Modra <amodra@gmail.com>
2774
2775 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2776 (Target_powerpc::Scan::global, local): Likewise.
2777 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2778 on all ppc64 @h and @ha relocs.
2779
2780 2013-10-14 Alan Modra <amodra@gmail.com>
2781
2782 * output.h (Output_data_got::add_constant): Tidy.
2783 (Output_data_got::add_constant_pair): New function.
2784 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2785 methods used so as to first call reserve_ent().
2786
2787 2013-10-11 Roland McGrath <mcgrathr@google.com>
2788
2789 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2790 add_got_entry and add_got_entry_pair.
2791
2792 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2793 (HAVE_PUBNAMES): Likewise.
2794 * configure: Regenerate.
2795
2796 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2797 * testsuite/Makefile.in: Regenerate.
2798
2799 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2800 Remove const from declaration.
2801 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2802 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2803 * output.h (Output_file_header): Remove const from member target_
2804 and corresponding constructor argument.
2805 * output.cc (Output_file_header::Output_file_header): Update prototype.
2806 (Output_file_header::do_sized_write): Use this->target_ in place
2807 of parameters()->target().
2808
2809 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2810
2811 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2812 * configure: Regenerate.
2813 * Makefile.in: Regenerate.
2814 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2815 * testsuite/merge_string_literals_2.c: Likewise.
2816 * testsuite/Makefile.am
2817 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2818 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2819 literal -fmerge-constants.
2820 * testsuite/Makefile.in: Regenerate.
2821
2822 * i386.cc (Target_i386): Remove unused member dynbss_.
2823 * arm.cc (Target_arm): Likewise.
2824 * powerpc.cc (Target_powerpc): Likewise.
2825 * sparc.cc (Target_sparc): Likewise.
2826 * tilegx.cc (Target_tilegx): Likewise.
2827 * x86_64.cc (Target_x86_64): Likewise.
2828 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2829 type_signature_, type_offset_.
2830 * plugin.h (Plugin_hook): Remove unused member layout_.
2831 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2832 mapfile_.
2833 (Read_member): Remove unused members input_objects_, symtab_,
2834 mapfile_, layout_.
2835 (Check_library): Remove unused member symtab_.
2836 * archive.h (Lib_group): Remove unused member lib_.
2837 * archive.cc (Lib_group::Lib_group): Update initializer.
2838 * incremental.h (Incremental_binary): Remove unused member target_.
2839 (Incremental_script_entry): Removed unused member script_.
2840 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2841 * icf.h (Icf): Remove unused member num_tracked_relocs.
2842
2843 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2844 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2845 its only use.
2846 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2847
2848 * archive.h: Use struct rather than class for forward declaration
2849 of Read_symbols_data.
2850
2851 2013-10-07 Cary Coutant <ccoutant@google.com>
2852
2853 PR gold/16010
2854 * testsuite/Makefile.am (icf_test): Fix dependencies.
2855 (icf_safe_test): Likewise.
2856 (icf_safe_so_test): Likewise.
2857 (large_symbol_alignment): Add empty _LDADD rule.
2858 * testsuite/Makefile.in: Regenerate.
2859
2860 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2861
2862 PR gold/15927
2863 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2864 relocation for R_X86_64_32 on x32.
2865
2866 2013-08-27 Roland McGrath <mcgrathr@google.com>
2867
2868 * output.cc (Output_segment::set_section_addresses): Take new
2869 Target* argument. If target->isolate_execinstr() and the segment
2870 is executable and starts at a target->abi_pagesize() boundary,
2871 pad its end out to a target->abi_pagesize() boundary with code fill.
2872 * output.h (Output_segment::set_section_addresses): Update decl.
2873 * layout.h (Layout::check_output_data_for_reset_values): Take new
2874 argument RELAX_OUTPUTS.
2875 (Layout): New member relax_output_list_.
2876 (Layout::add_relax_output): New method.
2877 * layout.cc (Layout::Layout): Update constructor.
2878 (Layout::reset_relax_output): New method.
2879 (Layout::clean_up_after_relaxation): Call it.
2880 (Layout::prepare_for_relaxation): Update caller.
2881 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2882 Call reset_relax_output before re-processing segments for
2883 isolate_execinstr case.
2884 (Layout::write_data): Handle relax_output_list_.
2885 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2886 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2887
2888 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2889
2890 PR binutils/15834
2891 * object.h: Fix typos.
2892
2893 2013-08-16 Roland McGrath <mcgrathr@google.com>
2894
2895 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2896 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2897
2898 2013-08-07 Cary Coutant <ccoutant@google.com>
2899
2900 Revert support for v2 DWP files:
2901
2902 2013-03-01 Cary Coutant <ccoutant@google.com>
2903
2904 Add dwp support for v2 DWARF package file format.
2905 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2906 tu_length parameter. Adjust all callers.
2907 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2908 * dwp.cc: Include dwarf.h.
2909 (Section_bounds): New struct type.
2910 (Unit_set): New struct type.
2911 (Dwo_file::Dwo_file): Initialize new data member.
2912 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2913 Combine and rename to...
2914 (Dwo_file::read_unit_index): ...this.
2915 (Dwo_file::sized_read_compunit_index)
2916 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2917 (Dwo_file::sized_read_unit_index): ...this.
2918 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2919 parameters; add section_id parameter.
2920 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2921 (Dwo_file::add_unit_set): ...this.
2922 (Dwo_file::shndx_map_): Remove.
2923 (Dwo_file::sect_offsets_): New data member.
2924 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2925 (Dwp_output_file::add_section): Rename to...
2926 (Dwp_output_file::add_contribution): ...this.
2927 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2928 (Dwp_output_file::add_tu_set): Likewise.
2929 (Dwp_output_file::Contribution): New type.
2930 (Dwp_output_file::Section::contributions): New data member.
2931 (Dwp_output_file::Cu_or_tu_set): Remove.
2932 (Dwp_output_file::Section::Section): New ctor.
2933 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2934 (Dwp_output_file::Dwp_index::Section_table): New type.
2935 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2936 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2937 parameter.
2938 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2939 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2940 (Dwp_output_file::Dwp_index::section_table): New member function.
2941 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2942 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2943 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2944 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2945 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2946 (Dwp_output_file::Dwp_index::section_table_): New data member.
2947 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2948 (Dwp_output_file::add_output_section): New member function.
2949 (Dwp_output_file::write_new_section): New member function.
2950 (Dwp_output_file::write_contributions): New member function.
2951 (Dwp_output_file::section_id_map_): New data member.
2952 (class Dwo_id_info_reader): Remove.
2953 (class Unit_reader): New class.
2954 (get_dwarf_section_name): New function.
2955 (Dwo_file::read_executable): Adjust initializations of class data.
2956 (Dwo_file::read): Add support for v2 package file format.
2957 (Dwo_file::read_unit_index): Likewise.
2958 (Dwo_file::sized_read_unit_index): Likewise.
2959 (Dwo_file::copy_section): Likewise.
2960 (Dwo_file::add_unit_set): Likewise.
2961 (Dwp_output_file::add_output_section): Likewise.
2962 (Dwp_output_file::add_contribution): Likewise.
2963 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2964 for empty slot.
2965 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2966 file format.
2967 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2968 slot.
2969 (Dwp_output_file::initialize): Remove unused function.
2970 (Dwp_output_file::finalize): Add support for v2 package file format.
2971 (Dwp_output_file::write_index): Likewise.
2972 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2973 function prototype.
2974
2975 2013-07-31 Cary Coutant <ccoutant@google.com>
2976
2977 * object.cc (Sized_relobj::do_output_section_address): New function.
2978 (Sized_relobj): Instantiate explicitly.
2979 * object.h (Object::output_section_address): New function.
2980 (Object::do_output_section_address): New function.
2981 (Sized_relobj::do_output_section_address): New function.
2982 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2983
2984 2013-07-30 Cary Coutant <ccoutant@google.com>
2985 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2986
2987 * parameters.cc (Parameters::entry): Return target-specific entry
2988 symbol name.
2989 * target.h (Target::entry_symbol_name): New function.
2990 (Target_info::entry_symbol_name): New data member.
2991
2992 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2993 * i386.cc (Target_i386::i386_info): Likewise.
2994 (Target_i386_nacl::i386_nacl_info): Likewise.
2995 * sparc.cc (Target_sparc::sparc_info): Likewise.
2996 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2997 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2998 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2999 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3000
3001 2013-07-22 Sterling Augustine <saugustine@google.com>
3002
3003 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3004 Convert parameter shndx to local variable. Add parameters symtab
3005 and symtab_size. Scan over section names. Find relocation
3006 section corresponding to current section. Create and initialize
3007 reloc_mapper_ and reloc_type_.
3008 (Dwarf_pubnames_table::read_header): Add assertion. Change
3009 unit_length to off_t. Initialize member unit_length_. Fill in field
3010 cu_offset_.
3011 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3012 Initialize new fields unit_length_ and cu_offset_.
3013 (Dwarf_pubnames_table::read_section): Update prototype.
3014 (Dwarf_pubnames_table::cu_offset): New member function.
3015 (Dwarf_pubnames_table::subsection_size): Likewise.
3016 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3017 New fields.
3018 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3019 member functions public.
3020 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3021 Update comment. Rework logic. Move repeated parts to...
3022 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3023 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3024 pubtypes_table_, and stmt_list_offset.
3025 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3026 Gdb_index::find_pubtype_offset,
3027 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3028 (Gdb_index::pubnames_read): Update prototype and rework logic.
3029 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3030 Forward declare.
3031 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3032 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3033 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3034 Gdb_index::map_pubtable_to_dies):
3035 Declare functions.
3036 (Gdb_index::pubnames_read): Update declaration.
3037 (Gdb_index::Pubname_offset_map): New type.
3038 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3039 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3040 Gdb_index::stmt_list_offset): Declare.
3041 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3042 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3043 Gdb_index::pubtypes_offset_): Remove.
3044
3045 2013-07-19 Roland McGrath <mcgrathr@google.com>
3046
3047 * options.h (General_options): Add -Trodata-segment option.
3048 * parameters.cc (Parameters::check_rodata_segment): New function.
3049 (Parameters::set_target_once): Call it.
3050 * parameters.h (Parameters): Declare it (private member function).
3051 * layout.cc (load_seg_unusable_for_headers): New function, broken
3052 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3053 then validate rodata segment rather than text segment.
3054 (relaxation_loop_body): Call that.
3055 (is_text_segment): New function. Don't admit a non-executable
3056 segment if TARGET->isolate_execinstr().
3057 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3058
3059 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
3060
3061 PR gold/15070
3062 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3063 * nacl.h (Sniff_file::View::View): Request aligned view.
3064
3065 2013-07-11 Cary Coutant <ccoutant@google.com>
3066
3067 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3068 correct BRLT entry size.
3069
3070 2013-07-03 Alan Modra <amodra@gmail.com>
3071
3072 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3073 comment.
3074
3075 2013-07-01 Cary Coutant <ccoutant@google.com>
3076
3077 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3078 reloc_type_.
3079 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3080 (Dwarf_ranges_table::lookup_reloc): New function.
3081 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3082 reloc_type_.
3083 (Dwarf_ranges_table::lookup_reloc): New function.
3084 (Dwarf_ranges_table::reloc_type_): New data member.
3085
3086 2013-06-27 Jing Yu <jingyu@google.com>
3087
3088 PR gold/15662
3089 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3090 function.
3091 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3092 (Target_powerpc::do_relax): Call the above.
3093
3094 2013-06-27 Cary Coutant <ccoutant@google.com>
3095
3096 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3097 on garbage collected .opd section.
3098
3099 2013-06-27 Alan Modra <amodra@gmail.com>
3100
3101 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3102 is non-zero.
3103 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3104 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3105
3106 2013-06-14 Cary Coutant <ccoutant@google.com>
3107
3108 * resolve.cc (Symbol::override_base): Don't override st_type
3109 from plugin placeholder symbols.
3110 (Symbol_table::resolve): Likewise.
3111 (Symbol_table::should_override): Don't complain about TLS mismatch
3112 if the TO symbol is a plugin placeholder.
3113 * testsuite/Makefile.am (plugin_test_tls): New test.
3114 * testsuite/Makefile.in: Regenerate.
3115 * testsuite/plugin_test_tls.sh: New test script.
3116 * testsuite/two_file_test_2_tls.cc: New test source.
3117 * testsuite/two_file_test_tls.cc: New test source.
3118
3119 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3120
3121 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3122 the maximum segment alignment is larger than the page size.
3123 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3124 correctly aligns the symbols with large alignemnt.
3125 * testsuite/Makefile.in: Regenerate.
3126 * testsuite/large_symbol_alignment.cc: New file.
3127
3128 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3129 Sriraman Tallam <tmsriram@google.com>
3130
3131 * options.h (sort_section): New option.
3132 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3133 Rename from Input_section_sort_section_name_special_ordering_compare.
3134 (Input_section_sort_section_name_compare): New struct.
3135 * output.cc (Output_section::Input_section_sort_section_name_compare::
3136 operator()): New function.
3137 (Output_section::sort_attached_input_sections): Use new sort function
3138 for .text if --sort-section=name is specified.
3139 * layout.cc (Layout::make_output_section):
3140 Add sorting by name when --sort-section=name is specified.
3141 * testsuite/Makefile.am (text_section_grouping): Test option
3142 --sort-section=name.
3143 * testsuite/Makefile.in: Regenerate.
3144 * testsuite/section_sorting_name.cc: New file.
3145 * testsuite/section_sorting_name.sh: New file.
3146
3147 2013-05-21 Cary Coutant <ccoutant@google.com>
3148
3149 * symtab.h (Symbol::is_cxx_vtable): New function.
3150 * target-reloc.h (relocate_section): Check for vtable symbol.
3151 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3152 * testsuite/Makefile.in: Regenerate.
3153 * testsuite/missing_key_func.cc: New test source.
3154 * testsuite/missing_key_func.sh: New test script.
3155
3156 2013-05-21 Cary Coutant <ccoutant@google.com>
3157
3158 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3159 type of enclosing symbol.
3160 (Relocate_info::location): Check symbol type when describing symbol.
3161 * object.h (Symbol_location_info): Remove unused line_number;
3162 add enclosing_symbol_type.
3163 * testsuite/debug_msg.sh: Adjust expected output.
3164
3165 2013-05-13 Cary Coutant <ccoutant@google.com>
3166
3167 * configure.ac: Export DEFAULT_TARGET.
3168 * configure: Regenerate.
3169 * Makefile.in: Regenerate.
3170 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3171 * testsuite/Makefile.in: Regenerate.
3172 * testsuite/debug_msg.sh: Delete duplicate tests.
3173 Don't check undef_int error message match for powerpc where the
3174 source file and line number aren't available.
3175
3176 2013-05-10 Roland McGrath <mcgrathr@google.com>
3177
3178 * options.h (General_options): Add --rosegment-gap option.
3179 * options.cc (finalize): --rosegment-gap implies --rosegment.
3180 * layout.cc (set_segment_offsets): Let user option override
3181 target->rosegment_gap().
3182
3183 2013-05-10 Roland McGrath <mcgrathr@google.com>
3184
3185 * options.h (General_options): Remove leading space from help
3186 messages for -nostdlib and --rosegment.
3187
3188 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3189
3190 PR ld/15365
3191 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3192
3193 2013-05-03 Alan Modra <amodra@gmail.com>
3194
3195 * merge.cc (Output_merge_string::do_add_input_section): Correct
3196 scan for number of strings. Rename vars to avoid shadowing.
3197 Include missing terminator in input_size_.
3198
3199 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3200
3201 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3202 Restore empty string handling.
3203
3204 2013-05-01 Cary Coutant <ccoutant@google.com>
3205
3206 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3207 uninitialized warning.
3208
3209 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3210
3211 * output.cc (Output_section::add_merge_input_section): Allow
3212 to merge sections if the alignment is more than character size.
3213 * merge.h (Output_merge_string::Output_merge_string): Remove
3214 assert.
3215 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3216 only not-null strings. Check the alignment of strings.
3217 * stringpool.h
3218 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3219 alignment as the argument.
3220 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3221 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3222 Align non-zero length strings according to the addralign_.
3223 (Stringpool_template<Stringpool_char>::set_string_offsets):
3224 Updating offsets according to the given alignment.
3225 * testsuite/Makefile.am (text_section_grouping): Test if string
3226 literals are getting merged.
3227 * testsuite/Makefile.in: Regenerate.
3228 * testsuite/merge_string_literals_1.c: New file.
3229 * testsuite/merge_string_literals_2.c: Ditto.
3230 * testsuite/merge_string_literals.sh: Ditto.
3231
3232 2013-04-26 Ian Lance Taylor <iant@google.com>
3233
3234 * target-reloc.h (relocate_section): If the reloc offset is out of
3235 range, pass VIEW as NULL to relocate.relocate.
3236 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3237 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3238 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3239 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3240 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3241 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3242
3243 2013-04-26 Geoff Pike <gpike@chromium.org>
3244
3245 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3246 * layout.cc (Hash_task): New class.
3247 (Layout::queue_build_id_tasks): New function.
3248 (Layout::write_build_id): Handle single-thread portion of build ID
3249 computation. (In some cases, all of it is single-threaded.) Replace
3250 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3251 functionality in fewer lines of code.
3252 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3253 * options.h (General_options): make "--build-id" default to tree
3254 rather than sha1. Add two new options related to --build-id=tree:
3255 --build-id-chunk-size-for-treehash and
3256 --build-id-min-file-size-for-treehash.
3257 * Makefile.am: add testing of --build-id=tree and related new options
3258 (these tests will be invoked by "make check").
3259 * Makefile.in: Regenerate.
3260
3261 2013-04-25 Alan Modra <amodra@gmail.com>
3262
3263 * configure.tgt: Add powerpcle and powerpc64le.
3264
3265 2013-04-22 Alan Modra <amodra@gmail.com>
3266
3267 PR gold/15355
3268 * layout.cc (Layout::segment_precedes): Allow more than one
3269 segment with the same type and flags.
3270
3271 2013-04-15 Cary Coutant <ccoutant@google.com>
3272
3273 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3274 allocate space in file for BSS sections.
3275
3276 2013-04-15 Cary Coutant <ccoutant@google.com>
3277
3278 * script-sections.cc (Orphan_output_section): Reset address
3279 to zero after each orphaned section for relocatable links.
3280
3281 2013-04-15 Cary Coutant <ccoutant@google.com>
3282
3283 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3284 section starting address for relocatable link.
3285 * testsuite/Makefile.am (script_test_11): New test.
3286 * testsuite/Makefile.in: Regenerate.
3287 * testsuite/script_test_11.c: New source file.
3288 * testsuite/script_test_11.t: New linker script.
3289
3290 2013-04-13 Alan Modra <amodra@gmail.com>
3291
3292 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3293 owner when sections are not adjacent and exceed group size.
3294 (Target_powerpc::group_sections): Handle corner case.
3295 (Target_powerpc::Branch_info::make_stub): Handle case where
3296 stub table doesn't exist due to branches in non-exec sections.
3297 (Target_powerpc::Relocate::relocate): Likewise.
3298
3299 2013-04-11 Alan Modra <amodra@gmail.com>
3300
3301 PR gold/15354
3302 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3303 .branch_lt to match bfd ld. Adjust comments throughout file.
3304
3305 2013-04-04 Ian Lance Taylor <iant@google.com>
3306
3307 GCC PR c++/56840
3308 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3309 sections before checking whether they are included in the link.
3310
3311 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3312
3313 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3314 object before calling the plugin claim_file handler. Pass the elf
3315 object of the archive to the plugin. Delete the elf object if the
3316 plugin claims the file.
3317
3318 2013-03-21 Alan Modra <amodra@gmail.com>
3319
3320 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3321 segment when omagic.
3322
3323 2013-03-21 Alan Modra <amodra@gmail.com>
3324
3325 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3326 comparison warning.
3327 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3328 uninitialized" warning.
3329
3330 2013-03-20 Alan Modra <amodra@gmail.com>
3331
3332 * symtab.h (Symbol::clear_version): New function.
3333 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3334 is_needed by weak references. Clear version for symbols defined
3335 in as-needed objects that are not needed.
3336
3337 2013-03-15 Alan Modra <amodra@gmail.com>
3338
3339 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3340 static and public. Add report_err param. Return false for data refs.
3341 (Target_powerpc::rela_dyn_section): New overloaded function.
3342 (Target_powerpc::plt_, iplt_): Elucidate.
3343 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3344 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3345 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3346 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3347 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3348 push_branch and make_plt_entry for ifunc syms when
3349 reloc_needs_plt_for_ifunc.
3350 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3351 for ifunc unless reloc_needs_plt_for_ifunc.
3352
3353 2013-03-15 Alan Modra <amodra@gmail.com>
3354
3355 * gc.h (gc_process_relocs): Don't look through function descriptors.
3356 * icf.cc (get_section_contents): Do so here instead.
3357
3358 2013-03-13 Alan Modra <amodra@gmail.com>
3359
3360 * powerpc.cc (is_branch_reloc): Forward declare.
3361 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3362 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3363 false for 64-bit, true for 32-bit non-branch relocs.
3364 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3365 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3366 nm output.
3367 (icf_safe_test): Generate linker map file as well as nm output.
3368 (icf_safe_so_test): Likewise.
3369 * testsuite/Makefile.in: Regenerate.
3370 * testsuite/icf_test.sh: Parse linker map file to determine
3371 section folding.
3372 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3373 * testsuite/icf_safe_so_test.sh: Likewise.
3374 (X86_32_or_ARM_specific_safe_fold): Merge into..
3375 (arch_specific_safe_fold): ..this.
3376 (X86_64_specific_safe_fold): Delete unused function.
3377
3378 2013-03-12 Alan Modra <amodra@gmail.com>
3379
3380 * gc.h (gc_process_relocs): Look through function descriptors
3381 to determine shndx, symvalue and addend used by ICF. Tidy
3382 variable duplication.
3383
3384 2013-03-11 Alan Modra <amodra@gmail.com>
3385
3386 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3387 * layout.cc (Layout_task_runner::run): ..to here.
3388 * symtab.h (struct Symbol_location): Extract from..
3389 (class Symbol_table): ..here.
3390 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3391 * target.h (class Target): Add function_location and
3392 do_function_location functions.
3393 (class Sized_target): Add do_function_location.
3394 * object.h (class Sized_relobj_file): Move find_shdr..
3395 (class Object): ..to here.
3396 * object.cc: Likewise. Update to suit. Instantiate.
3397 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3398 * powerpc.cc (class Powerpc_dynobj): New.
3399 (Target_powerpc::do_function_location): New function.
3400 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3401 (Powerpc_dynobj::do_read_symbols): New function.
3402 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3403
3404 2013-03-08 Ian Lance Taylor <iant@google.com>
3405
3406 * options.cc (General_options::string_to_object_format): Accept
3407 "default".
3408
3409 2013-03-08 Alan Modra <amodra@gmail.com>
3410
3411 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3412 pointer to Post_fde.
3413 (struct Post_fde): Move definition to here..
3414 * ehframe.cc (struct Post_fde): ..from here.
3415 (Cie::write): Don't alloc Post_fde.
3416 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3417
3418 2013-03-07 Alan Modra <amodra@gmail.com>
3419
3420 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3421 relocation referencing .LC0.
3422 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3423
3424 2013-03-07 Alan Modra <amodra@gmail.com>
3425
3426 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3427 always_inline. Add assembly for powerpc to avoid GOT.
3428
3429 2013-03-07 Alan Modra <amodra@gmail.com>
3430
3431 * testsuite/script_test_10.sh: Don't test .bss section
3432 header number.
3433
3434 2013-03-06 Alan Modra <amodra@gmail.com>
3435
3436 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3437 (Target_powerpc::symval_for_branch): Add symtab param. Update
3438 all callers. Handle folded sections.
3439 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3440 to Powerpc_relobj.
3441 (Global_symbol_visitor_opd::operator()): Likewise.
3442
3443 2013-03-04 Alan Modra <amodra@gmail.com>
3444
3445 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3446 * testsuite/Makefile.in: Regenerate.
3447
3448 2013-03-01 Cary Coutant <ccoutant@google.com>
3449
3450 Add dwp support for v2 DWARF package file format.
3451 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3452 tu_length parameter. Adjust all callers.
3453 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3454 * dwp.cc: Include dwarf.h.
3455 (Section_bounds): New struct type.
3456 (Unit_set): New struct type.
3457 (Dwo_file::Dwo_file): Initialize new data member.
3458 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3459 Combine and rename to...
3460 (Dwo_file::read_unit_index): ...this.
3461 (Dwo_file::sized_read_compunit_index)
3462 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3463 (Dwo_file::sized_read_unit_index): ...this.
3464 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3465 parameters; add section_id parameter.
3466 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3467 (Dwo_file::add_unit_set): ...this.
3468 (Dwo_file::shndx_map_): Remove.
3469 (Dwo_file::sect_offsets_): New data member.
3470 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3471 (Dwp_output_file::add_section): Rename to...
3472 (Dwp_output_file::add_contribution): ...this.
3473 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3474 (Dwp_output_file::add_tu_set): Likewise.
3475 (Dwp_output_file::Contribution): New type.
3476 (Dwp_output_file::Section::contributions): New data member.
3477 (Dwp_output_file::Cu_or_tu_set): Remove.
3478 (Dwp_output_file::Section::Section): New ctor.
3479 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3480 (Dwp_output_file::Dwp_index::Section_table): New type.
3481 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3482 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3483 parameter.
3484 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3485 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3486 (Dwp_output_file::Dwp_index::section_table): New member function.
3487 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3488 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3489 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3490 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3491 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3492 (Dwp_output_file::Dwp_index::section_table_): New data member.
3493 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3494 (Dwp_output_file::add_output_section): New member function.
3495 (Dwp_output_file::write_new_section): New member function.
3496 (Dwp_output_file::write_contributions): New member function.
3497 (Dwp_output_file::section_id_map_): New data member.
3498 (class Dwo_id_info_reader): Remove.
3499 (class Unit_reader): New class.
3500 (get_dwarf_section_name): New function.
3501 (Dwo_file::read_executable): Adjust initializations of class data.
3502 (Dwo_file::read): Add support for v2 package file format.
3503 (Dwo_file::read_unit_index): Likewise.
3504 (Dwo_file::sized_read_unit_index): Likewise.
3505 (Dwo_file::copy_section): Likewise.
3506 (Dwo_file::add_unit_set): Likewise.
3507 (Dwp_output_file::add_output_section): Likewise.
3508 (Dwp_output_file::add_contribution): Likewise.
3509 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3510 for empty slot.
3511 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3512 file format.
3513 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3514 slot.
3515 (Dwp_output_file::initialize): Remove unused function.
3516 (Dwp_output_file::finalize): Add support for v2 package file format.
3517 (Dwp_output_file::write_index): Likewise.
3518 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3519 function prototype.
3520
3521 2013-03-01 Cary Coutant <ccoutant@google.com>
3522
3523 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3524 function into class definition in header file.
3525 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3526 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3527 New function.
3528 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3529
3530 2013-02-28 Alan Modra <amodra@gmail.com>
3531
3532 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3533 * target.cc (Target::do_plt_fde_location): New function.
3534 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3535 accessor function, and constructor param.
3536 (struct Post_fde, Post_fdes): Declare.
3537 (Cie::write): Add post_fdes param.
3538 * ehframe.cc (Fde::write): Use plt_fde_location.
3539 (struct Post_fde): Define.
3540 (Cie::write): Stash FDEs added post merge mapping.
3541 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3542 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3543 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3544 other FDEs.
3545 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3546 (Target_powerpc::has_glink): New function.
3547 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3548 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3549 glink_eh_frame_fde_32, default_fde): New data.
3550 (Stub_table::eh_frame_added_): New var.
3551 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3552 Make const.
3553 (Stub_table::add_eh_frame): New function.
3554 (Output_data_glink::add_eh_frame): New function.
3555 (Target_powerpc::make_glink_section): Call add_eh_frame.
3556
3557 2013-02-15 Ian Lance Taylor <iant@google.com>
3558
3559 * options.h (DEFINE_uint64_alias): Define.
3560 (class General_options): Add -Ttext-segment as an alias for
3561 -Ttext.
3562
3563 2013-02-15 Alan Modra <amodra@gmail.com>
3564
3565 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3566 (Stub_table::do_write): ..here, two places.
3567 (Stub_table::plt_call_size): Use it here too.
3568
3569 2013-02-11 Ian Lance Taylor <iant@google.com>
3570
3571 * descriptors.cc (Descriptors::close_all): New function.
3572 * descriptors.h (class Descriptors): Declare close_all.
3573 (close_all_descriptors): New inline function.
3574 * plugin.cc: Include "descriptors.h".
3575 (Plugin_manager::cleanup): Call close_all_descriptors.
3576
3577 2013-02-06 Alan Modra <amodra@gmail.com>
3578
3579 * README: Update coding style link.
3580
3581 2013-01-28 Cary Coutant <ccoutant@google.com>
3582
3583 * dwp.cc (File_list): New typedef.
3584 (Dwo_name_info_reader): New class.
3585 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3586 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3587 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3588 (Dwo_file::read_executable): New function.
3589 (Dwo_file::read): Move common setup code to ...
3590 (Dwo_file::make_object): ... here.
3591 (dwp_options): Add --exec/-e.
3592 (usage): Likewise.
3593 (main): Likewise.
3594
3595 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3596
3597 * layout.cc (Layout::layout): Check for option text_reorder.
3598 (Layout::make_output_section): Ditto.
3599 * options.h (text_reorder): New option.
3600 * output.cc (Input_section_sort_compare): Remove special ordering
3601 of section names.
3602 (Output_section::
3603 Input_section_sort_section_name_special_ordering_compare::
3604 operator()): New function.
3605 (Output_section::sort_attached_input_sections): Use new sort function
3606 for .text.
3607 * output.h (Input_section_sort_section_name_special_ordering_compare):
3608 New struct.
3609 * testsuite/Makefile.am (text_section_grouping): Test option
3610 --no-text-reorder
3611 * testsuite/Makefile.in: Regenerate.
3612 * testsuite/text_section_grouping.sh: Check order of functions without
3613 default text reordering.
3614
3615 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3616
3617 * options.h (General_options): Change default to true for new_dtags.
3618
3619 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3620
3621 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3622 when enable_new_dtags is false. Only add DT_RUNPATH when
3623 enable_new_dtags is true.
3624
3625 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3626
3627 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3628 used in declaration and definition consistent.
3629 (Target_powerpc::symval_for_branch): Ditto.
3630
3631 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3632
3633 * testsuite/plugin_final_layout.cc: Fix comment.
3634
3635 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3636
3637 * layout.cc (Layout::layout): Do not do default sorting for
3638 text sections when section ordering is specified.
3639 (make_output_section): Ditto.
3640 * testsuite/plugin_final_layout.cc: Name the function sections
3641 to catch reordering issues.
3642
3643 2013-01-15 Alan Modra <amodra@gmail.com>
3644
3645 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3646 plt-thread-safe.
3647
3648 2013-01-15 Alan Modra <amodra@gmail.com>
3649
3650 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3651 * testsuite/Makefile.in: Regenerate.
3652
3653 2013-01-14 Alan Modra <amodra@gmail.com>
3654
3655 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3656 * testsuite/Makefile.in: Regenerate.
3657
3658 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3659
3660 PR bfd/14430
3661 Fix mingw gold build with plugins enabled
3662 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3663 * configure.ac: Export DLOPEN_LIBS and add headers check.
3664 * plugin.cc: Handle non-dlfcn case.
3665 * Makefile.in: Regenerate.
3666 * config.in: Regenerate.
3667 * configure: Regenerate.
3668 * testsuite/Makefile.in: Regenerate.
3669
3670 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3671
3672 * output.h (sort_attached_input_sections): Change to be public.
3673 * script-sections.cc
3674 (Output_section_definition::set_section_addresses): Sort
3675 attached input sections according to section order before linker
3676 script assigns section addresses.
3677 (Orphan_output_section::set_section_addresses): Sort
3678 attached input sections according to section order before linker
3679 script assigns section addresses.
3680 * Makefile.am (final_layout.sh): Use a simple linker script to
3681 check if section ordering still works.
3682 * Makefile.in: Regenerate.
3683
3684 2013-01-09 Ben Cheng <bccheng@google.com>
3685
3686 * arm.cc (Target_arm::attributes_accept_div): New function.
3687 (Target_arm::attributes_forbid_div): New function.
3688 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3689 attribute using the same new functions as what bfd/elf32_arm.c
3690 does.
3691
3692 2013-01-07 Cary Coutant <ccoutant@google.com>
3693
3694 PR gold/14993
3695 * output.cc (Output_section::add_input_section): For incremental
3696 updates, don't track input sections that are allocated from patch
3697 space.
3698
3699 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3700 Ian Lance Taylor <iant@google.com>
3701
3702 PR gold/14897
3703 * configure.ac (--enable-ld): Removed.
3704 (install_as_default): Set to yes only for --enable-gold=default
3705 or --disable-ld.
3706 * configure: Regenerated.
3707
3708 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3709
3710 * options.h (General_options): Add -fuse-ld= for GCC linker
3711 option compatibility.
3712
3713 2013-01-04 Cary Coutant <ccoutant@google.com>
3714
3715 * configure.ac: Fix typo restoring CXXFLAGS.
3716 * configure: Regenerate.
3717
3718 2013-01-04 Cary Coutant <ccoutant@google.com>
3719
3720 * testsuite/Makefile.am (CXXLINK_S): New macro.
3721 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3722 * testsuite/Makefile.in: Regenerate.
3723
3724 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3725
3726 * version.cc (print_version): Update copyright year to 2013.
3727
3728 2012-12-20 Ian Lance Taylor <iant@google.com>
3729
3730 * layout.cc (Layout::special_ordering_of_input_section): New
3731 function.
3732 (Layout::layout): If input section requires special ordering, must
3733 sort input sections.
3734 (Layout::make_output_section): May sort .text input sections.
3735 (Layout::is_section_name_prefix_grouped): Remove.
3736 * layout.h (class Layout): Declare
3737 special_ordering_of_input_section. Don't declare
3738 is_section_name_prefix_grouped.
3739 * output.cc (Output_section::add_input_section): Revert last
3740 change.
3741 (Output_section::Input_section_sort::match_file_name): Don't crash
3742 if called on output section data.
3743 (Output_section::Input_section_sort_compare): Sort based on
3744 special ordering.
3745 (Output_section::Input_section_sort_section_order_index_compare):
3746 Revert last patch.
3747 (Output_section::sort_attached_input_sections): Likewise.
3748
3749 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3750
3751 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3752 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3753 * output.cc (Output_section::add_input_section): Check if section
3754 name contains special prefix. Keep input sections to sort such
3755 sections.
3756 (Output_section::Input_section_sort_section_order_index_compare
3757 ::operator()): Group sections according to prefixes.
3758 (Output_section::sort_attached_input_sections): Add condition to
3759 Input_section_entry constructor call.
3760 * testsuite/Makefile.am (text_section_grouping): New test.
3761 * testsuite/Makefile.in: Regenerate.
3762 * testsuite/text_section_grouping.cc: New file.
3763 * testsuite/text_section_grouping.sh: New file.
3764
3765 2012-12-17 Nick Clifton <nickc@redhat.com>
3766
3767 * Makefile.am: Add copyright notice.
3768 * NEWS: Likewise.
3769 * README: Likewise.
3770 * configure.ac: Likewise.
3771 * ftruncate.c: Likewise.
3772 * Makefile.in: Regenerate.
3773
3774 2012-12-14 Cary Coutant <ccoutant@google.com>
3775
3776 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3777 --no-as-needed flag.
3778 (exception_separate_shared_12_test): Likewise.
3779 (incremental_copy_test): Likewise.
3780 * testsuite/Makefile.in: Regenerate.
3781
3782 2012-12-14 Cary Coutant <ccoutant@google.com>
3783
3784 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3785 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3786
3787 2012-12-12 Alan Modra <amodra@gmail.com>
3788
3789 * powerpc.cc (class Track_tls): New.
3790 (class Relocate, class Scan): Inherit Track_tls.
3791 (Target_powerpc::Scan::local, global): Track tls optimization
3792 and avoid creating plt entry for __tls_get_addr if all uses
3793 are optimized away.
3794 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3795
3796 2012-12-12 Alan Modra <amodra@gmail.com>
3797
3798 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3799 Replace no_toc_optimize with toc_optimize.
3800 * output.h (Output_section::input_sections): Provide non-const variant.
3801 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3802 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3803 accessors.
3804 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3805 (class Sort_toc_sections): New.
3806 (Target_powerpc::do_finalize_sections): Sort toc sections.
3807 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3808
3809 2012-12-10 Roland McGrath <mcgrathr@google.com>
3810
3811 * testsuite/binary_unittest.cc (read_all): New function.
3812 (Sized_binary_test): Use it instead of ::read.
3813 * fileread.cc (do_read): Don't assume pread always reads the whole
3814 amount in a single call.
3815
3816 2012-12-10 Alan Modra <amodra@gmail.com>
3817
3818 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3819 Set EM_PPC64 or EM_PPC here.
3820 (Target_selector_powerpc::do_recognize): Delete.
3821
3822 2012-12-10 Alan Modra <amodra@gmail.com>
3823
3824 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3825 stub_table_.
3826 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3827
3828 2012-12-07 Roland McGrath <mcgrathr@google.com>
3829
3830 * testsuite/binary_unittest.cc (Sized_binary_test):
3831 Use open_descriptor rather than ::open.
3832
3833 2012-12-07 Alan Modra <amodra@gmail.com>
3834
3835 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3836 typedef and invalid_address constant.
3837 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3838 instantiate constants.
3839
3840 2012-12-06 Roland McGrath <mcgrathr@google.com>
3841
3842 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3843 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3844 * aclocal.m4: Regenerate.
3845 * configure: Regenerate.
3846 * Makefile.in: Regenerate.
3847 * testsuite/Makefile.in: Regenerate.
3848
3849 2012-12-07 Alan Modra <amodra@gmail.com>
3850
3851 * options.h (General_options): Add no_toc_optimize.
3852 * powerpc.cc (ok_lo_toc_insn): New function.
3853 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3854
3855 2012-12-06 Alan Modra <amodra@gmail.com>
3856
3857 * options.h (General_options): Add plt_align, plt_static_chain,
3858 plt_thread_safe. Update stub_group_size help text.
3859 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3860 for new plt_thread_safe_ var.
3861 (use_plt_offset): Correct comments.
3862 (Target_powerpc::do_relax): Look for thread creation symbols to
3863 determine default plt_thread_safe value. Clear plt call stubs
3864 as well as branch stubs each iteration.
3865 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3866 insn constants.
3867 (l, hi, ha, write_insn): Move earlier.
3868 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3869 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3870 plt stubs too.
3871 (Stub_table::update_size): Adjust.
3872 (Stub_table::prev_size, set_prev_size): Delete.
3873 (Stub_table::stub_align): Let --plt-align affect result.
3874 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3875 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3876 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3877 (Stub_table::do_write): Support more stub variants.
3878
3879 2012-12-04 Alan Modra <amodra@gmail.com>
3880
3881 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3882 (Target_powerpc::do_define_standard_symbols): New function.
3883
3884 2012-12-03 Alan Modra <amodra@gmail.com>
3885
3886 * output.h: Formatting, whitespace.
3887
3888 2012-12-03 Alan Modra <amodra@gmail.com>
3889
3890 * layout.h (Layout::get_executable_sections): Declare.
3891 * layout.cc (Layout::get_executable_sections): New function.
3892 * arm.cc (Target_arm::group_sections): Use it.
3893 (Arm_output_section::group_sections): Delete now redundant test.
3894 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3895 param to handle relative relocs.
3896 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3897 (Output_data_reloc::add_absolute): Adjust.
3898 (Output_data_reloc::add_relative): New function.
3899 (Output_data::reset_data_size): New function.
3900 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3901 (Output_section::set_addralign): New function.
3902 (Output_section::checkpoint_set_addralign): New function.
3903 (Output_section::clear_section_offsets_need_adjustment): New function.
3904 (Output_section::input_sections): Make public.
3905 * powerpc.cc (class Output_data_brlt_powerpc): New.
3906 (class Stub_table, class Stub_control): New.
3907 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3908 stub_table_, set_stub_table, stub_table): New vectors and accessor
3909 functions.
3910 (Target_powerpc::do_may_relax, do_relax, push_branch,
3911 new_stub_table, stub_tables, brlt_section, group_sections,
3912 add_branch_lookup_table, find_branch_lookup_table,
3913 write_branch_lookup_table, make_brlt_section): New functions.
3914 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3915 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3916 branch_info_): New vars.
3917 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3918 make call stubs here.
3919 (Output_data_glink): Remove all call stub handling from this class.
3920 (Target_powerpc::Scan::local, global): Save interesting branch
3921 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3922 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3923 functions on final link.
3924 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3925 Handle long branch destinations too.
3926 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3927 do_plt_address_for_local): Adjust lookup of plt call stubs.
3928
3929 2012-11-30 Alan Modra <amodra@gmail.com>
3930
3931 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3932 relocs against protected symbols when building 32-bit shared libs.
3933
3934 2012-11-30 Alan Modra <amodra@gmail.com>
3935
3936 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3937 param. Call got_section() to make .got. Update all callers
3938 and their callers and so on.
3939
3940 2012-11-30 Alan Modra <amodra@gmail.com>
3941
3942 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3943 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3944 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3945 value if it already exists.
3946
3947 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3948
3949 PR gold/14858
3950 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3951
3952 2012-11-14 Roland McGrath <mcgrathr@google.com>
3953
3954 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3955 than bfc instruction for data sandboxing.
3956
3957 2012-11-08 Alan Modra <amodra@gmail.com>
3958
3959 * po/POTFILES.in: Regenerate.
3960
3961 2012-11-05 Alan Modra <amodra@gmail.com>
3962
3963 * configure.ac: Apply 2012-09-10 change to config.in here.
3964 * configure: Regenerate.
3965
3966 2012-11-05 Alan Modra <amodra@gmail.com>
3967
3968 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3969 (struct Opd_ent): Use "Address" rather than "Offset".
3970 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3971 (Target_powerpc::got_section): Make public.
3972 (Target_powerpc::scan_relocs): Move code setting symbols..
3973 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3974 Create _SDA_BASE_ only when referenced.
3975
3976 2012-11-02 Roland McGrath <mcgrathr@google.com>
3977
3978 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3979 from last change.
3980
3981 2012-11-01 Roland McGrath <mcgrathr@google.com>
3982
3983 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3984 for offset_in_output_section parameter.
3985 (Sized_target::relocate_special_relocatable): Likewise.
3986 * arm.cc (Target_arm::relocate_relocs): Likewise.
3987 (Target_arm::relocate_special_relocatable): Likewise.
3988 * i386.cc (Target_i386::relocate_relocs): Likewise.
3989 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3990 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3991 * target-reloc.h (relocate_relocs): Likewise.
3992 * testsuite/testfile.cc (Target_test): Likewise.
3993 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3994 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3995
3996 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3997 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3998
3999 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4000 parameter, which is unused in the [!F_SETFD] case.
4001
4002 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4003 SYMNDX to off_t before comparing it to this->data_size().
4004 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4005 * incremental.cc (Output_section_incremental_inputs::do_write):
4006 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4007
4008 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4009
4010 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4011
4012 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4013 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4014 in EABI_VER5.
4015
4016 2012-10-29 Cary Coutant <ccoutant@google.com>
4017
4018 * dwp.cc (usage): Add file and exit status parameters;
4019 add --help and --version options.
4020 (print_version): New function.
4021 (main): Add --help and --version options.
4022
4023 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4024
4025 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4026 final_layout_sequence.txt.
4027 * testsuite/Makefile.in: Regenerated.
4028
4029 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4030
4031 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4032 COMPILE generated by automake.
4033 (LINK1): Likewise.
4034 (CXXCOMPILE1): Likewise.
4035 (CXXLINK1): Likewise.
4036 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4037 (LINK): Likewise.
4038 (CXXCOMPILE): Likewise.
4039 (CXXLINK): Likewise.
4040 * testsuite/Makefile.in: Regenerated.
4041
4042 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4043
4044 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4045 on bad fwrite return.
4046
4047 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4048
4049 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4050 on val.
4051
4052 2012-10-23 Cary Coutant <ccoutant@google.com>
4053
4054 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4055 * testsuite/Makefile.in: Regenerate.
4056 * testsuite/dwp_test.h: New source file.
4057 * testsuite/dwp_test_1.cc: New source file.
4058 * testsuite/dwp_test_1.s: New source file.
4059 * testsuite/dwp_test_1.sh: New source file.
4060 * testsuite/dwp_test_1b.cc: New source file.
4061 * testsuite/dwp_test_1b.s: New source file.
4062 * testsuite/dwp_test_2.cc: New source file.
4063 * testsuite/dwp_test_2.s: New source file.
4064 * testsuite/dwp_test_2.sh: New source file.
4065 * testsuite/dwp_test_main.cc: New source file.
4066 * testsuite/dwp_test_main.s: New source file.
4067
4068 2012-10-23 Cary Coutant <ccoutant@google.com>
4069
4070 * dwp.h: New header file.
4071 * dwp.cc: New source file.
4072 * gold.h: Move shared declarations to system.h.
4073 * system.h: New header file.
4074 * Makefile.am: Add dwp.
4075 * Makefile.in: Regenerate.
4076
4077 2012-10-23 Cary Coutant <ccoutant@google.com>
4078
4079 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4080 Dwarf_info_reader::read_from_pointer.
4081 (Dwarf_pubnames_table::read_header): Likewise.
4082 (Dwarf_pubnames_table::next_name): Likewise.
4083 (Dwarf_die::read_attributes): Likewise.
4084 (Dwarf_die::skip_attributes): Likewise.
4085 (Dwarf_info_reader::read_from_pointer): New function template.
4086 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4087 (Dwarf_pubnames_table): Likewise.
4088 (Dwarf_info_reader::read_from_pointer): New function template.
4089 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4090 Dwarf_pubnames_table ctor.
4091
4092 2012-10-23 Cary Coutant <ccoutant@google.com>
4093
4094 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4095 abbrev_shndx.
4096 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4097 abbrev_shndx_.
4098 (Dwarf_info_reader::set_abbrev_shndx): New method.
4099 (Dwarf_info_reader::abbrev_shndx_): New data member.
4100
4101 2012-10-23 Cary Coutant <ccoutant@google.com>
4102
4103 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4104 from object, not parameters.
4105 (Dwarf_info_reader::parse): Likewise.
4106 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4107 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4108 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4109 methods.
4110
4111 2012-10-23 Cary Coutant <ccoutant@google.com>
4112
4113 * fileread.cc (Input_file::Input_file): New constructor.
4114 * fileread.h (class Input_file): Add new constructor.
4115
4116 2012-10-18 Alan Modra <amodra@gmail.com>
4117
4118 PR gold/14727
4119 * object.cc (Relobj::is_section_name_included): Also match
4120 .sdata personality section.
4121
4122 2012-10-18 Alan Modra <amodra@gmail.com>
4123
4124 * target-reloc.h (class Default_comdat_behavior): New, package up..
4125 (get_comdat_behaviour): ..this.
4126 (relocate_section): Add Relocate_comdat_behavior template arg,
4127 adjust code to suit.
4128 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4129 (Target_arm::scan_reloc_section): Likewise.
4130 * i386.cc (Target_i386::relocate_section): Likewise.
4131 * sparc.cc (Target_sparc::relocate_section): Likewise.
4132 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4133 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4134 * powerpc.cc (class Relocate_comdat_behavior): New.
4135 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4136 gold::relocate_section with new template arg.
4137
4138 2012-10-18 Alan Modra <amodra@gmail.com>
4139
4140 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4141 dynamic relocs for GOT_TPREL got entries, without symbol if
4142 resolving locally.
4143 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4144 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4145 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4146
4147 2012-10-17 Alan Modra <amodra@gmail.com>
4148
4149 PR gold/14726
4150 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4151
4152 2012-10-16 Sriraman Tallam <tmsriram@google.com>
4153
4154 * layout.cc (Layout::include_section): Keep sections marked
4155 SHF_EXCLUDE when doing relocatable links.
4156
4157 2012-10-16 Alan Modra <amodra@gmail.com>
4158
4159 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4160 (Target_powerpc::do_finalize_sections): Call it.
4161 (Output_data_save_res): New class and supporting functions.
4162 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4163 normal symbols defined in object files.
4164
4165 2012-10-12 Alan Modra <amodra@gmail.com>
4166
4167 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4168 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4169 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4170 section if scan_opd_relocs not yet called.
4171 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4172
4173 2012-10-12 Alan Modra <amodra@gmail.com>
4174
4175 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4176 add_local_ifunc_entry): Revert last change.
4177 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4178
4179 2012-10-05 Alan Modra <amodra@gmail.com>
4180
4181 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4182 do_plt_address_for_global): New functions.
4183 (Output_data_got_powerpc::do_write): Don't segfault when linking
4184 statically.
4185 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4186 add_local_ifunc_entry): Return true on adding entry..
4187 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4188 glink->add_entry call. Remove unused symtab param. Adjust calls.
4189 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4190 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4191 set up symbols here.
4192 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4193 syms here. Do so even when no .iplt. Don't segfault when linking
4194 statically.
4195 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4196 new variants without reloc param.
4197 (Glink_sym_ent::Glink_sym_ent): Likewise.
4198 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4199 reloc when refs will resolve to plt call stub.
4200 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4201 R_PPC_PLTREL24 to resolve locally.
4202 (Target_powerpc::Scan::global): Correct ifunc handling.
4203 (Target_powerpc::Relocate::relocate): Correct local sym glink
4204 lookup. Don't destroy "value" when we have a plt call stub,
4205 and when checking plt call validity.
4206 (Target_powerpc::do_dynsym_value): Simplify.
4207
4208 2012-10-05 Alan Modra <amodra@gmail.com>
4209
4210 * i386.cc (Output_data_plt_i386::address_for_global,
4211 address_for_local): Add plt offset to returned value. Adjust uses.
4212 * sparc.cc (Output_data_plt_sparc::address_for_global,
4213 address_for_local): Likewise.
4214 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4215 address_for_local): Likewise.
4216 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4217 address_for_local): Likewise.
4218 * target.h (Target::plt_address_for_global, plt_address_for_local):
4219 Update comment.
4220 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4221 (Output_data_got::Got_entry::write): Nor here.
4222 * output.h: Comment fix.
4223
4224 2012-10-02 Jiong Wang <jiwang@tilera.com>
4225
4226 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4227 global_offset_table_ value for larget got.
4228 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4229
4230 2012-09-29 Alan Modra <amodra@gmail.com>
4231
4232 * powerpc.cc (Target_powerpc::iplt_): New output section.
4233 (Target_powerpc::iplt_section, make_iplt_section,
4234 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4235 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4236 Target_powerpc::plt_entry_count): Count iplt entries too.
4237 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4238 reloc section in constructor. New params.
4239 (Target_powerpc::make_plt_section): Create reloc section here instead.
4240 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4241 functions.
4242 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4243 (Output_data_glink::add_entry, find_entry): New functions to
4244 deal with local syms.
4245 (Glink_sym_ent): Add support for local syms.
4246 (Output_data_glink::do_write): Handle ifunc plt entries.
4247 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4248 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4249 (Target_powerpc::Relocate::relocate): Likewise.
4250 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4251
4252 2012-09-25 Alan Modra <amodra@gmail.com>
4253
4254 * object.h (Sized_relobj_file::adjust_local_symbol,
4255 do_adjust_local_symbol): New functions.
4256 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4257 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4258 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4259 and irregular opd entry spacing.
4260 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4261 (Global_symbol_visitor_opd): New functor.
4262 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4263 on deleted opd entries.
4264
4265 2012-09-15 Jiong Wang <jiwang@tilera.com>
4266
4267 * tilegx.cc: New file.
4268 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4269 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4270 * configure.tgt: Add entries for tilegx*.
4271 * configure.ac: Likewise.
4272 * Makefile.in: Rebuild.
4273 * configure: Likewise.
4274 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4275 tilegx.
4276
4277 2012-09-13 Alan Modra <amodra@gmail.com>
4278
4279 * target-reloc.h (scan_relocs): Call scan.local for relocs
4280 against symbols in discarded sections. Pass is_discarded
4281 param.
4282 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4283 Add is_discarded param.
4284 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4285 is_discarded to flag opd entry as discarded. Don't emit dyn
4286 relocs on such entries.
4287 (Target_powerpc::Scan::global): Similarly detect and handle
4288 such opd entries.
4289 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4290 opd_ent_. Update all uses.
4291 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4292 (Target_powerpc::relocate_section): Zero out discarded opd
4293 entry relocs.
4294
4295 2012-09-12 Ian Lance Taylor <iant@google.com>
4296
4297 PR gold/14570
4298 * output.cc: Rename Output_data_got template parameter from size
4299 to got_size for all functions. Compile all variants of
4300 Output_data_got.
4301 (Output_data_got::Got_entry::write): Correct use of size for
4302 symbol value. Use local_is_tls rather than casting to
4303 Sized_relobj_file.
4304 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4305 (class Sized_relobj_file): Add do_local_is_tls.
4306 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4307
4308 2012-09-11 Alan Modra <amodra@gmail.com>
4309
4310 PR gold/14566
4311 * layout.cc (Layout::set_segment_offsets): When using
4312 common-page-size alignment, ensure we are on a new max-page-size
4313 page.
4314 * output.cc (Output_segment::set_section_addresses): Use
4315 abi_pagesize, not common_pagesize for relro boundary.
4316 (Output_segment::set_offset): Likewise.
4317
4318 2012-09-11 Alan Modra <amodra@gmail.com>
4319
4320 * output.h (Output_data_got::add_global_tls, add_local_tls,
4321 add_local_tls_pair): New functions.
4322 (Output_data_got::add_local_pair_with_rel): Remove second
4323 reloc param. Expand comment.
4324 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4325 use_plt_or_tls_offset_, similarly for constructor param.
4326 (Output_data_got::Got_entry::write): Add got_index param.
4327 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4328 add_local_tls_pair): New functions.
4329 (Output_data_got::Got_entry::write): Handle tls symbols
4330 with use_plt_or_tls_offset_ set specially.
4331 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4332 (Output_data_got::do_write): Replace iterator with index, pass
4333 index to entry write function.
4334 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4335 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4336 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4337 call.
4338 * i386.cc (Target_i386::Scan::local): Likewise.
4339 * sparc.cc (Target_sparc::Scan::local): Likewise.
4340 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4341 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4342 do_tls_offset_for_global): New functions.
4343 (Target_powerpc::Scan::local): Correct TLS relocations and got
4344 entry values.
4345 (Target_powerpc::Scan::global): Don't emit unnecessary
4346 dynamic relocations on TLS GOT entries.
4347
4348 2012-09-10 Matthias Klose <doko@ubuntu.com>
4349
4350 * config.in: Disable sanity check for kfreebsd.
4351
4352 2012-09-10 Sterling Augustine <saugustine@google.com>
4353
4354 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4355 (Gdb_index::pubtypes_read): New parameter.
4356 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4357 to calls.
4358 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4359 pubtypes_object_.
4360
4361 2012-09-09 Alan Modra <amodra@gmail.com>
4362
4363 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4364 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4365 * gc.h (gc_process_relocs): Call target gc_add_reference.
4366 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4367 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4368 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4369 unnecessary cast.
4370 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4371 to cater for when we don't need code offset. Update use.
4372 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4373 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4374 set_opd_valid): New functions.
4375 (Target_powerpc::do_gc_add_reference): New function.
4376 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4377 stashed refs.
4378 (Target_powerpc::do_gc_mark_symbol): New function.
4379
4380 2012-09-06 Cary Coutant <ccoutant@google.com>
4381
4382 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4383 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4384 (Dwarf_die::skip_attributes): Likewise.
4385 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4386 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4387 (main): Call it.
4388 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4389
4390 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4391
4392 * testsuite/script_test_3.t: Add .got.plt output section
4393 statement.
4394 * testsuite/script_test_4.t: Likewise.
4395
4396 2012-09-05 Alan Modra <amodra@gmail.com>
4397
4398 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4399 update all uses and lose "enum" when using type.
4400
4401 2012-09-05 Alan Modra <amodra@gmail.com>
4402
4403 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4404 * configure: Regenerate.
4405 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4406 (plugin_final_layout.stdout): Likewise.
4407 (memory_test): Set page sizes to 0x1000.
4408 * testsuite/Makefile.in: Regenerate.
4409 * testsuite/discard_locals_test.sh: Add FIXME comment.
4410 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4411 * testsuite/pr14265.t: Add .got output section statement.
4412 * testsuite/script_test_2.t: Likewise.
4413 * testsuite/script_test_3.t: Likewise.
4414 * testsuite/script_test_4.t: Likewise.
4415 * testsuite/script_test_5.t: Likewise.
4416 * testsuite/script_test_6.t: Likewise.
4417 * testsuite/script_test_7.t: Likewise.
4418 * testsuite/script_test_9.t: Likewise.
4419
4420 2012-09-05 Alan Modra <amodra@gmail.com>
4421
4422 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4423 (Powerpc_relocate_functions::Status): New typedef.
4424 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4425 (Target_powerpc::Scan::local): Handle REL64.
4426 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4427 for REL32 and REL64.
4428 (Target_powerpc::symval_for_branch): New function, extracted from..
4429 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4430 checks. Report overflow errors.
4431
4432 2012-09-05 Alan Modra <amodra@gmail.com>
4433
4434 * object.h (Sized_relobj_file::emit_relocs): Delete.
4435 (Sized_relobj_file::emit_relocs_reltype): Delete.
4436 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4437 relocate_relocs for --emit-relocs.
4438 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4439 * output.h: Update comment.
4440 (Output_segment::first_section): New function.
4441 (Output_segment::first_section_load_address): Use first_section.
4442 * output.cc (Output_segment::first_section): New function extracted..
4443 (Output_segment::first_section_load_address): ..from here. Delete.
4444 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4445 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4446 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4447 adjust call to target.h function.
4448 * i386.cc (Target_i386): Likewise.
4449 * sparc.cc (Target_sparc): Likewise.
4450 * x86_64.cc (Target_x86_64): Likewise.
4451 * powerpc.cc (Target_powerpc): Likewise.
4452 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4453 first tls section has section symbol for optimised local dynamic
4454 output relocs.
4455 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4456 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4457 optimised tls code.
4458 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4459 Rename to relocate_relocs. Update error message.
4460
4461 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4462
4463 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4464 --just-symbols.
4465
4466 2012-08-31 Alan Modra <amodra@gmail.com>
4467
4468 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4469 (Powerpc_relobj::toc_base_offset): New stub function.
4470 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4471 got_mod_index_offset to tlsld_got_offset. Update all refs.
4472 (Target_powerpc::Relocate::enum skip_tls): New.
4473 (Target_powerpc::call_tls_get_addr_): New var.
4474 (Target_powerpc::is_branch_reloc): Move to file scope.
4475 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4476 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4477 New functions.
4478 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4479 (powerpc_info): Correct common_pagesize for ppc64.
4480 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4481 (Powerpc_relocate_functions): Add overflow check enums and functions.
4482 Add non-shift version of rela, rela_ua. Delete all rel public
4483 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4484 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4485 addr16_ha3, addr14 functions.
4486 (Output_data_got_powerpc::add_constant_pair): New function.
4487 (Output_data_got_powerpc::got_base_offset): Likewise.
4488 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4489 (instruction constants): Sort, add some more.
4490 (Output_data_glink::do_write): Add and use Address typedef. Use
4491 object->toc_base_offset() stub for 64-bit.
4492 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4493 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4494 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4495 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4496 Always treat .opd relocs as against locally defined symbol.
4497 Correct condition for RELATIVE relocs.
4498 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4499 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4500 for 32-bit syms with a plt entry. Correct ppc64 toc base
4501 calculations. Handle TLS relocs, and more. Add overflow
4502 checking and adjust for Powerpc_relocate_functions changes.
4503 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4504 Reinstate --emit-relocs code with FIXME.
4505
4506 2012-08-30 Alan Modra <amodra@gmail.com>
4507
4508 * layout.cc (Layout::set_segment_offsets): Set p_align to
4509 abi_pagesize, not common_pagesize.
4510 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4511 to determine whether file header can go in segment.
4512
4513 2012-08-30 Alan Modra <amodra@gmail.com>
4514
4515 * output.h (Output_reloc::Output_reloc <output section>): Add
4516 is_relative param. Adjust calls.
4517 (Output_reloc::add_output_section_relative): New functions.
4518 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4519 is_relative.
4520 (Output_reloc::symbol_value): Handle SECTION_CODE.
4521
4522 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4523
4524 * gold.cc (queue_middle_tasks): Call layout again when unique
4525 segments for sections is desired.
4526 * layout.cc (Layout::Layout): Initialize new members.
4527 (Layout::get_output_section_flags): New function.
4528 (Layout::choose_output_section): Call get_output_section_flags.
4529 (Layout::layout): Make output section for mapping to a unique segment.
4530 (Layout::insert_section_segment_map): New function.
4531 (Layout::attach_allocated_section_to_segment): Make unique segment for
4532 output sections marked so.
4533 (Layout::segment_precedes): Check for unique segments when sorting.
4534 * layout.h (Layout::Unique_segment_info): New struct.
4535 (Layout::Section_segment_map): New typedef.
4536 (Layout::insert_section_segment_map): New function.
4537 (Layout::get_output_section_flags): New function.
4538 (Layout::is_unique_segment_for_sections_specified): New function.
4539 (Layout::set_unique_segment_for_sections_specified): New function.
4540 (Layout::unique_segment_for_sections_specified_): New member.
4541 (Layout::section_segment_map_): New member.
4542 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4543 Rename is_gc_pass_one to is_pass_one.
4544 Rename is_gc_pass_two to is_pass_two.
4545 Rename is_gc_or_icf to is_two_pass.
4546 Check for which pass based on whether symbols data is present.
4547 Make it two pass when unique segments for sections is desired.
4548 * output.cc (Output_section::Output_section): Initialize new
4549 members.
4550 * output.h (Output_section::is_unique_segment): New function.
4551 (Output_section::set_is_unique_segment): New function.
4552 (Output_section::is_unique_segment_): New member.
4553 (Output_section::extra_segment_flags): New function.
4554 (Output_section::set_extra_segment_flags): New function.
4555 (Output_section::extra_segment_flags_): New member.
4556 (Output_section::segment_alignment): New function.
4557 (Output_section::set_segment_alignment): New function.
4558 (Output_section::segment_alignment_): New member.
4559 (Output_segment::Output_segment): Initialize is_unique_segment_.
4560 (Output_segment::is_unique_segment): New function.
4561 (Output_segment::set_is_unique_segment): New function.
4562 (Output_segment::is_unique_segment_): New member.
4563 * plugin.cc (allow_unique_segment_for_sections): New function.
4564 (unique_segment_for_sections): New function.
4565 (Plugin::load): Add new functions to transfer vector.
4566 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4567 * Makefile.in: Regenerate.
4568 * testsuite/plugin_final_layout.sh: Check if unique segment
4569 functionality works.
4570 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4571 are available.
4572 (allow_unique_segment_for_sections): New global.
4573 (unique_segment_for_sections): New global.
4574 (claim_file_hook): Call allow_unique_segment_for_sections.
4575 (all_symbols_read_hook): Call unique_segment_for_sections.
4576
4577 2012-08-22 Cary Coutant <ccoutant@google.com>
4578
4579 * layout.cc (Layout::include_section): Don't assert on GROUP
4580 sections with --emit-relocs.
4581
4582 2012-08-21 Cary Coutant <ccoutant@google.com>
4583
4584 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4585 if --export-dynamic-symbol names an undef symbol.
4586
4587 2012-08-18 Alan Modra <amodra@gmail.com>
4588
4589 * powerpc.cc: Formatting and white space.
4590 (Powerpc_relobj): Rename got2_section_ to special_.
4591 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4592 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4593 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4594 (Target_powerpc): Add Address typedef and invalid_address. Use
4595 throughout.
4596 (Target_powerpc::is_branch_reloc): New function.
4597 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4598 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4599 for dst_mask, value and addend.
4600 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4601 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4602 (Output_data_glink::do_write): Correct toc base. Don't try to use
4603 uint16_t for 24-bit offset. Use get_output_section_offset and
4604 check return.
4605 (Target_powerpc::Scan::local): Handle more relocs.
4606 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4607 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4608 Plug in toc restoring insn after plt calls. Translate branches
4609 to function descriptor symbols to corresponding entry point.
4610 (Target_powerpc::relocate_for_relocatable): Check return from
4611 get_output_section_offset.
4612 * symtab.h: Comment typo.
4613
4614 2012-08-14 Ian Lance Taylor <iant@google.com>
4615
4616 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4617 unsupported_relocal_local to call unsupported_reloc_global.
4618
4619 2012-08-14 Nick Clifton <nickc@redhat.com>
4620
4621 PR ld/14265
4622 * script-sections.cc (Sections_element::output_section_name): Add
4623 keep return parameter.
4624 (Output_section_element::match_name): Add keep return parameter.
4625 Return the value of the keep_ member.
4626 * script-sections.h (class Output_section): Update
4627 output_section_name prototype.
4628 * layout.cc (Layout::keep_input_section): New public member
4629 function.
4630 (Layout::choose_output_section): Pass keep parameter to
4631 output_section_name.
4632 * layout.h (class Layout): Add keep_input_section.
4633 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4634 sections.
4635 * testsuite/Makefile.am: Add a test.
4636 * testsuite/Makefile.in: Regenerate.
4637 * testsuite/pr14265.c: Source file for the test.
4638 * testsuite/pr14265.t: Linker script for the test.
4639 * testsuite/pr14265.sh: Shell script for the test.
4640
4641 2012-08-14 Alan Modra <amodra@gmail.com>
4642
4643 * target.h (Target::output_section_name): New function.
4644 (Target::do_output_section_name): New function.
4645 * layout.cc (Layout::choose_output_section): Call the above.
4646 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4647
4648 2012-08-14 Alan Modra <amodra@gmail.com>
4649
4650 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4651 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4652 for replace_constant call.
4653 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4654 (Output_data_glink::do_print_to_mapfile): New function.
4655 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4656 (Target_powerpc::Relocate::relocate): Likewise.
4657
4658 2012-08-14 Alan Modra <amodra@gmail.com>
4659
4660 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4661 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4662 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4663 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4664 all references to shndx_. Handle special case for R_PPC_PLTREL24
4665 here.
4666 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4667 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4668 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4669 here.
4670 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4671 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4672
4673 2012-08-12 Alan Modra <amodra@gmail.com>
4674
4675 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4676 (glink insn constants): Use uint32_t.
4677 (Output_data_glink::add_entry): Use insert, not [] operator.
4678
4679 2012-08-11 Alan Modra <amodra@gmail.com>
4680
4681 * object.h (Sized_relobj_file::find_shdr): New function.
4682 (Sized_relobj_file::find_special_sections): New function.
4683 * object.cc (Sized_relobj_file::find_shdr): New function.
4684 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4685 (Sized_relobj_file::find_special_sections): New function, split out..
4686 (Sized_relobj_file::do_read_symbols): ..from here.
4687 * output.h (Output_data_got::replace_constant): New function.
4688 (Output_data_got::num_entries): New function.
4689 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4690 (Output_data_got::got_offset): Protected rather than private.
4691 (Output_data_got::replace_got_entry): New function.
4692 * output.cc (Output_data_got::replace_got_entry): New function.
4693 * powerpc.cc (class Powerpc_relobj): New.
4694 (class Powerpc_relocate_functions): Delete all psymval variants or
4695 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4696 Implement _ha functions using corresponding _hi function.
4697 (Powerpc_relobj::find_special_sections): New function.
4698 (Target_powerpc::do_make_elf_object): New function.
4699 (class Output_data_got_powerpc): New.
4700 (class Output_data_glink): New.
4701 (class Powerpc_scan_relocatable_reloc): New.
4702 Many more changes througout file.
4703
4704 2012-08-09 Nick Clifton <nickc@redhat.com>
4705
4706 * po/vi.po: Updated Vietnamese translation.
4707
4708 2012-08-07 Ian Lance Taylor <iant@google.com>
4709
4710 * layout.cc (Layout::add_target_dynamic_tags): If
4711 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4712 plt_rel.
4713
4714 2012-07-30 Nick Clifton <nickc@redhat.com>
4715
4716 * po/gold.pot: Updated template.
4717 * po/es.po: Updated Spanish translation.
4718
4719 2012-07-18 Cary Coutant <ccoutant@google.com>
4720
4721 PR gold/14344
4722 * configure.ac: Add check for -gpubnames support.
4723 * configure: Regenerate.
4724 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4725 support; force -gno-pubnames.
4726 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4727 support.
4728 (gdb_index_test_4): New test.
4729 * testsuite/Makefile.in: Regenerate.
4730 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4731 * testsuite/gdb_index_test_2.sh: Likewise.
4732 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4733 * testsuite/gdb_index_test_4.sh: New script.
4734 * testsuite/gdb_index_test_comm.sh: New script with common code;
4735 don't look for space after colon.
4736
4737 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4738
4739 * gold.cc (queue_middle_tasks): Update function order only after
4740 deferred objects due to plugins are processed.
4741
4742 2012-07-11 Ian Lance Taylor <iant@google.com>
4743
4744 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4745 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4746 (Target_arm::scan_reloc_for_stub): Likewise.
4747 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4748 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4749 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4750 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4751 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4752
4753 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4754 Ian Lance Taylor <iant@google.com>
4755
4756 PR gold/14309
4757 * configure.ac: Test whether std::tr1::hash<off_t> works.
4758 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4759 needed.
4760 * output.h (class Output_fill): Add virtual destructor.
4761 * configure, config.in: Rebuild.
4762
4763 2012-06-22 Roland McGrath <mcgrathr@google.com>
4764
4765 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4766
4767 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4768
4769 * plugin.cc (Plugin::load): Handle position independent executables.
4770
4771 2012-06-06 Cary Coutant <ccoutant@google.com>
4772
4773 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4774 add .debug_macro.
4775 (lines_only_debug_sections): Likewise.
4776 (gdb_fast_lookup_sections): New static array.
4777 (is_gdb_debug_section): Rename formal parameter.
4778 (is_lines_only_debug_section): Likewise.
4779 (is_gdb_fast_lookup_section): New function.
4780 (Layout::include_section): Check for ".zdebug_" prefix; pass
4781 section name suffix to is_gdb_debug_section, et al.; check for
4782 fast-lookup sections when building .gdb_index.
4783 * options.h (--strip-debug-gdb): Update GDB version number.
4784
4785 2012-06-06 Cary Coutant <ccoutant@google.com>
4786
4787 * configure.ac: Add check for fallocate.
4788 * configure: Regenerate.
4789 * config.in: Regenerate.
4790
4791 * options.h (class General_options): Add --mmap-output-file and
4792 --posix-fallocate options.
4793 * output.cc: (posix_fallocate): Remove; replace with...
4794 (gold_fallocate): New function.
4795 (Output_file::map_no_anonymous): Call gold_fallocate.
4796 (Output_file::map): Check --mmap-output-file option.
4797
4798 2012-06-05 Jing Yu <jingyu@google.com>
4799
4800 * gold.h (textdomain): Add do {} to empty while(0).
4801 (bindtextdomain): Likewise.
4802
4803 2012-06-04 Cary Coutant <ccoutant@google.com>
4804
4805 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4806 has_dynsym_index.
4807
4808 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4809
4810 * symtab.cc (Symbol_table::define_special_symbol):
4811 Initialize *poldsym to prevent uninitialized variable errors.
4812
4813 2012-05-23 Cary Coutant <ccoutant@google.com>
4814
4815 * layout.cc (Layout::section_name_mapping): Add rules to handle
4816 exact match on .data.rel.ro.local or .data.rel.ro.
4817 (Layout::output_section_name): Check for exact matches.
4818
4819 2012-05-23 Cary Coutant <ccoutant@google.com>
4820
4821 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4822 more carefully.
4823
4824 2012-05-22 Cary Coutant <ccoutant@google.com>
4825
4826 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4827 object before exporting symbol.
4828
4829 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4830
4831 * testsuite/tls_test.cc: Include "config.h" first.
4832 * testsuite/tls_test_c.c: Likewise.
4833
4834 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4835 Nick Clifton <nickc@redhat.com>
4836
4837 PR 14072
4838 * configure.in: Add check that sysdep.h has been included before
4839 any system header files.
4840 * configure: Regenerate.
4841 * config.in: Regenerate.
4842
4843 2012-05-14 Cary Coutant <ccoutant@google.com>
4844
4845 * layout.cc (Layout::make_output_section): Mark .tdata section
4846 as RELRO.
4847 * testsuite/relro_test.cc: Add a TLS variable.
4848
4849 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4850
4851 PR gold/14091
4852 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4853 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4854 R_X86_64_64.
4855
4856 2012-05-08 Cary Coutant <ccoutant@google.com>
4857
4858 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4859 (lines_only_debug_sections): Likewise.
4860
4861 2012-05-02 Roland McGrath <mcgrathr@google.com>
4862
4863 * nacl.cc: New file.
4864 * nacl.h: New file.
4865 * Makefile.am (CCFILES, HFILES): Add them.
4866 * Makefile.in: Regenerate.
4867 * i386.cc (Output_data_plt_i386_nacl): New class.
4868 (Output_data_plt_i386_nacl_exec): New class.
4869 (Output_data_plt_i386_nacl_dyn): New class.
4870 (Target_i386_nacl): New class.
4871 (Target_selector_i386_nacl): New class.
4872 (target_selector_i386): Use it instead of Target_selector_i386.
4873 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4874 (Target_x86_64_nacl): New class.
4875 (Target_selector_x86_64_nacl): New class.
4876 (target_selector_x86_64, target_selector_x32): Use it instead of
4877 Target_selector_x86_64.
4878 * arm.cc (Output_data_plt_arm_nacl): New class.
4879 (Target_arm_nacl): New class.
4880 (Target_selector_arm_nacl): New class.
4881 (target_selector_arm, target_selector_armbe): Use it instead of
4882 Target_selector_arm.
4883
4884 * target-select.cc (select_target): Take new Input_file* and off_t
4885 arguments, pass them on to recognize method of selector.
4886 * object.cc (make_elf_sized_object): Update caller.
4887 * parameters.cc (parameters_force_valid_target): Likewise.
4888 * incremental.cc (make_sized_incremental_binary): Likewise.
4889 * target-select.h: Update decl.
4890 (Target_selector::recognize): Take new Input_file* argument,
4891 pass it on to do_recognize.
4892 (Target_selector::do_recognize): Take new Input_file* argument.
4893 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4894 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4895 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4896 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4897
4898 * target.h (Target::Target_info): New members isolate_execinstr
4899 and rosegment_gap.
4900 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4901 * arm.cc (Target_arm::arm_info): Update initializer.
4902 * i386.cc (Target_i386::i386_info): Likewise.
4903 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4904 * sparc.cc (Target_sparc::sparc_info): Likewise.
4905 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4906 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4907 * layout.cc (Layout::attach_allocated_section_to_segment):
4908 Take new const Target* argument. If target->isolate_execinstr(), act
4909 like --rosegment.
4910 (Layout::find_first_load_seg): Take new const Target* argument;
4911 if target->isolate_execinstr(), reject PF_X segments.
4912 (Layout::relaxation_loop_body): Update caller.
4913 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4914 reset file offset to zero when we hit LOAD_SEG, and then do a second
4915 loop over the segments before LOAD_SEG to reassign offsets after
4916 addresses have been determined. Handle target->rosegment_gap().
4917 (Layout::attach_section_to_segment): Take new const Target* argument;
4918 pass it to attach_allocated_section_to_segment.
4919 (Layout::make_output_section): Update caller.
4920 (Layout::attach_sections_to_segments): Take new const Target* argument;
4921 pass it to attach_section_to_segment.
4922 * gold.cc (queue_middle_tasks): Update caller.
4923 * layout.h (Layout): Update method decls with new arguments.
4924
4925 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4926 Target_info pointer to use.
4927 (Target_arm::do_make_data_plt): New virtual method.
4928 (Target_arm::make_data_plt): New method that calls it.
4929 (Target_arm::make_plt_entry): Use it.
4930 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4931 for the section alignment.
4932 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4933 method.
4934 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4935 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4936 method.
4937 (Output_data_plt_arm::get_plt_entry_size): Call it.
4938 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4939 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4940 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4941 method.
4942 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4943 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4944 method instead of sizeof(plt_entry).
4945 (Output_data_plt_arm::add_entry): Likewise.
4946 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4947 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4948 than static method.
4949 (Target_arm::plt_entry_size): Likewise.
4950 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4951 Move to ...
4952 (Output_data_plt_arm_standard): ... here, new class.
4953 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4954 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4955 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4956
4957 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4958 Take additional argument for the PLT entry size.
4959 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4960 Use get_plt_entry_size method rather than plt_entry_size variable.
4961 (Output_data_plt_x86_64::reserve_slot): Likewise.
4962 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4963 (Output_data_plt_x86_64::add_entry): Likewise.
4964 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4965 (Output_data_plt_x86_64::address_for_global): Likewise.
4966 (Output_data_plt_x86_64::address_for_local): Likewise.
4967 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4968 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4969 Make method non-static.
4970 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4971 method.
4972 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4973 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4974 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4975 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4976 virtual method.
4977 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4978 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4979 virtual method.
4980 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4981 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4982 virtual method.
4983 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4984 (Output_data_plt_x86_64::plt_entry_size)
4985 (Output_data_plt_x86_64::first_plt_entry)
4986 (Output_data_plt_x86_64::plt_entry)
4987 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4988 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4989 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4990 (Output_data_plt_x86_64_standard): ... here, new class.
4991 (Target_x86_64::Target_x86_64): Take optional argument for the
4992 Target_info pointer to use.
4993 (Target_x86_64::do_make_data_plt): New virtual method.
4994 (Target_x86_64::make_data_plt): New method to call it.
4995 (Target_x86_64::init_got_plt_for_update): Use that.
4996 Call this->plt_->add_eh_frame method here.
4997 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4998 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4999 rather than static method.
5000 (Target_x86_64::plt_entry_size): Likewise.
5001 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5002 rather than plt_entry_size variable. Move guts of PLT filling to...
5003 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5004 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5005 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5006
5007 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5008 additional argument for the section alignment.
5009 Don't do add_eh_frame_for_plt here.
5010 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5011 non-static. Use get_plt_entry_size method rather than plt_entry_size
5012 variable.
5013 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5014 method.
5015 (Output_data_plt_i386::get_plt_entry_size): Call it.
5016 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5017 (Output_data_plt_i386::add_eh_frame): New method to call it.
5018 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5019 method.
5020 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5021 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5022 method.
5023 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5024 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5025 method instead of plt_entry_size.
5026 (Output_data_plt_i386::plt_entry_size)
5027 (Output_data_plt_i386::plt_eh_frame_fde_size)
5028 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5029 (Output_data_plt_i386_standard): ... here, new class.
5030 (Output_data_plt_i386_exec): New class.
5031 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5032 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5033 (Output_data_plt_i386::exec_plt_entry): Move to ...
5034 (Output_data_plt_i386_exec::plt_entry): ... here.
5035 (Output_data_plt_i386_dyn): New class.
5036 (Output_data_plt_i386::first_plt_entry): Move to ...
5037 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5038 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5039 (Output_data_plt_i386_dyn::plt_entry): ... here.
5040 (Target_i386::Target_i386): Take optional argument for the Target_info
5041 pointer to use.
5042 (Target_i386::do_make_data_plt): New virtual method.
5043 (Target_i386::make_data_plt): New method to call it.
5044 (Target_i386::make_plt_section): Use that.
5045 Call this->plt_->add_eh_frame method here.
5046 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5047 rather than plt_entry_size variable.
5048 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5049 (Output_data_plt_i386::address_for_local): Likewise.
5050 (Output_data_plt_i386::do_write): Likewise.
5051 Move guts of PLT filling to...
5052 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5053 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5054 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5055 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5056
5057 2012-05-01 Cary Coutant <ccoutant@google.com>
5058
5059 * dwarf_reader.cc (Dwarf_die::read_attributes)
5060 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5061 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5062 * reduced_debug_output.cc
5063 (Output_reduced_debug_info_section::get_die_end): Remove
5064 DW_FORM_GNU_ref_index. Add default case.
5065
5066 2012-04-26 Mark Wielaard <mjw@redhat.com>
5067
5068 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5069 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5070 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5071 DW_AT_high_pc as offset from DW_AT_low_pc.
5072
5073 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5074 * testsuite/Makefile.in: Regenerate.
5075 * testsuite/gdb_index_test_3.c: New test source file.
5076 * testsuite/gdb_index_test_3.sh: New test source file.
5077
5078 2012-04-25 Ian Lance Taylor <iant@google.com>
5079
5080 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5081 pointer.
5082 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5083 as a class, not a struct.
5084 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5085 (Target_arm::apply_cortex_a8_workaround): Likewise.
5086 * gc.h: Declare Reloc_types as a struct, not a class.
5087 * object.h: Declare Symbols_data as a struct.
5088 * reloc.h: Declare Read_relocs_data as a struct.
5089 * target.h: Declare Relocate_info as a struct.
5090
5091 2012-04-24 David S. Miller <davem@davemloft.net>
5092
5093 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5094 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5095 and R_SPARC_WPLT30.
5096
5097 2012-04-24 Cary Coutant <ccoutant@google.com>
5098
5099 * incremental-dump.cc (find_input_containing_global): Replace
5100 magic number with symbolic constant.
5101 (dump_incremental_inputs): Update version number.
5102 * incremental.cc (Output_section_incremental_inputs): Update version
5103 number; import symbolic constants from Incremental_inputs_reader.
5104 (Incremental_inputs::create_data_sections): Align relocations
5105 section correctly for 64-bit targets.
5106 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5107 constants; add padding.
5108 (Output_section_incremental_inputs::write_header): Add assert for
5109 header_size.
5110 (Output_section_incremental_inputs::write_input_files): Add assert
5111 for input_entry_size.
5112 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5113 add assert for object_info_size, input_section_entry_size,
5114 global_sym_entry_size.
5115 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5116 for data structure sizes; use them.
5117 (Incremental_input_entry_reader): Import symbolic constants from
5118 Incremental_inputs_reader; use them.
5119
5120 2012-04-23 David S. Miller <davem@davemloft.net>
5121
5122 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5123 and elf_flags_set_.
5124 (Target_sparc::Target_sparc): Initialize new fields.
5125 (Target_sparc::do_make_elf_object): New function.
5126 (Target_sparc::do_adjust_elf_header): New function.
5127
5128 2012-04-23 Cary Coutant <ccoutant@google.com>
5129
5130 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5131 CU range table of gdb index.
5132
5133 2012-04-20 David S. Miller <davem@davemloft.net>
5134
5135 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5136 instead of false.
5137
5138 2012-04-16 David S. Miller <davem@davemloft.net>
5139
5140 * sparc.cc (Target_sparc::got_address): New function.
5141 (Sparc_relocate_functions::gdop_hix22): New function.
5142 (Sparc_relocate_functions::gdop_lox10): New function.
5143 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5144 relocs.
5145 (Target_sparc::Scan::local): Likewise if the global symbol is not
5146 preemptible and is not IFUNC.
5147 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5148 transformations for local and non-preemptible non-IFUNC global
5149 symbols.
5150
5151 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5152 writing out 64-bit part of ranges.
5153
5154 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5155 -fpic and -fpie respectively.
5156 * Makefile.in: Regenerate.
5157
5158 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5159 (Target_sparc::Target_sparc): Initialize new field.
5160 (Target_sparc::do_plt_section_for_global): New function.
5161 (Target_sparc::do_plt_section_for_local): New function.
5162 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5163 (Target_sparc::make_plt_section): New function, broken out of
5164 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5165 (Target_sparc::make_plt_entry): Call make_plt_section.
5166 (Target_sparc::make_local_ifunc_plt_entry): New function.
5167 (Target_sparc::rela_ifunc_section): New function.
5168 (Target_sparc::plt_section): Remove const.
5169 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5170 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5171 and ifunc_count_ fields.
5172 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5173 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5174 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5175 (Output_data_plt_sparc::rela_ifunc): New function.
5176 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5177 (Output_data_plt_sparc::has_ifunc_section): New function.
5178 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5179 (Output_data_plt_sparc::address_for_global): New function.
5180 (Output_data_plt_sparc::address_for_local): New function.
5181 (Output_data_plt_sparc::plt_index_to_offset): New function.
5182 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5183 and entry_count.
5184 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5185 entry_count.
5186 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5187 R_SPARC_JMP_IREL to switch.
5188 (Target_sparc::Scan::check_non_pic): Likewise.
5189 (Target_sparc::Scan::local): Handle IFUNC symbols.
5190 (Target_sparc::Scan::local): Likewise.
5191 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5192 and plt_address_for_local.
5193 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5194 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5195
5196 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5197 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5198 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5199 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5200 global relocs too.
5201 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5202 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5203 calls.
5204 * sparc.cc (Target_sparc::Scan::global): Likewise.
5205 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5206
5207 2012-04-16 Cary Coutant <ccoutant@google.com>
5208
5209 * archive.cc (Library_base::should_include_member): Check for
5210 --export-dynamic-symbol.
5211 * options.h (class General_options): Add --export-dynamic-symbol.
5212 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5213 --export-dynamic-symbol.
5214 (Symbol_table::gc_mark_undef_symbols): Likewise.
5215 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5216
5217 2012-04-12 David S. Miller <davem@davemloft.net>
5218
5219 * sparc.cc (Reloc::wdisp10): New relocation method.
5220 (Reloc::h34): Likewise.
5221 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5222 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5223 R_SPARC_WDISP10.
5224 (Target_sparc::Scan::local): Likewise.
5225 (Target_sparc::Scan::global): Likewise.
5226 (Target_sparc::Relocate::relocate): Likewise.
5227
5228 2012-04-09 Cary Coutant <ccoutant@google.com>
5229
5230 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5231 low_pc == 0.
5232
5233 2012-04-06 Ian Lance Taylor <iant@google.com>
5234
5235 * timer.cc: #include <unistd.h>.
5236
5237 2012-04-06 Roland McGrath <mcgrathr@google.com>
5238
5239 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5240 * config.in: Regenerate.
5241 * configure: Regenerate.
5242
5243 2012-04-05 Nick Clifton <nickc@redhat.com>
5244
5245 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5246 (AM_LC_MESSAGES): Add.
5247 * aclocal.m4: Regenerate.
5248 * config.in: Regenerate.
5249 * configure: Regenerate.
5250
5251 2012-03-21 Cary Coutant <ccoutant@google.com>
5252
5253 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5254 * Makefile.in: Regenerate.
5255 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5256 (Sized_elf_reloc_mapper::symbol_section): New function.
5257 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5258 (make_elf_reloc_mapper): New function.
5259 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5260 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5261 (Dwarf_abbrev_table::do_get_abbrev): New function.
5262 (Dwarf_ranges_table::read_ranges_table): New function.
5263 (Dwarf_ranges_table::read_range_list): New function.
5264 (Dwarf_pubnames_table::read_section): New function.
5265 (Dwarf_pubnames_table::read_header): New function.
5266 (Dwarf_pubnames_table::next_name): New function.
5267 (Dwarf_die::Dwarf_die): New function.
5268 (Dwarf_die::read_attributes): New function.
5269 (Dwarf_die::skip_attributes): New function.
5270 (Dwarf_die::set_name): New function.
5271 (Dwarf_die::set_linkage_name): New function.
5272 (Dwarf_die::attribute): New function.
5273 (Dwarf_die::string_attribute): New function.
5274 (Dwarf_die::int_attribute): New function.
5275 (Dwarf_die::uint_attribute): New function.
5276 (Dwarf_die::ref_attribute): New function.
5277 (Dwarf_die::child_offset): New function.
5278 (Dwarf_die::sibling_offset): New function.
5279 (Dwarf_info_reader::check_buffer): New function.
5280 (Dwarf_info_reader::parse): New function.
5281 (Dwarf_info_reader::do_parse): New function.
5282 (Dwarf_info_reader::do_read_string_table): New function.
5283 (Dwarf_info_reader::lookup_reloc): New function.
5284 (Dwarf_info_reader::get_string): New function.
5285 (Dwarf_info_reader::visit_compilation_unit): New function.
5286 (Dwarf_info_reader::visit_type_unit): New function.
5287 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5288 Sized_elf_reloc_mapper.
5289 (Sized_dwarf_line_info::symbol_section): Remove function.
5290 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5291 (Sized_dwarf_line_info::read_line_mappings): Remove object
5292 parameter, adjust callers.
5293 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5294 * dwarf_reader.h: Include <sys/types.h>.
5295 (class Track_relocs): Remove forward declaration.
5296 (class Elf_reloc_mapper): New class.
5297 (class Sized_elf_reloc_mapper): New class.
5298 (class Dwarf_abbrev_table): New class.
5299 (class Dwarf_range_list): New class.
5300 (class Dwarf_ranges_table): New class.
5301 (class Dwarf_pubnames_table): New class.
5302 (class Dwarf_die): New class.
5303 (class Dwarf_info_reader): New class.
5304 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5305 (Sized_dwarf_line_info::symbol_section): Remove member function.
5306 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5307 base class.
5308 * gdb-index.cc: New source file.
5309 * gdb-index.h: New source file.
5310 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5311 and .debug_types sections, call Layout::add_to_gdb_index.
5312 (Sized_relobj_incr::do_section_name): Implement.
5313 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5314 return type; Implement.
5315 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5316 return type.
5317 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5318 parameter list and return type.
5319 (Sized_incr_dynobj::do_section_contents): Likewise.
5320 * layout.cc: Include gdb-index.h.
5321 (Layout::Layout): Initialize gdb_index_data_.
5322 (Layout::init_fixed_output_section): Check for .gdb_index section.
5323 (Layout::add_to_gdb_index): New function. Instantiate.
5324 * layout.h: Add forward declaration for class Gdb_index.
5325 (Layout::add_to_gdb_index): New member function.
5326 (Layout::gdb_index_data_): New data member.
5327 * main.cc: Include gdb-index.h.
5328 (main): Print statistics for gdb index.
5329 * object.cc (Object::section_contents): Move code into
5330 do_section_contents.
5331 (need_decompressed_section): Check for sections needed when building
5332 gdb index.
5333 (build_compressed_section_map): Likewise.
5334 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5335 gdb index.
5336 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5337 sections; call Layout::add_to_gdb_index.
5338 (Sized_relobj_file::do_decompressed_section_contents): Call
5339 do_section_contents directly.
5340 * object.h (Object::do_section_contents): Adjust parameter list and
5341 return type.
5342 (Object::do_decompressed_section_contents): Call do_section_contents
5343 directly.
5344 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5345 return type.
5346 * options.h (class General_options): Add --gdb-index option.
5347 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5348 list and return type.
5349 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5350 * reloc.h (Track_relocs::checkpoint): New function.
5351 (Track_relocs::reset): New function.
5352
5353 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5354 New test cases.
5355 * testsuite/Makefile.in: Regenerate.
5356 * testsuite/gdb_index_test.cc: New test source file.
5357 * testsuite/gdb_index_test_1.sh: New test source file.
5358 * testsuite/gdb_index_test_2.sh: New test source file.
5359
5360 2012-03-19 Doug Kwan <dougkwan@google.com>
5361
5362 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5363 (Target_arm::do_finalize_sections): Remove code which defines
5364 __exidx_start and __exidx_end. Make symbol table parameter
5365 anonymous as it is not used.
5366 * gold.cc (queue_middle_tasks): Call target hook to define any
5367 target-specific symbols.
5368 * target.h (Target::define_standard_symbols): New method.
5369 (Target::do_define_standard_symbols): Same.
5370 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5371 * testsuite/Makefile.in: Regenerate.
5372 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5373 and __exidx_end.
5374 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5375 relocations are generated for __exidx_start and __exidx_end.
5376
5377 2012-03-16 Doug Kwan <dougkwan@google.com>
5378
5379 * testsuite/Makefile.am: Disable test initpri3b.
5380 * testsuite/Makefile.in: Regenerate.
5381
5382 2012-03-15 Doug Kwan <dougkwan@google.com>
5383
5384 * arm.cc (Target_arm::got_section): Make .got section read-only
5385 if -z now is given.
5386
5387 2012-03-15 Ian Lance Taylor <iant@google.com>
5388
5389 PR gold/13850
5390 * layout.cc (Layout::make_output_section): Correctly mark
5391 SHT_INIT_ARRAY, et. al., as relro.
5392
5393 2012-03-14 Doug Kwan <dougkwan@google.com>
5394
5395 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5396 dynamic relocations for protected symbols in shared objects.
5397
5398 2012-03-13 Ian Lance Taylor <iant@google.com>
5399
5400 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5401 keep the larger alignment.
5402
5403 2012-03-12 Cary Coutant <ccoutant@google.com>
5404
5405 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5406 handling of DW_LNE_define_file.
5407
5408 2012-03-12 Cary Coutant <ccoutant@google.com>
5409
5410 * reduced_debug_output.cc
5411 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5412 codes to switch.
5413
5414 2012-02-29 Cary Coutant <ccoutant@google.com>
5415
5416 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5417
5418 2012-02-29 Cary Coutant <ccoutant@google.com>
5419
5420 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5421 Call Object::decompressed_section_contents.
5422 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5423 New dtor.
5424 (Sized_dwarf_line_info::buffer_start_): New data member.
5425 * merge.cc (Output_merge_data::do_add_input_section): Call
5426 Object::decompressed_section_contents.
5427 (Output_merge_string::do_add_input_section): Likewise.
5428 * object.cc (need_decompressed_section): New function.
5429 (build_compressed_section_map): Decompress sections needed later.
5430 (Sized_relobj_file::do_decompressed_section_contents): New function.
5431 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5432 * object.h (Object::decompressed_section_contents): New function.
5433 (Object::discard_decompressed_sections): New function.
5434 (Object::do_decompressed_section_contents): New function.
5435 (Object::do_discard_decompressed_sections): New function.
5436 (Compressed_section_info): New type.
5437 (Compressed_section_map): Include decompressed section contents.
5438 (Sized_relobj_file::do_decompressed_section_contents): New function.
5439 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5440
5441 2012-02-16 Cary Coutant <ccoutant@google.com>
5442
5443 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5444 * testsuite/Makefile.in: Regenerate.
5445
5446 2012-02-14 Cary Coutant <ccoutant@google.com>
5447
5448 * options.cc (General_options::finalize): Disallow -pie and -static.
5449
5450 2012-02-03 Doug Kwan <dougkwan@google.com>
5451
5452 * arm.cc (Arm_relocate_functions::abs8,
5453 Arm_relocate_functions::abs16): Use
5454 Bits::has_signed_unsigned_overflow32.
5455 (Arm_relocate_functions::thm_abs8): Correct range of
5456 overflow check.
5457 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5458 in assertions.
5459
5460 2012-02-02 Doug Kwan <dougkwan@google.com>
5461
5462 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5463 position independent outputs, not just shared objects.
5464
5465 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5466
5467 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5468 * configure: Regenerated.
5469
5470 2012-01-27 Ian Lance Taylor <iant@google.com>
5471
5472 * reloc.h (Bits): New class with static functions, copied from
5473 namespace utils in arm.cc.
5474 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5475 instead.
5476
5477 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5478
5479 * incremental.cc (write_info_blocks): Correct relocation offset.
5480
5481 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5482
5483 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5484 (Relocate::tls_gd_to_le): Likewise.
5485
5486 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5487
5488 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5489
5490 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5491
5492 * configure.ac: Check if -mcmodel=medium works.
5493 * configure: Regenerated.
5494
5495 2012-01-24 Cary Coutant <ccoutant@google.com>
5496
5497 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5498 definition and ...
5499 (read_unsigned_LEB_128_x): ... this new function.
5500 (read_signed_LEB_128): Replaced with inline definition and ...
5501 (read_signed_LEB_128_x): ... this new function.
5502 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5503 (read_unsigned_LEB_128): Add inline definition.
5504 (read_signed_LEB_128_x): New function.
5505 (read_signed_LEB_128): Add inline definition.
5506 * testsuite/Makefile.am (leb128_unittest): New unit test.
5507 * testsuite/Makefile.in: Regenerate.
5508 * testsuite/leb128_unittest.cc: New unit test.
5509
5510 2012-01-23 Ian Lance Taylor <iant@google.com>
5511
5512 PR gold/13617
5513 * i386.cc (Target_i386::do_code_fill): When using a jmp
5514 instruction, pad with nop instructions.
5515 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5516
5517 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5518
5519 * x86_64.cc (gc_process_relocs): Add typename on types used in
5520 template.
5521 (scan_relocs): Likewise.
5522 (relocate_section): Likewise.
5523 (apply_relocation): Likewise.
5524
5525 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5526
5527 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5528 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5529 under x32.
5530
5531 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5532
5533 * x86_64.cc: Initial support for x32.
5534
5535 2012-01-03 Cary Coutant <ccoutant@google.com>
5536
5537 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5538 Use abstract base class for GOT.
5539 * gold/output.h (class Output_data_got_base): New abstract base class.
5540 (class Output_data_got): Derive from new base class, adjust ctors.
5541 (Output_data_got::reserve_slot): Make virtual; rename to
5542 do_reserve_slot; Adjust callers.
5543 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5544 pointer to abstract base class.
5545 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5546
5547 2011-12-18 Ian Lance Taylor <iant@google.com>
5548
5549 * object.h (Relobj::local_symbol_value): New function.
5550 (Relobj::local_plt_offset): New function.
5551 (Relobj::local_has_got_offset): New function.
5552 (Relobj::local_got_offset): New function.
5553 (Relobj::set_local_got_offset): New function.
5554 (Relobj::do_local_symbol_value): New pure virtual function.
5555 (Relobj::do_local_plt_offset): Likewise.
5556 (Relobj::do_local_has_got_offset): Likewise.
5557 (Relobj::do_local_got_offset): Likewise.
5558 (Relobj::do_set_local_got_offset): Likewise.
5559 (Sized_relobj::do_local_has_got_offset): Rename from
5560 local_has_got_offset.
5561 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5562 (Sized_relobj::do_set_local_got_offset): Rename from
5563 set_local_got_offset.
5564 (Sized_relobj_file::do_local_plt_offset): Rename from
5565 local_plt_offset.
5566 (Sized_relobj_file::do_local_symbol_value): New function.
5567 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5568 local_plt_offset.
5569 * output.cc (Output_data_got::Got_entry::write): Change object to
5570 Relobj. Use local_symbol_value.
5571 (Output_data_got::add_global_with_rel): Change rel_dyn to
5572 Output_data_reloc_generic*. Use add_global_generic.
5573 (Output_data_got::add_global_with_rela): Remove. Change all
5574 callers to use add_global_with_rel.
5575 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5576 Output_data_reloc_generic*. Use add_global_generic.
5577 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5578 callers to use add_global_pair_with_rel.
5579 (Output_data_got::add_local): Change object to Relobj*.
5580 (Output_data_got::add_local_plt): Likewise.
5581 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5582 change rel_dyn to Output_data_reloc_generic*. Use
5583 add_local_generic.
5584 (Output_data_got::add_local_with_rela): Remove. Change all
5585 callers to use all_local_with_rel.
5586 (Output_data_got::add_local_pair_with_rel): Change object to
5587 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5588 add_output_section_generic.
5589 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5590 callers to use add_local_pair_with_rel.
5591 (Output_data_got::reserve_local): Change object to Relobj*.
5592 * output.h: (class Output_data_reloc_generic): Add pure virtual
5593 declarations for add_global_generic, add_local_generic,
5594 add_output_section_generic.
5595 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5596 functions for Output_data_reloc_generic. Update declarations for
5597 changes listed in output.cc.
5598 (class Output_data_got): Change template parameter to got_size.
5599 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5600 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5601 function.
5602 (Sized_relobj_incr::do_local_plt_offset): New function.
5603 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5604 add_global_generic.
5605
5606 2011-12-17 Cary Coutant <ccoutant@google.com>
5607
5608 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5609 * resolve.cc (Symbol_table::resolve): Likewise.
5610 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5611 arrays.
5612 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5613
5614 2011-12-16 Ian Lance Taylor <iant@google.com>
5615
5616 * output.h (Output_data_reloc_generic::add): Only call
5617 add_dynamic_reloc if this is a dynamic reloc section.
5618
5619 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5620
5621 PR gold/13505
5622 * target-reloc.h (apply_relocation): Replace <64, false> with
5623 <size, big_endian>.
5624
5625 2011-11-25 Nick Clifton <nickc@redhat.com>
5626
5627 * po/it.po: New Italian translation.
5628
5629 2011-11-17 Sterling Augustine <saugustine@google.com>
5630
5631 * script.cc (script_include_directive): Implement.
5632 (read_script_file): New local variables name and search_path. Update
5633 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5634 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5635 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5636
5637 2011-11-11 Sterling Augustine <saugustine@google.com>
5638
5639 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5640 (file_or_sections_cmd): Likewise.
5641
5642 2011-11-11 Doug Kwan <dougkwan@google.com>
5643
5644 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5645 if --just-symbols is given.
5646
5647 2011-11-10 Doug Kwan <dougkwan@google.com>
5648
5649 PR gold/13362
5650 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5651 when processing data relocs.
5652 * reloc.h (Relocate_functions::rel_unaligned): New method.
5653 (Relocate_functions::pcrel_unaligned): Ditto.
5654 (Relocate_functions::rel32_unaligned): Ditto.
5655 (Relocate_functions::pcrel32_unaligned): Ditto.
5656
5657 2011-11-09 Doug Kwan <dougkwan@google.com>
5658
5659 PR gold/13362
5660 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5661 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5662 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5663 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5664 (Relocate_functions::rel_unaligned): New.
5665 (Relocate_functions::rel32_unaligned): New.
5666 * target-reloc.h (relocate_for_relocatable): Add code to handle
5667 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5668 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5669 arm_unaligned_reloc_r): New targets.
5670 * testsuite/Makefile.in: Regenerate.
5671 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5672 linking.
5673
5674 2011-11-02 Ian Lance Taylor <iant@google.com>
5675
5676 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5677 NATIVE_LINKER.
5678 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5679 * options.cc (General_options::finalize): Use library search path
5680 from configure script if specified. If not native and no sysroot,
5681 only search TOOLLIBDIR.
5682 * options.h (Search_directory::Search_directory): Change name to
5683 const std::string&.
5684 (General_options::add_to_library_path_with_sysroot): Change arg to
5685 const std::string&.
5686 * configure, Makefile.in, config.in: Rebuild.
5687
5688 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5689
5690 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5691 we are working around the ARM1176 Erratum.
5692 * options.h (General_options::fix_arm1176): Add option.
5693 * testsuite/Makefile.am: Add testcases, and keep current ones
5694 working.
5695 * testsuite/Makefile.in: Regenerate.
5696 * testsuite/arm_fix_1176.s: New file.
5697 * testsuite/arm_fix_1176.sh: Likewise.
5698
5699 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5700
5701 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5702 may_use_blx_.
5703 (Target_arm::may_use_blx): Remove method.
5704 (Target_arm::set_may_use_blx): Likewise.
5705 (Target_arm::may_use_v4t_interworking): New method.
5706 (Target_arm::may_use_v5t_interworking): Likewise.
5707 (Target_arm::may_use_blx_): Remove member variable.
5708 (Arm_relocate_functions::arm_branch_common): Check for v5T
5709 interworking.
5710 (Arm_relocate_functions::thumb_branch_common): Likewise.
5711 (Reloc_stub::stub_type_for_reloc): Likewise.
5712 (Target_arm::do_finalize_sections): Correct interworking checks.
5713 * testsuite/Makefile.am: Add new tests.
5714 * testsuite/Makefile.in: Regenerate.
5715 * testsuite/arm_farcall_arm_arm.s: New test.
5716 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5717 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5718 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5719 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5720 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5721 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5722 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5723
5724 2011-10-31 Cary Coutant <ccoutant@google.com>
5725
5726 PR gold/13023
5727 * expression.cc (Expression::eval_with_dot): Add
5728 is_section_dot_assignment parameter.
5729 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5730 absolute and assigning to dot within a section.
5731 * script-sections.cc
5732 (Output_section_element_assignment::set_section_addresses): Pass
5733 dot_section to set_if_absolute.
5734 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5735 as is_section_dot_assignment flag to eval_with_dot.
5736 (Output_section_element_dot_assignment::set_section_addresses):
5737 Likewise.
5738 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5739 parameter. Also set value if relative to dot_section; set the
5740 symbol's output_section.
5741 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5742 parameter. Adjust all callers.
5743 (Expression::eval_maybe_dot): Likewise.
5744 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5745 Adjust all callers.
5746 * testsuite/script_test_2.t: Test assignment of an absolute value
5747 to dot within an output section element.
5748
5749 2011-10-31 Cary Coutant <ccoutant@google.com>
5750
5751 * options.h (class General_options): Add --[no-]gnu-unique options.
5752 * symtab.cc (Symbol_table::sized_write_globals): Convert
5753 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5754
5755 2011-10-31 Cary Coutant <ccoutant@google.com>
5756
5757 PR gold/13359
5758 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5759 unnecessary assertion.
5760 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5761
5762 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5763
5764 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5765 gc_mark_symbol.
5766 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5767 gc_mark_symbol.
5768 Change to just keep the section associated with symbol.
5769 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5770 they are externally visible and --export-dynamic is turned on.
5771 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5772
5773 2011-10-19 Ian Lance Taylor <iant@google.com>
5774
5775 PR gold/13163
5776 * script-sections.cc
5777 (Output_section_element_dot_assignment::needs_output_section): New
5778 function.
5779
5780 2011-10-19 Ian Lance Taylor <iant@google.com>
5781
5782 PR gold/13204
5783 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5784 --section-start option was seen.
5785 * options.h (General_options::any_section_start): New function.
5786
5787 2011-10-18 David S. Miller <davem@davemloft.net>
5788
5789 PR binutils/13301
5790 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5791 member to track relocation locations that have moved during TLS
5792 reloc optimizations.
5793 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5794 (Target_sparc::Relocate::relocate): Adjust view down by 4
5795 bytes if it matches reloc_adjust_addr_.
5796 (Target_sparc::Relocate::relocate_tls): Always move the
5797 __tls_get_addr call delay slot instruction forward 4 bytes when
5798 performing relaxation.
5799
5800 2011-10-18 Cary Coutant <ccoutant@google.com>
5801
5802 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5803 (Output_file::map_no_anonymous): Check for non-zero
5804 return code from posix_fallocate.
5805
5806 2011-10-17 Cary Coutant <ccoutant@google.com>
5807
5808 PR gold/13245
5809 * plugin.cc (is_visible_from_outside): Check for symbols
5810 referenced from dynamic objects.
5811 * resolve.cc (Symbol_table::resolve): Don't count references
5812 from dynamic objects as references from real ELF files.
5813 * testsuite/plugin_test_2.sh: Adjust expected result.
5814
5815 2011-10-17 Cary Coutant <ccoutant@google.com>
5816
5817 * gold.cc: Include timer.h.
5818 (queue_middle_tasks): Stamp time.
5819 (queue_final_tasks): Likewise.
5820 * main.cc (main): Store timer in parameters. Print timers
5821 for each pass.
5822 * parameters.cc (Parameters::Parameters): Initialize timer_.
5823 (Parameters::set_timer): New function.
5824 (set_parameters_timer): New function.
5825 * parameters.h (Parameters::set_timer): New function.
5826 (Parameters::timer): New function.
5827 (Parameters::timer_): New data member.
5828 (set_parameters_timer): New function.
5829 * timer.cc (Timer::stamp): New function.
5830 (Timer::get_pass_time): New function.
5831 * timer.h (Timer::stamp): New function.
5832 (Timer::get_pass_time): New function.
5833 (Timer::pass_times_): New data member.
5834
5835 2011-10-17 Cary Coutant <ccoutant@google.com>
5836
5837 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5838 task for members of lib groups.
5839
5840 2011-10-17 Cary Coutant <ccoutant@google.com>
5841
5842 PR gold/13288
5843 * fileread.cc (File_read::find_view): Add assert.
5844 (File_read::make_view): Move bounds check (replace with assert)...
5845 (File_read::find_or_make_view): ... to here.
5846
5847 2011-10-12 Cary Coutant <ccoutant@google.com>
5848
5849 * output.cc (Output_file::open_base_file): Handle case where
5850 ::read returns less than requested size.
5851
5852 2011-10-10 Cary Coutant <ccoutant@google.com>
5853
5854 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5855 Initialize defined_count_.
5856 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5857 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5858 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5859 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5860 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5861 * incremental.h (Sized_relobj_incr::defined_count_): New data
5862 member.
5863 (Sized_incr_dynobj::defined_count_): New data member.
5864 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5865 Return zeroes instead of internal error.
5866
5867 2011-10-10 Cary Coutant <ccoutant@google.com>
5868
5869 PR gold/13249
5870 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5871 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5872 * output.h (class Output_reloc): Add use_plt_offset flag.
5873 (Output_reloc::type_): Adjust size of bit field.
5874 (Output_reloc::use_plt_offset_): New bit field.
5875 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5876 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5877 flag. Adjust all callers.
5878 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5879 creating RELATIVE relocations.
5880
5881 2011-10-10 Nick Clifton <nickc@redhat.com>
5882
5883 * po/es.po: Updated Spanish translation.
5884 * po/fi.po: Updated Finnish translation.
5885
5886 2011-10-03 Diego Novillo <dnovillo@google.com>
5887
5888 * options.cc (parse_uint): Fix dereference of RETVAL.
5889
5890 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5891
5892 * layout.h (section_order_map_): New member.
5893 (get_section_order_map): New member function.
5894 * output.cc (Output_section::add_input_section): Check for patterns
5895 only when --section-ordering-file is specified.
5896 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5897 output_sections have been formed.
5898 * layout.cc (Layout_Layout): Initialize section_order_map_.
5899 * plugin.cc (update_section_order): Store order in order_map. Do not
5900 update the order.
5901 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5902 * testsuite/Makefile.in: Regenerate.
5903 * testsuite/plugin_section_order.c: New file.
5904 * testsuite/plugin_final_layout.cc: New file.
5905 * testsuite/plugin_final_layout.sh: New file.
5906
5907 2011-09-29 Cary Coutant <ccoutant@google.com>
5908
5909 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5910 Check for NULL.
5911 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5912 symbols during incremental update.
5913 (Symbol_table::add_from_dynobj): Likewise.
5914
5915 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5916 Ian Lance Taylor <iant@google.com>
5917
5918 * symtab.cc (Symbol_table::define_special_symbol): Always
5919 canonicalize version string.
5920
5921 2011-09-26 Cary Coutant <ccoutant@google.com>
5922
5923 * gold.cc (queue_initial_tasks): Move option checks ...
5924 * options.cc (General_options::finalize): ... to here. Disable
5925 some options; make others fatal.
5926
5927 2011-09-26 Cary Coutant <ccoutant@google.com>
5928
5929 gcc PR lto/47247
5930 * plugin.cc (get_symbols_v2): New function.
5931 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5932 (is_referenced_from_outside): New function.
5933 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5934 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5935 (get_symbols): Pass version parameter.
5936 (get_symbols_v2): New function.
5937 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5938 parameter.
5939 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5940 (onload): Add LDPT_GET_SYMBOLS_V2.
5941 (all_symbols_read_hook): Use get_symbols_v2; check for
5942 LDPR_PREVAILING_DEF_IRONLY_EXP.
5943 * testsuite/plugin_test_3.sh: Update expected results.
5944
5945 2011-09-23 Simon Baldwin <simonb@google.com>
5946
5947 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5948 configuration options.
5949 * configure: Regenerate.
5950 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5951 * Makefile.in: Regenerate.
5952 * testsuite/Makefile.in: Regenerate.
5953
5954 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5955
5956 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5957
5958 2011-09-19 Cary Coutant <ccoutant@google.com>
5959
5960 * incremental.cc (can_incremental_update): Fix typo in comment.
5961 * incremental.h (can_incremental_update): Likewise.
5962
5963 2011-09-18 Cary Coutant <ccoutant@google.com>
5964
5965 * incremental.cc (can_incremental_update): New function.
5966 * incremental.h (can_incremental_update): New function.
5967 * layout.cc (Layout::init_fixed_output_section): Call it.
5968 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5969 * object.cc (Sized_relobj_file::do_layout): Call
5970 can_incremental_update.
5971
5972 2011-09-13 Cary Coutant <ccoutant@google.com>
5973
5974 * configure.ac: Check for glibc support for gnu_indirect_function
5975 support with static linking, setting automake conditional
5976 IFUNC_STATIC.
5977 * Makefile.in: Regenerate.
5978 * configure: Regenerate.
5979
5980 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5981 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5982 for IFUNC_STATIC.
5983 * testsuite/Makefile.in: Regenerate.
5984
5985 2011-09-13 Cary Coutant <ccoutant@google.com>
5986
5987 * incremental.cc (Sized_relobj_incr::do_layout): Call
5988 report_comdat_group for kept comdat sections.
5989 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5990 * testsuite/Makefile.in: Regenerate.
5991 * testsuite/incr_comdat_test_1.cc: New source file.
5992 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5993 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5994 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5995
5996 2011-09-13 Ian Lance Taylor <iant@google.com>
5997
5998 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5999 variable external_symbols_offset.
6000
6001 2011-09-12 Ian Lance Taylor <iant@google.com>
6002
6003 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6004 triggered if object has no symbols.
6005
6006 2011-09-09 David S. Miller <davem@davemloft.net>
6007
6008 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6009 (Output_fill_debug_line::do_write): Likewise.
6010
6011 2011-08-29 Cary Coutant <ccoutant@google.com>
6012
6013 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6014 casts to match formatting specs.
6015 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6016
6017 2011-08-26 Cary Coutant <ccoutant@google.com>
6018
6019 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6020 remaining hole size when allocating.
6021 (Layout::make_output_section): Set fill methods for debug sections.
6022 * layout.h (Free_list::Free_list_node): Move from private to
6023 public.
6024 (Free_list::set_min_hole_size): New function.
6025 (Free_list::begin, Free_list::end): New functions.
6026 (Free_list::min_hole_): New data member.
6027 * output.cc: Include dwarf.h.
6028 (Output_fill_debug_info::do_minimum_hole_size): New function.
6029 (Output_fill_debug_info::do_write): New function.
6030 (Output_fill_debug_line::do_minimum_hole_size): New function.
6031 (Output_fill_debug_line::do_write): New function.
6032 (Output_section::Output_section): Initialize new data member.
6033 (Output_section::set_final_data_size): Ensure patch space is larger
6034 than minimum hole size.
6035 (Output_section::do_write): Fill holes in debug sections.
6036 * output.h (Output_fill): New class.
6037 (Output_fill_debug_info): New class.
6038 (Output_fill_debug_line): New class.
6039 (Output_section::set_free_space_fill): New function.
6040 (Output_section::free_space_fill_): New data member.
6041 * testsuite/Makefile.am (incremental_test_3): Add
6042 --incremental-patch option.
6043 (incremental_test_4): Likewise.
6044 (incremental_test_5): Likewise.
6045 (incremental_test_6): Likewise.
6046 (incremental_copy_test): Likewise.
6047 (incremental_common_test_1): Likewise.
6048 * testsuite/Makefile.in: Regenerate.
6049
6050 2011-08-26 Nick Clifton <nickc@redhat.com>
6051
6052 * po/es.po: Updated Spanish translation.
6053
6054 2011-08-01 Cary Coutant <ccoutant@google.com>
6055
6056 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6057 * gold/testsuite/Makefile.in: Regenerate.
6058 * gold/testsuite/justsyms_exec.c: New source file.
6059 * gold/testsuite/justsyms_lib.c: New source file.
6060
6061 2011-08-01 Cary Coutant <ccoutant@google.com>
6062
6063 * layout.cc (Layout::set_segment_offsets): Don't realign text
6064 segment if -Ttext was specified.
6065 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6066 file type.
6067 * object.h (Sized_relobj_file::e_type): New function.
6068 (Sized_relobj_file::e_type_): New data member.
6069 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6070 base address for ET_EXEC files.
6071 * target.cc (Target::do_make_elf_object_implementation): Allow
6072 ET_EXEC files with --just-symbols option.
6073
6074 2011-07-28 Cary Coutant <ccoutant@google.com>
6075
6076 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6077 Add thread_number parameter.
6078 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6079 * workqueue-threads.cc
6080 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6081 current thread if its thread number is greater than desired thread
6082 count.
6083 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6084 Add thread_number parameter.
6085 (Workqueue::should_cancel_thread): Likewise.
6086 (Workqueue::find_runnable_or_wait): Pass thread_number to
6087 should_cancel_thread.
6088 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6089 parameter.
6090
6091 2011-07-22 Sriraman Tallam <tmsriram@google.com>
6092
6093 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6094 only after checking if it cannot be forced local.
6095 * symtab.h (is_externally_visible): Check if the symbol is not forced
6096 local.
6097
6098 2011-07-15 Ian Lance Taylor <iant@google.com>
6099
6100 * options.h (class General_options): Add --print-output-format.
6101 Move -EL next to -EB, for better --help output.
6102 * target-select.cc: Include <cstdio>, "options.h", and
6103 "parameters.h".
6104 (Target_selector::do_target_bfd_name): New function.
6105 (print_output_format): New function.
6106 * target-select.h (class Target_selector): Update declarations.
6107 (Target_selector::target_bfd_name): New function.
6108 (print_output_format): Declare.
6109 * main.cc: Include "target-select.h".
6110 (main): Handle --print-output-format.
6111 * gold.cc: Include "target-select.h".
6112 (queue_initial_tasks): Handle --print-output-format when there are
6113 no input files.
6114 * parameters.cc (parameters_force_valid_target): Give a better
6115 error message if -EB/-EL does not match target.
6116 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6117 function.
6118
6119 2011-07-15 Ian Lance Taylor <iant@google.com>
6120
6121 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6122 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6123 (Output_data_plt_i386::do_write): Write address of .dynamic
6124 section to first entry in .got.plt section.
6125 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6126 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6127 Initialize layout_.
6128 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6129 section to first entry in .got.plt section.
6130 * layout.h (Layout::dynamic_section): New function.
6131
6132 2011-07-13 Sriraman Tallam <tmsriram@google.com>
6133
6134 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6135 to claim_file call.
6136 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6137 input_section_position_, and input_section_glob_.
6138 (read_layout_from_file): Call function section_ordering_specified.
6139 * layout.h (is_section_ordering_specified): New function.
6140 (section_ordering_specified): New function.
6141 (section_ordering_specified_): New boolean member.
6142 * main.cc(main): Call load_plugins after layout object is defined.
6143 * output.cc (Output_section::add_input_section): Use
6144 function section_ordering_specified to check if section ordering is
6145 needed.
6146 * output.cc (Output_section::add_relaxed_input_section): Use
6147 function section_ordering_specified to check if section ordering is
6148 needed.
6149 (Output_section::update_section_layout): New function.
6150 (Output_section::sort_attached_input_sections): Check if input section
6151 must be reordered.
6152 * output.h (Output_section::update_section_layout): New function.
6153 * plugin.cc (get_section_count): New function.
6154 (get_section_type): New function.
6155 (get_section_name): New function.
6156 (get_section_contents): New function.
6157 (update_section_order): New function.
6158 (allow_section_ordering): New function.
6159 (Plugin::load): Add the new interfaces to the transfer vector.
6160 (Plugin_manager::load_plugins): New parameter.
6161 (Plugin_manager::all_symbols_read): New parameter.
6162 (Plugin_manager::claim_file): New parameter. Save the elf object for
6163 unclaimed objects.
6164 (Plugin_manager::get_elf_object): New function.
6165 (Plugin_manager::get_view): Change to directly use the bool to check
6166 if get_view is called from claim_file_hook.
6167 * plugin.h (input_objects): New function
6168 (Plugin__manager::load_plugins): New parameter.
6169 (Plugin_manager::claim_file): New parameter.
6170 (Plugin_manager::get_elf_object): New function.
6171 (Plugin_manager::in_claim_file_handler): New function.
6172 (Plugin_manager::in_claim_file_handler_): New member.
6173 (layout): New function.
6174 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6175 handler with an extra parameter. Make the elf object before calling
6176 claim_file handler.
6177 * testsuite/plugin_test.c (get_section_count): New function pointer.
6178 (get_section_type): New function pointer.
6179 (get_section_name): New function pointer.
6180 (get_section_contents): New function pointer.
6181 (update_section_order): New function pointer.
6182 (allow_section_ordering): New function pointer.
6183 (onload): Check if the new interfaces exist.
6184
6185 2011-07-13 Ian Lance Taylor <iant@google.com>
6186
6187 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6188 relro section.
6189 * x86_64.cc (Target_x86_64::got_section): Likewise.
6190 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6191 (relro_now_test_SOURCES): New variable.
6192 (relro_now_test_DEPENDENCIES): New variable.
6193 (relro_now_test_LDFLAGS): New variable.
6194 (relro_now_test_LDADD): New variable.
6195 (relro_now_test.so): New target.
6196 * testsuite/Makefile.in: Rebuild.
6197
6198 2011-07-12 Ian Lance Taylor <iant@google.com>
6199
6200 PR gold/12980
6201 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6202 GLOB_DAT relocation rather than a RELATIVE relocation for a
6203 protected symbol when creating a shared library.
6204 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6205 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6206 * testsuite/protected_main_1.cc (main): Test that protected
6207 function has same address.
6208
6209 2011-07-11 Ian Lance Taylor <iant@google.com>
6210
6211 PR gold/12979
6212 * options.h (class General_options): Add -Bgroup.
6213 * options.cc (General_options::finalize): If -Bgroup is set,
6214 default to --unresolved-symbols=report-all.
6215 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6216 * target-reloc.h (issue_undefined_symbol_error): Handle
6217 --unresolved-symbols=report-all.
6218
6219 2011-07-08 Ian Lance Taylor <iant@google.com>
6220
6221 PR gold/11985
6222 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6223 if linker script discards key sections.
6224 (Layout::create_dynamic_symtab): Likewise.
6225 (Layout::assign_local_dynsym_offsets): Likewise.
6226 (Layout::sized_create_version_sections): Likewise.
6227 (Layout::create_interp): Likewise.
6228 (Layout::finish_dynamic_section): Likewise.
6229 (Layout::set_dynamic_symbol_size): Likewise.
6230
6231 2011-07-08 Ian Lance Taylor <iant@google.com>
6232
6233 PR gold/12386
6234 * options.h (class General_options): Add --unresolved-symbols.
6235 * target-reloc.h (issue_undefined_symbol_error): Check
6236 --unresolved-symbols. Add comments.
6237
6238 2011-07-08 Ian Lance Taylor <iant@google.com>
6239
6240 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6241 expression more complex.
6242
6243 2011-07-08 Ian Lance Taylor <iant@google.com>
6244
6245 PR gold/11317
6246 * target-reloc.h (issue_undefined_symbol_error): New inline
6247 function, broken out of relocate_section.
6248 (relocate_section): Call issue_undefined_symbol_error.
6249 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6250 there is no TLS segment if we are about to issue an undefined
6251 symbol error.
6252 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6253
6254 2011-07-08 Ian Lance Taylor <iant@google.com>
6255
6256 PR gold/12279
6257 * resolve.cc (Symbol_table::should_override): Add fromtype
6258 parameter. Change all callers. Give error when linking together
6259 TLS and non-TLS symbol.
6260 (Symbol_table::should_override_with_special): Add fromtype
6261 parameter. Change all callers.
6262 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6263 there is no TLS segment if we have reported some errors.
6264 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6265
6266 2011-07-08 Ian Lance Taylor <iant@google.com>
6267
6268 PR gold/12372
6269 * target.h (Target::plt_address_for_global): New function.
6270 (Target::plt_address_for_local): New function.
6271 (Target::plt_section_for_global): Remove.
6272 (Target::plt_section_for_local): Remove.
6273 (Target::do_plt_address_for_global): New virtual function.
6274 (Target::do_plt_address_for_local): New virtual function.
6275 (Target::do_plt_section_for_global): Remove.
6276 (Target::do_plt_section_for_local): Remove.
6277 (Target::register_global_plt_entry): Add Symbol_table and Layout
6278 parameters.
6279 * output.cc (Output_data_got::Got_entry::write): Use
6280 plt_address_for_global and plt_address_for_local.
6281 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6282 address of output section.
6283 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6284 got_irelative_, and irelative_count_ fields. Update
6285 declarations.
6286 (Output_data_plt_i386::has_irelative_section): New function.
6287 (Output_data_plt_i386::entry_count): Add irelative_count_.
6288 (Output_data_plt_i386::set_final_data_size): Likewise.
6289 (class Target_i386): Add got_irelative_ and rel_irelative_
6290 fields. Update declarations.
6291 (Target_i386::Target_i386): Initialize new fields.
6292 (Target_i386::do_plt_address_for_global): New function replacing
6293 do_plt_section_for_global.
6294 (Target_i386::do_plt_address_for_local): New function replacing
6295 do_plt_section_for_local.
6296 (Target_i386::got_section): Create got_irelative_.
6297 (Target_i386::rel_irelative_section): New function.
6298 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6299 fields. Don't define __rel_iplt_{start,end}.
6300 (Output_data_plt_i386::add_entry): Add symtab and layout
6301 parameters. Change all callers. Use different PLT and GOT for
6302 IFUNC symbols.
6303 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6304 layout parameters. Change all callers. Use different PLT and
6305 GOT.
6306 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6307 (Output_data_plt_i386::rel_irelative): New function.
6308 (Output_data_plt_i386::address_for_global): New function.
6309 (Output_data_plt_i386::address_for_local): New function.
6310 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6311 IRELATIVE GOT when changing IFUNC GOT entries.
6312 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6313 reloc.
6314 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6315 if we didn't create an IRELATIVE GOT.
6316 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6317 plt_address_for_local.
6318 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6319 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6320 got_irelative_, and irelative_count_ fields. Update
6321 declarations.
6322 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6323 Initialize new fields. Remove symtab parameter. Change all
6324 callers.
6325 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6326 irelative_count_.
6327 (Output_data_plt_x86_64::has_irelative_section): New function.
6328 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6329 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6330 fields. Update declarations.
6331 (Target_x86_64::Target_x86_64): Initialize new fields.
6332 (Target_x86_64::do_plt_address_for_global): New function replacing
6333 do_plt_section_for_global.
6334 (Target_x86_64::do_plt_address_for_local): New function replacing
6335 do_plt_section_for_local.
6336 (Target_x86_64::got_section): Create got_irelative_.
6337 (Target_x86_64::rela_irelative_section): New function.
6338 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6339 all callers. Don't create __rel_iplt_{start,end}.
6340 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6341 parameters. Change all callers. Use different PLT and GOT for
6342 IFUNC symbols.
6343 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6344 layout parameters. Change all callers. Use different PLT and
6345 GOT.
6346 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6347 parameters. Change all callers. Use different PLT and GOT for
6348 IFUNC symbols.
6349 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6350 (Output_data_plt_x86_64::rela_irelative): New function.
6351 (Output_data_plt_x86_64::address_for_global): New function.
6352 (Output_data_plt_x86_64::address_for_local): New function.
6353 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6354 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6355 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6356 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6357 parameters.
6358 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6359 reloc.
6360 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6361 symbols if we didn't create an IRELATIVE GOT.
6362 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6363 plt_address_for_local.
6364 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6365 * testsuite/ifuncvar1.c: New test file.
6366 * testsuite/ifuncvar2.c: New test file.
6367 * testsuite/ifuncvar3.c: New test file.
6368 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6369 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6370 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6371 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6372 * testsuite/Makefile.in: Rebuild.
6373
6374 2011-07-07 Cary Coutant <ccoutant@google.com>
6375
6376 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6377 (two_file_test_1_ndebug.o): Likewise.
6378 (two_file_test_1b_ndebug.o): Likewise.
6379 (two_file_test_2_ndebug.o): Likewise.
6380 (two_file_test_main_ndebug.o): Likewise.
6381 (incremental_test_2): Link with no-debug versions.
6382
6383 2011-07-06 Cary Coutant <ccoutant@google.com>
6384
6385 * gold/incremental.cc
6386 (Output_section_incremental_inputs::write_info_blocks): Check for
6387 hidden and internal symbols.
6388
6389 2011-07-06 Cary Coutant <ccoutant@google.com>
6390
6391 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6392 Check disposition for startup file.
6393 (Incremental_inputs::report_command_line): Ignore
6394 --incremental-startup-unchanged option.
6395 * options.cc (General_options::parse_incremental_startup_unchanged):
6396 New function.
6397 (General_options::General_options): Initialize new data member.
6398 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6399 (General_options): Add --incremental-startup-unchanged option.
6400 (General_options::incremental_startup_disposition): New function.
6401 (General_options::incremental_startup_disposition_): New data member.
6402
6403 2011-07-06 Cary Coutant <ccoutant@google.com>
6404
6405 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6406 input file index to Script_info ctor.
6407 (Sized_incremental_binary::do_file_has_changed): Find the
6408 command-line argument for files named in scripts.
6409 * incremental.h (Script_info::Script_info): New ctor
6410 with input file index.
6411 (Script_info::input_file_index): New function.
6412 (Script_info::input_file_index_): New data member.
6413 (Incremental_binary::get_library): Add const.
6414 (Incremental_binary::get_script_info): Add const.
6415 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6416 * testsuite/Makefile.am (incremental_test_5): New test case.
6417 (incremental_test_6): New test case.
6418 * testsuite/Makefile.in: Regenerate.
6419
6420 2011-07-06 Cary Coutant <ccoutant@google.com>
6421
6422 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6423 debug output when command lines differ.
6424
6425 2011-07-06 Cary Coutant <ccoutant@google.com>
6426
6427 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6428 --incremental-patch option.
6429 * layout.cc (Free_list::allocate): Extend allocation beyond original
6430 end if enabled.
6431 (Layout::make_output_section): Mark sections that should get
6432 patch space.
6433 * options.cc (parse_percent): New function.
6434 * options.h (parse_percent): New function.
6435 (DEFINE_percent): New macro.
6436 (General_options): Add --incremental-patch option.
6437 * output.cc (Output_section::Output_section): Initialize new data
6438 members.
6439 (Output_section::add_input_section): Print section name when out
6440 of patch space.
6441 (Output_section::add_output_section_data): Likewise.
6442 (Output_section::set_final_data_size): Add patch space when
6443 doing --incremental-full.
6444 (Output_section::do_reset_address_and_file_offset): Remove patch
6445 space.
6446 (Output_segment::set_section_list_addresses): Print debug output
6447 only if --incremental-update.
6448 * output.h (Output_section::set_is_patch_space_allowed): New function.
6449 (Output_section::is_patch_space_allowed_): New data member.
6450 (Output_section::patch_space_): New data member.
6451 * parameters.cc (Parameters::incremental_full): New function.
6452 * parameters.h (Parameters::incremental_full): New function
6453 * testsuite/Makefile.am (incremental_test_2): Add test for
6454 --incremental-patch option.
6455 * testsuite/Makefile.in: Regenerate.
6456 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6457 (t18): Remove function body.
6458
6459 2011-07-05 Doug Kwan <dougkwan@google.com>
6460
6461 PR gold/12771
6462 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6463 Arm_Address type for relocation result.
6464 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6465 overflow check.
6466 (Arm_relocate_functions::abs32): Use unaligned access.
6467 (Arm_relocate_functions::rel32): Ditto.
6468 (Arm_relocate_functions::prel31): Ditto.
6469 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6470 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6471 static data relocations.
6472 * testsuite/Makefile.in: Regnerate.
6473 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6474
6475 2011-07-05 Ian Lance Taylor <iant@google.com>
6476
6477 PR gold/12392
6478 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6479 symbols if necessary.
6480 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6481
6482 2011-07-05 Ian Lance Taylor <iant@google.com>
6483
6484 PR gold/12952
6485 * resolve.cc (Symbol::override_base_with_special): Simply override
6486 version with special symbol version, ignoring previous version.
6487
6488 2011-07-05 Ian Lance Taylor <iant@google.com>
6489
6490 * object.cc (Sized_relobj_file::include_section_group): Add
6491 information to comment about signature location.
6492
6493 2011-07-02 Ian Lance Taylor <iant@google.com>
6494
6495 PR gold/12957
6496 * options.h (class General_options): Add -f and -F.
6497 * options.cc (General_options::finalize): Fatal error if -f/-F
6498 are used without -shared.
6499 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6500
6501 2011-07-02 Ian Lance Taylor <iant@google.com>
6502
6503 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6504
6505 2011-07-01 Ian Lance Taylor <iant@google.com>
6506
6507 PR gold/12525
6508 PR gold/12952
6509 * resolve.cc (Symbol::override_base_with_special): Don't override
6510 the version if the overriding symbol has a different name.
6511 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6512 all callers. If we give an error about an undefined version,
6513 define the base version if necessary.
6514 * dynobj.h (class Versions): Update declaration.
6515 * testsuite/weak_alias_test_5.cc: New file.
6516 * testsuite/weak_alias_test.script: New file.
6517 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6518 and versioned_alias have the right value, and call t2.
6519 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6520 weak_alias_test_5.so.
6521 (weak_alias_test_LDADD): Likewise.
6522 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6523 * testsuite/Makefile.in: Rebuild.
6524
6525 2011-07-01 Ian Lance Taylor <iant@google.com>
6526
6527 PR gold/12525
6528 * options.h (class General_options): Support -z notext.
6529 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6530 -Wl,-z,notext.
6531 (two_file_shared_nonpic.so): Likewise.
6532 (two_file_shared_mixed.so): Likewise.
6533 (two_file_shared_mixed_1.so): Likewise.
6534 (weak_undef_lib_nonpic.so): Likewise.
6535 (alt/weak_undef_lib_nonpic.so): Likewise.
6536 (tls_test_shared_nonpic.so): Likewise.
6537 * testsuite/Makefile.in: Rebuild.
6538
6539 2011-07-01 Ian Lance Taylor <iant@google.com>
6540
6541 PR gold/12525
6542 * configure.ac: Test whether static linking works, setting
6543 the automake conditional HAVE_STATIC.
6544 * testsuite/Makefile.am: Disable tests using -static if
6545 HAVE_STATIC is not true.
6546 * configure, testsuite/Makefile.in: Rebuild.
6547
6548 2011-07-01 Ian Lance Taylor <iant@google.com>
6549
6550 PR gold/12525
6551 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6552 Assert if we see DW_EH_PE_indirect.
6553 * target.h (Target::ehframe_datarel_base): New function.
6554 (Target::do_ehframe_datarel_base): New target function.
6555 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6556 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6557 function.
6558
6559 2011-07-01 Ian Lance Taylor <iant@google.com>
6560
6561 PR gold/12571
6562 * options.h (class General_options): Add
6563 --ld-generated-unwind-info.
6564 * ehframe.cc (Fde::write): Add address parameter. Change all
6565 callers. If associated with PLT, fill in address and size.
6566 (Cie::set_output_offset): Only add merge mapping if there is an
6567 object.
6568 (Cie::write): Add address parameter. Change all callers.
6569 (Eh_frame::add_ehframe_for_plt): New function.
6570 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6571 input_offset_ fields into union u_, with new plt field.
6572 (Fde::Fde): Adjust for new union field.
6573 (Fde::Fde) [Output_data version]: New constructor.
6574 (Fde::add_mapping): Only add merge mapping if there is an object.
6575 (class Cie): Update declarations.
6576 (class Eh_frame): Declare add_ehframe_for_plt.
6577 * layout.cc (Layout::layout_eh_frame): Break out code into
6578 make_eh_frame_section, and call it.
6579 (Layout::make_eh_frame_section): New function.
6580 (Layout::add_eh_frame_for_plt): New function.
6581 * layout.h (class Layout): Update declarations.
6582 * merge.cc (Merge_map::add_mapping): Add assertion.
6583 * i386.cc: Include "dwarf.h".
6584 (class Output_data_plt_i386): Make first_plt_entry,
6585 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6586 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6587 and plt_eh_frame_fde.
6588 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6589 boundary. Call add_eh_frame_for_plt if appropriate.
6590 * x86_64.cc: Include "dwarf.h".
6591 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6592 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6593 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6594 and plt_eh_frame_fde.
6595 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6596 appropriate.
6597
6598 2011-06-29 Ian Lance Taylor <iant@google.com>
6599
6600 PR gold/12629
6601 * object.cc (Sized_relobj_file::layout_section): Change shdr
6602 parameter to be const.
6603 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6604 out of do_layout.
6605 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6606 appropriate. Call layout_eh_frame_section.
6607 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6608 sections.
6609 * object.h (class Sized_relobj_file): Update declarations.
6610
6611 2011-06-29 Ian Lance Taylor <iant@google.com>
6612
6613 PR gold/12652
6614 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6615 modifier.
6616 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6617
6618 2011-06-29 Ian Lance Taylor <iant@google.com>
6619
6620 PR gold/12675
6621 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6622 SHT_X86_64_UNWIND.
6623 * layout.cc (Layout::layout_eh_frame): Likewise.
6624
6625 2011-06-29 Ian Lance Taylor <iant@google.com>
6626
6627 PR gold/12695
6628 * layout.cc (Layout::symtab_section_shndx): New function.
6629 * layout.h (class Layout): Declare symtab_section_shndx.
6630 * output.cc (Output_section::write_header): Call it.
6631
6632 2011-06-29 Ian Lance Taylor <iant@google.com>
6633
6634 PR gold/12818
6635 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6636 symbols which are not used in a relocation.
6637
6638 2011-06-28 Ian Lance Taylor <iant@google.com>
6639
6640 PR gold/12898
6641 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6642 script create indistinguishable segments.
6643 (Layout::set_segment_offsets): Use stable_sort when sorting
6644 segments. Pass this to Compare_segments constructor.
6645 * layout.h (class Layout): Make segment_precedes non-static.
6646 (class Compare_segments): Change from struct to class. Add
6647 layout_ field. Add constructor.
6648 * script-sections.cc
6649 (Script_sections::attach_sections_using_phdrs_clause): Rename
6650 local orphan to is_orphan. Don't report failure to put empty
6651 section in segment. On attachment failure, report name of
6652 section, and attach to first PT_LOAD segment.
6653
6654 2011-06-28 Ian Lance Taylor <iant@google.com>
6655
6656 PR gold/12934
6657 * target-select.cc (Target_selector::Target_selector): Add
6658 emulation parameter. Change all callers.
6659 (select_target_by_bfd_name): Rename from select_target_by_name.
6660 Change all callers.
6661 (select_target_by_emulation): New function.
6662 (supported_emulation_names): New function.
6663 * target-select.h (class Target_selector): Add emulation_ field.
6664 Update declarations.
6665 (Target_selector::recognize_by_bfd_name): Rename from
6666 recognize_by_name. Change all callers.
6667 (Target_selector::supported_bfd_names): Rename from
6668 supported_names. Change all callers.
6669 (Target_selector::recognize_by_emulation): New function.
6670 (Target_selector::supported_emulations): New function.
6671 (Target_selector::emulation): New function.
6672 (Target_selector::do_recognize_by_bfd_name): Rename from
6673 do_recognize_by_name. Change all callers.
6674 (Target_selector::do_supported_bfd_names): Rename from
6675 do_supported_names. Change all callers.
6676 (Target_selector::do_recognize_by_emulation): New function.
6677 (Target_selector::do_supported_emulations): New function.
6678 (select_target_by_bfd_name): Change name in declaration.
6679 (select_target_by_emulation): Declare.
6680 (supported_emulation_names): Declare.
6681 * parameters.cc (parameters_force_valid_target): Try to find
6682 target based on emulation from -m option.
6683 * options.h (class General_options): Change doc string for -m.
6684 * options.cc (help): Print emulations.
6685 (General_options::parse_V): Likewise.
6686 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6687 Add emulation parameter. Change all callers.
6688
6689 2011-06-28 Ian Lance Taylor <iant@google.com>
6690
6691 * target.h (class Target): Add osabi_ field.
6692 (Target::osabi): New function.
6693 (Target::set_osabi): New function.
6694 (Target::Target): Initialize osabi_.
6695 (Target::do_adjust_elf_header): Make pure virtual.
6696 (Sized_target::do_adjust_elf_header): Declare.
6697 * target.cc (Sized_target::do_adjust_elf_header): New function.
6698 (class Sized_target): Instantiate all versions.
6699 * freebsd.h (class Target_freebsd): Remove.
6700 (Target_selector_freebsd::do_recognize): Call set_osabi on
6701 Target.
6702 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6703 (Target_selector_freebsd::set_osabi): Remove.
6704 * i386.cc (class Target_i386): Inherit from Sized_target rather
6705 than Target_freebsd.
6706 * x86_64.cc (class Target_x86_64): Likewise.
6707
6708 2011-06-28 Ian Lance Taylor <iant@google.com>
6709
6710 * target.h (Target::can_check_for_function_pointers): Rewrite.
6711 Make non-virtual.
6712 (Target::can_icf_inline_merge_sections): Likewise.
6713 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6714 (Target::Target_info): Add can_icf_inline_merge_sections field.
6715 (Target::do_can_check_for_function_pointers): New virtual
6716 function.
6717 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6718 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6719 from can_check_for_function_pointers, move in file.
6720 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6721 section_may_have_icf_unsafe_poineters, move in file.
6722 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6723 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6724 Rename from can_check_for_function_pointers, move in file.
6725 (Target_i386::can_icf_inline_merge_sections): Remove.
6726 (Target_i386::i386_info): Initialize
6727 can_icf_inline_merge_sections.
6728 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6729 Initialize can_icf_inline_merge_sections.
6730 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6731 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6732 Rename from can_check_for_function_pointers, move in file.
6733 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6734 (Target_x86_64::x86_64_info): Initialize
6735 can_icf_inline_merge_sections.
6736 * testsuite/testfile.cc (Target_test::test_target_info):
6737 Likewise.
6738 * icf.cc (get_section_contents): Correct formatting.
6739
6740 2011-06-27 Ian Lance Taylor <iant@google.com>
6741
6742 * symtab.cc (Symbol::versioned_name): New function.
6743 (Symbol_table::add_to_final_symtab): Use versioned_name when
6744 appropriate.
6745 (Symbol_table::sized_write_symbol): Likewise.
6746 * symtab.h (class Symbol): Declare versioned_name.
6747 * stringpool.h (class Stringpool_template): Add variant of add
6748 which takes a std::basic_string.
6749 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6750 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6751 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6752 (ver_test_12.o): New target.
6753 * testsuite/Makefile.in: Rebuild.
6754
6755 2011-06-27 Doug Kwan <dougkwan@google.com>
6756
6757 * arm.cc (Arm_relocate_functions::thm_jump8,
6758 Arm_relocate_functions::thm_jump11): Use a wider signed
6759 type to compute offset.
6760 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6761 arm_thm_jump8.
6762 * testsuite/Makefile.in: Regenerate.
6763 * testsuite/arm_branch_in_range.sh: Check test results of
6764 arm_thm_jump11 and arm_thm_jump8.
6765 * testsuite/arm_thm_jump11.s: New test source file.
6766 * testsuite/arm_thm_jump11.t: New linker script.
6767 * testsuite/arm_thm_jump8.s: New test source file.
6768 * testsuite/arm_thm_jump8.t: New linker script.
6769
6770 2011-06-24 Ian Lance Taylor <iant@google.com>
6771
6772 * layout.cc: Include "object.h".
6773 (ctors_sections_in_init_array): New static variable.
6774 (Layout::is_ctors_in_init_array): New function.
6775 (Layout::layout): Add entry to ctors_sections_in_init_array if
6776 appropriate.
6777 * layout.h (class Layout): Declare is_ctors_in_init_array.
6778 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6779 is_ctors_reverse_view is set.
6780 (Sized_relobj_file::write_sections): Add layout parameter. Change
6781 all callers. Set is_ctors_reverse_view field of View_size.
6782 (Sized_relobj_file::reverse_words): New function.
6783 * object.h (Sized_relobj_file::View_size): Add
6784 is_ctors_reverse_view field.
6785 (class Sized_relobj_file): Update declarations.
6786 * testsuite/initpri3.c: New test.
6787 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6788 initpri3b.
6789 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6790 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6791 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6792 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6793 * testsuite/Makefile.in: Rebuild.
6794
6795 2011-06-24 Cary Coutant <ccoutant@google.com>
6796
6797 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6798 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6799 (debug_msg_cdebug.err): New targets.
6800 * testsuite/Makefile.in: Regenerate.
6801 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6802 Fix checks for link with shared library.
6803
6804 2011-06-24 Doug Kwan <dougkwan@google.com>
6805
6806 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6807 skip empty text sections.
6808 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6809
6810 2011-06-22 Ian Lance Taylor <iant@google.com>
6811
6812 PR gold/12910
6813 * options.h (class General_options): Add --ctors-in-init-array.
6814 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6815 friends as SHT_PROGBITS for merging sections.
6816 (Layout::layout): Remove special handling of .init_array and
6817 friends. Don't sort if doing relocatable link. Sort for .ctors
6818 and .dtors if ctors_in_init_array.
6819 (Layout::make_output_section): Force correct section types for
6820 .init_array and friends. Don't sort if doing relocatable link,
6821 Don't sort .ctors and .dtors if ctors_in_init_array.
6822 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6823 (Layout::output_section_name): Add relobj parameter. Change all
6824 callers. Handle .ctors. and .dtors. in code rather than table.
6825 Handle .ctors and .dtors if ctors_in_init_array.
6826 (Layout::match_file_name): New function, moved from output.cc.
6827 * layout.h (class Layout): Update declarations.
6828 * output.cc: Include "layout.h".
6829 (Input_section_sort_entry::get_priority): New function.
6830 (Input_section_sort_entry::match_file_name): Just call
6831 Layout::match_file_name.
6832 (Output_section::Input_section_sort_init_fini_compare::operator()):
6833 Handle .ctors and .dtors. Sort by explicit priority rather than
6834 by name.
6835 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6836 * testsuite/initpri2.c: New test.
6837 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6838 (check_PROGRAMS): Add initpri2.
6839 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6840 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6841 * configure, testsuite/Makefile.in: Rebuild.
6842
6843 2011-06-19 Ian Lance Taylor <iant@google.com>
6844
6845 PR gold/12880
6846 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6847 .interp section to a PT_INTERP segment even if we have seen a
6848 --dynamic-linker option. Don't do it if we have seen a PHDRS
6849 clause in a linker script.
6850 (Layout::finalize): Don't create a .interp section if we've
6851 already create a PT_INTERP segment.
6852 (Layout::create_interp): Always call choose_output_section (revert
6853 patch of 2011-06-17). Don't create PT_INTERP segment.
6854 * script-sections.cc
6855 (Script_sections::create_note_and_tls_segments): Add a .interp
6856 section to a PT_INTERP segment even if we have seen a
6857 --dynamic-linker option.
6858
6859 2011-06-18 Ian Lance Taylor <iant@google.com>
6860
6861 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6862 merely because a non-PT_LOAD segment has a dynamic reloc.
6863
6864 2011-06-18 Ian Lance Taylor <iant@google.com>
6865
6866 * layout.cc (Layout::finish_dynamic_section): Don't create
6867 DT_FLAGS entry if not needed.
6868
6869 2011-06-18 Ian Lance Taylor <iant@google.com>
6870
6871 PR gold/12745
6872 * layout.cc (Layout::layout_eh_frame): Correct handling of
6873 writable .eh_frame section.
6874
6875 2011-06-17 Ian Lance Taylor <iant@google.com>
6876
6877 PR gold/12893
6878 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6879 symbol is redefined with the exact same object and value.
6880
6881 2011-06-17 Ian Lance Taylor <iant@google.com>
6882
6883 PR gold/12880
6884 * layout.h (class Layout): Add interp_segment_ field.
6885 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6886 (Layout::attach_allocated_section_to_segment): If making shared
6887 library, put .interp section in PT_INTERP segment.
6888 (Layout::finalize): Also call create_interp if -dynamic-linker
6889 option was used.
6890 (Layout::create_interp): Assert that there is no PT_INTERP
6891 segment. If not using a SECTIONS clause, use make_output_section.
6892 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6893 * script-sections.cc
6894 (Script_sections::create_note_and_tls_segments): If making shared
6895 library, put .interp section in PT_INTERP segment.
6896
6897 2011-06-17 Ian Lance Taylor <iant@google.com>
6898
6899 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6900 when making a shared library.
6901
6902 2011-06-17 Ian Lance Taylor <iant@google.com>
6903
6904 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6905 parameter. Change all callers. Don't issue warning about PC32
6906 against locally defined symbol.
6907
6908 2011-06-16 Ian Lance Taylor <iant@google.com>
6909
6910 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6911 occurs in same object.
6912
6913 2011-06-14 Alan Modra <amodra@gmail.com>
6914
6915 * po/POTFILES.in: Regenerate.
6916
6917 2011-06-09 Ian Lance Taylor <iant@google.com>
6918
6919 * script-sections.cc
6920 (Orphan_output_section::set_section_addresses): For a relocatable
6921 link set address to 0.
6922
6923 2011-06-09 Cary Coutant <ccoutant@google.com>
6924
6925 PR gold/12804
6926 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6927 used with --compress-debug-sections.
6928 * gold/object.cc (Sized_relobj_file::do_layout): Report
6929 uncompressed size of compressed input sections.
6930
6931 2011-06-08 Cary Coutant <ccoutant@google.com>
6932
6933 PR gold/12804
6934 * testsuite/two_file_test_2_v1.cc: Change initialization of
6935 v2 to keep it in .data.
6936
6937 2011-06-07 Cary Coutant <ccoutant@google.com>
6938
6939 * common.cc (Symbol_table::do_allocate_commons_list): Call
6940 gold_fallback.
6941 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6942 (Errors::fallback): New function.
6943 (gold_fallback): New function.
6944 * errors.h (Errors::fallback): New function.
6945 * gold.cc (gold_exit): Change status parameter to enum; adjust
6946 all callers.
6947 (queue_initial_tasks): Call gold_fallback.
6948 * gold.h: Include cstdlib.
6949 (Exit_status): New enum type.
6950 (gold_exit): Change status parameter to enum.
6951 (gold_fallback): New function.
6952 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6953 (Layout::create_symtab_sections): Likewise.
6954 (Layout::create_shdrs): Likewise.
6955 * main.cc (main): Adjust call to gold_exit.
6956 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6957 (Output_data_got::add_got_entry_pair): Likewise.
6958 (Output_section::add_input_section): Likewise.
6959 (Output_section::add_output_section_data): Likewise.
6960 (Output_segment::set_section_list_addresses): Likewise.
6961 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6962
6963 2011-06-07 Cary Coutant <ccoutant@google.com>
6964
6965 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6966 for incremental links.
6967 * output.cc (Output_segment::set_section_list_addresses): Remove
6968 FIXME and test for TLS or BSS.
6969
6970 2011-06-07 Cary Coutant <ccoutant@google.com>
6971
6972 * testsuite/Makefile.am: Add incremental_copy_test,
6973 incremental_common_test_1.
6974 * testsuite/Makefile.in: Regenerate.
6975 * testsuite/common_test_1_v1.c: New source file.
6976 * testsuite/common_test_1_v2.c: New source file.
6977 * testsuite/copy_test_v1.cc: New source file.
6978
6979 2011-06-07 Cary Coutant <ccoutant@google.com>
6980
6981 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6982 update, allocate common from bss section's free list.
6983 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6984 linker-defined symbols.
6985 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6986 Skip GOT and PLT entries that are no longer referenced.
6987 (Output_section_incremental_inputs::write_info_blocks): Mark
6988 linker-defined symbols.
6989 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6990 * output.cc (Output_section::allocate): New function.
6991 * output.h (Output_section::allocate): New function.
6992 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6993 linker-defined symbols.
6994 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6995 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6996 (Symbol::init_base_output_data): Likewise.
6997 (Symbol::init_base_output_segment): Likewise.
6998 (Symbol::init_base_constant): Likewise.
6999 (Sized_symbol::init_output_data): Likewise.
7000 (Sized_symbol::init_output_segment): Likewise.
7001 (Sized_symbol::init_constant): Likewise.
7002 (Symbol_table::do_define_in_output_data): Likewise.
7003 (Symbol_table::do_define_in_output_segment): Likewise.
7004 (Symbol_table::do_define_as_constant): Likewise.
7005 * symtab.h (Symbol::is_predefined): New function.
7006 (Symbol::init_base_output_data): Add is_predefined parameter.
7007 (Symbol::init_base_output_segment): Likewise.
7008 (Symbol::init_base_constant): Likewise.
7009 (Symbol::is_predefined_): New data member.
7010 (Sized_symbol::init_output_data): Add is_predefined parameter.
7011 (Sized_symbol::init_output_segment): Likewise.
7012 (Sized_symbol::init_constant): Likewise.
7013 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7014
7015 2011-06-07 Cary Coutant <ccoutant@google.com>
7016
7017 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7018 instead of emit_copy_reloc.
7019 (Copy_relocs::emit_copy_reloc): Refactor.
7020 (Copy_relocs::make_copy_reloc): New function.
7021 (Copy_relocs::add_copy_reloc): Remove.
7022 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7023 section.
7024 (Copy_relocs::make_copy_reloc): New function.
7025 (Copy_relocs::add_copy_reloc): Remove.
7026 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7027 unchanged input files.
7028 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7029 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7030 Reserve BSS space for COPY relocations.
7031 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7032 (Output_section_incremental_inputs::write_info_blocks): Record
7033 whether a symbol is copied from a shared object.
7034 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7035 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7036 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7037 (Incremental_input_entry_reader::get_output_symbol_index): Add
7038 is_copy parameter.
7039 (Incremental_binary::emit_copy_relocs): New function.
7040 (Incremental_binary::do_emit_copy_relocs): New function.
7041 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7042 new data member.
7043 (Sized_incremental_binary::add_copy_reloc): New function.
7044 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7045 (Sized_incremental_binary::Copy_reloc): New struct.
7046 (Sized_incremental_binary::Copy_relocs): New typedef.
7047 (Sized_incremental_binary::copy_relocs_): New data member.
7048 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7049 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7050 * target.h (Sized_target::emit_copy_reloc): New function.
7051 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7052
7053 2011-06-02 Cary Coutant <ccoutant@google.com>
7054
7055 PR gold/12163
7056 * gold/archive.cc (Archive::Archive): Initialize new data member.
7057 (Archive::include_all_members): Return if archive has already been
7058 included.
7059 * gold/archive.h (Archive::include_all_members_): New data member.
7060
7061 2011-06-02 Nick Clifton <nickc@redhat.com>
7062
7063 * dynobj.h: Fix spelling mistake in comment.
7064 * output.cc: Likewise.
7065
7066 2011-05-31 Doug Kwan <dougkwan@google.com>
7067 Asier Llano
7068
7069 PR gold/12826
7070 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
7071 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7072 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7073 redundant arm_exidx_test.so.
7074 * testsuite/Makefile.in: Regenerate.
7075 (check_SCRIPTS): Add pr12826.sh
7076 (check_DATA): Add pr12826.stdout
7077 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7078 * testsuite/pr12826.sh: New file.
7079 * testsuite/pr12826_1.s: Ditto.
7080 * testsuite/pr12826_1.s: Ditto.
7081
7082 2011-05-30 Ian Lance Taylor <iant@google.com>
7083
7084 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7085 sections.
7086
7087 2011-05-29 Ian Lance Taylor <iant@google.com>
7088
7089 PR gold/12804
7090 * testsuite/Makefile.am: Use different file name for two_file_test
7091 temporary file for each incremental test.
7092 * testsuite/Makefile.in: Rebuild.
7093
7094 2011-05-29 Ian Lance Taylor <iant@google.com>
7095
7096 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7097 binary input file is empty.
7098
7099 2011-05-27 Ian Lance Taylor <iant@google.com>
7100
7101 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7102 (ver_test_9.so): Likewise.
7103 * testsuite/Makefile.in: Rebuild.
7104
7105 2011-05-26 Cary Coutant <ccoutant@google.com>
7106
7107 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7108 * incremental.cc (Incremental_inputs::report_input_section): Fix
7109 comment, indentation.
7110 (Incremental_inputs::report_comdat_group): New function.
7111 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7112 of data for incremental input file entry.
7113 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7114 group count, COMDAT group signatures.
7115 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7116 an unchanged input file.
7117 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7118 Initialize new data member.
7119 (Incremental_object_entry::add_comdat_group): New function.
7120 (Incremental_object_entry::get_comdat_group_count): New function.
7121 (Incremental_object_entry::get_comdat_signature_key): New function.
7122 (Incremental_object_entry::groups_): New data member.
7123 (Incremental_inputs::report_comdat_group): New function.
7124 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7125 data for incremental input file entry.
7126 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7127 (Incremental_input_entry_reader::get_input_section): Adjust size of
7128 data for incremental input file entry.
7129 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7130 (Incremental_input_entry_reader::get_comdat_group_signature): New
7131 function.
7132 * object.cc (Sized_relobj::include_section_group): Report kept
7133 COMDAT groups for incremental links.
7134
7135 2011-05-24 David Meyer <pdox@google.com>
7136
7137 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7138 with name parameter. Add found_name parameter.
7139 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7140 * dirsearch.h (class Dirsearch): Update declaration.
7141
7142 2011-05-24 Ian Lance Taylor <iant@google.com>
7143
7144 * archive.cc (Library_base::should_include_member): Pull in object
7145 from archive if it defines the entry symbol.
7146 * parameters.cc (Parameters::entry): New function.
7147 * parameters.h (class Parameters): Declare entry.
7148 * output.h (class Output_file_header): Remove entry_ field.
7149 * output.cc (Output_file_header::Output_file_header): Remove entry
7150 parameter. Change all callers.
7151 (Output_file_header::entry): Use parameters->entry.
7152 * gold.cc (queue_middle_tasks): Likewise.
7153 * plugin.cc (Plugin_hook::run): Likewise.
7154
7155 2011-05-24 Cary Coutant <ccoutant@google.com>
7156
7157 * gold.cc (queue_initial_tasks): Pass incremental base filename
7158 to Output_file::open_base_file; don't print error message.
7159 * incremental-dump.cc (main): Adjust call to
7160 Output_file::open_for_modification.
7161 * incremental-dump.cc (main): Likewise.
7162 * incremental.cc (Incremental_inputs::report_command_line):
7163 Ignore --incremental-base option when comparing command lines.
7164 Ignore parameter when given as separate argument.
7165 * options.h (class General_options): Add --incremental-base.
7166 * output.cc (Output_file::Output_file):
7167 (Output_file::open_base_file): Add base_name and writable parameters;
7168 read base file into new file; print error message here.
7169 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7170 callers.
7171 * output.h (Output_file::open_for_modification): Rename to...
7172 (Output_file::open_base_file): ...this; add base_name and
7173 writable parameters; adjust all callers.
7174 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7175 callers.
7176 * testsuite/Makefile.am (incremental_test_4): Test
7177 --incremental-base.
7178 * testsuite/Makefile.in: Regenerate.
7179
7180 2011-05-24 Cary Coutant <ccoutant@google.com>
7181
7182 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7183 incremental_test_4.
7184 * testsuite/Makefile.in: Regenerate.
7185 * testsuite/two_file_test_1_v1.cc: New test source file.
7186 * testsuite/two_file_test_1b_v1.cc: New test source file.
7187 * testsuite/two_file_test_2_v1.cc: New test source file.
7188
7189 2011-05-24 Cary Coutant <ccoutant@google.com>
7190
7191 * dynobj.h (Dynobj::do_dynobj): New function.
7192 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7193 flag and soname for shared objects.
7194 * incremental.cc (Incremental_inputs::report_object): Make
7195 either Incremental_object_entry or Incremental_dynobj_entry; add
7196 soname to string table.
7197 (Incremental_inputs::report_input_section): Add assertion.
7198 (Output_section_incremental_inputs::set_final_data_size): Adjust
7199 type of input file entry for shared libraries; adjust size of
7200 shared library info entry.
7201 (Output_section_incremental_inputs::write_input_files): Write
7202 as_needed flag for shared libraries.
7203 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7204 of input file entry for shared libraries; write soname.
7205 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7206 soname from incremental info.
7207 * incremental.h (enum Incremental_input_flags): Add
7208 INCREMENTAL_INPUT_AS_NEEDED.
7209 (Incremental_input_entry::Incremental_input_entry): Initialize new
7210 data member.
7211 (Incremental_input_entry::set_as_needed): New function.
7212 (Incremental_input_entry::as_needed): New function.
7213 (Incremental_input_entry::do_dynobj_entry): New function.
7214 (Incremental_input_entry::as_needed_): New data member.
7215 (Incremental_object_entry::Incremental_object_entry): Don't check
7216 for shared library.
7217 (Incremental_object_entry::do_type): Likewise.
7218 (class Incremental_dynobj_entry): New class.
7219 (Incremental_input_entry_reader::as_needed): New function.
7220 (Incremental_input_entry_reader::get_soname): New function.
7221 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7222 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7223 size of shared library info entry.
7224 * layout.cc (Layout::finish_dynamic_section): Don't test for
7225 incremental link when adding DT_NEEDED entries.
7226 * object.h (Object::Object): Initialize new data member.
7227 (Object::dynobj): New function.
7228 (Object::set_as_needed): New function.
7229 (Object::as_needed): New function.
7230 (Object::do_dynobj): New function.
7231 (Object::as_needed_): New data member.
7232
7233 2011-05-24 Cary Coutant <ccoutant@google.com>
7234
7235 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7236 info; adjust display of GOT entries.
7237 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7238 vector of input objects; remove file_status_.
7239 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7240 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7241 got_plt reader; call target hooks to reserve GOT entries.
7242 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7243 of input file info header and GOT info entry.
7244 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7245 relocation info.
7246 (Got_plt_view_info::got_descriptor): Remove.
7247 (Got_plt_view_info::sym_index): New data member.
7248 (Got_plt_view_info::input_index): New data member.
7249 (Local_got_offset_visitor::visit): Write input file index.
7250 (Global_got_offset_visitor::visit): Write 0 for input file index.
7251 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7252 with sym_index and input_index.
7253 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7254 incremental info GOT entry; replace got_descriptor with input_index.
7255 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7256 map from input file index to object.
7257 (Sized_relobj_incr::do_layout): Replace direct data member reference
7258 with accessor function.
7259 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7260 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7261 Adjust size of input file info header.
7262 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7263 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7264 (Incremental_input_entry_reader::get_input_section): Adjust size of
7265 input file info header.
7266 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7267 of incremental info GOT entry.
7268 (Incremental_got_plt_reader::get_got_desc): Remove.
7269 (Incremental_got_plt_reader::get_got_symndx): New function.
7270 (Incremental_got_plt_reader::get_got_input_index): New function.
7271 (Sized_incremental_binary::Sized_incremental_binary): Remove
7272 file_status_; add input_objects_.
7273 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7274 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7275 (Sized_incremental_binary::file_is_unchanged): Remove.
7276 (Sized_incremental_binary::set_input_object): New function.
7277 (Sized_incremental_binary::input_object): New function.
7278 (Sized_incremental_binary::file_status_): Remove.
7279 (Sized_incremental_binary::input_objects_): New data member.
7280 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7281 references.
7282 (Sized_relobj_incr::invalid_address): Move to base class.
7283 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7284 class.
7285 (Sized_relobj_incr::do_output_section_offset): Likewise.
7286 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7287 (Sized_relobj_incr::section_offsets_): Likewise.
7288 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7289 function.
7290 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7291 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7292 with accessor function.
7293 (Sized_relobj_file::do_layout): Likewise.
7294 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7295 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7296 (Sized_relobj_file::compute_final_local_value): Replace refs to
7297 section_offsets_ with accessor function.
7298 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7299 * object.h (Relobj::Relobj): Initialize new data members.
7300 (Relobj::add_dyn_reloc): New function.
7301 (Relobj::first_dyn_reloc): New function.
7302 (Relobj::dyn_reloc_count): New function.
7303 (Relobj::first_dyn_reloc_): New data member.
7304 (Relobj::dyn_reloc_count_): New data member.
7305 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7306 references.
7307 (Sized_relobj::Address): New typedef.
7308 (Sized_relobj::invalid_address): Move here from child class.
7309 (Sized_relobj::Sized_relobj): Initialize new data members.
7310 (Sized_relobj::sized_relobj): New function.
7311 (Sized_relobj::is_output_section_offset_invalid): Move here from
7312 child class.
7313 (Sized_relobj::get_output_section_offset): Likewise.
7314 (Sized_relobj::local_has_got_offset): Likewise.
7315 (Sized_relobj::local_got_offset): Likewise.
7316 (Sized_relobj::set_local_got_offset): Likewise.
7317 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7318 (Sized_relobj::clear_got_offsets): New function.
7319 (Sized_relobj::section_offsets): Move here from child class.
7320 (Sized_relobj::do_output_section_offset): Likewise.
7321 (Sized_relobj::do_set_section_offset): Likewise.
7322 (Sized_relobj::Local_got_offsets): Likewise.
7323 (Sized_relobj::local_got_offsets_): Likewise.
7324 (Sized_relobj::section_offsets_): Likewise.
7325 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7326 references.
7327 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7328 class.
7329 (Sized_relobj_file::sized_relobj): New function
7330 (Sized_relobj_file::local_has_got_offset): Move to base class.
7331 (Sized_relobj_file::local_got_offset): Likewise.
7332 (Sized_relobj_file::set_local_got_offset): Likewise.
7333 (Sized_relobj_file::get_output_section_offset): Likewise.
7334 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7335 (Sized_relobj_file::do_output_section_offset): Likewise.
7336 (Sized_relobj_file::do_set_section_offset): Likewise.
7337 (Sized_relobj_file::Local_got_offsets): Likewise.
7338 (Sized_relobj_file::local_got_offsets_): Likewise.
7339 (Sized_relobj_file::section_offsets_): Likewise.
7340 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7341 (all constructors).
7342 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7343 (Output_reloc::get_symbol_index): Likewise.
7344 (Output_reloc::local_section_offset): Likewise.
7345 (Output_reloc::get_address): Likewise.
7346 (Output_reloc::symbol_value): Likewise.
7347 (Output_data_got::reserve_slot): Move to class definition.
7348 (Output_data_got::reserve_local): New function.
7349 (Output_data_got::reserve_slot_for_global): Remove.
7350 (Output_data_got::reserve_global): New function.
7351 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7352 (all constructors, two instantiations).
7353 (Output_reloc::get_relobj): New function (two instantiations).
7354 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7355 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7356 (Output_data_reloc::add_global): Adjust type of relobj.
7357 (Output_data_reloc::add_global_relative): Likewise.
7358 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7359 (Output_data_reloc::add_local): Likewise.
7360 (Output_data_reloc::add_local_relative): Likewise.
7361 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7362 (Output_data_reloc::add_local_section): Likewise.
7363 (Output_data_reloc::add_output_section): Likewise.
7364 (Output_data_reloc::add_absolute): Likewise.
7365 (Output_data_reloc::add_target_specific): Likewise.
7366 (Output_data_got::reserve_slot): Move definition here.
7367 (Output_data_got::reserve_local): New function.
7368 (Output_data_got::reserve_global): New function.
7369 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7370 section_offsets_ with accessor function.
7371 (Sized_relobj_file::write_sections): Likewise.
7372 (Sized_relobj_file::do_relocate_sections): Likewise.
7373 * target.h (Sized_target::reserve_local_got_entry): New function.
7374 (Sized_target::reserve_global_got_entry): New function.
7375 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7376 (Target_x86_64::reserve_global_got_entry): New function.
7377 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7378
7379 2011-05-23 Cary Coutant <ccoutant@google.com>
7380
7381 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7382 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7383 bit when checking got_type.
7384 * incremental.cc (Sized_incremental_binary::setup_readers):
7385 Store symbol table and string table locations; initialize bit vector
7386 of file status flags.
7387 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7388 unchanged files.
7389 (Sized_incremental_binary::do_process_got_plt): New function.
7390 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7391 (Output_section_incremental_inputs::set_final_data_size): Record
7392 file index for each input file.
7393 (Output_section_incremental_inputs::write_got_plt): Store file index
7394 instead of input entry offset for each GOT entry.
7395 * incremental.h
7396 (Incremental_input_entry::Incremental_input_entry): Initialize new
7397 data member.
7398 (Incremental_input_entry::set_offset): Store file index.
7399 (Incremental_input_entry::get_file_index): New function.
7400 (Incremental_input_entry::file_index_): New data member.
7401 (Incremental_binary::process_got_plt): New function.
7402 (Incremental_binary::do_process_got_plt): New function.
7403 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7404 data members.
7405 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7406 (Sized_incremental_binary::set_file_is_unchanged): New function.
7407 (Sized_incremental_binary::file_is_unchanged): New function.
7408 (Sized_incremental_binary::do_process_got_plt): New function.
7409 (Sized_incremental_binary::file_status_): New data member.
7410 (Sized_incremental_binary::main_symtab_loc_): New data member.
7411 (Sized_incremental_binary::main_strtab_loc_): New data member.
7412 * output.cc (Output_data_got::Got_entry::write): Add case
7413 RESERVED_CODE.
7414 (Output_data_got::add_global): Call add_got_entry.
7415 (Output_data_got::add_global_plt): Likewise.
7416 (Output_data_got::add_global_with_rel): Likewise.
7417 (Output_data_got::add_global_with_rela): Likewise.
7418 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7419 (Output_data_got::add_global_pair_with_rela): Likewise.
7420 (Output_data_got::add_local): Call add_got_entry.
7421 (Output_data_got::add_local_plt): Likewise.
7422 (Output_data_got::add_local_with_rel): Likewise.
7423 (Output_data_got::add_local_with_rela): Likewise.
7424 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7425 (Output_data_got::add_local_pair_with_rela): Likewise.
7426 (Output_data_got::reserve_slot): New function.
7427 (Output_data_got::reserve_slot_for_global): New function.
7428 (Output_data_got::add_got_entry): New function.
7429 (Output_data_got::add_got_entry_pair): New function.
7430 (Output_section::add_output_section_data): Edit FIXME.
7431 * output.h
7432 (Output_section_data_build::Output_section_data_build): New
7433 constructor with size parameter.
7434 (Output_data_space::Output_data_space): Likewise.
7435 (Output_data_got::Output_data_got): Initialize new data member; new
7436 constructor with size parameter.
7437 (Output_data_got::add_constant): Call add_got_entry.
7438 (Output_data_got::reserve_slot): New function.
7439 (Output_data_got::reserve_slot_for_global): New function.
7440 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7441 (Output_data_got::add_got_entry): New function.
7442 (Output_data_got::add_got_entry_pair): New function.
7443 (Output_data_got::free_list_): New data member.
7444 * target.h (Sized_target::init_got_plt_for_update): New function.
7445 (Sized_target::register_global_plt_entry): New function.
7446 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7447 Initialize new data member; call init; add constructor with PLT count.
7448 (Output_data_plt_x86_64::init): New function.
7449 (Output_data_plt_x86_64::add_relocation): New function.
7450 (Output_data_plt_x86_64::reserve_slot): New function.
7451 (Output_data_plt_x86_64::free_list_): New data member.
7452 (Target_x86_64::init_got_plt_for_update): New function.
7453 (Target_x86_64::register_global_plt_entry): New function.
7454 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7455 incremental updates.
7456 (Output_data_plt_x86_64::add_relocation): New function.
7457 * testsuite/object_unittest.cc (Object_test): Set default options.
7458
7459 2011-05-16 Ian Lance Taylor <iant@google.com>
7460
7461 * options.h (class General_options): Make -i a synonym for -r.
7462
7463 2011-05-16 Ian Lance Taylor <iant@google.com>
7464
7465 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7466
7467 2011-05-10 Cary Coutant <ccoutant@google.com>
7468
7469 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7470 strip_all (-s).
7471
7472 2011-05-06 Ian Lance Taylor <iant@google.com>
7473
7474 * layout.cc (Layout::layout): If the output section flags change,
7475 update the ordering.
7476
7477 2011-04-25 Cary Coutant <ccoutant@google.com>
7478
7479 * incremental-dump.cc (dump_incremental_inputs): Print local
7480 symbol info for each input file.
7481 * incremental.cc
7482 (Output_section_incremental_inputs::set_final_data_size): Add local
7483 symbol info to input file entries in incremental info.
7484 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7485 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7486 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7487 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7488 implementation.
7489 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7490 (Sized_incr_relobj::do_relocate): Write the local symbols.
7491 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7492 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7493 Adjust size of input file header.
7494 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7495 (Incremental_inputs_reader::get_local_symbol_count): New function.
7496 (Incremental_inputs_reader::get_input_section): Adjust size of input
7497 file header.
7498 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7499 (Sized_incr_relobj::This): New typedef.
7500 (Sized_incr_relobj::sym_size): New const data member.
7501 (Sized_incr_relobj::Local_symbol): New struct.
7502 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7503 (Sized_incr_relobj::do_local_symbol_offset): New function.
7504 (Sized_incr_relobj::local_symbol_count_): New data member.
7505 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7506 (Sized_incr_relobj::local_symbol_index_): New data member.
7507 (Sized_incr_relobj::local_symbol_offset_): New data member.
7508 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7509 (Sized_incr_relobj::local_symbols_): New data member.
7510 * object.h (Relobj::output_local_symbol_count): New function.
7511 (Relobj::local_symbol_offset): New function.
7512 (Relobj::do_output_local_symbol_count): New function.
7513 (Relobj::do_local_symbol_offset): New function.
7514 (Sized_relobj::do_output_local_symbol_count): New function.
7515 (Sized_relobj::do_local_symbol_offset): New function.
7516
7517 2011-04-22 Vladimir Simonov <sv@sw.ru>
7518
7519 * descriptors.cc (set_close_on_exec): New function.
7520 (Descriptors::open): Use set_close_on_exec.
7521 * output.cc (S_ISLNK): Define if not defined.
7522
7523 2011-04-22 Cary Coutant <ccoutant@google.com>
7524
7525 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7526 global symbol map.
7527 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7528 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7529 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7530 relocations.
7531 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7532 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7533 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7534 * incremental.h
7535 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7536 function.
7537 (Incremental_binary::apply_incremental_relocs): New function.
7538 (Incremental_binary::do_apply_incremental_relocs): New function.
7539 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7540 data member.
7541 (Sized_incremental_binary::add_global_symbol): New function.
7542 (Sized_incremental_binary::global_symbol): New function.
7543 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7544 (Sized_incremental_binary::symbol_map_): New data member.
7545 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7546 * target.h (Sized_target::apply_relocation): New function.
7547 * target-reloc.h (apply_relocation): New function.
7548 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7549
7550 2011-04-22 Doug Kwan <dougkwan@google.com>
7551
7552 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7553 flag of a SHT_ARM_EXIDX section.
7554 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7555 * testsuite/Makefile.in: Regenerate.
7556 * testsuite/arm_exidx_test.s: New file.
7557 * testsuite/arm_exidx_test.sh: Same.
7558
7559 2011-04-20 Cary Coutant <ccoutant@google.com>
7560
7561 PR gold/12689
7562 * archive.h (Incremental_archive_entry::Archive_member):
7563 Initialize arg_serial_ (second constructor).
7564
7565 2011-04-17 Ian Lance Taylor <iant@google.com>
7566
7567 * object.cc (Relocate_info::location): Simplify location string.
7568 * errors.cc (Errors::error_at_location): Don't print program
7569 name.
7570 (Errors::warning_at_location): Likewise.
7571 (Errors::undefined_symbol): Likewise.
7572 * testsuite/debug_msg.sh: Update accordingly.
7573
7574 2011-04-14 Cary Coutant <ccoutant@google.com>
7575
7576 * gold/layout.cc (Layout::symtab_section_offset): New function.
7577 * gold/layout.h (Layout::symtab_section_offset): New function.
7578 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7579
7580 2011-04-12 Ian Lance Taylor <iant@google.com>
7581
7582 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7583 with MREMAP_MAYMOVE.
7584 * output.h (class Output_file): Add map_is_allocated_ field.
7585 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7586 not available, provide stubs. If mremap is not available, #define
7587 it to gold_mremap.
7588 (MREMAP_MAYMOVE): Define if not defined.
7589 (Output_file::Output_file): Initialize map_is_allocated_.
7590 (Output_file::resize): Check map_is_allocated_.
7591 (Output_file::map_anonymous): If mmap fails, use malloc.
7592 (Output_file::unmap): Don't do anything for an anonymous map.
7593 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7594 is not available, provide stubs.
7595 (File_read::View::~View): Use free rather than delete[].
7596 (File_read::make_view): Use malloc rather than new[]. If mmap
7597 fails, use malloc.
7598 (File_read::find_or_make_view): Use malloc rather than new[].
7599 * gold.h: Remove HAVE_REMAP code.
7600 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7601 exists. Rename mremap to gold_mremap. If mmap is not available
7602 don't do anything.
7603 * configure, config.in: Rebuild.
7604
7605 2011-04-11 Ian Lance Taylor <iant@google.com>
7606
7607 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7608 initialize local variable v.
7609
7610 2011-04-11 Cary Coutant <ccoutant@google.com>
7611
7612 * archive.cc (Archive::include_member): Adjust call to
7613 report_object.
7614 (Add_archive_symbols::run): Track argument serial numbers.
7615 (Lib_group::include_member): Likewise.
7616 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7617 * archive.h (Incremental_archive_entry::Archive_member):
7618 Initialize arg_serial_.
7619 (Archive_member::arg_serial_): New data member.
7620 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7621 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7622 incremental link.
7623 (Sized_dynobj::do_for_all_local_got_entries): New function.
7624 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7625 function.
7626 * fileread.cc (get_mtime): New function.
7627 * fileread.h (get_mtime): New function.
7628 * gold.cc (queue_initial_tasks): Check for incremental update.
7629 (process_incremental_input): New function.
7630 (queue_middle_tasks): Don't force valid target for incremental
7631 update.
7632 * incremental-dump.cc (find_input_containing_global): Adjust
7633 size of symbol info entry.
7634 (dump_incremental_inputs): Dump argument serial number and
7635 in_system_directory flag; bias shndx by 1; print symbol names
7636 when dumping per-file symbol lists; use new symbol info readers.
7637 * incremental.cc
7638 (Output_section_incremental_inputs:update_data_size): New function.
7639 (Sized_incremental_binary::setup_readers): Setup input readers
7640 for each input file; build maps for files added from libraries
7641 and scripts.
7642 (Sized_incremental_binary::check_input_args): New function.
7643 (Sized_incremental_binary::do_check_inputs): Build map of argument
7644 serial numbers to input arguments.
7645 (Sized_incremental_binary::do_file_has_changed): Rename
7646 do_file_is_unchanged to this; compare file modification times.
7647 (Sized_incremental_binary::do_init_layout): New function.
7648 (Sized_incremental_binary::do_reserve_layout): New function.
7649 (Sized_incremental_binary::do_get_input_reader): Remove.
7650 (Sized_incremental_binary::get_symtab_view): New function.
7651 (Incremental_checker::can_incrementally_link_output_file): Remove.
7652 (Incremental_inputs::report_command_line): Exclude --debug options.
7653 (Incremental_inputs::report_archive_begin): Add parameter; track
7654 argument serial numbers; don't put input file entry for archive
7655 before archive members.
7656 (Incremental_inputs::report_archive_end): Put input file entry
7657 for archive after archive members.
7658 (Incremental_inputs::report_object): Add parameter; track argument
7659 serial numbers and in_system_directory flag.
7660 (Incremental_inputs::report_script): Add parameter; track argument
7661 serial numbers.
7662 (Output_section_incremental_inputs::set_final_data_size): Adjust
7663 size of symbol info entry; check for forwarding symbols.
7664 (Output_section_incremental_inputs::write_input_files): Write
7665 in_system_directory flag and argument serial number.
7666 (Output_section_incremental_inputs::write_info_blocks): Map section
7667 indices between incremental info and original input file; store
7668 input section index for each symbol.
7669 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7670 change operator() to visit().
7671 (class Global_got_offset_visitor): Likewise.
7672 (class Global_symbol_visitor_got_plt):
7673 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7674 classes.
7675 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7676 (Sized_incr_relobj::do_read_symbols): New function.
7677 (Sized_incr_relobj::do_layout): New function.
7678 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7679 (Sized_incr_relobj::do_add_symbols): New function.
7680 (Sized_incr_relobj::do_should_include_member): New function.
7681 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7682 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7683 (Sized_incr_relobj::do_section_size): New function.
7684 (Sized_incr_relobj::do_section_name): New function.
7685 (Sized_incr_relobj::do_section_contents): New function.
7686 (Sized_incr_relobj::do_section_flags): New function.
7687 (Sized_incr_relobj::do_section_entsize): New function.
7688 (Sized_incr_relobj::do_section_address): New function.
7689 (Sized_incr_relobj::do_section_type): New function.
7690 (Sized_incr_relobj::do_section_link): New function.
7691 (Sized_incr_relobj::do_section_info): New function.
7692 (Sized_incr_relobj::do_section_addralign): New function.
7693 (Sized_incr_relobj::do_initialize_xindex): New function.
7694 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7695 (Sized_incr_relobj::do_read_relocs): New function.
7696 (Sized_incr_relobj::do_gc_process_relocs): New function.
7697 (Sized_incr_relobj::do_scan_relocs): New function.
7698 (Sized_incr_relobj::do_count_local_symbols): New function.
7699 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7700 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7701 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7702 (Sized_incr_relobj::do_relocate): New function.
7703 (Sized_incr_relobj::do_set_section_offset): New function.
7704 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7705 (Sized_incr_dynobj::do_read_symbols): New function.
7706 (Sized_incr_dynobj::do_layout): New function.
7707 (Sized_incr_dynobj::do_add_symbols): New function.
7708 (Sized_incr_dynobj::do_should_include_member): New function.
7709 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7710 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7711 (Sized_incr_dynobj::do_section_size): New function.
7712 (Sized_incr_dynobj::do_section_name): New function.
7713 (Sized_incr_dynobj::do_section_contents): New function.
7714 (Sized_incr_dynobj::do_section_flags): New function.
7715 (Sized_incr_dynobj::do_section_entsize): New function.
7716 (Sized_incr_dynobj::do_section_address): New function.
7717 (Sized_incr_dynobj::do_section_type): New function.
7718 (Sized_incr_dynobj::do_section_link): New function.
7719 (Sized_incr_dynobj::do_section_info): New function.
7720 (Sized_incr_dynobj::do_section_addralign): New function.
7721 (Sized_incr_dynobj::do_initialize_xindex): New function.
7722 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7723 (make_sized_incremental_object): New function.
7724 (Incremental_library::copy_unused_symbols): New function.
7725 (Incremental_library::do_for_all_unused_symbols): New function.
7726 * incremental.h (enum Incremental_input_flags): New type.
7727 (class Incremental_checker): Remove.
7728 (Incremental_input_entry::Incremental_input_entry): Add argument
7729 serial number.
7730 (Incremental_input_entry::arg_serial): New function.
7731 (Incremental_input_entry::set_is_in_system_directory): New function.
7732 (Incremental_input_entry::is_in_system_directory): New function.
7733 (Incremental_input_entry::arg_serial_): New data member.
7734 (Incremental_input_entry::is_in_system_directory_): New data member.
7735 (class Script_info): Move here from script.h.
7736 (Script_info::Script_info): Add filename parameter.
7737 (Script_info::filename): New function.
7738 (Script_info::filename_): New data member.
7739 (Incremental_script_entry::Incremental_script_entry): Add argument
7740 serial number.
7741 (Incremental_object_entry::Incremental_object_entry): Likewise.
7742 (Incremental_object_entry::add_input_section): Build list of input
7743 sections with map to original shndx.
7744 (Incremental_object_entry::get_input_section_index): New function.
7745 (Incremental_object_entry::shndx_): New data member.
7746 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7747 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7748 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7749 serial number.
7750 (Incremental_inputs::report_archive_begin): Likewise.
7751 (Incremental_inputs::report_object): Likewise.
7752 (Incremental_inputs::report_script): Likewise.
7753 (class Incremental_global_symbol_reader): New class.
7754 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7755 and store flags and input file type.
7756 (Incremental_input_entry_reader::arg_serial): New function.
7757 (Incremental_input_entry_reader::type): Extract type from flags.
7758 (Incremental_input_entry_reader::is_in_system_directory): New function.
7759 (Incremental_input_entry_reader::get_input_section_count): Call
7760 accessor function for type.
7761 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7762 function for type; adjust size of global symbol entry.
7763 (Incremental_input_entry_reader::get_global_symbol_count): Call
7764 accessor function for type.
7765 (Incremental_input_entry_reader::get_object_count): Likewise.
7766 (Incremental_input_entry_reader::get_object_offset): Likewise.
7767 (Incremental_input_entry_reader::get_member_count): Likewise.
7768 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7769 (Incremental_input_entry_reader::get_member_offset): Likewise.
7770 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7771 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7772 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7773 (Incremental_input_entry_reader::get_global_symbol_reader): New
7774 function.
7775 (Incremental_input_entry_reader::get_output_symbol_index): New
7776 function.
7777 (Incremental_input_entry_reader::type_): Remove.
7778 (Incremental_input_entry_reader::flags_): New data member.
7779 (Incremental_inputs_reader::input_file_offset): New function.
7780 (Incremental_inputs_reader::input_file_index): New function.
7781 (Incremental_inputs_reader::input_file): Call input_file_offset.
7782 (Incremental_inputs_reader::input_file_at_offset): New function.
7783 (Incremental_relocs_reader::get_r_type): Reformat.
7784 (Incremental_relocs_reader::get_r_shndx): Reformat.
7785 (Incremental_relocs_reader::get_r_offset): Reformat.
7786 (Incremental_relocs_reader::data): New function.
7787 (Incremental_binary::Incremental_binary): Initialize new data members.
7788 (Incremental_binary::check_inputs): Add cmdline parameter.
7789 (Incremental_binary::file_is_unchanged): Remove.
7790 (Input_reader::arg_serial): New function.
7791 (Input_reader::get_unused_symbol_count): New function.
7792 (Input_reader::get_unused_symbol): New function.
7793 (Input_reader::do_arg_serial): New function.
7794 (Input_reader::do_get_unused_symbol_count): New function.
7795 (Input_reader::do_get_unused_symbol): New function.
7796 (Incremental_binary::input_file_count): New function.
7797 (Incremental_binary::get_input_reader): Change signature to use
7798 index instead of filename.
7799 (Incremental_binary::file_has_changed): New function.
7800 (Incremental_binary::get_input_argument): New function.
7801 (Incremental_binary::get_library): New function.
7802 (Incremental_binary::get_script_info): New function.
7803 (Incremental_binary::init_layout): New function.
7804 (Incremental_binary::reserve_layout): New function.
7805 (Incremental_binary::output_file): New function.
7806 (Incremental_binary::do_check_inputs): New function.
7807 (Incremental_binary::do_file_is_unchanged): Remove.
7808 (Incremental_binary::do_file_has_changed): New function.
7809 (Incremental_binary::do_init_layout): New function.
7810 (Incremental_binary::do_reserve_layout): New function.
7811 (Incremental_binary::do_input_file_count): New function.
7812 (Incremental_binary::do_get_input_reader): Change signature.
7813 (Incremental_binary::input_args_map_): New data member.
7814 (Incremental_binary::library_map_): New data member.
7815 (Incremental_binary::script_map_): New data member.
7816 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7817 new data members.
7818 (Sized_incremental_binary::output_section): New function.
7819 (Sized_incremental_binary::inputs_reader): Add const.
7820 (Sized_incremental_binary::symtab_reader): Add const.
7821 (Sized_incremental_binary::relocs_reader): Add const.
7822 (Sized_incremental_binary::got_plt_reader): Add const.
7823 (Sized_incremental_binary::get_symtab_view): New function.
7824 (Sized_incremental_binary::Inputs_reader): New typedef.
7825 (Sized_incremental_binary::Input_entry_reader): New typedef.
7826 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7827 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7828 (Sized_incremental_binary::do_file_has_changed): New function.
7829 (Sized_incremental_binary::do_init_layout): New function.
7830 (Sized_incremental_binary::do_reserve_layout): New function.
7831 (Sized_input_reader::Inputs_reader): Remove.
7832 (Sized_input_reader::Input_entry_reader): Remove.
7833 (Sized_input_reader::do_arg_serial): New function.
7834 (Sized_input_reader::do_get_unused_symbol_count): New function.
7835 (Sized_input_reader::do_get_unused_symbol): New function.
7836 (Sized_incremental_binary::do_input_file_count): New function.
7837 (Sized_incremental_binary::do_get_input_reader): Change signature;
7838 use index instead of filename.
7839 (Sized_incremental_binary::section_map_): New data member.
7840 (Sized_incremental_binary::input_entry_readers_): New data member.
7841 (class Sized_incr_relobj): New class.
7842 (class Sized_incr_dynobj): New class.
7843 (make_sized_incremental_object): New function.
7844 (class Incremental_library): New class.
7845 * layout.cc (Free_list::num_lists): New static data member.
7846 (Free_list::num_nodes): New static data member.
7847 (Free_list::num_removes): New static data member.
7848 (Free_list::num_remove_visits): New static data member.
7849 (Free_list::num_allocates): New static data member.
7850 (Free_list::num_allocate_visits): New static data member.
7851 (Free_list::init): New function.
7852 (Free_list::remove): New function.
7853 (Free_list::allocate): New function.
7854 (Free_list::dump): New function.
7855 (Free_list::print_stats): New function.
7856 (Layout_task_runner::run): Resize output file for incremental updates.
7857 (Layout::Layout): Initialize new data members.
7858 (Layout::set_incremental_base): New function.
7859 (Layout::init_fixed_output_section): New function.
7860 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7861 incremental updates.
7862 (Layout::create_gold_note): Do not create gold note section for
7863 incremental updates.
7864 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7865 for incremental updates.
7866 (Layout::set_section_offsets): For incremental updates, allocate space
7867 from free list.
7868 (Layout::create_symtab_sections): Layout with offsets relative to
7869 start of section; for incremental updates, allocate space from free
7870 list.
7871 (Layout::create_shdrs): For incremental updates, allocate space from
7872 free list.
7873 (Layout::finish_dynamic_section): For incremental updates, do not
7874 check --as-needed (fixed in subsequent patch).
7875 * layout.h (class Free_list): New class.
7876 (Layout::set_incremental_base): New function.
7877 (Layout::incremental_base): New function.
7878 (Layout::init_fixed_output_section): New function.
7879 (Layout::allocate): New function.
7880 (Layout::incremental_base_): New data member.
7881 (Layout::free_list_): New data member.
7882 * main.cc (main): Print Free_list statistics.
7883 * object.cc (Relobj::finalize_incremental_relocs): Add
7884 clear_counts parameter; clear counts only when clear_counts is set.
7885 (Sized_relobj::Sized_relobj): Initialize new base class.
7886 (Sized_relobj::do_layout): Don't report special sections.
7887 (Sized_relobj::do_for_all_local_got_entries): New function.
7888 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7889 symtab_off to all symbol table offsets.
7890 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7891 * object.h (class Got_offset_list): Move to top of file.
7892 (Object::Object): Allow case where input_file == NULL.
7893 (Object::~Object): Likewise.
7894 (Object::input_file): Assert that input_file != NULL.
7895 (Object::lock): Allow case where input_file == NULL.
7896 (Object::unlock): Likewise.
7897 (Object::is_locked): Likewise.
7898 (Object::token): Likewise.
7899 (Object::release): Likewise.
7900 (Object::is_incremental): New function.
7901 (Object::get_mtime): New function.
7902 (Object::for_all_local_got_entries): New function.
7903 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7904 (Object::set_is_in_system_directory): New function.
7905 (Object::is_in_system_directory): New function.
7906 (Object::do_is_incremental): New function.
7907 (Object::do_get_mtime): New function.
7908 (Object::do_for_all_local_got_entries): New function.
7909 (Object::is_in_system_directory_): New data member.
7910 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7911 (class Sized_relobj_base): New class.
7912 (class Sized_relobj): Derive from Sized_relobj_base.
7913 (class Sized_relobj::Symbols): Redeclare from base class.
7914 (class Sized_relobj::local_got_offset_list): Remove.
7915 (class Sized_relobj::Output_sections): Redeclare from base class.
7916 (class Sized_relobj::do_for_all_local_got_entries): New function.
7917 (class Sized_relobj::write_local_symbols): Add offset parameter.
7918 (class Sized_relobj::local_symbol_offset_): Update comment.
7919 (class Sized_relobj::local_dynsym_offset_): Update comment.
7920 * options.cc (Input_arguments::add_file): Remove const.
7921 * options.h (Input_file_argument::Input_file_argument):
7922 Initialize arg_serial_ (all constructors).
7923 (Input_file_argument::set_arg_serial): New function.
7924 (Input_file_argument::arg_serial): New function.
7925 (Input_file_argument::arg_serial_): New data member.
7926 (Input_arguments::Input_arguments): Initialize file_count_.
7927 (Input_arguments::add_file): Remove const.
7928 (Input_arguments::number_of_input_files): New function.
7929 (Input_arguments::file_count_): New data member.
7930 (Command_line::number_of_input_files): Call
7931 Input_arguments::number_of_input_files.
7932 * output.cc (Output_segment_headers::Output_segment_headers):
7933 Set current size.
7934 (Output_section::Input_section::current_data_size): New function.
7935 (Output_section::Output_section): Initialize new data members.
7936 (Output_section::add_input_section): Don't do merge sections for
7937 an incremental link; allocate space from free list for an
7938 incremental update.
7939 (Output_section::add_output_section_data): Allocate space from
7940 free list for an incremental update.
7941 (Output_section::update_data_size): New function.
7942 (Output_section::set_fixed_layout): New function.
7943 (Output_section::reserve): New function.
7944 (Output_segment::set_section_addresses): Remove const.
7945 (Output_segment::set_section_list_addresses): Remove const; allocate
7946 space from free list for an incremental update.
7947 (Output_segment::set_offset): Adjust size of RELRO segment for an
7948 incremental update.
7949 * output.h (Output_data::current_data_size): Move here from
7950 child classes.
7951 (Output_data::pre_finalize_data_size): New function.
7952 (Output_data::update_data_size): New function.
7953 (Output_section_headers::update_data_size): new function.
7954 (Output_section_data_build::current_data_size): Move to Output_data.
7955 (Output_data_strtab::update_data_size): New function.
7956 (Output_section::current_data_size): Move to Output_data.
7957 (Output_section::set_fixed_layout): New function.
7958 (Output_section::has_fixed_layout): New function.
7959 (Output_section::reserve): New function.
7960 (Output_section::update_data_size): New function.
7961 (Output_section::has_fixed_layout_): New data member.
7962 (Output_section::free_list_): New data member.
7963 (Output_segment::set_section_addresses): Remove const.
7964 (Output_segment::set_section_list_addresses): Remove const.
7965 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7966 New function.
7967 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7968 New function.
7969 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7970 parameter when calling Add_symbols constructor; store argument
7971 serial number for members of a lib group.
7972 (Add_symbols::locks): Allow case where token == NULL.
7973 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7974 (Read_member::~Read_member): New function.
7975 (Read_member::is_runnable): New function.
7976 (Read_member::locks): New function.
7977 (Read_member::run): New function.
7978 (Check_script::~Check_script): New function.
7979 (Check_script::is_runnable): New function.
7980 (Check_script::locks): New function.
7981 (Check_script::run): New function.
7982 (Check_library::~Check_library): New function.
7983 (Check_library::is_runnable): New function.
7984 (Check_library::locks): New function.
7985 (Check_library::run): New function.
7986 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7987 (Add_symbols::library_): New data member.
7988 (class Read_member): New class.
7989 (class Check_script): New class.
7990 (class Check_library): New class.
7991 * reloc.cc (Read_relocs::is_runnable): Allow case where
7992 token == NULL.
7993 (Read_relocs::locks): Likewise.
7994 (Scan_relocs::locks): Likewise.
7995 (Relocate_task::locks): Likewise.
7996 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7997 to clear counters.
7998 (Sized_relobj::incremental_relocs_scan): Fix comment.
7999 (Sized_relobj::do_relocate): Pass output file offset to
8000 write_local_symbols.
8001 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8002 from class declaration.
8003 * script.cc (read_input_script): Allocate Script_info; pass
8004 argument serial number to report_script.
8005 * script.h (class Script_info): Move to incremental.h.
8006 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8007 * symtab.h (Symbol_table::add_from_incrobj): New function.
8008 (Symbol_table::set_file_offset): New function.
8009
8010 2011-04-05 Cary Coutant <ccoutant@google.com>
8011
8012 * incremental-dump.cc (dump_incremental_inputs): Change signature
8013 to take a Sized_incremental_binary; change caller. Use readers
8014 in Sized_incremental_binary.
8015 * incremental.cc
8016 (Sized_incremental_binary::find_incremental_inputs_sections):
8017 Rename do_find_incremental_inputs_sections to this.
8018 (Sized_incremental_binary::setup_readers): New function.
8019 (Sized_incremental_binary::do_check_inputs): Check
8020 has_incremental_info_ flag; move setup code to setup_readers;
8021 use input readers.
8022 (Sized_incremental_binary::do_file_is_unchanged): New function.
8023 (Sized_incremental_binary::do_get_input_reader): New function.
8024 * incremental.h (class Incremental_binary): Move to end of file.
8025 (Incremental_binary::file_is_unchanged): New function.
8026 (Incremental_binary::do_file_is_unchanged): New function.
8027 (Incremental_binary::Input_reader): New class.
8028 (Incremental_binary::get_input_reader): New function.
8029 (class Sized_incremental_binary): Move to end of file.
8030 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8031 input section reader classes.
8032 (Sized_incremental_binary::has_incremental_info): New function.
8033 (Sized_incremental_binary::inputs_reader): New function.
8034 (Sized_incremental_binary::symtab_reader): New function.
8035 (Sized_incremental_binary::relocs_reader): New function.
8036 (Sized_incremental_binary::got_plt_reader): New function.
8037 (Sized_incremental_binary::do_file_is_unchanged): New function.
8038 (Sized_incremental_binary::Sized_input_reader): New class.
8039 (Sized_incremental_binary::get_input_reader): New function.
8040 (Sized_incremental_binary::find_incremental_inputs_sections):
8041 Rename do_find_incremental_inputs_sections to this.
8042 (Sized_incremental_binary::setup_readers): New function.
8043 (Sized_incremental_binary::has_incremental_info_): New data member.
8044 (Sized_incremental_binary::inputs_reader_): New data member.
8045 (Sized_incremental_binary::symtab_reader_): New data member.
8046 (Sized_incremental_binary::relocs_reader_): New data member.
8047 (Sized_incremental_binary::got_plt_reader_): New data member.
8048 (Sized_incremental_binary::current_input_file_): New data member.
8049
8050 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8051
8052 PR gold/12640
8053 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8054 violation.
8055
8056 2011-03-30 Cary Coutant <ccoutant@google.com>
8057
8058 * archive.cc (Archive::include_member): Adjust call to report_object.
8059 (Add_archive_symbols::run): Add script_info to call to
8060 report_archive_begin.
8061 (Lib_group::include_member): Adjust call to report_object.
8062 (Add_lib_group_symbols::run): Adjust call to report_object.
8063 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8064 blocks. Add object count for script input files.
8065 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8066 script_info parameter; change all callers.
8067 (Incremental_inputs::report_object): Add script_info parameter;
8068 change all callers.
8069 (Incremental_inputs::report_script): Store backpointer to
8070 incremental info entry.
8071 (Output_section_incremental_inputs::set_final_data_size): Record
8072 additional information for scripts.
8073 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8074 * incremental.h (Incremental_script_entry::add_object): New function.
8075 (Incremental_script_entry::get_object_count): New function.
8076 (Incremental_script_entry::get_object): New function.
8077 (Incremental_script_entry::objects_): New data member; adjust
8078 constructor.
8079 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8080 (Incremental_inputs::report_object): Add script_info parameter.
8081 (Incremental_inputs_reader::get_object_count): New function.
8082 (Incremental_inputs_reader::get_object_offset): New function.
8083 * options.cc (Input_arguments::add_file): Return reference to
8084 new input argument.
8085 * options.h (Input_argument::set_script_info): New function.
8086 (Input_argument::script_info): New function.
8087 (Input_argument::script_info_): New data member; adjust all
8088 constructors.
8089 (Input_file_group::add_file): Return reference to new input argument.
8090 (Input_file_lib::add_file): Likewise.
8091 (Input_arguments::add_file): Likewise.
8092 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8093 * script.cc (Parser_closure::Parser_closure): Add script_info
8094 parameter; adjust all callers.
8095 (Parser_closure::script_info): New function.
8096 (Parser_closure::script_info_): New data member.
8097 (read_input_script): Report scripts earlier to incremental info.
8098 (script_add_file): Set script_info in Input_argument.
8099 (script_add_library): Likewise.
8100 * script.h (Script_options::Script_info): Rewrite class.
8101
8102 2011-03-29 Cary Coutant <ccoutant@google.com>
8103
8104 * archive.cc (Library_base::should_include_member): Move
8105 method here from class Archive.
8106 (Archive::Archive): Initialize base class.
8107 (Archive::should_include_member): Move to base class.
8108 (Archive::do_for_all_unused_symbols): New function.
8109 (Add_archive_symbols::run): Remove redundant access to
8110 incremental_inputs.
8111 (Lib_group::Lib_group): Initialize base class.
8112 (Lib_group::do_filename): New function.
8113 (Lib_group::include_member): Pass pointer to Lib_group to
8114 report_object.
8115 (Lib_group::do_for_all_unused_symbols): New function.
8116 (Add_lib_group_symbols::run): Report archive information for
8117 incremental links.
8118 * archive.h (class Library_base): New base class.
8119 (class Archive): Derive from Library_base.
8120 (Archive::filename): Move to base class.
8121 (Archive::set_incremental_info): Likewise.
8122 (Archive::incremental_info): Likewise.
8123 (Archive::Should_include): Likewise.
8124 (Archive::should_include_member): Likewise.
8125 (Archive::Armap_entry): Remove.
8126 (Archive::Unused_symbol_iterator): Remove.
8127 (Archive::unused_symbols_begin): Remove.
8128 (Archive::unused_symbols_end): Remove.
8129 (Archive::do_filename): New function.
8130 (Archive::do_get_mtime): New function.
8131 (Archive::do_for_all_unused_symbols): New function.
8132 (Archive::task_): Move to base class.
8133 (Archive::incremental_info_): Likewise.
8134 (class Lib_group): Derive from Library_base.
8135 (Lib_group::do_filename): New function.
8136 (Lib_group::do_get_mtime): New function.
8137 (Lib_group::do_for_all_unused_symbols): New function.
8138 (Lib_group::task_): Move to base class.
8139 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8140 function.
8141 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8142 function.
8143 * incremental.cc (Incremental_inputs::report_archive_begin):
8144 Use Library_base; call library's get_mtime; add incremental inputs
8145 entry before members.
8146 (class Unused_symbol_visitor): New class.
8147 (Incremental_inputs::report_archive_end): Use Library_base; use
8148 visitor class to record unused symbols; don't add incremental inputs
8149 entry after members.
8150 (Incremental_inputs::report_object): Use Library_base.
8151 * incremental.h
8152 (Incremental_archive_entry::Incremental_archive_entry): Remove
8153 unused Archive parameter.
8154 (Incremental_inputs::report_archive_begin): Use Library_base.
8155 (Incremental_inputs::report_archive_end): Likewise.
8156 (Incremental_inputs::report_object): Likewise.
8157 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8158 function.
8159 * object.h (Object::for_all_global_symbols): New function.
8160 (Object::do_for_all_global_symbols): New function.
8161 (Sized_relobj::do_for_all_global_symbols): New function.
8162 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8163 function.
8164 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8165 function.
8166
8167 2011-03-27 Ian Lance Taylor <iant@google.com>
8168
8169 * archive.cc (Archive::interpret_header): Return -1 if something
8170 goes wrong. Change callers accordingly.
8171
8172 2011-03-25 Cary Coutant <ccoutant@google.com>
8173
8174 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8175 * testsuite/Makefile.in: Regenerate.
8176
8177 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8178
8179 * plugin.cc (get_view): New.
8180 (Plugin::load): Pass get_view to the plugin.
8181 (Plugin_manager::get_view): New.
8182
8183 2011-03-21 Ian Lance Taylor <iant@google.com>
8184
8185 * testsuite/final_layout.sh: Rewrite to not use dc.
8186 * testsuite/relro_test.sh: Fail if dc is not present.
8187
8188 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8189
8190 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8191 Change == to -eq.
8192 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8193 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8194 Change == to -eq.
8195 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8196 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8197
8198 2011-03-14 Ian Lance Taylor <iant@google.com>
8199
8200 * script-sections.cc (Sort_output_sections::script_compare):
8201 Rename from is_before, change return type.
8202 (Sort_output_sections::operator()): Adjust accordingly.
8203
8204 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8205
8206 PR gold/12572
8207 * testsuite/odr_violation2.cc: Add comment to make all error line
8208 numbers double digits.
8209 * testsuite/debug_msg.sh: Adjust expected errors.
8210
8211 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8212
8213 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8214 but mark earlier ones as non-canonical
8215 (offset_to_iterator): Update search target and example
8216 (do_addr2line): Return extra lines in a vector*
8217 (format_file_lineno): Extract from do_addr2line
8218 (one_addr2line): Add vector* out-param
8219 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8220 when a lineno entry appeared last for its instruction
8221 (Dwarf_line_info): Add vector* out-param
8222 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8223 * symtab.cc (Odr_violation_compare): Include the lineno in the
8224 comparison again.
8225 (linenos_from_loc): New. Combine the canonical line for an
8226 address with its other lines.
8227 (True_if_intersect): New. Helper functor to make
8228 std::set_intersection a query.
8229 (detect_odr_violations): Compare sets of lines instead of just
8230 one line for each function. This became less deterministic, but
8231 has fewer false positives.
8232 * symtab.h: Declarations.
8233 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8234 mix an optimized and non-optimized object in the same binary
8235 (odr_violation2.so): Same.
8236 * testsuite/Makefile.in: Regenerate from Makefile.am.
8237 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8238 * testsuite/debug_msg.sh: Update line numbers and add
8239 assertions.
8240 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8241 non-optimized context.
8242 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8243 isn't inlined, and use OdrDerived in an optimized context.
8244 * testsuite/odr_header1.h: Defines OdrDerived, where
8245 optimization will change the
8246 first-instruction-in-the-destructor's file and line number.
8247 * testsuite/odr_header2.h: Defines OdrBase.
8248
8249 2011-03-09 Ian Lance Taylor <iant@google.com>
8250
8251 * fileread.cc (File_read::clear_views): Don't delete the whole
8252 file view.
8253
8254 2011-03-08 Ian Lance Taylor <iant@google.com>
8255
8256 PR gold/12525
8257 * fileread.cc: #include <climits>.
8258 (GOLD_IOV_MAX): Define.
8259 (File_read::read_multiple): Limit number of entries by iov_max.
8260 * fileread.h (class File_read): Always set max_readv_entries to
8261 128.
8262
8263 2011-03-07 Ian Lance Taylor <iant@google.com>
8264
8265 PR gold/12525
8266 * options.h (class General_options): Add -dy and -dn.
8267
8268 2011-03-02 Cary Coutant <ccoutant@google.com>
8269
8270 * testsuite/script_test_9.t: Add TLS segment.
8271
8272 2011-03-02 Simon Baldwin <simonb@google.com>
8273
8274 * configure.ac: Add check for gnu_indirect_function support in
8275 the toolchain building binutils.
8276 * configure: Rebuild.
8277
8278 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8279
8280 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8281 plugin only symbols.
8282 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8283 in plugin files as not needed in the symbol table.
8284
8285 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8286
8287 * output.cc (Output_section::add_input_section): Delay fill
8288 generation for section ordering.
8289
8290 2011-02-09 Ian Lance Taylor <iant@google.com>
8291
8292 PR gold/12316
8293 * object.h (class Sized_relobj): Remove clear_local_symbols.
8294 * reloc.cc (Sized_relobj::do_relocate): Don't call
8295 clear_local_symbols.
8296
8297 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8298
8299 * plugin.cc (is_visible_from_outside): Return true for symbols
8300 in the -u option.
8301
8302 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8303
8304 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8305 filename.
8306
8307 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8308
8309 * icf.h (is_section_foldable_candidate): Change type of parameter
8310 to std::string.
8311 * icf.cc (Icf::find_identical_sections): Change type of local variable
8312 section_name to be std::string.
8313 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8314
8315 2011-01-25 Ian Lance Taylor <iant@google.com>
8316
8317 * script.cc (script_add_extern): Rewrite to use
8318 add_symbol_reference.
8319
8320 2011-01-25 Doug Kwan <dougkwan@google.com>
8321
8322 * icf.cc (get_section_contents): Always lock section's object.
8323
8324 2011-01-24 Ian Lance Taylor <iant@google.com>
8325
8326 * options.h (class General_options): Accept
8327 --no-detect-odr-violations.
8328
8329 2011-01-24 Ian Lance Taylor <iant@google.com>
8330
8331 * version.cc (version_string): Bump to 1.11.
8332
8333 2011-01-24 Ian Lance Taylor <iant@google.com>
8334
8335 * plugin.cc (class Plugin_rescan): Define new class.
8336 (Plugin_manager::claim_file): Set any_claimed_.
8337 (Plugin_manager::save_archive): New function.
8338 (Plugin_manager::save_input_group): New function.
8339 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8340 necessary.
8341 (Plugin_manager::new_undefined_symbol): New function.
8342 (Plugin_manager::rescan): New function.
8343 (Plugin_manager::rescannable_defines): New function.
8344 (Plugin_manager::add_input_file): Set any_added_.
8345 * plugin.h (class Plugin_manager): define new fields rescannable_,
8346 undefined_symbols_, any_claimed_, and any_added_. Declare
8347 Plugin_rescan as friend. Declare new functions.
8348 (Plugin_manager::Rescannable): Define type.
8349 (Plugin_manager::Rescannable_list): Define type.
8350 (Plugin_manager::Undefined_symbol_list): Define type.
8351 (Plugin_manager::Plugin_manager): Initialize new fields.
8352 * archive.cc (Archive::defines_symbol): New function.
8353 (Add_archive_symbols::run): Pass archive to plugins if any.
8354 * archive.h (class Archive): Declare defines_symbol.
8355 * readsyms.cc (Input_group::~Input_group): New function.
8356 (Finish_group::run): Pass input_group to plugins if any.
8357 * readsyms.h (class Input_group): Declare destructor.
8358 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8359 any.
8360
8361 2011-01-10 Ian Lance Taylor <iant@google.com>
8362
8363 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8364 section as relro.
8365 (Layout::set_segment_offsets): Reset increase_relro before calling
8366 set_section_addresses a second time.
8367
8368 2011-01-04 Cary Coutant <ccoutant@google.com>
8369
8370 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8371 sections before NOBITS sections.
8372
8373 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8374
8375 * version.cc (print_version): Update copyright to 2011.
8376
8377 2010-12-23 Cary Coutant <ccoutant@google.com>
8378
8379 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8380 of OS to this->add. Add OD parameter to second form of the function.
8381
8382 2010-12-20 Ian Lance Taylor <iant@google.com>
8383
8384 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8385 second of two consecutive entries with same offset.
8386
8387 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8388
8389 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8390 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8391 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8392 to avoid unneeded links against $(LDADD).
8393 * testsuite/Makefile.in: Regenerate.
8394
8395 2010-12-15 Ian Lance Taylor <iant@google.com>
8396
8397 PR gold/12324
8398 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8399 for R_X86_64_32 and R_X86_64_PC32.
8400 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8401 ver_matching_def_pic.o.
8402 (ver_matching_def_pic.o): New target.
8403
8404 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8405
8406 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8407 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8408 Move definition before File_read::View member definitions.
8409 (File_read::View::~View): Initialize and hold lock before
8410 updating current_mapped_bytes.
8411
8412 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8413
8414 * dwarf_reader.cc: Remove outdated comment.
8415 * gold-threads.cc: Fix typo in error message.
8416 * archive.cc: Fix typos in comments.
8417 * archive.h: Likewise.
8418 * arm-reloc-property.cc: Likewise.
8419 * arm-reloc-property.h: Likewise.
8420 * arm-reloc.def: Likewise.
8421 * arm.cc: Likewise.
8422 * attributes.h: Likewise.
8423 * cref.cc: Likewise.
8424 * ehframe.cc: Likewise.
8425 * fileread.h: Likewise.
8426 * gold.h: Likewise.
8427 * i386.cc: Likewise.
8428 * icf.cc: Likewise.
8429 * incremental.h: Likewise.
8430 * int_encoding.cc: Likewise.
8431 * layout.h: Likewise.
8432 * main.cc: Likewise.
8433 * merge.h: Likewise.
8434 * object.cc: Likewise.
8435 * object.h: Likewise.
8436 * options.cc: Likewise.
8437 * readsyms.cc: Likewise.
8438 * reduced_debug_output.cc: Likewise.
8439 * reloc.cc: Likewise.
8440 * script-sections.cc: Likewise.
8441 * sparc.cc: Likewise.
8442 * symtab.h: Likewise.
8443 * target-reloc.h: Likewise.
8444 * target.cc: Likewise.
8445 * target.h: Likewise.
8446 * timer.cc: Likewise.
8447 * timer.h: Likewise.
8448 * x86_64.cc: Likewise.
8449
8450 2010-12-09 Cary Coutant <ccoutant@google.com>
8451
8452 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8453 stack.
8454 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8455 parameter; change all callers.
8456 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8457 * options.h (warn_execstack): New option.
8458
8459 2010-12-07 Doug Kwan <dougkwan@google.com>
8460
8461 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8462 like function call relocations.
8463
8464 2010-12-07 Ian Lance Taylor <iant@google.com>
8465
8466 * archive.cc (Archive::get_elf_object_for_member): Permit
8467 punconfigured to be NULL.
8468 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8469 (Archive::include_member): Pass NULL to get_elf_object_for_member
8470 if we searched for the archive and this is the first included
8471 object.
8472
8473 2010-12-01 Ian Lance Taylor <iant@google.com>
8474
8475 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8476 track_relocs_type_ field.
8477 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8478 Set track_relocs_type_.
8479 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8480 contents when using RELA relocs.
8481 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8482 reloc_map_.
8483 * reloc.cc (Track_relocs::next_addend): New function.
8484 * reloc.h (class Track_relocs): Declare next_addend.
8485
8486 2010-12-01 Ian Lance Taylor <iant@google.com>
8487
8488 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8489 virtual destructor.
8490
8491 2010-12-01 Ian Lance Taylor <iant@google.com>
8492
8493 * README: Update compilers known to work and fail.
8494
8495 2010-11-23 Matthias Klose <doko@ubuntu.com>
8496
8497 * configure.in: For --enable-gold, handle value `default' instead of
8498 `both*'. Always install ld as ld.bfd, install as ld if gold is
8499 not the default.
8500 * configure: Regenerate.
8501
8502 2010-11-18 Doug Kwan <dougkwan@google.com>
8503
8504 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8505 and right_alignment to be zero. Store result alignment only if it is
8506 greater than existing alignment.
8507
8508 2010-11-16 Cary Coutant <ccoutant@google.com>
8509
8510 PR gold/12220
8511 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8512 Check for ".zdebug_line".
8513
8514 2010-11-16 Doug Kwan <dougkwan@google.com>
8515 Cary Coutant <ccoutant@google.com>
8516
8517 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8518 by reference; adjust all callers.
8519 * output.cc (Output_segment::set_section_addresses): Adjust references
8520 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8521 list is empty.
8522 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8523 end at page boundary.
8524
8525 2010-11-16 Cary Coutant <ccoutant@google.com>
8526
8527 PR gold/12220
8528 * layout.cc (Layout::choose_output_section): Transform names of
8529 compressed sections even when using a script with a SECTIONS clause.
8530 (Layout::output_section_name): Remove code to transform
8531 compressed debug section names.
8532 * output.cc (Output_section::add_input_section): Use uncompressed
8533 section size when tracking input sections.
8534
8535 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8536
8537 * symtab.h (Symbol::NON_PIC_REF): Remove.
8538 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8539 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8540 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8541 (Symbol::use_plt_offset): Take a flags argument and pass it
8542 directly to needs_dynamic_reloc. Restrict check for undefined
8543 weak symbols to function calls.
8544 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8545 (Target_arm::Scan::global): Use it.
8546 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8547 (Target_arm::Relocate::relocate): Likewise.
8548 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8549 parameter with an r_type parameter. Use get_reference_flags
8550 to get the flags.
8551 (Target_arm::Relocate::relocate): Update accordingly.
8552 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8553 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8554 (Target_i386::Scan::global): Likewise.
8555 (Target_i386::Relocate::relocate): Likewise.
8556 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8557 parameter with an r_type parameter. Use get_reference_flags
8558 to get the flags.
8559 (Target_i386::Relocate::relocate): Update accordingly.
8560 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8561 (Target_powerpc::Scan::global): Use it.
8562 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8563 (Target_powerpc::Relocate::relocate): Likewise.
8564 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8565 (Target_sparc::Scan::global): Use it.
8566 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8567 (Target_sparc::Relocate::relocate): Likewise.
8568 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8569 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8570 (Target_x86_64::Scan::global): Likewise.
8571 (Target_x86_64::Relocate::relocate): Likewise.
8572
8573 2010-11-08 Doug Kwan <dougkwan@google.com>
8574 Cary Coutant <ccoutant@google.com>
8575
8576 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8577 (Arm_exidx_merge_section::section_contents_): New data member.
8578 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8579 (Arm_input_section::~Arm_input_section): De-allocate memory.
8580 (Arm_input_section::original_contents_): New data member.
8581 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8582 in parameters instead of calling Object::section_contents without
8583 locking.
8584 (Arm_output_section::group_section): New parameter TASK. Pass it
8585 to callees that need locking objects.
8586 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8587 to lock EXIDX input sections. Fix a formatting issue. Call
8588 Arm_exidx_merged_section::build_contents to create merged section
8589 contents.
8590 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8591 to lock object of stub table owner.
8592 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8593 TEXT_SIZE to initialize data member TEXT_SIZE_.
8594 (Arm_exidx_input_section::addralign): Fix typo in comment.
8595 (Arm_exidx_input_section::text_size): New method.
8596 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8597 that require locking objects. Lock objects before scanning for stubs
8598 and updating local symbols.
8599 (Arm_input_section<big_endian>::init): Copy contents of original
8600 input section.
8601 (Arm_input_section<big_endian>::do_write): Use saved contents of
8602 original input section instead of calling Object::section_contents
8603 without locking.
8604 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8605 size without calling Object::section_size().
8606 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8607 for size. Allocate a buffer for merged EXIDX entries.
8608 (Arm_exidx_merged_section::build_contents): New method.
8609 (Arm_exidx_merged_section::do_write): Move merge section contents
8610 building code to Arm_exidx_merged_section::build_contetns. Write
8611 out contetns in buffer instead of building it on the fly.
8612 (Arm_relobj::make_exidx_input_section): Also pass text section size
8613 to Arm_exidx_input_section constructor.
8614 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8615 (Arm_dynobj::do_read_symbols): Fix memory leak.
8616 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8617 * target.h: (class Task): Add forward declaration.
8618 (Target::relax): Add new parameter TASK and pass it to
8619 Target::do_relax().
8620 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8621
8622 2010-11-05 Cary Coutant <ccoutant@google.com>
8623
8624 PR gold/10708
8625 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8626 object when reading from the file.
8627 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8628 second layout pass.
8629 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8630 when reading section contents.
8631 (get_section_contents): Likewise.
8632 (icf::find_identical_sections): Likewise.
8633 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8634 object when reading from the file.
8635 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8636 the object when doing deferred section layout.
8637
8638 2010-11-03 Nick Clifton <nickc@redhat.com>
8639
8640 PR gold/12001
8641 * script.h (class Symbol_assignment: name): New member. Returns
8642 the name of the symbol.
8643 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8644 Returns true if the given symbol name is on the list of
8645 assignments wating to be processed.
8646 * archive.cc (should_incldue_member): If the symbol is undefined,
8647 check to see if it is on the list of symbols pending assignment.
8648
8649 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8650
8651 * script-sections.cc (Script_sections::find_memory_region): Check
8652 for a NULL output section pointer.
8653
8654 2010-10-29 Doug Kwan <dougkwan@google.com>
8655
8656 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8657 Output_section::add_relaxed_input_section.
8658 * output.cc (Output_section::add_relaxed_input_section): Add new
8659 arguments LAYOUT and NAME. Set section order index.
8660 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8661 Copy section order index.
8662 * output.h (Output_section::add_relaxed_input_section): Add new
8663 arguments LAYOUT and NAME.
8664
8665 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8666
8667 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8668 NATIVE_OR_CROSS_LINKER.
8669 * testsuite/Makefile.in: Regenerate.
8670
8671 2010-10-20 Doug Kwan <dougkwan@google.com>
8672
8673 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8674 without SHF_LINK_ORDER flags.
8675 * layout.cc (Layout::choose_output_section): Do not filter
8676 SHF_LINK_ORDER flag in a relocatable link.
8677
8678 2010-10-17 Cary Coutant <ccoutant@google.com>
8679
8680 * output.h (Output_segment::set_section_addresses): Change function
8681 signature. Update all callers.
8682 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8683 sections.
8684 (Output_segment::set_section_addresses): Align after last TLS
8685 section. Add padding before last relro section instead of after.
8686
8687 2010-10-17 Doug Kwan <dougkwan@google.com>
8688
8689 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8690 GOT output section to be writable.
8691
8692 2010-10-14 Cary Coutant <ccoutant@google.com>
8693
8694 * debug.h (DEBUG_INCREMENTAL): New flag.
8695 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8696 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8697 mode.
8698 * incremental.cc (report_command_line): Ignore all forms of
8699 --incremental.
8700 * layout.cc (Layout::Layout): Check parameters for incremental link
8701 mode.
8702 * options.cc (General_options::parse_incremental): New function.
8703 (General_options::parse_no_incremental): New function.
8704 (General_options::parse_incremental_full): New function.
8705 (General_options::parse_incremental_update): New function.
8706 (General_options::incremental_mode_): New data member.
8707 (General_options::finalize): Check incremental_mode_.
8708 * options.h (General_options): Update help text for --incremental.
8709 Add --no-incremental, --incremental-full, --incremental-update.
8710 (General_options::Incremental_mode): New enum type.
8711 (General_options::incremental_mode): New function.
8712 (General_options::incremental_mode_): New data member.
8713 * parameters.cc (Parameters::incremental_mode_): New data member.
8714 (Parameters::set_options): Set incremental_mode_.
8715 (Parameters::set_incremental_full): New function.
8716 (Parameters::incremental): New function.
8717 (Parameters::incremental_update): New function.
8718 (set_parameters_incremental_full): New function.
8719 * parameters.h (Parameters::set_incremental_full): New function.
8720 (Parameters::incremental): New function.
8721 (Parameters::incremental_update): New function.
8722 (Parameters::incremental_mode_): New data member.
8723 (set_parameters_incremental_full): New function.
8724 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8725 incremental link mode.
8726 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8727 (Sized_relobj::do_relocate_sections): Likewise.
8728 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8729 option.
8730 * testsuite/Makefile.in: Regenerate.
8731 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8732
8733 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8734
8735 * script-sections.h (class Script_sections): Make
8736 Sections_elements typedef public.
8737 * script-sections.cc (class Sort_output_sections): Add elements_
8738 field. Add constructor which sets it; change all callers.
8739 (Sort_output_sections::is_before): New function.
8740 (Sort_output_sections::operator()): Call is_before.
8741 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8742 conditional.
8743 * testsuite/script_test_10.sh: New test. Test script section
8744 order.
8745 * testsuite/script_test_10.t: Likewise.
8746 * testsuite/script_test_10.s: Likewise.
8747 * testsuite/Makefile.am: Wrap the cross linker tests and the
8748 common tests into NATIVE_OR_CROSS_LINKER.
8749 (check_SCRIPTS): Add script_test_10.sh.
8750 (check_DATA): Add script_test_10.stdout.
8751 (script_test_10.o, script_test_10): New targets.
8752 (script_test_10.stdout): New target.
8753 * configure, testsuite/Makefile.in: Regenerate.
8754
8755 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8756
8757 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8758 error for the deprecated relocations.
8759 (Target_arm::Scan::global): Likewise.
8760 (Target_arm::Relocate::relocate): Likewise.
8761
8762 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8763
8764 * fileread.cc (Input_file::find_file): Initialize *found_name
8765 and *namep when using the fallback search for case 4.
8766
8767 2010-10-11 Cary Coutant <ccoutant@google.com>
8768
8769 * options.h (class General_options): Redefine -z lazy as an alias for
8770 the negation of -z now.
8771
8772 2010-10-11 Ian Lance Taylor <iant@google.com>
8773
8774 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8775 binding.
8776
8777 2010-10-06 Nick Clifton <nickc@redhat.com>
8778
8779 * script-sections.cc(class Memory_region): Remove
8780 current_lma_offset_ field. Rename current_vma_offset_ to
8781 current_offset_. Add last_section_ field.
8782 (Memory_region::get_current_vma_address): Rename to
8783 get_current_address.
8784 (Memory_region::get_current_lma_address): Delete.
8785 (Memory_region::increment_vma_offset): Rename to
8786 increment_offset.
8787 (Memory_region::increment_lma_offset): Delete.
8788 (Memory_region::attributes_compatible): New method. Returns
8789 true if the provided section is compatible with the region.
8790 (Memory_region::get_last_section): New method. Returns the last
8791 section to use the region.
8792 (Memory_region::set_last_section): New method. Stores the last
8793 section to use the region.
8794 (Script_sections::block_in_region): New method. Returns true if
8795 a block of memory is contained within a region.
8796 (Script_sections::find_memory_region): New method. Locates a
8797 memory region to be used to set a VMA or LMA address.
8798 (Output_section_definition::set_section_addresses): Add code to
8799 check for addresses set by memory regions.
8800 (Output_segment::set_section_addresses): Remove memory region
8801 walking code.
8802 (Script_sections::create_segment): Add a warning if a header
8803 segment is created outside of any region.
8804 * script-sections.h (class Script_sections): Add prototypes for
8805 find_memory_region and block_in_region methods.
8806 * testsuite/memory_test.s: Use .long instead of .word.
8807 * testsuite/memory_test.t: Add some more output sections.
8808 * testsuite/memory_test.sh: Update expected output.
8809
8810 2010-10-02 Doug Kwan <dougkwan@google.com>
8811
8812 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8813 defintion to symtab.h
8814 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8815 declaration to defintion.
8816
8817 2010-10-01 Nick Clifton <nickc@redhat.com>
8818
8819 * expression.cc (eval): Replace dummy argument with NULL.
8820 (eval_maybe_dot): Check for a NULL result section pointer.
8821 (Symbol_expression::value): Likewise.
8822 (Dot_expression::value): Likewise.
8823 (BINARY_EXPRESSION): Likewise.
8824 (Max_expression::value): Likewise.
8825 (Min_expression::value): Likewise.
8826 (Absolute_expression::value): Likewise.
8827 (Addr_expression::value_from_output_section): Likewise.
8828 (Loaddddr_expression::value_from_output_section): Likewise.
8829 (Segment_start_expression::value): Likewise.
8830 * script-sections.cc
8831 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8832 argument with NULL.
8833 (Sections_elememt_dot_assignment::set_section_addresses):
8834 Likewise.
8835 (Output_data_expression::do_write_to_buffer): Likewise.
8836 (Output_section_definition::finalize_symbols): Likewise.
8837 (Output_section_definition::set_section_addresses): Likewise.
8838
8839 2010-09-30 Doug Kwan <dougkwan@google.com>
8840
8841 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8842
8843 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8844
8845 * target.h (Target::can_icf_inline_merge_sections): New virtual
8846 function.
8847 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8848 virtual function.
8849 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8850 virtual function.
8851 * icf.cc (get_section_contents): Inline merge sections only when
8852 target allows it.
8853
8854 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8855
8856 * configure: Regenerate.
8857
8858 2010-09-17 Ian Lance Taylor <iant@google.com>
8859
8860 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8861 * testsuite/Makefile.am (memory_test.o): New target.
8862 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8863 memory_test.t.
8864 * testsuite/Makefile.in: Rebuild.
8865
8866 2010-09-17 Doug Kwan <dougkwan@google.com>
8867
8868 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8869 defintion if relocation uses GOT entries of the symbol.
8870 * testsuite/icf_safe_test.sh: Fix test.
8871 * testsuite/icf_safe_so_test.sh: Fix test.
8872
8873 2010-09-16 Cary Coutant <ccoutant@google.com>
8874
8875 * script_sections.cc (class Memory_region): Remove "NULL" from
8876 vector initializations.
8877
8878 2010-09-15 Cary Coutant <ccoutant@google.com>
8879
8880 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8881 Resolve forwarding symbols.
8882
8883 2010-09-15 Doug Kwan <dougkwan@google.com>
8884
8885 * gold/testsuite/script_test_3.t: Add ARM special sections.
8886 * gold/testsuite/script_test_4.t: Same.
8887 * gold/testsuite/script_test_5.t: Same.
8888 * gold/testsuite/script_test_6.t: Same.
8889 * gold/testsuite/script_test_7.t: Same.
8890 * gold/testsuite/script_test_7.t: Same.
8891 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8892
8893 2010-09-14 Cary Coutant <ccoutant@google.com>
8894
8895 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8896 (Target_x86_64::Relocate::relocate_tls): Replace check for
8897 saw_tls_block_reloc_ with test for executable section.
8898
8899 2010-09-12 Cary Coutant <ccoutant@google.com>
8900
8901 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8902 position-independent executables to shared libraries need dynamic
8903 relocations.
8904 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8905 position-independent executables.
8906 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8907 * testsuite/Makefile.in: Regenerate.
8908
8909 2010-09-10 Nick Clifton <nickc@redhat.com>
8910
8911 PR gold/11997
8912 * testsuite/memory_test.t: Discard any sections that are not
8913 needed.
8914
8915 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8916
8917 PR gold/11996
8918 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8919 "This::" to work around a bug in gcc 4.2.
8920
8921 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8922
8923 2010-09-09 Rafael Espindola <espindola@google.com>
8924
8925 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8926 sections with different PF_X flags in the same segment.
8927 (Layout::find_first_load_seg): Search all segments to find the first
8928 one.
8929 * options.h (rosegment): New.
8930
8931 2010-09-08 Rafael Espindola <espindola@google.com>
8932
8933 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8934
8935 2010-09-08 Doug Kwan <dougkwan@google.com>
8936
8937 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8938 (Arm_relobj::do_relocate_sections): Add new parameter for output
8939 file to match the parent.
8940 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8941 of local symbols instead of input values. Update code to track
8942 changes in gold::relocate_section.
8943 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8944 (Sized_relobj::compute_final_local_value_internal): New methods.
8945 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8946 body into private version of Sized_relobj::compute_final_local_value.
8947 Call the inline method.
8948 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8949 merged symbol value if there is one.
8950 (Symbol_value::has_output_value): New method defintiion.
8951 (Sized_relobj::Compute_final_local_value_status): New enum type.
8952 (Sized_relobj::compute_final_local_value): New methods.
8953 (Sized_relobj::compute_final_local_value_internal): New methods.
8954 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8955 and arm_cortex_a8.sh.
8956 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8957 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8958 New tests.
8959 * Makefile.in: Regenerate.
8960 * testsuite/arm_bl_out_of_range.s: Update test.
8961 * testsuite/thumb_bl_out_of_range.s: Ditto.
8962 * testsuite/thumb_blx_out_of_range.s: Ditto.
8963 * testsuite/arm_branch_out_of_range.sh: New file.
8964 * testsuite/arm_cortex_a8.sh: Ditto.
8965 * testsuite/arm_cortex_a8_b.s: Ditto.
8966 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8967 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8968 * testsuite/arm_cortex_a8_bl.s: Ditto.
8969 * testsuite/arm_cortex_a8_blx.s: Ditto.
8970 * testsuite/arm_cortex_a8_local.s: Ditto.
8971 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8972 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8973
8974 2010-09-08 Rafael Espindola <espindola@google.com>
8975
8976 * Makefile.am (memory_test.stdout): Run readelf with -W.
8977 * Makefile.in: Regenerate.
8978 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8979 64 bit output.
8980
8981 2010-09-08 Rafael Espindola <espindola@google.com>
8982
8983 * script-sections.cc (Script_sections::add_memory_region): Convert
8984 field precision to int.
8985 * script.cc (script_set_section_region, script_set_section_region):
8986 Convert field precision to int.
8987
8988 2010-09-08 Rafael Espindola <espindola@google.com>
8989
8990 * arm.cc (do_finalize_sections): Create the __exidx_start and
8991 __exdix_end symbols even when the section is missing.
8992
8993 2010-09-08 Nick Clifton <nickc@redhat.com>
8994
8995 * README: Remove claim that MEMORY is not supported.
8996 * expression.cc (script_exp_function_origin)
8997 (script_exp_function_length): Move from here to ...
8998 * script.cc: ... here.
8999 (script_set_section_region, script_add_memory)
9000 (script_parse_memory_attr, script_include_directive): New
9001 functions.
9002 * script-sections.cc
9003 (class Memory_region): New class.
9004 (class Output_section_definition): Add set_memory_region,
9005 set_section_vma, set_section_lma and get_section_name methods.
9006 (class Script_Sections): Add add_memory_region,
9007 find_memory_region, find_memory_region_origin,
9008 find_memory_region_length and set_memory_region methods.
9009 Have set_section_addresses method walk the list of set memory
9010 regions.
9011 Extend the print methos to display memory regions.
9012 * script-sections.h: Add prototypes for new methods.
9013 Add enum for MEMORY region attributes.
9014 * yyscript.y: Add support for parsing MEMORY regions.
9015 * script-c.h: Add prototypes for new functions.
9016 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9017 * testsuite/Makefile.in: Regenerate.
9018 * testsuite/memory_test.sh: New script.
9019 * testsuite/memory_test.s: New assembler source file.
9020 * testsuite/memory_test.t: New linker script.
9021
9022 2010-08-27 Doug Kwan <dougkwan@google.com>
9023
9024 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9025 reference override an existing dynamic weak reference.
9026 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9027 * testsuite/Makefile.in: Regenerate.
9028 * testsuite/dyn_weak_ref.sh: New file.
9029 * testsuite/dyn_weak_ref_1.c: Ditto.
9030 * testsuite/dyn_weak_ref_2.c: Ditto.
9031
9032 2010-08-27 Ian Lance Taylor <iant@google.com>
9033
9034 * incremental.h (class Incremental_input_entry): Add virtual
9035 destructor.
9036
9037 2010-08-27 Ian Lance Taylor <iant@google.com>
9038
9039 * testsuite/start_lib_test_3.c: Mark t3 as used.
9040
9041 2010-08-27 Nick Clifton <nickc@redhat.com>
9042
9043 * options.cc (version_script): Fix small typo in previous
9044 whitespace tidyup.
9045
9046 2010-08-25 Nick Clifton <nickc@redhat.com>
9047
9048 * archive.cc: Formatting fixes: Remove whitespace between
9049 typename and following asterisk. Remove whitespace between
9050 function name and opening parenthesis.
9051 * archive.h: Likewise.
9052 * arm.cc: Likewise.
9053 * attributes.cc: Likewise.
9054 * attributes.h: Likewise.
9055 * common.cc: Likewise.
9056 * copy-relocs.cc: Likewise.
9057 * dirsearch.h: Likewise.
9058 * dynobj.cc: Likewise.
9059 * ehframe.cc: Likewise.
9060 * ehframe.h: Likewise.
9061 * expression.cc: Likewise.
9062 * fileread.cc: Likewise.
9063 * fileread.h: Likewise.
9064 * gc.h: Likewise.
9065 * gold-threads.cc: Likewise.
9066 * gold.cc: Likewise.
9067 * i386.cc: Likewise.
9068 * icf.h: Likewise.
9069 * incremental-dump.cc: Likewise.
9070 * incremental.cc: Likewise.
9071 * layout.cc: Likewise.
9072 * layout.h: Likewise.
9073 * main.cc: Likewise.
9074 * merge.cc: Likewise.
9075 * merge.h: Likewise.
9076 * object.cc: Likewise.
9077 * object.h: Likewise.
9078 * options.cc: Likewise.
9079 * options.h: Likewise.
9080 * output.cc: Likewise.
9081 * output.h: Likewise.
9082 * plugin.cc: Likewise.
9083 * plugin.h: Likewise.
9084 * powerpc.cc: Likewise.
9085 * reloc.cc: Likewise.
9086 * script-c.h: Likewise.
9087 * script-sections.cc: Likewise.
9088 * script.cc: Likewise.
9089 * stringpool.cc: Likewise.
9090 * symtab.cc: Likewise.
9091 * symtab.h: Likewise.
9092 * target.cc: Likewise.
9093 * timer.cc: Likewise.
9094 * timer.h: Likewise.
9095 * version.cc: Likewise.
9096 * x86_64.cc: Likewise.
9097
9098 2010-08-24 Nick Clifton <nickc@redhat.com>
9099
9100 PR 11899
9101 * layout.cc (segment_precedes): Sort segments by their physical
9102 addresses, if they have been set.
9103
9104 2010-08-23 Cary Coutant <ccoutant@google.com>
9105
9106 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9107 symbols data.
9108 (Lib_group::include_member): Unlock object after deleting its
9109 symbols data.
9110 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9111 the bug fixed here.
9112
9113 2010-08-19 Neil Vachharajani <nvachhar@google.com>
9114 Cary Coutant <ccoutant@google.com>
9115
9116 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9117 constructor, and set_blocker.
9118 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9119 readsyms_blocker_.
9120 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9121 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9122 * testsuite/Makefile.am (start_lib_test): New test case.
9123 * testsuite/Makefile.in: Regenerate.
9124 * testsuite/start_lib_test_main.c: New file.
9125 * testsuite/start_lib_test_1.c: New file.
9126 * testsuite/start_lib_test_2.c: New file.
9127 * testsuite/start_lib_test_3.c: New file.
9128
9129 2010-08-19 Ian Lance Taylor <iant@google.com>
9130
9131 * Makefile.in: Rebuild with automake 1.11.1.
9132 * aclocal.m4: Likewise.
9133 * testsuite/Makefile.in: Likewise.
9134
9135 2010-08-19 Ian Lance Taylor <iant@google.com>
9136
9137 PR 10893
9138 * i386.cc (class Output_data_plt_i386): Update declarations.
9139 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9140 local_ifuncs_ fields.
9141 (Target_i386::do_plt_section_for_global): New function.
9142 (Target_i386::do_plt_section_for_local): New function.
9143 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9144 parameter; change all callers. Initialize global_ifuncs_ and
9145 local_ifuncs_. If doing a static link define __rel_iplt_start and
9146 __rel_iplt_end.
9147 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9148 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9149 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9150 symbols.
9151 (Target_i386::make_plt_section): New function, broken out of
9152 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9153 (Target_i386::make_plt_entry): Call make_plt_section.
9154 (Target_i386::make_local_ifunc_plt_entry): New function.
9155 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9156 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9157 R_386_IRELATIVE to switch.
9158 (Target_i386::Scan::global): Likewise.
9159 (Target_i386::Relocate::relocate): Likewise.
9160 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9161 switch.
9162 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9163 (Target_x86_64::do_plt_section_for_global): New function.
9164 (Target_x86_64::do_plt_section_for_local): New function.
9165 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9166 parameter; change all callers. If doing a static link define
9167 __rela_iplt_start and __rela_iplt_end.
9168 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9169 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9170 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9171 to point to .plt.
9172 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9173 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9174 switch.
9175 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9176 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9177 R_X86_64_IRELATIVE to switch.
9178 (Target_x86_64::Scan::global): Likewise.
9179 (Target_x86_64::Relocate::relocate): Likewise.
9180 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9181 switch.
9182 * target.h (class Target): Add plt_section_for_global and
9183 plt_section_for_local functions. Add do_plt_section_for_global
9184 and do_plt_section_for_local virtual functions.
9185 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9186 clarifying comments.
9187 (Symbol::use_plt_offset): Handle IFUNC symbol.
9188 * object.cc (Sized_relobj::Sized_relobj): Initialize
9189 local_plt_offsets_.
9190 (Sized_relobj::local_has_plt_offset): New function.
9191 (Sized_relobj::local_plt_offset): New function.
9192 (Sized_relobj::set_local_plt_offset): New function.
9193 (Sized_relobj::do_count): Handle IFUNC symbol.
9194 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9195 a bit away from input_shndx_ field. Add set_is_func_symbol and
9196 is_ifunc_symbol functions.
9197 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9198 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9199 local_plt_offsets_ field.
9200 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9201 * output.h (class Output_section_data): Add non-const
9202 output_section function.
9203 (class Output_data_got): Update declarations.
9204 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9205 Add use_plt_offset parameter to global and local constructors.
9206 Change all callers. Change local_sym_index_ field to 31 bits.
9207 Change GSYM_CODE and CONSTANT_CODE accordingly.
9208 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9209 doing a static link don't set sh_link field.
9210 (Output_data_got::Got_entry::write): Use PLT offset if
9211 appropriate.
9212 (Output_data_got::add_global_plt): New function.
9213 (Output_data_got::add_local_plt): New function.
9214 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9215 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9216 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9217 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9218 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9219 IFUNC conditional.
9220 * testsuite/ifunc-sel.h: New file.
9221 * testsuite/ifuncmain1.c: New file.
9222 * testsuite/ifuncmain1vis.c: New file.
9223 * testsuite/ifuncmod1.c: New file.
9224 * testsuite/ifuncdep2.c: New file.
9225 * testsuite/ifuncmain2.c: New file.
9226 * testsuite/ifuncmain3.c: New file.
9227 * testsuite/ifuncmod3.c: New file.
9228 * testsuite/ifuncmain4.c: New file.
9229 * testsuite/ifuncmain5.c: New file.
9230 * testsuite/ifuncmod5.c: New file.
9231 * testsuite/ifuncmain6pie.c: New file.
9232 * testsuite/ifuncmod6.c: New file.
9233 * testsuite/ifuncmain7.c: New file.
9234 * configure, testsuite/Makefile.in: Rebuild.
9235
9236 2010-08-18 Ian Lance Taylor <iant@google.com>
9237
9238 * incremental.cc
9239 (Output_section_incremental_inputs::write_input_files): Add cast
9240 to avoid signed/unsigned comparison warning.
9241 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9242
9243 2010-08-12 Cary Coutant <ccoutant@google.com>
9244
9245 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9246
9247 2010-08-13 Ian Lance Taylor <iant@google.com>
9248
9249 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9250
9251 2010-08-12 Cary Coutant <ccoutant@google.com>
9252 Doug Kwan <dougkwan@google.com>
9253
9254 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9255 defintion overrides non-weak undef, remember that the original undef
9256 is not weak.
9257 * symtab.cc (Symbol_table::sized_write_global): For undef without
9258 an original weak binding, set binding to global in output.
9259 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9260 * testsuite/Makefile.in: Regenerate.
9261 * testsuite/strong_ref_weak_def.sh: New file.
9262 * testsuite/strong_ref_weak_def_1.c: Ditto.
9263 * testsuite/strong_ref_weak_def_2.c: Ditto.
9264
9265 2010-08-12 Cary Coutant <ccoutant@google.com>
9266
9267 * testsuite/incremental_test.sh: Rewrite.
9268 * testsuite/incremental_test_1.c: Rewrite.
9269 * testsuite/incremental_test_2.c: Rewrite.
9270
9271 2010-08-12 Cary Coutant <ccoutant@google.com>
9272
9273 * arm.cc (Target_arm::got_size): Add const.
9274 (Target_arm::got_entry_count): New function.
9275 (Target_arm::plt_entry_count): New function.
9276 (Target_arm::first_plt_entry_offset): New function.
9277 (Target_arm::plt_entry_size): New function.
9278 (Output_data_plt_arm::entry_count): New function.
9279 (Output_data_plt_arm::first_plt_entry_offset): New function.
9280 (Output_data_plt_arm::get_plt_entry_size): New function.
9281 * i386.cc (Target_i386::got_size): Add const.
9282 (Target_i386::got_entry_count): New function.
9283 (Target_i386::plt_entry_count): New function.
9284 (Target_i386::first_plt_entry_offset): New function.
9285 (Target_i386::plt_entry_size): New function.
9286 (Output_data_plt_i386::entry_count): New function.
9287 (Output_data_plt_i386::first_plt_entry_offset): New function.
9288 (Output_data_plt_i386::get_plt_entry_size): New function.
9289 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9290 find_incremental_inputs_sections. Dump incremental_got_plt section.
9291 * incremental.cc: Include target.h.
9292 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9293 parameter. Adjust all callers. Find incremental_got_plt section.
9294 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9295 section.
9296 (Output_section_incremental_inputs::set_final_data_size): Calculate
9297 size of incremental_got_plt section.
9298 (Output_section_incremental_inputs::do_write): Write the
9299 incremental_got_plt section.
9300 (Got_plt_view_info): New struct.
9301 (Local_got_offset_visitor): New class.
9302 (Global_got_offset_visitor): New class.
9303 (Global_symbol_visitor_got_plt): New class.
9304 (Output_section_incremental_inputs::write_got_plt): New function.
9305 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9306 Add parameter. Adjust all callers.
9307 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9308 (Incremental_inputs::got_plt_section): New function.
9309 (Incremental_inputs::got_plt_section_): New data member.
9310 (Incremental_got_plt_reader): New class.
9311 * layout.cc (Layout::create_incremental_info_sections): Add the
9312 incremental_got_plt section.
9313 * object.h (Got_offset_list::get_list): New function.
9314 (Got offset_list::for_all_got_offsets): New function.
9315 (Sized_relobj::local_got_offset_list): New function.
9316 * powerpc.cc (Target_powerpc::got_size): Add const.
9317 (Target_powerpc::got_entry_count): New function.
9318 (Target_powerpc::plt_entry_count): New function.
9319 (Target_powerpc::first_plt_entry_offset): New function.
9320 (Target_powerpc::plt_entry_size): New function.
9321 (Output_data_plt_powerpc::entry_count): New function.
9322 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9323 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9324 * sparc.cc (Target_sparc::got_size): Add const.
9325 (Target_sparc::got_entry_count): New function.
9326 (Target_sparc::plt_entry_count): New function.
9327 (Target_sparc::first_plt_entry_offset): New function.
9328 (Target_sparc::plt_entry_size): New function.
9329 (Output_data_plt_sparc::entry_count): New function.
9330 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9331 (Output_data_plt_sparc::get_plt_entry_size): New function.
9332 * symtab.h (Symbol::got_offset_list): New function.
9333 (Symbol_table::for_all_symbols): New function.
9334 * target.h (Sized_target::got_entry_count): New function.
9335 (Sized_target::plt_entry_count): New function.
9336 (Sized_target::plt_entry_size): New function.
9337 * x86_64.cc (Target_x86_64::got_size): Add const.
9338 (Target_x86_64::got_entry_count): New function.
9339 (Target_x86_64::plt_entry_count): New function.
9340 (Target_x86_64::first_plt_entry_offset): New function.
9341 (Target_x86_64::plt_entry_size): New function.
9342 (Output_data_plt_x86_64::entry_count): New function.
9343 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9344 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9345
9346 2010-08-12 Cary Coutant <ccoutant@google.com>
9347
9348 * archive.cc: Include incremental.h.
9349 (Archive::Archive): Initialize incremental_info_.
9350 (Archive::include_member): Record archive members in incremental info.
9351 (Add_archive_symbols::run): Record begin and end of an archive in
9352 incremental info.
9353 (Lib_group::include_member): Record objects in incremental info.
9354 * archive.h (Incremental_archive_entry): Forward declaration.
9355 (Archive::set_incremental_info): New member function.
9356 (Archive::incremental_info): New member function.
9357 (Archive::Unused_symbol_iterator): New class.
9358 (Archive::unused_symbols_begin): New member function.
9359 (Archive::unused_symbols_end): New member function.
9360 (Archive::incremental_info_): New data member.
9361 * incremental-dump.cc (find_input_containing_global): New function.
9362 (dump_incremental_inputs): Dump new incremental info sections.
9363 * incremental.cc: Include symtab.h.
9364 (Output_section_incremental_inputs): New class.
9365 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9366 new incremental info sections.
9367 (Sized_incremental_binary::do_check_inputs): Likewise.
9368 (Incremental_inputs::report_archive): Remove.
9369 (Incremental_inputs::report_archive_begin): New function.
9370 (Incremental_inputs::report_archive_end): New function.
9371 (Incremental_inputs::report_object): New function.
9372 (Incremental_inputs::finalize_inputs): Remove.
9373 (Incremental_inputs::report_input_section): New function.
9374 (Incremental_inputs::report_script): Rewrite.
9375 (Incremental_inputs::finalize): Do nothing but finalize string table.
9376 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9377 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9378 (Incremental_inputs::create_data_sections): New function.
9379 (Incremental_inputs::relocs_entsize): New function.
9380 (Output_section_incremental_inputs::set_final_data_size): New function.
9381 (Output_section_incremental_inputs::do_write): New function.
9382 (Output_section_incremental_inputs::write_header): New function.
9383 (Output_section_incremental_inputs::write_input_files): New function.
9384 (Output_section_incremental_inputs::write_info_blocks): New function.
9385 (Output_section_incremental_inputs::write_symtab): New function.
9386 * incremental.h (Incremental_script_entry): Forward declaration.
9387 (Incremental_object_entry): Forward declaration.
9388 (Incremental_archive_entry): Forward declaration.
9389 (Incremental_inputs): Forward declaration.
9390 (Incremental_inputs_header_data): Remove.
9391 (Incremental_inputs_header): Remove.
9392 (Incremental_inputs_header_write): Remove.
9393 (Incremental_inputs_entry_data): Remove.
9394 (Incremental_inputs_entry): Remove.
9395 (Incremental_inputs_entry_write): Remove.
9396 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9397 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9398 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9399 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9400 Likewise.
9401 (Incremental_input_entry): New class.
9402 (Incremental_script_entry): New class.
9403 (Incremental_object_entry): New class.
9404 (Incremental_archive_entry): New class.
9405 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9406 (Incremental_inputs::report_inputs): Remove.
9407 (Incremental_inputs::report_archive): Remove.
9408 (Incremental_inputs::report_archive_begin): New function.
9409 (Incremental_inputs::report_archive_end): New function.
9410 (Incremental_inputs::report_object): Change prototype.
9411 (Incremental_inputs::report_input_section): New function.
9412 (Incremental_inputs::report_script): Change prototype.
9413 (Incremental_inputs::get_reloc_count): New function.
9414 (Incremental_inputs::set_reloc_count): New function.
9415 (Incremental_inputs::create_data_sections): New function.
9416 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9417 (Incremental_inputs::inputs_section): New function.
9418 (Incremental_inputs::symtab_section): New function.
9419 (Incremental_inputs::relocs_section): New function.
9420 (Incremental_inputs::get_stringpool): Add const.
9421 (Incremental_inputs::command_line): Add const.
9422 (Incremental_inputs::inputs): Remove.
9423 (Incremental_inputs::command_line_key): New function.
9424 (Incremental_inputs::input_file_count): New function.
9425 (Incremental_inputs::input_files): New function.
9426 (Incremental_inputs::relocs_entsize): New function.
9427 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9428 (Incremental_inputs::finalize_inputs): Remove.
9429 (Incremental_inputs::Input_info): Remove.
9430 (Incremental_inputs::lock_): Remove.
9431 (Incremental_inputs::inputs_): Change type.
9432 (Incremental_inputs::inputs_map_): Remove.
9433 (Incremental_inputs::current_object_entry_): New data member.
9434 (Incremental_inputs::inputs_section_): New data member.
9435 (Incremental_inputs::symtab_section_): New data member.
9436 (Incremental_inputs::relocs_section_): New data member.
9437 (Incremental_inputs::reloc_count_): New data member.
9438 (Incremental_inputs_reader): New class.
9439 (Incremental_symtab_reader): New class.
9440 (Incremental_relocs_reader): New class.
9441 * layout.cc (Layout::finalize): Move finalization of incremental info
9442 and creation of incremental info sections to follow finalization of
9443 symbol table. Set offsets for postprocessing sections.
9444 (Layout::create_incremental_info_sections): Call
9445 Incremental_inputs::create_data_sections. Add incremental symtab
9446 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9447 sections to layout after input sections.
9448 * layout.h (struct Timespec): Forward declaration.
9449 (Layout::incremental_inputs): Add const.
9450 (Layout::create_incremental_info_sections): Add parameter.
9451 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9452 * object.cc: Include incremental.h.
9453 (Relobj::finalize_incremental_relocs): New function.
9454 (Sized_relobj::do_layout): Record input sections in incremental info.
9455 * object.h (Object::output_section): New function.
9456 (Object::output_section_offset): Moved from Relobj.
9457 (Object::get_incremental_reloc_base): New function.
9458 (Object::get_incremental_reloc_count): New function.
9459 (Object::do_output_section): New function.
9460 (Object::do_output_section_offset): Moved from Relobj.
9461 (Object::do_get_incremental_reloc_base): New function.
9462 (Object::do_get_incremental_reloc_count): New function.
9463 (Object::Object): Initialize new data members.
9464 (Relobj::output_section): Renamed do_output_section and moved to
9465 protected.
9466 (Relobj::output_section_offset): Moved to Object.
9467 (Relobj::do_get_incremental_reloc_base): New function.
9468 (Relobj::do_get_incremental_reloc_count): New function.
9469 (Relobj::allocate_incremental_reloc_counts): New function.
9470 (Relobj::count_incremental_reloc): New function.
9471 (Relobj::finalize_incremental_relocs): New function.
9472 (Relobj::next_incremental_reloc_index): New function.
9473 (Relobj::reloc_counts_): New data member.
9474 (Relobj::reloc_bases_): New data member.
9475 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9476 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9477 (Sized_relobj::incremental_relocs_scan): New function.
9478 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9479 (Sized_relobj::incremental_relocs_write): New function.
9480 (Sized_relobj::incremental_relocs_write_reltype): New function.
9481 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9482 incremental link.
9483 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9484 archives and object files elsewhere.
9485 (Add_symbols::run): Report object files here.
9486 (Finish_group::run): Report end of archive at end of group.
9487 * reloc.cc: Include layout.h, incremental.h.
9488 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9489 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9490 (Sized_relobj::incremental_relocs_scan): New function.
9491 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9492 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9493 (Sized_relobj::incremental_relocs_write): New function.
9494 (Sized_relobj::incremental_relocs_write_reltype): New function.
9495 * script.cc (read_input_script): Rewrite test for incremental link.
9496 Change call to Incremental_inputs::report_script.
9497 * symtab.h (Symbol_table::first_global_index): New function.
9498 (Symbol_table::output_count): New function.
9499
9500 2010-08-12 Doug Kwan <dougkwan@google.com>
9501
9502 * arm.cc (Target_arm::merge_object_attributes): Check command line
9503 options --no-wchar-size-warning and --no-enum-size-warning.
9504 * options.h (General_options): Add ld-compatible options
9505 --no-enum-size-warning and --no-wchar-size-warning.
9506
9507 2010-08-04 Ian Lance Taylor <iant@google.com>
9508
9509 * x86_64.cc (Target_x86_64::Scan::local): Use
9510 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9511 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9512 (Target_x86_64::Scan::global): Likewise.
9513 (Target_x86_64::Relocate::relocate): Likewise.
9514 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9515 Likewise.
9516
9517 2010-08-03 Cary Coutant <ccoutant@google.com>
9518
9519 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9520 to reserve space in merged_strings vector. Keep total input size
9521 for stats.
9522 (Output_merge_string::do_print_merge_stats): Print total input size.
9523 * merge.h (Output_merge_string): Add input_size_ field.
9524 * stringpool.cc (Stringpool_template::string_length): Move
9525 implementations out of Stringpool_template class and place in
9526 stringpool.h.
9527 * stringpool.h (string_length): Move out of Stringpool_template.
9528
9529 2010-08-03 Ian Lance Taylor <iant@google.com>
9530
9531 PR 11712
9532 * layout.cc (relaxation_loop_body): If address of load segment is
9533 set, adjust address to include headers if possible.
9534
9535 2010-08-03 Ian Lance Taylor <iant@google.com>
9536
9537 * version.cc (version_string): Bump to 1.10.
9538
9539 2010-08-03 Ian Lance Taylor <iant@google.com>
9540
9541 PR 11805
9542 * layout.h (enum Output_section_order): Define.
9543 (class Layout): Update declarations.
9544 * layout.cc (Layout::get_output_section): Add order parameter.
9545 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9546 is_first_non_relro parameters. Change all callers.
9547 (Layout::choose_output_section): Likewise.
9548 (Layout::add_output_section_data): Likewise.
9549 (Layout::make_output_section): Likewise. Set order.
9550 (Layout::default_section_order): New function.
9551 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9552 * output.cc (Output_section::Output_section): Initialize order_.
9553 Don't initialize deleted fields.
9554 (Output_segment::Output_segment): Don't initialize deleted
9555 fields.
9556 (Output_segment::add_output_section_to_load): New function
9557 replacing add_output_section. Change all callers to call this or
9558 add_output_section_to_nonload.
9559 (Output_segment::add_output_section_to_nonload): New function.
9560 (Output_segment::remove_output_section): Rewrite.
9561 (Output_segment::add_initial_output_data): Likewise.
9562 (Output_segment::has_any_data_sections): Likewise.
9563 (Output_segment::is_first_section_relro): Likewise.
9564 (Output_segment::maximum_alignment): Likewise.
9565 (Output_segment::has_dynamic_reloc): New function replacing
9566 dynamic_reloc_count. Change all callers.
9567 (Output_segment::has_dynamic_reloc_list): New function replacing
9568 dynamic_reloc_count_list. Change all callers.
9569 (Output_segment::set_section_addresses): Rewrite.
9570 (Output_segment::set_offset): Rewrite.
9571 (Output_segment::find_first_and_last_list): Remove.
9572 (Output_segment::set_tls_offsets): Rewrite.
9573 (Output_segment::first_section_load_address): Likewise.
9574 (Output_segment::output_section_count): Likewise.
9575 (Output_segment::section_with_lowest_load_address): Likewise.
9576 (Output_segment::write_section_headers): Likewise.
9577 (Output_segment::print_sections_to_map): Likewise.
9578 * output.h (class Output_data): Remove dynamic_reloc_count_
9579 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9580 (Output_data::add_dynamic_reloc): Rewrite.
9581 (Output_data::has_dynamic_reloc): New function.
9582 (Output_data::dynamic_reloc_count): Remove.
9583 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9584 is_last_relro_, is_first_non_relro_, is_interp_,
9585 is_dynamic_linker_section_ fields. Add order and set_order
9586 functions. Remove is_relro_local, set_is_relro_local,
9587 is_last_relro, set_is_last_relro, is_first_non_relro,
9588 set_is_first_non_relro functions, is_interp, set_is_interp,
9589 is_dynamic_linker_section, and set_is_dynamic_linker_section
9590 functions.
9591 (class Output_segment): Change Output_data_list from std::list to
9592 std:;vector. Add output_lists_ field. Remove output_data_ and
9593 output_bss_ fields. Update declarations.
9594
9595 2010-08-02 Ian Lance Taylor <iant@google.com>
9596
9597 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9598 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9599 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9600
9601 2010-08-02 Ian Lance Taylor <iant@google.com>
9602
9603 PR 11855
9604 * script.cc (Script_options::Script_options): Initialize
9605 symbol_definitions_ and symbol_references_.
9606 (Script_options::add_symbol_assignment): Update
9607 symbol_definitions_ and symbol_references_.
9608 (Script_options::add_symbol_reference): New function.
9609 (script_symbol): New function.
9610 * script.h (class Script_options): Add symbol_definitions_ and
9611 symbol_references_ fields.
9612 (Script_options::referenced_const_iterator): New type.
9613 (Script_options::referenced_begin): New function.
9614 (Script_options::referenced_end): New function.
9615 (Script_options::is_referenced): New function.
9616 (Script_options::any_unreferenced): New function.
9617 * script-c.h (script_symbol): Declare.
9618 * yyscript.y (exp): Call script_symbol.
9619 * symtab.cc: Include "script.h".
9620 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9621 Change all callers. Check symbols referenced by scripts.
9622 (Symbol_table::add_undefined_symbols_from_command_line): Add
9623 layout parameter. Change all callers.
9624 (Symbol_table::do_add_undefined_symbols_from_command_line):
9625 Likewise. Break out loop body. Check symbols referenced by
9626 scripts.
9627 (Symbol_table::add_undefined_symbol_from_command_line): New
9628 function broken out of
9629 do_add_undefined_symbols_from_command_line.
9630 * symtab.h (class Symbol_table): Update declarations.
9631 * archive.cc: Include "layout.h".
9632 (Archive::should_include_member): Add layout parameter. Change
9633 all callers. Check for symbol mentioned in expression.
9634 * archive.h (class Archive): Update declaration.
9635 * object.cc (Sized_relobj::do_should_include_member): Add layout
9636 parameter.
9637 * object.h (Object::should_include_member): Add layout parameter.
9638 Change all callers.
9639 (Object::do_should_include_member): Add layout parameter.
9640 (class Sized_relobj): Update declaration.
9641 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9642 parameter.
9643 * dynobj.h (class Sized_dynobj): Update declaration.
9644 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9645 layout parameter.
9646 * plugin.h (class Sized_pluginobj): Update declaration.
9647
9648 2010-08-02 Ian Lance Taylor <iant@google.com>
9649
9650 PR 11866
9651 * output.cc (Output_segment::set_offset): Search for the first and
9652 last sections rather than assuming that the list is in order.
9653 (Output_segment::find_first_and_last_list): New function.
9654 * output.h (class Output_segment): Update declarations.
9655 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9656 (relro_strip_test_SOURCES): New variable.
9657 (relro_strip_test_DEPENDENCIES): New variable.
9658 (relro_strip_test_LDFLAGS): New variable.
9659 (relro_strip_test_LDADD): New variable.
9660 (relro_strip_test.so): New target.
9661
9662 2010-08-02 Ian Lance Taylor <iant@google.com>
9663
9664 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9665 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9666 (Target_i386::got_tlsdesc_section): New function.
9667 (Target_i386::got_section): Create space for GOT entries for
9668 TLSDESC relocations.
9669 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9670 R_386_TLS_GOTDESC.
9671 (Target_i386::Scan::global): Likewise.
9672 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9673 using TLSDESC GOT.
9674 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9675 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9676 (Target_x86_64::got_tlsdesc_section): New function.
9677 (Target_x86_64::got_section): Create space for GOT entries for
9678 TLSDESC relocations.
9679 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9680 R_386_TLS_GOTDESC.
9681 (Target_x86_64::Scan::global): Likewise.
9682 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9683 using TLSDESC GOT.
9684
9685 2010-08-02 Ian Lance Taylor <iant@google.com>
9686
9687 * testsuite/final_layout.sh: Use dc to convert from hex to
9688 decimal.
9689
9690 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9691
9692 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9693 paramter to the call to gold::gc_process_relocs.
9694 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9695 paramter to the call to gold::gc_process_relocs.
9696 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9697 parameter to the call to gold::gc_process_relocs.
9698 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9699 template parameter to the call to gold::gc_process_relocs.
9700 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9701 paramter to the call to gold::gc_process_relocs.
9702 * gc.h (get_embedded_addend_size): New function.
9703 (gc_process_relocs): Save the size of the reloc for use by ICF.
9704 * icf.cc (get_section_contents): Get the addend from the text section
9705 for SHT_REL relocation sections.
9706 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9707 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9708 * int_encoding.h (read_from_pointer): New overloaded function.
9709 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9710 * testsuite/icf_sht_rel_addend_test.sh: New file.
9711 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9712 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9713
9714 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9715
9716 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9717 * Makefile.in: Regenerate.
9718 * testsuite/Makefile.in: Regenerate.
9719
9720 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9721
9722 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9723 * gold/testsuite/debug_msg.cc: Likewise.
9724 * gold/testsuite/odr_violation1.cc
9725 * gold/testsuite/odr_violation2.cc
9726
9727 2010-07-21 Cary Coutant <ccoutant@google.com>
9728
9729 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9730 string, and length fields.
9731 (Output_merge_string::Merged_strings_list): New type.
9732 (Output_merge_string::Merged_strings_lists): New typedef.
9733 (Output_merge_string): Replace merged_strings_ with
9734 merged_strings_lists_.
9735 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9736 Merged_strings_list per input object and section. Don't store pointer
9737 to the string. Don't store length with each merged string entry.
9738 (Output_merge_string::finalize_merged_data): Loop over list of merged
9739 strings lists. Recompute length of each merged string.
9740
9741 2010-07-15 Cary Coutant <ccoutant@google.com>
9742
9743 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9744 here.
9745
9746 2010-07-14 Ian Lance Taylor <iant@google.com>
9747
9748 * descriptors.cc (Descriptors::open): Report correct name in error
9749 message.
9750
9751 2010-07-13 Doug Kwan <dougkwan@google.com>
9752
9753 * arm.cc (Arm_input_section::Arm_input_section): For a
9754 SHT_ARM_EXIDX section, always keeps the input sections.
9755 (Arm_input_section::set_exidx_section_link): New method.
9756 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9757 has_errors_ to false.
9758 (Arm_exidx_input_section::has_errors,
9759 Arm_exidx_input_section::set_has_errors): New methods.
9760 (Arm_exidx_input_section::has_errors_): New data member.
9761 (Arm_relobj::get_exidx_shndx_list): New method.
9762 (Arm_output_section::append_text_sections_to_list): Do not skip
9763 section without SHF_EXECINSTR.
9764 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9765 errors.
9766 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9767 section header. Make error messages more verbose. Check for
9768 a non-executable section linked to an EXIDX section.
9769 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9770 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9771 check that there is no deferred EXIDX section if we exit early.
9772 Instead of not making an EXIDX section in case of an error, make one
9773 and set the has_errors flag of it.
9774 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9775 in a relocatable link.
9776 (Target_arm::do_relax): Look for the EXIDX output section instead of
9777 assuming that it is called .ARM.exidx.
9778 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9779 section list. Do not check for SHF_EXECINSTR section flags but
9780 skip any input section with errors.
9781 * output.cc (Output_section::Output_section): Initialize
9782 always_keeps_input_sections_ to false.
9783 (Output_section::add_input_section): Check for
9784 always_keeps_input_sections_.
9785 * output.h (Output_section::always_keeps_input_sections,
9786 Output_section::set_always_keeps_input_sections): New methods.
9787 (Output_section::always_keeps_input_sections): New data member.
9788
9789 2010-07-13 Rafael Espindola <espindola@google.com>
9790
9791 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9792 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9793
9794 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9795 Ian Lance Taylor <iant@google.com>
9796
9797 * output.h (Output_section_lookup_maps::add_merge_section):
9798 Correct check of whether value was inserted.
9799 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9800 (Output_section_lookup_maps::add_relaxed_input_section):
9801 Likewise.
9802 * arm.cc (Target_arm::got_section): Remove used local os.
9803 * i386.cc (Target_i386::got_section): Likewise.
9804 * x86_64.cc (Target_x86_64::got_section): Likewise.
9805 * sparc.cc (Target_sparc::got_section): Likewise.
9806 (Target_sparc::relocate): Remove unused local have_got_offset.
9807 * powerpc.cc (Target_powerpc::relocate): Likewise.
9808
9809 2010-07-13 Ian Lance Taylor <iant@google.com>
9810
9811 * compressed_output.cc (zlib_decompress): Fix signature in
9812 !HAVE_ZLIB_H case.
9813
9814 * archive.cc (Archive::include_member): Unlock an external member
9815 of a thin archive. Don't bother to delete an object we know is
9816 NULL.
9817
9818 2010-07-12 Cary Coutant <ccoutant@google.com>
9819
9820 * compressed_output.cc (zlib_decompress): New function.
9821 (get_uncompressed_size): New function.
9822 (decompress_input_section): New function.
9823 * compressed_output.h (get_uncompressed_size): New function.
9824 (decompress_input_section): New function.
9825 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9826 Handle compressed debug sections.
9827 * layout.cc (is_compressed_debug_section): New function.
9828 (Layout::output_section_name): Map compressed section names to
9829 canonical names.
9830 * layout.h (is_compressed_debug_section): New function.
9831 (is_debug_info_section): Recognize compressed debug sections.
9832 * merge.cc: Include compressed_output.h.
9833 (Output_merge_data::do_add_input_section): Handle compressed
9834 debug sections.
9835 (Output_merge_string::do_add_input_section): Handle compressed
9836 debug sections.
9837 * object.cc: Include compressed_output.h.
9838 (Sized_relobj::Sized_relobj): Initialize new data members.
9839 (build_compressed_section_map): New function.
9840 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9841 * object.h (Object::section_is_compressed): New method.
9842 (Object::do_section_is_compressed): New method.
9843 (Sized_relobj::Compressed_section_map): New type.
9844 (Sized_relobj::do_section_is_compressed): New method.
9845 (Sized_relobj::compressed_sections_): New data member.
9846 * output.cc (Output_section::add_input_section): Handle compressed
9847 debug sections.
9848 * reloc.cc: Include compressed_output.h.
9849 (Sized_relobj::write_sections): Handle compressed debug sections.
9850
9851 2010-07-08 Cary Coutant <ccoutant@google.com>
9852
9853 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9854 weak when resolving to a dynamic def.
9855 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9856 for weak undef/dynamic def cases. Adjust callers.
9857 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9858 undef_binding_weak_.
9859 (Symbol_table::sized_write_globals): Adjust symbol binding.
9860 (Symbol_table::sized_write_symbol): Add binding parameter.
9861 * symtab.h (Symbol::set_undef_binding): New method.
9862 (Symbol::is_undef_binding_weak): New method.
9863 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9864 (Symbol_table::should_override): Add new parameter.
9865 (Symbol_table::sized_write_symbol): Add new parameter.
9866
9867 * testsuite/weak_undef_file1.cc: Add new test case.
9868 * testsuite/weak_undef_file2.cc: Fix header comment.
9869 * testsuite/weak_undef_test.cc: Add new test case.
9870
9871 2010-06-29 Doug Kwan <dougkwan@google.com>
9872
9873 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9874 Initialize USE_SYMBOL_.
9875 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9876 definition.
9877 (Arm_reloc_property::uses_symbol_): New data member declaration.
9878 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9879 uses symbol value and symbol is undefined but not weakly undefined.
9880
9881 2010-06-28 Rafael Espindola <espindola@google.com>
9882
9883 * plugin.cc (Plugin::load): Use dlerror.
9884
9885 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9886
9887 * symtab.cc (detect_odr_violations): When reporting an ODR
9888 violation, report an object where the symbol is defined.
9889
9890 2010-06-25 Doug Kwan <dougkwan@google.com>
9891
9892 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9893 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9894 definition.
9895 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9896 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9897 target hook to detect function points.
9898 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9899 * icf.h (Icf::check_section_for_function_pointers): Change type of
9900 parameter SECTION_NAME to const reference to std::string. Use
9901 target hook to determine if section may have unsafe pointers.
9902 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9903 method definition.
9904
9905 2010-06-21 Rafael Espindola <espindola@google.com>
9906
9907 * fileread.cc (Input_file::find_fie): New
9908 (Input_file::open): Use Input_file::find_fie.
9909 * fileread.h (Input_file::find_fie): New
9910 * plugin.cc (set_extra_library_path): New.
9911 (Plugin::load): Add set_extra_library_path to the transfer vector.
9912 (Plugin_manager::set_extra_library_path): New.
9913 (Plugin_manager::add_input_file): Use the extra search path if set.
9914 (set_extra_library_path(): New.
9915 * plugin.h (Plugin_manager): Add set_extra_library_path and
9916 extra_search_path_.
9917
9918 2010-06-19 Cary Coutant <ccoutant@google.com>
9919
9920 * layout.cc (gdb_sections): Add .debug_types.
9921 (lines_only_debug_sections): Likewise.
9922
9923 2010-06-18 Rafael Espindola <espindola@google.com>
9924
9925 * plugin.cc (add_input_file,add_input_library)
9926 (Plugin_manager::add_input_file): Make filename arguments const.
9927 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9928 const.
9929
9930 2010-06-16 Doug Kwan <dougkwan@google.com>
9931
9932 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9933 .ARM.attributes section if we have not merged any input
9934 attributes sections.
9935
9936 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9937
9938 * arm.cc: Allow combining objects with no EABI version
9939 information.
9940
9941 2010-06-15 Rafael Espindola <espindola@google.com>
9942
9943 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9944
9945 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9946
9947 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9948 (struct iovec): Correct !HAVE_READV definition.
9949
9950 2010-06-10 Cary Coutant <ccoutant@google.com>
9951
9952 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9953 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9954 reloc sections.
9955 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9956
9957 PR 11683
9958 * symtab.h (Symbol::is_placeholder): New member function.
9959 * target-reloc.h (relocate_section): Check for placeholder symbols.
9960
9961 * testsuite/Makefile.am (plugin_test_8): New test.
9962 (plugin_test_9): New test.
9963 * testsuite/Makefile.in: Regenerate.
9964
9965 2010-06-09 Nick Clifton <nickc@redhat.com>
9966
9967 * yyscript.y (input_list_element): Allow strings prefixed with
9968 the '-' character. Treat these as libraries.
9969 * script.cc (script_add_library): New function. Adds a library
9970 specified by "-l<name>" found in an input script.
9971 * script-c.h: Add prototype for script_add_library.
9972
9973 2010-06-07 Doug Kwan <dougkwan@google.com>
9974
9975 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9976 Restrict stub-group size to be within long conditional branch
9977 range when working around cortex-A8 erratum.
9978
9979 2010-06-07 Damien Diederen <dd@crosstwine.com>
9980
9981 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9982 #ifdef typo.
9983
9984 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9985
9986 PR gold/11658
9987 * output.cc
9988 (Output_section::Input_section_sort_entry::compare_section_ordering):
9989 Change to return non-zero correctly.
9990 (Output_section::Input_section_sort_section_order_index_compare
9991 ::operator()): Change to fix ambiguity in comparisons.
9992
9993 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9994
9995 * gold.h (is_wildcard_string): New function.
9996 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9997 (Layout::layout_eh_frame): Ditto.
9998 (Layout::find_section_order_index): New method.
9999 (Layout::read_layout_from_file): New method.
10000 * layout.h (Layout::find_section_order_index): New method.
10001 (Layout::read_layout_from_file): New method.
10002 (Layout::input_section_position_): New private member.
10003 (Layout::input_section_glob_): New private member.
10004 * main.cc (main): Call read_layout_from_file here.
10005 * options.h (--section-ordering-file): New option.
10006 * output.cc (Output_section::input_section_order_specified_): New
10007 member.
10008 (Output_section::Output_section): Initialize new member.
10009 (Output_section::add_input_section): Add new parameter.
10010 Keep input sections when --section-ordering-file is used.
10011 (Output_section::set_final_data_size): Sort input sections when
10012 section ordering file is specified.
10013 (Output_section::Input_section_sort_entry): Add new parameter.
10014 Check sorting type.
10015 (Output_section::Input_section_sort_entry::compare_section_ordering):
10016 New method.
10017 (Output_section::Input_section_sort_compare::operator()): Change to
10018 consider section_order_index.
10019 (Output_section::Input_section_sort_init_fini_compare::operator()):
10020 Change to consider section_order_index.
10021 (Output_section::Input_section_sort_section_order_index_compare
10022 ::operator()): New method.
10023 (Output_section::sort_attached_input_sections): Change to sort
10024 according to section order when specified.
10025 (Output_section::add_input_section<32, true>): Add new parameter.
10026 (Output_section::add_input_section<64, true>): Add new parameter.
10027 (Output_section::add_input_section<32, false>): Add new parameter.
10028 (Output_section::add_input_section<64, false>): Add new parameter.
10029 * output.h (Output_section::add_input_section): Add new parameter.
10030 (Output_section::input_section_order_specified): New
10031 method.
10032 (Output_section::set_input_section_order_specified): New method.
10033 (Input_section::Input_section): Initialize section_order_index_.
10034 (Input_section::section_order_index): New method.
10035 (Input_section::set_section_order_index): New method.
10036 (Input_section::section_order_index_): New member.
10037 (Input_section::Input_section_sort_section_order_index_compare): New
10038 struct.
10039 (Output_section::input_section_order_specified_): New member.
10040 * script-sections.cc (is_wildcard_string): Delete and move modified
10041 method to gold.h.
10042 (Output_section_element_input::Output_section_element_input): Modify
10043 call to is_wildcard_string.
10044 (Output_section_element_input::Input_section_pattern
10045 ::Input_section_pattern): Ditto.
10046 (Output_section_element_input::Output_section_element_input): Ditto.
10047 * testsuite/Makefile.am (final_layout): New test case.
10048 * testsuite/Makefile.in: Regenerate.
10049 * testsuite/final_layout.cc: New file.
10050 * testsuite/final_layout.sh: New file.
10051
10052 2010-06-01 Rafael Espindola <espindola@google.com>
10053
10054 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10055
10056 2010-06-01 Rafael Espindola <espindola@google.com>
10057
10058 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10059 visibility of symbols.
10060
10061 2010-05-27 Doug Kwan <dougkwan@google.com>
10062
10063 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10064 from start of output section instead of address for a local symbol
10065 in a merged or relaxed section when doing a relocatable link.
10066
10067 2010-05-26 Rafael Espindola <espindola@google.com>
10068
10069 PR 11604
10070 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10071 adding sections the garbage collector removed.
10072 * gold/testsuite/Makefile.am: Add test.
10073 * gold/testsuite/Makefile.in: Regenerate.
10074 * gold/testsuite/plugin_test_7.sh: New.
10075 * gold/testsuite/plugin_test_7_1.c: New.
10076 * gold/testsuite/plugin_test_7_2.c: New.
10077
10078 2010-05-26 Rafael Espindola <espindola@google.com>
10079
10080 * script-sections.cc (Output_section_definition::set_section_addresses):
10081 Check for --section-start.
10082
10083 2010-05-26 Doug Kwan <dougkwan@google.com>
10084
10085 * arm.cc (Arm_scan_relocatable_relocs): New class.
10086 (Target_arm::relocate_special_relocatable): New method.
10087 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10088 (Arm_relocate_functions::thumb_branch_common): Same.
10089 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10090 instead of Default_scan_relocatable_relocs.
10091 * target-reloc.h (relocate_for_relocatable): Let target handle
10092 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10093 * target.h (Sized_target::relocate_special_relocatable): New method.
10094
10095 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10096
10097 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10098
10099 2010-05-23 Doug Kwan <dougkwan@google.com>
10100
10101 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10102 instead of a cast.
10103 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10104 with a direct branch, not a conditional branch, to a stub.
10105 * merge.cc (Output_merge_base::record_input_section): New method
10106 defintion.
10107 (Output_merge_data::do_add_input_section): Record input section if
10108 keeps-input-sections flag is set.
10109 (Output_merge_string::do_add_input_section): Ditto.
10110 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10111 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10112 INPUT_SECTIONS_.
10113 (Output_merge_base::keeps_input_sections,
10114 Output_merge_base::set_keeps_input_sections,
10115 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10116 method definitions.
10117 (Output_merge_base::Input_sections): New type declaration.
10118 (Output_merge_base::input_sections_begin,
10119 Output_merge_base::input_sections_end,
10120 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10121 (Output_merge_base::bool keeps_input_sections_,
10122 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10123 Output_merge_base::input_sections_): New data members.
10124 (Output_merge_data::do_set_keeps_input_sections): New method
10125 defintion.
10126 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10127 * output.cc (Output_section::Input_section::relobj): Move method
10128 defintion from class declaration to here and handle merge sections.
10129 (Output_section::Input_section::shndx): Ditto.
10130 (Output_section::Output_section): Remove initializations of removed
10131 data members and initialize new data member LOOKUP_MAPS_.
10132 (Output_section::add_input_section): Set keeps-input-sections flag
10133 for a newly created merge output section as appropriate. Adjust code
10134 to use Output_section_lookup_maps class.
10135 (Output_section::add_relaxed_input_section): Adjst code for lookup
10136 maps code refactoring.
10137 (Output_section::add_merge_input_section): Add a new parameter
10138 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10139 class. If adding input section to a newly created merge output
10140 section fails, remove the new merge section.
10141 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
10142 Adjust code for use of the Output_section_lookup_maps class.
10143 (Output_section::find_merge_section): Ditto.
10144 (Output_section::build_lookup_maps): New method defintion.
10145 (Output_section::find_relaxed_input_section): Adjust code to use
10146 Output_section_lookup_maps class.
10147 (Output_section::get_input_sections): Export merge sections. Adjust
10148 code to use Output_section_lookup_maps class.
10149 (Output_section:::add_script_input_section): Adjust code to use
10150 Output_section_lookup_maps class. Update lookup maps for merge
10151 sections also.
10152 (Output_section::discard_states): Use Output_section_lookup_maps.
10153 (Output_section::restore_states): Same.
10154 * output.h (Merge_section_properties): Move class defintion out of
10155 Output_section.
10156 (Output_section_lookup_maps): New class.
10157 (Output_section::Input_section::is_merge_section): New method
10158 defintion.
10159 (Output_section::Input_section::relobj): Move defintion out of class
10160 defintion. Declare method only.
10161 (Output_section::Input_section::shndx): Ditto.
10162 (Output_section::Input_section::output_merge_base): New method defintion.
10163 (Output_section::Input_section::u2_.pomb): New union field.
10164 (Output_section::Merge_section_by_properties_map,
10165 Output_section::Output_section_data_by_input_section_map,
10166 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10167 Remove types.
10168 (Output_section::add_merge_input_section): Add new parameter
10169 KEEPS_INPUT_SECTIONS.
10170 (Output_section::build_lookup_maps): New method declaration.
10171 (Output_section::merge_section_map_,
10172 Output_section::merge_section_by_properties_map_,
10173 Output_section::relaxed_input_section_map_,
10174 Output_section::is_relaxed_input_section_map_valid_): Remove data
10175 members.
10176 (Output_section::lookup_maps_): New data member.
10177
10178 2010-05-21 Doug Kwan <dougkwan@google.com>
10179
10180 PR gold/11619
10181 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10182 avoid a compilation error.
10183
10184 2010-05-19 Rafael Espindola <espindola@google.com>
10185
10186 * script-sections.cc (Output_section_definition::allocate_to_segment):
10187 Update the phdrs_list even when the output section is NULL.
10188 * testsuite/Makefile.am: Add test.
10189 * testsuite/Makefile.in: Regenerate.
10190 * testsuite/script_test_9.cc: New.
10191 * testsuite/script_test_9.sh: New.
10192 * testsuite/script_test_9.t: New.
10193
10194 2010-05-19 Doug Kwan <dougkwan@google.com>
10195
10196 * arm.cc (Arm_input_section::original_size): New method.
10197 (Arm_input_section::do_addralign): Add a cast.
10198 (Arm_input_section::do_output_offset): Remove static cast.
10199 (Arm_input_section::original_addralign,
10200 Arm_input_section::original_size_): Change type to uint32_t.
10201 (Arm_input_section::init): Add safe casts for section alignment
10202 and size.
10203 (Arm_input_section::set_final_data_size): Do not set address and
10204 offset of stub table.
10205 (Arm_output_section::fix_exidx_coverage): Change use of of
10206 Output_section::Simple_input_section to that of
10207 Output_section::Input_section.
10208 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10209 except for the first pass.
10210 * output.cc (Output_section::get_input_sections): Change type of
10211 input_sections to std::list<Input_section>.
10212 (Output_section::add_script_input_section): Rename from
10213 Output_section::add_simple_input_section. Change type of SIS
10214 parameter from Simple_input_section to Input_section.
10215 * output.h (Output_section::Simple_input_section): Remove class.
10216 (Output_section::Input_section): Change class visibility to public.
10217 (Output_section::Input_section::addralign): Use stored alignments
10218 for special input sections if set.
10219 (Output_section::Input_section::set_addralign): New method.
10220 (Output_section::get_input_sections): Change parameter type from
10221 list of Simple_input_section to list of Input_section.
10222 (Output_section::add_script_input_section): Rename from
10223 Output_section::add_simple_input_section. Change first parameter's
10224 type from Simple_input_section to Input_section and remove the
10225 second and third parameters.
10226 * script-sections.cc (Input_section::Input_section_list): Change
10227 type to list of Output_section::Input_section/
10228 (Input_section_info::Input_section_info): Change parameter type of
10229 INPUT_SECTION to Output_section::Input_section.
10230 (Input_section_info::input_section): Change return type.
10231 (Input_section_info::input_section_): Change type to
10232 Output_section::Input_section.
10233 (Output_section_element_input::set_section_addresses): Adjust code
10234 to use Output_section::Input_section instead of
10235 Output_section::Simple_input_section. Adjust code for renaming
10236 of Output_section::add_simple_input_section.
10237 (Orphan_output_section::set_section_addresses): Ditto.
10238
10239 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10240
10241 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10242 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10243
10244 2010-05-18 Rafael Espindola <espindola@google.com>
10245
10246 * options.cc (General_options::finalize): Handle -nostdlib.
10247 * options.h (nostdlib): New option.
10248 * script.cc (script_add_search_dir): Handle -nostdlib.
10249
10250 2010-05-12 Doug Kwan <dougkwan@google.com>
10251
10252 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10253 attributes section only if there no attributes section after merging.
10254 (Target_arm::merge_object_attributes): Move value of
10255 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10256 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10257 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10258 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10259 and arm_attr_merge_7.stdout.
10260 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10261 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10262 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10263 arm_attr_merge_7b.o): New rules.
10264 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10265 arm_attr_merge_7
10266 * testsuite/Makefile.in: Regenerate.
10267 * testsuite/arm_attr_merge.sh: New file.
10268 * testsuite/arm_attr_merge_[67][ab].s: Same.
10269
10270 2010-05-05 Nick Clifton <nickc@redhat.com>
10271
10272 * po/es.po: Updated Spanish translation.
10273
10274 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10275
10276 * Makefile.am (install-exec-local): Properly install gold as
10277 default cross linker.
10278 * Makefile.in: Regenerated.
10279
10280 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10281 Nick Clifton <nickc@redhat.com>
10282
10283 * configure.ac (install_as_default): Define and set to false
10284 unless --enable-gold or --enable-gold=both/gold has been
10285 specified.
10286 * configure: Regenerate.
10287
10288 * Makefile.am (install-exec-local): Install the executable as
10289 'ld.gold'. If install_as_default is true then also install it as
10290 'ld'.
10291 * Makefile.in: Regenerated.
10292
10293 2010-04-24 Ian Lance Taylor <iant@google.com>
10294
10295 * layout.cc (Layout::layout_reloc): In relocatable link don't
10296 combine reloc sections for grouped sections.
10297
10298 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10299
10300 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10301 sections that are not ordinary to icf.
10302 * icf.cc (get_section_contents): Handle relocation pointing to section
10303 with no object or shndx information.
10304 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10305 * testsuite/Makefile.in: Regenerate.
10306 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10307 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10308
10309 2010-04-22 Ian Lance Taylor <iant@google.com>
10310
10311 * expression.cc (Expression::Expression_eval_info): Add
10312 result_alignment_pointer field.
10313 (Expression::eval_with_dot): Add result_alignment_pointer
10314 parameter. Change all callers.
10315 (Expression::eval_maybe_dot): Likewise.
10316 (class Binary_expression): Add alignment_pointer parameter to
10317 left_value and right_value. Change all callers.
10318 (BINARY_EXPRESSION): Set result alignment.
10319 (class Trinary_expression): Add alignment_pointer parameter to
10320 arg2_value and arg3_value. Change all callers.
10321 (Trinary_cond::value): Set result alignment.
10322 (Max_expression::value, Min_expression::value): Likewise.
10323 (Align_expression::value): Likewise.
10324 * script-sections.cc (class Sections_element): Add dot_alignment
10325 parameter to set_section_addresses virtual function. Update
10326 instantiations.
10327 (class Output_section_element): Likewise.
10328 (Script_sections::create_segments): Add dot_alignment parameter.
10329 Change all callers.
10330 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10331 (Script_sections::set_phdrs_clause_addresses): Likewise.
10332 * script-sections.h: Update declarations.
10333 * script.h: Update declarations.
10334 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10335 min_p_align.
10336 * testsuite/script_test_3.t: Set large alignment.
10337 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10338 segment has expected alignment.
10339
10340 2010-04-22 Nick Clifton <nickc@redhat.com>
10341
10342 * po/gold.pot: Updated by the Translation project.
10343 * po/vi.po: Updated Vietnamese translation.
10344
10345 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10346
10347 * testsuite/Makefile.am (check_PROGRAMS): Add
10348 icf_virtual_function_folding_test.
10349 * testsuite/Makefile.in: Regenerated.
10350
10351 2010-04-15 Andrew Haley <aph@redhat.com>
10352
10353 * options.h (merge_exidx_entries): New option.
10354 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10355 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10356 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10357 (Target_arm::merge_exidx_entries): New function.
10358 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10359 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10360 to Arm_exidx_fixup constructor.
10361 Add new arg, merge_exidx_entries.
10362 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10363 Arm_output_section::fix_exidx_coverage.
10364
10365 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10366
10367 * icf.cc (get_section_contents): Check for preemptible functions.
10368 Ignore addend when appropriate.
10369 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10370 section folded.
10371 (add_from_relobj): Check for section folded.
10372 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10373 * symtab.h (should_add_dynsym_entry): Add new parameter.
10374 * target-reloc.h (scan_relocs): Check for section folded.
10375 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10376 Check reloc types for function pointers in shared objects.
10377 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10378 case.
10379 (icf_preemptible_functions_test): New test case.
10380 (icf_string_merge_test): New test case.
10381 * testsuite.Makefile.in: Regenerate.
10382 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10383 bar_glob. Refactor code.
10384 * testsuite/icf_preemptible_functions_test.cc: New file.
10385 * testsuite/icf_preemptible_functions_test.sh: New file.
10386 * testsuite/icf_string_merge_test.cc: New file.
10387 * testsuite/icf_string_merge_test.sh: New file.
10388 * testsuite/icf_virtual_function_folding_test.cc: New file.
10389 * testsuite/icf_virtual_function_folding_test.sh: New file.
10390
10391 2010-04-14 Doug Kwan <dougkwan@google.com>
10392
10393 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10394 for local symbol recounting if we remove a section due to ICF.
10395 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10396 there are no regular objects in input.
10397
10398 2010-04-13 Doug Kwan <dougkwan@google.com>
10399
10400 * arm.cc (Arm_input_section::set_final_data_size): Compute
10401 accurate final data size instead of using current data size.
10402
10403 2010-04-09 Doug Kwan <dougkwan@google.com>
10404
10405 * layout.cc (Layout::choose_output_section): Handle script section
10406 types.
10407 (Layout::make_output_section_for_script): Add section type parameter.
10408 Handle script section types.
10409 * layout.h (Layout::make_output_section_for_script): Add section
10410 type parameter.
10411 * output.cc (Output_section::Output_section): Initialize data member
10412 is_noload_.
10413 (Output_section::do_reset_address_and_file_offset): Do not set address
10414 to 0 if section is a NOLOAD section.
10415 * output.h (Output_section::is_noload): New method.
10416 (Output_section::set_is_noload): Ditto.
10417 (Output_section::is_noload_): New data member.
10418 * script-c.h (Script_section_type): New enum type.
10419 (struct Parser_output_section_header): Add new file section_type.
10420 * script-sections.cc (Sections_element::output_section_name): Add
10421 parameter for returning script section type.
10422 (Output_section_definition::output_section_name): Ditto.
10423 (Output_section_definition::section_type)P; New method.
10424 (Output_section_definiton::script_section_type_name): Ditto.
10425 (Output_section_definition::script_section_type_): New data member.
10426 (Output_section_definition::Output_section_definition): Initialize
10427 data member Output_section_definition::script_section_type_.
10428 (Output_section_definition::create_sections): Pass script section type
10429 to Layout::make_output_section_for_script.
10430 (Output_section_definition::output_section_name): Return script
10431 section type to caller.
10432 (Output_section_definition::set_section_address): Do not advance
10433 dot value and load address if section type is NOLOAD. Set address
10434 of NOLOAD sections regardless of section flags.
10435 (Output_section_definition::print): Print section type if it is
10436 not SCRIPT_SECTION_TYPE_NONE.
10437 (Output_section_definition::section_type): New method.
10438 (Output_section_definition::script_section_type_name): Ditto.
10439 (Script_sections::output_section_name): Add new parameter
10440 PSECTION_TYPE for returning script section type. Pass it to
10441 section elements. Handle discard sections.
10442 (Sort_output_sections::operator()): Handle NOLOAD sections.
10443 * script-sections.h (Script_sections::Section_type): New enum type.
10444 (Script_sections::output_section_name): Add a new parameter for
10445 returning script section type.
10446 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10447 INFO and NOLOAD.
10448 * yyscript.y (union): Add new field SECTION_TYPE.
10449 (COPY, DSECT, INFO, NOLOAD): New tokens.
10450 (opt_address_and_section_type): Change type to output_section_header.
10451 (section_type): New non-terminal
10452 (section_header): Handle section type.
10453 (opt_address_and_section_type): Return section type value.
10454
10455 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10456
10457 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10458 * testsuite/plugin_common_test_2.c (foo): Likewise.
10459
10460 2010-04-08 Doug Kwan <dougkwan@google.com>
10461
10462 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10463 Output_merge_data.
10464 * output.cc (Output_section::add_merge_input_section): Simplify
10465 code and return status of Output_merge_base::add_input_section.
10466 Update merge section map only if Output_merge_base::add_input_section
10467 returns true.
10468
10469 2010-04-07 Doug Kwan <dougkwan@google.com>
10470
10471 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10472 if section is marked as containing instructions but has no mapping
10473 symbols.
10474 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10475 correct section index.
10476 (Arm_relobj::find_linked_text_section): Ditto.
10477
10478 2010-04-07 Cary Coutant <ccoutant@google.com>
10479
10480 * archive.cc (include_member): Destroy Read_symbols_data object before
10481 releasing file.
10482 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10483 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10484 (Read_symbols_data::~Read_symbols_data) New destructor.
10485 (Section_relocs::Section_relocs) New constructor.
10486 (Section_relocs::~Section_relocs) New destructor.
10487 (Read_relocs_data::Read_relocs_data) New constructor.
10488 (Read_relocs_data::~Read_relocs_data) New destructor.
10489 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10490 pointers to NULL after deleting.
10491
10492 2010-04-07 Doug Kwan <dougkwan@google.com>
10493
10494 * arm.cc: Replace "endianity" with "endianness" in comments.
10495 (Arm_exidx_cantunwind): Ditto.
10496 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10497 (Arm_relobj::merge_flags_and_attributes): New method.
10498 (Arm_relobj::merge_flags_and_attributes_): New data member.
10499 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10500 (Arm_relobj::scan_sections_for_stubs): Ditto.
10501 (Arm_relobj::do_read_symbols): Check to see if we really want to
10502 merge processor-specific flags and attributes. Exit early if
10503 an object is empty except for section names and the undefined symbol.
10504 (Target_arm::do_finalize_sections): Move check for ELF format to
10505 Arm_relobj::do_read_symbols. Merge processor specific flags and
10506 attributes from a regular object only when we have determined that
10507 it is aapropriate. Do not create an .ARM.attributes section in
10508 output if there is no regular input object.
10509 (Target_arm::merge_processor_specific_flags): Check
10510 --warn-mismatch before printing any error.
10511 (Target_arm::merge_object_attributes): Ditto.
10512 * gold.cc (queue_middle_tasks): Handle the case in which there is
10513 no regular object in input.
10514 * options.cc (General_options::parse_EB): New method.
10515 (General_options::parse_EL): Same.
10516 (General_options::General_options): Initialize endianness_.
10517 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10518 New options.
10519 (General_options::Endianness): New enum.
10520 (General_options::endianness): New method.
10521 (General_options::endianness_): New data member.
10522 * parameters.cc (Parameters::set_options): Check target endianness.
10523 (Parameters::set_target_once): Ditto.
10524 (Parameters::check_target_endianness): New method.
10525 (parameters_force_valid_target): If either -EL or -EB is specified,
10526 use it to define endianness of default target.
10527 * parameters.h (Parameters::check_target_endianness): New method
10528 declaration.
10529 * target.h (class Target): Change "endianity" to "endianness"
10530 in comments.
10531
10532 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10533
10534 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10535 * configure: Regenerate.
10536 * Makefile.in: Regenerate.
10537 * testsuite/Makefile.in: Regenerate.
10538
10539 2010-04-06 Cary Coutant <ccoutant@google.com>
10540
10541 gcc PR lto/42757
10542 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10543 prevailing definitions of common symbols.
10544 * testsuite/plugin_test_6.sh: New test case.
10545 * testsuite/plugin_common_test_1.c: New test case.
10546 * testsuite/plugin_common_test_2.c: New test case.
10547 * testsuite/Makefile.am (plugin_test_6): New test case.
10548 * testsuite/Makefile.in: Regenerate.
10549
10550 2010-04-06 Nick Clifton <nickc@redhat.com>
10551
10552 * po/vi.po: New Vietnamese translation.
10553
10554 2010-03-30 Doug Kwan <dougkwan@google.com>
10555
10556 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10557
10558 2010-03-25 Doug Kwan <dougkwan@google.com>
10559
10560 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10561 to avoid a conversion warning on a 32-bit host.
10562
10563 2010-03-24 Ian Lance Taylor <iant@google.com>
10564
10565 * testsuite/script_test_3.t: Add a TLS segment.
10566 * testsuite/Makefile.am (check_PROGRAMS): Add
10567 tls_phdrs_script_test.
10568 (tls_phdrs_script_test_SOURCES): Define.
10569 (tls_phdrs_script_test_DEPENDENCIES): Define.
10570 (tls_phdrs_script_test_LDFLAGS): Define.
10571 (tls_phdrs_script_test_LDADD): Define.
10572 * testsuite/Makefile.in: Rebuild.
10573
10574 2010-03-23 Cary Coutant <ccoutant@google.com>
10575
10576 * fileread.cc (find_or_make_view): Fix comment.
10577
10578 2010-03-23 Ian Lance Taylor <iant@google.com>
10579
10580 * script-sections.cc (class Orphan_section_placement): Define
10581 PLACE_TLS and PLACE_TLS_BSS.
10582 (Orphan_section_placement::Orphan_section_placement): Initialize
10583 new places.
10584 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10585 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10586 (tls_script_test_SOURCES): Define.
10587 (tls_script_test_DEPENDENCIES): Define.
10588 (tls_script_test_LDFLAGS): Define.
10589 (tls_script_test_LDADD): Define.
10590 * testsuite/Makefile.in: Rebuild.
10591
10592 2010-03-22 Doug Kwan <dougkwan@google.com>
10593
10594 * arm.cc (Arm_relocate_functions::abs8,
10595 Arm_relocate_functions::abs16): Use correct check for overflow
10596 specified in the ARM ELF specs.
10597 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10598 target of a BLX instruction specially.
10599 (Reloc_stub::stub_type_for_reloc): Ditto.
10600 (Relocate::relocate): Use symbolic names instead of numeric relocation
10601 codes to report error.
10602 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10603 workaround.
10604 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10605 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10606 thumb2_blx_out_of_range.stdout
10607 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10608 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10609 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10610 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10611 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10612 thumb2_blx_in_range, thumb2_blx_in_range.o,
10613 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10614 thumb2_blx_out_of_range.o): New rules.
10615 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10616 thumb2_blx_in_range and thumb2_blx_out_of_range.
10617 * testsuite/Makefile.in: Regenerate.
10618 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10619 * testsuite/thumb_blx_in_range.s: New file.
10620 * testsuite/thumb_blx_out_of_range.s: New file.
10621
10622 2010-03-22 Rafael Espindola <espindola@google.com>
10623
10624 * archive.cc (Should_include): Move to archive.h.
10625 (should_include_member): Make it a member of Archive.
10626 (Lib_group): New.
10627 (Add_lib_group_symbols): New.
10628 * archive.h: Include options.h.
10629 (Archive_member): Moved from Archive.
10630 (Should_include): Moved from archive.cc.
10631 (Lib_group): New.
10632 (Add_lib_group_symbols): New.
10633 * dynobj.cc (do_should_include_member): New.
10634 * dynobj.h (do_should_include_member): New.
10635 * gold.cc (queue_initial_tasks): Update call to queue.
10636 * main.cc (main): Print lib group stats.
10637 * object.cc (do_should_include_member): New.
10638 * object.h: Include archive.h.
10639 (Object::should_include_member): New.
10640 (Object::do_should_include_member): New.
10641 (Sized_relobj::do_should_include_member): New.
10642 * options.cc (General_options::parse_start_lib): New.
10643 (General_options::parse_end_lib): New.
10644 (Input_arguments::add_file): Handle lib groups.
10645 (Input_arguments::start_group): Check we are not in a lib.
10646 (Input_arguments::start_lib): New.
10647 (Input_arguments::end_lib): New.
10648 * options.h (General_options): Add start_lib and end_lib.
10649 (Input_argument::lib_): New.
10650 (Input_argument::lib): New.
10651 (Input_argument::is_lib): New.
10652 (Input_file_lib): New.
10653 (Input_arguments::in_lib_): New.
10654 (Input_arguments::in_lib): New.
10655 (Input_arguments::start_lib): New.
10656 (Input_arguments::end_lib_): New.
10657 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10658 in unused members as preempted.
10659 (Sized_pluginobj::do_should_include_member): New.
10660 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10661 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10662 return the blocker.
10663 (Read_symbols::do_whole_lib_group): New.
10664 (Read_symbols::do_lib_group): New.
10665 (Read_symbols::do_read_symbols): Handle lib groups.
10666 (Read_symbols::get_name): Handle lib groups.
10667 * readsyms.h (Read_symbols): Add an archive member pointer.
10668 (Read_symbols::do_whole_lib_group): New.
10669 (Read_symbols::do_lib_group): New.
10670 (Read_symbols::member_): New.
10671 * script.cc (read_input_script): Update call to queue_soon.
10672
10673 2010-03-19 Doug Kwan <dougkwan@google.com>
10674
10675 * arm.cc (Stub_table::Stub_table): Initialize new data members
10676 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10677 (Stub_table::add_reloc_stub): Assign stub offset and update
10678 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10679 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10680 New data members.
10681 (Stub_table::update_data_size_and_addralign): Use
10682 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10683 instead of going over all reloc stubs.
10684 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10685 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10686 Stringpool_template::offset_ to size of Stringpool_char.
10687 (Stringpool_template::new_key_offset): Remove code to initialize
10688 Stringpool_template::offset_.
10689 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10690 Stringpool_template::offset_ to zero.
10691
10692 2010-03-15 Doug Kwan <dougkwan@google.com>
10693
10694 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10695 offset_.
10696 (Stringpool_template::new_key_offset): New method.
10697 (Stringpool_template::add_string): Assign offsets when adding new
10698 strings.
10699 (Stringpool_template::set_string_offsets): Do not set string offsets
10700 when not optimizing.
10701 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10702 member size_.
10703 (Chunked_vector::clear): Clear size_.
10704 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10705 (Chunked_vector::size): Return size_.
10706 (Chunked_vector::push_back): Use size_ to find insert position.
10707 (Chunked_vector::size_): New data member.
10708 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10709 (Stringpool_template::new_key_offset): New method declaration.
10710 (Stringpool_template::offset_): New data member.
10711
10712 2010-03-15 Rafael Espindola <espindola@google.com>
10713
10714 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10715 Add_symbols' constructor.
10716 * readsyms.h (Add_symbols): Remove the input_group member.
10717
10718 2010-03-10 Ian Lance Taylor <iant@google.com>
10719
10720 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10721 target to ask whether a reference to a symbol requires a stack
10722 split.
10723 * target.h (Target::is_call_to_non_split): New function.
10724 (Target::do_is_call_to_non_split): Declare virtual function.
10725 * target.cc: Include "symtab.h".
10726 (Target::do_is_call_to_non_split): New function.
10727 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10728
10729 2010-03-10 Cary Coutant <ccoutant@google.com>
10730
10731 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10732 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10733 (File_read::open[2]): Add whole_file_view_ to list of views.
10734 (File_read::make_view): Remove test of whole_file_view_.
10735 (File_read::find_or_make_view): Create whole_file_view_ if
10736 necessary.
10737 (File_read::clear_views): Replace bool parameter with enum;
10738 adjust all callers. Don't delete views with permanent data;
10739 do delete cached views and views from archives if
10740 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10741 if clearing the corresponding view.
10742 * fileread.h (File_read::Clear_views_mode): New enum.
10743 (File_read::View::is_permanent_view): New method.
10744 (File_read::clear_views): Replace bool parameter
10745 with enum; adjust all callers.
10746 * options.h (General_options): Change keep_files_mapped option;
10747 add map_whole_files.
10748 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10749 releasing the file.
10750 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10751 the file.
10752
10753 2010-03-10 David S. Miller <davem@davemloft.net>
10754
10755 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10756
10757 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10758
10759 * icf.cc (get_section_contents): Add '@' marker after processing the
10760 merge reloc.
10761
10762 2010-03-08 Doug Kwan <dougkwan@google.com>
10763
10764 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10765 due to a conversion warning.
10766 (Arm_relobj::update_output_local_symbol_count): Check for local
10767 symbol with unset output index.
10768
10769 2010-03-05 Ian Lance Taylor <iant@google.com>
10770
10771 * options.h (class General_options): Add --spare-dynamic-tags.
10772 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10773 --spare-dynamic-tags.
10774
10775 2010-03-05 Ian Lance Taylor <iant@google.com>
10776
10777 * incremental.cc: Include "libiberty.h".
10778
10779 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10780
10781 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10782 function, is_info_ member.
10783 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10784 (Versions::Versions): Update caller.
10785 (Versions::define_base_version): Likewise.
10786 (Versions::add_def): Likewise.
10787
10788 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10789
10790 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10791 (Scan::possible_function_pointer_reloc): New function.
10792 (Scan::local_reloc_may_be_function_pointer): Change to call
10793 possible_function_pointer_reloc.
10794 (Scan::global_reloc_may_be_function_pointer): Ditto.
10795 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10796 relocations in ".data.rel.ro._ZTV" section.
10797 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10798 * testsuite/icf_safe_so_test.cc: Ditto.
10799 * testsuite/icf_safe_test.cc: Ditto.
10800 * testsuite/icf_safe_test.sh: Ditto.
10801
10802 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10803 Ian Lance Taylor <iant@google.com>
10804
10805 * target-reloc.h (relocate_section): Check the symbol table index
10806 for -1U before setting the local symbol index.
10807 (scan_relocatable_relocs): If copying the relocation, record that
10808 the local symbol is required.
10809 * object.h (Symbol_value::is_output_symtab_index_set): New
10810 function.
10811 (Symbol_value::may_be_discarded_from_output_symtab): New
10812 function.
10813 (Symbol_value::has_output_symtab_entry): New function.
10814 (Symbol_value::needs_output_symtab_entry): Remove.
10815 (Symbol_value::output_symtab_index): Make sure the symbol index is
10816 set.
10817 (Symbol_value::set_output_symtab_index): Make sure the symbol
10818 index is not set. Make sure the new index is valid.
10819 (Symbol_value::set_must_have_output_symtab_entry): New function.
10820 (Symbol_value::has_output_dynsym_entry): New function.
10821 (Symbol_value::set_output_dynsym_index): Make sure the new index
10822 is valid.
10823 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10824 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10825 local symbol if permitted.
10826 (Sized_relobj::do_finalize_local_symbols): Call
10827 is_output_symtab_index_set rather than needs_output_symtab_entry.
10828 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10829 rather than needs_output_symtab_entry. Call
10830 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10831 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10832 is_output_symtab_index_set rather than needs_output_symtab_entry.
10833 * testsuite/discard_locals_relocatable_test.c: New file.
10834 * testsuite/discard_locals_test.sh: Test -r.
10835 * testsuite/Makefile.am (check_DATA): Add
10836 discard_locals_relocatable_test1.syms,
10837 discard_local_relocatable_test2.syms.
10838 (MOSTLYCLEANFILES): Likewise. Also add
10839 discard_locals_relocatable_test1.lout and
10840 discard_locals_relocatable_test2.out.
10841 (discard_locals_relocatable_test1.syms): New target.
10842 (discard_locals_relocatable_test.o): New target.
10843 (discard_locals_relocatable_test1.out): New target.
10844 (discard_locals_relocatable_test2.syms): New target.
10845 (discard_locals_relocatable_test2.out): New target.
10846 (various): Add missing ../ld-new dependencies.
10847 * testsuite/Makefile.in: Rebuild.
10848
10849 2010-03-03 Nick Clifton <nickc@redhat.com>
10850
10851 * po/fi.po: New Finnish translation.
10852
10853 2010-03-01 Doug Kwan <dougkwan@google.com>
10854
10855 * layout.cc (Layout::Layout): Force section types of .init_array*,
10856 .preinit_array* and .fini_array* sections.
10857 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10858 Fix check of return value of std::string::find.().
10859 (Output_section::Input_section_sort_compare::operator()): Remove
10860 comment about .init_array.
10861 (Output_section::Input_section_sort_init_fini_compare::operator()):
10862 New method.
10863 (Output_section::sort_attached_input_sections): Handle .init_array
10864 and .fini_array specially.
10865 * output.h (Output_section::Inut_section_sort_compare): Update
10866 comment.
10867 (Output_section::Input_section_sort_init_fini_compare): New struct.
10868
10869 2010-02-26 Doug Kwan <dougkwan@google.com>
10870
10871 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10872 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10873 * testsuite/debug_msg.sh: Avoid matching source line number for
10874 use of global variable undef_int.
10875
10876 2010-02-26 Doug Kwan <dougkwan@google.com>
10877
10878 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10879 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10880 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10881 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10882 * options.cc (General_options::General_options): Initialize member
10883 fix_v4bx_.
10884 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10885 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10886 and rm_no_fix_v4bx.stdout
10887 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10888 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10889 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10890 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10891 and arm_no_fix_v4bx.
10892 * Makefile.in: Regenerate.
10893 * testsuite/arm_fix_v4bx.s: New file.
10894 * testsuite/arm_fix_v4bx.sh: Ditto.
10895
10896 2010-02-24 Doug Kwan <dougkwan@google.com>
10897
10898 * arm.cc (Target_arm::got_section): Make the .got section the first
10899 non RELRO section in the data segment.
10900 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10901 suffixes of section names.
10902
10903 2010-02-24 Doug Kwan <dougkwan@google.com>
10904
10905 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10906 flags and attributes merging if an input file is a binary file.
10907 * fileread.cc (Input_file::open): Record format of original file.
10908 * fileread.h (Input_file::Format): New enum type.
10909 (Input_file::Input_file): Initialize data member format_.
10910 (Input_file::format): New method definition.
10911 (Input_file::format_):: New data member.
10912
10913 2010-02-24 Doug Kwan <dougkwan@google.com>
10914
10915 * arm.cc (Arm_output_data_got): New class.
10916 (ARM_TCB_SIZE): New constant
10917 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10918 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10919 If user uses a script with a SECTIONS clause, issue only a warning
10920 for a misplaced EXIDX input section. Otherwise, issue an error.
10921 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10922 garbage collection.
10923 (Target_arm::got_mode_index_entry): Handle static linking.
10924 (Target_arm::Scan::local): Ditto.
10925 (Target_arm::Scan::global): Ditto.
10926 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10927 all incorrectly implemented relocations.
10928 (Target_arm::fix_exidx_coverage): Pass layout to
10929 Arm_output_section::fix_exidx_coverage.
10930 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10931 from ".ARM.exidx." and ".ARM.extab.".
10932
10933 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10934
10935 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10936 section if it does not already exist.
10937 * attributes.cc (Attributes_section_data::Attributes_section_data):
10938 Don't crash if size is zero.
10939
10940 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10941 Ian Lance Taylor <iant@google.com>
10942
10943 * gold.cc (queue_middle_tasks): If no input files were opened,
10944 exit.
10945 * workqueue.h (Task_function::Task_function): Assert that there is
10946 a blocker.
10947
10948 2010-02-22 Doug Kwan <dougkwan@google.com>
10949
10950 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10951 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10952 types to avoid warnings due to different uint64_t implementations
10953 on different hosts.
10954
10955 2010-02-21 Doug Kwan <dougkwan@google.com>
10956
10957 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10958 handling of the maximum backward branch offset.
10959 (Arm_relocate_functions::thumb_branch_common): Ditto.
10960 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10961 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10962 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10963 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10964 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10965 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10966 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10967 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10968 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10969 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10970 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10971 thumb2_bl_out_of_range.o): New rules.
10972 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10973 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10974 thumb2_bl_out_of_range
10975 * testsuite/Makefile.in: Regenerate.
10976 * testsuite/arm_bl_in_range.s: New file.
10977 * testsuite/arm_bl_out_of_range.s: Ditto.
10978 * testsuite/arm_branch_in_range.sh: Ditto.
10979 * testsuite/arm_branch_range.t: Ditto.
10980 * testsuite/thumb2_branch_range.t: Ditto.
10981 * testsuite/thumb_bl_in_range.s: Ditto.
10982 * testsuite/thumb_bl_out_of_range.s: Ditto.
10983 * testsuite/thumb_branch_range.t: Ditto.
10984
10985 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10986
10987 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10988 Add reloc offset information.
10989 * icf.cc (get_section_contents): Change iterators to point to the new
10990 vectors. Add reloc offset information to the contents.
10991 * icf.h (Icf::Sections_reachable_info): New typedef.
10992 (Icf::Sections_reachable_list): New typedef.
10993 (Icf::Offset_info): New typedef.
10994 (Icf::Reloc_info): New struct typedef.
10995 (Icf::Reloc_info_list): New typedef.
10996 (Icf::symbol_reloc_list): Delete method.
10997 (Icf::addend_reloc_list): Delete method.
10998 (Icf::section_reloc_list): Delete method.
10999 (Icf::reloc_info_list): New method.
11000 (Icf::reloc_info_list_): New member.
11001
11002 2010-02-19 Doug Kwan <dougkwan@google.com>
11003
11004 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11005 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11006 * arm.cc (Arm_relocation_functions): New forward declaration.
11007 (Target_arm::Target_arm): Initialize new data members
11008 got_mod_index_offset_ and tls_base_symbol_defined_.
11009 (Target_arm::Relocate::relocate_tls): New method.
11010 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11011 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11012 New methods.
11013 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
11014 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11015 (Target_arm::got_mod_index_offset_,
11016 Target_arm::tls_base_symbol_defined_): New data members.
11017 (Target_arm::Scan::local, Target::Scan::global,
11018 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11019 relocations.
11020
11021 2010-02-18 Doug Kwan <dougkwan@google.com>
11022
11023 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11024 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11025 text section as a parameter becuase some broken tools may not set
11026 the link in section header.
11027 (Target_arm::has_got_section): New method.
11028 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11029 without any mapping symbol as data only. Remove warning.
11030 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11031 link in its section header, try to discover the link by inspecting the
11032 REL31 relocation at the beginning of the section.
11033 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11034 in error message.
11035 (Target_arm::Scan::global): Treat any reference to the symbol
11036 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11037
11038 2010-02-12 Sriraman Tallam <tmsriram@google.com>
11039
11040 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11041 (Scan::global_reloc_may_be_function_pointer): New function.
11042 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11043 (Scan::global_reloc_may_be_function_pointer): New function.
11044 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11045 (Scan::global_reloc_may_be_function_pointer): New function.
11046 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11047 (Scan::global_reloc_may_be_function_pointer): New function.
11048 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11049 (Scan::global_reloc_may_be_function_pointer): New function.
11050 (Scan::possible_function_pointer_reloc): New function.
11051 (Target_x86_64::can_check_for_function_pointers): New function.
11052 * gc.h (gc_process_relocs): Scan relocation types to determine if
11053 function pointers were taken for targets that support it.
11054 * icf.cc (Icf::find_identical_sections): Include functions for
11055 folding in safe ICF whose pointer is not taken.
11056 * icf.h (Secn_fptr_taken_set): New typedef.
11057 (fptr_section_id_): New member.
11058 (section_has_function_pointers): New function.
11059 (set_section_has_function_pointers): New function.
11060 (check_section_for_function_pointers): New function.
11061 * options.h: Fix comment for safe ICF option.
11062 * target.h (can_check_for_function_pointers): New function.
11063 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11064 Modify icf_safe_test for X86-64.
11065 * testsuite/Makefile.in: Regenerate.
11066 * testsuite/icf_safe_so_test.cc: New file.
11067 * testsuite/icf_safe_so_test.sh: New file.
11068 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11069 (main): Change to take pointer to function kept_func_3.
11070 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11071 folding is done correctly for X86-64.
11072
11073 2010-02-12 David S. Miller <davem@davemloft.net>
11074
11075 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11076 is_symbolless parameter.
11077 (Output_reloc<SHT_REL>::is_symbolless): New.
11078 (Output_reloc<SHT_REL>::is_symbolless_): New.
11079 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11080 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11081 (Output_reloc<SHT_RELA>::is_symbolless): New.
11082 (Output_data_reloc::add_global): Handle is_symbolless.
11083 (Output_data_reloc::add_global_relative): Likewise.
11084 (Output_data_reloc::add_local): Likewise.
11085 (Output_data_reloc::add_local_relative): Likewise.
11086 (Output_data_reloc::add_symbolless_global_addend): New.
11087 (Output_data_reloc::add_symbolless_local_addend): New.
11088 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11089 is_symbolless.
11090 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11091 instead of ->is_relative_
11092 (Output_reloc::write): Likewise.
11093 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11094 (Output_reloc::write_rel): Simplify.
11095
11096 * sparc.cc (Target_sparc::Scan::local): Use
11097 ->add_symbolless_local_addend as needed.
11098 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11099 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11100 based upon relocation offset.
11101
11102 2010-02-11 Doug Kwan <dougkwan@google.com>
11103
11104 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11105 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11106 beginning of function.
11107 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11108 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11109 parameter is_32bit in calls to should_apply_static_reloc.
11110 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11111 (check_DATA): Add arm_abs_global.stdout.
11112 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11113 arm_abs_global.stdout): New rules.
11114 (MOSTLLYCLEANFILES): Add arm_abs_global
11115 * Makefile.in: Regenerate.
11116 * testsuite/arm_abs_global.s: New file.
11117 * testsuite/arm_abs_global.sh: Ditto.
11118 * testsuite/arm_abs_lib.s: Ditto.
11119
11120 2010-02-11 Ian Lance Taylor <iant@google.com>
11121
11122 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11123 Read_relocs task.
11124 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11125 Allocate_commons_task first.
11126 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11127 task, rather than symtab_lock_.
11128 (Gc_process_relocs::~Gc_process_relocs): New function.
11129 (Gc_process_relocs::is_runnable): Check this_blocker_.
11130 (Gc_process_relocs::locks): Use next_blocker_ rather than
11131 blocker_.
11132 (Scan_relocs::~Scan_relocs): New function.
11133 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11134 symtab_lock_.
11135 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11136 next_blocker_.
11137 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11138 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11139 constructor accordingly.
11140 (class Gc_process_relocs): Likewise.
11141 (class Scan_relocs): Likewise.
11142 * common.h (class Allocate_commons_task): Remove symtab_lock_
11143 field, and corresponding constructor parameter.
11144 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11145 symtab_lock_.
11146 (Allocate_commons_task::locks): Likewise.
11147
11148 2010-02-11 Ian Lance Taylor <iant@google.com>
11149
11150 * gold-threads.h (class Once): Define.
11151 (class Initialize_lock): Rewrite as child of Once.
11152 * gold-threads.cc (class Once_initialize): Define.
11153 (once_pointer_control): New static variable.
11154 (once_pointer, once_arg): New static variables.
11155 (c_run_once): New static function.
11156 (Once::Once, Once::run_once, Once::internal_run): New functions.
11157 (class Initialize_lock_once): Remove.
11158 (initialize_lock_control): Remove.
11159 (initialize_lock_pointer): Remove.
11160 (initialize_lock_once): Remove.
11161 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11162 (Initialize_lock::initialize): Rewrite.
11163 (Initialize_lock::do_run_once): New function.
11164 * archive.cc (Archive::interpret_header): Only clear name if it is
11165 not already empty.
11166 * fileread.cc: Include "gold-threads.h"
11167 (file_counts_lock): New static variable.
11168 (file_counts_initialize_lock): Likewise.
11169 (File_read::release): Only increment counts when using --stats.
11170 Use a lock around the increment.
11171 * parameters.cc (class Set_parameters_target_once): Define.
11172 (set_parameters_target_once): New static variable.
11173 (Parameters::Parameters): Move here from parameters.h.
11174 (Parameters::set_target): Rewrite.
11175 (Parameters::set_target_once): New function.
11176 (Parameters::clear_target): Move here and rewrite.
11177 * parameters.h (class Parameters): Update declarations. Add
11178 set_parameters_target_once_ field.
11179 (Parameters::Parameters): Move to parameters.cc.
11180 (Parameters::clear_target): Likewise.
11181 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11182 task.
11183 (Start_group::~Start_group): New function.
11184 (Start_group::is_runnable): New function.
11185 (Start_group::locks, Start_group::run): New functions.
11186 (Finish_group::run): Change saw_undefined to size_t.
11187 * readsyms.h (class Start_group): Define.
11188 (class Finish_group): Change saw_undefined_ field to size_t.
11189 (Finish_group::Finish_group): Remove saw_undefined and
11190 this_blocker parameters. Change all callers.
11191 (Finish_group::set_saw_undefined): New function.
11192 (Finish_group::set_blocker): New function.
11193 * symtab.h (class Symbol_table): Change saw_undefined to return
11194 size_t. Change saw_undefined_ field to size_t.
11195 * target-select.cc (Set_target_once::do_run_once): New function.
11196 (Target_selector::Target_selector): Initialize set_target_once_
11197 field. Don't initialize lock_ and initialize_lock_ fields.
11198 (Target_selector::instantiate_target): Rewrite.
11199 (Target_selector::set_target): New function.
11200 * target-select.h (class Set_target_once): Define.
11201 (class Target_selector): Update declarations. Make
11202 Set_target_once a friend. Remove lock_ and initialize_lock_
11203 fields. Add set_target_once_ field.
11204
11205 2010-02-10 Ian Lance Taylor <iant@google.com>
11206
11207 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11208 queueing any tasks.
11209 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11210 (queue_middle_tasks): Add all blockers before queueing any tasks.
11211 (queue_final_tasks): Likewise.
11212 * token.h (Task_token::add_blockers): New function.
11213 * object.h (Input_objects::number_of_relobjs): New function.
11214
11215 2010-02-10 Ian Lance Taylor <iant@google.com>
11216
11217 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11218 shared, not if not position independent.
11219 * x86_64.cc (Relocate::relocate_tls): Likewise.
11220 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11221 (tls_pie_pic_test): New target.
11222 * testsuite/Makefile.in: Rebuild.
11223
11224 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11225 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11226 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11227 * testsuite/Makefile.in: Rebuild.
11228
11229 2010-02-09 David S. Miller <davem@davemloft.net>
11230
11231 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11232 R_SPARC_RELATIVE using ->add_local_relative().
11233 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11234
11235 * output.h (Output_data_dynamic::add_section_size): New method
11236 that takes two Output_data objects.
11237 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11238 entry param. Handle it in initializers.
11239 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11240 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11241 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11242 arg.
11243 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11244 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11245 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11246 for dynrel_includes_plt.
11247 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11248 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11249 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11250 before .rela.plt
11251 (Target_sparc::do_finalize_sections): Update to pass true for
11252 dynrel_includes_plt.
11253 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11254 output before .rela.plt
11255 (Target_powerpc::do_finalize_sections): Update to pass true for
11256 dynrel_includes_plt when 32-bit.
11257
11258 2010-02-08 Doug Kwan <dougkwan@google.com>
11259
11260 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11261 method.
11262 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11263 Arm_relobj::scan_section_for_cortex_a8_stubs,
11264 Arm_relobj::do_relocation_section): Instead of calling
11265 Output_section::output_address, use faster
11266 Arm_relobj::simple_input_section_output_address.
11267
11268 2010-02-08 David S. Miller <davem@davemloft.net>
11269
11270 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11271 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11272 relocation helper function.
11273
11274 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11275 just like R_SPARC_GOT{10,13,22}.
11276 (Target_sparc::Scan::local): Likewise.
11277 (Target_sparc::Relocate:relocate): Likewise.
11278
11279 2010-02-06 Ian Lance Taylor <iant@google.com>
11280
11281 * configure.ac: Rewrite targetobjs duplicate removal code to use
11282 only shell constructs.
11283 * configure: Rebuild.
11284
11285 2010-02-05 Doug Kwan <dougkwan@google.com>
11286
11287 PR 11247
11288 * arm.cc (Arm_relobj::section_is_scannable): New method.
11289 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11290 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11291
11292 2010-02-04 Doug Kwan <dougkwan@google.com>
11293
11294 PR 11247
11295 * arm-reloc-property.cc (cstdio): Include.
11296 * configure.ac (targetobjs): Remove duplicates.
11297 * configure: Regenerate.
11298 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11299 big and little endian version for a given address size.
11300
11301 2010-02-03 Doug Kwan <dougkwan@google.com>
11302
11303 * arm-reloc-property.cc
11304 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11305 definition.
11306 * arm-reloc-property.h
11307 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11308 New method definition.
11309 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11310 declaration.
11311 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11312 overflow to N.
11313 (GOT_PREL): Change implemented to Y.
11314 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11315 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11316 (Arm_relocate_functions::movw_abs_nc): Remove method.
11317 (Arm_relocate_functions::movt_abs): Ditto.
11318 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11319 (Arm_relocate_functions::thm_movt_abs): Ditto.
11320 (Arm_relocate_functions::movw_rel_nc): Ditto.
11321 (Arm_relocate_functions::movw_rel): Ditto.
11322 (Arm_relocate_functions::movt_rel): Ditto.
11323 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11324 (Arm_relocate_functions:thm_movw_rel): Ditto.
11325 (Arm_relocate_functions:thm_movt_rel): Ditto.
11326 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11327 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11328 New method definitions.
11329 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11330 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11331 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11332 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11333 (Target_arm::Relocate::relocate): Check for non-static or
11334 unimplemented relocation code and exit early. Change calls to
11335 Target_arm::reloc_uses_thumb_bit and
11336 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11337 instead. Refactor code to handle similar relocations to increase
11338 code sharing. Remove check for unsupported relocation code in switch
11339 statement.
11340 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11341 relocation property table to find out size. Change error message to
11342 print out the name of a relocation code instead of the numeric value.
11343 (Target_arm::scan_reloc_for_stub): Use relocation property table
11344 instead of calling Target_arm::reloc_uses_thumb_bit().
11345
11346 2010-02-02 Doug Kwan <dougkwan@google.com>
11347
11348 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11349 types of relaxed input section.
11350
11351 2010-02-02 Doug Kwan <dougkwan@google.com>
11352
11353 * Makefile.am (HFILES): Add arm-reloc-property.h.
11354 (DEFFILES): New.
11355 (TARGETSOURCES): Add arm-reloc-property.cc
11356 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11357 (libgold_a_SOURCES): $(DEFFILES)
11358 * Makefile.in: Regenerate.
11359 * arm-reloc-property.cc: New file.
11360 * arm-reloc-property.h: New file.
11361 * arm-reloc.def: New file.
11362 * arm.cc: Update comments.
11363 (arm-reloc-property.h): New included header.
11364 (arm_reloc_property_table): New global variable.
11365 (Target_arm::do_select_as_default_target): New method definition.
11366 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11367 arm-reloc-property to targ_extra_obj.
11368 * parameters.cc (set_parameters_target): Call
11369 Target::select_as_default_target().
11370 * target.h (Target::select_as_default_target): New method definition.
11371 (Target::do_select_as_default_target): Same.
11372
11373 2010-02-01 Doug Kwan <dougkwan@google.com>
11374
11375 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11376 first_output_text_section_.
11377 (Arm_exidx_fixup::first_output_text_section): New method definition.
11378 (Arm_exidx_fixup::first_output_text_section_): New data member.
11379 (Arm_exidx_fixup::process_exidx_section): Record the first text
11380 output section seen.
11381 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11382 and entsize in output section header.
11383
11384 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11385
11386 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11387 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11388 (Arm_relocate_functions::thm_alu11): New Method.
11389 (Arm_relocate_functions::thm_pc8): New Method.
11390 (Arm_relocate_functions::thm_pc12): New Method.
11391 (Target_arm::Scan::local): Handle the relocations.
11392 (Target_arm::Scan::global): Likewise.
11393 (Target_arm::Relocate::relocate): Likewise.
11394 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11395
11396 2010-01-29 Doug Kwan <dougkwan@google.com>
11397
11398 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11399 of relocation types as ld.
11400
11401 2010-01-29 Doug Kwan <dougkwan@google.com>
11402
11403 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11404 to public.
11405 (Arm_relocate_functions::thumb_branch_common): Ditto.
11406 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11407 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11408 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11409 Arm_relocate_functions::jump24): Remove.
11410 (Target_arm::Relocate::relocate): Adjust code to call
11411 Arm_relocation_functions::arm_branch_common and
11412 Arm_relocation_functions::thumb_branch_common instead of their removed
11413 wrappers. Merge switch-cases together to reduce source code size.
11414
11415 2010-01-29 Doug Kwan <dougkwan@google.com>
11416
11417 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11418 output_local_symbol_count_needs_update_.
11419 (Arm_relobj::output_local_symbol_count_needs_update,
11420 Arm_relobj::set_output_local_symbol_count_needs_update,
11421 Arm_relobj::update_output_local_symbol_count): New methods.
11422 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11423 member.
11424 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11425 of pointed function as in a R_ARM_PREL31 relocation.
11426 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11427 for output local symbol count updating.
11428 (Target_arm::do_relax): Update output local symbol counts in objects
11429 if necessary.
11430 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11431
11432 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11433
11434 * arm.cc: Added support for the ARM relocations:
11435 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11436 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11437 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11438 movw_prel_nc).
11439 (Arm_relocate_functions::movw_rel): New method.
11440 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11441 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11442 thm_movw_prel_nc).
11443 (Arm_relocate_functions::thm_movw_rel): New method.
11444 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11445 thm_movt_prel).
11446 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11447 relocations.
11448 (Target_arm::Scan::global): Likewise.
11449 (Target_arm::Relocate::relocate): Likewise.
11450 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11451 Likewise.
11452
11453 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11454
11455 * arm.cc: Added support for ARM group relocations.
11456 (Target_arm::reloc_needs_sym_origin): New method.
11457 (Arm_relocate_functions::calc_grp_kn): New method.
11458 (Arm_relocate_functions::calc_grp_residual): New method.
11459 (Arm_relocate_functions::calc_grp_gn): New method.
11460 (Arm_relocate_functions::arm_grp_alu): New Method.
11461 (Arm_relocate_functions::arm_grp_ldr): New Method.
11462 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11463 (Arm_relocate_functions::arm_grp_ldc): New Method.
11464 (Target_arm::Scan::local): Handle the ARM group relocations.
11465 (Target_arm::Scan::global): Likewise.
11466 (Target_arm::Relocate::relocate): Likewise.
11467 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11468 Likewise.
11469
11470 2010-01-26 Doug Kwan <dougkwan@google.com>
11471
11472 * arm.cc (set): Include.
11473 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11474 pointer type.
11475 (Arm_output_section::Text_section_list): New type.
11476 (Arm_output_section::append_text_sections_to_list): New method.
11477 (Arm_output_section::fix_exidx_coverage): Ditto.
11478 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11479 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11480 Relobj::set_section_offset() instead of
11481 Sized_relobj::invalidate_section_offset().
11482 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11483 parameter for section headers. Ignore relocation sections for
11484 unallocated sections and EXIDX sections.
11485 (Target_arm::fix_exidx_coverage): New method.
11486 (Target_arm::output_section_address_less_than): New type.
11487 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11488 linked text section instead of the EXIDX section.
11489 (Arm_output_section::create_stub_group): Add an assertion to check
11490 that this is not an EXIDX output section.
11491 (Arm_output_section::append_text_sections_to_list): New method.
11492 (Arm_output_section::fix_exidx_coverage): Ditto.
11493 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11494 Arm_relobj::section_needs_reloc_stub_scanning.
11495 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11496 first pass.
11497 (Target_arm::fix_exidx_coverage): New method.
11498 * object.h (Relobj::set_output_section): New method.
11499 (Sized_relobj::invalidate_section_offset): Remove method.
11500 (Sized_relobj::do_invalidate_section_offset): Remove method.
11501 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11502
11503 2010-01-25 Doug Kwan <dougkwan@google.com>
11504
11505 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11506 Fix warning due to signed and unsigned comparison on a 32-bit host.
11507
11508 2010-01-22 Doug Kwan <dougkwan@google.com>
11509
11510 * arm.cc (Target_arm::do_relax): Record an output section for section
11511 offset adjustment it contains any stub table that has changed.
11512 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11513 offsets in an output section if necessary.
11514 * output.cc (Output_section::Output_section): Initialize
11515 section_offsets_need_adjustments_.
11516 (Output_section::add_input_section_for_script): Renamed to
11517 Output_section::add_simple_input_section.
11518 (Output_section::save_states): Add a comment.
11519 (Output_section::discard_states): New method defintion.
11520 (Output_section::adjust_section_offsets): Same.
11521 * output.h (Output_section::add_input_section_for_script): Renamed to
11522 Output_section::add_simple_input_section.
11523 (Output_section::discard_states): New method declaration.
11524 (Output_section::adjust_section_offsets): Same.
11525 (Output_section::section_offsets_need_adjustment,
11526 Output_section::set_section_offsets_need_adjustment): New method
11527 definitions.
11528 (Output_section::section_offsets_need_adjustment_): New data member.
11529 * script-sections.cc
11530 (Output_section_element_input::set_section_address): Adjust code for
11531 renaming of Output_section::add_input_section_for_script.
11532 (Orphan_output_section::set_section_address): Same.
11533
11534 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11535
11536 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11537 Fix_v4bx enum values .
11538 * gold/options.h (General_options): New option definitions.
11539 (General_options::fix_v4bx): New method.
11540 (General_options::Fix_v4bx): New enum.
11541 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11542 (General_options::parse_fix_v4bx_interworking): New method.
11543
11544 2010-01-22 Doug Kwan <dougkwan@google.com>
11545
11546 * arm.cc (Arm_exidx_fixup): New class.
11547
11548 2010-01-21 Doug Kwan <dougkwan@google.com>
11549
11550 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11551 classes.
11552 (Arm_exidx_section_offset_map): New type.
11553
11554 2010-01-21 Doug Kwan <dougkwan@google.com>
11555
11556 * arm.cc (Arm_exidx_input_section): New class.
11557 (Arm_relobj::exidx_input_section_by_link,
11558 Arm_relobj::exidx_input_section_by_shndx,
11559 Arm_relobj::make_exidx_input_section): New methods.
11560 (read_arm_attributes_section): Remove.
11561 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11562 information about them.
11563 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11564 to here.
11565
11566 2010-01-20 Doug Kwan <dougkwan@google.com>
11567
11568 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11569 Input_section_specifier to Section_id.
11570 (Target_arm::new_arm_input_section: Adjust code for change of key
11571 type.
11572 (Target_arm::find_arm_input_section): Ditto.
11573 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11574 (Section_id): Remove.
11575 (Garbage_collection::Section_id_hash): Remove.
11576 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11577 (Section_id): Remove.
11578 (Icf::Section_id_hash): Remove.
11579 * object.h (Section_id, Const_section_id, Section_id_hash,
11580 Const_section_id_hash): New type definitions.
11581 * output.cc (Output_section::add_relaxed_input_section): Change to
11582 use Const_section_id instead of Input_section_specifier as key type.
11583 (Output_section::add_merge_input_section): Ditto.
11584 (Output_section::build_relaxation_map): Change to use Section_id
11585 instead of Input_section_specifier as key type.
11586 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11587 Ditto.
11588 (Output_section::convert_input_sections_to_relaxed_sections): Change
11589 to use Const_section_id instead of Input_section_specifier as key type.
11590 (Output_section::find_merge_section): Ditto.
11591 (Output_section::find_relaxed_input_section): Ditto.
11592 * output.h (Input_section_specifier): Remove class.
11593 (Output_section::Output_section_data_by_input_section_map): Change
11594 key type to Const_section_id.
11595 (Output_section::Output_relaxed_input_section_by_input_section_map):
11596 Ditto.
11597 (Output_section::Relaxation_map): Change key type to Section_id.
11598
11599 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11600
11601 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11602 (class Arm_v4bx_stub): New class.
11603 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11604 (Stub_factory::make_arm_v4bx_stub): New method.
11605 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11606 (Stub_table::empty): Handle v4bx stubs.
11607 (Stub_table::add_arm_v4bx_stub): New method.
11608 (Stub_table::find_arm_v4bx_stub): New method.
11609 (Arm_relocate_functions::v4bx): New method.
11610 (Target_arm::fix_v4bx): New method.
11611 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11612 (Stub_table::relocate_stubs): Likewise.
11613 (Stub_table::do_write): Likewise.
11614 (Stub_table::update_data_size_and_addralign): Likewise.
11615 (Stub_table::finalize_stubs): Likewise.
11616 (Target_arm::Scan::local): Likewise.
11617 (Target_arm::Scan::global): Likewise.
11618 (Target_arm::do_finalize_sections): Likewise.
11619 (Target_arm::Relocate::relocate): Likewise.
11620 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11621 Likewise.
11622 (Target_arm::scan_reloc_for_stub): Likewise.
11623 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11624
11625 2010-01-19 Ian Lance Taylor <iant@google.com>
11626
11627 * output.cc (Output_section_headers::do_sized_write): Write large
11628 segment count to sh_info field.
11629 (Output_file_header::do_sized_write): For large segment count,
11630 write PN_XNUM to e_phnum field.
11631
11632 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11633
11634 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11635 (Arm_relocate_functions::thm_jump8): New function.
11636 (Arm_relocate_functions::thm_jump11): New function.
11637 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11638 R_ARM_THM_JUMP11.
11639 (Target_arm::Scan::global): Likewise.
11640 (Target_arm::Relocate::relocate): Likewise.
11641 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11642 Likewise.
11643
11644 2010-01-14 Doug Kwan <dougkwan@google.com>
11645
11646 * arm.cc (map, utility): Include headers.
11647 (Target_arm::apply_cortex_a8_workaround): New method.
11648 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11649 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11650 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11651 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11652 the --[no-]fix-cortex-a8 command line options.
11653 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11654 (Target_arm::relocate_stub): Use addend in instruction template.
11655 * options.h (DEFINE_bool): Set the user-set flag.
11656 (General_options): Add --[no-]-fix-cortex options.
11657 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11658 : Update fast look-up map after conversion.
11659
11660 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11661
11662 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11663 in the first pass of do_layout.
11664
11665 2010-01-13 Doug Kwan <dougkwan@google.com>
11666
11667 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11668 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11669 apparent compiler problem of not folding static constant integral
11670 data members of elfcpp::Elf_sizes<32>.
11671
11672 2010-01-13 Doug Kwan <dougkwan@google.com>
11673
11674 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11675 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11676 Arm_relobj::scan_section_for_cortex_a8_erratum,
11677 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11678 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11679 sections to scan for relocation stubs into a new method
11680 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11681 relocation and Cortex-A8 stub scanning.
11682 (Target_arm::do_relax): Force stubs to be after stubbed sections
11683 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11684 the beginning of a new relaxation pass. Update a comment.
11685 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11686
11687 2010-01-12 Ian Lance Taylor <iant@google.com>
11688
11689 * target-reloc.h (visibility_error): New inline function.
11690 (relocate_section): Call visibility_error.
11691 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11692 (MOSTLYCLEANFILES): Likewise.
11693 (protected_4_pic.o, protected_3.err): New targets.
11694 * testsuite/protected_4.cc: New file.
11695
11696 2010-01-12 Doug Kwan <dougkwan@google.com>
11697
11698 * arm.cc (Cortex_a8_reloc): New class.
11699 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11700 and cortex_a8_relocs_info_.
11701 (Target_arm::fix_cortex_a8): New method definition.
11702 (Target_arm::Cortex_a8_relocs_info): New type.
11703 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11704 New data member declarations.
11705 (Target_arm::scan_reloc_for_stub): Record information about
11706 relocations for THUMB branches that might be exempted from the
11707 Cortex-A8 workaround.
11708 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11709 at the beginning of a relaxation pass.
11710
11711 2010-01-12 Doug Kwan <dougkwan@google.com>
11712
11713 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11714 (Arm_relobj::Mapping_symbol_position,
11715 Arm_reloj::Mapping_symbol_position_less,
11716 Arm_relobj::Mapping_symbols_info): New types.
11717 (Target_arm::is_mapping_symbol_name): New method definition.
11718 (Arm_relobj::do_count_local_symbols): Save information about mapping
11719 symbols.
11720
11721 2010-01-11 Doug Kwan <dougkwan@google.com>
11722
11723 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11724 Arm_relocate_functions::thumb32_branch_upper,
11725 Arm_relocate_functions::thumb32_branch_lower,
11726 Arm_relocate_functions::thumb32_cond_branch_offset,
11727 Arm_relocate_functions::thumb32_cond_branch_upper,
11728 Arm_relocate_functions::thumb32_cond_branch_lower,
11729 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11730 branch offset encoding.
11731 (Arm_relocate_functions::thumb_branch_common): Use new branch
11732 offset encoding methods to avoid code duplication.
11733 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11734 (Stub_addend_reader::operator()): Use new branch encoding method
11735 to avoid code duplication.
11736
11737 2010-01-11 Doug Kwan <dougkwan@google.com>
11738
11739 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11740 (Target_arm::do_finalize_sections): Define special EXIDX section
11741 symbols only if referenced.
11742 * gc.h (Garbage_collection::add_reference): New method.
11743 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11744 code duplication.
11745
11746 2010-01-11 Ian Lance Taylor <iant@google.com>
11747
11748 * script.cc (Version_script_info::build_expression_list_lookup):
11749 Change complaing about duplicate wildcard match from error to
11750 warning.
11751
11752 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11753 of 2009-12-30.
11754 (Version_script_info::Version_script_info): Initialize globs_,
11755 default_version_, default_is_global_, and exact_. Don't
11756 initialize globals_ or locals_.
11757 (Version_script_info::build_lookup_tables): Build local symbols
11758 first.
11759 (Version_script_info::unquote): New function.
11760 (Version_script_info::add_exact_match): New function.
11761 (Version_script_info::build_expression_list_lookup): Remove lookup
11762 parameter. Add is_global parameter. Change all callers. Handle
11763 wildcard pattern specially. Unquote pattern. Call
11764 add_exact_match.
11765 (Version_script_info::get_name_to_match): New function.
11766 (Version_script_info::get_symbol_version): New function.
11767 (Version_script_info::get_symbol_version_helper): Remove.
11768 (Version_script_info::check_unmatched_names): Call unquote.
11769 * script.h (class Version_script_info): Change get_symbol_version
11770 to be non-inline and add is_global parameter; change all callers.
11771 Rewrite symbol_is_local. Update declarations. Define struct
11772 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11773 Remove globals_ and locals_ members. Add exact_, globs_,
11774 default_version_, is_global_.
11775 (Version_script_info::Glob): Remove pattern, add expression and
11776 is_global. Update constructor. Change all callers.
11777 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11778 default version.
11779 (Versions::symbol_section_contents): If a symbol is undefined, or
11780 defined in a dynamic object, set the version index to
11781 VER_NDX_LOCAL.
11782 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11783 symbol_is_local.
11784 (Symbol_table::add_from_pluginobj): Likewise.
11785 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11786
11787 2010-01-11 Doug Kwan <dougkwan@google.com>
11788
11789 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11790 (incremental_dump_LDADD): Add linking option for libintl.
11791 * Makefile.in: Regenerate.
11792
11793 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11794
11795 PR gold/11144
11796 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11797 instead of -Ds.
11798 * testsuite/Makefile.in: Regenerated.
11799
11800 2010-01-10 Doug Kwan <dougkwan@google.com>
11801
11802 * options.h (DEFINE_var): Use parentheses around argument varname__
11803 in macro body to avoid any unintended subsequent substitutions.
11804
11805 2010-01-10 Ian Lance Taylor <iant@google.com>
11806
11807 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11808 candidates before doing symbol resolution.
11809
11810 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11811 ODR candidates if only one is weak.
11812
11813 2010-01-08 Ian Lance Taylor <iant@google.com>
11814
11815 * script.cc (Version_script_info::build_expression_list_lookup):
11816 Don't warn about ambiguous version, just record the ambiguity.
11817 (Version_script_info::get_symbol_version_helper): Give error if
11818 version is ambiguous.
11819
11820 2010-01-08 Doug Kwan <dougkwan@google.com>
11821
11822 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11823 prev_data_size_ and prev_addralign_. Remove initializer for
11824 deleted data member has_been_changed_.
11825 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11826 to determine if the table is empty.
11827 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11828 Remove.
11829 (Stub_table::add_reloc_stub): Define method in class definition
11830 instead of just declaring it there.
11831 (Stub_table::add_cortex_a8_stub): New method definition.
11832 (Stub_table::update_data_size_and_addralign): Ditto.
11833 (Stub_table::finalize_stubs): Ditto.
11834 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11835 (Stub_table::do_addralign_): Return address alignment in the
11836 (Stub_table::do_reset_address_and_file_offset): Define method in
11837 class definition instead of declaring it there. Set current data
11838 size to be the data size of the previous pass.
11839 (Stub_table::set_final_data_size): Use current data size as the
11840 final data size.
11841 (Stub_table::relocate_stub): Change parameter type of stub from
11842 Reloc_stub pointer to Stub pointer.
11843 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11844 (Stub_table::Cortex_a8_stub_list): New typedef.
11845 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11846 Stub_table::prev_addralign_): New data member.
11847 (Arm_relobj::Arm_relobj): Initialize data member
11848 section_has_cortex_a8_workaround_.
11849 (Arm_relobj::section_has_cortex_a8_workaround,
11850 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11851 definitions.
11852 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11853 declarations.
11854 (Target_arm::relocate_stub): Change parameter type of stub from
11855 Reloc_stub pointer to Stub pointer.
11856 (Insn_template::size, Insn_template::alignment): Handle
11857 THUMB16_SPECIAL_TYPE.
11858 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11859 Stub_table::update_data_size_and_addralign,
11860 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11861 definitions.
11862 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11863 (Stub_table::do_write): Ditto.
11864 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11865
11866 2010-01-08 Ian Lance Taylor <iant@google.com>
11867
11868 PR 11108
11869 * symtab.h (class Symbol): Remove fields is_target_special_ and
11870 has_plt_offset_. Add field is_defined_in_discarded_section_.
11871 (Symbol::is_defined_in_discarded_section): New function.
11872 (Symbol::set_is_defined_in_discarded_section): New function.
11873 (Symbol::has_plt_offset): Rewrite.
11874 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11875 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11876 Don't initialize is_target_special_ or has_plt_offset_.
11877 Initialize is_defined_in_discarded_section_.
11878 (Symbol_table::add_from_relobj): If appropriate, set
11879 is_defined_in_discarded_section.
11880 * resolve.cc (Symbol::override_base_with_special): Don't test
11881 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11882 * target-reloc.h (relocate_section): Do special handling for
11883 symbols defined in discarded sections for global symbols as well
11884 as local symbols.
11885
11886 2010-01-08 Ian Lance Taylor <iant@google.com>
11887
11888 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11889 the SHT_SYMTAB case.
11890
11891 2010-01-08 Ian Lance Taylor <iant@google.com>
11892
11893 * object.cc (Sized_relobj::do_layout): Don't get confused if
11894 layout_eh_frame returns NULL.
11895
11896 2010-01-08 Ian Lance Taylor <iant@google.com>
11897
11898 PR 11084
11899 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11900 dynamic symbol table, use the normal symbol table.
11901 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11902 symbol table.
11903
11904 2010-01-08 Ian Lance Taylor <iant@google.com>
11905
11906 PR 11072
11907 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11908 sections.
11909
11910 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11911
11912 * version.cc (print_version): Change to "Copyright 2010".
11913
11914 2010-01-08 Ian Lance Taylor <iant@google.com>
11915
11916 PR 10287
11917 PR 11063
11918 * i386.cc (class Target_i386): Change return type of plt_section
11919 to be non-const.
11920 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11921 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11922 tls_desc_rel_ field.
11923 (Output_data_plt_i386::rel_tls_desc): New function.
11924 (Target_i386::rel_tls_desc_section): New function.
11925 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11926 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11927 R_386_TLS_DESC reloc in rel_tls_desc_section.
11928 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11929 Define struct Tlsdesc_info.
11930 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11931 (Target_x86_64::do_reloc_symbol_index): New function.
11932 (Target_x86_64::add_tlsdesc_info): New function.
11933 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11934 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11935 tlsdesc_rel_ field.
11936 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11937 all callers.
11938 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11939 (Target_x86_64::rela_tlsdesc_section): New function.
11940 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11941 handling.
11942 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11943 (Target_x86_64::do_reloc_addend): New function.
11944 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11945 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11946 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11947 (Output_reloc::type): New function.
11948 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11949 (Output_reloc::is_target_specific): New function.
11950 (Output_reloc::target_arg): New function.
11951 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11952 absolute relocs and target specific relocs.
11953 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11954 add_target_specific.
11955 (class Output_data_reloc) [SHT_RELA]: Likewise.
11956 * output.cc (Output_reloc::Output_reloc): Add four new versions
11957 for absolute relocs and target specific relocs.
11958 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11959 (Output_reloc::get_symbol_index): Likewise.
11960 (Output_reloc::local_section_offset): Check that local_sym_index_
11961 is not TARGET_CODE or 0.
11962 (Output_reloc::symbol_value): Likewise.
11963 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11964 reloc.
11965 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11966 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11967 functions.
11968 * layout.cc (add_target_dynamic_tags): Use output section for
11969 DT_PLTRELSZ and DT_JMPREL.
11970
11971 2010-01-07 Ian Lance Taylor <iant@google.com>
11972
11973 PR 11061
11974 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11975 function.
11976 (class Output_data_reloc_generic): Define.
11977 (class Output_data_reloc_base): Change base class to
11978 Output_data_reloc_generic. Change add() method to call
11979 bump_relative_reloc_count for a relative reloc. Remove
11980 sort_relocs_ field.
11981 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11982 to sort_relocs().
11983 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11984 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11985 appropriate.
11986 * layout.h (class Layout): Update declaration.
11987
11988 2010-01-07 Ian Lance Taylor <iant@google.com>
11989
11990 * output.h (class Output_data): Add const version of
11991 output_section and do_output_section.
11992 (class Output_section_data): Add const version of
11993 do_output_section.
11994 (class Output_section): Likewise.
11995 * layout.cc (Layout::add_target_dynamic_tags): New function.
11996 * layout.h (class Layout): Update declarations.
11997 * arm.cc (Target_arm::do_finalize_sections): Use
11998 add_target_dynamic_tags.
11999 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12000 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12001 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12002 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12003
12004 2010-01-07 Ian Lance Taylor <iant@google.com>
12005
12006 PR 11042
12007 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12008 object as needed.
12009
12010 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12011 Ian Lance Taylor <iant@google.com>
12012
12013 PR 11019
12014 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12015 Xindex::read_symtab_xindex.
12016
12017 2010-01-07 Doug Kwan <dougkwan@google.com>
12018
12019 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12020 (Insn_template::thumb16_bcond_insn): New method declaration.
12021 (Insn_template): Fix spelling.
12022 (Stub::thumb16_special): New method declaration.
12023 (Stub::do_write): Define virtual method which was previously pure
12024 virtual.
12025 (Stub::do_thumb16_special): New method declaration.
12026 (Stub::do_fixed_endian_write): New template member.
12027 (Reloc_stub::do_write): Remove.
12028 (Reloc_stub::do_fixed_endian_write): Remove.
12029 (Cortex_a8_stub): New class definition.
12030 (Stub_factory::make_cortex_a8_stub): New method definition.
12031 (Stub_factory::Stub_factory): Add missing static storage class
12032 qualifier for elf32_arm_stub_a8_veneer_blx.
12033
12034 2010-01-07 Ian Lance Taylor <iant@google.com>
12035
12036 PR 10980
12037 * options.h (class General_options): Add --warn-unresolved-symbols
12038 and --error-unresolved-symbols.
12039 * errors.cc (Errors::undefined_symbol): Implement
12040 --warn-unresolved-symbols.
12041
12042 * options.h (class General_options): Add -z text and -z textoff.
12043 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12044
12045 2010-01-06 Sriraman Tallam <tmsriram@google.com>
12046
12047 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12048 (Garbage_collection::cident_sections): New function.
12049 (Garbage_collection::add_cident_section): New function.
12050 (Garbage_collection::cident_sections_): New member.
12051 (gc_process_relocs): Add references to sections whose names are C
12052 identifiers.
12053 * gold.h (cident_section_start_prefix): New constant.
12054 (cident_section_stop_prefix): New constant.
12055 (is_cident): New function.
12056 * layout.cc (Layout::define_section_symbols): Replace string constants
12057 with the newly defined constants.
12058 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12059 C identifiers.
12060 * testsuite/Makefile.am: Add gc_orphan_section_test.
12061 * testsuite/Makefile.in: Regenerate.
12062 * testsuite/gc_orphan_section_test.cc: New file.
12063 * testsuite/gc_orphan_section_test.sh: New file.
12064
12065 2010-01-06 Ian Lance Taylor <iant@google.com>
12066
12067 PR 10980
12068 * options.h (class General_options): Add --warn-shared-textrel.
12069 * layout.cc (Layout::finish_dynamic_section): Implement
12070 --warn-shared-textrel.
12071
12072 PR 10980
12073 * options.h (class General_options): Add --warn-multiple-gp.
12074
12075 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12076
12077 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12078 $(THREADSLIB) and $(LIBDL).
12079 * Makefile.in: Rebuild.
12080
12081 2010-01-06 Ian Lance Taylor <iant@google.com>
12082
12083 PR 10980
12084 * options.cc (General_options::parse_section_start): New function.
12085 (General_options::section_start): New function.
12086 (General_options::General_options): Initialize all members.
12087 * options.h: Include <map>
12088 (class General_options): Add --section-start. Add section_starts_
12089 member.
12090 * layout.cc (Layout::attach_allocated_section_to_segment): If
12091 --section-start was used, set the address of the segment. Remove
12092 local sort_sections.
12093 (Layout::relaxation_loop_body): If the address of the load segment
12094 has been set by --section-start, don't use it.
12095 * output.h (Output_segment::update_flags_for_output_section): New
12096 function.
12097 * output.cc (Output_segment::add_output_section): Call
12098 update_flags_for_output_section.
12099
12100 2010-01-05 Ian Lance Taylor <iant@google.com>
12101
12102 PR 10980
12103 * options.h (class General_options): Add --undefined-version.
12104 * script.cc (struct Version_expression): Add was_matched_by_symbol
12105 field.
12106 (Version_script_info::matched_symbol): New function.
12107 (Version_script_info::get_symbol_version_helper): Call
12108 matched_symbol.
12109 (Version_script_info::check_unmatched_names): New function.
12110 * script.h (class Version_script_info): Update declarations.
12111 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12112
12113 * options.h (class General_options): Use DEFINE_bool_alias for
12114 allow_multiple_definition.
12115 * resolve.cc (Symbol_table::should_override): Don't test
12116 allow_multiple_definition.
12117
12118 PR 10980
12119 * options.h (class General_options): Add --cref.
12120 * main.cc (main): Print cref table if --cref. Don't close mapfile
12121 until after printing cref table.
12122 * cref.cc: Include "symtab.h".
12123 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12124 (Cref_table_compare::operator()): New function.
12125 (Cref_inputs::gather_cref): New function.
12126 (filecol): New static const.
12127 (Cref_inputs::print_cref): New function.
12128 (Cref::print_cref): New function.
12129 * cref.h: Include <cstdio>.
12130 (class Cref): Update declarations.
12131 * mapfile.h (Mapfile::file): New function.
12132 * object.h (class Object): Define Symbols. Declare virtual
12133 do_get_global_symbols.
12134 (Object::get_global_symbols): New function.
12135 * object.cc (Input_objects::add_object): Pass object to cref_ if
12136 --cref.
12137 (Input_objects::archive_start): Likewise.
12138 (Input_objects::archive_stop): Likewise.
12139 (Input_objects::print_cref): New function.
12140 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12141 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12142 --cref.
12143 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12144 function.
12145 * plugin.h (class Sized_pluginobj): Update declarations.
12146
12147 2010-01-05 Ian Lance Taylor <iant@google.com>
12148
12149 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12150 to is_default_version. Rename insdef to insdefault.
12151 (Symbol_table::add_from_relobj): Rename def to is_default_version
12152 and local to is_forced_local.
12153 (Symbol_table::add_from_pluginobj): Likewise.
12154 (Symbol_table::add_from_dynobj): Likewise.
12155 (Symbol_table::define_special_symbol): Rename insdef to
12156 insdefault.
12157
12158 2010-01-04 Ian Lance Taylor <iant@google.com>
12159
12160 PR 10980
12161 * options.h (class General_options): Add
12162 --allow-multiple-definition and -z muldefs.
12163 * resolve.cc (Symbol_table::should_override): Don't warn about a
12164 multiple symbol definition if --allow-multiple-definition or -z
12165 muldefs.
12166
12167 PR 10980
12168 * options.h (class General_options): Add --add-needed and
12169 --copy-dt-needed-entries. Tweak --as-needed help entry.
12170 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12171 error if --copy-dt-needed-entries aka --add-needed is used and
12172 would cause a change in behaviour.
12173
12174 PR 10980
12175 * options.h (class General_options): Add -G as a short version of
12176 --shared. Add no-op options -assert, -g, and -i.
12177
12178 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12179
12180 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12181 check for .text or .gnu.linkonce.t sections.
12182 * icf.cc (Icf::find_identical_sections): Ditto.
12183 Change the detection for mangled function name within the section
12184 name.
12185 * icf.h (is_section_foldable_candidate): New function.
12186
12187 2009-12-30 Ian Lance Taylor <iant@google.com>
12188
12189 PR 10980
12190 * options.h (class General_options): Permit two dashes with
12191 --retain-symbols-file.
12192
12193 2009-12-30 Ian Lance Taylor <iant@google.com>
12194
12195 PR 10979
12196 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12197 don't put the file header and segment headers in the text
12198 segment.
12199
12200 PR 10979
12201 * common.cc (Sort_commons::operator()): Stabilize sort when both
12202 entries are NULL.
12203 (Symbol_table::do_allocate_commons_list): When allocating common
12204 symbols, skip a symbol which is no longer common.
12205 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12206 an object before checking its type.
12207 * testsuite/common_test_2.c: New file.
12208 * testsuite/common_test_3.c: New file.
12209 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12210 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12211 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12212 (common_test_2_pic.o, common_test_2.so): New targets.
12213 (common_test_3_pic.o, common_test_3.so): New targets.
12214 * testsuite/Makefile.in: Rebuild.
12215
12216 PR 10979
12217 * script.cc (read_input_script): If we see a new SECTIONS clause,
12218 and we have added an input section, give an error.
12219 * layout.h (class Layout): Add have_added_input_section function.
12220 Add have_added_input_section_ field.
12221 * layout.cc (Layout::Layout): Initialize
12222 have_added_input_section_.
12223 (Layout::layout): Set have_added_input_section_.
12224 (Layout::layout_eh_frame): Likewise.
12225
12226 2009-12-30 Ian Lance Taylor <iant@google.com>
12227
12228 PR 10931
12229 * options.h (class General_options): Add --sort-common option.
12230 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12231 * common.cc (Sort_common): Add sort_order parameter to
12232 constructor. Add sort_order_ field.
12233 (Sort_commons::operator): Check sort_order_.
12234 (Symbol_table::allocate_commons): Determine the sort order.
12235 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12236 Change all callers.
12237 (Symbol_table::do_allocate_commons_list): Likewise.
12238
12239 2009-12-30 Ian Lance Taylor <iant@google.com>
12240
12241 PR 10916
12242 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12243 symbols from this object, don't change the visibility of an
12244 undefined symbol.
12245 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12246
12247 2009-12-30 Ian Lance Taylor <iant@google.com>
12248
12249 PR 10861
12250 * script.h (class Version_script_info): Define Language enum.
12251 Update declarations. Define Glob, Exact, and Lookup types. Add
12252 new fields globals_, locals_, and is_finalized_.
12253 * script.cc: Various formatting fixes.
12254 (class Parser_closure): Change language_stack_ from a vector of
12255 std::string to one of Version_script_info::Language. Adjust all
12256 uses accordingly.
12257 (class Lazy_demangler): Remove.
12258 (struct Version_expression): Change language from std::string to
12259 Version_script_info::Language.
12260 (Version_script_info::Version_script_info): New function.
12261 (Version_script_info::~Version_script_info): Don't call clear.
12262 (Version_script_info::finalize): New function.
12263 (Version_script_info::build_lookup_tables): New function.
12264 (Version_script_info::build_expression_list_lookup): New
12265 function.
12266 (Version_script_info::get_symbol_version_helper): Rewrite to use
12267 lookup tables.
12268 (Version_script_info::print_expression_list): Adjust to use
12269 Version_script_info::Language.
12270 (script_push_lex_into_version_mode): Check that the version script
12271 has not been finalized.
12272 (version_script_push_lang): Change language string to
12273 Version_script_info::Language.
12274 * options.cc (Command_line::version_script): New function.
12275 * options.h (class General_options): Add finalize_dynamic_list
12276 function. Change version_script from declaration to definition.
12277 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12278 * testsuite/version_script.map: Remove duplicate def of foo.
12279 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12280 version_script.map.
12281 * testsuite/Makefile.in: Rebuild.
12282
12283 2009-12-30 Ian Lance Taylor <iant@google.com>
12284
12285 PR 10843
12286 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12287 if the input symbol index is 0, make the output symbol index 0.
12288
12289 2009-12-30 Ian Lance Taylor <iant@google.com>
12290
12291 PR 10670
12292 * options.h (class General_options): Add -x/--discard-all.
12293 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12294 --discard-all. If the local symbol needs a dynamic entry, check
12295 that before handling --discard-locals.
12296
12297 2009-12-30 Ian Lance Taylor <iant@google.com>
12298
12299 PR 10450
12300 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12301 flags to PF_R.
12302 (Output_segment::add_output_section): Don't change the flags if
12303 the type is PT_TLS.
12304
12305 PR 10450
12306 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12307 GNU hash table if they need a dynamic value. Otherwise, don't add
12308 them if they are defined in a dynamic object or are forced local.
12309
12310 2009-12-29 Ian Lance Taylor <iant@google.com>
12311
12312 PR 10450
12313 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12314 .gnu.hash table for a 32-bit target.
12315
12316 PR 10450
12317 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12318 regular and a dynamic object only needs a dynamic symbol table
12319 entry if it is externally visible.
12320
12321 PR 10450
12322 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12323 constructor. Add global_offset_table_ field.
12324 (Target_i386::got_section): Set global_offset_table_.
12325 (Target_i386::do_finalize_sections): Set global_offset_table_
12326 size.
12327 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12328 in constructor. Add global_offset_table_ field.
12329 (Target_x86_64::got_section): Set global_offset_table_.
12330 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12331 size.
12332
12333 * layout.cc (Layout::Layout): Initialize increase_relro_.
12334 (Layout::get_output_section): Add is_relro, is_last_relro, and
12335 is_first_non_relro parameters. Change all callers.
12336 (Layout::choose_output_section): Likewise.
12337 (Layout::add_output_section_data): Likewise.
12338 (Layout::make_output_section): Likewise.
12339 (Layout::set_segment_offsets): Clear increase_relro when using a
12340 linker script.
12341 * layout.h (class Layout): Add increase_relro method. Add
12342 increase_relro_ field. Update declarations.
12343 * output.cc (Output_section::Output_section): Initialize
12344 is_last_relro_ and is_first_non_relro_.
12345 (Output_segment::add_output_section): Group relro sections is
12346 do_sort is true. Handle is_last_relro and is_first_non_relro.
12347 (Output_segment::maximum_alignment): Remove relro handling.
12348 (Output_segment::set_section_addresses): Add increase_relro
12349 parameter. Change all callers. Add initial alignment to align
12350 relro sections on separate page. Remove old relro handling.
12351 (Output_segment::set_section_list_addresses): Remove in_relro
12352 parameter. Change all callers.
12353 (Output_segment::set_offset): Add increase parameter. Change all
12354 callers. Remove old relro handling.
12355 * output.h (class Output_section): Add new methods: is_last_relro,
12356 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12357 Add is_last_relro_ and is_first_non_relro_ fields.
12358 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12359 Create separate .got.plt section. Call increase_relro.
12360 * x86_64.cc (Target_x86_64::got_section): Likewise.
12361 * testsuite/relro_script_test.t: Add .got.plt.
12362
12363 PR 10450
12364 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12365 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12366 (Layout::finalize): Call set_dynamic_symbol_size.
12367 (Layout::set_dynamic_symbol_size): New function.
12368 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12369 set_dynamic_symbol_size.
12370
12371 PR 10450
12372 * output.h (class Output_section): Add is_entsize_zero_ field.
12373 * output.cc (Output_section::Output_section): Initialize
12374 is_entsize_zero_.
12375 (Output_section::set_entsize): If two different entsizes are
12376 requested, force it to zero.
12377 (Output_section::add_input_section): Set flags for .debug_str
12378 before updating section flags. Set entsize.
12379 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12380 and SHF_STRING if all input sections have those flags.
12381
12382 2009-12-29 Rafael Espindola <espindola@google.com>
12383
12384 * main.cc (main): Fix the sys time reporting.
12385 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12386 reporting.
12387
12388 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12389
12390 * options.cc (General_options::parse_version): Allow -v to exit
12391 without an error if there is nothing to link.
12392
12393 2009-12-29 Ian Lance Taylor <iant@google.com>
12394
12395 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12396 using a version of gcc before 4.1.
12397 * configure: Rebuild.
12398
12399 2009-12-28 Chris Demetriou <cgd@google.com>
12400
12401 * attributes.cc (Output_attributes_section_data::do_write): Use
12402 std::vector::front rather than std::vector::data.
12403
12404 2009-12-28 Ian Lance Taylor <iant@google.com>
12405
12406 * symtab.h (class Symbol_table): Add enum Defined.
12407 * resolve.cc (Symbol_table::should_override): Add defined
12408 parameter. Change all callers. Test whether object is NULL
12409 before calling a method on it.
12410 (Symbol_table::report_resolve_problem): Add defined parameter.
12411 Change all callers.
12412 (Symbol_table::should_override_with_special): Likewise.
12413 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12414 parameter. Change all callers.
12415 (Symbol_table::do_define_in_output_data): Likewise.
12416 (Symbol_table::define_in_output_segment): Likewise.
12417 (Symbol_table::do_define_in_output_segment): Likewise.
12418 (Symbol_table::define_as_constant): Likewise.
12419 (Symbol_table::do_define_as_constant): Likewise.
12420 * script.h (class Symbol_assignment): Add is_defsym parameter to
12421 constructor; change all callers.
12422 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12423 parameter. Change all callers. Add is_defsym_ field.
12424 (class Parser_closure): Add parsing_defsym parameter to
12425 constructor; change all callers. Add parsing_defsym accessor
12426 function. Add parsing_defsym_ field.
12427
12428 2009-12-28 Ian Lance Taylor <iant@google.com>
12429
12430 * gold.cc (queue_middle_tasks): Fix formatting.
12431 * object.cc (Relobj::is_section_name_included): Likewise.
12432
12433 2009-12-23 Ian Lance Taylor <iant@google.com>
12434
12435 * i386.cc (Target_i386::do_calls_non_split): Recognize
12436 -fsplit-stack prologue for a function with a static chain.
12437 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12438 -fsplit-stack prologue when using %r11.
12439
12440 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12441
12442 * options.cc (General_options::parse_version): Make -v continue and do
12443 the link like GNU ld does.
12444
12445 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12446
12447 * Makefile.am (CCFILES): Add timer.cc.
12448 (HFILES): Add timer.h.
12449 * configure.ac: Check for sysconf and times.
12450 * main.cc: include timer.h.
12451 (main): Use Timer instead of get_run_time.
12452 * timer.cc: New.
12453 * timer.h: New.
12454 * workqueue.cc: include timer.h.
12455 (Workqueue::find_and_run_task):
12456 Report user, sys and wall time.
12457 * Makefile.in: Regenerate.
12458 * config.in: Regenerate.
12459 * configure: Regenerate.
12460
12461 2009-12-16 Doug Kwan <dougkwan@google.com>
12462
12463 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12464 sections.
12465 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12466 relaxed input sections.
12467 * output.cc (Output_section::find_relaxed_input_section): Change
12468 return type to Output_relaxed_input_section pointer. Adjust code
12469 for new type of relaxed_input_section_map_.
12470 * output.h (Output_section::find_relaxed_input_section): Change
12471 return type to Output_relaxed_input_section pointer.
12472 (Output_section::Output_relaxed_input_section_by_input_section_map):
12473 New type.
12474 (Output_section::relaxed_input_section_map_): Change type to
12475 Output_section::Output_relaxed_input_section_by_input_section_map.
12476 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12477 input section.
12478
12479 2009-12-15 Ian Lance Taylor <iant@google.com>
12480
12481 * layout.cc (Layout::create_shstrtab): Only write out after input
12482 sections if we are compressing debug sections.
12483
12484 2009-12-15 Ian Lance Taylor <iant@google.com>
12485
12486 * archive.cc (Archive::add_symbols): Only look up a symbol without
12487 a version if there is, in fact, a version.
12488
12489 2009-12-14 Ian Lance Taylor <iant@google.com>
12490
12491 Revert -Wshadow changes, all changes from:
12492 2009-12-11 Doug Kwan <dougkwan@google.com>
12493 2009-12-11 Nick Clifton <nickc@redhat.com>
12494 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12495
12496 2009-12-11 Doug Kwan <dougkwan@google.com>
12497
12498 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12499 due to -Wshadow.
12500 * attributes.cc (Object_attribute::size): Ditto.
12501 (Attributes_section_data::size): Ditto.
12502 (Attributes_section_data::Attributes_section_data): Ditto.
12503 (Output_attributes_section_data::do_write): Ditto.
12504 * attributes.h (Object_attribute::set_type): Ditto.
12505 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12506
12507 2009-12-11 Nick Clifton <nickc@redhat.com>
12508
12509 * archive.cc: Fix shadowed variable warnings.
12510 * arm.cc: Likewise.
12511 * compressed_output.cc: Likewise.
12512 * compressed_output.h: Likewise.
12513 * configure: Likewise.
12514 * dwarf_reader.cc: Likewise.
12515 * dynobj.cc: Likewise.
12516 * dynobj.h: Likewise.
12517 * ehframe.cc: Likewise.
12518 * ehframe.h: Likewise.
12519 * errors.cc: Likewise.
12520 * expression.cc: Likewise.
12521 * fileread.cc: Likewise.
12522 * fileread.h: Likewise.
12523 * freebsd.h: Likewise.
12524 * i386.cc: Likewise.
12525 * icf.cc: Likewise.
12526 * incremental.h: Likewise.
12527 * layout.cc: Likewise.
12528 * layout.h: Likewise.
12529 * mapfile.cc: Likewise.
12530 * merge.cc: Likewise.
12531 * merge.h: Likewise.
12532 * object.cc: Likewise.
12533 * object.h: Likewise.
12534 * options.h: Likewise.
12535 * output.cc: Likewise.
12536 * output.h: Likewise.
12537 * parameters.cc: Likewise.
12538 * plugin.cc: Likewise.
12539 * powerpc.cc: Likewise.
12540 * reduced_debug_output.cc: Likewise.
12541 * reduced_debug_output.h: Likewise.
12542 * reloc.cc: Likewise.
12543 * reloc.h: Likewise.
12544 * resolve.cc: Likewise.
12545 * script-sections.cc: Likewise.
12546 * script.cc: Likewise.
12547 * script.h: Likewise.
12548 * sparc.cc: Likewise.
12549 * symtab.cc: Likewise.
12550 * symtab.h: Likewise.
12551 * target-select.cc: Likewise.
12552 * target-select.h: Likewise.
12553 * token.h: Likewise.
12554 * workqueue.cc: Likewise.
12555 * workqueue.h: Likewise.
12556 * x86_64.cc: Likewise.
12557
12558 2009-12-10 Doug Kwan <dougkwan@google.com>
12559
12560 * arm.cc (attributes.h): New include.
12561 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12562 (Arm_relobj::~Arm_relobj): Delete object pointed by
12563 attributes_section_data_.
12564 (Arm_relobj::attributes_section_data): New method definition.
12565 (Arm_relobj::attributes_section_data_): New data member declaration.
12566 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12567 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12568 attributes_section_data_.
12569 (Arm_dynobj::attributes_section_data): New method definition.
12570 (Arm_dynobj::attributes_section_data_): New data member declaration.
12571 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12572 initialization value of may_use_blx_ to false.
12573 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12574 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12575 object attributes to compute results instead of hard-coding.
12576 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12577 Target_arm::get_secondary_compatible_arch,
12578 Target_arm::set_secondary_compatible_arch
12579 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12580 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12581 New method declarations.
12582 (Target_arm::get_aeabi_object_attribute): New method definition.
12583 (Target_arm::attributes_section_data_): New data member declaration.
12584 (read_arm_attributes_section): New template definition.
12585 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12586 (Arm_dynobj::do_read_symbols): Ditto.
12587 (Target_arm::do_finalize_sections): Merge attributes sections from
12588 input. Check for BLX use after attributes section merging.
12589 Fix __exidx_start and __exidx_end visibility. Create an
12590 .ARM.attributes section if necessary.
12591 (Target_arm::get_secondary_compatible_arch,
12592 Target_arm::set_secondary_compatible_arch,
12593 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12594 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12595 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12596 New method definitions.
12597
12598 2009-12-09 Ian Lance Taylor <iant@google.com>
12599
12600 * plugin.cc (Plugin::load): Don't cast from void* to a function
12601 pointer.
12602
12603 2009-12-09 Ian Lance Taylor <iant@google.com>
12604
12605 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12606 information fields.
12607
12608 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12609
12610 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12611 Replace two_file_shared_1.so with two_file_shared_2.so.
12612 * testsuite/Makefile.in: Regenerated.
12613
12614 2009-12-08 Doug Kwan <dougkwan@google.com>
12615
12616 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12617 (HFILES): Add attributes.h and int_encoding.h.
12618 * Makefile.in: Regenerate.
12619 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12620 function definitions to int_encoding.cc
12621 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12622 prototypes to int_encoding.h
12623 * reduced_debug_output.cc (int_encoding.h): New include.
12624 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12625 function definitions to int_encoding.cc
12626 (insert_into_vector, read_from_pointer): Move template definitions to
12627 int_encoding.h
12628 * attributes.cc: New file.
12629 * attributes.h: New file.
12630 * int_encoding.cc: New file.
12631 * int_encoding.h: New file.
12632
12633 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12634
12635 PR gold/11055
12636 * incremental-dump.cc (dump_incremental_inputs): New.
12637 (main): Use dump_incremental_inputs.
12638
12639 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12640
12641 PR gold/10893
12642 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12643 checking elfcpp::STT_FUNC.
12644 (Target_i386::Relocate::relocate): Likewise.
12645 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12646
12647 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12648 symbols from shared libraries into normal FUNC symbols.
12649
12650 * symtab.h (Symbol): Add is_func and use it.
12651
12652 2009-12-05 Doug Kwan <dougkwan@google.com>
12653
12654 * arm.cc (Target_arm::arm_info): Initialize new fields
12655 attributes_section and attributes_vendor.
12656 * i386.cc (Target_i386::i386_info): Same.
12657 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12658 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12659 fields attributes_section and attributes_vendor.
12660 * sparc.cc (Target_sparc::sparc_info): Same.
12661 * target.h (Target::attributes_section, Target::attributes_vendor,
12662 Target::is_attributes_section, Target::attribute_arg_type,
12663 Target::attributes_order): New method definitions.
12664 (Target::Target_info::attributes_section,
12665 Target::Target_info::attributes_vendor): New fields.
12666 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12667 virtual method definitions.
12668 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12669 attributes_section and attributes_vendor.
12670 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12671
12672 2009-12-05 Doug Kwan <dougkwan@google.com>
12673
12674 * arm.cc: Update comments about interworking and stub generation.
12675 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12676 considered as non-PIC.
12677 (Arm_relocate_functions::base_abs): Fix formatting.
12678 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12679 of function to use GOT entry address instead of offset.
12680 (Target_arm::Scan::global): Issue an error if a symbol would need a
12681 PLT does not get one because it is untyped. Remove code to create
12682 dynamic symbols for relative branches.
12683 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12684 takes unsigned integer instead of boolean.
12685
12686 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12687
12688 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12689 (two_file_test_LDADD): Likewise.
12690 (common_test_1_LDADD): Likewise.
12691 (exception_test_LDADD) Likewise.
12692 (weak_test_LDADD): Likewise.
12693 (many_sections_test_LDADD): Likewise.
12694 (initpri1_LDADD): Likewise.
12695 (script_test_1_LDADD): Likewise.
12696 (script_test_2_LDADD): Likewise.
12697 (justsyms_LDADD): Likewise.
12698 (binary_test_LDADD): Likewise.
12699 (large_LDADD): Likewise.
12700 * testsuite/Makefile.in: Regenerated.
12701
12702 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12703
12704 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12705 (Symbol_table::override_with_special): Likewise.
12706 (Symbol_table::add_from_object): Likewise.
12707
12708 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12709
12710 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12711 Don't set the data_offset twice.
12712
12713 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12714
12715 * testsuite/Makefile.in: Regenerate.
12716
12717 2009-12-03 Doug Kwan <dougkwan@google.com>
12718
12719 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12720 (Target_arm::do_finalize_sections): Add parameter for symbol table
12721 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12722 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12723 parameter for symbol table pointer.
12724 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12725 an additional parameter for a pointer to symbol table.
12726 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12727 parameter for a symbol table pointer.
12728 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12729 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12730 Ditto.
12731 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12732 parameter for a symbol table pointer.
12733
12734 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12735
12736 * incremental.cc (Incremental_inputs_header)
12737 (Incremental_inputs_header_write, Incremental_inputs_entry)
12738 (Incremental_inputs_entry_write): Move ...
12739 * incremental.h (Incremental_inputs_header)
12740 (Incremental_inputs_header_write, Incremental_inputs_entry)
12741 (Incremental_inputs_entry_write): here.
12742
12743 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12744
12745 * incremental.cc (make_sized_incremental_binary): Set the target.
12746 Error if it is incompatible.
12747 * output.h (Output_file): Add filename method.
12748
12749 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12750
12751 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12752 from the get_* methods.
12753
12754 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12755
12756 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12757 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12758 Write 0 for the data_offset of scripts.
12759
12760 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12761
12762 * testsuite/Makefile.am: Add the incremental_test.sh test.
12763 * testsuite/incremental_test.sh: New.
12764 * testsuite/incremental_test_1.c: New.
12765 * testsuite/incremental_test_2.c: New.
12766
12767 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12768
12769 * incremental-dump.cc (main): Fix typos.
12770
12771 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12772
12773 PR gold/11025
12774 * incremental-dump.cc (main): Use llu to print 64 bit values.
12775
12776 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12777 H.J. Lu <hongjiu.lu@intel.com>
12778
12779 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12780 $(LIBDL).
12781 (incremental_dump_LDADD): Likewise.
12782 * Makefile.in: Regenerated.
12783
12784 2009-11-25 Doug Kwan <dougkwan@google.com>
12785
12786 Revert:
12787
12788 2009-11-25 Doug Kwan <dougkwan@google.com>
12789
12790 * arm.cc (Target_arm::Target_arm): Move method definition
12791 outside of class definition. Add code to handle
12792 --target1-rel, --target1-abs and --target2= options.
12793 (Target_arm::get_reloc_reloc_type): Change method to be
12794 non-static and const.
12795 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12796 New data member declaration.
12797 (Target_arm::Scan::local, Target_arm::Scan::global,
12798 Target_arm::Relocate::relocate,
12799 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12800 Adjust call to Target_arm::get_real_reloc_type.
12801 (Target_arm::get_real_reloc_type): Use command line options
12802 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12803 * options.h (--target1-rel, --target1-abs, --target2): New
12804 ARM-only options.
12805
12806 2009-11-25 Doug Kwan <dougkwan@google.com>
12807
12808 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12809 class definition. Add code to handle --target1-rel, --target1-abs
12810 and --target2= options.
12811 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12812 and const.
12813 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12814 member declaration.
12815 (Target_arm::Scan::local, Target_arm::Scan::global,
12816 Target_arm::Relocate::relocate,
12817 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12818 call to Target_arm::get_real_reloc_type.
12819 (Target_arm::get_real_reloc_type): Use command line options to
12820 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12821 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12822 options.
12823
12824 2009-11-25 Doug Kwan <dougkwan@google.com>
12825
12826 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12827 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12828 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12829 formatting.
12830 (Arm_relocate_functions::thm_call): Replace body with a call to
12831 Arm_relocate_functions::thumb_branch_common.
12832 (Arm_relocate_functions::thm_jump24,
12833 Arm_relocate_functions::thm_xpc22): New method definitions.
12834 (Arm_relocate_functions::thumb_branch_common): New method definition.
12835 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12836 operator.
12837 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12838 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12839
12840 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12841
12842 * Makefile.am: Build incremental-dump
12843 * Makefile.in: Regenerate.
12844 * incremental-dump.cc: New.
12845 * incremental.cc (Incremental_inputs_header_data,
12846 Incremental_inputs_entry_data): Move to incremental.h
12847 * incremental.h: (Incremental_inputs_header_data,
12848 Incremental_inputs_entry_data): Move from incremental.cc
12849
12850 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12851
12852 * incremental.cc (Incremental_inputs_header,
12853 Incremental_inputs_header_write, Incremental_inputs_entry,
12854 Incremental_inputs_entry_write): Add a typedef with the data type.
12855
12856 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12857
12858 * incremental.cc (Incremental_inputs_header,
12859 Incremental_inputs_header_write, Incremental_inputs_entry,
12860 Incremental_inputs_entry_write): Update comment about which
12861 type has the filed descriptions.
12862
12863 2009-11-15 Doug Kwan <dougkwan@google.com>
12864
12865 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12866 (Arm_relocate_functions::arm_branch_common): Change method defintion
12867 in class definition to a method declaration and update list of formal
12868 parameters.
12869 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12870 Arm_relocation_functions::jump24): Adjust call to
12871 Arm_relocate_functions::arm_branch_common. Update list of formal
12872 parameters.
12873 (Arm_relocate_functions::xpc25): New method definition.
12874 (Arm_relocate_functions::arm_branch_common): Move method defintion
12875 out from class definition. Use stubs for mode-switching and extending
12876 branch ranges.
12877 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12878 specially. Change code to enable use of stubs in ARM branches.
12879
12880 2009-11-10 Doug Kwan <dougkwan@google.com>
12881
12882 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12883 in method declaration.
12884 (Target_arm::relocate_stub): New method declaration.
12885 (Target_arm::default_target): Change to return a pointer instead of
12886 a const reference.
12887 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12888 Target_arm::default_target.
12889 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12890 method definition.
12891 (Target_arm::relocate_section): Adjust view.
12892 (Target_arm::relocate_stub): New method definition.
12893
12894 2009-11-10 Doug Kwan <dougkwan@google.com>
12895
12896 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12897 a format warning.
12898 * incremental.cc (open_incremental_binary): Initialized local
12899 variables to avoid warnings.
12900 * object.cc (make_elf_object): Ditto.
12901 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12902 a format warning.
12903
12904 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12905
12906 PR gold/10930
12907 * testsuite/plugin_test.c: Include "config.h".
12908
12909 2009-11-09 Doug Kwan <dougkwan@google.com>
12910
12911 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12912 (arm_symbol_value): Remove.
12913 (Arm_relocate_functions::arm_branch_common,
12914 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12915 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12916 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12917 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12918 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12919 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12920 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12921 Arm_relocate_functions::thm_mobw_abs_nc,
12922 Arm_relocate_functions::thm_mov_abs,
12923 Arm_relocate_functions::movw_prel_nc,
12924 Arm_relocate_functions::thm_movt_abs,
12925 Arm_relocate_functions::movt_prel,
12926 Arm_relocate_functions::thm_movw_prel_nc,
12927 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12928 (Target_arm::Relocate::relocate): Only decompose address into two
12929 parts if relocation type uses the thumb-bit and pass the actual
12930 bit instead of a flag indicating that the thumb-bit is used. Adjust
12931 calls to methods in Arm_relocate_functions for this change.
12932
12933 2009-11-08 Ian Lance Taylor <iant@google.com>
12934
12935 PR 10925
12936 * reloc.cc: Instantiate
12937 Sized_relobj::initialize_input_to_output_maps and
12938 Sized_relobj:free_input_to_output_maps.
12939
12940 2009-11-06 Ian Lance Taylor <iant@google.com>
12941
12942 PR 10876
12943 * defstd.cc (in_segment): Set only_if_ref true for "end".
12944
12945 2009-11-06 Doug Kwan <dougkwan@google.com>
12946
12947 * arm.cc (class Reloc_stub): Correct a comment.
12948 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12949 (Target_arm::scan_section_for_stubs): New method declaration.
12950 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12951 Change methods from private to protected.
12952 (Target_arm::do_may_relax): New method definition.
12953 (Target_arm::do_relax, Target_arm::group_sections,
12954 Target_arm::scan_reloc_for_stub,
12955 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12956 (Target_arm::arm_input_section_map_): New data member declaration.
12957 (Target_arm::scan_reloc_for_stub,
12958 Target_arm::scan_reloc_section_for_stubs,
12959 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12960 Target_arm::do_relax): New method definitions.
12961
12962 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12963
12964 * configure.ac: Check for (struct stat)::st_mtim
12965 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12966 * config.in: Regenerate.
12967 * configure: Regenerate.
12968
12969 2009-11-05 Ian Lance Taylor <iant@google.com>
12970
12971 PR 10910
12972 * output.cc (Output_segment::add_output_section): Add missing
12973 return statement.
12974
12975 2009-11-04 Ian Lance Taylor <iant@google.com>
12976
12977 PR 10880
12978 * object.h (class Object): Add is_needed and set_is_needed
12979 methods. Add is_needed_ field. Make bool fields into bitfields.
12980 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12981 defined in a dynamic object and referenced by a regular object,
12982 set is_needed for the dynamic object.
12983 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12984 if the file is marked with as_needed and it is not needed.
12985
12986 2009-11-04 Ian Lance Taylor <iant@google.com>
12987
12988 PR 10887
12989 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12990 tags if data is discarded by linker script.
12991 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12992 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12993 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12994 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12995
12996 2009-11-04 Ian Lance Taylor <iant@google.com>
12997
12998 * layout.cc (Layout::get_output_section): Add is_interp and
12999 is_dynamic_linker_section parameters. Change all callers.
13000 (Layout::choose_output_section): Likewise.
13001 (Layout::make_output_section): Likewise.
13002 (Layout::add_output_section_data): Add is_dynamic_linker_section
13003 parameter. Change all callers.
13004 * layout.h (class Layout): Update declarations.
13005 * output.h (class Output_section): Add is_interp, set_is_interp,
13006 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13007 Add is_interp_, is_dynamic_linker_section_ fields. Change
13008 generate_code_fills_at_write_ to a bitfield.
13009 * output.cc (Output_section::Output_sections): Initialize new
13010 fields.
13011 (Output_segment::add_output_section): Add do_sort parameter.
13012 Change all callers.
13013
13014 2009-11-03 Ian Lance Taylor <iant@google.com>
13015
13016 PR 10860
13017 * options.h (class General_options): Add --warn-common.
13018 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13019 merging two common symbols.
13020 (Symbol_table::should_override): Handle --warn-common when merging
13021 a common symbol with a defined symbol. Use report_resolve_problem
13022 for multiple definitions.
13023 (Symbol_table::report_resolve_problem): New function.
13024 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13025
13026 2009-11-03 Doug Kwan <dougkwan@google.com>
13027
13028 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13029 stub_factory_.
13030 (Target_arm::stub_factory): New method definition.
13031 (Target_arm::new_arm_input_section,
13032 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13033 Target_arm::reloc_uses_thumb_bit): New method declarations.
13034 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
13035 New type definitions.
13036 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13037 member declarations.
13038 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13039 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13040 New method definitions.
13041
13042 2009-11-03 Ian Lance Taylor <iant@google.com>
13043
13044 * options.h (class General_options): Add --warn_constructors.
13045
13046 2009-11-03 Ian Lance Taylor <iant@google.com>
13047
13048 PR 10893
13049 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13050 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13051
13052 2009-11-03 Ian Lance Taylor <iant@google.com>
13053
13054 PR 10895
13055 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13056 --msgid-bugs-address.
13057 (install-pdf): New target.
13058 (install-data_yes): Look up one directory to find mkinstalldirs.
13059
13060 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13061
13062 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13063 tree.
13064
13065 2009-10-30 Doug Kwan <dougkwan@google.com>
13066
13067 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13068
13069 2009-10-30 Doug Kwan <dougkwan@google.com>
13070
13071 * arm.cc (Stub_addend_reader): New struct template definition
13072 and partial specializations.
13073 (Stub_addend_reader::operator()): New method definition for a
13074 partially specialized template.
13075
13076 2009-10-30 Doug Kwan <dougkwan@google.com>
13077
13078 * arm.cc (Arm_relobj::processor_specific_flags): New method
13079 definition.
13080 (Arm_relobj::do_read_symbols): New method declaration.
13081 (Arm_relobj::processor_specific_flags_): New data member declaration.
13082 (Arm_dynobj): New class definition.
13083 (Target_arm::do_finalize_sections): Add input_objects parameter.
13084 (Target_arm::do_adjust_elf_header): New method declaration.
13085 (Target_arm::are_eabi_versions_compatible,
13086 (Target_arm::merge_processor_specific_flags): New method declaration.
13087 (Target_arm::do_make_elf_object): New overloaded method definitions
13088 and declaration.
13089 (Arm_relobj::do_read_symbols): New method definition.
13090 (Arm_dynobj::do_read_symbols): Ditto.
13091 (Target_arm::do_finalize_sections): Add input_objects parameters.
13092 Merge processor-specific flags from all input objects.
13093 (Target_arm::are_eabi_versions_compatible,
13094 Target_arm::merge_processor_specific_flags,
13095 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13096 New method definitions.
13097 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13098 Input_objects pointer type parameter.
13099 * layout.cc (Layout::finalize): Pass input objects to target's.
13100 finalize_sections function.
13101 * output.cc (Output_file_header::do_sized_write): Set ELF file
13102 header's processor-specific flags.
13103 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13104 Input_objects pointer type parameter.
13105 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13106 * target.h (Input_objects): New forward class declaration.
13107 (Target::processor_specific_flags,
13108 Target::are_processor_specific_flags_sect): New method definitions.
13109 (Target::finalize_sections): Add input_objects parameter.
13110 (Target::Target): Initialize processor_specific_flags_ and
13111 are_processor_specific_flags_set_.
13112 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13113 parameter.
13114 (Target::set_processor_specific_flags): New method definition.
13115 (Target::processor_specific_flags_,
13116 Target::are_processor_specific_flags_set_): New data member
13117 declarations.
13118 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13119 Input_objects pointer type parameter.
13120
13121 2009-10-30 Doug Kwan <dougkwan@google.com>
13122
13123 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13124
13125 2009-10-28 Ian Lance Taylor <iant@google.com>
13126
13127 * object.h (class Relobj): Drop options parameter from
13128 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13129 do_scan_relocs, do_relocate. Change all callers.
13130 (class Sized_relobj): Drop options parameters from
13131 do_gc_process_relocs, do_scan_relocs, do_relocate,
13132 do_relocate_sections, relocate_sections, emit_relocs_scan,
13133 emit_relocs_scan_reltype. Change all callers.
13134 (struct Relocate_info): Remove options field and all references to
13135 it.
13136 * reloc.h (class Read_relocs): Remove options constructor
13137 parameter and options_ field. Change all callers.
13138 (class Gc_process_relocs, class Scan_relocs): Likewise.
13139 (class Relocate_task): Likewise.
13140 * target-reloc.h (scan_relocs): Remove options parameter. Change
13141 all callers.
13142 (scan_relocatable_relocs): Likewise.
13143 * target.h (class Sized_target): Remove options parameter from
13144 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13145 all callers.
13146 * gc.h (gc_process_relocs): Remove options parameter. Change all
13147 callers.
13148 * arm.cc: Update functions to remove options parameters.
13149 * i386.cc: Likewise.
13150 * powerpc.cc: Likewise.
13151 * sparc.cc: Likewise.
13152 * x86_64.cc: Likewise.
13153 * testsuite/testfile.cc: Likewise.
13154
13155 2009-10-28 Doug Kwan <dougkwan@google.com>
13156
13157 * arm.cc (Arm_relobj): New class definition.
13158 (Arm_relobj::scan_sections_for_stubs,
13159 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13160 New method definitions.
13161
13162 2009-10-28 Cary Coutant <ccoutant@google.com>
13163
13164 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13165 (Plugin::cleanup_done_): New member.
13166 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13167 (Plugin_manager::cleanup_done_): Remove.
13168 (Plugin_manager::add_input_file): Edit error message.
13169 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13170 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13171
13172 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13173
13174 * fileread.cc: (File_read::View::~View): Use the new
13175 data_ownership_ filed.
13176 (File_read::~File_read): Dispose the new whole_file_view_.
13177 (File_read::open): Mmap the whole file if needed.
13178 (File_read::open): Use whole_file_view_ instead of contents_.
13179 (File_read::find_view): Use whole_file_view_ if applicable.
13180 (File_read::do_read): Use whole_file_view_ instead of contents_.
13181 (File_read::make_view): Use whole_file_view_ instead of contents_,
13182 update File_read::View::View call.
13183 (File_read::find_or_make_view): Update File_read::View::View
13184 call.
13185 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13186 remove contents_
13187 (File_read::View::Data_ownership): New enum.
13188 (File_read::View::View): Replace bool mapped_ with Data_ownership
13189 argument.
13190 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13191 (File_read::View::data_ownership_): New field.
13192 (File_read::contents_): Remove (replaced by whole_file_view_).
13193 (File_read::whole_file_view_): New field.
13194 * options.h (class General_options): Add --keep-files-mapped.
13195
13196 2009-10-27 Cary Coutant <ccoutant@google.com>
13197
13198 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13199 * testsuite/Makefile.am (plugin_test_5): New test case.
13200 * testsuite/Makefile.in: Regenerate.
13201
13202 2009-10-25 Doug Kwan <dougkwan@google.com>
13203
13204 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13205 from private to protected to allow access by child class.
13206 (Sized_relobj::do_relocate_sections): New method declaration.
13207 (Sized_relobj::relocate_sections): Virtualize.
13208 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13209 Sized_relobj::relocate_sections. Instantiate template explicitly
13210 for different target sizes and endianity.
13211
13212 2009-10-24 Doug Kwan <dougkwan@google.com>
13213
13214 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13215 (Arm_input_section::as_arm_input_section): New method.
13216 (Arm_output_section): New class definition.
13217 (Arm_output_section::create_stub_group,
13218 Arm_output_section::group_sections): New method definitions.
13219
13220 2009-10-22 Doug Kwan <dougkwan@google.com>
13221
13222 * arm.cc (Arm_input_section): New class definition.
13223 (Arm_input_section::init, Arm_input_section:do_write,
13224 Arm_input_section::set_final_data_size,
13225 Arm_input_section::do_reset_address_and_file_offset): New method
13226 definitions.
13227
13228 2009-10-21 Doug Kwan <dougkwan@google.com>
13229
13230 * arm.cc (Stub_table, Arm_input_section): New forward class
13231 declarations.
13232 (Stub_table): New class defintion.
13233 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13234 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13235 New method definition.
13236
13237 2009-10-21 Doug Kwan <dougkwan@google.com>
13238
13239 * arm.cc: Update copyright comments.
13240 (Target_arm): New forward class template declaration.
13241 (Arm_address): New type.
13242 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13243 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13244 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13245 constants.
13246 (Insn_template): Same.
13247 (DEF_STUBS): New macro.
13248 (Stub_type): New enum type.
13249 (Stub_template): New class definition.
13250 (Stub): Same.
13251 (Reloc_stub): Same.
13252 (Stub_factory): Same.
13253 (Target_arm::Target_arm): Initialize may_use_blx_ and
13254 should_force_pic_veneer_.
13255 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13256 Target_arm::should_force_pic_veneer,
13257 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13258 Target_arm::using_thumb_only, Target_arm:;default_target): New
13259 method defintions.
13260 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13261 New data member declarations.
13262 (Insn_template::size, Insn_template::alignment): New method defintions.
13263 (Stub_template::Stub_template): New method definition.
13264 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13265 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13266 (Stub_factory::Stub_factory): New method definition.
13267 * gold.h (string_hash): New template.
13268 * output.h (Input_section_specifier::hash_value): Use
13269 gold::string_hash.
13270 (Input_section_specifier::string_hash): Remove.
13271 * stringpool.cc (Stringpool_template::string_hash): Use
13272 gold::string_hash.
13273
13274 2009-10-20 Doug Kwan <dougkwan@google.com>
13275
13276 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13277 symbols of relaxed input sections.
13278 * output.h (Output_section::find_relaxed_input_section): Make
13279 method public.
13280
13281 2009-10-16 Doug Kwan <dougkwan@google.com>
13282
13283 * dynobj.cc (Versions::Versions): Initialize version_script_.
13284 Only insert base version symbol definition for a shared object
13285 if version script defines any version versions.
13286 (Versions::define_base_version): New method definition.
13287 (Versions::add_def): Check that base version is not needed.
13288 (Versions::add_need): Define base version lazily.
13289 * dynobj.h (Versions::define_base_version): New method declaration.
13290 (Versions::needs_base_version_): New data member declaration.
13291 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13292 (check_DATA): Add no_version_test.stdout.
13293 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13294 New make rules.
13295 * testsuite/Makefile.in: Regenerate.
13296 * testsuite/no_version_test.c: New file.
13297 * testsuite/no_version_test.sh: Ditto.
13298
13299 2009-10-16 Doug Kwan <dougkwan@google.com>
13300
13301 * expression.cc (class Segment_start_expression): New class definition.
13302 (Segment_start_expression::value): New method definition.
13303 (script_exp_function_segment_start): Return a new
13304 Segment_start_expression.
13305 * gold/script-c.h (script_saw_segment_start_expression): New function
13306 prototype.
13307 * script-sections.cc (Script_sections::Script_sections): Initialize
13308 SAW_SEGMENT_START_EXPRESSION_ to false.
13309 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13310 and -Tbbs options to specify section addresses if given in
13311 command line and no SEGMENT_START expression is seen in a script.
13312 * script-sections.h (Script_sections::saw_segment_start_expression,
13313 Script_sections::set_saw_segment_start_expression): New method
13314 definition.
13315 (Script_sections::saw_segment_start_expression_): New data member
13316 declaration.
13317 * script.cc (script_saw_segment_start_expression): New function.
13318 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13319 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13320 script_test_7.sh and script_test_8.sh.
13321 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13322 script_test_8.stdout.
13323 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13324 (script_test_6, script_test_6.stdout, script_test_7,
13325 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13326 * Makefile.in: Regenerate.
13327 * testsuite/script_test_6.sh: New file.
13328 * testsuite/script_test_6.t: Same.
13329 * testsuite/script_test_7.sh: Same.
13330 * testsuite/script_test_7.t: Same.
13331 * testsuite/script_test_8.sh: Same.
13332
13333 2009-10-16 Doug Kwan <dougkwan@google.com>
13334
13335 * output.cc (Output_segment::set_section_list_address): Cast
13336 expressions to unsigned long long type to avoid format warnings.
13337
13338 2009-10-15 Ian Lance Taylor <iant@google.com>
13339
13340 * script.cc (Script_options::add_symbol_assignment): Always add a
13341 dot assignment to script_sections_.
13342 * script-sections.cc (Script_sections::add_dot_assignment):
13343 Initialize if necessary.
13344
13345 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13346 program headers with no load segment if there is a linker script.
13347
13348 * layout.cc (Layout::set_segment_offsets): Align the file offset
13349 to the segment aligment for -N or -n with no load segment.
13350 * output.cc (Output_segment::add_output_section): Don't crash if
13351 the first section is a TLS section.
13352 (Output_segment::set_section_list_addresses): Print an error
13353 message if the address moves backward in a linker script.
13354 * script-sections.cc
13355 (Output_section_element_input::set_section_addresses): Don't
13356 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13357 (Orphan_output_section::set_section_addresses): Likewise.
13358
13359 2009-10-15 Doug Kwan <dougkwan@google.com>
13360
13361 * layout.cc (Layout::finish_dynamic_section): Generate tags
13362 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13363 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13364 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13365
13366 2009-10-14 Ian Lance Taylor <iant@google.com>
13367
13368 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13369 fields.
13370 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13371 data_shdr fields of relinfo.
13372 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13373 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13374 R_386_TLS_LDO_32, adjust based on section flags.
13375 (Target_i386::Relocate::fix_up_ldo): Remove.
13376
13377 2009-10-13 Ian Lance Taylor <iant@google.com>
13378
13379 Add support for -pie.
13380 * options.h (class General_options): Add -pie and
13381 --pic-executable.
13382 (General_options::output_is_position_independent): Test -pie.
13383 (General_options::output_is_executable): Return true if not shared
13384 and not relocatable.
13385 (General_options::output_is_pie): Remove.
13386 * options.cc (General_options::finalize): Reject incompatible uses
13387 of -pie.
13388 * gold.cc (queue_middle_tasks): A -pie link is not static.
13389 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13390 * symtab.cc (Symbol::final_value_is_known): Return false if
13391 output_is_position_independent.
13392 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13393 output_is_position_independent.
13394 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13395 output_is_position_independent.
13396 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13397 output_is_position_independent.
13398 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13399 two_file_pie_test.
13400 (basic_pie_test.o, basic_pie_test): New targets.
13401 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13402 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13403 (two_file_pie_test): New target.
13404 * testsuite/Makefile.in: Rebuild.
13405 * README: Remove note saying that -pie is not supported.
13406
13407 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13408
13409 * options.h (class General_options): Add -init and -fini.
13410 * layout.cc (Layout::finish_dynamic_section): Emit
13411 given init and fini functions.
13412
13413 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13414
13415 * gc.h (gc_process_relocs): Check if icf is enabled using new
13416 function.
13417 * gold.cc (queue_initial_tasks): Likewise.
13418 (queue_middle_tasks): Likewise.
13419 * object.cc (do_layout): Likewise.
13420 * symtab.cc (is_section_folded): Likewise.
13421 * main.cc (main): Likewise.
13422 * reloc.cc (Read_relocs::run): Likewise.
13423 (Sized_relobj::do_scan_relocs): Likewise.
13424 * icf.cc (is_function_ctor_or_dtor): New function.
13425 (Icf::find_identical_sections): Check if function is ctor or dtor when
13426 safe icf is chosen.
13427 * options.h (General_options::icf): Change option to be an enum.
13428 (Icf_status): New enum.
13429 (icf_enabled): New method.
13430 (icf_safe_folding): New method.
13431 (set_icf_status): New method.
13432 (icf_status_): New variable.
13433 * (options.cc) (General_options::finalize): Set icf_status_.
13434 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13435 icf_test and icf_keep_unique_test to use the --icf enum flag.
13436 * testsuite/icf_safe_test.sh: New file.
13437 * testsuite/icf_safe_test.cc: New file.
13438
13439 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13440
13441 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13442 includes to gc.h and icf.h.
13443 * arm.cc: Include gc.h.
13444 * gold.cc: Likewise.
13445 * i386.cc: Likewise.
13446 * powerpc.cc: Likewise.
13447 * sparc.cc: Likewise.
13448 * x86_64.cc: Likewise.
13449 * gc.h: Include icf.h.
13450
13451 2009-10-11 Ian Lance Taylor <iant@google.com>
13452
13453 * plugin.cc: Include "gold.h" before other header files.
13454
13455 2009-10-10 Chris Demetriou <cgd@google.com>
13456
13457 * options.h (Input_file_argument::Input_file_type): New enum.
13458 (Input_file_argument::is_lib_): Replace with...
13459 (Input_file_argument::type_): New member.
13460 (Input_file_argument::Input_file_argument): Take Input_file_type
13461 'type' rather than boolean 'is_lib' as second argument.
13462 (Input_file_argument::is_lib): Use type_.
13463 (Input_file_argument::is_searched_file): New function.
13464 (Input_file_argument::may_need_search): Handle is_searched_file.
13465 * options.cc (General_options::parse_library): Support -l:filename.
13466 (General_options::parse_just_symbols): Update for Input_file_argument
13467 changes.
13468 (Command_line::process): Likewise.
13469 * archive.cc (Archive::get_file_and_offset): Likewise.
13470 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13471 * script.cc (read_script_file, script_add_file): Likewise.
13472 * fileread.cc (Input_file::Input_file): Likewise.
13473 (Input_file::will_search_for): Handle is_searched_file.
13474 (Input_file::open): Likewise.
13475 * readsyms.cc (Read_symbols::get_name): Likewise.
13476 * testsuite/Makefile.am (searched_file_test): New test.
13477 * testsuite/Makefile.in: Regenerate.
13478 * testsuite/searched_file_test.cc: New file.
13479 * testsuite/searched_file_test_lib.cc: New file.
13480
13481 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13482 Ian Lance Taylor <iant@google.com>
13483
13484 * descriptor.cc: Include <cstdio> and "binary-io.h".
13485 (Descriptors::open): Open the files in binary mode always.
13486 * script.cc (Lex::get_token): Treat \r as whitespace.
13487
13488 2009-10-09 Ian Lance Taylor <iant@google.com>
13489
13490 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13491
13492 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13493 Ian Lance Taylor <iant@google.com>
13494
13495 * configure.ac: Check for readv function also.
13496 * fileread.cc (readv): Define if not HAVE_READV.
13497 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13498 does not exist.
13499 * config.in: Regenerate.
13500 * configure: Regenerate.
13501
13502 2009-10-09 Doug Kwan <dougkwan@google.com>
13503
13504 * layout.cc (Layout::make_output_section): Call target hook to make
13505 ordinary output section.
13506 (Layout::finalize): Adjust parameter list of call the
13507 Target::may_relax().
13508 * layout.h (class Layout::section_list): New method.
13509 * merge.h (Output_merge_base::entsize): Change visibility to public.
13510 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13511 New methods.
13512 (Output_merge_string::do_is_string): New method.
13513 * object.cc (Sized_relobj::do_setup): renamed from
13514 Sized_relobj::set_up.
13515 * object.h (Sized_relobj::adjust_shndx,
13516 Sized_relobj::initializ_input_to_output_maps,
13517 Sized_relobj::free_input_to_output_maps): Change visibilities to
13518 protected.
13519 (Sized_relobj::setup): Virtualize.
13520 (Sized_relobj::do_setup): New method declaration.
13521 (Sized_relobj::invalidate_section_offset,
13522 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13523 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13524 * options.cc (parse_int): New function.
13525 * options.h (parse_int): New declaration.
13526 (DEFINE_int): New macro.
13527 (stub_group_size): New option.
13528 * output.cc (Output_section::Output_section): Initialize memebers
13529 merge_section_map_, merge_section_by_properties_map_,
13530 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13531 (Output_section::add_input_section): Handled deferred code-fill
13532 generation and remove an old comment.
13533 (Output_section::add_relaxed_input_section): New method definition.
13534 (Output_section::add_merge_input_section): Use merge section by
13535 properties map to speed to search. Update merge section maps
13536 as appropriate.
13537 (Output_section::build_relaxation_map): New method definition.
13538 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13539 Same.
13540 (Output_section::relax_input_section): Renamed to
13541 Output_section::convert_input_sections_to_relaxed_sections and change
13542 interface to take a vector of pointers to relaxed sections.
13543 (Output_section::find_merge_section,
13544 Output_section::find_relaxed_input_section): New method definitions.
13545 (Output_section::is_input_address_mapped,
13546 Output_section::output_offset, Output_section::output_address):
13547 Use output section data maps to speed up searching.
13548 (Output_section::find_starting_output_address): Add comments.
13549 (Output_section::do_write,
13550 Output_section::write_to_postprocessing_buffer): Do code-fill
13551 generation as appropriate.
13552 (Output_section::get_input_sections): Invalidate relaxed input section
13553 map.
13554 (Output_section::restore_states): Adjust type of checkpoint .
13555 Invalidate relaxed input section map.
13556 * output.h (Output_merge_base): New class declaration.
13557 (Input_section_specifier): New class defintion.
13558 (class Output_relaxed_input_section) Change base class to
13559 Output_section_data_build.
13560 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13561 base class initializer.
13562 (Output_section::add_relaxed_input_section): New method declaration.
13563 (Output_section::Input_section): Change visibility to protected.
13564 (Output_section::Input_section::relobj,
13565 Output_section::Input_section::shndx): Handle relaxed input sections.
13566 Output_section::input_sections) Change visibility to protected. Also
13567 define overload to return a non-const pointer.
13568 (Output_section::Merge_section_properties): New class defintion.
13569 (Output_section::Merge_section_by_properties_map,
13570 Output_section::Output_section_data_by_input_section_map,
13571 Output_section::Relaxation_map): New types.
13572 (Output_section::relax_input_section): Rename method to
13573 Output_section::convert_input_sections_to_relaxed_sections and change
13574 interface to take a vector of relaxed section pointers.
13575 (Output_section::find_merge_section,
13576 Output_section::find_relaxed_input_section,
13577 Output_section::build_relaxation_map,
13578 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13579 New method declarations.
13580 (Output_section::merge_section_map_
13581 Output_section::merge_section_by_properties_map_,
13582 Output_section::relaxed_input_section_map_,
13583 Output_section::is_relaxed_input_section_map_valid_,
13584 Output_section::generate_code_fills_at_write_): New data members.
13585 * script-sections.cc
13586 (Output_section_element_input::set_section_addresses): Call
13587 current_data_size and addralign methods of relaxed input sections.
13588 (Orphan_output_section::set_section_addresses): Call current_data_size
13589 and addralign methods of relaxed input sections.
13590 * symtab.cc (Symbol_table::compute_final_value): Extract template
13591 from the body of Symbol_table::sized_finalize_symbol.
13592 (Symbol_table::sized_finalized_symbol): Call
13593 Symbol_table::compute_final_value.
13594 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13595 (Symbol_table::compute_final_value): New templated method declaration.
13596 * target.cc (Target::do_make_output_section): New method defintion.
13597 * target.h (Target::make_output_section): New method declaration.
13598 (Target::relax): Add more parameters for input objects, symbol table
13599 and layout. Adjust call to do_relax.
13600 (Target::do_make_output_section): New method declaration.
13601 (Target::do_relax): Add parameters for input objects, symbol table
13602 and layout.
13603
13604 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13605
13606 * pread.c: Include stdio.h.
13607
13608 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13609
13610 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13611 defined.
13612
13613 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13614
13615 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13616 Change read_shndx type to unsigned int.
13617 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13618 int.
13619 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13620 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13621 Change read_shndx type to unsigned int.
13622 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13623 int.
13624 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13625 * layout.cc (Layout::create_symtab_sections): Cast the result of
13626 local_symcount * symsize to off_t in the gold_assert.
13627
13628 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13629
13630 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13631 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13632 R_ARM_BASE_ABS.
13633 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13634 (Arm_relocate_functions::thm_abs5): New function.
13635 (Arm_relocate_functions::abs12): New function.
13636 (Arm_relocate_functions::abs16): New function.
13637 (Arm_relocate_functions::base_abs): New function.
13638 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13639 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13640 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13641 R_ARM_BASE_ABS.
13642 (Scan::global): Likewise.
13643 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13644 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13645 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13646 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13647 R_ARM_BASE_ABS.
13648
13649 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13650
13651 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13652 (Arm_relocate_functions::movt_prel): New function.
13653 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13654 (Arm_relocate_functions::thm_movt_prel): New function.
13655 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13656 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13657 (Scan::global, Relocate::relocate): Likewise.
13658 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13659
13660 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13661
13662 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13663 Incremental_checker.
13664 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13665 unsigned int.
13666 (class Incremental_inputs_header): New class.
13667 (Incremental_inputs_header_writer): Edit comment.
13668 (Incremental_inputs_entry): New class.
13669 (Incremental_inputs_entry_writer): Edit comment.
13670 (Sized_incremental_binary::do_find_incremental_inputs_section):
13671 Add *strtab_shndx parameter, fill it.
13672 (Sized_incremental_binary::do_check_inputs): New method.
13673 (Incremental_checker::can_incrementally_link_output_file): Use
13674 Sized_incremental_binary::check_inputs.
13675 (Incremental_inputs::report_command_line): Save command line in
13676 command_line_.
13677 * incremental.h:
13678 (Incremental_binary::find_incremental_inputs_section): New
13679 method.
13680 (Incremental_binary::do_find_incremental_inputs_section): Add
13681 strtab_shndx parameter.
13682 (Incremental_binary::do_check_inputs): New pure virtual method.
13683 (Sized_incremental_binary::do_check_inputs): Declare.
13684 (Incremental_checker::Incremental_checker): Add incremental_inputs
13685 parameter, use it to initialize incremental_inputs_.
13686 (Incremental_checker::incremental_inputs_): New field.
13687 (Incremental_checker::command_line): New method.
13688 (Incremental_checker::inputs): New method.
13689 (Incremental_checker::command_line_): New field.
13690
13691 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13692
13693 * incremental.cc: Include <cstdarg> and "target-select.h".
13694 (vexplain_no_incremental): New function.
13695 (explain_no_incremental): New function.
13696 (Incremental_binary::error): New method.
13697 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13698 method.
13699 (make_sized_incremental_binary): New function.
13700 (open_incremental_binary): New function.
13701 (can_incrementally_link_file): Add checks if output is ELF and has
13702 inputs section.
13703 * incremental.h: Include "elfcpp_file.h" and "output.h".
13704 (Incremental_binary): New class.
13705 (Sized_incremental_binary): New class.
13706 (open_incremental_binary): Declare.
13707 * object.cc (is_elf_object): Use
13708 elfcpp::Elf_recognizer::is_elf_file.
13709 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13710 * output.h (Output_file::filesize): New method.
13711
13712 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13713
13714 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13715 New function.
13716 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13717 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13718 function.
13719 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13720 function.
13721 (Arm_relocate_functions::movw_abs_nc): New function.
13722 (Arm_relocate_functions::movt_abs): New function.
13723 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13724 (Arm_relocate_functions::thm_movt_abs): New function.
13725 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13726 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13727 (Scan::global): Likewise.
13728 (Relocate::relocate): Likewise.
13729 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13730
13731 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13732
13733 * arm.cc (Arm_relocate_functions::got_prel) New function.
13734 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13735 (Relocate::relocate): Likewise.
13736 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13737
13738 2009-10-06 Ian Lance Taylor <iant@google.com>
13739
13740 * options.h (class General_options): Define
13741 split_stack_adjust_size parameter.
13742 * object.h (class Object): Add uses_split_stack_ and
13743 has_no_split_stack_ fields. Add uses_split_stack and
13744 has_no_split_stack accessor functions. Declare
13745 handle_split_stack_section.
13746 (class Reloc_symbol_changes): Define.
13747 (class Sized_relobj): Define Function_offsets. Declare
13748 split_stack_adjust, split_stack_adjust_reltype, and
13749 find_functions.
13750 * object.cc (Object::handle_split_stack_section): New function.
13751 (Sized_relobj::do_layout): Call handle_split_stack_section.
13752 * dynobj.cc (Sized_dynobj::do_layout): Call
13753 handle_split_stack_section.
13754 * reloc.cc (Sized_relobj::relocate_sections): Call
13755 split_stack_adjust for executable sections in split_stack
13756 objects. Pass reloc_map to relocate_section.
13757 (Sized_relobj::split_stack_adjust): New function.
13758 (Sized_relobj::split_stack_adjust_reltype): New function.
13759 (Sized_relobj::find_functions): New function.
13760 * target-reloc.h: Include "object.h".
13761 (relocate_section): Add reloc_symbol_changes parameter. Change
13762 all callers.
13763 * target.h (class Target): Add calls_non_split method. Declare
13764 do_calls_non_split virtual method. Declare match_view and
13765 set_view_to_nop.
13766 * target.cc: Include "elfcpp.h".
13767 (Target::do_calls_non_split): New function.
13768 (Target::match_view): New function.
13769 (Target::set_view_to_nop): New function.
13770 * gold.cc (queue_middle_tasks): Give an error if mixing
13771 split-stack and non-split-stack objects with -r.
13772 * i386.cc (Target_i386::relocate_section): Add
13773 reloc_symbol_changes parameter.
13774 (Target_i386::do_calls_non_split): New function.
13775 * x86_64.cc (Target_x86_64::relocate_section): Add
13776 reloc_symbol_changes parameter.
13777 (Target_x86_64::do_calls_non_split): New function.
13778 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13779 parameter.
13780 * powerpc.cc (Target_powerpc::relocate_section): Add
13781 reloc_symbol_changes parameter.
13782 * sparc.cc (Target_sparc::relocate_section): Add
13783 reloc_symbol_changes parameter.
13784 * configure.ac: Call AM_CONDITIONAL for the default target.
13785 * configure: Rebuild.
13786 * testsuite/Makefile.am (TEST_AS): New variable.
13787 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13788 (check_DATA): Add split_i386 and split_x86_64 files.
13789 (SPLIT_DEFSYMS): Define.
13790 (split_i386_[1234n].o): New targets.
13791 (split_i386_[124]): New targets.
13792 (split_i386_[1234r].stdout): New targets.
13793 (split_x86_64_[1234n].o): New targets.
13794 (split_x86_64_[124]): New targets.
13795 (split_x86_64_[1234r].stdout): New targets.
13796 (MOSTLYCLEANFILES): Add new executables.
13797 * testsuite/split_i386.sh: New file.
13798 * testsuite/split_x86_64.sh: New file.
13799 * testsuite/split_i386_1.s: New file.
13800 * testsuite/split_i386_2.s: New file.
13801 * testsuite/split_i386_3.s: New file.
13802 * testsuite/split_i386_4.s: New file.
13803 * testsuite/split_i386_n.s: New file.
13804 * testsuite/split_x86_64_1.s: New file.
13805 * testsuite/split_x86_64_2.s: New file.
13806 * testsuite/split_x86_64_3.s: New file.
13807 * testsuite/split_x86_64_4.s: New file.
13808 * testsuite/split_x86_64_n.s: New file.
13809 * testsuite/testfile.cc (Target_test): Update relocation_section
13810 function.
13811 * testsuite/Makefile.in: Rebuild.
13812
13813 2009-10-06 Ian Lance Taylor <iant@google.com>
13814
13815 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13816 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13817 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13818 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13819 the address on ldo_addrs_.
13820 (Target_i386::Relocate::fix_up_ldo): New function.
13821
13822 2009-10-06 Rafael Espindola <espindola@google.com>
13823
13824 * plugin.cc (add_input_library): New.
13825 (Plugin::load): Add add_input_library to tv.
13826 (Plugin_manager::add_input_file): Add the is_lib argument.
13827 (add_input_file): Update call to Plugin_manager::add_input_file.
13828 (add_input_library): New.
13829 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13830
13831 2009-09-30 Doug Kwan <dougkwan@google.com>
13832
13833 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13834 symbol and call Symbol::may_need_copy_reloc to determine if
13835 a copy reloc is needed.
13836 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13837 nocopyreloc is given in command line.
13838 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13839 given in command line.
13840 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13841 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13842 of the removed Target_i386::may_need_copy_reloc.
13843 * options.h (copyreloc): New option with default value false.
13844 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13845 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13846 instead of the removed Target_powerpc::may_need_copy_reloc.
13847 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13848 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13849 instead of the removed Target_sparc::may_need_copy_reloc.
13850 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13851 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13852 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13853 instead of the removed Target_x86_64::may_need_copy_reloc.
13854
13855 2009-09-30 Ian Lance Taylor <iant@google.com>
13856
13857 * object.h (class Object): Remove target_ field, and target,
13858 sized_target, and set_target methods.
13859 (Object::sized_target): Remove.
13860 (class Sized_relobj): Update declarations. Remove sized_target.
13861 * object.cc (Sized_relobj::setup): Remove target parameter.
13862 Change all callers.
13863 (Input_objects::add_object): Don't do anything with the target.
13864 (make_elf_sized_object): Add punconfigured parameter. Change all
13865 callers. Set or test parameter target.
13866 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13867 Change all callers.
13868 * parameters.cc (Parameters::set_target): Change parameter type to
13869 be non-const.
13870 (Parameters::default_target): Remove.
13871 (set_parameters_target): Change parameter type to be non-const.
13872 (parameters_force_valid_target): New function.
13873 (parameters_clear_target): New function.
13874 * parameters.h (class Parameters): Update declarations. Remove
13875 default_target method. Add sized_target and clear_target
13876 methods. Change target_ to be non-const.
13877 (set_parameters_target): Update declaration.
13878 (parameters_force_valid_target): Declare.
13879 (parameters_clear_target): Declare.
13880 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13881 as NULL if we aren't searching.
13882 (Add_symbols::run): Don't check for compatible target.
13883 * fileread.cc (Input_file::open_binary): Call
13884 parameters_force_valid_target.
13885 * gold.cc (queue_middle_tasks): Likewise.
13886 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13887 set_target on object.
13888 * dynobj.h (class Sized_dynobj): Update declarations.
13889 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13890 make_elf_object returns NULL.
13891 (Archive::include_member): Don't check whether object target is
13892 compatible.
13893 * output.cc (Output_section::add_input_section): Get target from
13894 parameters.
13895 (Output_section::relax_input_section): Likewise.
13896 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13897 parameters.
13898 (Sized_relobj::do_scan_relocs): Likewise.
13899 (Sized_relobj::relocate_sections): Likewise.
13900 * resolve.cc (Symbol_table::resolve): Likewise.
13901 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13902 parameter. Change all callers.
13903 (Symbol_table::add_from_object): Get target from parameters.
13904 (Symbol_table::add_from_relobj): Don't check object target.
13905 (Symbol_table::add_from_dynobj): Likewise.
13906 (Symbol_table::define_special_symbol): Get target from
13907 parameters.
13908 * symtab.h (class Symbol_table): Update declaration.
13909 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13910 parameter. Change all callers. Clear parameter target.
13911 (Binary_test): Test target here.
13912 * testsuite/object_unittest.cc (gold_testsuite): Remove
13913 target_test_pointer parameter. Change all callers.
13914 (Object_test): Test target here.
13915
13916 2009-09-26 Ian Lance Taylor <iant@google.com>
13917
13918 * testsuite/initpri1.c: Don't try to use constructor priorities if
13919 compiling with gcc before 4.3.
13920
13921 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13922
13923 * testsuite/retain_symbols_file_test.sh (check_present): Change
13924 output file name to retain_symbols_file_test.stdout.
13925 (check_absent): Likewise.
13926
13927 2009-09-18 Craig Silverstein <csilvers@google.com>
13928
13929 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13930 * options.cc: Include <cerrno> and <fstream>.
13931 (General_options::finalize): Parse -retain-symbols-file tag.
13932 * options.h: New flag.
13933 (General_options): New method should_retain_symbol, new
13934 variable symbols_to_retain.
13935 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13936 should_retain_symbol map.
13937 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13938 * testsuite/Makefile.in: Regenerate.
13939 * testsuite/retain_symbols_file_test.sh: New file.
13940
13941 2009-09-18 Nick Clifton <nickc@redhat.com>
13942
13943 * po/es.po: Updated Spanish translation.
13944
13945 2009-09-17 Doug Kwan <dougkwan@google.com>
13946
13947 * debug.h (DEBUG_RELAXATION): New constant.
13948 (DEBUG_ALL): Add DEBUG_RELAXATION.
13949 (debug_string_to_enum): Add relaxation debug option.
13950 * layout.cc
13951 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13952 Layout::Relaxation_debug_check::read_sections,
13953 Layout::Relaxation_debug_check::read_sections): New method definitions.
13954 (Layout::Layout): Initialize data members
13955 record_output_section_data_from_scrips_,
13956 script_output_section_data_list_ and relaxation_debug_check_.
13957 (Layout::save_segments, Layout::restore_segments,
13958 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13959 Layout::relaxation_loop_body): New method definitions.
13960 (Layout::finalize): Support relaxation. Move section layout code to
13961 Layout::relaxation_loop_body.
13962 (Layout::set_asection_address_from_script): Move code for orphan
13963 section placement out.
13964 (Layout::place_orphan_sections_in_script): New method definition.
13965 * layout.h (Output_segment_headers, Output_file_header):
13966 New forward class declarations.
13967 (Layout::~Layout): Define.
13968 (Layout::new_output_section_data_from_script): New method definition.
13969 (Layout::place_orphan_sections_in_script): New method declaration.
13970 (Layout::Segment_states): New type declaration.
13971 (Layout::save_segments, Layout::restore_segments,
13972 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13973 Layout::relaxation_loop_body): New method declarations.
13974 (Layout::Output_section_data_list): New type declaration.
13975 (Layout::Relaxation_debug_check): New class definition.
13976 (Layout::record_output_section_data_from_script_,
13977 Layout::script_output_section_data_list_, Layout::segment_states_,
13978 Layout::relaxation_debug_check_): New data members.
13979 * output.cc: (Output_section_headers::do_size): New method definition.
13980 (Output_section_headers::Output_section_headers): Move size
13981 computation to Output_section_headers::do_size.
13982 (Output_segment_headers::do_size): New method definition.
13983 (Output_file_header::Output_file_header): Move size computation to
13984 Output_file_header::do_size and call it.
13985 (Output_file_header::do_size): New method definition.
13986 (Output_data_group::Output_data_group): Adjust call to
13987 Output_section_data.
13988 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13989 (Output_symtab_xindex::do_write): Add array bound check.
13990 (Output_section::Input_section::print_to_mapfile): Handle
13991 RELAXED_INPUT_SECTION_CODE.
13992 (Output_section::Output_section): Initialize data member checkpoint_.
13993 (Output_section::~Output_section): Delete checkpoint object pointed
13994 by checkpoint_.
13995 (Output_section::add_input_section): Always add an Input_section if
13996 relaxing.
13997 (Output_section::add_merge_input_section): Add assert.
13998 (Output_section::relax_input_section): New method definition.
13999 (Output_section::set_final_data_size): Set load address to zero for
14000 an unallocated section.
14001 (Output_section::do_address_and_file_offset_have_reset_values):
14002 New method definition.
14003 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14004 Handle relaxed input section.
14005 (Output_section::sort_attached_input_sections): Checkpoint input
14006 section list lazily.
14007 (Output_section::get_input_sections): Change type of input_sections to
14008 list of Simple_input_section pointers. Checkpoint input section list
14009 lazily. Also handle relaxed input sections.
14010 (Output_section::add_input_section_for_script): Take a reference to
14011 a Simple_input_section object instead of Relobj pointer and section
14012 index as parameter. Handle relaxed input sections.
14013 (Output_section::save_states, Output_section::restore_states): New
14014 method definitions.
14015 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14016 (Output_data::is_data_size_fixed): New method definition.
14017 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14018 if it is fixed.
14019 (Output_data::address_and_file_offset_have_reset_values): New method
14020 definition.
14021 (Output_data::do_address_and_file_offset_have_reset_values): New method
14022 definition.
14023 (Output_data::set_data_size): Check that data size is not fixed.
14024 (Output_data::fix_data_size): New method definition.
14025 (Output_data::is_data_size_fixed_): New data member.
14026 (Output_section_headers::set_final_data_size): New method definition.
14027 (Output_section_headers::do_size): New method declaration.
14028 (Output_segment_headers::set_final_data_size): New method definition.
14029 (Output_segment_headers::do_size): New method declaration.
14030 (Output_file_header::set_final_data_size)::New method definition.
14031 (Output_file_header::do_size)::New method declaration.
14032 (Output_section_data::Output_section_data): Add new parameter
14033 is_data_size_fixed and use it to fix data size.
14034 (Output_data_const::Output_data_const): Adjust call to base class
14035 constructor and fix data size.
14036 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14037 base class constructor and fix data size.
14038 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14039 base class constructor and fix data size.
14040 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14041 class constructor and fix data size.
14042 (Output_data_group::set_final_data_size): New method definition.
14043 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14044 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14045 class constructor and fix data size.
14046 (Output_relaxed_input_section): New class definition.
14047 (Output_section::Simple_input_section): New class definition.
14048 (Output_section::get_input_sections): Adjust parameter list.
14049 (Output_section::add_input_section_for_script): Same.
14050 (Output_section::save_states, Output_section::restore_states,
14051 Output_section::do_address_and_file_offset_have_reset_values,
14052 (Output_section::Input_section::Input_section): Handle
14053 RELAXED_INPUT_SECTION_CODE. Add new overload for
14054 Output_relaxed_input_section.
14055 (Output_section::Input_section::is_input_section,
14056 Output_section::Input_section::set_output_section): Handle relaxed
14057 input section.
14058 (Output_section::Input_section::is_relaxed_input_section,
14059 Output_section::Input_section::output_section_data,
14060 Output_section::Input_section::relaxed_input_section): New method
14061 definitions.
14062 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14063 value.
14064 (Output_section::Input_section::u1_): Update comments.
14065 (Output_section::Input_section::u2_): Add new union member poris.
14066 (Output_section::Checkpoint_output_section): New classs definition.
14067 (Output_section::relax_input_section): New method declaration.
14068 (Output_section::checkpoint_): New data member.
14069 (Output_segment): Update comments.
14070 (Output_segment::Output_segment): Un-privatize copy constructor.
14071 (Output_segment::operator=): Un-privatize.
14072 * script-sections.cc (Output_section_element::Input_section_list):
14073 Change element type to Output_section::Simple_input_section.
14074 (Output_section_element_dot_assignment::set_section_addresses):
14075 Register output section data for relaxation clean up.
14076 (Output_data_exression::Output_data_expression): Adjust call to base
14077 constructor to fix data size.
14078 (Output_section_element_data::set_section_addresses): Register
14079 Output_data_expression object for relaxation clean up.
14080 (struct Input_section_info): Replace Relobj pointer and section index
14081 pair with Output_section::Simple_input_section and Convert struct to a
14082 class.
14083 (Input_section_sorter::operator()): Adjust access to
14084 Input_section_info data member to use accessors.
14085 (Output_section_element_input::set_section_addresses): Use layout
14086 parameter. Adjust code to use Output_section::Simple_input_section
14087 and Input_secction_info classes. Register filler for relaxation
14088 clean up.
14089 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14090 and section index pair with Output_section::Simple_input_section
14091 class. Adjust code accordingly.
14092 (Phdrs_element::release_segment): New method definition.
14093 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14094 segment list.
14095 (Script_sections::release_segments): New method definition.
14096 * gold/script-sections.h (Script_sections::release_segments): New
14097 method declaration.
14098 * gold/target.h (Target::may_relax, Target::relax,
14099 Target::do_may_relax, Target::do_relax): New method definitions.
14100
14101 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14102
14103 * arm.cc (has_signed_unsigned_overflow): New function.
14104 (Arm_relocate_functions::abs8): New function.
14105 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14106 (Target_arm::Scan::global): Likewise.
14107 (Target_arm::relocate::relocate): Likewise.
14108 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14109 Likewise.
14110
14111 2009-09-16 Cary Coutant <ccoutant@google.com>
14112
14113 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14114 * testsuite/Makefile.in: Regenerate.
14115
14116 2009-09-11 Nick Clifton <nickc@redhat.com>
14117
14118 * po/gold.pot: Updated by the Translation project.
14119
14120 2009-09-08 Cary Coutant <ccoutant@google.com>
14121
14122 * output.cc (Output_file::open): Add execute permission to empty file.
14123 * testsuite/Makefile.am (permission_test): New test.
14124 * testsuite/Makefile.in: Regenerate.
14125
14126 2009-09-02 Ian Lance Taylor <iant@google.com>
14127
14128 * output.cc (Output_file::resize): Call map_no_anonymous rather
14129 than map.
14130
14131 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14132
14133 * gold.cc: Include "incremental.h".
14134 (queue_initial_tasks): Call Incremental_checker methods.
14135 * incremental.cc: Include "output.h".
14136 (Incremental_checker::can_incrementally_link_output_file): New
14137 method.
14138 * incremental.h (Incremental_checker): New class.
14139
14140 * output.cc (Output_file::open_for_modification): New method.
14141 (Output_file::map_anonymous): Changed return type to bool. Record
14142 map in base_ field.
14143 (Output_file::map_no_anonymous): New method, broken out of map.
14144 (Output_file::map): Use map_no_anonymous and map_anonymous.
14145 * output.h (class Output_file): Update declarations.
14146
14147 2009-08-24 Cary Coutant <ccoutant@google.com>
14148
14149 * options.h (Command_line::Pre_options): New class.
14150 (Command_line::pre_options): New member.
14151 * options.cc (gold::options::ready_to_register): New variable.
14152 (One_option::register_option): Do nothing if not registering options.
14153 Assert if same short option registered twice.
14154 (General_options::General_options): Turn off option registration when
14155 done constructing.
14156 (Command_line::Pre_options::Pre_options): New constructor.
14157
14158 2009-08-24 Cary Coutant <ccoutant@google.com>
14159
14160 * options.h (General_options::no_keep_memory): Remove incorrect
14161 short option.
14162
14163 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14164
14165 * Makefile.am (am__skiplex, am__skipyacc): New.
14166 * Makefile.in: Regenerate.
14167
14168 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14169
14170 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14171 (INCLUDES): ... this.
14172 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14173 (AM_CPPFLAGS): Renamed from ...
14174 (INCLUDE): ... this.
14175 * Makefile.in, testsuite/Makefile.in: Regenerate.
14176
14177 * Makefile.in: Regenerate.
14178 * aclocal.m4: Likewise.
14179 * config.in: Likewise.
14180 * configure: Likewise.
14181 * testsuite/Makefile.in: Likewise.
14182
14183 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14184 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14185 * Makefile.in: Regenerate.
14186 * testsuite/Makefile.in: Regenerate.
14187
14188 2009-08-19 Cary Coutant <ccoutant@google.com>
14189
14190 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14191 symbols in shared libraries overridden by hidden or internal symbols
14192 in the main program.
14193
14194 2009-08-19 Chris Demetriou <cgd@google.com>
14195
14196 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14197 checking source file names in error messages.
14198
14199 2009-08-18 Doug Kwan <dougkwan@google.com>
14200
14201 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14202 an elcpp::Ehdr as parameter. Adjust call to set_target.
14203 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14204 an elfcpp::Ehdr as parameter.
14205 * object.cc (Object::set_target): Remove the version that looks up
14206 a target and sets it.
14207 (Sized_relobj::setup): Take a Target object instead of
14208 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14209 (make_elf_sized_object): Find target and ask target to
14210 make an ELF object.
14211 * object.h: (Object::set_target): Remove the version that looks up
14212 a target and sets it.
14213 (Sized_relobj::setup): Take a Target object instead of
14214 an elfcpp:Ehdr as parameter.
14215 * target.cc: Include dynobj.h.
14216 (Target::do_make_elf_object_implementation): New.
14217 (Target::do_make_elf_object): New.
14218 * target.h (Target::make_elf_object): New template declaration.
14219 (Target::do_make_elf_object): New method declarations.
14220 (Target::do_make_elf_object_implementation): New template declaration.
14221
14222 2009-08-14 Ian Lance Taylor <iant@google.com>
14223
14224 * gold.h (FUNCTION_NAME): Define.
14225 (gold_unreachable): Use FUNCTION_NAME.
14226
14227 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14228
14229 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14230 symbol in the --keep-unique list is not found.
14231
14232 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14233
14234 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14235 been maked as --keep-unique.
14236 (Icf::unfold_section): New function.
14237 * icf.h (Icf::unfold_section): New function.
14238 * options.h (General_options::keep_unique): New option.
14239 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14240 * testsuite/Makefile.in: Regenerate.
14241 * testsuite/icf_keep_unique_test.sh: New file.
14242 * testsuite/icf_keep_unique_test.cc: New file.
14243
14244 2009-08-12 Cary Coutant <ccoutant@google.com>
14245
14246 PR 10471
14247 * resolve.cc (Symbol_table::resolve): Check for references from
14248 dynamic objects to hidden and internal symbols.
14249 * testsuite/Makefile.am (hidden_test.sh): New test.
14250 * testsuite/Makefile.in: Regenerate.
14251 * testsuite/hidden_test.sh: New script.
14252 * testsuite/hidden_test_1.c: New test source.
14253 * testsuite/hidden_test_main.c: New test source.
14254
14255 2009-08-11 Doug Kwan <dougkwan@google.com>
14256
14257 * arm.cc: Update comments.
14258 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14259 segment to locate the .ARM.exidx section if present.
14260
14261 2009-08-09 Doug Kwan <dougkwan@google.com>
14262
14263 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14264 patch.
14265
14266 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14267 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14268 compiler warnings.
14269
14270 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14271
14272 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14273 valid tls_segment only for non-debug-section relocations.
14274 * testsuite/Makefile.am: Add gc_tls_test.
14275 * testsuite/Makefile.in: Regenerate.
14276 * testsuite/gc_tls_test.cc: New file.
14277 * testsuite/gc_tls_test.sh: New file.
14278
14279 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14280
14281 * icf.cc: New file.
14282 * icf.h: New file.
14283 * Makefile.am (CCFILES): Add icf.cc.
14284 (HFILES): Add icf.h
14285 * Makefile.in: Regenerate.
14286 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14287 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14288 section, symbol and addend information for the relocs.
14289 * gold.cc (queue_middle_tasks): Call identical code folding.
14290 * gold.h: Add defines for multimap.
14291 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14292 to the call of finalize_local_symbols.
14293 * main.cc (main): Create object of class Icf.
14294 * object.cc (Sized_relobj::do_layout): Allow this function to be
14295 called twice during icf.
14296 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14297 to sections marked as identical by icf.
14298 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14299 when available.
14300 (Sized_relobj::do_section_entsize): New function.
14301 * object.h (Object::section_entsize): New function.
14302 (Object::do_section_entsize): New pure virtual function.
14303 (Relobj::finalize_local_symbols): Add new parameter.
14304 (Relobj::do_section_entsize): New function.
14305 * options.h (General_options::icf): New option.
14306 (General_options::icf_iterations): New option.
14307 (General_options::print_icf_sections): New option.
14308 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14309 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14310 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14311 icf.
14312 * symtab.cc (Symbol_table::is_section_folded): New function.
14313 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14314 to sections marked as identical by icf.
14315 * symtab.h (Symbol_table::set_icf): New function.
14316 (Symbol_table::icf): New function.
14317 (Symbol_table::is_section_folded): New function.
14318 (Symbol_table::icf_): New data member.
14319 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14320 * testsuite/Makefile.am: Add commands to build icf_test.
14321 * testsuite/Makefile.in: Regenerate.
14322 * testsuite/icf_test.sh: New file.
14323 * testsuite/icf_test.cc: New file.
14324
14325 2009-07-24 Chris Demetriou <cgd@google.com>
14326
14327 * layout.cc (is_compressible_debug_section): Fix incorrect
14328 comment about compressed section names.
14329
14330 2009-07-20 Ian Lance Taylor <ian@airs.com>
14331
14332 PR 10419
14333 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14334
14335 2009-07-16 Ian Lance Taylor <iant@google.com>
14336
14337 PR 10400
14338 * layout.h: #include <map>.
14339 (class Kept_section): Change from struct to class. Add accessors
14340 and setters. Add section size to Comdat_group mapping. Change
14341 Comdat_group to std::map. Add is_comdat_ field. Add
14342 linkonce_size field in union.
14343 (class Layout): Update declaration of find_or_add_kept_section.
14344 Don't declare find_kept_object.
14345 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14346 parameter. Add object, shndx, is_comdat, and is_group_name
14347 parameters. Change all callers. Adjust for new Kept_section.
14348 (Layout::find_kept_object): Remove.
14349 * object.cc (Sized_relobj::include_section_group): Update use of
14350 Kept_section. Rename secnum to shndx. Only record
14351 Kept_comdat_section if sections are the same size.
14352 (Sized_relobj::include_linkonce_section): Update use of
14353 Kept_section. Only record Kept_comdat_section if sections are the
14354 same size. Set size of linkonce section.
14355 (Sized_relobj::map_to_kept_section): Update call to
14356 get_kept_comdat_section.
14357 * object.h (class Sized_relobj): Rename fields in
14358 Kept_comdat_section to drop trailing underscores; change object
14359 field to Relobj*. Change Kept_comdat_section_table to store
14360 struct rather than pointer.
14361 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14362 Add kept_object and kept_shndx parameters. Change all callers.
14363 (Sized_relobj::get_kept_comdat_section): Change return type to
14364 bool. Add kept_object and kept_shndx parameters. Change all
14365 callers.
14366 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14367 Layout::find_or_add_kept_section.
14368
14369 2009-07-09 Ian Lance Taylor <iant@google.com>
14370
14371 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14372 Reserve space in the hash table.
14373
14374 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14375
14376 * fileread.cc (File_read::get_mtime): New method.
14377 * fileread.h (Timespec): New structure.
14378 (File_read::get_mtime): New method.
14379 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14380 Renamed from timestamp_nsec.
14381 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14382 Elf_Xword.
14383 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14384 timestamp_nsec.
14385 (Incremental_inputs::report_archive): Save mtime; style fix.
14386 (Incremental_inputs::report_obejct): Save mtime; style fix.
14387 (Incremental_inputs::report_script): Save mtime; style fix.
14388 (Incremental_inputs::finalize_inputs): Style fix.
14389 (Incremental_inputs::finalize): Style fix.
14390 (Incremental_inputs::create_input_section_data): Store inputs
14391 mtime.
14392 * incremental.h (Incremental_inputs::report_script): Add mtime
14393 argument.
14394 (Incremental_inputs::Input_info::Input_info): Intialize only one
14395 union member.
14396 (Incremental_inputs::Input_info::archive): Move to nameless
14397 union.
14398 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14399 (Incremental_inputs::Input_info::script): Move to nameless union.
14400 (Incremental_inputs::mtime): New field.
14401 * script.cc (read_input_script): Pass file mtime to
14402 Incremental_input.
14403 * script.h (Script_info::inputs): Style fix.
14404
14405 2009-07-01 Ian Lance Taylor <ian@airs.com>
14406
14407 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14408 instead of 32.
14409
14410 2009-06-24 Ian Lance Taylor <iant@google.com>
14411
14412 PR 10156
14413 * layout.cc (Layout::choose_output_section): If we find an
14414 existing section, update the flags.
14415 (Layout::create_notes): New function, broken out of
14416 Layout::finalize.
14417 (Layout::finalize): Don't create note sections.
14418 (Layout::create_note): Don't crash if linker script discards
14419 section.
14420 (Layout::create_gold_note): Likewise.
14421 (Layout::create_build_id): Likewise. Don't set
14422 after_input_sections on the section.
14423 (Layout::create_executable_stack_info): Remove target parameter.
14424 Change caller.
14425 * layout.h (class Layout): Declare create_notes. Update
14426 declaration of create_executable_stack_info.
14427 * gold.cc (queue_middle_tasks): Call create_notes.
14428 * output.cc (Output_section::update_flags_for_input_section): Move
14429 here from output.h. If SHF_ALLOC flag is newly set, mark address
14430 invalid.
14431 * output.h (Output_data::mark_address_invalid): New function.
14432 (class Output_section): Only declare, not define,
14433 update_flags_for_input_section. Remove set_flags.
14434
14435 2009-06-24 Ian Lance Taylor <iant@google.com>
14436
14437 * script-sections.cc (Output_section_definition::
14438 set_section_addresses): Rename shadowing local load_address to
14439 laddr.
14440
14441 2009-06-24 Ian Lance Taylor <iant@google.com>
14442
14443 PR 10244
14444 * reloc.cc (relocate_sections): Skip empty relocation sections.
14445
14446 2009-06-23 Ian Lance Taylor <iant@google.com>
14447
14448 PR 10156
14449 * layout.cc (Layout::create_note): Use choose_output_section
14450 rather than make_output_section.
14451
14452 2009-06-23 Ian Lance Taylor <iant@google.com>
14453
14454 PR 10237
14455 * options.cc (General_options::parse_V): Set printed_version_.
14456 (General_options::General_options): Initialize printed_version_.
14457 * options.h (class General_options): Add printed_version_ field.
14458 * gold.cc (queue_initial_tasks): If there are no input files,
14459 don't give a fatal error if we printed the version information.
14460 (queue_middle_tasks): If using -r with a shared object, give a
14461 fatal error rather than an ordinary error.
14462
14463 2009-06-23 Ian Lance Taylor <iant@google.com>
14464
14465 PR 10219
14466 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14467 (Layout::make_output_section): Set have_stabstr_section_ if we see
14468 a .stab*str section.
14469 (Layout::finalize): Call link_stabs_sections.
14470 (Layout::link_stabs_sections): New file.
14471 * layout.h (class Layout): Add have_stabstr_section_ field.
14472 Declare link_stabs_sections.
14473
14474 2009-06-23 Doug Kwan <dougkwan@google.com>
14475
14476 * Makefile.am (libgold_a_LIBADD): New.
14477 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14478 * Makefile.in: Regenerate.
14479 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14480 * configure: Regenerate.
14481 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14482 * fileread.cc: Include sys/state.h
14483 * gold.h: Declare memmem and strndup if found missing.
14484 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14485
14486 2009-06-23 Ian Lance Taylor <iant@google.com>
14487
14488 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14489 * configure: Rebuild.
14490
14491 2009-06-23 Ian Lance Taylor <iant@google.com>
14492
14493 PR 10147
14494 * object.cc (Object::section_contents): Don't try to get a view if
14495 the section has length zero.
14496 (Object::handle_gnu_warning_section): If the section is empty, use
14497 the name of the section as the warning.
14498
14499 2009-06-23 Ian Lance Taylor <iant@google.com>
14500
14501 PR 10133
14502 * stringpool.h (class Stringpool_template): Add optimize_ field.
14503 (Stringpool_template::set_optimize): New function.
14504 * stringpool.cc (Stringpool_template::Stringpool_template):
14505 Initialize optimize_ field.
14506 (Stringpool_template::set_string_offsets): Test local optimize
14507 fild rather than parameter.
14508 * layout.cc (Layout::Layout): Call set_optimize on the section
14509 name stringpool.
14510
14511 2009-06-22 Ian Lance Taylor <iant@google.com>
14512
14513 PR 10030
14514 * yyscript.y: Parse TARGET.
14515 * script.cc (script_set_target): New function.
14516 * script-c.h (script_set_target): Declare.
14517 * options.cc (General_options::string_to_object_format): Rename
14518 from string_to_object_format in anonymous namespace. Change
14519 callers.
14520 * options.h (class General_options): Declare
14521 string_to_object_format.
14522
14523 2009-06-22 Ian Lance Taylor <iant@google.com>
14524
14525 * script-sections.cc (Script_sections::create_segments): Don't put
14526 program headers in a PT_LOAD segment if -n or -N.
14527
14528 2009-06-22 Ian Lance Taylor <iant@google.com>
14529
14530 PR 10141
14531 * options.h (class General_options): Add -z lazy and -z now. Sort
14532 -z options into alphabetical order.
14533 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14534
14535 2009-06-21 Ian Lance Taylor <iant@google.com>
14536
14537 * layout.cc (Layout::make_output_section): Call
14538 Target::new_output_section.
14539 (Layout::attach_allocated_section_to_segment): Put large section
14540 sections in a separate load segment with the large segment flag
14541 set.
14542 (Layout::segment_precedes): Sort large data segments after other
14543 load segments.
14544 (align_file_offset): New static function.
14545 (Layout::set_segment_offsets): Use align_file_offset.
14546 * output.h (class Output_section): Add is_small_section_ and
14547 is_large_section_ fields.
14548 (Output_section::is_small_section): New function.
14549 (Output_section::set_is_small_section): New function.
14550 (Output_section::is_large_section): New function.
14551 (Output_section::set_is_large_section): New function.
14552 (Output_section::is_large_data_section): New function.
14553 (class Output_segment): Add is_large_data_segment_ field.
14554 (Output_segment::is_large_data_segment): New function.
14555 (Output_segment::set_is_large_data_segment): New function.
14556 * output.cc (Output_section::Output_section): Initialize new
14557 fields.
14558 (Output_segment::Output_segment): Likewise.
14559 (Output_segment::add_output_section): Add assertion that large
14560 data sections always go in large data segments. Force small data
14561 sections to the end of the list of data sections. Force small BSS
14562 sections to the start of the list of BSS sections. For large BSS
14563 sections to the end of the list of BSS sections.
14564 * symtab.h (class Symbol): Declare is_common_shndx.
14565 (Symbol::is_defined): Check Symbol::is_common_shndx.
14566 (Symbol::is_common): Likewise.
14567 (class Symbol_table): Define enum Commons_section_type. Update
14568 declarations. Add small_commons_ and large_commons_ fields.
14569 * symtab.cc (Symbol::is_common_shndx): New function.
14570 (Symbol_table::Symbol_table): Initialize new fields.
14571 (Symbol_table::add_from_object): Put small and large common
14572 symbols in the right list.
14573 (Symbol_table::sized_finalized_symbol): Check
14574 Symbol::is_common_shndx.
14575 (Symbol_table::sized_write_globals): Likewise.
14576 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14577 common symbol lists. Don't call do_allocate_commons_list if the
14578 list is empty.
14579 (Symbol_table::do_allocate_commons_list): Remove is_tls
14580 parameter. Add comons_section_type parameter. Change all
14581 callers. Handle small and large common symbols.
14582 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14583 Symbol::is_common_shndx.
14584 * resolve.cc (symbol_to_bits): Likewise.
14585 * target.h (Target::small_common_shndx): New function.
14586 (Target::small_common_section_flags): New function.
14587 (Target::large_common_shndx): New function.
14588 (Target::large_common_section_flags): New function.
14589 (Target::new_output_section): New function.
14590 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14591 small_common_section_flags, and large_common_section_flags
14592 fields.
14593 (Target::do_new_output_section): New virtual function.
14594 * arm.cc (Target_arm::arm_info): Initialize new fields.
14595 * i386.cc (Target_i386::i386_info): Likewise.
14596 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14597 Likewise.
14598 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14599 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14600 (Target_x86_64::do_new_output_section): New function.
14601 * configure.ac: Define conditional MCMODEL_MEDIUM.
14602 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14603 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14604 (large_LDFLAGS): Define.
14605 * testsuite/large.c: New file.
14606 * testsuite/testfile.cc (Target_test::test_target_info):
14607 Initialize new fields.
14608 * configure, testsuite/Makefile.in: Rebuild.
14609
14610 2009-06-05 Doug Kwan <dougkwan@google.com>
14611
14612 * Makefile.am (CCFILES): Add target.cc.
14613 * Makefile.in: Regenerate.
14614 * i386.cc (class Target_i386): Define new virtual method to
14615 override do_is_local_label_name in parent.
14616 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14617 local symbols if --discard-locals or -X is given.
14618 * options.h (class General_options): Declare new options
14619 '--discard-locals' and '-X' for discarding locals.
14620 * target.h (class Target): Define new methods is_local_label_name.
14621 Declare new virtual method do_is_local_label_name.
14622 * target.cc: New file.
14623 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14624 (check_SCRIPTS): Add discard_locals_test.sh.
14625 (check_DATA): Add discard_local_tests.syms.
14626 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14627 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14628 * testsuite/Makefile.in: Regenerate.
14629 * testsuite/discard_locals_test.c: New file.
14630 * testsuite/discard_locals_test.sh: Same.
14631
14632 2009-06-05 Doug Kwan <dougkwan@google.com>
14633
14634 * object.cc (Sized_relobj::Sized_relobj): Initialize
14635 discarded_eh_frame_shndx_ to -1U.
14636 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14637 section.
14638 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14639 a discarded .eh_frame section.
14640 (Sized_relobj::do_finalize_local_symbols): Ditto.
14641 * object.h (class Sized_relobj): Declare new member
14642 discarded_eh_frame_shndx_.
14643 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14644 (local_labels_test.o, local_labels_test): New rules.
14645 * testsuite/Makefile.in: Regenerate.
14646
14647 2009-06-04 Doug Kwan <dougkwan@google.com>
14648
14649 * layout.cc (Layout::section_name_mapping): Add mapping for
14650 special ARM sections.
14651
14652 2009-06-03 Doug Kwan <dougkwan@google.com>
14653
14654 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14655 (utils::has_overflow): Same.
14656
14657 2009-06-03 Ian Lance Taylor <iant@google.com>
14658
14659 * layout.cc (Layout::section_name_mapping): New array, replacing
14660 Layout::linkonce_mapping.
14661 (Layout::section_name_mapping_count): New variable, replacing
14662 Layout::linkonce_mapping_count.
14663 (Layout::linkonce_output_name): Remove.
14664 (Layout::output_section_name): Rewrite.
14665 * layout.h (class Layout): Rename Linkonce_mapping to
14666 Section_name_mapping, linkonce_mapping to section_name_mapping,
14667 linkonce_mapping_count to section_name_mapping_count. Don't
14668 declare linkonce_output_name.
14669
14670 2009-06-03 Doug Kwan <dougkwan@google.com>
14671
14672 * gold/arm.cc (namespace utils): New.
14673 (Target_arm::reloc_is_non_pic): Define new method.
14674 (class Arm_relocate_functions): New.
14675 (Target_arm::Relocate::relocate): Handle relocation types used by
14676 Android.
14677
14678 2009-06-03 Ian Lance Taylor <iant@google.com>
14679
14680 * arm.cc (Target_arm::scan::global): Use || instead of |.
14681
14682 2009-06-02 Doug Kwan <dougkwan@google.com>
14683
14684 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14685 issued_non_pic_error_.
14686 (class Target_arm::Scan): Declare new method check_non_pic.
14687 Define new method symbol_needs_plt_entry.
14688 Declare new data member issued_non_pic_error_.
14689 (class Target_arm::Relocate): Declare new method
14690 should_apply_static_reloc.
14691 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14692 (Target_arm::Scan::check_non_pic): Define new method.
14693 (Target_arm::Scan::local): Handle a small subset of reloc types used
14694 by Android.
14695 (Target_arm::Scan::local): Same.
14696 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14697
14698 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14699
14700 * incremental.cc (Incremental_inputs::report_command_line): Filter
14701 out --incremental-* options.
14702
14703 2009-05-29 Doug Kwan <dougkwan@google.com>
14704
14705 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14706 template class.
14707 (class Target_arm): Update comment.
14708 (Target_arm::Target_arm): Initialize new data members GOT_,
14709 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14710 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14711 and Target_arm::rel_dyn_section.
14712 Declare new_enum Target_arm::Got_type.
14713 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14714 and DYNBSS_.
14715 Update commments for member do_dynsym_value.
14716 (Target_arm::got_size, Target_arm::plt_section,
14717 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14718 new methods inside class defintion.
14719 (Target_arm::got_section): Define new method.
14720 (Target_arm::rel_dyn_section): Same.
14721 (Output_data_plt_arm): New template class.
14722 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14723 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14724 (Output_data_plt_arm::add_entry): Same.
14725 (Output_data_plt_arm::first_plt_entry): Define new
14726 static data member for PLT instruction template.
14727 (Output_data_plt_arm::plt_entry): Same.
14728 (Output_data_plt_arm::do_write): Define new method.
14729 (Target_arm::make_plt_entry): Same.
14730 (Target_arm::do_finalize_sections): Same.
14731 (Target_arm::do_dynsym_value): Same.
14732
14733 2009-05-28 Doug Kwan <dougkwan@google.com>
14734
14735 * Makefile.am (TARGETSOURCES): Add arm.cc.
14736 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14737 * Makefile.in: Regenerate.
14738 * arm.cc: New file.
14739 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14740
14741 2009-05-26 Doug Kwan <dougkwan@google.com>
14742
14743 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14744 (General_options::check_excluded_libs): Strip off directories in
14745 archive name before matching like GNU ld does.
14746 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14747 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14748 (exclude_libs_test_LDFLAGS): Add linker option
14749 -Wl,--exclude-libs,libexclude_libs_test_3
14750 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14751 an explicit archive without using -l.
14752 (alt/libexclude_libs_test_3.a): New make rule.
14753 * testsuite/Makefile.in: Regenerate.
14754 * testsuite/exclude_libs_test.c : Declare lib3_default().
14755 (main): Call it.
14756 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14757 * exclude_libs_test_3.c: New file.
14758
14759 2009-05-26 Nick Clifton <nickc@redhat.com>
14760
14761 * po/id.po: New Indonesian translation.
14762 * po/gold.pot: Updated template file.
14763
14764 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14765
14766 * testsuite/Makefile.am: Add -ffunction-sections to compile
14767 gc_comdat_test files. Add -Wl,--gc-sections to build
14768 gc_comdat_test.
14769 * testsuite/Makefile.in: Regenerate.
14770 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14771
14772 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14773
14774 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14775 kept comdat section was garbage collected.
14776 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14777 * testsuite/Makefile.in: Regenerate.
14778 * testsuite/gc_comdat_test.sh: New file.
14779 * testsuite/gc_comdat_test_1.cc: New file.
14780 * testsuite/gc_comdat_test_2.cc: New file.
14781
14782 2009-05-19 Doug Kwan <dougkwan@google.com>
14783
14784 * archive.cc (Archive::Archive): Move constructor from archive.h
14785 to here. Initialize no_export_.
14786 (Archive::get_elf_object_for_member): Set no_export flag of object.
14787 * archive.h (Archive::Archive): Move constructor body to
14788 archive.cc.
14789 (Archive::no_export): New method.
14790 (Archive::no_export_): New field.
14791 * object.h (Object::Object): Initialize no_export_ to false.
14792 (Object::no_export, Object::set_no_export): New methods.
14793 (Object::no_export_): New field.
14794 * options.cc (General_options::parse_exclude_libs): New method.
14795 (General_options::check_excluded_libs) Same.
14796 * options.h (exclude_libs): New option.
14797 (General_options::check_excluded_libs): New method declaration.
14798 (General_options::excluded_libs_): New field.
14799 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14800 default or protected visibility if an object has no-export flag set.
14801 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14802 (check_SCRIPTS): Add exclude_libs_test.sh.
14803 (check_DATA): Add exclude_libs_test.syms.
14804 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14805 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14806 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14807 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14808 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14809 libexclude_libs_test_2.a): New rules.
14810 * testsuite/Makefile.in: Regenerate.
14811 * testsuite/exclude_libs_test.c: New file.
14812 * testsuite/exclude_libs_test.sh: Ditto.
14813 * testsuite/exclude_libs_test_1.c: Ditto.
14814 * testsuite/exclude_libs_test_2.c: Ditto.
14815
14816 2009-05-15 Ian Lance Taylor <iant@google.com>
14817
14818 * configure.ac: Check for declarations for cases where libiberty.h
14819 checks HAVE_DECL_xxx.
14820 * configure, config.in: Rebuild.
14821
14822 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14823
14824 * gold.h (Incremental_argument_list): Remove (invalid) forward
14825 declaration.
14826 * incremental.cc (Incremental_inputs::report_achive): New method.
14827 (Incremental_inputs::report_object): New method.
14828 (Incremental_inputs::report_script): New method.
14829 (Incremental_inputs::finalize_inputs): New method.
14830 (Incremental_inputs::finalize): Call finalize_inputs().
14831 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14832 Create inputs entries.
14833 * incremental.h (Incremental_input_type): New enum.
14834 (Incremental_inputs::Incremental_input): Initialize new fields.
14835 (Incremental_inputs::report_inputs): New method.
14836 (Incremental_inputs::report_achive): New method.
14837 (Incremental_inputs::report_object): New method.
14838 (Incremental_inputs::report_script): New method.
14839 (Incremental_inputs::finalize_inputs): New method.
14840 (Incremental_inputs::Input_info): New struct.
14841 (Incremental_inputs::Input_info_map): New typedef.
14842 (Incremental_inputs::lock_): New field.
14843 (Incremental_inputs::Inputs_): New field.
14844 (Incremental_inputs::Inputs_map): New field.
14845 * main.cc (main): Call Incremental_input::report_inputs.
14846 * options.h (Input_argument_list): Typedef moved from
14847 Input_arguments.
14848 (Input_file_group::Files): Remove, use ::Input_argument_list.
14849 (Input_file_group::Input_argument_list): Remove, use
14850 ::Input_argument_list.
14851 * plugin.cc (Plugin_manager::add_input_file): Add error in
14852 incremental build.
14853 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14854 functions.
14855 * script.cc (read_input_script): Call
14856 Incremental_input::report_script.
14857 * script.h (Script_info): New class.
14858
14859 2009-04-27 Ian Lance Taylor <iant@google.com>
14860
14861 * x86_64.cc (do_adjust_output_section): Set entsize to
14862 plt_entry_size.
14863
14864 2009-04-23 Elliott Hughes <enh@google.com>
14865
14866 * output.cc (Output_file::close): After short writes, continue
14867 writing from the correct offset in the buffer being written.
14868
14869 2009-04-23 Chris Demetriou <cgd@google.com>
14870
14871 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14872 * configure: Regenerate.
14873 * config.in: Regenerate.
14874 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14875 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14876
14877 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14878
14879 * incremental.cc (Incremental_inputs_header_data): Renamed from
14880 Incremental_input_header_data.
14881 (Incremental_inputs_header_data::data_size): New field.
14882 (Incremental_inputs_header_data::put_input_file_count): Renamed
14883 from input_file_count.
14884 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14885 from command_line_offset.
14886 (Incremental_inputs_header_data::put_reserved): Renamed from
14887 put_reserved.
14888 (Incremental_inputs_entry_data): Renamed from
14889 Incremental_input_entry_data.
14890 (Incremental_inputs_entry_data::data_size): New field.
14891 (Incremental_inputs::report_command_line): New method.
14892 (Incremental_inputs::finalize): New method.
14893 (Incremental_inputs::create_incremental_inputs_data): New method.
14894 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14895 * incremental.h: New file.
14896 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14897 (Layout::finalize): Create incremental inputs section in
14898 incremental builds.
14899 (Layout::create_incremental_info_sections): New method.
14900 * layout.h (Layout::incremental_inputs): New method.
14901 (Layout::create_incremental_info_sections): New method.
14902 (Layout::incremental_inputs_): New field.
14903 * main.cc (main): Notify Incremental_input of the command line.
14904
14905 2009-04-01 Ian Lance Taylor <iant@google.com>
14906 Mikolaj Zalewski <mikolajz@google.com>
14907
14908 * gold.h (reserve_unordered_map): Define, three versions, one for
14909 each version of Unordered_map.
14910 * layout.cc (Layout::Layout): Remove options parameter. Add
14911 number_of_input_files parameter. Don't initialize options_.
14912 Initialize number_of_input_files_ and resized_signatures_. Move
14913 sections_are_attached_.
14914 (Layout::layout_group): Reserve space for group_signatures_.
14915 (Layout::find_or_add_kept_section): Change name parameter to be a
14916 reference. Resize signatures_ map when it gets large enough.
14917 (Layout::layout_eh_frame): Use parameters->options() instead of
14918 this->options_.
14919 (Layout::make_output_section): Likewise.
14920 (Layout::attach_allocated_section_to_segment): Likewise.
14921 (Layout::finalize, Layout::create_executable_stack): Likewise.
14922 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14923 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14924 * layout.h (class Layout): Update declarations. Remove options_
14925 field. Add number_of_input_files_ and resized_signatures_
14926 fields. Move sections_are_attached_ field.
14927 * main.cc (main): Pass number of input files to Layout
14928 constructor. Don't pass options.
14929
14930 2009-03-30 Ian Lance Taylor <iant@google.com>
14931
14932 * ffsll.c (ffsll): Correct implementation.
14933
14934 2009-03-27 Ian Lance Taylor <iant@google.com>
14935
14936 * ffsll.c: New file.
14937 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14938 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14939 * ftruncate.c (ftruncate): Declare before definition.
14940 * mremap.c (mremap): Likewise.
14941 * pread.c (pread): Likewise.
14942 * configure, Makefile.in, config.in: Rebuild.
14943
14944 * mremap.c: New file.
14945 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14946 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14947 (mremap): Declare if HAVE_MREMAP is not defined.
14948 * configure, Makefile.in, config.in: Rebuild.
14949
14950 2009-03-27 Cary Coutant <ccoutant@google.com>
14951
14952 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14953 position independent.
14954 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14955 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14956
14957 2009-03-24 Cary Coutant <ccoutant@google.com>
14958
14959 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14960 an executable.
14961 (needs_dynamic_reloc): Likewise.
14962
14963 2009-03-24 Ian Lance Taylor <iant@google.com>
14964
14965 * yyscript.y (file_cmd): Recognize EXTERN.
14966 (extern_name_list, extern_name_list_body): New nonterminals.
14967 * script.cc (script_add_extern): Define.
14968 * script-c.h (script_add_extern): Declare.
14969
14970 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14971
14972 * object.cc (is_elf_object): Define.
14973 * object.h (is_elf_object): Declare.
14974 * archive.cc (Archive::get_elf_object_for_member): Call
14975 is_elf_object.
14976 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14977
14978 2009-03-24 Elliott Hughes <enh@google.com>
14979
14980 * output.cc (Output_file::map_anonymous): Define.
14981 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14982 try an anonymous one. Report the size if the mmap fails.
14983 * output.h (class Output_file): Declare map_anonymous.
14984
14985 2009-03-24 Ian Lance Taylor <iant@google.com>
14986
14987 * target-select.cc (instantiate_target): Don't acquire the lock if
14988 the instantiated_target_ field has already been set.
14989
14990 2009-03-23 Ian Lance Taylor <iant@google.com>
14991
14992 * gold-threads.h (class Initialize_lock): Define.
14993 * gold-threads.cc (class Initialize_lock_once): Define.
14994 (initialize_lock_control): New static variable.
14995 (initialize_lock_pointer): New static variable.
14996 (initialize_lock_once): New static function.
14997 (Initialize_lock::Initialize_lock): Define.
14998 (Initialize_lock::initialize): Define.
14999 * target-select.h: Include "gold-threads.h".
15000 (class Target_selector): Add lock_ and initialize_lock_ fields.
15001 Don't define instantiate_target, just declare it.
15002 * target-select.cc (Target_selector::Target_selector): Initialize
15003 new fields.
15004 (Target_selector::instantiate_target): Define.
15005 * descriptors.h: Include "gold-threads.h".
15006 (class Descriptors): Add initialize_lock_ field.
15007 * descriptors.cc (Descriptors::Descriptors): Initialize new
15008 field.
15009 (Descriptors::open): Use initialize_lock_ field
15010 * errors.h (class Errors): Add initialize_lock_ field.
15011 * errors.cc (Errors::Errors): Initialize new field.
15012 (Errors::initialize_lock): Use initialize_lock_ field.
15013 * powerpc.cc (class Target_selector_powerpc): Remove
15014 instantiated_target_ field. In do_recognize call
15015 instantiate_target rather than do_instantiate_target. In
15016 do_instantiate_target just allocate a new target.
15017 * sparc.cc (class Target_selector_sparc): Likewise.
15018
15019 * freebsd.h: New file.
15020 * i386.cc: Include "freebsd.h".
15021 (Target_i386): Derive from Target_freebsd rather than
15022 Sized_target.
15023 (Target_selector_i386): Derive from Target_selector_freebsd rather
15024 than Target_selector.
15025 * x86_64.cc: Include "freebsd.h".
15026 (Target_x86_64): Derive from Target_freebsd rather than
15027 Sized_target.
15028 (Target_selector_x86_64): Derive from Target_selector_freebsd
15029 rather than Target_selector.
15030 * target.h (class Target): Add adjust_elf_header and
15031 do_adjust_elf_header.
15032 * output.cc (Output_file_header:: do_sized_write): Call target
15033 adjust_elf_header routine.
15034 * configure.tgt: Set targ_osabi.
15035 * configure.ac: Define GOLD_DEFAULT_OSABI.
15036 * parameters.cc (Parameters::default_target): Pass
15037 GOLD_DEFAULT_OSABI to select_target.
15038 * target-select.h (class Target_selector): Make instantiate_target
15039 protected rather than private.
15040 * Makefile.am (HFILES): Add freebsd.h.
15041 * configure, Makefile.in, config.in: Rebuild.
15042
15043 * merge.cc (do_add_input_section): Correct pend value. Change
15044 message about last entry not being null terminated from error to
15045 warning.
15046
15047 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15048
15049 * incremental.cc: New file.
15050 * Makefile.am (CCFILES): Add incremental.cc.
15051 * Makefile.in: Rebuild.
15052
15053 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15054
15055 * layout.cc (Layout::output_section_name): Preserve names
15056 of '.note.' sections.
15057
15058 2009-03-19 Ian Lance Taylor <iant@google.com>
15059
15060 * descriptors.cc (Descriptors::open): Check that the options are
15061 valid before using them.
15062
15063 2009-03-18 Ian Lance Taylor <iant@google.com>
15064
15065 * script-sections.h: Include <list>.
15066 (class Script_sections): Change Sections_elements from std::vector
15067 to std::list. Typedef public Elements_iterator. Add
15068 orphan_section_placement_, data_segment_align_start_, and
15069 saw_data_segment_align_ fields. Remove data_segment_align_index_
15070 field.
15071 * script-sections.cc (class Orphan_section_placement): New class.
15072 (class Sections_element): Add virtual functions is_relro and
15073 orphan_section_init. Remove virtual function place_orphan_here.
15074 (class Output_section_definition): Add is_relro and
15075 orphan_section_init. Remove place_orphan_here.
15076 (class Orphan_output_section): Likewise.
15077 (Script_sections::Script_sections): Update for field changes.
15078 (Script_sections::data_segment_align): Set saw_data_segment_align_
15079 and data_segment_align_start_, not data_segment_align_index.
15080 (Script_sections::data_segment_relro_end): Check
15081 saw_data_segment_align_. Use data_segment_align_start_ rather
15082 than data_segment_align_index_.
15083 (Script_sections::place_orphan): Rewrite to use
15084 Orphan_section_placement.
15085
15086 2009-03-17 Ian Lance Taylor <iant@google.com>
15087
15088 * archive.cc (Archive::add_symbols): Check for a version attached
15089 to the symbol name in the archive map.
15090 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15091 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15092 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15093 (ver_test_11.a): New target.
15094 * testsuite/Makefile.in: Rebuild.
15095
15096 * configure.ac: Check for chsize and posix_fallocate. Replace
15097 ftruncate.
15098 * ftruncate.c: New file, from gnulib.
15099 * output.cc (posix_fallocate): Define dummy version if not
15100 HAVE_POSIX_FALLOCATE.
15101 (Output_file::map): Call posix_fallocate rather than lseek and
15102 write.
15103 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15104 * configure, Makefile.in, config.in: Rebuild.
15105
15106 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
15107
15108 * layout.h (Layout::create_note): Add section_name parameter.
15109 * layout.cc (Layout::create_note): Likewise.
15110 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
15111
15112 2009-03-17 Ian Lance Taylor <iant@google.com>
15113
15114 * descriptors.cc: Include "options.h".
15115 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15116 (Descriptors::open): Always use O_CLOEXEC when opening a new
15117 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15118 then set FD_CLOEXEC.
15119
15120 * sparc.cc (class Target_sparc): Add has_got_section.
15121 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15122 make sure we have a GOT section.
15123
15124 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15125 (Target_sparc::Scan::local): Likewise.
15126 (Target_sparc::Scan::global): Likewise.
15127 (Target_sparc::Relocate::relocate): Likewise.
15128 (Target_sparc::Relocate::relocate_tls): Likewise.
15129
15130 * symtab.cc (Symbol_table::define_default_version): New function,
15131 broken out of add_from_object.
15132 (Symbol_table::add_from_object): Call define_default_version.
15133 (Symbol_table::define_special_symbol): Add resolve_oldsym
15134 parameter. Change all callers. If the version for a symbol comes
15135 from a version script, resolve it with the symbol with the same
15136 name with no version. Also add the symbol without a version if
15137 appropriate.
15138 (do_define_in_output_data): If resolving with oldsym, don't delete
15139 sym.
15140 (do_define_in_output_segment): Likewise.
15141 (do_define_as_constant): Likewise.
15142 * symtab.h (class Symbol_table): Update declarations.
15143
15144 2009-03-13 Ian Lance Taylor <iant@google.com>
15145
15146 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15147 (Read_symbols::requeue): New function.
15148 (Read_symbols::do_read_symbols): If make_elf_object fails because
15149 the target type is not configured, and the file was searched for,
15150 issue a warning and retry with the next directory.
15151 (Add_symbols::run): If the file has an incompatible format, and
15152 it was searched for, requeue the Read_symbols task. On error,
15153 release the object.
15154 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15155 dirindex parameter to constructor. Change all callers. Declare
15156 incompatible_warning and requeue.
15157 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15158 input_argument_ and input_group_ fields. Add them to
15159 constructor. Change all callers.
15160 (class Read_script): Add dirindex_ field. Add it to constructor.
15161 Change all callers.
15162 * archive.cc (Archive::setup): Remove input_objects parameter.
15163 Change all callers.
15164 (Archive::get_file_and_offset): Likewise.
15165 (Archive::read_all_symbols): Likewise.
15166 (Archive::read_symbols): Likewise.
15167 (Archive::get_elf_object_for_member): Remove input_objects
15168 parameter. Add punconfigured parameter. Change all callers.
15169 (Archive::add_symbols): Change return type to bool. Check return
15170 value of include_member.
15171 (Archive::include_all_members): Likewise.
15172 (Archive::include_member): Change return type to bool. Return
15173 false if first included object has incompatible target. Set
15174 included_member_ field.
15175 (Add_archive_symbols::run): If add_symbols returns false, requeue
15176 Read_symbols task.
15177 * archive.h (class Archive): Add included_member_ field.
15178 Initialize it in constructor. Add input_file and searched_for
15179 methods. Update declarations.
15180 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15181 input_argument_ fields. Add them to constructor. Change all
15182 callers.
15183 * script.cc: Include "target-select.h".
15184 (class Parser_closure): Add skip_on_incompatible_target_ and
15185 found_incompatible_target_ fields. Add
15186 skip_on_incompatible_target parameter to constructor. Change all
15187 callers. Add methods skip_on_incompatible_target,
15188 clear_skip_on_incompatible_target, found_incompatible_target, and
15189 set_found_incompatible_target.
15190 (read_input_script): Add dirindex parameter. Change all callers.
15191 If parser finds an incompatible target, requeue Read_symbols
15192 task.
15193 (script_set_symbol): Clear skip_on_incompatible_target in
15194 closure.
15195 (script_add_assertion, script_parse_option): Likewise.
15196 (script_start_sections, script_add_phdr): Likewise.
15197 (script_check_output_format): New function.
15198 * script.h (read_input_script): Update declaration.
15199 * script-c.h (script_check_output_format): Declare.
15200 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15201 (ignore_cmd): Remove OUTPUT_FORMAT.
15202 * fileread.cc (Input_file::Input_file): Add explicit this.
15203 (Input_file::will_search_for): New function.
15204 (Input_file::open): Add pindex parameter. Change all callers.
15205 * fileread.h (class Input_file): Add input_file_argument method.
15206 Declare will_search_for. Update declarations.
15207 * object.cc (make_elf_object): Add punconfigured parameter.
15208 Change all callers.
15209 * object.h (class Object): Make input_file public. Add
15210 searched_for method.
15211 (make_elf_object): Update declaration.
15212 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15213 restart search.
15214 * dirsearch.h (class Dirsearch): Update declaration.
15215 * options.h (class General_options): Add --warn-search-mismatch.
15216 * parameters.cc (Parameters::is_compatible_target): New function.
15217 * parameters.h (class Parameters): Declare is_compatible_target.
15218 * workqueue.cc (Workqueue::add_blocker): New function.
15219 * workqueue.h (class Workqueue): Declare add_blocker.
15220
15221 * fileread.cc (Input_file::open): Remove options parameter.
15222 Change all callers.
15223 (Input_file::open_binary): Likewise.
15224 * script.cc (read_input_script): Likewise.
15225 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15226 options parameter from constructor. Change all callers.
15227 (class Read_script): Likewise.
15228 * fileread.h (class Input_file): Update declarations.
15229 * script.h (read_input_script): Update declaration.
15230
15231 2009-03-10 Nick Clifton <nickc@redhat.com>
15232
15233 * po/es.po: New Spanish translation.
15234
15235 2009-03-06 Cary Coutant <ccoutant@google.com>
15236
15237 * options.cc (parse_short_option): Keep dash_z from registering itself.
15238
15239 2009-03-03 Ian Lance Taylor <iant@google.com>
15240
15241 PR 9918
15242 * target-reloc.h (relocate_section): Pass output_section to
15243 relocate.
15244 * i386.cc (Target_i386::should_apply_static_reloc): Add
15245 output_section parameter. Change all callers.
15246 (Target_i386::Relocate::relocate): Add output_section parameter.
15247 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15248 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15249 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15250 * testsuite/two_file_shared.sh: New script.
15251 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15252 (check_DATA): Add two_file_shared.dbg.
15253 (two_file_shared.dbg): New target.
15254 * testsuite/Makefile.in: Rebuild.
15255
15256 2009-03-01 Ian Lance Taylor <iant@google.com>
15257
15258 * configure.ac: Check for byteswap.h.
15259 * configure: Rebuild.
15260 * config.in: Rebuild.
15261
15262 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15263
15264 * layout.cc (Layout::find_or_add_kept_section): New function.
15265 (Layout::add_comdat): Removed.
15266 * layout.h (struct Kept_section): Move out of class Layout.
15267 Remove trailing underscores from field names. Add group_sections
15268 field. Rename group_ field to is_group. Change all uses.
15269 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15270 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15271 comdat_groups_ field.
15272 (Sized_relobj::include_section_group): Use
15273 find_or_add_kept_section and Kept_section::group_sections.
15274 (Sized_relobj::include_linkonce_section): Likewise.
15275 * object.cc (class Sized_relobj): Don't define Comdat_group or
15276 Comdat_group_table. Remove find_comdat_group and
15277 add_comdat_group. Remove comdat_groups_ field.
15278 * plugin.cc (include_comdat_group): Use
15279 Layout::find_or_add_kept_section.
15280
15281 2009-02-28 Ian Lance Taylor <iant@google.com>
15282
15283 * README: --gc-sections and map files are now supported. Document
15284 some build requirements.
15285
15286 PR 6992
15287 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15288 relocatable link set the value of the section symbol to zero.
15289 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15290 relocatable link don't include the section address in the local
15291 symbol value.
15292
15293 2009-02-27 Ian Lance Taylor <iant@google.com>
15294
15295 PR 6811
15296 * options.h (class Search_directory): Add is_system_directory.
15297 (class General_options): Declare is_in_system_directory.
15298 * options.cc (get_relative_sysroot): Make static.
15299 (get_default_sysroot): Make static.
15300 (General_optoins::is_in_system_directory): New function.
15301 * fileread.cc (Input_file::is_in_system_directory): New function.
15302 * fileread.h (class Input_file): Declare is_in_system_directory.
15303 * object.h (class Object): Add is_in_system_directory.
15304 (class Input_objects): Remove system_library_directory_ field.
15305 * object.cc (Input_objects::add_object): Don't set
15306 system_library_directory_.
15307 (input_objects::found_in_system_library_directory): Remove.
15308 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15309 parameter. Change all callers.
15310 (Symbol_table::sized_write_globals): Likewise.
15311 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15312 Call Object::is_in_system_directory.
15313 * symtab.h (class Symbol_table): Update declarations.
15314
15315 PR 5990
15316 * descriptors.h (Open_descriptor): Add is_on_stack field.
15317 * descriptors.cc (Descriptors::open): If the descriptor is on the
15318 top of the stack, remove it. Initialize is_on_stack field.
15319 (Descriptors::release): Only add pod to stack if it is not on the
15320 stack already.
15321 (Descriptors::close_some_descriptor): Clear stack_next and
15322 is_on_stack fields.
15323
15324 PR 7091
15325 * output.cc (Output_section::find_starting_output_address): Rename
15326 from starting_output_address; add PADDR parameter; change return
15327 type.
15328 * output.h (class Output_section): Declare
15329 find_starting_output_address instead of starting_output_address.
15330 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15331 section symbol for which we can't find a merge section.
15332
15333 PR 9836
15334 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15335 hidden or internal, force the symbol to be local.
15336 * resolve.cc (Symbol::override_visibility): Define.
15337 (Symbol::override_base): Use override_visibility.
15338 (Symbol_table::resolve): Likewise.
15339 (Symbol::override_base_with_special): Likewise.
15340 (Symbol_table::override_with_special): If the visibility is hidden
15341 or internal, force the symbol to be local.
15342 * symtab.h (class Symbol): Add set_visibility and
15343 override_visibility.
15344 * testsuite/ver_test_1.sh: New file.
15345 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15346 (check_DATA): Add ver_test_1.syms.
15347 (ver_test_1.syms): New target.
15348 * testsuite/Makefile.in: Rebuild.
15349
15350 2009-02-25 Cary Coutant <ccoutant@google.com>
15351
15352 * layout.cc (Layout::choose_output_section): Don't rename sections
15353 when using a linker script that has a SECTIONS clause.
15354 * Makefile.in: Regenerate.
15355
15356 * testsuite/Makefile.am (script_test_5.sh): New test case.
15357 * testsuite/Makefile.in: Regenerate.
15358 * testsuite/script_test_5.cc: New file.
15359 * testsuite/script_test_5.sh: New file.
15360 * testsuite/script_test_5.t: New file.
15361
15362 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15363
15364 * archive.cc (Archive::include_member): Update calls to add_symbols.
15365 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15366 the Layout argument.
15367 * dynobj.h (do_add_symbols): Add the Layout argument.
15368 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15369 Layout argument.
15370 * object.h (Object::add_symbols): Add the Layout argument.
15371 (Object::do_add_symbols): Add the Layout argument.
15372 (Sized_relobj::do_add_symbols): Add the Layout argument.
15373 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15374 Unify the two versions.
15375 (Add_plugin_symbols): Remove.
15376 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15377 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15378 (Add_plugin_symbols): Remove.
15379 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15380 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15381 (Add_symbols::run): Make it work with Pulginobj.
15382
15383 2009-02-06 Ian Lance Taylor <iant@google.com>
15384
15385 * object.cc (Sized_relobj::do_layout): Make info message start
15386 with lower case letter.
15387
15388 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15389
15390 * binary.cc: Fix file comment.
15391
15392 * options.h (enum Incremental_disposition): Define.
15393 (class General_options): Add new options: --incremental,
15394 --incremental_changed, --incremental_unchanged,
15395 --incremental_unknown. Add incremental_disposition_ and
15396 implicit_incremental_ fields.
15397 (General_options::incremental_disposition): New function.
15398 (class Position_dependent_options): Add incremental_disposition
15399 option.
15400 (Position_dependent_options::copy_from_options): Set incremental
15401 dispositions.
15402 * options.cc (General_options::parse_incremental_changed): New
15403 function.
15404 (General_options::parse_incremental_unchanged): New function.
15405 (General_options::parse_incremental_unknown): New function.
15406 (General_options::General_options): Initialize new fields
15407 incremental_disposition_ and implicit_incremental_.
15408 (General_options::finalize): Check for uasge of --incremental-*
15409 without --incremental.
15410
15411 2009-02-06 Chris Demetriou <cgd@google.com>
15412
15413 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15414 pointer and to report location as the file name associated with
15415 the symbol.
15416 (gold_undefined_symbol_at_location): New function to replace the
15417 old gold_undefined_symbol functionality.
15418 * target-reloc.h (relocate_section): Update to use
15419 gold_undefined_symbol_at_location.
15420 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15421 Call gold_undefined_symbol function rather than gold_error.
15422 * errors.h (Errors::undefined_symbol): Take location as a
15423 string, rather than calculating it from a relocation.
15424 * errors.cc (Errors::fatal): Print "fatal error:" before the
15425 formatted message.
15426 (Errors::error, Errors::error_at_location): Print "error: "
15427 before the formatted message.
15428 (Errors::undefined_symbol): Take location as a string, rather
15429 than calculating it from a relocation.
15430 (gold_undefined_symbol_at_location): New function akin to
15431 old gold_undefined_symbol, calculates location from relocation.
15432 (gold_undefined_symbol): Change to take only a Symbol pointer
15433 and to report location as the file name associated with the symbol.
15434 * testsuite/debug_msg.sh: Update for changed error messages.
15435 * testsuite/undef_symbol.sh: Likewise.
15436
15437 2009-02-04 Duncan Sands <baldrick@free.fr>
15438
15439 PR 9812
15440 * reduced_debug_output.h
15441 (Output_reduced_debug_abbrev_section::failed): Use format for
15442 gold_warning.
15443 (Output_reduced_debug_info_section::faild): Likewise.
15444
15445 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15446
15447 * script.cc (Lazy_demangler): New class.
15448 (Version_script_info::get_symbol_version_helper): Demangle a
15449 symbol only once.
15450
15451 2009-01-29 Cary Coutant <ccoutant@google.com>
15452
15453 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15454 to __tls_get_addr.
15455 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15456
15457 2009-01-28 Ian Lance Taylor <iant@google.com>
15458
15459 * version.cc (version_string): Bump to 1.9.
15460
15461 * gold.h: Include <cstring> and <stdint.h>.
15462 * version.cc: Include <cstdio>.
15463 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15464 warning.
15465 * reduced_debug_output.cc (insert_into_vector): Rename from
15466 Insert_into_vector; change all callers. Use Swap_unaligned to
15467 avoid aliasing issue; remove union since it is unnecessary.
15468
15469 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15470
15471 * Makefile.am (CCFILES): Add gc.cc.
15472 (HFILES): Add gc.h.
15473 * Makefile.in: Regenerate.
15474 * gold.cc (Gc_runner): New class.
15475 (queue_initial_tasks): Call garbage collection related tasks
15476 when corresponding options are invoked.
15477 (queue_middle_gc_tasks): New function.
15478 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15479 processed early before laying out sections during garbage collection.
15480 * gold.h (queue_middle_gc_tasks): New function.
15481 (is_prefix_of): Move from "layout.cc".
15482 * i386.cc (Target_i386::gc_process_relocs): New function.
15483 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15484 * main.cc (main): Create object of class "Garbage_collection".
15485 * object.cc (Relobj::copy_symbols_data): New function.
15486 (Relobj::is_section_name_included): New function.
15487 (Sized_relobj::do_layout): Allow this function to be called twice
15488 during garbage collection and defer layout of section during the
15489 first call.
15490 * object.h (Relobj::get_symbols_data): New function.
15491 (Relobj::is_section_name_included): New function.
15492 (Relobj::copy_symbols_data): New function.
15493 (Relobj::set_symbols_data): New function.
15494 (Relobj::get_relocs_data): New function.
15495 (Relobj::set_relocs_data): New function.
15496 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15497 (Relobj::gc_process_relocs): New function.
15498 (Relobj::do_gc_process_relocs): New pure virtual function.
15499 (Relobj::sd_): New data member.
15500 (Sized_relobj::is_output_section_offset_invalid): New function.
15501 (Sized_relobj::do_gc_process_relocs): New function.
15502 * options.h (General_options::gc_sections): Modify to not be a no-op.
15503 (General_options::print_gc_sections): New option.
15504 * plugin.cc (Plugin_finish::run): Remove function call to
15505 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15506 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15507 * reloc.cc (Read_relocs::run): Add task to process relocs and
15508 determine unreferenced sections when doing garbage collection.
15509 (Gc_process_relocs): New class.
15510 (Sized_relobj::do_gc_process_relocs): New function.
15511 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15512 sections that are garbage collected.
15513 * reloc.h (Gc_process_relocs): New class.
15514 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15515 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15516 symbols whose corresponding sections are garbage collected.
15517 (Symbol_table::Symbol_table): Add new parameter for the garbage
15518 collection object.
15519 (Symbol_table::gc_mark_undef_symbols): New function.
15520 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15521 (Symbol_table::gc_mark_dyn_syms): New function.
15522 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15523 as garbage.
15524 (Symbol_table::add_from_object): Likewise.
15525 (Symbol_table::add_from_relobj): When building shared objects, do not
15526 treat externally visible symbols as garbage.
15527 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15528 table information for static and relocatable links.
15529 * symtab.h (Symbol_table::set_gc): New function.
15530 (Symbol_table::gc): New function.
15531 (Symbol_table::gc_mark_undef_symbols): New function.
15532 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15533 (Symbol_table::gc_mark_dyn_syms): New function.
15534 (Symbol_table::gc_): New data member.
15535 * target.h (Sized_target::gc_process_relocs): New pure virtual
15536 function.
15537 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15538 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15539
15540 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15541
15542 * options.h (General_options::gc_sections): Define as a no-op for now.
15543 (General_options::no_keep_memory): Ditto.
15544 (General_options::Bshareable): Define.
15545 * options.cc (General_options::finalize): Honor -Bshareable.
15546
15547 2009-01-20 Andreas Schwab <schwab@suse.de>
15548
15549 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15550 read the value in the contents, since we don't use it. Use the
15551 template endianness when writing.
15552 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15553
15554 2009-01-19 Andreas Schwab <schwab@suse.de>
15555
15556 * configure.tgt (powerpc64-*): Fix targ_obj.
15557
15558 2009-01-15 Ian Lance Taylor <iant@google.com>
15559
15560 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15561 local symbols when stripping all symbols.
15562
15563 2009-01-14 Cary Coutant <ccoutant@google.com>
15564
15565 * output.cc (Output_reloc): Add explicit instantiations.
15566
15567 2009-01-14 Cary Coutant <ccoutant@google.com>
15568
15569 * archive.cc (Archive::get_elf_object_for_member): Remove call
15570 to File_read::claim_for_plugin.
15571 * descriptors.cc (Descriptors::open): Remove reference to
15572 is_claimed.
15573 (Descriptors::claim_for_plugin): Remove.
15574 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15575 (Descriptors::is_claimed): Remove.
15576 (claim_descriptor_for_plugin): Remove.
15577 * fileread.cc (File_read::claim_for_plugin): Remove.
15578 * fileread.h (File_read::claim_for_plugin): Remove.
15579 (File_read::descriptor): Reopen descriptor if necessary.
15580 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15581 (Plugin_manager::all_symbols_read): Add task parameter. Change
15582 all callers.
15583 (Plugin_manager::get_input_file): New function.
15584 (Plugin_manager::release_input_file): New function.
15585 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15586 corresponding data member.
15587 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15588 and pass to base constructor. Change all callers.
15589 (get_input_file, release_input_file): New functions.
15590 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15591 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15592 (Plugin_manager::all_symbols_read): Add task parameter.
15593 (Plugin_manager::get_input_file): New function.
15594 (Plugin_manager::release_input_file): New function.
15595 (Plugin_manager::task_): New data member.
15596 (Pluginobj::Pluginobj): Add filesize parameter.
15597 (Pluginobj::filename): New function.
15598 (Pluginobj::descriptor): New function.
15599 (Pluginobj::filesize): New function.
15600 (Pluginobj::filesize_): New data member.
15601 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15602 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15603 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15604
15605 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15606 with archive libraries.
15607 * testsuite/Makefile.in: Regenerate.
15608 * testsuite/plugin_test.c (struct sym_info): New type.
15609 (get_input_file, release_input_file): New static variables.
15610 (onload): Capture new transfer vector entries.
15611 (claim_file_hook): Stop reading at end of file according to filesize.
15612 Factor out parsing of readelf output into separate function.
15613 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15614 APIs and get the source file name from the symbol table. Convert
15615 source file name to corresponding object file name. Print info
15616 message when adding new input files.
15617 (parse_readelf_line): New function.
15618 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15619 * testsuite/plugin_test_2.sh: Likewise.
15620 * testsuite/plugin_test_3.sh: Likewise.
15621 * testsuite/plugin_test_4.sh: New test case.
15622
15623 2009-01-07 Ian Lance Taylor <iant@google.com>
15624
15625 * version.cc (version_string): Bump to 1.8.
15626
15627 2008-12-23 Cary Coutant <ccoutant@google.com>
15628
15629 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15630 * plugin.cc (Plugin_manager::finish): Rename as
15631 layout_deferred_objects. Move cleanup to separate function.
15632 (Plugin_manager::cleanup): New function.
15633 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15634 separately.
15635 * plugin.h (Plugin_manager::finish): Rename as
15636 layout_deferred_objects.
15637 (Plugin_manager::cleanup): New function.
15638 (Plugin_manager::cleanup_done): New field.
15639
15640 2008-12-23 Cary Coutant <ccoutant@google.com>
15641
15642 * plugin.cc (is_visible_from_outside): New function.
15643 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15644 so we don't return "IR only" status for exported symbols or -r links.
15645
15646 * testsuite/Makefile.am (plugin_test_3): New test case.
15647 * testsuite/Makefile.in: Regenerate.
15648 * testsuite/plugin_test_3.sh: New file.
15649
15650 2008-12-22 Cary Coutant <ccoutant@google.com>
15651
15652 * object.cc (Sized_relobj::layout_section): New function.
15653 (Sized_relobj::do_layout): Defer layout of input sections until after
15654 plugin has provided replacement files.
15655 (Sized_relobj::do_layout_deferred_sections): New function.
15656 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15657 (Relobj::layout_deferred_sections): New function.
15658 (Relobj::do_layout_deferred_sections): New function.
15659 (Sized_relobj::do_layout_deferred_sections): New function.
15660 (Sized_relobj::layout_section): New function.
15661 (Sized_relobj::Deferred_layout): New structure.
15662 (Sized_relobj::deferred_layout_): New field.
15663 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15664 Change all callers. Layout deferred sections.
15665 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15666 references.
15667 (Plugin_hook::run): Move code from do_plugin_hook inline.
15668 (Plugin_hook::do_plugin_hook): Remove.
15669 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15670 (Plugin_manager::finish): Renamed, was cleanup.
15671 (Plugin_manager::should_defer_layout): New function.
15672 (Plugin_manager::add_deferred_layout_object): New function.
15673 (Plugin_manager::Deferred_layout_list): New type.
15674 (Plugin_manager::deferred_layout_objects_): New field.
15675 (Plugin_hook::do_plugin_hook): Remove.
15676
15677 2008-12-17 Ian Lance Taylor <iant@google.com>
15678
15679 * options.h (class General_options): Add --no case for
15680 --export-dynamic.
15681
15682 2008-12-16 Cary Coutant <ccoutant@google.com>
15683
15684 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15685 vector.
15686 (Plugin_manager::claim_file): Create plugin object even if
15687 plugin did not call the add_symbols callback.
15688 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15689 asking for more symbols than were added.
15690 * testsuite/Makefile.am (plugin_test_1): Add test case with
15691 no global symbols.
15692 (empty.syms): New target.
15693 * testsuite/Makefile.in: Regenerate.
15694 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15695 message. Don't call add_symbols if no globals.
15696 (all_symbols_read_hook): Don't provide replacement for empty
15697 claimed file.
15698
15699 2008-12-12 Ian Lance Taylor <iant@google.com>
15700
15701 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15702 r_type == 0 for a local symbol with r_sym == 0.
15703 (scan_relocatable_relocs): Pass r_sym to
15704 local_non_section_strategy.
15705 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15706 r_sym parameter.
15707
15708 * configure.ac: Update test for TLS descriptors: they are
15709 supported as of glibc 2.9.
15710 * configure: Rebuild.
15711
15712 2008-12-11 Ian Lance Taylor <iant@google.com>
15713
15714 PR 7091
15715 * target-reloc.h (Default_scan_relocatable_relocs): For each
15716 function, map r_type == 0 to RELOC_DISCARD.
15717
15718 2008-12-10 Cary Coutant <ccoutant@google.com>
15719
15720 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15721 object to override a kept COMDAT group from a plugin object.
15722
15723 2008-12-09 Ian Lance Taylor <iant@google.com>
15724
15725 PR 7088
15726 * yyscript.y (file_cmd): Handle INPUT.
15727
15728 * testsuite/initpri1.c: Change all declarations to be full
15729 prototypes by adding void, to avoid compiler warnings.
15730
15731 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15732
15733 * options.cc (General_options::parse_plugin_opt): New.
15734 (General_options::add_plugin): The argument now is just the filename.
15735 (General_options::add_plugin_option): New.
15736 * options.h (plugin_opt): New.
15737 (add_plugin): Change argument name.
15738 (add_plugin_option): New.
15739 * plugin.cc (Plugin::load): Don't parse the plugin option.
15740 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15741 (Plugin::add_option): New.
15742 (Plugin::args_): Change type.
15743 (Plugin::filename_): New.
15744 (Plugin_manager::add_plugin_option): New.
15745 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15746 * testsuite/Makefile.in: Regenerate.
15747
15748 2008-12-05 Cary Coutant <ccoutant@google.com>
15749
15750 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15751 Handle --strip-lto-sections option.
15752 * options.h (strip_lto_sections): New option.
15753
15754 2008-12-01 Cary Coutant <ccoutant@google.com>
15755
15756 * plugin.cc (ld_plugin_message): Change format parameter to const.
15757 Fix mismatch between new[] and delete.
15758
15759 2008-11-14 Cary Coutant <ccoutant@google.com>
15760
15761 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15762 instead of -1U.
15763
15764 2008-11-05 Craig Silverstein <csilvers@google.com>
15765
15766 * options.cc (General_options::parse_dynamic_list): New function.
15767 * options.h (General_options): New flags dynamic_list,
15768 dynamic_list_data, dynamic_list_cpp_new, and
15769 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15770 (General_options::in_dynamic_list): New function.
15771 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15772 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15773 (Lex::can_continue_name): Likewise.
15774 (yylex): Likewise.
15775 (read_script_file): New parameter script_options.
15776 (read_dynamic_list): New function.
15777 (Script_options::define_dynamic_list): New function.
15778 (dynamic_list_keyword_parsecodes): New variable.
15779 (dynamic_list_keywords): New variable.
15780 * script.h (Script_options::define_dynamic_list): New function
15781 prototype.
15782 (read_dynamic_list): New function prototype.
15783 * symtab.cc (strprefix): New macro.
15784 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15785 dynamic_list_data, dynamic_list_cpp_new, and
15786 dynamic_list_cpp_typeinfo.
15787 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15788 (dynamic_list_expr): New rule.
15789 (dynamic_list_nodes): Likewise.
15790 (dynamic_list_node): Likewise.
15791 * testsuite/Makefile.am (dynamic_list): New test.
15792 * testsuite/Makefile.in: Regenerated.
15793 * testsuite/dynamic_list.t: New file.
15794 * testsuite/dynamic_list.sh: New file.
15795
15796 2008-11-05 Craig Silverstein <csilvers@google.com>
15797
15798 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15799 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15800 (t11_last): Likewise.
15801 * testsuite/ver_test_6.c (main): Likewise.
15802
15803 2008-10-07 Cary Coutant <ccoutant@google.com>
15804
15805 * options.c (General_options::finalize): Add check for -static and
15806 -shared.
15807 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15808 is not empty.
15809
15810 2008-10-02 Cary Coutant <ccoutant@google.com>
15811
15812 * plugin.cc (make_sized_plugin_object): Fix conditional
15813 compilation to work when not all targets are enabled.
15814
15815 2008-09-29 Cary Coutant <ccoutant@google.com>
15816
15817 * archive.cc (Archive::get_file_and_offset): Use filename instead
15818 of name to get library path.
15819 (Archive::include_member): Unlock external member of a thin archive.
15820
15821 * testsuite/Makefile.am (TEST_AR): New variable.
15822 (thin_archive_test_1): New test.
15823 (thin_archive_test_2): New test.
15824 * testsuite/Makefile.in: Regenerate.
15825 * testsuite/thin_archive_main.cc: New file.
15826 * testsuite/thin_archive_test_1.cc: New file.
15827 * testsuite/thin_archive_test_2.cc: New file.
15828 * testsuite/thin_archive_test_3.cc: New file.
15829 * testsuite/thin_archive_test_4.cc: New file.
15830
15831 2008-09-29 Cary Coutant <ccoutant@google.com>
15832
15833 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15834 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15835 instead of -1U.
15836 (Sized_relobj::do_finalize_local_symbols): Likewise.
15837 (Sized_relobj::map_to_kept_section): Likewise.
15838 * object.h (Sized_relobj::invalid_address): New constant.
15839 (Sized_relobj::do_output_section_offset): Check for invalid_address
15840 and return -1ULL.
15841 * output.cc (Output_reloc::local_section_offset): Use constant
15842 invalid_address instead of -1U.
15843 (Output_reloc::get_address): Likewise.
15844 (Output_section::output_address): Change -1U to -1ULL.
15845 * output.h (Output_reloc::invalid_address): New constant.
15846 * reloc.cc (Sized_relobj::write_sections): Use constant
15847 invalid_address instead of -1U.
15848 (Sized_relobj::relocate_sections): Likewise.
15849 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15850 values for merge sections.
15851 * target-reloc.h (relocate_for_relocatable): Use constant
15852 invalid_address instead of -1U.
15853
15854 2008-09-19 Cary Coutant <ccoutant@google.com>
15855
15856 Add plugin functionality for link-time optimization (LTO).
15857 * configure.ac (plugins): Add --enable-plugins option.
15858 * configure: Regenerate.
15859 * config.in: Regenerate.
15860 * Makefile.am (LIBDL): New variable.
15861 (CCFILES): Add plugin.cc.
15862 (HFILES): Add plugin.h.
15863 (ldadd_var): Add LIBDL.
15864 * Makefile.in: Regenerate.
15865
15866 * archive.cc: Include "plugin.h".
15867 (Archive::setup): Don't preread archive symbols when using a plugin.
15868 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15869 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15870 files.
15871 (Archive::include_member): Add symbols from plugin objects.
15872 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15873 * descriptors.cc (Descriptors::open): Check for file descriptors
15874 abandoned by plugins.
15875 (Descriptors::claim_for_plugin): New function.
15876 * descriptors.h (Descriptors::claim_for_plugin): New function.
15877 (Open_descriptor::is_claimed): New field.
15878 (claim_descriptor_for_plugin): New function.
15879 * fileread.cc (File_read::claim_for_plugin): New function.
15880 * fileread.h (File_read::claim_for_plugin): New function.
15881 (File_read::descriptor): New function.
15882 * gold.cc: Include "plugin.h".
15883 (queue_initial_tasks): Add task to call plugin hooks for generating
15884 new object files.
15885 * main.cc: Include "plugin.h".
15886 (main): Load plugin libraries.
15887 * object.h (Pluginobj): Declare.
15888 (Object::pluginobj): New function.
15889 (Object::do_pluginobj): New function.
15890 (Object::set_target): New function.
15891 * options.cc: Include "plugin.h".
15892 (General_options::parse_plugin): New function.
15893 (General_options::General_options): Initialize plugins_ field.
15894 (General_options::add_plugin): New function.
15895 * options.h (Plugin_manager): Declare.
15896 (General_options): Add --plugin option.
15897 (General_options::has_plugins): New function.
15898 (General_options::plugins): New function.
15899 (General_options::add_plugin): New function.
15900 (General_options::plugins_): New field.
15901 * plugin.cc: New file.
15902 * plugin.h: New file.
15903 * readsyms.cc: Include "plugin.h".
15904 (Read_symbols::do_read_symbols): Check for archive before checking
15905 for ELF file. Call plugin hooks to claim files.
15906 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15907 from a real object file; force override when processing replacement
15908 files.
15909 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15910 (Symbol::init_base_object): Likewise.
15911 (Symbol::init_base_output_data): Likewise.
15912 (Symbol::init_base_output_segment): Likewise.
15913 (Symbol::init_base_constant): Likewise.
15914 (Symbol::init_base_undefined): Likewise.
15915 (Symbol::output_section): Assert that object is not a plugin.
15916 (Symbol_table::add_from_pluginobj): New function.
15917 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15918 undefined.
15919 (Symbol_table::sized_write_globals): Likewise.
15920 (Symbol_table::add_from_pluginobj): Instantiate template.
15921 * symtab.h (Sized_pluginobj): Declare.
15922 (Symbol::in_real_elf): New function.
15923 (Symbol::set_in_real_elf): New function.
15924 (Symbol::in_real_elf_): New field.
15925 (Symbol_table::add_from_pluginobj): New function.
15926
15927 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15928 (LIBDL): New variable.
15929 (LDADD): Add LIBDL.
15930 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15931 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15932 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15933 (MOSTLYCLEANFILES): Likewise.
15934 * testsuite/Makefile.in: Regenerate.
15935 * testsuite/plugin_test.c: New file.
15936 * testsuite/plugin_test_1.sh: New file.
15937 * testsuite/plugin_test_2.sh: New file.
15938
15939 2008-09-16 Ian Lance Taylor <iant@google.com>
15940
15941 * target-reloc.h (relocate_section): Check whether a symbol is
15942 defined by the ABI before reporting an undefined symbol error.
15943 * target.h (Target::is_defined_by_abi): Make parameter const.
15944 (Target::do_is_defined_by_abi): Likewise.
15945 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15946 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15947 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15948 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15949 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15950 * testsuite/Makefile.in: Rebuild.
15951
15952 * fileread.cc (make_view): Add casts to avoid warning.
15953
15954 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15955
15956 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15957 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15958
15959 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15960
15961 * options.h (General_options::output_is_executable): New.
15962 (General_options::output_is_pie): New.
15963 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15964 for shared libraries.
15965 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15966
15967 2008-09-11 Chris Demetriou <cgd@google.com>
15968
15969 * options.h (origin): New -z option.
15970 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15971 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15972 in DT_FLAGS_1.
15973
15974 2008-09-05 Cary Coutant <ccoutant@google.com>
15975
15976 * fileread.cc (File_read::make_view): Add check for attempt to map
15977 beyond end of file.
15978
15979 2008-09-05 Cary Coutant <ccoutant@google.com>
15980
15981 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15982 explicit instantiations.
15983
15984 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15985
15986 PR gold/6858
15987 * options.cc (General_options::finalize): Allow undefined symbols
15988 in shlibs if linking -shared.
15989
15990 PR gold/6859
15991 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15992 symbols as not needing a dynsym entry.
15993
15994 2008-08-20 Craig Silverstein <csilvers@google.com>
15995
15996 * fileread.cc (File_read::open): Do not lock the file unless it
15997 was successfully opened.
15998
15999 2008-08-14 Cary Coutant <ccoutant@google.com>
16000
16001 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16002 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16003 * testsuite/tls_test.cc (struct int128): 128-bit struct
16004 for testing TLS relocs with non-zero addend.
16005 (v12): New TLS variable.
16006 (t12): New test.
16007 (t_last): Add check for v12.
16008 * testsuite/tls_test.h (t12): New function.
16009 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16010
16011 2008-08-13 Ian Lance Taylor <iant@google.com>
16012
16013 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16014 set tls_segment_ or relro_segment_.
16015 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16016 when appropriate.
16017 * output.h (Output_section::clear_is_relro): New function.
16018 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16019 sections specially even when output_data_ is empty.
16020 (Output_segment::maximum_alignment): When first section is relro,
16021 only force alignment for PT_LOAD segments.
16022 * script.cc (script_data_segment_align): New function.
16023 (script_data_segment_relro_end): New function.
16024 * script-c.h (script_data_segment_align): Declare.
16025 (script_data_segment_relro_end): Declare.
16026 * script-sections.h (class Script_sections): Declare
16027 data_segment_align and data_segment_relro_end. Add fields
16028 segment_align_index_ and saw_relro_end_.
16029 * script-sections.cc (class Sections_element): Add set_is_relro
16030 virtual function. Add new bool* parameter to place_orphan_here.
16031 Add get_output_section virtual function.
16032 (class Output_section_definition): Add set_is_relro. Add new
16033 bool* parameter to place_orphan_here. Add get_output_section.
16034 Add is_relro_ field.
16035 (Output_section_definition::Output_section_definition): Initialize
16036 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16037 and is_relro_ fields.
16038 (Output_section_definition::place_orphan_here): Add is_relro
16039 parameter.
16040 (Output_section_definition::set_section_addresses): Set relro for
16041 output section.
16042 (Output_section_definition::alternate_constraint): Likewise.
16043 (class Orphan_output_section): Add new bool* parameter to
16044 place_orphan_here. Add get_output_section.
16045 (Orphan_output_section::place_orphan_here): Add is_relro
16046 parameter.
16047 (Script_sections::Script_sections): Initialize
16048 data_segment_align_index_ and saw_relro_end_.
16049 (Script_sections::data_segment_align): New function.
16050 (Script_sections::data_segment_relro_end): New function.
16051 (Script_sections::place_orphan): Set or clear is_relro.
16052 (Script_sections::set_section_addresses): Force alignment of first
16053 TLS section.
16054 * yyscript.y (exp): Call script_data_segment_align and
16055 script_data_segment_relro_end.
16056 * testsuite/relro_script_test.t: New file.
16057 * testsuite/relro_test.cc (using_script): Declare.
16058 (t1, t2): Test using_script.
16059 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16060 (relro_script_test_SOURCES): Define.
16061 (relro_script_test_DEPENDENCIES): Define.
16062 (relro_script_test_LDFLAGS): Define.
16063 (relro_script_test_LDADD): Define.
16064 (relro_script_test.so): New target.
16065 * testsuite/Makefile.in: Rebuild.
16066
16067 2008-08-06 Cary Coutant <ccoutant@google.com>
16068
16069 * archive.cc (Archive::total_archives, Archive::total_members)
16070 (Archive::total_members_loaded): New variables.
16071 (Archive::setup): Add parameter. Add option to preread
16072 archive symbols.
16073 (Archive::read_armap): Add counter.
16074 (Archive::get_file_and_offset): New function.
16075 (Archive::get_elf_object_for_member): New function.
16076 (Archive::read_all_symbols): New function.
16077 (Archive::read_symbols): New function.
16078 (Archive::add_symbols): Add counters.
16079 (Archive::include_all_members): Use armap to find members if it's
16080 already built.
16081 (Archive::include_member): Skip reading symbols if already read.
16082 Factored code into Archive::get_file_and_offset and
16083 Archive::get_elf_object_for_member. Changed call to
16084 Mapfile::report_include_archive_member.
16085 (Archive::print_stats): New function.
16086 * archive.h: Declare Object and Read_symbols_data classes.
16087 (Archive::Archive): Add initializers for new members.
16088 (Archive::setup): Add parameter.
16089 (Archive::print_stats): New function.
16090 (Archive::total_archives, Archive::total_members)
16091 (Archive::total_members_loaded): New variables.
16092 (Archive::get_file_and_offset): New function.
16093 (Archive::get_elf_object_for_member): New function.
16094 (Archive::read_all_symbols): New function.
16095 (Archive::read_symbols): New function.
16096 (Archive::Archive_member): New class.
16097 (Archive::members_): New member.
16098 (Archive::num_members_): New member.
16099 * main.cc: Include archive.h.
16100 (main): Call Archive::print_stats.
16101 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16102 archive parameter; member_name is now the fully-decorated name.
16103 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16104 * options.h: (General_options): Add --preread-archive-symbols option.
16105 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16106 Archive::setup.
16107
16108 2008-08-04 Ian Lance Taylor <iant@google.com>
16109
16110 * symtab.h (Symbol::use_plt_offset): New function.
16111 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16112 * powerpc.cc (Relocate::relocate): Likewise.
16113 * sparc.cc (Relocate::relocate): Likewise.
16114 * x86_64.cc (Relocate::relocate): Likewise.
16115 * testsuite/weak_plt.sh: New test.
16116 * testsuite/weak_plt_main.cc: New test.
16117 * testsuite/weak_plt_shared.cc: New test.
16118 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16119 (check_PROGRAMS): Add weak_plt.
16120 (check_DATA): Add weak_plt_shared.so.
16121 (weak_plt_main_pic.o, weak_plt): New targets.
16122 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16123 * testsuite/Makefile.in: Rebuild.
16124
16125 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16126 gcctestdir/ld.
16127 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16128 * testsuite/Makefile.in: Rebuild.
16129
16130 2008-08-04 Alan Modra <amodra@bigpond.net.au>
16131
16132 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16133 * Makefile.in: Regenerate.
16134 * po/POTFILES.in: Regenerate.
16135
16136 2008-07-29 Ian Lance Taylor <iant@google.com>
16137
16138 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16139 symbols before other symbols.
16140 * testsuite/script_test_2.cc (test_addr): Declare.
16141 (test_addr_alias): Declare.
16142 (main): Check that test_addr and test_addr_alias have the right
16143 values.
16144 * testsuite/script_test_2.t: Define test_addr_alias and
16145 test_addr.
16146
16147 2008-07-24 Ian Lance Taylor <iant@google.com>
16148
16149 PR 5990
16150 * descriptors.cc: New file.
16151 * descriptors.h: New file.
16152 * gold-threads.h (class Hold_optional_lock): New class.
16153 * fileread.cc: Include "descriptors.h".
16154 (File_read::~File_read): Release descriptor rather than closing
16155 it.
16156 (File_read::open) [file]: Call open_descriptor rather than open.
16157 Set is_descriptor_opened_.
16158 (File_read::open) [memory]: Assert that descriptor is not open.
16159 (File_read::reopen_descriptor): New function.
16160 (File_read::release): Release descriptor.
16161 (File_read::do_read): Make non-const. Reopen descriptor.
16162 (File_read::read): Make non-const.
16163 (File_read::make_view): Reopen descriptor.
16164 (File_read::do_readv): Likewise.
16165 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16166 Update declarations.
16167 * layout.cc: Include "descriptors.h".
16168 (Layout::create_build_id): Use open_descriptor rather than open.
16169 * output.cc: Include "descriptors.h".
16170 (Output_file::open): Use open_descriptor rather than open.
16171 * archive.cc (Archive::const_iterator): Change Archive to be
16172 non-const.
16173 (Archive::begin, Archive::end): Make non-const.
16174 (Archive::count_members): Likewise.
16175 * archive.h (class Archive): Update declarations.
16176 * object.h (Object::read): Make non-const.
16177 * Makefile.am (CCFILES): Add descriptors.cc.
16178 (HFILES): Add descriptors.h.
16179 * Makefile.in: Rebuild.
16180
16181 PR 6716
16182 * gold.h: Always include <clocale>. Add Solaris workarounds
16183 following code in binutils/sysdep.h.
16184
16185 PR 6048
16186 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16187 this->eh_frame_hdr_ is NULL before using it.
16188
16189 * dynobj.cc (Versions::Versions): Update comment.
16190
16191 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16192 the base version name.
16193
16194 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16195 array size plus one.
16196 (Stringpool_template::set_string_offsets): Subtract one from key
16197 before using it as an array index.
16198 (Stringpool_template::get_offset_with_length): Likewise.
16199 (Stringpool_template::write_to_buffer): Likewise.
16200 * stringpool.h (Stringpool_template::get_offset_from_key):
16201 Likewise.
16202
16203 2008-07-23 Ian Lance Taylor <iant@google.com>
16204
16205 PR 6658
16206 * object.h (Merged_symbol_value::value): Do our best to handle a
16207 negative addend.
16208
16209 PR 6647
16210 * script.cc (Version_script_info::get_versions): Don't add empty
16211 version tag to return value.
16212 (Version_script_info::get_symbol_version_helper): Change return
16213 type to bool. Add pversion parameter. Change all callers.
16214 (script_register_vers_node): Don't require a non-NULL tag.
16215 * script.h (class Version_script_info): Update declarations.
16216 (Version_script_info::get_symbol_version): Change return type to
16217 bool. Add version parameter. Change all callers.
16218 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16219 handling. Handle an empty version from a version script.
16220 (Symbol_table::define_special_symbol): Likewise.
16221 * testsuite/ver_test_10.script: New file.
16222 * testsuite/ver_test_10.sh: New file.
16223 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16224 (check_DATA): Add ver_test_10.syms.
16225 (ver_test_10.syms, ver_test_10.so): New target.
16226 * testsuite/Makefile.in: Rebuild.
16227
16228 2008-07-23 Simon Baldwin <simonb@google.com>
16229
16230 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16231 to zero for undefined symbols from dynamic libraries.
16232
16233 2008-07-23 Ian Lance Taylor <iant@google.com>
16234
16235 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16236 Change all callers.
16237 * symtab.h (class Symbol_table): Update declaration.
16238 * testsuite/ver_test_9.cc: New file.
16239 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16240 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16241 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16242 (ver_test_9.so, ver_test_9.o): New targets.
16243 * testsuite/Makefile.in: Rebuild.
16244
16245 2008-07-22 Ian Lance Taylor <iant@google.com>
16246
16247 * options.h (class General_options): Define --check-sections.
16248 * layout.cc (Layout::set_segment_offsets): Handle
16249 --check-sections.
16250
16251 * options.h (class General_options): Define -n/--nmagic and
16252 -N/--omagic.
16253 * options.cc (General_options::finalize): For -n/--nmagic or
16254 -N/--omagic, set -static.
16255 * layout.cc (Layout::attach_allocated_section_to_segment): If
16256 -N/--omagic, don't put read-only and read-write sections in
16257 different segments.
16258 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16259 finding a read-only segment.
16260 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16261 don't set the minimum segment alignment to the common page size,
16262 and don't set the file offset to the address modulo the page size.
16263 * script-sections.cc (Script_sections::create_segments): If
16264 -n/--omagic, don't put read-only and read-write sections in
16265 different segments.
16266
16267 * cref.cc: New file.
16268 * cref.h: New file.
16269 * options.h (class General_options): Add --print-symbol-counts.
16270 * main.cc (main): Issue defined symbol report if requested.
16271 * archive.cc (Archive::interpret_header): Make into a const member
16272 function.
16273 (Archive::add_symbols): Call Input_objects::archive_start and
16274 archive_stop.
16275 (Archive::const_iterator): Define new class.
16276 (Archive::begin, Archive::end): New functions.
16277 (Archive::include_all_members): Rewrite to use iterator.
16278 (Archive::count_members): New function.
16279 * archive.h (class Archive): Update declarations.
16280 (Archive::filename): New function.
16281 * object.cc: Include "cref.h".
16282 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16283 (Sized_relobj::do_get_global_symbol_counts): New function.
16284 (Input_objects::add_object): Add object to cross-referencer.
16285 (Input_objects::archive_start): New function.
16286 (Input_objects::archive_stop): New function.
16287 (Input_objects::print_symbol_counts): New function.
16288 * object.h: Declare Cref and Archive.
16289 (Object::get_global_symbol_counts): New function.
16290 (Object::do_get_global_symbol_counts): New pure virtual function.
16291 (class Sized_relobj): Add defined_count_ field. Update
16292 declarations.
16293 (class Input_objects): Add cref_ field. Update constructor.
16294 Update declarations.
16295 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16296 defined_count_.
16297 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16298 symbol counts.
16299 (Sized_dynobj::do_get_global_symbol_counts): New function.
16300 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16301 defined_count_. Update declarations. Define Symbols typedef.
16302 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16303 parameter. Change all callers.
16304 (Symbol_table::add_from_dynobj): Add sympointers and defined
16305 parameters. Change all callers.
16306 * symtab.h (class Symbol_table): Update declarations.
16307 * Makefile.am (CCFILES): Add cref.cc.
16308 (HFILES): Add cref.h.
16309 * Makefile.in: Rebuild.
16310
16311 2008-07-22 Simon Baldwin <simonb@google.com>
16312
16313 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16314 to zero when writing undefined symbols.
16315
16316 2008-07-22 Ian Lance Taylor <iant@google.com>
16317
16318 * output.cc (Output_section::add_input_section): Don't try to
16319 merge empty merge sections.
16320
16321 2008-07-21 Craig Silverstein <csilvers@google.com>
16322
16323 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16324 Include symbol version in error message.
16325
16326 2008-07-20 Chris Demetriou <cgd@google.com>
16327
16328 * configure.ac (gold_cv_c_random_seed): New configured variable.
16329 (RANDOM_SEED_CFLAGS): New substituted variable.
16330 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16331 * configure: Rebuild.
16332 * Makefile.in: Likewise.
16333 * testsuite/Makefile.in: Likewise.
16334
16335 2008-07-18 Ian Lance Taylor <iant@google.com>
16336
16337 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16338 where we see NAME/NULL and NAME/VERSION as separate symbols.
16339 * testsuite/ver_test_main.cc (main): Call t4.
16340 (t4, t4_2a): Define.
16341 * testsuite/ver_test_2.cc (t4_2): Define.
16342 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16343 * testsuite/ver_test_4.cc (t4_2a): Define.
16344 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16345 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16346
16347 2008-07-17 Ian Lance Taylor <iant@google.com>
16348
16349 * dynobj.cc (Versions::add_def): If we give an error about a
16350 missing version, go ahead and create the version anyhow.
16351
16352 2008-07-10 Ian Lance Taylor <iant@google.com>
16353
16354 Handle output sections with more than 0x7fffffff bytes.
16355 * object.h (class Relobj): Change map_to_output_ to
16356 output_sections_, and just keep a section pointer. Change all
16357 uses. Move comdat group support to Sized_relobj.
16358 (Relobj::is_section_specially_mapped): Remove.
16359 (Relobj::output_section): Remove poff parameter. Change all
16360 callers.
16361 (Relobj::output_section_offset): New function.
16362 (Relobj::set_section_offset): Rewrite.
16363 (Relobj::map_to_output): Remove.
16364 (Relobj::output_sections): New function.
16365 (Relobj::do_output_section_offset): New pure virtual function.
16366 (Relobj::do_set_section_offset): Likewise.
16367 (class Sized_relobj): Add section_offsets_ field. Add comdat
16368 group support from Relobj. Update declarations.
16369 (Sized_relobj::get_output_section_offset): New function.
16370 (Sized_relobj::do_output_section_offset): New function.
16371 (Sized_relobj::do_set_section_offset): New function.
16372 * object.cc (Relobj::output_section_address): Remove.
16373 (Sized_relobj::Sized_relobj): Initialize new fields.
16374 (Sized_relobj::include_section_group): Cast find_kept_object to
16375 Sized_relobj.
16376 (Sized_relobj::include_linkonce_section): Likewise.
16377 (Sized_relobj::do_layout): Use separate arrays for output section
16378 and output offset.
16379 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16380 output_sections.
16381 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16382 output_sections and section_offsets.
16383 (Sized_relobj::write_local_symbols): Likewise.
16384 (map_to_kept_section): Compute output address directly.
16385 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16386 output_sections and section_offsets.
16387 (Sized_relobj::write_sections): Likewise.
16388 (Sized_relobj::relocate_sections): Likewise.
16389 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16390 * output.h (class Output_reloc): Update declarations. Change
16391 u2_.relobj to Sized_relobj*.
16392 (class Output_data_reloc): Change add functions to use
16393 Sized_relobj*.
16394 * output.cc (Output_reloc::Output_reloc): Change relobj to
16395 Sized_relobj*.
16396 (Output_reloc::local_section_offset): Change return type to
16397 Elf_Addr. Use get_output_section_offset.
16398 (Output_reloc::get_address): Likewise.
16399 (Output_section::is_input_address_mapped): Don't call
16400 is_section_specially_mapped.
16401 (Output_section::output_offset): Likewise.
16402 (Output_section::output_address): Likewise.
16403 (Output_section::starting_output_address): Likewise.
16404 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16405 parameter to Sized_relobj*.
16406 (Copy_relocs::need_copy_reloc): Likewise.
16407 (Copy_relocs::save): Likewise.
16408 * copy-relocs.h (class Copy_relocs): Update declarations.
16409 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16410 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16411 * target-reloc.h (relocate_for_relocatable): Change
16412 offset_in_output_section type to Elf_Addr. Change code that uses
16413 it as well.
16414 * layout.cc (Layout::layout): Always set *off.
16415 * mapfile.cc (Mapfile::print_input_section): Use
16416 output_section_offset.
16417 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16418 Sized_relobj*.
16419 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16420 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16421 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16422
16423 2008-07-03 Ian Lance Taylor <iant@google.com>
16424
16425 * layout.cc (Layout::include_section): Do not discard unrecognized
16426 SHT_STRTAB sections.
16427
16428 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16429
16430 * script.cc (Lex::can_continue_name): Make '?' allowable in
16431 version-script names.
16432 * testsuite/version_script.map: Change glob pattern to use '?'
16433
16434 2008-06-30 Manish Singh <yosh@gimp.org>
16435
16436 PR 6585
16437 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16438 Correct typo.
16439
16440 2008-06-30 Ian Lance Taylor <iant@google.com>
16441
16442 PR 6660
16443 PR 6682
16444 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16445 versions]: Don't try to read the value in the contents, since we
16446 don't use it. Use the template endianness when writing.
16447
16448 2008-06-25 Cary Coutant <ccoutant@google.com>
16449
16450 * fileread.cc (File_read::make_view): Assert on zero-length view.
16451 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16452 symbol table when there are no symbols to read.
16453
16454 2008-06-23 Craig Silverstein <csilvers@google.com>
16455
16456 * version.cc (version_string): Bump to 1.7
16457
16458 2008-06-18 Craig Silverstein <csilvers@google.com>
16459
16460 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16461 constant 0xFFFF to type Valtype.
16462 (Powerpc_relocate_functions::rel16_ha): Likewise.
16463
16464 2008-06-17 Ian Lance Taylor <iant@google.com>
16465
16466 * output.h (Output_section::Input_section): Initialize p2align_ to
16467 zero for Output_section_data constructors.
16468 (Output_section::Input_section::addralign): If not an input
16469 section, return the alignment of the Output_section_data.
16470 * testsuite/copy_test.cc: New file.
16471 * testsuite/copy_test_1.cc: New file.
16472 * testsuite/copy_test_2.cc: New file.
16473 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16474 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16475 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16476 (copy_test_1_pic.o, copy_test_1.so): New targets.
16477 (copy_test_2_pic.o, copy_test_2.so): New targets.
16478 * testsuite/Makefile.in: Rebuild.
16479
16480 * script-sections.cc (Script_sections::place_orphan): Initialize
16481 local variable exact.
16482
16483 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16484
16485 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16486
16487 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16488 David S. Miller <davem@davemloft.net>
16489
16490 * powerpc.cc: New file.
16491 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16492 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16493 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16494 * Makefile.in: Rebuild.
16495
16496 2008-06-09 Ian Lance Taylor <iant@google.com>
16497
16498 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16499 <exception>.
16500 (throwing, orig_terminate): New static variables.
16501 (terminate_handler): New static function.
16502 (t2): Set terminate handler.
16503
16504 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16505
16506 PR 6584
16507 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16508 alignment.
16509
16510 2008-05-30 Cary Coutant <ccoutant@google.com>
16511
16512 * archive.cc (Archive::include_all_members) Correct to step
16513 over symbol table and extended name table in thin archives.
16514
16515 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16516
16517 PR 6407
16518 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16519 calculation.
16520
16521 2008-05-28 Caleb Howe <cshowe@google.com>
16522
16523 * reduced_debug_output.cc: New file.
16524 * reduced_debug_output.h: New file.
16525 * options.h (class General_options): Add --strip-debug-non-line.
16526 * options.cc (General_options::finalize): Add strip_debug_non_line
16527 to the strip heirarchy.
16528 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16529 fields.
16530 * layout.cc: Include "reduced_debug_output.h".
16531 (Layout::Layout): Initialize new fields.
16532 (line_only_debug_sections): New static array.
16533 (is_lines_only_debug_sections): New static inline function.
16534 (Layout::include_section): Handle --strip-debug-non-line.
16535 (Layout::make_output_section): If --strip-debug-non-line, build
16536 new output sections for .debug_abbrev and .debug_info.
16537 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16538 gold. Warn about possible overflow.
16539 (read_signed_LEB_128): Likewise.
16540 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16541 (read_signed_LEB_128): Declare.
16542 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16543 (HFILES): Add reduced_debug_output.h.
16544 * Makefile.in: Rebuild.
16545
16546 2008-05-21 Ian Lance Taylor <iant@google.com>
16547
16548 * mapfile.cc: New file.
16549 * mapfile.h: New file.
16550 * options.h (class General_options): Add -M/--print-map and -Map.
16551 * options.cc (General_options::finalize): Make -M equivalent to
16552 -Map -.
16553 * main.cc: Include <cstdio> and "mapfile.h".
16554 (main): Open mapfile if requested.
16555 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16556 constructor. Change caller.
16557 (queue_initial_tasks): Add mapfile parameter. Change caller.
16558 (queue_middle_tasks): Likewise.
16559 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16560 declarations.
16561 * archive.cc: Include "mapfile.h".
16562 (Archive::add_symbols): Add mapfile parameter. Change all
16563 callers. Pass mapfile, symbol, and reason to include_member.
16564 (Archive::include_all_members): Add mapfile parameter. Change all
16565 callers.
16566 (Archive::include_member): Add mapfile, sym, and why parameters.
16567 Change all callers. Report inclusion to map file.
16568 * archive.h: Include "fileread.h".
16569 (class Archive): Update declarations.
16570 (Archive::file): New const method.
16571 (class Add_archive_symbols): Add mapfile_ field. Update
16572 constructor. Change all callers.
16573 * readsyms.h (class Read_symbols): Likewise.
16574 (class Finish_group): Likewise.
16575 (class Read_script): Likewise.
16576 * common.cc: Include "mapfile.h".
16577 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16578 all callers.
16579 (Symbol_table::do_allocate_commons): Likewise.
16580 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16581 symbol allocation to mapfile.
16582 * common.h (class Allocate_commons_task): Add mapfile_ field.
16583 Update constructor. Change all callers.
16584 * symtab.h (class Symbol_table): Update declarations.
16585 * layout.cc: Include "mapfile.h".
16586 (Layout_task_runner::run): Print information to mapfile.
16587 (Layout::create_gold_note): Change Output_data_fixed_space to
16588 Output_data_zero_fill.
16589 (Layout::create_build_id): Likewise.
16590 (Layout::print_to_mapfile): New function.
16591 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16592 constructor. Change caller.
16593 (class Layout): Declare print_to_mapfile.
16594 * output.cc (Output_section::Input_section::print_to_mapfile): New
16595 function.
16596 (Output_section::add_input_section): If producing a map, always
16597 add to input_sections_ list.
16598 (Output_section::do_print_to_mapfile): New function.
16599 (Output_segment::print_sections_to_mapfile): New function.
16600 (Output_segment::print_section_list_to_mapfile): New function.
16601 * output.h: Include "mapfile.h".
16602 (Output_data::print_to_mapfile): New function.
16603 (Output_data::do_print_to_mapfile): New virtual function.
16604 (Output_segment_headers::do_print_to_mapfile): New function.
16605 (Output_file_header::do_print_to_mapfile): New function.
16606 (Output_data_const::do_print_to_mapfile): New function.
16607 (class Output_data_const_buffer): Add map_name_ field. Update
16608 constructor. Change all callers. Add do_print_to_mapfile
16609 function.
16610 (class Output_data_fixed_space): Likewise.
16611 (class Output_data_space): Likewise.
16612 (class Output_data_zero_fill): New class.
16613 (Output_data_strtab::do_print_to_mapfile): New function.
16614 (Output_data_reloc_base::do_print_to_mapfile): New function.
16615 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16616 (Output_data_group::do_print_to_mapfile): New function.
16617 (Output_data_got::do_print_to_mapfile): New function.
16618 (Output_data_dynamic::do_print_to_mapfile): New function.
16619 (Output_symtab_xindex::do_print_to_mapfile): New function.
16620 (class Output_section): Declare do_print_to_mapflie. Declare
16621 print_to_mapfile in Input_section.
16622 (class Output_segment): Declare new functions.
16623 * object.h (Sized_relobj::symbol_count): New function.
16624 * script-sections.cc
16625 (Output_section_element_dot_assignment::set_section_addresses):
16626 Change Output_data_fixed_space to Output_data_zero_fill.
16627 (Output_data_expression::do_print_to_mapfile): New function.
16628 * script.cc (read_input_script): Add mapfile parameter. Change
16629 all callers.
16630 * script.h (read_input_script): Update declaration.
16631 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16632 (Eh_frame::do_print_to_mapfile): New function.
16633 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16634 (Output_merge_string::do_print_to_mapfile): New function.
16635 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16636 function.
16637 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16638 function.
16639 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16640 function.
16641 * Makefile.am (CCFILES): Add mapfile.cc.
16642 (HFILES): Add mapfile.h.
16643 * Makefile.in: Rebuild.
16644
16645 2008-05-19 Ian Lance Taylor <iant@google.com>
16646
16647 * options.h (class General_options): Add -z relro.
16648 * layout.cc (Layout::Layout): Initialize relro_segment_.
16649 (Layout::add_output_section_data): Return the output section.
16650 (Layout::make_output_section): Rcognize relro sections and mark
16651 them appropriately.
16652 (Layout::attach_allocated_section_to_segment): Put relro sections
16653 in a PT_GNU_RELRO segment.
16654 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16655 section as relro.
16656 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16657 PT_TLS segments.
16658 (Layout::linkonce_mapping): Map d.rel.ro.local to
16659 .data.rel.ro.local.
16660 (Layout::output_section_name): Us .data.rel.ro.local for any
16661 section which begins with that.
16662 * layout.h (class Layout): Update add_output_section_data
16663 declaration. Add relro_segment_ field.
16664 * output.cc (Output_section::Output_section): Initialize is_relro_
16665 and is_relro_local_ fields.
16666 (Output_segment::add_output_section): Group relro sections.
16667 (Output_segment::is_first_section_relro): New function.
16668 (Output_segment::maximum_alignment): If there is a relro section,
16669 align the segment to the common page size.
16670 (Output_segment::set_section_addresses): Track whether we are
16671 looking at relro sections. If the last section is a relro
16672 section, align to the common page size.
16673 (Output_segment::set_section_list_addresses): Add in_relro
16674 parameter. Change all callers. Align to the page size when
16675 moving from relro to non-relro section.
16676 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16677 segment.
16678 * output.h (class Output_section): Add is_relro_ and
16679 is_relro_local_ fields.
16680 (Output_section::is_relro): New function.
16681 (Output_section::set_is_relro): New function.
16682 (Output_section::is_relro_local): New function.
16683 (Output_section::set_is_relro_local): New function.
16684 (class Output_segment): Update declarations.
16685 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16686 * sparc.cc (Target_sparc::got_section): Likewise.
16687 * x86_64.cc (Target_x86_64::got_section): Likewise.
16688 * testsuite/relro_test_main.cc: New file.
16689 * testsuite/relro_test.cc: New file.
16690 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16691 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16692 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16693 (relro_test.so, relro_test_pic.o): New targets.
16694 * testsuite/Makefile.in: Rebuild.
16695
16696 2008-05-16 Ian Lance Taylor <iant@google.com>
16697
16698 * output.cc (Output_segment::add_output_section): Remove front
16699 parameter.
16700 * output.h (class Output_segment): Remove
16701 add_initial_output_section and overloaded add_output_section.
16702 Update declaration of remaining add_output_section.
16703 * layout.cc (Layout::create_interp): Call add_output_section
16704 rather than add_initial_output_section.
16705 (Layout::finish_dynamic_section): Likewise.
16706
16707 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16708 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16709 know the dynamic type.
16710 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16711 field. Initialize it in constructor.
16712 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16713 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16714 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16715 reloc.
16716
16717 * output.cc (Output_reloc::get_address): Change return type to
16718 Elf_Addr.
16719 * output.h (class Output_reloc): Update get_address declaration.
16720 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16721 for section addresses.
16722
16723 2008-05-09 Ian Lance Taylor <iant@google.com>
16724
16725 PR 6493
16726 * gold.cc (gold_nomem): Use return value of write.
16727
16728 2008-05-08 Ian Lance Taylor <iant@google.com>
16729
16730 * symtab.c (Symbol::init_base_output_data): Add version
16731 parameter. Change all callers.
16732 (Symbol::init_base_output_segment): Likewise.
16733 (Symbol::init_base_constant): Likewise.
16734 (Symbol::init_base_undefined): Likewise.
16735 (Sized_symbol::init_output_data): Likewise.
16736 (Sized_symbol::init_output_segment): Likewise.
16737 (Sized_symbol::init_constant): Likewise.
16738 (Sized_symbol::init_undefined): Likewise.
16739 (Symbol_table::do_define_in_output_data): If the new symbol has a
16740 version, mark it as the default.
16741 (Symbol_table::do_define_in_output_segment): Likewise.
16742 (Symbol_table::do_define_as_constant): Likewise.
16743 * symtab.h (class Symbol): Update declarations.
16744 (class Sized_symbol): Likewise.
16745 * resolve.cc (Symbol::override_version): New function.
16746 (Symbol::override_base): Call override_version.
16747 (Symbol::override_base_with_special): Likewise.
16748 * testsuite/ver_script_8.script: New file.
16749 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16750 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16751 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16752 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16753
16754 2008-05-06 Ian Lance Taylor <iant@google.com>
16755
16756 PR 6049
16757 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16758 functions.
16759 (class General_options): Remove existing --undefined, and add
16760 --no-undefined instead. Add new --undefined as synonym for -u.
16761 * archive.cc (Archive::add_symbols): Check whether symbol was
16762 named with -u.
16763 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16764 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16765 all uses. Add IS_UNDEFINED. Update declarations to split
16766 different versions of init_base. Declare init_base_undefined.
16767 (Symbol::is_defined): Handle IS_UNDEFINED.
16768 (Symbol::is_undefined): Likewise.
16769 (Symbol::is_weak_undefined): Call is_undefined.
16770 (Symbol::is_absolute): Handle IS_CONSTANT.
16771 (class Sized_symbol): Update declarations to split different
16772 versions of init. Declare init_undefined.
16773 (class Symbol_table): Declare new functions.
16774 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16775 Change all callers.
16776 (Symbol::init_base_output_data): Likewise.
16777 (Symbol::init_base_output_segment): Likewise.
16778 (Symbol::init_base_constant): Likewise.
16779 (Symbol::init_base_undefined): New function.
16780 (Sized_symbol::init_object): Rename from init. Change all
16781 callers.
16782 (Sized_symbol::init_output_data): Likewise.
16783 (Sized_symbol::init_output_segment): Likewise.
16784 (Sized_symbol::init_constant): Likewise.
16785 (Sized_symbol::init_undefined): New function.
16786 (Symbol_table::add_undefined_symbols_from_command_line): New
16787 function.
16788 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16789 function.
16790 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16791 (Symbol::output_section): Likewise.
16792 (Symbol::set_output_section): Likewise.
16793 (Symbol_table::sized_finalize_symbol): Likewise.
16794 (Symbol_table::sized_write_globals): Likewise.
16795 * resolve.cc (Symbol_table::should_override): Likewise.
16796 (Symbol::override_base_with_special): Likewise.
16797
16798 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16799 symbol, change it to have default visibility.
16800 * testsuite/protected_1.cc: New file.
16801 * testsuite/protected_2.cc: New file.
16802 * testsuite/protected_3.cc: New file.
16803 * testsuite/protected_main_1.cc: New file.
16804 * testsuite/protected_main_2.cc: New file.
16805 * testsuite/protected_main_3.cc: New file.
16806 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16807 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16808 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16809 (protected_1.so): New target.
16810 (protected_1_pic.o, protected_2_pic.o): New targets.
16811 (protected_3_pic.o): New target.
16812 (check_PROGRAMS): Add protected_2.
16813 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16814 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16815 * testsuite/Makefile.in: Rebuild.
16816
16817 * options.h (DEFINE_var): Add set_user_set_##varname__.
16818 (DEFINE_bool_alias): New macro.
16819 (class General_options): Define -Bstatic using DEFINE_bool_alias
16820 rather than DEFINE_special. Add --undefined as an alias for -z
16821 defs.
16822 * options.cc (General_options::parse_Bstatic): Remove.
16823
16824 * options.h (class General_options): Add --fatal-warnings.
16825 * main.cc (main): Implement --fatal-warnings.
16826 * errors.h (Errors::warning_count): New function.
16827
16828 * options.h (class General_options): Add -Bsymbolic-functions.
16829 * symtab.h (Symbol::is_preemptible): Check for
16830 -Bsymbolic-functions.
16831
16832 2008-05-05 Ian Lance Taylor <iant@google.com>
16833
16834 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16835 as noVARNAME rather than no-VARNAME.
16836 (class General_options): Add option -z combreloc.
16837 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16838 get_address.
16839 (Output_reloc::sort_before) [SHT_REL]: New function.
16840 (Output_reloc::sort_before) [SHT_RELA]: New function.
16841 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16842 Sort_relocs_comparison.
16843 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16844 parameter. Change all callers.
16845 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16846 sort_relocs parameter. Change all callers.
16847 * output.cc (Output_reloc::get_address): New function, broken out
16848 of write_rel.
16849 (Output_reloc::write_rel): Call it.
16850 (Output_reloc::compare): New function.
16851 (Output_data_reloc_base::do_write): Optionally sort relocs.
16852
16853 * configure.ac: If targ_extra_obj is set, link it in.
16854 * configure.tgt: Initialize all variables.
16855 (x86_64*): Set targ_extra_obj and targ_extra_size.
16856 * configure: Rebuild.
16857
16858 * object.cc (Sized_relobj::include_section_group): Adjust section
16859 indexes read from group data. Build vector to pass to
16860 layout_group.
16861 * layout.cc (Layout::layout_group): Add flags and shndxes
16862 parameters. Remove contents parameter. Change caller. Update
16863 explicit instantiations.
16864 * layout.h (class Layout): Update layout_group declaration.
16865 * output.cc (Output_data_group::Output_data_group): Add flags and
16866 input_shndxes parameters. Remove contents parameter. Change
16867 caller.
16868 (Output_data_group::do_write): Change input_sections_ to
16869 input_shndxes_.
16870 * output.h (class Output_data_group): Update constructor
16871 declaration. Rename input_sections_ to input_shndxes_.
16872 * testsuite/many_sections_test.cc: Add template.
16873
16874 2008-04-30 Cary Coutant <ccoutant@google.com>
16875
16876 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16877
16878 * layout.cc (Layout::include_section): Refactored check for debug
16879 info section.
16880 (Layout::add_comdat): Add new parameters. Change type
16881 of signature parameter. Add object and shndx to signatures table.
16882 (Layout::find_kept_object): New function.
16883 * layout.h: Include <cstring>.
16884 (Layout::is_debug_info_section): New function.
16885 (Layout::add_comdat): Add new parameters.
16886 (Layout::find_kept_object): New function.
16887 (Layout::Kept_section): New struct.
16888 (Layout::Signatures): Change type of map range.
16889 * object.cc (Relobj::output_section_address): New function.
16890 (Sized_relobj::include_section_group): Add new parameters. Change
16891 calls to Layout::add_comdat. Change to build table of kept comdat
16892 groups and table mapping discarded sections to kept sections.
16893 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16894 (Sized_relobj::do_layout): Change calls to include_section_group and
16895 include_linkonce_section.
16896 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16897 value to zero when section is discarded.
16898 (Sized_relobj::map_to_kept_section): New function.
16899 * object.h (Relobj::output_section_address): New function.
16900 (Relobj::Comdat_group): New type.
16901 (Relobj::find_comdat_group): New function.
16902 (Relobj::Comdat_group_table): New type.
16903 (Relobj::Kept_comdat_section): New type.
16904 (Relobj::Kept_comdat_section_table): New type.
16905 (Relobj::add_comdat_group): New function.
16906 (Relobj::set_kept_comdat_section): New function.
16907 (Relobj::get_kept_comdat_section): New function.
16908 (Relobj::comdat_groups_): New field.
16909 (Relobj::kept_comdat_sections_): New field.
16910 (Symbol_value::input_value): Update comment.
16911 (Sized_relobj::map_to_kept_section) New function.
16912 (Sized_relobj::include_linkonce_section): Add new parameter.
16913 * target-reloc.h (Comdat_behavior): New type.
16914 (get_comdat_behavior): New function.
16915 (relocate_section): Add code to map a discarded section to the
16916 corresponding kept section when applying a relocation.
16917
16918 2008-04-30 Craig Silverstein <csilvers@google.com>
16919
16920 * dwarf_reader.cc (next_generation_count): New static var.
16921 (Addr2line_cache_entry): New struct.
16922 (addr2line_cache): New static var.
16923 (Dwarf_line_info::one_addr2line): Added caching.
16924 (Dwarf_line_info::clear_addr2line_cache): New function.
16925 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16926 cache-size parameter.
16927 (Dwarf_line_info::one_addr2line_cache): New function.
16928 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16929 new cache-size argument to one_addr2line(), and clear cache.
16930
16931 2008-04-28 Cary Coutant <ccoutant@google.com>
16932
16933 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16934 R_386_PC8 relocations.
16935
16936 2008-04-23 Ian Lance Taylor <iant@google.com>
16937
16938 * object.cc (Sized_relobj::include_section_group): Check for
16939 invalid section group.
16940
16941 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16942 header size.
16943
16944 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16945 than read for file header.
16946 * archive.cc (Archive::include_member): Likewise.
16947
16948 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16949
16950 * aclocal.m4: Regenerate.
16951 * configure: Regenerate.
16952
16953 2008-04-19 Ian Lance Taylor <iant@google.com>
16954
16955 * version.cc (version_string): Bump to 1.6.
16956
16957 * testsuite/Makefile.am (many_sections_r_test): New target.
16958 (many_sections_r_test_SOURCES): Remove.
16959 (many_sections_r_test_DEPENDENCIES): Remove.
16960 (many_sections_r_test_LDFLAGS): Remove.
16961 (many_sections_r_test_LDADD): Remove.
16962
16963 * object.cc (Sized_relobj::do_add_symbols): Always pass
16964 local_symbol_count_ to add_from_relobj.
16965
16966 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16967 every thousand variables.
16968 * testsuite/Makefile.in: Rebuild.
16969
16970 * object.cc (Xindex::initialize_symtab_xindex): New function.
16971 (Xindex::read_symtab_xindex): New function.
16972 (Xindex::sym_xindex_to_shndx): New function.
16973 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16974 available.
16975 (Sized_relobj::do_initialize_xindex): New function.
16976 (Sized_relobj::do_read_symbols): Adjust section links.
16977 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16978 parameter. Change all callers.
16979 (Sized_relobj::include_section_group): Adjust section links and
16980 symbol section indexes.
16981 (Sized_relobj::do_layout): Adjust section links.
16982 (Sized_relobj::do_count_local_symbols): Adjust section links and
16983 symbol section indexes.
16984 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16985 ordinary and special symbols.
16986 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16987 dynsym_xindex parameters. Change all callers. Adjust section
16988 links. Use SHN_XINDEX when needed.
16989 (Sized_relobj::get_symbol_location_info): Adjust section links.
16990 Don't get fooled by special symbols.
16991 * object.h (class Xindex): Define.
16992 (class Object): Add xindex_ parameter. Declare virtual functoin
16993 do_initialize_xindex.
16994 (Object::adjust_sym_shndx): New function.
16995 (Object::set_xindex): New protected function.
16996 (class Symbol_value): Add is_ordinary_shndx_ field.
16997 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16998 (Symbol_value::value): Assert ordinary section.
16999 (Symbol_value::initialize_input_to_output_map): Likewise.
17000 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17001 Change all callers.
17002 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17003 all callers.
17004 (class Sized_relobj): Update declarations.
17005 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17006 parameter. Change all callers.
17007 (Sized_relobj::adjust_shndx): New function.
17008 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17009 field.
17010 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17011 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17012 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17013 (Sized_dynobj::read_dynsym_section): Adjust section links.
17014 (Sized_dynobj::read_dynamic): Likewise.
17015 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17016 section links.
17017 (Sized_dynobj::do_initialize_xindex): New function.
17018 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17019 do_initialize_xindex.
17020 (Sized_dynobj::adjust_shndx): New function.
17021 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17022 dynsym_xindex_ fields.
17023 (Layout::finalize): Add a call to set_section_indexes before
17024 creating the symtab sections.
17025 (Layout::set_section_indexes): Don't do anything if the section
17026 already has a section index.
17027 (Layout::create_symtab_sections): Add shnum parameter. Change
17028 caller. Create .symtab_shndx section if needed.
17029 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17030 caller.
17031 (Layout::allocated_output_section_count): New function.
17032 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17033 needed.
17034 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17035 fields. Update declarations.
17036 (Layout::symtab_xindex): New function.
17037 (Layout::dynsym_xindex): New function.
17038 (class Write_symbols_task): Add layout_ field.
17039 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17040 Change caller.
17041 * output.cc (Output_section_headers::Output_section_headers): Add
17042 shstrtab_section parameter. Change all callers.
17043 (Output_section_headers::do_sized_write): Store overflow values
17044 for section count and section string table section index in
17045 section header zero.
17046 (Output_file_header::do_sized_write): Check for overflow of
17047 section count and section string table section index.
17048 (Output_symtab_xindex::do_write): New function.
17049 (Output_symtab_xindex::endian_do_write): New function.
17050 * output.h (class Output_section_headers): Add shstrtab_section_.
17051 Update declarations.
17052 (class Output_symtab_xindex): Define.
17053 (Output_section::has_out_shndx): New function.
17054 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17055 field.
17056 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17057 Change all callers.
17058 (Sized_symbol::init): Likewise.
17059 (Symbol::output_section): Check for ordinary symbol.
17060 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17061 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17062 callers.
17063 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17064 Change all callers. Simplify handling of symbols from sections
17065 not included in the link.
17066 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17067 distinction.
17068 (Weak_alias_sorter::operator()): Assert that symbols are
17069 ordinary.
17070 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17071 distinction.
17072 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17073 parameters. Change all callers.
17074 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17075 symbol distinction. Use SHN_XINDEX when needed.
17076 (Symbol_table::write_section_symbol): Add symtab_xindex
17077 parameter. Change all callers.
17078 (Symbol_table::sized_write_section_symbol): Likewise. Use
17079 SHN_XINDEX when needed.
17080 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17081 declarations.
17082 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17083 (Symbol::is_defined): Check is_ordinary.
17084 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17085 (Symbol::is_absolute, Symbol::is_common): Likewise.
17086 (class Sized_symbol): Update declarations.
17087 (class Symbol_table): Update declarations.
17088 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17089 parameters. Change all callers.
17090 (Sized_symbol::override): Likewise.
17091 (Symbol_table::override): Likewise.
17092 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17093 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17094 is_ordinary, and orig_st_shndx parameters. Change all callers.
17095 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17096 to be in an ordinary section.
17097 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17098 object and is_ordinary parameters. Change all callers.
17099 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17100 Change all callers. Don't add undefined or non-ordinary symbols
17101 to reloc_map_.
17102 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17103 Change all callers.
17104 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17105 declarations.
17106 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17107 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17108 (Sized_relobj::relocate_sections): Likewise.
17109 * target-reloc.h (scan_relocs): Adjust section symbol index.
17110 (scan_relocatable_relocs): Likewise.
17111 * i386.cc (Scan::local): Check for ordinary symbols.
17112 * sparc.cc (Scan::local): Likewise.
17113 * x86_64.cc (Scan::local): Likewise.
17114 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17115 to symbol_section_and_value.
17116 * testsuite/many_sections_test.cc: New file.
17117 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17118 (check_PROGRAMS): Add many_sections_test.
17119 (many_sections_test_SOURCES): Define.
17120 (many_sections_test_DEPENDENCIES): Define.
17121 (many_sections_test_LDFLAGS): Define.
17122 (BUILT_SOURCES): Add many_sections_define.h.
17123 (many_sections_define.h): New target.
17124 (BUILT_SOURCES): Add many_sections_check.h.
17125 (many_sections_check.h): New target.
17126 (check_PROGRAMS): Add many_sections_r_test.
17127 (many_sections_r_test_SOURCES): Define.
17128 (many_sections_r_test_DEPENDENCIES): Define.
17129 (many_sections_r_test_LDFLAGS): Define.
17130 (many_sections_r_test_LDADD): Define.
17131 (many_sections_r_test.o): New target.
17132 * testsuite/Makefile.in: Rebuild.
17133
17134 2008-04-17 Cary Coutant <ccoutant@google.com>
17135
17136 * errors.cc (Errors::info): New function.
17137 (gold_info): New function.
17138 * errors.h (Errors::info): New function.
17139 * gold.h (gold_info): New function.
17140 * object.cc (Input_objects::add_object): Print trace output.
17141 * options.cc (options::parse_set): New function.
17142 (General_options::parse_wrap): Deleted.
17143 (General_options::General_options): Deleted initializer.
17144 * options.h (options::String_set): New typedef.
17145 (options::parse_set): New function.
17146 (DEFINE_set): New macro.
17147 (General_options::wrap): Changed to use DEFINE_set. Changed
17148 callers of any_wrap_symbols and is_wrap_symbol.
17149 (General_options::trace, General_options::trace_symbol):
17150 New options.
17151 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17152 (General_options::wrap_symbols_): Deleted.
17153 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17154
17155 2008-04-17 David S. Miller <davem@davemloft.net>
17156
17157 * options.cc (General_options::parse_V): New function.
17158 * options.h: Add entries for -V and -Qy.
17159
17160 2008-04-17 Ian Lance Taylor <iant@google.com>
17161
17162 * common.cc (Symbol_table::allocate_commons): Remove options
17163 parameter. Change caller.
17164 (Symbol_table::do_allocate_commons): Remove options parameter.
17165 Change caller. Just call do_allocate_commons_list twice.
17166 (Symbol_table::do_allocate_commons_list): New function, broken out
17167 of do_allocate_commons.
17168 * common.h (class Allocate_commons_task): Remove options_ field.
17169 Update constructor.
17170 * symtab.cc (Symbol_table::Symbol_table): Initialize
17171 tls_commons_.
17172 (Symbol_table::add_from_object): Put TLS common symbols on
17173 tls_commons_ list.
17174 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17175 which are IN_OUTPUT_DATA.
17176 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17177 allocate_commons and do_allocate_commons declarations. Declare
17178 do_allocate_commons_list.
17179 * gold.cc (queue_middle_tasks): Update creation of
17180 Allocate_commons_task to not pass options.
17181 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17182 (TLS_TEST_C_FLAGS): New variable.
17183 (tls_test_c_pic.o): New target.
17184 (tls_test_shared.so): Link in tls_test_c_pic.o.
17185 (tls_test_c_pic_ie.o): New target.
17186 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17187 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17188 (tls_test_c.o): New target.
17189 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17190 (tls_pic_test_LDADD): Likewise.
17191 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17192 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17193 (tls_test_c_gnu2.o): New target.
17194 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17195 tls_test_c_gnu2.o.
17196 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17197 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17198 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17199 * testsuite/tls_test.cc: Include "config.h".
17200 (t_last): Call t11_last.
17201 * testsuite/tls_test.h (t11, t11_last): Declare.
17202 * testsuite/tls_test_c.c: New file.
17203 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17204 * configure.ac: Check for OpenMP support.
17205 * configure, config.in, Makefile.in: Rebuild.
17206 * testsuite/Makefile.in: Rebuild.
17207
17208 2008-04-16 Cary Coutant <ccoutant@google.com>
17209
17210 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17211 (Target_i386::tls_base_symbol_defined_): New field.
17212 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17213 (Target_i386::Scan::global): Likewise.
17214 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17215 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17216 (Target_x86_64::tls_base_symbol_defined_): New field.
17217 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17218 (Target_x86_64::Scan::global): Likewise.
17219
17220 2008-04-16 Cary Coutant <ccoutant@google.com>
17221
17222 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17223 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17224 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17225 building shared libraries.
17226 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17227 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17228 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17229 * testsuite/Makefile.in: Rebuild.
17230 * testsuite/weak_undef.h: New file.
17231 * testsuite/weak_undef_file1.cc: Add extra test cases.
17232 * testsuite/weak_undef_file2.cc: Likewise.
17233 * testsuite/weak_undef_test.cc: Likewise.
17234
17235 2008-04-16 David S. Miller <davem@davemloft.net>
17236
17237 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17238 Add issued_non_pic_error_ field. Declare check_non_pic.
17239 (Target_sparc::Scan::check_non_pic): New function.
17240 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17241 (Target_sparc::Scan::global): Likewise.
17242
17243 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17244 * configure: Rebuild.
17245
17246 * options.h (DEFINE_enable): New macro.
17247 (new_dtags): New enable option.
17248 (initfirst, interpose, loadfltr, nodefaultlib,
17249 nodelete, nodlopen, nodump): New -z options.
17250 * layout.cc (Layout:finish_dynamic_section): If new
17251 dtags enabled, emit DT_RUNPATH. Also, emit a
17252 DT_FLAGS_1 containing any specified -z flags.
17253
17254 2008-04-16 Ian Lance Taylor <iant@google.com>
17255
17256 * copy-relocs.cc: New file.
17257 * copy-relocs.h: New file.
17258 * reloc.cc: Remove Copy_relocs code.
17259 * reloc.h: Likewise.
17260 * reloc-types.h (struct Reloc_types) [both versions]: Add
17261 get_reloc_addend_noerror.
17262 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17263 variants of add_global which take an addend which must be zero.
17264 * i386.cc: Include "copy-relocs.h".
17265 (class Target_i386): Change type of copy_relocs_ to variable,
17266 update initializer.
17267 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17268 Change all callers.
17269 (Target_i386::do_finalize_sections): Change handling of
17270 copy_relocs_.
17271 * sparc.cc: Include "copy-relocs.h".
17272 (class Target_sparc): Change type of copy_relocs_ to variable,
17273 update initializer.
17274 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17275 Change all callers.
17276 (Target_sparc::do_finalize_sections): Change handling of
17277 copy_relocs_.
17278 * x86_64.cc: Include "copy-relocs.h".
17279 (class Target_x86_64): Change type of copy_relocs_ to variable,
17280 update initializer.
17281 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17282 class. Change all callers.
17283 (Target_x86_64::do_finalize_sections): Change handling of
17284 copy_relocs_.
17285 * Makefile.am (CCFILES): Add copy-relocs.cc.
17286 (HFILES): Add copy-relocs.h.
17287
17288 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17289
17290 * testsuite/script_test_4.sh: Permit leading zeroes.
17291
17292 2008-04-15 Ian Lance Taylor <iant@google.com>
17293
17294 * script-sections.cc (Script_sections::create_segments): Use
17295 header_size_adjustment even when there is enough room for the
17296 headers.
17297 * testsuite/script_test_4.sh: New file.
17298 * testsuite/script_test_4.t: New file.
17299 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17300 (check_DATA): Add script_test_4.stdout.
17301 (MOSTLYCLEANFILES): Likewise.
17302 (script_test_4): New target.
17303 (script_test_4.stdout): New target.
17304 * testsuite/Makefile.in: Rebuild.
17305
17306 * sparc.cc: Add definitions for Output_data_plt_sparc class
17307 constants.
17308
17309 2008-04-14 David S. Miller <davem@davemloft.net>
17310
17311 * sparc.cc: New file.
17312 * Makefile.am (TARGETSOURCES): Add sparc.cc
17313 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17314 * configure.tgt: Document targ_extra_size and
17315 targ_extra_big_endian. Add entries for sparc-* and
17316 sparc64-*.
17317 * configure.ac: Handle targ_extra_size and
17318 targ_extra_big_endian.
17319 * Makefile.in: Rebuild.
17320 * configure: Likewise.
17321 * po/POTFILES.in: Likewise.
17322 * po/gold.pot: Likewise.
17323
17324 2008-04-14 Ian Lance Taylor <iant@google.com>
17325
17326 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17327 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17328 in the name/type/flags to section mapping. Don't call
17329 allocate_output_section.
17330 (Layout::choose_output_section): Change parameter from adjust_name
17331 to is_input_section. Don't permit input sections after sections
17332 are attached to segments. Don't call allocate_output_section.
17333 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17334 not write_enable_output_section.
17335 (Layout::make_output_section): Don't push to
17336 unattached_section_list_ nor call attach_to_segment. Call
17337 attach_section_to_segment if sections are attached.
17338 (Layout::attach_sections_to_segments): New function.
17339 (Layout::attach_section_to_segment): New function.
17340 (Layout::attach_allocated_section_to_segment): Rename from
17341 attach_to_segment. Remove flags parameter.
17342 (Layout::allocate_output_section): Remove function.
17343 (Layout::write_enable_output_section): Remove function.
17344 * layout.h (class Layout): Update for above changes. Add new
17345 field sections_are_attached_.
17346 * output.h (Output_section::update_flags_for_input_section): New
17347 function.
17348 * output.cc (Output_section::add_input_section): Call
17349 update_flags_for_input_section.
17350 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17351
17352 2008-04-11 Cary Coutant <ccoutant@google.com>
17353
17354 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17355 thought unnecessary.
17356 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17357
17358 2008-04-11 Ian Lance Taylor <iant@google.com>
17359
17360 * output.h (class Output_section_data): Remove inline definition
17361 of set_addralign.
17362 * output.cc (Output_section_data::set_addralign): New function.
17363
17364 2008-04-11 Cary Coutant <ccoutant@google.com>
17365
17366 Add support for TLS descriptors for i386 and x86_64.
17367 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17368 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17369 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17370 GOT_TYPE_TLS_DESC.
17371 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17372 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17373 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17374 relocations.
17375 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17376 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17377 Fix problem with initial-exec relocations.
17378 (Target_i386::Relocate::relocate_tls): Likewise.
17379 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17380 relaxation.
17381 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17382 support for section-plus-offset dynamic table entries.
17383 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17384 (Output_data_dynamic::Dynamic_entry): Add support for
17385 section-plus-offset dynamic table entries.
17386 (Output_data_dynamic::Classification): Likewise.
17387 (Output_data_dynamic::classification_): Renamed offset_.
17388 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17389 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17390 (Target_x86_64::make_plt_section): New function.
17391 (Target_x86_64::reserve_tlsdesc_entries): New function.
17392 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17393 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17394 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17395 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17396 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17397 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17398 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17399 add extra PLT entry for TLS descriptors.
17400 (Output_data_plt_x86_64::got_): New field.
17401 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17402 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17403 fields.
17404 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17405 descriptors.
17406 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17407 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17408 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17409 R_386_TLS_DESC_CALL relocations.
17410 (Target_x86_64::Scan::global): Likewise.
17411 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17412 for TLS descriptors.
17413 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17414 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17415 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17416 GD-to-IE relaxation.
17417 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17418 and TLS_DESCRIPTORS.
17419 * Makefile.in: Rebuild.
17420 * configure: Rebuild.
17421 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17422 (tls_test_shared2.so): New target.
17423 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17424 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17425 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17426 (tls_shared_gd_to_ie_test_LDADD): New variable.
17427 (tls_shared_gnu2_gd_to_ie_test): New target.
17428 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17429 New targets.
17430 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17431 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17432 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17433 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17434 (tls_shared_gnu2_test): New target.
17435 (tls_test_gnu2_shared.so): New target.
17436 (tls_shared_gnu2_test_SOURCES): New variable.
17437 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17438 (tls_shared_gnu2_test_LDFLAGS): New variable.
17439 (tls_shared_gnu2_test_LDADD): New variable.
17440 * testsuite/Makefile.in: Rebuild.
17441 * testsuite/Makefile.
17442
17443 2008-04-11 Ian Lance Taylor <iant@google.com>
17444
17445 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17446 justsyms.t.
17447 * testsuite/Makefile.in: Rebuild.
17448
17449 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17450 long.
17451 * testsuite/script_test_2.cc (main): Adjust test.
17452
17453 2008-04-11 David S. Miller <davem@davemloft.net>
17454 Ian Lance Taylor <iant@google.com>
17455
17456 * options.h (General_options): Add entries for '-Y' and
17457 '-relax'.
17458 * options.cc (General_options:finalize): If -Y was used, add those
17459 entries to the library path instead of the default "/lib" and
17460 "/usr/lib".
17461
17462 2008-04-11 David S. Miller <davem@davemloft.net>
17463
17464 * testsuite/justsyms.t: Start at 0x100.
17465 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17466 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17467 long.
17468 * testsuite/script_test_2.cc: Adjust string and section length
17469 checks.
17470
17471 2008-04-09 Ian Lance Taylor <iant@google.com>
17472
17473 PR gold/5996
17474 * script-sections.cc (Sections_element::allocate_to_segment): Add
17475 orphan parameter.
17476 (Output_section_definition::allocate_to_segment): Likewise.
17477 (Orphan_output_section::allocate_to_segment): Likewise.
17478 (Script_sections::attach_sections_using_phdrs_clause): Don't
17479 propagate non-PT_LOAD segments to orphan sections.
17480 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17481 readelf rather than objdump.
17482 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17483 .interp section and PT_INTERP segment are the same size.
17484 * testsuite/Makefile.in: Rebuild.
17485
17486 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17487 aliases for symbols defined in the same object.
17488 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17489 (weak_alias_test_SOURCES): New variable.
17490 (weak_alias_test_DEPENDENCIES): New variable.
17491 (weak_alias_test_LDFLAGS): New variable.
17492 (weak_alias_test_LDADD): New variable.
17493 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17494 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17495 (weak_alias_test_3.o): New target.
17496 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17497 * testsuite/weak_alias_test_main.cc: New file.
17498 * testsuite/weak_alias_test_1.cc: New file.
17499 * testsuite/weak_alias_test_2.cc: New file.
17500 * testsuite/weak_alias_test_3.cc: New file.
17501
17502 2008-04-08 Ian Lance Taylor <iant@google.com>
17503
17504 * options.h (class General_options): Add --noinhibit-exec option.
17505 * main.cc (main): Check --noinhibit-exec.
17506
17507 * options.h (class General_options): Define --wrap as a special
17508 option. Add wrap_symbols_ field.
17509 (General_options::any_wrap_symbols): New function.
17510 (General_options::is_wrap_symbol): New function.
17511 * options.cc (General_options::parse_wrap): New function.
17512 (General_options::General_options): Initialize wrap_symbols_.
17513 * symtab.cc (Symbol_table::wrap_symbol): New function.
17514 (Symbol_table::add_from_object): Handle --wrap.
17515 * symtab.h (class Symbol_table): Declare wrap_symbol.
17516 * target.h (Target::wrap_char): New function.
17517 (Target::Target_info): Add wrap_char field.
17518 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17519 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17520 * testsuite/testfile.cc (Target_test::test_target_info):
17521 Likewise.
17522
17523 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17524 there is one.
17525
17526 * layout.h (class Layout): Add added_eh_frame_data_ field.
17527 * layout.cc (Layout::Layout): Initialize new field.
17528 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17529 output section until we find a section we merged successfully.
17530 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17531 that the size be non-zero.
17532
17533 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17534 qualifier.
17535
17536 2008-04-08 Craig Silverstein <csilvers@google.com>
17537
17538 * configure.ac: Export new conditional variable HAVE_ZLIB.
17539 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17540 on HAVE_ZLIB.
17541 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17542 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17543
17544 2008-04-07 Ian Lance Taylor <iant@google.com>
17545
17546 * version.cc (version_string): Set to "1.5".
17547
17548 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17549 Add issued_non_pic_error_ field. Declare check_non_pic.
17550 (Target_x86_64::Scan::check_non_pic): New function.
17551 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17552 (Target_x86_64::Scan::global): Likewise.
17553
17554 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17555 addend parameter. Change caller. Handle merge sections.
17556 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17557 Address to Addend. Don't add in the result of
17558 local_section_offset, pass down the addend and use the returned
17559 value.
17560 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17561 Update declarations of local_section_offset and symbol_value.
17562 * testsuite/two_file_test_1.cc (t18): New function.
17563 * testsuite/two_file_test_2.cc (f18): New function.
17564 * testsuite/two_file_test_main.cc (main): Call t18.
17565 * testsuite/two_file_test.h (t18, f18): Declare.
17566
17567 * configure.ac: Don't test for objdump, c++filt, or readelf.
17568 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17569 conditionals.
17570 (TEST_READELF): New variable.
17571 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17572 (check_PROGRAMS): Add two_file_strip_test.
17573 (two_file_strip_test): New target.
17574 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17575 (two_file_same_shared_strip_test_SOURCES): New variable.
17576 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17577 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17578 (two_file_same_shared_strip_test_LDADD): New variable.
17579 (two_file_shared_strip.so): New target.
17580 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17581 (ver_test_5.syms, ver_test_7.syms): Likewise.
17582 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17583 (strip_test_3.stdout): Use TEST_OBJDUMP.
17584 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17585
17586 2008-04-04 Cary Coutant <ccoutant@google.com>
17587
17588 * symtab.h (Symbol::is_weak_undefined): New function.
17589 (Symbol::is_strong_undefined): New function.
17590 (Symbol::is_absolute): New function.
17591 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17592 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17593 absolute symbols.
17594 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17595 (weak_undef_test): New target.
17596 * testsuite/Makefile.in: Rebuild.
17597 * testsuite/weak_undef_file1.cc: New file.
17598 * testsuite/weak_undef_file2.cc: New file.
17599 * testsuite/weak_undef_test.cc: New file.
17600
17601 2008-04-03 Craig Silverstein <csilvers@google.com>
17602
17603 * compressed_output.h (class Output_compressed_section): Use
17604 unsigned buffer.
17605 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17606 add zlib header.
17607 (zlib_compressed_suffix): Removed.
17608 (Output_compressed_section::set_final_data_size): Use unsigned
17609 buffers.
17610 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17611 Fix linker invocation.
17612 (flagstest_o_specialfile_and_compress_debug_sections):
17613 Likewise.
17614 * testsuite/Makefile.in: Regenerated.
17615
17616 2008-04-02 David S. Miller <davem@davemloft.net>
17617
17618 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17619 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17620
17621 2008-04-02 Craig Silverstein <csilvers@google.com>
17622
17623 * TODO: New file.
17624
17625 2008-04-02 Ian Lance Taylor <iant@google.com>
17626
17627 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17628 parameters. Update for new key type to views_. Change all
17629 callers.
17630 (File_read::read): Adjust for byteshift in returned view.
17631 (File_read::add_view): New function, broken out of
17632 find_and_make_view.
17633 (File_read::make_view): New function, broken out of
17634 find_and_make_view.
17635 (File_read::find_or_make_view): Add offset and aligned
17636 parameters. Rewrite accordingly. Change all callers.
17637 (File_read::get_view): Add offset and aligned parameters. Adjust
17638 for byteshift in return value.
17639 (File_read::get_lasting_view): Likewise.
17640 * fileread.h (class File_read): Update declarations.
17641 (class File_read::View): Add byteshift_ field. Add byteshift to
17642 constructor. Add byteshift method.
17643 * archive.h (Archive::clear_uncached_views): New function.
17644 (Archive::get_view): Add aligned parameter. Change all callers.
17645 * object.h (Object::get_view): Add aligned parameter. Change all
17646 callers.
17647 (Object::get_lasting_view): Likewise.
17648
17649 * fileread.cc (File_read::release): Don't call clear_views if
17650 there are multiple objects.
17651 * fileread.h (File_read::clear_uncached_views): New function.
17652 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17653 on the archive.
17654
17655 2008-03-31 Cary Coutant <ccoutant@google.com>
17656
17657 Add thin archive support.
17658 * archive.cc (Archive::armagt): New const.
17659 (Archive::setup): Remove task parameter and calls to unlock.
17660 (Archive::unlock_nested_archives): New function.
17661 (Archive::read_header): Add nested_off parameter. Change
17662 all callers.
17663 (Archive::interpret_header): Likewise.
17664 (Archive::include_all_members): Change to handle thin
17665 archives.
17666 (Archive::include_member): Likewise.
17667 * archive.h (Archive::Archive): Add new parameters and
17668 initializers.
17669 (Archive::armagt): New const.
17670 (Archive::setup): Remove task parameter.
17671 (Archive::unlock_nested_archives): New function.
17672 (Archive::read_header): Add nested_off parameter.
17673 (Archive::interpret_header): Likewise.
17674 (Archive::Nested_archive_table): New typedef.
17675 (Archive::is_thin_archive_): New field.
17676 (Archive::nested_archives_): New field.
17677 (Archive::options_): New field.
17678 (Archive::dirpath_): New field.
17679 (Archive::task_): New field.
17680 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17681 for thin archives. Pass additional parameters to
17682 Archive::Archive. Unlock the archive file after calling
17683 Archive::setup.
17684
17685 2008-03-29 Ian Lance Taylor <iant@google.com>
17686
17687 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17688 version symbol to be local.
17689 * testsuite/ver_test_4.sh: New file.
17690 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17691 (check_DATA): Add ver_test_4.syms.
17692 (ver_test_4.syms): New target.
17693 * testsuite/Makefile.in: Rebuild.
17694
17695 * output.cc
17696 (Output_section::Input_section_sort_entry::has_priority): New
17697 function.
17698 (Output_section::Input_section_sort_entry::match_file_name): New
17699 function.
17700 (Output_section::Input_section_sort_entry::match_section_name):
17701 Remove.
17702 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17703 Remove.
17704 (Output_section::Input_section_sort_entry::match_section_file):
17705 Remove.
17706 (Output_section::Input_section_sort_compare::operator()): Rewrite
17707 using new Input_section_sort_entry functions. Sort crtbegin and
17708 crtend first. Sort sections with no priority before sections with
17709 a priority.
17710 * testsuite/initpri1.c (d3): Check j != 4.
17711 (cd5): New constructor/destructor function.
17712 (main): Check j != 2.
17713
17714 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17715 new symbol when resolving, don't call set_is_default.
17716 * testsuite/ver_test_7.cc: New file.
17717 * testsuite/ver_test_7.sh: New file.
17718 * testsuite/Makefile.am (ver_test_7.so): New target.
17719 (ver_test_7.o): New target.
17720 (check_SCRIPTS): Add ver_test_7.sh.
17721 (check_DATA): Add ver_test_7.syms.
17722 (ver_test_7.syms): New target.
17723
17724 2008-03-28 Ian Lance Taylor <iant@google.com>
17725
17726 * layout.cc (Layout::layout): If we see an input section with a
17727 name that needs sorting, set the must_sort flag for the output
17728 section.
17729 (Layout::make_output_section): If the name of the output section
17730 indicates that it might require sorting, set the may_sort flag.
17731 * output.h (Output_section::may_sort_attached_input_sections): New
17732 function.
17733 (Output_section::set_may_sort_attached_input_sections): New
17734 function.
17735 (Output_section::must_sort_attached_input_sections): New
17736 function.
17737 (Output_section::set_must_sort_attached_input_sections): New
17738 function.
17739 (class Output_section): Declare Input_section_sort_entry. Define
17740 Input_section_sort_compare. Declare
17741 sort_attached_input_sections. Add new fields:
17742 may_sort_attached_input_sections_,
17743 must_sort_attached_input_sections_,
17744 attached_input_sections_are_sorted_.
17745 * output.cc (Output_section::Output_section): Initialize new
17746 fields.
17747 (Output_section::add_input_section): Add an entry to
17748 input_sections_ if may_sort or must_sort are true.
17749 (Output_section::set_final_data_size): Call
17750 sort_attached_input_sections if necessary.
17751 (Output_section::Input_section_sort_entry): Define new class.
17752 (Output_section::Input_section_sort_compare::operator()): New
17753 function.
17754 (Output_section::sort_attached_input_sections): New function.
17755 * configure.ac: Check whether the compiler supports constructor
17756 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17757 * testsuite/initpri1.c: New file.
17758 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17759 CONSTRUCTOR_PRIORITY.
17760 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17761 (initpri1_LDFLAGS): New variable.
17762 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17763
17764 2008-03-27 Ian Lance Taylor <iant@google.com>
17765
17766 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17767 * testsuite/common_test_1.c: New file.
17768 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17769 (common_test_1_SOURCES): New variable.
17770 (common_test_1_DEPENDENCIES): New variable.
17771 (common_test_1_LDFLAGS): New variable.
17772
17773 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17774 and commons_ correctly when NAME/VERSION does not override
17775 NAME/NULL.
17776 * testsuite/ver_test_6.c: New file.
17777 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17778 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17779 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17780
17781 2008-03-26 Ian Lance Taylor <iant@google.com>
17782
17783 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17784 of an undefined symbol from a version script.
17785 * testsuite/Makefile.am (ver_test_5.so): New target.
17786 (ver_test_5.o): New target.
17787 (check_SCRIPTS): Add ver_test_5.sh.
17788 (check_DATA): Add ver_test_5.syms.
17789 (ver_test_5.syms): New target.
17790 * testsuite/ver_test_5.cc: New file.
17791 * testsuite/ver_test_5.script: New file.
17792 * testsuite/ver_test_5.sh: New file.
17793 * Makefile.in, testsuite/Makefile.in: Rebuild.
17794
17795 PR gold/5986
17796 Fix problems building gold with gcc 4.3.0.
17797 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17798 (gold_error_at_location, gold_warning_at_location): Use it.
17799 * configure.ac: Check whether we can compile and use a template
17800 function with a printf attribute.
17801 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17802 when jumping over bytes.
17803 * object.cc: Instantiate Object::read_section_data.
17804 * debug.h: Include <cstring>
17805 * dwarf_reader.cc: Include <algorithm>
17806 * main.cc: Include <cstring>.
17807 * options.cc: Include <cstring>.
17808 * output.cc: Include <cstring>.
17809 * script.cc: Include <cstring>.
17810 * script.h: Include <string>.
17811 * symtab.cc: Include <cstring> and <algorithm>.
17812 * target-select.cc: Include <cstring>.
17813 * version.cc: Include <string>.
17814 * testsuite/testmain.cc: Include <cstdlib>.
17815 * configure, config.in: Rebuild.
17816
17817 2008-03-25 Ian Lance Taylor <iant@google.com>
17818
17819 * options.cc: Include "../bfd/bfdver.h".
17820 (options::help): Print bug reporting address.
17821
17822 * version.cc (print_version): Adjust output for current value of
17823 BFD_VERSION_STRING.
17824
17825 * NEWS: New file.
17826
17827 * options.cc (options::help): Print list of supported targets.
17828 * target-select.h: Include <vector>.
17829 (class Target_selector): Make machine_, size_, and is_big_endian_
17830 fields const. Add bfd_name_ and instantiated_target_ fields.
17831 (Target_selector::Target_selector): Add bfd_name parameter.
17832 (Target_selector::recognize): Make non-virtual, call
17833 do_recognize.
17834 (Target_selector::recognize_by_name): Make non-virtual, call
17835 do_recognize_by_name.
17836 (Target_selector::supported_names): New function.
17837 (Target_selector::bfd_name): New function.
17838 (Target_selector::do_instantiate_target): New pure virtual
17839 function.
17840 (Target_selector::do_recognize): New virtual function.
17841 (Target_selector::do_recognize_by_name): New virtual function.
17842 (Target_selector::instantiate_target): New private function.
17843 (supported_target_names): Declare.
17844 * target-select.cc (Target_selector::Target_selector): Update for
17845 new parameter and fields.
17846 (select_target_by_name): Check that the name matches before
17847 calling recognize_by_name.
17848 (supported_target_names): New function.
17849 * i386.cc (class Target_selector_i386): Update Target_selector
17850 constructor call. Remove recognize and recognize_by_name. Add
17851 do_instantiate_target.
17852 * x86_64.cc (class Target_selector_x86_64): Likewise.
17853 * testsuite/testfile.cc (class Target_selector_test): Update for
17854 changes to Target_selector.
17855
17856 * README: Rewrite, with some notes on unsupported features.
17857
17858 2008-03-24 Cary Coutant <ccoutant@google.com>
17859
17860 * i386.cc (Target_i386::Got_type): New enum declaration.
17861 (Target_i386::Scan::local): Updated callers of Output_data_got
17862 member functions.
17863 (Target_i386::Scan::global): Likewise.
17864 (Target_i386::Relocate::relocate): Likewise.
17865 (Target_i386::Relocate::relocate_tls): Likewise.
17866 * object.h (Got_offset_list): New class.
17867 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17868 (Sized_relobj::local_got_offset): Likewise.
17869 (Sized_relobj::set_local_got_offset): Likewise.
17870 (Sized_relobj::local_has_tls_got_offset): Removed.
17871 (Sized_relobj::local_tls_got_offset): Removed.
17872 (Sized_relobj::set_local_tls_got_offset): Removed.
17873 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17874 * output.cc (Output_data_got::add_global): Added got_type parameter.
17875 (Output_data_got::add_global_with_rel): Likewise.
17876 (Output_data_got::add_global_with_rela): Likewise.
17877 (Output_data_got::add_global_pair_with_rel): New function.
17878 (Output_data_got::add_global_pair_with_rela): New function.
17879 (Output_data_got::add_local): Added got_type parameter.
17880 (Output_data_got::add_local_with_rel): Likewise.
17881 (Output_data_got::add_local_with_rela): Likewise.
17882 (Output_data_got::add_local_pair_with_rel): New function.
17883 (Output_data_got::add_local_pair_with_rela): New function.
17884 (Output_data_got::add_global_tls): Removed.
17885 (Output_data_got::add_global_tls_with_rel): Removed.
17886 (Output_data_got::add_global_tls_with_rela): Removed.
17887 (Output_data_got::add_local_tls): Removed.
17888 (Output_data_got::add_local_tls_with_rel): Removed.
17889 (Output_data_got::add_local_tls_with_rela): Removed.
17890 * output.h (Output_data_got::add_global): Added got_type parameter.
17891 (Output_data_got::add_global_with_rel): Likewise.
17892 (Output_data_got::add_global_with_rela): Likewise.
17893 (Output_data_got::add_global_pair_with_rel): New function.
17894 (Output_data_got::add_global_pair_with_rela): New function.
17895 (Output_data_got::add_local): Added got_type parameter.
17896 (Output_data_got::add_local_with_rel): Likewise.
17897 (Output_data_got::add_local_with_rela): Likewise.
17898 (Output_data_got::add_local_pair_with_rel): New function.
17899 (Output_data_got::add_local_pair_with_rela): New function.
17900 (Output_data_got::add_global_tls): Removed.
17901 (Output_data_got::add_global_tls_with_rel): Removed.
17902 (Output_data_got::add_global_tls_with_rela): Removed.
17903 (Output_data_got::add_local_tls): Removed.
17904 (Output_data_got::add_local_tls_with_rel): Removed.
17905 (Output_data_got::add_local_tls_with_rela): Removed.
17906 * resolve.cc (Symbol::override_base_with_special): Removed
17907 reference to has_got_offset_ field.
17908 * symtab.cc (Symbol::init_fields): Replaced initialization
17909 of got_offset_ with got_offsets_. Removed initialization
17910 of has_got_offset_
17911 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17912 (Symbol::got_offset): Likewise.
17913 (Symbol::set_got_offset): Likewise.
17914 (Symbol::has_tls_got_offset): Removed.
17915 (Symbol::tls_got_offset): Removed.
17916 (Symbol::set_tls_got_offset): Removed.
17917 (Symbol::got_offset_): Removed.
17918 (Symbol::tls_mod_got_offset_): Removed.
17919 (Symbol::tls_pair_got_offset_): Removed.
17920 (Symbol::got_offsets_): New field.
17921 (Symbol::has_got_offset): Removed.
17922 (Symbol::has_tls_mod_got_offset): Removed.
17923 (Symbol::has_tls_pair_got_offset): Removed.
17924 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17925 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17926 member functions.
17927 (Target_x86_64::Scan::global): Likewise.
17928 (Target_x86_64::Relocate::relocate): Likewise.
17929 (Target_x86_64::Relocate::relocate_tls): Likewise.
17930
17931 2008-03-25 Ben Elliston <bje@au.ibm.com>
17932
17933 * yyscript.y: Fix spelling error in comment.
17934
17935 2008-03-24 Ian Lance Taylor <iant@google.com>
17936
17937 * options.h (class General_options): Define build_id option.
17938 * layout.h (class Layout): Declare write_build_id, create_note,
17939 create_build_id. Add build_id_note_ member.
17940 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17941 "libiberty.h", "md5.h", "sha1.h".
17942 (Layout::Layout): Initialize eh_frame_data_,
17943 eh_frame_hdr_section_, and build_id_note_.
17944 (Layout::finalize): Call create_build_id.
17945 (Layout::create_note): New function, broken out of
17946 Layout::create_gold_note.
17947 (Layout::create_gold_note): Call create_note.
17948 (Layout::create_build_id): New function.
17949 (Layout::write_build_id): New function.
17950 (Close_task_runner::run): Call write_build_id.
17951
17952 * x86_64.cc: Correct license to GPLv3.
17953
17954 2008-03-23 Ian Lance Taylor <iant@google.com>
17955
17956 * options.cc: Include "demangle.h".
17957 (parse_optional_string): New function.
17958 (parse_long_option): Handle takes_optional_argument.
17959 (parse_short_option): Update dash_z initializer. Handle
17960 takes_optional_argument.
17961 (General_options::General_options): Initialize do_demangle_.
17962 (General_options::finalize): Set do_demangle_. Handle demangling
17963 style.
17964 * options.h (parse_optional_string): Declare.
17965 (struct One_option): Add optional_arg field. Update constructor.
17966 Update call constructor calls. Add takes_optional_argument
17967 function.
17968 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17969 (DEFINE_optional_string): Define.
17970 (General_options::demangle): Change from DEFINE_bool to
17971 DEFINE_optional_string.
17972 (General_options::no_demangle): New function.
17973 (General_options::do_demangle): New function.
17974 (General_options::set_do_demangle): New function.
17975 (General_options::execstack_status_): Move definition to end of
17976 class definition.
17977 (General_options::static_): Likewise.
17978 (General_options::do_demangle_): New field.
17979 * object.cc (big_endian>::get_symbol_location_info): Call
17980 Options::do_demangle, not Options::demangle.
17981 * symtab.cc (demangle): Likewise.
17982
17983 2008-03-22 Ian Lance Taylor <iant@google.com>
17984
17985 * gold.h: Include <cstddef> and <sys/types.h>
17986 * options.h: Include <cstring>.
17987
17988 2008-03-21 Ian Lance Taylor <iant@google.com>
17989
17990 * Added source code to GNU binutils.
17991 \f
17992 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17993
17994 Copying and distribution of this file, with or without modification,
17995 are permitted in any medium without royalty provided the copyright
17996 notice and this notice are preserved.
17997
17998 Local Variables:
17999 mode: change-log
18000 left-margin: 8
18001 fill-column: 74
18002 version-control: never
18003 End:
This page took 0.682515 seconds and 4 git commands to generate.