Make output views accessible to Target during do_relocate().
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-12-11 Cary Coutant <ccoutant@gmail.com>
2
3 * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize
4 output_views_.
5 * object.h (Object::get_output_view): New function.
6 (Object::do_get_output_view): New function.
7 (Sized_relobj_file::do_get_output_view): New function.
8 (Sized_relobj_file::output_views_): New data member.
9 * reloc.cc: (Sized_relobj_file::do_relocate): Store pointer to
10 output views in class object.
11 (Sized_relobj_file::do_get_output_view): New function.
12
13 2015-12-10 H.J. Lu <hongjiu.lu@intel.com>
14
15 PR ld/19317
16 * symtab.cc (Symbol_table::add_from_relobj): Don't complain
17 plugin needed to handle slim lto object for relocatable link.
18
19 2015-12-09 Alan Modra <amodra@gmail.com>
20
21 * powerpc.cc (Target_powerpc::Relocate::relocate): New constant
22 d_offset. Use throughout.
23 (Target_powerpc::relocate_relocs): Likewise.
24
25 2015-12-09 Alan Modra <amodra@gmail.com>
26
27 * powerpc.cc (Target_powerpc::Relocate::relocate): Edit ELFv2
28 entry code.
29 (Target_powerpc::relocate_relocs): Edit relocs to suit.
30
31 2015-12-09 Alan Modra <amodra@gmail.com>
32
33 * object.h (struct Relocate_info): Add "rr".
34 * reloc.h (Relocatable_relocs::set_strategy): New accessor.
35 * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
36 relinfo.rr for relocate_section and relocate_relocs.
37 * powerpc.cc (relocate): Add rel_type and preloc parameters.
38 Delete rela and r_type params, instead recalculate these from
39 preloc.
40 (relocate_relocs): Delete Relocatable_relocs* param, instead
41 use relinfo->rr.
42 * aarch64.cc: Likewise.
43 * arm.cc: Likewise.
44 * i386.cc: Likewise.
45 * mips.cc: Likewise.
46 * s390.cc: Likewise.
47 * sparc.cc: Likewise.
48 * target.h: Likewise.
49 * tilegx.cc: Likewise.
50 * x86_64.cc: Likewise.
51 * testsuite/testfile.cc: Likewise.
52 * target-reloc.h (relocate_section): Adjust to suit.
53 (apply_relocation, relocate_relocs): Likewise.
54
55 2015-12-07 Alan Modra <amodra@gmail.com>
56
57 * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
58 (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
59 (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
60
61 2015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
62
63 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
64 Local_got_entry_key for searching in local_got_offsets_.
65 * object.h (class Local_got_entry_key): New class.
66 (Relobj::local_has_got_offset): New overloaded method.
67 (Relobj::local_got_offset): Likewise.
68 (Relobj::set_local_got_offset): Likewise.
69 (Relobj::do_local_has_got_offset): Add addend argument.
70 (Relobj::do_local_got_offset): Likewise.
71 (Relobj::do_set_local_got_offset): Likewise.
72 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
73 Local_got_entry_key for searching through local_got_offsets_.
74 (Sized_relobj::do_local_got_offset): Likewise.
75 (Sized_relobj::do_set_local_got_offset): Likewise.
76 (Sized_relobj::Local_got_offsets): Change type of the key from
77 unsigned int to Local_got_entry_key, and add hash and equal_to.
78 * output.cc (Got_entry::write): Take addend into account for
79 calculating value of the local symbol for GOT.
80 (Output_data_got::add_local): New definition of overloaded method.
81 (Output_data_got::add_local_with_rel): Likewise.
82 (Output_data_got::add_local_pair_with_rel): Likewise.
83 * output.h (Output_data_got::add_local): New declaration of overloaded
84 method.
85
86 2015-11-25 Cary Coutant <ccoutant@gmail.com>
87
88 PR gold/19291
89 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
90 subtract section address from symbol value.
91
92 2015-11-25 Alan Modra <amodra@gmail.com>
93
94 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
95 to 256 byte boundary.
96
97 2015-11-19 Alan Modra <amodra@gmail.com>
98
99 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
100 GOT16 and TOC16 relocs to RELATIVE_REF.
101
102 2015-11-14 Cary Coutant <ccoutant@gmail.com>
103
104 PR gold/19244
105 PR gold/18548
106 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
107 local symbols only for predefined symbols.
108
109 2015-11-11 Alan Modra <amodra@gmail.com>
110 Peter Bergner <bergner@vnet.ibm.com>
111
112 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
113 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
114 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
115 (Target_powerpc::Scan::global): Likewise.
116 (Target_powerpc::Relocate::relocate): Likewise.
117
118 2015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
119
120 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
121 sections.
122
123 2015-11-09 Cary Coutant <ccoutant@gmail.com>
124 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
125
126 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
127 with type, offset, addend.
128 (Copy_relocs::save): Likewise.
129 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
130 (Copy_relocs::save): Likewise.
131 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
132 and r_addend to Copy_relocs::copy_reloc.
133 * arm.cc (Target_arm::copy_reloc): Likewise.
134 * i386.cc (Target_i386::copy_reloc): Likewise.
135 * mips.cc (Target_mips::copy_reloc): Likewise.
136 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
137 * s390.cc (Target_s390::copy_reloc): Likewise.
138 * sparc.cc (Target_sparc::copy_reloc): Likewise.
139 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
140 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
141
142 2015-11-05 Cary Coutant <ccoutant@gmail.com>
143
144 PR gold/19119
145 PR gold/19172
146 PR gold/19197
147 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
148 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
149 * options.h (General_options): Remove "obsolete" from -m.
150 * parameters.cc (set_parameters_target): Check if input target
151 is compatible with output emulation set by "-m emulation".
152
153 2015-11-05 Cary Coutant <ccoutant@gmail.com>
154
155 PR gold/19163
156 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
157 certain relocations if --no-apply-dynamic-relocs is set.
158 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
159
160 2015-11-03 Alan Modra <amodra@gmail.com>
161
162 * po/POTFILES.in: Regenerate.
163
164 2015-10-30 Nick Clifton <nickc@redhat.com>
165
166 * po/zh_CN.po: New (simplified) Chinese translation.
167
168 2015-10-29 H.J. Lu <hongjiu.lu@intel.com>
169
170 PR gold/19184
171 * incremental.cc (Got_plt_view_info): Add got_entry_size.
172 (Local_got_offset_visitor::visit): Replace got_entry_size_
173 with info_.got_entry_size.
174 (Local_got_offset_visitor::got_entry_size_): Removed.
175 (Global_got_offset_visitor::visit): Replace got_entry_size_
176 with info_.got_entry_size.
177 (Global_got_offset_visitor::got_entry_size_): Removed.
178 (Output_section_incremental_inputs::write_got_plt): Initialize
179 view_info.got_entry_size.
180 * target.h (Sized_target::got_entry_size): New virtual function.
181 * x86_64.cc (Target_x86_64::got_entry_size): New function.
182
183 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
184
185 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
186 * testsuite/script_test_12a.c: Likewise.
187 * testsuite/script_test_1a.cc: Likewise.
188 * testsuite/script_test_2.cc: Likewise.
189
190 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
191
192 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
193
194 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
195
196 PR gold/18959
197 * stringpool.cc (Stringpool_template::new_key_offset): Align all
198 strings, even zero-length.
199 (Stringpool_template::set_string_offsets): Likewise.
200
201 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
202
203 * s390.cc: New file.
204 * Makefile.am (TARGETSOURCES): Add s390.cc.
205 (ALL_TARGETOBJS): Add s390.o.
206 * Makefile.in: Regenerate.
207 * configure.ac: Add s390 support.
208 * configure: Regenerate.
209 * configure.tgt: Add s390-*-* and s390x-*-*.
210 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
211 support.
212
213 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
214
215 * archive.cc (Archive::sym64name): New const.
216 (Archive::setup): Add support for SYM64 armap.
217 (Archive::read_armap): Likewise.
218 (Archive::interpret_header): Likewise.
219 (Archive::const_iterator::read_next_header): Likewise.
220 * archive.h (Archive::sym64name): New const.
221 (Archive::read_armap): Add mapsize template parameter.
222
223 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
224
225 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
226 target-specific entry size.
227 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
228 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
229 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
230 hash_entry_size.
231 * target.h (Target::hash_entry_size): New method.
232 (Target::Target_info::hash_entry_size): New data member.
233
234 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
235 * arm.cc (Target_arm::arm_info): Likewise.
236 (Target_arm_nacl::arm_nacl_info): Likewise.
237 * i386.cc (Target_i386::i386_info): Likewise.
238 (Target_i386_nacl::i386_nacl_info): Likewise.
239 (Target_iamcu::iamcu_info): Likewise.
240 * mips.cc (Target_mips::mips_info): Likewise.
241 (Target_mips_nacl::mips_nacl_info): Likewise.
242 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
243 * sparc.cc (Target_sparc::sparc_info): Likewise.
244 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
245 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
246 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
247 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
248
249 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
250
251 PR gold/19177
252 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
253 and R_386_GOT32X relocations without base register.
254
255 2015-10.27 Han Shen <shenhan@google.com>
256
257 PR gold/19042 - unsupported reloc 311/312.
258
259 * aarch64.cc (Target_aarch64::Scan::local): Add support for
260 reloc 311/312.
261
262 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
263
264 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
265 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
266 as R_X86_64_GOTPCREL.
267 (Target_x86_64<size>::Scan::local): Likewise.
268 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
269 Likewise.
270 (Target_x86_64<size>::Scan::global): Likewise.
271 (Target_x86_64<size>::Relocate::relocate): Likewise.
272 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
273 Likewise.
274
275 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
276
277 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
278 R_386_GOT32X the same as R_386_GOT32.
279 (Target_i386::Scan::local): Likewise.
280 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
281 (Target_i386::Scan::global): Likewise.
282 (Target_i386::Relocate::relocate): Likewise.
283 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
284 Likewise.
285
286 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
287
288 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
289 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
290 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
291 x86_64_mov_to_lea1.o.
292 * testsuite/Makefile.in: Regenerated.
293
294 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
295
296 PR gold/19119
297 * options.h (General_options): Remove "obsolete" from -m.
298 * parameters.cc (set_parameters_target): Check if input target
299 is compatible with output emulation set by "-m emulation".
300
301 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
302
303 PR gold/19118
304 * i386.cc (Target_iamcu): New class.
305 (Target_selector_iamcu): Likewise.
306 (Target_iamcu::iamcu_info): New variable.
307 (target_selector_iamcu): Likewise.
308
309 2015-10-07 Andreas Schwab <schwab@suse.de>
310
311 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
312
313 2015-10-06 Cary Coutant <ccoutant@gmail.com>
314
315 PR gold/18855
316 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
317 parameter.
318 (Sparc_relocate_functions::gdop_lox10): Likewise.
319 (Target_sparc::Relocate::relocate): Use addend when computing
320 symbol value for R_SPARC_GOTDATA_OP*.
321
322 2015-09-07 Cary Coutant <ccoutant@gmail.com>
323
324 PR gold/18930
325 PR gold/18886
326 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
327 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
328
329 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
330
331 PR gold/18886
332 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
333 shared libraries into normal FUNC symbols.
334 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
335 symbols aren't from shared libraries.
336
337 2015-09-02 Alan Modra <amodra@gmail.com>
338
339 PR 18878
340 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
341 (Target_powerpc::Branch_info::make_stub): Determine whether long
342 branch stub is for save/restore function.
343 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
344 (Stub_table): Add need_save_res_.
345 (Stub_table:clear_stubs): Clear need_save_res_.
346 (Stub_table:set_address_and_size): Add save/restore section size.
347 (Stub_table::add_long_branch_entry): Add save_res param. Set
348 need_save_res_, but don't add space for save/restore stubs.
349 (Stub_table::find_long_branch_entry): Return offset to local copy
350 of save/restore func.
351 (Stub_table::do_write): Don't output save/restore stubs. Instead
352 copy the save/restore functions.
353 (Output_data_save_res:contents): New accessor.
354 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
355
356 2015-08-25 Cary Coutant <ccoutant@gmail.com>
357
358 PR gold/18847
359 * script-sections.cc (Memory_region::set_address): New method.
360 (Script_sections::find_memory_region): Add explicit_only parameter.
361 (Output_section_definition::set_section_addresses): Handle case where
362 script specifies both address and vma region.
363 * script-sections.h (Script_sections::find_memory_region): Add
364 explicit_only parameter.
365
366 2015-08-25 Cary Coutant <ccoutant@gmail.com>
367
368 PR gold/18859
369 * object.cc (Input_objects::add_object): Store objects in a map,
370 indexed by soname; update as-needed flag when necessary.
371 * object.h (Object::clear_as_needed): New method.
372 (Input_objects::so_names_): Change from set to map.
373
374 2015-08-25 Cary Coutant <ccoutant@gmail.com>
375
376 PR gold/14746
377 * expression.cc (Expression::Expression_eval_info): Add
378 is_valid_pointer field.
379 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
380 Adjust all callers.
381 (Addr_expression::value_from_output_section): Check whether address
382 is valid.
383 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
384 if evaluation failed due to address that is not yet valid.
385 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
386 parameter.
387
388 2015-08-25 Cary Coutant <ccoutant@gmail.com>
389
390 PR gold/18866
391 PR gold/18703
392 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
393
394 2015-08-20 Alan Modra <amodra@gmail.com>
395
396 PR gold/18846
397 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
398 Subtract os->address() from addend.
399 * powerpc.cc (relocate_relocs): Likewise.
400
401 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
402
403 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
404 lazy_stub_normal_1, lazy_stub_normal_1_n64,
405 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
406 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
407 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
408 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
409 of 'addu/daddu'.
410
411 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
412
413 * configure: Regenerated.
414
415 2015-07-26 Doug Kwan <dougkwan@google.com>
416
417 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
418 disassembler output format.
419
420 2015-07-23 Ian Coolidge <icoolidge@google.com>
421 Plumb --pic-veneer option for gold.
422
423 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
424 generation.
425 * options.h (General_options): Add --pic-veneer option.
426
427 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
428
429 PR gold/18663
430 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
431 script_test_1a.cc script_test_1b.cc.
432 (script_test_11_r.o): Replace script_test_11.o with
433 script_test_11a.o script_test_11b.o.
434 (script_test_11.o): Removed.
435 (script_test_11a.o): New.
436 (script_test_11b.o): Likewise.
437 * testsuite/Makefile.in: Regenerated.
438 * testsuite/script_test_1.h: New file.
439 * testsuite/script_test_1b.cc: Likewise.
440 * testsuite/script_test_11.h: Likewise.
441 * testsuite/script_test_11b.c: Likewise.
442 * testsuite/script_test_1.cc: Renamed to ...
443 * testsuite/script_test_1a.cc: This.
444 Include "script_test_1.h".
445 (main): Call check_int and check_ptr.
446 * testsuite/script_test_11.c: Renamed to ...
447 * testsuite/script_test_11a.c: This.
448 Include "script_test_11.h".
449 (main): Call ptr_equal.
450
451 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
452
453 PR gold/18628
454 * testsuite/ifuncdep2.c (global): Change protected to hidden.
455 * testsuite/ifuncmod1.c (global): Likewise.
456 * testsuite/ifuncmod5.c (global): Likewise.
457
458 2015-07-22 Alan Modra <amodra@gmail.com>
459
460 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
461
462 2015-07-21 Cary Coutant <ccoutant@gmail.com>
463
464 PR gold/18548
465 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
466 forced local symbol even when oldsym != NULL.
467 (Symbol_table::do_define_in_output_segment): Likewise.
468 (Symbol_table::do_define_as_constant): Likewise.
469
470 2015-07-21 Cary Coutant <ccoutant@gmail.com>
471
472 PR gold/18698
473 * archive.cc (Library_base::should_include_member): Don't use entry
474 point for relocatable links, or if target is not yet valid.
475 * parameters.cc (Parameters::entry): Check target_valid().
476
477 2015-07-20 Han Shen <shenhan@google.com>
478
479 Optimize erratum 843419 fix.
480
481 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
482 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
483 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
484 (E843419_stub): New sub-class of Erratum_stub.
485 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
486 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
487 (AArch64_relobj::create_erratum_stub): Add 1 argument.
488 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
489
490 2015-07-20 Han Shen <shenhan@google.com>
491
492 Fix arm elf header flags wrt hardfp bit.
493
494 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
495
496 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
497
498 PR gold/18689
499 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
500 from input group section for relocatable link.
501 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
502 (check_DATA): Add pr18689.stdout.
503 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
504 (pr18689.stdout): New rule.
505 (pr18689a.o): Likewise.
506 (pr18689b.o): Likewise.
507 (pr18689.o): Likewise.
508 * testsuite/pr18689.c: New file.
509 * testsuite/pr18689.sh: Likewise.
510 * testsuite/Makefile.in: Regenerated.
511
512 2015-07-20 Yiran Wang <yiran@google.com>
513 Cary Coutant <ccoutant@gmail.com>
514
515 PR gold/15574
516 * resolve.cc (Symbol_table): Remove warning about references
517 from shared objects to hidden symbols.
518 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
519 * testsuite/Makefile.in: Regenerate.
520 * testsuite/hidden_test.sh: Check dynamic symbol table; update
521 expected error messages.
522
523 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
524
525 * compressed_output.cc (Output_compressed_section::set_final_data_size):
526 Make --compress-debug-sections=zlib the same as
527 --compress-debug-sections=zlib-gabi.
528 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
529 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
530 ".zdebug_".
531 * testsuite/Makefile.in: Regenerated.
532
533 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
534
535 PR gold/18322
536 * compressed_output.cc (zlib_compress): Add argument for
537 compression header size. Set header size to compression header
538 size if it isn't 0. Don't write out the zlib header here.
539 (Output_compressed_section::set_final_data_size): Support
540 zlib-gnu and zlib-gabi compressions. Pass compression header
541 size to zlib_compress and write out compression header. Set
542 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
543 clear the SHF_COMPRESSED bit
544 * options.h (compress_debug_sections): Add zlib-gnu and
545 zlib-gabi.
546 * output.h (Output_section::set_flags): New.
547 * testsuite/Makefile.am (check_PROGRAMS): Add
548 flagstest_compress_debug_sections_none,
549 flagstest_compress_debug_sections_gnu and
550 flagstest_compress_debug_sections_gabi.
551 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
552 flagstest_compress_debug_sections.stdout,
553 flagstest_compress_debug_sections.cmp,
554 flagstest_compress_debug_sections.check,
555 flagstest_compress_debug_sections_gnu.stdout,
556 flagstest_compress_debug_sections_gnu.cmp,
557 flagstest_compress_debug_sections_gnu.check,
558 flagstest_compress_debug_sections_gabi.stdout,
559 flagstest_compress_debug_sections_gabi.cmp and
560 flagstest_compress_debug_sections_gabi.check.
561 (flagstest_compress_debug_sections_none): New.
562 (flagstest_compress_debug_sections_none.stdout): Likewise.
563 (flagstest_compress_debug_sections.stdout): Likewise.
564 (flagstest_compress_debug_sections.check): Likewise.
565 (flagstest_compress_debug_sections.cmp): Likewise.
566 (flagstest_compress_debug_sections_gnu): Likewise.
567 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
568 (flagstest_compress_debug_sections_gnu.check): Likewise.
569 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
570 (flagstest_compress_debug_sections_gabi): Likewise.
571 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
572 (flagstest_compress_debug_sections_gnu.check): Likewise.
573 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
574 * testsuite/Makefile.in: Regenerated.
575
576 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
577
578 PR gold/18321
579 * compressed_output.h (decompress_input_section): Add arguments
580 for ELF class, big endian and sh_flags.
581 * compressed_output.cc (decompress_input_section): Likewise.
582 Support the SHF_COMPRESSED section.
583 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
584 functions.
585 * plugin.h (Pluginobj): Likewise.
586 * layout.cc (Layout::get_output_section_flags): Also clear the
587 SHF_COMPRESSED bit.
588 * object.h (Compressed_section_info): Add flag to store sh_flags.
589 (Object): Add pure virtual elfsize and is_big_endian member
590 functions.
591 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
592 prefix here.
593 (build_compressed_section_map): Check SHF_COMPRESSED for
594 uncompressed size. Store sh_flags in Compressed_section_info.
595 Pass size, big_endian and sh_flags to decompress_input_section.
596 Skip the ".debug"/".zdebug" prefix when passing section name to
597 need_decompressed_section.
598 (Sized_relobj_file<size, big_endian>::do_find_special_section):
599 Don't check ".zdebug_*" sections.
600 (Object::decompressed_section_contents): Pass ELF class, big
601 endian and sh_flags to decompress_input_section.
602 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
603 Likewise.
604 * testsuite/Makefile.am (check_DATA): Add
605 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
606 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
607 gdb_index_test_2_gabi.stdout.
608 (debug_msg_cdebug_gabi.o): New.
609 (odr_violation1_cdebug_gabi.o): Likewise.
610 (odr_violation2_cdebug_gabi.o): Likewise.
611 (debug_msg_cdebug_gabi.err): Likewise.
612 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
613 (gdb_index_test_cdebug_gabi.o): Likewise.
614 (gdb_index_test_2_gabi): Likewise.
615 (gdb_index_test_2_gabi.stdout): Likewise.
616 * testsuite/gdb_index_test_2_gabi.sh: New file.
617 * testsuite/Makefile.in: Regenerated.
618
619 2015-07-09 Han Shen <shenhan@google.com>
620
621 Use "gold_info" instead of "gold_warning" for erratum fix.
622
623 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
624 'gold_info'.
625 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
626
627 2015-07-09 Han Shen <shenhan@google.com>
628
629 Drop missing symbol warning for arm/aarch64.
630
631 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
632 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
633 symbol warning.
634
635 2015-07-07 Han Shen <shenhan@google.com>
636
637 Make gold aarch64 accept long form of mapping symbols.
638
639 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
640 of mapping symbols.
641
642 2015-06-29 Doug Kwan <dougkwan@google.com>
643
644 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
645 at address expected by test.
646 * testsuite/arm_cortex_a8_b.s: Ditto.
647 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
648 * testsuite/arm_cortex_a8_bl.s: Ditto.
649 * testsuite/arm_cortex_a8_blx.s: Ditto.
650 * testsuite/arm_cortex_a8_local.s: Ditto.
651 * testsuite/arm_fix_v4bx.s: Ditto.
652 * testsuite/arm_unaligned_reloc.s: Ditto.
653 * testsuite/thumb_bl_out_of_range.s: Ditto.
654 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
655 * testsuite/thumb_blx_out_of_range.s: Ditto.
656
657 2015-06-29 Han Shen <shenhan@google.com>
658
659 Patch for erratum 843419 internal error.
660
661 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
662 (Erratum_stub::update_erratum_insn): New method.
663 (Stub_table::relocate_stubs): Modified to place relocated insn.
664 (AArch64_relobj::fix_errata): Modified gold_assert.
665
666 2015-06-12 Han Shen <shenhan@google.com>
667
668 Fix erratum 835769.
669
670 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
671 defintion outside class definition.
672 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
673 (AArch64_insn_utilities::aarch64_op31): New member.
674 (AArch64_insn_utilities::aarch64_ra): New member.
675 (AArch64_insn_utilities::aarch64_mac): New member.
676 (AArch64_insn_utilities::aarch64_mlxl): New member.
677 (ST_E_835769): New global enum member.
678 (Stub_table::relocate_stubs): Add 835769 handler.
679 (Stub_template_repertoire::Stub_template_repertoire): Install new
680 stub type.
681 (AArch64_relobj::scan_errata): This func is renamed from
682 scan_erratum_843419.
683 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
684 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
685 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
686 (Target_aarch64::scan_erratum_835769_span): New method.
687 (Target_aarch64::create_erratum_stub): New method.
688 (Target_aarch64::is_erratum_835769_sequence): New method.
689 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
690 code into create_erratum_stub.
691 * options.h (fix_cortex_a53_835769): New option.
692
693 2015-06-11 Cary Coutant <ccoutant@gmail.com>
694
695 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
696 outside class body.
697 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
698
699 2015-06-11 Cary Coutant <ccoutant@gmail.com>
700
701 PR gold/17731
702 * layout.cc (corresponding_uncompressed_section_name): New function.
703 (Layout::choose_output_section): Call it.
704 * layout.h (corresponding_uncompressed_section_name): New function.
705 * script-sections.cc (Input_section_info::set_section_name): Check
706 for compressed debug section (.zdebug style).
707
708 2015-06-11 Jing Yu <jingyu@google.com>
709
710 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
711 * testsuite/Makefile.in: Regenerate.
712
713 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
714
715 * gold.h (is_cident): Correct typo.
716
717 2015-06-10 Han Shen <shenhan@google.com>
718 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
719
720 Now fixing for 843419 is fully functional.
721
722 The first part of the erratum fix CL is here -
723 https://sourceware.org/ml/binutils/2015-04/msg00229.html
724
725 * aarch64.cc(global enum): New constants representing stub types.
726 (Stub_template): New POD struct.
727 (Stub_template_repertoire): New class.
728 (Stub_base): New class.
729 (Erratum_stub): New class.
730 (Reloc_stub): Refactored to be a subclass of Stub_base.
731 (Reloc_stub::Stub_type): Removed.
732 (Reloc_stub::offset): Moved to Stub_base.
733 (Reloc_stub::set_offset): Moved to Stub_base.
734 (Reloc_stub::destination_address): Moved to Stub_base.
735 (Reloc_stub::set_destination_address): Moved to Stub_base.
736 (Reloc_stub::reset_destination_address): Moved to Stub_base.
737 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
738 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
739 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
740 (Reloc_stub::write): Moved to Stub_base.
741 (Reloc_stub::invalid_offset): Moved to Stub_base.
742 (Reloc_stub::invalid_address): Moved to Stub_base.
743 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
744 (Reloc_stub::stub_insns_): Moved to Stub_base.
745 (Reloc_stub::offset_): Moved to Stub_base.
746 (Reloc_stub::destination_address_): Moved to Stub_base.
747 (Stub_table::The_aarch64_relobj): New typedef.
748 (Stub_table::The_erratum_stub): New typedef.
749 (Stub_table::The_erratum_stub_less): New typedef.
750 (Stub_table::The_erratum_stub_set): New typedef.
751 (Stub_table::The_erratum_stub_set_iter): New typedef.
752 (Stub_table::empty): Added emptiness testing for erratum stubs.
753 (Stub_table::add_erratum_stub): New method to add an erratum stub.
754 (Stub_table::find_erratum_stub): New method.
755 (Stub_table::find_erratum_stubs_for_input_section): New method.
756 (Stub_table::erratum_stub_address): New method.
757 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
758 (Stub_table::do_addralign): Modified to handle erratum stubs.
759 (Stub_table::erratum_stubs_): New member.
760 (Stub_table::erratum_stub_size_): New member.
761 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
762 (Stub_table::do_write): Modified to handle erratum stubs.
763 (AArch64_relobj::The_erratum_stub): New typedef.
764 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
765 (AArch64_relobj::fix_errata): New method.
766 (Target_aarch64::The_reloc_stub_type): Removed.
767 (Target_aarch64::The_erratum_stub): New typede.
768 (AArch64_relocate_functions::construct_b): New method.
769
770 2015-06-08 Nick Clifton <nickc@redhat.com>
771
772 * po/fr.po: New French Translation.
773
774 2015-06-07 Cary Coutant <ccoutant@gmail.com>
775
776 PR gold/18288
777 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
778 callers. Don't use STT_COMMON to check for common symbols.
779 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
780 symbol that's not in a common section.
781 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
782 common symbols.
783
784 2015-06-04 Cary Coutant <ccoutant@gmail.com>
785
786 PR gold/18200
787 * Makefile.am (diststuff): Add target.
788 * Makefile.in: Regenerate.
789
790 2015-06-04 Cary Coutant <ccoutant@gmail.com>
791
792 PR gold/17498
793 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
794 temporary locals in merge sections.
795 * options.cc (General_options::parse_discard_all): New method.
796 (General_options::parse_discard_locals): New method.
797 (General_options::parse_discard_none): New method.
798 (General_options::General_options): Initialize discard_locals_.
799 * options.h (--discard-all): Convert to special option.
800 (--discard-locals): Likewise.
801 (--discard-none): New option.
802 (General_options::discard_all): New method.
803 (General_options::discard_locals): New method.
804 (General_options::discard_sec_merge): New method.
805 (General_options::Discard_locals): New enum.
806 (General_options::discard_locals_): New data member.
807
808 2015-06-03 Cary Coutant <cary@google.com>
809
810 * script-sections.cc (Script_sections::Script_sections): Initialize
811 segments_created_.
812 (Script_sections::create_note_and_tls_segments): Set flag when
813 segments are created.
814 (Script_sections::expected_segment_count): Count PT_INTERP.
815 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
816 segments are created.
817 * script-sections.h (Script_sections::segments_created_): New data
818 member.
819
820 2015-06-03 Cary Coutant <ccoutant@gmail.com>
821
822 PR gold/15370
823 * script-sections.cc
824 (Output_section_element_input::set_section_addresses): When there
825 are several patterns with no sort spec, put all sections in the same
826 bin.
827 * testsuite/Makefile.am (script_test_12): New testcase.
828 (script_test_12i): New testcase.
829 * testsuite/Makefile.in: Regenerate.
830 * testsuite/script_test_12.t: New test linker script.
831 * testsuite/script_test_12i.t: New test linker script.
832 * testsuite/script_test_12a.c: New test source file.
833 * testsuite/script_test_12b.c: New test source file.
834
835 2015-06-02 Cary Coutant <ccoutant@gmail.com>
836
837 * nacl.h (Sniff_file): Switch parameters to get_view to get an
838 aligned view.
839
840 2015-06-03 Cary Coutant <ccoutant@gmail.com>
841
842 PR gold/17819
843 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
844 separate task to schedule the build id computation.
845 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
846 add Output_file and offset.
847 (Hash_task::run): Get and release the input views.
848 (Hash_task::is_runnable): Always return NULL (always runnable).
849 (Layout::queue_build_id_tasks): Remove.
850 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
851 parameters; use them instead of class members.
852 (Build_id_task_runner::run): New function.
853 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
854 to write_build_id.
855 * layout.h (Layout::queue_build_id_tasks): Remove.
856 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
857 parameters.
858 (Layout::array_of_hashes_): Remove.
859 (Layout::size_of_array_of_hashes_): Remove.
860 (Layout::input_view_): Remove.
861 (Build_id_task_runner): New class.
862 (Close_task_runner::Close_task_runner): Add array_of_hashes and
863 size_of_hashes parameters.
864 (Close_task_runner::array_of_hashes_): New data member.
865 (Close_task_runner::size_of_hashes_): New data member.
866 * testsuite/Makefile.am
867 (flagstest_compress_debug_sections_and_build_id_tree): New test.
868 * testsuite/Makefile.in: Regenerate.
869
870 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
871
872 * merge.cc (get_input_merge_map): Update for data structure change.
873 (get_or_make_input_merge_map): Update for data structure change.
874 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
875 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
876
877 2015-05-16 Alan Modra <amodra@gmail.com>
878
879 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
880 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
881 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
882 (lis_0): Rename from lis_0_0.
883
884 2015-04-29 Cary Coutant <cary@google.com>
885 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
886
887 * gc.h (Garbage_collection::is_section_garbage): Change Object*
888 to Relobj*.
889 (Garbage_collection::add_reference): Likewise.
890 (Garbage_collection::gc_process_relocs): Likewise. Don't push
891 object/shndx pair onto *secvec for dynamic objects. Don't follow
892 relocations pointing to dynamic objects for GC.
893 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
894 (Icf::unfold_section): Likewise.
895 (Icf::is_section_folded): Likewise.
896 (Icf::get_folded_section): Likewise.
897 * icf.h: (Icf::get_folded_section): Likewise.
898 (Icf::unfold_section): Likewise.
899 (Icf::is_section_folded): Likewise.
900 (Icf::section_has_function_pointers): Likewise.
901 (Icf::set_section_has_function_pointers): Likewise.
902 * object.h (Section_id): Likewise.
903 (Const_section_id): Likewise.
904 * output.cc (Output_section::update_section_layout): Likewise.
905 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
906 Likewise.
907 * plugin.cc (update_section_order): Likewise.
908 (unique_segment_for_sections): Likewise.
909 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
910 (Target_powerpc::do_gc_add_reference): Likewise.
911 (Target_powerpc::gc_process_relocs): Likewise.
912 (Target_powerpc::do_gc_add_reference): Likewise.
913 * symtab.cc (Symbol_table::is_section_folded): Likewise.
914 (Symbol_table::gc_mark_symbol): Likewise.
915 * symtab.h: (Symbol_table::is_section_folded): Likewise.
916 * target.h: (Sized_target::gc_add_reference): Likewise.
917 (Sized_target::do_gc_add_reference): Likewise.
918
919 2015-04-29 Nick Clifton <nickc@redhat.com>
920
921 * po/fi.po: Updated Finnish translation.
922
923 2015-04-28 Alan Modra <amodra@gmail.com>
924
925 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
926 than unsigned int for find_global_entry result temp. Compare
927 against invalid_address.
928 (Target_powerpc::do_plt_address_for_global): Likewise.
929 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
930 on plt call stub existence for debug info. Do assert for plt
931 and global entry stub existence if an alloc section.
932
933 2015-04-28 Alan Modra <amodra@gmail.com>
934
935 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
936 on missing global entry stub due to bogus debug info.
937
938 2015-04-27 Han Shen <shenhan@google.com>
939
940 * options.h (--fix-cortex-a53-843419): Rename option.
941 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
942 option.
943 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
944
945 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
946
947 PR gold/18327
948 * output.cc (Output_section::is_input_address_mapped): Assume a missing
949 entry is mapped.
950 * testsuite/Makefile.am: Add the eh_test test.
951 * testsuite/Makefile.in: Regenerate.
952 * testsuite/eh_test_a.cc: New test.
953 * testsuite/eh_test_b.cc: New test.
954
955 2015-04-23 Sriraman Tallam <tmsriram@google.com>
956
957 * options.h (--weak-unresolved-symbols): New option.
958 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
959 binding to weak with new option.
960 * symtab.h (is_weak_undefined): Check for new option.
961 (is_strong_undefined): Check for new option.
962 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
963 * testsuite/Makefile.in: Regenerate.
964 * testsuite/weak_unresolved_symbols_test.cc: New file.
965
966 2015-04-20 Ian Coolidge <icoolidge@google.com>
967
968 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
969 GNU_UNIQUE.
970
971 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
972
973 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
974 push_back.
975 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
976 * object.cc (Sized_relobj_file::do_layout): Use push_back.
977 * powerpc.cc (process_gc_mark): Use push_back.
978 (Target_powerpc::do_gc_mark_symbol): Use push_back.
979 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
980
981 2015-04-16 Han Shen <shenhan@google.com>
982
983 * aarch64.cc (AArch64_insn_utilities): New utility class.
984 (AArch64_relobj::Mapping_symbol_position): New struct.
985 (AArch64_relobj::Mapping_symbol_info): New typedef.
986 (AArch64_relobj::do_count_local_symbols): New function overriding
987 parent's implementation.
988 (AArch64_relobj::mapping_symbol_info_): New member
989 (AArch64_relobj::scan_erratum_843419): New method.
990 (Target_aarch64::scan_erratum_843419_span): New method.
991 (Target_aarch64::is_erratum_843419_sequence): New method.
992 * options.h (fix_cortex_a53): New option.
993
994 2015-04-09 Cary Coutant <ccoutant@google.com>
995
996 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
997 in a PIE link.
998 * testsuite/Makefile.am (tls_pie_test.sh): New test.
999 * testsuite/Makefile.in: Regenerate.
1000 * testsuite/tls_pie_test.sh: New.
1001
1002 2015-04-09 Cary Coutant <ccoutant@google.com>
1003
1004 * debug.h (DEBUG_LOCATION): New.
1005 (DEBUG_ALL): Include DEBUG_LOCATION.
1006 (debug_string_to_enum): Add DEBUG_LOCATION.
1007 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
1008 output to print correct context.
1009 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
1010 up to 4 more locations at the beginning of the function.
1011 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
1012 result before sorting list of line numbers.
1013 * testsuite/debug_msg.sh: Allow range of line numbers for
1014 canonical results on optimized code.
1015
1016 2015-04-07 HC Yen <hc.yen@mediatek.com>
1017
1018 Add AArch32 support for gold linker.
1019 gold/
1020 * arm.cc: Add V8 arch combine table.
1021
1022 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1023
1024 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
1025
1026 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1027
1028 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
1029 to find by using the return value of insert.
1030
1031 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1032
1033 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
1034 constructor call.
1035
1036 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
1037
1038 PR gold/17641
1039 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
1040 (Target_x86_64::Scan::local): Don't create GOT entry, when we
1041 can convert mov to lea.
1042 (Target_x86_64::Scan::global): Ditto.
1043 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
1044 %reg to lea foo(%rip), %reg if possible.
1045 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
1046 * testsuite/x86_64_mov_to_lea1.s: New.
1047 * testsuite/x86_64_mov_to_lea2.s: Ditto.
1048 * testsuite/x86_64_mov_to_lea3.s: Ditto.
1049 * testsuite/x86_64_mov_to_lea4.s: Ditto.
1050 * testsuite/x86_64_mov_to_lea.sh: Ditto.
1051
1052 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
1053
1054 * configure: Regenerated.
1055
1056 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
1057
1058 PR gold/17640
1059 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1060 (Target_i386::Scan::local): Don't create GOT entry, when we
1061 can convert GOT to GOTOFF.
1062 (Target_i386::Scan::global): Ditto.
1063 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1064 lea foo@GOTOFF(%reg), %reg if possible.
1065 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1066 * testsuite/i386_mov_to_lea1.s: New.
1067 * testsuite/i386_mov_to_lea2.s: Ditto.
1068 * testsuite/i386_mov_to_lea3.s: Ditto.
1069 * testsuite/i386_mov_to_lea4.s: Ditto.
1070 * testsuite/i386_mov_to_lea5.s: Ditto.
1071 * testsuite/i386_mov_to_lea.sh: Ditto.
1072
1073 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1074
1075 * Makefile.am (ZLIB): New.
1076 (ZLIBINC): Likewise.
1077 (AM_CFLAGS): Add $(ZLIBINC).
1078 (AM_CXXFLAGS): Likewise.
1079 (ldadd_varldadd_var): Add $(ZLIB).
1080 (incremental_dump_LDADD): Likewise.
1081 (dwp_LDADD): Likewise.
1082 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1083 <zlib.h>.
1084 (zlib_compress): Don't check HAVE_ZLIB_H.
1085 (zlib_decompress): Likewise.
1086 * options.h (compress_debug_sections): Likewise.
1087 * configure.ac (AM_CONDITIONAL): Removed.
1088 * testsuite/Makefile.am (ZLIB): New.
1089 (LDADD): Add $(ZLIB).
1090 Don't check HAVE_ZLIB.
1091 * Makefile.in: Regenerated.
1092 * config.in: Likewise.
1093 * configure: Likewise.
1094 * testsuite/Makefile.in: Likewise.
1095
1096 2015-03-30 Jing Yu <jingyu@google.com>
1097
1098 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1099 TLSLD_ADD_DTPREL_LO12_NC.
1100 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1101 _TLS_MODULE_BASE_ point to the start of tls segment.
1102 (Target_aarch64::optimize_tls_reloc): Add cases for
1103 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1104 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1105 (Target_aarch64::Scan::local): Likewise.
1106 (Target_aarch64::Scan::global): Likewise.
1107 (Target_aarch64::Relocate::relocate): Likewise.
1108 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1109 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1110 relocations.
1111
1112 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1113
1114 * merge.cc (Object_merge_map::add_mapping): call
1115 Object_merge_map::Input_merge_map::add_mapping.
1116 (Object_merge_map::Input_merge_map::add_mapping): New.
1117 (Output_merge_data::do_add_input_section): Call
1118 get_or_make_input_merge_map before a loop.
1119 (Output_merge_string<Char_type>::finalize_merged_data): Call
1120 get_or_make_input_merge_map before a loop.
1121 * merge.h (Object_merge_map): Make Input_merge_map public.
1122 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1123 (Relobj::get_or_create_merge_map): New.
1124 * object.h (Relobj::get_or_create_merge_map): New.
1125
1126 2015-03-24 Alan Modra <amodra@gmail.com>
1127
1128 PR 18147
1129 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1130 relocation errors for branches to strong undefined symbols.
1131
1132 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1133
1134 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1135 (Object_merge_map::is_merge_section_for): Remove.
1136 (Object_merge_map::find_merge_section): New.
1137 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1138 (Object_merge_map::find_merge_section): New.
1139 (Object_merge_map::get_input_merge_map): Add a const version.
1140 * object.cc (Relobj::is_merge_section_for): Remove.
1141 (Relobj::find_merge_section): New.
1142 * object.h (Relobj::is_merge_section_for): Remove.
1143 (Relobj::find_merge_section): New.
1144 * output.cc
1145 (Output_section::Input_section::is_merge_section_for): Remove.
1146 (Output_section::add_merge_input_section): Don't call
1147 add_merge_input_section.
1148 (Output_section::find_merge_section): Return const. Use
1149 object->find_merge_section.
1150 (Output_section::build_lookup_maps): Don't build a map for
1151 merge sections.
1152 (Output_section::is_input_address_mapped): Return false if
1153 section is not found.
1154 (Output_section::find_starting_output_address): Use
1155 find_merge_section instead of is_merge_section_for.
1156 (Output_section::add_script_input_section): Don't build a map for
1157 merge sections.
1158 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1159 (Output_section_lookup_maps::find_merge_section): Remove.
1160 (Output_section_lookup_maps::add_merge_input_section) Remove.
1161 (Output_section::find_merge_section): Return const.
1162
1163 2015-03-22 Cary Coutant <cary@google.com>
1164
1165 PR gold/18106
1166 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1167 non-SIB form of lea, with nop after the call.
1168
1169 2015-03-21 Cary Coutant <cary@google.com>
1170
1171 PR gold/14217
1172 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1173 .tdata section.
1174 (Output_segment::set_section_addresses): Don't align size of relro
1175 segment for .tbss.
1176
1177 2015-03-21 Cary Coutant <cary@google.com>
1178
1179 PR gold/18010
1180 * stringpool.cc (Stringpool_template): Don't optimize if section
1181 alignment is greater than sizeof(char).
1182
1183 2015-03-21 Cary Coutant <cary@google.com>
1184
1185 PR gold/18048
1186 * script-c.h (script_include_directive): Add first_token parameter.
1187 * script.cc (script_include_directive): Add first_token parameter, and
1188 pass it to read_script_file.
1189 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1190 (PARSING_MEMORY_DEF): New tokens.
1191 (top): Add new productions for INCLUDE files.
1192 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1193 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1194 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1195 (section_cmd): Pass PARSING_SECTION_CMDS.
1196 (file_or_sections_cmd): Remove.
1197 (memory_def): Pass PARSING_MEMORY_DEF.
1198 * testsuite/Makefile.am (memory_test_2): New test.
1199 * testsuite/Makefile.in: Regenerate.
1200 * testsuite/memory_test_inc.t: New script file.
1201 * testsuite/memory_test_inc_1.t.src: New script file.
1202 * testsuite/memory_test_inc_2.t.src: New script file.
1203 * testsuite/memory_test_inc_3.t.src: New script file.
1204
1205 2015-03-21 Cary Coutant <cary@google.com>
1206
1207 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1208 (Sized_relobj_dwo::setup): Build compressed section map.
1209 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1210 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1211 section map.
1212 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1213 compressed_sections_ field.
1214 (build_compressed_section_map): Take Object instead of
1215 Sized_relobj_file parameter; add decompress_if_needed parameter.
1216 (Sized_relobj_file::do_find_special_sections): Store compressed
1217 section map in parent Object.
1218 (Sized_relobj_file::do_decompressed_section_contents): Move
1219 implementation to Object::decompressed_section_contents.
1220 (Sized_relobj_file::do_discard_decompressed_sections): Move
1221 implementation to Object::discard_decompressed_sections.
1222 * object.h (build_compressed_section_map): Declare.
1223 (Object::Object): Add compressed_sections_ field.
1224 (Object::section_is_compressed): Move implementation here.
1225 (Object::decompressed_section_contents): De-virtualize.
1226 (Object::discard_decompressed_sections): De-virtualize.
1227 (Object::do_section_is_compressed): Delete.
1228 (Object::do_decompressed_section_contents): Delete.
1229 (Object::set_compressed_sections): New method.
1230 (Object::compressed_sections): New method.
1231 (Object::compressed_sections_): New data member.
1232 (Compressed_section_info, Compressed_section_map): Move to top of file.
1233 (Sized_relobj_file::do_section_is_compressed): Delete.
1234 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1235 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1236 (Sized_relobj_file::compressed_sections_): Move to Object class.
1237
1238 2015-03-21 Cary Coutant <ccoutant@google.com>
1239
1240 PR gold/18152
1241 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1242 deferred objects.
1243
1244 2015-03-11 Cary Coutant <ccoutant@google.com>
1245
1246 * options.cc (General_options::finalize): Don't allow -z relro
1247 with incremental linking.
1248 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1249 (incremental_test_2): Likewise.
1250 (incremental_test_3): Likewise.
1251 (incremental_test_4): Likewise.
1252 (incremental_test_5): Likewise.
1253 (incremental_test_6): Likewise.
1254 (incremental_copy_test): Likewise.
1255 (incremental_common_test_1): Likewise.
1256 (incremental_comdat_test_1): Likewise.
1257 * testsuite/Makefile.in: Regenerate.
1258
1259 2015-03-09 Cary Coutant <ccoutant@google.com>
1260
1261 PR gold/14675
1262 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1263 return enum indicating whether .eh_frame section is empty, optimizable,
1264 unrecognized, or an end marker. Adjust explicit instantiations.
1265 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1266 (Eh_frame::add_ehframe_input_section): Change return type.
1267 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1268 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1269 to the .eh_frame output section until we see the end marker.
1270 (Layout::finalize_eh_frame_section): New.
1271 * layout.h: (Layout::finalize_eh_frame_section): New.
1272
1273 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1274
1275 * output.cc (Relobj::initialize_input_to_output_map<size>):
1276 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1277
1278 2015-03-04 Cary Coutant <ccoutant@google.com>
1279
1280 * parameters.cc (Parameters::set_target_once): Call
1281 Target::select_as_default_target just once from here...
1282 (set_parameters_target): ...instead of from here.
1283
1284 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1285
1286 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1287 Output_section_data instead of a Merge_map.
1288 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1289 (Eh_frame::read_cie): Use add_merge_mapping instead of
1290 Merge_map::add_mapping.
1291 (Eh_frame::read_fde): Ditto.
1292 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1293 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1294 merge_map_->get_output_offset.
1295 (Eh_frame::do_is_merge_section_for): Delete.
1296 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1297 instead of a Merge_map.
1298 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1299 Merge_map.
1300 (Eh_frame::do_is_merge_section_for): Delete.
1301 (Eh_frame::merge_map_): Delete.
1302 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1303 and use a Output_section_data instead of a Merge_map.
1304 (Object_merge_map::add_mapping): Ditto.
1305 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1306 (Object_merge_map::is_merge_section_for): Pass in and use a
1307 Output_section_data instead of a Merge_map.
1308 (Merge_map): Delete.
1309 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1310 of merge_map_.get_output_offset.
1311 (Output_merge_base::do_is_merge_section_for): Delete.
1312 (Output_merge_data::do_add_input_section): Use
1313 object->add_merge_mapping instead of add_mapping.
1314 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1315 * merge.h (Merge_map): Delete forward declaration.
1316 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1317 instead of a Merge_map.
1318 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1319 (Object_merge_map::is_merge_section_for): Pass in and use a
1320 Output_section_data instead of a Merge_map.
1321 (Input_merge_map::Object_merge_map::merge_map): Replace with
1322 output_data.
1323 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1324 Output_section_data instead of a Merge_map.
1325 (Merge_map): Delete.
1326 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1327 (Output_merge_base::do_is_merge_section_for): Delete.
1328 (Output_merge_base::add_mapping): Delete.
1329 (Output_merge_base::merge_map_): Delete.
1330 * object.cc (Relobj::initialize_input_to_output_map): New.
1331 (Relobj::initialize_input_to_output_map): New.
1332 (Relobj::merge_output_offset): New.
1333 (Relobj::is_merge_section_for): New.
1334 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1335 bits.
1336 * object.h (Relobj::merge_map): Delete.
1337 (initialize_input_to_output_map): New.
1338 (set_merge_map): Delete.
1339 (add_merge_mapping): New.
1340 (merge_output_offset): New.
1341 (is_merge_section_for): New.
1342 * output.cc (Output_section::Input_section::is_merge_section_for):
1343 Use object->is_merge_section_for.
1344 * output.h (Output_section_data::is_merge_section_for): Delete.
1345 (Output_section_data::do_is_merge_section_for): Delete.
1346 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1347 Use object->initialize_input_to_output_map.
1348 (Merged_symbol_value<size>::value_from_output_section): Use
1349 object->merge_output_offset.
1350
1351 2015-03-02 Peter Collingbourne <pcc@google.com>
1352 Cary Coutant <ccoutant@google.com>
1353
1354 * output.cc (Output_section::add_merge_input_section): Do not
1355 attempt to merge sections with an entsize of 0.
1356
1357 2015-03-02 Khem Raj <raj.khem@gmail.com>
1358
1359 * attributes.h (class Output_attributes_section_data ): Add
1360 do_print_to_mapfile function.
1361
1362 2015-02-24 Alan Modra <amodra@gmail.com>
1363
1364 PR 18010
1365 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1366 complain if value is not a multiple of four.
1367 (Target_powerpc::Relocate::relocate): Correct handling of
1368 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1369
1370 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1371
1372 * configure.ac (default_size): Set to 32 for x32.
1373 * configure: Regenerated.
1374
1375 2015-02-18 Alan Modra <amodra@gmail.com>
1376
1377 PR 17954
1378 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1379 visibility.
1380
1381 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1382
1383 * gc.h (Garbage_collection::add_reference): Don't use find.
1384
1385 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1386
1387 * object.cc (write_local_symbols): avoid std::vector copy.
1388
1389 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1390
1391 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1392
1393 2015-02-09 Mark Wielaard <mjw@redhat.com>
1394
1395 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1396 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1397
1398 2015-02-16 Cary Coutant <ccoutant@google.com>
1399
1400 PR gold/13577
1401 PR gold/16992
1402 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1403 DF_SYMBOLIC if --dynamic-list option is used.
1404 * options.cc (General_options::finalize): --dynamic-list is not
1405 mutually exclusive with -Bsymbolic.
1406 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1407 listed in --dynamic-list.
1408 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1409 -Bsymbolic-functions.
1410 * testsuite/Makefile.in: Regenerate.
1411
1412 2015-02-16 Cary Coutant <ccoutant@google.com>
1413
1414 PR gold/17971
1415 * incremental.cc: Remove redundant include of "output.h".
1416
1417 2015-02-12 Jing Yu <jingyu@google.com>
1418
1419 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1420 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1421 New relocation.
1422 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1423 TLSLE_MOVW_* relocations.
1424 (Target_aarch64::Scan::global): Likewise.
1425 (Target_aarch64::Relocate::relocate): Likewise.
1426 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1427 for new TLSLE_MOVW_* relocations.
1428
1429 2015-02-11 Will Newton <will.newton@linaro.org>
1430
1431 PR gold/13321
1432 * arm.cc (Target_arm::make_plt_section): Create an ARM
1433 state mapping symbol at the start of the PLT.
1434
1435 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1436
1437 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1438 Replace two_file_shared_2.so with two_file_shared_1.so.
1439 * testsuite/Makefile.in: Regenerated.
1440
1441 2015-02-09 Alan Modra <amodra@gmail.com>
1442
1443 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1444 plugin_test_thin.a and defsym_test.
1445 * testsuite/Makefile.in: Regenerate.
1446
1447 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1448
1449 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1450 body.
1451
1452 2015-02-04 Peter Collingbourne <pcc@google.com>
1453
1454 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1455 forwarding symbols when computing symbol resolution info for plugins.
1456 * plugin.h (Plugin_manager::symtab): New method.
1457 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1458
1459 2015-02-03 Cary Coutant <ccoutant@google.com>
1460 Peter Collingbourne <pcc@google.com>
1461
1462 PR gold/15660
1463 * archive.cc (Thin_archive_object_unlocker): New class.
1464 (Archive::include_member): Unlock external members of thin archives.
1465 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1466 (plugin_test_2): Likewise.
1467 (plugin_test_3): Likewise.
1468 (plugin_test_4): Likewise.
1469 (plugin_test_5): Likewise.
1470 (plugin_test_6): Likewise.
1471 (plugin_test_7): Likewise.
1472 (plugin_test_8): Likewise.
1473 (plugin_test_9): Likewise.
1474 (plugin_test_10): Likewise.
1475 (plugin_test_11): New test case.
1476 * testsuite/Makefile.in: Regenerate.
1477 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1478 file to decide whether to claim file.
1479 (all_symbols_read_hook): Likewise.
1480 * testsuite/plugin_test_1.sh: Adjust expected output.
1481 * testsuite/plugin_test_2.sh: Likewise.
1482 * testsuite/plugin_test_3.sh: Likewise.
1483 * testsuite/plugin_test_6.sh: Likewise.
1484 * testsuite/plugin_test_tls.sh: Likewise.
1485 * testsuite/plugin_test_11.sh: New testcase.
1486
1487 2015-02-03 Cary Coutant <ccoutant@google.com>
1488
1489 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1490 file descriptors when debugging enabled. Add debug output.
1491 (Descriptors::release): Add debug output.
1492 (Descriptors::close_some_descriptor): Likewise.
1493 (Descriptors::close_all): Likewise.
1494 * fileread.cc (File_read::lock): Likewise.
1495 (File_read::unlock): Likewise.
1496
1497 2015-02-02 Cary Coutant <ccoutant@google.com>
1498
1499 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1500 executable output file.
1501
1502 2015-01-22 Han Shen <shenhan@google.com>
1503
1504 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1505 (Target_arm::do_plt_address_for_global): New method.
1506 (Target_arm::do_plt_address_for_local): New method.
1507 (Target_arm::rel_irelative_section): New method.
1508 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1509 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1510 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1511 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1512 (Target_arm::Scan::check_non_pic): Add ifunc support.
1513 (Target_arm::Scan::local): Add ifunc support.
1514 (Target_arm::Scan::global): Add ifunc support.
1515 (Target_arm::make_plt_section): New method.
1516 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1517 (Target_arm::make_local_ifunc_plt_entry): New method.
1518 (Target_arm::got_irelative_): New member.
1519 (Target_arm::rel_irelative_): New member.
1520 (Target_arm::got_section): Add creation for got_irelative_.
1521 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1522 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1523 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1524 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1525 (Output_data_plt_arm::IRelative_data): New type.
1526 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1527 (Output_data_plt_arm::add_entry): Add more parameters.
1528 (Output_data_plt_arm::add_relocation): New method.
1529 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1530 (Output_data_plt_arm::rel_irelative): New method.
1531 (Output_data_plt_arm::entry_count): Modified.
1532 (Output_data_plt_arm::address_for_global): New method.
1533 (Output_data_plt_arm::address_for_local): New method.
1534 gold/
1535 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1536 (Output_data_plt_arm::insert_irelative_data): New method.
1537 (Output_data_plt_arm::irelative_rel_): New member.
1538 (Output_data_plt_arm::got_): New member.
1539 (Output_data_plt_arm::got_irelative_): New member.
1540 (Output_data_plt_arm::irelative_count_): New member.
1541 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1542 (Output_data_plt_arm::irelative_data_vec_): New member.
1543 (Output_data_plt_arm::do_write): Write out irelative entries.
1544 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1545 more parameters to ctor.
1546 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1547 more parameters to ctor.
1548 * output.h (Output_data_reloc::add_local_relative): New method.
1549 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1550
1551 2015-01-29 Alan Modra <amodra@gmail.com>
1552
1553 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1554 and GOT_TLSGD to LE optimization.
1555
1556 2015-01-28 Cary Coutant <ccoutant@google.com>
1557
1558 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1559 for undef TLS symbols.
1560 (Target_x86_64::Relocate::relocate_tls): Likewise.
1561 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1562
1563 2015-01-25 Cary Coutant <ccoutant@google.com>
1564
1565 * output.cc (Output_segment::set_section_addresses): Fix calculation
1566 of size of relro segment.
1567
1568 2015-01-22 Alan Modra <amodra@gmail.com>
1569
1570 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1571 condition for need of ifunc plt entry.
1572 (Target_powerpc::Scan::global <got relocs>): Likewise.
1573
1574 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1575
1576 * mips.cc (reloc_high): Add r_sym.
1577 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1578 reloc_high constructor.
1579 (Mips_relocate_functions::relgot16_local): Likewise.
1580 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1581 r_type to decide whether LO16 matches HI16.
1582 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1583 rello16 and relgot16_local.
1584
1585 2015-01-09 Cary Coutant <ccoutant@google.com>
1586
1587 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1588 unless alignment is larger than page size.
1589
1590 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1591 Cary Coutant <ccoutant@google.com>
1592
1593 PR gold/17729
1594 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1595 (DEFAULT_TARGET_X32): Set for x32.
1596 * x86_64.cc (cmp_insn_32): New.
1597 (lea_r10_insn_32): Likewise.
1598 (lea_r11_insn_32): Likewise.
1599 (cmp_insn_64): Likewise.
1600 (lea_r10_insn_64): Likewise.
1601 (lea_r11_insn_64): Likewise.
1602 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1603 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1604 (check_DATA): Add split_x32 files.
1605 (split_x32_[1234n].o): New targets.
1606 (split_x32_[124]): New targets.
1607 (split_x32_[1234r].stdout): New targets.
1608 * testsuite/split_x32.sh: New file.
1609 * testsuite/split_x32_1.s: Likewise.
1610 * testsuite/split_x32_2.s: Likewise.
1611 * testsuite/split_x32_3.s: Likewise.
1612 * testsuite/split_x32_4.s: Likewise.
1613 * testsuite/split_x32_n.s: Likewise.
1614 * configure: Regenerated.
1615 * testsuite/Makefile.in: Likewise.
1616
1617 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1618
1619 PR gold/17809
1620 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1621 x32.
1622
1623 2015-01-02 Alan Modra <amodra@gmail.com>
1624
1625 * version.cc (print_version): Just print current year.
1626 * dwp.cc (print_version): Likewise.
1627
1628 2015-01-01 Alan Modra <amodra@gmail.com>
1629
1630 Update year range in copyright notice of all files.
1631
1632 2014-12-25 Alan Modra <amodra@gmail.com>
1633
1634 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1635 new enums.
1636 (Target_arm::merge_object_attributes, ): Likewise.
1637
1638 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1639
1640 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1641 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1642 AEABI_VFP_args_vfp to check that.
1643 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1644 value and replace hardcoded values by enum values.
1645
1646 2014-12-22 Cary Coutant <ccoutant@google.com>
1647
1648 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1649
1650 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1651
1652 PR gold/14608
1653 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1654 to "return i * i * 3;".
1655
1656 2014-12-16 Cary Coutant <ccoutant@google.com>
1657
1658 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1659 (Mapfile::print_output_data): Use current_data_size() to avoid
1660 assert for sections requiring postprocessing; if address is not valid,
1661 print 0.
1662 (Mapfile::print_output_section): Use current_data_size(); print note
1663 that addresses and sizes are before compression.
1664
1665 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1666
1667 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1668 Cast current_group_size to unsigned long when reporting error.
1669
1670 2014-12-10 Jing Yu <jingyu@google.com>
1671
1672 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1673 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1674 Update error message.
1675 (Target_aarch64::do_relax): Use absolute value of option
1676 stub_group_size. Replace local variable with class member
1677 stub_group_size_.
1678
1679 2014-12-04 Alan Modra <amodra@gmail.com>
1680
1681 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1682 addend of PLTREL24 reloc when not generating a plt stub. Make
1683 max_branch_offset an "Address".
1684 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1685 (Target_powerpc::Relocate::relocate): Likewise.
1686
1687 2014-12-04 Alan Modra <amodra@gmail.com>
1688
1689 PR 17670
1690 * symtab.cc (Symbol::set_undefined): Remove assertion.
1691 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1692 on symbols defined in discarded sections, instead return false.
1693 Rearrange params, update all callers.
1694 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1695 branches to syms in discarded sections.
1696 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1697 undefined and flag as discarded.
1698 (Target_powerpc::Relocate::relocate): Localize variable.
1699
1700 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1701
1702 PR gold/17675
1703 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1704 * testsuite/Makefile.in: Regenerated.
1705
1706 2014-12-03 Alan Modra <amodra@gmail.com>
1707
1708 PR 17566
1709 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1710 when adding dynamic relocations against section symbols.
1711
1712 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1713
1714 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1715 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1716 * options.h (General_options): New -z option (global).
1717
1718 2014-12-01 Cary Coutant <ccoutant@google.com>
1719
1720 PR gold/17578
1721 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1722 is given.
1723 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1724 given but some inputs require executable stack.
1725
1726 2014-11-26 Cary Coutant <ccoutant@google.com>
1727
1728 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1729 .debug_str_offsets; strip .debug_gnu_pubnames and
1730 .debug_gnu_pubtypes.
1731 (lines_only_debug_sections): Strip all four new sections.
1732
1733 2014-11-26 Jing Yu <jingyu@google.com>
1734
1735 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1736 register to be x0 when to relax TLSDESC_LD64_LO12.
1737
1738 2014-11-26 Alan Modra <amodra@gmail.com>
1739
1740 * powerpc.cc (struct Stub_table_owner): New.
1741 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1742 unsigned int vector. Update all references.
1743 (powerpc_relobj::set_stub_table): Take an unsigned int param
1744 rather than a Stub_table. Update callers.
1745 (Powerpc_relobj::clear_stub_table): New function.
1746 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1747 stub_group_size_ vars.
1748 (Target_powerpc::new_stub_table): Delete.
1749 (max_branch_delta): New function, extracted from..
1750 (Target_powerpc::Relocate::relocate): ..here..
1751 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1752 status on whether stub created successfully.
1753 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1754 default sizing to..
1755 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1756 reduce on relax failure.
1757 (Target_powerpc::group_sections): Add "no_size_errors" param.
1758 Use stub_group_size_. Set up group info in a temp vector,
1759 before building Stub_table vector. Account for input sections
1760 possibly already converted to relaxed sections.
1761 (Stub_table::init): Delete. Merge into..
1762 (Stub_table::Stub_table): ..here.
1763 (Stub_table::can_reach_stub): New function.
1764 (Stub_table::add_plt_call_entry): Add "from" parameter and
1765 return true iff stub could be reached.
1766 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1767 param too.
1768 (Stub_table::clear_stubs): Add "all" param.
1769
1770 2014-11-26 Alan Modra <amodra@gmail.com>
1771
1772 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1773 (Target_powerpc::group_sections): Use it.
1774
1775 2014-11-25 Cary Coutant <ccoutant@google.com>
1776
1777 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1778 (Binary_to_elf::write_symbol): Add st_size parameter.
1779 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1780
1781 2014-11-25 Cary Coutant <ccoutant@google.com>
1782
1783 PR gold/17639
1784 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1785 (Sized_relobj_file::do_layout): Handle deferred sections properly
1786 during GC pass 1. Don't add reloc sections to deferred list twice.
1787 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1788 (Sized_relobj_file::is_deferred_layout_): New data member.
1789
1790 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1791
1792 PR gold/17619
1793 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1794 Check PC-relative offset overflow in PLT entry.
1795
1796 2014-11-21 Alan Modra <amodra@gmail.com>
1797
1798 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1799 for undefined weaks.
1800
1801 2014-11-20 Alan Modra <amodra@gmail.com>
1802
1803 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1804 from --stub-group-size parameter divided by 1024.
1805 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1806 template parameter. Update all uses.
1807 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1808 has_stub_value. Set for long branches. Don't report overflow for
1809 branch to undefined weak symbols. Print info message on
1810 overflowing branch to stub.
1811
1812 2014-11-20 Alan Modra <amodra@gmail.com>
1813
1814 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1815
1816 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1817
1818 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1819 entry for R_X86_64_GOTPLT64.
1820 (Target_x86_64<size>::Relocate::relocate): Update comments for
1821 R_X86_64_GOTPLT64.
1822
1823 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1824
1825 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1826 * plugin.h: add lock definition
1827
1828 2014-10-29 Han Shen <shenhan@google.com>
1829 Jing Yu <jingyu@google.com>
1830
1831 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1832 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1833 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1834 Symbol::TLS_REF.
1835 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1836 method.
1837 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1838 (Target_aarch64::tls_ld_to_le): New method.
1839 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1840 for 64bit targets.
1841 (Output_data_plt_aarch64::irelative_rel_): New data member.
1842 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1843 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1844 (Output_data_plt_aarch64::add_relocation): New method.
1845 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1846 offset. Add got_irelative size to got size.
1847 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1848 type string with the new typename.
1849 (AArch64_relocate_functions::update_adr): Replace parameter x with
1850 immed.
1851 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1852 (AArch64_relocate_functions::reloc_common): New method.
1853 (AArch64_relocate_funcsions::rela_general): Extract common part out
1854 into reloc_common method.
1855 (AArch64_relocate_functions::rela_general): Likewise.
1856 (AArch64_relocate_functions::pcrela_general): Likewise.
1857 (AArch64_relocate_functions::adr): New method.
1858 (AArch64_relocate_functions::adrp): Calculate immed before calling
1859 update_adr.
1860 (AArch64_relocate_functions::adrp): Likewise.
1861 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1862 comparing x to 0. Calculate immed from ~x when x < 0.
1863 (Target_aarch64::optimize_tls_reloc): Add new cases for
1864 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1865 TLSLD_MOVW_DTPREL_G0_NC.
1866 (Target_aarch64::possible_function_pointer_reloc): Implement this
1867 method.
1868 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1869 comment.
1870 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1871 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1872 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1873 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1874 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1875 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1876 (Target_aarch64::make_plt_entry): Call add_entry with two more
1877 parameters.
1878 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1879 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1880 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1881 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1882 (Target_aarch64::Relocate::relocate_tls): Add cases for
1883 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1884 TLSLD_MOVW_DTPREL_G0_NC.
1885 * testsuite/icf_safe_so_test.cc: Correct test comment.
1886 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1887
1888 2014-10-22 Alan Modra <amodra@gmail.com>
1889
1890 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1891 thread_starter.
1892
1893 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1894
1895 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1896
1897 2014-10-17 Cary Coutant <ccoutant@google.com>
1898
1899 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1900 Add "typename" keyword.
1901
1902 2014-10-15 Han Shen <shenhan@google.com>
1903 Jing Yu <jingyu@google.com>
1904
1905 Patch for gold aarch64 backend to support relaxation.
1906 * aarch64-reloc.def: Change format.
1907 * aarch64.cc (class Reloc_stub): New class.
1908 (class Stub_table): New class.
1909 (class AArch64_relobj): New class.
1910 (class AArch64_input_section): New class.
1911 (class AArch64_output_section): New class.
1912 (Target_aarch64::new_stub_table): New method.
1913 (Target_aarch64::new_aarch64_input_section): New method.
1914 (Target_aarch64::find_aarch64_input_section): New method.
1915 (Target_aarch64::scan_section_for_stubs): New method.
1916 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1917 (Target_aarch64::relocate_stub): New method.
1918 (Target_aarch64::current_target): New method.
1919 (Target_aarch64::do_make_elf_object): New method.
1920 (Target_aarch64::do_may_relax): New method.
1921 (Target_aarch64::do_relax): New method.
1922 (Target_aarch64::group_sections): New method.
1923 (Target_aarch64::scan_reloc_for_stub): New method.
1924 (Target_aarch64::do_make_output_section): New method.
1925 (Target_aarch64::stub_tables_): New data member.
1926 (Target_aarch64::aarch64_input_section_map_): New data member.
1927 (AArch64_relocate_functions::maybe_apply_stub): New method.
1928
1929 2014-09-30 Cary Coutant <ccoutant@google.com>
1930
1931 PR gold/17432
1932 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1933
1934 2014-09-30 Kito Cheng <kito@0xlab.org>
1935
1936 PR gold/13597
1937 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1938 hash table before sysv-style hash table.
1939
1940 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1941
1942 * options.h (--pic-executable): Add negative to alias to -no-pie.
1943
1944 2014-09-26 Cary Coutant <ccoutant@google.com>
1945
1946 PR gold/16773
1947 * object.cc (Sized_relobj_file): Compute value of section symbols
1948 for TLS sections the same as TLS symbols.
1949
1950 2014-09-25 Cary Coutant <ccoutant@google.com>
1951
1952 PR gold/17432
1953 * resolve.cc (Symbol_table::resolve): Override common placeholder
1954 symbols, but adjust sizes.
1955 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1956 symbols to common lists.
1957
1958 2014-09-24 Alan Modra <amodra@gmail.com>
1959
1960 * po/POTFILES.in: Regenerate.
1961
1962 2014-09-23 Taiju Tsuiki <tzik@google.com>
1963 Cary Coutant <ccoutant@google.com>
1964
1965 PR gold/14860
1966 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1967 on input_sections_blocker.
1968 * layout.cc (Write_sections_task::locks): Unblock
1969 input_sections_blocker_.
1970 * layout.h (Write_sections_task::Write_sections_task): Add
1971 input_sections_blocker.
1972 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1973 to DEPENDENCIES.
1974 * testsuite/Makefile.in: Regenerate.
1975
1976 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1977
1978 * testsuite/Makefile.am (plugin_test_10): New test.
1979 * testsuite/Makefile.in: Regenerate
1980 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1981 * testsuite/plugin_test_10.sh: New file.
1982
1983 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1984
1985 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1986 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1987 during the replacement phase.
1988
1989 2014-09-17 Han Shen <shenhan@google.com>
1990 Jing Yu <jingyu@google.com>
1991
1992 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1993 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1994 * aarch64.cc (Target_aarch64): Add data members
1995 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1996 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1997 constructor.
1998 (Target_aarch64::do_reloc_symbol_index): New method.
1999 (Target_aarch64::do_reloc_addend): New method.
2000 (Target_aarch64::add_tlsdesc_info): New method.
2001 (Target_aarch64::do_dynsym_value): New method.
2002 (Target_aarch64::do_make_data_plt): Add new parameters: got,
2003 got_irelative. Pass them to Output_data_plt_aarch64_standard.
2004 (Target_aarch64::make_data_plt): Add new parameters: got,
2005 got_irelative. Pass them to do_make_data_plt.
2006 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
2007 (Target_aarch64::Relocate:tls_gd_to_le): New method.
2008 (Target_aarch64::Relocate:tls_ie_to_le): New method.
2009 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
2010 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
2011 (Target_aarch64::got_tlsdesc_section): New method.
2012 (Target_aarch64::make_local_ifunc_plt_entry): New method.
2013 (Target_aarch64::define_tls_base_symbol): New method.
2014 (Target_aarch64::reserve_tlsdesc_entries): New method.
2015 (Target_aarch64::got_mod_index_entry): New method.
2016 (Target_aarch64::rela_tlsdesc_section): New method.
2017 (Target_aarch64::rela_irelative_section): New method.
2018 (Target_aarch64::Tlsdesc_info): New struct.
2019 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
2020 relocations and tlsdesc relocations.
2021 (Target_aarch64::optimize_tls_reloc): Implement method.
2022 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
2023 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
2024 in constructor.
2025 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
2026 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
2027 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
2028 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
2029 (Output_data_plt_aarch64::rela_tlsdesc): New method.
2030 (Output_data_plt_aarch64::rela_irelative): New method.
2031 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
2032 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
2033 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
2034 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
2035 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
2036 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
2037 (Output_data_plt_aarch64_standard): New member variables:
2038 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
2039 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
2040 New parameter: got, got_irelative.
2041 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
2042 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
2043 (Output_data_plt_aarch64::do_write): Replace got_address with
2044 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
2045 (AArch64_relocate_functions::update_movnz): New method.
2046 (AArch64_relocate_functions): Correct format.
2047 (AArch64_relocate_functions::movnz): New method.
2048 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
2049 before the switch. Add new cases to switch.
2050 Check ie_to_le relaxation on tlsie relocations. Add code handling
2051 tlsgd tlsdesc cases.
2052 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
2053 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
2054 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
2055 Call reloc_name_in_error_message to print unsupported reloc.
2056 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
2057 make_data_plt.
2058 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
2059 relocs. Fill in some more dynamic tags.
2060 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2061 Skip call tls_get_addr when tlsgd is relaxed.
2062 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2063 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2064 tlsdesc->ie relaxation.
2065
2066 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2067
2068 * mips.cc (Target_mips_nacl): New class.
2069 (Target_selector_mips_nacl): New class.
2070 (target_selector_mips32): Rename from target_selector_mips32be and use
2071 Target_selector_mips_nacl instead of Target_selector_mips.
2072 (target_selector_mips32el): Rename from target_selector_mips32 and use
2073 Target_selector_mips_nacl instead of Target_selector_mips.
2074 (target_selector_mips64): Rename from target_selector_mips64be and use
2075 Target_selector_mips_nacl instead of Target_selector_mips.
2076 (target_selector_mips64el): Rename from target_selector_mips64 and use
2077 Target_selector_mips_nacl instead of Target_selector_mips.
2078 (Target_mips::mips_info): Add const attribute.
2079
2080 2014-09-02 Cary Coutant <ccoutant@google.com>
2081
2082 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2083 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2084 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2085 (Sized_incr_dynobj::do_section_name): Likewise.
2086 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2087 (Sized_incr_dynobj::do_section_name): Likewise.
2088 * object.h (Object::section_name): Likewise.
2089 (Object::do_section_name): Likewise.
2090 (Sized_relobj_file::do_section_name): Likewise.
2091 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2092 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2093
2094 2014-09-02 Cary Coutant <ccoutant@google.com>
2095
2096 PR gold/17005
2097 * ehframe.cc (Fde::write): Add output_offset parameter.
2098 (Cie::write): Likewise.
2099 (Eh_frame::set_final_data_size): Account for offset within output
2100 section.
2101 (Eh_frame::do_sized_write): Likewise.
2102 * ehframe.h (Fde::write): Add output_offset parameter.
2103 (Cie::write): Likewise.
2104 * output.cc (Output_section::Input_section_sort_entry): Remove
2105 section_has_name_; add output_section_name parameter. Use
2106 output section name for non-input sections.
2107 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2108 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2109 (Output_section::Input_section_sort_compare): Remove logic for
2110 sections without names.
2111 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2112 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2113 Likewise.
2114 (Output_section::Input_section_sort_section_name_compare): Likewise.
2115
2116 2014-08-29 Han Shen <shenhan@google.com>
2117 Jing Yu <jingyu@google.com>
2118
2119 * aarch64-reloc-property.cc
2120 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2121 reference reloc property in the table.
2122 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2123 3 other entries.
2124 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2125 2 new overloaded methods.
2126 (Output_data_got_aarch64::do_write): Add code to write out
2127 static relocs.
2128 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2129 static relocs.
2130 (Output_data_got_aarch64::static_relocs): New vector to
2131 hold static relocs.
2132 (Target_aarch64::TCB_SIZE): New const static memeber.
2133 (Target_aarch64::tcb_size): New method.
2134 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2135 (Target_aarch64::Relocate::relocate_tls): New method.
2136 (Target_aarch64::Scan::local): Add code handling new reloc types.
2137 (Target_aarch64::Scan::global): Add code handling new reloc types.
2138
2139 2014-08-13 Sriraman Tallam <tmsriram@google.com>
2140
2141 * options.h (-no-pie): Add option.
2142
2143 2014-08-08 Jing Yu <jingyu@google.com>
2144 Han Shen <shenhan@google.com>
2145
2146 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2147 (DEFFILES): add aarch64-reloc.def.
2148 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2149 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2150 * Makefile.in: Regenerate.
2151 * aarch64-reloc-property.cc: New file.
2152 * aarch64-reloc-property.h: New file.
2153 * aarch64-reloc.def: New file.
2154 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2155 with tab to make the format consistent.
2156 (Output_data_got_aarch64::symbol_table_): New method.
2157 (Target_aarch64::do_plt_address_for_global): New method.
2158 (Target_aarch64::do_plt_address_for_local): New method.
2159 (Target_aarch64::do_select_as_default_target): New method.
2160 (Target_aarch64::do_make_data_plt): New method.
2161 (Target_aarch64::make_data_plt): New method.
2162 (Output_data_plt_aarch64::has_irelative_section): New method.
2163 (Output_data_plt_aarch64::address_for_global): New method.
2164 (Output_data_plt_aarch64::address_for_local): New method.
2165 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2166 (Output_data_plt_aarch64::add_entry): Implement contents.
2167 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2168 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2169 the got_pov entry to plt0.
2170 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2171 Implement contents.
2172 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2173 (AArch64_howto): New struct.
2174 (aarch64_howto[]): New static const array.
2175 (AArch64_relocate_functions): New class.
2176 (Target_aarch64::Scan::get_reference_flags): Remove method.
2177 (Target_aarch64::Scan::local): Implement to support a few relocations.
2178 (Target_aarch64::Scan::global): Implement to support a few relocations.
2179 (Target_aarch64::make_plt_section): Implement contents.
2180 (Target_aarch64::make_plt_entry): Implement contents.
2181 (Target_aarch64::do_finalize_sections): Implement contents.
2182 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2183 (Target_aarch64::relocate_section): Implement contents.
2184
2185 2014-08-06 Alan Modra <amodra@gmail.com>
2186
2187 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2188
2189 2014-08-06 Alan Modra <amodra@gmail.com>
2190
2191 PR 13227
2192 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2193
2194 2014-07-21 Sriraman Tallam <tmsriram@google.com>
2195
2196 * object.cc (Relobj::is_section_name_included): Add
2197 ".rodata.nptl_version" to not garbage collect this section.
2198
2199 2014-07-08 Cary Coutant <ccoutant@google.com>
2200
2201 * expression.cc (struct Expression::Expression_eval_info): Add
2202 new fields type_pointer, vis_pointer, and nonvis_pointer.
2203 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2204 nonvis_pointer parameters. Adjust all calls.
2205 (Symbol_expression::value): Update type, visibility, and nonvis bits
2206 in caller.
2207 * script.cc (Symbol_assignment::sized_finalize): Update type,
2208 visibility, and remaining st_other bits for new symbol.
2209 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2210 vis_pointer, and nonvis_pointer parameters.
2211 * symtab.h (Symbol::set_type): New method.
2212
2213 * testsuite/Makefile.am (defsym_test): New test.
2214 * testsuite/Makefile.in: Regenerate.
2215 * testsuite/defsym_test.c: New file.
2216 * testsuite/defsym_test.sh: New file.
2217
2218 2014-07-08 Cary Coutant <ccoutant@google.com>
2219
2220 PR gold/15639
2221 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2222 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2223 (Sized_dynobj::base_read_symbols): ...new method.
2224 * object.h (Sized_relobj_file::base_read_symbols): New method.
2225 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2226 (Sized_relobj_file::base_read_symbols): ...new method.
2227 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2228 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2229 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2230
2231 2014-07-04 Alan Modra <amodra@gmail.com>
2232
2233 * po/POTFILES.in: Regenerate.
2234
2235 2014-07-02 Jing Yu <jingyu@google.com>
2236
2237 * aarch64.cc: New file
2238 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2239 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2240 * Makefile.in: Regenerate.
2241 * configure.tgt: Add entries for aarch64*.
2242 * configure.ac: Likewise.
2243 * configure: Likewise.
2244
2245 2014-06-27 Alan Modra <amodra@gmail.com>
2246
2247 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2248
2249 2014-06-24 Cary Coutant <ccoutant@google.com>
2250
2251 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2252 sections.
2253 (Dwo_file::sized_read_unit_index): Likewise.
2254
2255 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2256
2257 * mips.cc: New file.
2258 * Makefile.am (TARGETSOURCES): Add mips.cc
2259 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2260 * configure.tgt: Add entries for mips*.
2261 * configure.ac: Likewise.
2262 * Makefile.in: Regenerate.
2263 * configure: Likewise.
2264
2265 2014-06-09 Cary Coutant <ccoutant@google.com>
2266
2267 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2268 unit_length is within section bounds.
2269
2270 2014-06-09 Cary Coutant <ccoutant@google.com>
2271
2272 PR gold/16980
2273 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2274 map.
2275
2276 2014-06-07 Alan Modra <amodra@gmail.com>
2277
2278 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2279
2280 2014-06-06 Cary Coutant <ccoutant@google.com>
2281
2282 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2283 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2284 (Dwarf_pubnames_table::read_header): Likewise.
2285 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2286 .debug_gnu_pubtypes.
2287
2288 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2289
2290 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2291 * Makefile.in, configure: Regenerate.
2292
2293 2014-06-03 Alan Modra <amodra@gmail.com>
2294
2295 * powerpc.cc (addis_12_2): Define.
2296 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2297
2298 2014-06-03 Alan Modra <amodra@gmail.com>
2299
2300 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2301 st_other output.
2302
2303 2014-06-02 Alan Modra <amodra@gmail.com>
2304
2305 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2306 Only ignore relocs on ELFv1.
2307 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2308
2309 2014-05-30 Cary Coutant <ccoutant@google.com>
2310
2311 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2312 * testsuite/Makefile.in: Regenerate.
2313 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2314
2315 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2316
2317 PR gold/16945
2318 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2319 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2320
2321 2014-05-15 Alan Modra <amodra@gmail.com>
2322
2323 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2324 Compare FDE contents with DW_CFA_nop rather than 0.
2325
2326 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2327
2328 * symtab.h (may_need_copy_reloc): Remove check for position independent
2329 code.
2330 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2331 position independence before pc absolute may_need_copy_reloc call.
2332 Add check for executable output befor pc relative may_need_copy_reloc
2333 call.
2334 * i386.cc: Ditto.
2335 * arm.cc: Ditto.
2336 * sparc.cc: Ditto.
2337 * tilegx.cc: Ditto.
2338 * powerpc.cc: Add check for no position independence before
2339 may_need_copy_reloc calls.
2340 * testsuite/pie_copyrelocs_test.cc: New file.
2341 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2342 * Makefile.am (pie_copyrelocs_test): New test.
2343 * Makefile.in: Regenerate.
2344
2345 2014-05-08 Martin Liška <mliska@suse.cz>
2346
2347 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2348
2349 2014-05-06 Cary Coutant <ccoutant@google.com>
2350
2351 PR gold/16900
2352 * i386.cc (Output_data_got_plt_i386): New class.
2353 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2354 parameter. Change all callers.
2355 (Output_data_plt_i386::layout_): Remove.
2356 (Output_data_plt_i386::got_plt_): Change type.
2357 (Target_i386::got_plt_): Change type. Change all references.
2358 (Target_i386::got_section): Create instance of new class.
2359 (Output_data_got_plt_i386::do_write): New function.
2360 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2361 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2362 parameter. Change all callers.
2363 (Output_data_plt_x86_64::layout_): Remove.
2364 (Output_data_plt_x86_64::got_plt_): Change type.
2365 (Target_x86_64::got_plt_): Change type. Change all references.
2366 (Target_x86_64::got_section): Create instance of new class.
2367 (Output_data_got_plt_x86_64::do_write): New function.
2368 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2369 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2370 class.
2371
2372 2014-05-05 Cary Coutant <ccoutant@google.com>
2373
2374 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2375 if we have pubnames/pubtypes.
2376
2377 2014-05-02 Cary Coutant <ccoutant@google.com>
2378
2379 * defstd.cc (in_segment): Define __ehdr_start here...
2380 * layout.cc (Layout::finalize): ...Instead of here. Set the
2381 output segment when known.
2382 * resolve.cc (Symbol::override_base_with_special): Remember
2383 the original binding.
2384 * symtab.cc (Symbol::set_output_segment): New function.
2385 (Symbol::set_undefined): New function.
2386 * symtab.h (Symbol::is_weak_undefined): Check original undef
2387 binding.
2388 (Symbol::is_strong_undefined): New function.
2389 (Symbol::set_output_segment): New function.
2390 (Symbol::set_undefined): New function.
2391 * target-reloc.h (is_strong_undefined): Remove.
2392 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2393 Check for hidden undefs.
2394 (relocate_section): Call Symbol::is_strong_undefined.
2395
2396 * testsuite/Makefile.am (ehdr_start_test_1)
2397 (ehdr_start_test_2, ehdr_start_test_3)
2398 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2399 * testsuite/Makefile.in: Regenerate.
2400 * testsuite/ehdr_start_def.cc: New source file.
2401 * testsuite/ehdr_start_test.cc: New source file.
2402 * testsuite/ehdr_start_test.t: New linker script.
2403 * testsuite/ehdr_start_test_4.sh: New shell script.
2404
2405 2014-04-23 Cary Coutant <ccoutant@google.com>
2406
2407 PR gold/16870
2408 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2409
2410 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2411
2412 * layout.cc (Layout::include_section): Allow a target to decide
2413 whether to include a section.
2414 * target.h (Target::should_include_section): New function.
2415 (Target::do_should_include_section): New function.
2416
2417 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2418
2419 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2420 inline into ...
2421 (Copy_relocs::emit): ... here.
2422 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2423 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2424 (Copy_reloc_entry::entries_): Change from private to protected.
2425
2426 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2427
2428 * icf.cc (get_section_contents): Replace copies of reloc
2429 vectors with const references.
2430
2431 2014-04-02 Cary Coutant <ccoutant@google.com>
2432
2433 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2434 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2435 * configure: Regenerate.
2436 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2437 -fno-use-linker-plugin.
2438 (LINK1, CXXLINK1): Add it to the link command.
2439 * testsuite/Makefile.in: Regenerate.
2440
2441 2014-03-12 Alan Modra <amodra@gmail.com>
2442
2443 * Makefile.in: Regenerate.
2444
2445 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2446
2447 * symtab.h (Symbol::set_nonvis): New function.
2448
2449 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2450
2451 * symtab.cc (Sized_symbol<32>::init_output_data):
2452 Instantiate the template.
2453 (Sized_symbol<64>::init_output_data): Likewise.
2454
2455 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2456
2457 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2458 adjust dynamic symbol value.
2459 * target.h (Target::adjust_dyn_symbol): New function.
2460 (Target::do_adjust_dyn_symbol): New function.
2461
2462 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2463
2464 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2465 Get the value of DYNAMIC_CUSTOM dynamic entry.
2466 * output.h (Output_data_dynamic::add_custom): New function.
2467 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2468 dynamic entry.
2469 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2470 * target.h (Target::dynamic_tag_custom_value): New function.
2471 (Target::do_dynamic_tag_custom_value): New function.
2472
2473 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2474
2475 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2476 dynsym indexes.
2477 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2478 (Target::do_has_custom_set_dynsym_indexes): New function.
2479 (Target::set_dynsym_indexes): New function.
2480 (Target::do_set_dynsym_indexes): New function.
2481
2482 2014-03-07 Alan Modra <amodra@gmail.com>
2483
2484 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2485 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2486 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2487 (Powerpc_relocate_functions::has_overflow_bitfield,
2488 overflowed): Use the above.
2489 (Target_powerpc::Relocate::relocate): Correct overflow checking
2490 for a number of relocations. Modify overflow test for 16-bit
2491 fields in instructions to signed/unsigned according to whether
2492 the field takes a signed or unsigned value.
2493
2494 2014-03-05 Alan Modra <amodra@gmail.com>
2495
2496 Update copyright years.
2497
2498 2014-03-05 Alan Modra <amodra@gmail.com>
2499
2500 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2501 R_PPC64_ADDR64_LOCAL.
2502 (Target_powerpc::Relocate::relocate): Likewise.
2503
2504 2014-03-03 Alan Modra <amodra@gmail.com>
2505
2506 * dwp.cc (print_version): Update copyright year to current.
2507
2508 2014-02-10 Alan Modra <amodra@gmail.com>
2509
2510 * po/gold.pot: Regenerate.
2511
2512 2014-02-06 Cary Coutant <ccoutant@google.com>
2513
2514 Fix problem where -u is ignored when a weak undef is seen.
2515
2516 * archive.cc (Library_base::should_include_member): Reorder
2517 code to check for -u option if a weak undef has already been seen.
2518 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2519 * testsuite/Makefile.in: Regenerate.
2520 * testsuite/weak_undef_file3.cc: New file.
2521 * testsuite/weak_undef_file4.cc: New file.
2522 * testsuite/weak_undef_test_2.cc: New file.
2523
2524 2014-02-05 Cary Coutant <ccoutant@google.com>
2525
2526 Fix issues with gold undefined symbol diagnostics.
2527
2528 PR binutils/15435
2529 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2530 check to here.
2531 * target-reloc.h (is_strong_undefined): New function.
2532 (relocate_section): Move undef vtable symbol check from here.
2533 Check for is_strong_undefined.
2534
2535 2014-02-05 Cary Coutant <ccoutant@google.com>
2536
2537 Fix problems with the --dynamic-list option.
2538
2539 PR gold/13577
2540 * options.cc (General_options::parse_dynamic_list):
2541 Set have_dynamic_list_.
2542 (General_options::General_options): Initialize have_dynamic_list_.
2543 (General_options::finalize): Turn off -Bsymbolic and
2544 -Bsymbolic-functions if --dynamic-list provided.
2545 * options.h (General_options::have_dynamic_list): New function.
2546 (General_options::have_dynamic_list_): New data member.
2547 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2548 correctly.
2549
2550 PR gold/16530
2551 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2552 in --dynamic-list, mark it.
2553
2554 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2555 (dynamic_list_2): New test case.
2556 * testsuite/Makefile.in: Regenerate.
2557 * testsuite/dynamic_list_2.cc: New file.
2558 * testsuite/dynamic_list_2.t: New file.
2559 * testsuite/dynamic_list_lib1.cc: New file.
2560 * testsuite/dynamic_list_lib2.cc: New file.
2561 * testsuite/gc_dynamic_list_test.c: New file.
2562 * testsuite/gc_dynamic_list_test.sh: New file.
2563 * testsuite/gc_dynamic_list_test.t: New file.
2564
2565 2014-01-28 Cary Coutant <ccoutant@google.com>
2566
2567 Add .gdb_index version 7 support.
2568
2569 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2570 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2571 debug sections.
2572 (Dwarf_ranges_table::read_ranges_table): Likewise.
2573 (Dwarf_pubnames_table::read_section): Check for GNU-style
2574 sections, and for compressed debug sections.
2575 (Dwarf_pubnames_table::read_header): Compute end address of table.
2576 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2577 for end of list by offset, not by offset == 0.
2578 (Dwarf_info_reader::do_read_string_table): Check for compressed
2579 debug sections.
2580 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2581 Initialize new data members.
2582 (Dwarf_pubnames_table::next_name): return flag_byte.
2583 (Dwarf_pubnames_table::end_of_table_): New data member.
2584 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2585 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2586 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2587 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2588 read skeleton type unit DIEs.
2589 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2590 (Gdb_index::do_write): Write flag_byte.
2591 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2592 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2593 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2594 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2595
2596 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2597
2598 * version.cc (print_version): Update copyright year to 2014.
2599
2600 2013-12-19 Dimitry Andric <dimitry@andric.com>
2601
2602 * stringpool.cc (Stringpool_template::reserve): Add
2603 HAVE_UNORDERED_MAP case.
2604 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2605
2606 2013-12-18 Cary Coutant <ccoutant@google.com>
2607
2608 * configure.ac: Check for <unordered_set> and <unordered_map>.
2609 * config.in: Regenerate.
2610 * configure: Regenerate.
2611 * system.h: Use <unordered_set> and <unordered_map> if available.
2612
2613 2013-12-10 Roland McGrath <mcgrathr@google.com>
2614
2615 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2616 with $(INSTALL_PROGRAM_ENV).
2617 * Makefile.in: Regenerate.
2618
2619 2013-11-22 Cary Coutant <ccoutant@google.com>
2620
2621 * configure.ac: Add check for which library is needed for
2622 dlopen.
2623 * configure: Regenerate.
2624
2625 2013-11-22 Cary Coutant <ccoutant@google.com>
2626
2627 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2628 assembler.
2629 * testsuite/Makefile.in: Regenerate.
2630
2631 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2632
2633 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2634 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2635 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2636 (Target_x86_64<size>::Scan::local): Likewise.
2637 (Target_x86_64<size>::Scan::global): Likewise.
2638 (Target_x86_64<size>::Relocate::relocate): Likewise.
2639 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2640 Likewise.
2641 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2642 R_X86_64_PC32_BND.
2643
2644 * testsuite/Makefile.am (check_PROGRAMS): Add
2645 exception_x86_64_bnd_test.
2646 (exception_x86_64_bnd_test_SOURCES): New macro.
2647 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2648 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2649 (exception_x86_64_bnd_test_LDADD): Likewise.
2650 (exception_x86_64_bnd_1.o): New rule.
2651 (exception_x86_64_bnd_2.o): Likewise.
2652 * testsuite/Makefile.in: Regenerated.
2653
2654 2013-11-15 Alan Modra <amodra@gmail.com>
2655
2656 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2657 accessor.
2658 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2659 Only call ppc64_local_entry_offset for 64-bit. Restrict
2660 symval_for_branch lookup to ELFv1.
2661 (Stub_table::add_plt_call_entry): Use unsigned int off.
2662 (Output_data_glink::Address, invalid_address): New.
2663 (Output_data_glink::add_eh_frame): Move out of line. Add
2664 support for ELFv2.
2665 (Output_data_glink::add_global_entry, find_global_entry,
2666 global_entry_address): New functions.
2667 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2668 ge_size): New variables.
2669 (Output_data_glink::set_final_data_size): Add global entry
2670 stub sizing.
2671 (Output_data_glink::do_write): Write global entry stubs.
2672 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2673 parameter. Return true for ELFv2. Adjust callers.
2674 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2675 ELFv1. Similarly for ifunc and dynamic relocation processing
2676 specific to ELFv1. Recognize that symbols are defined on
2677 their plt entries for ELFv2.
2678 (Target_powerpc::symval_for_branch): Assert if called for
2679 ELFv2 or ppc32.
2680 (Target_powerpc::Relocate::relocate): Use global entry plt
2681 stub for symbol value if such exists on ELFv2.
2682 (Target_powerpc::Relocate::relocate): Don't call
2683 symval_for_branch when ELFv2. Do adjust for local entry
2684 offset when ELFv2.
2685 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2686 plt stub for ELFv2.
2687 (Target_powerpc::do_plt_address_for_global): Similarly.
2688
2689 2013-11-14 Cary Coutant <ccoutant@google.com>
2690
2691 Revert patch -- this did not fix the problem, and there is
2692 no race there.
2693
2694 2013-11-14 Cary Coutant <ccoutant@google.com>
2695
2696 PR gold/14860
2697 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2698 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2699 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2700 updating fde_offsets_.
2701 (Eh_frame_hdr::lock_): New data member.
2702
2703 2013-11-14 Cary Coutant <ccoutant@google.com>
2704
2705 * dwp.cc (Dwo_file_entry): New type.
2706 (File_list): Use Dwo_file_entry.
2707 (Dwo_file::verify): New function.
2708 (Dwo_file::verify_dwo_list): New function.
2709 (Dwo_file::sized_verify_dwo_list): New function.
2710 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2711 list.
2712 (Dwp_options): New enum type.
2713 (dwp_options): Add --verify-only.
2714 (usage): Likewise.
2715 (main): Likewise.
2716 * dwp.h (gold_info): Add declaration.
2717
2718 2013-11-14 Cary Coutant <ccoutant@google.com>
2719
2720 PR gold/14860
2721 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2722 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2723 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2724 updating fde_offsets_.
2725 (Eh_frame_hdr::lock_): New data member.
2726
2727 2013-11-06 Cary Coutant <ccoutant@google.com>
2728
2729 PR gold/15758
2730 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2731 before reloc sections.
2732
2733 2013-11-04 Alan Modra <amodra@gmail.com>
2734
2735 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2736 (Symbol::needs_dynamic_reloc): Test new flag.
2737 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2738 (Target_powerpc::Scan::get_reference_flags): Add target param.
2739 Return FUNC_DESC_ABI for 64-bit ELFv1.
2740 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2741 call.
2742 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2743 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2744
2745 2013-10-31 Cary Coutant <ccoutant@google.com>
2746
2747 Restore support for dwp v2 DWARF package file format.
2748
2749 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2750 tu_length parameter. Adjust all callers.
2751 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2752 * dwp.cc: Include dwarf.h.
2753 (Section_bounds): New struct type.
2754 (Unit_set): New struct type.
2755 (Dwo_file::Dwo_file): Initialize new data member.
2756 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2757 Combine and rename to...
2758 (Dwo_file::read_unit_index): ...this.
2759 (Dwo_file::sized_read_compunit_index)
2760 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2761 (Dwo_file::sized_read_unit_index): ...this.
2762 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2763 parameters; add section_id parameter.
2764 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2765 (Dwo_file::add_unit_set): ...this.
2766 (Dwo_file::shndx_map_): Remove.
2767 (Dwo_file::sect_offsets_): New data member.
2768 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2769 (Dwp_output_file::add_section): Rename to...
2770 (Dwp_output_file::add_contribution): ...this.
2771 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2772 (Dwp_output_file::add_tu_set): Likewise.
2773 (Dwp_output_file::Contribution): New type.
2774 (Dwp_output_file::Section::contributions): New data member.
2775 (Dwp_output_file::Cu_or_tu_set): Remove.
2776 (Dwp_output_file::Section::Section): New ctor.
2777 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2778 (Dwp_output_file::Dwp_index::Section_table): New type.
2779 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2780 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2781 parameter.
2782 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2783 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2784 (Dwp_output_file::Dwp_index::section_table): New member function.
2785 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2786 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2787 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2788 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2789 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2790 (Dwp_output_file::Dwp_index::section_table_): New data member.
2791 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2792 (Dwp_output_file::add_output_section): New member function.
2793 (Dwp_output_file::write_new_section): New member function.
2794 (Dwp_output_file::write_contributions): New member function.
2795 (Dwp_output_file::section_id_map_): New data member.
2796 (class Dwo_id_info_reader): Remove.
2797 (class Unit_reader): New class.
2798 (get_dwarf_section_name): New function.
2799 (Dwo_file::read_executable): Adjust initializations of class data.
2800 (Dwo_file::read): Add support for v2 package file format.
2801 (Dwo_file::read_unit_index): Likewise.
2802 (Dwo_file::sized_read_unit_index): Likewise.
2803 (Dwo_file::copy_section): Likewise.
2804 (Dwo_file::add_unit_set): Likewise.
2805 (Dwp_output_file::add_output_section): Likewise.
2806 (Dwp_output_file::add_contribution): Likewise.
2807 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2808 for empty slot.
2809 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2810 file format.
2811 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2812 slot.
2813 (Dwp_output_file::initialize): Remove unused function.
2814 (Dwp_output_file::finalize): Add support for v2 package file format.
2815 (Dwp_output_file::write_index): Likewise.
2816 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2817 function prototype.
2818
2819 2013-10-31 Cary Coutant <ccoutant@google.com>
2820
2821 * configure.ac: Fix check for -fmerge-constants.
2822 * configure.ac: Regenerate.
2823
2824 2013-10-30 Roland McGrath <mcgrathr@google.com>
2825
2826 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2827 Correct 9-byte nop sequence to match what the assembler generates.
2828
2829 2013-10-30 Alan Modra <amodra@gmail.com>
2830
2831 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2832 ppc64_local_entry_offset, ppc64_local_entry_offset,
2833 do_read_symbols): New functions.
2834 (Powerpc_relobj::e_flags_, st_other_): New vars.
2835 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2836 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2837 (Powerpc_relobj::e_flags_): New var.
2838 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2839 and adjust for ELFv2.
2840 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2841 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2842 (Powerpc_dynobj::do_find_special_sections): Likewise.
2843 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2844 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2845 to ELFv2 local entry.
2846 (Target_powerpc::do_relax): No thread safe barriers needed for
2847 ELFv2.
2848 (Output_data_plt_powerpc::initial_plt_entry_size_,
2849 plt_entry_size): Delete. Replace all uses with
2850 first_plt_entry_offset() and plt_entry_size().
2851 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2852 reserved_size parm. Update callers.
2853 (Output_data_plt_powerpc::entry_count): Update.
2854 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2855 and use Target_powerpc::first_plt_entry_offset().
2856 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2857 rename to plt_entry_size.
2858 (Output_data_plt_powerpc::add_ifunc_entry,
2859 add_local_ifunc_entry): Adjust reloc for ELFv2.
2860 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2861 (glink_eh_frame_fde_64v2): New.
2862 (Stub_table::plt_call_size): Support ELFv2 sizing.
2863 (Output_data_glink::add_eh_frame): Use the new FDE.
2864 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2865 (Stub_table::do_write): Write ELFv2 stubs and glink.
2866 (Target_powerpc::Relocate::relocate): Replaces nop after call
2867 with ld 2,24(1) and adjust local offset destination for ELFv2.
2868
2869 2013-10-30 Alan Modra <amodra@gmail.com>
2870
2871 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2872 (Target_powerpc::Scan::global, local): Likewise.
2873 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2874 on all ppc64 @h and @ha relocs.
2875
2876 2013-10-14 Alan Modra <amodra@gmail.com>
2877
2878 * output.h (Output_data_got::add_constant): Tidy.
2879 (Output_data_got::add_constant_pair): New function.
2880 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2881 methods used so as to first call reserve_ent().
2882
2883 2013-10-11 Roland McGrath <mcgrathr@google.com>
2884
2885 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2886 add_got_entry and add_got_entry_pair.
2887
2888 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2889 (HAVE_PUBNAMES): Likewise.
2890 * configure: Regenerate.
2891
2892 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2893 * testsuite/Makefile.in: Regenerate.
2894
2895 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2896 Remove const from declaration.
2897 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2898 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2899 * output.h (Output_file_header): Remove const from member target_
2900 and corresponding constructor argument.
2901 * output.cc (Output_file_header::Output_file_header): Update prototype.
2902 (Output_file_header::do_sized_write): Use this->target_ in place
2903 of parameters()->target().
2904
2905 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2906
2907 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2908 * configure: Regenerate.
2909 * Makefile.in: Regenerate.
2910 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2911 * testsuite/merge_string_literals_2.c: Likewise.
2912 * testsuite/Makefile.am
2913 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2914 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2915 literal -fmerge-constants.
2916 * testsuite/Makefile.in: Regenerate.
2917
2918 * i386.cc (Target_i386): Remove unused member dynbss_.
2919 * arm.cc (Target_arm): Likewise.
2920 * powerpc.cc (Target_powerpc): Likewise.
2921 * sparc.cc (Target_sparc): Likewise.
2922 * tilegx.cc (Target_tilegx): Likewise.
2923 * x86_64.cc (Target_x86_64): Likewise.
2924 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2925 type_signature_, type_offset_.
2926 * plugin.h (Plugin_hook): Remove unused member layout_.
2927 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2928 mapfile_.
2929 (Read_member): Remove unused members input_objects_, symtab_,
2930 mapfile_, layout_.
2931 (Check_library): Remove unused member symtab_.
2932 * archive.h (Lib_group): Remove unused member lib_.
2933 * archive.cc (Lib_group::Lib_group): Update initializer.
2934 * incremental.h (Incremental_binary): Remove unused member target_.
2935 (Incremental_script_entry): Removed unused member script_.
2936 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2937 * icf.h (Icf): Remove unused member num_tracked_relocs.
2938
2939 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2940 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2941 its only use.
2942 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2943
2944 * archive.h: Use struct rather than class for forward declaration
2945 of Read_symbols_data.
2946
2947 2013-10-07 Cary Coutant <ccoutant@google.com>
2948
2949 PR gold/16010
2950 * testsuite/Makefile.am (icf_test): Fix dependencies.
2951 (icf_safe_test): Likewise.
2952 (icf_safe_so_test): Likewise.
2953 (large_symbol_alignment): Add empty _LDADD rule.
2954 * testsuite/Makefile.in: Regenerate.
2955
2956 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2957
2958 PR gold/15927
2959 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2960 relocation for R_X86_64_32 on x32.
2961
2962 2013-08-27 Roland McGrath <mcgrathr@google.com>
2963
2964 * output.cc (Output_segment::set_section_addresses): Take new
2965 Target* argument. If target->isolate_execinstr() and the segment
2966 is executable and starts at a target->abi_pagesize() boundary,
2967 pad its end out to a target->abi_pagesize() boundary with code fill.
2968 * output.h (Output_segment::set_section_addresses): Update decl.
2969 * layout.h (Layout::check_output_data_for_reset_values): Take new
2970 argument RELAX_OUTPUTS.
2971 (Layout): New member relax_output_list_.
2972 (Layout::add_relax_output): New method.
2973 * layout.cc (Layout::Layout): Update constructor.
2974 (Layout::reset_relax_output): New method.
2975 (Layout::clean_up_after_relaxation): Call it.
2976 (Layout::prepare_for_relaxation): Update caller.
2977 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2978 Call reset_relax_output before re-processing segments for
2979 isolate_execinstr case.
2980 (Layout::write_data): Handle relax_output_list_.
2981 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2982 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2983
2984 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2985
2986 PR binutils/15834
2987 * object.h: Fix typos.
2988
2989 2013-08-16 Roland McGrath <mcgrathr@google.com>
2990
2991 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2992 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2993
2994 2013-08-07 Cary Coutant <ccoutant@google.com>
2995
2996 Revert support for v2 DWP files:
2997
2998 2013-03-01 Cary Coutant <ccoutant@google.com>
2999
3000 Add dwp support for v2 DWARF package file format.
3001 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3002 tu_length parameter. Adjust all callers.
3003 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3004 * dwp.cc: Include dwarf.h.
3005 (Section_bounds): New struct type.
3006 (Unit_set): New struct type.
3007 (Dwo_file::Dwo_file): Initialize new data member.
3008 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3009 Combine and rename to...
3010 (Dwo_file::read_unit_index): ...this.
3011 (Dwo_file::sized_read_compunit_index)
3012 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3013 (Dwo_file::sized_read_unit_index): ...this.
3014 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3015 parameters; add section_id parameter.
3016 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3017 (Dwo_file::add_unit_set): ...this.
3018 (Dwo_file::shndx_map_): Remove.
3019 (Dwo_file::sect_offsets_): New data member.
3020 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3021 (Dwp_output_file::add_section): Rename to...
3022 (Dwp_output_file::add_contribution): ...this.
3023 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3024 (Dwp_output_file::add_tu_set): Likewise.
3025 (Dwp_output_file::Contribution): New type.
3026 (Dwp_output_file::Section::contributions): New data member.
3027 (Dwp_output_file::Cu_or_tu_set): Remove.
3028 (Dwp_output_file::Section::Section): New ctor.
3029 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3030 (Dwp_output_file::Dwp_index::Section_table): New type.
3031 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3032 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3033 parameter.
3034 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3035 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3036 (Dwp_output_file::Dwp_index::section_table): New member function.
3037 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3038 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3039 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3040 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3041 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3042 (Dwp_output_file::Dwp_index::section_table_): New data member.
3043 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3044 (Dwp_output_file::add_output_section): New member function.
3045 (Dwp_output_file::write_new_section): New member function.
3046 (Dwp_output_file::write_contributions): New member function.
3047 (Dwp_output_file::section_id_map_): New data member.
3048 (class Dwo_id_info_reader): Remove.
3049 (class Unit_reader): New class.
3050 (get_dwarf_section_name): New function.
3051 (Dwo_file::read_executable): Adjust initializations of class data.
3052 (Dwo_file::read): Add support for v2 package file format.
3053 (Dwo_file::read_unit_index): Likewise.
3054 (Dwo_file::sized_read_unit_index): Likewise.
3055 (Dwo_file::copy_section): Likewise.
3056 (Dwo_file::add_unit_set): Likewise.
3057 (Dwp_output_file::add_output_section): Likewise.
3058 (Dwp_output_file::add_contribution): Likewise.
3059 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3060 for empty slot.
3061 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3062 file format.
3063 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3064 slot.
3065 (Dwp_output_file::initialize): Remove unused function.
3066 (Dwp_output_file::finalize): Add support for v2 package file format.
3067 (Dwp_output_file::write_index): Likewise.
3068 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3069 function prototype.
3070
3071 2013-07-31 Cary Coutant <ccoutant@google.com>
3072
3073 * object.cc (Sized_relobj::do_output_section_address): New function.
3074 (Sized_relobj): Instantiate explicitly.
3075 * object.h (Object::output_section_address): New function.
3076 (Object::do_output_section_address): New function.
3077 (Sized_relobj::do_output_section_address): New function.
3078 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3079
3080 2013-07-30 Cary Coutant <ccoutant@google.com>
3081 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
3082
3083 * parameters.cc (Parameters::entry): Return target-specific entry
3084 symbol name.
3085 * target.h (Target::entry_symbol_name): New function.
3086 (Target_info::entry_symbol_name): New data member.
3087
3088 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3089 * i386.cc (Target_i386::i386_info): Likewise.
3090 (Target_i386_nacl::i386_nacl_info): Likewise.
3091 * sparc.cc (Target_sparc::sparc_info): Likewise.
3092 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3093 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3094 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3095 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3096
3097 2013-07-22 Sterling Augustine <saugustine@google.com>
3098
3099 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3100 Convert parameter shndx to local variable. Add parameters symtab
3101 and symtab_size. Scan over section names. Find relocation
3102 section corresponding to current section. Create and initialize
3103 reloc_mapper_ and reloc_type_.
3104 (Dwarf_pubnames_table::read_header): Add assertion. Change
3105 unit_length to off_t. Initialize member unit_length_. Fill in field
3106 cu_offset_.
3107 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3108 Initialize new fields unit_length_ and cu_offset_.
3109 (Dwarf_pubnames_table::read_section): Update prototype.
3110 (Dwarf_pubnames_table::cu_offset): New member function.
3111 (Dwarf_pubnames_table::subsection_size): Likewise.
3112 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3113 New fields.
3114 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3115 member functions public.
3116 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3117 Update comment. Rework logic. Move repeated parts to...
3118 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3119 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3120 pubtypes_table_, and stmt_list_offset.
3121 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3122 Gdb_index::find_pubtype_offset,
3123 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3124 (Gdb_index::pubnames_read): Update prototype and rework logic.
3125 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3126 Forward declare.
3127 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3128 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3129 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3130 Gdb_index::map_pubtable_to_dies):
3131 Declare functions.
3132 (Gdb_index::pubnames_read): Update declaration.
3133 (Gdb_index::Pubname_offset_map): New type.
3134 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3135 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3136 Gdb_index::stmt_list_offset): Declare.
3137 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3138 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3139 Gdb_index::pubtypes_offset_): Remove.
3140
3141 2013-07-19 Roland McGrath <mcgrathr@google.com>
3142
3143 * options.h (General_options): Add -Trodata-segment option.
3144 * parameters.cc (Parameters::check_rodata_segment): New function.
3145 (Parameters::set_target_once): Call it.
3146 * parameters.h (Parameters): Declare it (private member function).
3147 * layout.cc (load_seg_unusable_for_headers): New function, broken
3148 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3149 then validate rodata segment rather than text segment.
3150 (relaxation_loop_body): Call that.
3151 (is_text_segment): New function. Don't admit a non-executable
3152 segment if TARGET->isolate_execinstr().
3153 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3154
3155 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
3156
3157 PR gold/15070
3158 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3159 * nacl.h (Sniff_file::View::View): Request aligned view.
3160
3161 2013-07-11 Cary Coutant <ccoutant@google.com>
3162
3163 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3164 correct BRLT entry size.
3165
3166 2013-07-03 Alan Modra <amodra@gmail.com>
3167
3168 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3169 comment.
3170
3171 2013-07-01 Cary Coutant <ccoutant@google.com>
3172
3173 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3174 reloc_type_.
3175 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3176 (Dwarf_ranges_table::lookup_reloc): New function.
3177 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3178 reloc_type_.
3179 (Dwarf_ranges_table::lookup_reloc): New function.
3180 (Dwarf_ranges_table::reloc_type_): New data member.
3181
3182 2013-06-27 Jing Yu <jingyu@google.com>
3183
3184 PR gold/15662
3185 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3186 function.
3187 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3188 (Target_powerpc::do_relax): Call the above.
3189
3190 2013-06-27 Cary Coutant <ccoutant@google.com>
3191
3192 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3193 on garbage collected .opd section.
3194
3195 2013-06-27 Alan Modra <amodra@gmail.com>
3196
3197 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3198 is non-zero.
3199 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3200 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3201
3202 2013-06-14 Cary Coutant <ccoutant@google.com>
3203
3204 * resolve.cc (Symbol::override_base): Don't override st_type
3205 from plugin placeholder symbols.
3206 (Symbol_table::resolve): Likewise.
3207 (Symbol_table::should_override): Don't complain about TLS mismatch
3208 if the TO symbol is a plugin placeholder.
3209 * testsuite/Makefile.am (plugin_test_tls): New test.
3210 * testsuite/Makefile.in: Regenerate.
3211 * testsuite/plugin_test_tls.sh: New test script.
3212 * testsuite/two_file_test_2_tls.cc: New test source.
3213 * testsuite/two_file_test_tls.cc: New test source.
3214
3215 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3216
3217 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3218 the maximum segment alignment is larger than the page size.
3219 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3220 correctly aligns the symbols with large alignemnt.
3221 * testsuite/Makefile.in: Regenerate.
3222 * testsuite/large_symbol_alignment.cc: New file.
3223
3224 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3225 Sriraman Tallam <tmsriram@google.com>
3226
3227 * options.h (sort_section): New option.
3228 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3229 Rename from Input_section_sort_section_name_special_ordering_compare.
3230 (Input_section_sort_section_name_compare): New struct.
3231 * output.cc (Output_section::Input_section_sort_section_name_compare::
3232 operator()): New function.
3233 (Output_section::sort_attached_input_sections): Use new sort function
3234 for .text if --sort-section=name is specified.
3235 * layout.cc (Layout::make_output_section):
3236 Add sorting by name when --sort-section=name is specified.
3237 * testsuite/Makefile.am (text_section_grouping): Test option
3238 --sort-section=name.
3239 * testsuite/Makefile.in: Regenerate.
3240 * testsuite/section_sorting_name.cc: New file.
3241 * testsuite/section_sorting_name.sh: New file.
3242
3243 2013-05-21 Cary Coutant <ccoutant@google.com>
3244
3245 * symtab.h (Symbol::is_cxx_vtable): New function.
3246 * target-reloc.h (relocate_section): Check for vtable symbol.
3247 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3248 * testsuite/Makefile.in: Regenerate.
3249 * testsuite/missing_key_func.cc: New test source.
3250 * testsuite/missing_key_func.sh: New test script.
3251
3252 2013-05-21 Cary Coutant <ccoutant@google.com>
3253
3254 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3255 type of enclosing symbol.
3256 (Relocate_info::location): Check symbol type when describing symbol.
3257 * object.h (Symbol_location_info): Remove unused line_number;
3258 add enclosing_symbol_type.
3259 * testsuite/debug_msg.sh: Adjust expected output.
3260
3261 2013-05-13 Cary Coutant <ccoutant@google.com>
3262
3263 * configure.ac: Export DEFAULT_TARGET.
3264 * configure: Regenerate.
3265 * Makefile.in: Regenerate.
3266 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3267 * testsuite/Makefile.in: Regenerate.
3268 * testsuite/debug_msg.sh: Delete duplicate tests.
3269 Don't check undef_int error message match for powerpc where the
3270 source file and line number aren't available.
3271
3272 2013-05-10 Roland McGrath <mcgrathr@google.com>
3273
3274 * options.h (General_options): Add --rosegment-gap option.
3275 * options.cc (finalize): --rosegment-gap implies --rosegment.
3276 * layout.cc (set_segment_offsets): Let user option override
3277 target->rosegment_gap().
3278
3279 2013-05-10 Roland McGrath <mcgrathr@google.com>
3280
3281 * options.h (General_options): Remove leading space from help
3282 messages for -nostdlib and --rosegment.
3283
3284 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3285
3286 PR ld/15365
3287 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3288
3289 2013-05-03 Alan Modra <amodra@gmail.com>
3290
3291 * merge.cc (Output_merge_string::do_add_input_section): Correct
3292 scan for number of strings. Rename vars to avoid shadowing.
3293 Include missing terminator in input_size_.
3294
3295 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3296
3297 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3298 Restore empty string handling.
3299
3300 2013-05-01 Cary Coutant <ccoutant@google.com>
3301
3302 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3303 uninitialized warning.
3304
3305 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3306
3307 * output.cc (Output_section::add_merge_input_section): Allow
3308 to merge sections if the alignment is more than character size.
3309 * merge.h (Output_merge_string::Output_merge_string): Remove
3310 assert.
3311 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3312 only not-null strings. Check the alignment of strings.
3313 * stringpool.h
3314 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3315 alignment as the argument.
3316 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3317 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3318 Align non-zero length strings according to the addralign_.
3319 (Stringpool_template<Stringpool_char>::set_string_offsets):
3320 Updating offsets according to the given alignment.
3321 * testsuite/Makefile.am (text_section_grouping): Test if string
3322 literals are getting merged.
3323 * testsuite/Makefile.in: Regenerate.
3324 * testsuite/merge_string_literals_1.c: New file.
3325 * testsuite/merge_string_literals_2.c: Ditto.
3326 * testsuite/merge_string_literals.sh: Ditto.
3327
3328 2013-04-26 Ian Lance Taylor <iant@google.com>
3329
3330 * target-reloc.h (relocate_section): If the reloc offset is out of
3331 range, pass VIEW as NULL to relocate.relocate.
3332 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3333 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3334 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3335 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3336 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3337 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3338
3339 2013-04-26 Geoff Pike <gpike@chromium.org>
3340
3341 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3342 * layout.cc (Hash_task): New class.
3343 (Layout::queue_build_id_tasks): New function.
3344 (Layout::write_build_id): Handle single-thread portion of build ID
3345 computation. (In some cases, all of it is single-threaded.) Replace
3346 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3347 functionality in fewer lines of code.
3348 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3349 * options.h (General_options): make "--build-id" default to tree
3350 rather than sha1. Add two new options related to --build-id=tree:
3351 --build-id-chunk-size-for-treehash and
3352 --build-id-min-file-size-for-treehash.
3353 * Makefile.am: add testing of --build-id=tree and related new options
3354 (these tests will be invoked by "make check").
3355 * Makefile.in: Regenerate.
3356
3357 2013-04-25 Alan Modra <amodra@gmail.com>
3358
3359 * configure.tgt: Add powerpcle and powerpc64le.
3360
3361 2013-04-22 Alan Modra <amodra@gmail.com>
3362
3363 PR gold/15355
3364 * layout.cc (Layout::segment_precedes): Allow more than one
3365 segment with the same type and flags.
3366
3367 2013-04-15 Cary Coutant <ccoutant@google.com>
3368
3369 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3370 allocate space in file for BSS sections.
3371
3372 2013-04-15 Cary Coutant <ccoutant@google.com>
3373
3374 * script-sections.cc (Orphan_output_section): Reset address
3375 to zero after each orphaned section for relocatable links.
3376
3377 2013-04-15 Cary Coutant <ccoutant@google.com>
3378
3379 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3380 section starting address for relocatable link.
3381 * testsuite/Makefile.am (script_test_11): New test.
3382 * testsuite/Makefile.in: Regenerate.
3383 * testsuite/script_test_11.c: New source file.
3384 * testsuite/script_test_11.t: New linker script.
3385
3386 2013-04-13 Alan Modra <amodra@gmail.com>
3387
3388 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3389 owner when sections are not adjacent and exceed group size.
3390 (Target_powerpc::group_sections): Handle corner case.
3391 (Target_powerpc::Branch_info::make_stub): Handle case where
3392 stub table doesn't exist due to branches in non-exec sections.
3393 (Target_powerpc::Relocate::relocate): Likewise.
3394
3395 2013-04-11 Alan Modra <amodra@gmail.com>
3396
3397 PR gold/15354
3398 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3399 .branch_lt to match bfd ld. Adjust comments throughout file.
3400
3401 2013-04-04 Ian Lance Taylor <iant@google.com>
3402
3403 GCC PR c++/56840
3404 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3405 sections before checking whether they are included in the link.
3406
3407 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3408
3409 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3410 object before calling the plugin claim_file handler. Pass the elf
3411 object of the archive to the plugin. Delete the elf object if the
3412 plugin claims the file.
3413
3414 2013-03-21 Alan Modra <amodra@gmail.com>
3415
3416 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3417 segment when omagic.
3418
3419 2013-03-21 Alan Modra <amodra@gmail.com>
3420
3421 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3422 comparison warning.
3423 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3424 uninitialized" warning.
3425
3426 2013-03-20 Alan Modra <amodra@gmail.com>
3427
3428 * symtab.h (Symbol::clear_version): New function.
3429 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3430 is_needed by weak references. Clear version for symbols defined
3431 in as-needed objects that are not needed.
3432
3433 2013-03-15 Alan Modra <amodra@gmail.com>
3434
3435 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3436 static and public. Add report_err param. Return false for data refs.
3437 (Target_powerpc::rela_dyn_section): New overloaded function.
3438 (Target_powerpc::plt_, iplt_): Elucidate.
3439 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3440 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3441 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3442 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3443 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3444 push_branch and make_plt_entry for ifunc syms when
3445 reloc_needs_plt_for_ifunc.
3446 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3447 for ifunc unless reloc_needs_plt_for_ifunc.
3448
3449 2013-03-15 Alan Modra <amodra@gmail.com>
3450
3451 * gc.h (gc_process_relocs): Don't look through function descriptors.
3452 * icf.cc (get_section_contents): Do so here instead.
3453
3454 2013-03-13 Alan Modra <amodra@gmail.com>
3455
3456 * powerpc.cc (is_branch_reloc): Forward declare.
3457 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3458 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3459 false for 64-bit, true for 32-bit non-branch relocs.
3460 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3461 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3462 nm output.
3463 (icf_safe_test): Generate linker map file as well as nm output.
3464 (icf_safe_so_test): Likewise.
3465 * testsuite/Makefile.in: Regenerate.
3466 * testsuite/icf_test.sh: Parse linker map file to determine
3467 section folding.
3468 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3469 * testsuite/icf_safe_so_test.sh: Likewise.
3470 (X86_32_or_ARM_specific_safe_fold): Merge into..
3471 (arch_specific_safe_fold): ..this.
3472 (X86_64_specific_safe_fold): Delete unused function.
3473
3474 2013-03-12 Alan Modra <amodra@gmail.com>
3475
3476 * gc.h (gc_process_relocs): Look through function descriptors
3477 to determine shndx, symvalue and addend used by ICF. Tidy
3478 variable duplication.
3479
3480 2013-03-11 Alan Modra <amodra@gmail.com>
3481
3482 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3483 * layout.cc (Layout_task_runner::run): ..to here.
3484 * symtab.h (struct Symbol_location): Extract from..
3485 (class Symbol_table): ..here.
3486 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3487 * target.h (class Target): Add function_location and
3488 do_function_location functions.
3489 (class Sized_target): Add do_function_location.
3490 * object.h (class Sized_relobj_file): Move find_shdr..
3491 (class Object): ..to here.
3492 * object.cc: Likewise. Update to suit. Instantiate.
3493 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3494 * powerpc.cc (class Powerpc_dynobj): New.
3495 (Target_powerpc::do_function_location): New function.
3496 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3497 (Powerpc_dynobj::do_read_symbols): New function.
3498 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3499
3500 2013-03-08 Ian Lance Taylor <iant@google.com>
3501
3502 * options.cc (General_options::string_to_object_format): Accept
3503 "default".
3504
3505 2013-03-08 Alan Modra <amodra@gmail.com>
3506
3507 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3508 pointer to Post_fde.
3509 (struct Post_fde): Move definition to here..
3510 * ehframe.cc (struct Post_fde): ..from here.
3511 (Cie::write): Don't alloc Post_fde.
3512 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3513
3514 2013-03-07 Alan Modra <amodra@gmail.com>
3515
3516 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3517 relocation referencing .LC0.
3518 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3519
3520 2013-03-07 Alan Modra <amodra@gmail.com>
3521
3522 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3523 always_inline. Add assembly for powerpc to avoid GOT.
3524
3525 2013-03-07 Alan Modra <amodra@gmail.com>
3526
3527 * testsuite/script_test_10.sh: Don't test .bss section
3528 header number.
3529
3530 2013-03-06 Alan Modra <amodra@gmail.com>
3531
3532 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3533 (Target_powerpc::symval_for_branch): Add symtab param. Update
3534 all callers. Handle folded sections.
3535 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3536 to Powerpc_relobj.
3537 (Global_symbol_visitor_opd::operator()): Likewise.
3538
3539 2013-03-04 Alan Modra <amodra@gmail.com>
3540
3541 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3542 * testsuite/Makefile.in: Regenerate.
3543
3544 2013-03-01 Cary Coutant <ccoutant@google.com>
3545
3546 Add dwp support for v2 DWARF package file format.
3547 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3548 tu_length parameter. Adjust all callers.
3549 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3550 * dwp.cc: Include dwarf.h.
3551 (Section_bounds): New struct type.
3552 (Unit_set): New struct type.
3553 (Dwo_file::Dwo_file): Initialize new data member.
3554 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3555 Combine and rename to...
3556 (Dwo_file::read_unit_index): ...this.
3557 (Dwo_file::sized_read_compunit_index)
3558 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3559 (Dwo_file::sized_read_unit_index): ...this.
3560 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3561 parameters; add section_id parameter.
3562 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3563 (Dwo_file::add_unit_set): ...this.
3564 (Dwo_file::shndx_map_): Remove.
3565 (Dwo_file::sect_offsets_): New data member.
3566 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3567 (Dwp_output_file::add_section): Rename to...
3568 (Dwp_output_file::add_contribution): ...this.
3569 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3570 (Dwp_output_file::add_tu_set): Likewise.
3571 (Dwp_output_file::Contribution): New type.
3572 (Dwp_output_file::Section::contributions): New data member.
3573 (Dwp_output_file::Cu_or_tu_set): Remove.
3574 (Dwp_output_file::Section::Section): New ctor.
3575 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3576 (Dwp_output_file::Dwp_index::Section_table): New type.
3577 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3578 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3579 parameter.
3580 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3581 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3582 (Dwp_output_file::Dwp_index::section_table): New member function.
3583 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3584 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3585 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3586 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3587 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3588 (Dwp_output_file::Dwp_index::section_table_): New data member.
3589 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3590 (Dwp_output_file::add_output_section): New member function.
3591 (Dwp_output_file::write_new_section): New member function.
3592 (Dwp_output_file::write_contributions): New member function.
3593 (Dwp_output_file::section_id_map_): New data member.
3594 (class Dwo_id_info_reader): Remove.
3595 (class Unit_reader): New class.
3596 (get_dwarf_section_name): New function.
3597 (Dwo_file::read_executable): Adjust initializations of class data.
3598 (Dwo_file::read): Add support for v2 package file format.
3599 (Dwo_file::read_unit_index): Likewise.
3600 (Dwo_file::sized_read_unit_index): Likewise.
3601 (Dwo_file::copy_section): Likewise.
3602 (Dwo_file::add_unit_set): Likewise.
3603 (Dwp_output_file::add_output_section): Likewise.
3604 (Dwp_output_file::add_contribution): Likewise.
3605 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3606 for empty slot.
3607 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3608 file format.
3609 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3610 slot.
3611 (Dwp_output_file::initialize): Remove unused function.
3612 (Dwp_output_file::finalize): Add support for v2 package file format.
3613 (Dwp_output_file::write_index): Likewise.
3614 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3615 function prototype.
3616
3617 2013-03-01 Cary Coutant <ccoutant@google.com>
3618
3619 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3620 function into class definition in header file.
3621 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3622 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3623 New function.
3624 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3625
3626 2013-02-28 Alan Modra <amodra@gmail.com>
3627
3628 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3629 * target.cc (Target::do_plt_fde_location): New function.
3630 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3631 accessor function, and constructor param.
3632 (struct Post_fde, Post_fdes): Declare.
3633 (Cie::write): Add post_fdes param.
3634 * ehframe.cc (Fde::write): Use plt_fde_location.
3635 (struct Post_fde): Define.
3636 (Cie::write): Stash FDEs added post merge mapping.
3637 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3638 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3639 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3640 other FDEs.
3641 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3642 (Target_powerpc::has_glink): New function.
3643 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3644 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3645 glink_eh_frame_fde_32, default_fde): New data.
3646 (Stub_table::eh_frame_added_): New var.
3647 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3648 Make const.
3649 (Stub_table::add_eh_frame): New function.
3650 (Output_data_glink::add_eh_frame): New function.
3651 (Target_powerpc::make_glink_section): Call add_eh_frame.
3652
3653 2013-02-15 Ian Lance Taylor <iant@google.com>
3654
3655 * options.h (DEFINE_uint64_alias): Define.
3656 (class General_options): Add -Ttext-segment as an alias for
3657 -Ttext.
3658
3659 2013-02-15 Alan Modra <amodra@gmail.com>
3660
3661 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3662 (Stub_table::do_write): ..here, two places.
3663 (Stub_table::plt_call_size): Use it here too.
3664
3665 2013-02-11 Ian Lance Taylor <iant@google.com>
3666
3667 * descriptors.cc (Descriptors::close_all): New function.
3668 * descriptors.h (class Descriptors): Declare close_all.
3669 (close_all_descriptors): New inline function.
3670 * plugin.cc: Include "descriptors.h".
3671 (Plugin_manager::cleanup): Call close_all_descriptors.
3672
3673 2013-02-06 Alan Modra <amodra@gmail.com>
3674
3675 * README: Update coding style link.
3676
3677 2013-01-28 Cary Coutant <ccoutant@google.com>
3678
3679 * dwp.cc (File_list): New typedef.
3680 (Dwo_name_info_reader): New class.
3681 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3682 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3683 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3684 (Dwo_file::read_executable): New function.
3685 (Dwo_file::read): Move common setup code to ...
3686 (Dwo_file::make_object): ... here.
3687 (dwp_options): Add --exec/-e.
3688 (usage): Likewise.
3689 (main): Likewise.
3690
3691 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3692
3693 * layout.cc (Layout::layout): Check for option text_reorder.
3694 (Layout::make_output_section): Ditto.
3695 * options.h (text_reorder): New option.
3696 * output.cc (Input_section_sort_compare): Remove special ordering
3697 of section names.
3698 (Output_section::
3699 Input_section_sort_section_name_special_ordering_compare::
3700 operator()): New function.
3701 (Output_section::sort_attached_input_sections): Use new sort function
3702 for .text.
3703 * output.h (Input_section_sort_section_name_special_ordering_compare):
3704 New struct.
3705 * testsuite/Makefile.am (text_section_grouping): Test option
3706 --no-text-reorder
3707 * testsuite/Makefile.in: Regenerate.
3708 * testsuite/text_section_grouping.sh: Check order of functions without
3709 default text reordering.
3710
3711 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3712
3713 * options.h (General_options): Change default to true for new_dtags.
3714
3715 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3716
3717 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3718 when enable_new_dtags is false. Only add DT_RUNPATH when
3719 enable_new_dtags is true.
3720
3721 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3722
3723 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3724 used in declaration and definition consistent.
3725 (Target_powerpc::symval_for_branch): Ditto.
3726
3727 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3728
3729 * testsuite/plugin_final_layout.cc: Fix comment.
3730
3731 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3732
3733 * layout.cc (Layout::layout): Do not do default sorting for
3734 text sections when section ordering is specified.
3735 (make_output_section): Ditto.
3736 * testsuite/plugin_final_layout.cc: Name the function sections
3737 to catch reordering issues.
3738
3739 2013-01-15 Alan Modra <amodra@gmail.com>
3740
3741 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3742 plt-thread-safe.
3743
3744 2013-01-15 Alan Modra <amodra@gmail.com>
3745
3746 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3747 * testsuite/Makefile.in: Regenerate.
3748
3749 2013-01-14 Alan Modra <amodra@gmail.com>
3750
3751 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3752 * testsuite/Makefile.in: Regenerate.
3753
3754 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3755
3756 PR bfd/14430
3757 Fix mingw gold build with plugins enabled
3758 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3759 * configure.ac: Export DLOPEN_LIBS and add headers check.
3760 * plugin.cc: Handle non-dlfcn case.
3761 * Makefile.in: Regenerate.
3762 * config.in: Regenerate.
3763 * configure: Regenerate.
3764 * testsuite/Makefile.in: Regenerate.
3765
3766 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3767
3768 * output.h (sort_attached_input_sections): Change to be public.
3769 * script-sections.cc
3770 (Output_section_definition::set_section_addresses): Sort
3771 attached input sections according to section order before linker
3772 script assigns section addresses.
3773 (Orphan_output_section::set_section_addresses): Sort
3774 attached input sections according to section order before linker
3775 script assigns section addresses.
3776 * Makefile.am (final_layout.sh): Use a simple linker script to
3777 check if section ordering still works.
3778 * Makefile.in: Regenerate.
3779
3780 2013-01-09 Ben Cheng <bccheng@google.com>
3781
3782 * arm.cc (Target_arm::attributes_accept_div): New function.
3783 (Target_arm::attributes_forbid_div): New function.
3784 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3785 attribute using the same new functions as what bfd/elf32_arm.c
3786 does.
3787
3788 2013-01-07 Cary Coutant <ccoutant@google.com>
3789
3790 PR gold/14993
3791 * output.cc (Output_section::add_input_section): For incremental
3792 updates, don't track input sections that are allocated from patch
3793 space.
3794
3795 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3796 Ian Lance Taylor <iant@google.com>
3797
3798 PR gold/14897
3799 * configure.ac (--enable-ld): Removed.
3800 (install_as_default): Set to yes only for --enable-gold=default
3801 or --disable-ld.
3802 * configure: Regenerated.
3803
3804 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3805
3806 * options.h (General_options): Add -fuse-ld= for GCC linker
3807 option compatibility.
3808
3809 2013-01-04 Cary Coutant <ccoutant@google.com>
3810
3811 * configure.ac: Fix typo restoring CXXFLAGS.
3812 * configure: Regenerate.
3813
3814 2013-01-04 Cary Coutant <ccoutant@google.com>
3815
3816 * testsuite/Makefile.am (CXXLINK_S): New macro.
3817 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3818 * testsuite/Makefile.in: Regenerate.
3819
3820 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3821
3822 * version.cc (print_version): Update copyright year to 2013.
3823
3824 2012-12-20 Ian Lance Taylor <iant@google.com>
3825
3826 * layout.cc (Layout::special_ordering_of_input_section): New
3827 function.
3828 (Layout::layout): If input section requires special ordering, must
3829 sort input sections.
3830 (Layout::make_output_section): May sort .text input sections.
3831 (Layout::is_section_name_prefix_grouped): Remove.
3832 * layout.h (class Layout): Declare
3833 special_ordering_of_input_section. Don't declare
3834 is_section_name_prefix_grouped.
3835 * output.cc (Output_section::add_input_section): Revert last
3836 change.
3837 (Output_section::Input_section_sort::match_file_name): Don't crash
3838 if called on output section data.
3839 (Output_section::Input_section_sort_compare): Sort based on
3840 special ordering.
3841 (Output_section::Input_section_sort_section_order_index_compare):
3842 Revert last patch.
3843 (Output_section::sort_attached_input_sections): Likewise.
3844
3845 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3846
3847 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3848 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3849 * output.cc (Output_section::add_input_section): Check if section
3850 name contains special prefix. Keep input sections to sort such
3851 sections.
3852 (Output_section::Input_section_sort_section_order_index_compare
3853 ::operator()): Group sections according to prefixes.
3854 (Output_section::sort_attached_input_sections): Add condition to
3855 Input_section_entry constructor call.
3856 * testsuite/Makefile.am (text_section_grouping): New test.
3857 * testsuite/Makefile.in: Regenerate.
3858 * testsuite/text_section_grouping.cc: New file.
3859 * testsuite/text_section_grouping.sh: New file.
3860
3861 2012-12-17 Nick Clifton <nickc@redhat.com>
3862
3863 * Makefile.am: Add copyright notice.
3864 * NEWS: Likewise.
3865 * README: Likewise.
3866 * configure.ac: Likewise.
3867 * ftruncate.c: Likewise.
3868 * Makefile.in: Regenerate.
3869
3870 2012-12-14 Cary Coutant <ccoutant@google.com>
3871
3872 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3873 --no-as-needed flag.
3874 (exception_separate_shared_12_test): Likewise.
3875 (incremental_copy_test): Likewise.
3876 * testsuite/Makefile.in: Regenerate.
3877
3878 2012-12-14 Cary Coutant <ccoutant@google.com>
3879
3880 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3881 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3882
3883 2012-12-12 Alan Modra <amodra@gmail.com>
3884
3885 * powerpc.cc (class Track_tls): New.
3886 (class Relocate, class Scan): Inherit Track_tls.
3887 (Target_powerpc::Scan::local, global): Track tls optimization
3888 and avoid creating plt entry for __tls_get_addr if all uses
3889 are optimized away.
3890 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3891
3892 2012-12-12 Alan Modra <amodra@gmail.com>
3893
3894 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3895 Replace no_toc_optimize with toc_optimize.
3896 * output.h (Output_section::input_sections): Provide non-const variant.
3897 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3898 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3899 accessors.
3900 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3901 (class Sort_toc_sections): New.
3902 (Target_powerpc::do_finalize_sections): Sort toc sections.
3903 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3904
3905 2012-12-10 Roland McGrath <mcgrathr@google.com>
3906
3907 * testsuite/binary_unittest.cc (read_all): New function.
3908 (Sized_binary_test): Use it instead of ::read.
3909 * fileread.cc (do_read): Don't assume pread always reads the whole
3910 amount in a single call.
3911
3912 2012-12-10 Alan Modra <amodra@gmail.com>
3913
3914 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3915 Set EM_PPC64 or EM_PPC here.
3916 (Target_selector_powerpc::do_recognize): Delete.
3917
3918 2012-12-10 Alan Modra <amodra@gmail.com>
3919
3920 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3921 stub_table_.
3922 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3923
3924 2012-12-07 Roland McGrath <mcgrathr@google.com>
3925
3926 * testsuite/binary_unittest.cc (Sized_binary_test):
3927 Use open_descriptor rather than ::open.
3928
3929 2012-12-07 Alan Modra <amodra@gmail.com>
3930
3931 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3932 typedef and invalid_address constant.
3933 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3934 instantiate constants.
3935
3936 2012-12-06 Roland McGrath <mcgrathr@google.com>
3937
3938 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3939 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3940 * aclocal.m4: Regenerate.
3941 * configure: Regenerate.
3942 * Makefile.in: Regenerate.
3943 * testsuite/Makefile.in: Regenerate.
3944
3945 2012-12-07 Alan Modra <amodra@gmail.com>
3946
3947 * options.h (General_options): Add no_toc_optimize.
3948 * powerpc.cc (ok_lo_toc_insn): New function.
3949 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3950
3951 2012-12-06 Alan Modra <amodra@gmail.com>
3952
3953 * options.h (General_options): Add plt_align, plt_static_chain,
3954 plt_thread_safe. Update stub_group_size help text.
3955 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3956 for new plt_thread_safe_ var.
3957 (use_plt_offset): Correct comments.
3958 (Target_powerpc::do_relax): Look for thread creation symbols to
3959 determine default plt_thread_safe value. Clear plt call stubs
3960 as well as branch stubs each iteration.
3961 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3962 insn constants.
3963 (l, hi, ha, write_insn): Move earlier.
3964 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3965 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3966 plt stubs too.
3967 (Stub_table::update_size): Adjust.
3968 (Stub_table::prev_size, set_prev_size): Delete.
3969 (Stub_table::stub_align): Let --plt-align affect result.
3970 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3971 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3972 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3973 (Stub_table::do_write): Support more stub variants.
3974
3975 2012-12-04 Alan Modra <amodra@gmail.com>
3976
3977 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3978 (Target_powerpc::do_define_standard_symbols): New function.
3979
3980 2012-12-03 Alan Modra <amodra@gmail.com>
3981
3982 * output.h: Formatting, whitespace.
3983
3984 2012-12-03 Alan Modra <amodra@gmail.com>
3985
3986 * layout.h (Layout::get_executable_sections): Declare.
3987 * layout.cc (Layout::get_executable_sections): New function.
3988 * arm.cc (Target_arm::group_sections): Use it.
3989 (Arm_output_section::group_sections): Delete now redundant test.
3990 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3991 param to handle relative relocs.
3992 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3993 (Output_data_reloc::add_absolute): Adjust.
3994 (Output_data_reloc::add_relative): New function.
3995 (Output_data::reset_data_size): New function.
3996 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3997 (Output_section::set_addralign): New function.
3998 (Output_section::checkpoint_set_addralign): New function.
3999 (Output_section::clear_section_offsets_need_adjustment): New function.
4000 (Output_section::input_sections): Make public.
4001 * powerpc.cc (class Output_data_brlt_powerpc): New.
4002 (class Stub_table, class Stub_control): New.
4003 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
4004 stub_table_, set_stub_table, stub_table): New vectors and accessor
4005 functions.
4006 (Target_powerpc::do_may_relax, do_relax, push_branch,
4007 new_stub_table, stub_tables, brlt_section, group_sections,
4008 add_branch_lookup_table, find_branch_lookup_table,
4009 write_branch_lookup_table, make_brlt_section): New functions.
4010 (Target_powerpc::struct Sort_sections, class Branch_info): New.
4011 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
4012 branch_info_): New vars.
4013 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
4014 make call stubs here.
4015 (Output_data_glink): Remove all call stub handling from this class.
4016 (Target_powerpc::Scan::local, global): Save interesting branch
4017 relocs and relocs for ifunc. Adjust calls to plt entry functions.
4018 (Target_powerpc::do_finalize_sections): Only make reg save/restore
4019 functions on final link.
4020 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
4021 Handle long branch destinations too.
4022 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
4023 do_plt_address_for_local): Adjust lookup of plt call stubs.
4024
4025 2012-11-30 Alan Modra <amodra@gmail.com>
4026
4027 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
4028 relocs against protected symbols when building 32-bit shared libs.
4029
4030 2012-11-30 Alan Modra <amodra@gmail.com>
4031
4032 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
4033 param. Call got_section() to make .got. Update all callers
4034 and their callers and so on.
4035
4036 2012-11-30 Alan Modra <amodra@gmail.com>
4037
4038 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
4039 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
4040 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
4041 value if it already exists.
4042
4043 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
4044
4045 PR gold/14858
4046 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
4047
4048 2012-11-14 Roland McGrath <mcgrathr@google.com>
4049
4050 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
4051 than bfc instruction for data sandboxing.
4052
4053 2012-11-08 Alan Modra <amodra@gmail.com>
4054
4055 * po/POTFILES.in: Regenerate.
4056
4057 2012-11-05 Alan Modra <amodra@gmail.com>
4058
4059 * configure.ac: Apply 2012-09-10 change to config.in here.
4060 * configure: Regenerate.
4061
4062 2012-11-05 Alan Modra <amodra@gmail.com>
4063
4064 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4065 (struct Opd_ent): Use "Address" rather than "Offset".
4066 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4067 (Target_powerpc::got_section): Make public.
4068 (Target_powerpc::scan_relocs): Move code setting symbols..
4069 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4070 Create _SDA_BASE_ only when referenced.
4071
4072 2012-11-02 Roland McGrath <mcgrathr@google.com>
4073
4074 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4075 from last change.
4076
4077 2012-11-01 Roland McGrath <mcgrathr@google.com>
4078
4079 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4080 for offset_in_output_section parameter.
4081 (Sized_target::relocate_special_relocatable): Likewise.
4082 * arm.cc (Target_arm::relocate_relocs): Likewise.
4083 (Target_arm::relocate_special_relocatable): Likewise.
4084 * i386.cc (Target_i386::relocate_relocs): Likewise.
4085 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4086 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4087 * target-reloc.h (relocate_relocs): Likewise.
4088 * testsuite/testfile.cc (Target_test): Likewise.
4089 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4090 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4091
4092 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4093 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4094
4095 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4096 parameter, which is unused in the [!F_SETFD] case.
4097
4098 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4099 SYMNDX to off_t before comparing it to this->data_size().
4100 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4101 * incremental.cc (Output_section_incremental_inputs::do_write):
4102 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4103
4104 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4105
4106 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4107
4108 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4109 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4110 in EABI_VER5.
4111
4112 2012-10-29 Cary Coutant <ccoutant@google.com>
4113
4114 * dwp.cc (usage): Add file and exit status parameters;
4115 add --help and --version options.
4116 (print_version): New function.
4117 (main): Add --help and --version options.
4118
4119 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4120
4121 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4122 final_layout_sequence.txt.
4123 * testsuite/Makefile.in: Regenerated.
4124
4125 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4126
4127 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4128 COMPILE generated by automake.
4129 (LINK1): Likewise.
4130 (CXXCOMPILE1): Likewise.
4131 (CXXLINK1): Likewise.
4132 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4133 (LINK): Likewise.
4134 (CXXCOMPILE): Likewise.
4135 (CXXLINK): Likewise.
4136 * testsuite/Makefile.in: Regenerated.
4137
4138 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4139
4140 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4141 on bad fwrite return.
4142
4143 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4144
4145 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4146 on val.
4147
4148 2012-10-23 Cary Coutant <ccoutant@google.com>
4149
4150 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4151 * testsuite/Makefile.in: Regenerate.
4152 * testsuite/dwp_test.h: New source file.
4153 * testsuite/dwp_test_1.cc: New source file.
4154 * testsuite/dwp_test_1.s: New source file.
4155 * testsuite/dwp_test_1.sh: New source file.
4156 * testsuite/dwp_test_1b.cc: New source file.
4157 * testsuite/dwp_test_1b.s: New source file.
4158 * testsuite/dwp_test_2.cc: New source file.
4159 * testsuite/dwp_test_2.s: New source file.
4160 * testsuite/dwp_test_2.sh: New source file.
4161 * testsuite/dwp_test_main.cc: New source file.
4162 * testsuite/dwp_test_main.s: New source file.
4163
4164 2012-10-23 Cary Coutant <ccoutant@google.com>
4165
4166 * dwp.h: New header file.
4167 * dwp.cc: New source file.
4168 * gold.h: Move shared declarations to system.h.
4169 * system.h: New header file.
4170 * Makefile.am: Add dwp.
4171 * Makefile.in: Regenerate.
4172
4173 2012-10-23 Cary Coutant <ccoutant@google.com>
4174
4175 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4176 Dwarf_info_reader::read_from_pointer.
4177 (Dwarf_pubnames_table::read_header): Likewise.
4178 (Dwarf_pubnames_table::next_name): Likewise.
4179 (Dwarf_die::read_attributes): Likewise.
4180 (Dwarf_die::skip_attributes): Likewise.
4181 (Dwarf_info_reader::read_from_pointer): New function template.
4182 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4183 (Dwarf_pubnames_table): Likewise.
4184 (Dwarf_info_reader::read_from_pointer): New function template.
4185 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4186 Dwarf_pubnames_table ctor.
4187
4188 2012-10-23 Cary Coutant <ccoutant@google.com>
4189
4190 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4191 abbrev_shndx.
4192 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4193 abbrev_shndx_.
4194 (Dwarf_info_reader::set_abbrev_shndx): New method.
4195 (Dwarf_info_reader::abbrev_shndx_): New data member.
4196
4197 2012-10-23 Cary Coutant <ccoutant@google.com>
4198
4199 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4200 from object, not parameters.
4201 (Dwarf_info_reader::parse): Likewise.
4202 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4203 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4204 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4205 methods.
4206
4207 2012-10-23 Cary Coutant <ccoutant@google.com>
4208
4209 * fileread.cc (Input_file::Input_file): New constructor.
4210 * fileread.h (class Input_file): Add new constructor.
4211
4212 2012-10-18 Alan Modra <amodra@gmail.com>
4213
4214 PR gold/14727
4215 * object.cc (Relobj::is_section_name_included): Also match
4216 .sdata personality section.
4217
4218 2012-10-18 Alan Modra <amodra@gmail.com>
4219
4220 * target-reloc.h (class Default_comdat_behavior): New, package up..
4221 (get_comdat_behaviour): ..this.
4222 (relocate_section): Add Relocate_comdat_behavior template arg,
4223 adjust code to suit.
4224 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4225 (Target_arm::scan_reloc_section): Likewise.
4226 * i386.cc (Target_i386::relocate_section): Likewise.
4227 * sparc.cc (Target_sparc::relocate_section): Likewise.
4228 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4229 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4230 * powerpc.cc (class Relocate_comdat_behavior): New.
4231 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4232 gold::relocate_section with new template arg.
4233
4234 2012-10-18 Alan Modra <amodra@gmail.com>
4235
4236 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4237 dynamic relocs for GOT_TPREL got entries, without symbol if
4238 resolving locally.
4239 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4240 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4241 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4242
4243 2012-10-17 Alan Modra <amodra@gmail.com>
4244
4245 PR gold/14726
4246 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4247
4248 2012-10-16 Sriraman Tallam <tmsriram@google.com>
4249
4250 * layout.cc (Layout::include_section): Keep sections marked
4251 SHF_EXCLUDE when doing relocatable links.
4252
4253 2012-10-16 Alan Modra <amodra@gmail.com>
4254
4255 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4256 (Target_powerpc::do_finalize_sections): Call it.
4257 (Output_data_save_res): New class and supporting functions.
4258 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4259 normal symbols defined in object files.
4260
4261 2012-10-12 Alan Modra <amodra@gmail.com>
4262
4263 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4264 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4265 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4266 section if scan_opd_relocs not yet called.
4267 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4268
4269 2012-10-12 Alan Modra <amodra@gmail.com>
4270
4271 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4272 add_local_ifunc_entry): Revert last change.
4273 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4274
4275 2012-10-05 Alan Modra <amodra@gmail.com>
4276
4277 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4278 do_plt_address_for_global): New functions.
4279 (Output_data_got_powerpc::do_write): Don't segfault when linking
4280 statically.
4281 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4282 add_local_ifunc_entry): Return true on adding entry..
4283 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4284 glink->add_entry call. Remove unused symtab param. Adjust calls.
4285 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4286 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4287 set up symbols here.
4288 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4289 syms here. Do so even when no .iplt. Don't segfault when linking
4290 statically.
4291 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4292 new variants without reloc param.
4293 (Glink_sym_ent::Glink_sym_ent): Likewise.
4294 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4295 reloc when refs will resolve to plt call stub.
4296 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4297 R_PPC_PLTREL24 to resolve locally.
4298 (Target_powerpc::Scan::global): Correct ifunc handling.
4299 (Target_powerpc::Relocate::relocate): Correct local sym glink
4300 lookup. Don't destroy "value" when we have a plt call stub,
4301 and when checking plt call validity.
4302 (Target_powerpc::do_dynsym_value): Simplify.
4303
4304 2012-10-05 Alan Modra <amodra@gmail.com>
4305
4306 * i386.cc (Output_data_plt_i386::address_for_global,
4307 address_for_local): Add plt offset to returned value. Adjust uses.
4308 * sparc.cc (Output_data_plt_sparc::address_for_global,
4309 address_for_local): Likewise.
4310 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4311 address_for_local): Likewise.
4312 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4313 address_for_local): Likewise.
4314 * target.h (Target::plt_address_for_global, plt_address_for_local):
4315 Update comment.
4316 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4317 (Output_data_got::Got_entry::write): Nor here.
4318 * output.h: Comment fix.
4319
4320 2012-10-02 Jiong Wang <jiwang@tilera.com>
4321
4322 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4323 global_offset_table_ value for larget got.
4324 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4325
4326 2012-09-29 Alan Modra <amodra@gmail.com>
4327
4328 * powerpc.cc (Target_powerpc::iplt_): New output section.
4329 (Target_powerpc::iplt_section, make_iplt_section,
4330 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4331 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4332 Target_powerpc::plt_entry_count): Count iplt entries too.
4333 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4334 reloc section in constructor. New params.
4335 (Target_powerpc::make_plt_section): Create reloc section here instead.
4336 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4337 functions.
4338 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4339 (Output_data_glink::add_entry, find_entry): New functions to
4340 deal with local syms.
4341 (Glink_sym_ent): Add support for local syms.
4342 (Output_data_glink::do_write): Handle ifunc plt entries.
4343 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4344 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4345 (Target_powerpc::Relocate::relocate): Likewise.
4346 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4347
4348 2012-09-25 Alan Modra <amodra@gmail.com>
4349
4350 * object.h (Sized_relobj_file::adjust_local_symbol,
4351 do_adjust_local_symbol): New functions.
4352 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4353 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4354 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4355 and irregular opd entry spacing.
4356 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4357 (Global_symbol_visitor_opd): New functor.
4358 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4359 on deleted opd entries.
4360
4361 2012-09-15 Jiong Wang <jiwang@tilera.com>
4362
4363 * tilegx.cc: New file.
4364 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4365 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4366 * configure.tgt: Add entries for tilegx*.
4367 * configure.ac: Likewise.
4368 * Makefile.in: Rebuild.
4369 * configure: Likewise.
4370 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4371 tilegx.
4372
4373 2012-09-13 Alan Modra <amodra@gmail.com>
4374
4375 * target-reloc.h (scan_relocs): Call scan.local for relocs
4376 against symbols in discarded sections. Pass is_discarded
4377 param.
4378 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4379 Add is_discarded param.
4380 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4381 is_discarded to flag opd entry as discarded. Don't emit dyn
4382 relocs on such entries.
4383 (Target_powerpc::Scan::global): Similarly detect and handle
4384 such opd entries.
4385 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4386 opd_ent_. Update all uses.
4387 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4388 (Target_powerpc::relocate_section): Zero out discarded opd
4389 entry relocs.
4390
4391 2012-09-12 Ian Lance Taylor <iant@google.com>
4392
4393 PR gold/14570
4394 * output.cc: Rename Output_data_got template parameter from size
4395 to got_size for all functions. Compile all variants of
4396 Output_data_got.
4397 (Output_data_got::Got_entry::write): Correct use of size for
4398 symbol value. Use local_is_tls rather than casting to
4399 Sized_relobj_file.
4400 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4401 (class Sized_relobj_file): Add do_local_is_tls.
4402 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4403
4404 2012-09-11 Alan Modra <amodra@gmail.com>
4405
4406 PR gold/14566
4407 * layout.cc (Layout::set_segment_offsets): When using
4408 common-page-size alignment, ensure we are on a new max-page-size
4409 page.
4410 * output.cc (Output_segment::set_section_addresses): Use
4411 abi_pagesize, not common_pagesize for relro boundary.
4412 (Output_segment::set_offset): Likewise.
4413
4414 2012-09-11 Alan Modra <amodra@gmail.com>
4415
4416 * output.h (Output_data_got::add_global_tls, add_local_tls,
4417 add_local_tls_pair): New functions.
4418 (Output_data_got::add_local_pair_with_rel): Remove second
4419 reloc param. Expand comment.
4420 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4421 use_plt_or_tls_offset_, similarly for constructor param.
4422 (Output_data_got::Got_entry::write): Add got_index param.
4423 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4424 add_local_tls_pair): New functions.
4425 (Output_data_got::Got_entry::write): Handle tls symbols
4426 with use_plt_or_tls_offset_ set specially.
4427 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4428 (Output_data_got::do_write): Replace iterator with index, pass
4429 index to entry write function.
4430 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4431 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4432 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4433 call.
4434 * i386.cc (Target_i386::Scan::local): Likewise.
4435 * sparc.cc (Target_sparc::Scan::local): Likewise.
4436 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4437 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4438 do_tls_offset_for_global): New functions.
4439 (Target_powerpc::Scan::local): Correct TLS relocations and got
4440 entry values.
4441 (Target_powerpc::Scan::global): Don't emit unnecessary
4442 dynamic relocations on TLS GOT entries.
4443
4444 2012-09-10 Matthias Klose <doko@ubuntu.com>
4445
4446 * config.in: Disable sanity check for kfreebsd.
4447
4448 2012-09-10 Sterling Augustine <saugustine@google.com>
4449
4450 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4451 (Gdb_index::pubtypes_read): New parameter.
4452 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4453 to calls.
4454 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4455 pubtypes_object_.
4456
4457 2012-09-09 Alan Modra <amodra@gmail.com>
4458
4459 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4460 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4461 * gc.h (gc_process_relocs): Call target gc_add_reference.
4462 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4463 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4464 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4465 unnecessary cast.
4466 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4467 to cater for when we don't need code offset. Update use.
4468 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4469 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4470 set_opd_valid): New functions.
4471 (Target_powerpc::do_gc_add_reference): New function.
4472 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4473 stashed refs.
4474 (Target_powerpc::do_gc_mark_symbol): New function.
4475
4476 2012-09-06 Cary Coutant <ccoutant@google.com>
4477
4478 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4479 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4480 (Dwarf_die::skip_attributes): Likewise.
4481 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4482 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4483 (main): Call it.
4484 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4485
4486 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4487
4488 * testsuite/script_test_3.t: Add .got.plt output section
4489 statement.
4490 * testsuite/script_test_4.t: Likewise.
4491
4492 2012-09-05 Alan Modra <amodra@gmail.com>
4493
4494 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4495 update all uses and lose "enum" when using type.
4496
4497 2012-09-05 Alan Modra <amodra@gmail.com>
4498
4499 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4500 * configure: Regenerate.
4501 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4502 (plugin_final_layout.stdout): Likewise.
4503 (memory_test): Set page sizes to 0x1000.
4504 * testsuite/Makefile.in: Regenerate.
4505 * testsuite/discard_locals_test.sh: Add FIXME comment.
4506 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4507 * testsuite/pr14265.t: Add .got output section statement.
4508 * testsuite/script_test_2.t: Likewise.
4509 * testsuite/script_test_3.t: Likewise.
4510 * testsuite/script_test_4.t: Likewise.
4511 * testsuite/script_test_5.t: Likewise.
4512 * testsuite/script_test_6.t: Likewise.
4513 * testsuite/script_test_7.t: Likewise.
4514 * testsuite/script_test_9.t: Likewise.
4515
4516 2012-09-05 Alan Modra <amodra@gmail.com>
4517
4518 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4519 (Powerpc_relocate_functions::Status): New typedef.
4520 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4521 (Target_powerpc::Scan::local): Handle REL64.
4522 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4523 for REL32 and REL64.
4524 (Target_powerpc::symval_for_branch): New function, extracted from..
4525 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4526 checks. Report overflow errors.
4527
4528 2012-09-05 Alan Modra <amodra@gmail.com>
4529
4530 * object.h (Sized_relobj_file::emit_relocs): Delete.
4531 (Sized_relobj_file::emit_relocs_reltype): Delete.
4532 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4533 relocate_relocs for --emit-relocs.
4534 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4535 * output.h: Update comment.
4536 (Output_segment::first_section): New function.
4537 (Output_segment::first_section_load_address): Use first_section.
4538 * output.cc (Output_segment::first_section): New function extracted..
4539 (Output_segment::first_section_load_address): ..from here. Delete.
4540 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4541 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4542 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4543 adjust call to target.h function.
4544 * i386.cc (Target_i386): Likewise.
4545 * sparc.cc (Target_sparc): Likewise.
4546 * x86_64.cc (Target_x86_64): Likewise.
4547 * powerpc.cc (Target_powerpc): Likewise.
4548 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4549 first tls section has section symbol for optimised local dynamic
4550 output relocs.
4551 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4552 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4553 optimised tls code.
4554 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4555 Rename to relocate_relocs. Update error message.
4556
4557 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4558
4559 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4560 --just-symbols.
4561
4562 2012-08-31 Alan Modra <amodra@gmail.com>
4563
4564 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4565 (Powerpc_relobj::toc_base_offset): New stub function.
4566 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4567 got_mod_index_offset to tlsld_got_offset. Update all refs.
4568 (Target_powerpc::Relocate::enum skip_tls): New.
4569 (Target_powerpc::call_tls_get_addr_): New var.
4570 (Target_powerpc::is_branch_reloc): Move to file scope.
4571 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4572 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4573 New functions.
4574 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4575 (powerpc_info): Correct common_pagesize for ppc64.
4576 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4577 (Powerpc_relocate_functions): Add overflow check enums and functions.
4578 Add non-shift version of rela, rela_ua. Delete all rel public
4579 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4580 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4581 addr16_ha3, addr14 functions.
4582 (Output_data_got_powerpc::add_constant_pair): New function.
4583 (Output_data_got_powerpc::got_base_offset): Likewise.
4584 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4585 (instruction constants): Sort, add some more.
4586 (Output_data_glink::do_write): Add and use Address typedef. Use
4587 object->toc_base_offset() stub for 64-bit.
4588 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4589 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4590 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4591 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4592 Always treat .opd relocs as against locally defined symbol.
4593 Correct condition for RELATIVE relocs.
4594 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4595 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4596 for 32-bit syms with a plt entry. Correct ppc64 toc base
4597 calculations. Handle TLS relocs, and more. Add overflow
4598 checking and adjust for Powerpc_relocate_functions changes.
4599 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4600 Reinstate --emit-relocs code with FIXME.
4601
4602 2012-08-30 Alan Modra <amodra@gmail.com>
4603
4604 * layout.cc (Layout::set_segment_offsets): Set p_align to
4605 abi_pagesize, not common_pagesize.
4606 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4607 to determine whether file header can go in segment.
4608
4609 2012-08-30 Alan Modra <amodra@gmail.com>
4610
4611 * output.h (Output_reloc::Output_reloc <output section>): Add
4612 is_relative param. Adjust calls.
4613 (Output_reloc::add_output_section_relative): New functions.
4614 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4615 is_relative.
4616 (Output_reloc::symbol_value): Handle SECTION_CODE.
4617
4618 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4619
4620 * gold.cc (queue_middle_tasks): Call layout again when unique
4621 segments for sections is desired.
4622 * layout.cc (Layout::Layout): Initialize new members.
4623 (Layout::get_output_section_flags): New function.
4624 (Layout::choose_output_section): Call get_output_section_flags.
4625 (Layout::layout): Make output section for mapping to a unique segment.
4626 (Layout::insert_section_segment_map): New function.
4627 (Layout::attach_allocated_section_to_segment): Make unique segment for
4628 output sections marked so.
4629 (Layout::segment_precedes): Check for unique segments when sorting.
4630 * layout.h (Layout::Unique_segment_info): New struct.
4631 (Layout::Section_segment_map): New typedef.
4632 (Layout::insert_section_segment_map): New function.
4633 (Layout::get_output_section_flags): New function.
4634 (Layout::is_unique_segment_for_sections_specified): New function.
4635 (Layout::set_unique_segment_for_sections_specified): New function.
4636 (Layout::unique_segment_for_sections_specified_): New member.
4637 (Layout::section_segment_map_): New member.
4638 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4639 Rename is_gc_pass_one to is_pass_one.
4640 Rename is_gc_pass_two to is_pass_two.
4641 Rename is_gc_or_icf to is_two_pass.
4642 Check for which pass based on whether symbols data is present.
4643 Make it two pass when unique segments for sections is desired.
4644 * output.cc (Output_section::Output_section): Initialize new
4645 members.
4646 * output.h (Output_section::is_unique_segment): New function.
4647 (Output_section::set_is_unique_segment): New function.
4648 (Output_section::is_unique_segment_): New member.
4649 (Output_section::extra_segment_flags): New function.
4650 (Output_section::set_extra_segment_flags): New function.
4651 (Output_section::extra_segment_flags_): New member.
4652 (Output_section::segment_alignment): New function.
4653 (Output_section::set_segment_alignment): New function.
4654 (Output_section::segment_alignment_): New member.
4655 (Output_segment::Output_segment): Initialize is_unique_segment_.
4656 (Output_segment::is_unique_segment): New function.
4657 (Output_segment::set_is_unique_segment): New function.
4658 (Output_segment::is_unique_segment_): New member.
4659 * plugin.cc (allow_unique_segment_for_sections): New function.
4660 (unique_segment_for_sections): New function.
4661 (Plugin::load): Add new functions to transfer vector.
4662 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4663 * Makefile.in: Regenerate.
4664 * testsuite/plugin_final_layout.sh: Check if unique segment
4665 functionality works.
4666 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4667 are available.
4668 (allow_unique_segment_for_sections): New global.
4669 (unique_segment_for_sections): New global.
4670 (claim_file_hook): Call allow_unique_segment_for_sections.
4671 (all_symbols_read_hook): Call unique_segment_for_sections.
4672
4673 2012-08-22 Cary Coutant <ccoutant@google.com>
4674
4675 * layout.cc (Layout::include_section): Don't assert on GROUP
4676 sections with --emit-relocs.
4677
4678 2012-08-21 Cary Coutant <ccoutant@google.com>
4679
4680 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4681 if --export-dynamic-symbol names an undef symbol.
4682
4683 2012-08-18 Alan Modra <amodra@gmail.com>
4684
4685 * powerpc.cc: Formatting and white space.
4686 (Powerpc_relobj): Rename got2_section_ to special_.
4687 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4688 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4689 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4690 (Target_powerpc): Add Address typedef and invalid_address. Use
4691 throughout.
4692 (Target_powerpc::is_branch_reloc): New function.
4693 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4694 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4695 for dst_mask, value and addend.
4696 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4697 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4698 (Output_data_glink::do_write): Correct toc base. Don't try to use
4699 uint16_t for 24-bit offset. Use get_output_section_offset and
4700 check return.
4701 (Target_powerpc::Scan::local): Handle more relocs.
4702 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4703 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4704 Plug in toc restoring insn after plt calls. Translate branches
4705 to function descriptor symbols to corresponding entry point.
4706 (Target_powerpc::relocate_for_relocatable): Check return from
4707 get_output_section_offset.
4708 * symtab.h: Comment typo.
4709
4710 2012-08-14 Ian Lance Taylor <iant@google.com>
4711
4712 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4713 unsupported_relocal_local to call unsupported_reloc_global.
4714
4715 2012-08-14 Nick Clifton <nickc@redhat.com>
4716
4717 PR ld/14265
4718 * script-sections.cc (Sections_element::output_section_name): Add
4719 keep return parameter.
4720 (Output_section_element::match_name): Add keep return parameter.
4721 Return the value of the keep_ member.
4722 * script-sections.h (class Output_section): Update
4723 output_section_name prototype.
4724 * layout.cc (Layout::keep_input_section): New public member
4725 function.
4726 (Layout::choose_output_section): Pass keep parameter to
4727 output_section_name.
4728 * layout.h (class Layout): Add keep_input_section.
4729 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4730 sections.
4731 * testsuite/Makefile.am: Add a test.
4732 * testsuite/Makefile.in: Regenerate.
4733 * testsuite/pr14265.c: Source file for the test.
4734 * testsuite/pr14265.t: Linker script for the test.
4735 * testsuite/pr14265.sh: Shell script for the test.
4736
4737 2012-08-14 Alan Modra <amodra@gmail.com>
4738
4739 * target.h (Target::output_section_name): New function.
4740 (Target::do_output_section_name): New function.
4741 * layout.cc (Layout::choose_output_section): Call the above.
4742 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4743
4744 2012-08-14 Alan Modra <amodra@gmail.com>
4745
4746 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4747 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4748 for replace_constant call.
4749 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4750 (Output_data_glink::do_print_to_mapfile): New function.
4751 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4752 (Target_powerpc::Relocate::relocate): Likewise.
4753
4754 2012-08-14 Alan Modra <amodra@gmail.com>
4755
4756 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4757 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4758 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4759 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4760 all references to shndx_. Handle special case for R_PPC_PLTREL24
4761 here.
4762 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4763 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4764 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4765 here.
4766 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4767 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4768
4769 2012-08-12 Alan Modra <amodra@gmail.com>
4770
4771 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4772 (glink insn constants): Use uint32_t.
4773 (Output_data_glink::add_entry): Use insert, not [] operator.
4774
4775 2012-08-11 Alan Modra <amodra@gmail.com>
4776
4777 * object.h (Sized_relobj_file::find_shdr): New function.
4778 (Sized_relobj_file::find_special_sections): New function.
4779 * object.cc (Sized_relobj_file::find_shdr): New function.
4780 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4781 (Sized_relobj_file::find_special_sections): New function, split out..
4782 (Sized_relobj_file::do_read_symbols): ..from here.
4783 * output.h (Output_data_got::replace_constant): New function.
4784 (Output_data_got::num_entries): New function.
4785 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4786 (Output_data_got::got_offset): Protected rather than private.
4787 (Output_data_got::replace_got_entry): New function.
4788 * output.cc (Output_data_got::replace_got_entry): New function.
4789 * powerpc.cc (class Powerpc_relobj): New.
4790 (class Powerpc_relocate_functions): Delete all psymval variants or
4791 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4792 Implement _ha functions using corresponding _hi function.
4793 (Powerpc_relobj::find_special_sections): New function.
4794 (Target_powerpc::do_make_elf_object): New function.
4795 (class Output_data_got_powerpc): New.
4796 (class Output_data_glink): New.
4797 (class Powerpc_scan_relocatable_reloc): New.
4798 Many more changes througout file.
4799
4800 2012-08-09 Nick Clifton <nickc@redhat.com>
4801
4802 * po/vi.po: Updated Vietnamese translation.
4803
4804 2012-08-07 Ian Lance Taylor <iant@google.com>
4805
4806 * layout.cc (Layout::add_target_dynamic_tags): If
4807 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4808 plt_rel.
4809
4810 2012-07-30 Nick Clifton <nickc@redhat.com>
4811
4812 * po/gold.pot: Updated template.
4813 * po/es.po: Updated Spanish translation.
4814
4815 2012-07-18 Cary Coutant <ccoutant@google.com>
4816
4817 PR gold/14344
4818 * configure.ac: Add check for -gpubnames support.
4819 * configure: Regenerate.
4820 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4821 support; force -gno-pubnames.
4822 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4823 support.
4824 (gdb_index_test_4): New test.
4825 * testsuite/Makefile.in: Regenerate.
4826 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4827 * testsuite/gdb_index_test_2.sh: Likewise.
4828 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4829 * testsuite/gdb_index_test_4.sh: New script.
4830 * testsuite/gdb_index_test_comm.sh: New script with common code;
4831 don't look for space after colon.
4832
4833 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4834
4835 * gold.cc (queue_middle_tasks): Update function order only after
4836 deferred objects due to plugins are processed.
4837
4838 2012-07-11 Ian Lance Taylor <iant@google.com>
4839
4840 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4841 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4842 (Target_arm::scan_reloc_for_stub): Likewise.
4843 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4844 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4845 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4846 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4847 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4848
4849 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4850 Ian Lance Taylor <iant@google.com>
4851
4852 PR gold/14309
4853 * configure.ac: Test whether std::tr1::hash<off_t> works.
4854 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4855 needed.
4856 * output.h (class Output_fill): Add virtual destructor.
4857 * configure, config.in: Rebuild.
4858
4859 2012-06-22 Roland McGrath <mcgrathr@google.com>
4860
4861 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4862
4863 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4864
4865 * plugin.cc (Plugin::load): Handle position independent executables.
4866
4867 2012-06-06 Cary Coutant <ccoutant@google.com>
4868
4869 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4870 add .debug_macro.
4871 (lines_only_debug_sections): Likewise.
4872 (gdb_fast_lookup_sections): New static array.
4873 (is_gdb_debug_section): Rename formal parameter.
4874 (is_lines_only_debug_section): Likewise.
4875 (is_gdb_fast_lookup_section): New function.
4876 (Layout::include_section): Check for ".zdebug_" prefix; pass
4877 section name suffix to is_gdb_debug_section, et al.; check for
4878 fast-lookup sections when building .gdb_index.
4879 * options.h (--strip-debug-gdb): Update GDB version number.
4880
4881 2012-06-06 Cary Coutant <ccoutant@google.com>
4882
4883 * configure.ac: Add check for fallocate.
4884 * configure: Regenerate.
4885 * config.in: Regenerate.
4886
4887 * options.h (class General_options): Add --mmap-output-file and
4888 --posix-fallocate options.
4889 * output.cc: (posix_fallocate): Remove; replace with...
4890 (gold_fallocate): New function.
4891 (Output_file::map_no_anonymous): Call gold_fallocate.
4892 (Output_file::map): Check --mmap-output-file option.
4893
4894 2012-06-05 Jing Yu <jingyu@google.com>
4895
4896 * gold.h (textdomain): Add do {} to empty while(0).
4897 (bindtextdomain): Likewise.
4898
4899 2012-06-04 Cary Coutant <ccoutant@google.com>
4900
4901 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4902 has_dynsym_index.
4903
4904 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4905
4906 * symtab.cc (Symbol_table::define_special_symbol):
4907 Initialize *poldsym to prevent uninitialized variable errors.
4908
4909 2012-05-23 Cary Coutant <ccoutant@google.com>
4910
4911 * layout.cc (Layout::section_name_mapping): Add rules to handle
4912 exact match on .data.rel.ro.local or .data.rel.ro.
4913 (Layout::output_section_name): Check for exact matches.
4914
4915 2012-05-23 Cary Coutant <ccoutant@google.com>
4916
4917 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4918 more carefully.
4919
4920 2012-05-22 Cary Coutant <ccoutant@google.com>
4921
4922 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4923 object before exporting symbol.
4924
4925 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4926
4927 * testsuite/tls_test.cc: Include "config.h" first.
4928 * testsuite/tls_test_c.c: Likewise.
4929
4930 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4931 Nick Clifton <nickc@redhat.com>
4932
4933 PR 14072
4934 * configure.in: Add check that sysdep.h has been included before
4935 any system header files.
4936 * configure: Regenerate.
4937 * config.in: Regenerate.
4938
4939 2012-05-14 Cary Coutant <ccoutant@google.com>
4940
4941 * layout.cc (Layout::make_output_section): Mark .tdata section
4942 as RELRO.
4943 * testsuite/relro_test.cc: Add a TLS variable.
4944
4945 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4946
4947 PR gold/14091
4948 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4949 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4950 R_X86_64_64.
4951
4952 2012-05-08 Cary Coutant <ccoutant@google.com>
4953
4954 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4955 (lines_only_debug_sections): Likewise.
4956
4957 2012-05-02 Roland McGrath <mcgrathr@google.com>
4958
4959 * nacl.cc: New file.
4960 * nacl.h: New file.
4961 * Makefile.am (CCFILES, HFILES): Add them.
4962 * Makefile.in: Regenerate.
4963 * i386.cc (Output_data_plt_i386_nacl): New class.
4964 (Output_data_plt_i386_nacl_exec): New class.
4965 (Output_data_plt_i386_nacl_dyn): New class.
4966 (Target_i386_nacl): New class.
4967 (Target_selector_i386_nacl): New class.
4968 (target_selector_i386): Use it instead of Target_selector_i386.
4969 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4970 (Target_x86_64_nacl): New class.
4971 (Target_selector_x86_64_nacl): New class.
4972 (target_selector_x86_64, target_selector_x32): Use it instead of
4973 Target_selector_x86_64.
4974 * arm.cc (Output_data_plt_arm_nacl): New class.
4975 (Target_arm_nacl): New class.
4976 (Target_selector_arm_nacl): New class.
4977 (target_selector_arm, target_selector_armbe): Use it instead of
4978 Target_selector_arm.
4979
4980 * target-select.cc (select_target): Take new Input_file* and off_t
4981 arguments, pass them on to recognize method of selector.
4982 * object.cc (make_elf_sized_object): Update caller.
4983 * parameters.cc (parameters_force_valid_target): Likewise.
4984 * incremental.cc (make_sized_incremental_binary): Likewise.
4985 * target-select.h: Update decl.
4986 (Target_selector::recognize): Take new Input_file* argument,
4987 pass it on to do_recognize.
4988 (Target_selector::do_recognize): Take new Input_file* argument.
4989 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4990 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4991 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4992 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4993
4994 * target.h (Target::Target_info): New members isolate_execinstr
4995 and rosegment_gap.
4996 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4997 * arm.cc (Target_arm::arm_info): Update initializer.
4998 * i386.cc (Target_i386::i386_info): Likewise.
4999 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
5000 * sparc.cc (Target_sparc::sparc_info): Likewise.
5001 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5002 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
5003 * layout.cc (Layout::attach_allocated_section_to_segment):
5004 Take new const Target* argument. If target->isolate_execinstr(), act
5005 like --rosegment.
5006 (Layout::find_first_load_seg): Take new const Target* argument;
5007 if target->isolate_execinstr(), reject PF_X segments.
5008 (Layout::relaxation_loop_body): Update caller.
5009 (Layout::set_segment_offsets): If target->isolate_execinstr(),
5010 reset file offset to zero when we hit LOAD_SEG, and then do a second
5011 loop over the segments before LOAD_SEG to reassign offsets after
5012 addresses have been determined. Handle target->rosegment_gap().
5013 (Layout::attach_section_to_segment): Take new const Target* argument;
5014 pass it to attach_allocated_section_to_segment.
5015 (Layout::make_output_section): Update caller.
5016 (Layout::attach_sections_to_segments): Take new const Target* argument;
5017 pass it to attach_section_to_segment.
5018 * gold.cc (queue_middle_tasks): Update caller.
5019 * layout.h (Layout): Update method decls with new arguments.
5020
5021 * arm.cc (Target_arm::Target_arm): Take optional argument for the
5022 Target_info pointer to use.
5023 (Target_arm::do_make_data_plt): New virtual method.
5024 (Target_arm::make_data_plt): New method that calls it.
5025 (Target_arm::make_plt_entry): Use it.
5026 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
5027 for the section alignment.
5028 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
5029 method.
5030 (Output_data_plt_arm::first_plt_entry_offset): Call it.
5031 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
5032 method.
5033 (Output_data_plt_arm::get_plt_entry_size): Call it.
5034 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
5035 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
5036 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
5037 method.
5038 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
5039 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
5040 method instead of sizeof(plt_entry).
5041 (Output_data_plt_arm::add_entry): Likewise.
5042 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
5043 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
5044 than static method.
5045 (Target_arm::plt_entry_size): Likewise.
5046 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
5047 Move to ...
5048 (Output_data_plt_arm_standard): ... here, new class.
5049 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
5050 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
5051 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
5052
5053 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5054 Take additional argument for the PLT entry size.
5055 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
5056 Use get_plt_entry_size method rather than plt_entry_size variable.
5057 (Output_data_plt_x86_64::reserve_slot): Likewise.
5058 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
5059 (Output_data_plt_x86_64::add_entry): Likewise.
5060 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5061 (Output_data_plt_x86_64::address_for_global): Likewise.
5062 (Output_data_plt_x86_64::address_for_local): Likewise.
5063 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5064 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5065 Make method non-static.
5066 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5067 method.
5068 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5069 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5070 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5071 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5072 virtual method.
5073 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5074 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5075 virtual method.
5076 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5077 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5078 virtual method.
5079 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5080 (Output_data_plt_x86_64::plt_entry_size)
5081 (Output_data_plt_x86_64::first_plt_entry)
5082 (Output_data_plt_x86_64::plt_entry)
5083 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5084 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5085 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5086 (Output_data_plt_x86_64_standard): ... here, new class.
5087 (Target_x86_64::Target_x86_64): Take optional argument for the
5088 Target_info pointer to use.
5089 (Target_x86_64::do_make_data_plt): New virtual method.
5090 (Target_x86_64::make_data_plt): New method to call it.
5091 (Target_x86_64::init_got_plt_for_update): Use that.
5092 Call this->plt_->add_eh_frame method here.
5093 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5094 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5095 rather than static method.
5096 (Target_x86_64::plt_entry_size): Likewise.
5097 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5098 rather than plt_entry_size variable. Move guts of PLT filling to...
5099 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5100 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5101 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5102
5103 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5104 additional argument for the section alignment.
5105 Don't do add_eh_frame_for_plt here.
5106 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5107 non-static. Use get_plt_entry_size method rather than plt_entry_size
5108 variable.
5109 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5110 method.
5111 (Output_data_plt_i386::get_plt_entry_size): Call it.
5112 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5113 (Output_data_plt_i386::add_eh_frame): New method to call it.
5114 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5115 method.
5116 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5117 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5118 method.
5119 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5120 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5121 method instead of plt_entry_size.
5122 (Output_data_plt_i386::plt_entry_size)
5123 (Output_data_plt_i386::plt_eh_frame_fde_size)
5124 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5125 (Output_data_plt_i386_standard): ... here, new class.
5126 (Output_data_plt_i386_exec): New class.
5127 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5128 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5129 (Output_data_plt_i386::exec_plt_entry): Move to ...
5130 (Output_data_plt_i386_exec::plt_entry): ... here.
5131 (Output_data_plt_i386_dyn): New class.
5132 (Output_data_plt_i386::first_plt_entry): Move to ...
5133 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5134 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5135 (Output_data_plt_i386_dyn::plt_entry): ... here.
5136 (Target_i386::Target_i386): Take optional argument for the Target_info
5137 pointer to use.
5138 (Target_i386::do_make_data_plt): New virtual method.
5139 (Target_i386::make_data_plt): New method to call it.
5140 (Target_i386::make_plt_section): Use that.
5141 Call this->plt_->add_eh_frame method here.
5142 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5143 rather than plt_entry_size variable.
5144 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5145 (Output_data_plt_i386::address_for_local): Likewise.
5146 (Output_data_plt_i386::do_write): Likewise.
5147 Move guts of PLT filling to...
5148 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5149 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5150 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5151 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5152
5153 2012-05-01 Cary Coutant <ccoutant@google.com>
5154
5155 * dwarf_reader.cc (Dwarf_die::read_attributes)
5156 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5157 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5158 * reduced_debug_output.cc
5159 (Output_reduced_debug_info_section::get_die_end): Remove
5160 DW_FORM_GNU_ref_index. Add default case.
5161
5162 2012-04-26 Mark Wielaard <mjw@redhat.com>
5163
5164 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5165 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5166 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5167 DW_AT_high_pc as offset from DW_AT_low_pc.
5168
5169 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5170 * testsuite/Makefile.in: Regenerate.
5171 * testsuite/gdb_index_test_3.c: New test source file.
5172 * testsuite/gdb_index_test_3.sh: New test source file.
5173
5174 2012-04-25 Ian Lance Taylor <iant@google.com>
5175
5176 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5177 pointer.
5178 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5179 as a class, not a struct.
5180 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5181 (Target_arm::apply_cortex_a8_workaround): Likewise.
5182 * gc.h: Declare Reloc_types as a struct, not a class.
5183 * object.h: Declare Symbols_data as a struct.
5184 * reloc.h: Declare Read_relocs_data as a struct.
5185 * target.h: Declare Relocate_info as a struct.
5186
5187 2012-04-24 David S. Miller <davem@davemloft.net>
5188
5189 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5190 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5191 and R_SPARC_WPLT30.
5192
5193 2012-04-24 Cary Coutant <ccoutant@google.com>
5194
5195 * incremental-dump.cc (find_input_containing_global): Replace
5196 magic number with symbolic constant.
5197 (dump_incremental_inputs): Update version number.
5198 * incremental.cc (Output_section_incremental_inputs): Update version
5199 number; import symbolic constants from Incremental_inputs_reader.
5200 (Incremental_inputs::create_data_sections): Align relocations
5201 section correctly for 64-bit targets.
5202 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5203 constants; add padding.
5204 (Output_section_incremental_inputs::write_header): Add assert for
5205 header_size.
5206 (Output_section_incremental_inputs::write_input_files): Add assert
5207 for input_entry_size.
5208 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5209 add assert for object_info_size, input_section_entry_size,
5210 global_sym_entry_size.
5211 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5212 for data structure sizes; use them.
5213 (Incremental_input_entry_reader): Import symbolic constants from
5214 Incremental_inputs_reader; use them.
5215
5216 2012-04-23 David S. Miller <davem@davemloft.net>
5217
5218 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5219 and elf_flags_set_.
5220 (Target_sparc::Target_sparc): Initialize new fields.
5221 (Target_sparc::do_make_elf_object): New function.
5222 (Target_sparc::do_adjust_elf_header): New function.
5223
5224 2012-04-23 Cary Coutant <ccoutant@google.com>
5225
5226 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5227 CU range table of gdb index.
5228
5229 2012-04-20 David S. Miller <davem@davemloft.net>
5230
5231 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5232 instead of false.
5233
5234 2012-04-16 David S. Miller <davem@davemloft.net>
5235
5236 * sparc.cc (Target_sparc::got_address): New function.
5237 (Sparc_relocate_functions::gdop_hix22): New function.
5238 (Sparc_relocate_functions::gdop_lox10): New function.
5239 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5240 relocs.
5241 (Target_sparc::Scan::local): Likewise if the global symbol is not
5242 preemptible and is not IFUNC.
5243 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5244 transformations for local and non-preemptible non-IFUNC global
5245 symbols.
5246
5247 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5248 writing out 64-bit part of ranges.
5249
5250 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5251 -fpic and -fpie respectively.
5252 * Makefile.in: Regenerate.
5253
5254 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5255 (Target_sparc::Target_sparc): Initialize new field.
5256 (Target_sparc::do_plt_section_for_global): New function.
5257 (Target_sparc::do_plt_section_for_local): New function.
5258 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5259 (Target_sparc::make_plt_section): New function, broken out of
5260 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5261 (Target_sparc::make_plt_entry): Call make_plt_section.
5262 (Target_sparc::make_local_ifunc_plt_entry): New function.
5263 (Target_sparc::rela_ifunc_section): New function.
5264 (Target_sparc::plt_section): Remove const.
5265 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5266 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5267 and ifunc_count_ fields.
5268 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5269 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5270 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5271 (Output_data_plt_sparc::rela_ifunc): New function.
5272 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5273 (Output_data_plt_sparc::has_ifunc_section): New function.
5274 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5275 (Output_data_plt_sparc::address_for_global): New function.
5276 (Output_data_plt_sparc::address_for_local): New function.
5277 (Output_data_plt_sparc::plt_index_to_offset): New function.
5278 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5279 and entry_count.
5280 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5281 entry_count.
5282 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5283 R_SPARC_JMP_IREL to switch.
5284 (Target_sparc::Scan::check_non_pic): Likewise.
5285 (Target_sparc::Scan::local): Handle IFUNC symbols.
5286 (Target_sparc::Scan::local): Likewise.
5287 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5288 and plt_address_for_local.
5289 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5290 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5291
5292 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5293 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5294 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5295 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5296 global relocs too.
5297 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5298 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5299 calls.
5300 * sparc.cc (Target_sparc::Scan::global): Likewise.
5301 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5302
5303 2012-04-16 Cary Coutant <ccoutant@google.com>
5304
5305 * archive.cc (Library_base::should_include_member): Check for
5306 --export-dynamic-symbol.
5307 * options.h (class General_options): Add --export-dynamic-symbol.
5308 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5309 --export-dynamic-symbol.
5310 (Symbol_table::gc_mark_undef_symbols): Likewise.
5311 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5312
5313 2012-04-12 David S. Miller <davem@davemloft.net>
5314
5315 * sparc.cc (Reloc::wdisp10): New relocation method.
5316 (Reloc::h34): Likewise.
5317 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5318 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5319 R_SPARC_WDISP10.
5320 (Target_sparc::Scan::local): Likewise.
5321 (Target_sparc::Scan::global): Likewise.
5322 (Target_sparc::Relocate::relocate): Likewise.
5323
5324 2012-04-09 Cary Coutant <ccoutant@google.com>
5325
5326 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5327 low_pc == 0.
5328
5329 2012-04-06 Ian Lance Taylor <iant@google.com>
5330
5331 * timer.cc: #include <unistd.h>.
5332
5333 2012-04-06 Roland McGrath <mcgrathr@google.com>
5334
5335 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5336 * config.in: Regenerate.
5337 * configure: Regenerate.
5338
5339 2012-04-05 Nick Clifton <nickc@redhat.com>
5340
5341 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5342 (AM_LC_MESSAGES): Add.
5343 * aclocal.m4: Regenerate.
5344 * config.in: Regenerate.
5345 * configure: Regenerate.
5346
5347 2012-03-21 Cary Coutant <ccoutant@google.com>
5348
5349 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5350 * Makefile.in: Regenerate.
5351 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5352 (Sized_elf_reloc_mapper::symbol_section): New function.
5353 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5354 (make_elf_reloc_mapper): New function.
5355 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5356 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5357 (Dwarf_abbrev_table::do_get_abbrev): New function.
5358 (Dwarf_ranges_table::read_ranges_table): New function.
5359 (Dwarf_ranges_table::read_range_list): New function.
5360 (Dwarf_pubnames_table::read_section): New function.
5361 (Dwarf_pubnames_table::read_header): New function.
5362 (Dwarf_pubnames_table::next_name): New function.
5363 (Dwarf_die::Dwarf_die): New function.
5364 (Dwarf_die::read_attributes): New function.
5365 (Dwarf_die::skip_attributes): New function.
5366 (Dwarf_die::set_name): New function.
5367 (Dwarf_die::set_linkage_name): New function.
5368 (Dwarf_die::attribute): New function.
5369 (Dwarf_die::string_attribute): New function.
5370 (Dwarf_die::int_attribute): New function.
5371 (Dwarf_die::uint_attribute): New function.
5372 (Dwarf_die::ref_attribute): New function.
5373 (Dwarf_die::child_offset): New function.
5374 (Dwarf_die::sibling_offset): New function.
5375 (Dwarf_info_reader::check_buffer): New function.
5376 (Dwarf_info_reader::parse): New function.
5377 (Dwarf_info_reader::do_parse): New function.
5378 (Dwarf_info_reader::do_read_string_table): New function.
5379 (Dwarf_info_reader::lookup_reloc): New function.
5380 (Dwarf_info_reader::get_string): New function.
5381 (Dwarf_info_reader::visit_compilation_unit): New function.
5382 (Dwarf_info_reader::visit_type_unit): New function.
5383 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5384 Sized_elf_reloc_mapper.
5385 (Sized_dwarf_line_info::symbol_section): Remove function.
5386 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5387 (Sized_dwarf_line_info::read_line_mappings): Remove object
5388 parameter, adjust callers.
5389 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5390 * dwarf_reader.h: Include <sys/types.h>.
5391 (class Track_relocs): Remove forward declaration.
5392 (class Elf_reloc_mapper): New class.
5393 (class Sized_elf_reloc_mapper): New class.
5394 (class Dwarf_abbrev_table): New class.
5395 (class Dwarf_range_list): New class.
5396 (class Dwarf_ranges_table): New class.
5397 (class Dwarf_pubnames_table): New class.
5398 (class Dwarf_die): New class.
5399 (class Dwarf_info_reader): New class.
5400 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5401 (Sized_dwarf_line_info::symbol_section): Remove member function.
5402 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5403 base class.
5404 * gdb-index.cc: New source file.
5405 * gdb-index.h: New source file.
5406 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5407 and .debug_types sections, call Layout::add_to_gdb_index.
5408 (Sized_relobj_incr::do_section_name): Implement.
5409 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5410 return type; Implement.
5411 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5412 return type.
5413 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5414 parameter list and return type.
5415 (Sized_incr_dynobj::do_section_contents): Likewise.
5416 * layout.cc: Include gdb-index.h.
5417 (Layout::Layout): Initialize gdb_index_data_.
5418 (Layout::init_fixed_output_section): Check for .gdb_index section.
5419 (Layout::add_to_gdb_index): New function. Instantiate.
5420 * layout.h: Add forward declaration for class Gdb_index.
5421 (Layout::add_to_gdb_index): New member function.
5422 (Layout::gdb_index_data_): New data member.
5423 * main.cc: Include gdb-index.h.
5424 (main): Print statistics for gdb index.
5425 * object.cc (Object::section_contents): Move code into
5426 do_section_contents.
5427 (need_decompressed_section): Check for sections needed when building
5428 gdb index.
5429 (build_compressed_section_map): Likewise.
5430 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5431 gdb index.
5432 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5433 sections; call Layout::add_to_gdb_index.
5434 (Sized_relobj_file::do_decompressed_section_contents): Call
5435 do_section_contents directly.
5436 * object.h (Object::do_section_contents): Adjust parameter list and
5437 return type.
5438 (Object::do_decompressed_section_contents): Call do_section_contents
5439 directly.
5440 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5441 return type.
5442 * options.h (class General_options): Add --gdb-index option.
5443 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5444 list and return type.
5445 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5446 * reloc.h (Track_relocs::checkpoint): New function.
5447 (Track_relocs::reset): New function.
5448
5449 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5450 New test cases.
5451 * testsuite/Makefile.in: Regenerate.
5452 * testsuite/gdb_index_test.cc: New test source file.
5453 * testsuite/gdb_index_test_1.sh: New test source file.
5454 * testsuite/gdb_index_test_2.sh: New test source file.
5455
5456 2012-03-19 Doug Kwan <dougkwan@google.com>
5457
5458 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5459 (Target_arm::do_finalize_sections): Remove code which defines
5460 __exidx_start and __exidx_end. Make symbol table parameter
5461 anonymous as it is not used.
5462 * gold.cc (queue_middle_tasks): Call target hook to define any
5463 target-specific symbols.
5464 * target.h (Target::define_standard_symbols): New method.
5465 (Target::do_define_standard_symbols): Same.
5466 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5467 * testsuite/Makefile.in: Regenerate.
5468 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5469 and __exidx_end.
5470 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5471 relocations are generated for __exidx_start and __exidx_end.
5472
5473 2012-03-16 Doug Kwan <dougkwan@google.com>
5474
5475 * testsuite/Makefile.am: Disable test initpri3b.
5476 * testsuite/Makefile.in: Regenerate.
5477
5478 2012-03-15 Doug Kwan <dougkwan@google.com>
5479
5480 * arm.cc (Target_arm::got_section): Make .got section read-only
5481 if -z now is given.
5482
5483 2012-03-15 Ian Lance Taylor <iant@google.com>
5484
5485 PR gold/13850
5486 * layout.cc (Layout::make_output_section): Correctly mark
5487 SHT_INIT_ARRAY, et. al., as relro.
5488
5489 2012-03-14 Doug Kwan <dougkwan@google.com>
5490
5491 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5492 dynamic relocations for protected symbols in shared objects.
5493
5494 2012-03-13 Ian Lance Taylor <iant@google.com>
5495
5496 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5497 keep the larger alignment.
5498
5499 2012-03-12 Cary Coutant <ccoutant@google.com>
5500
5501 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5502 handling of DW_LNE_define_file.
5503
5504 2012-03-12 Cary Coutant <ccoutant@google.com>
5505
5506 * reduced_debug_output.cc
5507 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5508 codes to switch.
5509
5510 2012-02-29 Cary Coutant <ccoutant@google.com>
5511
5512 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5513
5514 2012-02-29 Cary Coutant <ccoutant@google.com>
5515
5516 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5517 Call Object::decompressed_section_contents.
5518 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5519 New dtor.
5520 (Sized_dwarf_line_info::buffer_start_): New data member.
5521 * merge.cc (Output_merge_data::do_add_input_section): Call
5522 Object::decompressed_section_contents.
5523 (Output_merge_string::do_add_input_section): Likewise.
5524 * object.cc (need_decompressed_section): New function.
5525 (build_compressed_section_map): Decompress sections needed later.
5526 (Sized_relobj_file::do_decompressed_section_contents): New function.
5527 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5528 * object.h (Object::decompressed_section_contents): New function.
5529 (Object::discard_decompressed_sections): New function.
5530 (Object::do_decompressed_section_contents): New function.
5531 (Object::do_discard_decompressed_sections): New function.
5532 (Compressed_section_info): New type.
5533 (Compressed_section_map): Include decompressed section contents.
5534 (Sized_relobj_file::do_decompressed_section_contents): New function.
5535 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5536
5537 2012-02-16 Cary Coutant <ccoutant@google.com>
5538
5539 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5540 * testsuite/Makefile.in: Regenerate.
5541
5542 2012-02-14 Cary Coutant <ccoutant@google.com>
5543
5544 * options.cc (General_options::finalize): Disallow -pie and -static.
5545
5546 2012-02-03 Doug Kwan <dougkwan@google.com>
5547
5548 * arm.cc (Arm_relocate_functions::abs8,
5549 Arm_relocate_functions::abs16): Use
5550 Bits::has_signed_unsigned_overflow32.
5551 (Arm_relocate_functions::thm_abs8): Correct range of
5552 overflow check.
5553 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5554 in assertions.
5555
5556 2012-02-02 Doug Kwan <dougkwan@google.com>
5557
5558 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5559 position independent outputs, not just shared objects.
5560
5561 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5562
5563 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5564 * configure: Regenerated.
5565
5566 2012-01-27 Ian Lance Taylor <iant@google.com>
5567
5568 * reloc.h (Bits): New class with static functions, copied from
5569 namespace utils in arm.cc.
5570 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5571 instead.
5572
5573 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5574
5575 * incremental.cc (write_info_blocks): Correct relocation offset.
5576
5577 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5578
5579 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5580 (Relocate::tls_gd_to_le): Likewise.
5581
5582 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5583
5584 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5585
5586 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5587
5588 * configure.ac: Check if -mcmodel=medium works.
5589 * configure: Regenerated.
5590
5591 2012-01-24 Cary Coutant <ccoutant@google.com>
5592
5593 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5594 definition and ...
5595 (read_unsigned_LEB_128_x): ... this new function.
5596 (read_signed_LEB_128): Replaced with inline definition and ...
5597 (read_signed_LEB_128_x): ... this new function.
5598 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5599 (read_unsigned_LEB_128): Add inline definition.
5600 (read_signed_LEB_128_x): New function.
5601 (read_signed_LEB_128): Add inline definition.
5602 * testsuite/Makefile.am (leb128_unittest): New unit test.
5603 * testsuite/Makefile.in: Regenerate.
5604 * testsuite/leb128_unittest.cc: New unit test.
5605
5606 2012-01-23 Ian Lance Taylor <iant@google.com>
5607
5608 PR gold/13617
5609 * i386.cc (Target_i386::do_code_fill): When using a jmp
5610 instruction, pad with nop instructions.
5611 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5612
5613 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5614
5615 * x86_64.cc (gc_process_relocs): Add typename on types used in
5616 template.
5617 (scan_relocs): Likewise.
5618 (relocate_section): Likewise.
5619 (apply_relocation): Likewise.
5620
5621 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5622
5623 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5624 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5625 under x32.
5626
5627 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5628
5629 * x86_64.cc: Initial support for x32.
5630
5631 2012-01-03 Cary Coutant <ccoutant@google.com>
5632
5633 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5634 Use abstract base class for GOT.
5635 * gold/output.h (class Output_data_got_base): New abstract base class.
5636 (class Output_data_got): Derive from new base class, adjust ctors.
5637 (Output_data_got::reserve_slot): Make virtual; rename to
5638 do_reserve_slot; Adjust callers.
5639 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5640 pointer to abstract base class.
5641 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5642
5643 2011-12-18 Ian Lance Taylor <iant@google.com>
5644
5645 * object.h (Relobj::local_symbol_value): New function.
5646 (Relobj::local_plt_offset): New function.
5647 (Relobj::local_has_got_offset): New function.
5648 (Relobj::local_got_offset): New function.
5649 (Relobj::set_local_got_offset): New function.
5650 (Relobj::do_local_symbol_value): New pure virtual function.
5651 (Relobj::do_local_plt_offset): Likewise.
5652 (Relobj::do_local_has_got_offset): Likewise.
5653 (Relobj::do_local_got_offset): Likewise.
5654 (Relobj::do_set_local_got_offset): Likewise.
5655 (Sized_relobj::do_local_has_got_offset): Rename from
5656 local_has_got_offset.
5657 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5658 (Sized_relobj::do_set_local_got_offset): Rename from
5659 set_local_got_offset.
5660 (Sized_relobj_file::do_local_plt_offset): Rename from
5661 local_plt_offset.
5662 (Sized_relobj_file::do_local_symbol_value): New function.
5663 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5664 local_plt_offset.
5665 * output.cc (Output_data_got::Got_entry::write): Change object to
5666 Relobj. Use local_symbol_value.
5667 (Output_data_got::add_global_with_rel): Change rel_dyn to
5668 Output_data_reloc_generic*. Use add_global_generic.
5669 (Output_data_got::add_global_with_rela): Remove. Change all
5670 callers to use add_global_with_rel.
5671 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5672 Output_data_reloc_generic*. Use add_global_generic.
5673 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5674 callers to use add_global_pair_with_rel.
5675 (Output_data_got::add_local): Change object to Relobj*.
5676 (Output_data_got::add_local_plt): Likewise.
5677 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5678 change rel_dyn to Output_data_reloc_generic*. Use
5679 add_local_generic.
5680 (Output_data_got::add_local_with_rela): Remove. Change all
5681 callers to use all_local_with_rel.
5682 (Output_data_got::add_local_pair_with_rel): Change object to
5683 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5684 add_output_section_generic.
5685 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5686 callers to use add_local_pair_with_rel.
5687 (Output_data_got::reserve_local): Change object to Relobj*.
5688 * output.h: (class Output_data_reloc_generic): Add pure virtual
5689 declarations for add_global_generic, add_local_generic,
5690 add_output_section_generic.
5691 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5692 functions for Output_data_reloc_generic. Update declarations for
5693 changes listed in output.cc.
5694 (class Output_data_got): Change template parameter to got_size.
5695 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5696 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5697 function.
5698 (Sized_relobj_incr::do_local_plt_offset): New function.
5699 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5700 add_global_generic.
5701
5702 2011-12-17 Cary Coutant <ccoutant@google.com>
5703
5704 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5705 * resolve.cc (Symbol_table::resolve): Likewise.
5706 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5707 arrays.
5708 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5709
5710 2011-12-16 Ian Lance Taylor <iant@google.com>
5711
5712 * output.h (Output_data_reloc_generic::add): Only call
5713 add_dynamic_reloc if this is a dynamic reloc section.
5714
5715 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5716
5717 PR gold/13505
5718 * target-reloc.h (apply_relocation): Replace <64, false> with
5719 <size, big_endian>.
5720
5721 2011-11-25 Nick Clifton <nickc@redhat.com>
5722
5723 * po/it.po: New Italian translation.
5724
5725 2011-11-17 Sterling Augustine <saugustine@google.com>
5726
5727 * script.cc (script_include_directive): Implement.
5728 (read_script_file): New local variables name and search_path. Update
5729 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5730 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5731 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5732
5733 2011-11-11 Sterling Augustine <saugustine@google.com>
5734
5735 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5736 (file_or_sections_cmd): Likewise.
5737
5738 2011-11-11 Doug Kwan <dougkwan@google.com>
5739
5740 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5741 if --just-symbols is given.
5742
5743 2011-11-10 Doug Kwan <dougkwan@google.com>
5744
5745 PR gold/13362
5746 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5747 when processing data relocs.
5748 * reloc.h (Relocate_functions::rel_unaligned): New method.
5749 (Relocate_functions::pcrel_unaligned): Ditto.
5750 (Relocate_functions::rel32_unaligned): Ditto.
5751 (Relocate_functions::pcrel32_unaligned): Ditto.
5752
5753 2011-11-09 Doug Kwan <dougkwan@google.com>
5754
5755 PR gold/13362
5756 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5757 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5758 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5759 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5760 (Relocate_functions::rel_unaligned): New.
5761 (Relocate_functions::rel32_unaligned): New.
5762 * target-reloc.h (relocate_for_relocatable): Add code to handle
5763 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5764 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5765 arm_unaligned_reloc_r): New targets.
5766 * testsuite/Makefile.in: Regenerate.
5767 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5768 linking.
5769
5770 2011-11-02 Ian Lance Taylor <iant@google.com>
5771
5772 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5773 NATIVE_LINKER.
5774 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5775 * options.cc (General_options::finalize): Use library search path
5776 from configure script if specified. If not native and no sysroot,
5777 only search TOOLLIBDIR.
5778 * options.h (Search_directory::Search_directory): Change name to
5779 const std::string&.
5780 (General_options::add_to_library_path_with_sysroot): Change arg to
5781 const std::string&.
5782 * configure, Makefile.in, config.in: Rebuild.
5783
5784 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5785
5786 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5787 we are working around the ARM1176 Erratum.
5788 * options.h (General_options::fix_arm1176): Add option.
5789 * testsuite/Makefile.am: Add testcases, and keep current ones
5790 working.
5791 * testsuite/Makefile.in: Regenerate.
5792 * testsuite/arm_fix_1176.s: New file.
5793 * testsuite/arm_fix_1176.sh: Likewise.
5794
5795 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5796
5797 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5798 may_use_blx_.
5799 (Target_arm::may_use_blx): Remove method.
5800 (Target_arm::set_may_use_blx): Likewise.
5801 (Target_arm::may_use_v4t_interworking): New method.
5802 (Target_arm::may_use_v5t_interworking): Likewise.
5803 (Target_arm::may_use_blx_): Remove member variable.
5804 (Arm_relocate_functions::arm_branch_common): Check for v5T
5805 interworking.
5806 (Arm_relocate_functions::thumb_branch_common): Likewise.
5807 (Reloc_stub::stub_type_for_reloc): Likewise.
5808 (Target_arm::do_finalize_sections): Correct interworking checks.
5809 * testsuite/Makefile.am: Add new tests.
5810 * testsuite/Makefile.in: Regenerate.
5811 * testsuite/arm_farcall_arm_arm.s: New test.
5812 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5813 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5814 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5815 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5816 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5817 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5818 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5819
5820 2011-10-31 Cary Coutant <ccoutant@google.com>
5821
5822 PR gold/13023
5823 * expression.cc (Expression::eval_with_dot): Add
5824 is_section_dot_assignment parameter.
5825 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5826 absolute and assigning to dot within a section.
5827 * script-sections.cc
5828 (Output_section_element_assignment::set_section_addresses): Pass
5829 dot_section to set_if_absolute.
5830 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5831 as is_section_dot_assignment flag to eval_with_dot.
5832 (Output_section_element_dot_assignment::set_section_addresses):
5833 Likewise.
5834 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5835 parameter. Also set value if relative to dot_section; set the
5836 symbol's output_section.
5837 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5838 parameter. Adjust all callers.
5839 (Expression::eval_maybe_dot): Likewise.
5840 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5841 Adjust all callers.
5842 * testsuite/script_test_2.t: Test assignment of an absolute value
5843 to dot within an output section element.
5844
5845 2011-10-31 Cary Coutant <ccoutant@google.com>
5846
5847 * options.h (class General_options): Add --[no-]gnu-unique options.
5848 * symtab.cc (Symbol_table::sized_write_globals): Convert
5849 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5850
5851 2011-10-31 Cary Coutant <ccoutant@google.com>
5852
5853 PR gold/13359
5854 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5855 unnecessary assertion.
5856 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5857
5858 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5859
5860 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5861 gc_mark_symbol.
5862 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5863 gc_mark_symbol.
5864 Change to just keep the section associated with symbol.
5865 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5866 they are externally visible and --export-dynamic is turned on.
5867 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5868
5869 2011-10-19 Ian Lance Taylor <iant@google.com>
5870
5871 PR gold/13163
5872 * script-sections.cc
5873 (Output_section_element_dot_assignment::needs_output_section): New
5874 function.
5875
5876 2011-10-19 Ian Lance Taylor <iant@google.com>
5877
5878 PR gold/13204
5879 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5880 --section-start option was seen.
5881 * options.h (General_options::any_section_start): New function.
5882
5883 2011-10-18 David S. Miller <davem@davemloft.net>
5884
5885 PR binutils/13301
5886 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5887 member to track relocation locations that have moved during TLS
5888 reloc optimizations.
5889 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5890 (Target_sparc::Relocate::relocate): Adjust view down by 4
5891 bytes if it matches reloc_adjust_addr_.
5892 (Target_sparc::Relocate::relocate_tls): Always move the
5893 __tls_get_addr call delay slot instruction forward 4 bytes when
5894 performing relaxation.
5895
5896 2011-10-18 Cary Coutant <ccoutant@google.com>
5897
5898 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5899 (Output_file::map_no_anonymous): Check for non-zero
5900 return code from posix_fallocate.
5901
5902 2011-10-17 Cary Coutant <ccoutant@google.com>
5903
5904 PR gold/13245
5905 * plugin.cc (is_visible_from_outside): Check for symbols
5906 referenced from dynamic objects.
5907 * resolve.cc (Symbol_table::resolve): Don't count references
5908 from dynamic objects as references from real ELF files.
5909 * testsuite/plugin_test_2.sh: Adjust expected result.
5910
5911 2011-10-17 Cary Coutant <ccoutant@google.com>
5912
5913 * gold.cc: Include timer.h.
5914 (queue_middle_tasks): Stamp time.
5915 (queue_final_tasks): Likewise.
5916 * main.cc (main): Store timer in parameters. Print timers
5917 for each pass.
5918 * parameters.cc (Parameters::Parameters): Initialize timer_.
5919 (Parameters::set_timer): New function.
5920 (set_parameters_timer): New function.
5921 * parameters.h (Parameters::set_timer): New function.
5922 (Parameters::timer): New function.
5923 (Parameters::timer_): New data member.
5924 (set_parameters_timer): New function.
5925 * timer.cc (Timer::stamp): New function.
5926 (Timer::get_pass_time): New function.
5927 * timer.h (Timer::stamp): New function.
5928 (Timer::get_pass_time): New function.
5929 (Timer::pass_times_): New data member.
5930
5931 2011-10-17 Cary Coutant <ccoutant@google.com>
5932
5933 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5934 task for members of lib groups.
5935
5936 2011-10-17 Cary Coutant <ccoutant@google.com>
5937
5938 PR gold/13288
5939 * fileread.cc (File_read::find_view): Add assert.
5940 (File_read::make_view): Move bounds check (replace with assert)...
5941 (File_read::find_or_make_view): ... to here.
5942
5943 2011-10-12 Cary Coutant <ccoutant@google.com>
5944
5945 * output.cc (Output_file::open_base_file): Handle case where
5946 ::read returns less than requested size.
5947
5948 2011-10-10 Cary Coutant <ccoutant@google.com>
5949
5950 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5951 Initialize defined_count_.
5952 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5953 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5954 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5955 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5956 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5957 * incremental.h (Sized_relobj_incr::defined_count_): New data
5958 member.
5959 (Sized_incr_dynobj::defined_count_): New data member.
5960 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5961 Return zeroes instead of internal error.
5962
5963 2011-10-10 Cary Coutant <ccoutant@google.com>
5964
5965 PR gold/13249
5966 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5967 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5968 * output.h (class Output_reloc): Add use_plt_offset flag.
5969 (Output_reloc::type_): Adjust size of bit field.
5970 (Output_reloc::use_plt_offset_): New bit field.
5971 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5972 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5973 flag. Adjust all callers.
5974 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5975 creating RELATIVE relocations.
5976
5977 2011-10-10 Nick Clifton <nickc@redhat.com>
5978
5979 * po/es.po: Updated Spanish translation.
5980 * po/fi.po: Updated Finnish translation.
5981
5982 2011-10-03 Diego Novillo <dnovillo@google.com>
5983
5984 * options.cc (parse_uint): Fix dereference of RETVAL.
5985
5986 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5987
5988 * layout.h (section_order_map_): New member.
5989 (get_section_order_map): New member function.
5990 * output.cc (Output_section::add_input_section): Check for patterns
5991 only when --section-ordering-file is specified.
5992 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5993 output_sections have been formed.
5994 * layout.cc (Layout_Layout): Initialize section_order_map_.
5995 * plugin.cc (update_section_order): Store order in order_map. Do not
5996 update the order.
5997 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5998 * testsuite/Makefile.in: Regenerate.
5999 * testsuite/plugin_section_order.c: New file.
6000 * testsuite/plugin_final_layout.cc: New file.
6001 * testsuite/plugin_final_layout.sh: New file.
6002
6003 2011-09-29 Cary Coutant <ccoutant@google.com>
6004
6005 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6006 Check for NULL.
6007 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
6008 symbols during incremental update.
6009 (Symbol_table::add_from_dynobj): Likewise.
6010
6011 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6012 Ian Lance Taylor <iant@google.com>
6013
6014 * symtab.cc (Symbol_table::define_special_symbol): Always
6015 canonicalize version string.
6016
6017 2011-09-26 Cary Coutant <ccoutant@google.com>
6018
6019 * gold.cc (queue_initial_tasks): Move option checks ...
6020 * options.cc (General_options::finalize): ... to here. Disable
6021 some options; make others fatal.
6022
6023 2011-09-26 Cary Coutant <ccoutant@google.com>
6024
6025 gcc PR lto/47247
6026 * plugin.cc (get_symbols_v2): New function.
6027 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
6028 (is_referenced_from_outside): New function.
6029 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
6030 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
6031 (get_symbols): Pass version parameter.
6032 (get_symbols_v2): New function.
6033 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
6034 parameter.
6035 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
6036 (onload): Add LDPT_GET_SYMBOLS_V2.
6037 (all_symbols_read_hook): Use get_symbols_v2; check for
6038 LDPR_PREVAILING_DEF_IRONLY_EXP.
6039 * testsuite/plugin_test_3.sh: Update expected results.
6040
6041 2011-09-23 Simon Baldwin <simonb@google.com>
6042
6043 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
6044 configuration options.
6045 * configure: Regenerate.
6046 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
6047 * Makefile.in: Regenerate.
6048 * testsuite/Makefile.in: Regenerate.
6049
6050 2011-09-19 Sriraman Tallam <tmsriram@google.com>
6051
6052 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
6053
6054 2011-09-19 Cary Coutant <ccoutant@google.com>
6055
6056 * incremental.cc (can_incremental_update): Fix typo in comment.
6057 * incremental.h (can_incremental_update): Likewise.
6058
6059 2011-09-18 Cary Coutant <ccoutant@google.com>
6060
6061 * incremental.cc (can_incremental_update): New function.
6062 * incremental.h (can_incremental_update): New function.
6063 * layout.cc (Layout::init_fixed_output_section): Call it.
6064 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6065 * object.cc (Sized_relobj_file::do_layout): Call
6066 can_incremental_update.
6067
6068 2011-09-13 Cary Coutant <ccoutant@google.com>
6069
6070 * configure.ac: Check for glibc support for gnu_indirect_function
6071 support with static linking, setting automake conditional
6072 IFUNC_STATIC.
6073 * Makefile.in: Regenerate.
6074 * configure: Regenerate.
6075
6076 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6077 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6078 for IFUNC_STATIC.
6079 * testsuite/Makefile.in: Regenerate.
6080
6081 2011-09-13 Cary Coutant <ccoutant@google.com>
6082
6083 * incremental.cc (Sized_relobj_incr::do_layout): Call
6084 report_comdat_group for kept comdat sections.
6085 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6086 * testsuite/Makefile.in: Regenerate.
6087 * testsuite/incr_comdat_test_1.cc: New source file.
6088 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6089 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6090 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6091
6092 2011-09-13 Ian Lance Taylor <iant@google.com>
6093
6094 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6095 variable external_symbols_offset.
6096
6097 2011-09-12 Ian Lance Taylor <iant@google.com>
6098
6099 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6100 triggered if object has no symbols.
6101
6102 2011-09-09 David S. Miller <davem@davemloft.net>
6103
6104 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6105 (Output_fill_debug_line::do_write): Likewise.
6106
6107 2011-08-29 Cary Coutant <ccoutant@google.com>
6108
6109 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6110 casts to match formatting specs.
6111 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6112
6113 2011-08-26 Cary Coutant <ccoutant@google.com>
6114
6115 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6116 remaining hole size when allocating.
6117 (Layout::make_output_section): Set fill methods for debug sections.
6118 * layout.h (Free_list::Free_list_node): Move from private to
6119 public.
6120 (Free_list::set_min_hole_size): New function.
6121 (Free_list::begin, Free_list::end): New functions.
6122 (Free_list::min_hole_): New data member.
6123 * output.cc: Include dwarf.h.
6124 (Output_fill_debug_info::do_minimum_hole_size): New function.
6125 (Output_fill_debug_info::do_write): New function.
6126 (Output_fill_debug_line::do_minimum_hole_size): New function.
6127 (Output_fill_debug_line::do_write): New function.
6128 (Output_section::Output_section): Initialize new data member.
6129 (Output_section::set_final_data_size): Ensure patch space is larger
6130 than minimum hole size.
6131 (Output_section::do_write): Fill holes in debug sections.
6132 * output.h (Output_fill): New class.
6133 (Output_fill_debug_info): New class.
6134 (Output_fill_debug_line): New class.
6135 (Output_section::set_free_space_fill): New function.
6136 (Output_section::free_space_fill_): New data member.
6137 * testsuite/Makefile.am (incremental_test_3): Add
6138 --incremental-patch option.
6139 (incremental_test_4): Likewise.
6140 (incremental_test_5): Likewise.
6141 (incremental_test_6): Likewise.
6142 (incremental_copy_test): Likewise.
6143 (incremental_common_test_1): Likewise.
6144 * testsuite/Makefile.in: Regenerate.
6145
6146 2011-08-26 Nick Clifton <nickc@redhat.com>
6147
6148 * po/es.po: Updated Spanish translation.
6149
6150 2011-08-01 Cary Coutant <ccoutant@google.com>
6151
6152 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6153 * gold/testsuite/Makefile.in: Regenerate.
6154 * gold/testsuite/justsyms_exec.c: New source file.
6155 * gold/testsuite/justsyms_lib.c: New source file.
6156
6157 2011-08-01 Cary Coutant <ccoutant@google.com>
6158
6159 * layout.cc (Layout::set_segment_offsets): Don't realign text
6160 segment if -Ttext was specified.
6161 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6162 file type.
6163 * object.h (Sized_relobj_file::e_type): New function.
6164 (Sized_relobj_file::e_type_): New data member.
6165 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6166 base address for ET_EXEC files.
6167 * target.cc (Target::do_make_elf_object_implementation): Allow
6168 ET_EXEC files with --just-symbols option.
6169
6170 2011-07-28 Cary Coutant <ccoutant@google.com>
6171
6172 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6173 Add thread_number parameter.
6174 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6175 * workqueue-threads.cc
6176 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6177 current thread if its thread number is greater than desired thread
6178 count.
6179 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6180 Add thread_number parameter.
6181 (Workqueue::should_cancel_thread): Likewise.
6182 (Workqueue::find_runnable_or_wait): Pass thread_number to
6183 should_cancel_thread.
6184 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6185 parameter.
6186
6187 2011-07-22 Sriraman Tallam <tmsriram@google.com>
6188
6189 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6190 only after checking if it cannot be forced local.
6191 * symtab.h (is_externally_visible): Check if the symbol is not forced
6192 local.
6193
6194 2011-07-15 Ian Lance Taylor <iant@google.com>
6195
6196 * options.h (class General_options): Add --print-output-format.
6197 Move -EL next to -EB, for better --help output.
6198 * target-select.cc: Include <cstdio>, "options.h", and
6199 "parameters.h".
6200 (Target_selector::do_target_bfd_name): New function.
6201 (print_output_format): New function.
6202 * target-select.h (class Target_selector): Update declarations.
6203 (Target_selector::target_bfd_name): New function.
6204 (print_output_format): Declare.
6205 * main.cc: Include "target-select.h".
6206 (main): Handle --print-output-format.
6207 * gold.cc: Include "target-select.h".
6208 (queue_initial_tasks): Handle --print-output-format when there are
6209 no input files.
6210 * parameters.cc (parameters_force_valid_target): Give a better
6211 error message if -EB/-EL does not match target.
6212 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6213 function.
6214
6215 2011-07-15 Ian Lance Taylor <iant@google.com>
6216
6217 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6218 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6219 (Output_data_plt_i386::do_write): Write address of .dynamic
6220 section to first entry in .got.plt section.
6221 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6222 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6223 Initialize layout_.
6224 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6225 section to first entry in .got.plt section.
6226 * layout.h (Layout::dynamic_section): New function.
6227
6228 2011-07-13 Sriraman Tallam <tmsriram@google.com>
6229
6230 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6231 to claim_file call.
6232 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6233 input_section_position_, and input_section_glob_.
6234 (read_layout_from_file): Call function section_ordering_specified.
6235 * layout.h (is_section_ordering_specified): New function.
6236 (section_ordering_specified): New function.
6237 (section_ordering_specified_): New boolean member.
6238 * main.cc(main): Call load_plugins after layout object is defined.
6239 * output.cc (Output_section::add_input_section): Use
6240 function section_ordering_specified to check if section ordering is
6241 needed.
6242 * output.cc (Output_section::add_relaxed_input_section): Use
6243 function section_ordering_specified to check if section ordering is
6244 needed.
6245 (Output_section::update_section_layout): New function.
6246 (Output_section::sort_attached_input_sections): Check if input section
6247 must be reordered.
6248 * output.h (Output_section::update_section_layout): New function.
6249 * plugin.cc (get_section_count): New function.
6250 (get_section_type): New function.
6251 (get_section_name): New function.
6252 (get_section_contents): New function.
6253 (update_section_order): New function.
6254 (allow_section_ordering): New function.
6255 (Plugin::load): Add the new interfaces to the transfer vector.
6256 (Plugin_manager::load_plugins): New parameter.
6257 (Plugin_manager::all_symbols_read): New parameter.
6258 (Plugin_manager::claim_file): New parameter. Save the elf object for
6259 unclaimed objects.
6260 (Plugin_manager::get_elf_object): New function.
6261 (Plugin_manager::get_view): Change to directly use the bool to check
6262 if get_view is called from claim_file_hook.
6263 * plugin.h (input_objects): New function
6264 (Plugin__manager::load_plugins): New parameter.
6265 (Plugin_manager::claim_file): New parameter.
6266 (Plugin_manager::get_elf_object): New function.
6267 (Plugin_manager::in_claim_file_handler): New function.
6268 (Plugin_manager::in_claim_file_handler_): New member.
6269 (layout): New function.
6270 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6271 handler with an extra parameter. Make the elf object before calling
6272 claim_file handler.
6273 * testsuite/plugin_test.c (get_section_count): New function pointer.
6274 (get_section_type): New function pointer.
6275 (get_section_name): New function pointer.
6276 (get_section_contents): New function pointer.
6277 (update_section_order): New function pointer.
6278 (allow_section_ordering): New function pointer.
6279 (onload): Check if the new interfaces exist.
6280
6281 2011-07-13 Ian Lance Taylor <iant@google.com>
6282
6283 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6284 relro section.
6285 * x86_64.cc (Target_x86_64::got_section): Likewise.
6286 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6287 (relro_now_test_SOURCES): New variable.
6288 (relro_now_test_DEPENDENCIES): New variable.
6289 (relro_now_test_LDFLAGS): New variable.
6290 (relro_now_test_LDADD): New variable.
6291 (relro_now_test.so): New target.
6292 * testsuite/Makefile.in: Rebuild.
6293
6294 2011-07-12 Ian Lance Taylor <iant@google.com>
6295
6296 PR gold/12980
6297 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6298 GLOB_DAT relocation rather than a RELATIVE relocation for a
6299 protected symbol when creating a shared library.
6300 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6301 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6302 * testsuite/protected_main_1.cc (main): Test that protected
6303 function has same address.
6304
6305 2011-07-11 Ian Lance Taylor <iant@google.com>
6306
6307 PR gold/12979
6308 * options.h (class General_options): Add -Bgroup.
6309 * options.cc (General_options::finalize): If -Bgroup is set,
6310 default to --unresolved-symbols=report-all.
6311 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6312 * target-reloc.h (issue_undefined_symbol_error): Handle
6313 --unresolved-symbols=report-all.
6314
6315 2011-07-08 Ian Lance Taylor <iant@google.com>
6316
6317 PR gold/11985
6318 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6319 if linker script discards key sections.
6320 (Layout::create_dynamic_symtab): Likewise.
6321 (Layout::assign_local_dynsym_offsets): Likewise.
6322 (Layout::sized_create_version_sections): Likewise.
6323 (Layout::create_interp): Likewise.
6324 (Layout::finish_dynamic_section): Likewise.
6325 (Layout::set_dynamic_symbol_size): Likewise.
6326
6327 2011-07-08 Ian Lance Taylor <iant@google.com>
6328
6329 PR gold/12386
6330 * options.h (class General_options): Add --unresolved-symbols.
6331 * target-reloc.h (issue_undefined_symbol_error): Check
6332 --unresolved-symbols. Add comments.
6333
6334 2011-07-08 Ian Lance Taylor <iant@google.com>
6335
6336 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6337 expression more complex.
6338
6339 2011-07-08 Ian Lance Taylor <iant@google.com>
6340
6341 PR gold/11317
6342 * target-reloc.h (issue_undefined_symbol_error): New inline
6343 function, broken out of relocate_section.
6344 (relocate_section): Call issue_undefined_symbol_error.
6345 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6346 there is no TLS segment if we are about to issue an undefined
6347 symbol error.
6348 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6349
6350 2011-07-08 Ian Lance Taylor <iant@google.com>
6351
6352 PR gold/12279
6353 * resolve.cc (Symbol_table::should_override): Add fromtype
6354 parameter. Change all callers. Give error when linking together
6355 TLS and non-TLS symbol.
6356 (Symbol_table::should_override_with_special): Add fromtype
6357 parameter. Change all callers.
6358 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6359 there is no TLS segment if we have reported some errors.
6360 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6361
6362 2011-07-08 Ian Lance Taylor <iant@google.com>
6363
6364 PR gold/12372
6365 * target.h (Target::plt_address_for_global): New function.
6366 (Target::plt_address_for_local): New function.
6367 (Target::plt_section_for_global): Remove.
6368 (Target::plt_section_for_local): Remove.
6369 (Target::do_plt_address_for_global): New virtual function.
6370 (Target::do_plt_address_for_local): New virtual function.
6371 (Target::do_plt_section_for_global): Remove.
6372 (Target::do_plt_section_for_local): Remove.
6373 (Target::register_global_plt_entry): Add Symbol_table and Layout
6374 parameters.
6375 * output.cc (Output_data_got::Got_entry::write): Use
6376 plt_address_for_global and plt_address_for_local.
6377 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6378 address of output section.
6379 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6380 got_irelative_, and irelative_count_ fields. Update
6381 declarations.
6382 (Output_data_plt_i386::has_irelative_section): New function.
6383 (Output_data_plt_i386::entry_count): Add irelative_count_.
6384 (Output_data_plt_i386::set_final_data_size): Likewise.
6385 (class Target_i386): Add got_irelative_ and rel_irelative_
6386 fields. Update declarations.
6387 (Target_i386::Target_i386): Initialize new fields.
6388 (Target_i386::do_plt_address_for_global): New function replacing
6389 do_plt_section_for_global.
6390 (Target_i386::do_plt_address_for_local): New function replacing
6391 do_plt_section_for_local.
6392 (Target_i386::got_section): Create got_irelative_.
6393 (Target_i386::rel_irelative_section): New function.
6394 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6395 fields. Don't define __rel_iplt_{start,end}.
6396 (Output_data_plt_i386::add_entry): Add symtab and layout
6397 parameters. Change all callers. Use different PLT and GOT for
6398 IFUNC symbols.
6399 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6400 layout parameters. Change all callers. Use different PLT and
6401 GOT.
6402 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6403 (Output_data_plt_i386::rel_irelative): New function.
6404 (Output_data_plt_i386::address_for_global): New function.
6405 (Output_data_plt_i386::address_for_local): New function.
6406 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6407 IRELATIVE GOT when changing IFUNC GOT entries.
6408 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6409 reloc.
6410 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6411 if we didn't create an IRELATIVE GOT.
6412 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6413 plt_address_for_local.
6414 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6415 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6416 got_irelative_, and irelative_count_ fields. Update
6417 declarations.
6418 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6419 Initialize new fields. Remove symtab parameter. Change all
6420 callers.
6421 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6422 irelative_count_.
6423 (Output_data_plt_x86_64::has_irelative_section): New function.
6424 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6425 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6426 fields. Update declarations.
6427 (Target_x86_64::Target_x86_64): Initialize new fields.
6428 (Target_x86_64::do_plt_address_for_global): New function replacing
6429 do_plt_section_for_global.
6430 (Target_x86_64::do_plt_address_for_local): New function replacing
6431 do_plt_section_for_local.
6432 (Target_x86_64::got_section): Create got_irelative_.
6433 (Target_x86_64::rela_irelative_section): New function.
6434 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6435 all callers. Don't create __rel_iplt_{start,end}.
6436 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6437 parameters. Change all callers. Use different PLT and GOT for
6438 IFUNC symbols.
6439 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6440 layout parameters. Change all callers. Use different PLT and
6441 GOT.
6442 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6443 parameters. Change all callers. Use different PLT and GOT for
6444 IFUNC symbols.
6445 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6446 (Output_data_plt_x86_64::rela_irelative): New function.
6447 (Output_data_plt_x86_64::address_for_global): New function.
6448 (Output_data_plt_x86_64::address_for_local): New function.
6449 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6450 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6451 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6452 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6453 parameters.
6454 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6455 reloc.
6456 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6457 symbols if we didn't create an IRELATIVE GOT.
6458 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6459 plt_address_for_local.
6460 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6461 * testsuite/ifuncvar1.c: New test file.
6462 * testsuite/ifuncvar2.c: New test file.
6463 * testsuite/ifuncvar3.c: New test file.
6464 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6465 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6466 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6467 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6468 * testsuite/Makefile.in: Rebuild.
6469
6470 2011-07-07 Cary Coutant <ccoutant@google.com>
6471
6472 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6473 (two_file_test_1_ndebug.o): Likewise.
6474 (two_file_test_1b_ndebug.o): Likewise.
6475 (two_file_test_2_ndebug.o): Likewise.
6476 (two_file_test_main_ndebug.o): Likewise.
6477 (incremental_test_2): Link with no-debug versions.
6478
6479 2011-07-06 Cary Coutant <ccoutant@google.com>
6480
6481 * gold/incremental.cc
6482 (Output_section_incremental_inputs::write_info_blocks): Check for
6483 hidden and internal symbols.
6484
6485 2011-07-06 Cary Coutant <ccoutant@google.com>
6486
6487 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6488 Check disposition for startup file.
6489 (Incremental_inputs::report_command_line): Ignore
6490 --incremental-startup-unchanged option.
6491 * options.cc (General_options::parse_incremental_startup_unchanged):
6492 New function.
6493 (General_options::General_options): Initialize new data member.
6494 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6495 (General_options): Add --incremental-startup-unchanged option.
6496 (General_options::incremental_startup_disposition): New function.
6497 (General_options::incremental_startup_disposition_): New data member.
6498
6499 2011-07-06 Cary Coutant <ccoutant@google.com>
6500
6501 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6502 input file index to Script_info ctor.
6503 (Sized_incremental_binary::do_file_has_changed): Find the
6504 command-line argument for files named in scripts.
6505 * incremental.h (Script_info::Script_info): New ctor
6506 with input file index.
6507 (Script_info::input_file_index): New function.
6508 (Script_info::input_file_index_): New data member.
6509 (Incremental_binary::get_library): Add const.
6510 (Incremental_binary::get_script_info): Add const.
6511 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6512 * testsuite/Makefile.am (incremental_test_5): New test case.
6513 (incremental_test_6): New test case.
6514 * testsuite/Makefile.in: Regenerate.
6515
6516 2011-07-06 Cary Coutant <ccoutant@google.com>
6517
6518 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6519 debug output when command lines differ.
6520
6521 2011-07-06 Cary Coutant <ccoutant@google.com>
6522
6523 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6524 --incremental-patch option.
6525 * layout.cc (Free_list::allocate): Extend allocation beyond original
6526 end if enabled.
6527 (Layout::make_output_section): Mark sections that should get
6528 patch space.
6529 * options.cc (parse_percent): New function.
6530 * options.h (parse_percent): New function.
6531 (DEFINE_percent): New macro.
6532 (General_options): Add --incremental-patch option.
6533 * output.cc (Output_section::Output_section): Initialize new data
6534 members.
6535 (Output_section::add_input_section): Print section name when out
6536 of patch space.
6537 (Output_section::add_output_section_data): Likewise.
6538 (Output_section::set_final_data_size): Add patch space when
6539 doing --incremental-full.
6540 (Output_section::do_reset_address_and_file_offset): Remove patch
6541 space.
6542 (Output_segment::set_section_list_addresses): Print debug output
6543 only if --incremental-update.
6544 * output.h (Output_section::set_is_patch_space_allowed): New function.
6545 (Output_section::is_patch_space_allowed_): New data member.
6546 (Output_section::patch_space_): New data member.
6547 * parameters.cc (Parameters::incremental_full): New function.
6548 * parameters.h (Parameters::incremental_full): New function
6549 * testsuite/Makefile.am (incremental_test_2): Add test for
6550 --incremental-patch option.
6551 * testsuite/Makefile.in: Regenerate.
6552 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6553 (t18): Remove function body.
6554
6555 2011-07-05 Doug Kwan <dougkwan@google.com>
6556
6557 PR gold/12771
6558 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6559 Arm_Address type for relocation result.
6560 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6561 overflow check.
6562 (Arm_relocate_functions::abs32): Use unaligned access.
6563 (Arm_relocate_functions::rel32): Ditto.
6564 (Arm_relocate_functions::prel31): Ditto.
6565 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6566 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6567 static data relocations.
6568 * testsuite/Makefile.in: Regnerate.
6569 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6570
6571 2011-07-05 Ian Lance Taylor <iant@google.com>
6572
6573 PR gold/12392
6574 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6575 symbols if necessary.
6576 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6577
6578 2011-07-05 Ian Lance Taylor <iant@google.com>
6579
6580 PR gold/12952
6581 * resolve.cc (Symbol::override_base_with_special): Simply override
6582 version with special symbol version, ignoring previous version.
6583
6584 2011-07-05 Ian Lance Taylor <iant@google.com>
6585
6586 * object.cc (Sized_relobj_file::include_section_group): Add
6587 information to comment about signature location.
6588
6589 2011-07-02 Ian Lance Taylor <iant@google.com>
6590
6591 PR gold/12957
6592 * options.h (class General_options): Add -f and -F.
6593 * options.cc (General_options::finalize): Fatal error if -f/-F
6594 are used without -shared.
6595 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6596
6597 2011-07-02 Ian Lance Taylor <iant@google.com>
6598
6599 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6600
6601 2011-07-01 Ian Lance Taylor <iant@google.com>
6602
6603 PR gold/12525
6604 PR gold/12952
6605 * resolve.cc (Symbol::override_base_with_special): Don't override
6606 the version if the overriding symbol has a different name.
6607 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6608 all callers. If we give an error about an undefined version,
6609 define the base version if necessary.
6610 * dynobj.h (class Versions): Update declaration.
6611 * testsuite/weak_alias_test_5.cc: New file.
6612 * testsuite/weak_alias_test.script: New file.
6613 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6614 and versioned_alias have the right value, and call t2.
6615 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6616 weak_alias_test_5.so.
6617 (weak_alias_test_LDADD): Likewise.
6618 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6619 * testsuite/Makefile.in: Rebuild.
6620
6621 2011-07-01 Ian Lance Taylor <iant@google.com>
6622
6623 PR gold/12525
6624 * options.h (class General_options): Support -z notext.
6625 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6626 -Wl,-z,notext.
6627 (two_file_shared_nonpic.so): Likewise.
6628 (two_file_shared_mixed.so): Likewise.
6629 (two_file_shared_mixed_1.so): Likewise.
6630 (weak_undef_lib_nonpic.so): Likewise.
6631 (alt/weak_undef_lib_nonpic.so): Likewise.
6632 (tls_test_shared_nonpic.so): Likewise.
6633 * testsuite/Makefile.in: Rebuild.
6634
6635 2011-07-01 Ian Lance Taylor <iant@google.com>
6636
6637 PR gold/12525
6638 * configure.ac: Test whether static linking works, setting
6639 the automake conditional HAVE_STATIC.
6640 * testsuite/Makefile.am: Disable tests using -static if
6641 HAVE_STATIC is not true.
6642 * configure, testsuite/Makefile.in: Rebuild.
6643
6644 2011-07-01 Ian Lance Taylor <iant@google.com>
6645
6646 PR gold/12525
6647 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6648 Assert if we see DW_EH_PE_indirect.
6649 * target.h (Target::ehframe_datarel_base): New function.
6650 (Target::do_ehframe_datarel_base): New target function.
6651 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6652 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6653 function.
6654
6655 2011-07-01 Ian Lance Taylor <iant@google.com>
6656
6657 PR gold/12571
6658 * options.h (class General_options): Add
6659 --ld-generated-unwind-info.
6660 * ehframe.cc (Fde::write): Add address parameter. Change all
6661 callers. If associated with PLT, fill in address and size.
6662 (Cie::set_output_offset): Only add merge mapping if there is an
6663 object.
6664 (Cie::write): Add address parameter. Change all callers.
6665 (Eh_frame::add_ehframe_for_plt): New function.
6666 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6667 input_offset_ fields into union u_, with new plt field.
6668 (Fde::Fde): Adjust for new union field.
6669 (Fde::Fde) [Output_data version]: New constructor.
6670 (Fde::add_mapping): Only add merge mapping if there is an object.
6671 (class Cie): Update declarations.
6672 (class Eh_frame): Declare add_ehframe_for_plt.
6673 * layout.cc (Layout::layout_eh_frame): Break out code into
6674 make_eh_frame_section, and call it.
6675 (Layout::make_eh_frame_section): New function.
6676 (Layout::add_eh_frame_for_plt): New function.
6677 * layout.h (class Layout): Update declarations.
6678 * merge.cc (Merge_map::add_mapping): Add assertion.
6679 * i386.cc: Include "dwarf.h".
6680 (class Output_data_plt_i386): Make first_plt_entry,
6681 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6682 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6683 and plt_eh_frame_fde.
6684 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6685 boundary. Call add_eh_frame_for_plt if appropriate.
6686 * x86_64.cc: Include "dwarf.h".
6687 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6688 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6689 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6690 and plt_eh_frame_fde.
6691 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6692 appropriate.
6693
6694 2011-06-29 Ian Lance Taylor <iant@google.com>
6695
6696 PR gold/12629
6697 * object.cc (Sized_relobj_file::layout_section): Change shdr
6698 parameter to be const.
6699 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6700 out of do_layout.
6701 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6702 appropriate. Call layout_eh_frame_section.
6703 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6704 sections.
6705 * object.h (class Sized_relobj_file): Update declarations.
6706
6707 2011-06-29 Ian Lance Taylor <iant@google.com>
6708
6709 PR gold/12652
6710 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6711 modifier.
6712 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6713
6714 2011-06-29 Ian Lance Taylor <iant@google.com>
6715
6716 PR gold/12675
6717 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6718 SHT_X86_64_UNWIND.
6719 * layout.cc (Layout::layout_eh_frame): Likewise.
6720
6721 2011-06-29 Ian Lance Taylor <iant@google.com>
6722
6723 PR gold/12695
6724 * layout.cc (Layout::symtab_section_shndx): New function.
6725 * layout.h (class Layout): Declare symtab_section_shndx.
6726 * output.cc (Output_section::write_header): Call it.
6727
6728 2011-06-29 Ian Lance Taylor <iant@google.com>
6729
6730 PR gold/12818
6731 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6732 symbols which are not used in a relocation.
6733
6734 2011-06-28 Ian Lance Taylor <iant@google.com>
6735
6736 PR gold/12898
6737 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6738 script create indistinguishable segments.
6739 (Layout::set_segment_offsets): Use stable_sort when sorting
6740 segments. Pass this to Compare_segments constructor.
6741 * layout.h (class Layout): Make segment_precedes non-static.
6742 (class Compare_segments): Change from struct to class. Add
6743 layout_ field. Add constructor.
6744 * script-sections.cc
6745 (Script_sections::attach_sections_using_phdrs_clause): Rename
6746 local orphan to is_orphan. Don't report failure to put empty
6747 section in segment. On attachment failure, report name of
6748 section, and attach to first PT_LOAD segment.
6749
6750 2011-06-28 Ian Lance Taylor <iant@google.com>
6751
6752 PR gold/12934
6753 * target-select.cc (Target_selector::Target_selector): Add
6754 emulation parameter. Change all callers.
6755 (select_target_by_bfd_name): Rename from select_target_by_name.
6756 Change all callers.
6757 (select_target_by_emulation): New function.
6758 (supported_emulation_names): New function.
6759 * target-select.h (class Target_selector): Add emulation_ field.
6760 Update declarations.
6761 (Target_selector::recognize_by_bfd_name): Rename from
6762 recognize_by_name. Change all callers.
6763 (Target_selector::supported_bfd_names): Rename from
6764 supported_names. Change all callers.
6765 (Target_selector::recognize_by_emulation): New function.
6766 (Target_selector::supported_emulations): New function.
6767 (Target_selector::emulation): New function.
6768 (Target_selector::do_recognize_by_bfd_name): Rename from
6769 do_recognize_by_name. Change all callers.
6770 (Target_selector::do_supported_bfd_names): Rename from
6771 do_supported_names. Change all callers.
6772 (Target_selector::do_recognize_by_emulation): New function.
6773 (Target_selector::do_supported_emulations): New function.
6774 (select_target_by_bfd_name): Change name in declaration.
6775 (select_target_by_emulation): Declare.
6776 (supported_emulation_names): Declare.
6777 * parameters.cc (parameters_force_valid_target): Try to find
6778 target based on emulation from -m option.
6779 * options.h (class General_options): Change doc string for -m.
6780 * options.cc (help): Print emulations.
6781 (General_options::parse_V): Likewise.
6782 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6783 Add emulation parameter. Change all callers.
6784
6785 2011-06-28 Ian Lance Taylor <iant@google.com>
6786
6787 * target.h (class Target): Add osabi_ field.
6788 (Target::osabi): New function.
6789 (Target::set_osabi): New function.
6790 (Target::Target): Initialize osabi_.
6791 (Target::do_adjust_elf_header): Make pure virtual.
6792 (Sized_target::do_adjust_elf_header): Declare.
6793 * target.cc (Sized_target::do_adjust_elf_header): New function.
6794 (class Sized_target): Instantiate all versions.
6795 * freebsd.h (class Target_freebsd): Remove.
6796 (Target_selector_freebsd::do_recognize): Call set_osabi on
6797 Target.
6798 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6799 (Target_selector_freebsd::set_osabi): Remove.
6800 * i386.cc (class Target_i386): Inherit from Sized_target rather
6801 than Target_freebsd.
6802 * x86_64.cc (class Target_x86_64): Likewise.
6803
6804 2011-06-28 Ian Lance Taylor <iant@google.com>
6805
6806 * target.h (Target::can_check_for_function_pointers): Rewrite.
6807 Make non-virtual.
6808 (Target::can_icf_inline_merge_sections): Likewise.
6809 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6810 (Target::Target_info): Add can_icf_inline_merge_sections field.
6811 (Target::do_can_check_for_function_pointers): New virtual
6812 function.
6813 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6814 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6815 from can_check_for_function_pointers, move in file.
6816 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6817 section_may_have_icf_unsafe_poineters, move in file.
6818 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6819 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6820 Rename from can_check_for_function_pointers, move in file.
6821 (Target_i386::can_icf_inline_merge_sections): Remove.
6822 (Target_i386::i386_info): Initialize
6823 can_icf_inline_merge_sections.
6824 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6825 Initialize can_icf_inline_merge_sections.
6826 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6827 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6828 Rename from can_check_for_function_pointers, move in file.
6829 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6830 (Target_x86_64::x86_64_info): Initialize
6831 can_icf_inline_merge_sections.
6832 * testsuite/testfile.cc (Target_test::test_target_info):
6833 Likewise.
6834 * icf.cc (get_section_contents): Correct formatting.
6835
6836 2011-06-27 Ian Lance Taylor <iant@google.com>
6837
6838 * symtab.cc (Symbol::versioned_name): New function.
6839 (Symbol_table::add_to_final_symtab): Use versioned_name when
6840 appropriate.
6841 (Symbol_table::sized_write_symbol): Likewise.
6842 * symtab.h (class Symbol): Declare versioned_name.
6843 * stringpool.h (class Stringpool_template): Add variant of add
6844 which takes a std::basic_string.
6845 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6846 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6847 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6848 (ver_test_12.o): New target.
6849 * testsuite/Makefile.in: Rebuild.
6850
6851 2011-06-27 Doug Kwan <dougkwan@google.com>
6852
6853 * arm.cc (Arm_relocate_functions::thm_jump8,
6854 Arm_relocate_functions::thm_jump11): Use a wider signed
6855 type to compute offset.
6856 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6857 arm_thm_jump8.
6858 * testsuite/Makefile.in: Regenerate.
6859 * testsuite/arm_branch_in_range.sh: Check test results of
6860 arm_thm_jump11 and arm_thm_jump8.
6861 * testsuite/arm_thm_jump11.s: New test source file.
6862 * testsuite/arm_thm_jump11.t: New linker script.
6863 * testsuite/arm_thm_jump8.s: New test source file.
6864 * testsuite/arm_thm_jump8.t: New linker script.
6865
6866 2011-06-24 Ian Lance Taylor <iant@google.com>
6867
6868 * layout.cc: Include "object.h".
6869 (ctors_sections_in_init_array): New static variable.
6870 (Layout::is_ctors_in_init_array): New function.
6871 (Layout::layout): Add entry to ctors_sections_in_init_array if
6872 appropriate.
6873 * layout.h (class Layout): Declare is_ctors_in_init_array.
6874 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6875 is_ctors_reverse_view is set.
6876 (Sized_relobj_file::write_sections): Add layout parameter. Change
6877 all callers. Set is_ctors_reverse_view field of View_size.
6878 (Sized_relobj_file::reverse_words): New function.
6879 * object.h (Sized_relobj_file::View_size): Add
6880 is_ctors_reverse_view field.
6881 (class Sized_relobj_file): Update declarations.
6882 * testsuite/initpri3.c: New test.
6883 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6884 initpri3b.
6885 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6886 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6887 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6888 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6889 * testsuite/Makefile.in: Rebuild.
6890
6891 2011-06-24 Cary Coutant <ccoutant@google.com>
6892
6893 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6894 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6895 (debug_msg_cdebug.err): New targets.
6896 * testsuite/Makefile.in: Regenerate.
6897 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6898 Fix checks for link with shared library.
6899
6900 2011-06-24 Doug Kwan <dougkwan@google.com>
6901
6902 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6903 skip empty text sections.
6904 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6905
6906 2011-06-22 Ian Lance Taylor <iant@google.com>
6907
6908 PR gold/12910
6909 * options.h (class General_options): Add --ctors-in-init-array.
6910 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6911 friends as SHT_PROGBITS for merging sections.
6912 (Layout::layout): Remove special handling of .init_array and
6913 friends. Don't sort if doing relocatable link. Sort for .ctors
6914 and .dtors if ctors_in_init_array.
6915 (Layout::make_output_section): Force correct section types for
6916 .init_array and friends. Don't sort if doing relocatable link,
6917 Don't sort .ctors and .dtors if ctors_in_init_array.
6918 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6919 (Layout::output_section_name): Add relobj parameter. Change all
6920 callers. Handle .ctors. and .dtors. in code rather than table.
6921 Handle .ctors and .dtors if ctors_in_init_array.
6922 (Layout::match_file_name): New function, moved from output.cc.
6923 * layout.h (class Layout): Update declarations.
6924 * output.cc: Include "layout.h".
6925 (Input_section_sort_entry::get_priority): New function.
6926 (Input_section_sort_entry::match_file_name): Just call
6927 Layout::match_file_name.
6928 (Output_section::Input_section_sort_init_fini_compare::operator()):
6929 Handle .ctors and .dtors. Sort by explicit priority rather than
6930 by name.
6931 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6932 * testsuite/initpri2.c: New test.
6933 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6934 (check_PROGRAMS): Add initpri2.
6935 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6936 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6937 * configure, testsuite/Makefile.in: Rebuild.
6938
6939 2011-06-19 Ian Lance Taylor <iant@google.com>
6940
6941 PR gold/12880
6942 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6943 .interp section to a PT_INTERP segment even if we have seen a
6944 --dynamic-linker option. Don't do it if we have seen a PHDRS
6945 clause in a linker script.
6946 (Layout::finalize): Don't create a .interp section if we've
6947 already create a PT_INTERP segment.
6948 (Layout::create_interp): Always call choose_output_section (revert
6949 patch of 2011-06-17). Don't create PT_INTERP segment.
6950 * script-sections.cc
6951 (Script_sections::create_note_and_tls_segments): Add a .interp
6952 section to a PT_INTERP segment even if we have seen a
6953 --dynamic-linker option.
6954
6955 2011-06-18 Ian Lance Taylor <iant@google.com>
6956
6957 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6958 merely because a non-PT_LOAD segment has a dynamic reloc.
6959
6960 2011-06-18 Ian Lance Taylor <iant@google.com>
6961
6962 * layout.cc (Layout::finish_dynamic_section): Don't create
6963 DT_FLAGS entry if not needed.
6964
6965 2011-06-18 Ian Lance Taylor <iant@google.com>
6966
6967 PR gold/12745
6968 * layout.cc (Layout::layout_eh_frame): Correct handling of
6969 writable .eh_frame section.
6970
6971 2011-06-17 Ian Lance Taylor <iant@google.com>
6972
6973 PR gold/12893
6974 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6975 symbol is redefined with the exact same object and value.
6976
6977 2011-06-17 Ian Lance Taylor <iant@google.com>
6978
6979 PR gold/12880
6980 * layout.h (class Layout): Add interp_segment_ field.
6981 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6982 (Layout::attach_allocated_section_to_segment): If making shared
6983 library, put .interp section in PT_INTERP segment.
6984 (Layout::finalize): Also call create_interp if -dynamic-linker
6985 option was used.
6986 (Layout::create_interp): Assert that there is no PT_INTERP
6987 segment. If not using a SECTIONS clause, use make_output_section.
6988 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6989 * script-sections.cc
6990 (Script_sections::create_note_and_tls_segments): If making shared
6991 library, put .interp section in PT_INTERP segment.
6992
6993 2011-06-17 Ian Lance Taylor <iant@google.com>
6994
6995 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6996 when making a shared library.
6997
6998 2011-06-17 Ian Lance Taylor <iant@google.com>
6999
7000 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
7001 parameter. Change all callers. Don't issue warning about PC32
7002 against locally defined symbol.
7003
7004 2011-06-16 Ian Lance Taylor <iant@google.com>
7005
7006 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
7007 occurs in same object.
7008
7009 2011-06-14 Alan Modra <amodra@gmail.com>
7010
7011 * po/POTFILES.in: Regenerate.
7012
7013 2011-06-09 Ian Lance Taylor <iant@google.com>
7014
7015 * script-sections.cc
7016 (Orphan_output_section::set_section_addresses): For a relocatable
7017 link set address to 0.
7018
7019 2011-06-09 Cary Coutant <ccoutant@google.com>
7020
7021 PR gold/12804
7022 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
7023 used with --compress-debug-sections.
7024 * gold/object.cc (Sized_relobj_file::do_layout): Report
7025 uncompressed size of compressed input sections.
7026
7027 2011-06-08 Cary Coutant <ccoutant@google.com>
7028
7029 PR gold/12804
7030 * testsuite/two_file_test_2_v1.cc: Change initialization of
7031 v2 to keep it in .data.
7032
7033 2011-06-07 Cary Coutant <ccoutant@google.com>
7034
7035 * common.cc (Symbol_table::do_allocate_commons_list): Call
7036 gold_fallback.
7037 * errors.cc (Errors::fatal): Adjust call to gold_exit.
7038 (Errors::fallback): New function.
7039 (gold_fallback): New function.
7040 * errors.h (Errors::fallback): New function.
7041 * gold.cc (gold_exit): Change status parameter to enum; adjust
7042 all callers.
7043 (queue_initial_tasks): Call gold_fallback.
7044 * gold.h: Include cstdlib.
7045 (Exit_status): New enum type.
7046 (gold_exit): Change status parameter to enum.
7047 (gold_fallback): New function.
7048 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
7049 (Layout::create_symtab_sections): Likewise.
7050 (Layout::create_shdrs): Likewise.
7051 * main.cc (main): Adjust call to gold_exit.
7052 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
7053 (Output_data_got::add_got_entry_pair): Likewise.
7054 (Output_section::add_input_section): Likewise.
7055 (Output_section::add_output_section_data): Likewise.
7056 (Output_segment::set_section_list_addresses): Likewise.
7057 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
7058
7059 2011-06-07 Cary Coutant <ccoutant@google.com>
7060
7061 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7062 for incremental links.
7063 * output.cc (Output_segment::set_section_list_addresses): Remove
7064 FIXME and test for TLS or BSS.
7065
7066 2011-06-07 Cary Coutant <ccoutant@google.com>
7067
7068 * testsuite/Makefile.am: Add incremental_copy_test,
7069 incremental_common_test_1.
7070 * testsuite/Makefile.in: Regenerate.
7071 * testsuite/common_test_1_v1.c: New source file.
7072 * testsuite/common_test_1_v2.c: New source file.
7073 * testsuite/copy_test_v1.cc: New source file.
7074
7075 2011-06-07 Cary Coutant <ccoutant@google.com>
7076
7077 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7078 update, allocate common from bss section's free list.
7079 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7080 linker-defined symbols.
7081 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7082 Skip GOT and PLT entries that are no longer referenced.
7083 (Output_section_incremental_inputs::write_info_blocks): Mark
7084 linker-defined symbols.
7085 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7086 * output.cc (Output_section::allocate): New function.
7087 * output.h (Output_section::allocate): New function.
7088 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7089 linker-defined symbols.
7090 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7091 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7092 (Symbol::init_base_output_data): Likewise.
7093 (Symbol::init_base_output_segment): Likewise.
7094 (Symbol::init_base_constant): Likewise.
7095 (Sized_symbol::init_output_data): Likewise.
7096 (Sized_symbol::init_output_segment): Likewise.
7097 (Sized_symbol::init_constant): Likewise.
7098 (Symbol_table::do_define_in_output_data): Likewise.
7099 (Symbol_table::do_define_in_output_segment): Likewise.
7100 (Symbol_table::do_define_as_constant): Likewise.
7101 * symtab.h (Symbol::is_predefined): New function.
7102 (Symbol::init_base_output_data): Add is_predefined parameter.
7103 (Symbol::init_base_output_segment): Likewise.
7104 (Symbol::init_base_constant): Likewise.
7105 (Symbol::is_predefined_): New data member.
7106 (Sized_symbol::init_output_data): Add is_predefined parameter.
7107 (Sized_symbol::init_output_segment): Likewise.
7108 (Sized_symbol::init_constant): Likewise.
7109 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7110
7111 2011-06-07 Cary Coutant <ccoutant@google.com>
7112
7113 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7114 instead of emit_copy_reloc.
7115 (Copy_relocs::emit_copy_reloc): Refactor.
7116 (Copy_relocs::make_copy_reloc): New function.
7117 (Copy_relocs::add_copy_reloc): Remove.
7118 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7119 section.
7120 (Copy_relocs::make_copy_reloc): New function.
7121 (Copy_relocs::add_copy_reloc): Remove.
7122 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7123 unchanged input files.
7124 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7125 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7126 Reserve BSS space for COPY relocations.
7127 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7128 (Output_section_incremental_inputs::write_info_blocks): Record
7129 whether a symbol is copied from a shared object.
7130 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7131 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7132 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7133 (Incremental_input_entry_reader::get_output_symbol_index): Add
7134 is_copy parameter.
7135 (Incremental_binary::emit_copy_relocs): New function.
7136 (Incremental_binary::do_emit_copy_relocs): New function.
7137 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7138 new data member.
7139 (Sized_incremental_binary::add_copy_reloc): New function.
7140 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7141 (Sized_incremental_binary::Copy_reloc): New struct.
7142 (Sized_incremental_binary::Copy_relocs): New typedef.
7143 (Sized_incremental_binary::copy_relocs_): New data member.
7144 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7145 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7146 * target.h (Sized_target::emit_copy_reloc): New function.
7147 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7148
7149 2011-06-02 Cary Coutant <ccoutant@google.com>
7150
7151 PR gold/12163
7152 * gold/archive.cc (Archive::Archive): Initialize new data member.
7153 (Archive::include_all_members): Return if archive has already been
7154 included.
7155 * gold/archive.h (Archive::include_all_members_): New data member.
7156
7157 2011-06-02 Nick Clifton <nickc@redhat.com>
7158
7159 * dynobj.h: Fix spelling mistake in comment.
7160 * output.cc: Likewise.
7161
7162 2011-05-31 Doug Kwan <dougkwan@google.com>
7163 Asier Llano
7164
7165 PR gold/12826
7166 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
7167 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7168 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7169 redundant arm_exidx_test.so.
7170 * testsuite/Makefile.in: Regenerate.
7171 (check_SCRIPTS): Add pr12826.sh
7172 (check_DATA): Add pr12826.stdout
7173 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7174 * testsuite/pr12826.sh: New file.
7175 * testsuite/pr12826_1.s: Ditto.
7176 * testsuite/pr12826_1.s: Ditto.
7177
7178 2011-05-30 Ian Lance Taylor <iant@google.com>
7179
7180 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7181 sections.
7182
7183 2011-05-29 Ian Lance Taylor <iant@google.com>
7184
7185 PR gold/12804
7186 * testsuite/Makefile.am: Use different file name for two_file_test
7187 temporary file for each incremental test.
7188 * testsuite/Makefile.in: Rebuild.
7189
7190 2011-05-29 Ian Lance Taylor <iant@google.com>
7191
7192 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7193 binary input file is empty.
7194
7195 2011-05-27 Ian Lance Taylor <iant@google.com>
7196
7197 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7198 (ver_test_9.so): Likewise.
7199 * testsuite/Makefile.in: Rebuild.
7200
7201 2011-05-26 Cary Coutant <ccoutant@google.com>
7202
7203 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7204 * incremental.cc (Incremental_inputs::report_input_section): Fix
7205 comment, indentation.
7206 (Incremental_inputs::report_comdat_group): New function.
7207 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7208 of data for incremental input file entry.
7209 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7210 group count, COMDAT group signatures.
7211 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7212 an unchanged input file.
7213 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7214 Initialize new data member.
7215 (Incremental_object_entry::add_comdat_group): New function.
7216 (Incremental_object_entry::get_comdat_group_count): New function.
7217 (Incremental_object_entry::get_comdat_signature_key): New function.
7218 (Incremental_object_entry::groups_): New data member.
7219 (Incremental_inputs::report_comdat_group): New function.
7220 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7221 data for incremental input file entry.
7222 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7223 (Incremental_input_entry_reader::get_input_section): Adjust size of
7224 data for incremental input file entry.
7225 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7226 (Incremental_input_entry_reader::get_comdat_group_signature): New
7227 function.
7228 * object.cc (Sized_relobj::include_section_group): Report kept
7229 COMDAT groups for incremental links.
7230
7231 2011-05-24 David Meyer <pdox@google.com>
7232
7233 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7234 with name parameter. Add found_name parameter.
7235 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7236 * dirsearch.h (class Dirsearch): Update declaration.
7237
7238 2011-05-24 Ian Lance Taylor <iant@google.com>
7239
7240 * archive.cc (Library_base::should_include_member): Pull in object
7241 from archive if it defines the entry symbol.
7242 * parameters.cc (Parameters::entry): New function.
7243 * parameters.h (class Parameters): Declare entry.
7244 * output.h (class Output_file_header): Remove entry_ field.
7245 * output.cc (Output_file_header::Output_file_header): Remove entry
7246 parameter. Change all callers.
7247 (Output_file_header::entry): Use parameters->entry.
7248 * gold.cc (queue_middle_tasks): Likewise.
7249 * plugin.cc (Plugin_hook::run): Likewise.
7250
7251 2011-05-24 Cary Coutant <ccoutant@google.com>
7252
7253 * gold.cc (queue_initial_tasks): Pass incremental base filename
7254 to Output_file::open_base_file; don't print error message.
7255 * incremental-dump.cc (main): Adjust call to
7256 Output_file::open_for_modification.
7257 * incremental-dump.cc (main): Likewise.
7258 * incremental.cc (Incremental_inputs::report_command_line):
7259 Ignore --incremental-base option when comparing command lines.
7260 Ignore parameter when given as separate argument.
7261 * options.h (class General_options): Add --incremental-base.
7262 * output.cc (Output_file::Output_file):
7263 (Output_file::open_base_file): Add base_name and writable parameters;
7264 read base file into new file; print error message here.
7265 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7266 callers.
7267 * output.h (Output_file::open_for_modification): Rename to...
7268 (Output_file::open_base_file): ...this; add base_name and
7269 writable parameters; adjust all callers.
7270 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7271 callers.
7272 * testsuite/Makefile.am (incremental_test_4): Test
7273 --incremental-base.
7274 * testsuite/Makefile.in: Regenerate.
7275
7276 2011-05-24 Cary Coutant <ccoutant@google.com>
7277
7278 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7279 incremental_test_4.
7280 * testsuite/Makefile.in: Regenerate.
7281 * testsuite/two_file_test_1_v1.cc: New test source file.
7282 * testsuite/two_file_test_1b_v1.cc: New test source file.
7283 * testsuite/two_file_test_2_v1.cc: New test source file.
7284
7285 2011-05-24 Cary Coutant <ccoutant@google.com>
7286
7287 * dynobj.h (Dynobj::do_dynobj): New function.
7288 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7289 flag and soname for shared objects.
7290 * incremental.cc (Incremental_inputs::report_object): Make
7291 either Incremental_object_entry or Incremental_dynobj_entry; add
7292 soname to string table.
7293 (Incremental_inputs::report_input_section): Add assertion.
7294 (Output_section_incremental_inputs::set_final_data_size): Adjust
7295 type of input file entry for shared libraries; adjust size of
7296 shared library info entry.
7297 (Output_section_incremental_inputs::write_input_files): Write
7298 as_needed flag for shared libraries.
7299 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7300 of input file entry for shared libraries; write soname.
7301 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7302 soname from incremental info.
7303 * incremental.h (enum Incremental_input_flags): Add
7304 INCREMENTAL_INPUT_AS_NEEDED.
7305 (Incremental_input_entry::Incremental_input_entry): Initialize new
7306 data member.
7307 (Incremental_input_entry::set_as_needed): New function.
7308 (Incremental_input_entry::as_needed): New function.
7309 (Incremental_input_entry::do_dynobj_entry): New function.
7310 (Incremental_input_entry::as_needed_): New data member.
7311 (Incremental_object_entry::Incremental_object_entry): Don't check
7312 for shared library.
7313 (Incremental_object_entry::do_type): Likewise.
7314 (class Incremental_dynobj_entry): New class.
7315 (Incremental_input_entry_reader::as_needed): New function.
7316 (Incremental_input_entry_reader::get_soname): New function.
7317 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7318 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7319 size of shared library info entry.
7320 * layout.cc (Layout::finish_dynamic_section): Don't test for
7321 incremental link when adding DT_NEEDED entries.
7322 * object.h (Object::Object): Initialize new data member.
7323 (Object::dynobj): New function.
7324 (Object::set_as_needed): New function.
7325 (Object::as_needed): New function.
7326 (Object::do_dynobj): New function.
7327 (Object::as_needed_): New data member.
7328
7329 2011-05-24 Cary Coutant <ccoutant@google.com>
7330
7331 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7332 info; adjust display of GOT entries.
7333 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7334 vector of input objects; remove file_status_.
7335 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7336 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7337 got_plt reader; call target hooks to reserve GOT entries.
7338 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7339 of input file info header and GOT info entry.
7340 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7341 relocation info.
7342 (Got_plt_view_info::got_descriptor): Remove.
7343 (Got_plt_view_info::sym_index): New data member.
7344 (Got_plt_view_info::input_index): New data member.
7345 (Local_got_offset_visitor::visit): Write input file index.
7346 (Global_got_offset_visitor::visit): Write 0 for input file index.
7347 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7348 with sym_index and input_index.
7349 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7350 incremental info GOT entry; replace got_descriptor with input_index.
7351 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7352 map from input file index to object.
7353 (Sized_relobj_incr::do_layout): Replace direct data member reference
7354 with accessor function.
7355 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7356 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7357 Adjust size of input file info header.
7358 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7359 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7360 (Incremental_input_entry_reader::get_input_section): Adjust size of
7361 input file info header.
7362 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7363 of incremental info GOT entry.
7364 (Incremental_got_plt_reader::get_got_desc): Remove.
7365 (Incremental_got_plt_reader::get_got_symndx): New function.
7366 (Incremental_got_plt_reader::get_got_input_index): New function.
7367 (Sized_incremental_binary::Sized_incremental_binary): Remove
7368 file_status_; add input_objects_.
7369 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7370 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7371 (Sized_incremental_binary::file_is_unchanged): Remove.
7372 (Sized_incremental_binary::set_input_object): New function.
7373 (Sized_incremental_binary::input_object): New function.
7374 (Sized_incremental_binary::file_status_): Remove.
7375 (Sized_incremental_binary::input_objects_): New data member.
7376 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7377 references.
7378 (Sized_relobj_incr::invalid_address): Move to base class.
7379 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7380 class.
7381 (Sized_relobj_incr::do_output_section_offset): Likewise.
7382 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7383 (Sized_relobj_incr::section_offsets_): Likewise.
7384 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7385 function.
7386 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7387 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7388 with accessor function.
7389 (Sized_relobj_file::do_layout): Likewise.
7390 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7391 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7392 (Sized_relobj_file::compute_final_local_value): Replace refs to
7393 section_offsets_ with accessor function.
7394 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7395 * object.h (Relobj::Relobj): Initialize new data members.
7396 (Relobj::add_dyn_reloc): New function.
7397 (Relobj::first_dyn_reloc): New function.
7398 (Relobj::dyn_reloc_count): New function.
7399 (Relobj::first_dyn_reloc_): New data member.
7400 (Relobj::dyn_reloc_count_): New data member.
7401 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7402 references.
7403 (Sized_relobj::Address): New typedef.
7404 (Sized_relobj::invalid_address): Move here from child class.
7405 (Sized_relobj::Sized_relobj): Initialize new data members.
7406 (Sized_relobj::sized_relobj): New function.
7407 (Sized_relobj::is_output_section_offset_invalid): Move here from
7408 child class.
7409 (Sized_relobj::get_output_section_offset): Likewise.
7410 (Sized_relobj::local_has_got_offset): Likewise.
7411 (Sized_relobj::local_got_offset): Likewise.
7412 (Sized_relobj::set_local_got_offset): Likewise.
7413 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7414 (Sized_relobj::clear_got_offsets): New function.
7415 (Sized_relobj::section_offsets): Move here from child class.
7416 (Sized_relobj::do_output_section_offset): Likewise.
7417 (Sized_relobj::do_set_section_offset): Likewise.
7418 (Sized_relobj::Local_got_offsets): Likewise.
7419 (Sized_relobj::local_got_offsets_): Likewise.
7420 (Sized_relobj::section_offsets_): Likewise.
7421 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7422 references.
7423 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7424 class.
7425 (Sized_relobj_file::sized_relobj): New function
7426 (Sized_relobj_file::local_has_got_offset): Move to base class.
7427 (Sized_relobj_file::local_got_offset): Likewise.
7428 (Sized_relobj_file::set_local_got_offset): Likewise.
7429 (Sized_relobj_file::get_output_section_offset): Likewise.
7430 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7431 (Sized_relobj_file::do_output_section_offset): Likewise.
7432 (Sized_relobj_file::do_set_section_offset): Likewise.
7433 (Sized_relobj_file::Local_got_offsets): Likewise.
7434 (Sized_relobj_file::local_got_offsets_): Likewise.
7435 (Sized_relobj_file::section_offsets_): Likewise.
7436 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7437 (all constructors).
7438 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7439 (Output_reloc::get_symbol_index): Likewise.
7440 (Output_reloc::local_section_offset): Likewise.
7441 (Output_reloc::get_address): Likewise.
7442 (Output_reloc::symbol_value): Likewise.
7443 (Output_data_got::reserve_slot): Move to class definition.
7444 (Output_data_got::reserve_local): New function.
7445 (Output_data_got::reserve_slot_for_global): Remove.
7446 (Output_data_got::reserve_global): New function.
7447 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7448 (all constructors, two instantiations).
7449 (Output_reloc::get_relobj): New function (two instantiations).
7450 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7451 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7452 (Output_data_reloc::add_global): Adjust type of relobj.
7453 (Output_data_reloc::add_global_relative): Likewise.
7454 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7455 (Output_data_reloc::add_local): Likewise.
7456 (Output_data_reloc::add_local_relative): Likewise.
7457 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7458 (Output_data_reloc::add_local_section): Likewise.
7459 (Output_data_reloc::add_output_section): Likewise.
7460 (Output_data_reloc::add_absolute): Likewise.
7461 (Output_data_reloc::add_target_specific): Likewise.
7462 (Output_data_got::reserve_slot): Move definition here.
7463 (Output_data_got::reserve_local): New function.
7464 (Output_data_got::reserve_global): New function.
7465 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7466 section_offsets_ with accessor function.
7467 (Sized_relobj_file::write_sections): Likewise.
7468 (Sized_relobj_file::do_relocate_sections): Likewise.
7469 * target.h (Sized_target::reserve_local_got_entry): New function.
7470 (Sized_target::reserve_global_got_entry): New function.
7471 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7472 (Target_x86_64::reserve_global_got_entry): New function.
7473 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7474
7475 2011-05-23 Cary Coutant <ccoutant@google.com>
7476
7477 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7478 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7479 bit when checking got_type.
7480 * incremental.cc (Sized_incremental_binary::setup_readers):
7481 Store symbol table and string table locations; initialize bit vector
7482 of file status flags.
7483 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7484 unchanged files.
7485 (Sized_incremental_binary::do_process_got_plt): New function.
7486 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7487 (Output_section_incremental_inputs::set_final_data_size): Record
7488 file index for each input file.
7489 (Output_section_incremental_inputs::write_got_plt): Store file index
7490 instead of input entry offset for each GOT entry.
7491 * incremental.h
7492 (Incremental_input_entry::Incremental_input_entry): Initialize new
7493 data member.
7494 (Incremental_input_entry::set_offset): Store file index.
7495 (Incremental_input_entry::get_file_index): New function.
7496 (Incremental_input_entry::file_index_): New data member.
7497 (Incremental_binary::process_got_plt): New function.
7498 (Incremental_binary::do_process_got_plt): New function.
7499 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7500 data members.
7501 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7502 (Sized_incremental_binary::set_file_is_unchanged): New function.
7503 (Sized_incremental_binary::file_is_unchanged): New function.
7504 (Sized_incremental_binary::do_process_got_plt): New function.
7505 (Sized_incremental_binary::file_status_): New data member.
7506 (Sized_incremental_binary::main_symtab_loc_): New data member.
7507 (Sized_incremental_binary::main_strtab_loc_): New data member.
7508 * output.cc (Output_data_got::Got_entry::write): Add case
7509 RESERVED_CODE.
7510 (Output_data_got::add_global): Call add_got_entry.
7511 (Output_data_got::add_global_plt): Likewise.
7512 (Output_data_got::add_global_with_rel): Likewise.
7513 (Output_data_got::add_global_with_rela): Likewise.
7514 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7515 (Output_data_got::add_global_pair_with_rela): Likewise.
7516 (Output_data_got::add_local): Call add_got_entry.
7517 (Output_data_got::add_local_plt): Likewise.
7518 (Output_data_got::add_local_with_rel): Likewise.
7519 (Output_data_got::add_local_with_rela): Likewise.
7520 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7521 (Output_data_got::add_local_pair_with_rela): Likewise.
7522 (Output_data_got::reserve_slot): New function.
7523 (Output_data_got::reserve_slot_for_global): New function.
7524 (Output_data_got::add_got_entry): New function.
7525 (Output_data_got::add_got_entry_pair): New function.
7526 (Output_section::add_output_section_data): Edit FIXME.
7527 * output.h
7528 (Output_section_data_build::Output_section_data_build): New
7529 constructor with size parameter.
7530 (Output_data_space::Output_data_space): Likewise.
7531 (Output_data_got::Output_data_got): Initialize new data member; new
7532 constructor with size parameter.
7533 (Output_data_got::add_constant): Call add_got_entry.
7534 (Output_data_got::reserve_slot): New function.
7535 (Output_data_got::reserve_slot_for_global): New function.
7536 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7537 (Output_data_got::add_got_entry): New function.
7538 (Output_data_got::add_got_entry_pair): New function.
7539 (Output_data_got::free_list_): New data member.
7540 * target.h (Sized_target::init_got_plt_for_update): New function.
7541 (Sized_target::register_global_plt_entry): New function.
7542 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7543 Initialize new data member; call init; add constructor with PLT count.
7544 (Output_data_plt_x86_64::init): New function.
7545 (Output_data_plt_x86_64::add_relocation): New function.
7546 (Output_data_plt_x86_64::reserve_slot): New function.
7547 (Output_data_plt_x86_64::free_list_): New data member.
7548 (Target_x86_64::init_got_plt_for_update): New function.
7549 (Target_x86_64::register_global_plt_entry): New function.
7550 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7551 incremental updates.
7552 (Output_data_plt_x86_64::add_relocation): New function.
7553 * testsuite/object_unittest.cc (Object_test): Set default options.
7554
7555 2011-05-16 Ian Lance Taylor <iant@google.com>
7556
7557 * options.h (class General_options): Make -i a synonym for -r.
7558
7559 2011-05-16 Ian Lance Taylor <iant@google.com>
7560
7561 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7562
7563 2011-05-10 Cary Coutant <ccoutant@google.com>
7564
7565 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7566 strip_all (-s).
7567
7568 2011-05-06 Ian Lance Taylor <iant@google.com>
7569
7570 * layout.cc (Layout::layout): If the output section flags change,
7571 update the ordering.
7572
7573 2011-04-25 Cary Coutant <ccoutant@google.com>
7574
7575 * incremental-dump.cc (dump_incremental_inputs): Print local
7576 symbol info for each input file.
7577 * incremental.cc
7578 (Output_section_incremental_inputs::set_final_data_size): Add local
7579 symbol info to input file entries in incremental info.
7580 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7581 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7582 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7583 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7584 implementation.
7585 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7586 (Sized_incr_relobj::do_relocate): Write the local symbols.
7587 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7588 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7589 Adjust size of input file header.
7590 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7591 (Incremental_inputs_reader::get_local_symbol_count): New function.
7592 (Incremental_inputs_reader::get_input_section): Adjust size of input
7593 file header.
7594 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7595 (Sized_incr_relobj::This): New typedef.
7596 (Sized_incr_relobj::sym_size): New const data member.
7597 (Sized_incr_relobj::Local_symbol): New struct.
7598 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7599 (Sized_incr_relobj::do_local_symbol_offset): New function.
7600 (Sized_incr_relobj::local_symbol_count_): New data member.
7601 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7602 (Sized_incr_relobj::local_symbol_index_): New data member.
7603 (Sized_incr_relobj::local_symbol_offset_): New data member.
7604 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7605 (Sized_incr_relobj::local_symbols_): New data member.
7606 * object.h (Relobj::output_local_symbol_count): New function.
7607 (Relobj::local_symbol_offset): New function.
7608 (Relobj::do_output_local_symbol_count): New function.
7609 (Relobj::do_local_symbol_offset): New function.
7610 (Sized_relobj::do_output_local_symbol_count): New function.
7611 (Sized_relobj::do_local_symbol_offset): New function.
7612
7613 2011-04-22 Vladimir Simonov <sv@sw.ru>
7614
7615 * descriptors.cc (set_close_on_exec): New function.
7616 (Descriptors::open): Use set_close_on_exec.
7617 * output.cc (S_ISLNK): Define if not defined.
7618
7619 2011-04-22 Cary Coutant <ccoutant@google.com>
7620
7621 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7622 global symbol map.
7623 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7624 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7625 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7626 relocations.
7627 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7628 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7629 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7630 * incremental.h
7631 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7632 function.
7633 (Incremental_binary::apply_incremental_relocs): New function.
7634 (Incremental_binary::do_apply_incremental_relocs): New function.
7635 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7636 data member.
7637 (Sized_incremental_binary::add_global_symbol): New function.
7638 (Sized_incremental_binary::global_symbol): New function.
7639 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7640 (Sized_incremental_binary::symbol_map_): New data member.
7641 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7642 * target.h (Sized_target::apply_relocation): New function.
7643 * target-reloc.h (apply_relocation): New function.
7644 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7645
7646 2011-04-22 Doug Kwan <dougkwan@google.com>
7647
7648 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7649 flag of a SHT_ARM_EXIDX section.
7650 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7651 * testsuite/Makefile.in: Regenerate.
7652 * testsuite/arm_exidx_test.s: New file.
7653 * testsuite/arm_exidx_test.sh: Same.
7654
7655 2011-04-20 Cary Coutant <ccoutant@google.com>
7656
7657 PR gold/12689
7658 * archive.h (Incremental_archive_entry::Archive_member):
7659 Initialize arg_serial_ (second constructor).
7660
7661 2011-04-17 Ian Lance Taylor <iant@google.com>
7662
7663 * object.cc (Relocate_info::location): Simplify location string.
7664 * errors.cc (Errors::error_at_location): Don't print program
7665 name.
7666 (Errors::warning_at_location): Likewise.
7667 (Errors::undefined_symbol): Likewise.
7668 * testsuite/debug_msg.sh: Update accordingly.
7669
7670 2011-04-14 Cary Coutant <ccoutant@google.com>
7671
7672 * gold/layout.cc (Layout::symtab_section_offset): New function.
7673 * gold/layout.h (Layout::symtab_section_offset): New function.
7674 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7675
7676 2011-04-12 Ian Lance Taylor <iant@google.com>
7677
7678 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7679 with MREMAP_MAYMOVE.
7680 * output.h (class Output_file): Add map_is_allocated_ field.
7681 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7682 not available, provide stubs. If mremap is not available, #define
7683 it to gold_mremap.
7684 (MREMAP_MAYMOVE): Define if not defined.
7685 (Output_file::Output_file): Initialize map_is_allocated_.
7686 (Output_file::resize): Check map_is_allocated_.
7687 (Output_file::map_anonymous): If mmap fails, use malloc.
7688 (Output_file::unmap): Don't do anything for an anonymous map.
7689 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7690 is not available, provide stubs.
7691 (File_read::View::~View): Use free rather than delete[].
7692 (File_read::make_view): Use malloc rather than new[]. If mmap
7693 fails, use malloc.
7694 (File_read::find_or_make_view): Use malloc rather than new[].
7695 * gold.h: Remove HAVE_REMAP code.
7696 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7697 exists. Rename mremap to gold_mremap. If mmap is not available
7698 don't do anything.
7699 * configure, config.in: Rebuild.
7700
7701 2011-04-11 Ian Lance Taylor <iant@google.com>
7702
7703 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7704 initialize local variable v.
7705
7706 2011-04-11 Cary Coutant <ccoutant@google.com>
7707
7708 * archive.cc (Archive::include_member): Adjust call to
7709 report_object.
7710 (Add_archive_symbols::run): Track argument serial numbers.
7711 (Lib_group::include_member): Likewise.
7712 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7713 * archive.h (Incremental_archive_entry::Archive_member):
7714 Initialize arg_serial_.
7715 (Archive_member::arg_serial_): New data member.
7716 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7717 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7718 incremental link.
7719 (Sized_dynobj::do_for_all_local_got_entries): New function.
7720 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7721 function.
7722 * fileread.cc (get_mtime): New function.
7723 * fileread.h (get_mtime): New function.
7724 * gold.cc (queue_initial_tasks): Check for incremental update.
7725 (process_incremental_input): New function.
7726 (queue_middle_tasks): Don't force valid target for incremental
7727 update.
7728 * incremental-dump.cc (find_input_containing_global): Adjust
7729 size of symbol info entry.
7730 (dump_incremental_inputs): Dump argument serial number and
7731 in_system_directory flag; bias shndx by 1; print symbol names
7732 when dumping per-file symbol lists; use new symbol info readers.
7733 * incremental.cc
7734 (Output_section_incremental_inputs:update_data_size): New function.
7735 (Sized_incremental_binary::setup_readers): Setup input readers
7736 for each input file; build maps for files added from libraries
7737 and scripts.
7738 (Sized_incremental_binary::check_input_args): New function.
7739 (Sized_incremental_binary::do_check_inputs): Build map of argument
7740 serial numbers to input arguments.
7741 (Sized_incremental_binary::do_file_has_changed): Rename
7742 do_file_is_unchanged to this; compare file modification times.
7743 (Sized_incremental_binary::do_init_layout): New function.
7744 (Sized_incremental_binary::do_reserve_layout): New function.
7745 (Sized_incremental_binary::do_get_input_reader): Remove.
7746 (Sized_incremental_binary::get_symtab_view): New function.
7747 (Incremental_checker::can_incrementally_link_output_file): Remove.
7748 (Incremental_inputs::report_command_line): Exclude --debug options.
7749 (Incremental_inputs::report_archive_begin): Add parameter; track
7750 argument serial numbers; don't put input file entry for archive
7751 before archive members.
7752 (Incremental_inputs::report_archive_end): Put input file entry
7753 for archive after archive members.
7754 (Incremental_inputs::report_object): Add parameter; track argument
7755 serial numbers and in_system_directory flag.
7756 (Incremental_inputs::report_script): Add parameter; track argument
7757 serial numbers.
7758 (Output_section_incremental_inputs::set_final_data_size): Adjust
7759 size of symbol info entry; check for forwarding symbols.
7760 (Output_section_incremental_inputs::write_input_files): Write
7761 in_system_directory flag and argument serial number.
7762 (Output_section_incremental_inputs::write_info_blocks): Map section
7763 indices between incremental info and original input file; store
7764 input section index for each symbol.
7765 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7766 change operator() to visit().
7767 (class Global_got_offset_visitor): Likewise.
7768 (class Global_symbol_visitor_got_plt):
7769 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7770 classes.
7771 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7772 (Sized_incr_relobj::do_read_symbols): New function.
7773 (Sized_incr_relobj::do_layout): New function.
7774 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7775 (Sized_incr_relobj::do_add_symbols): New function.
7776 (Sized_incr_relobj::do_should_include_member): New function.
7777 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7778 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7779 (Sized_incr_relobj::do_section_size): New function.
7780 (Sized_incr_relobj::do_section_name): New function.
7781 (Sized_incr_relobj::do_section_contents): New function.
7782 (Sized_incr_relobj::do_section_flags): New function.
7783 (Sized_incr_relobj::do_section_entsize): New function.
7784 (Sized_incr_relobj::do_section_address): New function.
7785 (Sized_incr_relobj::do_section_type): New function.
7786 (Sized_incr_relobj::do_section_link): New function.
7787 (Sized_incr_relobj::do_section_info): New function.
7788 (Sized_incr_relobj::do_section_addralign): New function.
7789 (Sized_incr_relobj::do_initialize_xindex): New function.
7790 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7791 (Sized_incr_relobj::do_read_relocs): New function.
7792 (Sized_incr_relobj::do_gc_process_relocs): New function.
7793 (Sized_incr_relobj::do_scan_relocs): New function.
7794 (Sized_incr_relobj::do_count_local_symbols): New function.
7795 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7796 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7797 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7798 (Sized_incr_relobj::do_relocate): New function.
7799 (Sized_incr_relobj::do_set_section_offset): New function.
7800 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7801 (Sized_incr_dynobj::do_read_symbols): New function.
7802 (Sized_incr_dynobj::do_layout): New function.
7803 (Sized_incr_dynobj::do_add_symbols): New function.
7804 (Sized_incr_dynobj::do_should_include_member): New function.
7805 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7806 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7807 (Sized_incr_dynobj::do_section_size): New function.
7808 (Sized_incr_dynobj::do_section_name): New function.
7809 (Sized_incr_dynobj::do_section_contents): New function.
7810 (Sized_incr_dynobj::do_section_flags): New function.
7811 (Sized_incr_dynobj::do_section_entsize): New function.
7812 (Sized_incr_dynobj::do_section_address): New function.
7813 (Sized_incr_dynobj::do_section_type): New function.
7814 (Sized_incr_dynobj::do_section_link): New function.
7815 (Sized_incr_dynobj::do_section_info): New function.
7816 (Sized_incr_dynobj::do_section_addralign): New function.
7817 (Sized_incr_dynobj::do_initialize_xindex): New function.
7818 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7819 (make_sized_incremental_object): New function.
7820 (Incremental_library::copy_unused_symbols): New function.
7821 (Incremental_library::do_for_all_unused_symbols): New function.
7822 * incremental.h (enum Incremental_input_flags): New type.
7823 (class Incremental_checker): Remove.
7824 (Incremental_input_entry::Incremental_input_entry): Add argument
7825 serial number.
7826 (Incremental_input_entry::arg_serial): New function.
7827 (Incremental_input_entry::set_is_in_system_directory): New function.
7828 (Incremental_input_entry::is_in_system_directory): New function.
7829 (Incremental_input_entry::arg_serial_): New data member.
7830 (Incremental_input_entry::is_in_system_directory_): New data member.
7831 (class Script_info): Move here from script.h.
7832 (Script_info::Script_info): Add filename parameter.
7833 (Script_info::filename): New function.
7834 (Script_info::filename_): New data member.
7835 (Incremental_script_entry::Incremental_script_entry): Add argument
7836 serial number.
7837 (Incremental_object_entry::Incremental_object_entry): Likewise.
7838 (Incremental_object_entry::add_input_section): Build list of input
7839 sections with map to original shndx.
7840 (Incremental_object_entry::get_input_section_index): New function.
7841 (Incremental_object_entry::shndx_): New data member.
7842 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7843 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7844 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7845 serial number.
7846 (Incremental_inputs::report_archive_begin): Likewise.
7847 (Incremental_inputs::report_object): Likewise.
7848 (Incremental_inputs::report_script): Likewise.
7849 (class Incremental_global_symbol_reader): New class.
7850 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7851 and store flags and input file type.
7852 (Incremental_input_entry_reader::arg_serial): New function.
7853 (Incremental_input_entry_reader::type): Extract type from flags.
7854 (Incremental_input_entry_reader::is_in_system_directory): New function.
7855 (Incremental_input_entry_reader::get_input_section_count): Call
7856 accessor function for type.
7857 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7858 function for type; adjust size of global symbol entry.
7859 (Incremental_input_entry_reader::get_global_symbol_count): Call
7860 accessor function for type.
7861 (Incremental_input_entry_reader::get_object_count): Likewise.
7862 (Incremental_input_entry_reader::get_object_offset): Likewise.
7863 (Incremental_input_entry_reader::get_member_count): Likewise.
7864 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7865 (Incremental_input_entry_reader::get_member_offset): Likewise.
7866 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7867 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7868 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7869 (Incremental_input_entry_reader::get_global_symbol_reader): New
7870 function.
7871 (Incremental_input_entry_reader::get_output_symbol_index): New
7872 function.
7873 (Incremental_input_entry_reader::type_): Remove.
7874 (Incremental_input_entry_reader::flags_): New data member.
7875 (Incremental_inputs_reader::input_file_offset): New function.
7876 (Incremental_inputs_reader::input_file_index): New function.
7877 (Incremental_inputs_reader::input_file): Call input_file_offset.
7878 (Incremental_inputs_reader::input_file_at_offset): New function.
7879 (Incremental_relocs_reader::get_r_type): Reformat.
7880 (Incremental_relocs_reader::get_r_shndx): Reformat.
7881 (Incremental_relocs_reader::get_r_offset): Reformat.
7882 (Incremental_relocs_reader::data): New function.
7883 (Incremental_binary::Incremental_binary): Initialize new data members.
7884 (Incremental_binary::check_inputs): Add cmdline parameter.
7885 (Incremental_binary::file_is_unchanged): Remove.
7886 (Input_reader::arg_serial): New function.
7887 (Input_reader::get_unused_symbol_count): New function.
7888 (Input_reader::get_unused_symbol): New function.
7889 (Input_reader::do_arg_serial): New function.
7890 (Input_reader::do_get_unused_symbol_count): New function.
7891 (Input_reader::do_get_unused_symbol): New function.
7892 (Incremental_binary::input_file_count): New function.
7893 (Incremental_binary::get_input_reader): Change signature to use
7894 index instead of filename.
7895 (Incremental_binary::file_has_changed): New function.
7896 (Incremental_binary::get_input_argument): New function.
7897 (Incremental_binary::get_library): New function.
7898 (Incremental_binary::get_script_info): New function.
7899 (Incremental_binary::init_layout): New function.
7900 (Incremental_binary::reserve_layout): New function.
7901 (Incremental_binary::output_file): New function.
7902 (Incremental_binary::do_check_inputs): New function.
7903 (Incremental_binary::do_file_is_unchanged): Remove.
7904 (Incremental_binary::do_file_has_changed): New function.
7905 (Incremental_binary::do_init_layout): New function.
7906 (Incremental_binary::do_reserve_layout): New function.
7907 (Incremental_binary::do_input_file_count): New function.
7908 (Incremental_binary::do_get_input_reader): Change signature.
7909 (Incremental_binary::input_args_map_): New data member.
7910 (Incremental_binary::library_map_): New data member.
7911 (Incremental_binary::script_map_): New data member.
7912 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7913 new data members.
7914 (Sized_incremental_binary::output_section): New function.
7915 (Sized_incremental_binary::inputs_reader): Add const.
7916 (Sized_incremental_binary::symtab_reader): Add const.
7917 (Sized_incremental_binary::relocs_reader): Add const.
7918 (Sized_incremental_binary::got_plt_reader): Add const.
7919 (Sized_incremental_binary::get_symtab_view): New function.
7920 (Sized_incremental_binary::Inputs_reader): New typedef.
7921 (Sized_incremental_binary::Input_entry_reader): New typedef.
7922 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7923 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7924 (Sized_incremental_binary::do_file_has_changed): New function.
7925 (Sized_incremental_binary::do_init_layout): New function.
7926 (Sized_incremental_binary::do_reserve_layout): New function.
7927 (Sized_input_reader::Inputs_reader): Remove.
7928 (Sized_input_reader::Input_entry_reader): Remove.
7929 (Sized_input_reader::do_arg_serial): New function.
7930 (Sized_input_reader::do_get_unused_symbol_count): New function.
7931 (Sized_input_reader::do_get_unused_symbol): New function.
7932 (Sized_incremental_binary::do_input_file_count): New function.
7933 (Sized_incremental_binary::do_get_input_reader): Change signature;
7934 use index instead of filename.
7935 (Sized_incremental_binary::section_map_): New data member.
7936 (Sized_incremental_binary::input_entry_readers_): New data member.
7937 (class Sized_incr_relobj): New class.
7938 (class Sized_incr_dynobj): New class.
7939 (make_sized_incremental_object): New function.
7940 (class Incremental_library): New class.
7941 * layout.cc (Free_list::num_lists): New static data member.
7942 (Free_list::num_nodes): New static data member.
7943 (Free_list::num_removes): New static data member.
7944 (Free_list::num_remove_visits): New static data member.
7945 (Free_list::num_allocates): New static data member.
7946 (Free_list::num_allocate_visits): New static data member.
7947 (Free_list::init): New function.
7948 (Free_list::remove): New function.
7949 (Free_list::allocate): New function.
7950 (Free_list::dump): New function.
7951 (Free_list::print_stats): New function.
7952 (Layout_task_runner::run): Resize output file for incremental updates.
7953 (Layout::Layout): Initialize new data members.
7954 (Layout::set_incremental_base): New function.
7955 (Layout::init_fixed_output_section): New function.
7956 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7957 incremental updates.
7958 (Layout::create_gold_note): Do not create gold note section for
7959 incremental updates.
7960 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7961 for incremental updates.
7962 (Layout::set_section_offsets): For incremental updates, allocate space
7963 from free list.
7964 (Layout::create_symtab_sections): Layout with offsets relative to
7965 start of section; for incremental updates, allocate space from free
7966 list.
7967 (Layout::create_shdrs): For incremental updates, allocate space from
7968 free list.
7969 (Layout::finish_dynamic_section): For incremental updates, do not
7970 check --as-needed (fixed in subsequent patch).
7971 * layout.h (class Free_list): New class.
7972 (Layout::set_incremental_base): New function.
7973 (Layout::incremental_base): New function.
7974 (Layout::init_fixed_output_section): New function.
7975 (Layout::allocate): New function.
7976 (Layout::incremental_base_): New data member.
7977 (Layout::free_list_): New data member.
7978 * main.cc (main): Print Free_list statistics.
7979 * object.cc (Relobj::finalize_incremental_relocs): Add
7980 clear_counts parameter; clear counts only when clear_counts is set.
7981 (Sized_relobj::Sized_relobj): Initialize new base class.
7982 (Sized_relobj::do_layout): Don't report special sections.
7983 (Sized_relobj::do_for_all_local_got_entries): New function.
7984 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7985 symtab_off to all symbol table offsets.
7986 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7987 * object.h (class Got_offset_list): Move to top of file.
7988 (Object::Object): Allow case where input_file == NULL.
7989 (Object::~Object): Likewise.
7990 (Object::input_file): Assert that input_file != NULL.
7991 (Object::lock): Allow case where input_file == NULL.
7992 (Object::unlock): Likewise.
7993 (Object::is_locked): Likewise.
7994 (Object::token): Likewise.
7995 (Object::release): Likewise.
7996 (Object::is_incremental): New function.
7997 (Object::get_mtime): New function.
7998 (Object::for_all_local_got_entries): New function.
7999 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
8000 (Object::set_is_in_system_directory): New function.
8001 (Object::is_in_system_directory): New function.
8002 (Object::do_is_incremental): New function.
8003 (Object::do_get_mtime): New function.
8004 (Object::do_for_all_local_got_entries): New function.
8005 (Object::is_in_system_directory_): New data member.
8006 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
8007 (class Sized_relobj_base): New class.
8008 (class Sized_relobj): Derive from Sized_relobj_base.
8009 (class Sized_relobj::Symbols): Redeclare from base class.
8010 (class Sized_relobj::local_got_offset_list): Remove.
8011 (class Sized_relobj::Output_sections): Redeclare from base class.
8012 (class Sized_relobj::do_for_all_local_got_entries): New function.
8013 (class Sized_relobj::write_local_symbols): Add offset parameter.
8014 (class Sized_relobj::local_symbol_offset_): Update comment.
8015 (class Sized_relobj::local_dynsym_offset_): Update comment.
8016 * options.cc (Input_arguments::add_file): Remove const.
8017 * options.h (Input_file_argument::Input_file_argument):
8018 Initialize arg_serial_ (all constructors).
8019 (Input_file_argument::set_arg_serial): New function.
8020 (Input_file_argument::arg_serial): New function.
8021 (Input_file_argument::arg_serial_): New data member.
8022 (Input_arguments::Input_arguments): Initialize file_count_.
8023 (Input_arguments::add_file): Remove const.
8024 (Input_arguments::number_of_input_files): New function.
8025 (Input_arguments::file_count_): New data member.
8026 (Command_line::number_of_input_files): Call
8027 Input_arguments::number_of_input_files.
8028 * output.cc (Output_segment_headers::Output_segment_headers):
8029 Set current size.
8030 (Output_section::Input_section::current_data_size): New function.
8031 (Output_section::Output_section): Initialize new data members.
8032 (Output_section::add_input_section): Don't do merge sections for
8033 an incremental link; allocate space from free list for an
8034 incremental update.
8035 (Output_section::add_output_section_data): Allocate space from
8036 free list for an incremental update.
8037 (Output_section::update_data_size): New function.
8038 (Output_section::set_fixed_layout): New function.
8039 (Output_section::reserve): New function.
8040 (Output_segment::set_section_addresses): Remove const.
8041 (Output_segment::set_section_list_addresses): Remove const; allocate
8042 space from free list for an incremental update.
8043 (Output_segment::set_offset): Adjust size of RELRO segment for an
8044 incremental update.
8045 * output.h (Output_data::current_data_size): Move here from
8046 child classes.
8047 (Output_data::pre_finalize_data_size): New function.
8048 (Output_data::update_data_size): New function.
8049 (Output_section_headers::update_data_size): new function.
8050 (Output_section_data_build::current_data_size): Move to Output_data.
8051 (Output_data_strtab::update_data_size): New function.
8052 (Output_section::current_data_size): Move to Output_data.
8053 (Output_section::set_fixed_layout): New function.
8054 (Output_section::has_fixed_layout): New function.
8055 (Output_section::reserve): New function.
8056 (Output_section::update_data_size): New function.
8057 (Output_section::has_fixed_layout_): New data member.
8058 (Output_section::free_list_): New data member.
8059 (Output_segment::set_section_addresses): Remove const.
8060 (Output_segment::set_section_list_addresses): Remove const.
8061 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8062 New function.
8063 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8064 New function.
8065 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8066 parameter when calling Add_symbols constructor; store argument
8067 serial number for members of a lib group.
8068 (Add_symbols::locks): Allow case where token == NULL.
8069 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8070 (Read_member::~Read_member): New function.
8071 (Read_member::is_runnable): New function.
8072 (Read_member::locks): New function.
8073 (Read_member::run): New function.
8074 (Check_script::~Check_script): New function.
8075 (Check_script::is_runnable): New function.
8076 (Check_script::locks): New function.
8077 (Check_script::run): New function.
8078 (Check_library::~Check_library): New function.
8079 (Check_library::is_runnable): New function.
8080 (Check_library::locks): New function.
8081 (Check_library::run): New function.
8082 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8083 (Add_symbols::library_): New data member.
8084 (class Read_member): New class.
8085 (class Check_script): New class.
8086 (class Check_library): New class.
8087 * reloc.cc (Read_relocs::is_runnable): Allow case where
8088 token == NULL.
8089 (Read_relocs::locks): Likewise.
8090 (Scan_relocs::locks): Likewise.
8091 (Relocate_task::locks): Likewise.
8092 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8093 to clear counters.
8094 (Sized_relobj::incremental_relocs_scan): Fix comment.
8095 (Sized_relobj::do_relocate): Pass output file offset to
8096 write_local_symbols.
8097 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8098 from class declaration.
8099 * script.cc (read_input_script): Allocate Script_info; pass
8100 argument serial number to report_script.
8101 * script.h (class Script_info): Move to incremental.h.
8102 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8103 * symtab.h (Symbol_table::add_from_incrobj): New function.
8104 (Symbol_table::set_file_offset): New function.
8105
8106 2011-04-05 Cary Coutant <ccoutant@google.com>
8107
8108 * incremental-dump.cc (dump_incremental_inputs): Change signature
8109 to take a Sized_incremental_binary; change caller. Use readers
8110 in Sized_incremental_binary.
8111 * incremental.cc
8112 (Sized_incremental_binary::find_incremental_inputs_sections):
8113 Rename do_find_incremental_inputs_sections to this.
8114 (Sized_incremental_binary::setup_readers): New function.
8115 (Sized_incremental_binary::do_check_inputs): Check
8116 has_incremental_info_ flag; move setup code to setup_readers;
8117 use input readers.
8118 (Sized_incremental_binary::do_file_is_unchanged): New function.
8119 (Sized_incremental_binary::do_get_input_reader): New function.
8120 * incremental.h (class Incremental_binary): Move to end of file.
8121 (Incremental_binary::file_is_unchanged): New function.
8122 (Incremental_binary::do_file_is_unchanged): New function.
8123 (Incremental_binary::Input_reader): New class.
8124 (Incremental_binary::get_input_reader): New function.
8125 (class Sized_incremental_binary): Move to end of file.
8126 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8127 input section reader classes.
8128 (Sized_incremental_binary::has_incremental_info): New function.
8129 (Sized_incremental_binary::inputs_reader): New function.
8130 (Sized_incremental_binary::symtab_reader): New function.
8131 (Sized_incremental_binary::relocs_reader): New function.
8132 (Sized_incremental_binary::got_plt_reader): New function.
8133 (Sized_incremental_binary::do_file_is_unchanged): New function.
8134 (Sized_incremental_binary::Sized_input_reader): New class.
8135 (Sized_incremental_binary::get_input_reader): New function.
8136 (Sized_incremental_binary::find_incremental_inputs_sections):
8137 Rename do_find_incremental_inputs_sections to this.
8138 (Sized_incremental_binary::setup_readers): New function.
8139 (Sized_incremental_binary::has_incremental_info_): New data member.
8140 (Sized_incremental_binary::inputs_reader_): New data member.
8141 (Sized_incremental_binary::symtab_reader_): New data member.
8142 (Sized_incremental_binary::relocs_reader_): New data member.
8143 (Sized_incremental_binary::got_plt_reader_): New data member.
8144 (Sized_incremental_binary::current_input_file_): New data member.
8145
8146 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8147
8148 PR gold/12640
8149 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8150 violation.
8151
8152 2011-03-30 Cary Coutant <ccoutant@google.com>
8153
8154 * archive.cc (Archive::include_member): Adjust call to report_object.
8155 (Add_archive_symbols::run): Add script_info to call to
8156 report_archive_begin.
8157 (Lib_group::include_member): Adjust call to report_object.
8158 (Add_lib_group_symbols::run): Adjust call to report_object.
8159 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8160 blocks. Add object count for script input files.
8161 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8162 script_info parameter; change all callers.
8163 (Incremental_inputs::report_object): Add script_info parameter;
8164 change all callers.
8165 (Incremental_inputs::report_script): Store backpointer to
8166 incremental info entry.
8167 (Output_section_incremental_inputs::set_final_data_size): Record
8168 additional information for scripts.
8169 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8170 * incremental.h (Incremental_script_entry::add_object): New function.
8171 (Incremental_script_entry::get_object_count): New function.
8172 (Incremental_script_entry::get_object): New function.
8173 (Incremental_script_entry::objects_): New data member; adjust
8174 constructor.
8175 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8176 (Incremental_inputs::report_object): Add script_info parameter.
8177 (Incremental_inputs_reader::get_object_count): New function.
8178 (Incremental_inputs_reader::get_object_offset): New function.
8179 * options.cc (Input_arguments::add_file): Return reference to
8180 new input argument.
8181 * options.h (Input_argument::set_script_info): New function.
8182 (Input_argument::script_info): New function.
8183 (Input_argument::script_info_): New data member; adjust all
8184 constructors.
8185 (Input_file_group::add_file): Return reference to new input argument.
8186 (Input_file_lib::add_file): Likewise.
8187 (Input_arguments::add_file): Likewise.
8188 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8189 * script.cc (Parser_closure::Parser_closure): Add script_info
8190 parameter; adjust all callers.
8191 (Parser_closure::script_info): New function.
8192 (Parser_closure::script_info_): New data member.
8193 (read_input_script): Report scripts earlier to incremental info.
8194 (script_add_file): Set script_info in Input_argument.
8195 (script_add_library): Likewise.
8196 * script.h (Script_options::Script_info): Rewrite class.
8197
8198 2011-03-29 Cary Coutant <ccoutant@google.com>
8199
8200 * archive.cc (Library_base::should_include_member): Move
8201 method here from class Archive.
8202 (Archive::Archive): Initialize base class.
8203 (Archive::should_include_member): Move to base class.
8204 (Archive::do_for_all_unused_symbols): New function.
8205 (Add_archive_symbols::run): Remove redundant access to
8206 incremental_inputs.
8207 (Lib_group::Lib_group): Initialize base class.
8208 (Lib_group::do_filename): New function.
8209 (Lib_group::include_member): Pass pointer to Lib_group to
8210 report_object.
8211 (Lib_group::do_for_all_unused_symbols): New function.
8212 (Add_lib_group_symbols::run): Report archive information for
8213 incremental links.
8214 * archive.h (class Library_base): New base class.
8215 (class Archive): Derive from Library_base.
8216 (Archive::filename): Move to base class.
8217 (Archive::set_incremental_info): Likewise.
8218 (Archive::incremental_info): Likewise.
8219 (Archive::Should_include): Likewise.
8220 (Archive::should_include_member): Likewise.
8221 (Archive::Armap_entry): Remove.
8222 (Archive::Unused_symbol_iterator): Remove.
8223 (Archive::unused_symbols_begin): Remove.
8224 (Archive::unused_symbols_end): Remove.
8225 (Archive::do_filename): New function.
8226 (Archive::do_get_mtime): New function.
8227 (Archive::do_for_all_unused_symbols): New function.
8228 (Archive::task_): Move to base class.
8229 (Archive::incremental_info_): Likewise.
8230 (class Lib_group): Derive from Library_base.
8231 (Lib_group::do_filename): New function.
8232 (Lib_group::do_get_mtime): New function.
8233 (Lib_group::do_for_all_unused_symbols): New function.
8234 (Lib_group::task_): Move to base class.
8235 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8236 function.
8237 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8238 function.
8239 * incremental.cc (Incremental_inputs::report_archive_begin):
8240 Use Library_base; call library's get_mtime; add incremental inputs
8241 entry before members.
8242 (class Unused_symbol_visitor): New class.
8243 (Incremental_inputs::report_archive_end): Use Library_base; use
8244 visitor class to record unused symbols; don't add incremental inputs
8245 entry after members.
8246 (Incremental_inputs::report_object): Use Library_base.
8247 * incremental.h
8248 (Incremental_archive_entry::Incremental_archive_entry): Remove
8249 unused Archive parameter.
8250 (Incremental_inputs::report_archive_begin): Use Library_base.
8251 (Incremental_inputs::report_archive_end): Likewise.
8252 (Incremental_inputs::report_object): Likewise.
8253 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8254 function.
8255 * object.h (Object::for_all_global_symbols): New function.
8256 (Object::do_for_all_global_symbols): New function.
8257 (Sized_relobj::do_for_all_global_symbols): New function.
8258 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8259 function.
8260 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8261 function.
8262
8263 2011-03-27 Ian Lance Taylor <iant@google.com>
8264
8265 * archive.cc (Archive::interpret_header): Return -1 if something
8266 goes wrong. Change callers accordingly.
8267
8268 2011-03-25 Cary Coutant <ccoutant@google.com>
8269
8270 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8271 * testsuite/Makefile.in: Regenerate.
8272
8273 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8274
8275 * plugin.cc (get_view): New.
8276 (Plugin::load): Pass get_view to the plugin.
8277 (Plugin_manager::get_view): New.
8278
8279 2011-03-21 Ian Lance Taylor <iant@google.com>
8280
8281 * testsuite/final_layout.sh: Rewrite to not use dc.
8282 * testsuite/relro_test.sh: Fail if dc is not present.
8283
8284 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8285
8286 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8287 Change == to -eq.
8288 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8289 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8290 Change == to -eq.
8291 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8292 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8293
8294 2011-03-14 Ian Lance Taylor <iant@google.com>
8295
8296 * script-sections.cc (Sort_output_sections::script_compare):
8297 Rename from is_before, change return type.
8298 (Sort_output_sections::operator()): Adjust accordingly.
8299
8300 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8301
8302 PR gold/12572
8303 * testsuite/odr_violation2.cc: Add comment to make all error line
8304 numbers double digits.
8305 * testsuite/debug_msg.sh: Adjust expected errors.
8306
8307 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8308
8309 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8310 but mark earlier ones as non-canonical
8311 (offset_to_iterator): Update search target and example
8312 (do_addr2line): Return extra lines in a vector*
8313 (format_file_lineno): Extract from do_addr2line
8314 (one_addr2line): Add vector* out-param
8315 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8316 when a lineno entry appeared last for its instruction
8317 (Dwarf_line_info): Add vector* out-param
8318 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8319 * symtab.cc (Odr_violation_compare): Include the lineno in the
8320 comparison again.
8321 (linenos_from_loc): New. Combine the canonical line for an
8322 address with its other lines.
8323 (True_if_intersect): New. Helper functor to make
8324 std::set_intersection a query.
8325 (detect_odr_violations): Compare sets of lines instead of just
8326 one line for each function. This became less deterministic, but
8327 has fewer false positives.
8328 * symtab.h: Declarations.
8329 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8330 mix an optimized and non-optimized object in the same binary
8331 (odr_violation2.so): Same.
8332 * testsuite/Makefile.in: Regenerate from Makefile.am.
8333 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8334 * testsuite/debug_msg.sh: Update line numbers and add
8335 assertions.
8336 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8337 non-optimized context.
8338 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8339 isn't inlined, and use OdrDerived in an optimized context.
8340 * testsuite/odr_header1.h: Defines OdrDerived, where
8341 optimization will change the
8342 first-instruction-in-the-destructor's file and line number.
8343 * testsuite/odr_header2.h: Defines OdrBase.
8344
8345 2011-03-09 Ian Lance Taylor <iant@google.com>
8346
8347 * fileread.cc (File_read::clear_views): Don't delete the whole
8348 file view.
8349
8350 2011-03-08 Ian Lance Taylor <iant@google.com>
8351
8352 PR gold/12525
8353 * fileread.cc: #include <climits>.
8354 (GOLD_IOV_MAX): Define.
8355 (File_read::read_multiple): Limit number of entries by iov_max.
8356 * fileread.h (class File_read): Always set max_readv_entries to
8357 128.
8358
8359 2011-03-07 Ian Lance Taylor <iant@google.com>
8360
8361 PR gold/12525
8362 * options.h (class General_options): Add -dy and -dn.
8363
8364 2011-03-02 Cary Coutant <ccoutant@google.com>
8365
8366 * testsuite/script_test_9.t: Add TLS segment.
8367
8368 2011-03-02 Simon Baldwin <simonb@google.com>
8369
8370 * configure.ac: Add check for gnu_indirect_function support in
8371 the toolchain building binutils.
8372 * configure: Rebuild.
8373
8374 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8375
8376 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8377 plugin only symbols.
8378 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8379 in plugin files as not needed in the symbol table.
8380
8381 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8382
8383 * output.cc (Output_section::add_input_section): Delay fill
8384 generation for section ordering.
8385
8386 2011-02-09 Ian Lance Taylor <iant@google.com>
8387
8388 PR gold/12316
8389 * object.h (class Sized_relobj): Remove clear_local_symbols.
8390 * reloc.cc (Sized_relobj::do_relocate): Don't call
8391 clear_local_symbols.
8392
8393 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8394
8395 * plugin.cc (is_visible_from_outside): Return true for symbols
8396 in the -u option.
8397
8398 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8399
8400 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8401 filename.
8402
8403 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8404
8405 * icf.h (is_section_foldable_candidate): Change type of parameter
8406 to std::string.
8407 * icf.cc (Icf::find_identical_sections): Change type of local variable
8408 section_name to be std::string.
8409 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8410
8411 2011-01-25 Ian Lance Taylor <iant@google.com>
8412
8413 * script.cc (script_add_extern): Rewrite to use
8414 add_symbol_reference.
8415
8416 2011-01-25 Doug Kwan <dougkwan@google.com>
8417
8418 * icf.cc (get_section_contents): Always lock section's object.
8419
8420 2011-01-24 Ian Lance Taylor <iant@google.com>
8421
8422 * options.h (class General_options): Accept
8423 --no-detect-odr-violations.
8424
8425 2011-01-24 Ian Lance Taylor <iant@google.com>
8426
8427 * version.cc (version_string): Bump to 1.11.
8428
8429 2011-01-24 Ian Lance Taylor <iant@google.com>
8430
8431 * plugin.cc (class Plugin_rescan): Define new class.
8432 (Plugin_manager::claim_file): Set any_claimed_.
8433 (Plugin_manager::save_archive): New function.
8434 (Plugin_manager::save_input_group): New function.
8435 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8436 necessary.
8437 (Plugin_manager::new_undefined_symbol): New function.
8438 (Plugin_manager::rescan): New function.
8439 (Plugin_manager::rescannable_defines): New function.
8440 (Plugin_manager::add_input_file): Set any_added_.
8441 * plugin.h (class Plugin_manager): define new fields rescannable_,
8442 undefined_symbols_, any_claimed_, and any_added_. Declare
8443 Plugin_rescan as friend. Declare new functions.
8444 (Plugin_manager::Rescannable): Define type.
8445 (Plugin_manager::Rescannable_list): Define type.
8446 (Plugin_manager::Undefined_symbol_list): Define type.
8447 (Plugin_manager::Plugin_manager): Initialize new fields.
8448 * archive.cc (Archive::defines_symbol): New function.
8449 (Add_archive_symbols::run): Pass archive to plugins if any.
8450 * archive.h (class Archive): Declare defines_symbol.
8451 * readsyms.cc (Input_group::~Input_group): New function.
8452 (Finish_group::run): Pass input_group to plugins if any.
8453 * readsyms.h (class Input_group): Declare destructor.
8454 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8455 any.
8456
8457 2011-01-10 Ian Lance Taylor <iant@google.com>
8458
8459 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8460 section as relro.
8461 (Layout::set_segment_offsets): Reset increase_relro before calling
8462 set_section_addresses a second time.
8463
8464 2011-01-04 Cary Coutant <ccoutant@google.com>
8465
8466 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8467 sections before NOBITS sections.
8468
8469 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8470
8471 * version.cc (print_version): Update copyright to 2011.
8472
8473 2010-12-23 Cary Coutant <ccoutant@google.com>
8474
8475 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8476 of OS to this->add. Add OD parameter to second form of the function.
8477
8478 2010-12-20 Ian Lance Taylor <iant@google.com>
8479
8480 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8481 second of two consecutive entries with same offset.
8482
8483 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8484
8485 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8486 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8487 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8488 to avoid unneeded links against $(LDADD).
8489 * testsuite/Makefile.in: Regenerate.
8490
8491 2010-12-15 Ian Lance Taylor <iant@google.com>
8492
8493 PR gold/12324
8494 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8495 for R_X86_64_32 and R_X86_64_PC32.
8496 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8497 ver_matching_def_pic.o.
8498 (ver_matching_def_pic.o): New target.
8499
8500 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8501
8502 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8503 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8504 Move definition before File_read::View member definitions.
8505 (File_read::View::~View): Initialize and hold lock before
8506 updating current_mapped_bytes.
8507
8508 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8509
8510 * dwarf_reader.cc: Remove outdated comment.
8511 * gold-threads.cc: Fix typo in error message.
8512 * archive.cc: Fix typos in comments.
8513 * archive.h: Likewise.
8514 * arm-reloc-property.cc: Likewise.
8515 * arm-reloc-property.h: Likewise.
8516 * arm-reloc.def: Likewise.
8517 * arm.cc: Likewise.
8518 * attributes.h: Likewise.
8519 * cref.cc: Likewise.
8520 * ehframe.cc: Likewise.
8521 * fileread.h: Likewise.
8522 * gold.h: Likewise.
8523 * i386.cc: Likewise.
8524 * icf.cc: Likewise.
8525 * incremental.h: Likewise.
8526 * int_encoding.cc: Likewise.
8527 * layout.h: Likewise.
8528 * main.cc: Likewise.
8529 * merge.h: Likewise.
8530 * object.cc: Likewise.
8531 * object.h: Likewise.
8532 * options.cc: Likewise.
8533 * readsyms.cc: Likewise.
8534 * reduced_debug_output.cc: Likewise.
8535 * reloc.cc: Likewise.
8536 * script-sections.cc: Likewise.
8537 * sparc.cc: Likewise.
8538 * symtab.h: Likewise.
8539 * target-reloc.h: Likewise.
8540 * target.cc: Likewise.
8541 * target.h: Likewise.
8542 * timer.cc: Likewise.
8543 * timer.h: Likewise.
8544 * x86_64.cc: Likewise.
8545
8546 2010-12-09 Cary Coutant <ccoutant@google.com>
8547
8548 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8549 stack.
8550 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8551 parameter; change all callers.
8552 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8553 * options.h (warn_execstack): New option.
8554
8555 2010-12-07 Doug Kwan <dougkwan@google.com>
8556
8557 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8558 like function call relocations.
8559
8560 2010-12-07 Ian Lance Taylor <iant@google.com>
8561
8562 * archive.cc (Archive::get_elf_object_for_member): Permit
8563 punconfigured to be NULL.
8564 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8565 (Archive::include_member): Pass NULL to get_elf_object_for_member
8566 if we searched for the archive and this is the first included
8567 object.
8568
8569 2010-12-01 Ian Lance Taylor <iant@google.com>
8570
8571 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8572 track_relocs_type_ field.
8573 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8574 Set track_relocs_type_.
8575 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8576 contents when using RELA relocs.
8577 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8578 reloc_map_.
8579 * reloc.cc (Track_relocs::next_addend): New function.
8580 * reloc.h (class Track_relocs): Declare next_addend.
8581
8582 2010-12-01 Ian Lance Taylor <iant@google.com>
8583
8584 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8585 virtual destructor.
8586
8587 2010-12-01 Ian Lance Taylor <iant@google.com>
8588
8589 * README: Update compilers known to work and fail.
8590
8591 2010-11-23 Matthias Klose <doko@ubuntu.com>
8592
8593 * configure.in: For --enable-gold, handle value `default' instead of
8594 `both*'. Always install ld as ld.bfd, install as ld if gold is
8595 not the default.
8596 * configure: Regenerate.
8597
8598 2010-11-18 Doug Kwan <dougkwan@google.com>
8599
8600 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8601 and right_alignment to be zero. Store result alignment only if it is
8602 greater than existing alignment.
8603
8604 2010-11-16 Cary Coutant <ccoutant@google.com>
8605
8606 PR gold/12220
8607 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8608 Check for ".zdebug_line".
8609
8610 2010-11-16 Doug Kwan <dougkwan@google.com>
8611 Cary Coutant <ccoutant@google.com>
8612
8613 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8614 by reference; adjust all callers.
8615 * output.cc (Output_segment::set_section_addresses): Adjust references
8616 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8617 list is empty.
8618 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8619 end at page boundary.
8620
8621 2010-11-16 Cary Coutant <ccoutant@google.com>
8622
8623 PR gold/12220
8624 * layout.cc (Layout::choose_output_section): Transform names of
8625 compressed sections even when using a script with a SECTIONS clause.
8626 (Layout::output_section_name): Remove code to transform
8627 compressed debug section names.
8628 * output.cc (Output_section::add_input_section): Use uncompressed
8629 section size when tracking input sections.
8630
8631 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8632
8633 * symtab.h (Symbol::NON_PIC_REF): Remove.
8634 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8635 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8636 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8637 (Symbol::use_plt_offset): Take a flags argument and pass it
8638 directly to needs_dynamic_reloc. Restrict check for undefined
8639 weak symbols to function calls.
8640 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8641 (Target_arm::Scan::global): Use it.
8642 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8643 (Target_arm::Relocate::relocate): Likewise.
8644 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8645 parameter with an r_type parameter. Use get_reference_flags
8646 to get the flags.
8647 (Target_arm::Relocate::relocate): Update accordingly.
8648 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8649 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8650 (Target_i386::Scan::global): Likewise.
8651 (Target_i386::Relocate::relocate): Likewise.
8652 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8653 parameter with an r_type parameter. Use get_reference_flags
8654 to get the flags.
8655 (Target_i386::Relocate::relocate): Update accordingly.
8656 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8657 (Target_powerpc::Scan::global): Use it.
8658 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8659 (Target_powerpc::Relocate::relocate): Likewise.
8660 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8661 (Target_sparc::Scan::global): Use it.
8662 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8663 (Target_sparc::Relocate::relocate): Likewise.
8664 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8665 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8666 (Target_x86_64::Scan::global): Likewise.
8667 (Target_x86_64::Relocate::relocate): Likewise.
8668
8669 2010-11-08 Doug Kwan <dougkwan@google.com>
8670 Cary Coutant <ccoutant@google.com>
8671
8672 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8673 (Arm_exidx_merge_section::section_contents_): New data member.
8674 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8675 (Arm_input_section::~Arm_input_section): De-allocate memory.
8676 (Arm_input_section::original_contents_): New data member.
8677 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8678 in parameters instead of calling Object::section_contents without
8679 locking.
8680 (Arm_output_section::group_section): New parameter TASK. Pass it
8681 to callees that need locking objects.
8682 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8683 to lock EXIDX input sections. Fix a formatting issue. Call
8684 Arm_exidx_merged_section::build_contents to create merged section
8685 contents.
8686 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8687 to lock object of stub table owner.
8688 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8689 TEXT_SIZE to initialize data member TEXT_SIZE_.
8690 (Arm_exidx_input_section::addralign): Fix typo in comment.
8691 (Arm_exidx_input_section::text_size): New method.
8692 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8693 that require locking objects. Lock objects before scanning for stubs
8694 and updating local symbols.
8695 (Arm_input_section<big_endian>::init): Copy contents of original
8696 input section.
8697 (Arm_input_section<big_endian>::do_write): Use saved contents of
8698 original input section instead of calling Object::section_contents
8699 without locking.
8700 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8701 size without calling Object::section_size().
8702 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8703 for size. Allocate a buffer for merged EXIDX entries.
8704 (Arm_exidx_merged_section::build_contents): New method.
8705 (Arm_exidx_merged_section::do_write): Move merge section contents
8706 building code to Arm_exidx_merged_section::build_contetns. Write
8707 out contetns in buffer instead of building it on the fly.
8708 (Arm_relobj::make_exidx_input_section): Also pass text section size
8709 to Arm_exidx_input_section constructor.
8710 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8711 (Arm_dynobj::do_read_symbols): Fix memory leak.
8712 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8713 * target.h: (class Task): Add forward declaration.
8714 (Target::relax): Add new parameter TASK and pass it to
8715 Target::do_relax().
8716 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8717
8718 2010-11-05 Cary Coutant <ccoutant@google.com>
8719
8720 PR gold/10708
8721 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8722 object when reading from the file.
8723 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8724 second layout pass.
8725 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8726 when reading section contents.
8727 (get_section_contents): Likewise.
8728 (icf::find_identical_sections): Likewise.
8729 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8730 object when reading from the file.
8731 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8732 the object when doing deferred section layout.
8733
8734 2010-11-03 Nick Clifton <nickc@redhat.com>
8735
8736 PR gold/12001
8737 * script.h (class Symbol_assignment: name): New member. Returns
8738 the name of the symbol.
8739 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8740 Returns true if the given symbol name is on the list of
8741 assignments wating to be processed.
8742 * archive.cc (should_incldue_member): If the symbol is undefined,
8743 check to see if it is on the list of symbols pending assignment.
8744
8745 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8746
8747 * script-sections.cc (Script_sections::find_memory_region): Check
8748 for a NULL output section pointer.
8749
8750 2010-10-29 Doug Kwan <dougkwan@google.com>
8751
8752 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8753 Output_section::add_relaxed_input_section.
8754 * output.cc (Output_section::add_relaxed_input_section): Add new
8755 arguments LAYOUT and NAME. Set section order index.
8756 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8757 Copy section order index.
8758 * output.h (Output_section::add_relaxed_input_section): Add new
8759 arguments LAYOUT and NAME.
8760
8761 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8762
8763 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8764 NATIVE_OR_CROSS_LINKER.
8765 * testsuite/Makefile.in: Regenerate.
8766
8767 2010-10-20 Doug Kwan <dougkwan@google.com>
8768
8769 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8770 without SHF_LINK_ORDER flags.
8771 * layout.cc (Layout::choose_output_section): Do not filter
8772 SHF_LINK_ORDER flag in a relocatable link.
8773
8774 2010-10-17 Cary Coutant <ccoutant@google.com>
8775
8776 * output.h (Output_segment::set_section_addresses): Change function
8777 signature. Update all callers.
8778 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8779 sections.
8780 (Output_segment::set_section_addresses): Align after last TLS
8781 section. Add padding before last relro section instead of after.
8782
8783 2010-10-17 Doug Kwan <dougkwan@google.com>
8784
8785 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8786 GOT output section to be writable.
8787
8788 2010-10-14 Cary Coutant <ccoutant@google.com>
8789
8790 * debug.h (DEBUG_INCREMENTAL): New flag.
8791 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8792 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8793 mode.
8794 * incremental.cc (report_command_line): Ignore all forms of
8795 --incremental.
8796 * layout.cc (Layout::Layout): Check parameters for incremental link
8797 mode.
8798 * options.cc (General_options::parse_incremental): New function.
8799 (General_options::parse_no_incremental): New function.
8800 (General_options::parse_incremental_full): New function.
8801 (General_options::parse_incremental_update): New function.
8802 (General_options::incremental_mode_): New data member.
8803 (General_options::finalize): Check incremental_mode_.
8804 * options.h (General_options): Update help text for --incremental.
8805 Add --no-incremental, --incremental-full, --incremental-update.
8806 (General_options::Incremental_mode): New enum type.
8807 (General_options::incremental_mode): New function.
8808 (General_options::incremental_mode_): New data member.
8809 * parameters.cc (Parameters::incremental_mode_): New data member.
8810 (Parameters::set_options): Set incremental_mode_.
8811 (Parameters::set_incremental_full): New function.
8812 (Parameters::incremental): New function.
8813 (Parameters::incremental_update): New function.
8814 (set_parameters_incremental_full): New function.
8815 * parameters.h (Parameters::set_incremental_full): New function.
8816 (Parameters::incremental): New function.
8817 (Parameters::incremental_update): New function.
8818 (Parameters::incremental_mode_): New data member.
8819 (set_parameters_incremental_full): New function.
8820 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8821 incremental link mode.
8822 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8823 (Sized_relobj::do_relocate_sections): Likewise.
8824 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8825 option.
8826 * testsuite/Makefile.in: Regenerate.
8827 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8828
8829 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8830
8831 * script-sections.h (class Script_sections): Make
8832 Sections_elements typedef public.
8833 * script-sections.cc (class Sort_output_sections): Add elements_
8834 field. Add constructor which sets it; change all callers.
8835 (Sort_output_sections::is_before): New function.
8836 (Sort_output_sections::operator()): Call is_before.
8837 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8838 conditional.
8839 * testsuite/script_test_10.sh: New test. Test script section
8840 order.
8841 * testsuite/script_test_10.t: Likewise.
8842 * testsuite/script_test_10.s: Likewise.
8843 * testsuite/Makefile.am: Wrap the cross linker tests and the
8844 common tests into NATIVE_OR_CROSS_LINKER.
8845 (check_SCRIPTS): Add script_test_10.sh.
8846 (check_DATA): Add script_test_10.stdout.
8847 (script_test_10.o, script_test_10): New targets.
8848 (script_test_10.stdout): New target.
8849 * configure, testsuite/Makefile.in: Regenerate.
8850
8851 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8852
8853 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8854 error for the deprecated relocations.
8855 (Target_arm::Scan::global): Likewise.
8856 (Target_arm::Relocate::relocate): Likewise.
8857
8858 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8859
8860 * fileread.cc (Input_file::find_file): Initialize *found_name
8861 and *namep when using the fallback search for case 4.
8862
8863 2010-10-11 Cary Coutant <ccoutant@google.com>
8864
8865 * options.h (class General_options): Redefine -z lazy as an alias for
8866 the negation of -z now.
8867
8868 2010-10-11 Ian Lance Taylor <iant@google.com>
8869
8870 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8871 binding.
8872
8873 2010-10-06 Nick Clifton <nickc@redhat.com>
8874
8875 * script-sections.cc(class Memory_region): Remove
8876 current_lma_offset_ field. Rename current_vma_offset_ to
8877 current_offset_. Add last_section_ field.
8878 (Memory_region::get_current_vma_address): Rename to
8879 get_current_address.
8880 (Memory_region::get_current_lma_address): Delete.
8881 (Memory_region::increment_vma_offset): Rename to
8882 increment_offset.
8883 (Memory_region::increment_lma_offset): Delete.
8884 (Memory_region::attributes_compatible): New method. Returns
8885 true if the provided section is compatible with the region.
8886 (Memory_region::get_last_section): New method. Returns the last
8887 section to use the region.
8888 (Memory_region::set_last_section): New method. Stores the last
8889 section to use the region.
8890 (Script_sections::block_in_region): New method. Returns true if
8891 a block of memory is contained within a region.
8892 (Script_sections::find_memory_region): New method. Locates a
8893 memory region to be used to set a VMA or LMA address.
8894 (Output_section_definition::set_section_addresses): Add code to
8895 check for addresses set by memory regions.
8896 (Output_segment::set_section_addresses): Remove memory region
8897 walking code.
8898 (Script_sections::create_segment): Add a warning if a header
8899 segment is created outside of any region.
8900 * script-sections.h (class Script_sections): Add prototypes for
8901 find_memory_region and block_in_region methods.
8902 * testsuite/memory_test.s: Use .long instead of .word.
8903 * testsuite/memory_test.t: Add some more output sections.
8904 * testsuite/memory_test.sh: Update expected output.
8905
8906 2010-10-02 Doug Kwan <dougkwan@google.com>
8907
8908 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8909 defintion to symtab.h
8910 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8911 declaration to defintion.
8912
8913 2010-10-01 Nick Clifton <nickc@redhat.com>
8914
8915 * expression.cc (eval): Replace dummy argument with NULL.
8916 (eval_maybe_dot): Check for a NULL result section pointer.
8917 (Symbol_expression::value): Likewise.
8918 (Dot_expression::value): Likewise.
8919 (BINARY_EXPRESSION): Likewise.
8920 (Max_expression::value): Likewise.
8921 (Min_expression::value): Likewise.
8922 (Absolute_expression::value): Likewise.
8923 (Addr_expression::value_from_output_section): Likewise.
8924 (Loaddddr_expression::value_from_output_section): Likewise.
8925 (Segment_start_expression::value): Likewise.
8926 * script-sections.cc
8927 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8928 argument with NULL.
8929 (Sections_elememt_dot_assignment::set_section_addresses):
8930 Likewise.
8931 (Output_data_expression::do_write_to_buffer): Likewise.
8932 (Output_section_definition::finalize_symbols): Likewise.
8933 (Output_section_definition::set_section_addresses): Likewise.
8934
8935 2010-09-30 Doug Kwan <dougkwan@google.com>
8936
8937 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8938
8939 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8940
8941 * target.h (Target::can_icf_inline_merge_sections): New virtual
8942 function.
8943 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8944 virtual function.
8945 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8946 virtual function.
8947 * icf.cc (get_section_contents): Inline merge sections only when
8948 target allows it.
8949
8950 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8951
8952 * configure: Regenerate.
8953
8954 2010-09-17 Ian Lance Taylor <iant@google.com>
8955
8956 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8957 * testsuite/Makefile.am (memory_test.o): New target.
8958 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8959 memory_test.t.
8960 * testsuite/Makefile.in: Rebuild.
8961
8962 2010-09-17 Doug Kwan <dougkwan@google.com>
8963
8964 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8965 defintion if relocation uses GOT entries of the symbol.
8966 * testsuite/icf_safe_test.sh: Fix test.
8967 * testsuite/icf_safe_so_test.sh: Fix test.
8968
8969 2010-09-16 Cary Coutant <ccoutant@google.com>
8970
8971 * script_sections.cc (class Memory_region): Remove "NULL" from
8972 vector initializations.
8973
8974 2010-09-15 Cary Coutant <ccoutant@google.com>
8975
8976 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8977 Resolve forwarding symbols.
8978
8979 2010-09-15 Doug Kwan <dougkwan@google.com>
8980
8981 * gold/testsuite/script_test_3.t: Add ARM special sections.
8982 * gold/testsuite/script_test_4.t: Same.
8983 * gold/testsuite/script_test_5.t: Same.
8984 * gold/testsuite/script_test_6.t: Same.
8985 * gold/testsuite/script_test_7.t: Same.
8986 * gold/testsuite/script_test_7.t: Same.
8987 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8988
8989 2010-09-14 Cary Coutant <ccoutant@google.com>
8990
8991 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8992 (Target_x86_64::Relocate::relocate_tls): Replace check for
8993 saw_tls_block_reloc_ with test for executable section.
8994
8995 2010-09-12 Cary Coutant <ccoutant@google.com>
8996
8997 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8998 position-independent executables to shared libraries need dynamic
8999 relocations.
9000 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
9001 position-independent executables.
9002 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
9003 * testsuite/Makefile.in: Regenerate.
9004
9005 2010-09-10 Nick Clifton <nickc@redhat.com>
9006
9007 PR gold/11997
9008 * testsuite/memory_test.t: Discard any sections that are not
9009 needed.
9010
9011 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
9012
9013 PR gold/11996
9014 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
9015 "This::" to work around a bug in gcc 4.2.
9016
9017 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
9018
9019 2010-09-09 Rafael Espindola <espindola@google.com>
9020
9021 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
9022 sections with different PF_X flags in the same segment.
9023 (Layout::find_first_load_seg): Search all segments to find the first
9024 one.
9025 * options.h (rosegment): New.
9026
9027 2010-09-08 Rafael Espindola <espindola@google.com>
9028
9029 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
9030
9031 2010-09-08 Doug Kwan <dougkwan@google.com>
9032
9033 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
9034 (Arm_relobj::do_relocate_sections): Add new parameter for output
9035 file to match the parent.
9036 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
9037 of local symbols instead of input values. Update code to track
9038 changes in gold::relocate_section.
9039 * object.cc (Sized_relobj::compute_final_local_value): New methods.
9040 (Sized_relobj::compute_final_local_value_internal): New methods.
9041 (Sized_relobj::do_finalize_local_symbols): Move code from loop
9042 body into private version of Sized_relobj::compute_final_local_value.
9043 Call the inline method.
9044 * object.h (Symbol_value::Symbol_value): Define destructor. Free
9045 merged symbol value if there is one.
9046 (Symbol_value::has_output_value): New method defintiion.
9047 (Sized_relobj::Compute_final_local_value_status): New enum type.
9048 (Sized_relobj::compute_final_local_value): New methods.
9049 (Sized_relobj::compute_final_local_value_internal): New methods.
9050 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
9051 and arm_cortex_a8.sh.
9052 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
9053 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
9054 New tests.
9055 * Makefile.in: Regenerate.
9056 * testsuite/arm_bl_out_of_range.s: Update test.
9057 * testsuite/thumb_bl_out_of_range.s: Ditto.
9058 * testsuite/thumb_blx_out_of_range.s: Ditto.
9059 * testsuite/arm_branch_out_of_range.sh: New file.
9060 * testsuite/arm_cortex_a8.sh: Ditto.
9061 * testsuite/arm_cortex_a8_b.s: Ditto.
9062 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9063 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9064 * testsuite/arm_cortex_a8_bl.s: Ditto.
9065 * testsuite/arm_cortex_a8_blx.s: Ditto.
9066 * testsuite/arm_cortex_a8_local.s: Ditto.
9067 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9068 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9069
9070 2010-09-08 Rafael Espindola <espindola@google.com>
9071
9072 * Makefile.am (memory_test.stdout): Run readelf with -W.
9073 * Makefile.in: Regenerate.
9074 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9075 64 bit output.
9076
9077 2010-09-08 Rafael Espindola <espindola@google.com>
9078
9079 * script-sections.cc (Script_sections::add_memory_region): Convert
9080 field precision to int.
9081 * script.cc (script_set_section_region, script_set_section_region):
9082 Convert field precision to int.
9083
9084 2010-09-08 Rafael Espindola <espindola@google.com>
9085
9086 * arm.cc (do_finalize_sections): Create the __exidx_start and
9087 __exdix_end symbols even when the section is missing.
9088
9089 2010-09-08 Nick Clifton <nickc@redhat.com>
9090
9091 * README: Remove claim that MEMORY is not supported.
9092 * expression.cc (script_exp_function_origin)
9093 (script_exp_function_length): Move from here to ...
9094 * script.cc: ... here.
9095 (script_set_section_region, script_add_memory)
9096 (script_parse_memory_attr, script_include_directive): New
9097 functions.
9098 * script-sections.cc
9099 (class Memory_region): New class.
9100 (class Output_section_definition): Add set_memory_region,
9101 set_section_vma, set_section_lma and get_section_name methods.
9102 (class Script_Sections): Add add_memory_region,
9103 find_memory_region, find_memory_region_origin,
9104 find_memory_region_length and set_memory_region methods.
9105 Have set_section_addresses method walk the list of set memory
9106 regions.
9107 Extend the print methos to display memory regions.
9108 * script-sections.h: Add prototypes for new methods.
9109 Add enum for MEMORY region attributes.
9110 * yyscript.y: Add support for parsing MEMORY regions.
9111 * script-c.h: Add prototypes for new functions.
9112 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9113 * testsuite/Makefile.in: Regenerate.
9114 * testsuite/memory_test.sh: New script.
9115 * testsuite/memory_test.s: New assembler source file.
9116 * testsuite/memory_test.t: New linker script.
9117
9118 2010-08-27 Doug Kwan <dougkwan@google.com>
9119
9120 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9121 reference override an existing dynamic weak reference.
9122 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9123 * testsuite/Makefile.in: Regenerate.
9124 * testsuite/dyn_weak_ref.sh: New file.
9125 * testsuite/dyn_weak_ref_1.c: Ditto.
9126 * testsuite/dyn_weak_ref_2.c: Ditto.
9127
9128 2010-08-27 Ian Lance Taylor <iant@google.com>
9129
9130 * incremental.h (class Incremental_input_entry): Add virtual
9131 destructor.
9132
9133 2010-08-27 Ian Lance Taylor <iant@google.com>
9134
9135 * testsuite/start_lib_test_3.c: Mark t3 as used.
9136
9137 2010-08-27 Nick Clifton <nickc@redhat.com>
9138
9139 * options.cc (version_script): Fix small typo in previous
9140 whitespace tidyup.
9141
9142 2010-08-25 Nick Clifton <nickc@redhat.com>
9143
9144 * archive.cc: Formatting fixes: Remove whitespace between
9145 typename and following asterisk. Remove whitespace between
9146 function name and opening parenthesis.
9147 * archive.h: Likewise.
9148 * arm.cc: Likewise.
9149 * attributes.cc: Likewise.
9150 * attributes.h: Likewise.
9151 * common.cc: Likewise.
9152 * copy-relocs.cc: Likewise.
9153 * dirsearch.h: Likewise.
9154 * dynobj.cc: Likewise.
9155 * ehframe.cc: Likewise.
9156 * ehframe.h: Likewise.
9157 * expression.cc: Likewise.
9158 * fileread.cc: Likewise.
9159 * fileread.h: Likewise.
9160 * gc.h: Likewise.
9161 * gold-threads.cc: Likewise.
9162 * gold.cc: Likewise.
9163 * i386.cc: Likewise.
9164 * icf.h: Likewise.
9165 * incremental-dump.cc: Likewise.
9166 * incremental.cc: Likewise.
9167 * layout.cc: Likewise.
9168 * layout.h: Likewise.
9169 * main.cc: Likewise.
9170 * merge.cc: Likewise.
9171 * merge.h: Likewise.
9172 * object.cc: Likewise.
9173 * object.h: Likewise.
9174 * options.cc: Likewise.
9175 * options.h: Likewise.
9176 * output.cc: Likewise.
9177 * output.h: Likewise.
9178 * plugin.cc: Likewise.
9179 * plugin.h: Likewise.
9180 * powerpc.cc: Likewise.
9181 * reloc.cc: Likewise.
9182 * script-c.h: Likewise.
9183 * script-sections.cc: Likewise.
9184 * script.cc: Likewise.
9185 * stringpool.cc: Likewise.
9186 * symtab.cc: Likewise.
9187 * symtab.h: Likewise.
9188 * target.cc: Likewise.
9189 * timer.cc: Likewise.
9190 * timer.h: Likewise.
9191 * version.cc: Likewise.
9192 * x86_64.cc: Likewise.
9193
9194 2010-08-24 Nick Clifton <nickc@redhat.com>
9195
9196 PR 11899
9197 * layout.cc (segment_precedes): Sort segments by their physical
9198 addresses, if they have been set.
9199
9200 2010-08-23 Cary Coutant <ccoutant@google.com>
9201
9202 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9203 symbols data.
9204 (Lib_group::include_member): Unlock object after deleting its
9205 symbols data.
9206 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9207 the bug fixed here.
9208
9209 2010-08-19 Neil Vachharajani <nvachhar@google.com>
9210 Cary Coutant <ccoutant@google.com>
9211
9212 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9213 constructor, and set_blocker.
9214 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9215 readsyms_blocker_.
9216 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9217 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9218 * testsuite/Makefile.am (start_lib_test): New test case.
9219 * testsuite/Makefile.in: Regenerate.
9220 * testsuite/start_lib_test_main.c: New file.
9221 * testsuite/start_lib_test_1.c: New file.
9222 * testsuite/start_lib_test_2.c: New file.
9223 * testsuite/start_lib_test_3.c: New file.
9224
9225 2010-08-19 Ian Lance Taylor <iant@google.com>
9226
9227 * Makefile.in: Rebuild with automake 1.11.1.
9228 * aclocal.m4: Likewise.
9229 * testsuite/Makefile.in: Likewise.
9230
9231 2010-08-19 Ian Lance Taylor <iant@google.com>
9232
9233 PR 10893
9234 * i386.cc (class Output_data_plt_i386): Update declarations.
9235 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9236 local_ifuncs_ fields.
9237 (Target_i386::do_plt_section_for_global): New function.
9238 (Target_i386::do_plt_section_for_local): New function.
9239 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9240 parameter; change all callers. Initialize global_ifuncs_ and
9241 local_ifuncs_. If doing a static link define __rel_iplt_start and
9242 __rel_iplt_end.
9243 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9244 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9245 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9246 symbols.
9247 (Target_i386::make_plt_section): New function, broken out of
9248 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9249 (Target_i386::make_plt_entry): Call make_plt_section.
9250 (Target_i386::make_local_ifunc_plt_entry): New function.
9251 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9252 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9253 R_386_IRELATIVE to switch.
9254 (Target_i386::Scan::global): Likewise.
9255 (Target_i386::Relocate::relocate): Likewise.
9256 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9257 switch.
9258 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9259 (Target_x86_64::do_plt_section_for_global): New function.
9260 (Target_x86_64::do_plt_section_for_local): New function.
9261 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9262 parameter; change all callers. If doing a static link define
9263 __rela_iplt_start and __rela_iplt_end.
9264 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9265 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9266 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9267 to point to .plt.
9268 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9269 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9270 switch.
9271 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9272 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9273 R_X86_64_IRELATIVE to switch.
9274 (Target_x86_64::Scan::global): Likewise.
9275 (Target_x86_64::Relocate::relocate): Likewise.
9276 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9277 switch.
9278 * target.h (class Target): Add plt_section_for_global and
9279 plt_section_for_local functions. Add do_plt_section_for_global
9280 and do_plt_section_for_local virtual functions.
9281 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9282 clarifying comments.
9283 (Symbol::use_plt_offset): Handle IFUNC symbol.
9284 * object.cc (Sized_relobj::Sized_relobj): Initialize
9285 local_plt_offsets_.
9286 (Sized_relobj::local_has_plt_offset): New function.
9287 (Sized_relobj::local_plt_offset): New function.
9288 (Sized_relobj::set_local_plt_offset): New function.
9289 (Sized_relobj::do_count): Handle IFUNC symbol.
9290 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9291 a bit away from input_shndx_ field. Add set_is_func_symbol and
9292 is_ifunc_symbol functions.
9293 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9294 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9295 local_plt_offsets_ field.
9296 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9297 * output.h (class Output_section_data): Add non-const
9298 output_section function.
9299 (class Output_data_got): Update declarations.
9300 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9301 Add use_plt_offset parameter to global and local constructors.
9302 Change all callers. Change local_sym_index_ field to 31 bits.
9303 Change GSYM_CODE and CONSTANT_CODE accordingly.
9304 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9305 doing a static link don't set sh_link field.
9306 (Output_data_got::Got_entry::write): Use PLT offset if
9307 appropriate.
9308 (Output_data_got::add_global_plt): New function.
9309 (Output_data_got::add_local_plt): New function.
9310 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9311 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9312 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9313 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9314 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9315 IFUNC conditional.
9316 * testsuite/ifunc-sel.h: New file.
9317 * testsuite/ifuncmain1.c: New file.
9318 * testsuite/ifuncmain1vis.c: New file.
9319 * testsuite/ifuncmod1.c: New file.
9320 * testsuite/ifuncdep2.c: New file.
9321 * testsuite/ifuncmain2.c: New file.
9322 * testsuite/ifuncmain3.c: New file.
9323 * testsuite/ifuncmod3.c: New file.
9324 * testsuite/ifuncmain4.c: New file.
9325 * testsuite/ifuncmain5.c: New file.
9326 * testsuite/ifuncmod5.c: New file.
9327 * testsuite/ifuncmain6pie.c: New file.
9328 * testsuite/ifuncmod6.c: New file.
9329 * testsuite/ifuncmain7.c: New file.
9330 * configure, testsuite/Makefile.in: Rebuild.
9331
9332 2010-08-18 Ian Lance Taylor <iant@google.com>
9333
9334 * incremental.cc
9335 (Output_section_incremental_inputs::write_input_files): Add cast
9336 to avoid signed/unsigned comparison warning.
9337 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9338
9339 2010-08-12 Cary Coutant <ccoutant@google.com>
9340
9341 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9342
9343 2010-08-13 Ian Lance Taylor <iant@google.com>
9344
9345 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9346
9347 2010-08-12 Cary Coutant <ccoutant@google.com>
9348 Doug Kwan <dougkwan@google.com>
9349
9350 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9351 defintion overrides non-weak undef, remember that the original undef
9352 is not weak.
9353 * symtab.cc (Symbol_table::sized_write_global): For undef without
9354 an original weak binding, set binding to global in output.
9355 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9356 * testsuite/Makefile.in: Regenerate.
9357 * testsuite/strong_ref_weak_def.sh: New file.
9358 * testsuite/strong_ref_weak_def_1.c: Ditto.
9359 * testsuite/strong_ref_weak_def_2.c: Ditto.
9360
9361 2010-08-12 Cary Coutant <ccoutant@google.com>
9362
9363 * testsuite/incremental_test.sh: Rewrite.
9364 * testsuite/incremental_test_1.c: Rewrite.
9365 * testsuite/incremental_test_2.c: Rewrite.
9366
9367 2010-08-12 Cary Coutant <ccoutant@google.com>
9368
9369 * arm.cc (Target_arm::got_size): Add const.
9370 (Target_arm::got_entry_count): New function.
9371 (Target_arm::plt_entry_count): New function.
9372 (Target_arm::first_plt_entry_offset): New function.
9373 (Target_arm::plt_entry_size): New function.
9374 (Output_data_plt_arm::entry_count): New function.
9375 (Output_data_plt_arm::first_plt_entry_offset): New function.
9376 (Output_data_plt_arm::get_plt_entry_size): New function.
9377 * i386.cc (Target_i386::got_size): Add const.
9378 (Target_i386::got_entry_count): New function.
9379 (Target_i386::plt_entry_count): New function.
9380 (Target_i386::first_plt_entry_offset): New function.
9381 (Target_i386::plt_entry_size): New function.
9382 (Output_data_plt_i386::entry_count): New function.
9383 (Output_data_plt_i386::first_plt_entry_offset): New function.
9384 (Output_data_plt_i386::get_plt_entry_size): New function.
9385 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9386 find_incremental_inputs_sections. Dump incremental_got_plt section.
9387 * incremental.cc: Include target.h.
9388 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9389 parameter. Adjust all callers. Find incremental_got_plt section.
9390 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9391 section.
9392 (Output_section_incremental_inputs::set_final_data_size): Calculate
9393 size of incremental_got_plt section.
9394 (Output_section_incremental_inputs::do_write): Write the
9395 incremental_got_plt section.
9396 (Got_plt_view_info): New struct.
9397 (Local_got_offset_visitor): New class.
9398 (Global_got_offset_visitor): New class.
9399 (Global_symbol_visitor_got_plt): New class.
9400 (Output_section_incremental_inputs::write_got_plt): New function.
9401 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9402 Add parameter. Adjust all callers.
9403 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9404 (Incremental_inputs::got_plt_section): New function.
9405 (Incremental_inputs::got_plt_section_): New data member.
9406 (Incremental_got_plt_reader): New class.
9407 * layout.cc (Layout::create_incremental_info_sections): Add the
9408 incremental_got_plt section.
9409 * object.h (Got_offset_list::get_list): New function.
9410 (Got offset_list::for_all_got_offsets): New function.
9411 (Sized_relobj::local_got_offset_list): New function.
9412 * powerpc.cc (Target_powerpc::got_size): Add const.
9413 (Target_powerpc::got_entry_count): New function.
9414 (Target_powerpc::plt_entry_count): New function.
9415 (Target_powerpc::first_plt_entry_offset): New function.
9416 (Target_powerpc::plt_entry_size): New function.
9417 (Output_data_plt_powerpc::entry_count): New function.
9418 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9419 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9420 * sparc.cc (Target_sparc::got_size): Add const.
9421 (Target_sparc::got_entry_count): New function.
9422 (Target_sparc::plt_entry_count): New function.
9423 (Target_sparc::first_plt_entry_offset): New function.
9424 (Target_sparc::plt_entry_size): New function.
9425 (Output_data_plt_sparc::entry_count): New function.
9426 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9427 (Output_data_plt_sparc::get_plt_entry_size): New function.
9428 * symtab.h (Symbol::got_offset_list): New function.
9429 (Symbol_table::for_all_symbols): New function.
9430 * target.h (Sized_target::got_entry_count): New function.
9431 (Sized_target::plt_entry_count): New function.
9432 (Sized_target::plt_entry_size): New function.
9433 * x86_64.cc (Target_x86_64::got_size): Add const.
9434 (Target_x86_64::got_entry_count): New function.
9435 (Target_x86_64::plt_entry_count): New function.
9436 (Target_x86_64::first_plt_entry_offset): New function.
9437 (Target_x86_64::plt_entry_size): New function.
9438 (Output_data_plt_x86_64::entry_count): New function.
9439 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9440 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9441
9442 2010-08-12 Cary Coutant <ccoutant@google.com>
9443
9444 * archive.cc: Include incremental.h.
9445 (Archive::Archive): Initialize incremental_info_.
9446 (Archive::include_member): Record archive members in incremental info.
9447 (Add_archive_symbols::run): Record begin and end of an archive in
9448 incremental info.
9449 (Lib_group::include_member): Record objects in incremental info.
9450 * archive.h (Incremental_archive_entry): Forward declaration.
9451 (Archive::set_incremental_info): New member function.
9452 (Archive::incremental_info): New member function.
9453 (Archive::Unused_symbol_iterator): New class.
9454 (Archive::unused_symbols_begin): New member function.
9455 (Archive::unused_symbols_end): New member function.
9456 (Archive::incremental_info_): New data member.
9457 * incremental-dump.cc (find_input_containing_global): New function.
9458 (dump_incremental_inputs): Dump new incremental info sections.
9459 * incremental.cc: Include symtab.h.
9460 (Output_section_incremental_inputs): New class.
9461 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9462 new incremental info sections.
9463 (Sized_incremental_binary::do_check_inputs): Likewise.
9464 (Incremental_inputs::report_archive): Remove.
9465 (Incremental_inputs::report_archive_begin): New function.
9466 (Incremental_inputs::report_archive_end): New function.
9467 (Incremental_inputs::report_object): New function.
9468 (Incremental_inputs::finalize_inputs): Remove.
9469 (Incremental_inputs::report_input_section): New function.
9470 (Incremental_inputs::report_script): Rewrite.
9471 (Incremental_inputs::finalize): Do nothing but finalize string table.
9472 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9473 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9474 (Incremental_inputs::create_data_sections): New function.
9475 (Incremental_inputs::relocs_entsize): New function.
9476 (Output_section_incremental_inputs::set_final_data_size): New function.
9477 (Output_section_incremental_inputs::do_write): New function.
9478 (Output_section_incremental_inputs::write_header): New function.
9479 (Output_section_incremental_inputs::write_input_files): New function.
9480 (Output_section_incremental_inputs::write_info_blocks): New function.
9481 (Output_section_incremental_inputs::write_symtab): New function.
9482 * incremental.h (Incremental_script_entry): Forward declaration.
9483 (Incremental_object_entry): Forward declaration.
9484 (Incremental_archive_entry): Forward declaration.
9485 (Incremental_inputs): Forward declaration.
9486 (Incremental_inputs_header_data): Remove.
9487 (Incremental_inputs_header): Remove.
9488 (Incremental_inputs_header_write): Remove.
9489 (Incremental_inputs_entry_data): Remove.
9490 (Incremental_inputs_entry): Remove.
9491 (Incremental_inputs_entry_write): Remove.
9492 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9493 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9494 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9495 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9496 Likewise.
9497 (Incremental_input_entry): New class.
9498 (Incremental_script_entry): New class.
9499 (Incremental_object_entry): New class.
9500 (Incremental_archive_entry): New class.
9501 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9502 (Incremental_inputs::report_inputs): Remove.
9503 (Incremental_inputs::report_archive): Remove.
9504 (Incremental_inputs::report_archive_begin): New function.
9505 (Incremental_inputs::report_archive_end): New function.
9506 (Incremental_inputs::report_object): Change prototype.
9507 (Incremental_inputs::report_input_section): New function.
9508 (Incremental_inputs::report_script): Change prototype.
9509 (Incremental_inputs::get_reloc_count): New function.
9510 (Incremental_inputs::set_reloc_count): New function.
9511 (Incremental_inputs::create_data_sections): New function.
9512 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9513 (Incremental_inputs::inputs_section): New function.
9514 (Incremental_inputs::symtab_section): New function.
9515 (Incremental_inputs::relocs_section): New function.
9516 (Incremental_inputs::get_stringpool): Add const.
9517 (Incremental_inputs::command_line): Add const.
9518 (Incremental_inputs::inputs): Remove.
9519 (Incremental_inputs::command_line_key): New function.
9520 (Incremental_inputs::input_file_count): New function.
9521 (Incremental_inputs::input_files): New function.
9522 (Incremental_inputs::relocs_entsize): New function.
9523 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9524 (Incremental_inputs::finalize_inputs): Remove.
9525 (Incremental_inputs::Input_info): Remove.
9526 (Incremental_inputs::lock_): Remove.
9527 (Incremental_inputs::inputs_): Change type.
9528 (Incremental_inputs::inputs_map_): Remove.
9529 (Incremental_inputs::current_object_entry_): New data member.
9530 (Incremental_inputs::inputs_section_): New data member.
9531 (Incremental_inputs::symtab_section_): New data member.
9532 (Incremental_inputs::relocs_section_): New data member.
9533 (Incremental_inputs::reloc_count_): New data member.
9534 (Incremental_inputs_reader): New class.
9535 (Incremental_symtab_reader): New class.
9536 (Incremental_relocs_reader): New class.
9537 * layout.cc (Layout::finalize): Move finalization of incremental info
9538 and creation of incremental info sections to follow finalization of
9539 symbol table. Set offsets for postprocessing sections.
9540 (Layout::create_incremental_info_sections): Call
9541 Incremental_inputs::create_data_sections. Add incremental symtab
9542 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9543 sections to layout after input sections.
9544 * layout.h (struct Timespec): Forward declaration.
9545 (Layout::incremental_inputs): Add const.
9546 (Layout::create_incremental_info_sections): Add parameter.
9547 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9548 * object.cc: Include incremental.h.
9549 (Relobj::finalize_incremental_relocs): New function.
9550 (Sized_relobj::do_layout): Record input sections in incremental info.
9551 * object.h (Object::output_section): New function.
9552 (Object::output_section_offset): Moved from Relobj.
9553 (Object::get_incremental_reloc_base): New function.
9554 (Object::get_incremental_reloc_count): New function.
9555 (Object::do_output_section): New function.
9556 (Object::do_output_section_offset): Moved from Relobj.
9557 (Object::do_get_incremental_reloc_base): New function.
9558 (Object::do_get_incremental_reloc_count): New function.
9559 (Object::Object): Initialize new data members.
9560 (Relobj::output_section): Renamed do_output_section and moved to
9561 protected.
9562 (Relobj::output_section_offset): Moved to Object.
9563 (Relobj::do_get_incremental_reloc_base): New function.
9564 (Relobj::do_get_incremental_reloc_count): New function.
9565 (Relobj::allocate_incremental_reloc_counts): New function.
9566 (Relobj::count_incremental_reloc): New function.
9567 (Relobj::finalize_incremental_relocs): New function.
9568 (Relobj::next_incremental_reloc_index): New function.
9569 (Relobj::reloc_counts_): New data member.
9570 (Relobj::reloc_bases_): New data member.
9571 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9572 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9573 (Sized_relobj::incremental_relocs_scan): New function.
9574 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9575 (Sized_relobj::incremental_relocs_write): New function.
9576 (Sized_relobj::incremental_relocs_write_reltype): New function.
9577 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9578 incremental link.
9579 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9580 archives and object files elsewhere.
9581 (Add_symbols::run): Report object files here.
9582 (Finish_group::run): Report end of archive at end of group.
9583 * reloc.cc: Include layout.h, incremental.h.
9584 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9585 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9586 (Sized_relobj::incremental_relocs_scan): New function.
9587 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9588 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9589 (Sized_relobj::incremental_relocs_write): New function.
9590 (Sized_relobj::incremental_relocs_write_reltype): New function.
9591 * script.cc (read_input_script): Rewrite test for incremental link.
9592 Change call to Incremental_inputs::report_script.
9593 * symtab.h (Symbol_table::first_global_index): New function.
9594 (Symbol_table::output_count): New function.
9595
9596 2010-08-12 Doug Kwan <dougkwan@google.com>
9597
9598 * arm.cc (Target_arm::merge_object_attributes): Check command line
9599 options --no-wchar-size-warning and --no-enum-size-warning.
9600 * options.h (General_options): Add ld-compatible options
9601 --no-enum-size-warning and --no-wchar-size-warning.
9602
9603 2010-08-04 Ian Lance Taylor <iant@google.com>
9604
9605 * x86_64.cc (Target_x86_64::Scan::local): Use
9606 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9607 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9608 (Target_x86_64::Scan::global): Likewise.
9609 (Target_x86_64::Relocate::relocate): Likewise.
9610 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9611 Likewise.
9612
9613 2010-08-03 Cary Coutant <ccoutant@google.com>
9614
9615 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9616 to reserve space in merged_strings vector. Keep total input size
9617 for stats.
9618 (Output_merge_string::do_print_merge_stats): Print total input size.
9619 * merge.h (Output_merge_string): Add input_size_ field.
9620 * stringpool.cc (Stringpool_template::string_length): Move
9621 implementations out of Stringpool_template class and place in
9622 stringpool.h.
9623 * stringpool.h (string_length): Move out of Stringpool_template.
9624
9625 2010-08-03 Ian Lance Taylor <iant@google.com>
9626
9627 PR 11712
9628 * layout.cc (relaxation_loop_body): If address of load segment is
9629 set, adjust address to include headers if possible.
9630
9631 2010-08-03 Ian Lance Taylor <iant@google.com>
9632
9633 * version.cc (version_string): Bump to 1.10.
9634
9635 2010-08-03 Ian Lance Taylor <iant@google.com>
9636
9637 PR 11805
9638 * layout.h (enum Output_section_order): Define.
9639 (class Layout): Update declarations.
9640 * layout.cc (Layout::get_output_section): Add order parameter.
9641 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9642 is_first_non_relro parameters. Change all callers.
9643 (Layout::choose_output_section): Likewise.
9644 (Layout::add_output_section_data): Likewise.
9645 (Layout::make_output_section): Likewise. Set order.
9646 (Layout::default_section_order): New function.
9647 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9648 * output.cc (Output_section::Output_section): Initialize order_.
9649 Don't initialize deleted fields.
9650 (Output_segment::Output_segment): Don't initialize deleted
9651 fields.
9652 (Output_segment::add_output_section_to_load): New function
9653 replacing add_output_section. Change all callers to call this or
9654 add_output_section_to_nonload.
9655 (Output_segment::add_output_section_to_nonload): New function.
9656 (Output_segment::remove_output_section): Rewrite.
9657 (Output_segment::add_initial_output_data): Likewise.
9658 (Output_segment::has_any_data_sections): Likewise.
9659 (Output_segment::is_first_section_relro): Likewise.
9660 (Output_segment::maximum_alignment): Likewise.
9661 (Output_segment::has_dynamic_reloc): New function replacing
9662 dynamic_reloc_count. Change all callers.
9663 (Output_segment::has_dynamic_reloc_list): New function replacing
9664 dynamic_reloc_count_list. Change all callers.
9665 (Output_segment::set_section_addresses): Rewrite.
9666 (Output_segment::set_offset): Rewrite.
9667 (Output_segment::find_first_and_last_list): Remove.
9668 (Output_segment::set_tls_offsets): Rewrite.
9669 (Output_segment::first_section_load_address): Likewise.
9670 (Output_segment::output_section_count): Likewise.
9671 (Output_segment::section_with_lowest_load_address): Likewise.
9672 (Output_segment::write_section_headers): Likewise.
9673 (Output_segment::print_sections_to_map): Likewise.
9674 * output.h (class Output_data): Remove dynamic_reloc_count_
9675 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9676 (Output_data::add_dynamic_reloc): Rewrite.
9677 (Output_data::has_dynamic_reloc): New function.
9678 (Output_data::dynamic_reloc_count): Remove.
9679 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9680 is_last_relro_, is_first_non_relro_, is_interp_,
9681 is_dynamic_linker_section_ fields. Add order and set_order
9682 functions. Remove is_relro_local, set_is_relro_local,
9683 is_last_relro, set_is_last_relro, is_first_non_relro,
9684 set_is_first_non_relro functions, is_interp, set_is_interp,
9685 is_dynamic_linker_section, and set_is_dynamic_linker_section
9686 functions.
9687 (class Output_segment): Change Output_data_list from std::list to
9688 std:;vector. Add output_lists_ field. Remove output_data_ and
9689 output_bss_ fields. Update declarations.
9690
9691 2010-08-02 Ian Lance Taylor <iant@google.com>
9692
9693 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9694 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9695 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9696
9697 2010-08-02 Ian Lance Taylor <iant@google.com>
9698
9699 PR 11855
9700 * script.cc (Script_options::Script_options): Initialize
9701 symbol_definitions_ and symbol_references_.
9702 (Script_options::add_symbol_assignment): Update
9703 symbol_definitions_ and symbol_references_.
9704 (Script_options::add_symbol_reference): New function.
9705 (script_symbol): New function.
9706 * script.h (class Script_options): Add symbol_definitions_ and
9707 symbol_references_ fields.
9708 (Script_options::referenced_const_iterator): New type.
9709 (Script_options::referenced_begin): New function.
9710 (Script_options::referenced_end): New function.
9711 (Script_options::is_referenced): New function.
9712 (Script_options::any_unreferenced): New function.
9713 * script-c.h (script_symbol): Declare.
9714 * yyscript.y (exp): Call script_symbol.
9715 * symtab.cc: Include "script.h".
9716 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9717 Change all callers. Check symbols referenced by scripts.
9718 (Symbol_table::add_undefined_symbols_from_command_line): Add
9719 layout parameter. Change all callers.
9720 (Symbol_table::do_add_undefined_symbols_from_command_line):
9721 Likewise. Break out loop body. Check symbols referenced by
9722 scripts.
9723 (Symbol_table::add_undefined_symbol_from_command_line): New
9724 function broken out of
9725 do_add_undefined_symbols_from_command_line.
9726 * symtab.h (class Symbol_table): Update declarations.
9727 * archive.cc: Include "layout.h".
9728 (Archive::should_include_member): Add layout parameter. Change
9729 all callers. Check for symbol mentioned in expression.
9730 * archive.h (class Archive): Update declaration.
9731 * object.cc (Sized_relobj::do_should_include_member): Add layout
9732 parameter.
9733 * object.h (Object::should_include_member): Add layout parameter.
9734 Change all callers.
9735 (Object::do_should_include_member): Add layout parameter.
9736 (class Sized_relobj): Update declaration.
9737 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9738 parameter.
9739 * dynobj.h (class Sized_dynobj): Update declaration.
9740 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9741 layout parameter.
9742 * plugin.h (class Sized_pluginobj): Update declaration.
9743
9744 2010-08-02 Ian Lance Taylor <iant@google.com>
9745
9746 PR 11866
9747 * output.cc (Output_segment::set_offset): Search for the first and
9748 last sections rather than assuming that the list is in order.
9749 (Output_segment::find_first_and_last_list): New function.
9750 * output.h (class Output_segment): Update declarations.
9751 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9752 (relro_strip_test_SOURCES): New variable.
9753 (relro_strip_test_DEPENDENCIES): New variable.
9754 (relro_strip_test_LDFLAGS): New variable.
9755 (relro_strip_test_LDADD): New variable.
9756 (relro_strip_test.so): New target.
9757
9758 2010-08-02 Ian Lance Taylor <iant@google.com>
9759
9760 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9761 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9762 (Target_i386::got_tlsdesc_section): New function.
9763 (Target_i386::got_section): Create space for GOT entries for
9764 TLSDESC relocations.
9765 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9766 R_386_TLS_GOTDESC.
9767 (Target_i386::Scan::global): Likewise.
9768 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9769 using TLSDESC GOT.
9770 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9771 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9772 (Target_x86_64::got_tlsdesc_section): New function.
9773 (Target_x86_64::got_section): Create space for GOT entries for
9774 TLSDESC relocations.
9775 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9776 R_386_TLS_GOTDESC.
9777 (Target_x86_64::Scan::global): Likewise.
9778 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9779 using TLSDESC GOT.
9780
9781 2010-08-02 Ian Lance Taylor <iant@google.com>
9782
9783 * testsuite/final_layout.sh: Use dc to convert from hex to
9784 decimal.
9785
9786 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9787
9788 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9789 paramter to the call to gold::gc_process_relocs.
9790 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9791 paramter to the call to gold::gc_process_relocs.
9792 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9793 parameter to the call to gold::gc_process_relocs.
9794 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9795 template parameter to the call to gold::gc_process_relocs.
9796 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9797 paramter to the call to gold::gc_process_relocs.
9798 * gc.h (get_embedded_addend_size): New function.
9799 (gc_process_relocs): Save the size of the reloc for use by ICF.
9800 * icf.cc (get_section_contents): Get the addend from the text section
9801 for SHT_REL relocation sections.
9802 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9803 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9804 * int_encoding.h (read_from_pointer): New overloaded function.
9805 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9806 * testsuite/icf_sht_rel_addend_test.sh: New file.
9807 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9808 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9809
9810 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9811
9812 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9813 * Makefile.in: Regenerate.
9814 * testsuite/Makefile.in: Regenerate.
9815
9816 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9817
9818 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9819 * gold/testsuite/debug_msg.cc: Likewise.
9820 * gold/testsuite/odr_violation1.cc
9821 * gold/testsuite/odr_violation2.cc
9822
9823 2010-07-21 Cary Coutant <ccoutant@google.com>
9824
9825 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9826 string, and length fields.
9827 (Output_merge_string::Merged_strings_list): New type.
9828 (Output_merge_string::Merged_strings_lists): New typedef.
9829 (Output_merge_string): Replace merged_strings_ with
9830 merged_strings_lists_.
9831 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9832 Merged_strings_list per input object and section. Don't store pointer
9833 to the string. Don't store length with each merged string entry.
9834 (Output_merge_string::finalize_merged_data): Loop over list of merged
9835 strings lists. Recompute length of each merged string.
9836
9837 2010-07-15 Cary Coutant <ccoutant@google.com>
9838
9839 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9840 here.
9841
9842 2010-07-14 Ian Lance Taylor <iant@google.com>
9843
9844 * descriptors.cc (Descriptors::open): Report correct name in error
9845 message.
9846
9847 2010-07-13 Doug Kwan <dougkwan@google.com>
9848
9849 * arm.cc (Arm_input_section::Arm_input_section): For a
9850 SHT_ARM_EXIDX section, always keeps the input sections.
9851 (Arm_input_section::set_exidx_section_link): New method.
9852 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9853 has_errors_ to false.
9854 (Arm_exidx_input_section::has_errors,
9855 Arm_exidx_input_section::set_has_errors): New methods.
9856 (Arm_exidx_input_section::has_errors_): New data member.
9857 (Arm_relobj::get_exidx_shndx_list): New method.
9858 (Arm_output_section::append_text_sections_to_list): Do not skip
9859 section without SHF_EXECINSTR.
9860 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9861 errors.
9862 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9863 section header. Make error messages more verbose. Check for
9864 a non-executable section linked to an EXIDX section.
9865 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9866 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9867 check that there is no deferred EXIDX section if we exit early.
9868 Instead of not making an EXIDX section in case of an error, make one
9869 and set the has_errors flag of it.
9870 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9871 in a relocatable link.
9872 (Target_arm::do_relax): Look for the EXIDX output section instead of
9873 assuming that it is called .ARM.exidx.
9874 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9875 section list. Do not check for SHF_EXECINSTR section flags but
9876 skip any input section with errors.
9877 * output.cc (Output_section::Output_section): Initialize
9878 always_keeps_input_sections_ to false.
9879 (Output_section::add_input_section): Check for
9880 always_keeps_input_sections_.
9881 * output.h (Output_section::always_keeps_input_sections,
9882 Output_section::set_always_keeps_input_sections): New methods.
9883 (Output_section::always_keeps_input_sections): New data member.
9884
9885 2010-07-13 Rafael Espindola <espindola@google.com>
9886
9887 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9888 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9889
9890 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9891 Ian Lance Taylor <iant@google.com>
9892
9893 * output.h (Output_section_lookup_maps::add_merge_section):
9894 Correct check of whether value was inserted.
9895 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9896 (Output_section_lookup_maps::add_relaxed_input_section):
9897 Likewise.
9898 * arm.cc (Target_arm::got_section): Remove used local os.
9899 * i386.cc (Target_i386::got_section): Likewise.
9900 * x86_64.cc (Target_x86_64::got_section): Likewise.
9901 * sparc.cc (Target_sparc::got_section): Likewise.
9902 (Target_sparc::relocate): Remove unused local have_got_offset.
9903 * powerpc.cc (Target_powerpc::relocate): Likewise.
9904
9905 2010-07-13 Ian Lance Taylor <iant@google.com>
9906
9907 * compressed_output.cc (zlib_decompress): Fix signature in
9908 !HAVE_ZLIB_H case.
9909
9910 * archive.cc (Archive::include_member): Unlock an external member
9911 of a thin archive. Don't bother to delete an object we know is
9912 NULL.
9913
9914 2010-07-12 Cary Coutant <ccoutant@google.com>
9915
9916 * compressed_output.cc (zlib_decompress): New function.
9917 (get_uncompressed_size): New function.
9918 (decompress_input_section): New function.
9919 * compressed_output.h (get_uncompressed_size): New function.
9920 (decompress_input_section): New function.
9921 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9922 Handle compressed debug sections.
9923 * layout.cc (is_compressed_debug_section): New function.
9924 (Layout::output_section_name): Map compressed section names to
9925 canonical names.
9926 * layout.h (is_compressed_debug_section): New function.
9927 (is_debug_info_section): Recognize compressed debug sections.
9928 * merge.cc: Include compressed_output.h.
9929 (Output_merge_data::do_add_input_section): Handle compressed
9930 debug sections.
9931 (Output_merge_string::do_add_input_section): Handle compressed
9932 debug sections.
9933 * object.cc: Include compressed_output.h.
9934 (Sized_relobj::Sized_relobj): Initialize new data members.
9935 (build_compressed_section_map): New function.
9936 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9937 * object.h (Object::section_is_compressed): New method.
9938 (Object::do_section_is_compressed): New method.
9939 (Sized_relobj::Compressed_section_map): New type.
9940 (Sized_relobj::do_section_is_compressed): New method.
9941 (Sized_relobj::compressed_sections_): New data member.
9942 * output.cc (Output_section::add_input_section): Handle compressed
9943 debug sections.
9944 * reloc.cc: Include compressed_output.h.
9945 (Sized_relobj::write_sections): Handle compressed debug sections.
9946
9947 2010-07-08 Cary Coutant <ccoutant@google.com>
9948
9949 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9950 weak when resolving to a dynamic def.
9951 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9952 for weak undef/dynamic def cases. Adjust callers.
9953 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9954 undef_binding_weak_.
9955 (Symbol_table::sized_write_globals): Adjust symbol binding.
9956 (Symbol_table::sized_write_symbol): Add binding parameter.
9957 * symtab.h (Symbol::set_undef_binding): New method.
9958 (Symbol::is_undef_binding_weak): New method.
9959 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9960 (Symbol_table::should_override): Add new parameter.
9961 (Symbol_table::sized_write_symbol): Add new parameter.
9962
9963 * testsuite/weak_undef_file1.cc: Add new test case.
9964 * testsuite/weak_undef_file2.cc: Fix header comment.
9965 * testsuite/weak_undef_test.cc: Add new test case.
9966
9967 2010-06-29 Doug Kwan <dougkwan@google.com>
9968
9969 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9970 Initialize USE_SYMBOL_.
9971 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9972 definition.
9973 (Arm_reloc_property::uses_symbol_): New data member declaration.
9974 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9975 uses symbol value and symbol is undefined but not weakly undefined.
9976
9977 2010-06-28 Rafael Espindola <espindola@google.com>
9978
9979 * plugin.cc (Plugin::load): Use dlerror.
9980
9981 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9982
9983 * symtab.cc (detect_odr_violations): When reporting an ODR
9984 violation, report an object where the symbol is defined.
9985
9986 2010-06-25 Doug Kwan <dougkwan@google.com>
9987
9988 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9989 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9990 definition.
9991 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9992 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9993 target hook to detect function points.
9994 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9995 * icf.h (Icf::check_section_for_function_pointers): Change type of
9996 parameter SECTION_NAME to const reference to std::string. Use
9997 target hook to determine if section may have unsafe pointers.
9998 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9999 method definition.
10000
10001 2010-06-21 Rafael Espindola <espindola@google.com>
10002
10003 * fileread.cc (Input_file::find_fie): New
10004 (Input_file::open): Use Input_file::find_fie.
10005 * fileread.h (Input_file::find_fie): New
10006 * plugin.cc (set_extra_library_path): New.
10007 (Plugin::load): Add set_extra_library_path to the transfer vector.
10008 (Plugin_manager::set_extra_library_path): New.
10009 (Plugin_manager::add_input_file): Use the extra search path if set.
10010 (set_extra_library_path(): New.
10011 * plugin.h (Plugin_manager): Add set_extra_library_path and
10012 extra_search_path_.
10013
10014 2010-06-19 Cary Coutant <ccoutant@google.com>
10015
10016 * layout.cc (gdb_sections): Add .debug_types.
10017 (lines_only_debug_sections): Likewise.
10018
10019 2010-06-18 Rafael Espindola <espindola@google.com>
10020
10021 * plugin.cc (add_input_file,add_input_library)
10022 (Plugin_manager::add_input_file): Make filename arguments const.
10023 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
10024 const.
10025
10026 2010-06-16 Doug Kwan <dougkwan@google.com>
10027
10028 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
10029 .ARM.attributes section if we have not merged any input
10030 attributes sections.
10031
10032 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10033
10034 * arm.cc: Allow combining objects with no EABI version
10035 information.
10036
10037 2010-06-15 Rafael Espindola <espindola@google.com>
10038
10039 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
10040
10041 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10042
10043 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
10044 (struct iovec): Correct !HAVE_READV definition.
10045
10046 2010-06-10 Cary Coutant <ccoutant@google.com>
10047
10048 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
10049 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
10050 reloc sections.
10051 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
10052
10053 PR 11683
10054 * symtab.h (Symbol::is_placeholder): New member function.
10055 * target-reloc.h (relocate_section): Check for placeholder symbols.
10056
10057 * testsuite/Makefile.am (plugin_test_8): New test.
10058 (plugin_test_9): New test.
10059 * testsuite/Makefile.in: Regenerate.
10060
10061 2010-06-09 Nick Clifton <nickc@redhat.com>
10062
10063 * yyscript.y (input_list_element): Allow strings prefixed with
10064 the '-' character. Treat these as libraries.
10065 * script.cc (script_add_library): New function. Adds a library
10066 specified by "-l<name>" found in an input script.
10067 * script-c.h: Add prototype for script_add_library.
10068
10069 2010-06-07 Doug Kwan <dougkwan@google.com>
10070
10071 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10072 Restrict stub-group size to be within long conditional branch
10073 range when working around cortex-A8 erratum.
10074
10075 2010-06-07 Damien Diederen <dd@crosstwine.com>
10076
10077 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10078 #ifdef typo.
10079
10080 2010-06-03 Sriraman Tallam <tmsriram@google.com>
10081
10082 PR gold/11658
10083 * output.cc
10084 (Output_section::Input_section_sort_entry::compare_section_ordering):
10085 Change to return non-zero correctly.
10086 (Output_section::Input_section_sort_section_order_index_compare
10087 ::operator()): Change to fix ambiguity in comparisons.
10088
10089 2010-06-01 Sriraman Tallam <tmsriram@google.com>
10090
10091 * gold.h (is_wildcard_string): New function.
10092 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10093 (Layout::layout_eh_frame): Ditto.
10094 (Layout::find_section_order_index): New method.
10095 (Layout::read_layout_from_file): New method.
10096 * layout.h (Layout::find_section_order_index): New method.
10097 (Layout::read_layout_from_file): New method.
10098 (Layout::input_section_position_): New private member.
10099 (Layout::input_section_glob_): New private member.
10100 * main.cc (main): Call read_layout_from_file here.
10101 * options.h (--section-ordering-file): New option.
10102 * output.cc (Output_section::input_section_order_specified_): New
10103 member.
10104 (Output_section::Output_section): Initialize new member.
10105 (Output_section::add_input_section): Add new parameter.
10106 Keep input sections when --section-ordering-file is used.
10107 (Output_section::set_final_data_size): Sort input sections when
10108 section ordering file is specified.
10109 (Output_section::Input_section_sort_entry): Add new parameter.
10110 Check sorting type.
10111 (Output_section::Input_section_sort_entry::compare_section_ordering):
10112 New method.
10113 (Output_section::Input_section_sort_compare::operator()): Change to
10114 consider section_order_index.
10115 (Output_section::Input_section_sort_init_fini_compare::operator()):
10116 Change to consider section_order_index.
10117 (Output_section::Input_section_sort_section_order_index_compare
10118 ::operator()): New method.
10119 (Output_section::sort_attached_input_sections): Change to sort
10120 according to section order when specified.
10121 (Output_section::add_input_section<32, true>): Add new parameter.
10122 (Output_section::add_input_section<64, true>): Add new parameter.
10123 (Output_section::add_input_section<32, false>): Add new parameter.
10124 (Output_section::add_input_section<64, false>): Add new parameter.
10125 * output.h (Output_section::add_input_section): Add new parameter.
10126 (Output_section::input_section_order_specified): New
10127 method.
10128 (Output_section::set_input_section_order_specified): New method.
10129 (Input_section::Input_section): Initialize section_order_index_.
10130 (Input_section::section_order_index): New method.
10131 (Input_section::set_section_order_index): New method.
10132 (Input_section::section_order_index_): New member.
10133 (Input_section::Input_section_sort_section_order_index_compare): New
10134 struct.
10135 (Output_section::input_section_order_specified_): New member.
10136 * script-sections.cc (is_wildcard_string): Delete and move modified
10137 method to gold.h.
10138 (Output_section_element_input::Output_section_element_input): Modify
10139 call to is_wildcard_string.
10140 (Output_section_element_input::Input_section_pattern
10141 ::Input_section_pattern): Ditto.
10142 (Output_section_element_input::Output_section_element_input): Ditto.
10143 * testsuite/Makefile.am (final_layout): New test case.
10144 * testsuite/Makefile.in: Regenerate.
10145 * testsuite/final_layout.cc: New file.
10146 * testsuite/final_layout.sh: New file.
10147
10148 2010-06-01 Rafael Espindola <espindola@google.com>
10149
10150 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10151
10152 2010-06-01 Rafael Espindola <espindola@google.com>
10153
10154 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10155 visibility of symbols.
10156
10157 2010-05-27 Doug Kwan <dougkwan@google.com>
10158
10159 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10160 from start of output section instead of address for a local symbol
10161 in a merged or relaxed section when doing a relocatable link.
10162
10163 2010-05-26 Rafael Espindola <espindola@google.com>
10164
10165 PR 11604
10166 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10167 adding sections the garbage collector removed.
10168 * gold/testsuite/Makefile.am: Add test.
10169 * gold/testsuite/Makefile.in: Regenerate.
10170 * gold/testsuite/plugin_test_7.sh: New.
10171 * gold/testsuite/plugin_test_7_1.c: New.
10172 * gold/testsuite/plugin_test_7_2.c: New.
10173
10174 2010-05-26 Rafael Espindola <espindola@google.com>
10175
10176 * script-sections.cc (Output_section_definition::set_section_addresses):
10177 Check for --section-start.
10178
10179 2010-05-26 Doug Kwan <dougkwan@google.com>
10180
10181 * arm.cc (Arm_scan_relocatable_relocs): New class.
10182 (Target_arm::relocate_special_relocatable): New method.
10183 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10184 (Arm_relocate_functions::thumb_branch_common): Same.
10185 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10186 instead of Default_scan_relocatable_relocs.
10187 * target-reloc.h (relocate_for_relocatable): Let target handle
10188 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10189 * target.h (Sized_target::relocate_special_relocatable): New method.
10190
10191 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10192
10193 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10194
10195 2010-05-23 Doug Kwan <dougkwan@google.com>
10196
10197 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10198 instead of a cast.
10199 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10200 with a direct branch, not a conditional branch, to a stub.
10201 * merge.cc (Output_merge_base::record_input_section): New method
10202 defintion.
10203 (Output_merge_data::do_add_input_section): Record input section if
10204 keeps-input-sections flag is set.
10205 (Output_merge_string::do_add_input_section): Ditto.
10206 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10207 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10208 INPUT_SECTIONS_.
10209 (Output_merge_base::keeps_input_sections,
10210 Output_merge_base::set_keeps_input_sections,
10211 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10212 method definitions.
10213 (Output_merge_base::Input_sections): New type declaration.
10214 (Output_merge_base::input_sections_begin,
10215 Output_merge_base::input_sections_end,
10216 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10217 (Output_merge_base::bool keeps_input_sections_,
10218 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10219 Output_merge_base::input_sections_): New data members.
10220 (Output_merge_data::do_set_keeps_input_sections): New method
10221 defintion.
10222 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10223 * output.cc (Output_section::Input_section::relobj): Move method
10224 defintion from class declaration to here and handle merge sections.
10225 (Output_section::Input_section::shndx): Ditto.
10226 (Output_section::Output_section): Remove initializations of removed
10227 data members and initialize new data member LOOKUP_MAPS_.
10228 (Output_section::add_input_section): Set keeps-input-sections flag
10229 for a newly created merge output section as appropriate. Adjust code
10230 to use Output_section_lookup_maps class.
10231 (Output_section::add_relaxed_input_section): Adjst code for lookup
10232 maps code refactoring.
10233 (Output_section::add_merge_input_section): Add a new parameter
10234 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10235 class. If adding input section to a newly created merge output
10236 section fails, remove the new merge section.
10237 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
10238 Adjust code for use of the Output_section_lookup_maps class.
10239 (Output_section::find_merge_section): Ditto.
10240 (Output_section::build_lookup_maps): New method defintion.
10241 (Output_section::find_relaxed_input_section): Adjust code to use
10242 Output_section_lookup_maps class.
10243 (Output_section::get_input_sections): Export merge sections. Adjust
10244 code to use Output_section_lookup_maps class.
10245 (Output_section:::add_script_input_section): Adjust code to use
10246 Output_section_lookup_maps class. Update lookup maps for merge
10247 sections also.
10248 (Output_section::discard_states): Use Output_section_lookup_maps.
10249 (Output_section::restore_states): Same.
10250 * output.h (Merge_section_properties): Move class defintion out of
10251 Output_section.
10252 (Output_section_lookup_maps): New class.
10253 (Output_section::Input_section::is_merge_section): New method
10254 defintion.
10255 (Output_section::Input_section::relobj): Move defintion out of class
10256 defintion. Declare method only.
10257 (Output_section::Input_section::shndx): Ditto.
10258 (Output_section::Input_section::output_merge_base): New method defintion.
10259 (Output_section::Input_section::u2_.pomb): New union field.
10260 (Output_section::Merge_section_by_properties_map,
10261 Output_section::Output_section_data_by_input_section_map,
10262 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10263 Remove types.
10264 (Output_section::add_merge_input_section): Add new parameter
10265 KEEPS_INPUT_SECTIONS.
10266 (Output_section::build_lookup_maps): New method declaration.
10267 (Output_section::merge_section_map_,
10268 Output_section::merge_section_by_properties_map_,
10269 Output_section::relaxed_input_section_map_,
10270 Output_section::is_relaxed_input_section_map_valid_): Remove data
10271 members.
10272 (Output_section::lookup_maps_): New data member.
10273
10274 2010-05-21 Doug Kwan <dougkwan@google.com>
10275
10276 PR gold/11619
10277 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10278 avoid a compilation error.
10279
10280 2010-05-19 Rafael Espindola <espindola@google.com>
10281
10282 * script-sections.cc (Output_section_definition::allocate_to_segment):
10283 Update the phdrs_list even when the output section is NULL.
10284 * testsuite/Makefile.am: Add test.
10285 * testsuite/Makefile.in: Regenerate.
10286 * testsuite/script_test_9.cc: New.
10287 * testsuite/script_test_9.sh: New.
10288 * testsuite/script_test_9.t: New.
10289
10290 2010-05-19 Doug Kwan <dougkwan@google.com>
10291
10292 * arm.cc (Arm_input_section::original_size): New method.
10293 (Arm_input_section::do_addralign): Add a cast.
10294 (Arm_input_section::do_output_offset): Remove static cast.
10295 (Arm_input_section::original_addralign,
10296 Arm_input_section::original_size_): Change type to uint32_t.
10297 (Arm_input_section::init): Add safe casts for section alignment
10298 and size.
10299 (Arm_input_section::set_final_data_size): Do not set address and
10300 offset of stub table.
10301 (Arm_output_section::fix_exidx_coverage): Change use of of
10302 Output_section::Simple_input_section to that of
10303 Output_section::Input_section.
10304 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10305 except for the first pass.
10306 * output.cc (Output_section::get_input_sections): Change type of
10307 input_sections to std::list<Input_section>.
10308 (Output_section::add_script_input_section): Rename from
10309 Output_section::add_simple_input_section. Change type of SIS
10310 parameter from Simple_input_section to Input_section.
10311 * output.h (Output_section::Simple_input_section): Remove class.
10312 (Output_section::Input_section): Change class visibility to public.
10313 (Output_section::Input_section::addralign): Use stored alignments
10314 for special input sections if set.
10315 (Output_section::Input_section::set_addralign): New method.
10316 (Output_section::get_input_sections): Change parameter type from
10317 list of Simple_input_section to list of Input_section.
10318 (Output_section::add_script_input_section): Rename from
10319 Output_section::add_simple_input_section. Change first parameter's
10320 type from Simple_input_section to Input_section and remove the
10321 second and third parameters.
10322 * script-sections.cc (Input_section::Input_section_list): Change
10323 type to list of Output_section::Input_section/
10324 (Input_section_info::Input_section_info): Change parameter type of
10325 INPUT_SECTION to Output_section::Input_section.
10326 (Input_section_info::input_section): Change return type.
10327 (Input_section_info::input_section_): Change type to
10328 Output_section::Input_section.
10329 (Output_section_element_input::set_section_addresses): Adjust code
10330 to use Output_section::Input_section instead of
10331 Output_section::Simple_input_section. Adjust code for renaming
10332 of Output_section::add_simple_input_section.
10333 (Orphan_output_section::set_section_addresses): Ditto.
10334
10335 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10336
10337 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10338 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10339
10340 2010-05-18 Rafael Espindola <espindola@google.com>
10341
10342 * options.cc (General_options::finalize): Handle -nostdlib.
10343 * options.h (nostdlib): New option.
10344 * script.cc (script_add_search_dir): Handle -nostdlib.
10345
10346 2010-05-12 Doug Kwan <dougkwan@google.com>
10347
10348 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10349 attributes section only if there no attributes section after merging.
10350 (Target_arm::merge_object_attributes): Move value of
10351 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10352 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10353 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10354 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10355 and arm_attr_merge_7.stdout.
10356 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10357 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10358 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10359 arm_attr_merge_7b.o): New rules.
10360 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10361 arm_attr_merge_7
10362 * testsuite/Makefile.in: Regenerate.
10363 * testsuite/arm_attr_merge.sh: New file.
10364 * testsuite/arm_attr_merge_[67][ab].s: Same.
10365
10366 2010-05-05 Nick Clifton <nickc@redhat.com>
10367
10368 * po/es.po: Updated Spanish translation.
10369
10370 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10371
10372 * Makefile.am (install-exec-local): Properly install gold as
10373 default cross linker.
10374 * Makefile.in: Regenerated.
10375
10376 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10377 Nick Clifton <nickc@redhat.com>
10378
10379 * configure.ac (install_as_default): Define and set to false
10380 unless --enable-gold or --enable-gold=both/gold has been
10381 specified.
10382 * configure: Regenerate.
10383
10384 * Makefile.am (install-exec-local): Install the executable as
10385 'ld.gold'. If install_as_default is true then also install it as
10386 'ld'.
10387 * Makefile.in: Regenerated.
10388
10389 2010-04-24 Ian Lance Taylor <iant@google.com>
10390
10391 * layout.cc (Layout::layout_reloc): In relocatable link don't
10392 combine reloc sections for grouped sections.
10393
10394 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10395
10396 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10397 sections that are not ordinary to icf.
10398 * icf.cc (get_section_contents): Handle relocation pointing to section
10399 with no object or shndx information.
10400 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10401 * testsuite/Makefile.in: Regenerate.
10402 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10403 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10404
10405 2010-04-22 Ian Lance Taylor <iant@google.com>
10406
10407 * expression.cc (Expression::Expression_eval_info): Add
10408 result_alignment_pointer field.
10409 (Expression::eval_with_dot): Add result_alignment_pointer
10410 parameter. Change all callers.
10411 (Expression::eval_maybe_dot): Likewise.
10412 (class Binary_expression): Add alignment_pointer parameter to
10413 left_value and right_value. Change all callers.
10414 (BINARY_EXPRESSION): Set result alignment.
10415 (class Trinary_expression): Add alignment_pointer parameter to
10416 arg2_value and arg3_value. Change all callers.
10417 (Trinary_cond::value): Set result alignment.
10418 (Max_expression::value, Min_expression::value): Likewise.
10419 (Align_expression::value): Likewise.
10420 * script-sections.cc (class Sections_element): Add dot_alignment
10421 parameter to set_section_addresses virtual function. Update
10422 instantiations.
10423 (class Output_section_element): Likewise.
10424 (Script_sections::create_segments): Add dot_alignment parameter.
10425 Change all callers.
10426 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10427 (Script_sections::set_phdrs_clause_addresses): Likewise.
10428 * script-sections.h: Update declarations.
10429 * script.h: Update declarations.
10430 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10431 min_p_align.
10432 * testsuite/script_test_3.t: Set large alignment.
10433 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10434 segment has expected alignment.
10435
10436 2010-04-22 Nick Clifton <nickc@redhat.com>
10437
10438 * po/gold.pot: Updated by the Translation project.
10439 * po/vi.po: Updated Vietnamese translation.
10440
10441 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10442
10443 * testsuite/Makefile.am (check_PROGRAMS): Add
10444 icf_virtual_function_folding_test.
10445 * testsuite/Makefile.in: Regenerated.
10446
10447 2010-04-15 Andrew Haley <aph@redhat.com>
10448
10449 * options.h (merge_exidx_entries): New option.
10450 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10451 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10452 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10453 (Target_arm::merge_exidx_entries): New function.
10454 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10455 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10456 to Arm_exidx_fixup constructor.
10457 Add new arg, merge_exidx_entries.
10458 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10459 Arm_output_section::fix_exidx_coverage.
10460
10461 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10462
10463 * icf.cc (get_section_contents): Check for preemptible functions.
10464 Ignore addend when appropriate.
10465 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10466 section folded.
10467 (add_from_relobj): Check for section folded.
10468 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10469 * symtab.h (should_add_dynsym_entry): Add new parameter.
10470 * target-reloc.h (scan_relocs): Check for section folded.
10471 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10472 Check reloc types for function pointers in shared objects.
10473 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10474 case.
10475 (icf_preemptible_functions_test): New test case.
10476 (icf_string_merge_test): New test case.
10477 * testsuite.Makefile.in: Regenerate.
10478 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10479 bar_glob. Refactor code.
10480 * testsuite/icf_preemptible_functions_test.cc: New file.
10481 * testsuite/icf_preemptible_functions_test.sh: New file.
10482 * testsuite/icf_string_merge_test.cc: New file.
10483 * testsuite/icf_string_merge_test.sh: New file.
10484 * testsuite/icf_virtual_function_folding_test.cc: New file.
10485 * testsuite/icf_virtual_function_folding_test.sh: New file.
10486
10487 2010-04-14 Doug Kwan <dougkwan@google.com>
10488
10489 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10490 for local symbol recounting if we remove a section due to ICF.
10491 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10492 there are no regular objects in input.
10493
10494 2010-04-13 Doug Kwan <dougkwan@google.com>
10495
10496 * arm.cc (Arm_input_section::set_final_data_size): Compute
10497 accurate final data size instead of using current data size.
10498
10499 2010-04-09 Doug Kwan <dougkwan@google.com>
10500
10501 * layout.cc (Layout::choose_output_section): Handle script section
10502 types.
10503 (Layout::make_output_section_for_script): Add section type parameter.
10504 Handle script section types.
10505 * layout.h (Layout::make_output_section_for_script): Add section
10506 type parameter.
10507 * output.cc (Output_section::Output_section): Initialize data member
10508 is_noload_.
10509 (Output_section::do_reset_address_and_file_offset): Do not set address
10510 to 0 if section is a NOLOAD section.
10511 * output.h (Output_section::is_noload): New method.
10512 (Output_section::set_is_noload): Ditto.
10513 (Output_section::is_noload_): New data member.
10514 * script-c.h (Script_section_type): New enum type.
10515 (struct Parser_output_section_header): Add new file section_type.
10516 * script-sections.cc (Sections_element::output_section_name): Add
10517 parameter for returning script section type.
10518 (Output_section_definition::output_section_name): Ditto.
10519 (Output_section_definition::section_type)P; New method.
10520 (Output_section_definiton::script_section_type_name): Ditto.
10521 (Output_section_definition::script_section_type_): New data member.
10522 (Output_section_definition::Output_section_definition): Initialize
10523 data member Output_section_definition::script_section_type_.
10524 (Output_section_definition::create_sections): Pass script section type
10525 to Layout::make_output_section_for_script.
10526 (Output_section_definition::output_section_name): Return script
10527 section type to caller.
10528 (Output_section_definition::set_section_address): Do not advance
10529 dot value and load address if section type is NOLOAD. Set address
10530 of NOLOAD sections regardless of section flags.
10531 (Output_section_definition::print): Print section type if it is
10532 not SCRIPT_SECTION_TYPE_NONE.
10533 (Output_section_definition::section_type): New method.
10534 (Output_section_definition::script_section_type_name): Ditto.
10535 (Script_sections::output_section_name): Add new parameter
10536 PSECTION_TYPE for returning script section type. Pass it to
10537 section elements. Handle discard sections.
10538 (Sort_output_sections::operator()): Handle NOLOAD sections.
10539 * script-sections.h (Script_sections::Section_type): New enum type.
10540 (Script_sections::output_section_name): Add a new parameter for
10541 returning script section type.
10542 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10543 INFO and NOLOAD.
10544 * yyscript.y (union): Add new field SECTION_TYPE.
10545 (COPY, DSECT, INFO, NOLOAD): New tokens.
10546 (opt_address_and_section_type): Change type to output_section_header.
10547 (section_type): New non-terminal
10548 (section_header): Handle section type.
10549 (opt_address_and_section_type): Return section type value.
10550
10551 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10552
10553 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10554 * testsuite/plugin_common_test_2.c (foo): Likewise.
10555
10556 2010-04-08 Doug Kwan <dougkwan@google.com>
10557
10558 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10559 Output_merge_data.
10560 * output.cc (Output_section::add_merge_input_section): Simplify
10561 code and return status of Output_merge_base::add_input_section.
10562 Update merge section map only if Output_merge_base::add_input_section
10563 returns true.
10564
10565 2010-04-07 Doug Kwan <dougkwan@google.com>
10566
10567 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10568 if section is marked as containing instructions but has no mapping
10569 symbols.
10570 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10571 correct section index.
10572 (Arm_relobj::find_linked_text_section): Ditto.
10573
10574 2010-04-07 Cary Coutant <ccoutant@google.com>
10575
10576 * archive.cc (include_member): Destroy Read_symbols_data object before
10577 releasing file.
10578 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10579 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10580 (Read_symbols_data::~Read_symbols_data) New destructor.
10581 (Section_relocs::Section_relocs) New constructor.
10582 (Section_relocs::~Section_relocs) New destructor.
10583 (Read_relocs_data::Read_relocs_data) New constructor.
10584 (Read_relocs_data::~Read_relocs_data) New destructor.
10585 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10586 pointers to NULL after deleting.
10587
10588 2010-04-07 Doug Kwan <dougkwan@google.com>
10589
10590 * arm.cc: Replace "endianity" with "endianness" in comments.
10591 (Arm_exidx_cantunwind): Ditto.
10592 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10593 (Arm_relobj::merge_flags_and_attributes): New method.
10594 (Arm_relobj::merge_flags_and_attributes_): New data member.
10595 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10596 (Arm_relobj::scan_sections_for_stubs): Ditto.
10597 (Arm_relobj::do_read_symbols): Check to see if we really want to
10598 merge processor-specific flags and attributes. Exit early if
10599 an object is empty except for section names and the undefined symbol.
10600 (Target_arm::do_finalize_sections): Move check for ELF format to
10601 Arm_relobj::do_read_symbols. Merge processor specific flags and
10602 attributes from a regular object only when we have determined that
10603 it is aapropriate. Do not create an .ARM.attributes section in
10604 output if there is no regular input object.
10605 (Target_arm::merge_processor_specific_flags): Check
10606 --warn-mismatch before printing any error.
10607 (Target_arm::merge_object_attributes): Ditto.
10608 * gold.cc (queue_middle_tasks): Handle the case in which there is
10609 no regular object in input.
10610 * options.cc (General_options::parse_EB): New method.
10611 (General_options::parse_EL): Same.
10612 (General_options::General_options): Initialize endianness_.
10613 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10614 New options.
10615 (General_options::Endianness): New enum.
10616 (General_options::endianness): New method.
10617 (General_options::endianness_): New data member.
10618 * parameters.cc (Parameters::set_options): Check target endianness.
10619 (Parameters::set_target_once): Ditto.
10620 (Parameters::check_target_endianness): New method.
10621 (parameters_force_valid_target): If either -EL or -EB is specified,
10622 use it to define endianness of default target.
10623 * parameters.h (Parameters::check_target_endianness): New method
10624 declaration.
10625 * target.h (class Target): Change "endianity" to "endianness"
10626 in comments.
10627
10628 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10629
10630 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10631 * configure: Regenerate.
10632 * Makefile.in: Regenerate.
10633 * testsuite/Makefile.in: Regenerate.
10634
10635 2010-04-06 Cary Coutant <ccoutant@google.com>
10636
10637 gcc PR lto/42757
10638 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10639 prevailing definitions of common symbols.
10640 * testsuite/plugin_test_6.sh: New test case.
10641 * testsuite/plugin_common_test_1.c: New test case.
10642 * testsuite/plugin_common_test_2.c: New test case.
10643 * testsuite/Makefile.am (plugin_test_6): New test case.
10644 * testsuite/Makefile.in: Regenerate.
10645
10646 2010-04-06 Nick Clifton <nickc@redhat.com>
10647
10648 * po/vi.po: New Vietnamese translation.
10649
10650 2010-03-30 Doug Kwan <dougkwan@google.com>
10651
10652 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10653
10654 2010-03-25 Doug Kwan <dougkwan@google.com>
10655
10656 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10657 to avoid a conversion warning on a 32-bit host.
10658
10659 2010-03-24 Ian Lance Taylor <iant@google.com>
10660
10661 * testsuite/script_test_3.t: Add a TLS segment.
10662 * testsuite/Makefile.am (check_PROGRAMS): Add
10663 tls_phdrs_script_test.
10664 (tls_phdrs_script_test_SOURCES): Define.
10665 (tls_phdrs_script_test_DEPENDENCIES): Define.
10666 (tls_phdrs_script_test_LDFLAGS): Define.
10667 (tls_phdrs_script_test_LDADD): Define.
10668 * testsuite/Makefile.in: Rebuild.
10669
10670 2010-03-23 Cary Coutant <ccoutant@google.com>
10671
10672 * fileread.cc (find_or_make_view): Fix comment.
10673
10674 2010-03-23 Ian Lance Taylor <iant@google.com>
10675
10676 * script-sections.cc (class Orphan_section_placement): Define
10677 PLACE_TLS and PLACE_TLS_BSS.
10678 (Orphan_section_placement::Orphan_section_placement): Initialize
10679 new places.
10680 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10681 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10682 (tls_script_test_SOURCES): Define.
10683 (tls_script_test_DEPENDENCIES): Define.
10684 (tls_script_test_LDFLAGS): Define.
10685 (tls_script_test_LDADD): Define.
10686 * testsuite/Makefile.in: Rebuild.
10687
10688 2010-03-22 Doug Kwan <dougkwan@google.com>
10689
10690 * arm.cc (Arm_relocate_functions::abs8,
10691 Arm_relocate_functions::abs16): Use correct check for overflow
10692 specified in the ARM ELF specs.
10693 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10694 target of a BLX instruction specially.
10695 (Reloc_stub::stub_type_for_reloc): Ditto.
10696 (Relocate::relocate): Use symbolic names instead of numeric relocation
10697 codes to report error.
10698 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10699 workaround.
10700 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10701 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10702 thumb2_blx_out_of_range.stdout
10703 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10704 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10705 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10706 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10707 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10708 thumb2_blx_in_range, thumb2_blx_in_range.o,
10709 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10710 thumb2_blx_out_of_range.o): New rules.
10711 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10712 thumb2_blx_in_range and thumb2_blx_out_of_range.
10713 * testsuite/Makefile.in: Regenerate.
10714 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10715 * testsuite/thumb_blx_in_range.s: New file.
10716 * testsuite/thumb_blx_out_of_range.s: New file.
10717
10718 2010-03-22 Rafael Espindola <espindola@google.com>
10719
10720 * archive.cc (Should_include): Move to archive.h.
10721 (should_include_member): Make it a member of Archive.
10722 (Lib_group): New.
10723 (Add_lib_group_symbols): New.
10724 * archive.h: Include options.h.
10725 (Archive_member): Moved from Archive.
10726 (Should_include): Moved from archive.cc.
10727 (Lib_group): New.
10728 (Add_lib_group_symbols): New.
10729 * dynobj.cc (do_should_include_member): New.
10730 * dynobj.h (do_should_include_member): New.
10731 * gold.cc (queue_initial_tasks): Update call to queue.
10732 * main.cc (main): Print lib group stats.
10733 * object.cc (do_should_include_member): New.
10734 * object.h: Include archive.h.
10735 (Object::should_include_member): New.
10736 (Object::do_should_include_member): New.
10737 (Sized_relobj::do_should_include_member): New.
10738 * options.cc (General_options::parse_start_lib): New.
10739 (General_options::parse_end_lib): New.
10740 (Input_arguments::add_file): Handle lib groups.
10741 (Input_arguments::start_group): Check we are not in a lib.
10742 (Input_arguments::start_lib): New.
10743 (Input_arguments::end_lib): New.
10744 * options.h (General_options): Add start_lib and end_lib.
10745 (Input_argument::lib_): New.
10746 (Input_argument::lib): New.
10747 (Input_argument::is_lib): New.
10748 (Input_file_lib): New.
10749 (Input_arguments::in_lib_): New.
10750 (Input_arguments::in_lib): New.
10751 (Input_arguments::start_lib): New.
10752 (Input_arguments::end_lib_): New.
10753 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10754 in unused members as preempted.
10755 (Sized_pluginobj::do_should_include_member): New.
10756 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10757 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10758 return the blocker.
10759 (Read_symbols::do_whole_lib_group): New.
10760 (Read_symbols::do_lib_group): New.
10761 (Read_symbols::do_read_symbols): Handle lib groups.
10762 (Read_symbols::get_name): Handle lib groups.
10763 * readsyms.h (Read_symbols): Add an archive member pointer.
10764 (Read_symbols::do_whole_lib_group): New.
10765 (Read_symbols::do_lib_group): New.
10766 (Read_symbols::member_): New.
10767 * script.cc (read_input_script): Update call to queue_soon.
10768
10769 2010-03-19 Doug Kwan <dougkwan@google.com>
10770
10771 * arm.cc (Stub_table::Stub_table): Initialize new data members
10772 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10773 (Stub_table::add_reloc_stub): Assign stub offset and update
10774 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10775 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10776 New data members.
10777 (Stub_table::update_data_size_and_addralign): Use
10778 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10779 instead of going over all reloc stubs.
10780 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10781 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10782 Stringpool_template::offset_ to size of Stringpool_char.
10783 (Stringpool_template::new_key_offset): Remove code to initialize
10784 Stringpool_template::offset_.
10785 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10786 Stringpool_template::offset_ to zero.
10787
10788 2010-03-15 Doug Kwan <dougkwan@google.com>
10789
10790 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10791 offset_.
10792 (Stringpool_template::new_key_offset): New method.
10793 (Stringpool_template::add_string): Assign offsets when adding new
10794 strings.
10795 (Stringpool_template::set_string_offsets): Do not set string offsets
10796 when not optimizing.
10797 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10798 member size_.
10799 (Chunked_vector::clear): Clear size_.
10800 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10801 (Chunked_vector::size): Return size_.
10802 (Chunked_vector::push_back): Use size_ to find insert position.
10803 (Chunked_vector::size_): New data member.
10804 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10805 (Stringpool_template::new_key_offset): New method declaration.
10806 (Stringpool_template::offset_): New data member.
10807
10808 2010-03-15 Rafael Espindola <espindola@google.com>
10809
10810 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10811 Add_symbols' constructor.
10812 * readsyms.h (Add_symbols): Remove the input_group member.
10813
10814 2010-03-10 Ian Lance Taylor <iant@google.com>
10815
10816 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10817 target to ask whether a reference to a symbol requires a stack
10818 split.
10819 * target.h (Target::is_call_to_non_split): New function.
10820 (Target::do_is_call_to_non_split): Declare virtual function.
10821 * target.cc: Include "symtab.h".
10822 (Target::do_is_call_to_non_split): New function.
10823 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10824
10825 2010-03-10 Cary Coutant <ccoutant@google.com>
10826
10827 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10828 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10829 (File_read::open[2]): Add whole_file_view_ to list of views.
10830 (File_read::make_view): Remove test of whole_file_view_.
10831 (File_read::find_or_make_view): Create whole_file_view_ if
10832 necessary.
10833 (File_read::clear_views): Replace bool parameter with enum;
10834 adjust all callers. Don't delete views with permanent data;
10835 do delete cached views and views from archives if
10836 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10837 if clearing the corresponding view.
10838 * fileread.h (File_read::Clear_views_mode): New enum.
10839 (File_read::View::is_permanent_view): New method.
10840 (File_read::clear_views): Replace bool parameter
10841 with enum; adjust all callers.
10842 * options.h (General_options): Change keep_files_mapped option;
10843 add map_whole_files.
10844 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10845 releasing the file.
10846 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10847 the file.
10848
10849 2010-03-10 David S. Miller <davem@davemloft.net>
10850
10851 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10852
10853 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10854
10855 * icf.cc (get_section_contents): Add '@' marker after processing the
10856 merge reloc.
10857
10858 2010-03-08 Doug Kwan <dougkwan@google.com>
10859
10860 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10861 due to a conversion warning.
10862 (Arm_relobj::update_output_local_symbol_count): Check for local
10863 symbol with unset output index.
10864
10865 2010-03-05 Ian Lance Taylor <iant@google.com>
10866
10867 * options.h (class General_options): Add --spare-dynamic-tags.
10868 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10869 --spare-dynamic-tags.
10870
10871 2010-03-05 Ian Lance Taylor <iant@google.com>
10872
10873 * incremental.cc: Include "libiberty.h".
10874
10875 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10876
10877 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10878 function, is_info_ member.
10879 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10880 (Versions::Versions): Update caller.
10881 (Versions::define_base_version): Likewise.
10882 (Versions::add_def): Likewise.
10883
10884 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10885
10886 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10887 (Scan::possible_function_pointer_reloc): New function.
10888 (Scan::local_reloc_may_be_function_pointer): Change to call
10889 possible_function_pointer_reloc.
10890 (Scan::global_reloc_may_be_function_pointer): Ditto.
10891 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10892 relocations in ".data.rel.ro._ZTV" section.
10893 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10894 * testsuite/icf_safe_so_test.cc: Ditto.
10895 * testsuite/icf_safe_test.cc: Ditto.
10896 * testsuite/icf_safe_test.sh: Ditto.
10897
10898 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10899 Ian Lance Taylor <iant@google.com>
10900
10901 * target-reloc.h (relocate_section): Check the symbol table index
10902 for -1U before setting the local symbol index.
10903 (scan_relocatable_relocs): If copying the relocation, record that
10904 the local symbol is required.
10905 * object.h (Symbol_value::is_output_symtab_index_set): New
10906 function.
10907 (Symbol_value::may_be_discarded_from_output_symtab): New
10908 function.
10909 (Symbol_value::has_output_symtab_entry): New function.
10910 (Symbol_value::needs_output_symtab_entry): Remove.
10911 (Symbol_value::output_symtab_index): Make sure the symbol index is
10912 set.
10913 (Symbol_value::set_output_symtab_index): Make sure the symbol
10914 index is not set. Make sure the new index is valid.
10915 (Symbol_value::set_must_have_output_symtab_entry): New function.
10916 (Symbol_value::has_output_dynsym_entry): New function.
10917 (Symbol_value::set_output_dynsym_index): Make sure the new index
10918 is valid.
10919 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10920 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10921 local symbol if permitted.
10922 (Sized_relobj::do_finalize_local_symbols): Call
10923 is_output_symtab_index_set rather than needs_output_symtab_entry.
10924 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10925 rather than needs_output_symtab_entry. Call
10926 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10927 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10928 is_output_symtab_index_set rather than needs_output_symtab_entry.
10929 * testsuite/discard_locals_relocatable_test.c: New file.
10930 * testsuite/discard_locals_test.sh: Test -r.
10931 * testsuite/Makefile.am (check_DATA): Add
10932 discard_locals_relocatable_test1.syms,
10933 discard_local_relocatable_test2.syms.
10934 (MOSTLYCLEANFILES): Likewise. Also add
10935 discard_locals_relocatable_test1.lout and
10936 discard_locals_relocatable_test2.out.
10937 (discard_locals_relocatable_test1.syms): New target.
10938 (discard_locals_relocatable_test.o): New target.
10939 (discard_locals_relocatable_test1.out): New target.
10940 (discard_locals_relocatable_test2.syms): New target.
10941 (discard_locals_relocatable_test2.out): New target.
10942 (various): Add missing ../ld-new dependencies.
10943 * testsuite/Makefile.in: Rebuild.
10944
10945 2010-03-03 Nick Clifton <nickc@redhat.com>
10946
10947 * po/fi.po: New Finnish translation.
10948
10949 2010-03-01 Doug Kwan <dougkwan@google.com>
10950
10951 * layout.cc (Layout::Layout): Force section types of .init_array*,
10952 .preinit_array* and .fini_array* sections.
10953 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10954 Fix check of return value of std::string::find.().
10955 (Output_section::Input_section_sort_compare::operator()): Remove
10956 comment about .init_array.
10957 (Output_section::Input_section_sort_init_fini_compare::operator()):
10958 New method.
10959 (Output_section::sort_attached_input_sections): Handle .init_array
10960 and .fini_array specially.
10961 * output.h (Output_section::Inut_section_sort_compare): Update
10962 comment.
10963 (Output_section::Input_section_sort_init_fini_compare): New struct.
10964
10965 2010-02-26 Doug Kwan <dougkwan@google.com>
10966
10967 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10968 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10969 * testsuite/debug_msg.sh: Avoid matching source line number for
10970 use of global variable undef_int.
10971
10972 2010-02-26 Doug Kwan <dougkwan@google.com>
10973
10974 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10975 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10976 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10977 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10978 * options.cc (General_options::General_options): Initialize member
10979 fix_v4bx_.
10980 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10981 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10982 and rm_no_fix_v4bx.stdout
10983 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10984 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10985 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10986 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10987 and arm_no_fix_v4bx.
10988 * Makefile.in: Regenerate.
10989 * testsuite/arm_fix_v4bx.s: New file.
10990 * testsuite/arm_fix_v4bx.sh: Ditto.
10991
10992 2010-02-24 Doug Kwan <dougkwan@google.com>
10993
10994 * arm.cc (Target_arm::got_section): Make the .got section the first
10995 non RELRO section in the data segment.
10996 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10997 suffixes of section names.
10998
10999 2010-02-24 Doug Kwan <dougkwan@google.com>
11000
11001 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
11002 flags and attributes merging if an input file is a binary file.
11003 * fileread.cc (Input_file::open): Record format of original file.
11004 * fileread.h (Input_file::Format): New enum type.
11005 (Input_file::Input_file): Initialize data member format_.
11006 (Input_file::format): New method definition.
11007 (Input_file::format_):: New data member.
11008
11009 2010-02-24 Doug Kwan <dougkwan@google.com>
11010
11011 * arm.cc (Arm_output_data_got): New class.
11012 (ARM_TCB_SIZE): New constant
11013 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
11014 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
11015 If user uses a script with a SECTIONS clause, issue only a warning
11016 for a misplaced EXIDX input section. Otherwise, issue an error.
11017 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
11018 garbage collection.
11019 (Target_arm::got_mode_index_entry): Handle static linking.
11020 (Target_arm::Scan::local): Ditto.
11021 (Target_arm::Scan::global): Ditto.
11022 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
11023 all incorrectly implemented relocations.
11024 (Target_arm::fix_exidx_coverage): Pass layout to
11025 Arm_output_section::fix_exidx_coverage.
11026 * layout.cc (Layout::section_name_mapping): Remove trailing dots
11027 from ".ARM.exidx." and ".ARM.extab.".
11028
11029 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11030
11031 * arm.cc (Target_arm::do_finalize_sections): Create attribute
11032 section if it does not already exist.
11033 * attributes.cc (Attributes_section_data::Attributes_section_data):
11034 Don't crash if size is zero.
11035
11036 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11037 Ian Lance Taylor <iant@google.com>
11038
11039 * gold.cc (queue_middle_tasks): If no input files were opened,
11040 exit.
11041 * workqueue.h (Task_function::Task_function): Assert that there is
11042 a blocker.
11043
11044 2010-02-22 Doug Kwan <dougkwan@google.com>
11045
11046 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
11047 * icf.cc (get_section_contents): Cast snprintf arguments to long long
11048 types to avoid warnings due to different uint64_t implementations
11049 on different hosts.
11050
11051 2010-02-21 Doug Kwan <dougkwan@google.com>
11052
11053 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
11054 handling of the maximum backward branch offset.
11055 (Arm_relocate_functions::thumb_branch_common): Ditto.
11056 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
11057 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
11058 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
11059 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11060 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11061 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11062 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11063 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11064 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11065 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11066 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11067 thumb2_bl_out_of_range.o): New rules.
11068 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11069 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11070 thumb2_bl_out_of_range
11071 * testsuite/Makefile.in: Regenerate.
11072 * testsuite/arm_bl_in_range.s: New file.
11073 * testsuite/arm_bl_out_of_range.s: Ditto.
11074 * testsuite/arm_branch_in_range.sh: Ditto.
11075 * testsuite/arm_branch_range.t: Ditto.
11076 * testsuite/thumb2_branch_range.t: Ditto.
11077 * testsuite/thumb_bl_in_range.s: Ditto.
11078 * testsuite/thumb_bl_out_of_range.s: Ditto.
11079 * testsuite/thumb_branch_range.t: Ditto.
11080
11081 2010-02-20 Sriraman Tallam <tmsriram@google.com>
11082
11083 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11084 Add reloc offset information.
11085 * icf.cc (get_section_contents): Change iterators to point to the new
11086 vectors. Add reloc offset information to the contents.
11087 * icf.h (Icf::Sections_reachable_info): New typedef.
11088 (Icf::Sections_reachable_list): New typedef.
11089 (Icf::Offset_info): New typedef.
11090 (Icf::Reloc_info): New struct typedef.
11091 (Icf::Reloc_info_list): New typedef.
11092 (Icf::symbol_reloc_list): Delete method.
11093 (Icf::addend_reloc_list): Delete method.
11094 (Icf::section_reloc_list): Delete method.
11095 (Icf::reloc_info_list): New method.
11096 (Icf::reloc_info_list_): New member.
11097
11098 2010-02-19 Doug Kwan <dougkwan@google.com>
11099
11100 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11101 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11102 * arm.cc (Arm_relocation_functions): New forward declaration.
11103 (Target_arm::Target_arm): Initialize new data members
11104 got_mod_index_offset_ and tls_base_symbol_defined_.
11105 (Target_arm::Relocate::relocate_tls): New method.
11106 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11107 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11108 New methods.
11109 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
11110 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11111 (Target_arm::got_mod_index_offset_,
11112 Target_arm::tls_base_symbol_defined_): New data members.
11113 (Target_arm::Scan::local, Target::Scan::global,
11114 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11115 relocations.
11116
11117 2010-02-18 Doug Kwan <dougkwan@google.com>
11118
11119 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11120 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11121 text section as a parameter becuase some broken tools may not set
11122 the link in section header.
11123 (Target_arm::has_got_section): New method.
11124 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11125 without any mapping symbol as data only. Remove warning.
11126 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11127 link in its section header, try to discover the link by inspecting the
11128 REL31 relocation at the beginning of the section.
11129 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11130 in error message.
11131 (Target_arm::Scan::global): Treat any reference to the symbol
11132 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11133
11134 2010-02-12 Sriraman Tallam <tmsriram@google.com>
11135
11136 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11137 (Scan::global_reloc_may_be_function_pointer): New function.
11138 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11139 (Scan::global_reloc_may_be_function_pointer): New function.
11140 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11141 (Scan::global_reloc_may_be_function_pointer): New function.
11142 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11143 (Scan::global_reloc_may_be_function_pointer): New function.
11144 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11145 (Scan::global_reloc_may_be_function_pointer): New function.
11146 (Scan::possible_function_pointer_reloc): New function.
11147 (Target_x86_64::can_check_for_function_pointers): New function.
11148 * gc.h (gc_process_relocs): Scan relocation types to determine if
11149 function pointers were taken for targets that support it.
11150 * icf.cc (Icf::find_identical_sections): Include functions for
11151 folding in safe ICF whose pointer is not taken.
11152 * icf.h (Secn_fptr_taken_set): New typedef.
11153 (fptr_section_id_): New member.
11154 (section_has_function_pointers): New function.
11155 (set_section_has_function_pointers): New function.
11156 (check_section_for_function_pointers): New function.
11157 * options.h: Fix comment for safe ICF option.
11158 * target.h (can_check_for_function_pointers): New function.
11159 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11160 Modify icf_safe_test for X86-64.
11161 * testsuite/Makefile.in: Regenerate.
11162 * testsuite/icf_safe_so_test.cc: New file.
11163 * testsuite/icf_safe_so_test.sh: New file.
11164 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11165 (main): Change to take pointer to function kept_func_3.
11166 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11167 folding is done correctly for X86-64.
11168
11169 2010-02-12 David S. Miller <davem@davemloft.net>
11170
11171 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11172 is_symbolless parameter.
11173 (Output_reloc<SHT_REL>::is_symbolless): New.
11174 (Output_reloc<SHT_REL>::is_symbolless_): New.
11175 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11176 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11177 (Output_reloc<SHT_RELA>::is_symbolless): New.
11178 (Output_data_reloc::add_global): Handle is_symbolless.
11179 (Output_data_reloc::add_global_relative): Likewise.
11180 (Output_data_reloc::add_local): Likewise.
11181 (Output_data_reloc::add_local_relative): Likewise.
11182 (Output_data_reloc::add_symbolless_global_addend): New.
11183 (Output_data_reloc::add_symbolless_local_addend): New.
11184 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11185 is_symbolless.
11186 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11187 instead of ->is_relative_
11188 (Output_reloc::write): Likewise.
11189 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11190 (Output_reloc::write_rel): Simplify.
11191
11192 * sparc.cc (Target_sparc::Scan::local): Use
11193 ->add_symbolless_local_addend as needed.
11194 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11195 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11196 based upon relocation offset.
11197
11198 2010-02-11 Doug Kwan <dougkwan@google.com>
11199
11200 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11201 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11202 beginning of function.
11203 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11204 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11205 parameter is_32bit in calls to should_apply_static_reloc.
11206 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11207 (check_DATA): Add arm_abs_global.stdout.
11208 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11209 arm_abs_global.stdout): New rules.
11210 (MOSTLLYCLEANFILES): Add arm_abs_global
11211 * Makefile.in: Regenerate.
11212 * testsuite/arm_abs_global.s: New file.
11213 * testsuite/arm_abs_global.sh: Ditto.
11214 * testsuite/arm_abs_lib.s: Ditto.
11215
11216 2010-02-11 Ian Lance Taylor <iant@google.com>
11217
11218 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11219 Read_relocs task.
11220 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11221 Allocate_commons_task first.
11222 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11223 task, rather than symtab_lock_.
11224 (Gc_process_relocs::~Gc_process_relocs): New function.
11225 (Gc_process_relocs::is_runnable): Check this_blocker_.
11226 (Gc_process_relocs::locks): Use next_blocker_ rather than
11227 blocker_.
11228 (Scan_relocs::~Scan_relocs): New function.
11229 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11230 symtab_lock_.
11231 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11232 next_blocker_.
11233 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11234 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11235 constructor accordingly.
11236 (class Gc_process_relocs): Likewise.
11237 (class Scan_relocs): Likewise.
11238 * common.h (class Allocate_commons_task): Remove symtab_lock_
11239 field, and corresponding constructor parameter.
11240 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11241 symtab_lock_.
11242 (Allocate_commons_task::locks): Likewise.
11243
11244 2010-02-11 Ian Lance Taylor <iant@google.com>
11245
11246 * gold-threads.h (class Once): Define.
11247 (class Initialize_lock): Rewrite as child of Once.
11248 * gold-threads.cc (class Once_initialize): Define.
11249 (once_pointer_control): New static variable.
11250 (once_pointer, once_arg): New static variables.
11251 (c_run_once): New static function.
11252 (Once::Once, Once::run_once, Once::internal_run): New functions.
11253 (class Initialize_lock_once): Remove.
11254 (initialize_lock_control): Remove.
11255 (initialize_lock_pointer): Remove.
11256 (initialize_lock_once): Remove.
11257 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11258 (Initialize_lock::initialize): Rewrite.
11259 (Initialize_lock::do_run_once): New function.
11260 * archive.cc (Archive::interpret_header): Only clear name if it is
11261 not already empty.
11262 * fileread.cc: Include "gold-threads.h"
11263 (file_counts_lock): New static variable.
11264 (file_counts_initialize_lock): Likewise.
11265 (File_read::release): Only increment counts when using --stats.
11266 Use a lock around the increment.
11267 * parameters.cc (class Set_parameters_target_once): Define.
11268 (set_parameters_target_once): New static variable.
11269 (Parameters::Parameters): Move here from parameters.h.
11270 (Parameters::set_target): Rewrite.
11271 (Parameters::set_target_once): New function.
11272 (Parameters::clear_target): Move here and rewrite.
11273 * parameters.h (class Parameters): Update declarations. Add
11274 set_parameters_target_once_ field.
11275 (Parameters::Parameters): Move to parameters.cc.
11276 (Parameters::clear_target): Likewise.
11277 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11278 task.
11279 (Start_group::~Start_group): New function.
11280 (Start_group::is_runnable): New function.
11281 (Start_group::locks, Start_group::run): New functions.
11282 (Finish_group::run): Change saw_undefined to size_t.
11283 * readsyms.h (class Start_group): Define.
11284 (class Finish_group): Change saw_undefined_ field to size_t.
11285 (Finish_group::Finish_group): Remove saw_undefined and
11286 this_blocker parameters. Change all callers.
11287 (Finish_group::set_saw_undefined): New function.
11288 (Finish_group::set_blocker): New function.
11289 * symtab.h (class Symbol_table): Change saw_undefined to return
11290 size_t. Change saw_undefined_ field to size_t.
11291 * target-select.cc (Set_target_once::do_run_once): New function.
11292 (Target_selector::Target_selector): Initialize set_target_once_
11293 field. Don't initialize lock_ and initialize_lock_ fields.
11294 (Target_selector::instantiate_target): Rewrite.
11295 (Target_selector::set_target): New function.
11296 * target-select.h (class Set_target_once): Define.
11297 (class Target_selector): Update declarations. Make
11298 Set_target_once a friend. Remove lock_ and initialize_lock_
11299 fields. Add set_target_once_ field.
11300
11301 2010-02-10 Ian Lance Taylor <iant@google.com>
11302
11303 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11304 queueing any tasks.
11305 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11306 (queue_middle_tasks): Add all blockers before queueing any tasks.
11307 (queue_final_tasks): Likewise.
11308 * token.h (Task_token::add_blockers): New function.
11309 * object.h (Input_objects::number_of_relobjs): New function.
11310
11311 2010-02-10 Ian Lance Taylor <iant@google.com>
11312
11313 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11314 shared, not if not position independent.
11315 * x86_64.cc (Relocate::relocate_tls): Likewise.
11316 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11317 (tls_pie_pic_test): New target.
11318 * testsuite/Makefile.in: Rebuild.
11319
11320 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11321 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11322 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11323 * testsuite/Makefile.in: Rebuild.
11324
11325 2010-02-09 David S. Miller <davem@davemloft.net>
11326
11327 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11328 R_SPARC_RELATIVE using ->add_local_relative().
11329 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11330
11331 * output.h (Output_data_dynamic::add_section_size): New method
11332 that takes two Output_data objects.
11333 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11334 entry param. Handle it in initializers.
11335 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11336 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11337 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11338 arg.
11339 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11340 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11341 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11342 for dynrel_includes_plt.
11343 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11344 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11345 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11346 before .rela.plt
11347 (Target_sparc::do_finalize_sections): Update to pass true for
11348 dynrel_includes_plt.
11349 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11350 output before .rela.plt
11351 (Target_powerpc::do_finalize_sections): Update to pass true for
11352 dynrel_includes_plt when 32-bit.
11353
11354 2010-02-08 Doug Kwan <dougkwan@google.com>
11355
11356 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11357 method.
11358 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11359 Arm_relobj::scan_section_for_cortex_a8_stubs,
11360 Arm_relobj::do_relocation_section): Instead of calling
11361 Output_section::output_address, use faster
11362 Arm_relobj::simple_input_section_output_address.
11363
11364 2010-02-08 David S. Miller <davem@davemloft.net>
11365
11366 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11367 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11368 relocation helper function.
11369
11370 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11371 just like R_SPARC_GOT{10,13,22}.
11372 (Target_sparc::Scan::local): Likewise.
11373 (Target_sparc::Relocate:relocate): Likewise.
11374
11375 2010-02-06 Ian Lance Taylor <iant@google.com>
11376
11377 * configure.ac: Rewrite targetobjs duplicate removal code to use
11378 only shell constructs.
11379 * configure: Rebuild.
11380
11381 2010-02-05 Doug Kwan <dougkwan@google.com>
11382
11383 PR 11247
11384 * arm.cc (Arm_relobj::section_is_scannable): New method.
11385 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11386 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11387
11388 2010-02-04 Doug Kwan <dougkwan@google.com>
11389
11390 PR 11247
11391 * arm-reloc-property.cc (cstdio): Include.
11392 * configure.ac (targetobjs): Remove duplicates.
11393 * configure: Regenerate.
11394 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11395 big and little endian version for a given address size.
11396
11397 2010-02-03 Doug Kwan <dougkwan@google.com>
11398
11399 * arm-reloc-property.cc
11400 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11401 definition.
11402 * arm-reloc-property.h
11403 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11404 New method definition.
11405 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11406 declaration.
11407 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11408 overflow to N.
11409 (GOT_PREL): Change implemented to Y.
11410 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11411 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11412 (Arm_relocate_functions::movw_abs_nc): Remove method.
11413 (Arm_relocate_functions::movt_abs): Ditto.
11414 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11415 (Arm_relocate_functions::thm_movt_abs): Ditto.
11416 (Arm_relocate_functions::movw_rel_nc): Ditto.
11417 (Arm_relocate_functions::movw_rel): Ditto.
11418 (Arm_relocate_functions::movt_rel): Ditto.
11419 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11420 (Arm_relocate_functions:thm_movw_rel): Ditto.
11421 (Arm_relocate_functions:thm_movt_rel): Ditto.
11422 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11423 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11424 New method definitions.
11425 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11426 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11427 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11428 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11429 (Target_arm::Relocate::relocate): Check for non-static or
11430 unimplemented relocation code and exit early. Change calls to
11431 Target_arm::reloc_uses_thumb_bit and
11432 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11433 instead. Refactor code to handle similar relocations to increase
11434 code sharing. Remove check for unsupported relocation code in switch
11435 statement.
11436 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11437 relocation property table to find out size. Change error message to
11438 print out the name of a relocation code instead of the numeric value.
11439 (Target_arm::scan_reloc_for_stub): Use relocation property table
11440 instead of calling Target_arm::reloc_uses_thumb_bit().
11441
11442 2010-02-02 Doug Kwan <dougkwan@google.com>
11443
11444 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11445 types of relaxed input section.
11446
11447 2010-02-02 Doug Kwan <dougkwan@google.com>
11448
11449 * Makefile.am (HFILES): Add arm-reloc-property.h.
11450 (DEFFILES): New.
11451 (TARGETSOURCES): Add arm-reloc-property.cc
11452 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11453 (libgold_a_SOURCES): $(DEFFILES)
11454 * Makefile.in: Regenerate.
11455 * arm-reloc-property.cc: New file.
11456 * arm-reloc-property.h: New file.
11457 * arm-reloc.def: New file.
11458 * arm.cc: Update comments.
11459 (arm-reloc-property.h): New included header.
11460 (arm_reloc_property_table): New global variable.
11461 (Target_arm::do_select_as_default_target): New method definition.
11462 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11463 arm-reloc-property to targ_extra_obj.
11464 * parameters.cc (set_parameters_target): Call
11465 Target::select_as_default_target().
11466 * target.h (Target::select_as_default_target): New method definition.
11467 (Target::do_select_as_default_target): Same.
11468
11469 2010-02-01 Doug Kwan <dougkwan@google.com>
11470
11471 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11472 first_output_text_section_.
11473 (Arm_exidx_fixup::first_output_text_section): New method definition.
11474 (Arm_exidx_fixup::first_output_text_section_): New data member.
11475 (Arm_exidx_fixup::process_exidx_section): Record the first text
11476 output section seen.
11477 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11478 and entsize in output section header.
11479
11480 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11481
11482 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11483 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11484 (Arm_relocate_functions::thm_alu11): New Method.
11485 (Arm_relocate_functions::thm_pc8): New Method.
11486 (Arm_relocate_functions::thm_pc12): New Method.
11487 (Target_arm::Scan::local): Handle the relocations.
11488 (Target_arm::Scan::global): Likewise.
11489 (Target_arm::Relocate::relocate): Likewise.
11490 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11491
11492 2010-01-29 Doug Kwan <dougkwan@google.com>
11493
11494 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11495 of relocation types as ld.
11496
11497 2010-01-29 Doug Kwan <dougkwan@google.com>
11498
11499 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11500 to public.
11501 (Arm_relocate_functions::thumb_branch_common): Ditto.
11502 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11503 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11504 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11505 Arm_relocate_functions::jump24): Remove.
11506 (Target_arm::Relocate::relocate): Adjust code to call
11507 Arm_relocation_functions::arm_branch_common and
11508 Arm_relocation_functions::thumb_branch_common instead of their removed
11509 wrappers. Merge switch-cases together to reduce source code size.
11510
11511 2010-01-29 Doug Kwan <dougkwan@google.com>
11512
11513 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11514 output_local_symbol_count_needs_update_.
11515 (Arm_relobj::output_local_symbol_count_needs_update,
11516 Arm_relobj::set_output_local_symbol_count_needs_update,
11517 Arm_relobj::update_output_local_symbol_count): New methods.
11518 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11519 member.
11520 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11521 of pointed function as in a R_ARM_PREL31 relocation.
11522 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11523 for output local symbol count updating.
11524 (Target_arm::do_relax): Update output local symbol counts in objects
11525 if necessary.
11526 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11527
11528 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11529
11530 * arm.cc: Added support for the ARM relocations:
11531 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11532 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11533 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11534 movw_prel_nc).
11535 (Arm_relocate_functions::movw_rel): New method.
11536 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11537 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11538 thm_movw_prel_nc).
11539 (Arm_relocate_functions::thm_movw_rel): New method.
11540 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11541 thm_movt_prel).
11542 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11543 relocations.
11544 (Target_arm::Scan::global): Likewise.
11545 (Target_arm::Relocate::relocate): Likewise.
11546 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11547 Likewise.
11548
11549 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11550
11551 * arm.cc: Added support for ARM group relocations.
11552 (Target_arm::reloc_needs_sym_origin): New method.
11553 (Arm_relocate_functions::calc_grp_kn): New method.
11554 (Arm_relocate_functions::calc_grp_residual): New method.
11555 (Arm_relocate_functions::calc_grp_gn): New method.
11556 (Arm_relocate_functions::arm_grp_alu): New Method.
11557 (Arm_relocate_functions::arm_grp_ldr): New Method.
11558 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11559 (Arm_relocate_functions::arm_grp_ldc): New Method.
11560 (Target_arm::Scan::local): Handle the ARM group relocations.
11561 (Target_arm::Scan::global): Likewise.
11562 (Target_arm::Relocate::relocate): Likewise.
11563 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11564 Likewise.
11565
11566 2010-01-26 Doug Kwan <dougkwan@google.com>
11567
11568 * arm.cc (set): Include.
11569 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11570 pointer type.
11571 (Arm_output_section::Text_section_list): New type.
11572 (Arm_output_section::append_text_sections_to_list): New method.
11573 (Arm_output_section::fix_exidx_coverage): Ditto.
11574 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11575 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11576 Relobj::set_section_offset() instead of
11577 Sized_relobj::invalidate_section_offset().
11578 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11579 parameter for section headers. Ignore relocation sections for
11580 unallocated sections and EXIDX sections.
11581 (Target_arm::fix_exidx_coverage): New method.
11582 (Target_arm::output_section_address_less_than): New type.
11583 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11584 linked text section instead of the EXIDX section.
11585 (Arm_output_section::create_stub_group): Add an assertion to check
11586 that this is not an EXIDX output section.
11587 (Arm_output_section::append_text_sections_to_list): New method.
11588 (Arm_output_section::fix_exidx_coverage): Ditto.
11589 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11590 Arm_relobj::section_needs_reloc_stub_scanning.
11591 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11592 first pass.
11593 (Target_arm::fix_exidx_coverage): New method.
11594 * object.h (Relobj::set_output_section): New method.
11595 (Sized_relobj::invalidate_section_offset): Remove method.
11596 (Sized_relobj::do_invalidate_section_offset): Remove method.
11597 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11598
11599 2010-01-25 Doug Kwan <dougkwan@google.com>
11600
11601 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11602 Fix warning due to signed and unsigned comparison on a 32-bit host.
11603
11604 2010-01-22 Doug Kwan <dougkwan@google.com>
11605
11606 * arm.cc (Target_arm::do_relax): Record an output section for section
11607 offset adjustment it contains any stub table that has changed.
11608 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11609 offsets in an output section if necessary.
11610 * output.cc (Output_section::Output_section): Initialize
11611 section_offsets_need_adjustments_.
11612 (Output_section::add_input_section_for_script): Renamed to
11613 Output_section::add_simple_input_section.
11614 (Output_section::save_states): Add a comment.
11615 (Output_section::discard_states): New method defintion.
11616 (Output_section::adjust_section_offsets): Same.
11617 * output.h (Output_section::add_input_section_for_script): Renamed to
11618 Output_section::add_simple_input_section.
11619 (Output_section::discard_states): New method declaration.
11620 (Output_section::adjust_section_offsets): Same.
11621 (Output_section::section_offsets_need_adjustment,
11622 Output_section::set_section_offsets_need_adjustment): New method
11623 definitions.
11624 (Output_section::section_offsets_need_adjustment_): New data member.
11625 * script-sections.cc
11626 (Output_section_element_input::set_section_address): Adjust code for
11627 renaming of Output_section::add_input_section_for_script.
11628 (Orphan_output_section::set_section_address): Same.
11629
11630 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11631
11632 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11633 Fix_v4bx enum values .
11634 * gold/options.h (General_options): New option definitions.
11635 (General_options::fix_v4bx): New method.
11636 (General_options::Fix_v4bx): New enum.
11637 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11638 (General_options::parse_fix_v4bx_interworking): New method.
11639
11640 2010-01-22 Doug Kwan <dougkwan@google.com>
11641
11642 * arm.cc (Arm_exidx_fixup): New class.
11643
11644 2010-01-21 Doug Kwan <dougkwan@google.com>
11645
11646 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11647 classes.
11648 (Arm_exidx_section_offset_map): New type.
11649
11650 2010-01-21 Doug Kwan <dougkwan@google.com>
11651
11652 * arm.cc (Arm_exidx_input_section): New class.
11653 (Arm_relobj::exidx_input_section_by_link,
11654 Arm_relobj::exidx_input_section_by_shndx,
11655 Arm_relobj::make_exidx_input_section): New methods.
11656 (read_arm_attributes_section): Remove.
11657 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11658 information about them.
11659 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11660 to here.
11661
11662 2010-01-20 Doug Kwan <dougkwan@google.com>
11663
11664 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11665 Input_section_specifier to Section_id.
11666 (Target_arm::new_arm_input_section: Adjust code for change of key
11667 type.
11668 (Target_arm::find_arm_input_section): Ditto.
11669 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11670 (Section_id): Remove.
11671 (Garbage_collection::Section_id_hash): Remove.
11672 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11673 (Section_id): Remove.
11674 (Icf::Section_id_hash): Remove.
11675 * object.h (Section_id, Const_section_id, Section_id_hash,
11676 Const_section_id_hash): New type definitions.
11677 * output.cc (Output_section::add_relaxed_input_section): Change to
11678 use Const_section_id instead of Input_section_specifier as key type.
11679 (Output_section::add_merge_input_section): Ditto.
11680 (Output_section::build_relaxation_map): Change to use Section_id
11681 instead of Input_section_specifier as key type.
11682 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11683 Ditto.
11684 (Output_section::convert_input_sections_to_relaxed_sections): Change
11685 to use Const_section_id instead of Input_section_specifier as key type.
11686 (Output_section::find_merge_section): Ditto.
11687 (Output_section::find_relaxed_input_section): Ditto.
11688 * output.h (Input_section_specifier): Remove class.
11689 (Output_section::Output_section_data_by_input_section_map): Change
11690 key type to Const_section_id.
11691 (Output_section::Output_relaxed_input_section_by_input_section_map):
11692 Ditto.
11693 (Output_section::Relaxation_map): Change key type to Section_id.
11694
11695 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11696
11697 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11698 (class Arm_v4bx_stub): New class.
11699 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11700 (Stub_factory::make_arm_v4bx_stub): New method.
11701 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11702 (Stub_table::empty): Handle v4bx stubs.
11703 (Stub_table::add_arm_v4bx_stub): New method.
11704 (Stub_table::find_arm_v4bx_stub): New method.
11705 (Arm_relocate_functions::v4bx): New method.
11706 (Target_arm::fix_v4bx): New method.
11707 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11708 (Stub_table::relocate_stubs): Likewise.
11709 (Stub_table::do_write): Likewise.
11710 (Stub_table::update_data_size_and_addralign): Likewise.
11711 (Stub_table::finalize_stubs): Likewise.
11712 (Target_arm::Scan::local): Likewise.
11713 (Target_arm::Scan::global): Likewise.
11714 (Target_arm::do_finalize_sections): Likewise.
11715 (Target_arm::Relocate::relocate): Likewise.
11716 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11717 Likewise.
11718 (Target_arm::scan_reloc_for_stub): Likewise.
11719 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11720
11721 2010-01-19 Ian Lance Taylor <iant@google.com>
11722
11723 * output.cc (Output_section_headers::do_sized_write): Write large
11724 segment count to sh_info field.
11725 (Output_file_header::do_sized_write): For large segment count,
11726 write PN_XNUM to e_phnum field.
11727
11728 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11729
11730 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11731 (Arm_relocate_functions::thm_jump8): New function.
11732 (Arm_relocate_functions::thm_jump11): New function.
11733 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11734 R_ARM_THM_JUMP11.
11735 (Target_arm::Scan::global): Likewise.
11736 (Target_arm::Relocate::relocate): Likewise.
11737 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11738 Likewise.
11739
11740 2010-01-14 Doug Kwan <dougkwan@google.com>
11741
11742 * arm.cc (map, utility): Include headers.
11743 (Target_arm::apply_cortex_a8_workaround): New method.
11744 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11745 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11746 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11747 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11748 the --[no-]fix-cortex-a8 command line options.
11749 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11750 (Target_arm::relocate_stub): Use addend in instruction template.
11751 * options.h (DEFINE_bool): Set the user-set flag.
11752 (General_options): Add --[no-]-fix-cortex options.
11753 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11754 : Update fast look-up map after conversion.
11755
11756 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11757
11758 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11759 in the first pass of do_layout.
11760
11761 2010-01-13 Doug Kwan <dougkwan@google.com>
11762
11763 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11764 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11765 apparent compiler problem of not folding static constant integral
11766 data members of elfcpp::Elf_sizes<32>.
11767
11768 2010-01-13 Doug Kwan <dougkwan@google.com>
11769
11770 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11771 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11772 Arm_relobj::scan_section_for_cortex_a8_erratum,
11773 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11774 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11775 sections to scan for relocation stubs into a new method
11776 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11777 relocation and Cortex-A8 stub scanning.
11778 (Target_arm::do_relax): Force stubs to be after stubbed sections
11779 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11780 the beginning of a new relaxation pass. Update a comment.
11781 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11782
11783 2010-01-12 Ian Lance Taylor <iant@google.com>
11784
11785 * target-reloc.h (visibility_error): New inline function.
11786 (relocate_section): Call visibility_error.
11787 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11788 (MOSTLYCLEANFILES): Likewise.
11789 (protected_4_pic.o, protected_3.err): New targets.
11790 * testsuite/protected_4.cc: New file.
11791
11792 2010-01-12 Doug Kwan <dougkwan@google.com>
11793
11794 * arm.cc (Cortex_a8_reloc): New class.
11795 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11796 and cortex_a8_relocs_info_.
11797 (Target_arm::fix_cortex_a8): New method definition.
11798 (Target_arm::Cortex_a8_relocs_info): New type.
11799 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11800 New data member declarations.
11801 (Target_arm::scan_reloc_for_stub): Record information about
11802 relocations for THUMB branches that might be exempted from the
11803 Cortex-A8 workaround.
11804 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11805 at the beginning of a relaxation pass.
11806
11807 2010-01-12 Doug Kwan <dougkwan@google.com>
11808
11809 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11810 (Arm_relobj::Mapping_symbol_position,
11811 Arm_reloj::Mapping_symbol_position_less,
11812 Arm_relobj::Mapping_symbols_info): New types.
11813 (Target_arm::is_mapping_symbol_name): New method definition.
11814 (Arm_relobj::do_count_local_symbols): Save information about mapping
11815 symbols.
11816
11817 2010-01-11 Doug Kwan <dougkwan@google.com>
11818
11819 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11820 Arm_relocate_functions::thumb32_branch_upper,
11821 Arm_relocate_functions::thumb32_branch_lower,
11822 Arm_relocate_functions::thumb32_cond_branch_offset,
11823 Arm_relocate_functions::thumb32_cond_branch_upper,
11824 Arm_relocate_functions::thumb32_cond_branch_lower,
11825 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11826 branch offset encoding.
11827 (Arm_relocate_functions::thumb_branch_common): Use new branch
11828 offset encoding methods to avoid code duplication.
11829 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11830 (Stub_addend_reader::operator()): Use new branch encoding method
11831 to avoid code duplication.
11832
11833 2010-01-11 Doug Kwan <dougkwan@google.com>
11834
11835 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11836 (Target_arm::do_finalize_sections): Define special EXIDX section
11837 symbols only if referenced.
11838 * gc.h (Garbage_collection::add_reference): New method.
11839 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11840 code duplication.
11841
11842 2010-01-11 Ian Lance Taylor <iant@google.com>
11843
11844 * script.cc (Version_script_info::build_expression_list_lookup):
11845 Change complaing about duplicate wildcard match from error to
11846 warning.
11847
11848 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11849 of 2009-12-30.
11850 (Version_script_info::Version_script_info): Initialize globs_,
11851 default_version_, default_is_global_, and exact_. Don't
11852 initialize globals_ or locals_.
11853 (Version_script_info::build_lookup_tables): Build local symbols
11854 first.
11855 (Version_script_info::unquote): New function.
11856 (Version_script_info::add_exact_match): New function.
11857 (Version_script_info::build_expression_list_lookup): Remove lookup
11858 parameter. Add is_global parameter. Change all callers. Handle
11859 wildcard pattern specially. Unquote pattern. Call
11860 add_exact_match.
11861 (Version_script_info::get_name_to_match): New function.
11862 (Version_script_info::get_symbol_version): New function.
11863 (Version_script_info::get_symbol_version_helper): Remove.
11864 (Version_script_info::check_unmatched_names): Call unquote.
11865 * script.h (class Version_script_info): Change get_symbol_version
11866 to be non-inline and add is_global parameter; change all callers.
11867 Rewrite symbol_is_local. Update declarations. Define struct
11868 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11869 Remove globals_ and locals_ members. Add exact_, globs_,
11870 default_version_, is_global_.
11871 (Version_script_info::Glob): Remove pattern, add expression and
11872 is_global. Update constructor. Change all callers.
11873 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11874 default version.
11875 (Versions::symbol_section_contents): If a symbol is undefined, or
11876 defined in a dynamic object, set the version index to
11877 VER_NDX_LOCAL.
11878 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11879 symbol_is_local.
11880 (Symbol_table::add_from_pluginobj): Likewise.
11881 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11882
11883 2010-01-11 Doug Kwan <dougkwan@google.com>
11884
11885 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11886 (incremental_dump_LDADD): Add linking option for libintl.
11887 * Makefile.in: Regenerate.
11888
11889 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11890
11891 PR gold/11144
11892 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11893 instead of -Ds.
11894 * testsuite/Makefile.in: Regenerated.
11895
11896 2010-01-10 Doug Kwan <dougkwan@google.com>
11897
11898 * options.h (DEFINE_var): Use parentheses around argument varname__
11899 in macro body to avoid any unintended subsequent substitutions.
11900
11901 2010-01-10 Ian Lance Taylor <iant@google.com>
11902
11903 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11904 candidates before doing symbol resolution.
11905
11906 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11907 ODR candidates if only one is weak.
11908
11909 2010-01-08 Ian Lance Taylor <iant@google.com>
11910
11911 * script.cc (Version_script_info::build_expression_list_lookup):
11912 Don't warn about ambiguous version, just record the ambiguity.
11913 (Version_script_info::get_symbol_version_helper): Give error if
11914 version is ambiguous.
11915
11916 2010-01-08 Doug Kwan <dougkwan@google.com>
11917
11918 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11919 prev_data_size_ and prev_addralign_. Remove initializer for
11920 deleted data member has_been_changed_.
11921 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11922 to determine if the table is empty.
11923 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11924 Remove.
11925 (Stub_table::add_reloc_stub): Define method in class definition
11926 instead of just declaring it there.
11927 (Stub_table::add_cortex_a8_stub): New method definition.
11928 (Stub_table::update_data_size_and_addralign): Ditto.
11929 (Stub_table::finalize_stubs): Ditto.
11930 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11931 (Stub_table::do_addralign_): Return address alignment in the
11932 (Stub_table::do_reset_address_and_file_offset): Define method in
11933 class definition instead of declaring it there. Set current data
11934 size to be the data size of the previous pass.
11935 (Stub_table::set_final_data_size): Use current data size as the
11936 final data size.
11937 (Stub_table::relocate_stub): Change parameter type of stub from
11938 Reloc_stub pointer to Stub pointer.
11939 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11940 (Stub_table::Cortex_a8_stub_list): New typedef.
11941 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11942 Stub_table::prev_addralign_): New data member.
11943 (Arm_relobj::Arm_relobj): Initialize data member
11944 section_has_cortex_a8_workaround_.
11945 (Arm_relobj::section_has_cortex_a8_workaround,
11946 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11947 definitions.
11948 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11949 declarations.
11950 (Target_arm::relocate_stub): Change parameter type of stub from
11951 Reloc_stub pointer to Stub pointer.
11952 (Insn_template::size, Insn_template::alignment): Handle
11953 THUMB16_SPECIAL_TYPE.
11954 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11955 Stub_table::update_data_size_and_addralign,
11956 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11957 definitions.
11958 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11959 (Stub_table::do_write): Ditto.
11960 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11961
11962 2010-01-08 Ian Lance Taylor <iant@google.com>
11963
11964 PR 11108
11965 * symtab.h (class Symbol): Remove fields is_target_special_ and
11966 has_plt_offset_. Add field is_defined_in_discarded_section_.
11967 (Symbol::is_defined_in_discarded_section): New function.
11968 (Symbol::set_is_defined_in_discarded_section): New function.
11969 (Symbol::has_plt_offset): Rewrite.
11970 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11971 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11972 Don't initialize is_target_special_ or has_plt_offset_.
11973 Initialize is_defined_in_discarded_section_.
11974 (Symbol_table::add_from_relobj): If appropriate, set
11975 is_defined_in_discarded_section.
11976 * resolve.cc (Symbol::override_base_with_special): Don't test
11977 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11978 * target-reloc.h (relocate_section): Do special handling for
11979 symbols defined in discarded sections for global symbols as well
11980 as local symbols.
11981
11982 2010-01-08 Ian Lance Taylor <iant@google.com>
11983
11984 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11985 the SHT_SYMTAB case.
11986
11987 2010-01-08 Ian Lance Taylor <iant@google.com>
11988
11989 * object.cc (Sized_relobj::do_layout): Don't get confused if
11990 layout_eh_frame returns NULL.
11991
11992 2010-01-08 Ian Lance Taylor <iant@google.com>
11993
11994 PR 11084
11995 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11996 dynamic symbol table, use the normal symbol table.
11997 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11998 symbol table.
11999
12000 2010-01-08 Ian Lance Taylor <iant@google.com>
12001
12002 PR 11072
12003 * layout.cc (Layout::include_section): Remove .gnu_debuglink
12004 sections.
12005
12006 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
12007
12008 * version.cc (print_version): Change to "Copyright 2010".
12009
12010 2010-01-08 Ian Lance Taylor <iant@google.com>
12011
12012 PR 10287
12013 PR 11063
12014 * i386.cc (class Target_i386): Change return type of plt_section
12015 to be non-const.
12016 (class Output_data_plt_i386): Add tls_desc_rel_ field.
12017 (Output_data_plt_i386::Output_data_plt_i386): Initialize
12018 tls_desc_rel_ field.
12019 (Output_data_plt_i386::rel_tls_desc): New function.
12020 (Target_i386::rel_tls_desc_section): New function.
12021 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
12022 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
12023 R_386_TLS_DESC reloc in rel_tls_desc_section.
12024 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
12025 Define struct Tlsdesc_info.
12026 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
12027 (Target_x86_64::do_reloc_symbol_index): New function.
12028 (Target_x86_64::add_tlsdesc_info): New function.
12029 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
12030 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
12031 tlsdesc_rel_ field.
12032 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
12033 all callers.
12034 (Output_data_plt_x86_64::rela_tlsdesc): New function.
12035 (Target_x86_64::rela_tlsdesc_section): New function.
12036 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
12037 handling.
12038 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
12039 (Target_x86_64::do_reloc_addend): New function.
12040 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
12041 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
12042 declarations. Define TARGET_CODE. Add arg field to u1_ union.
12043 (Output_reloc::type): New function.
12044 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
12045 (Output_reloc::is_target_specific): New function.
12046 (Output_reloc::target_arg): New function.
12047 (class Output_reloc) [SHT_RELA]: Add four new constructors for
12048 absolute relocs and target specific relocs.
12049 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
12050 add_target_specific.
12051 (class Output_data_reloc) [SHT_RELA]: Likewise.
12052 * output.cc (Output_reloc::Output_reloc): Add four new versions
12053 for absolute relocs and target specific relocs.
12054 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
12055 (Output_reloc::get_symbol_index): Likewise.
12056 (Output_reloc::local_section_offset): Check that local_sym_index_
12057 is not TARGET_CODE or 0.
12058 (Output_reloc::symbol_value): Likewise.
12059 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12060 reloc.
12061 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12062 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12063 functions.
12064 * layout.cc (add_target_dynamic_tags): Use output section for
12065 DT_PLTRELSZ and DT_JMPREL.
12066
12067 2010-01-07 Ian Lance Taylor <iant@google.com>
12068
12069 PR 11061
12070 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12071 function.
12072 (class Output_data_reloc_generic): Define.
12073 (class Output_data_reloc_base): Change base class to
12074 Output_data_reloc_generic. Change add() method to call
12075 bump_relative_reloc_count for a relative reloc. Remove
12076 sort_relocs_ field.
12077 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12078 to sort_relocs().
12079 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12080 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12081 appropriate.
12082 * layout.h (class Layout): Update declaration.
12083
12084 2010-01-07 Ian Lance Taylor <iant@google.com>
12085
12086 * output.h (class Output_data): Add const version of
12087 output_section and do_output_section.
12088 (class Output_section_data): Add const version of
12089 do_output_section.
12090 (class Output_section): Likewise.
12091 * layout.cc (Layout::add_target_dynamic_tags): New function.
12092 * layout.h (class Layout): Update declarations.
12093 * arm.cc (Target_arm::do_finalize_sections): Use
12094 add_target_dynamic_tags.
12095 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12096 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12097 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12098 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12099
12100 2010-01-07 Ian Lance Taylor <iant@google.com>
12101
12102 PR 11042
12103 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12104 object as needed.
12105
12106 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12107 Ian Lance Taylor <iant@google.com>
12108
12109 PR 11019
12110 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12111 Xindex::read_symtab_xindex.
12112
12113 2010-01-07 Doug Kwan <dougkwan@google.com>
12114
12115 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12116 (Insn_template::thumb16_bcond_insn): New method declaration.
12117 (Insn_template): Fix spelling.
12118 (Stub::thumb16_special): New method declaration.
12119 (Stub::do_write): Define virtual method which was previously pure
12120 virtual.
12121 (Stub::do_thumb16_special): New method declaration.
12122 (Stub::do_fixed_endian_write): New template member.
12123 (Reloc_stub::do_write): Remove.
12124 (Reloc_stub::do_fixed_endian_write): Remove.
12125 (Cortex_a8_stub): New class definition.
12126 (Stub_factory::make_cortex_a8_stub): New method definition.
12127 (Stub_factory::Stub_factory): Add missing static storage class
12128 qualifier for elf32_arm_stub_a8_veneer_blx.
12129
12130 2010-01-07 Ian Lance Taylor <iant@google.com>
12131
12132 PR 10980
12133 * options.h (class General_options): Add --warn-unresolved-symbols
12134 and --error-unresolved-symbols.
12135 * errors.cc (Errors::undefined_symbol): Implement
12136 --warn-unresolved-symbols.
12137
12138 * options.h (class General_options): Add -z text and -z textoff.
12139 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12140
12141 2010-01-06 Sriraman Tallam <tmsriram@google.com>
12142
12143 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12144 (Garbage_collection::cident_sections): New function.
12145 (Garbage_collection::add_cident_section): New function.
12146 (Garbage_collection::cident_sections_): New member.
12147 (gc_process_relocs): Add references to sections whose names are C
12148 identifiers.
12149 * gold.h (cident_section_start_prefix): New constant.
12150 (cident_section_stop_prefix): New constant.
12151 (is_cident): New function.
12152 * layout.cc (Layout::define_section_symbols): Replace string constants
12153 with the newly defined constants.
12154 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12155 C identifiers.
12156 * testsuite/Makefile.am: Add gc_orphan_section_test.
12157 * testsuite/Makefile.in: Regenerate.
12158 * testsuite/gc_orphan_section_test.cc: New file.
12159 * testsuite/gc_orphan_section_test.sh: New file.
12160
12161 2010-01-06 Ian Lance Taylor <iant@google.com>
12162
12163 PR 10980
12164 * options.h (class General_options): Add --warn-shared-textrel.
12165 * layout.cc (Layout::finish_dynamic_section): Implement
12166 --warn-shared-textrel.
12167
12168 PR 10980
12169 * options.h (class General_options): Add --warn-multiple-gp.
12170
12171 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12172
12173 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12174 $(THREADSLIB) and $(LIBDL).
12175 * Makefile.in: Rebuild.
12176
12177 2010-01-06 Ian Lance Taylor <iant@google.com>
12178
12179 PR 10980
12180 * options.cc (General_options::parse_section_start): New function.
12181 (General_options::section_start): New function.
12182 (General_options::General_options): Initialize all members.
12183 * options.h: Include <map>
12184 (class General_options): Add --section-start. Add section_starts_
12185 member.
12186 * layout.cc (Layout::attach_allocated_section_to_segment): If
12187 --section-start was used, set the address of the segment. Remove
12188 local sort_sections.
12189 (Layout::relaxation_loop_body): If the address of the load segment
12190 has been set by --section-start, don't use it.
12191 * output.h (Output_segment::update_flags_for_output_section): New
12192 function.
12193 * output.cc (Output_segment::add_output_section): Call
12194 update_flags_for_output_section.
12195
12196 2010-01-05 Ian Lance Taylor <iant@google.com>
12197
12198 PR 10980
12199 * options.h (class General_options): Add --undefined-version.
12200 * script.cc (struct Version_expression): Add was_matched_by_symbol
12201 field.
12202 (Version_script_info::matched_symbol): New function.
12203 (Version_script_info::get_symbol_version_helper): Call
12204 matched_symbol.
12205 (Version_script_info::check_unmatched_names): New function.
12206 * script.h (class Version_script_info): Update declarations.
12207 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12208
12209 * options.h (class General_options): Use DEFINE_bool_alias for
12210 allow_multiple_definition.
12211 * resolve.cc (Symbol_table::should_override): Don't test
12212 allow_multiple_definition.
12213
12214 PR 10980
12215 * options.h (class General_options): Add --cref.
12216 * main.cc (main): Print cref table if --cref. Don't close mapfile
12217 until after printing cref table.
12218 * cref.cc: Include "symtab.h".
12219 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12220 (Cref_table_compare::operator()): New function.
12221 (Cref_inputs::gather_cref): New function.
12222 (filecol): New static const.
12223 (Cref_inputs::print_cref): New function.
12224 (Cref::print_cref): New function.
12225 * cref.h: Include <cstdio>.
12226 (class Cref): Update declarations.
12227 * mapfile.h (Mapfile::file): New function.
12228 * object.h (class Object): Define Symbols. Declare virtual
12229 do_get_global_symbols.
12230 (Object::get_global_symbols): New function.
12231 * object.cc (Input_objects::add_object): Pass object to cref_ if
12232 --cref.
12233 (Input_objects::archive_start): Likewise.
12234 (Input_objects::archive_stop): Likewise.
12235 (Input_objects::print_cref): New function.
12236 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12237 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12238 --cref.
12239 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12240 function.
12241 * plugin.h (class Sized_pluginobj): Update declarations.
12242
12243 2010-01-05 Ian Lance Taylor <iant@google.com>
12244
12245 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12246 to is_default_version. Rename insdef to insdefault.
12247 (Symbol_table::add_from_relobj): Rename def to is_default_version
12248 and local to is_forced_local.
12249 (Symbol_table::add_from_pluginobj): Likewise.
12250 (Symbol_table::add_from_dynobj): Likewise.
12251 (Symbol_table::define_special_symbol): Rename insdef to
12252 insdefault.
12253
12254 2010-01-04 Ian Lance Taylor <iant@google.com>
12255
12256 PR 10980
12257 * options.h (class General_options): Add
12258 --allow-multiple-definition and -z muldefs.
12259 * resolve.cc (Symbol_table::should_override): Don't warn about a
12260 multiple symbol definition if --allow-multiple-definition or -z
12261 muldefs.
12262
12263 PR 10980
12264 * options.h (class General_options): Add --add-needed and
12265 --copy-dt-needed-entries. Tweak --as-needed help entry.
12266 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12267 error if --copy-dt-needed-entries aka --add-needed is used and
12268 would cause a change in behaviour.
12269
12270 PR 10980
12271 * options.h (class General_options): Add -G as a short version of
12272 --shared. Add no-op options -assert, -g, and -i.
12273
12274 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12275
12276 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12277 check for .text or .gnu.linkonce.t sections.
12278 * icf.cc (Icf::find_identical_sections): Ditto.
12279 Change the detection for mangled function name within the section
12280 name.
12281 * icf.h (is_section_foldable_candidate): New function.
12282
12283 2009-12-30 Ian Lance Taylor <iant@google.com>
12284
12285 PR 10980
12286 * options.h (class General_options): Permit two dashes with
12287 --retain-symbols-file.
12288
12289 2009-12-30 Ian Lance Taylor <iant@google.com>
12290
12291 PR 10979
12292 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12293 don't put the file header and segment headers in the text
12294 segment.
12295
12296 PR 10979
12297 * common.cc (Sort_commons::operator()): Stabilize sort when both
12298 entries are NULL.
12299 (Symbol_table::do_allocate_commons_list): When allocating common
12300 symbols, skip a symbol which is no longer common.
12301 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12302 an object before checking its type.
12303 * testsuite/common_test_2.c: New file.
12304 * testsuite/common_test_3.c: New file.
12305 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12306 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12307 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12308 (common_test_2_pic.o, common_test_2.so): New targets.
12309 (common_test_3_pic.o, common_test_3.so): New targets.
12310 * testsuite/Makefile.in: Rebuild.
12311
12312 PR 10979
12313 * script.cc (read_input_script): If we see a new SECTIONS clause,
12314 and we have added an input section, give an error.
12315 * layout.h (class Layout): Add have_added_input_section function.
12316 Add have_added_input_section_ field.
12317 * layout.cc (Layout::Layout): Initialize
12318 have_added_input_section_.
12319 (Layout::layout): Set have_added_input_section_.
12320 (Layout::layout_eh_frame): Likewise.
12321
12322 2009-12-30 Ian Lance Taylor <iant@google.com>
12323
12324 PR 10931
12325 * options.h (class General_options): Add --sort-common option.
12326 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12327 * common.cc (Sort_common): Add sort_order parameter to
12328 constructor. Add sort_order_ field.
12329 (Sort_commons::operator): Check sort_order_.
12330 (Symbol_table::allocate_commons): Determine the sort order.
12331 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12332 Change all callers.
12333 (Symbol_table::do_allocate_commons_list): Likewise.
12334
12335 2009-12-30 Ian Lance Taylor <iant@google.com>
12336
12337 PR 10916
12338 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12339 symbols from this object, don't change the visibility of an
12340 undefined symbol.
12341 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12342
12343 2009-12-30 Ian Lance Taylor <iant@google.com>
12344
12345 PR 10861
12346 * script.h (class Version_script_info): Define Language enum.
12347 Update declarations. Define Glob, Exact, and Lookup types. Add
12348 new fields globals_, locals_, and is_finalized_.
12349 * script.cc: Various formatting fixes.
12350 (class Parser_closure): Change language_stack_ from a vector of
12351 std::string to one of Version_script_info::Language. Adjust all
12352 uses accordingly.
12353 (class Lazy_demangler): Remove.
12354 (struct Version_expression): Change language from std::string to
12355 Version_script_info::Language.
12356 (Version_script_info::Version_script_info): New function.
12357 (Version_script_info::~Version_script_info): Don't call clear.
12358 (Version_script_info::finalize): New function.
12359 (Version_script_info::build_lookup_tables): New function.
12360 (Version_script_info::build_expression_list_lookup): New
12361 function.
12362 (Version_script_info::get_symbol_version_helper): Rewrite to use
12363 lookup tables.
12364 (Version_script_info::print_expression_list): Adjust to use
12365 Version_script_info::Language.
12366 (script_push_lex_into_version_mode): Check that the version script
12367 has not been finalized.
12368 (version_script_push_lang): Change language string to
12369 Version_script_info::Language.
12370 * options.cc (Command_line::version_script): New function.
12371 * options.h (class General_options): Add finalize_dynamic_list
12372 function. Change version_script from declaration to definition.
12373 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12374 * testsuite/version_script.map: Remove duplicate def of foo.
12375 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12376 version_script.map.
12377 * testsuite/Makefile.in: Rebuild.
12378
12379 2009-12-30 Ian Lance Taylor <iant@google.com>
12380
12381 PR 10843
12382 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12383 if the input symbol index is 0, make the output symbol index 0.
12384
12385 2009-12-30 Ian Lance Taylor <iant@google.com>
12386
12387 PR 10670
12388 * options.h (class General_options): Add -x/--discard-all.
12389 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12390 --discard-all. If the local symbol needs a dynamic entry, check
12391 that before handling --discard-locals.
12392
12393 2009-12-30 Ian Lance Taylor <iant@google.com>
12394
12395 PR 10450
12396 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12397 flags to PF_R.
12398 (Output_segment::add_output_section): Don't change the flags if
12399 the type is PT_TLS.
12400
12401 PR 10450
12402 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12403 GNU hash table if they need a dynamic value. Otherwise, don't add
12404 them if they are defined in a dynamic object or are forced local.
12405
12406 2009-12-29 Ian Lance Taylor <iant@google.com>
12407
12408 PR 10450
12409 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12410 .gnu.hash table for a 32-bit target.
12411
12412 PR 10450
12413 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12414 regular and a dynamic object only needs a dynamic symbol table
12415 entry if it is externally visible.
12416
12417 PR 10450
12418 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12419 constructor. Add global_offset_table_ field.
12420 (Target_i386::got_section): Set global_offset_table_.
12421 (Target_i386::do_finalize_sections): Set global_offset_table_
12422 size.
12423 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12424 in constructor. Add global_offset_table_ field.
12425 (Target_x86_64::got_section): Set global_offset_table_.
12426 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12427 size.
12428
12429 * layout.cc (Layout::Layout): Initialize increase_relro_.
12430 (Layout::get_output_section): Add is_relro, is_last_relro, and
12431 is_first_non_relro parameters. Change all callers.
12432 (Layout::choose_output_section): Likewise.
12433 (Layout::add_output_section_data): Likewise.
12434 (Layout::make_output_section): Likewise.
12435 (Layout::set_segment_offsets): Clear increase_relro when using a
12436 linker script.
12437 * layout.h (class Layout): Add increase_relro method. Add
12438 increase_relro_ field. Update declarations.
12439 * output.cc (Output_section::Output_section): Initialize
12440 is_last_relro_ and is_first_non_relro_.
12441 (Output_segment::add_output_section): Group relro sections is
12442 do_sort is true. Handle is_last_relro and is_first_non_relro.
12443 (Output_segment::maximum_alignment): Remove relro handling.
12444 (Output_segment::set_section_addresses): Add increase_relro
12445 parameter. Change all callers. Add initial alignment to align
12446 relro sections on separate page. Remove old relro handling.
12447 (Output_segment::set_section_list_addresses): Remove in_relro
12448 parameter. Change all callers.
12449 (Output_segment::set_offset): Add increase parameter. Change all
12450 callers. Remove old relro handling.
12451 * output.h (class Output_section): Add new methods: is_last_relro,
12452 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12453 Add is_last_relro_ and is_first_non_relro_ fields.
12454 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12455 Create separate .got.plt section. Call increase_relro.
12456 * x86_64.cc (Target_x86_64::got_section): Likewise.
12457 * testsuite/relro_script_test.t: Add .got.plt.
12458
12459 PR 10450
12460 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12461 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12462 (Layout::finalize): Call set_dynamic_symbol_size.
12463 (Layout::set_dynamic_symbol_size): New function.
12464 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12465 set_dynamic_symbol_size.
12466
12467 PR 10450
12468 * output.h (class Output_section): Add is_entsize_zero_ field.
12469 * output.cc (Output_section::Output_section): Initialize
12470 is_entsize_zero_.
12471 (Output_section::set_entsize): If two different entsizes are
12472 requested, force it to zero.
12473 (Output_section::add_input_section): Set flags for .debug_str
12474 before updating section flags. Set entsize.
12475 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12476 and SHF_STRING if all input sections have those flags.
12477
12478 2009-12-29 Rafael Espindola <espindola@google.com>
12479
12480 * main.cc (main): Fix the sys time reporting.
12481 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12482 reporting.
12483
12484 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12485
12486 * options.cc (General_options::parse_version): Allow -v to exit
12487 without an error if there is nothing to link.
12488
12489 2009-12-29 Ian Lance Taylor <iant@google.com>
12490
12491 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12492 using a version of gcc before 4.1.
12493 * configure: Rebuild.
12494
12495 2009-12-28 Chris Demetriou <cgd@google.com>
12496
12497 * attributes.cc (Output_attributes_section_data::do_write): Use
12498 std::vector::front rather than std::vector::data.
12499
12500 2009-12-28 Ian Lance Taylor <iant@google.com>
12501
12502 * symtab.h (class Symbol_table): Add enum Defined.
12503 * resolve.cc (Symbol_table::should_override): Add defined
12504 parameter. Change all callers. Test whether object is NULL
12505 before calling a method on it.
12506 (Symbol_table::report_resolve_problem): Add defined parameter.
12507 Change all callers.
12508 (Symbol_table::should_override_with_special): Likewise.
12509 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12510 parameter. Change all callers.
12511 (Symbol_table::do_define_in_output_data): Likewise.
12512 (Symbol_table::define_in_output_segment): Likewise.
12513 (Symbol_table::do_define_in_output_segment): Likewise.
12514 (Symbol_table::define_as_constant): Likewise.
12515 (Symbol_table::do_define_as_constant): Likewise.
12516 * script.h (class Symbol_assignment): Add is_defsym parameter to
12517 constructor; change all callers.
12518 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12519 parameter. Change all callers. Add is_defsym_ field.
12520 (class Parser_closure): Add parsing_defsym parameter to
12521 constructor; change all callers. Add parsing_defsym accessor
12522 function. Add parsing_defsym_ field.
12523
12524 2009-12-28 Ian Lance Taylor <iant@google.com>
12525
12526 * gold.cc (queue_middle_tasks): Fix formatting.
12527 * object.cc (Relobj::is_section_name_included): Likewise.
12528
12529 2009-12-23 Ian Lance Taylor <iant@google.com>
12530
12531 * i386.cc (Target_i386::do_calls_non_split): Recognize
12532 -fsplit-stack prologue for a function with a static chain.
12533 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12534 -fsplit-stack prologue when using %r11.
12535
12536 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12537
12538 * options.cc (General_options::parse_version): Make -v continue and do
12539 the link like GNU ld does.
12540
12541 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12542
12543 * Makefile.am (CCFILES): Add timer.cc.
12544 (HFILES): Add timer.h.
12545 * configure.ac: Check for sysconf and times.
12546 * main.cc: include timer.h.
12547 (main): Use Timer instead of get_run_time.
12548 * timer.cc: New.
12549 * timer.h: New.
12550 * workqueue.cc: include timer.h.
12551 (Workqueue::find_and_run_task):
12552 Report user, sys and wall time.
12553 * Makefile.in: Regenerate.
12554 * config.in: Regenerate.
12555 * configure: Regenerate.
12556
12557 2009-12-16 Doug Kwan <dougkwan@google.com>
12558
12559 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12560 sections.
12561 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12562 relaxed input sections.
12563 * output.cc (Output_section::find_relaxed_input_section): Change
12564 return type to Output_relaxed_input_section pointer. Adjust code
12565 for new type of relaxed_input_section_map_.
12566 * output.h (Output_section::find_relaxed_input_section): Change
12567 return type to Output_relaxed_input_section pointer.
12568 (Output_section::Output_relaxed_input_section_by_input_section_map):
12569 New type.
12570 (Output_section::relaxed_input_section_map_): Change type to
12571 Output_section::Output_relaxed_input_section_by_input_section_map.
12572 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12573 input section.
12574
12575 2009-12-15 Ian Lance Taylor <iant@google.com>
12576
12577 * layout.cc (Layout::create_shstrtab): Only write out after input
12578 sections if we are compressing debug sections.
12579
12580 2009-12-15 Ian Lance Taylor <iant@google.com>
12581
12582 * archive.cc (Archive::add_symbols): Only look up a symbol without
12583 a version if there is, in fact, a version.
12584
12585 2009-12-14 Ian Lance Taylor <iant@google.com>
12586
12587 Revert -Wshadow changes, all changes from:
12588 2009-12-11 Doug Kwan <dougkwan@google.com>
12589 2009-12-11 Nick Clifton <nickc@redhat.com>
12590 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12591
12592 2009-12-11 Doug Kwan <dougkwan@google.com>
12593
12594 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12595 due to -Wshadow.
12596 * attributes.cc (Object_attribute::size): Ditto.
12597 (Attributes_section_data::size): Ditto.
12598 (Attributes_section_data::Attributes_section_data): Ditto.
12599 (Output_attributes_section_data::do_write): Ditto.
12600 * attributes.h (Object_attribute::set_type): Ditto.
12601 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12602
12603 2009-12-11 Nick Clifton <nickc@redhat.com>
12604
12605 * archive.cc: Fix shadowed variable warnings.
12606 * arm.cc: Likewise.
12607 * compressed_output.cc: Likewise.
12608 * compressed_output.h: Likewise.
12609 * configure: Likewise.
12610 * dwarf_reader.cc: Likewise.
12611 * dynobj.cc: Likewise.
12612 * dynobj.h: Likewise.
12613 * ehframe.cc: Likewise.
12614 * ehframe.h: Likewise.
12615 * errors.cc: Likewise.
12616 * expression.cc: Likewise.
12617 * fileread.cc: Likewise.
12618 * fileread.h: Likewise.
12619 * freebsd.h: Likewise.
12620 * i386.cc: Likewise.
12621 * icf.cc: Likewise.
12622 * incremental.h: Likewise.
12623 * layout.cc: Likewise.
12624 * layout.h: Likewise.
12625 * mapfile.cc: Likewise.
12626 * merge.cc: Likewise.
12627 * merge.h: Likewise.
12628 * object.cc: Likewise.
12629 * object.h: Likewise.
12630 * options.h: Likewise.
12631 * output.cc: Likewise.
12632 * output.h: Likewise.
12633 * parameters.cc: Likewise.
12634 * plugin.cc: Likewise.
12635 * powerpc.cc: Likewise.
12636 * reduced_debug_output.cc: Likewise.
12637 * reduced_debug_output.h: Likewise.
12638 * reloc.cc: Likewise.
12639 * reloc.h: Likewise.
12640 * resolve.cc: Likewise.
12641 * script-sections.cc: Likewise.
12642 * script.cc: Likewise.
12643 * script.h: Likewise.
12644 * sparc.cc: Likewise.
12645 * symtab.cc: Likewise.
12646 * symtab.h: Likewise.
12647 * target-select.cc: Likewise.
12648 * target-select.h: Likewise.
12649 * token.h: Likewise.
12650 * workqueue.cc: Likewise.
12651 * workqueue.h: Likewise.
12652 * x86_64.cc: Likewise.
12653
12654 2009-12-10 Doug Kwan <dougkwan@google.com>
12655
12656 * arm.cc (attributes.h): New include.
12657 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12658 (Arm_relobj::~Arm_relobj): Delete object pointed by
12659 attributes_section_data_.
12660 (Arm_relobj::attributes_section_data): New method definition.
12661 (Arm_relobj::attributes_section_data_): New data member declaration.
12662 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12663 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12664 attributes_section_data_.
12665 (Arm_dynobj::attributes_section_data): New method definition.
12666 (Arm_dynobj::attributes_section_data_): New data member declaration.
12667 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12668 initialization value of may_use_blx_ to false.
12669 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12670 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12671 object attributes to compute results instead of hard-coding.
12672 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12673 Target_arm::get_secondary_compatible_arch,
12674 Target_arm::set_secondary_compatible_arch
12675 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12676 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12677 New method declarations.
12678 (Target_arm::get_aeabi_object_attribute): New method definition.
12679 (Target_arm::attributes_section_data_): New data member declaration.
12680 (read_arm_attributes_section): New template definition.
12681 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12682 (Arm_dynobj::do_read_symbols): Ditto.
12683 (Target_arm::do_finalize_sections): Merge attributes sections from
12684 input. Check for BLX use after attributes section merging.
12685 Fix __exidx_start and __exidx_end visibility. Create an
12686 .ARM.attributes section if necessary.
12687 (Target_arm::get_secondary_compatible_arch,
12688 Target_arm::set_secondary_compatible_arch,
12689 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12690 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12691 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12692 New method definitions.
12693
12694 2009-12-09 Ian Lance Taylor <iant@google.com>
12695
12696 * plugin.cc (Plugin::load): Don't cast from void* to a function
12697 pointer.
12698
12699 2009-12-09 Ian Lance Taylor <iant@google.com>
12700
12701 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12702 information fields.
12703
12704 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12705
12706 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12707 Replace two_file_shared_1.so with two_file_shared_2.so.
12708 * testsuite/Makefile.in: Regenerated.
12709
12710 2009-12-08 Doug Kwan <dougkwan@google.com>
12711
12712 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12713 (HFILES): Add attributes.h and int_encoding.h.
12714 * Makefile.in: Regenerate.
12715 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12716 function definitions to int_encoding.cc
12717 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12718 prototypes to int_encoding.h
12719 * reduced_debug_output.cc (int_encoding.h): New include.
12720 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12721 function definitions to int_encoding.cc
12722 (insert_into_vector, read_from_pointer): Move template definitions to
12723 int_encoding.h
12724 * attributes.cc: New file.
12725 * attributes.h: New file.
12726 * int_encoding.cc: New file.
12727 * int_encoding.h: New file.
12728
12729 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12730
12731 PR gold/11055
12732 * incremental-dump.cc (dump_incremental_inputs): New.
12733 (main): Use dump_incremental_inputs.
12734
12735 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12736
12737 PR gold/10893
12738 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12739 checking elfcpp::STT_FUNC.
12740 (Target_i386::Relocate::relocate): Likewise.
12741 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12742
12743 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12744 symbols from shared libraries into normal FUNC symbols.
12745
12746 * symtab.h (Symbol): Add is_func and use it.
12747
12748 2009-12-05 Doug Kwan <dougkwan@google.com>
12749
12750 * arm.cc (Target_arm::arm_info): Initialize new fields
12751 attributes_section and attributes_vendor.
12752 * i386.cc (Target_i386::i386_info): Same.
12753 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12754 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12755 fields attributes_section and attributes_vendor.
12756 * sparc.cc (Target_sparc::sparc_info): Same.
12757 * target.h (Target::attributes_section, Target::attributes_vendor,
12758 Target::is_attributes_section, Target::attribute_arg_type,
12759 Target::attributes_order): New method definitions.
12760 (Target::Target_info::attributes_section,
12761 Target::Target_info::attributes_vendor): New fields.
12762 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12763 virtual method definitions.
12764 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12765 attributes_section and attributes_vendor.
12766 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12767
12768 2009-12-05 Doug Kwan <dougkwan@google.com>
12769
12770 * arm.cc: Update comments about interworking and stub generation.
12771 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12772 considered as non-PIC.
12773 (Arm_relocate_functions::base_abs): Fix formatting.
12774 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12775 of function to use GOT entry address instead of offset.
12776 (Target_arm::Scan::global): Issue an error if a symbol would need a
12777 PLT does not get one because it is untyped. Remove code to create
12778 dynamic symbols for relative branches.
12779 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12780 takes unsigned integer instead of boolean.
12781
12782 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12783
12784 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12785 (two_file_test_LDADD): Likewise.
12786 (common_test_1_LDADD): Likewise.
12787 (exception_test_LDADD) Likewise.
12788 (weak_test_LDADD): Likewise.
12789 (many_sections_test_LDADD): Likewise.
12790 (initpri1_LDADD): Likewise.
12791 (script_test_1_LDADD): Likewise.
12792 (script_test_2_LDADD): Likewise.
12793 (justsyms_LDADD): Likewise.
12794 (binary_test_LDADD): Likewise.
12795 (large_LDADD): Likewise.
12796 * testsuite/Makefile.in: Regenerated.
12797
12798 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12799
12800 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12801 (Symbol_table::override_with_special): Likewise.
12802 (Symbol_table::add_from_object): Likewise.
12803
12804 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12805
12806 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12807 Don't set the data_offset twice.
12808
12809 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12810
12811 * testsuite/Makefile.in: Regenerate.
12812
12813 2009-12-03 Doug Kwan <dougkwan@google.com>
12814
12815 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12816 (Target_arm::do_finalize_sections): Add parameter for symbol table
12817 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12818 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12819 parameter for symbol table pointer.
12820 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12821 an additional parameter for a pointer to symbol table.
12822 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12823 parameter for a symbol table pointer.
12824 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12825 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12826 Ditto.
12827 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12828 parameter for a symbol table pointer.
12829
12830 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12831
12832 * incremental.cc (Incremental_inputs_header)
12833 (Incremental_inputs_header_write, Incremental_inputs_entry)
12834 (Incremental_inputs_entry_write): Move ...
12835 * incremental.h (Incremental_inputs_header)
12836 (Incremental_inputs_header_write, Incremental_inputs_entry)
12837 (Incremental_inputs_entry_write): here.
12838
12839 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12840
12841 * incremental.cc (make_sized_incremental_binary): Set the target.
12842 Error if it is incompatible.
12843 * output.h (Output_file): Add filename method.
12844
12845 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12846
12847 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12848 from the get_* methods.
12849
12850 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12851
12852 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12853 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12854 Write 0 for the data_offset of scripts.
12855
12856 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12857
12858 * testsuite/Makefile.am: Add the incremental_test.sh test.
12859 * testsuite/incremental_test.sh: New.
12860 * testsuite/incremental_test_1.c: New.
12861 * testsuite/incremental_test_2.c: New.
12862
12863 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12864
12865 * incremental-dump.cc (main): Fix typos.
12866
12867 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12868
12869 PR gold/11025
12870 * incremental-dump.cc (main): Use llu to print 64 bit values.
12871
12872 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12873 H.J. Lu <hongjiu.lu@intel.com>
12874
12875 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12876 $(LIBDL).
12877 (incremental_dump_LDADD): Likewise.
12878 * Makefile.in: Regenerated.
12879
12880 2009-11-25 Doug Kwan <dougkwan@google.com>
12881
12882 Revert:
12883
12884 2009-11-25 Doug Kwan <dougkwan@google.com>
12885
12886 * arm.cc (Target_arm::Target_arm): Move method definition
12887 outside of class definition. Add code to handle
12888 --target1-rel, --target1-abs and --target2= options.
12889 (Target_arm::get_reloc_reloc_type): Change method to be
12890 non-static and const.
12891 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12892 New data member declaration.
12893 (Target_arm::Scan::local, Target_arm::Scan::global,
12894 Target_arm::Relocate::relocate,
12895 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12896 Adjust call to Target_arm::get_real_reloc_type.
12897 (Target_arm::get_real_reloc_type): Use command line options
12898 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12899 * options.h (--target1-rel, --target1-abs, --target2): New
12900 ARM-only options.
12901
12902 2009-11-25 Doug Kwan <dougkwan@google.com>
12903
12904 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12905 class definition. Add code to handle --target1-rel, --target1-abs
12906 and --target2= options.
12907 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12908 and const.
12909 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12910 member declaration.
12911 (Target_arm::Scan::local, Target_arm::Scan::global,
12912 Target_arm::Relocate::relocate,
12913 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12914 call to Target_arm::get_real_reloc_type.
12915 (Target_arm::get_real_reloc_type): Use command line options to
12916 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12917 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12918 options.
12919
12920 2009-11-25 Doug Kwan <dougkwan@google.com>
12921
12922 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12923 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12924 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12925 formatting.
12926 (Arm_relocate_functions::thm_call): Replace body with a call to
12927 Arm_relocate_functions::thumb_branch_common.
12928 (Arm_relocate_functions::thm_jump24,
12929 Arm_relocate_functions::thm_xpc22): New method definitions.
12930 (Arm_relocate_functions::thumb_branch_common): New method definition.
12931 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12932 operator.
12933 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12934 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12935
12936 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12937
12938 * Makefile.am: Build incremental-dump
12939 * Makefile.in: Regenerate.
12940 * incremental-dump.cc: New.
12941 * incremental.cc (Incremental_inputs_header_data,
12942 Incremental_inputs_entry_data): Move to incremental.h
12943 * incremental.h: (Incremental_inputs_header_data,
12944 Incremental_inputs_entry_data): Move from incremental.cc
12945
12946 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12947
12948 * incremental.cc (Incremental_inputs_header,
12949 Incremental_inputs_header_write, Incremental_inputs_entry,
12950 Incremental_inputs_entry_write): Add a typedef with the data type.
12951
12952 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12953
12954 * incremental.cc (Incremental_inputs_header,
12955 Incremental_inputs_header_write, Incremental_inputs_entry,
12956 Incremental_inputs_entry_write): Update comment about which
12957 type has the filed descriptions.
12958
12959 2009-11-15 Doug Kwan <dougkwan@google.com>
12960
12961 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12962 (Arm_relocate_functions::arm_branch_common): Change method defintion
12963 in class definition to a method declaration and update list of formal
12964 parameters.
12965 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12966 Arm_relocation_functions::jump24): Adjust call to
12967 Arm_relocate_functions::arm_branch_common. Update list of formal
12968 parameters.
12969 (Arm_relocate_functions::xpc25): New method definition.
12970 (Arm_relocate_functions::arm_branch_common): Move method defintion
12971 out from class definition. Use stubs for mode-switching and extending
12972 branch ranges.
12973 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12974 specially. Change code to enable use of stubs in ARM branches.
12975
12976 2009-11-10 Doug Kwan <dougkwan@google.com>
12977
12978 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12979 in method declaration.
12980 (Target_arm::relocate_stub): New method declaration.
12981 (Target_arm::default_target): Change to return a pointer instead of
12982 a const reference.
12983 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12984 Target_arm::default_target.
12985 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12986 method definition.
12987 (Target_arm::relocate_section): Adjust view.
12988 (Target_arm::relocate_stub): New method definition.
12989
12990 2009-11-10 Doug Kwan <dougkwan@google.com>
12991
12992 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12993 a format warning.
12994 * incremental.cc (open_incremental_binary): Initialized local
12995 variables to avoid warnings.
12996 * object.cc (make_elf_object): Ditto.
12997 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12998 a format warning.
12999
13000 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
13001
13002 PR gold/10930
13003 * testsuite/plugin_test.c: Include "config.h".
13004
13005 2009-11-09 Doug Kwan <dougkwan@google.com>
13006
13007 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
13008 (arm_symbol_value): Remove.
13009 (Arm_relocate_functions::arm_branch_common,
13010 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
13011 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
13012 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
13013 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
13014 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
13015 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
13016 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
13017 Arm_relocate_functions::thm_mobw_abs_nc,
13018 Arm_relocate_functions::thm_mov_abs,
13019 Arm_relocate_functions::movw_prel_nc,
13020 Arm_relocate_functions::thm_movt_abs,
13021 Arm_relocate_functions::movt_prel,
13022 Arm_relocate_functions::thm_movw_prel_nc,
13023 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
13024 (Target_arm::Relocate::relocate): Only decompose address into two
13025 parts if relocation type uses the thumb-bit and pass the actual
13026 bit instead of a flag indicating that the thumb-bit is used. Adjust
13027 calls to methods in Arm_relocate_functions for this change.
13028
13029 2009-11-08 Ian Lance Taylor <iant@google.com>
13030
13031 PR 10925
13032 * reloc.cc: Instantiate
13033 Sized_relobj::initialize_input_to_output_maps and
13034 Sized_relobj:free_input_to_output_maps.
13035
13036 2009-11-06 Ian Lance Taylor <iant@google.com>
13037
13038 PR 10876
13039 * defstd.cc (in_segment): Set only_if_ref true for "end".
13040
13041 2009-11-06 Doug Kwan <dougkwan@google.com>
13042
13043 * arm.cc (class Reloc_stub): Correct a comment.
13044 (Target_arm::Target_arm): Initialize arm_input_section_map_.
13045 (Target_arm::scan_section_for_stubs): New method declaration.
13046 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
13047 Change methods from private to protected.
13048 (Target_arm::do_may_relax): New method definition.
13049 (Target_arm::do_relax, Target_arm::group_sections,
13050 Target_arm::scan_reloc_for_stub,
13051 Target_arm::scan_reloc_section_for_stubs): New method declarations.
13052 (Target_arm::arm_input_section_map_): New data member declaration.
13053 (Target_arm::scan_reloc_for_stub,
13054 Target_arm::scan_reloc_section_for_stubs,
13055 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
13056 Target_arm::do_relax): New method definitions.
13057
13058 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
13059
13060 * configure.ac: Check for (struct stat)::st_mtim
13061 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13062 * config.in: Regenerate.
13063 * configure: Regenerate.
13064
13065 2009-11-05 Ian Lance Taylor <iant@google.com>
13066
13067 PR 10910
13068 * output.cc (Output_segment::add_output_section): Add missing
13069 return statement.
13070
13071 2009-11-04 Ian Lance Taylor <iant@google.com>
13072
13073 PR 10880
13074 * object.h (class Object): Add is_needed and set_is_needed
13075 methods. Add is_needed_ field. Make bool fields into bitfields.
13076 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13077 defined in a dynamic object and referenced by a regular object,
13078 set is_needed for the dynamic object.
13079 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13080 if the file is marked with as_needed and it is not needed.
13081
13082 2009-11-04 Ian Lance Taylor <iant@google.com>
13083
13084 PR 10887
13085 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13086 tags if data is discarded by linker script.
13087 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13088 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13089 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13090 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13091
13092 2009-11-04 Ian Lance Taylor <iant@google.com>
13093
13094 * layout.cc (Layout::get_output_section): Add is_interp and
13095 is_dynamic_linker_section parameters. Change all callers.
13096 (Layout::choose_output_section): Likewise.
13097 (Layout::make_output_section): Likewise.
13098 (Layout::add_output_section_data): Add is_dynamic_linker_section
13099 parameter. Change all callers.
13100 * layout.h (class Layout): Update declarations.
13101 * output.h (class Output_section): Add is_interp, set_is_interp,
13102 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13103 Add is_interp_, is_dynamic_linker_section_ fields. Change
13104 generate_code_fills_at_write_ to a bitfield.
13105 * output.cc (Output_section::Output_sections): Initialize new
13106 fields.
13107 (Output_segment::add_output_section): Add do_sort parameter.
13108 Change all callers.
13109
13110 2009-11-03 Ian Lance Taylor <iant@google.com>
13111
13112 PR 10860
13113 * options.h (class General_options): Add --warn-common.
13114 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13115 merging two common symbols.
13116 (Symbol_table::should_override): Handle --warn-common when merging
13117 a common symbol with a defined symbol. Use report_resolve_problem
13118 for multiple definitions.
13119 (Symbol_table::report_resolve_problem): New function.
13120 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13121
13122 2009-11-03 Doug Kwan <dougkwan@google.com>
13123
13124 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13125 stub_factory_.
13126 (Target_arm::stub_factory): New method definition.
13127 (Target_arm::new_arm_input_section,
13128 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13129 Target_arm::reloc_uses_thumb_bit): New method declarations.
13130 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
13131 New type definitions.
13132 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13133 member declarations.
13134 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13135 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13136 New method definitions.
13137
13138 2009-11-03 Ian Lance Taylor <iant@google.com>
13139
13140 * options.h (class General_options): Add --warn_constructors.
13141
13142 2009-11-03 Ian Lance Taylor <iant@google.com>
13143
13144 PR 10893
13145 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13146 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13147
13148 2009-11-03 Ian Lance Taylor <iant@google.com>
13149
13150 PR 10895
13151 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13152 --msgid-bugs-address.
13153 (install-pdf): New target.
13154 (install-data_yes): Look up one directory to find mkinstalldirs.
13155
13156 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13157
13158 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13159 tree.
13160
13161 2009-10-30 Doug Kwan <dougkwan@google.com>
13162
13163 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13164
13165 2009-10-30 Doug Kwan <dougkwan@google.com>
13166
13167 * arm.cc (Stub_addend_reader): New struct template definition
13168 and partial specializations.
13169 (Stub_addend_reader::operator()): New method definition for a
13170 partially specialized template.
13171
13172 2009-10-30 Doug Kwan <dougkwan@google.com>
13173
13174 * arm.cc (Arm_relobj::processor_specific_flags): New method
13175 definition.
13176 (Arm_relobj::do_read_symbols): New method declaration.
13177 (Arm_relobj::processor_specific_flags_): New data member declaration.
13178 (Arm_dynobj): New class definition.
13179 (Target_arm::do_finalize_sections): Add input_objects parameter.
13180 (Target_arm::do_adjust_elf_header): New method declaration.
13181 (Target_arm::are_eabi_versions_compatible,
13182 (Target_arm::merge_processor_specific_flags): New method declaration.
13183 (Target_arm::do_make_elf_object): New overloaded method definitions
13184 and declaration.
13185 (Arm_relobj::do_read_symbols): New method definition.
13186 (Arm_dynobj::do_read_symbols): Ditto.
13187 (Target_arm::do_finalize_sections): Add input_objects parameters.
13188 Merge processor-specific flags from all input objects.
13189 (Target_arm::are_eabi_versions_compatible,
13190 Target_arm::merge_processor_specific_flags,
13191 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13192 New method definitions.
13193 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13194 Input_objects pointer type parameter.
13195 * layout.cc (Layout::finalize): Pass input objects to target's.
13196 finalize_sections function.
13197 * output.cc (Output_file_header::do_sized_write): Set ELF file
13198 header's processor-specific flags.
13199 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13200 Input_objects pointer type parameter.
13201 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13202 * target.h (Input_objects): New forward class declaration.
13203 (Target::processor_specific_flags,
13204 Target::are_processor_specific_flags_sect): New method definitions.
13205 (Target::finalize_sections): Add input_objects parameter.
13206 (Target::Target): Initialize processor_specific_flags_ and
13207 are_processor_specific_flags_set_.
13208 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13209 parameter.
13210 (Target::set_processor_specific_flags): New method definition.
13211 (Target::processor_specific_flags_,
13212 Target::are_processor_specific_flags_set_): New data member
13213 declarations.
13214 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13215 Input_objects pointer type parameter.
13216
13217 2009-10-30 Doug Kwan <dougkwan@google.com>
13218
13219 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13220
13221 2009-10-28 Ian Lance Taylor <iant@google.com>
13222
13223 * object.h (class Relobj): Drop options parameter from
13224 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13225 do_scan_relocs, do_relocate. Change all callers.
13226 (class Sized_relobj): Drop options parameters from
13227 do_gc_process_relocs, do_scan_relocs, do_relocate,
13228 do_relocate_sections, relocate_sections, emit_relocs_scan,
13229 emit_relocs_scan_reltype. Change all callers.
13230 (struct Relocate_info): Remove options field and all references to
13231 it.
13232 * reloc.h (class Read_relocs): Remove options constructor
13233 parameter and options_ field. Change all callers.
13234 (class Gc_process_relocs, class Scan_relocs): Likewise.
13235 (class Relocate_task): Likewise.
13236 * target-reloc.h (scan_relocs): Remove options parameter. Change
13237 all callers.
13238 (scan_relocatable_relocs): Likewise.
13239 * target.h (class Sized_target): Remove options parameter from
13240 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13241 all callers.
13242 * gc.h (gc_process_relocs): Remove options parameter. Change all
13243 callers.
13244 * arm.cc: Update functions to remove options parameters.
13245 * i386.cc: Likewise.
13246 * powerpc.cc: Likewise.
13247 * sparc.cc: Likewise.
13248 * x86_64.cc: Likewise.
13249 * testsuite/testfile.cc: Likewise.
13250
13251 2009-10-28 Doug Kwan <dougkwan@google.com>
13252
13253 * arm.cc (Arm_relobj): New class definition.
13254 (Arm_relobj::scan_sections_for_stubs,
13255 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13256 New method definitions.
13257
13258 2009-10-28 Cary Coutant <ccoutant@google.com>
13259
13260 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13261 (Plugin::cleanup_done_): New member.
13262 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13263 (Plugin_manager::cleanup_done_): Remove.
13264 (Plugin_manager::add_input_file): Edit error message.
13265 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13266 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13267
13268 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13269
13270 * fileread.cc: (File_read::View::~View): Use the new
13271 data_ownership_ filed.
13272 (File_read::~File_read): Dispose the new whole_file_view_.
13273 (File_read::open): Mmap the whole file if needed.
13274 (File_read::open): Use whole_file_view_ instead of contents_.
13275 (File_read::find_view): Use whole_file_view_ if applicable.
13276 (File_read::do_read): Use whole_file_view_ instead of contents_.
13277 (File_read::make_view): Use whole_file_view_ instead of contents_,
13278 update File_read::View::View call.
13279 (File_read::find_or_make_view): Update File_read::View::View
13280 call.
13281 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13282 remove contents_
13283 (File_read::View::Data_ownership): New enum.
13284 (File_read::View::View): Replace bool mapped_ with Data_ownership
13285 argument.
13286 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13287 (File_read::View::data_ownership_): New field.
13288 (File_read::contents_): Remove (replaced by whole_file_view_).
13289 (File_read::whole_file_view_): New field.
13290 * options.h (class General_options): Add --keep-files-mapped.
13291
13292 2009-10-27 Cary Coutant <ccoutant@google.com>
13293
13294 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13295 * testsuite/Makefile.am (plugin_test_5): New test case.
13296 * testsuite/Makefile.in: Regenerate.
13297
13298 2009-10-25 Doug Kwan <dougkwan@google.com>
13299
13300 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13301 from private to protected to allow access by child class.
13302 (Sized_relobj::do_relocate_sections): New method declaration.
13303 (Sized_relobj::relocate_sections): Virtualize.
13304 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13305 Sized_relobj::relocate_sections. Instantiate template explicitly
13306 for different target sizes and endianity.
13307
13308 2009-10-24 Doug Kwan <dougkwan@google.com>
13309
13310 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13311 (Arm_input_section::as_arm_input_section): New method.
13312 (Arm_output_section): New class definition.
13313 (Arm_output_section::create_stub_group,
13314 Arm_output_section::group_sections): New method definitions.
13315
13316 2009-10-22 Doug Kwan <dougkwan@google.com>
13317
13318 * arm.cc (Arm_input_section): New class definition.
13319 (Arm_input_section::init, Arm_input_section:do_write,
13320 Arm_input_section::set_final_data_size,
13321 Arm_input_section::do_reset_address_and_file_offset): New method
13322 definitions.
13323
13324 2009-10-21 Doug Kwan <dougkwan@google.com>
13325
13326 * arm.cc (Stub_table, Arm_input_section): New forward class
13327 declarations.
13328 (Stub_table): New class defintion.
13329 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13330 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13331 New method definition.
13332
13333 2009-10-21 Doug Kwan <dougkwan@google.com>
13334
13335 * arm.cc: Update copyright comments.
13336 (Target_arm): New forward class template declaration.
13337 (Arm_address): New type.
13338 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13339 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13340 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13341 constants.
13342 (Insn_template): Same.
13343 (DEF_STUBS): New macro.
13344 (Stub_type): New enum type.
13345 (Stub_template): New class definition.
13346 (Stub): Same.
13347 (Reloc_stub): Same.
13348 (Stub_factory): Same.
13349 (Target_arm::Target_arm): Initialize may_use_blx_ and
13350 should_force_pic_veneer_.
13351 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13352 Target_arm::should_force_pic_veneer,
13353 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13354 Target_arm::using_thumb_only, Target_arm:;default_target): New
13355 method defintions.
13356 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13357 New data member declarations.
13358 (Insn_template::size, Insn_template::alignment): New method defintions.
13359 (Stub_template::Stub_template): New method definition.
13360 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13361 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13362 (Stub_factory::Stub_factory): New method definition.
13363 * gold.h (string_hash): New template.
13364 * output.h (Input_section_specifier::hash_value): Use
13365 gold::string_hash.
13366 (Input_section_specifier::string_hash): Remove.
13367 * stringpool.cc (Stringpool_template::string_hash): Use
13368 gold::string_hash.
13369
13370 2009-10-20 Doug Kwan <dougkwan@google.com>
13371
13372 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13373 symbols of relaxed input sections.
13374 * output.h (Output_section::find_relaxed_input_section): Make
13375 method public.
13376
13377 2009-10-16 Doug Kwan <dougkwan@google.com>
13378
13379 * dynobj.cc (Versions::Versions): Initialize version_script_.
13380 Only insert base version symbol definition for a shared object
13381 if version script defines any version versions.
13382 (Versions::define_base_version): New method definition.
13383 (Versions::add_def): Check that base version is not needed.
13384 (Versions::add_need): Define base version lazily.
13385 * dynobj.h (Versions::define_base_version): New method declaration.
13386 (Versions::needs_base_version_): New data member declaration.
13387 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13388 (check_DATA): Add no_version_test.stdout.
13389 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13390 New make rules.
13391 * testsuite/Makefile.in: Regenerate.
13392 * testsuite/no_version_test.c: New file.
13393 * testsuite/no_version_test.sh: Ditto.
13394
13395 2009-10-16 Doug Kwan <dougkwan@google.com>
13396
13397 * expression.cc (class Segment_start_expression): New class definition.
13398 (Segment_start_expression::value): New method definition.
13399 (script_exp_function_segment_start): Return a new
13400 Segment_start_expression.
13401 * gold/script-c.h (script_saw_segment_start_expression): New function
13402 prototype.
13403 * script-sections.cc (Script_sections::Script_sections): Initialize
13404 SAW_SEGMENT_START_EXPRESSION_ to false.
13405 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13406 and -Tbbs options to specify section addresses if given in
13407 command line and no SEGMENT_START expression is seen in a script.
13408 * script-sections.h (Script_sections::saw_segment_start_expression,
13409 Script_sections::set_saw_segment_start_expression): New method
13410 definition.
13411 (Script_sections::saw_segment_start_expression_): New data member
13412 declaration.
13413 * script.cc (script_saw_segment_start_expression): New function.
13414 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13415 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13416 script_test_7.sh and script_test_8.sh.
13417 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13418 script_test_8.stdout.
13419 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13420 (script_test_6, script_test_6.stdout, script_test_7,
13421 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13422 * Makefile.in: Regenerate.
13423 * testsuite/script_test_6.sh: New file.
13424 * testsuite/script_test_6.t: Same.
13425 * testsuite/script_test_7.sh: Same.
13426 * testsuite/script_test_7.t: Same.
13427 * testsuite/script_test_8.sh: Same.
13428
13429 2009-10-16 Doug Kwan <dougkwan@google.com>
13430
13431 * output.cc (Output_segment::set_section_list_address): Cast
13432 expressions to unsigned long long type to avoid format warnings.
13433
13434 2009-10-15 Ian Lance Taylor <iant@google.com>
13435
13436 * script.cc (Script_options::add_symbol_assignment): Always add a
13437 dot assignment to script_sections_.
13438 * script-sections.cc (Script_sections::add_dot_assignment):
13439 Initialize if necessary.
13440
13441 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13442 program headers with no load segment if there is a linker script.
13443
13444 * layout.cc (Layout::set_segment_offsets): Align the file offset
13445 to the segment aligment for -N or -n with no load segment.
13446 * output.cc (Output_segment::add_output_section): Don't crash if
13447 the first section is a TLS section.
13448 (Output_segment::set_section_list_addresses): Print an error
13449 message if the address moves backward in a linker script.
13450 * script-sections.cc
13451 (Output_section_element_input::set_section_addresses): Don't
13452 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13453 (Orphan_output_section::set_section_addresses): Likewise.
13454
13455 2009-10-15 Doug Kwan <dougkwan@google.com>
13456
13457 * layout.cc (Layout::finish_dynamic_section): Generate tags
13458 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13459 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13460 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13461
13462 2009-10-14 Ian Lance Taylor <iant@google.com>
13463
13464 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13465 fields.
13466 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13467 data_shdr fields of relinfo.
13468 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13469 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13470 R_386_TLS_LDO_32, adjust based on section flags.
13471 (Target_i386::Relocate::fix_up_ldo): Remove.
13472
13473 2009-10-13 Ian Lance Taylor <iant@google.com>
13474
13475 Add support for -pie.
13476 * options.h (class General_options): Add -pie and
13477 --pic-executable.
13478 (General_options::output_is_position_independent): Test -pie.
13479 (General_options::output_is_executable): Return true if not shared
13480 and not relocatable.
13481 (General_options::output_is_pie): Remove.
13482 * options.cc (General_options::finalize): Reject incompatible uses
13483 of -pie.
13484 * gold.cc (queue_middle_tasks): A -pie link is not static.
13485 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13486 * symtab.cc (Symbol::final_value_is_known): Return false if
13487 output_is_position_independent.
13488 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13489 output_is_position_independent.
13490 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13491 output_is_position_independent.
13492 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13493 output_is_position_independent.
13494 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13495 two_file_pie_test.
13496 (basic_pie_test.o, basic_pie_test): New targets.
13497 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13498 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13499 (two_file_pie_test): New target.
13500 * testsuite/Makefile.in: Rebuild.
13501 * README: Remove note saying that -pie is not supported.
13502
13503 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13504
13505 * options.h (class General_options): Add -init and -fini.
13506 * layout.cc (Layout::finish_dynamic_section): Emit
13507 given init and fini functions.
13508
13509 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13510
13511 * gc.h (gc_process_relocs): Check if icf is enabled using new
13512 function.
13513 * gold.cc (queue_initial_tasks): Likewise.
13514 (queue_middle_tasks): Likewise.
13515 * object.cc (do_layout): Likewise.
13516 * symtab.cc (is_section_folded): Likewise.
13517 * main.cc (main): Likewise.
13518 * reloc.cc (Read_relocs::run): Likewise.
13519 (Sized_relobj::do_scan_relocs): Likewise.
13520 * icf.cc (is_function_ctor_or_dtor): New function.
13521 (Icf::find_identical_sections): Check if function is ctor or dtor when
13522 safe icf is chosen.
13523 * options.h (General_options::icf): Change option to be an enum.
13524 (Icf_status): New enum.
13525 (icf_enabled): New method.
13526 (icf_safe_folding): New method.
13527 (set_icf_status): New method.
13528 (icf_status_): New variable.
13529 * (options.cc) (General_options::finalize): Set icf_status_.
13530 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13531 icf_test and icf_keep_unique_test to use the --icf enum flag.
13532 * testsuite/icf_safe_test.sh: New file.
13533 * testsuite/icf_safe_test.cc: New file.
13534
13535 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13536
13537 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13538 includes to gc.h and icf.h.
13539 * arm.cc: Include gc.h.
13540 * gold.cc: Likewise.
13541 * i386.cc: Likewise.
13542 * powerpc.cc: Likewise.
13543 * sparc.cc: Likewise.
13544 * x86_64.cc: Likewise.
13545 * gc.h: Include icf.h.
13546
13547 2009-10-11 Ian Lance Taylor <iant@google.com>
13548
13549 * plugin.cc: Include "gold.h" before other header files.
13550
13551 2009-10-10 Chris Demetriou <cgd@google.com>
13552
13553 * options.h (Input_file_argument::Input_file_type): New enum.
13554 (Input_file_argument::is_lib_): Replace with...
13555 (Input_file_argument::type_): New member.
13556 (Input_file_argument::Input_file_argument): Take Input_file_type
13557 'type' rather than boolean 'is_lib' as second argument.
13558 (Input_file_argument::is_lib): Use type_.
13559 (Input_file_argument::is_searched_file): New function.
13560 (Input_file_argument::may_need_search): Handle is_searched_file.
13561 * options.cc (General_options::parse_library): Support -l:filename.
13562 (General_options::parse_just_symbols): Update for Input_file_argument
13563 changes.
13564 (Command_line::process): Likewise.
13565 * archive.cc (Archive::get_file_and_offset): Likewise.
13566 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13567 * script.cc (read_script_file, script_add_file): Likewise.
13568 * fileread.cc (Input_file::Input_file): Likewise.
13569 (Input_file::will_search_for): Handle is_searched_file.
13570 (Input_file::open): Likewise.
13571 * readsyms.cc (Read_symbols::get_name): Likewise.
13572 * testsuite/Makefile.am (searched_file_test): New test.
13573 * testsuite/Makefile.in: Regenerate.
13574 * testsuite/searched_file_test.cc: New file.
13575 * testsuite/searched_file_test_lib.cc: New file.
13576
13577 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13578 Ian Lance Taylor <iant@google.com>
13579
13580 * descriptor.cc: Include <cstdio> and "binary-io.h".
13581 (Descriptors::open): Open the files in binary mode always.
13582 * script.cc (Lex::get_token): Treat \r as whitespace.
13583
13584 2009-10-09 Ian Lance Taylor <iant@google.com>
13585
13586 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13587
13588 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13589 Ian Lance Taylor <iant@google.com>
13590
13591 * configure.ac: Check for readv function also.
13592 * fileread.cc (readv): Define if not HAVE_READV.
13593 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13594 does not exist.
13595 * config.in: Regenerate.
13596 * configure: Regenerate.
13597
13598 2009-10-09 Doug Kwan <dougkwan@google.com>
13599
13600 * layout.cc (Layout::make_output_section): Call target hook to make
13601 ordinary output section.
13602 (Layout::finalize): Adjust parameter list of call the
13603 Target::may_relax().
13604 * layout.h (class Layout::section_list): New method.
13605 * merge.h (Output_merge_base::entsize): Change visibility to public.
13606 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13607 New methods.
13608 (Output_merge_string::do_is_string): New method.
13609 * object.cc (Sized_relobj::do_setup): renamed from
13610 Sized_relobj::set_up.
13611 * object.h (Sized_relobj::adjust_shndx,
13612 Sized_relobj::initializ_input_to_output_maps,
13613 Sized_relobj::free_input_to_output_maps): Change visibilities to
13614 protected.
13615 (Sized_relobj::setup): Virtualize.
13616 (Sized_relobj::do_setup): New method declaration.
13617 (Sized_relobj::invalidate_section_offset,
13618 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13619 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13620 * options.cc (parse_int): New function.
13621 * options.h (parse_int): New declaration.
13622 (DEFINE_int): New macro.
13623 (stub_group_size): New option.
13624 * output.cc (Output_section::Output_section): Initialize memebers
13625 merge_section_map_, merge_section_by_properties_map_,
13626 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13627 (Output_section::add_input_section): Handled deferred code-fill
13628 generation and remove an old comment.
13629 (Output_section::add_relaxed_input_section): New method definition.
13630 (Output_section::add_merge_input_section): Use merge section by
13631 properties map to speed to search. Update merge section maps
13632 as appropriate.
13633 (Output_section::build_relaxation_map): New method definition.
13634 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13635 Same.
13636 (Output_section::relax_input_section): Renamed to
13637 Output_section::convert_input_sections_to_relaxed_sections and change
13638 interface to take a vector of pointers to relaxed sections.
13639 (Output_section::find_merge_section,
13640 Output_section::find_relaxed_input_section): New method definitions.
13641 (Output_section::is_input_address_mapped,
13642 Output_section::output_offset, Output_section::output_address):
13643 Use output section data maps to speed up searching.
13644 (Output_section::find_starting_output_address): Add comments.
13645 (Output_section::do_write,
13646 Output_section::write_to_postprocessing_buffer): Do code-fill
13647 generation as appropriate.
13648 (Output_section::get_input_sections): Invalidate relaxed input section
13649 map.
13650 (Output_section::restore_states): Adjust type of checkpoint .
13651 Invalidate relaxed input section map.
13652 * output.h (Output_merge_base): New class declaration.
13653 (Input_section_specifier): New class defintion.
13654 (class Output_relaxed_input_section) Change base class to
13655 Output_section_data_build.
13656 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13657 base class initializer.
13658 (Output_section::add_relaxed_input_section): New method declaration.
13659 (Output_section::Input_section): Change visibility to protected.
13660 (Output_section::Input_section::relobj,
13661 Output_section::Input_section::shndx): Handle relaxed input sections.
13662 Output_section::input_sections) Change visibility to protected. Also
13663 define overload to return a non-const pointer.
13664 (Output_section::Merge_section_properties): New class defintion.
13665 (Output_section::Merge_section_by_properties_map,
13666 Output_section::Output_section_data_by_input_section_map,
13667 Output_section::Relaxation_map): New types.
13668 (Output_section::relax_input_section): Rename method to
13669 Output_section::convert_input_sections_to_relaxed_sections and change
13670 interface to take a vector of relaxed section pointers.
13671 (Output_section::find_merge_section,
13672 Output_section::find_relaxed_input_section,
13673 Output_section::build_relaxation_map,
13674 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13675 New method declarations.
13676 (Output_section::merge_section_map_
13677 Output_section::merge_section_by_properties_map_,
13678 Output_section::relaxed_input_section_map_,
13679 Output_section::is_relaxed_input_section_map_valid_,
13680 Output_section::generate_code_fills_at_write_): New data members.
13681 * script-sections.cc
13682 (Output_section_element_input::set_section_addresses): Call
13683 current_data_size and addralign methods of relaxed input sections.
13684 (Orphan_output_section::set_section_addresses): Call current_data_size
13685 and addralign methods of relaxed input sections.
13686 * symtab.cc (Symbol_table::compute_final_value): Extract template
13687 from the body of Symbol_table::sized_finalize_symbol.
13688 (Symbol_table::sized_finalized_symbol): Call
13689 Symbol_table::compute_final_value.
13690 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13691 (Symbol_table::compute_final_value): New templated method declaration.
13692 * target.cc (Target::do_make_output_section): New method defintion.
13693 * target.h (Target::make_output_section): New method declaration.
13694 (Target::relax): Add more parameters for input objects, symbol table
13695 and layout. Adjust call to do_relax.
13696 (Target::do_make_output_section): New method declaration.
13697 (Target::do_relax): Add parameters for input objects, symbol table
13698 and layout.
13699
13700 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13701
13702 * pread.c: Include stdio.h.
13703
13704 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13705
13706 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13707 defined.
13708
13709 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13710
13711 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13712 Change read_shndx type to unsigned int.
13713 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13714 int.
13715 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13716 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13717 Change read_shndx type to unsigned int.
13718 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13719 int.
13720 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13721 * layout.cc (Layout::create_symtab_sections): Cast the result of
13722 local_symcount * symsize to off_t in the gold_assert.
13723
13724 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13725
13726 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13727 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13728 R_ARM_BASE_ABS.
13729 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13730 (Arm_relocate_functions::thm_abs5): New function.
13731 (Arm_relocate_functions::abs12): New function.
13732 (Arm_relocate_functions::abs16): New function.
13733 (Arm_relocate_functions::base_abs): New function.
13734 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13735 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13736 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13737 R_ARM_BASE_ABS.
13738 (Scan::global): Likewise.
13739 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13740 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13741 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13742 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13743 R_ARM_BASE_ABS.
13744
13745 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13746
13747 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13748 (Arm_relocate_functions::movt_prel): New function.
13749 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13750 (Arm_relocate_functions::thm_movt_prel): New function.
13751 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13752 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13753 (Scan::global, Relocate::relocate): Likewise.
13754 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13755
13756 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13757
13758 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13759 Incremental_checker.
13760 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13761 unsigned int.
13762 (class Incremental_inputs_header): New class.
13763 (Incremental_inputs_header_writer): Edit comment.
13764 (Incremental_inputs_entry): New class.
13765 (Incremental_inputs_entry_writer): Edit comment.
13766 (Sized_incremental_binary::do_find_incremental_inputs_section):
13767 Add *strtab_shndx parameter, fill it.
13768 (Sized_incremental_binary::do_check_inputs): New method.
13769 (Incremental_checker::can_incrementally_link_output_file): Use
13770 Sized_incremental_binary::check_inputs.
13771 (Incremental_inputs::report_command_line): Save command line in
13772 command_line_.
13773 * incremental.h:
13774 (Incremental_binary::find_incremental_inputs_section): New
13775 method.
13776 (Incremental_binary::do_find_incremental_inputs_section): Add
13777 strtab_shndx parameter.
13778 (Incremental_binary::do_check_inputs): New pure virtual method.
13779 (Sized_incremental_binary::do_check_inputs): Declare.
13780 (Incremental_checker::Incremental_checker): Add incremental_inputs
13781 parameter, use it to initialize incremental_inputs_.
13782 (Incremental_checker::incremental_inputs_): New field.
13783 (Incremental_checker::command_line): New method.
13784 (Incremental_checker::inputs): New method.
13785 (Incremental_checker::command_line_): New field.
13786
13787 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13788
13789 * incremental.cc: Include <cstdarg> and "target-select.h".
13790 (vexplain_no_incremental): New function.
13791 (explain_no_incremental): New function.
13792 (Incremental_binary::error): New method.
13793 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13794 method.
13795 (make_sized_incremental_binary): New function.
13796 (open_incremental_binary): New function.
13797 (can_incrementally_link_file): Add checks if output is ELF and has
13798 inputs section.
13799 * incremental.h: Include "elfcpp_file.h" and "output.h".
13800 (Incremental_binary): New class.
13801 (Sized_incremental_binary): New class.
13802 (open_incremental_binary): Declare.
13803 * object.cc (is_elf_object): Use
13804 elfcpp::Elf_recognizer::is_elf_file.
13805 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13806 * output.h (Output_file::filesize): New method.
13807
13808 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13809
13810 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13811 New function.
13812 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13813 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13814 function.
13815 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13816 function.
13817 (Arm_relocate_functions::movw_abs_nc): New function.
13818 (Arm_relocate_functions::movt_abs): New function.
13819 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13820 (Arm_relocate_functions::thm_movt_abs): New function.
13821 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13822 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13823 (Scan::global): Likewise.
13824 (Relocate::relocate): Likewise.
13825 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13826
13827 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13828
13829 * arm.cc (Arm_relocate_functions::got_prel) New function.
13830 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13831 (Relocate::relocate): Likewise.
13832 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13833
13834 2009-10-06 Ian Lance Taylor <iant@google.com>
13835
13836 * options.h (class General_options): Define
13837 split_stack_adjust_size parameter.
13838 * object.h (class Object): Add uses_split_stack_ and
13839 has_no_split_stack_ fields. Add uses_split_stack and
13840 has_no_split_stack accessor functions. Declare
13841 handle_split_stack_section.
13842 (class Reloc_symbol_changes): Define.
13843 (class Sized_relobj): Define Function_offsets. Declare
13844 split_stack_adjust, split_stack_adjust_reltype, and
13845 find_functions.
13846 * object.cc (Object::handle_split_stack_section): New function.
13847 (Sized_relobj::do_layout): Call handle_split_stack_section.
13848 * dynobj.cc (Sized_dynobj::do_layout): Call
13849 handle_split_stack_section.
13850 * reloc.cc (Sized_relobj::relocate_sections): Call
13851 split_stack_adjust for executable sections in split_stack
13852 objects. Pass reloc_map to relocate_section.
13853 (Sized_relobj::split_stack_adjust): New function.
13854 (Sized_relobj::split_stack_adjust_reltype): New function.
13855 (Sized_relobj::find_functions): New function.
13856 * target-reloc.h: Include "object.h".
13857 (relocate_section): Add reloc_symbol_changes parameter. Change
13858 all callers.
13859 * target.h (class Target): Add calls_non_split method. Declare
13860 do_calls_non_split virtual method. Declare match_view and
13861 set_view_to_nop.
13862 * target.cc: Include "elfcpp.h".
13863 (Target::do_calls_non_split): New function.
13864 (Target::match_view): New function.
13865 (Target::set_view_to_nop): New function.
13866 * gold.cc (queue_middle_tasks): Give an error if mixing
13867 split-stack and non-split-stack objects with -r.
13868 * i386.cc (Target_i386::relocate_section): Add
13869 reloc_symbol_changes parameter.
13870 (Target_i386::do_calls_non_split): New function.
13871 * x86_64.cc (Target_x86_64::relocate_section): Add
13872 reloc_symbol_changes parameter.
13873 (Target_x86_64::do_calls_non_split): New function.
13874 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13875 parameter.
13876 * powerpc.cc (Target_powerpc::relocate_section): Add
13877 reloc_symbol_changes parameter.
13878 * sparc.cc (Target_sparc::relocate_section): Add
13879 reloc_symbol_changes parameter.
13880 * configure.ac: Call AM_CONDITIONAL for the default target.
13881 * configure: Rebuild.
13882 * testsuite/Makefile.am (TEST_AS): New variable.
13883 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13884 (check_DATA): Add split_i386 and split_x86_64 files.
13885 (SPLIT_DEFSYMS): Define.
13886 (split_i386_[1234n].o): New targets.
13887 (split_i386_[124]): New targets.
13888 (split_i386_[1234r].stdout): New targets.
13889 (split_x86_64_[1234n].o): New targets.
13890 (split_x86_64_[124]): New targets.
13891 (split_x86_64_[1234r].stdout): New targets.
13892 (MOSTLYCLEANFILES): Add new executables.
13893 * testsuite/split_i386.sh: New file.
13894 * testsuite/split_x86_64.sh: New file.
13895 * testsuite/split_i386_1.s: New file.
13896 * testsuite/split_i386_2.s: New file.
13897 * testsuite/split_i386_3.s: New file.
13898 * testsuite/split_i386_4.s: New file.
13899 * testsuite/split_i386_n.s: New file.
13900 * testsuite/split_x86_64_1.s: New file.
13901 * testsuite/split_x86_64_2.s: New file.
13902 * testsuite/split_x86_64_3.s: New file.
13903 * testsuite/split_x86_64_4.s: New file.
13904 * testsuite/split_x86_64_n.s: New file.
13905 * testsuite/testfile.cc (Target_test): Update relocation_section
13906 function.
13907 * testsuite/Makefile.in: Rebuild.
13908
13909 2009-10-06 Ian Lance Taylor <iant@google.com>
13910
13911 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13912 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13913 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13914 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13915 the address on ldo_addrs_.
13916 (Target_i386::Relocate::fix_up_ldo): New function.
13917
13918 2009-10-06 Rafael Espindola <espindola@google.com>
13919
13920 * plugin.cc (add_input_library): New.
13921 (Plugin::load): Add add_input_library to tv.
13922 (Plugin_manager::add_input_file): Add the is_lib argument.
13923 (add_input_file): Update call to Plugin_manager::add_input_file.
13924 (add_input_library): New.
13925 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13926
13927 2009-09-30 Doug Kwan <dougkwan@google.com>
13928
13929 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13930 symbol and call Symbol::may_need_copy_reloc to determine if
13931 a copy reloc is needed.
13932 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13933 nocopyreloc is given in command line.
13934 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13935 given in command line.
13936 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13937 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13938 of the removed Target_i386::may_need_copy_reloc.
13939 * options.h (copyreloc): New option with default value false.
13940 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13941 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13942 instead of the removed Target_powerpc::may_need_copy_reloc.
13943 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13944 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13945 instead of the removed Target_sparc::may_need_copy_reloc.
13946 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13947 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13948 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13949 instead of the removed Target_x86_64::may_need_copy_reloc.
13950
13951 2009-09-30 Ian Lance Taylor <iant@google.com>
13952
13953 * object.h (class Object): Remove target_ field, and target,
13954 sized_target, and set_target methods.
13955 (Object::sized_target): Remove.
13956 (class Sized_relobj): Update declarations. Remove sized_target.
13957 * object.cc (Sized_relobj::setup): Remove target parameter.
13958 Change all callers.
13959 (Input_objects::add_object): Don't do anything with the target.
13960 (make_elf_sized_object): Add punconfigured parameter. Change all
13961 callers. Set or test parameter target.
13962 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13963 Change all callers.
13964 * parameters.cc (Parameters::set_target): Change parameter type to
13965 be non-const.
13966 (Parameters::default_target): Remove.
13967 (set_parameters_target): Change parameter type to be non-const.
13968 (parameters_force_valid_target): New function.
13969 (parameters_clear_target): New function.
13970 * parameters.h (class Parameters): Update declarations. Remove
13971 default_target method. Add sized_target and clear_target
13972 methods. Change target_ to be non-const.
13973 (set_parameters_target): Update declaration.
13974 (parameters_force_valid_target): Declare.
13975 (parameters_clear_target): Declare.
13976 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13977 as NULL if we aren't searching.
13978 (Add_symbols::run): Don't check for compatible target.
13979 * fileread.cc (Input_file::open_binary): Call
13980 parameters_force_valid_target.
13981 * gold.cc (queue_middle_tasks): Likewise.
13982 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13983 set_target on object.
13984 * dynobj.h (class Sized_dynobj): Update declarations.
13985 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13986 make_elf_object returns NULL.
13987 (Archive::include_member): Don't check whether object target is
13988 compatible.
13989 * output.cc (Output_section::add_input_section): Get target from
13990 parameters.
13991 (Output_section::relax_input_section): Likewise.
13992 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13993 parameters.
13994 (Sized_relobj::do_scan_relocs): Likewise.
13995 (Sized_relobj::relocate_sections): Likewise.
13996 * resolve.cc (Symbol_table::resolve): Likewise.
13997 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13998 parameter. Change all callers.
13999 (Symbol_table::add_from_object): Get target from parameters.
14000 (Symbol_table::add_from_relobj): Don't check object target.
14001 (Symbol_table::add_from_dynobj): Likewise.
14002 (Symbol_table::define_special_symbol): Get target from
14003 parameters.
14004 * symtab.h (class Symbol_table): Update declaration.
14005 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
14006 parameter. Change all callers. Clear parameter target.
14007 (Binary_test): Test target here.
14008 * testsuite/object_unittest.cc (gold_testsuite): Remove
14009 target_test_pointer parameter. Change all callers.
14010 (Object_test): Test target here.
14011
14012 2009-09-26 Ian Lance Taylor <iant@google.com>
14013
14014 * testsuite/initpri1.c: Don't try to use constructor priorities if
14015 compiling with gcc before 4.3.
14016
14017 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
14018
14019 * testsuite/retain_symbols_file_test.sh (check_present): Change
14020 output file name to retain_symbols_file_test.stdout.
14021 (check_absent): Likewise.
14022
14023 2009-09-18 Craig Silverstein <csilvers@google.com>
14024
14025 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
14026 * options.cc: Include <cerrno> and <fstream>.
14027 (General_options::finalize): Parse -retain-symbols-file tag.
14028 * options.h: New flag.
14029 (General_options): New method should_retain_symbol, new
14030 variable symbols_to_retain.
14031 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
14032 should_retain_symbol map.
14033 * testsuite/Makefile.am (retain_symbols_file_test): New test.
14034 * testsuite/Makefile.in: Regenerate.
14035 * testsuite/retain_symbols_file_test.sh: New file.
14036
14037 2009-09-18 Nick Clifton <nickc@redhat.com>
14038
14039 * po/es.po: Updated Spanish translation.
14040
14041 2009-09-17 Doug Kwan <dougkwan@google.com>
14042
14043 * debug.h (DEBUG_RELAXATION): New constant.
14044 (DEBUG_ALL): Add DEBUG_RELAXATION.
14045 (debug_string_to_enum): Add relaxation debug option.
14046 * layout.cc
14047 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
14048 Layout::Relaxation_debug_check::read_sections,
14049 Layout::Relaxation_debug_check::read_sections): New method definitions.
14050 (Layout::Layout): Initialize data members
14051 record_output_section_data_from_scrips_,
14052 script_output_section_data_list_ and relaxation_debug_check_.
14053 (Layout::save_segments, Layout::restore_segments,
14054 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14055 Layout::relaxation_loop_body): New method definitions.
14056 (Layout::finalize): Support relaxation. Move section layout code to
14057 Layout::relaxation_loop_body.
14058 (Layout::set_asection_address_from_script): Move code for orphan
14059 section placement out.
14060 (Layout::place_orphan_sections_in_script): New method definition.
14061 * layout.h (Output_segment_headers, Output_file_header):
14062 New forward class declarations.
14063 (Layout::~Layout): Define.
14064 (Layout::new_output_section_data_from_script): New method definition.
14065 (Layout::place_orphan_sections_in_script): New method declaration.
14066 (Layout::Segment_states): New type declaration.
14067 (Layout::save_segments, Layout::restore_segments,
14068 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14069 Layout::relaxation_loop_body): New method declarations.
14070 (Layout::Output_section_data_list): New type declaration.
14071 (Layout::Relaxation_debug_check): New class definition.
14072 (Layout::record_output_section_data_from_script_,
14073 Layout::script_output_section_data_list_, Layout::segment_states_,
14074 Layout::relaxation_debug_check_): New data members.
14075 * output.cc: (Output_section_headers::do_size): New method definition.
14076 (Output_section_headers::Output_section_headers): Move size
14077 computation to Output_section_headers::do_size.
14078 (Output_segment_headers::do_size): New method definition.
14079 (Output_file_header::Output_file_header): Move size computation to
14080 Output_file_header::do_size and call it.
14081 (Output_file_header::do_size): New method definition.
14082 (Output_data_group::Output_data_group): Adjust call to
14083 Output_section_data.
14084 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14085 (Output_symtab_xindex::do_write): Add array bound check.
14086 (Output_section::Input_section::print_to_mapfile): Handle
14087 RELAXED_INPUT_SECTION_CODE.
14088 (Output_section::Output_section): Initialize data member checkpoint_.
14089 (Output_section::~Output_section): Delete checkpoint object pointed
14090 by checkpoint_.
14091 (Output_section::add_input_section): Always add an Input_section if
14092 relaxing.
14093 (Output_section::add_merge_input_section): Add assert.
14094 (Output_section::relax_input_section): New method definition.
14095 (Output_section::set_final_data_size): Set load address to zero for
14096 an unallocated section.
14097 (Output_section::do_address_and_file_offset_have_reset_values):
14098 New method definition.
14099 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14100 Handle relaxed input section.
14101 (Output_section::sort_attached_input_sections): Checkpoint input
14102 section list lazily.
14103 (Output_section::get_input_sections): Change type of input_sections to
14104 list of Simple_input_section pointers. Checkpoint input section list
14105 lazily. Also handle relaxed input sections.
14106 (Output_section::add_input_section_for_script): Take a reference to
14107 a Simple_input_section object instead of Relobj pointer and section
14108 index as parameter. Handle relaxed input sections.
14109 (Output_section::save_states, Output_section::restore_states): New
14110 method definitions.
14111 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14112 (Output_data::is_data_size_fixed): New method definition.
14113 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14114 if it is fixed.
14115 (Output_data::address_and_file_offset_have_reset_values): New method
14116 definition.
14117 (Output_data::do_address_and_file_offset_have_reset_values): New method
14118 definition.
14119 (Output_data::set_data_size): Check that data size is not fixed.
14120 (Output_data::fix_data_size): New method definition.
14121 (Output_data::is_data_size_fixed_): New data member.
14122 (Output_section_headers::set_final_data_size): New method definition.
14123 (Output_section_headers::do_size): New method declaration.
14124 (Output_segment_headers::set_final_data_size): New method definition.
14125 (Output_segment_headers::do_size): New method declaration.
14126 (Output_file_header::set_final_data_size)::New method definition.
14127 (Output_file_header::do_size)::New method declaration.
14128 (Output_section_data::Output_section_data): Add new parameter
14129 is_data_size_fixed and use it to fix data size.
14130 (Output_data_const::Output_data_const): Adjust call to base class
14131 constructor and fix data size.
14132 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14133 base class constructor and fix data size.
14134 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14135 base class constructor and fix data size.
14136 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14137 class constructor and fix data size.
14138 (Output_data_group::set_final_data_size): New method definition.
14139 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14140 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14141 class constructor and fix data size.
14142 (Output_relaxed_input_section): New class definition.
14143 (Output_section::Simple_input_section): New class definition.
14144 (Output_section::get_input_sections): Adjust parameter list.
14145 (Output_section::add_input_section_for_script): Same.
14146 (Output_section::save_states, Output_section::restore_states,
14147 Output_section::do_address_and_file_offset_have_reset_values,
14148 (Output_section::Input_section::Input_section): Handle
14149 RELAXED_INPUT_SECTION_CODE. Add new overload for
14150 Output_relaxed_input_section.
14151 (Output_section::Input_section::is_input_section,
14152 Output_section::Input_section::set_output_section): Handle relaxed
14153 input section.
14154 (Output_section::Input_section::is_relaxed_input_section,
14155 Output_section::Input_section::output_section_data,
14156 Output_section::Input_section::relaxed_input_section): New method
14157 definitions.
14158 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14159 value.
14160 (Output_section::Input_section::u1_): Update comments.
14161 (Output_section::Input_section::u2_): Add new union member poris.
14162 (Output_section::Checkpoint_output_section): New classs definition.
14163 (Output_section::relax_input_section): New method declaration.
14164 (Output_section::checkpoint_): New data member.
14165 (Output_segment): Update comments.
14166 (Output_segment::Output_segment): Un-privatize copy constructor.
14167 (Output_segment::operator=): Un-privatize.
14168 * script-sections.cc (Output_section_element::Input_section_list):
14169 Change element type to Output_section::Simple_input_section.
14170 (Output_section_element_dot_assignment::set_section_addresses):
14171 Register output section data for relaxation clean up.
14172 (Output_data_exression::Output_data_expression): Adjust call to base
14173 constructor to fix data size.
14174 (Output_section_element_data::set_section_addresses): Register
14175 Output_data_expression object for relaxation clean up.
14176 (struct Input_section_info): Replace Relobj pointer and section index
14177 pair with Output_section::Simple_input_section and Convert struct to a
14178 class.
14179 (Input_section_sorter::operator()): Adjust access to
14180 Input_section_info data member to use accessors.
14181 (Output_section_element_input::set_section_addresses): Use layout
14182 parameter. Adjust code to use Output_section::Simple_input_section
14183 and Input_secction_info classes. Register filler for relaxation
14184 clean up.
14185 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14186 and section index pair with Output_section::Simple_input_section
14187 class. Adjust code accordingly.
14188 (Phdrs_element::release_segment): New method definition.
14189 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14190 segment list.
14191 (Script_sections::release_segments): New method definition.
14192 * gold/script-sections.h (Script_sections::release_segments): New
14193 method declaration.
14194 * gold/target.h (Target::may_relax, Target::relax,
14195 Target::do_may_relax, Target::do_relax): New method definitions.
14196
14197 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14198
14199 * arm.cc (has_signed_unsigned_overflow): New function.
14200 (Arm_relocate_functions::abs8): New function.
14201 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14202 (Target_arm::Scan::global): Likewise.
14203 (Target_arm::relocate::relocate): Likewise.
14204 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14205 Likewise.
14206
14207 2009-09-16 Cary Coutant <ccoutant@google.com>
14208
14209 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14210 * testsuite/Makefile.in: Regenerate.
14211
14212 2009-09-11 Nick Clifton <nickc@redhat.com>
14213
14214 * po/gold.pot: Updated by the Translation project.
14215
14216 2009-09-08 Cary Coutant <ccoutant@google.com>
14217
14218 * output.cc (Output_file::open): Add execute permission to empty file.
14219 * testsuite/Makefile.am (permission_test): New test.
14220 * testsuite/Makefile.in: Regenerate.
14221
14222 2009-09-02 Ian Lance Taylor <iant@google.com>
14223
14224 * output.cc (Output_file::resize): Call map_no_anonymous rather
14225 than map.
14226
14227 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14228
14229 * gold.cc: Include "incremental.h".
14230 (queue_initial_tasks): Call Incremental_checker methods.
14231 * incremental.cc: Include "output.h".
14232 (Incremental_checker::can_incrementally_link_output_file): New
14233 method.
14234 * incremental.h (Incremental_checker): New class.
14235
14236 * output.cc (Output_file::open_for_modification): New method.
14237 (Output_file::map_anonymous): Changed return type to bool. Record
14238 map in base_ field.
14239 (Output_file::map_no_anonymous): New method, broken out of map.
14240 (Output_file::map): Use map_no_anonymous and map_anonymous.
14241 * output.h (class Output_file): Update declarations.
14242
14243 2009-08-24 Cary Coutant <ccoutant@google.com>
14244
14245 * options.h (Command_line::Pre_options): New class.
14246 (Command_line::pre_options): New member.
14247 * options.cc (gold::options::ready_to_register): New variable.
14248 (One_option::register_option): Do nothing if not registering options.
14249 Assert if same short option registered twice.
14250 (General_options::General_options): Turn off option registration when
14251 done constructing.
14252 (Command_line::Pre_options::Pre_options): New constructor.
14253
14254 2009-08-24 Cary Coutant <ccoutant@google.com>
14255
14256 * options.h (General_options::no_keep_memory): Remove incorrect
14257 short option.
14258
14259 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14260
14261 * Makefile.am (am__skiplex, am__skipyacc): New.
14262 * Makefile.in: Regenerate.
14263
14264 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14265
14266 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14267 (INCLUDES): ... this.
14268 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14269 (AM_CPPFLAGS): Renamed from ...
14270 (INCLUDE): ... this.
14271 * Makefile.in, testsuite/Makefile.in: Regenerate.
14272
14273 * Makefile.in: Regenerate.
14274 * aclocal.m4: Likewise.
14275 * config.in: Likewise.
14276 * configure: Likewise.
14277 * testsuite/Makefile.in: Likewise.
14278
14279 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14280 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14281 * Makefile.in: Regenerate.
14282 * testsuite/Makefile.in: Regenerate.
14283
14284 2009-08-19 Cary Coutant <ccoutant@google.com>
14285
14286 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14287 symbols in shared libraries overridden by hidden or internal symbols
14288 in the main program.
14289
14290 2009-08-19 Chris Demetriou <cgd@google.com>
14291
14292 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14293 checking source file names in error messages.
14294
14295 2009-08-18 Doug Kwan <dougkwan@google.com>
14296
14297 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14298 an elcpp::Ehdr as parameter. Adjust call to set_target.
14299 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14300 an elfcpp::Ehdr as parameter.
14301 * object.cc (Object::set_target): Remove the version that looks up
14302 a target and sets it.
14303 (Sized_relobj::setup): Take a Target object instead of
14304 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14305 (make_elf_sized_object): Find target and ask target to
14306 make an ELF object.
14307 * object.h: (Object::set_target): Remove the version that looks up
14308 a target and sets it.
14309 (Sized_relobj::setup): Take a Target object instead of
14310 an elfcpp:Ehdr as parameter.
14311 * target.cc: Include dynobj.h.
14312 (Target::do_make_elf_object_implementation): New.
14313 (Target::do_make_elf_object): New.
14314 * target.h (Target::make_elf_object): New template declaration.
14315 (Target::do_make_elf_object): New method declarations.
14316 (Target::do_make_elf_object_implementation): New template declaration.
14317
14318 2009-08-14 Ian Lance Taylor <iant@google.com>
14319
14320 * gold.h (FUNCTION_NAME): Define.
14321 (gold_unreachable): Use FUNCTION_NAME.
14322
14323 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14324
14325 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14326 symbol in the --keep-unique list is not found.
14327
14328 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14329
14330 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14331 been maked as --keep-unique.
14332 (Icf::unfold_section): New function.
14333 * icf.h (Icf::unfold_section): New function.
14334 * options.h (General_options::keep_unique): New option.
14335 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14336 * testsuite/Makefile.in: Regenerate.
14337 * testsuite/icf_keep_unique_test.sh: New file.
14338 * testsuite/icf_keep_unique_test.cc: New file.
14339
14340 2009-08-12 Cary Coutant <ccoutant@google.com>
14341
14342 PR 10471
14343 * resolve.cc (Symbol_table::resolve): Check for references from
14344 dynamic objects to hidden and internal symbols.
14345 * testsuite/Makefile.am (hidden_test.sh): New test.
14346 * testsuite/Makefile.in: Regenerate.
14347 * testsuite/hidden_test.sh: New script.
14348 * testsuite/hidden_test_1.c: New test source.
14349 * testsuite/hidden_test_main.c: New test source.
14350
14351 2009-08-11 Doug Kwan <dougkwan@google.com>
14352
14353 * arm.cc: Update comments.
14354 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14355 segment to locate the .ARM.exidx section if present.
14356
14357 2009-08-09 Doug Kwan <dougkwan@google.com>
14358
14359 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14360 patch.
14361
14362 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14363 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14364 compiler warnings.
14365
14366 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14367
14368 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14369 valid tls_segment only for non-debug-section relocations.
14370 * testsuite/Makefile.am: Add gc_tls_test.
14371 * testsuite/Makefile.in: Regenerate.
14372 * testsuite/gc_tls_test.cc: New file.
14373 * testsuite/gc_tls_test.sh: New file.
14374
14375 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14376
14377 * icf.cc: New file.
14378 * icf.h: New file.
14379 * Makefile.am (CCFILES): Add icf.cc.
14380 (HFILES): Add icf.h
14381 * Makefile.in: Regenerate.
14382 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14383 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14384 section, symbol and addend information for the relocs.
14385 * gold.cc (queue_middle_tasks): Call identical code folding.
14386 * gold.h: Add defines for multimap.
14387 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14388 to the call of finalize_local_symbols.
14389 * main.cc (main): Create object of class Icf.
14390 * object.cc (Sized_relobj::do_layout): Allow this function to be
14391 called twice during icf.
14392 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14393 to sections marked as identical by icf.
14394 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14395 when available.
14396 (Sized_relobj::do_section_entsize): New function.
14397 * object.h (Object::section_entsize): New function.
14398 (Object::do_section_entsize): New pure virtual function.
14399 (Relobj::finalize_local_symbols): Add new parameter.
14400 (Relobj::do_section_entsize): New function.
14401 * options.h (General_options::icf): New option.
14402 (General_options::icf_iterations): New option.
14403 (General_options::print_icf_sections): New option.
14404 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14405 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14406 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14407 icf.
14408 * symtab.cc (Symbol_table::is_section_folded): New function.
14409 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14410 to sections marked as identical by icf.
14411 * symtab.h (Symbol_table::set_icf): New function.
14412 (Symbol_table::icf): New function.
14413 (Symbol_table::is_section_folded): New function.
14414 (Symbol_table::icf_): New data member.
14415 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14416 * testsuite/Makefile.am: Add commands to build icf_test.
14417 * testsuite/Makefile.in: Regenerate.
14418 * testsuite/icf_test.sh: New file.
14419 * testsuite/icf_test.cc: New file.
14420
14421 2009-07-24 Chris Demetriou <cgd@google.com>
14422
14423 * layout.cc (is_compressible_debug_section): Fix incorrect
14424 comment about compressed section names.
14425
14426 2009-07-20 Ian Lance Taylor <ian@airs.com>
14427
14428 PR 10419
14429 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14430
14431 2009-07-16 Ian Lance Taylor <iant@google.com>
14432
14433 PR 10400
14434 * layout.h: #include <map>.
14435 (class Kept_section): Change from struct to class. Add accessors
14436 and setters. Add section size to Comdat_group mapping. Change
14437 Comdat_group to std::map. Add is_comdat_ field. Add
14438 linkonce_size field in union.
14439 (class Layout): Update declaration of find_or_add_kept_section.
14440 Don't declare find_kept_object.
14441 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14442 parameter. Add object, shndx, is_comdat, and is_group_name
14443 parameters. Change all callers. Adjust for new Kept_section.
14444 (Layout::find_kept_object): Remove.
14445 * object.cc (Sized_relobj::include_section_group): Update use of
14446 Kept_section. Rename secnum to shndx. Only record
14447 Kept_comdat_section if sections are the same size.
14448 (Sized_relobj::include_linkonce_section): Update use of
14449 Kept_section. Only record Kept_comdat_section if sections are the
14450 same size. Set size of linkonce section.
14451 (Sized_relobj::map_to_kept_section): Update call to
14452 get_kept_comdat_section.
14453 * object.h (class Sized_relobj): Rename fields in
14454 Kept_comdat_section to drop trailing underscores; change object
14455 field to Relobj*. Change Kept_comdat_section_table to store
14456 struct rather than pointer.
14457 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14458 Add kept_object and kept_shndx parameters. Change all callers.
14459 (Sized_relobj::get_kept_comdat_section): Change return type to
14460 bool. Add kept_object and kept_shndx parameters. Change all
14461 callers.
14462 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14463 Layout::find_or_add_kept_section.
14464
14465 2009-07-09 Ian Lance Taylor <iant@google.com>
14466
14467 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14468 Reserve space in the hash table.
14469
14470 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14471
14472 * fileread.cc (File_read::get_mtime): New method.
14473 * fileread.h (Timespec): New structure.
14474 (File_read::get_mtime): New method.
14475 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14476 Renamed from timestamp_nsec.
14477 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14478 Elf_Xword.
14479 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14480 timestamp_nsec.
14481 (Incremental_inputs::report_archive): Save mtime; style fix.
14482 (Incremental_inputs::report_obejct): Save mtime; style fix.
14483 (Incremental_inputs::report_script): Save mtime; style fix.
14484 (Incremental_inputs::finalize_inputs): Style fix.
14485 (Incremental_inputs::finalize): Style fix.
14486 (Incremental_inputs::create_input_section_data): Store inputs
14487 mtime.
14488 * incremental.h (Incremental_inputs::report_script): Add mtime
14489 argument.
14490 (Incremental_inputs::Input_info::Input_info): Intialize only one
14491 union member.
14492 (Incremental_inputs::Input_info::archive): Move to nameless
14493 union.
14494 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14495 (Incremental_inputs::Input_info::script): Move to nameless union.
14496 (Incremental_inputs::mtime): New field.
14497 * script.cc (read_input_script): Pass file mtime to
14498 Incremental_input.
14499 * script.h (Script_info::inputs): Style fix.
14500
14501 2009-07-01 Ian Lance Taylor <ian@airs.com>
14502
14503 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14504 instead of 32.
14505
14506 2009-06-24 Ian Lance Taylor <iant@google.com>
14507
14508 PR 10156
14509 * layout.cc (Layout::choose_output_section): If we find an
14510 existing section, update the flags.
14511 (Layout::create_notes): New function, broken out of
14512 Layout::finalize.
14513 (Layout::finalize): Don't create note sections.
14514 (Layout::create_note): Don't crash if linker script discards
14515 section.
14516 (Layout::create_gold_note): Likewise.
14517 (Layout::create_build_id): Likewise. Don't set
14518 after_input_sections on the section.
14519 (Layout::create_executable_stack_info): Remove target parameter.
14520 Change caller.
14521 * layout.h (class Layout): Declare create_notes. Update
14522 declaration of create_executable_stack_info.
14523 * gold.cc (queue_middle_tasks): Call create_notes.
14524 * output.cc (Output_section::update_flags_for_input_section): Move
14525 here from output.h. If SHF_ALLOC flag is newly set, mark address
14526 invalid.
14527 * output.h (Output_data::mark_address_invalid): New function.
14528 (class Output_section): Only declare, not define,
14529 update_flags_for_input_section. Remove set_flags.
14530
14531 2009-06-24 Ian Lance Taylor <iant@google.com>
14532
14533 * script-sections.cc (Output_section_definition::
14534 set_section_addresses): Rename shadowing local load_address to
14535 laddr.
14536
14537 2009-06-24 Ian Lance Taylor <iant@google.com>
14538
14539 PR 10244
14540 * reloc.cc (relocate_sections): Skip empty relocation sections.
14541
14542 2009-06-23 Ian Lance Taylor <iant@google.com>
14543
14544 PR 10156
14545 * layout.cc (Layout::create_note): Use choose_output_section
14546 rather than make_output_section.
14547
14548 2009-06-23 Ian Lance Taylor <iant@google.com>
14549
14550 PR 10237
14551 * options.cc (General_options::parse_V): Set printed_version_.
14552 (General_options::General_options): Initialize printed_version_.
14553 * options.h (class General_options): Add printed_version_ field.
14554 * gold.cc (queue_initial_tasks): If there are no input files,
14555 don't give a fatal error if we printed the version information.
14556 (queue_middle_tasks): If using -r with a shared object, give a
14557 fatal error rather than an ordinary error.
14558
14559 2009-06-23 Ian Lance Taylor <iant@google.com>
14560
14561 PR 10219
14562 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14563 (Layout::make_output_section): Set have_stabstr_section_ if we see
14564 a .stab*str section.
14565 (Layout::finalize): Call link_stabs_sections.
14566 (Layout::link_stabs_sections): New file.
14567 * layout.h (class Layout): Add have_stabstr_section_ field.
14568 Declare link_stabs_sections.
14569
14570 2009-06-23 Doug Kwan <dougkwan@google.com>
14571
14572 * Makefile.am (libgold_a_LIBADD): New.
14573 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14574 * Makefile.in: Regenerate.
14575 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14576 * configure: Regenerate.
14577 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14578 * fileread.cc: Include sys/state.h
14579 * gold.h: Declare memmem and strndup if found missing.
14580 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14581
14582 2009-06-23 Ian Lance Taylor <iant@google.com>
14583
14584 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14585 * configure: Rebuild.
14586
14587 2009-06-23 Ian Lance Taylor <iant@google.com>
14588
14589 PR 10147
14590 * object.cc (Object::section_contents): Don't try to get a view if
14591 the section has length zero.
14592 (Object::handle_gnu_warning_section): If the section is empty, use
14593 the name of the section as the warning.
14594
14595 2009-06-23 Ian Lance Taylor <iant@google.com>
14596
14597 PR 10133
14598 * stringpool.h (class Stringpool_template): Add optimize_ field.
14599 (Stringpool_template::set_optimize): New function.
14600 * stringpool.cc (Stringpool_template::Stringpool_template):
14601 Initialize optimize_ field.
14602 (Stringpool_template::set_string_offsets): Test local optimize
14603 fild rather than parameter.
14604 * layout.cc (Layout::Layout): Call set_optimize on the section
14605 name stringpool.
14606
14607 2009-06-22 Ian Lance Taylor <iant@google.com>
14608
14609 PR 10030
14610 * yyscript.y: Parse TARGET.
14611 * script.cc (script_set_target): New function.
14612 * script-c.h (script_set_target): Declare.
14613 * options.cc (General_options::string_to_object_format): Rename
14614 from string_to_object_format in anonymous namespace. Change
14615 callers.
14616 * options.h (class General_options): Declare
14617 string_to_object_format.
14618
14619 2009-06-22 Ian Lance Taylor <iant@google.com>
14620
14621 * script-sections.cc (Script_sections::create_segments): Don't put
14622 program headers in a PT_LOAD segment if -n or -N.
14623
14624 2009-06-22 Ian Lance Taylor <iant@google.com>
14625
14626 PR 10141
14627 * options.h (class General_options): Add -z lazy and -z now. Sort
14628 -z options into alphabetical order.
14629 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14630
14631 2009-06-21 Ian Lance Taylor <iant@google.com>
14632
14633 * layout.cc (Layout::make_output_section): Call
14634 Target::new_output_section.
14635 (Layout::attach_allocated_section_to_segment): Put large section
14636 sections in a separate load segment with the large segment flag
14637 set.
14638 (Layout::segment_precedes): Sort large data segments after other
14639 load segments.
14640 (align_file_offset): New static function.
14641 (Layout::set_segment_offsets): Use align_file_offset.
14642 * output.h (class Output_section): Add is_small_section_ and
14643 is_large_section_ fields.
14644 (Output_section::is_small_section): New function.
14645 (Output_section::set_is_small_section): New function.
14646 (Output_section::is_large_section): New function.
14647 (Output_section::set_is_large_section): New function.
14648 (Output_section::is_large_data_section): New function.
14649 (class Output_segment): Add is_large_data_segment_ field.
14650 (Output_segment::is_large_data_segment): New function.
14651 (Output_segment::set_is_large_data_segment): New function.
14652 * output.cc (Output_section::Output_section): Initialize new
14653 fields.
14654 (Output_segment::Output_segment): Likewise.
14655 (Output_segment::add_output_section): Add assertion that large
14656 data sections always go in large data segments. Force small data
14657 sections to the end of the list of data sections. Force small BSS
14658 sections to the start of the list of BSS sections. For large BSS
14659 sections to the end of the list of BSS sections.
14660 * symtab.h (class Symbol): Declare is_common_shndx.
14661 (Symbol::is_defined): Check Symbol::is_common_shndx.
14662 (Symbol::is_common): Likewise.
14663 (class Symbol_table): Define enum Commons_section_type. Update
14664 declarations. Add small_commons_ and large_commons_ fields.
14665 * symtab.cc (Symbol::is_common_shndx): New function.
14666 (Symbol_table::Symbol_table): Initialize new fields.
14667 (Symbol_table::add_from_object): Put small and large common
14668 symbols in the right list.
14669 (Symbol_table::sized_finalized_symbol): Check
14670 Symbol::is_common_shndx.
14671 (Symbol_table::sized_write_globals): Likewise.
14672 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14673 common symbol lists. Don't call do_allocate_commons_list if the
14674 list is empty.
14675 (Symbol_table::do_allocate_commons_list): Remove is_tls
14676 parameter. Add comons_section_type parameter. Change all
14677 callers. Handle small and large common symbols.
14678 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14679 Symbol::is_common_shndx.
14680 * resolve.cc (symbol_to_bits): Likewise.
14681 * target.h (Target::small_common_shndx): New function.
14682 (Target::small_common_section_flags): New function.
14683 (Target::large_common_shndx): New function.
14684 (Target::large_common_section_flags): New function.
14685 (Target::new_output_section): New function.
14686 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14687 small_common_section_flags, and large_common_section_flags
14688 fields.
14689 (Target::do_new_output_section): New virtual function.
14690 * arm.cc (Target_arm::arm_info): Initialize new fields.
14691 * i386.cc (Target_i386::i386_info): Likewise.
14692 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14693 Likewise.
14694 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14695 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14696 (Target_x86_64::do_new_output_section): New function.
14697 * configure.ac: Define conditional MCMODEL_MEDIUM.
14698 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14699 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14700 (large_LDFLAGS): Define.
14701 * testsuite/large.c: New file.
14702 * testsuite/testfile.cc (Target_test::test_target_info):
14703 Initialize new fields.
14704 * configure, testsuite/Makefile.in: Rebuild.
14705
14706 2009-06-05 Doug Kwan <dougkwan@google.com>
14707
14708 * Makefile.am (CCFILES): Add target.cc.
14709 * Makefile.in: Regenerate.
14710 * i386.cc (class Target_i386): Define new virtual method to
14711 override do_is_local_label_name in parent.
14712 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14713 local symbols if --discard-locals or -X is given.
14714 * options.h (class General_options): Declare new options
14715 '--discard-locals' and '-X' for discarding locals.
14716 * target.h (class Target): Define new methods is_local_label_name.
14717 Declare new virtual method do_is_local_label_name.
14718 * target.cc: New file.
14719 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14720 (check_SCRIPTS): Add discard_locals_test.sh.
14721 (check_DATA): Add discard_local_tests.syms.
14722 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14723 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14724 * testsuite/Makefile.in: Regenerate.
14725 * testsuite/discard_locals_test.c: New file.
14726 * testsuite/discard_locals_test.sh: Same.
14727
14728 2009-06-05 Doug Kwan <dougkwan@google.com>
14729
14730 * object.cc (Sized_relobj::Sized_relobj): Initialize
14731 discarded_eh_frame_shndx_ to -1U.
14732 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14733 section.
14734 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14735 a discarded .eh_frame section.
14736 (Sized_relobj::do_finalize_local_symbols): Ditto.
14737 * object.h (class Sized_relobj): Declare new member
14738 discarded_eh_frame_shndx_.
14739 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14740 (local_labels_test.o, local_labels_test): New rules.
14741 * testsuite/Makefile.in: Regenerate.
14742
14743 2009-06-04 Doug Kwan <dougkwan@google.com>
14744
14745 * layout.cc (Layout::section_name_mapping): Add mapping for
14746 special ARM sections.
14747
14748 2009-06-03 Doug Kwan <dougkwan@google.com>
14749
14750 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14751 (utils::has_overflow): Same.
14752
14753 2009-06-03 Ian Lance Taylor <iant@google.com>
14754
14755 * layout.cc (Layout::section_name_mapping): New array, replacing
14756 Layout::linkonce_mapping.
14757 (Layout::section_name_mapping_count): New variable, replacing
14758 Layout::linkonce_mapping_count.
14759 (Layout::linkonce_output_name): Remove.
14760 (Layout::output_section_name): Rewrite.
14761 * layout.h (class Layout): Rename Linkonce_mapping to
14762 Section_name_mapping, linkonce_mapping to section_name_mapping,
14763 linkonce_mapping_count to section_name_mapping_count. Don't
14764 declare linkonce_output_name.
14765
14766 2009-06-03 Doug Kwan <dougkwan@google.com>
14767
14768 * gold/arm.cc (namespace utils): New.
14769 (Target_arm::reloc_is_non_pic): Define new method.
14770 (class Arm_relocate_functions): New.
14771 (Target_arm::Relocate::relocate): Handle relocation types used by
14772 Android.
14773
14774 2009-06-03 Ian Lance Taylor <iant@google.com>
14775
14776 * arm.cc (Target_arm::scan::global): Use || instead of |.
14777
14778 2009-06-02 Doug Kwan <dougkwan@google.com>
14779
14780 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14781 issued_non_pic_error_.
14782 (class Target_arm::Scan): Declare new method check_non_pic.
14783 Define new method symbol_needs_plt_entry.
14784 Declare new data member issued_non_pic_error_.
14785 (class Target_arm::Relocate): Declare new method
14786 should_apply_static_reloc.
14787 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14788 (Target_arm::Scan::check_non_pic): Define new method.
14789 (Target_arm::Scan::local): Handle a small subset of reloc types used
14790 by Android.
14791 (Target_arm::Scan::local): Same.
14792 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14793
14794 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14795
14796 * incremental.cc (Incremental_inputs::report_command_line): Filter
14797 out --incremental-* options.
14798
14799 2009-05-29 Doug Kwan <dougkwan@google.com>
14800
14801 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14802 template class.
14803 (class Target_arm): Update comment.
14804 (Target_arm::Target_arm): Initialize new data members GOT_,
14805 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14806 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14807 and Target_arm::rel_dyn_section.
14808 Declare new_enum Target_arm::Got_type.
14809 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14810 and DYNBSS_.
14811 Update commments for member do_dynsym_value.
14812 (Target_arm::got_size, Target_arm::plt_section,
14813 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14814 new methods inside class defintion.
14815 (Target_arm::got_section): Define new method.
14816 (Target_arm::rel_dyn_section): Same.
14817 (Output_data_plt_arm): New template class.
14818 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14819 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14820 (Output_data_plt_arm::add_entry): Same.
14821 (Output_data_plt_arm::first_plt_entry): Define new
14822 static data member for PLT instruction template.
14823 (Output_data_plt_arm::plt_entry): Same.
14824 (Output_data_plt_arm::do_write): Define new method.
14825 (Target_arm::make_plt_entry): Same.
14826 (Target_arm::do_finalize_sections): Same.
14827 (Target_arm::do_dynsym_value): Same.
14828
14829 2009-05-28 Doug Kwan <dougkwan@google.com>
14830
14831 * Makefile.am (TARGETSOURCES): Add arm.cc.
14832 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14833 * Makefile.in: Regenerate.
14834 * arm.cc: New file.
14835 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14836
14837 2009-05-26 Doug Kwan <dougkwan@google.com>
14838
14839 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14840 (General_options::check_excluded_libs): Strip off directories in
14841 archive name before matching like GNU ld does.
14842 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14843 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14844 (exclude_libs_test_LDFLAGS): Add linker option
14845 -Wl,--exclude-libs,libexclude_libs_test_3
14846 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14847 an explicit archive without using -l.
14848 (alt/libexclude_libs_test_3.a): New make rule.
14849 * testsuite/Makefile.in: Regenerate.
14850 * testsuite/exclude_libs_test.c : Declare lib3_default().
14851 (main): Call it.
14852 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14853 * exclude_libs_test_3.c: New file.
14854
14855 2009-05-26 Nick Clifton <nickc@redhat.com>
14856
14857 * po/id.po: New Indonesian translation.
14858 * po/gold.pot: Updated template file.
14859
14860 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14861
14862 * testsuite/Makefile.am: Add -ffunction-sections to compile
14863 gc_comdat_test files. Add -Wl,--gc-sections to build
14864 gc_comdat_test.
14865 * testsuite/Makefile.in: Regenerate.
14866 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14867
14868 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14869
14870 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14871 kept comdat section was garbage collected.
14872 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14873 * testsuite/Makefile.in: Regenerate.
14874 * testsuite/gc_comdat_test.sh: New file.
14875 * testsuite/gc_comdat_test_1.cc: New file.
14876 * testsuite/gc_comdat_test_2.cc: New file.
14877
14878 2009-05-19 Doug Kwan <dougkwan@google.com>
14879
14880 * archive.cc (Archive::Archive): Move constructor from archive.h
14881 to here. Initialize no_export_.
14882 (Archive::get_elf_object_for_member): Set no_export flag of object.
14883 * archive.h (Archive::Archive): Move constructor body to
14884 archive.cc.
14885 (Archive::no_export): New method.
14886 (Archive::no_export_): New field.
14887 * object.h (Object::Object): Initialize no_export_ to false.
14888 (Object::no_export, Object::set_no_export): New methods.
14889 (Object::no_export_): New field.
14890 * options.cc (General_options::parse_exclude_libs): New method.
14891 (General_options::check_excluded_libs) Same.
14892 * options.h (exclude_libs): New option.
14893 (General_options::check_excluded_libs): New method declaration.
14894 (General_options::excluded_libs_): New field.
14895 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14896 default or protected visibility if an object has no-export flag set.
14897 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14898 (check_SCRIPTS): Add exclude_libs_test.sh.
14899 (check_DATA): Add exclude_libs_test.syms.
14900 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14901 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14902 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14903 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14904 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14905 libexclude_libs_test_2.a): New rules.
14906 * testsuite/Makefile.in: Regenerate.
14907 * testsuite/exclude_libs_test.c: New file.
14908 * testsuite/exclude_libs_test.sh: Ditto.
14909 * testsuite/exclude_libs_test_1.c: Ditto.
14910 * testsuite/exclude_libs_test_2.c: Ditto.
14911
14912 2009-05-15 Ian Lance Taylor <iant@google.com>
14913
14914 * configure.ac: Check for declarations for cases where libiberty.h
14915 checks HAVE_DECL_xxx.
14916 * configure, config.in: Rebuild.
14917
14918 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14919
14920 * gold.h (Incremental_argument_list): Remove (invalid) forward
14921 declaration.
14922 * incremental.cc (Incremental_inputs::report_achive): New method.
14923 (Incremental_inputs::report_object): New method.
14924 (Incremental_inputs::report_script): New method.
14925 (Incremental_inputs::finalize_inputs): New method.
14926 (Incremental_inputs::finalize): Call finalize_inputs().
14927 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14928 Create inputs entries.
14929 * incremental.h (Incremental_input_type): New enum.
14930 (Incremental_inputs::Incremental_input): Initialize new fields.
14931 (Incremental_inputs::report_inputs): New method.
14932 (Incremental_inputs::report_achive): New method.
14933 (Incremental_inputs::report_object): New method.
14934 (Incremental_inputs::report_script): New method.
14935 (Incremental_inputs::finalize_inputs): New method.
14936 (Incremental_inputs::Input_info): New struct.
14937 (Incremental_inputs::Input_info_map): New typedef.
14938 (Incremental_inputs::lock_): New field.
14939 (Incremental_inputs::Inputs_): New field.
14940 (Incremental_inputs::Inputs_map): New field.
14941 * main.cc (main): Call Incremental_input::report_inputs.
14942 * options.h (Input_argument_list): Typedef moved from
14943 Input_arguments.
14944 (Input_file_group::Files): Remove, use ::Input_argument_list.
14945 (Input_file_group::Input_argument_list): Remove, use
14946 ::Input_argument_list.
14947 * plugin.cc (Plugin_manager::add_input_file): Add error in
14948 incremental build.
14949 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14950 functions.
14951 * script.cc (read_input_script): Call
14952 Incremental_input::report_script.
14953 * script.h (Script_info): New class.
14954
14955 2009-04-27 Ian Lance Taylor <iant@google.com>
14956
14957 * x86_64.cc (do_adjust_output_section): Set entsize to
14958 plt_entry_size.
14959
14960 2009-04-23 Elliott Hughes <enh@google.com>
14961
14962 * output.cc (Output_file::close): After short writes, continue
14963 writing from the correct offset in the buffer being written.
14964
14965 2009-04-23 Chris Demetriou <cgd@google.com>
14966
14967 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14968 * configure: Regenerate.
14969 * config.in: Regenerate.
14970 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14971 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14972
14973 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14974
14975 * incremental.cc (Incremental_inputs_header_data): Renamed from
14976 Incremental_input_header_data.
14977 (Incremental_inputs_header_data::data_size): New field.
14978 (Incremental_inputs_header_data::put_input_file_count): Renamed
14979 from input_file_count.
14980 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14981 from command_line_offset.
14982 (Incremental_inputs_header_data::put_reserved): Renamed from
14983 put_reserved.
14984 (Incremental_inputs_entry_data): Renamed from
14985 Incremental_input_entry_data.
14986 (Incremental_inputs_entry_data::data_size): New field.
14987 (Incremental_inputs::report_command_line): New method.
14988 (Incremental_inputs::finalize): New method.
14989 (Incremental_inputs::create_incremental_inputs_data): New method.
14990 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14991 * incremental.h: New file.
14992 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14993 (Layout::finalize): Create incremental inputs section in
14994 incremental builds.
14995 (Layout::create_incremental_info_sections): New method.
14996 * layout.h (Layout::incremental_inputs): New method.
14997 (Layout::create_incremental_info_sections): New method.
14998 (Layout::incremental_inputs_): New field.
14999 * main.cc (main): Notify Incremental_input of the command line.
15000
15001 2009-04-01 Ian Lance Taylor <iant@google.com>
15002 Mikolaj Zalewski <mikolajz@google.com>
15003
15004 * gold.h (reserve_unordered_map): Define, three versions, one for
15005 each version of Unordered_map.
15006 * layout.cc (Layout::Layout): Remove options parameter. Add
15007 number_of_input_files parameter. Don't initialize options_.
15008 Initialize number_of_input_files_ and resized_signatures_. Move
15009 sections_are_attached_.
15010 (Layout::layout_group): Reserve space for group_signatures_.
15011 (Layout::find_or_add_kept_section): Change name parameter to be a
15012 reference. Resize signatures_ map when it gets large enough.
15013 (Layout::layout_eh_frame): Use parameters->options() instead of
15014 this->options_.
15015 (Layout::make_output_section): Likewise.
15016 (Layout::attach_allocated_section_to_segment): Likewise.
15017 (Layout::finalize, Layout::create_executable_stack): Likewise.
15018 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
15019 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
15020 * layout.h (class Layout): Update declarations. Remove options_
15021 field. Add number_of_input_files_ and resized_signatures_
15022 fields. Move sections_are_attached_ field.
15023 * main.cc (main): Pass number of input files to Layout
15024 constructor. Don't pass options.
15025
15026 2009-03-30 Ian Lance Taylor <iant@google.com>
15027
15028 * ffsll.c (ffsll): Correct implementation.
15029
15030 2009-03-27 Ian Lance Taylor <iant@google.com>
15031
15032 * ffsll.c: New file.
15033 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
15034 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
15035 * ftruncate.c (ftruncate): Declare before definition.
15036 * mremap.c (mremap): Likewise.
15037 * pread.c (pread): Likewise.
15038 * configure, Makefile.in, config.in: Rebuild.
15039
15040 * mremap.c: New file.
15041 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
15042 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
15043 (mremap): Declare if HAVE_MREMAP is not defined.
15044 * configure, Makefile.in, config.in: Rebuild.
15045
15046 2009-03-27 Cary Coutant <ccoutant@google.com>
15047
15048 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
15049 position independent.
15050 * sparc.cc (Target_sparc::check_non_pic): Likewise.
15051 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
15052
15053 2009-03-24 Cary Coutant <ccoutant@google.com>
15054
15055 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
15056 an executable.
15057 (needs_dynamic_reloc): Likewise.
15058
15059 2009-03-24 Ian Lance Taylor <iant@google.com>
15060
15061 * yyscript.y (file_cmd): Recognize EXTERN.
15062 (extern_name_list, extern_name_list_body): New nonterminals.
15063 * script.cc (script_add_extern): Define.
15064 * script-c.h (script_add_extern): Declare.
15065
15066 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
15067
15068 * object.cc (is_elf_object): Define.
15069 * object.h (is_elf_object): Declare.
15070 * archive.cc (Archive::get_elf_object_for_member): Call
15071 is_elf_object.
15072 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
15073
15074 2009-03-24 Elliott Hughes <enh@google.com>
15075
15076 * output.cc (Output_file::map_anonymous): Define.
15077 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15078 try an anonymous one. Report the size if the mmap fails.
15079 * output.h (class Output_file): Declare map_anonymous.
15080
15081 2009-03-24 Ian Lance Taylor <iant@google.com>
15082
15083 * target-select.cc (instantiate_target): Don't acquire the lock if
15084 the instantiated_target_ field has already been set.
15085
15086 2009-03-23 Ian Lance Taylor <iant@google.com>
15087
15088 * gold-threads.h (class Initialize_lock): Define.
15089 * gold-threads.cc (class Initialize_lock_once): Define.
15090 (initialize_lock_control): New static variable.
15091 (initialize_lock_pointer): New static variable.
15092 (initialize_lock_once): New static function.
15093 (Initialize_lock::Initialize_lock): Define.
15094 (Initialize_lock::initialize): Define.
15095 * target-select.h: Include "gold-threads.h".
15096 (class Target_selector): Add lock_ and initialize_lock_ fields.
15097 Don't define instantiate_target, just declare it.
15098 * target-select.cc (Target_selector::Target_selector): Initialize
15099 new fields.
15100 (Target_selector::instantiate_target): Define.
15101 * descriptors.h: Include "gold-threads.h".
15102 (class Descriptors): Add initialize_lock_ field.
15103 * descriptors.cc (Descriptors::Descriptors): Initialize new
15104 field.
15105 (Descriptors::open): Use initialize_lock_ field
15106 * errors.h (class Errors): Add initialize_lock_ field.
15107 * errors.cc (Errors::Errors): Initialize new field.
15108 (Errors::initialize_lock): Use initialize_lock_ field.
15109 * powerpc.cc (class Target_selector_powerpc): Remove
15110 instantiated_target_ field. In do_recognize call
15111 instantiate_target rather than do_instantiate_target. In
15112 do_instantiate_target just allocate a new target.
15113 * sparc.cc (class Target_selector_sparc): Likewise.
15114
15115 * freebsd.h: New file.
15116 * i386.cc: Include "freebsd.h".
15117 (Target_i386): Derive from Target_freebsd rather than
15118 Sized_target.
15119 (Target_selector_i386): Derive from Target_selector_freebsd rather
15120 than Target_selector.
15121 * x86_64.cc: Include "freebsd.h".
15122 (Target_x86_64): Derive from Target_freebsd rather than
15123 Sized_target.
15124 (Target_selector_x86_64): Derive from Target_selector_freebsd
15125 rather than Target_selector.
15126 * target.h (class Target): Add adjust_elf_header and
15127 do_adjust_elf_header.
15128 * output.cc (Output_file_header:: do_sized_write): Call target
15129 adjust_elf_header routine.
15130 * configure.tgt: Set targ_osabi.
15131 * configure.ac: Define GOLD_DEFAULT_OSABI.
15132 * parameters.cc (Parameters::default_target): Pass
15133 GOLD_DEFAULT_OSABI to select_target.
15134 * target-select.h (class Target_selector): Make instantiate_target
15135 protected rather than private.
15136 * Makefile.am (HFILES): Add freebsd.h.
15137 * configure, Makefile.in, config.in: Rebuild.
15138
15139 * merge.cc (do_add_input_section): Correct pend value. Change
15140 message about last entry not being null terminated from error to
15141 warning.
15142
15143 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15144
15145 * incremental.cc: New file.
15146 * Makefile.am (CCFILES): Add incremental.cc.
15147 * Makefile.in: Rebuild.
15148
15149 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15150
15151 * layout.cc (Layout::output_section_name): Preserve names
15152 of '.note.' sections.
15153
15154 2009-03-19 Ian Lance Taylor <iant@google.com>
15155
15156 * descriptors.cc (Descriptors::open): Check that the options are
15157 valid before using them.
15158
15159 2009-03-18 Ian Lance Taylor <iant@google.com>
15160
15161 * script-sections.h: Include <list>.
15162 (class Script_sections): Change Sections_elements from std::vector
15163 to std::list. Typedef public Elements_iterator. Add
15164 orphan_section_placement_, data_segment_align_start_, and
15165 saw_data_segment_align_ fields. Remove data_segment_align_index_
15166 field.
15167 * script-sections.cc (class Orphan_section_placement): New class.
15168 (class Sections_element): Add virtual functions is_relro and
15169 orphan_section_init. Remove virtual function place_orphan_here.
15170 (class Output_section_definition): Add is_relro and
15171 orphan_section_init. Remove place_orphan_here.
15172 (class Orphan_output_section): Likewise.
15173 (Script_sections::Script_sections): Update for field changes.
15174 (Script_sections::data_segment_align): Set saw_data_segment_align_
15175 and data_segment_align_start_, not data_segment_align_index.
15176 (Script_sections::data_segment_relro_end): Check
15177 saw_data_segment_align_. Use data_segment_align_start_ rather
15178 than data_segment_align_index_.
15179 (Script_sections::place_orphan): Rewrite to use
15180 Orphan_section_placement.
15181
15182 2009-03-17 Ian Lance Taylor <iant@google.com>
15183
15184 * archive.cc (Archive::add_symbols): Check for a version attached
15185 to the symbol name in the archive map.
15186 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15187 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15188 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15189 (ver_test_11.a): New target.
15190 * testsuite/Makefile.in: Rebuild.
15191
15192 * configure.ac: Check for chsize and posix_fallocate. Replace
15193 ftruncate.
15194 * ftruncate.c: New file, from gnulib.
15195 * output.cc (posix_fallocate): Define dummy version if not
15196 HAVE_POSIX_FALLOCATE.
15197 (Output_file::map): Call posix_fallocate rather than lseek and
15198 write.
15199 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15200 * configure, Makefile.in, config.in: Rebuild.
15201
15202 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
15203
15204 * layout.h (Layout::create_note): Add section_name parameter.
15205 * layout.cc (Layout::create_note): Likewise.
15206 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
15207
15208 2009-03-17 Ian Lance Taylor <iant@google.com>
15209
15210 * descriptors.cc: Include "options.h".
15211 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15212 (Descriptors::open): Always use O_CLOEXEC when opening a new
15213 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15214 then set FD_CLOEXEC.
15215
15216 * sparc.cc (class Target_sparc): Add has_got_section.
15217 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15218 make sure we have a GOT section.
15219
15220 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15221 (Target_sparc::Scan::local): Likewise.
15222 (Target_sparc::Scan::global): Likewise.
15223 (Target_sparc::Relocate::relocate): Likewise.
15224 (Target_sparc::Relocate::relocate_tls): Likewise.
15225
15226 * symtab.cc (Symbol_table::define_default_version): New function,
15227 broken out of add_from_object.
15228 (Symbol_table::add_from_object): Call define_default_version.
15229 (Symbol_table::define_special_symbol): Add resolve_oldsym
15230 parameter. Change all callers. If the version for a symbol comes
15231 from a version script, resolve it with the symbol with the same
15232 name with no version. Also add the symbol without a version if
15233 appropriate.
15234 (do_define_in_output_data): If resolving with oldsym, don't delete
15235 sym.
15236 (do_define_in_output_segment): Likewise.
15237 (do_define_as_constant): Likewise.
15238 * symtab.h (class Symbol_table): Update declarations.
15239
15240 2009-03-13 Ian Lance Taylor <iant@google.com>
15241
15242 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15243 (Read_symbols::requeue): New function.
15244 (Read_symbols::do_read_symbols): If make_elf_object fails because
15245 the target type is not configured, and the file was searched for,
15246 issue a warning and retry with the next directory.
15247 (Add_symbols::run): If the file has an incompatible format, and
15248 it was searched for, requeue the Read_symbols task. On error,
15249 release the object.
15250 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15251 dirindex parameter to constructor. Change all callers. Declare
15252 incompatible_warning and requeue.
15253 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15254 input_argument_ and input_group_ fields. Add them to
15255 constructor. Change all callers.
15256 (class Read_script): Add dirindex_ field. Add it to constructor.
15257 Change all callers.
15258 * archive.cc (Archive::setup): Remove input_objects parameter.
15259 Change all callers.
15260 (Archive::get_file_and_offset): Likewise.
15261 (Archive::read_all_symbols): Likewise.
15262 (Archive::read_symbols): Likewise.
15263 (Archive::get_elf_object_for_member): Remove input_objects
15264 parameter. Add punconfigured parameter. Change all callers.
15265 (Archive::add_symbols): Change return type to bool. Check return
15266 value of include_member.
15267 (Archive::include_all_members): Likewise.
15268 (Archive::include_member): Change return type to bool. Return
15269 false if first included object has incompatible target. Set
15270 included_member_ field.
15271 (Add_archive_symbols::run): If add_symbols returns false, requeue
15272 Read_symbols task.
15273 * archive.h (class Archive): Add included_member_ field.
15274 Initialize it in constructor. Add input_file and searched_for
15275 methods. Update declarations.
15276 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15277 input_argument_ fields. Add them to constructor. Change all
15278 callers.
15279 * script.cc: Include "target-select.h".
15280 (class Parser_closure): Add skip_on_incompatible_target_ and
15281 found_incompatible_target_ fields. Add
15282 skip_on_incompatible_target parameter to constructor. Change all
15283 callers. Add methods skip_on_incompatible_target,
15284 clear_skip_on_incompatible_target, found_incompatible_target, and
15285 set_found_incompatible_target.
15286 (read_input_script): Add dirindex parameter. Change all callers.
15287 If parser finds an incompatible target, requeue Read_symbols
15288 task.
15289 (script_set_symbol): Clear skip_on_incompatible_target in
15290 closure.
15291 (script_add_assertion, script_parse_option): Likewise.
15292 (script_start_sections, script_add_phdr): Likewise.
15293 (script_check_output_format): New function.
15294 * script.h (read_input_script): Update declaration.
15295 * script-c.h (script_check_output_format): Declare.
15296 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15297 (ignore_cmd): Remove OUTPUT_FORMAT.
15298 * fileread.cc (Input_file::Input_file): Add explicit this.
15299 (Input_file::will_search_for): New function.
15300 (Input_file::open): Add pindex parameter. Change all callers.
15301 * fileread.h (class Input_file): Add input_file_argument method.
15302 Declare will_search_for. Update declarations.
15303 * object.cc (make_elf_object): Add punconfigured parameter.
15304 Change all callers.
15305 * object.h (class Object): Make input_file public. Add
15306 searched_for method.
15307 (make_elf_object): Update declaration.
15308 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15309 restart search.
15310 * dirsearch.h (class Dirsearch): Update declaration.
15311 * options.h (class General_options): Add --warn-search-mismatch.
15312 * parameters.cc (Parameters::is_compatible_target): New function.
15313 * parameters.h (class Parameters): Declare is_compatible_target.
15314 * workqueue.cc (Workqueue::add_blocker): New function.
15315 * workqueue.h (class Workqueue): Declare add_blocker.
15316
15317 * fileread.cc (Input_file::open): Remove options parameter.
15318 Change all callers.
15319 (Input_file::open_binary): Likewise.
15320 * script.cc (read_input_script): Likewise.
15321 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15322 options parameter from constructor. Change all callers.
15323 (class Read_script): Likewise.
15324 * fileread.h (class Input_file): Update declarations.
15325 * script.h (read_input_script): Update declaration.
15326
15327 2009-03-10 Nick Clifton <nickc@redhat.com>
15328
15329 * po/es.po: New Spanish translation.
15330
15331 2009-03-06 Cary Coutant <ccoutant@google.com>
15332
15333 * options.cc (parse_short_option): Keep dash_z from registering itself.
15334
15335 2009-03-03 Ian Lance Taylor <iant@google.com>
15336
15337 PR 9918
15338 * target-reloc.h (relocate_section): Pass output_section to
15339 relocate.
15340 * i386.cc (Target_i386::should_apply_static_reloc): Add
15341 output_section parameter. Change all callers.
15342 (Target_i386::Relocate::relocate): Add output_section parameter.
15343 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15344 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15345 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15346 * testsuite/two_file_shared.sh: New script.
15347 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15348 (check_DATA): Add two_file_shared.dbg.
15349 (two_file_shared.dbg): New target.
15350 * testsuite/Makefile.in: Rebuild.
15351
15352 2009-03-01 Ian Lance Taylor <iant@google.com>
15353
15354 * configure.ac: Check for byteswap.h.
15355 * configure: Rebuild.
15356 * config.in: Rebuild.
15357
15358 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15359
15360 * layout.cc (Layout::find_or_add_kept_section): New function.
15361 (Layout::add_comdat): Removed.
15362 * layout.h (struct Kept_section): Move out of class Layout.
15363 Remove trailing underscores from field names. Add group_sections
15364 field. Rename group_ field to is_group. Change all uses.
15365 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15366 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15367 comdat_groups_ field.
15368 (Sized_relobj::include_section_group): Use
15369 find_or_add_kept_section and Kept_section::group_sections.
15370 (Sized_relobj::include_linkonce_section): Likewise.
15371 * object.cc (class Sized_relobj): Don't define Comdat_group or
15372 Comdat_group_table. Remove find_comdat_group and
15373 add_comdat_group. Remove comdat_groups_ field.
15374 * plugin.cc (include_comdat_group): Use
15375 Layout::find_or_add_kept_section.
15376
15377 2009-02-28 Ian Lance Taylor <iant@google.com>
15378
15379 * README: --gc-sections and map files are now supported. Document
15380 some build requirements.
15381
15382 PR 6992
15383 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15384 relocatable link set the value of the section symbol to zero.
15385 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15386 relocatable link don't include the section address in the local
15387 symbol value.
15388
15389 2009-02-27 Ian Lance Taylor <iant@google.com>
15390
15391 PR 6811
15392 * options.h (class Search_directory): Add is_system_directory.
15393 (class General_options): Declare is_in_system_directory.
15394 * options.cc (get_relative_sysroot): Make static.
15395 (get_default_sysroot): Make static.
15396 (General_optoins::is_in_system_directory): New function.
15397 * fileread.cc (Input_file::is_in_system_directory): New function.
15398 * fileread.h (class Input_file): Declare is_in_system_directory.
15399 * object.h (class Object): Add is_in_system_directory.
15400 (class Input_objects): Remove system_library_directory_ field.
15401 * object.cc (Input_objects::add_object): Don't set
15402 system_library_directory_.
15403 (input_objects::found_in_system_library_directory): Remove.
15404 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15405 parameter. Change all callers.
15406 (Symbol_table::sized_write_globals): Likewise.
15407 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15408 Call Object::is_in_system_directory.
15409 * symtab.h (class Symbol_table): Update declarations.
15410
15411 PR 5990
15412 * descriptors.h (Open_descriptor): Add is_on_stack field.
15413 * descriptors.cc (Descriptors::open): If the descriptor is on the
15414 top of the stack, remove it. Initialize is_on_stack field.
15415 (Descriptors::release): Only add pod to stack if it is not on the
15416 stack already.
15417 (Descriptors::close_some_descriptor): Clear stack_next and
15418 is_on_stack fields.
15419
15420 PR 7091
15421 * output.cc (Output_section::find_starting_output_address): Rename
15422 from starting_output_address; add PADDR parameter; change return
15423 type.
15424 * output.h (class Output_section): Declare
15425 find_starting_output_address instead of starting_output_address.
15426 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15427 section symbol for which we can't find a merge section.
15428
15429 PR 9836
15430 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15431 hidden or internal, force the symbol to be local.
15432 * resolve.cc (Symbol::override_visibility): Define.
15433 (Symbol::override_base): Use override_visibility.
15434 (Symbol_table::resolve): Likewise.
15435 (Symbol::override_base_with_special): Likewise.
15436 (Symbol_table::override_with_special): If the visibility is hidden
15437 or internal, force the symbol to be local.
15438 * symtab.h (class Symbol): Add set_visibility and
15439 override_visibility.
15440 * testsuite/ver_test_1.sh: New file.
15441 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15442 (check_DATA): Add ver_test_1.syms.
15443 (ver_test_1.syms): New target.
15444 * testsuite/Makefile.in: Rebuild.
15445
15446 2009-02-25 Cary Coutant <ccoutant@google.com>
15447
15448 * layout.cc (Layout::choose_output_section): Don't rename sections
15449 when using a linker script that has a SECTIONS clause.
15450 * Makefile.in: Regenerate.
15451
15452 * testsuite/Makefile.am (script_test_5.sh): New test case.
15453 * testsuite/Makefile.in: Regenerate.
15454 * testsuite/script_test_5.cc: New file.
15455 * testsuite/script_test_5.sh: New file.
15456 * testsuite/script_test_5.t: New file.
15457
15458 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15459
15460 * archive.cc (Archive::include_member): Update calls to add_symbols.
15461 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15462 the Layout argument.
15463 * dynobj.h (do_add_symbols): Add the Layout argument.
15464 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15465 Layout argument.
15466 * object.h (Object::add_symbols): Add the Layout argument.
15467 (Object::do_add_symbols): Add the Layout argument.
15468 (Sized_relobj::do_add_symbols): Add the Layout argument.
15469 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15470 Unify the two versions.
15471 (Add_plugin_symbols): Remove.
15472 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15473 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15474 (Add_plugin_symbols): Remove.
15475 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15476 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15477 (Add_symbols::run): Make it work with Pulginobj.
15478
15479 2009-02-06 Ian Lance Taylor <iant@google.com>
15480
15481 * object.cc (Sized_relobj::do_layout): Make info message start
15482 with lower case letter.
15483
15484 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15485
15486 * binary.cc: Fix file comment.
15487
15488 * options.h (enum Incremental_disposition): Define.
15489 (class General_options): Add new options: --incremental,
15490 --incremental_changed, --incremental_unchanged,
15491 --incremental_unknown. Add incremental_disposition_ and
15492 implicit_incremental_ fields.
15493 (General_options::incremental_disposition): New function.
15494 (class Position_dependent_options): Add incremental_disposition
15495 option.
15496 (Position_dependent_options::copy_from_options): Set incremental
15497 dispositions.
15498 * options.cc (General_options::parse_incremental_changed): New
15499 function.
15500 (General_options::parse_incremental_unchanged): New function.
15501 (General_options::parse_incremental_unknown): New function.
15502 (General_options::General_options): Initialize new fields
15503 incremental_disposition_ and implicit_incremental_.
15504 (General_options::finalize): Check for uasge of --incremental-*
15505 without --incremental.
15506
15507 2009-02-06 Chris Demetriou <cgd@google.com>
15508
15509 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15510 pointer and to report location as the file name associated with
15511 the symbol.
15512 (gold_undefined_symbol_at_location): New function to replace the
15513 old gold_undefined_symbol functionality.
15514 * target-reloc.h (relocate_section): Update to use
15515 gold_undefined_symbol_at_location.
15516 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15517 Call gold_undefined_symbol function rather than gold_error.
15518 * errors.h (Errors::undefined_symbol): Take location as a
15519 string, rather than calculating it from a relocation.
15520 * errors.cc (Errors::fatal): Print "fatal error:" before the
15521 formatted message.
15522 (Errors::error, Errors::error_at_location): Print "error: "
15523 before the formatted message.
15524 (Errors::undefined_symbol): Take location as a string, rather
15525 than calculating it from a relocation.
15526 (gold_undefined_symbol_at_location): New function akin to
15527 old gold_undefined_symbol, calculates location from relocation.
15528 (gold_undefined_symbol): Change to take only a Symbol pointer
15529 and to report location as the file name associated with the symbol.
15530 * testsuite/debug_msg.sh: Update for changed error messages.
15531 * testsuite/undef_symbol.sh: Likewise.
15532
15533 2009-02-04 Duncan Sands <baldrick@free.fr>
15534
15535 PR 9812
15536 * reduced_debug_output.h
15537 (Output_reduced_debug_abbrev_section::failed): Use format for
15538 gold_warning.
15539 (Output_reduced_debug_info_section::faild): Likewise.
15540
15541 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15542
15543 * script.cc (Lazy_demangler): New class.
15544 (Version_script_info::get_symbol_version_helper): Demangle a
15545 symbol only once.
15546
15547 2009-01-29 Cary Coutant <ccoutant@google.com>
15548
15549 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15550 to __tls_get_addr.
15551 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15552
15553 2009-01-28 Ian Lance Taylor <iant@google.com>
15554
15555 * version.cc (version_string): Bump to 1.9.
15556
15557 * gold.h: Include <cstring> and <stdint.h>.
15558 * version.cc: Include <cstdio>.
15559 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15560 warning.
15561 * reduced_debug_output.cc (insert_into_vector): Rename from
15562 Insert_into_vector; change all callers. Use Swap_unaligned to
15563 avoid aliasing issue; remove union since it is unnecessary.
15564
15565 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15566
15567 * Makefile.am (CCFILES): Add gc.cc.
15568 (HFILES): Add gc.h.
15569 * Makefile.in: Regenerate.
15570 * gold.cc (Gc_runner): New class.
15571 (queue_initial_tasks): Call garbage collection related tasks
15572 when corresponding options are invoked.
15573 (queue_middle_gc_tasks): New function.
15574 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15575 processed early before laying out sections during garbage collection.
15576 * gold.h (queue_middle_gc_tasks): New function.
15577 (is_prefix_of): Move from "layout.cc".
15578 * i386.cc (Target_i386::gc_process_relocs): New function.
15579 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15580 * main.cc (main): Create object of class "Garbage_collection".
15581 * object.cc (Relobj::copy_symbols_data): New function.
15582 (Relobj::is_section_name_included): New function.
15583 (Sized_relobj::do_layout): Allow this function to be called twice
15584 during garbage collection and defer layout of section during the
15585 first call.
15586 * object.h (Relobj::get_symbols_data): New function.
15587 (Relobj::is_section_name_included): New function.
15588 (Relobj::copy_symbols_data): New function.
15589 (Relobj::set_symbols_data): New function.
15590 (Relobj::get_relocs_data): New function.
15591 (Relobj::set_relocs_data): New function.
15592 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15593 (Relobj::gc_process_relocs): New function.
15594 (Relobj::do_gc_process_relocs): New pure virtual function.
15595 (Relobj::sd_): New data member.
15596 (Sized_relobj::is_output_section_offset_invalid): New function.
15597 (Sized_relobj::do_gc_process_relocs): New function.
15598 * options.h (General_options::gc_sections): Modify to not be a no-op.
15599 (General_options::print_gc_sections): New option.
15600 * plugin.cc (Plugin_finish::run): Remove function call to
15601 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15602 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15603 * reloc.cc (Read_relocs::run): Add task to process relocs and
15604 determine unreferenced sections when doing garbage collection.
15605 (Gc_process_relocs): New class.
15606 (Sized_relobj::do_gc_process_relocs): New function.
15607 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15608 sections that are garbage collected.
15609 * reloc.h (Gc_process_relocs): New class.
15610 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15611 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15612 symbols whose corresponding sections are garbage collected.
15613 (Symbol_table::Symbol_table): Add new parameter for the garbage
15614 collection object.
15615 (Symbol_table::gc_mark_undef_symbols): New function.
15616 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15617 (Symbol_table::gc_mark_dyn_syms): New function.
15618 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15619 as garbage.
15620 (Symbol_table::add_from_object): Likewise.
15621 (Symbol_table::add_from_relobj): When building shared objects, do not
15622 treat externally visible symbols as garbage.
15623 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15624 table information for static and relocatable links.
15625 * symtab.h (Symbol_table::set_gc): New function.
15626 (Symbol_table::gc): New function.
15627 (Symbol_table::gc_mark_undef_symbols): New function.
15628 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15629 (Symbol_table::gc_mark_dyn_syms): New function.
15630 (Symbol_table::gc_): New data member.
15631 * target.h (Sized_target::gc_process_relocs): New pure virtual
15632 function.
15633 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15634 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15635
15636 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15637
15638 * options.h (General_options::gc_sections): Define as a no-op for now.
15639 (General_options::no_keep_memory): Ditto.
15640 (General_options::Bshareable): Define.
15641 * options.cc (General_options::finalize): Honor -Bshareable.
15642
15643 2009-01-20 Andreas Schwab <schwab@suse.de>
15644
15645 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15646 read the value in the contents, since we don't use it. Use the
15647 template endianness when writing.
15648 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15649
15650 2009-01-19 Andreas Schwab <schwab@suse.de>
15651
15652 * configure.tgt (powerpc64-*): Fix targ_obj.
15653
15654 2009-01-15 Ian Lance Taylor <iant@google.com>
15655
15656 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15657 local symbols when stripping all symbols.
15658
15659 2009-01-14 Cary Coutant <ccoutant@google.com>
15660
15661 * output.cc (Output_reloc): Add explicit instantiations.
15662
15663 2009-01-14 Cary Coutant <ccoutant@google.com>
15664
15665 * archive.cc (Archive::get_elf_object_for_member): Remove call
15666 to File_read::claim_for_plugin.
15667 * descriptors.cc (Descriptors::open): Remove reference to
15668 is_claimed.
15669 (Descriptors::claim_for_plugin): Remove.
15670 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15671 (Descriptors::is_claimed): Remove.
15672 (claim_descriptor_for_plugin): Remove.
15673 * fileread.cc (File_read::claim_for_plugin): Remove.
15674 * fileread.h (File_read::claim_for_plugin): Remove.
15675 (File_read::descriptor): Reopen descriptor if necessary.
15676 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15677 (Plugin_manager::all_symbols_read): Add task parameter. Change
15678 all callers.
15679 (Plugin_manager::get_input_file): New function.
15680 (Plugin_manager::release_input_file): New function.
15681 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15682 corresponding data member.
15683 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15684 and pass to base constructor. Change all callers.
15685 (get_input_file, release_input_file): New functions.
15686 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15687 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15688 (Plugin_manager::all_symbols_read): Add task parameter.
15689 (Plugin_manager::get_input_file): New function.
15690 (Plugin_manager::release_input_file): New function.
15691 (Plugin_manager::task_): New data member.
15692 (Pluginobj::Pluginobj): Add filesize parameter.
15693 (Pluginobj::filename): New function.
15694 (Pluginobj::descriptor): New function.
15695 (Pluginobj::filesize): New function.
15696 (Pluginobj::filesize_): New data member.
15697 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15698 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15699 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15700
15701 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15702 with archive libraries.
15703 * testsuite/Makefile.in: Regenerate.
15704 * testsuite/plugin_test.c (struct sym_info): New type.
15705 (get_input_file, release_input_file): New static variables.
15706 (onload): Capture new transfer vector entries.
15707 (claim_file_hook): Stop reading at end of file according to filesize.
15708 Factor out parsing of readelf output into separate function.
15709 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15710 APIs and get the source file name from the symbol table. Convert
15711 source file name to corresponding object file name. Print info
15712 message when adding new input files.
15713 (parse_readelf_line): New function.
15714 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15715 * testsuite/plugin_test_2.sh: Likewise.
15716 * testsuite/plugin_test_3.sh: Likewise.
15717 * testsuite/plugin_test_4.sh: New test case.
15718
15719 2009-01-07 Ian Lance Taylor <iant@google.com>
15720
15721 * version.cc (version_string): Bump to 1.8.
15722
15723 2008-12-23 Cary Coutant <ccoutant@google.com>
15724
15725 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15726 * plugin.cc (Plugin_manager::finish): Rename as
15727 layout_deferred_objects. Move cleanup to separate function.
15728 (Plugin_manager::cleanup): New function.
15729 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15730 separately.
15731 * plugin.h (Plugin_manager::finish): Rename as
15732 layout_deferred_objects.
15733 (Plugin_manager::cleanup): New function.
15734 (Plugin_manager::cleanup_done): New field.
15735
15736 2008-12-23 Cary Coutant <ccoutant@google.com>
15737
15738 * plugin.cc (is_visible_from_outside): New function.
15739 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15740 so we don't return "IR only" status for exported symbols or -r links.
15741
15742 * testsuite/Makefile.am (plugin_test_3): New test case.
15743 * testsuite/Makefile.in: Regenerate.
15744 * testsuite/plugin_test_3.sh: New file.
15745
15746 2008-12-22 Cary Coutant <ccoutant@google.com>
15747
15748 * object.cc (Sized_relobj::layout_section): New function.
15749 (Sized_relobj::do_layout): Defer layout of input sections until after
15750 plugin has provided replacement files.
15751 (Sized_relobj::do_layout_deferred_sections): New function.
15752 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15753 (Relobj::layout_deferred_sections): New function.
15754 (Relobj::do_layout_deferred_sections): New function.
15755 (Sized_relobj::do_layout_deferred_sections): New function.
15756 (Sized_relobj::layout_section): New function.
15757 (Sized_relobj::Deferred_layout): New structure.
15758 (Sized_relobj::deferred_layout_): New field.
15759 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15760 Change all callers. Layout deferred sections.
15761 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15762 references.
15763 (Plugin_hook::run): Move code from do_plugin_hook inline.
15764 (Plugin_hook::do_plugin_hook): Remove.
15765 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15766 (Plugin_manager::finish): Renamed, was cleanup.
15767 (Plugin_manager::should_defer_layout): New function.
15768 (Plugin_manager::add_deferred_layout_object): New function.
15769 (Plugin_manager::Deferred_layout_list): New type.
15770 (Plugin_manager::deferred_layout_objects_): New field.
15771 (Plugin_hook::do_plugin_hook): Remove.
15772
15773 2008-12-17 Ian Lance Taylor <iant@google.com>
15774
15775 * options.h (class General_options): Add --no case for
15776 --export-dynamic.
15777
15778 2008-12-16 Cary Coutant <ccoutant@google.com>
15779
15780 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15781 vector.
15782 (Plugin_manager::claim_file): Create plugin object even if
15783 plugin did not call the add_symbols callback.
15784 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15785 asking for more symbols than were added.
15786 * testsuite/Makefile.am (plugin_test_1): Add test case with
15787 no global symbols.
15788 (empty.syms): New target.
15789 * testsuite/Makefile.in: Regenerate.
15790 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15791 message. Don't call add_symbols if no globals.
15792 (all_symbols_read_hook): Don't provide replacement for empty
15793 claimed file.
15794
15795 2008-12-12 Ian Lance Taylor <iant@google.com>
15796
15797 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15798 r_type == 0 for a local symbol with r_sym == 0.
15799 (scan_relocatable_relocs): Pass r_sym to
15800 local_non_section_strategy.
15801 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15802 r_sym parameter.
15803
15804 * configure.ac: Update test for TLS descriptors: they are
15805 supported as of glibc 2.9.
15806 * configure: Rebuild.
15807
15808 2008-12-11 Ian Lance Taylor <iant@google.com>
15809
15810 PR 7091
15811 * target-reloc.h (Default_scan_relocatable_relocs): For each
15812 function, map r_type == 0 to RELOC_DISCARD.
15813
15814 2008-12-10 Cary Coutant <ccoutant@google.com>
15815
15816 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15817 object to override a kept COMDAT group from a plugin object.
15818
15819 2008-12-09 Ian Lance Taylor <iant@google.com>
15820
15821 PR 7088
15822 * yyscript.y (file_cmd): Handle INPUT.
15823
15824 * testsuite/initpri1.c: Change all declarations to be full
15825 prototypes by adding void, to avoid compiler warnings.
15826
15827 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15828
15829 * options.cc (General_options::parse_plugin_opt): New.
15830 (General_options::add_plugin): The argument now is just the filename.
15831 (General_options::add_plugin_option): New.
15832 * options.h (plugin_opt): New.
15833 (add_plugin): Change argument name.
15834 (add_plugin_option): New.
15835 * plugin.cc (Plugin::load): Don't parse the plugin option.
15836 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15837 (Plugin::add_option): New.
15838 (Plugin::args_): Change type.
15839 (Plugin::filename_): New.
15840 (Plugin_manager::add_plugin_option): New.
15841 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15842 * testsuite/Makefile.in: Regenerate.
15843
15844 2008-12-05 Cary Coutant <ccoutant@google.com>
15845
15846 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15847 Handle --strip-lto-sections option.
15848 * options.h (strip_lto_sections): New option.
15849
15850 2008-12-01 Cary Coutant <ccoutant@google.com>
15851
15852 * plugin.cc (ld_plugin_message): Change format parameter to const.
15853 Fix mismatch between new[] and delete.
15854
15855 2008-11-14 Cary Coutant <ccoutant@google.com>
15856
15857 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15858 instead of -1U.
15859
15860 2008-11-05 Craig Silverstein <csilvers@google.com>
15861
15862 * options.cc (General_options::parse_dynamic_list): New function.
15863 * options.h (General_options): New flags dynamic_list,
15864 dynamic_list_data, dynamic_list_cpp_new, and
15865 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15866 (General_options::in_dynamic_list): New function.
15867 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15868 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15869 (Lex::can_continue_name): Likewise.
15870 (yylex): Likewise.
15871 (read_script_file): New parameter script_options.
15872 (read_dynamic_list): New function.
15873 (Script_options::define_dynamic_list): New function.
15874 (dynamic_list_keyword_parsecodes): New variable.
15875 (dynamic_list_keywords): New variable.
15876 * script.h (Script_options::define_dynamic_list): New function
15877 prototype.
15878 (read_dynamic_list): New function prototype.
15879 * symtab.cc (strprefix): New macro.
15880 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15881 dynamic_list_data, dynamic_list_cpp_new, and
15882 dynamic_list_cpp_typeinfo.
15883 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15884 (dynamic_list_expr): New rule.
15885 (dynamic_list_nodes): Likewise.
15886 (dynamic_list_node): Likewise.
15887 * testsuite/Makefile.am (dynamic_list): New test.
15888 * testsuite/Makefile.in: Regenerated.
15889 * testsuite/dynamic_list.t: New file.
15890 * testsuite/dynamic_list.sh: New file.
15891
15892 2008-11-05 Craig Silverstein <csilvers@google.com>
15893
15894 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15895 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15896 (t11_last): Likewise.
15897 * testsuite/ver_test_6.c (main): Likewise.
15898
15899 2008-10-07 Cary Coutant <ccoutant@google.com>
15900
15901 * options.c (General_options::finalize): Add check for -static and
15902 -shared.
15903 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15904 is not empty.
15905
15906 2008-10-02 Cary Coutant <ccoutant@google.com>
15907
15908 * plugin.cc (make_sized_plugin_object): Fix conditional
15909 compilation to work when not all targets are enabled.
15910
15911 2008-09-29 Cary Coutant <ccoutant@google.com>
15912
15913 * archive.cc (Archive::get_file_and_offset): Use filename instead
15914 of name to get library path.
15915 (Archive::include_member): Unlock external member of a thin archive.
15916
15917 * testsuite/Makefile.am (TEST_AR): New variable.
15918 (thin_archive_test_1): New test.
15919 (thin_archive_test_2): New test.
15920 * testsuite/Makefile.in: Regenerate.
15921 * testsuite/thin_archive_main.cc: New file.
15922 * testsuite/thin_archive_test_1.cc: New file.
15923 * testsuite/thin_archive_test_2.cc: New file.
15924 * testsuite/thin_archive_test_3.cc: New file.
15925 * testsuite/thin_archive_test_4.cc: New file.
15926
15927 2008-09-29 Cary Coutant <ccoutant@google.com>
15928
15929 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15930 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15931 instead of -1U.
15932 (Sized_relobj::do_finalize_local_symbols): Likewise.
15933 (Sized_relobj::map_to_kept_section): Likewise.
15934 * object.h (Sized_relobj::invalid_address): New constant.
15935 (Sized_relobj::do_output_section_offset): Check for invalid_address
15936 and return -1ULL.
15937 * output.cc (Output_reloc::local_section_offset): Use constant
15938 invalid_address instead of -1U.
15939 (Output_reloc::get_address): Likewise.
15940 (Output_section::output_address): Change -1U to -1ULL.
15941 * output.h (Output_reloc::invalid_address): New constant.
15942 * reloc.cc (Sized_relobj::write_sections): Use constant
15943 invalid_address instead of -1U.
15944 (Sized_relobj::relocate_sections): Likewise.
15945 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15946 values for merge sections.
15947 * target-reloc.h (relocate_for_relocatable): Use constant
15948 invalid_address instead of -1U.
15949
15950 2008-09-19 Cary Coutant <ccoutant@google.com>
15951
15952 Add plugin functionality for link-time optimization (LTO).
15953 * configure.ac (plugins): Add --enable-plugins option.
15954 * configure: Regenerate.
15955 * config.in: Regenerate.
15956 * Makefile.am (LIBDL): New variable.
15957 (CCFILES): Add plugin.cc.
15958 (HFILES): Add plugin.h.
15959 (ldadd_var): Add LIBDL.
15960 * Makefile.in: Regenerate.
15961
15962 * archive.cc: Include "plugin.h".
15963 (Archive::setup): Don't preread archive symbols when using a plugin.
15964 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15965 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15966 files.
15967 (Archive::include_member): Add symbols from plugin objects.
15968 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15969 * descriptors.cc (Descriptors::open): Check for file descriptors
15970 abandoned by plugins.
15971 (Descriptors::claim_for_plugin): New function.
15972 * descriptors.h (Descriptors::claim_for_plugin): New function.
15973 (Open_descriptor::is_claimed): New field.
15974 (claim_descriptor_for_plugin): New function.
15975 * fileread.cc (File_read::claim_for_plugin): New function.
15976 * fileread.h (File_read::claim_for_plugin): New function.
15977 (File_read::descriptor): New function.
15978 * gold.cc: Include "plugin.h".
15979 (queue_initial_tasks): Add task to call plugin hooks for generating
15980 new object files.
15981 * main.cc: Include "plugin.h".
15982 (main): Load plugin libraries.
15983 * object.h (Pluginobj): Declare.
15984 (Object::pluginobj): New function.
15985 (Object::do_pluginobj): New function.
15986 (Object::set_target): New function.
15987 * options.cc: Include "plugin.h".
15988 (General_options::parse_plugin): New function.
15989 (General_options::General_options): Initialize plugins_ field.
15990 (General_options::add_plugin): New function.
15991 * options.h (Plugin_manager): Declare.
15992 (General_options): Add --plugin option.
15993 (General_options::has_plugins): New function.
15994 (General_options::plugins): New function.
15995 (General_options::add_plugin): New function.
15996 (General_options::plugins_): New field.
15997 * plugin.cc: New file.
15998 * plugin.h: New file.
15999 * readsyms.cc: Include "plugin.h".
16000 (Read_symbols::do_read_symbols): Check for archive before checking
16001 for ELF file. Call plugin hooks to claim files.
16002 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
16003 from a real object file; force override when processing replacement
16004 files.
16005 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
16006 (Symbol::init_base_object): Likewise.
16007 (Symbol::init_base_output_data): Likewise.
16008 (Symbol::init_base_output_segment): Likewise.
16009 (Symbol::init_base_constant): Likewise.
16010 (Symbol::init_base_undefined): Likewise.
16011 (Symbol::output_section): Assert that object is not a plugin.
16012 (Symbol_table::add_from_pluginobj): New function.
16013 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
16014 undefined.
16015 (Symbol_table::sized_write_globals): Likewise.
16016 (Symbol_table::add_from_pluginobj): Instantiate template.
16017 * symtab.h (Sized_pluginobj): Declare.
16018 (Symbol::in_real_elf): New function.
16019 (Symbol::set_in_real_elf): New function.
16020 (Symbol::in_real_elf_): New field.
16021 (Symbol_table::add_from_pluginobj): New function.
16022
16023 * testsuite/Makefile.am (AM_CFLAGS): New variable.
16024 (LIBDL): New variable.
16025 (LDADD): Add LIBDL.
16026 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
16027 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
16028 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
16029 (MOSTLYCLEANFILES): Likewise.
16030 * testsuite/Makefile.in: Regenerate.
16031 * testsuite/plugin_test.c: New file.
16032 * testsuite/plugin_test_1.sh: New file.
16033 * testsuite/plugin_test_2.sh: New file.
16034
16035 2008-09-16 Ian Lance Taylor <iant@google.com>
16036
16037 * target-reloc.h (relocate_section): Check whether a symbol is
16038 defined by the ABI before reporting an undefined symbol error.
16039 * target.h (Target::is_defined_by_abi): Make parameter const.
16040 (Target::do_is_defined_by_abi): Likewise.
16041 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
16042 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
16043 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
16044 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
16045 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
16046 * testsuite/Makefile.in: Rebuild.
16047
16048 * fileread.cc (make_view): Add casts to avoid warning.
16049
16050 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
16051
16052 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
16053 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16054
16055 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
16056
16057 * options.h (General_options::output_is_executable): New.
16058 (General_options::output_is_pie): New.
16059 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16060 for shared libraries.
16061 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16062
16063 2008-09-11 Chris Demetriou <cgd@google.com>
16064
16065 * options.h (origin): New -z option.
16066 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16067 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16068 in DT_FLAGS_1.
16069
16070 2008-09-05 Cary Coutant <ccoutant@google.com>
16071
16072 * fileread.cc (File_read::make_view): Add check for attempt to map
16073 beyond end of file.
16074
16075 2008-09-05 Cary Coutant <ccoutant@google.com>
16076
16077 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16078 explicit instantiations.
16079
16080 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16081
16082 PR gold/6858
16083 * options.cc (General_options::finalize): Allow undefined symbols
16084 in shlibs if linking -shared.
16085
16086 PR gold/6859
16087 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16088 symbols as not needing a dynsym entry.
16089
16090 2008-08-20 Craig Silverstein <csilvers@google.com>
16091
16092 * fileread.cc (File_read::open): Do not lock the file unless it
16093 was successfully opened.
16094
16095 2008-08-14 Cary Coutant <ccoutant@google.com>
16096
16097 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16098 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16099 * testsuite/tls_test.cc (struct int128): 128-bit struct
16100 for testing TLS relocs with non-zero addend.
16101 (v12): New TLS variable.
16102 (t12): New test.
16103 (t_last): Add check for v12.
16104 * testsuite/tls_test.h (t12): New function.
16105 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16106
16107 2008-08-13 Ian Lance Taylor <iant@google.com>
16108
16109 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16110 set tls_segment_ or relro_segment_.
16111 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16112 when appropriate.
16113 * output.h (Output_section::clear_is_relro): New function.
16114 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16115 sections specially even when output_data_ is empty.
16116 (Output_segment::maximum_alignment): When first section is relro,
16117 only force alignment for PT_LOAD segments.
16118 * script.cc (script_data_segment_align): New function.
16119 (script_data_segment_relro_end): New function.
16120 * script-c.h (script_data_segment_align): Declare.
16121 (script_data_segment_relro_end): Declare.
16122 * script-sections.h (class Script_sections): Declare
16123 data_segment_align and data_segment_relro_end. Add fields
16124 segment_align_index_ and saw_relro_end_.
16125 * script-sections.cc (class Sections_element): Add set_is_relro
16126 virtual function. Add new bool* parameter to place_orphan_here.
16127 Add get_output_section virtual function.
16128 (class Output_section_definition): Add set_is_relro. Add new
16129 bool* parameter to place_orphan_here. Add get_output_section.
16130 Add is_relro_ field.
16131 (Output_section_definition::Output_section_definition): Initialize
16132 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16133 and is_relro_ fields.
16134 (Output_section_definition::place_orphan_here): Add is_relro
16135 parameter.
16136 (Output_section_definition::set_section_addresses): Set relro for
16137 output section.
16138 (Output_section_definition::alternate_constraint): Likewise.
16139 (class Orphan_output_section): Add new bool* parameter to
16140 place_orphan_here. Add get_output_section.
16141 (Orphan_output_section::place_orphan_here): Add is_relro
16142 parameter.
16143 (Script_sections::Script_sections): Initialize
16144 data_segment_align_index_ and saw_relro_end_.
16145 (Script_sections::data_segment_align): New function.
16146 (Script_sections::data_segment_relro_end): New function.
16147 (Script_sections::place_orphan): Set or clear is_relro.
16148 (Script_sections::set_section_addresses): Force alignment of first
16149 TLS section.
16150 * yyscript.y (exp): Call script_data_segment_align and
16151 script_data_segment_relro_end.
16152 * testsuite/relro_script_test.t: New file.
16153 * testsuite/relro_test.cc (using_script): Declare.
16154 (t1, t2): Test using_script.
16155 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16156 (relro_script_test_SOURCES): Define.
16157 (relro_script_test_DEPENDENCIES): Define.
16158 (relro_script_test_LDFLAGS): Define.
16159 (relro_script_test_LDADD): Define.
16160 (relro_script_test.so): New target.
16161 * testsuite/Makefile.in: Rebuild.
16162
16163 2008-08-06 Cary Coutant <ccoutant@google.com>
16164
16165 * archive.cc (Archive::total_archives, Archive::total_members)
16166 (Archive::total_members_loaded): New variables.
16167 (Archive::setup): Add parameter. Add option to preread
16168 archive symbols.
16169 (Archive::read_armap): Add counter.
16170 (Archive::get_file_and_offset): New function.
16171 (Archive::get_elf_object_for_member): New function.
16172 (Archive::read_all_symbols): New function.
16173 (Archive::read_symbols): New function.
16174 (Archive::add_symbols): Add counters.
16175 (Archive::include_all_members): Use armap to find members if it's
16176 already built.
16177 (Archive::include_member): Skip reading symbols if already read.
16178 Factored code into Archive::get_file_and_offset and
16179 Archive::get_elf_object_for_member. Changed call to
16180 Mapfile::report_include_archive_member.
16181 (Archive::print_stats): New function.
16182 * archive.h: Declare Object and Read_symbols_data classes.
16183 (Archive::Archive): Add initializers for new members.
16184 (Archive::setup): Add parameter.
16185 (Archive::print_stats): New function.
16186 (Archive::total_archives, Archive::total_members)
16187 (Archive::total_members_loaded): New variables.
16188 (Archive::get_file_and_offset): New function.
16189 (Archive::get_elf_object_for_member): New function.
16190 (Archive::read_all_symbols): New function.
16191 (Archive::read_symbols): New function.
16192 (Archive::Archive_member): New class.
16193 (Archive::members_): New member.
16194 (Archive::num_members_): New member.
16195 * main.cc: Include archive.h.
16196 (main): Call Archive::print_stats.
16197 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16198 archive parameter; member_name is now the fully-decorated name.
16199 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16200 * options.h: (General_options): Add --preread-archive-symbols option.
16201 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16202 Archive::setup.
16203
16204 2008-08-04 Ian Lance Taylor <iant@google.com>
16205
16206 * symtab.h (Symbol::use_plt_offset): New function.
16207 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16208 * powerpc.cc (Relocate::relocate): Likewise.
16209 * sparc.cc (Relocate::relocate): Likewise.
16210 * x86_64.cc (Relocate::relocate): Likewise.
16211 * testsuite/weak_plt.sh: New test.
16212 * testsuite/weak_plt_main.cc: New test.
16213 * testsuite/weak_plt_shared.cc: New test.
16214 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16215 (check_PROGRAMS): Add weak_plt.
16216 (check_DATA): Add weak_plt_shared.so.
16217 (weak_plt_main_pic.o, weak_plt): New targets.
16218 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16219 * testsuite/Makefile.in: Rebuild.
16220
16221 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16222 gcctestdir/ld.
16223 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16224 * testsuite/Makefile.in: Rebuild.
16225
16226 2008-08-04 Alan Modra <amodra@bigpond.net.au>
16227
16228 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16229 * Makefile.in: Regenerate.
16230 * po/POTFILES.in: Regenerate.
16231
16232 2008-07-29 Ian Lance Taylor <iant@google.com>
16233
16234 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16235 symbols before other symbols.
16236 * testsuite/script_test_2.cc (test_addr): Declare.
16237 (test_addr_alias): Declare.
16238 (main): Check that test_addr and test_addr_alias have the right
16239 values.
16240 * testsuite/script_test_2.t: Define test_addr_alias and
16241 test_addr.
16242
16243 2008-07-24 Ian Lance Taylor <iant@google.com>
16244
16245 PR 5990
16246 * descriptors.cc: New file.
16247 * descriptors.h: New file.
16248 * gold-threads.h (class Hold_optional_lock): New class.
16249 * fileread.cc: Include "descriptors.h".
16250 (File_read::~File_read): Release descriptor rather than closing
16251 it.
16252 (File_read::open) [file]: Call open_descriptor rather than open.
16253 Set is_descriptor_opened_.
16254 (File_read::open) [memory]: Assert that descriptor is not open.
16255 (File_read::reopen_descriptor): New function.
16256 (File_read::release): Release descriptor.
16257 (File_read::do_read): Make non-const. Reopen descriptor.
16258 (File_read::read): Make non-const.
16259 (File_read::make_view): Reopen descriptor.
16260 (File_read::do_readv): Likewise.
16261 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16262 Update declarations.
16263 * layout.cc: Include "descriptors.h".
16264 (Layout::create_build_id): Use open_descriptor rather than open.
16265 * output.cc: Include "descriptors.h".
16266 (Output_file::open): Use open_descriptor rather than open.
16267 * archive.cc (Archive::const_iterator): Change Archive to be
16268 non-const.
16269 (Archive::begin, Archive::end): Make non-const.
16270 (Archive::count_members): Likewise.
16271 * archive.h (class Archive): Update declarations.
16272 * object.h (Object::read): Make non-const.
16273 * Makefile.am (CCFILES): Add descriptors.cc.
16274 (HFILES): Add descriptors.h.
16275 * Makefile.in: Rebuild.
16276
16277 PR 6716
16278 * gold.h: Always include <clocale>. Add Solaris workarounds
16279 following code in binutils/sysdep.h.
16280
16281 PR 6048
16282 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16283 this->eh_frame_hdr_ is NULL before using it.
16284
16285 * dynobj.cc (Versions::Versions): Update comment.
16286
16287 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16288 the base version name.
16289
16290 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16291 array size plus one.
16292 (Stringpool_template::set_string_offsets): Subtract one from key
16293 before using it as an array index.
16294 (Stringpool_template::get_offset_with_length): Likewise.
16295 (Stringpool_template::write_to_buffer): Likewise.
16296 * stringpool.h (Stringpool_template::get_offset_from_key):
16297 Likewise.
16298
16299 2008-07-23 Ian Lance Taylor <iant@google.com>
16300
16301 PR 6658
16302 * object.h (Merged_symbol_value::value): Do our best to handle a
16303 negative addend.
16304
16305 PR 6647
16306 * script.cc (Version_script_info::get_versions): Don't add empty
16307 version tag to return value.
16308 (Version_script_info::get_symbol_version_helper): Change return
16309 type to bool. Add pversion parameter. Change all callers.
16310 (script_register_vers_node): Don't require a non-NULL tag.
16311 * script.h (class Version_script_info): Update declarations.
16312 (Version_script_info::get_symbol_version): Change return type to
16313 bool. Add version parameter. Change all callers.
16314 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16315 handling. Handle an empty version from a version script.
16316 (Symbol_table::define_special_symbol): Likewise.
16317 * testsuite/ver_test_10.script: New file.
16318 * testsuite/ver_test_10.sh: New file.
16319 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16320 (check_DATA): Add ver_test_10.syms.
16321 (ver_test_10.syms, ver_test_10.so): New target.
16322 * testsuite/Makefile.in: Rebuild.
16323
16324 2008-07-23 Simon Baldwin <simonb@google.com>
16325
16326 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16327 to zero for undefined symbols from dynamic libraries.
16328
16329 2008-07-23 Ian Lance Taylor <iant@google.com>
16330
16331 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16332 Change all callers.
16333 * symtab.h (class Symbol_table): Update declaration.
16334 * testsuite/ver_test_9.cc: New file.
16335 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16336 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16337 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16338 (ver_test_9.so, ver_test_9.o): New targets.
16339 * testsuite/Makefile.in: Rebuild.
16340
16341 2008-07-22 Ian Lance Taylor <iant@google.com>
16342
16343 * options.h (class General_options): Define --check-sections.
16344 * layout.cc (Layout::set_segment_offsets): Handle
16345 --check-sections.
16346
16347 * options.h (class General_options): Define -n/--nmagic and
16348 -N/--omagic.
16349 * options.cc (General_options::finalize): For -n/--nmagic or
16350 -N/--omagic, set -static.
16351 * layout.cc (Layout::attach_allocated_section_to_segment): If
16352 -N/--omagic, don't put read-only and read-write sections in
16353 different segments.
16354 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16355 finding a read-only segment.
16356 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16357 don't set the minimum segment alignment to the common page size,
16358 and don't set the file offset to the address modulo the page size.
16359 * script-sections.cc (Script_sections::create_segments): If
16360 -n/--omagic, don't put read-only and read-write sections in
16361 different segments.
16362
16363 * cref.cc: New file.
16364 * cref.h: New file.
16365 * options.h (class General_options): Add --print-symbol-counts.
16366 * main.cc (main): Issue defined symbol report if requested.
16367 * archive.cc (Archive::interpret_header): Make into a const member
16368 function.
16369 (Archive::add_symbols): Call Input_objects::archive_start and
16370 archive_stop.
16371 (Archive::const_iterator): Define new class.
16372 (Archive::begin, Archive::end): New functions.
16373 (Archive::include_all_members): Rewrite to use iterator.
16374 (Archive::count_members): New function.
16375 * archive.h (class Archive): Update declarations.
16376 (Archive::filename): New function.
16377 * object.cc: Include "cref.h".
16378 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16379 (Sized_relobj::do_get_global_symbol_counts): New function.
16380 (Input_objects::add_object): Add object to cross-referencer.
16381 (Input_objects::archive_start): New function.
16382 (Input_objects::archive_stop): New function.
16383 (Input_objects::print_symbol_counts): New function.
16384 * object.h: Declare Cref and Archive.
16385 (Object::get_global_symbol_counts): New function.
16386 (Object::do_get_global_symbol_counts): New pure virtual function.
16387 (class Sized_relobj): Add defined_count_ field. Update
16388 declarations.
16389 (class Input_objects): Add cref_ field. Update constructor.
16390 Update declarations.
16391 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16392 defined_count_.
16393 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16394 symbol counts.
16395 (Sized_dynobj::do_get_global_symbol_counts): New function.
16396 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16397 defined_count_. Update declarations. Define Symbols typedef.
16398 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16399 parameter. Change all callers.
16400 (Symbol_table::add_from_dynobj): Add sympointers and defined
16401 parameters. Change all callers.
16402 * symtab.h (class Symbol_table): Update declarations.
16403 * Makefile.am (CCFILES): Add cref.cc.
16404 (HFILES): Add cref.h.
16405 * Makefile.in: Rebuild.
16406
16407 2008-07-22 Simon Baldwin <simonb@google.com>
16408
16409 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16410 to zero when writing undefined symbols.
16411
16412 2008-07-22 Ian Lance Taylor <iant@google.com>
16413
16414 * output.cc (Output_section::add_input_section): Don't try to
16415 merge empty merge sections.
16416
16417 2008-07-21 Craig Silverstein <csilvers@google.com>
16418
16419 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16420 Include symbol version in error message.
16421
16422 2008-07-20 Chris Demetriou <cgd@google.com>
16423
16424 * configure.ac (gold_cv_c_random_seed): New configured variable.
16425 (RANDOM_SEED_CFLAGS): New substituted variable.
16426 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16427 * configure: Rebuild.
16428 * Makefile.in: Likewise.
16429 * testsuite/Makefile.in: Likewise.
16430
16431 2008-07-18 Ian Lance Taylor <iant@google.com>
16432
16433 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16434 where we see NAME/NULL and NAME/VERSION as separate symbols.
16435 * testsuite/ver_test_main.cc (main): Call t4.
16436 (t4, t4_2a): Define.
16437 * testsuite/ver_test_2.cc (t4_2): Define.
16438 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16439 * testsuite/ver_test_4.cc (t4_2a): Define.
16440 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16441 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16442
16443 2008-07-17 Ian Lance Taylor <iant@google.com>
16444
16445 * dynobj.cc (Versions::add_def): If we give an error about a
16446 missing version, go ahead and create the version anyhow.
16447
16448 2008-07-10 Ian Lance Taylor <iant@google.com>
16449
16450 Handle output sections with more than 0x7fffffff bytes.
16451 * object.h (class Relobj): Change map_to_output_ to
16452 output_sections_, and just keep a section pointer. Change all
16453 uses. Move comdat group support to Sized_relobj.
16454 (Relobj::is_section_specially_mapped): Remove.
16455 (Relobj::output_section): Remove poff parameter. Change all
16456 callers.
16457 (Relobj::output_section_offset): New function.
16458 (Relobj::set_section_offset): Rewrite.
16459 (Relobj::map_to_output): Remove.
16460 (Relobj::output_sections): New function.
16461 (Relobj::do_output_section_offset): New pure virtual function.
16462 (Relobj::do_set_section_offset): Likewise.
16463 (class Sized_relobj): Add section_offsets_ field. Add comdat
16464 group support from Relobj. Update declarations.
16465 (Sized_relobj::get_output_section_offset): New function.
16466 (Sized_relobj::do_output_section_offset): New function.
16467 (Sized_relobj::do_set_section_offset): New function.
16468 * object.cc (Relobj::output_section_address): Remove.
16469 (Sized_relobj::Sized_relobj): Initialize new fields.
16470 (Sized_relobj::include_section_group): Cast find_kept_object to
16471 Sized_relobj.
16472 (Sized_relobj::include_linkonce_section): Likewise.
16473 (Sized_relobj::do_layout): Use separate arrays for output section
16474 and output offset.
16475 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16476 output_sections.
16477 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16478 output_sections and section_offsets.
16479 (Sized_relobj::write_local_symbols): Likewise.
16480 (map_to_kept_section): Compute output address directly.
16481 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16482 output_sections and section_offsets.
16483 (Sized_relobj::write_sections): Likewise.
16484 (Sized_relobj::relocate_sections): Likewise.
16485 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16486 * output.h (class Output_reloc): Update declarations. Change
16487 u2_.relobj to Sized_relobj*.
16488 (class Output_data_reloc): Change add functions to use
16489 Sized_relobj*.
16490 * output.cc (Output_reloc::Output_reloc): Change relobj to
16491 Sized_relobj*.
16492 (Output_reloc::local_section_offset): Change return type to
16493 Elf_Addr. Use get_output_section_offset.
16494 (Output_reloc::get_address): Likewise.
16495 (Output_section::is_input_address_mapped): Don't call
16496 is_section_specially_mapped.
16497 (Output_section::output_offset): Likewise.
16498 (Output_section::output_address): Likewise.
16499 (Output_section::starting_output_address): Likewise.
16500 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16501 parameter to Sized_relobj*.
16502 (Copy_relocs::need_copy_reloc): Likewise.
16503 (Copy_relocs::save): Likewise.
16504 * copy-relocs.h (class Copy_relocs): Update declarations.
16505 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16506 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16507 * target-reloc.h (relocate_for_relocatable): Change
16508 offset_in_output_section type to Elf_Addr. Change code that uses
16509 it as well.
16510 * layout.cc (Layout::layout): Always set *off.
16511 * mapfile.cc (Mapfile::print_input_section): Use
16512 output_section_offset.
16513 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16514 Sized_relobj*.
16515 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16516 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16517 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16518
16519 2008-07-03 Ian Lance Taylor <iant@google.com>
16520
16521 * layout.cc (Layout::include_section): Do not discard unrecognized
16522 SHT_STRTAB sections.
16523
16524 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16525
16526 * script.cc (Lex::can_continue_name): Make '?' allowable in
16527 version-script names.
16528 * testsuite/version_script.map: Change glob pattern to use '?'
16529
16530 2008-06-30 Manish Singh <yosh@gimp.org>
16531
16532 PR 6585
16533 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16534 Correct typo.
16535
16536 2008-06-30 Ian Lance Taylor <iant@google.com>
16537
16538 PR 6660
16539 PR 6682
16540 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16541 versions]: Don't try to read the value in the contents, since we
16542 don't use it. Use the template endianness when writing.
16543
16544 2008-06-25 Cary Coutant <ccoutant@google.com>
16545
16546 * fileread.cc (File_read::make_view): Assert on zero-length view.
16547 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16548 symbol table when there are no symbols to read.
16549
16550 2008-06-23 Craig Silverstein <csilvers@google.com>
16551
16552 * version.cc (version_string): Bump to 1.7
16553
16554 2008-06-18 Craig Silverstein <csilvers@google.com>
16555
16556 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16557 constant 0xFFFF to type Valtype.
16558 (Powerpc_relocate_functions::rel16_ha): Likewise.
16559
16560 2008-06-17 Ian Lance Taylor <iant@google.com>
16561
16562 * output.h (Output_section::Input_section): Initialize p2align_ to
16563 zero for Output_section_data constructors.
16564 (Output_section::Input_section::addralign): If not an input
16565 section, return the alignment of the Output_section_data.
16566 * testsuite/copy_test.cc: New file.
16567 * testsuite/copy_test_1.cc: New file.
16568 * testsuite/copy_test_2.cc: New file.
16569 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16570 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16571 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16572 (copy_test_1_pic.o, copy_test_1.so): New targets.
16573 (copy_test_2_pic.o, copy_test_2.so): New targets.
16574 * testsuite/Makefile.in: Rebuild.
16575
16576 * script-sections.cc (Script_sections::place_orphan): Initialize
16577 local variable exact.
16578
16579 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16580
16581 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16582
16583 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16584 David S. Miller <davem@davemloft.net>
16585
16586 * powerpc.cc: New file.
16587 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16588 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16589 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16590 * Makefile.in: Rebuild.
16591
16592 2008-06-09 Ian Lance Taylor <iant@google.com>
16593
16594 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16595 <exception>.
16596 (throwing, orig_terminate): New static variables.
16597 (terminate_handler): New static function.
16598 (t2): Set terminate handler.
16599
16600 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16601
16602 PR 6584
16603 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16604 alignment.
16605
16606 2008-05-30 Cary Coutant <ccoutant@google.com>
16607
16608 * archive.cc (Archive::include_all_members) Correct to step
16609 over symbol table and extended name table in thin archives.
16610
16611 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16612
16613 PR 6407
16614 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16615 calculation.
16616
16617 2008-05-28 Caleb Howe <cshowe@google.com>
16618
16619 * reduced_debug_output.cc: New file.
16620 * reduced_debug_output.h: New file.
16621 * options.h (class General_options): Add --strip-debug-non-line.
16622 * options.cc (General_options::finalize): Add strip_debug_non_line
16623 to the strip heirarchy.
16624 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16625 fields.
16626 * layout.cc: Include "reduced_debug_output.h".
16627 (Layout::Layout): Initialize new fields.
16628 (line_only_debug_sections): New static array.
16629 (is_lines_only_debug_sections): New static inline function.
16630 (Layout::include_section): Handle --strip-debug-non-line.
16631 (Layout::make_output_section): If --strip-debug-non-line, build
16632 new output sections for .debug_abbrev and .debug_info.
16633 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16634 gold. Warn about possible overflow.
16635 (read_signed_LEB_128): Likewise.
16636 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16637 (read_signed_LEB_128): Declare.
16638 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16639 (HFILES): Add reduced_debug_output.h.
16640 * Makefile.in: Rebuild.
16641
16642 2008-05-21 Ian Lance Taylor <iant@google.com>
16643
16644 * mapfile.cc: New file.
16645 * mapfile.h: New file.
16646 * options.h (class General_options): Add -M/--print-map and -Map.
16647 * options.cc (General_options::finalize): Make -M equivalent to
16648 -Map -.
16649 * main.cc: Include <cstdio> and "mapfile.h".
16650 (main): Open mapfile if requested.
16651 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16652 constructor. Change caller.
16653 (queue_initial_tasks): Add mapfile parameter. Change caller.
16654 (queue_middle_tasks): Likewise.
16655 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16656 declarations.
16657 * archive.cc: Include "mapfile.h".
16658 (Archive::add_symbols): Add mapfile parameter. Change all
16659 callers. Pass mapfile, symbol, and reason to include_member.
16660 (Archive::include_all_members): Add mapfile parameter. Change all
16661 callers.
16662 (Archive::include_member): Add mapfile, sym, and why parameters.
16663 Change all callers. Report inclusion to map file.
16664 * archive.h: Include "fileread.h".
16665 (class Archive): Update declarations.
16666 (Archive::file): New const method.
16667 (class Add_archive_symbols): Add mapfile_ field. Update
16668 constructor. Change all callers.
16669 * readsyms.h (class Read_symbols): Likewise.
16670 (class Finish_group): Likewise.
16671 (class Read_script): Likewise.
16672 * common.cc: Include "mapfile.h".
16673 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16674 all callers.
16675 (Symbol_table::do_allocate_commons): Likewise.
16676 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16677 symbol allocation to mapfile.
16678 * common.h (class Allocate_commons_task): Add mapfile_ field.
16679 Update constructor. Change all callers.
16680 * symtab.h (class Symbol_table): Update declarations.
16681 * layout.cc: Include "mapfile.h".
16682 (Layout_task_runner::run): Print information to mapfile.
16683 (Layout::create_gold_note): Change Output_data_fixed_space to
16684 Output_data_zero_fill.
16685 (Layout::create_build_id): Likewise.
16686 (Layout::print_to_mapfile): New function.
16687 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16688 constructor. Change caller.
16689 (class Layout): Declare print_to_mapfile.
16690 * output.cc (Output_section::Input_section::print_to_mapfile): New
16691 function.
16692 (Output_section::add_input_section): If producing a map, always
16693 add to input_sections_ list.
16694 (Output_section::do_print_to_mapfile): New function.
16695 (Output_segment::print_sections_to_mapfile): New function.
16696 (Output_segment::print_section_list_to_mapfile): New function.
16697 * output.h: Include "mapfile.h".
16698 (Output_data::print_to_mapfile): New function.
16699 (Output_data::do_print_to_mapfile): New virtual function.
16700 (Output_segment_headers::do_print_to_mapfile): New function.
16701 (Output_file_header::do_print_to_mapfile): New function.
16702 (Output_data_const::do_print_to_mapfile): New function.
16703 (class Output_data_const_buffer): Add map_name_ field. Update
16704 constructor. Change all callers. Add do_print_to_mapfile
16705 function.
16706 (class Output_data_fixed_space): Likewise.
16707 (class Output_data_space): Likewise.
16708 (class Output_data_zero_fill): New class.
16709 (Output_data_strtab::do_print_to_mapfile): New function.
16710 (Output_data_reloc_base::do_print_to_mapfile): New function.
16711 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16712 (Output_data_group::do_print_to_mapfile): New function.
16713 (Output_data_got::do_print_to_mapfile): New function.
16714 (Output_data_dynamic::do_print_to_mapfile): New function.
16715 (Output_symtab_xindex::do_print_to_mapfile): New function.
16716 (class Output_section): Declare do_print_to_mapflie. Declare
16717 print_to_mapfile in Input_section.
16718 (class Output_segment): Declare new functions.
16719 * object.h (Sized_relobj::symbol_count): New function.
16720 * script-sections.cc
16721 (Output_section_element_dot_assignment::set_section_addresses):
16722 Change Output_data_fixed_space to Output_data_zero_fill.
16723 (Output_data_expression::do_print_to_mapfile): New function.
16724 * script.cc (read_input_script): Add mapfile parameter. Change
16725 all callers.
16726 * script.h (read_input_script): Update declaration.
16727 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16728 (Eh_frame::do_print_to_mapfile): New function.
16729 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16730 (Output_merge_string::do_print_to_mapfile): New function.
16731 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16732 function.
16733 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16734 function.
16735 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16736 function.
16737 * Makefile.am (CCFILES): Add mapfile.cc.
16738 (HFILES): Add mapfile.h.
16739 * Makefile.in: Rebuild.
16740
16741 2008-05-19 Ian Lance Taylor <iant@google.com>
16742
16743 * options.h (class General_options): Add -z relro.
16744 * layout.cc (Layout::Layout): Initialize relro_segment_.
16745 (Layout::add_output_section_data): Return the output section.
16746 (Layout::make_output_section): Rcognize relro sections and mark
16747 them appropriately.
16748 (Layout::attach_allocated_section_to_segment): Put relro sections
16749 in a PT_GNU_RELRO segment.
16750 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16751 section as relro.
16752 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16753 PT_TLS segments.
16754 (Layout::linkonce_mapping): Map d.rel.ro.local to
16755 .data.rel.ro.local.
16756 (Layout::output_section_name): Us .data.rel.ro.local for any
16757 section which begins with that.
16758 * layout.h (class Layout): Update add_output_section_data
16759 declaration. Add relro_segment_ field.
16760 * output.cc (Output_section::Output_section): Initialize is_relro_
16761 and is_relro_local_ fields.
16762 (Output_segment::add_output_section): Group relro sections.
16763 (Output_segment::is_first_section_relro): New function.
16764 (Output_segment::maximum_alignment): If there is a relro section,
16765 align the segment to the common page size.
16766 (Output_segment::set_section_addresses): Track whether we are
16767 looking at relro sections. If the last section is a relro
16768 section, align to the common page size.
16769 (Output_segment::set_section_list_addresses): Add in_relro
16770 parameter. Change all callers. Align to the page size when
16771 moving from relro to non-relro section.
16772 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16773 segment.
16774 * output.h (class Output_section): Add is_relro_ and
16775 is_relro_local_ fields.
16776 (Output_section::is_relro): New function.
16777 (Output_section::set_is_relro): New function.
16778 (Output_section::is_relro_local): New function.
16779 (Output_section::set_is_relro_local): New function.
16780 (class Output_segment): Update declarations.
16781 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16782 * sparc.cc (Target_sparc::got_section): Likewise.
16783 * x86_64.cc (Target_x86_64::got_section): Likewise.
16784 * testsuite/relro_test_main.cc: New file.
16785 * testsuite/relro_test.cc: New file.
16786 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16787 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16788 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16789 (relro_test.so, relro_test_pic.o): New targets.
16790 * testsuite/Makefile.in: Rebuild.
16791
16792 2008-05-16 Ian Lance Taylor <iant@google.com>
16793
16794 * output.cc (Output_segment::add_output_section): Remove front
16795 parameter.
16796 * output.h (class Output_segment): Remove
16797 add_initial_output_section and overloaded add_output_section.
16798 Update declaration of remaining add_output_section.
16799 * layout.cc (Layout::create_interp): Call add_output_section
16800 rather than add_initial_output_section.
16801 (Layout::finish_dynamic_section): Likewise.
16802
16803 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16804 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16805 know the dynamic type.
16806 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16807 field. Initialize it in constructor.
16808 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16809 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16810 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16811 reloc.
16812
16813 * output.cc (Output_reloc::get_address): Change return type to
16814 Elf_Addr.
16815 * output.h (class Output_reloc): Update get_address declaration.
16816 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16817 for section addresses.
16818
16819 2008-05-09 Ian Lance Taylor <iant@google.com>
16820
16821 PR 6493
16822 * gold.cc (gold_nomem): Use return value of write.
16823
16824 2008-05-08 Ian Lance Taylor <iant@google.com>
16825
16826 * symtab.c (Symbol::init_base_output_data): Add version
16827 parameter. Change all callers.
16828 (Symbol::init_base_output_segment): Likewise.
16829 (Symbol::init_base_constant): Likewise.
16830 (Symbol::init_base_undefined): Likewise.
16831 (Sized_symbol::init_output_data): Likewise.
16832 (Sized_symbol::init_output_segment): Likewise.
16833 (Sized_symbol::init_constant): Likewise.
16834 (Sized_symbol::init_undefined): Likewise.
16835 (Symbol_table::do_define_in_output_data): If the new symbol has a
16836 version, mark it as the default.
16837 (Symbol_table::do_define_in_output_segment): Likewise.
16838 (Symbol_table::do_define_as_constant): Likewise.
16839 * symtab.h (class Symbol): Update declarations.
16840 (class Sized_symbol): Likewise.
16841 * resolve.cc (Symbol::override_version): New function.
16842 (Symbol::override_base): Call override_version.
16843 (Symbol::override_base_with_special): Likewise.
16844 * testsuite/ver_script_8.script: New file.
16845 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16846 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16847 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16848 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16849
16850 2008-05-06 Ian Lance Taylor <iant@google.com>
16851
16852 PR 6049
16853 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16854 functions.
16855 (class General_options): Remove existing --undefined, and add
16856 --no-undefined instead. Add new --undefined as synonym for -u.
16857 * archive.cc (Archive::add_symbols): Check whether symbol was
16858 named with -u.
16859 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16860 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16861 all uses. Add IS_UNDEFINED. Update declarations to split
16862 different versions of init_base. Declare init_base_undefined.
16863 (Symbol::is_defined): Handle IS_UNDEFINED.
16864 (Symbol::is_undefined): Likewise.
16865 (Symbol::is_weak_undefined): Call is_undefined.
16866 (Symbol::is_absolute): Handle IS_CONSTANT.
16867 (class Sized_symbol): Update declarations to split different
16868 versions of init. Declare init_undefined.
16869 (class Symbol_table): Declare new functions.
16870 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16871 Change all callers.
16872 (Symbol::init_base_output_data): Likewise.
16873 (Symbol::init_base_output_segment): Likewise.
16874 (Symbol::init_base_constant): Likewise.
16875 (Symbol::init_base_undefined): New function.
16876 (Sized_symbol::init_object): Rename from init. Change all
16877 callers.
16878 (Sized_symbol::init_output_data): Likewise.
16879 (Sized_symbol::init_output_segment): Likewise.
16880 (Sized_symbol::init_constant): Likewise.
16881 (Sized_symbol::init_undefined): New function.
16882 (Symbol_table::add_undefined_symbols_from_command_line): New
16883 function.
16884 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16885 function.
16886 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16887 (Symbol::output_section): Likewise.
16888 (Symbol::set_output_section): Likewise.
16889 (Symbol_table::sized_finalize_symbol): Likewise.
16890 (Symbol_table::sized_write_globals): Likewise.
16891 * resolve.cc (Symbol_table::should_override): Likewise.
16892 (Symbol::override_base_with_special): Likewise.
16893
16894 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16895 symbol, change it to have default visibility.
16896 * testsuite/protected_1.cc: New file.
16897 * testsuite/protected_2.cc: New file.
16898 * testsuite/protected_3.cc: New file.
16899 * testsuite/protected_main_1.cc: New file.
16900 * testsuite/protected_main_2.cc: New file.
16901 * testsuite/protected_main_3.cc: New file.
16902 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16903 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16904 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16905 (protected_1.so): New target.
16906 (protected_1_pic.o, protected_2_pic.o): New targets.
16907 (protected_3_pic.o): New target.
16908 (check_PROGRAMS): Add protected_2.
16909 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16910 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16911 * testsuite/Makefile.in: Rebuild.
16912
16913 * options.h (DEFINE_var): Add set_user_set_##varname__.
16914 (DEFINE_bool_alias): New macro.
16915 (class General_options): Define -Bstatic using DEFINE_bool_alias
16916 rather than DEFINE_special. Add --undefined as an alias for -z
16917 defs.
16918 * options.cc (General_options::parse_Bstatic): Remove.
16919
16920 * options.h (class General_options): Add --fatal-warnings.
16921 * main.cc (main): Implement --fatal-warnings.
16922 * errors.h (Errors::warning_count): New function.
16923
16924 * options.h (class General_options): Add -Bsymbolic-functions.
16925 * symtab.h (Symbol::is_preemptible): Check for
16926 -Bsymbolic-functions.
16927
16928 2008-05-05 Ian Lance Taylor <iant@google.com>
16929
16930 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16931 as noVARNAME rather than no-VARNAME.
16932 (class General_options): Add option -z combreloc.
16933 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16934 get_address.
16935 (Output_reloc::sort_before) [SHT_REL]: New function.
16936 (Output_reloc::sort_before) [SHT_RELA]: New function.
16937 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16938 Sort_relocs_comparison.
16939 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16940 parameter. Change all callers.
16941 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16942 sort_relocs parameter. Change all callers.
16943 * output.cc (Output_reloc::get_address): New function, broken out
16944 of write_rel.
16945 (Output_reloc::write_rel): Call it.
16946 (Output_reloc::compare): New function.
16947 (Output_data_reloc_base::do_write): Optionally sort relocs.
16948
16949 * configure.ac: If targ_extra_obj is set, link it in.
16950 * configure.tgt: Initialize all variables.
16951 (x86_64*): Set targ_extra_obj and targ_extra_size.
16952 * configure: Rebuild.
16953
16954 * object.cc (Sized_relobj::include_section_group): Adjust section
16955 indexes read from group data. Build vector to pass to
16956 layout_group.
16957 * layout.cc (Layout::layout_group): Add flags and shndxes
16958 parameters. Remove contents parameter. Change caller. Update
16959 explicit instantiations.
16960 * layout.h (class Layout): Update layout_group declaration.
16961 * output.cc (Output_data_group::Output_data_group): Add flags and
16962 input_shndxes parameters. Remove contents parameter. Change
16963 caller.
16964 (Output_data_group::do_write): Change input_sections_ to
16965 input_shndxes_.
16966 * output.h (class Output_data_group): Update constructor
16967 declaration. Rename input_sections_ to input_shndxes_.
16968 * testsuite/many_sections_test.cc: Add template.
16969
16970 2008-04-30 Cary Coutant <ccoutant@google.com>
16971
16972 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16973
16974 * layout.cc (Layout::include_section): Refactored check for debug
16975 info section.
16976 (Layout::add_comdat): Add new parameters. Change type
16977 of signature parameter. Add object and shndx to signatures table.
16978 (Layout::find_kept_object): New function.
16979 * layout.h: Include <cstring>.
16980 (Layout::is_debug_info_section): New function.
16981 (Layout::add_comdat): Add new parameters.
16982 (Layout::find_kept_object): New function.
16983 (Layout::Kept_section): New struct.
16984 (Layout::Signatures): Change type of map range.
16985 * object.cc (Relobj::output_section_address): New function.
16986 (Sized_relobj::include_section_group): Add new parameters. Change
16987 calls to Layout::add_comdat. Change to build table of kept comdat
16988 groups and table mapping discarded sections to kept sections.
16989 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16990 (Sized_relobj::do_layout): Change calls to include_section_group and
16991 include_linkonce_section.
16992 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16993 value to zero when section is discarded.
16994 (Sized_relobj::map_to_kept_section): New function.
16995 * object.h (Relobj::output_section_address): New function.
16996 (Relobj::Comdat_group): New type.
16997 (Relobj::find_comdat_group): New function.
16998 (Relobj::Comdat_group_table): New type.
16999 (Relobj::Kept_comdat_section): New type.
17000 (Relobj::Kept_comdat_section_table): New type.
17001 (Relobj::add_comdat_group): New function.
17002 (Relobj::set_kept_comdat_section): New function.
17003 (Relobj::get_kept_comdat_section): New function.
17004 (Relobj::comdat_groups_): New field.
17005 (Relobj::kept_comdat_sections_): New field.
17006 (Symbol_value::input_value): Update comment.
17007 (Sized_relobj::map_to_kept_section) New function.
17008 (Sized_relobj::include_linkonce_section): Add new parameter.
17009 * target-reloc.h (Comdat_behavior): New type.
17010 (get_comdat_behavior): New function.
17011 (relocate_section): Add code to map a discarded section to the
17012 corresponding kept section when applying a relocation.
17013
17014 2008-04-30 Craig Silverstein <csilvers@google.com>
17015
17016 * dwarf_reader.cc (next_generation_count): New static var.
17017 (Addr2line_cache_entry): New struct.
17018 (addr2line_cache): New static var.
17019 (Dwarf_line_info::one_addr2line): Added caching.
17020 (Dwarf_line_info::clear_addr2line_cache): New function.
17021 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
17022 cache-size parameter.
17023 (Dwarf_line_info::one_addr2line_cache): New function.
17024 * symtab.cc (Symbol_table::detect_odr_violations): Pass
17025 new cache-size argument to one_addr2line(), and clear cache.
17026
17027 2008-04-28 Cary Coutant <ccoutant@google.com>
17028
17029 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
17030 R_386_PC8 relocations.
17031
17032 2008-04-23 Ian Lance Taylor <iant@google.com>
17033
17034 * object.cc (Sized_relobj::include_section_group): Check for
17035 invalid section group.
17036
17037 * object.cc (make_elf_object): Correct test for 64-bit ELF file
17038 header size.
17039
17040 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
17041 than read for file header.
17042 * archive.cc (Archive::include_member): Likewise.
17043
17044 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
17045
17046 * aclocal.m4: Regenerate.
17047 * configure: Regenerate.
17048
17049 2008-04-19 Ian Lance Taylor <iant@google.com>
17050
17051 * version.cc (version_string): Bump to 1.6.
17052
17053 * testsuite/Makefile.am (many_sections_r_test): New target.
17054 (many_sections_r_test_SOURCES): Remove.
17055 (many_sections_r_test_DEPENDENCIES): Remove.
17056 (many_sections_r_test_LDFLAGS): Remove.
17057 (many_sections_r_test_LDADD): Remove.
17058
17059 * object.cc (Sized_relobj::do_add_symbols): Always pass
17060 local_symbol_count_ to add_from_relobj.
17061
17062 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17063 every thousand variables.
17064 * testsuite/Makefile.in: Rebuild.
17065
17066 * object.cc (Xindex::initialize_symtab_xindex): New function.
17067 (Xindex::read_symtab_xindex): New function.
17068 (Xindex::sym_xindex_to_shndx): New function.
17069 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17070 available.
17071 (Sized_relobj::do_initialize_xindex): New function.
17072 (Sized_relobj::do_read_symbols): Adjust section links.
17073 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17074 parameter. Change all callers.
17075 (Sized_relobj::include_section_group): Adjust section links and
17076 symbol section indexes.
17077 (Sized_relobj::do_layout): Adjust section links.
17078 (Sized_relobj::do_count_local_symbols): Adjust section links and
17079 symbol section indexes.
17080 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17081 ordinary and special symbols.
17082 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17083 dynsym_xindex parameters. Change all callers. Adjust section
17084 links. Use SHN_XINDEX when needed.
17085 (Sized_relobj::get_symbol_location_info): Adjust section links.
17086 Don't get fooled by special symbols.
17087 * object.h (class Xindex): Define.
17088 (class Object): Add xindex_ parameter. Declare virtual functoin
17089 do_initialize_xindex.
17090 (Object::adjust_sym_shndx): New function.
17091 (Object::set_xindex): New protected function.
17092 (class Symbol_value): Add is_ordinary_shndx_ field.
17093 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17094 (Symbol_value::value): Assert ordinary section.
17095 (Symbol_value::initialize_input_to_output_map): Likewise.
17096 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17097 Change all callers.
17098 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17099 all callers.
17100 (class Sized_relobj): Update declarations.
17101 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17102 parameter. Change all callers.
17103 (Sized_relobj::adjust_shndx): New function.
17104 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17105 field.
17106 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17107 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17108 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17109 (Sized_dynobj::read_dynsym_section): Adjust section links.
17110 (Sized_dynobj::read_dynamic): Likewise.
17111 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17112 section links.
17113 (Sized_dynobj::do_initialize_xindex): New function.
17114 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17115 do_initialize_xindex.
17116 (Sized_dynobj::adjust_shndx): New function.
17117 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17118 dynsym_xindex_ fields.
17119 (Layout::finalize): Add a call to set_section_indexes before
17120 creating the symtab sections.
17121 (Layout::set_section_indexes): Don't do anything if the section
17122 already has a section index.
17123 (Layout::create_symtab_sections): Add shnum parameter. Change
17124 caller. Create .symtab_shndx section if needed.
17125 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17126 caller.
17127 (Layout::allocated_output_section_count): New function.
17128 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17129 needed.
17130 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17131 fields. Update declarations.
17132 (Layout::symtab_xindex): New function.
17133 (Layout::dynsym_xindex): New function.
17134 (class Write_symbols_task): Add layout_ field.
17135 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17136 Change caller.
17137 * output.cc (Output_section_headers::Output_section_headers): Add
17138 shstrtab_section parameter. Change all callers.
17139 (Output_section_headers::do_sized_write): Store overflow values
17140 for section count and section string table section index in
17141 section header zero.
17142 (Output_file_header::do_sized_write): Check for overflow of
17143 section count and section string table section index.
17144 (Output_symtab_xindex::do_write): New function.
17145 (Output_symtab_xindex::endian_do_write): New function.
17146 * output.h (class Output_section_headers): Add shstrtab_section_.
17147 Update declarations.
17148 (class Output_symtab_xindex): Define.
17149 (Output_section::has_out_shndx): New function.
17150 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17151 field.
17152 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17153 Change all callers.
17154 (Sized_symbol::init): Likewise.
17155 (Symbol::output_section): Check for ordinary symbol.
17156 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17157 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17158 callers.
17159 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17160 Change all callers. Simplify handling of symbols from sections
17161 not included in the link.
17162 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17163 distinction.
17164 (Weak_alias_sorter::operator()): Assert that symbols are
17165 ordinary.
17166 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17167 distinction.
17168 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17169 parameters. Change all callers.
17170 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17171 symbol distinction. Use SHN_XINDEX when needed.
17172 (Symbol_table::write_section_symbol): Add symtab_xindex
17173 parameter. Change all callers.
17174 (Symbol_table::sized_write_section_symbol): Likewise. Use
17175 SHN_XINDEX when needed.
17176 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17177 declarations.
17178 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17179 (Symbol::is_defined): Check is_ordinary.
17180 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17181 (Symbol::is_absolute, Symbol::is_common): Likewise.
17182 (class Sized_symbol): Update declarations.
17183 (class Symbol_table): Update declarations.
17184 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17185 parameters. Change all callers.
17186 (Sized_symbol::override): Likewise.
17187 (Symbol_table::override): Likewise.
17188 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17189 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17190 is_ordinary, and orig_st_shndx parameters. Change all callers.
17191 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17192 to be in an ordinary section.
17193 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17194 object and is_ordinary parameters. Change all callers.
17195 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17196 Change all callers. Don't add undefined or non-ordinary symbols
17197 to reloc_map_.
17198 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17199 Change all callers.
17200 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17201 declarations.
17202 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17203 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17204 (Sized_relobj::relocate_sections): Likewise.
17205 * target-reloc.h (scan_relocs): Adjust section symbol index.
17206 (scan_relocatable_relocs): Likewise.
17207 * i386.cc (Scan::local): Check for ordinary symbols.
17208 * sparc.cc (Scan::local): Likewise.
17209 * x86_64.cc (Scan::local): Likewise.
17210 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17211 to symbol_section_and_value.
17212 * testsuite/many_sections_test.cc: New file.
17213 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17214 (check_PROGRAMS): Add many_sections_test.
17215 (many_sections_test_SOURCES): Define.
17216 (many_sections_test_DEPENDENCIES): Define.
17217 (many_sections_test_LDFLAGS): Define.
17218 (BUILT_SOURCES): Add many_sections_define.h.
17219 (many_sections_define.h): New target.
17220 (BUILT_SOURCES): Add many_sections_check.h.
17221 (many_sections_check.h): New target.
17222 (check_PROGRAMS): Add many_sections_r_test.
17223 (many_sections_r_test_SOURCES): Define.
17224 (many_sections_r_test_DEPENDENCIES): Define.
17225 (many_sections_r_test_LDFLAGS): Define.
17226 (many_sections_r_test_LDADD): Define.
17227 (many_sections_r_test.o): New target.
17228 * testsuite/Makefile.in: Rebuild.
17229
17230 2008-04-17 Cary Coutant <ccoutant@google.com>
17231
17232 * errors.cc (Errors::info): New function.
17233 (gold_info): New function.
17234 * errors.h (Errors::info): New function.
17235 * gold.h (gold_info): New function.
17236 * object.cc (Input_objects::add_object): Print trace output.
17237 * options.cc (options::parse_set): New function.
17238 (General_options::parse_wrap): Deleted.
17239 (General_options::General_options): Deleted initializer.
17240 * options.h (options::String_set): New typedef.
17241 (options::parse_set): New function.
17242 (DEFINE_set): New macro.
17243 (General_options::wrap): Changed to use DEFINE_set. Changed
17244 callers of any_wrap_symbols and is_wrap_symbol.
17245 (General_options::trace, General_options::trace_symbol):
17246 New options.
17247 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17248 (General_options::wrap_symbols_): Deleted.
17249 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17250
17251 2008-04-17 David S. Miller <davem@davemloft.net>
17252
17253 * options.cc (General_options::parse_V): New function.
17254 * options.h: Add entries for -V and -Qy.
17255
17256 2008-04-17 Ian Lance Taylor <iant@google.com>
17257
17258 * common.cc (Symbol_table::allocate_commons): Remove options
17259 parameter. Change caller.
17260 (Symbol_table::do_allocate_commons): Remove options parameter.
17261 Change caller. Just call do_allocate_commons_list twice.
17262 (Symbol_table::do_allocate_commons_list): New function, broken out
17263 of do_allocate_commons.
17264 * common.h (class Allocate_commons_task): Remove options_ field.
17265 Update constructor.
17266 * symtab.cc (Symbol_table::Symbol_table): Initialize
17267 tls_commons_.
17268 (Symbol_table::add_from_object): Put TLS common symbols on
17269 tls_commons_ list.
17270 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17271 which are IN_OUTPUT_DATA.
17272 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17273 allocate_commons and do_allocate_commons declarations. Declare
17274 do_allocate_commons_list.
17275 * gold.cc (queue_middle_tasks): Update creation of
17276 Allocate_commons_task to not pass options.
17277 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17278 (TLS_TEST_C_FLAGS): New variable.
17279 (tls_test_c_pic.o): New target.
17280 (tls_test_shared.so): Link in tls_test_c_pic.o.
17281 (tls_test_c_pic_ie.o): New target.
17282 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17283 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17284 (tls_test_c.o): New target.
17285 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17286 (tls_pic_test_LDADD): Likewise.
17287 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17288 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17289 (tls_test_c_gnu2.o): New target.
17290 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17291 tls_test_c_gnu2.o.
17292 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17293 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17294 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17295 * testsuite/tls_test.cc: Include "config.h".
17296 (t_last): Call t11_last.
17297 * testsuite/tls_test.h (t11, t11_last): Declare.
17298 * testsuite/tls_test_c.c: New file.
17299 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17300 * configure.ac: Check for OpenMP support.
17301 * configure, config.in, Makefile.in: Rebuild.
17302 * testsuite/Makefile.in: Rebuild.
17303
17304 2008-04-16 Cary Coutant <ccoutant@google.com>
17305
17306 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17307 (Target_i386::tls_base_symbol_defined_): New field.
17308 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17309 (Target_i386::Scan::global): Likewise.
17310 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17311 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17312 (Target_x86_64::tls_base_symbol_defined_): New field.
17313 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17314 (Target_x86_64::Scan::global): Likewise.
17315
17316 2008-04-16 Cary Coutant <ccoutant@google.com>
17317
17318 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17319 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17320 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17321 building shared libraries.
17322 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17323 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17324 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17325 * testsuite/Makefile.in: Rebuild.
17326 * testsuite/weak_undef.h: New file.
17327 * testsuite/weak_undef_file1.cc: Add extra test cases.
17328 * testsuite/weak_undef_file2.cc: Likewise.
17329 * testsuite/weak_undef_test.cc: Likewise.
17330
17331 2008-04-16 David S. Miller <davem@davemloft.net>
17332
17333 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17334 Add issued_non_pic_error_ field. Declare check_non_pic.
17335 (Target_sparc::Scan::check_non_pic): New function.
17336 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17337 (Target_sparc::Scan::global): Likewise.
17338
17339 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17340 * configure: Rebuild.
17341
17342 * options.h (DEFINE_enable): New macro.
17343 (new_dtags): New enable option.
17344 (initfirst, interpose, loadfltr, nodefaultlib,
17345 nodelete, nodlopen, nodump): New -z options.
17346 * layout.cc (Layout:finish_dynamic_section): If new
17347 dtags enabled, emit DT_RUNPATH. Also, emit a
17348 DT_FLAGS_1 containing any specified -z flags.
17349
17350 2008-04-16 Ian Lance Taylor <iant@google.com>
17351
17352 * copy-relocs.cc: New file.
17353 * copy-relocs.h: New file.
17354 * reloc.cc: Remove Copy_relocs code.
17355 * reloc.h: Likewise.
17356 * reloc-types.h (struct Reloc_types) [both versions]: Add
17357 get_reloc_addend_noerror.
17358 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17359 variants of add_global which take an addend which must be zero.
17360 * i386.cc: Include "copy-relocs.h".
17361 (class Target_i386): Change type of copy_relocs_ to variable,
17362 update initializer.
17363 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17364 Change all callers.
17365 (Target_i386::do_finalize_sections): Change handling of
17366 copy_relocs_.
17367 * sparc.cc: Include "copy-relocs.h".
17368 (class Target_sparc): Change type of copy_relocs_ to variable,
17369 update initializer.
17370 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17371 Change all callers.
17372 (Target_sparc::do_finalize_sections): Change handling of
17373 copy_relocs_.
17374 * x86_64.cc: Include "copy-relocs.h".
17375 (class Target_x86_64): Change type of copy_relocs_ to variable,
17376 update initializer.
17377 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17378 class. Change all callers.
17379 (Target_x86_64::do_finalize_sections): Change handling of
17380 copy_relocs_.
17381 * Makefile.am (CCFILES): Add copy-relocs.cc.
17382 (HFILES): Add copy-relocs.h.
17383
17384 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17385
17386 * testsuite/script_test_4.sh: Permit leading zeroes.
17387
17388 2008-04-15 Ian Lance Taylor <iant@google.com>
17389
17390 * script-sections.cc (Script_sections::create_segments): Use
17391 header_size_adjustment even when there is enough room for the
17392 headers.
17393 * testsuite/script_test_4.sh: New file.
17394 * testsuite/script_test_4.t: New file.
17395 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17396 (check_DATA): Add script_test_4.stdout.
17397 (MOSTLYCLEANFILES): Likewise.
17398 (script_test_4): New target.
17399 (script_test_4.stdout): New target.
17400 * testsuite/Makefile.in: Rebuild.
17401
17402 * sparc.cc: Add definitions for Output_data_plt_sparc class
17403 constants.
17404
17405 2008-04-14 David S. Miller <davem@davemloft.net>
17406
17407 * sparc.cc: New file.
17408 * Makefile.am (TARGETSOURCES): Add sparc.cc
17409 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17410 * configure.tgt: Document targ_extra_size and
17411 targ_extra_big_endian. Add entries for sparc-* and
17412 sparc64-*.
17413 * configure.ac: Handle targ_extra_size and
17414 targ_extra_big_endian.
17415 * Makefile.in: Rebuild.
17416 * configure: Likewise.
17417 * po/POTFILES.in: Likewise.
17418 * po/gold.pot: Likewise.
17419
17420 2008-04-14 Ian Lance Taylor <iant@google.com>
17421
17422 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17423 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17424 in the name/type/flags to section mapping. Don't call
17425 allocate_output_section.
17426 (Layout::choose_output_section): Change parameter from adjust_name
17427 to is_input_section. Don't permit input sections after sections
17428 are attached to segments. Don't call allocate_output_section.
17429 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17430 not write_enable_output_section.
17431 (Layout::make_output_section): Don't push to
17432 unattached_section_list_ nor call attach_to_segment. Call
17433 attach_section_to_segment if sections are attached.
17434 (Layout::attach_sections_to_segments): New function.
17435 (Layout::attach_section_to_segment): New function.
17436 (Layout::attach_allocated_section_to_segment): Rename from
17437 attach_to_segment. Remove flags parameter.
17438 (Layout::allocate_output_section): Remove function.
17439 (Layout::write_enable_output_section): Remove function.
17440 * layout.h (class Layout): Update for above changes. Add new
17441 field sections_are_attached_.
17442 * output.h (Output_section::update_flags_for_input_section): New
17443 function.
17444 * output.cc (Output_section::add_input_section): Call
17445 update_flags_for_input_section.
17446 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17447
17448 2008-04-11 Cary Coutant <ccoutant@google.com>
17449
17450 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17451 thought unnecessary.
17452 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17453
17454 2008-04-11 Ian Lance Taylor <iant@google.com>
17455
17456 * output.h (class Output_section_data): Remove inline definition
17457 of set_addralign.
17458 * output.cc (Output_section_data::set_addralign): New function.
17459
17460 2008-04-11 Cary Coutant <ccoutant@google.com>
17461
17462 Add support for TLS descriptors for i386 and x86_64.
17463 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17464 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17465 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17466 GOT_TYPE_TLS_DESC.
17467 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17468 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17469 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17470 relocations.
17471 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17472 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17473 Fix problem with initial-exec relocations.
17474 (Target_i386::Relocate::relocate_tls): Likewise.
17475 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17476 relaxation.
17477 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17478 support for section-plus-offset dynamic table entries.
17479 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17480 (Output_data_dynamic::Dynamic_entry): Add support for
17481 section-plus-offset dynamic table entries.
17482 (Output_data_dynamic::Classification): Likewise.
17483 (Output_data_dynamic::classification_): Renamed offset_.
17484 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17485 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17486 (Target_x86_64::make_plt_section): New function.
17487 (Target_x86_64::reserve_tlsdesc_entries): New function.
17488 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17489 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17490 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17491 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17492 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17493 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17494 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17495 add extra PLT entry for TLS descriptors.
17496 (Output_data_plt_x86_64::got_): New field.
17497 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17498 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17499 fields.
17500 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17501 descriptors.
17502 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17503 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17504 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17505 R_386_TLS_DESC_CALL relocations.
17506 (Target_x86_64::Scan::global): Likewise.
17507 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17508 for TLS descriptors.
17509 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17510 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17511 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17512 GD-to-IE relaxation.
17513 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17514 and TLS_DESCRIPTORS.
17515 * Makefile.in: Rebuild.
17516 * configure: Rebuild.
17517 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17518 (tls_test_shared2.so): New target.
17519 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17520 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17521 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17522 (tls_shared_gd_to_ie_test_LDADD): New variable.
17523 (tls_shared_gnu2_gd_to_ie_test): New target.
17524 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17525 New targets.
17526 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17527 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17528 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17529 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17530 (tls_shared_gnu2_test): New target.
17531 (tls_test_gnu2_shared.so): New target.
17532 (tls_shared_gnu2_test_SOURCES): New variable.
17533 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17534 (tls_shared_gnu2_test_LDFLAGS): New variable.
17535 (tls_shared_gnu2_test_LDADD): New variable.
17536 * testsuite/Makefile.in: Rebuild.
17537 * testsuite/Makefile.
17538
17539 2008-04-11 Ian Lance Taylor <iant@google.com>
17540
17541 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17542 justsyms.t.
17543 * testsuite/Makefile.in: Rebuild.
17544
17545 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17546 long.
17547 * testsuite/script_test_2.cc (main): Adjust test.
17548
17549 2008-04-11 David S. Miller <davem@davemloft.net>
17550 Ian Lance Taylor <iant@google.com>
17551
17552 * options.h (General_options): Add entries for '-Y' and
17553 '-relax'.
17554 * options.cc (General_options:finalize): If -Y was used, add those
17555 entries to the library path instead of the default "/lib" and
17556 "/usr/lib".
17557
17558 2008-04-11 David S. Miller <davem@davemloft.net>
17559
17560 * testsuite/justsyms.t: Start at 0x100.
17561 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17562 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17563 long.
17564 * testsuite/script_test_2.cc: Adjust string and section length
17565 checks.
17566
17567 2008-04-09 Ian Lance Taylor <iant@google.com>
17568
17569 PR gold/5996
17570 * script-sections.cc (Sections_element::allocate_to_segment): Add
17571 orphan parameter.
17572 (Output_section_definition::allocate_to_segment): Likewise.
17573 (Orphan_output_section::allocate_to_segment): Likewise.
17574 (Script_sections::attach_sections_using_phdrs_clause): Don't
17575 propagate non-PT_LOAD segments to orphan sections.
17576 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17577 readelf rather than objdump.
17578 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17579 .interp section and PT_INTERP segment are the same size.
17580 * testsuite/Makefile.in: Rebuild.
17581
17582 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17583 aliases for symbols defined in the same object.
17584 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17585 (weak_alias_test_SOURCES): New variable.
17586 (weak_alias_test_DEPENDENCIES): New variable.
17587 (weak_alias_test_LDFLAGS): New variable.
17588 (weak_alias_test_LDADD): New variable.
17589 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17590 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17591 (weak_alias_test_3.o): New target.
17592 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17593 * testsuite/weak_alias_test_main.cc: New file.
17594 * testsuite/weak_alias_test_1.cc: New file.
17595 * testsuite/weak_alias_test_2.cc: New file.
17596 * testsuite/weak_alias_test_3.cc: New file.
17597
17598 2008-04-08 Ian Lance Taylor <iant@google.com>
17599
17600 * options.h (class General_options): Add --noinhibit-exec option.
17601 * main.cc (main): Check --noinhibit-exec.
17602
17603 * options.h (class General_options): Define --wrap as a special
17604 option. Add wrap_symbols_ field.
17605 (General_options::any_wrap_symbols): New function.
17606 (General_options::is_wrap_symbol): New function.
17607 * options.cc (General_options::parse_wrap): New function.
17608 (General_options::General_options): Initialize wrap_symbols_.
17609 * symtab.cc (Symbol_table::wrap_symbol): New function.
17610 (Symbol_table::add_from_object): Handle --wrap.
17611 * symtab.h (class Symbol_table): Declare wrap_symbol.
17612 * target.h (Target::wrap_char): New function.
17613 (Target::Target_info): Add wrap_char field.
17614 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17615 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17616 * testsuite/testfile.cc (Target_test::test_target_info):
17617 Likewise.
17618
17619 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17620 there is one.
17621
17622 * layout.h (class Layout): Add added_eh_frame_data_ field.
17623 * layout.cc (Layout::Layout): Initialize new field.
17624 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17625 output section until we find a section we merged successfully.
17626 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17627 that the size be non-zero.
17628
17629 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17630 qualifier.
17631
17632 2008-04-08 Craig Silverstein <csilvers@google.com>
17633
17634 * configure.ac: Export new conditional variable HAVE_ZLIB.
17635 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17636 on HAVE_ZLIB.
17637 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17638 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17639
17640 2008-04-07 Ian Lance Taylor <iant@google.com>
17641
17642 * version.cc (version_string): Set to "1.5".
17643
17644 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17645 Add issued_non_pic_error_ field. Declare check_non_pic.
17646 (Target_x86_64::Scan::check_non_pic): New function.
17647 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17648 (Target_x86_64::Scan::global): Likewise.
17649
17650 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17651 addend parameter. Change caller. Handle merge sections.
17652 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17653 Address to Addend. Don't add in the result of
17654 local_section_offset, pass down the addend and use the returned
17655 value.
17656 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17657 Update declarations of local_section_offset and symbol_value.
17658 * testsuite/two_file_test_1.cc (t18): New function.
17659 * testsuite/two_file_test_2.cc (f18): New function.
17660 * testsuite/two_file_test_main.cc (main): Call t18.
17661 * testsuite/two_file_test.h (t18, f18): Declare.
17662
17663 * configure.ac: Don't test for objdump, c++filt, or readelf.
17664 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17665 conditionals.
17666 (TEST_READELF): New variable.
17667 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17668 (check_PROGRAMS): Add two_file_strip_test.
17669 (two_file_strip_test): New target.
17670 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17671 (two_file_same_shared_strip_test_SOURCES): New variable.
17672 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17673 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17674 (two_file_same_shared_strip_test_LDADD): New variable.
17675 (two_file_shared_strip.so): New target.
17676 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17677 (ver_test_5.syms, ver_test_7.syms): Likewise.
17678 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17679 (strip_test_3.stdout): Use TEST_OBJDUMP.
17680 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17681
17682 2008-04-04 Cary Coutant <ccoutant@google.com>
17683
17684 * symtab.h (Symbol::is_weak_undefined): New function.
17685 (Symbol::is_strong_undefined): New function.
17686 (Symbol::is_absolute): New function.
17687 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17688 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17689 absolute symbols.
17690 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17691 (weak_undef_test): New target.
17692 * testsuite/Makefile.in: Rebuild.
17693 * testsuite/weak_undef_file1.cc: New file.
17694 * testsuite/weak_undef_file2.cc: New file.
17695 * testsuite/weak_undef_test.cc: New file.
17696
17697 2008-04-03 Craig Silverstein <csilvers@google.com>
17698
17699 * compressed_output.h (class Output_compressed_section): Use
17700 unsigned buffer.
17701 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17702 add zlib header.
17703 (zlib_compressed_suffix): Removed.
17704 (Output_compressed_section::set_final_data_size): Use unsigned
17705 buffers.
17706 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17707 Fix linker invocation.
17708 (flagstest_o_specialfile_and_compress_debug_sections):
17709 Likewise.
17710 * testsuite/Makefile.in: Regenerated.
17711
17712 2008-04-02 David S. Miller <davem@davemloft.net>
17713
17714 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17715 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17716
17717 2008-04-02 Craig Silverstein <csilvers@google.com>
17718
17719 * TODO: New file.
17720
17721 2008-04-02 Ian Lance Taylor <iant@google.com>
17722
17723 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17724 parameters. Update for new key type to views_. Change all
17725 callers.
17726 (File_read::read): Adjust for byteshift in returned view.
17727 (File_read::add_view): New function, broken out of
17728 find_and_make_view.
17729 (File_read::make_view): New function, broken out of
17730 find_and_make_view.
17731 (File_read::find_or_make_view): Add offset and aligned
17732 parameters. Rewrite accordingly. Change all callers.
17733 (File_read::get_view): Add offset and aligned parameters. Adjust
17734 for byteshift in return value.
17735 (File_read::get_lasting_view): Likewise.
17736 * fileread.h (class File_read): Update declarations.
17737 (class File_read::View): Add byteshift_ field. Add byteshift to
17738 constructor. Add byteshift method.
17739 * archive.h (Archive::clear_uncached_views): New function.
17740 (Archive::get_view): Add aligned parameter. Change all callers.
17741 * object.h (Object::get_view): Add aligned parameter. Change all
17742 callers.
17743 (Object::get_lasting_view): Likewise.
17744
17745 * fileread.cc (File_read::release): Don't call clear_views if
17746 there are multiple objects.
17747 * fileread.h (File_read::clear_uncached_views): New function.
17748 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17749 on the archive.
17750
17751 2008-03-31 Cary Coutant <ccoutant@google.com>
17752
17753 Add thin archive support.
17754 * archive.cc (Archive::armagt): New const.
17755 (Archive::setup): Remove task parameter and calls to unlock.
17756 (Archive::unlock_nested_archives): New function.
17757 (Archive::read_header): Add nested_off parameter. Change
17758 all callers.
17759 (Archive::interpret_header): Likewise.
17760 (Archive::include_all_members): Change to handle thin
17761 archives.
17762 (Archive::include_member): Likewise.
17763 * archive.h (Archive::Archive): Add new parameters and
17764 initializers.
17765 (Archive::armagt): New const.
17766 (Archive::setup): Remove task parameter.
17767 (Archive::unlock_nested_archives): New function.
17768 (Archive::read_header): Add nested_off parameter.
17769 (Archive::interpret_header): Likewise.
17770 (Archive::Nested_archive_table): New typedef.
17771 (Archive::is_thin_archive_): New field.
17772 (Archive::nested_archives_): New field.
17773 (Archive::options_): New field.
17774 (Archive::dirpath_): New field.
17775 (Archive::task_): New field.
17776 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17777 for thin archives. Pass additional parameters to
17778 Archive::Archive. Unlock the archive file after calling
17779 Archive::setup.
17780
17781 2008-03-29 Ian Lance Taylor <iant@google.com>
17782
17783 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17784 version symbol to be local.
17785 * testsuite/ver_test_4.sh: New file.
17786 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17787 (check_DATA): Add ver_test_4.syms.
17788 (ver_test_4.syms): New target.
17789 * testsuite/Makefile.in: Rebuild.
17790
17791 * output.cc
17792 (Output_section::Input_section_sort_entry::has_priority): New
17793 function.
17794 (Output_section::Input_section_sort_entry::match_file_name): New
17795 function.
17796 (Output_section::Input_section_sort_entry::match_section_name):
17797 Remove.
17798 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17799 Remove.
17800 (Output_section::Input_section_sort_entry::match_section_file):
17801 Remove.
17802 (Output_section::Input_section_sort_compare::operator()): Rewrite
17803 using new Input_section_sort_entry functions. Sort crtbegin and
17804 crtend first. Sort sections with no priority before sections with
17805 a priority.
17806 * testsuite/initpri1.c (d3): Check j != 4.
17807 (cd5): New constructor/destructor function.
17808 (main): Check j != 2.
17809
17810 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17811 new symbol when resolving, don't call set_is_default.
17812 * testsuite/ver_test_7.cc: New file.
17813 * testsuite/ver_test_7.sh: New file.
17814 * testsuite/Makefile.am (ver_test_7.so): New target.
17815 (ver_test_7.o): New target.
17816 (check_SCRIPTS): Add ver_test_7.sh.
17817 (check_DATA): Add ver_test_7.syms.
17818 (ver_test_7.syms): New target.
17819
17820 2008-03-28 Ian Lance Taylor <iant@google.com>
17821
17822 * layout.cc (Layout::layout): If we see an input section with a
17823 name that needs sorting, set the must_sort flag for the output
17824 section.
17825 (Layout::make_output_section): If the name of the output section
17826 indicates that it might require sorting, set the may_sort flag.
17827 * output.h (Output_section::may_sort_attached_input_sections): New
17828 function.
17829 (Output_section::set_may_sort_attached_input_sections): New
17830 function.
17831 (Output_section::must_sort_attached_input_sections): New
17832 function.
17833 (Output_section::set_must_sort_attached_input_sections): New
17834 function.
17835 (class Output_section): Declare Input_section_sort_entry. Define
17836 Input_section_sort_compare. Declare
17837 sort_attached_input_sections. Add new fields:
17838 may_sort_attached_input_sections_,
17839 must_sort_attached_input_sections_,
17840 attached_input_sections_are_sorted_.
17841 * output.cc (Output_section::Output_section): Initialize new
17842 fields.
17843 (Output_section::add_input_section): Add an entry to
17844 input_sections_ if may_sort or must_sort are true.
17845 (Output_section::set_final_data_size): Call
17846 sort_attached_input_sections if necessary.
17847 (Output_section::Input_section_sort_entry): Define new class.
17848 (Output_section::Input_section_sort_compare::operator()): New
17849 function.
17850 (Output_section::sort_attached_input_sections): New function.
17851 * configure.ac: Check whether the compiler supports constructor
17852 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17853 * testsuite/initpri1.c: New file.
17854 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17855 CONSTRUCTOR_PRIORITY.
17856 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17857 (initpri1_LDFLAGS): New variable.
17858 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17859
17860 2008-03-27 Ian Lance Taylor <iant@google.com>
17861
17862 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17863 * testsuite/common_test_1.c: New file.
17864 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17865 (common_test_1_SOURCES): New variable.
17866 (common_test_1_DEPENDENCIES): New variable.
17867 (common_test_1_LDFLAGS): New variable.
17868
17869 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17870 and commons_ correctly when NAME/VERSION does not override
17871 NAME/NULL.
17872 * testsuite/ver_test_6.c: New file.
17873 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17874 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17875 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17876
17877 2008-03-26 Ian Lance Taylor <iant@google.com>
17878
17879 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17880 of an undefined symbol from a version script.
17881 * testsuite/Makefile.am (ver_test_5.so): New target.
17882 (ver_test_5.o): New target.
17883 (check_SCRIPTS): Add ver_test_5.sh.
17884 (check_DATA): Add ver_test_5.syms.
17885 (ver_test_5.syms): New target.
17886 * testsuite/ver_test_5.cc: New file.
17887 * testsuite/ver_test_5.script: New file.
17888 * testsuite/ver_test_5.sh: New file.
17889 * Makefile.in, testsuite/Makefile.in: Rebuild.
17890
17891 PR gold/5986
17892 Fix problems building gold with gcc 4.3.0.
17893 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17894 (gold_error_at_location, gold_warning_at_location): Use it.
17895 * configure.ac: Check whether we can compile and use a template
17896 function with a printf attribute.
17897 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17898 when jumping over bytes.
17899 * object.cc: Instantiate Object::read_section_data.
17900 * debug.h: Include <cstring>
17901 * dwarf_reader.cc: Include <algorithm>
17902 * main.cc: Include <cstring>.
17903 * options.cc: Include <cstring>.
17904 * output.cc: Include <cstring>.
17905 * script.cc: Include <cstring>.
17906 * script.h: Include <string>.
17907 * symtab.cc: Include <cstring> and <algorithm>.
17908 * target-select.cc: Include <cstring>.
17909 * version.cc: Include <string>.
17910 * testsuite/testmain.cc: Include <cstdlib>.
17911 * configure, config.in: Rebuild.
17912
17913 2008-03-25 Ian Lance Taylor <iant@google.com>
17914
17915 * options.cc: Include "../bfd/bfdver.h".
17916 (options::help): Print bug reporting address.
17917
17918 * version.cc (print_version): Adjust output for current value of
17919 BFD_VERSION_STRING.
17920
17921 * NEWS: New file.
17922
17923 * options.cc (options::help): Print list of supported targets.
17924 * target-select.h: Include <vector>.
17925 (class Target_selector): Make machine_, size_, and is_big_endian_
17926 fields const. Add bfd_name_ and instantiated_target_ fields.
17927 (Target_selector::Target_selector): Add bfd_name parameter.
17928 (Target_selector::recognize): Make non-virtual, call
17929 do_recognize.
17930 (Target_selector::recognize_by_name): Make non-virtual, call
17931 do_recognize_by_name.
17932 (Target_selector::supported_names): New function.
17933 (Target_selector::bfd_name): New function.
17934 (Target_selector::do_instantiate_target): New pure virtual
17935 function.
17936 (Target_selector::do_recognize): New virtual function.
17937 (Target_selector::do_recognize_by_name): New virtual function.
17938 (Target_selector::instantiate_target): New private function.
17939 (supported_target_names): Declare.
17940 * target-select.cc (Target_selector::Target_selector): Update for
17941 new parameter and fields.
17942 (select_target_by_name): Check that the name matches before
17943 calling recognize_by_name.
17944 (supported_target_names): New function.
17945 * i386.cc (class Target_selector_i386): Update Target_selector
17946 constructor call. Remove recognize and recognize_by_name. Add
17947 do_instantiate_target.
17948 * x86_64.cc (class Target_selector_x86_64): Likewise.
17949 * testsuite/testfile.cc (class Target_selector_test): Update for
17950 changes to Target_selector.
17951
17952 * README: Rewrite, with some notes on unsupported features.
17953
17954 2008-03-24 Cary Coutant <ccoutant@google.com>
17955
17956 * i386.cc (Target_i386::Got_type): New enum declaration.
17957 (Target_i386::Scan::local): Updated callers of Output_data_got
17958 member functions.
17959 (Target_i386::Scan::global): Likewise.
17960 (Target_i386::Relocate::relocate): Likewise.
17961 (Target_i386::Relocate::relocate_tls): Likewise.
17962 * object.h (Got_offset_list): New class.
17963 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17964 (Sized_relobj::local_got_offset): Likewise.
17965 (Sized_relobj::set_local_got_offset): Likewise.
17966 (Sized_relobj::local_has_tls_got_offset): Removed.
17967 (Sized_relobj::local_tls_got_offset): Removed.
17968 (Sized_relobj::set_local_tls_got_offset): Removed.
17969 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17970 * output.cc (Output_data_got::add_global): Added got_type parameter.
17971 (Output_data_got::add_global_with_rel): Likewise.
17972 (Output_data_got::add_global_with_rela): Likewise.
17973 (Output_data_got::add_global_pair_with_rel): New function.
17974 (Output_data_got::add_global_pair_with_rela): New function.
17975 (Output_data_got::add_local): Added got_type parameter.
17976 (Output_data_got::add_local_with_rel): Likewise.
17977 (Output_data_got::add_local_with_rela): Likewise.
17978 (Output_data_got::add_local_pair_with_rel): New function.
17979 (Output_data_got::add_local_pair_with_rela): New function.
17980 (Output_data_got::add_global_tls): Removed.
17981 (Output_data_got::add_global_tls_with_rel): Removed.
17982 (Output_data_got::add_global_tls_with_rela): Removed.
17983 (Output_data_got::add_local_tls): Removed.
17984 (Output_data_got::add_local_tls_with_rel): Removed.
17985 (Output_data_got::add_local_tls_with_rela): Removed.
17986 * output.h (Output_data_got::add_global): Added got_type parameter.
17987 (Output_data_got::add_global_with_rel): Likewise.
17988 (Output_data_got::add_global_with_rela): Likewise.
17989 (Output_data_got::add_global_pair_with_rel): New function.
17990 (Output_data_got::add_global_pair_with_rela): New function.
17991 (Output_data_got::add_local): Added got_type parameter.
17992 (Output_data_got::add_local_with_rel): Likewise.
17993 (Output_data_got::add_local_with_rela): Likewise.
17994 (Output_data_got::add_local_pair_with_rel): New function.
17995 (Output_data_got::add_local_pair_with_rela): New function.
17996 (Output_data_got::add_global_tls): Removed.
17997 (Output_data_got::add_global_tls_with_rel): Removed.
17998 (Output_data_got::add_global_tls_with_rela): Removed.
17999 (Output_data_got::add_local_tls): Removed.
18000 (Output_data_got::add_local_tls_with_rel): Removed.
18001 (Output_data_got::add_local_tls_with_rela): Removed.
18002 * resolve.cc (Symbol::override_base_with_special): Removed
18003 reference to has_got_offset_ field.
18004 * symtab.cc (Symbol::init_fields): Replaced initialization
18005 of got_offset_ with got_offsets_. Removed initialization
18006 of has_got_offset_
18007 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
18008 (Symbol::got_offset): Likewise.
18009 (Symbol::set_got_offset): Likewise.
18010 (Symbol::has_tls_got_offset): Removed.
18011 (Symbol::tls_got_offset): Removed.
18012 (Symbol::set_tls_got_offset): Removed.
18013 (Symbol::got_offset_): Removed.
18014 (Symbol::tls_mod_got_offset_): Removed.
18015 (Symbol::tls_pair_got_offset_): Removed.
18016 (Symbol::got_offsets_): New field.
18017 (Symbol::has_got_offset): Removed.
18018 (Symbol::has_tls_mod_got_offset): Removed.
18019 (Symbol::has_tls_pair_got_offset): Removed.
18020 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
18021 (Target_x86_64::Scan::local): Updated callers of Output_data_got
18022 member functions.
18023 (Target_x86_64::Scan::global): Likewise.
18024 (Target_x86_64::Relocate::relocate): Likewise.
18025 (Target_x86_64::Relocate::relocate_tls): Likewise.
18026
18027 2008-03-25 Ben Elliston <bje@au.ibm.com>
18028
18029 * yyscript.y: Fix spelling error in comment.
18030
18031 2008-03-24 Ian Lance Taylor <iant@google.com>
18032
18033 * options.h (class General_options): Define build_id option.
18034 * layout.h (class Layout): Declare write_build_id, create_note,
18035 create_build_id. Add build_id_note_ member.
18036 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
18037 "libiberty.h", "md5.h", "sha1.h".
18038 (Layout::Layout): Initialize eh_frame_data_,
18039 eh_frame_hdr_section_, and build_id_note_.
18040 (Layout::finalize): Call create_build_id.
18041 (Layout::create_note): New function, broken out of
18042 Layout::create_gold_note.
18043 (Layout::create_gold_note): Call create_note.
18044 (Layout::create_build_id): New function.
18045 (Layout::write_build_id): New function.
18046 (Close_task_runner::run): Call write_build_id.
18047
18048 * x86_64.cc: Correct license to GPLv3.
18049
18050 2008-03-23 Ian Lance Taylor <iant@google.com>
18051
18052 * options.cc: Include "demangle.h".
18053 (parse_optional_string): New function.
18054 (parse_long_option): Handle takes_optional_argument.
18055 (parse_short_option): Update dash_z initializer. Handle
18056 takes_optional_argument.
18057 (General_options::General_options): Initialize do_demangle_.
18058 (General_options::finalize): Set do_demangle_. Handle demangling
18059 style.
18060 * options.h (parse_optional_string): Declare.
18061 (struct One_option): Add optional_arg field. Update constructor.
18062 Update call constructor calls. Add takes_optional_argument
18063 function.
18064 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18065 (DEFINE_optional_string): Define.
18066 (General_options::demangle): Change from DEFINE_bool to
18067 DEFINE_optional_string.
18068 (General_options::no_demangle): New function.
18069 (General_options::do_demangle): New function.
18070 (General_options::set_do_demangle): New function.
18071 (General_options::execstack_status_): Move definition to end of
18072 class definition.
18073 (General_options::static_): Likewise.
18074 (General_options::do_demangle_): New field.
18075 * object.cc (big_endian>::get_symbol_location_info): Call
18076 Options::do_demangle, not Options::demangle.
18077 * symtab.cc (demangle): Likewise.
18078
18079 2008-03-22 Ian Lance Taylor <iant@google.com>
18080
18081 * gold.h: Include <cstddef> and <sys/types.h>
18082 * options.h: Include <cstring>.
18083
18084 2008-03-21 Ian Lance Taylor <iant@google.com>
18085
18086 * Added source code to GNU binutils.
18087 \f
18088 Copyright (C) 2008-2015 Free Software Foundation, Inc.
18089
18090 Copying and distribution of this file, with or without modification,
18091 are permitted in any medium without royalty provided the copyright
18092 notice and this notice are preserved.
18093
18094 Local Variables:
18095 mode: change-log
18096 left-margin: 8
18097 fill-column: 74
18098 version-control: never
18099 End:
This page took 0.41909 seconds and 5 git commands to generate.