07589c9767fac33aa44fe42e3312f0c9153e9815
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-12-17 Peter Collingbourne <pcc@google.com>
2
3 PR gold/18780
4 * arm.cc (Target_arm::do_make_data_plt): Choose PLT generator based
5 on value of --long-plt flag.
6 (Output_data_plt_arm_standard::do_get_plt_entry_size): Moved to
7 Output_data_plt_arm_short.
8 (Output_data_plt_arm_standard::do_fill_plt_entry): Likewise.
9 (Output_data_plt_arm_standard::plt_entry): Likewise.
10 (Output_data_plt_arm_standard::do_fill_first_plt_entry): Fix
11 variable reference.
12 (Output_data_plt_arm_short): New class.
13 (Output_data_plt_arm_short::do_fill_plt_entry): Error out on too large
14 PLT offsets instead of asserting.
15 (Output_data_plt_arm_long): New class.
16 * options.h (General_options): Define --long-plt flag.
17
18 2015-12-16 Roland McGrath <mcgrathr@google.com>
19
20 PR ld/17473
21 * binary.cc: Move #include "safe-ctype.h" to be last #include.
22
23 2015-12-13 Cary Coutant <ccoutant@gmail.com>
24
25 * object.h (Object::get_output_view): remove const from return type.
26 (Object::do_get_output_view): Likewise.
27 (Sized_relobj_file::do_get_output_view): Likewise.
28 * reloc.cc (Sized_relobj_file::do_get_output_view): Likewise.
29
30 2015-12-11 Cary Coutant <ccoutant@gmail.com>
31
32 * target.h (Target::calls_non_split): Add prelocs, reloc_count
33 parameters.
34 (Target::do_calls_non_split): Likewise.
35 * target.cc (Target::do_calls_non_split): Likewise.
36 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Adjust
37 call to Target::calls_non_split.
38 * i386.cc (Target_i386::do_calls_non_split): Add prelocs, reloc_count
39 parameters.
40 * powerpc.cc (Target_powerpc::do_calls_non_split): Likewise.
41 * x86_64.cc (Target_x86_64::do_calls_non_split): Likewise.
42
43 2015-12-11 Cary Coutant <ccoutant@gmail.com>
44
45 * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize
46 output_views_.
47 * object.h (Object::get_output_view): New function.
48 (Object::do_get_output_view): New function.
49 (Sized_relobj_file::do_get_output_view): New function.
50 (Sized_relobj_file::output_views_): New data member.
51 * reloc.cc: (Sized_relobj_file::do_relocate): Store pointer to
52 output views in class object.
53 (Sized_relobj_file::do_get_output_view): New function.
54
55 2015-12-10 H.J. Lu <hongjiu.lu@intel.com>
56
57 PR ld/19317
58 * symtab.cc (Symbol_table::add_from_relobj): Don't complain
59 plugin needed to handle slim lto object for relocatable link.
60
61 2015-12-09 Alan Modra <amodra@gmail.com>
62
63 * powerpc.cc (Target_powerpc::Relocate::relocate): New constant
64 d_offset. Use throughout.
65 (Target_powerpc::relocate_relocs): Likewise.
66
67 2015-12-09 Alan Modra <amodra@gmail.com>
68
69 * powerpc.cc (Target_powerpc::Relocate::relocate): Edit ELFv2
70 entry code.
71 (Target_powerpc::relocate_relocs): Edit relocs to suit.
72
73 2015-12-09 Alan Modra <amodra@gmail.com>
74
75 * object.h (struct Relocate_info): Add "rr".
76 * reloc.h (Relocatable_relocs::set_strategy): New accessor.
77 * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
78 relinfo.rr for relocate_section and relocate_relocs.
79 * powerpc.cc (relocate): Add rel_type and preloc parameters.
80 Delete rela and r_type params, instead recalculate these from
81 preloc.
82 (relocate_relocs): Delete Relocatable_relocs* param, instead
83 use relinfo->rr.
84 * aarch64.cc: Likewise.
85 * arm.cc: Likewise.
86 * i386.cc: Likewise.
87 * mips.cc: Likewise.
88 * s390.cc: Likewise.
89 * sparc.cc: Likewise.
90 * target.h: Likewise.
91 * tilegx.cc: Likewise.
92 * x86_64.cc: Likewise.
93 * testsuite/testfile.cc: Likewise.
94 * target-reloc.h (relocate_section): Adjust to suit.
95 (apply_relocation, relocate_relocs): Likewise.
96
97 2015-12-07 Alan Modra <amodra@gmail.com>
98
99 * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
100 (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
101 (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
102
103 2015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
104
105 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
106 Local_got_entry_key for searching in local_got_offsets_.
107 * object.h (class Local_got_entry_key): New class.
108 (Relobj::local_has_got_offset): New overloaded method.
109 (Relobj::local_got_offset): Likewise.
110 (Relobj::set_local_got_offset): Likewise.
111 (Relobj::do_local_has_got_offset): Add addend argument.
112 (Relobj::do_local_got_offset): Likewise.
113 (Relobj::do_set_local_got_offset): Likewise.
114 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
115 Local_got_entry_key for searching through local_got_offsets_.
116 (Sized_relobj::do_local_got_offset): Likewise.
117 (Sized_relobj::do_set_local_got_offset): Likewise.
118 (Sized_relobj::Local_got_offsets): Change type of the key from
119 unsigned int to Local_got_entry_key, and add hash and equal_to.
120 * output.cc (Got_entry::write): Take addend into account for
121 calculating value of the local symbol for GOT.
122 (Output_data_got::add_local): New definition of overloaded method.
123 (Output_data_got::add_local_with_rel): Likewise.
124 (Output_data_got::add_local_pair_with_rel): Likewise.
125 * output.h (Output_data_got::add_local): New declaration of overloaded
126 method.
127
128 2015-11-25 Cary Coutant <ccoutant@gmail.com>
129
130 PR gold/19291
131 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
132 subtract section address from symbol value.
133
134 2015-11-25 Alan Modra <amodra@gmail.com>
135
136 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
137 to 256 byte boundary.
138
139 2015-11-19 Alan Modra <amodra@gmail.com>
140
141 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
142 GOT16 and TOC16 relocs to RELATIVE_REF.
143
144 2015-11-14 Cary Coutant <ccoutant@gmail.com>
145
146 PR gold/19244
147 PR gold/18548
148 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
149 local symbols only for predefined symbols.
150
151 2015-11-11 Alan Modra <amodra@gmail.com>
152 Peter Bergner <bergner@vnet.ibm.com>
153
154 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
155 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
156 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
157 (Target_powerpc::Scan::global): Likewise.
158 (Target_powerpc::Relocate::relocate): Likewise.
159
160 2015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
161
162 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
163 sections.
164
165 2015-11-09 Cary Coutant <ccoutant@gmail.com>
166 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
167
168 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
169 with type, offset, addend.
170 (Copy_relocs::save): Likewise.
171 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
172 (Copy_relocs::save): Likewise.
173 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
174 and r_addend to Copy_relocs::copy_reloc.
175 * arm.cc (Target_arm::copy_reloc): Likewise.
176 * i386.cc (Target_i386::copy_reloc): Likewise.
177 * mips.cc (Target_mips::copy_reloc): Likewise.
178 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
179 * s390.cc (Target_s390::copy_reloc): Likewise.
180 * sparc.cc (Target_sparc::copy_reloc): Likewise.
181 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
182 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
183
184 2015-11-05 Cary Coutant <ccoutant@gmail.com>
185
186 PR gold/19119
187 PR gold/19172
188 PR gold/19197
189 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
190 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
191 * options.h (General_options): Remove "obsolete" from -m.
192 * parameters.cc (set_parameters_target): Check if input target
193 is compatible with output emulation set by "-m emulation".
194
195 2015-11-05 Cary Coutant <ccoutant@gmail.com>
196
197 PR gold/19163
198 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
199 certain relocations if --no-apply-dynamic-relocs is set.
200 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
201
202 2015-11-03 Alan Modra <amodra@gmail.com>
203
204 * po/POTFILES.in: Regenerate.
205
206 2015-10-30 Nick Clifton <nickc@redhat.com>
207
208 * po/zh_CN.po: New (simplified) Chinese translation.
209
210 2015-10-29 H.J. Lu <hongjiu.lu@intel.com>
211
212 PR gold/19184
213 * incremental.cc (Got_plt_view_info): Add got_entry_size.
214 (Local_got_offset_visitor::visit): Replace got_entry_size_
215 with info_.got_entry_size.
216 (Local_got_offset_visitor::got_entry_size_): Removed.
217 (Global_got_offset_visitor::visit): Replace got_entry_size_
218 with info_.got_entry_size.
219 (Global_got_offset_visitor::got_entry_size_): Removed.
220 (Output_section_incremental_inputs::write_got_plt): Initialize
221 view_info.got_entry_size.
222 * target.h (Sized_target::got_entry_size): New virtual function.
223 * x86_64.cc (Target_x86_64::got_entry_size): New function.
224
225 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
226
227 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
228 * testsuite/script_test_12a.c: Likewise.
229 * testsuite/script_test_1a.cc: Likewise.
230 * testsuite/script_test_2.cc: Likewise.
231
232 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
233
234 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
235
236 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
237
238 PR gold/18959
239 * stringpool.cc (Stringpool_template::new_key_offset): Align all
240 strings, even zero-length.
241 (Stringpool_template::set_string_offsets): Likewise.
242
243 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
244
245 * s390.cc: New file.
246 * Makefile.am (TARGETSOURCES): Add s390.cc.
247 (ALL_TARGETOBJS): Add s390.o.
248 * Makefile.in: Regenerate.
249 * configure.ac: Add s390 support.
250 * configure: Regenerate.
251 * configure.tgt: Add s390-*-* and s390x-*-*.
252 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
253 support.
254
255 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
256
257 * archive.cc (Archive::sym64name): New const.
258 (Archive::setup): Add support for SYM64 armap.
259 (Archive::read_armap): Likewise.
260 (Archive::interpret_header): Likewise.
261 (Archive::const_iterator::read_next_header): Likewise.
262 * archive.h (Archive::sym64name): New const.
263 (Archive::read_armap): Add mapsize template parameter.
264
265 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
266
267 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
268 target-specific entry size.
269 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
270 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
271 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
272 hash_entry_size.
273 * target.h (Target::hash_entry_size): New method.
274 (Target::Target_info::hash_entry_size): New data member.
275
276 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
277 * arm.cc (Target_arm::arm_info): Likewise.
278 (Target_arm_nacl::arm_nacl_info): Likewise.
279 * i386.cc (Target_i386::i386_info): Likewise.
280 (Target_i386_nacl::i386_nacl_info): Likewise.
281 (Target_iamcu::iamcu_info): Likewise.
282 * mips.cc (Target_mips::mips_info): Likewise.
283 (Target_mips_nacl::mips_nacl_info): Likewise.
284 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
285 * sparc.cc (Target_sparc::sparc_info): Likewise.
286 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
287 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
288 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
289 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
290
291 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
292
293 PR gold/19177
294 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
295 and R_386_GOT32X relocations without base register.
296
297 2015-10.27 Han Shen <shenhan@google.com>
298
299 PR gold/19042 - unsupported reloc 311/312.
300
301 * aarch64.cc (Target_aarch64::Scan::local): Add support for
302 reloc 311/312.
303
304 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
305
306 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
307 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
308 as R_X86_64_GOTPCREL.
309 (Target_x86_64<size>::Scan::local): Likewise.
310 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
311 Likewise.
312 (Target_x86_64<size>::Scan::global): Likewise.
313 (Target_x86_64<size>::Relocate::relocate): Likewise.
314 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
315 Likewise.
316
317 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
318
319 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
320 R_386_GOT32X the same as R_386_GOT32.
321 (Target_i386::Scan::local): Likewise.
322 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
323 (Target_i386::Scan::global): Likewise.
324 (Target_i386::Relocate::relocate): Likewise.
325 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
326 Likewise.
327
328 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
329
330 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
331 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
332 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
333 x86_64_mov_to_lea1.o.
334 * testsuite/Makefile.in: Regenerated.
335
336 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
337
338 PR gold/19119
339 * options.h (General_options): Remove "obsolete" from -m.
340 * parameters.cc (set_parameters_target): Check if input target
341 is compatible with output emulation set by "-m emulation".
342
343 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
344
345 PR gold/19118
346 * i386.cc (Target_iamcu): New class.
347 (Target_selector_iamcu): Likewise.
348 (Target_iamcu::iamcu_info): New variable.
349 (target_selector_iamcu): Likewise.
350
351 2015-10-07 Andreas Schwab <schwab@suse.de>
352
353 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
354
355 2015-10-06 Cary Coutant <ccoutant@gmail.com>
356
357 PR gold/18855
358 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
359 parameter.
360 (Sparc_relocate_functions::gdop_lox10): Likewise.
361 (Target_sparc::Relocate::relocate): Use addend when computing
362 symbol value for R_SPARC_GOTDATA_OP*.
363
364 2015-09-07 Cary Coutant <ccoutant@gmail.com>
365
366 PR gold/18930
367 PR gold/18886
368 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
369 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
370
371 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
372
373 PR gold/18886
374 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
375 shared libraries into normal FUNC symbols.
376 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
377 symbols aren't from shared libraries.
378
379 2015-09-02 Alan Modra <amodra@gmail.com>
380
381 PR 18878
382 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
383 (Target_powerpc::Branch_info::make_stub): Determine whether long
384 branch stub is for save/restore function.
385 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
386 (Stub_table): Add need_save_res_.
387 (Stub_table:clear_stubs): Clear need_save_res_.
388 (Stub_table:set_address_and_size): Add save/restore section size.
389 (Stub_table::add_long_branch_entry): Add save_res param. Set
390 need_save_res_, but don't add space for save/restore stubs.
391 (Stub_table::find_long_branch_entry): Return offset to local copy
392 of save/restore func.
393 (Stub_table::do_write): Don't output save/restore stubs. Instead
394 copy the save/restore functions.
395 (Output_data_save_res:contents): New accessor.
396 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
397
398 2015-08-25 Cary Coutant <ccoutant@gmail.com>
399
400 PR gold/18847
401 * script-sections.cc (Memory_region::set_address): New method.
402 (Script_sections::find_memory_region): Add explicit_only parameter.
403 (Output_section_definition::set_section_addresses): Handle case where
404 script specifies both address and vma region.
405 * script-sections.h (Script_sections::find_memory_region): Add
406 explicit_only parameter.
407
408 2015-08-25 Cary Coutant <ccoutant@gmail.com>
409
410 PR gold/18859
411 * object.cc (Input_objects::add_object): Store objects in a map,
412 indexed by soname; update as-needed flag when necessary.
413 * object.h (Object::clear_as_needed): New method.
414 (Input_objects::so_names_): Change from set to map.
415
416 2015-08-25 Cary Coutant <ccoutant@gmail.com>
417
418 PR gold/14746
419 * expression.cc (Expression::Expression_eval_info): Add
420 is_valid_pointer field.
421 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
422 Adjust all callers.
423 (Addr_expression::value_from_output_section): Check whether address
424 is valid.
425 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
426 if evaluation failed due to address that is not yet valid.
427 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
428 parameter.
429
430 2015-08-25 Cary Coutant <ccoutant@gmail.com>
431
432 PR gold/18866
433 PR gold/18703
434 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
435
436 2015-08-20 Alan Modra <amodra@gmail.com>
437
438 PR gold/18846
439 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
440 Subtract os->address() from addend.
441 * powerpc.cc (relocate_relocs): Likewise.
442
443 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
444
445 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
446 lazy_stub_normal_1, lazy_stub_normal_1_n64,
447 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
448 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
449 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
450 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
451 of 'addu/daddu'.
452
453 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
454
455 * configure: Regenerated.
456
457 2015-07-26 Doug Kwan <dougkwan@google.com>
458
459 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
460 disassembler output format.
461
462 2015-07-23 Ian Coolidge <icoolidge@google.com>
463 Plumb --pic-veneer option for gold.
464
465 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
466 generation.
467 * options.h (General_options): Add --pic-veneer option.
468
469 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
470
471 PR gold/18663
472 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
473 script_test_1a.cc script_test_1b.cc.
474 (script_test_11_r.o): Replace script_test_11.o with
475 script_test_11a.o script_test_11b.o.
476 (script_test_11.o): Removed.
477 (script_test_11a.o): New.
478 (script_test_11b.o): Likewise.
479 * testsuite/Makefile.in: Regenerated.
480 * testsuite/script_test_1.h: New file.
481 * testsuite/script_test_1b.cc: Likewise.
482 * testsuite/script_test_11.h: Likewise.
483 * testsuite/script_test_11b.c: Likewise.
484 * testsuite/script_test_1.cc: Renamed to ...
485 * testsuite/script_test_1a.cc: This.
486 Include "script_test_1.h".
487 (main): Call check_int and check_ptr.
488 * testsuite/script_test_11.c: Renamed to ...
489 * testsuite/script_test_11a.c: This.
490 Include "script_test_11.h".
491 (main): Call ptr_equal.
492
493 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
494
495 PR gold/18628
496 * testsuite/ifuncdep2.c (global): Change protected to hidden.
497 * testsuite/ifuncmod1.c (global): Likewise.
498 * testsuite/ifuncmod5.c (global): Likewise.
499
500 2015-07-22 Alan Modra <amodra@gmail.com>
501
502 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
503
504 2015-07-21 Cary Coutant <ccoutant@gmail.com>
505
506 PR gold/18548
507 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
508 forced local symbol even when oldsym != NULL.
509 (Symbol_table::do_define_in_output_segment): Likewise.
510 (Symbol_table::do_define_as_constant): Likewise.
511
512 2015-07-21 Cary Coutant <ccoutant@gmail.com>
513
514 PR gold/18698
515 * archive.cc (Library_base::should_include_member): Don't use entry
516 point for relocatable links, or if target is not yet valid.
517 * parameters.cc (Parameters::entry): Check target_valid().
518
519 2015-07-20 Han Shen <shenhan@google.com>
520
521 Optimize erratum 843419 fix.
522
523 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
524 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
525 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
526 (E843419_stub): New sub-class of Erratum_stub.
527 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
528 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
529 (AArch64_relobj::create_erratum_stub): Add 1 argument.
530 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
531
532 2015-07-20 Han Shen <shenhan@google.com>
533
534 Fix arm elf header flags wrt hardfp bit.
535
536 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
537
538 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
539
540 PR gold/18689
541 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
542 from input group section for relocatable link.
543 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
544 (check_DATA): Add pr18689.stdout.
545 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
546 (pr18689.stdout): New rule.
547 (pr18689a.o): Likewise.
548 (pr18689b.o): Likewise.
549 (pr18689.o): Likewise.
550 * testsuite/pr18689.c: New file.
551 * testsuite/pr18689.sh: Likewise.
552 * testsuite/Makefile.in: Regenerated.
553
554 2015-07-20 Yiran Wang <yiran@google.com>
555 Cary Coutant <ccoutant@gmail.com>
556
557 PR gold/15574
558 * resolve.cc (Symbol_table): Remove warning about references
559 from shared objects to hidden symbols.
560 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
561 * testsuite/Makefile.in: Regenerate.
562 * testsuite/hidden_test.sh: Check dynamic symbol table; update
563 expected error messages.
564
565 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
566
567 * compressed_output.cc (Output_compressed_section::set_final_data_size):
568 Make --compress-debug-sections=zlib the same as
569 --compress-debug-sections=zlib-gabi.
570 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
571 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
572 ".zdebug_".
573 * testsuite/Makefile.in: Regenerated.
574
575 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
576
577 PR gold/18322
578 * compressed_output.cc (zlib_compress): Add argument for
579 compression header size. Set header size to compression header
580 size if it isn't 0. Don't write out the zlib header here.
581 (Output_compressed_section::set_final_data_size): Support
582 zlib-gnu and zlib-gabi compressions. Pass compression header
583 size to zlib_compress and write out compression header. Set
584 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
585 clear the SHF_COMPRESSED bit
586 * options.h (compress_debug_sections): Add zlib-gnu and
587 zlib-gabi.
588 * output.h (Output_section::set_flags): New.
589 * testsuite/Makefile.am (check_PROGRAMS): Add
590 flagstest_compress_debug_sections_none,
591 flagstest_compress_debug_sections_gnu and
592 flagstest_compress_debug_sections_gabi.
593 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
594 flagstest_compress_debug_sections.stdout,
595 flagstest_compress_debug_sections.cmp,
596 flagstest_compress_debug_sections.check,
597 flagstest_compress_debug_sections_gnu.stdout,
598 flagstest_compress_debug_sections_gnu.cmp,
599 flagstest_compress_debug_sections_gnu.check,
600 flagstest_compress_debug_sections_gabi.stdout,
601 flagstest_compress_debug_sections_gabi.cmp and
602 flagstest_compress_debug_sections_gabi.check.
603 (flagstest_compress_debug_sections_none): New.
604 (flagstest_compress_debug_sections_none.stdout): Likewise.
605 (flagstest_compress_debug_sections.stdout): Likewise.
606 (flagstest_compress_debug_sections.check): Likewise.
607 (flagstest_compress_debug_sections.cmp): Likewise.
608 (flagstest_compress_debug_sections_gnu): Likewise.
609 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
610 (flagstest_compress_debug_sections_gnu.check): Likewise.
611 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
612 (flagstest_compress_debug_sections_gabi): Likewise.
613 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
614 (flagstest_compress_debug_sections_gnu.check): Likewise.
615 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
616 * testsuite/Makefile.in: Regenerated.
617
618 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
619
620 PR gold/18321
621 * compressed_output.h (decompress_input_section): Add arguments
622 for ELF class, big endian and sh_flags.
623 * compressed_output.cc (decompress_input_section): Likewise.
624 Support the SHF_COMPRESSED section.
625 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
626 functions.
627 * plugin.h (Pluginobj): Likewise.
628 * layout.cc (Layout::get_output_section_flags): Also clear the
629 SHF_COMPRESSED bit.
630 * object.h (Compressed_section_info): Add flag to store sh_flags.
631 (Object): Add pure virtual elfsize and is_big_endian member
632 functions.
633 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
634 prefix here.
635 (build_compressed_section_map): Check SHF_COMPRESSED for
636 uncompressed size. Store sh_flags in Compressed_section_info.
637 Pass size, big_endian and sh_flags to decompress_input_section.
638 Skip the ".debug"/".zdebug" prefix when passing section name to
639 need_decompressed_section.
640 (Sized_relobj_file<size, big_endian>::do_find_special_section):
641 Don't check ".zdebug_*" sections.
642 (Object::decompressed_section_contents): Pass ELF class, big
643 endian and sh_flags to decompress_input_section.
644 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
645 Likewise.
646 * testsuite/Makefile.am (check_DATA): Add
647 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
648 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
649 gdb_index_test_2_gabi.stdout.
650 (debug_msg_cdebug_gabi.o): New.
651 (odr_violation1_cdebug_gabi.o): Likewise.
652 (odr_violation2_cdebug_gabi.o): Likewise.
653 (debug_msg_cdebug_gabi.err): Likewise.
654 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
655 (gdb_index_test_cdebug_gabi.o): Likewise.
656 (gdb_index_test_2_gabi): Likewise.
657 (gdb_index_test_2_gabi.stdout): Likewise.
658 * testsuite/gdb_index_test_2_gabi.sh: New file.
659 * testsuite/Makefile.in: Regenerated.
660
661 2015-07-09 Han Shen <shenhan@google.com>
662
663 Use "gold_info" instead of "gold_warning" for erratum fix.
664
665 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
666 'gold_info'.
667 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
668
669 2015-07-09 Han Shen <shenhan@google.com>
670
671 Drop missing symbol warning for arm/aarch64.
672
673 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
674 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
675 symbol warning.
676
677 2015-07-07 Han Shen <shenhan@google.com>
678
679 Make gold aarch64 accept long form of mapping symbols.
680
681 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
682 of mapping symbols.
683
684 2015-06-29 Doug Kwan <dougkwan@google.com>
685
686 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
687 at address expected by test.
688 * testsuite/arm_cortex_a8_b.s: Ditto.
689 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
690 * testsuite/arm_cortex_a8_bl.s: Ditto.
691 * testsuite/arm_cortex_a8_blx.s: Ditto.
692 * testsuite/arm_cortex_a8_local.s: Ditto.
693 * testsuite/arm_fix_v4bx.s: Ditto.
694 * testsuite/arm_unaligned_reloc.s: Ditto.
695 * testsuite/thumb_bl_out_of_range.s: Ditto.
696 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
697 * testsuite/thumb_blx_out_of_range.s: Ditto.
698
699 2015-06-29 Han Shen <shenhan@google.com>
700
701 Patch for erratum 843419 internal error.
702
703 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
704 (Erratum_stub::update_erratum_insn): New method.
705 (Stub_table::relocate_stubs): Modified to place relocated insn.
706 (AArch64_relobj::fix_errata): Modified gold_assert.
707
708 2015-06-12 Han Shen <shenhan@google.com>
709
710 Fix erratum 835769.
711
712 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
713 defintion outside class definition.
714 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
715 (AArch64_insn_utilities::aarch64_op31): New member.
716 (AArch64_insn_utilities::aarch64_ra): New member.
717 (AArch64_insn_utilities::aarch64_mac): New member.
718 (AArch64_insn_utilities::aarch64_mlxl): New member.
719 (ST_E_835769): New global enum member.
720 (Stub_table::relocate_stubs): Add 835769 handler.
721 (Stub_template_repertoire::Stub_template_repertoire): Install new
722 stub type.
723 (AArch64_relobj::scan_errata): This func is renamed from
724 scan_erratum_843419.
725 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
726 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
727 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
728 (Target_aarch64::scan_erratum_835769_span): New method.
729 (Target_aarch64::create_erratum_stub): New method.
730 (Target_aarch64::is_erratum_835769_sequence): New method.
731 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
732 code into create_erratum_stub.
733 * options.h (fix_cortex_a53_835769): New option.
734
735 2015-06-11 Cary Coutant <ccoutant@gmail.com>
736
737 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
738 outside class body.
739 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
740
741 2015-06-11 Cary Coutant <ccoutant@gmail.com>
742
743 PR gold/17731
744 * layout.cc (corresponding_uncompressed_section_name): New function.
745 (Layout::choose_output_section): Call it.
746 * layout.h (corresponding_uncompressed_section_name): New function.
747 * script-sections.cc (Input_section_info::set_section_name): Check
748 for compressed debug section (.zdebug style).
749
750 2015-06-11 Jing Yu <jingyu@google.com>
751
752 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
753 * testsuite/Makefile.in: Regenerate.
754
755 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
756
757 * gold.h (is_cident): Correct typo.
758
759 2015-06-10 Han Shen <shenhan@google.com>
760 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
761
762 Now fixing for 843419 is fully functional.
763
764 The first part of the erratum fix CL is here -
765 https://sourceware.org/ml/binutils/2015-04/msg00229.html
766
767 * aarch64.cc(global enum): New constants representing stub types.
768 (Stub_template): New POD struct.
769 (Stub_template_repertoire): New class.
770 (Stub_base): New class.
771 (Erratum_stub): New class.
772 (Reloc_stub): Refactored to be a subclass of Stub_base.
773 (Reloc_stub::Stub_type): Removed.
774 (Reloc_stub::offset): Moved to Stub_base.
775 (Reloc_stub::set_offset): Moved to Stub_base.
776 (Reloc_stub::destination_address): Moved to Stub_base.
777 (Reloc_stub::set_destination_address): Moved to Stub_base.
778 (Reloc_stub::reset_destination_address): Moved to Stub_base.
779 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
780 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
781 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
782 (Reloc_stub::write): Moved to Stub_base.
783 (Reloc_stub::invalid_offset): Moved to Stub_base.
784 (Reloc_stub::invalid_address): Moved to Stub_base.
785 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
786 (Reloc_stub::stub_insns_): Moved to Stub_base.
787 (Reloc_stub::offset_): Moved to Stub_base.
788 (Reloc_stub::destination_address_): Moved to Stub_base.
789 (Stub_table::The_aarch64_relobj): New typedef.
790 (Stub_table::The_erratum_stub): New typedef.
791 (Stub_table::The_erratum_stub_less): New typedef.
792 (Stub_table::The_erratum_stub_set): New typedef.
793 (Stub_table::The_erratum_stub_set_iter): New typedef.
794 (Stub_table::empty): Added emptiness testing for erratum stubs.
795 (Stub_table::add_erratum_stub): New method to add an erratum stub.
796 (Stub_table::find_erratum_stub): New method.
797 (Stub_table::find_erratum_stubs_for_input_section): New method.
798 (Stub_table::erratum_stub_address): New method.
799 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
800 (Stub_table::do_addralign): Modified to handle erratum stubs.
801 (Stub_table::erratum_stubs_): New member.
802 (Stub_table::erratum_stub_size_): New member.
803 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
804 (Stub_table::do_write): Modified to handle erratum stubs.
805 (AArch64_relobj::The_erratum_stub): New typedef.
806 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
807 (AArch64_relobj::fix_errata): New method.
808 (Target_aarch64::The_reloc_stub_type): Removed.
809 (Target_aarch64::The_erratum_stub): New typede.
810 (AArch64_relocate_functions::construct_b): New method.
811
812 2015-06-08 Nick Clifton <nickc@redhat.com>
813
814 * po/fr.po: New French Translation.
815
816 2015-06-07 Cary Coutant <ccoutant@gmail.com>
817
818 PR gold/18288
819 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
820 callers. Don't use STT_COMMON to check for common symbols.
821 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
822 symbol that's not in a common section.
823 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
824 common symbols.
825
826 2015-06-04 Cary Coutant <ccoutant@gmail.com>
827
828 PR gold/18200
829 * Makefile.am (diststuff): Add target.
830 * Makefile.in: Regenerate.
831
832 2015-06-04 Cary Coutant <ccoutant@gmail.com>
833
834 PR gold/17498
835 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
836 temporary locals in merge sections.
837 * options.cc (General_options::parse_discard_all): New method.
838 (General_options::parse_discard_locals): New method.
839 (General_options::parse_discard_none): New method.
840 (General_options::General_options): Initialize discard_locals_.
841 * options.h (--discard-all): Convert to special option.
842 (--discard-locals): Likewise.
843 (--discard-none): New option.
844 (General_options::discard_all): New method.
845 (General_options::discard_locals): New method.
846 (General_options::discard_sec_merge): New method.
847 (General_options::Discard_locals): New enum.
848 (General_options::discard_locals_): New data member.
849
850 2015-06-03 Cary Coutant <cary@google.com>
851
852 * script-sections.cc (Script_sections::Script_sections): Initialize
853 segments_created_.
854 (Script_sections::create_note_and_tls_segments): Set flag when
855 segments are created.
856 (Script_sections::expected_segment_count): Count PT_INTERP.
857 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
858 segments are created.
859 * script-sections.h (Script_sections::segments_created_): New data
860 member.
861
862 2015-06-03 Cary Coutant <ccoutant@gmail.com>
863
864 PR gold/15370
865 * script-sections.cc
866 (Output_section_element_input::set_section_addresses): When there
867 are several patterns with no sort spec, put all sections in the same
868 bin.
869 * testsuite/Makefile.am (script_test_12): New testcase.
870 (script_test_12i): New testcase.
871 * testsuite/Makefile.in: Regenerate.
872 * testsuite/script_test_12.t: New test linker script.
873 * testsuite/script_test_12i.t: New test linker script.
874 * testsuite/script_test_12a.c: New test source file.
875 * testsuite/script_test_12b.c: New test source file.
876
877 2015-06-02 Cary Coutant <ccoutant@gmail.com>
878
879 * nacl.h (Sniff_file): Switch parameters to get_view to get an
880 aligned view.
881
882 2015-06-03 Cary Coutant <ccoutant@gmail.com>
883
884 PR gold/17819
885 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
886 separate task to schedule the build id computation.
887 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
888 add Output_file and offset.
889 (Hash_task::run): Get and release the input views.
890 (Hash_task::is_runnable): Always return NULL (always runnable).
891 (Layout::queue_build_id_tasks): Remove.
892 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
893 parameters; use them instead of class members.
894 (Build_id_task_runner::run): New function.
895 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
896 to write_build_id.
897 * layout.h (Layout::queue_build_id_tasks): Remove.
898 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
899 parameters.
900 (Layout::array_of_hashes_): Remove.
901 (Layout::size_of_array_of_hashes_): Remove.
902 (Layout::input_view_): Remove.
903 (Build_id_task_runner): New class.
904 (Close_task_runner::Close_task_runner): Add array_of_hashes and
905 size_of_hashes parameters.
906 (Close_task_runner::array_of_hashes_): New data member.
907 (Close_task_runner::size_of_hashes_): New data member.
908 * testsuite/Makefile.am
909 (flagstest_compress_debug_sections_and_build_id_tree): New test.
910 * testsuite/Makefile.in: Regenerate.
911
912 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
913
914 * merge.cc (get_input_merge_map): Update for data structure change.
915 (get_or_make_input_merge_map): Update for data structure change.
916 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
917 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
918
919 2015-05-16 Alan Modra <amodra@gmail.com>
920
921 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
922 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
923 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
924 (lis_0): Rename from lis_0_0.
925
926 2015-04-29 Cary Coutant <cary@google.com>
927 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
928
929 * gc.h (Garbage_collection::is_section_garbage): Change Object*
930 to Relobj*.
931 (Garbage_collection::add_reference): Likewise.
932 (Garbage_collection::gc_process_relocs): Likewise. Don't push
933 object/shndx pair onto *secvec for dynamic objects. Don't follow
934 relocations pointing to dynamic objects for GC.
935 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
936 (Icf::unfold_section): Likewise.
937 (Icf::is_section_folded): Likewise.
938 (Icf::get_folded_section): Likewise.
939 * icf.h: (Icf::get_folded_section): Likewise.
940 (Icf::unfold_section): Likewise.
941 (Icf::is_section_folded): Likewise.
942 (Icf::section_has_function_pointers): Likewise.
943 (Icf::set_section_has_function_pointers): Likewise.
944 * object.h (Section_id): Likewise.
945 (Const_section_id): Likewise.
946 * output.cc (Output_section::update_section_layout): Likewise.
947 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
948 Likewise.
949 * plugin.cc (update_section_order): Likewise.
950 (unique_segment_for_sections): Likewise.
951 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
952 (Target_powerpc::do_gc_add_reference): Likewise.
953 (Target_powerpc::gc_process_relocs): Likewise.
954 (Target_powerpc::do_gc_add_reference): Likewise.
955 * symtab.cc (Symbol_table::is_section_folded): Likewise.
956 (Symbol_table::gc_mark_symbol): Likewise.
957 * symtab.h: (Symbol_table::is_section_folded): Likewise.
958 * target.h: (Sized_target::gc_add_reference): Likewise.
959 (Sized_target::do_gc_add_reference): Likewise.
960
961 2015-04-29 Nick Clifton <nickc@redhat.com>
962
963 * po/fi.po: Updated Finnish translation.
964
965 2015-04-28 Alan Modra <amodra@gmail.com>
966
967 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
968 than unsigned int for find_global_entry result temp. Compare
969 against invalid_address.
970 (Target_powerpc::do_plt_address_for_global): Likewise.
971 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
972 on plt call stub existence for debug info. Do assert for plt
973 and global entry stub existence if an alloc section.
974
975 2015-04-28 Alan Modra <amodra@gmail.com>
976
977 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
978 on missing global entry stub due to bogus debug info.
979
980 2015-04-27 Han Shen <shenhan@google.com>
981
982 * options.h (--fix-cortex-a53-843419): Rename option.
983 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
984 option.
985 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
986
987 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
988
989 PR gold/18327
990 * output.cc (Output_section::is_input_address_mapped): Assume a missing
991 entry is mapped.
992 * testsuite/Makefile.am: Add the eh_test test.
993 * testsuite/Makefile.in: Regenerate.
994 * testsuite/eh_test_a.cc: New test.
995 * testsuite/eh_test_b.cc: New test.
996
997 2015-04-23 Sriraman Tallam <tmsriram@google.com>
998
999 * options.h (--weak-unresolved-symbols): New option.
1000 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
1001 binding to weak with new option.
1002 * symtab.h (is_weak_undefined): Check for new option.
1003 (is_strong_undefined): Check for new option.
1004 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
1005 * testsuite/Makefile.in: Regenerate.
1006 * testsuite/weak_unresolved_symbols_test.cc: New file.
1007
1008 2015-04-20 Ian Coolidge <icoolidge@google.com>
1009
1010 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
1011 GNU_UNIQUE.
1012
1013 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1014
1015 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
1016 push_back.
1017 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
1018 * object.cc (Sized_relobj_file::do_layout): Use push_back.
1019 * powerpc.cc (process_gc_mark): Use push_back.
1020 (Target_powerpc::do_gc_mark_symbol): Use push_back.
1021 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
1022
1023 2015-04-16 Han Shen <shenhan@google.com>
1024
1025 * aarch64.cc (AArch64_insn_utilities): New utility class.
1026 (AArch64_relobj::Mapping_symbol_position): New struct.
1027 (AArch64_relobj::Mapping_symbol_info): New typedef.
1028 (AArch64_relobj::do_count_local_symbols): New function overriding
1029 parent's implementation.
1030 (AArch64_relobj::mapping_symbol_info_): New member
1031 (AArch64_relobj::scan_erratum_843419): New method.
1032 (Target_aarch64::scan_erratum_843419_span): New method.
1033 (Target_aarch64::is_erratum_843419_sequence): New method.
1034 * options.h (fix_cortex_a53): New option.
1035
1036 2015-04-09 Cary Coutant <ccoutant@google.com>
1037
1038 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
1039 in a PIE link.
1040 * testsuite/Makefile.am (tls_pie_test.sh): New test.
1041 * testsuite/Makefile.in: Regenerate.
1042 * testsuite/tls_pie_test.sh: New.
1043
1044 2015-04-09 Cary Coutant <ccoutant@google.com>
1045
1046 * debug.h (DEBUG_LOCATION): New.
1047 (DEBUG_ALL): Include DEBUG_LOCATION.
1048 (debug_string_to_enum): Add DEBUG_LOCATION.
1049 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
1050 output to print correct context.
1051 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
1052 up to 4 more locations at the beginning of the function.
1053 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
1054 result before sorting list of line numbers.
1055 * testsuite/debug_msg.sh: Allow range of line numbers for
1056 canonical results on optimized code.
1057
1058 2015-04-07 HC Yen <hc.yen@mediatek.com>
1059
1060 Add AArch32 support for gold linker.
1061 gold/
1062 * arm.cc: Add V8 arch combine table.
1063
1064 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1065
1066 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
1067
1068 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1069
1070 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
1071 to find by using the return value of insert.
1072
1073 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1074
1075 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
1076 constructor call.
1077
1078 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
1079
1080 PR gold/17641
1081 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
1082 (Target_x86_64::Scan::local): Don't create GOT entry, when we
1083 can convert mov to lea.
1084 (Target_x86_64::Scan::global): Ditto.
1085 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
1086 %reg to lea foo(%rip), %reg if possible.
1087 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
1088 * testsuite/x86_64_mov_to_lea1.s: New.
1089 * testsuite/x86_64_mov_to_lea2.s: Ditto.
1090 * testsuite/x86_64_mov_to_lea3.s: Ditto.
1091 * testsuite/x86_64_mov_to_lea4.s: Ditto.
1092 * testsuite/x86_64_mov_to_lea.sh: Ditto.
1093
1094 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
1095
1096 * configure: Regenerated.
1097
1098 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
1099
1100 PR gold/17640
1101 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1102 (Target_i386::Scan::local): Don't create GOT entry, when we
1103 can convert GOT to GOTOFF.
1104 (Target_i386::Scan::global): Ditto.
1105 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1106 lea foo@GOTOFF(%reg), %reg if possible.
1107 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1108 * testsuite/i386_mov_to_lea1.s: New.
1109 * testsuite/i386_mov_to_lea2.s: Ditto.
1110 * testsuite/i386_mov_to_lea3.s: Ditto.
1111 * testsuite/i386_mov_to_lea4.s: Ditto.
1112 * testsuite/i386_mov_to_lea5.s: Ditto.
1113 * testsuite/i386_mov_to_lea.sh: Ditto.
1114
1115 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1116
1117 * Makefile.am (ZLIB): New.
1118 (ZLIBINC): Likewise.
1119 (AM_CFLAGS): Add $(ZLIBINC).
1120 (AM_CXXFLAGS): Likewise.
1121 (ldadd_varldadd_var): Add $(ZLIB).
1122 (incremental_dump_LDADD): Likewise.
1123 (dwp_LDADD): Likewise.
1124 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1125 <zlib.h>.
1126 (zlib_compress): Don't check HAVE_ZLIB_H.
1127 (zlib_decompress): Likewise.
1128 * options.h (compress_debug_sections): Likewise.
1129 * configure.ac (AM_CONDITIONAL): Removed.
1130 * testsuite/Makefile.am (ZLIB): New.
1131 (LDADD): Add $(ZLIB).
1132 Don't check HAVE_ZLIB.
1133 * Makefile.in: Regenerated.
1134 * config.in: Likewise.
1135 * configure: Likewise.
1136 * testsuite/Makefile.in: Likewise.
1137
1138 2015-03-30 Jing Yu <jingyu@google.com>
1139
1140 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1141 TLSLD_ADD_DTPREL_LO12_NC.
1142 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1143 _TLS_MODULE_BASE_ point to the start of tls segment.
1144 (Target_aarch64::optimize_tls_reloc): Add cases for
1145 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1146 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1147 (Target_aarch64::Scan::local): Likewise.
1148 (Target_aarch64::Scan::global): Likewise.
1149 (Target_aarch64::Relocate::relocate): Likewise.
1150 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1151 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1152 relocations.
1153
1154 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1155
1156 * merge.cc (Object_merge_map::add_mapping): call
1157 Object_merge_map::Input_merge_map::add_mapping.
1158 (Object_merge_map::Input_merge_map::add_mapping): New.
1159 (Output_merge_data::do_add_input_section): Call
1160 get_or_make_input_merge_map before a loop.
1161 (Output_merge_string<Char_type>::finalize_merged_data): Call
1162 get_or_make_input_merge_map before a loop.
1163 * merge.h (Object_merge_map): Make Input_merge_map public.
1164 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1165 (Relobj::get_or_create_merge_map): New.
1166 * object.h (Relobj::get_or_create_merge_map): New.
1167
1168 2015-03-24 Alan Modra <amodra@gmail.com>
1169
1170 PR 18147
1171 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1172 relocation errors for branches to strong undefined symbols.
1173
1174 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1175
1176 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1177 (Object_merge_map::is_merge_section_for): Remove.
1178 (Object_merge_map::find_merge_section): New.
1179 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1180 (Object_merge_map::find_merge_section): New.
1181 (Object_merge_map::get_input_merge_map): Add a const version.
1182 * object.cc (Relobj::is_merge_section_for): Remove.
1183 (Relobj::find_merge_section): New.
1184 * object.h (Relobj::is_merge_section_for): Remove.
1185 (Relobj::find_merge_section): New.
1186 * output.cc
1187 (Output_section::Input_section::is_merge_section_for): Remove.
1188 (Output_section::add_merge_input_section): Don't call
1189 add_merge_input_section.
1190 (Output_section::find_merge_section): Return const. Use
1191 object->find_merge_section.
1192 (Output_section::build_lookup_maps): Don't build a map for
1193 merge sections.
1194 (Output_section::is_input_address_mapped): Return false if
1195 section is not found.
1196 (Output_section::find_starting_output_address): Use
1197 find_merge_section instead of is_merge_section_for.
1198 (Output_section::add_script_input_section): Don't build a map for
1199 merge sections.
1200 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1201 (Output_section_lookup_maps::find_merge_section): Remove.
1202 (Output_section_lookup_maps::add_merge_input_section) Remove.
1203 (Output_section::find_merge_section): Return const.
1204
1205 2015-03-22 Cary Coutant <cary@google.com>
1206
1207 PR gold/18106
1208 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1209 non-SIB form of lea, with nop after the call.
1210
1211 2015-03-21 Cary Coutant <cary@google.com>
1212
1213 PR gold/14217
1214 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1215 .tdata section.
1216 (Output_segment::set_section_addresses): Don't align size of relro
1217 segment for .tbss.
1218
1219 2015-03-21 Cary Coutant <cary@google.com>
1220
1221 PR gold/18010
1222 * stringpool.cc (Stringpool_template): Don't optimize if section
1223 alignment is greater than sizeof(char).
1224
1225 2015-03-21 Cary Coutant <cary@google.com>
1226
1227 PR gold/18048
1228 * script-c.h (script_include_directive): Add first_token parameter.
1229 * script.cc (script_include_directive): Add first_token parameter, and
1230 pass it to read_script_file.
1231 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1232 (PARSING_MEMORY_DEF): New tokens.
1233 (top): Add new productions for INCLUDE files.
1234 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1235 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1236 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1237 (section_cmd): Pass PARSING_SECTION_CMDS.
1238 (file_or_sections_cmd): Remove.
1239 (memory_def): Pass PARSING_MEMORY_DEF.
1240 * testsuite/Makefile.am (memory_test_2): New test.
1241 * testsuite/Makefile.in: Regenerate.
1242 * testsuite/memory_test_inc.t: New script file.
1243 * testsuite/memory_test_inc_1.t.src: New script file.
1244 * testsuite/memory_test_inc_2.t.src: New script file.
1245 * testsuite/memory_test_inc_3.t.src: New script file.
1246
1247 2015-03-21 Cary Coutant <cary@google.com>
1248
1249 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1250 (Sized_relobj_dwo::setup): Build compressed section map.
1251 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1252 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1253 section map.
1254 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1255 compressed_sections_ field.
1256 (build_compressed_section_map): Take Object instead of
1257 Sized_relobj_file parameter; add decompress_if_needed parameter.
1258 (Sized_relobj_file::do_find_special_sections): Store compressed
1259 section map in parent Object.
1260 (Sized_relobj_file::do_decompressed_section_contents): Move
1261 implementation to Object::decompressed_section_contents.
1262 (Sized_relobj_file::do_discard_decompressed_sections): Move
1263 implementation to Object::discard_decompressed_sections.
1264 * object.h (build_compressed_section_map): Declare.
1265 (Object::Object): Add compressed_sections_ field.
1266 (Object::section_is_compressed): Move implementation here.
1267 (Object::decompressed_section_contents): De-virtualize.
1268 (Object::discard_decompressed_sections): De-virtualize.
1269 (Object::do_section_is_compressed): Delete.
1270 (Object::do_decompressed_section_contents): Delete.
1271 (Object::set_compressed_sections): New method.
1272 (Object::compressed_sections): New method.
1273 (Object::compressed_sections_): New data member.
1274 (Compressed_section_info, Compressed_section_map): Move to top of file.
1275 (Sized_relobj_file::do_section_is_compressed): Delete.
1276 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1277 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1278 (Sized_relobj_file::compressed_sections_): Move to Object class.
1279
1280 2015-03-21 Cary Coutant <ccoutant@google.com>
1281
1282 PR gold/18152
1283 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1284 deferred objects.
1285
1286 2015-03-11 Cary Coutant <ccoutant@google.com>
1287
1288 * options.cc (General_options::finalize): Don't allow -z relro
1289 with incremental linking.
1290 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1291 (incremental_test_2): Likewise.
1292 (incremental_test_3): Likewise.
1293 (incremental_test_4): Likewise.
1294 (incremental_test_5): Likewise.
1295 (incremental_test_6): Likewise.
1296 (incremental_copy_test): Likewise.
1297 (incremental_common_test_1): Likewise.
1298 (incremental_comdat_test_1): Likewise.
1299 * testsuite/Makefile.in: Regenerate.
1300
1301 2015-03-09 Cary Coutant <ccoutant@google.com>
1302
1303 PR gold/14675
1304 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1305 return enum indicating whether .eh_frame section is empty, optimizable,
1306 unrecognized, or an end marker. Adjust explicit instantiations.
1307 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1308 (Eh_frame::add_ehframe_input_section): Change return type.
1309 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1310 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1311 to the .eh_frame output section until we see the end marker.
1312 (Layout::finalize_eh_frame_section): New.
1313 * layout.h: (Layout::finalize_eh_frame_section): New.
1314
1315 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1316
1317 * output.cc (Relobj::initialize_input_to_output_map<size>):
1318 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1319
1320 2015-03-04 Cary Coutant <ccoutant@google.com>
1321
1322 * parameters.cc (Parameters::set_target_once): Call
1323 Target::select_as_default_target just once from here...
1324 (set_parameters_target): ...instead of from here.
1325
1326 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1327
1328 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1329 Output_section_data instead of a Merge_map.
1330 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1331 (Eh_frame::read_cie): Use add_merge_mapping instead of
1332 Merge_map::add_mapping.
1333 (Eh_frame::read_fde): Ditto.
1334 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1335 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1336 merge_map_->get_output_offset.
1337 (Eh_frame::do_is_merge_section_for): Delete.
1338 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1339 instead of a Merge_map.
1340 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1341 Merge_map.
1342 (Eh_frame::do_is_merge_section_for): Delete.
1343 (Eh_frame::merge_map_): Delete.
1344 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1345 and use a Output_section_data instead of a Merge_map.
1346 (Object_merge_map::add_mapping): Ditto.
1347 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1348 (Object_merge_map::is_merge_section_for): Pass in and use a
1349 Output_section_data instead of a Merge_map.
1350 (Merge_map): Delete.
1351 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1352 of merge_map_.get_output_offset.
1353 (Output_merge_base::do_is_merge_section_for): Delete.
1354 (Output_merge_data::do_add_input_section): Use
1355 object->add_merge_mapping instead of add_mapping.
1356 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1357 * merge.h (Merge_map): Delete forward declaration.
1358 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1359 instead of a Merge_map.
1360 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1361 (Object_merge_map::is_merge_section_for): Pass in and use a
1362 Output_section_data instead of a Merge_map.
1363 (Input_merge_map::Object_merge_map::merge_map): Replace with
1364 output_data.
1365 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1366 Output_section_data instead of a Merge_map.
1367 (Merge_map): Delete.
1368 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1369 (Output_merge_base::do_is_merge_section_for): Delete.
1370 (Output_merge_base::add_mapping): Delete.
1371 (Output_merge_base::merge_map_): Delete.
1372 * object.cc (Relobj::initialize_input_to_output_map): New.
1373 (Relobj::initialize_input_to_output_map): New.
1374 (Relobj::merge_output_offset): New.
1375 (Relobj::is_merge_section_for): New.
1376 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1377 bits.
1378 * object.h (Relobj::merge_map): Delete.
1379 (initialize_input_to_output_map): New.
1380 (set_merge_map): Delete.
1381 (add_merge_mapping): New.
1382 (merge_output_offset): New.
1383 (is_merge_section_for): New.
1384 * output.cc (Output_section::Input_section::is_merge_section_for):
1385 Use object->is_merge_section_for.
1386 * output.h (Output_section_data::is_merge_section_for): Delete.
1387 (Output_section_data::do_is_merge_section_for): Delete.
1388 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1389 Use object->initialize_input_to_output_map.
1390 (Merged_symbol_value<size>::value_from_output_section): Use
1391 object->merge_output_offset.
1392
1393 2015-03-02 Peter Collingbourne <pcc@google.com>
1394 Cary Coutant <ccoutant@google.com>
1395
1396 * output.cc (Output_section::add_merge_input_section): Do not
1397 attempt to merge sections with an entsize of 0.
1398
1399 2015-03-02 Khem Raj <raj.khem@gmail.com>
1400
1401 * attributes.h (class Output_attributes_section_data ): Add
1402 do_print_to_mapfile function.
1403
1404 2015-02-24 Alan Modra <amodra@gmail.com>
1405
1406 PR 18010
1407 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1408 complain if value is not a multiple of four.
1409 (Target_powerpc::Relocate::relocate): Correct handling of
1410 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1411
1412 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1413
1414 * configure.ac (default_size): Set to 32 for x32.
1415 * configure: Regenerated.
1416
1417 2015-02-18 Alan Modra <amodra@gmail.com>
1418
1419 PR 17954
1420 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1421 visibility.
1422
1423 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1424
1425 * gc.h (Garbage_collection::add_reference): Don't use find.
1426
1427 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1428
1429 * object.cc (write_local_symbols): avoid std::vector copy.
1430
1431 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1432
1433 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1434
1435 2015-02-09 Mark Wielaard <mjw@redhat.com>
1436
1437 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1438 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1439
1440 2015-02-16 Cary Coutant <ccoutant@google.com>
1441
1442 PR gold/13577
1443 PR gold/16992
1444 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1445 DF_SYMBOLIC if --dynamic-list option is used.
1446 * options.cc (General_options::finalize): --dynamic-list is not
1447 mutually exclusive with -Bsymbolic.
1448 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1449 listed in --dynamic-list.
1450 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1451 -Bsymbolic-functions.
1452 * testsuite/Makefile.in: Regenerate.
1453
1454 2015-02-16 Cary Coutant <ccoutant@google.com>
1455
1456 PR gold/17971
1457 * incremental.cc: Remove redundant include of "output.h".
1458
1459 2015-02-12 Jing Yu <jingyu@google.com>
1460
1461 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1462 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1463 New relocation.
1464 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1465 TLSLE_MOVW_* relocations.
1466 (Target_aarch64::Scan::global): Likewise.
1467 (Target_aarch64::Relocate::relocate): Likewise.
1468 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1469 for new TLSLE_MOVW_* relocations.
1470
1471 2015-02-11 Will Newton <will.newton@linaro.org>
1472
1473 PR gold/13321
1474 * arm.cc (Target_arm::make_plt_section): Create an ARM
1475 state mapping symbol at the start of the PLT.
1476
1477 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1478
1479 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1480 Replace two_file_shared_2.so with two_file_shared_1.so.
1481 * testsuite/Makefile.in: Regenerated.
1482
1483 2015-02-09 Alan Modra <amodra@gmail.com>
1484
1485 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1486 plugin_test_thin.a and defsym_test.
1487 * testsuite/Makefile.in: Regenerate.
1488
1489 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1490
1491 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1492 body.
1493
1494 2015-02-04 Peter Collingbourne <pcc@google.com>
1495
1496 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1497 forwarding symbols when computing symbol resolution info for plugins.
1498 * plugin.h (Plugin_manager::symtab): New method.
1499 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1500
1501 2015-02-03 Cary Coutant <ccoutant@google.com>
1502 Peter Collingbourne <pcc@google.com>
1503
1504 PR gold/15660
1505 * archive.cc (Thin_archive_object_unlocker): New class.
1506 (Archive::include_member): Unlock external members of thin archives.
1507 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1508 (plugin_test_2): Likewise.
1509 (plugin_test_3): Likewise.
1510 (plugin_test_4): Likewise.
1511 (plugin_test_5): Likewise.
1512 (plugin_test_6): Likewise.
1513 (plugin_test_7): Likewise.
1514 (plugin_test_8): Likewise.
1515 (plugin_test_9): Likewise.
1516 (plugin_test_10): Likewise.
1517 (plugin_test_11): New test case.
1518 * testsuite/Makefile.in: Regenerate.
1519 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1520 file to decide whether to claim file.
1521 (all_symbols_read_hook): Likewise.
1522 * testsuite/plugin_test_1.sh: Adjust expected output.
1523 * testsuite/plugin_test_2.sh: Likewise.
1524 * testsuite/plugin_test_3.sh: Likewise.
1525 * testsuite/plugin_test_6.sh: Likewise.
1526 * testsuite/plugin_test_tls.sh: Likewise.
1527 * testsuite/plugin_test_11.sh: New testcase.
1528
1529 2015-02-03 Cary Coutant <ccoutant@google.com>
1530
1531 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1532 file descriptors when debugging enabled. Add debug output.
1533 (Descriptors::release): Add debug output.
1534 (Descriptors::close_some_descriptor): Likewise.
1535 (Descriptors::close_all): Likewise.
1536 * fileread.cc (File_read::lock): Likewise.
1537 (File_read::unlock): Likewise.
1538
1539 2015-02-02 Cary Coutant <ccoutant@google.com>
1540
1541 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1542 executable output file.
1543
1544 2015-01-22 Han Shen <shenhan@google.com>
1545
1546 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1547 (Target_arm::do_plt_address_for_global): New method.
1548 (Target_arm::do_plt_address_for_local): New method.
1549 (Target_arm::rel_irelative_section): New method.
1550 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1551 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1552 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1553 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1554 (Target_arm::Scan::check_non_pic): Add ifunc support.
1555 (Target_arm::Scan::local): Add ifunc support.
1556 (Target_arm::Scan::global): Add ifunc support.
1557 (Target_arm::make_plt_section): New method.
1558 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1559 (Target_arm::make_local_ifunc_plt_entry): New method.
1560 (Target_arm::got_irelative_): New member.
1561 (Target_arm::rel_irelative_): New member.
1562 (Target_arm::got_section): Add creation for got_irelative_.
1563 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1564 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1565 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1566 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1567 (Output_data_plt_arm::IRelative_data): New type.
1568 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1569 (Output_data_plt_arm::add_entry): Add more parameters.
1570 (Output_data_plt_arm::add_relocation): New method.
1571 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1572 (Output_data_plt_arm::rel_irelative): New method.
1573 (Output_data_plt_arm::entry_count): Modified.
1574 (Output_data_plt_arm::address_for_global): New method.
1575 (Output_data_plt_arm::address_for_local): New method.
1576 gold/
1577 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1578 (Output_data_plt_arm::insert_irelative_data): New method.
1579 (Output_data_plt_arm::irelative_rel_): New member.
1580 (Output_data_plt_arm::got_): New member.
1581 (Output_data_plt_arm::got_irelative_): New member.
1582 (Output_data_plt_arm::irelative_count_): New member.
1583 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1584 (Output_data_plt_arm::irelative_data_vec_): New member.
1585 (Output_data_plt_arm::do_write): Write out irelative entries.
1586 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1587 more parameters to ctor.
1588 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1589 more parameters to ctor.
1590 * output.h (Output_data_reloc::add_local_relative): New method.
1591 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1592
1593 2015-01-29 Alan Modra <amodra@gmail.com>
1594
1595 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1596 and GOT_TLSGD to LE optimization.
1597
1598 2015-01-28 Cary Coutant <ccoutant@google.com>
1599
1600 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1601 for undef TLS symbols.
1602 (Target_x86_64::Relocate::relocate_tls): Likewise.
1603 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1604
1605 2015-01-25 Cary Coutant <ccoutant@google.com>
1606
1607 * output.cc (Output_segment::set_section_addresses): Fix calculation
1608 of size of relro segment.
1609
1610 2015-01-22 Alan Modra <amodra@gmail.com>
1611
1612 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1613 condition for need of ifunc plt entry.
1614 (Target_powerpc::Scan::global <got relocs>): Likewise.
1615
1616 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1617
1618 * mips.cc (reloc_high): Add r_sym.
1619 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1620 reloc_high constructor.
1621 (Mips_relocate_functions::relgot16_local): Likewise.
1622 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1623 r_type to decide whether LO16 matches HI16.
1624 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1625 rello16 and relgot16_local.
1626
1627 2015-01-09 Cary Coutant <ccoutant@google.com>
1628
1629 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1630 unless alignment is larger than page size.
1631
1632 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1633 Cary Coutant <ccoutant@google.com>
1634
1635 PR gold/17729
1636 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1637 (DEFAULT_TARGET_X32): Set for x32.
1638 * x86_64.cc (cmp_insn_32): New.
1639 (lea_r10_insn_32): Likewise.
1640 (lea_r11_insn_32): Likewise.
1641 (cmp_insn_64): Likewise.
1642 (lea_r10_insn_64): Likewise.
1643 (lea_r11_insn_64): Likewise.
1644 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1645 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1646 (check_DATA): Add split_x32 files.
1647 (split_x32_[1234n].o): New targets.
1648 (split_x32_[124]): New targets.
1649 (split_x32_[1234r].stdout): New targets.
1650 * testsuite/split_x32.sh: New file.
1651 * testsuite/split_x32_1.s: Likewise.
1652 * testsuite/split_x32_2.s: Likewise.
1653 * testsuite/split_x32_3.s: Likewise.
1654 * testsuite/split_x32_4.s: Likewise.
1655 * testsuite/split_x32_n.s: Likewise.
1656 * configure: Regenerated.
1657 * testsuite/Makefile.in: Likewise.
1658
1659 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1660
1661 PR gold/17809
1662 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1663 x32.
1664
1665 2015-01-02 Alan Modra <amodra@gmail.com>
1666
1667 * version.cc (print_version): Just print current year.
1668 * dwp.cc (print_version): Likewise.
1669
1670 2015-01-01 Alan Modra <amodra@gmail.com>
1671
1672 Update year range in copyright notice of all files.
1673
1674 2014-12-25 Alan Modra <amodra@gmail.com>
1675
1676 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1677 new enums.
1678 (Target_arm::merge_object_attributes, ): Likewise.
1679
1680 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1681
1682 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1683 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1684 AEABI_VFP_args_vfp to check that.
1685 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1686 value and replace hardcoded values by enum values.
1687
1688 2014-12-22 Cary Coutant <ccoutant@google.com>
1689
1690 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1691
1692 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1693
1694 PR gold/14608
1695 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1696 to "return i * i * 3;".
1697
1698 2014-12-16 Cary Coutant <ccoutant@google.com>
1699
1700 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1701 (Mapfile::print_output_data): Use current_data_size() to avoid
1702 assert for sections requiring postprocessing; if address is not valid,
1703 print 0.
1704 (Mapfile::print_output_section): Use current_data_size(); print note
1705 that addresses and sizes are before compression.
1706
1707 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1708
1709 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1710 Cast current_group_size to unsigned long when reporting error.
1711
1712 2014-12-10 Jing Yu <jingyu@google.com>
1713
1714 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1715 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1716 Update error message.
1717 (Target_aarch64::do_relax): Use absolute value of option
1718 stub_group_size. Replace local variable with class member
1719 stub_group_size_.
1720
1721 2014-12-04 Alan Modra <amodra@gmail.com>
1722
1723 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1724 addend of PLTREL24 reloc when not generating a plt stub. Make
1725 max_branch_offset an "Address".
1726 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1727 (Target_powerpc::Relocate::relocate): Likewise.
1728
1729 2014-12-04 Alan Modra <amodra@gmail.com>
1730
1731 PR 17670
1732 * symtab.cc (Symbol::set_undefined): Remove assertion.
1733 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1734 on symbols defined in discarded sections, instead return false.
1735 Rearrange params, update all callers.
1736 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1737 branches to syms in discarded sections.
1738 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1739 undefined and flag as discarded.
1740 (Target_powerpc::Relocate::relocate): Localize variable.
1741
1742 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1743
1744 PR gold/17675
1745 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1746 * testsuite/Makefile.in: Regenerated.
1747
1748 2014-12-03 Alan Modra <amodra@gmail.com>
1749
1750 PR 17566
1751 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1752 when adding dynamic relocations against section symbols.
1753
1754 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1755
1756 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1757 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1758 * options.h (General_options): New -z option (global).
1759
1760 2014-12-01 Cary Coutant <ccoutant@google.com>
1761
1762 PR gold/17578
1763 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1764 is given.
1765 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1766 given but some inputs require executable stack.
1767
1768 2014-11-26 Cary Coutant <ccoutant@google.com>
1769
1770 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1771 .debug_str_offsets; strip .debug_gnu_pubnames and
1772 .debug_gnu_pubtypes.
1773 (lines_only_debug_sections): Strip all four new sections.
1774
1775 2014-11-26 Jing Yu <jingyu@google.com>
1776
1777 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1778 register to be x0 when to relax TLSDESC_LD64_LO12.
1779
1780 2014-11-26 Alan Modra <amodra@gmail.com>
1781
1782 * powerpc.cc (struct Stub_table_owner): New.
1783 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1784 unsigned int vector. Update all references.
1785 (powerpc_relobj::set_stub_table): Take an unsigned int param
1786 rather than a Stub_table. Update callers.
1787 (Powerpc_relobj::clear_stub_table): New function.
1788 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1789 stub_group_size_ vars.
1790 (Target_powerpc::new_stub_table): Delete.
1791 (max_branch_delta): New function, extracted from..
1792 (Target_powerpc::Relocate::relocate): ..here..
1793 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1794 status on whether stub created successfully.
1795 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1796 default sizing to..
1797 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1798 reduce on relax failure.
1799 (Target_powerpc::group_sections): Add "no_size_errors" param.
1800 Use stub_group_size_. Set up group info in a temp vector,
1801 before building Stub_table vector. Account for input sections
1802 possibly already converted to relaxed sections.
1803 (Stub_table::init): Delete. Merge into..
1804 (Stub_table::Stub_table): ..here.
1805 (Stub_table::can_reach_stub): New function.
1806 (Stub_table::add_plt_call_entry): Add "from" parameter and
1807 return true iff stub could be reached.
1808 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1809 param too.
1810 (Stub_table::clear_stubs): Add "all" param.
1811
1812 2014-11-26 Alan Modra <amodra@gmail.com>
1813
1814 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1815 (Target_powerpc::group_sections): Use it.
1816
1817 2014-11-25 Cary Coutant <ccoutant@google.com>
1818
1819 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1820 (Binary_to_elf::write_symbol): Add st_size parameter.
1821 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1822
1823 2014-11-25 Cary Coutant <ccoutant@google.com>
1824
1825 PR gold/17639
1826 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1827 (Sized_relobj_file::do_layout): Handle deferred sections properly
1828 during GC pass 1. Don't add reloc sections to deferred list twice.
1829 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1830 (Sized_relobj_file::is_deferred_layout_): New data member.
1831
1832 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1833
1834 PR gold/17619
1835 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1836 Check PC-relative offset overflow in PLT entry.
1837
1838 2014-11-21 Alan Modra <amodra@gmail.com>
1839
1840 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1841 for undefined weaks.
1842
1843 2014-11-20 Alan Modra <amodra@gmail.com>
1844
1845 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1846 from --stub-group-size parameter divided by 1024.
1847 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1848 template parameter. Update all uses.
1849 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1850 has_stub_value. Set for long branches. Don't report overflow for
1851 branch to undefined weak symbols. Print info message on
1852 overflowing branch to stub.
1853
1854 2014-11-20 Alan Modra <amodra@gmail.com>
1855
1856 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1857
1858 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1859
1860 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1861 entry for R_X86_64_GOTPLT64.
1862 (Target_x86_64<size>::Relocate::relocate): Update comments for
1863 R_X86_64_GOTPLT64.
1864
1865 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1866
1867 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1868 * plugin.h: add lock definition
1869
1870 2014-10-29 Han Shen <shenhan@google.com>
1871 Jing Yu <jingyu@google.com>
1872
1873 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1874 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1875 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1876 Symbol::TLS_REF.
1877 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1878 method.
1879 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1880 (Target_aarch64::tls_ld_to_le): New method.
1881 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1882 for 64bit targets.
1883 (Output_data_plt_aarch64::irelative_rel_): New data member.
1884 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1885 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1886 (Output_data_plt_aarch64::add_relocation): New method.
1887 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1888 offset. Add got_irelative size to got size.
1889 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1890 type string with the new typename.
1891 (AArch64_relocate_functions::update_adr): Replace parameter x with
1892 immed.
1893 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1894 (AArch64_relocate_functions::reloc_common): New method.
1895 (AArch64_relocate_funcsions::rela_general): Extract common part out
1896 into reloc_common method.
1897 (AArch64_relocate_functions::rela_general): Likewise.
1898 (AArch64_relocate_functions::pcrela_general): Likewise.
1899 (AArch64_relocate_functions::adr): New method.
1900 (AArch64_relocate_functions::adrp): Calculate immed before calling
1901 update_adr.
1902 (AArch64_relocate_functions::adrp): Likewise.
1903 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1904 comparing x to 0. Calculate immed from ~x when x < 0.
1905 (Target_aarch64::optimize_tls_reloc): Add new cases for
1906 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1907 TLSLD_MOVW_DTPREL_G0_NC.
1908 (Target_aarch64::possible_function_pointer_reloc): Implement this
1909 method.
1910 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1911 comment.
1912 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1913 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1914 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1915 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1916 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1917 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1918 (Target_aarch64::make_plt_entry): Call add_entry with two more
1919 parameters.
1920 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1921 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1922 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1923 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1924 (Target_aarch64::Relocate::relocate_tls): Add cases for
1925 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1926 TLSLD_MOVW_DTPREL_G0_NC.
1927 * testsuite/icf_safe_so_test.cc: Correct test comment.
1928 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1929
1930 2014-10-22 Alan Modra <amodra@gmail.com>
1931
1932 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1933 thread_starter.
1934
1935 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1936
1937 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1938
1939 2014-10-17 Cary Coutant <ccoutant@google.com>
1940
1941 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1942 Add "typename" keyword.
1943
1944 2014-10-15 Han Shen <shenhan@google.com>
1945 Jing Yu <jingyu@google.com>
1946
1947 Patch for gold aarch64 backend to support relaxation.
1948 * aarch64-reloc.def: Change format.
1949 * aarch64.cc (class Reloc_stub): New class.
1950 (class Stub_table): New class.
1951 (class AArch64_relobj): New class.
1952 (class AArch64_input_section): New class.
1953 (class AArch64_output_section): New class.
1954 (Target_aarch64::new_stub_table): New method.
1955 (Target_aarch64::new_aarch64_input_section): New method.
1956 (Target_aarch64::find_aarch64_input_section): New method.
1957 (Target_aarch64::scan_section_for_stubs): New method.
1958 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1959 (Target_aarch64::relocate_stub): New method.
1960 (Target_aarch64::current_target): New method.
1961 (Target_aarch64::do_make_elf_object): New method.
1962 (Target_aarch64::do_may_relax): New method.
1963 (Target_aarch64::do_relax): New method.
1964 (Target_aarch64::group_sections): New method.
1965 (Target_aarch64::scan_reloc_for_stub): New method.
1966 (Target_aarch64::do_make_output_section): New method.
1967 (Target_aarch64::stub_tables_): New data member.
1968 (Target_aarch64::aarch64_input_section_map_): New data member.
1969 (AArch64_relocate_functions::maybe_apply_stub): New method.
1970
1971 2014-09-30 Cary Coutant <ccoutant@google.com>
1972
1973 PR gold/17432
1974 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1975
1976 2014-09-30 Kito Cheng <kito@0xlab.org>
1977
1978 PR gold/13597
1979 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1980 hash table before sysv-style hash table.
1981
1982 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1983
1984 * options.h (--pic-executable): Add negative to alias to -no-pie.
1985
1986 2014-09-26 Cary Coutant <ccoutant@google.com>
1987
1988 PR gold/16773
1989 * object.cc (Sized_relobj_file): Compute value of section symbols
1990 for TLS sections the same as TLS symbols.
1991
1992 2014-09-25 Cary Coutant <ccoutant@google.com>
1993
1994 PR gold/17432
1995 * resolve.cc (Symbol_table::resolve): Override common placeholder
1996 symbols, but adjust sizes.
1997 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1998 symbols to common lists.
1999
2000 2014-09-24 Alan Modra <amodra@gmail.com>
2001
2002 * po/POTFILES.in: Regenerate.
2003
2004 2014-09-23 Taiju Tsuiki <tzik@google.com>
2005 Cary Coutant <ccoutant@google.com>
2006
2007 PR gold/14860
2008 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
2009 on input_sections_blocker.
2010 * layout.cc (Write_sections_task::locks): Unblock
2011 input_sections_blocker_.
2012 * layout.h (Write_sections_task::Write_sections_task): Add
2013 input_sections_blocker.
2014 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
2015 to DEPENDENCIES.
2016 * testsuite/Makefile.in: Regenerate.
2017
2018 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2019
2020 * testsuite/Makefile.am (plugin_test_10): New test.
2021 * testsuite/Makefile.in: Regenerate
2022 * testsuite/plugin_common_test_2.c (c1): Align to 8.
2023 * testsuite/plugin_test_10.sh: New file.
2024
2025 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2026
2027 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
2028 * resolve.cc (Symbol_table::resolve): Don't override common symbols
2029 during the replacement phase.
2030
2031 2014-09-17 Han Shen <shenhan@google.com>
2032 Jing Yu <jingyu@google.com>
2033
2034 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
2035 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
2036 * aarch64.cc (Target_aarch64): Add data members
2037 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
2038 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
2039 constructor.
2040 (Target_aarch64::do_reloc_symbol_index): New method.
2041 (Target_aarch64::do_reloc_addend): New method.
2042 (Target_aarch64::add_tlsdesc_info): New method.
2043 (Target_aarch64::do_dynsym_value): New method.
2044 (Target_aarch64::do_make_data_plt): Add new parameters: got,
2045 got_irelative. Pass them to Output_data_plt_aarch64_standard.
2046 (Target_aarch64::make_data_plt): Add new parameters: got,
2047 got_irelative. Pass them to do_make_data_plt.
2048 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
2049 (Target_aarch64::Relocate:tls_gd_to_le): New method.
2050 (Target_aarch64::Relocate:tls_ie_to_le): New method.
2051 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
2052 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
2053 (Target_aarch64::got_tlsdesc_section): New method.
2054 (Target_aarch64::make_local_ifunc_plt_entry): New method.
2055 (Target_aarch64::define_tls_base_symbol): New method.
2056 (Target_aarch64::reserve_tlsdesc_entries): New method.
2057 (Target_aarch64::got_mod_index_entry): New method.
2058 (Target_aarch64::rela_tlsdesc_section): New method.
2059 (Target_aarch64::rela_irelative_section): New method.
2060 (Target_aarch64::Tlsdesc_info): New struct.
2061 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
2062 relocations and tlsdesc relocations.
2063 (Target_aarch64::optimize_tls_reloc): Implement method.
2064 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
2065 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
2066 in constructor.
2067 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
2068 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
2069 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
2070 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
2071 (Output_data_plt_aarch64::rela_tlsdesc): New method.
2072 (Output_data_plt_aarch64::rela_irelative): New method.
2073 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
2074 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
2075 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
2076 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
2077 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
2078 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
2079 (Output_data_plt_aarch64_standard): New member variables:
2080 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
2081 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
2082 New parameter: got, got_irelative.
2083 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
2084 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
2085 (Output_data_plt_aarch64::do_write): Replace got_address with
2086 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
2087 (AArch64_relocate_functions::update_movnz): New method.
2088 (AArch64_relocate_functions): Correct format.
2089 (AArch64_relocate_functions::movnz): New method.
2090 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
2091 before the switch. Add new cases to switch.
2092 Check ie_to_le relaxation on tlsie relocations. Add code handling
2093 tlsgd tlsdesc cases.
2094 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
2095 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
2096 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
2097 Call reloc_name_in_error_message to print unsupported reloc.
2098 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
2099 make_data_plt.
2100 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
2101 relocs. Fill in some more dynamic tags.
2102 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2103 Skip call tls_get_addr when tlsgd is relaxed.
2104 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2105 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2106 tlsdesc->ie relaxation.
2107
2108 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2109
2110 * mips.cc (Target_mips_nacl): New class.
2111 (Target_selector_mips_nacl): New class.
2112 (target_selector_mips32): Rename from target_selector_mips32be and use
2113 Target_selector_mips_nacl instead of Target_selector_mips.
2114 (target_selector_mips32el): Rename from target_selector_mips32 and use
2115 Target_selector_mips_nacl instead of Target_selector_mips.
2116 (target_selector_mips64): Rename from target_selector_mips64be and use
2117 Target_selector_mips_nacl instead of Target_selector_mips.
2118 (target_selector_mips64el): Rename from target_selector_mips64 and use
2119 Target_selector_mips_nacl instead of Target_selector_mips.
2120 (Target_mips::mips_info): Add const attribute.
2121
2122 2014-09-02 Cary Coutant <ccoutant@google.com>
2123
2124 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2125 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2126 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2127 (Sized_incr_dynobj::do_section_name): Likewise.
2128 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2129 (Sized_incr_dynobj::do_section_name): Likewise.
2130 * object.h (Object::section_name): Likewise.
2131 (Object::do_section_name): Likewise.
2132 (Sized_relobj_file::do_section_name): Likewise.
2133 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2134 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2135
2136 2014-09-02 Cary Coutant <ccoutant@google.com>
2137
2138 PR gold/17005
2139 * ehframe.cc (Fde::write): Add output_offset parameter.
2140 (Cie::write): Likewise.
2141 (Eh_frame::set_final_data_size): Account for offset within output
2142 section.
2143 (Eh_frame::do_sized_write): Likewise.
2144 * ehframe.h (Fde::write): Add output_offset parameter.
2145 (Cie::write): Likewise.
2146 * output.cc (Output_section::Input_section_sort_entry): Remove
2147 section_has_name_; add output_section_name parameter. Use
2148 output section name for non-input sections.
2149 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2150 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2151 (Output_section::Input_section_sort_compare): Remove logic for
2152 sections without names.
2153 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2154 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2155 Likewise.
2156 (Output_section::Input_section_sort_section_name_compare): Likewise.
2157
2158 2014-08-29 Han Shen <shenhan@google.com>
2159 Jing Yu <jingyu@google.com>
2160
2161 * aarch64-reloc-property.cc
2162 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2163 reference reloc property in the table.
2164 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2165 3 other entries.
2166 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2167 2 new overloaded methods.
2168 (Output_data_got_aarch64::do_write): Add code to write out
2169 static relocs.
2170 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2171 static relocs.
2172 (Output_data_got_aarch64::static_relocs): New vector to
2173 hold static relocs.
2174 (Target_aarch64::TCB_SIZE): New const static memeber.
2175 (Target_aarch64::tcb_size): New method.
2176 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2177 (Target_aarch64::Relocate::relocate_tls): New method.
2178 (Target_aarch64::Scan::local): Add code handling new reloc types.
2179 (Target_aarch64::Scan::global): Add code handling new reloc types.
2180
2181 2014-08-13 Sriraman Tallam <tmsriram@google.com>
2182
2183 * options.h (-no-pie): Add option.
2184
2185 2014-08-08 Jing Yu <jingyu@google.com>
2186 Han Shen <shenhan@google.com>
2187
2188 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2189 (DEFFILES): add aarch64-reloc.def.
2190 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2191 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2192 * Makefile.in: Regenerate.
2193 * aarch64-reloc-property.cc: New file.
2194 * aarch64-reloc-property.h: New file.
2195 * aarch64-reloc.def: New file.
2196 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2197 with tab to make the format consistent.
2198 (Output_data_got_aarch64::symbol_table_): New method.
2199 (Target_aarch64::do_plt_address_for_global): New method.
2200 (Target_aarch64::do_plt_address_for_local): New method.
2201 (Target_aarch64::do_select_as_default_target): New method.
2202 (Target_aarch64::do_make_data_plt): New method.
2203 (Target_aarch64::make_data_plt): New method.
2204 (Output_data_plt_aarch64::has_irelative_section): New method.
2205 (Output_data_plt_aarch64::address_for_global): New method.
2206 (Output_data_plt_aarch64::address_for_local): New method.
2207 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2208 (Output_data_plt_aarch64::add_entry): Implement contents.
2209 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2210 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2211 the got_pov entry to plt0.
2212 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2213 Implement contents.
2214 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2215 (AArch64_howto): New struct.
2216 (aarch64_howto[]): New static const array.
2217 (AArch64_relocate_functions): New class.
2218 (Target_aarch64::Scan::get_reference_flags): Remove method.
2219 (Target_aarch64::Scan::local): Implement to support a few relocations.
2220 (Target_aarch64::Scan::global): Implement to support a few relocations.
2221 (Target_aarch64::make_plt_section): Implement contents.
2222 (Target_aarch64::make_plt_entry): Implement contents.
2223 (Target_aarch64::do_finalize_sections): Implement contents.
2224 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2225 (Target_aarch64::relocate_section): Implement contents.
2226
2227 2014-08-06 Alan Modra <amodra@gmail.com>
2228
2229 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2230
2231 2014-08-06 Alan Modra <amodra@gmail.com>
2232
2233 PR 13227
2234 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2235
2236 2014-07-21 Sriraman Tallam <tmsriram@google.com>
2237
2238 * object.cc (Relobj::is_section_name_included): Add
2239 ".rodata.nptl_version" to not garbage collect this section.
2240
2241 2014-07-08 Cary Coutant <ccoutant@google.com>
2242
2243 * expression.cc (struct Expression::Expression_eval_info): Add
2244 new fields type_pointer, vis_pointer, and nonvis_pointer.
2245 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2246 nonvis_pointer parameters. Adjust all calls.
2247 (Symbol_expression::value): Update type, visibility, and nonvis bits
2248 in caller.
2249 * script.cc (Symbol_assignment::sized_finalize): Update type,
2250 visibility, and remaining st_other bits for new symbol.
2251 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2252 vis_pointer, and nonvis_pointer parameters.
2253 * symtab.h (Symbol::set_type): New method.
2254
2255 * testsuite/Makefile.am (defsym_test): New test.
2256 * testsuite/Makefile.in: Regenerate.
2257 * testsuite/defsym_test.c: New file.
2258 * testsuite/defsym_test.sh: New file.
2259
2260 2014-07-08 Cary Coutant <ccoutant@google.com>
2261
2262 PR gold/15639
2263 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2264 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2265 (Sized_dynobj::base_read_symbols): ...new method.
2266 * object.h (Sized_relobj_file::base_read_symbols): New method.
2267 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2268 (Sized_relobj_file::base_read_symbols): ...new method.
2269 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2270 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2271 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2272
2273 2014-07-04 Alan Modra <amodra@gmail.com>
2274
2275 * po/POTFILES.in: Regenerate.
2276
2277 2014-07-02 Jing Yu <jingyu@google.com>
2278
2279 * aarch64.cc: New file
2280 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2281 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2282 * Makefile.in: Regenerate.
2283 * configure.tgt: Add entries for aarch64*.
2284 * configure.ac: Likewise.
2285 * configure: Likewise.
2286
2287 2014-06-27 Alan Modra <amodra@gmail.com>
2288
2289 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2290
2291 2014-06-24 Cary Coutant <ccoutant@google.com>
2292
2293 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2294 sections.
2295 (Dwo_file::sized_read_unit_index): Likewise.
2296
2297 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2298
2299 * mips.cc: New file.
2300 * Makefile.am (TARGETSOURCES): Add mips.cc
2301 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2302 * configure.tgt: Add entries for mips*.
2303 * configure.ac: Likewise.
2304 * Makefile.in: Regenerate.
2305 * configure: Likewise.
2306
2307 2014-06-09 Cary Coutant <ccoutant@google.com>
2308
2309 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2310 unit_length is within section bounds.
2311
2312 2014-06-09 Cary Coutant <ccoutant@google.com>
2313
2314 PR gold/16980
2315 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2316 map.
2317
2318 2014-06-07 Alan Modra <amodra@gmail.com>
2319
2320 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2321
2322 2014-06-06 Cary Coutant <ccoutant@google.com>
2323
2324 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2325 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2326 (Dwarf_pubnames_table::read_header): Likewise.
2327 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2328 .debug_gnu_pubtypes.
2329
2330 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2331
2332 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2333 * Makefile.in, configure: Regenerate.
2334
2335 2014-06-03 Alan Modra <amodra@gmail.com>
2336
2337 * powerpc.cc (addis_12_2): Define.
2338 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2339
2340 2014-06-03 Alan Modra <amodra@gmail.com>
2341
2342 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2343 st_other output.
2344
2345 2014-06-02 Alan Modra <amodra@gmail.com>
2346
2347 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2348 Only ignore relocs on ELFv1.
2349 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2350
2351 2014-05-30 Cary Coutant <ccoutant@google.com>
2352
2353 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2354 * testsuite/Makefile.in: Regenerate.
2355 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2356
2357 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2358
2359 PR gold/16945
2360 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2361 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2362
2363 2014-05-15 Alan Modra <amodra@gmail.com>
2364
2365 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2366 Compare FDE contents with DW_CFA_nop rather than 0.
2367
2368 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2369
2370 * symtab.h (may_need_copy_reloc): Remove check for position independent
2371 code.
2372 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2373 position independence before pc absolute may_need_copy_reloc call.
2374 Add check for executable output befor pc relative may_need_copy_reloc
2375 call.
2376 * i386.cc: Ditto.
2377 * arm.cc: Ditto.
2378 * sparc.cc: Ditto.
2379 * tilegx.cc: Ditto.
2380 * powerpc.cc: Add check for no position independence before
2381 may_need_copy_reloc calls.
2382 * testsuite/pie_copyrelocs_test.cc: New file.
2383 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2384 * Makefile.am (pie_copyrelocs_test): New test.
2385 * Makefile.in: Regenerate.
2386
2387 2014-05-08 Martin Liška <mliska@suse.cz>
2388
2389 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2390
2391 2014-05-06 Cary Coutant <ccoutant@google.com>
2392
2393 PR gold/16900
2394 * i386.cc (Output_data_got_plt_i386): New class.
2395 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2396 parameter. Change all callers.
2397 (Output_data_plt_i386::layout_): Remove.
2398 (Output_data_plt_i386::got_plt_): Change type.
2399 (Target_i386::got_plt_): Change type. Change all references.
2400 (Target_i386::got_section): Create instance of new class.
2401 (Output_data_got_plt_i386::do_write): New function.
2402 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2403 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2404 parameter. Change all callers.
2405 (Output_data_plt_x86_64::layout_): Remove.
2406 (Output_data_plt_x86_64::got_plt_): Change type.
2407 (Target_x86_64::got_plt_): Change type. Change all references.
2408 (Target_x86_64::got_section): Create instance of new class.
2409 (Output_data_got_plt_x86_64::do_write): New function.
2410 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2411 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2412 class.
2413
2414 2014-05-05 Cary Coutant <ccoutant@google.com>
2415
2416 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2417 if we have pubnames/pubtypes.
2418
2419 2014-05-02 Cary Coutant <ccoutant@google.com>
2420
2421 * defstd.cc (in_segment): Define __ehdr_start here...
2422 * layout.cc (Layout::finalize): ...Instead of here. Set the
2423 output segment when known.
2424 * resolve.cc (Symbol::override_base_with_special): Remember
2425 the original binding.
2426 * symtab.cc (Symbol::set_output_segment): New function.
2427 (Symbol::set_undefined): New function.
2428 * symtab.h (Symbol::is_weak_undefined): Check original undef
2429 binding.
2430 (Symbol::is_strong_undefined): New function.
2431 (Symbol::set_output_segment): New function.
2432 (Symbol::set_undefined): New function.
2433 * target-reloc.h (is_strong_undefined): Remove.
2434 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2435 Check for hidden undefs.
2436 (relocate_section): Call Symbol::is_strong_undefined.
2437
2438 * testsuite/Makefile.am (ehdr_start_test_1)
2439 (ehdr_start_test_2, ehdr_start_test_3)
2440 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2441 * testsuite/Makefile.in: Regenerate.
2442 * testsuite/ehdr_start_def.cc: New source file.
2443 * testsuite/ehdr_start_test.cc: New source file.
2444 * testsuite/ehdr_start_test.t: New linker script.
2445 * testsuite/ehdr_start_test_4.sh: New shell script.
2446
2447 2014-04-23 Cary Coutant <ccoutant@google.com>
2448
2449 PR gold/16870
2450 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2451
2452 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2453
2454 * layout.cc (Layout::include_section): Allow a target to decide
2455 whether to include a section.
2456 * target.h (Target::should_include_section): New function.
2457 (Target::do_should_include_section): New function.
2458
2459 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2460
2461 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2462 inline into ...
2463 (Copy_relocs::emit): ... here.
2464 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2465 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2466 (Copy_reloc_entry::entries_): Change from private to protected.
2467
2468 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2469
2470 * icf.cc (get_section_contents): Replace copies of reloc
2471 vectors with const references.
2472
2473 2014-04-02 Cary Coutant <ccoutant@google.com>
2474
2475 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2476 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2477 * configure: Regenerate.
2478 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2479 -fno-use-linker-plugin.
2480 (LINK1, CXXLINK1): Add it to the link command.
2481 * testsuite/Makefile.in: Regenerate.
2482
2483 2014-03-12 Alan Modra <amodra@gmail.com>
2484
2485 * Makefile.in: Regenerate.
2486
2487 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2488
2489 * symtab.h (Symbol::set_nonvis): New function.
2490
2491 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2492
2493 * symtab.cc (Sized_symbol<32>::init_output_data):
2494 Instantiate the template.
2495 (Sized_symbol<64>::init_output_data): Likewise.
2496
2497 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2498
2499 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2500 adjust dynamic symbol value.
2501 * target.h (Target::adjust_dyn_symbol): New function.
2502 (Target::do_adjust_dyn_symbol): New function.
2503
2504 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2505
2506 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2507 Get the value of DYNAMIC_CUSTOM dynamic entry.
2508 * output.h (Output_data_dynamic::add_custom): New function.
2509 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2510 dynamic entry.
2511 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2512 * target.h (Target::dynamic_tag_custom_value): New function.
2513 (Target::do_dynamic_tag_custom_value): New function.
2514
2515 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2516
2517 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2518 dynsym indexes.
2519 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2520 (Target::do_has_custom_set_dynsym_indexes): New function.
2521 (Target::set_dynsym_indexes): New function.
2522 (Target::do_set_dynsym_indexes): New function.
2523
2524 2014-03-07 Alan Modra <amodra@gmail.com>
2525
2526 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2527 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2528 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2529 (Powerpc_relocate_functions::has_overflow_bitfield,
2530 overflowed): Use the above.
2531 (Target_powerpc::Relocate::relocate): Correct overflow checking
2532 for a number of relocations. Modify overflow test for 16-bit
2533 fields in instructions to signed/unsigned according to whether
2534 the field takes a signed or unsigned value.
2535
2536 2014-03-05 Alan Modra <amodra@gmail.com>
2537
2538 Update copyright years.
2539
2540 2014-03-05 Alan Modra <amodra@gmail.com>
2541
2542 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2543 R_PPC64_ADDR64_LOCAL.
2544 (Target_powerpc::Relocate::relocate): Likewise.
2545
2546 2014-03-03 Alan Modra <amodra@gmail.com>
2547
2548 * dwp.cc (print_version): Update copyright year to current.
2549
2550 2014-02-10 Alan Modra <amodra@gmail.com>
2551
2552 * po/gold.pot: Regenerate.
2553
2554 2014-02-06 Cary Coutant <ccoutant@google.com>
2555
2556 Fix problem where -u is ignored when a weak undef is seen.
2557
2558 * archive.cc (Library_base::should_include_member): Reorder
2559 code to check for -u option if a weak undef has already been seen.
2560 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2561 * testsuite/Makefile.in: Regenerate.
2562 * testsuite/weak_undef_file3.cc: New file.
2563 * testsuite/weak_undef_file4.cc: New file.
2564 * testsuite/weak_undef_test_2.cc: New file.
2565
2566 2014-02-05 Cary Coutant <ccoutant@google.com>
2567
2568 Fix issues with gold undefined symbol diagnostics.
2569
2570 PR binutils/15435
2571 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2572 check to here.
2573 * target-reloc.h (is_strong_undefined): New function.
2574 (relocate_section): Move undef vtable symbol check from here.
2575 Check for is_strong_undefined.
2576
2577 2014-02-05 Cary Coutant <ccoutant@google.com>
2578
2579 Fix problems with the --dynamic-list option.
2580
2581 PR gold/13577
2582 * options.cc (General_options::parse_dynamic_list):
2583 Set have_dynamic_list_.
2584 (General_options::General_options): Initialize have_dynamic_list_.
2585 (General_options::finalize): Turn off -Bsymbolic and
2586 -Bsymbolic-functions if --dynamic-list provided.
2587 * options.h (General_options::have_dynamic_list): New function.
2588 (General_options::have_dynamic_list_): New data member.
2589 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2590 correctly.
2591
2592 PR gold/16530
2593 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2594 in --dynamic-list, mark it.
2595
2596 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2597 (dynamic_list_2): New test case.
2598 * testsuite/Makefile.in: Regenerate.
2599 * testsuite/dynamic_list_2.cc: New file.
2600 * testsuite/dynamic_list_2.t: New file.
2601 * testsuite/dynamic_list_lib1.cc: New file.
2602 * testsuite/dynamic_list_lib2.cc: New file.
2603 * testsuite/gc_dynamic_list_test.c: New file.
2604 * testsuite/gc_dynamic_list_test.sh: New file.
2605 * testsuite/gc_dynamic_list_test.t: New file.
2606
2607 2014-01-28 Cary Coutant <ccoutant@google.com>
2608
2609 Add .gdb_index version 7 support.
2610
2611 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2612 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2613 debug sections.
2614 (Dwarf_ranges_table::read_ranges_table): Likewise.
2615 (Dwarf_pubnames_table::read_section): Check for GNU-style
2616 sections, and for compressed debug sections.
2617 (Dwarf_pubnames_table::read_header): Compute end address of table.
2618 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2619 for end of list by offset, not by offset == 0.
2620 (Dwarf_info_reader::do_read_string_table): Check for compressed
2621 debug sections.
2622 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2623 Initialize new data members.
2624 (Dwarf_pubnames_table::next_name): return flag_byte.
2625 (Dwarf_pubnames_table::end_of_table_): New data member.
2626 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2627 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2628 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2629 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2630 read skeleton type unit DIEs.
2631 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2632 (Gdb_index::do_write): Write flag_byte.
2633 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2634 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2635 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2636 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2637
2638 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2639
2640 * version.cc (print_version): Update copyright year to 2014.
2641
2642 2013-12-19 Dimitry Andric <dimitry@andric.com>
2643
2644 * stringpool.cc (Stringpool_template::reserve): Add
2645 HAVE_UNORDERED_MAP case.
2646 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2647
2648 2013-12-18 Cary Coutant <ccoutant@google.com>
2649
2650 * configure.ac: Check for <unordered_set> and <unordered_map>.
2651 * config.in: Regenerate.
2652 * configure: Regenerate.
2653 * system.h: Use <unordered_set> and <unordered_map> if available.
2654
2655 2013-12-10 Roland McGrath <mcgrathr@google.com>
2656
2657 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2658 with $(INSTALL_PROGRAM_ENV).
2659 * Makefile.in: Regenerate.
2660
2661 2013-11-22 Cary Coutant <ccoutant@google.com>
2662
2663 * configure.ac: Add check for which library is needed for
2664 dlopen.
2665 * configure: Regenerate.
2666
2667 2013-11-22 Cary Coutant <ccoutant@google.com>
2668
2669 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2670 assembler.
2671 * testsuite/Makefile.in: Regenerate.
2672
2673 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2674
2675 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2676 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2677 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2678 (Target_x86_64<size>::Scan::local): Likewise.
2679 (Target_x86_64<size>::Scan::global): Likewise.
2680 (Target_x86_64<size>::Relocate::relocate): Likewise.
2681 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2682 Likewise.
2683 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2684 R_X86_64_PC32_BND.
2685
2686 * testsuite/Makefile.am (check_PROGRAMS): Add
2687 exception_x86_64_bnd_test.
2688 (exception_x86_64_bnd_test_SOURCES): New macro.
2689 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2690 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2691 (exception_x86_64_bnd_test_LDADD): Likewise.
2692 (exception_x86_64_bnd_1.o): New rule.
2693 (exception_x86_64_bnd_2.o): Likewise.
2694 * testsuite/Makefile.in: Regenerated.
2695
2696 2013-11-15 Alan Modra <amodra@gmail.com>
2697
2698 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2699 accessor.
2700 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2701 Only call ppc64_local_entry_offset for 64-bit. Restrict
2702 symval_for_branch lookup to ELFv1.
2703 (Stub_table::add_plt_call_entry): Use unsigned int off.
2704 (Output_data_glink::Address, invalid_address): New.
2705 (Output_data_glink::add_eh_frame): Move out of line. Add
2706 support for ELFv2.
2707 (Output_data_glink::add_global_entry, find_global_entry,
2708 global_entry_address): New functions.
2709 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2710 ge_size): New variables.
2711 (Output_data_glink::set_final_data_size): Add global entry
2712 stub sizing.
2713 (Output_data_glink::do_write): Write global entry stubs.
2714 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2715 parameter. Return true for ELFv2. Adjust callers.
2716 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2717 ELFv1. Similarly for ifunc and dynamic relocation processing
2718 specific to ELFv1. Recognize that symbols are defined on
2719 their plt entries for ELFv2.
2720 (Target_powerpc::symval_for_branch): Assert if called for
2721 ELFv2 or ppc32.
2722 (Target_powerpc::Relocate::relocate): Use global entry plt
2723 stub for symbol value if such exists on ELFv2.
2724 (Target_powerpc::Relocate::relocate): Don't call
2725 symval_for_branch when ELFv2. Do adjust for local entry
2726 offset when ELFv2.
2727 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2728 plt stub for ELFv2.
2729 (Target_powerpc::do_plt_address_for_global): Similarly.
2730
2731 2013-11-14 Cary Coutant <ccoutant@google.com>
2732
2733 Revert patch -- this did not fix the problem, and there is
2734 no race there.
2735
2736 2013-11-14 Cary Coutant <ccoutant@google.com>
2737
2738 PR gold/14860
2739 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2740 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2741 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2742 updating fde_offsets_.
2743 (Eh_frame_hdr::lock_): New data member.
2744
2745 2013-11-14 Cary Coutant <ccoutant@google.com>
2746
2747 * dwp.cc (Dwo_file_entry): New type.
2748 (File_list): Use Dwo_file_entry.
2749 (Dwo_file::verify): New function.
2750 (Dwo_file::verify_dwo_list): New function.
2751 (Dwo_file::sized_verify_dwo_list): New function.
2752 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2753 list.
2754 (Dwp_options): New enum type.
2755 (dwp_options): Add --verify-only.
2756 (usage): Likewise.
2757 (main): Likewise.
2758 * dwp.h (gold_info): Add declaration.
2759
2760 2013-11-14 Cary Coutant <ccoutant@google.com>
2761
2762 PR gold/14860
2763 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2764 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2765 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2766 updating fde_offsets_.
2767 (Eh_frame_hdr::lock_): New data member.
2768
2769 2013-11-06 Cary Coutant <ccoutant@google.com>
2770
2771 PR gold/15758
2772 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2773 before reloc sections.
2774
2775 2013-11-04 Alan Modra <amodra@gmail.com>
2776
2777 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2778 (Symbol::needs_dynamic_reloc): Test new flag.
2779 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2780 (Target_powerpc::Scan::get_reference_flags): Add target param.
2781 Return FUNC_DESC_ABI for 64-bit ELFv1.
2782 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2783 call.
2784 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2785 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2786
2787 2013-10-31 Cary Coutant <ccoutant@google.com>
2788
2789 Restore support for dwp v2 DWARF package file format.
2790
2791 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2792 tu_length parameter. Adjust all callers.
2793 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2794 * dwp.cc: Include dwarf.h.
2795 (Section_bounds): New struct type.
2796 (Unit_set): New struct type.
2797 (Dwo_file::Dwo_file): Initialize new data member.
2798 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2799 Combine and rename to...
2800 (Dwo_file::read_unit_index): ...this.
2801 (Dwo_file::sized_read_compunit_index)
2802 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2803 (Dwo_file::sized_read_unit_index): ...this.
2804 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2805 parameters; add section_id parameter.
2806 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2807 (Dwo_file::add_unit_set): ...this.
2808 (Dwo_file::shndx_map_): Remove.
2809 (Dwo_file::sect_offsets_): New data member.
2810 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2811 (Dwp_output_file::add_section): Rename to...
2812 (Dwp_output_file::add_contribution): ...this.
2813 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2814 (Dwp_output_file::add_tu_set): Likewise.
2815 (Dwp_output_file::Contribution): New type.
2816 (Dwp_output_file::Section::contributions): New data member.
2817 (Dwp_output_file::Cu_or_tu_set): Remove.
2818 (Dwp_output_file::Section::Section): New ctor.
2819 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2820 (Dwp_output_file::Dwp_index::Section_table): New type.
2821 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2822 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2823 parameter.
2824 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2825 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2826 (Dwp_output_file::Dwp_index::section_table): New member function.
2827 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2828 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2829 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2830 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2831 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2832 (Dwp_output_file::Dwp_index::section_table_): New data member.
2833 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2834 (Dwp_output_file::add_output_section): New member function.
2835 (Dwp_output_file::write_new_section): New member function.
2836 (Dwp_output_file::write_contributions): New member function.
2837 (Dwp_output_file::section_id_map_): New data member.
2838 (class Dwo_id_info_reader): Remove.
2839 (class Unit_reader): New class.
2840 (get_dwarf_section_name): New function.
2841 (Dwo_file::read_executable): Adjust initializations of class data.
2842 (Dwo_file::read): Add support for v2 package file format.
2843 (Dwo_file::read_unit_index): Likewise.
2844 (Dwo_file::sized_read_unit_index): Likewise.
2845 (Dwo_file::copy_section): Likewise.
2846 (Dwo_file::add_unit_set): Likewise.
2847 (Dwp_output_file::add_output_section): Likewise.
2848 (Dwp_output_file::add_contribution): Likewise.
2849 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2850 for empty slot.
2851 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2852 file format.
2853 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2854 slot.
2855 (Dwp_output_file::initialize): Remove unused function.
2856 (Dwp_output_file::finalize): Add support for v2 package file format.
2857 (Dwp_output_file::write_index): Likewise.
2858 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2859 function prototype.
2860
2861 2013-10-31 Cary Coutant <ccoutant@google.com>
2862
2863 * configure.ac: Fix check for -fmerge-constants.
2864 * configure.ac: Regenerate.
2865
2866 2013-10-30 Roland McGrath <mcgrathr@google.com>
2867
2868 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2869 Correct 9-byte nop sequence to match what the assembler generates.
2870
2871 2013-10-30 Alan Modra <amodra@gmail.com>
2872
2873 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2874 ppc64_local_entry_offset, ppc64_local_entry_offset,
2875 do_read_symbols): New functions.
2876 (Powerpc_relobj::e_flags_, st_other_): New vars.
2877 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2878 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2879 (Powerpc_relobj::e_flags_): New var.
2880 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2881 and adjust for ELFv2.
2882 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2883 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2884 (Powerpc_dynobj::do_find_special_sections): Likewise.
2885 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2886 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2887 to ELFv2 local entry.
2888 (Target_powerpc::do_relax): No thread safe barriers needed for
2889 ELFv2.
2890 (Output_data_plt_powerpc::initial_plt_entry_size_,
2891 plt_entry_size): Delete. Replace all uses with
2892 first_plt_entry_offset() and plt_entry_size().
2893 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2894 reserved_size parm. Update callers.
2895 (Output_data_plt_powerpc::entry_count): Update.
2896 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2897 and use Target_powerpc::first_plt_entry_offset().
2898 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2899 rename to plt_entry_size.
2900 (Output_data_plt_powerpc::add_ifunc_entry,
2901 add_local_ifunc_entry): Adjust reloc for ELFv2.
2902 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2903 (glink_eh_frame_fde_64v2): New.
2904 (Stub_table::plt_call_size): Support ELFv2 sizing.
2905 (Output_data_glink::add_eh_frame): Use the new FDE.
2906 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2907 (Stub_table::do_write): Write ELFv2 stubs and glink.
2908 (Target_powerpc::Relocate::relocate): Replaces nop after call
2909 with ld 2,24(1) and adjust local offset destination for ELFv2.
2910
2911 2013-10-30 Alan Modra <amodra@gmail.com>
2912
2913 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2914 (Target_powerpc::Scan::global, local): Likewise.
2915 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2916 on all ppc64 @h and @ha relocs.
2917
2918 2013-10-14 Alan Modra <amodra@gmail.com>
2919
2920 * output.h (Output_data_got::add_constant): Tidy.
2921 (Output_data_got::add_constant_pair): New function.
2922 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2923 methods used so as to first call reserve_ent().
2924
2925 2013-10-11 Roland McGrath <mcgrathr@google.com>
2926
2927 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2928 add_got_entry and add_got_entry_pair.
2929
2930 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2931 (HAVE_PUBNAMES): Likewise.
2932 * configure: Regenerate.
2933
2934 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2935 * testsuite/Makefile.in: Regenerate.
2936
2937 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2938 Remove const from declaration.
2939 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2940 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2941 * output.h (Output_file_header): Remove const from member target_
2942 and corresponding constructor argument.
2943 * output.cc (Output_file_header::Output_file_header): Update prototype.
2944 (Output_file_header::do_sized_write): Use this->target_ in place
2945 of parameters()->target().
2946
2947 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2948
2949 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2950 * configure: Regenerate.
2951 * Makefile.in: Regenerate.
2952 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2953 * testsuite/merge_string_literals_2.c: Likewise.
2954 * testsuite/Makefile.am
2955 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2956 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2957 literal -fmerge-constants.
2958 * testsuite/Makefile.in: Regenerate.
2959
2960 * i386.cc (Target_i386): Remove unused member dynbss_.
2961 * arm.cc (Target_arm): Likewise.
2962 * powerpc.cc (Target_powerpc): Likewise.
2963 * sparc.cc (Target_sparc): Likewise.
2964 * tilegx.cc (Target_tilegx): Likewise.
2965 * x86_64.cc (Target_x86_64): Likewise.
2966 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2967 type_signature_, type_offset_.
2968 * plugin.h (Plugin_hook): Remove unused member layout_.
2969 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2970 mapfile_.
2971 (Read_member): Remove unused members input_objects_, symtab_,
2972 mapfile_, layout_.
2973 (Check_library): Remove unused member symtab_.
2974 * archive.h (Lib_group): Remove unused member lib_.
2975 * archive.cc (Lib_group::Lib_group): Update initializer.
2976 * incremental.h (Incremental_binary): Remove unused member target_.
2977 (Incremental_script_entry): Removed unused member script_.
2978 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2979 * icf.h (Icf): Remove unused member num_tracked_relocs.
2980
2981 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2982 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2983 its only use.
2984 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2985
2986 * archive.h: Use struct rather than class for forward declaration
2987 of Read_symbols_data.
2988
2989 2013-10-07 Cary Coutant <ccoutant@google.com>
2990
2991 PR gold/16010
2992 * testsuite/Makefile.am (icf_test): Fix dependencies.
2993 (icf_safe_test): Likewise.
2994 (icf_safe_so_test): Likewise.
2995 (large_symbol_alignment): Add empty _LDADD rule.
2996 * testsuite/Makefile.in: Regenerate.
2997
2998 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2999
3000 PR gold/15927
3001 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
3002 relocation for R_X86_64_32 on x32.
3003
3004 2013-08-27 Roland McGrath <mcgrathr@google.com>
3005
3006 * output.cc (Output_segment::set_section_addresses): Take new
3007 Target* argument. If target->isolate_execinstr() and the segment
3008 is executable and starts at a target->abi_pagesize() boundary,
3009 pad its end out to a target->abi_pagesize() boundary with code fill.
3010 * output.h (Output_segment::set_section_addresses): Update decl.
3011 * layout.h (Layout::check_output_data_for_reset_values): Take new
3012 argument RELAX_OUTPUTS.
3013 (Layout): New member relax_output_list_.
3014 (Layout::add_relax_output): New method.
3015 * layout.cc (Layout::Layout): Update constructor.
3016 (Layout::reset_relax_output): New method.
3017 (Layout::clean_up_after_relaxation): Call it.
3018 (Layout::prepare_for_relaxation): Update caller.
3019 (Layout::set_segment_offsets): Update callers of set_section_addresses.
3020 Call reset_relax_output before re-processing segments for
3021 isolate_execinstr case.
3022 (Layout::write_data): Handle relax_output_list_.
3023 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
3024 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
3025
3026 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
3027
3028 PR binutils/15834
3029 * object.h: Fix typos.
3030
3031 2013-08-16 Roland McGrath <mcgrathr@google.com>
3032
3033 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
3034 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
3035
3036 2013-08-07 Cary Coutant <ccoutant@google.com>
3037
3038 Revert support for v2 DWP files:
3039
3040 2013-03-01 Cary Coutant <ccoutant@google.com>
3041
3042 Add dwp support for v2 DWARF package file format.
3043 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3044 tu_length parameter. Adjust all callers.
3045 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3046 * dwp.cc: Include dwarf.h.
3047 (Section_bounds): New struct type.
3048 (Unit_set): New struct type.
3049 (Dwo_file::Dwo_file): Initialize new data member.
3050 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3051 Combine and rename to...
3052 (Dwo_file::read_unit_index): ...this.
3053 (Dwo_file::sized_read_compunit_index)
3054 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3055 (Dwo_file::sized_read_unit_index): ...this.
3056 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3057 parameters; add section_id parameter.
3058 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3059 (Dwo_file::add_unit_set): ...this.
3060 (Dwo_file::shndx_map_): Remove.
3061 (Dwo_file::sect_offsets_): New data member.
3062 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3063 (Dwp_output_file::add_section): Rename to...
3064 (Dwp_output_file::add_contribution): ...this.
3065 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3066 (Dwp_output_file::add_tu_set): Likewise.
3067 (Dwp_output_file::Contribution): New type.
3068 (Dwp_output_file::Section::contributions): New data member.
3069 (Dwp_output_file::Cu_or_tu_set): Remove.
3070 (Dwp_output_file::Section::Section): New ctor.
3071 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3072 (Dwp_output_file::Dwp_index::Section_table): New type.
3073 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3074 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3075 parameter.
3076 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3077 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3078 (Dwp_output_file::Dwp_index::section_table): New member function.
3079 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3080 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3081 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3082 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3083 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3084 (Dwp_output_file::Dwp_index::section_table_): New data member.
3085 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3086 (Dwp_output_file::add_output_section): New member function.
3087 (Dwp_output_file::write_new_section): New member function.
3088 (Dwp_output_file::write_contributions): New member function.
3089 (Dwp_output_file::section_id_map_): New data member.
3090 (class Dwo_id_info_reader): Remove.
3091 (class Unit_reader): New class.
3092 (get_dwarf_section_name): New function.
3093 (Dwo_file::read_executable): Adjust initializations of class data.
3094 (Dwo_file::read): Add support for v2 package file format.
3095 (Dwo_file::read_unit_index): Likewise.
3096 (Dwo_file::sized_read_unit_index): Likewise.
3097 (Dwo_file::copy_section): Likewise.
3098 (Dwo_file::add_unit_set): Likewise.
3099 (Dwp_output_file::add_output_section): Likewise.
3100 (Dwp_output_file::add_contribution): Likewise.
3101 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3102 for empty slot.
3103 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3104 file format.
3105 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3106 slot.
3107 (Dwp_output_file::initialize): Remove unused function.
3108 (Dwp_output_file::finalize): Add support for v2 package file format.
3109 (Dwp_output_file::write_index): Likewise.
3110 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3111 function prototype.
3112
3113 2013-07-31 Cary Coutant <ccoutant@google.com>
3114
3115 * object.cc (Sized_relobj::do_output_section_address): New function.
3116 (Sized_relobj): Instantiate explicitly.
3117 * object.h (Object::output_section_address): New function.
3118 (Object::do_output_section_address): New function.
3119 (Sized_relobj::do_output_section_address): New function.
3120 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3121
3122 2013-07-30 Cary Coutant <ccoutant@google.com>
3123 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
3124
3125 * parameters.cc (Parameters::entry): Return target-specific entry
3126 symbol name.
3127 * target.h (Target::entry_symbol_name): New function.
3128 (Target_info::entry_symbol_name): New data member.
3129
3130 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3131 * i386.cc (Target_i386::i386_info): Likewise.
3132 (Target_i386_nacl::i386_nacl_info): Likewise.
3133 * sparc.cc (Target_sparc::sparc_info): Likewise.
3134 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3135 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3136 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3137 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3138
3139 2013-07-22 Sterling Augustine <saugustine@google.com>
3140
3141 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3142 Convert parameter shndx to local variable. Add parameters symtab
3143 and symtab_size. Scan over section names. Find relocation
3144 section corresponding to current section. Create and initialize
3145 reloc_mapper_ and reloc_type_.
3146 (Dwarf_pubnames_table::read_header): Add assertion. Change
3147 unit_length to off_t. Initialize member unit_length_. Fill in field
3148 cu_offset_.
3149 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3150 Initialize new fields unit_length_ and cu_offset_.
3151 (Dwarf_pubnames_table::read_section): Update prototype.
3152 (Dwarf_pubnames_table::cu_offset): New member function.
3153 (Dwarf_pubnames_table::subsection_size): Likewise.
3154 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3155 New fields.
3156 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3157 member functions public.
3158 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3159 Update comment. Rework logic. Move repeated parts to...
3160 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3161 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3162 pubtypes_table_, and stmt_list_offset.
3163 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3164 Gdb_index::find_pubtype_offset,
3165 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3166 (Gdb_index::pubnames_read): Update prototype and rework logic.
3167 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3168 Forward declare.
3169 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3170 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3171 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3172 Gdb_index::map_pubtable_to_dies):
3173 Declare functions.
3174 (Gdb_index::pubnames_read): Update declaration.
3175 (Gdb_index::Pubname_offset_map): New type.
3176 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3177 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3178 Gdb_index::stmt_list_offset): Declare.
3179 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3180 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3181 Gdb_index::pubtypes_offset_): Remove.
3182
3183 2013-07-19 Roland McGrath <mcgrathr@google.com>
3184
3185 * options.h (General_options): Add -Trodata-segment option.
3186 * parameters.cc (Parameters::check_rodata_segment): New function.
3187 (Parameters::set_target_once): Call it.
3188 * parameters.h (Parameters): Declare it (private member function).
3189 * layout.cc (load_seg_unusable_for_headers): New function, broken
3190 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3191 then validate rodata segment rather than text segment.
3192 (relaxation_loop_body): Call that.
3193 (is_text_segment): New function. Don't admit a non-executable
3194 segment if TARGET->isolate_execinstr().
3195 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3196
3197 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
3198
3199 PR gold/15070
3200 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3201 * nacl.h (Sniff_file::View::View): Request aligned view.
3202
3203 2013-07-11 Cary Coutant <ccoutant@google.com>
3204
3205 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3206 correct BRLT entry size.
3207
3208 2013-07-03 Alan Modra <amodra@gmail.com>
3209
3210 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3211 comment.
3212
3213 2013-07-01 Cary Coutant <ccoutant@google.com>
3214
3215 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3216 reloc_type_.
3217 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3218 (Dwarf_ranges_table::lookup_reloc): New function.
3219 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3220 reloc_type_.
3221 (Dwarf_ranges_table::lookup_reloc): New function.
3222 (Dwarf_ranges_table::reloc_type_): New data member.
3223
3224 2013-06-27 Jing Yu <jingyu@google.com>
3225
3226 PR gold/15662
3227 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3228 function.
3229 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3230 (Target_powerpc::do_relax): Call the above.
3231
3232 2013-06-27 Cary Coutant <ccoutant@google.com>
3233
3234 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3235 on garbage collected .opd section.
3236
3237 2013-06-27 Alan Modra <amodra@gmail.com>
3238
3239 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3240 is non-zero.
3241 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3242 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3243
3244 2013-06-14 Cary Coutant <ccoutant@google.com>
3245
3246 * resolve.cc (Symbol::override_base): Don't override st_type
3247 from plugin placeholder symbols.
3248 (Symbol_table::resolve): Likewise.
3249 (Symbol_table::should_override): Don't complain about TLS mismatch
3250 if the TO symbol is a plugin placeholder.
3251 * testsuite/Makefile.am (plugin_test_tls): New test.
3252 * testsuite/Makefile.in: Regenerate.
3253 * testsuite/plugin_test_tls.sh: New test script.
3254 * testsuite/two_file_test_2_tls.cc: New test source.
3255 * testsuite/two_file_test_tls.cc: New test source.
3256
3257 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3258
3259 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3260 the maximum segment alignment is larger than the page size.
3261 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3262 correctly aligns the symbols with large alignemnt.
3263 * testsuite/Makefile.in: Regenerate.
3264 * testsuite/large_symbol_alignment.cc: New file.
3265
3266 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3267 Sriraman Tallam <tmsriram@google.com>
3268
3269 * options.h (sort_section): New option.
3270 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3271 Rename from Input_section_sort_section_name_special_ordering_compare.
3272 (Input_section_sort_section_name_compare): New struct.
3273 * output.cc (Output_section::Input_section_sort_section_name_compare::
3274 operator()): New function.
3275 (Output_section::sort_attached_input_sections): Use new sort function
3276 for .text if --sort-section=name is specified.
3277 * layout.cc (Layout::make_output_section):
3278 Add sorting by name when --sort-section=name is specified.
3279 * testsuite/Makefile.am (text_section_grouping): Test option
3280 --sort-section=name.
3281 * testsuite/Makefile.in: Regenerate.
3282 * testsuite/section_sorting_name.cc: New file.
3283 * testsuite/section_sorting_name.sh: New file.
3284
3285 2013-05-21 Cary Coutant <ccoutant@google.com>
3286
3287 * symtab.h (Symbol::is_cxx_vtable): New function.
3288 * target-reloc.h (relocate_section): Check for vtable symbol.
3289 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3290 * testsuite/Makefile.in: Regenerate.
3291 * testsuite/missing_key_func.cc: New test source.
3292 * testsuite/missing_key_func.sh: New test script.
3293
3294 2013-05-21 Cary Coutant <ccoutant@google.com>
3295
3296 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3297 type of enclosing symbol.
3298 (Relocate_info::location): Check symbol type when describing symbol.
3299 * object.h (Symbol_location_info): Remove unused line_number;
3300 add enclosing_symbol_type.
3301 * testsuite/debug_msg.sh: Adjust expected output.
3302
3303 2013-05-13 Cary Coutant <ccoutant@google.com>
3304
3305 * configure.ac: Export DEFAULT_TARGET.
3306 * configure: Regenerate.
3307 * Makefile.in: Regenerate.
3308 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3309 * testsuite/Makefile.in: Regenerate.
3310 * testsuite/debug_msg.sh: Delete duplicate tests.
3311 Don't check undef_int error message match for powerpc where the
3312 source file and line number aren't available.
3313
3314 2013-05-10 Roland McGrath <mcgrathr@google.com>
3315
3316 * options.h (General_options): Add --rosegment-gap option.
3317 * options.cc (finalize): --rosegment-gap implies --rosegment.
3318 * layout.cc (set_segment_offsets): Let user option override
3319 target->rosegment_gap().
3320
3321 2013-05-10 Roland McGrath <mcgrathr@google.com>
3322
3323 * options.h (General_options): Remove leading space from help
3324 messages for -nostdlib and --rosegment.
3325
3326 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3327
3328 PR ld/15365
3329 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3330
3331 2013-05-03 Alan Modra <amodra@gmail.com>
3332
3333 * merge.cc (Output_merge_string::do_add_input_section): Correct
3334 scan for number of strings. Rename vars to avoid shadowing.
3335 Include missing terminator in input_size_.
3336
3337 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3338
3339 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3340 Restore empty string handling.
3341
3342 2013-05-01 Cary Coutant <ccoutant@google.com>
3343
3344 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3345 uninitialized warning.
3346
3347 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3348
3349 * output.cc (Output_section::add_merge_input_section): Allow
3350 to merge sections if the alignment is more than character size.
3351 * merge.h (Output_merge_string::Output_merge_string): Remove
3352 assert.
3353 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3354 only not-null strings. Check the alignment of strings.
3355 * stringpool.h
3356 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3357 alignment as the argument.
3358 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3359 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3360 Align non-zero length strings according to the addralign_.
3361 (Stringpool_template<Stringpool_char>::set_string_offsets):
3362 Updating offsets according to the given alignment.
3363 * testsuite/Makefile.am (text_section_grouping): Test if string
3364 literals are getting merged.
3365 * testsuite/Makefile.in: Regenerate.
3366 * testsuite/merge_string_literals_1.c: New file.
3367 * testsuite/merge_string_literals_2.c: Ditto.
3368 * testsuite/merge_string_literals.sh: Ditto.
3369
3370 2013-04-26 Ian Lance Taylor <iant@google.com>
3371
3372 * target-reloc.h (relocate_section): If the reloc offset is out of
3373 range, pass VIEW as NULL to relocate.relocate.
3374 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3375 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3376 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3377 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3378 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3379 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3380
3381 2013-04-26 Geoff Pike <gpike@chromium.org>
3382
3383 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3384 * layout.cc (Hash_task): New class.
3385 (Layout::queue_build_id_tasks): New function.
3386 (Layout::write_build_id): Handle single-thread portion of build ID
3387 computation. (In some cases, all of it is single-threaded.) Replace
3388 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3389 functionality in fewer lines of code.
3390 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3391 * options.h (General_options): make "--build-id" default to tree
3392 rather than sha1. Add two new options related to --build-id=tree:
3393 --build-id-chunk-size-for-treehash and
3394 --build-id-min-file-size-for-treehash.
3395 * Makefile.am: add testing of --build-id=tree and related new options
3396 (these tests will be invoked by "make check").
3397 * Makefile.in: Regenerate.
3398
3399 2013-04-25 Alan Modra <amodra@gmail.com>
3400
3401 * configure.tgt: Add powerpcle and powerpc64le.
3402
3403 2013-04-22 Alan Modra <amodra@gmail.com>
3404
3405 PR gold/15355
3406 * layout.cc (Layout::segment_precedes): Allow more than one
3407 segment with the same type and flags.
3408
3409 2013-04-15 Cary Coutant <ccoutant@google.com>
3410
3411 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3412 allocate space in file for BSS sections.
3413
3414 2013-04-15 Cary Coutant <ccoutant@google.com>
3415
3416 * script-sections.cc (Orphan_output_section): Reset address
3417 to zero after each orphaned section for relocatable links.
3418
3419 2013-04-15 Cary Coutant <ccoutant@google.com>
3420
3421 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3422 section starting address for relocatable link.
3423 * testsuite/Makefile.am (script_test_11): New test.
3424 * testsuite/Makefile.in: Regenerate.
3425 * testsuite/script_test_11.c: New source file.
3426 * testsuite/script_test_11.t: New linker script.
3427
3428 2013-04-13 Alan Modra <amodra@gmail.com>
3429
3430 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3431 owner when sections are not adjacent and exceed group size.
3432 (Target_powerpc::group_sections): Handle corner case.
3433 (Target_powerpc::Branch_info::make_stub): Handle case where
3434 stub table doesn't exist due to branches in non-exec sections.
3435 (Target_powerpc::Relocate::relocate): Likewise.
3436
3437 2013-04-11 Alan Modra <amodra@gmail.com>
3438
3439 PR gold/15354
3440 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3441 .branch_lt to match bfd ld. Adjust comments throughout file.
3442
3443 2013-04-04 Ian Lance Taylor <iant@google.com>
3444
3445 GCC PR c++/56840
3446 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3447 sections before checking whether they are included in the link.
3448
3449 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3450
3451 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3452 object before calling the plugin claim_file handler. Pass the elf
3453 object of the archive to the plugin. Delete the elf object if the
3454 plugin claims the file.
3455
3456 2013-03-21 Alan Modra <amodra@gmail.com>
3457
3458 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3459 segment when omagic.
3460
3461 2013-03-21 Alan Modra <amodra@gmail.com>
3462
3463 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3464 comparison warning.
3465 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3466 uninitialized" warning.
3467
3468 2013-03-20 Alan Modra <amodra@gmail.com>
3469
3470 * symtab.h (Symbol::clear_version): New function.
3471 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3472 is_needed by weak references. Clear version for symbols defined
3473 in as-needed objects that are not needed.
3474
3475 2013-03-15 Alan Modra <amodra@gmail.com>
3476
3477 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3478 static and public. Add report_err param. Return false for data refs.
3479 (Target_powerpc::rela_dyn_section): New overloaded function.
3480 (Target_powerpc::plt_, iplt_): Elucidate.
3481 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3482 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3483 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3484 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3485 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3486 push_branch and make_plt_entry for ifunc syms when
3487 reloc_needs_plt_for_ifunc.
3488 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3489 for ifunc unless reloc_needs_plt_for_ifunc.
3490
3491 2013-03-15 Alan Modra <amodra@gmail.com>
3492
3493 * gc.h (gc_process_relocs): Don't look through function descriptors.
3494 * icf.cc (get_section_contents): Do so here instead.
3495
3496 2013-03-13 Alan Modra <amodra@gmail.com>
3497
3498 * powerpc.cc (is_branch_reloc): Forward declare.
3499 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3500 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3501 false for 64-bit, true for 32-bit non-branch relocs.
3502 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3503 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3504 nm output.
3505 (icf_safe_test): Generate linker map file as well as nm output.
3506 (icf_safe_so_test): Likewise.
3507 * testsuite/Makefile.in: Regenerate.
3508 * testsuite/icf_test.sh: Parse linker map file to determine
3509 section folding.
3510 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3511 * testsuite/icf_safe_so_test.sh: Likewise.
3512 (X86_32_or_ARM_specific_safe_fold): Merge into..
3513 (arch_specific_safe_fold): ..this.
3514 (X86_64_specific_safe_fold): Delete unused function.
3515
3516 2013-03-12 Alan Modra <amodra@gmail.com>
3517
3518 * gc.h (gc_process_relocs): Look through function descriptors
3519 to determine shndx, symvalue and addend used by ICF. Tidy
3520 variable duplication.
3521
3522 2013-03-11 Alan Modra <amodra@gmail.com>
3523
3524 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3525 * layout.cc (Layout_task_runner::run): ..to here.
3526 * symtab.h (struct Symbol_location): Extract from..
3527 (class Symbol_table): ..here.
3528 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3529 * target.h (class Target): Add function_location and
3530 do_function_location functions.
3531 (class Sized_target): Add do_function_location.
3532 * object.h (class Sized_relobj_file): Move find_shdr..
3533 (class Object): ..to here.
3534 * object.cc: Likewise. Update to suit. Instantiate.
3535 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3536 * powerpc.cc (class Powerpc_dynobj): New.
3537 (Target_powerpc::do_function_location): New function.
3538 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3539 (Powerpc_dynobj::do_read_symbols): New function.
3540 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3541
3542 2013-03-08 Ian Lance Taylor <iant@google.com>
3543
3544 * options.cc (General_options::string_to_object_format): Accept
3545 "default".
3546
3547 2013-03-08 Alan Modra <amodra@gmail.com>
3548
3549 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3550 pointer to Post_fde.
3551 (struct Post_fde): Move definition to here..
3552 * ehframe.cc (struct Post_fde): ..from here.
3553 (Cie::write): Don't alloc Post_fde.
3554 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3555
3556 2013-03-07 Alan Modra <amodra@gmail.com>
3557
3558 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3559 relocation referencing .LC0.
3560 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3561
3562 2013-03-07 Alan Modra <amodra@gmail.com>
3563
3564 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3565 always_inline. Add assembly for powerpc to avoid GOT.
3566
3567 2013-03-07 Alan Modra <amodra@gmail.com>
3568
3569 * testsuite/script_test_10.sh: Don't test .bss section
3570 header number.
3571
3572 2013-03-06 Alan Modra <amodra@gmail.com>
3573
3574 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3575 (Target_powerpc::symval_for_branch): Add symtab param. Update
3576 all callers. Handle folded sections.
3577 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3578 to Powerpc_relobj.
3579 (Global_symbol_visitor_opd::operator()): Likewise.
3580
3581 2013-03-04 Alan Modra <amodra@gmail.com>
3582
3583 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3584 * testsuite/Makefile.in: Regenerate.
3585
3586 2013-03-01 Cary Coutant <ccoutant@google.com>
3587
3588 Add dwp support for v2 DWARF package file format.
3589 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3590 tu_length parameter. Adjust all callers.
3591 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3592 * dwp.cc: Include dwarf.h.
3593 (Section_bounds): New struct type.
3594 (Unit_set): New struct type.
3595 (Dwo_file::Dwo_file): Initialize new data member.
3596 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3597 Combine and rename to...
3598 (Dwo_file::read_unit_index): ...this.
3599 (Dwo_file::sized_read_compunit_index)
3600 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3601 (Dwo_file::sized_read_unit_index): ...this.
3602 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3603 parameters; add section_id parameter.
3604 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3605 (Dwo_file::add_unit_set): ...this.
3606 (Dwo_file::shndx_map_): Remove.
3607 (Dwo_file::sect_offsets_): New data member.
3608 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3609 (Dwp_output_file::add_section): Rename to...
3610 (Dwp_output_file::add_contribution): ...this.
3611 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3612 (Dwp_output_file::add_tu_set): Likewise.
3613 (Dwp_output_file::Contribution): New type.
3614 (Dwp_output_file::Section::contributions): New data member.
3615 (Dwp_output_file::Cu_or_tu_set): Remove.
3616 (Dwp_output_file::Section::Section): New ctor.
3617 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3618 (Dwp_output_file::Dwp_index::Section_table): New type.
3619 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3620 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3621 parameter.
3622 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3623 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3624 (Dwp_output_file::Dwp_index::section_table): New member function.
3625 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3626 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3627 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3628 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3629 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3630 (Dwp_output_file::Dwp_index::section_table_): New data member.
3631 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3632 (Dwp_output_file::add_output_section): New member function.
3633 (Dwp_output_file::write_new_section): New member function.
3634 (Dwp_output_file::write_contributions): New member function.
3635 (Dwp_output_file::section_id_map_): New data member.
3636 (class Dwo_id_info_reader): Remove.
3637 (class Unit_reader): New class.
3638 (get_dwarf_section_name): New function.
3639 (Dwo_file::read_executable): Adjust initializations of class data.
3640 (Dwo_file::read): Add support for v2 package file format.
3641 (Dwo_file::read_unit_index): Likewise.
3642 (Dwo_file::sized_read_unit_index): Likewise.
3643 (Dwo_file::copy_section): Likewise.
3644 (Dwo_file::add_unit_set): Likewise.
3645 (Dwp_output_file::add_output_section): Likewise.
3646 (Dwp_output_file::add_contribution): Likewise.
3647 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3648 for empty slot.
3649 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3650 file format.
3651 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3652 slot.
3653 (Dwp_output_file::initialize): Remove unused function.
3654 (Dwp_output_file::finalize): Add support for v2 package file format.
3655 (Dwp_output_file::write_index): Likewise.
3656 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3657 function prototype.
3658
3659 2013-03-01 Cary Coutant <ccoutant@google.com>
3660
3661 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3662 function into class definition in header file.
3663 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3664 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3665 New function.
3666 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3667
3668 2013-02-28 Alan Modra <amodra@gmail.com>
3669
3670 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3671 * target.cc (Target::do_plt_fde_location): New function.
3672 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3673 accessor function, and constructor param.
3674 (struct Post_fde, Post_fdes): Declare.
3675 (Cie::write): Add post_fdes param.
3676 * ehframe.cc (Fde::write): Use plt_fde_location.
3677 (struct Post_fde): Define.
3678 (Cie::write): Stash FDEs added post merge mapping.
3679 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3680 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3681 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3682 other FDEs.
3683 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3684 (Target_powerpc::has_glink): New function.
3685 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3686 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3687 glink_eh_frame_fde_32, default_fde): New data.
3688 (Stub_table::eh_frame_added_): New var.
3689 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3690 Make const.
3691 (Stub_table::add_eh_frame): New function.
3692 (Output_data_glink::add_eh_frame): New function.
3693 (Target_powerpc::make_glink_section): Call add_eh_frame.
3694
3695 2013-02-15 Ian Lance Taylor <iant@google.com>
3696
3697 * options.h (DEFINE_uint64_alias): Define.
3698 (class General_options): Add -Ttext-segment as an alias for
3699 -Ttext.
3700
3701 2013-02-15 Alan Modra <amodra@gmail.com>
3702
3703 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3704 (Stub_table::do_write): ..here, two places.
3705 (Stub_table::plt_call_size): Use it here too.
3706
3707 2013-02-11 Ian Lance Taylor <iant@google.com>
3708
3709 * descriptors.cc (Descriptors::close_all): New function.
3710 * descriptors.h (class Descriptors): Declare close_all.
3711 (close_all_descriptors): New inline function.
3712 * plugin.cc: Include "descriptors.h".
3713 (Plugin_manager::cleanup): Call close_all_descriptors.
3714
3715 2013-02-06 Alan Modra <amodra@gmail.com>
3716
3717 * README: Update coding style link.
3718
3719 2013-01-28 Cary Coutant <ccoutant@google.com>
3720
3721 * dwp.cc (File_list): New typedef.
3722 (Dwo_name_info_reader): New class.
3723 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3724 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3725 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3726 (Dwo_file::read_executable): New function.
3727 (Dwo_file::read): Move common setup code to ...
3728 (Dwo_file::make_object): ... here.
3729 (dwp_options): Add --exec/-e.
3730 (usage): Likewise.
3731 (main): Likewise.
3732
3733 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3734
3735 * layout.cc (Layout::layout): Check for option text_reorder.
3736 (Layout::make_output_section): Ditto.
3737 * options.h (text_reorder): New option.
3738 * output.cc (Input_section_sort_compare): Remove special ordering
3739 of section names.
3740 (Output_section::
3741 Input_section_sort_section_name_special_ordering_compare::
3742 operator()): New function.
3743 (Output_section::sort_attached_input_sections): Use new sort function
3744 for .text.
3745 * output.h (Input_section_sort_section_name_special_ordering_compare):
3746 New struct.
3747 * testsuite/Makefile.am (text_section_grouping): Test option
3748 --no-text-reorder
3749 * testsuite/Makefile.in: Regenerate.
3750 * testsuite/text_section_grouping.sh: Check order of functions without
3751 default text reordering.
3752
3753 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3754
3755 * options.h (General_options): Change default to true for new_dtags.
3756
3757 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3758
3759 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3760 when enable_new_dtags is false. Only add DT_RUNPATH when
3761 enable_new_dtags is true.
3762
3763 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3764
3765 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3766 used in declaration and definition consistent.
3767 (Target_powerpc::symval_for_branch): Ditto.
3768
3769 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3770
3771 * testsuite/plugin_final_layout.cc: Fix comment.
3772
3773 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3774
3775 * layout.cc (Layout::layout): Do not do default sorting for
3776 text sections when section ordering is specified.
3777 (make_output_section): Ditto.
3778 * testsuite/plugin_final_layout.cc: Name the function sections
3779 to catch reordering issues.
3780
3781 2013-01-15 Alan Modra <amodra@gmail.com>
3782
3783 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3784 plt-thread-safe.
3785
3786 2013-01-15 Alan Modra <amodra@gmail.com>
3787
3788 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3789 * testsuite/Makefile.in: Regenerate.
3790
3791 2013-01-14 Alan Modra <amodra@gmail.com>
3792
3793 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3794 * testsuite/Makefile.in: Regenerate.
3795
3796 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3797
3798 PR bfd/14430
3799 Fix mingw gold build with plugins enabled
3800 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3801 * configure.ac: Export DLOPEN_LIBS and add headers check.
3802 * plugin.cc: Handle non-dlfcn case.
3803 * Makefile.in: Regenerate.
3804 * config.in: Regenerate.
3805 * configure: Regenerate.
3806 * testsuite/Makefile.in: Regenerate.
3807
3808 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3809
3810 * output.h (sort_attached_input_sections): Change to be public.
3811 * script-sections.cc
3812 (Output_section_definition::set_section_addresses): Sort
3813 attached input sections according to section order before linker
3814 script assigns section addresses.
3815 (Orphan_output_section::set_section_addresses): Sort
3816 attached input sections according to section order before linker
3817 script assigns section addresses.
3818 * Makefile.am (final_layout.sh): Use a simple linker script to
3819 check if section ordering still works.
3820 * Makefile.in: Regenerate.
3821
3822 2013-01-09 Ben Cheng <bccheng@google.com>
3823
3824 * arm.cc (Target_arm::attributes_accept_div): New function.
3825 (Target_arm::attributes_forbid_div): New function.
3826 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3827 attribute using the same new functions as what bfd/elf32_arm.c
3828 does.
3829
3830 2013-01-07 Cary Coutant <ccoutant@google.com>
3831
3832 PR gold/14993
3833 * output.cc (Output_section::add_input_section): For incremental
3834 updates, don't track input sections that are allocated from patch
3835 space.
3836
3837 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3838 Ian Lance Taylor <iant@google.com>
3839
3840 PR gold/14897
3841 * configure.ac (--enable-ld): Removed.
3842 (install_as_default): Set to yes only for --enable-gold=default
3843 or --disable-ld.
3844 * configure: Regenerated.
3845
3846 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3847
3848 * options.h (General_options): Add -fuse-ld= for GCC linker
3849 option compatibility.
3850
3851 2013-01-04 Cary Coutant <ccoutant@google.com>
3852
3853 * configure.ac: Fix typo restoring CXXFLAGS.
3854 * configure: Regenerate.
3855
3856 2013-01-04 Cary Coutant <ccoutant@google.com>
3857
3858 * testsuite/Makefile.am (CXXLINK_S): New macro.
3859 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3860 * testsuite/Makefile.in: Regenerate.
3861
3862 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3863
3864 * version.cc (print_version): Update copyright year to 2013.
3865
3866 2012-12-20 Ian Lance Taylor <iant@google.com>
3867
3868 * layout.cc (Layout::special_ordering_of_input_section): New
3869 function.
3870 (Layout::layout): If input section requires special ordering, must
3871 sort input sections.
3872 (Layout::make_output_section): May sort .text input sections.
3873 (Layout::is_section_name_prefix_grouped): Remove.
3874 * layout.h (class Layout): Declare
3875 special_ordering_of_input_section. Don't declare
3876 is_section_name_prefix_grouped.
3877 * output.cc (Output_section::add_input_section): Revert last
3878 change.
3879 (Output_section::Input_section_sort::match_file_name): Don't crash
3880 if called on output section data.
3881 (Output_section::Input_section_sort_compare): Sort based on
3882 special ordering.
3883 (Output_section::Input_section_sort_section_order_index_compare):
3884 Revert last patch.
3885 (Output_section::sort_attached_input_sections): Likewise.
3886
3887 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3888
3889 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3890 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3891 * output.cc (Output_section::add_input_section): Check if section
3892 name contains special prefix. Keep input sections to sort such
3893 sections.
3894 (Output_section::Input_section_sort_section_order_index_compare
3895 ::operator()): Group sections according to prefixes.
3896 (Output_section::sort_attached_input_sections): Add condition to
3897 Input_section_entry constructor call.
3898 * testsuite/Makefile.am (text_section_grouping): New test.
3899 * testsuite/Makefile.in: Regenerate.
3900 * testsuite/text_section_grouping.cc: New file.
3901 * testsuite/text_section_grouping.sh: New file.
3902
3903 2012-12-17 Nick Clifton <nickc@redhat.com>
3904
3905 * Makefile.am: Add copyright notice.
3906 * NEWS: Likewise.
3907 * README: Likewise.
3908 * configure.ac: Likewise.
3909 * ftruncate.c: Likewise.
3910 * Makefile.in: Regenerate.
3911
3912 2012-12-14 Cary Coutant <ccoutant@google.com>
3913
3914 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3915 --no-as-needed flag.
3916 (exception_separate_shared_12_test): Likewise.
3917 (incremental_copy_test): Likewise.
3918 * testsuite/Makefile.in: Regenerate.
3919
3920 2012-12-14 Cary Coutant <ccoutant@google.com>
3921
3922 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3923 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3924
3925 2012-12-12 Alan Modra <amodra@gmail.com>
3926
3927 * powerpc.cc (class Track_tls): New.
3928 (class Relocate, class Scan): Inherit Track_tls.
3929 (Target_powerpc::Scan::local, global): Track tls optimization
3930 and avoid creating plt entry for __tls_get_addr if all uses
3931 are optimized away.
3932 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3933
3934 2012-12-12 Alan Modra <amodra@gmail.com>
3935
3936 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3937 Replace no_toc_optimize with toc_optimize.
3938 * output.h (Output_section::input_sections): Provide non-const variant.
3939 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3940 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3941 accessors.
3942 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3943 (class Sort_toc_sections): New.
3944 (Target_powerpc::do_finalize_sections): Sort toc sections.
3945 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3946
3947 2012-12-10 Roland McGrath <mcgrathr@google.com>
3948
3949 * testsuite/binary_unittest.cc (read_all): New function.
3950 (Sized_binary_test): Use it instead of ::read.
3951 * fileread.cc (do_read): Don't assume pread always reads the whole
3952 amount in a single call.
3953
3954 2012-12-10 Alan Modra <amodra@gmail.com>
3955
3956 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3957 Set EM_PPC64 or EM_PPC here.
3958 (Target_selector_powerpc::do_recognize): Delete.
3959
3960 2012-12-10 Alan Modra <amodra@gmail.com>
3961
3962 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3963 stub_table_.
3964 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3965
3966 2012-12-07 Roland McGrath <mcgrathr@google.com>
3967
3968 * testsuite/binary_unittest.cc (Sized_binary_test):
3969 Use open_descriptor rather than ::open.
3970
3971 2012-12-07 Alan Modra <amodra@gmail.com>
3972
3973 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3974 typedef and invalid_address constant.
3975 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3976 instantiate constants.
3977
3978 2012-12-06 Roland McGrath <mcgrathr@google.com>
3979
3980 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3981 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3982 * aclocal.m4: Regenerate.
3983 * configure: Regenerate.
3984 * Makefile.in: Regenerate.
3985 * testsuite/Makefile.in: Regenerate.
3986
3987 2012-12-07 Alan Modra <amodra@gmail.com>
3988
3989 * options.h (General_options): Add no_toc_optimize.
3990 * powerpc.cc (ok_lo_toc_insn): New function.
3991 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3992
3993 2012-12-06 Alan Modra <amodra@gmail.com>
3994
3995 * options.h (General_options): Add plt_align, plt_static_chain,
3996 plt_thread_safe. Update stub_group_size help text.
3997 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3998 for new plt_thread_safe_ var.
3999 (use_plt_offset): Correct comments.
4000 (Target_powerpc::do_relax): Look for thread creation symbols to
4001 determine default plt_thread_safe value. Clear plt call stubs
4002 as well as branch stubs each iteration.
4003 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
4004 insn constants.
4005 (l, hi, ha, write_insn): Move earlier.
4006 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
4007 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
4008 plt stubs too.
4009 (Stub_table::update_size): Adjust.
4010 (Stub_table::prev_size, set_prev_size): Delete.
4011 (Stub_table::stub_align): Let --plt-align affect result.
4012 (Stub_table::plt_call_size): Calculate sizes for various stubs.
4013 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
4014 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
4015 (Stub_table::do_write): Support more stub variants.
4016
4017 2012-12-04 Alan Modra <amodra@gmail.com>
4018
4019 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
4020 (Target_powerpc::do_define_standard_symbols): New function.
4021
4022 2012-12-03 Alan Modra <amodra@gmail.com>
4023
4024 * output.h: Formatting, whitespace.
4025
4026 2012-12-03 Alan Modra <amodra@gmail.com>
4027
4028 * layout.h (Layout::get_executable_sections): Declare.
4029 * layout.cc (Layout::get_executable_sections): New function.
4030 * arm.cc (Target_arm::group_sections): Use it.
4031 (Arm_output_section::group_sections): Delete now redundant test.
4032 * output.cc (Output_reloc::Output_reloc): Add is_relative.
4033 param to handle relative relocs.
4034 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
4035 (Output_data_reloc::add_absolute): Adjust.
4036 (Output_data_reloc::add_relative): New function.
4037 (Output_data::reset_data_size): New function.
4038 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
4039 (Output_section::set_addralign): New function.
4040 (Output_section::checkpoint_set_addralign): New function.
4041 (Output_section::clear_section_offsets_need_adjustment): New function.
4042 (Output_section::input_sections): Make public.
4043 * powerpc.cc (class Output_data_brlt_powerpc): New.
4044 (class Stub_table, class Stub_control): New.
4045 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
4046 stub_table_, set_stub_table, stub_table): New vectors and accessor
4047 functions.
4048 (Target_powerpc::do_may_relax, do_relax, push_branch,
4049 new_stub_table, stub_tables, brlt_section, group_sections,
4050 add_branch_lookup_table, find_branch_lookup_table,
4051 write_branch_lookup_table, make_brlt_section): New functions.
4052 (Target_powerpc::struct Sort_sections, class Branch_info): New.
4053 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
4054 branch_info_): New vars.
4055 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
4056 make call stubs here.
4057 (Output_data_glink): Remove all call stub handling from this class.
4058 (Target_powerpc::Scan::local, global): Save interesting branch
4059 relocs and relocs for ifunc. Adjust calls to plt entry functions.
4060 (Target_powerpc::do_finalize_sections): Only make reg save/restore
4061 functions on final link.
4062 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
4063 Handle long branch destinations too.
4064 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
4065 do_plt_address_for_local): Adjust lookup of plt call stubs.
4066
4067 2012-11-30 Alan Modra <amodra@gmail.com>
4068
4069 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
4070 relocs against protected symbols when building 32-bit shared libs.
4071
4072 2012-11-30 Alan Modra <amodra@gmail.com>
4073
4074 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
4075 param. Call got_section() to make .got. Update all callers
4076 and their callers and so on.
4077
4078 2012-11-30 Alan Modra <amodra@gmail.com>
4079
4080 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
4081 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
4082 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
4083 value if it already exists.
4084
4085 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
4086
4087 PR gold/14858
4088 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
4089
4090 2012-11-14 Roland McGrath <mcgrathr@google.com>
4091
4092 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
4093 than bfc instruction for data sandboxing.
4094
4095 2012-11-08 Alan Modra <amodra@gmail.com>
4096
4097 * po/POTFILES.in: Regenerate.
4098
4099 2012-11-05 Alan Modra <amodra@gmail.com>
4100
4101 * configure.ac: Apply 2012-09-10 change to config.in here.
4102 * configure: Regenerate.
4103
4104 2012-11-05 Alan Modra <amodra@gmail.com>
4105
4106 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4107 (struct Opd_ent): Use "Address" rather than "Offset".
4108 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4109 (Target_powerpc::got_section): Make public.
4110 (Target_powerpc::scan_relocs): Move code setting symbols..
4111 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4112 Create _SDA_BASE_ only when referenced.
4113
4114 2012-11-02 Roland McGrath <mcgrathr@google.com>
4115
4116 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4117 from last change.
4118
4119 2012-11-01 Roland McGrath <mcgrathr@google.com>
4120
4121 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4122 for offset_in_output_section parameter.
4123 (Sized_target::relocate_special_relocatable): Likewise.
4124 * arm.cc (Target_arm::relocate_relocs): Likewise.
4125 (Target_arm::relocate_special_relocatable): Likewise.
4126 * i386.cc (Target_i386::relocate_relocs): Likewise.
4127 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4128 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4129 * target-reloc.h (relocate_relocs): Likewise.
4130 * testsuite/testfile.cc (Target_test): Likewise.
4131 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4132 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4133
4134 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4135 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4136
4137 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4138 parameter, which is unused in the [!F_SETFD] case.
4139
4140 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4141 SYMNDX to off_t before comparing it to this->data_size().
4142 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4143 * incremental.cc (Output_section_incremental_inputs::do_write):
4144 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4145
4146 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4147
4148 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4149
4150 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4151 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4152 in EABI_VER5.
4153
4154 2012-10-29 Cary Coutant <ccoutant@google.com>
4155
4156 * dwp.cc (usage): Add file and exit status parameters;
4157 add --help and --version options.
4158 (print_version): New function.
4159 (main): Add --help and --version options.
4160
4161 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4162
4163 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4164 final_layout_sequence.txt.
4165 * testsuite/Makefile.in: Regenerated.
4166
4167 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4168
4169 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4170 COMPILE generated by automake.
4171 (LINK1): Likewise.
4172 (CXXCOMPILE1): Likewise.
4173 (CXXLINK1): Likewise.
4174 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4175 (LINK): Likewise.
4176 (CXXCOMPILE): Likewise.
4177 (CXXLINK): Likewise.
4178 * testsuite/Makefile.in: Regenerated.
4179
4180 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4181
4182 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4183 on bad fwrite return.
4184
4185 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4186
4187 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4188 on val.
4189
4190 2012-10-23 Cary Coutant <ccoutant@google.com>
4191
4192 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4193 * testsuite/Makefile.in: Regenerate.
4194 * testsuite/dwp_test.h: New source file.
4195 * testsuite/dwp_test_1.cc: New source file.
4196 * testsuite/dwp_test_1.s: New source file.
4197 * testsuite/dwp_test_1.sh: New source file.
4198 * testsuite/dwp_test_1b.cc: New source file.
4199 * testsuite/dwp_test_1b.s: New source file.
4200 * testsuite/dwp_test_2.cc: New source file.
4201 * testsuite/dwp_test_2.s: New source file.
4202 * testsuite/dwp_test_2.sh: New source file.
4203 * testsuite/dwp_test_main.cc: New source file.
4204 * testsuite/dwp_test_main.s: New source file.
4205
4206 2012-10-23 Cary Coutant <ccoutant@google.com>
4207
4208 * dwp.h: New header file.
4209 * dwp.cc: New source file.
4210 * gold.h: Move shared declarations to system.h.
4211 * system.h: New header file.
4212 * Makefile.am: Add dwp.
4213 * Makefile.in: Regenerate.
4214
4215 2012-10-23 Cary Coutant <ccoutant@google.com>
4216
4217 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4218 Dwarf_info_reader::read_from_pointer.
4219 (Dwarf_pubnames_table::read_header): Likewise.
4220 (Dwarf_pubnames_table::next_name): Likewise.
4221 (Dwarf_die::read_attributes): Likewise.
4222 (Dwarf_die::skip_attributes): Likewise.
4223 (Dwarf_info_reader::read_from_pointer): New function template.
4224 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4225 (Dwarf_pubnames_table): Likewise.
4226 (Dwarf_info_reader::read_from_pointer): New function template.
4227 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4228 Dwarf_pubnames_table ctor.
4229
4230 2012-10-23 Cary Coutant <ccoutant@google.com>
4231
4232 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4233 abbrev_shndx.
4234 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4235 abbrev_shndx_.
4236 (Dwarf_info_reader::set_abbrev_shndx): New method.
4237 (Dwarf_info_reader::abbrev_shndx_): New data member.
4238
4239 2012-10-23 Cary Coutant <ccoutant@google.com>
4240
4241 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4242 from object, not parameters.
4243 (Dwarf_info_reader::parse): Likewise.
4244 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4245 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4246 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4247 methods.
4248
4249 2012-10-23 Cary Coutant <ccoutant@google.com>
4250
4251 * fileread.cc (Input_file::Input_file): New constructor.
4252 * fileread.h (class Input_file): Add new constructor.
4253
4254 2012-10-18 Alan Modra <amodra@gmail.com>
4255
4256 PR gold/14727
4257 * object.cc (Relobj::is_section_name_included): Also match
4258 .sdata personality section.
4259
4260 2012-10-18 Alan Modra <amodra@gmail.com>
4261
4262 * target-reloc.h (class Default_comdat_behavior): New, package up..
4263 (get_comdat_behaviour): ..this.
4264 (relocate_section): Add Relocate_comdat_behavior template arg,
4265 adjust code to suit.
4266 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4267 (Target_arm::scan_reloc_section): Likewise.
4268 * i386.cc (Target_i386::relocate_section): Likewise.
4269 * sparc.cc (Target_sparc::relocate_section): Likewise.
4270 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4271 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4272 * powerpc.cc (class Relocate_comdat_behavior): New.
4273 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4274 gold::relocate_section with new template arg.
4275
4276 2012-10-18 Alan Modra <amodra@gmail.com>
4277
4278 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4279 dynamic relocs for GOT_TPREL got entries, without symbol if
4280 resolving locally.
4281 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4282 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4283 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4284
4285 2012-10-17 Alan Modra <amodra@gmail.com>
4286
4287 PR gold/14726
4288 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4289
4290 2012-10-16 Sriraman Tallam <tmsriram@google.com>
4291
4292 * layout.cc (Layout::include_section): Keep sections marked
4293 SHF_EXCLUDE when doing relocatable links.
4294
4295 2012-10-16 Alan Modra <amodra@gmail.com>
4296
4297 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4298 (Target_powerpc::do_finalize_sections): Call it.
4299 (Output_data_save_res): New class and supporting functions.
4300 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4301 normal symbols defined in object files.
4302
4303 2012-10-12 Alan Modra <amodra@gmail.com>
4304
4305 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4306 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4307 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4308 section if scan_opd_relocs not yet called.
4309 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4310
4311 2012-10-12 Alan Modra <amodra@gmail.com>
4312
4313 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4314 add_local_ifunc_entry): Revert last change.
4315 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4316
4317 2012-10-05 Alan Modra <amodra@gmail.com>
4318
4319 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4320 do_plt_address_for_global): New functions.
4321 (Output_data_got_powerpc::do_write): Don't segfault when linking
4322 statically.
4323 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4324 add_local_ifunc_entry): Return true on adding entry..
4325 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4326 glink->add_entry call. Remove unused symtab param. Adjust calls.
4327 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4328 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4329 set up symbols here.
4330 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4331 syms here. Do so even when no .iplt. Don't segfault when linking
4332 statically.
4333 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4334 new variants without reloc param.
4335 (Glink_sym_ent::Glink_sym_ent): Likewise.
4336 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4337 reloc when refs will resolve to plt call stub.
4338 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4339 R_PPC_PLTREL24 to resolve locally.
4340 (Target_powerpc::Scan::global): Correct ifunc handling.
4341 (Target_powerpc::Relocate::relocate): Correct local sym glink
4342 lookup. Don't destroy "value" when we have a plt call stub,
4343 and when checking plt call validity.
4344 (Target_powerpc::do_dynsym_value): Simplify.
4345
4346 2012-10-05 Alan Modra <amodra@gmail.com>
4347
4348 * i386.cc (Output_data_plt_i386::address_for_global,
4349 address_for_local): Add plt offset to returned value. Adjust uses.
4350 * sparc.cc (Output_data_plt_sparc::address_for_global,
4351 address_for_local): Likewise.
4352 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4353 address_for_local): Likewise.
4354 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4355 address_for_local): Likewise.
4356 * target.h (Target::plt_address_for_global, plt_address_for_local):
4357 Update comment.
4358 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4359 (Output_data_got::Got_entry::write): Nor here.
4360 * output.h: Comment fix.
4361
4362 2012-10-02 Jiong Wang <jiwang@tilera.com>
4363
4364 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4365 global_offset_table_ value for larget got.
4366 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4367
4368 2012-09-29 Alan Modra <amodra@gmail.com>
4369
4370 * powerpc.cc (Target_powerpc::iplt_): New output section.
4371 (Target_powerpc::iplt_section, make_iplt_section,
4372 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4373 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4374 Target_powerpc::plt_entry_count): Count iplt entries too.
4375 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4376 reloc section in constructor. New params.
4377 (Target_powerpc::make_plt_section): Create reloc section here instead.
4378 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4379 functions.
4380 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4381 (Output_data_glink::add_entry, find_entry): New functions to
4382 deal with local syms.
4383 (Glink_sym_ent): Add support for local syms.
4384 (Output_data_glink::do_write): Handle ifunc plt entries.
4385 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4386 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4387 (Target_powerpc::Relocate::relocate): Likewise.
4388 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4389
4390 2012-09-25 Alan Modra <amodra@gmail.com>
4391
4392 * object.h (Sized_relobj_file::adjust_local_symbol,
4393 do_adjust_local_symbol): New functions.
4394 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4395 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4396 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4397 and irregular opd entry spacing.
4398 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4399 (Global_symbol_visitor_opd): New functor.
4400 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4401 on deleted opd entries.
4402
4403 2012-09-15 Jiong Wang <jiwang@tilera.com>
4404
4405 * tilegx.cc: New file.
4406 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4407 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4408 * configure.tgt: Add entries for tilegx*.
4409 * configure.ac: Likewise.
4410 * Makefile.in: Rebuild.
4411 * configure: Likewise.
4412 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4413 tilegx.
4414
4415 2012-09-13 Alan Modra <amodra@gmail.com>
4416
4417 * target-reloc.h (scan_relocs): Call scan.local for relocs
4418 against symbols in discarded sections. Pass is_discarded
4419 param.
4420 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4421 Add is_discarded param.
4422 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4423 is_discarded to flag opd entry as discarded. Don't emit dyn
4424 relocs on such entries.
4425 (Target_powerpc::Scan::global): Similarly detect and handle
4426 such opd entries.
4427 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4428 opd_ent_. Update all uses.
4429 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4430 (Target_powerpc::relocate_section): Zero out discarded opd
4431 entry relocs.
4432
4433 2012-09-12 Ian Lance Taylor <iant@google.com>
4434
4435 PR gold/14570
4436 * output.cc: Rename Output_data_got template parameter from size
4437 to got_size for all functions. Compile all variants of
4438 Output_data_got.
4439 (Output_data_got::Got_entry::write): Correct use of size for
4440 symbol value. Use local_is_tls rather than casting to
4441 Sized_relobj_file.
4442 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4443 (class Sized_relobj_file): Add do_local_is_tls.
4444 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4445
4446 2012-09-11 Alan Modra <amodra@gmail.com>
4447
4448 PR gold/14566
4449 * layout.cc (Layout::set_segment_offsets): When using
4450 common-page-size alignment, ensure we are on a new max-page-size
4451 page.
4452 * output.cc (Output_segment::set_section_addresses): Use
4453 abi_pagesize, not common_pagesize for relro boundary.
4454 (Output_segment::set_offset): Likewise.
4455
4456 2012-09-11 Alan Modra <amodra@gmail.com>
4457
4458 * output.h (Output_data_got::add_global_tls, add_local_tls,
4459 add_local_tls_pair): New functions.
4460 (Output_data_got::add_local_pair_with_rel): Remove second
4461 reloc param. Expand comment.
4462 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4463 use_plt_or_tls_offset_, similarly for constructor param.
4464 (Output_data_got::Got_entry::write): Add got_index param.
4465 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4466 add_local_tls_pair): New functions.
4467 (Output_data_got::Got_entry::write): Handle tls symbols
4468 with use_plt_or_tls_offset_ set specially.
4469 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4470 (Output_data_got::do_write): Replace iterator with index, pass
4471 index to entry write function.
4472 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4473 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4474 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4475 call.
4476 * i386.cc (Target_i386::Scan::local): Likewise.
4477 * sparc.cc (Target_sparc::Scan::local): Likewise.
4478 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4479 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4480 do_tls_offset_for_global): New functions.
4481 (Target_powerpc::Scan::local): Correct TLS relocations and got
4482 entry values.
4483 (Target_powerpc::Scan::global): Don't emit unnecessary
4484 dynamic relocations on TLS GOT entries.
4485
4486 2012-09-10 Matthias Klose <doko@ubuntu.com>
4487
4488 * config.in: Disable sanity check for kfreebsd.
4489
4490 2012-09-10 Sterling Augustine <saugustine@google.com>
4491
4492 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4493 (Gdb_index::pubtypes_read): New parameter.
4494 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4495 to calls.
4496 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4497 pubtypes_object_.
4498
4499 2012-09-09 Alan Modra <amodra@gmail.com>
4500
4501 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4502 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4503 * gc.h (gc_process_relocs): Call target gc_add_reference.
4504 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4505 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4506 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4507 unnecessary cast.
4508 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4509 to cater for when we don't need code offset. Update use.
4510 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4511 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4512 set_opd_valid): New functions.
4513 (Target_powerpc::do_gc_add_reference): New function.
4514 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4515 stashed refs.
4516 (Target_powerpc::do_gc_mark_symbol): New function.
4517
4518 2012-09-06 Cary Coutant <ccoutant@google.com>
4519
4520 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4521 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4522 (Dwarf_die::skip_attributes): Likewise.
4523 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4524 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4525 (main): Call it.
4526 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4527
4528 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4529
4530 * testsuite/script_test_3.t: Add .got.plt output section
4531 statement.
4532 * testsuite/script_test_4.t: Likewise.
4533
4534 2012-09-05 Alan Modra <amodra@gmail.com>
4535
4536 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4537 update all uses and lose "enum" when using type.
4538
4539 2012-09-05 Alan Modra <amodra@gmail.com>
4540
4541 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4542 * configure: Regenerate.
4543 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4544 (plugin_final_layout.stdout): Likewise.
4545 (memory_test): Set page sizes to 0x1000.
4546 * testsuite/Makefile.in: Regenerate.
4547 * testsuite/discard_locals_test.sh: Add FIXME comment.
4548 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4549 * testsuite/pr14265.t: Add .got output section statement.
4550 * testsuite/script_test_2.t: Likewise.
4551 * testsuite/script_test_3.t: Likewise.
4552 * testsuite/script_test_4.t: Likewise.
4553 * testsuite/script_test_5.t: Likewise.
4554 * testsuite/script_test_6.t: Likewise.
4555 * testsuite/script_test_7.t: Likewise.
4556 * testsuite/script_test_9.t: Likewise.
4557
4558 2012-09-05 Alan Modra <amodra@gmail.com>
4559
4560 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4561 (Powerpc_relocate_functions::Status): New typedef.
4562 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4563 (Target_powerpc::Scan::local): Handle REL64.
4564 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4565 for REL32 and REL64.
4566 (Target_powerpc::symval_for_branch): New function, extracted from..
4567 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4568 checks. Report overflow errors.
4569
4570 2012-09-05 Alan Modra <amodra@gmail.com>
4571
4572 * object.h (Sized_relobj_file::emit_relocs): Delete.
4573 (Sized_relobj_file::emit_relocs_reltype): Delete.
4574 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4575 relocate_relocs for --emit-relocs.
4576 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4577 * output.h: Update comment.
4578 (Output_segment::first_section): New function.
4579 (Output_segment::first_section_load_address): Use first_section.
4580 * output.cc (Output_segment::first_section): New function extracted..
4581 (Output_segment::first_section_load_address): ..from here. Delete.
4582 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4583 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4584 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4585 adjust call to target.h function.
4586 * i386.cc (Target_i386): Likewise.
4587 * sparc.cc (Target_sparc): Likewise.
4588 * x86_64.cc (Target_x86_64): Likewise.
4589 * powerpc.cc (Target_powerpc): Likewise.
4590 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4591 first tls section has section symbol for optimised local dynamic
4592 output relocs.
4593 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4594 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4595 optimised tls code.
4596 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4597 Rename to relocate_relocs. Update error message.
4598
4599 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4600
4601 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4602 --just-symbols.
4603
4604 2012-08-31 Alan Modra <amodra@gmail.com>
4605
4606 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4607 (Powerpc_relobj::toc_base_offset): New stub function.
4608 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4609 got_mod_index_offset to tlsld_got_offset. Update all refs.
4610 (Target_powerpc::Relocate::enum skip_tls): New.
4611 (Target_powerpc::call_tls_get_addr_): New var.
4612 (Target_powerpc::is_branch_reloc): Move to file scope.
4613 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4614 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4615 New functions.
4616 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4617 (powerpc_info): Correct common_pagesize for ppc64.
4618 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4619 (Powerpc_relocate_functions): Add overflow check enums and functions.
4620 Add non-shift version of rela, rela_ua. Delete all rel public
4621 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4622 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4623 addr16_ha3, addr14 functions.
4624 (Output_data_got_powerpc::add_constant_pair): New function.
4625 (Output_data_got_powerpc::got_base_offset): Likewise.
4626 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4627 (instruction constants): Sort, add some more.
4628 (Output_data_glink::do_write): Add and use Address typedef. Use
4629 object->toc_base_offset() stub for 64-bit.
4630 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4631 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4632 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4633 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4634 Always treat .opd relocs as against locally defined symbol.
4635 Correct condition for RELATIVE relocs.
4636 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4637 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4638 for 32-bit syms with a plt entry. Correct ppc64 toc base
4639 calculations. Handle TLS relocs, and more. Add overflow
4640 checking and adjust for Powerpc_relocate_functions changes.
4641 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4642 Reinstate --emit-relocs code with FIXME.
4643
4644 2012-08-30 Alan Modra <amodra@gmail.com>
4645
4646 * layout.cc (Layout::set_segment_offsets): Set p_align to
4647 abi_pagesize, not common_pagesize.
4648 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4649 to determine whether file header can go in segment.
4650
4651 2012-08-30 Alan Modra <amodra@gmail.com>
4652
4653 * output.h (Output_reloc::Output_reloc <output section>): Add
4654 is_relative param. Adjust calls.
4655 (Output_reloc::add_output_section_relative): New functions.
4656 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4657 is_relative.
4658 (Output_reloc::symbol_value): Handle SECTION_CODE.
4659
4660 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4661
4662 * gold.cc (queue_middle_tasks): Call layout again when unique
4663 segments for sections is desired.
4664 * layout.cc (Layout::Layout): Initialize new members.
4665 (Layout::get_output_section_flags): New function.
4666 (Layout::choose_output_section): Call get_output_section_flags.
4667 (Layout::layout): Make output section for mapping to a unique segment.
4668 (Layout::insert_section_segment_map): New function.
4669 (Layout::attach_allocated_section_to_segment): Make unique segment for
4670 output sections marked so.
4671 (Layout::segment_precedes): Check for unique segments when sorting.
4672 * layout.h (Layout::Unique_segment_info): New struct.
4673 (Layout::Section_segment_map): New typedef.
4674 (Layout::insert_section_segment_map): New function.
4675 (Layout::get_output_section_flags): New function.
4676 (Layout::is_unique_segment_for_sections_specified): New function.
4677 (Layout::set_unique_segment_for_sections_specified): New function.
4678 (Layout::unique_segment_for_sections_specified_): New member.
4679 (Layout::section_segment_map_): New member.
4680 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4681 Rename is_gc_pass_one to is_pass_one.
4682 Rename is_gc_pass_two to is_pass_two.
4683 Rename is_gc_or_icf to is_two_pass.
4684 Check for which pass based on whether symbols data is present.
4685 Make it two pass when unique segments for sections is desired.
4686 * output.cc (Output_section::Output_section): Initialize new
4687 members.
4688 * output.h (Output_section::is_unique_segment): New function.
4689 (Output_section::set_is_unique_segment): New function.
4690 (Output_section::is_unique_segment_): New member.
4691 (Output_section::extra_segment_flags): New function.
4692 (Output_section::set_extra_segment_flags): New function.
4693 (Output_section::extra_segment_flags_): New member.
4694 (Output_section::segment_alignment): New function.
4695 (Output_section::set_segment_alignment): New function.
4696 (Output_section::segment_alignment_): New member.
4697 (Output_segment::Output_segment): Initialize is_unique_segment_.
4698 (Output_segment::is_unique_segment): New function.
4699 (Output_segment::set_is_unique_segment): New function.
4700 (Output_segment::is_unique_segment_): New member.
4701 * plugin.cc (allow_unique_segment_for_sections): New function.
4702 (unique_segment_for_sections): New function.
4703 (Plugin::load): Add new functions to transfer vector.
4704 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4705 * Makefile.in: Regenerate.
4706 * testsuite/plugin_final_layout.sh: Check if unique segment
4707 functionality works.
4708 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4709 are available.
4710 (allow_unique_segment_for_sections): New global.
4711 (unique_segment_for_sections): New global.
4712 (claim_file_hook): Call allow_unique_segment_for_sections.
4713 (all_symbols_read_hook): Call unique_segment_for_sections.
4714
4715 2012-08-22 Cary Coutant <ccoutant@google.com>
4716
4717 * layout.cc (Layout::include_section): Don't assert on GROUP
4718 sections with --emit-relocs.
4719
4720 2012-08-21 Cary Coutant <ccoutant@google.com>
4721
4722 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4723 if --export-dynamic-symbol names an undef symbol.
4724
4725 2012-08-18 Alan Modra <amodra@gmail.com>
4726
4727 * powerpc.cc: Formatting and white space.
4728 (Powerpc_relobj): Rename got2_section_ to special_.
4729 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4730 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4731 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4732 (Target_powerpc): Add Address typedef and invalid_address. Use
4733 throughout.
4734 (Target_powerpc::is_branch_reloc): New function.
4735 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4736 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4737 for dst_mask, value and addend.
4738 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4739 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4740 (Output_data_glink::do_write): Correct toc base. Don't try to use
4741 uint16_t for 24-bit offset. Use get_output_section_offset and
4742 check return.
4743 (Target_powerpc::Scan::local): Handle more relocs.
4744 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4745 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4746 Plug in toc restoring insn after plt calls. Translate branches
4747 to function descriptor symbols to corresponding entry point.
4748 (Target_powerpc::relocate_for_relocatable): Check return from
4749 get_output_section_offset.
4750 * symtab.h: Comment typo.
4751
4752 2012-08-14 Ian Lance Taylor <iant@google.com>
4753
4754 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4755 unsupported_relocal_local to call unsupported_reloc_global.
4756
4757 2012-08-14 Nick Clifton <nickc@redhat.com>
4758
4759 PR ld/14265
4760 * script-sections.cc (Sections_element::output_section_name): Add
4761 keep return parameter.
4762 (Output_section_element::match_name): Add keep return parameter.
4763 Return the value of the keep_ member.
4764 * script-sections.h (class Output_section): Update
4765 output_section_name prototype.
4766 * layout.cc (Layout::keep_input_section): New public member
4767 function.
4768 (Layout::choose_output_section): Pass keep parameter to
4769 output_section_name.
4770 * layout.h (class Layout): Add keep_input_section.
4771 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4772 sections.
4773 * testsuite/Makefile.am: Add a test.
4774 * testsuite/Makefile.in: Regenerate.
4775 * testsuite/pr14265.c: Source file for the test.
4776 * testsuite/pr14265.t: Linker script for the test.
4777 * testsuite/pr14265.sh: Shell script for the test.
4778
4779 2012-08-14 Alan Modra <amodra@gmail.com>
4780
4781 * target.h (Target::output_section_name): New function.
4782 (Target::do_output_section_name): New function.
4783 * layout.cc (Layout::choose_output_section): Call the above.
4784 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4785
4786 2012-08-14 Alan Modra <amodra@gmail.com>
4787
4788 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4789 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4790 for replace_constant call.
4791 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4792 (Output_data_glink::do_print_to_mapfile): New function.
4793 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4794 (Target_powerpc::Relocate::relocate): Likewise.
4795
4796 2012-08-14 Alan Modra <amodra@gmail.com>
4797
4798 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4799 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4800 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4801 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4802 all references to shndx_. Handle special case for R_PPC_PLTREL24
4803 here.
4804 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4805 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4806 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4807 here.
4808 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4809 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4810
4811 2012-08-12 Alan Modra <amodra@gmail.com>
4812
4813 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4814 (glink insn constants): Use uint32_t.
4815 (Output_data_glink::add_entry): Use insert, not [] operator.
4816
4817 2012-08-11 Alan Modra <amodra@gmail.com>
4818
4819 * object.h (Sized_relobj_file::find_shdr): New function.
4820 (Sized_relobj_file::find_special_sections): New function.
4821 * object.cc (Sized_relobj_file::find_shdr): New function.
4822 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4823 (Sized_relobj_file::find_special_sections): New function, split out..
4824 (Sized_relobj_file::do_read_symbols): ..from here.
4825 * output.h (Output_data_got::replace_constant): New function.
4826 (Output_data_got::num_entries): New function.
4827 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4828 (Output_data_got::got_offset): Protected rather than private.
4829 (Output_data_got::replace_got_entry): New function.
4830 * output.cc (Output_data_got::replace_got_entry): New function.
4831 * powerpc.cc (class Powerpc_relobj): New.
4832 (class Powerpc_relocate_functions): Delete all psymval variants or
4833 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4834 Implement _ha functions using corresponding _hi function.
4835 (Powerpc_relobj::find_special_sections): New function.
4836 (Target_powerpc::do_make_elf_object): New function.
4837 (class Output_data_got_powerpc): New.
4838 (class Output_data_glink): New.
4839 (class Powerpc_scan_relocatable_reloc): New.
4840 Many more changes througout file.
4841
4842 2012-08-09 Nick Clifton <nickc@redhat.com>
4843
4844 * po/vi.po: Updated Vietnamese translation.
4845
4846 2012-08-07 Ian Lance Taylor <iant@google.com>
4847
4848 * layout.cc (Layout::add_target_dynamic_tags): If
4849 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4850 plt_rel.
4851
4852 2012-07-30 Nick Clifton <nickc@redhat.com>
4853
4854 * po/gold.pot: Updated template.
4855 * po/es.po: Updated Spanish translation.
4856
4857 2012-07-18 Cary Coutant <ccoutant@google.com>
4858
4859 PR gold/14344
4860 * configure.ac: Add check for -gpubnames support.
4861 * configure: Regenerate.
4862 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4863 support; force -gno-pubnames.
4864 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4865 support.
4866 (gdb_index_test_4): New test.
4867 * testsuite/Makefile.in: Regenerate.
4868 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4869 * testsuite/gdb_index_test_2.sh: Likewise.
4870 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4871 * testsuite/gdb_index_test_4.sh: New script.
4872 * testsuite/gdb_index_test_comm.sh: New script with common code;
4873 don't look for space after colon.
4874
4875 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4876
4877 * gold.cc (queue_middle_tasks): Update function order only after
4878 deferred objects due to plugins are processed.
4879
4880 2012-07-11 Ian Lance Taylor <iant@google.com>
4881
4882 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4883 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4884 (Target_arm::scan_reloc_for_stub): Likewise.
4885 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4886 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4887 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4888 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4889 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4890
4891 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4892 Ian Lance Taylor <iant@google.com>
4893
4894 PR gold/14309
4895 * configure.ac: Test whether std::tr1::hash<off_t> works.
4896 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4897 needed.
4898 * output.h (class Output_fill): Add virtual destructor.
4899 * configure, config.in: Rebuild.
4900
4901 2012-06-22 Roland McGrath <mcgrathr@google.com>
4902
4903 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4904
4905 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4906
4907 * plugin.cc (Plugin::load): Handle position independent executables.
4908
4909 2012-06-06 Cary Coutant <ccoutant@google.com>
4910
4911 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4912 add .debug_macro.
4913 (lines_only_debug_sections): Likewise.
4914 (gdb_fast_lookup_sections): New static array.
4915 (is_gdb_debug_section): Rename formal parameter.
4916 (is_lines_only_debug_section): Likewise.
4917 (is_gdb_fast_lookup_section): New function.
4918 (Layout::include_section): Check for ".zdebug_" prefix; pass
4919 section name suffix to is_gdb_debug_section, et al.; check for
4920 fast-lookup sections when building .gdb_index.
4921 * options.h (--strip-debug-gdb): Update GDB version number.
4922
4923 2012-06-06 Cary Coutant <ccoutant@google.com>
4924
4925 * configure.ac: Add check for fallocate.
4926 * configure: Regenerate.
4927 * config.in: Regenerate.
4928
4929 * options.h (class General_options): Add --mmap-output-file and
4930 --posix-fallocate options.
4931 * output.cc: (posix_fallocate): Remove; replace with...
4932 (gold_fallocate): New function.
4933 (Output_file::map_no_anonymous): Call gold_fallocate.
4934 (Output_file::map): Check --mmap-output-file option.
4935
4936 2012-06-05 Jing Yu <jingyu@google.com>
4937
4938 * gold.h (textdomain): Add do {} to empty while(0).
4939 (bindtextdomain): Likewise.
4940
4941 2012-06-04 Cary Coutant <ccoutant@google.com>
4942
4943 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4944 has_dynsym_index.
4945
4946 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4947
4948 * symtab.cc (Symbol_table::define_special_symbol):
4949 Initialize *poldsym to prevent uninitialized variable errors.
4950
4951 2012-05-23 Cary Coutant <ccoutant@google.com>
4952
4953 * layout.cc (Layout::section_name_mapping): Add rules to handle
4954 exact match on .data.rel.ro.local or .data.rel.ro.
4955 (Layout::output_section_name): Check for exact matches.
4956
4957 2012-05-23 Cary Coutant <ccoutant@google.com>
4958
4959 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4960 more carefully.
4961
4962 2012-05-22 Cary Coutant <ccoutant@google.com>
4963
4964 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4965 object before exporting symbol.
4966
4967 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4968
4969 * testsuite/tls_test.cc: Include "config.h" first.
4970 * testsuite/tls_test_c.c: Likewise.
4971
4972 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4973 Nick Clifton <nickc@redhat.com>
4974
4975 PR 14072
4976 * configure.in: Add check that sysdep.h has been included before
4977 any system header files.
4978 * configure: Regenerate.
4979 * config.in: Regenerate.
4980
4981 2012-05-14 Cary Coutant <ccoutant@google.com>
4982
4983 * layout.cc (Layout::make_output_section): Mark .tdata section
4984 as RELRO.
4985 * testsuite/relro_test.cc: Add a TLS variable.
4986
4987 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4988
4989 PR gold/14091
4990 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4991 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4992 R_X86_64_64.
4993
4994 2012-05-08 Cary Coutant <ccoutant@google.com>
4995
4996 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4997 (lines_only_debug_sections): Likewise.
4998
4999 2012-05-02 Roland McGrath <mcgrathr@google.com>
5000
5001 * nacl.cc: New file.
5002 * nacl.h: New file.
5003 * Makefile.am (CCFILES, HFILES): Add them.
5004 * Makefile.in: Regenerate.
5005 * i386.cc (Output_data_plt_i386_nacl): New class.
5006 (Output_data_plt_i386_nacl_exec): New class.
5007 (Output_data_plt_i386_nacl_dyn): New class.
5008 (Target_i386_nacl): New class.
5009 (Target_selector_i386_nacl): New class.
5010 (target_selector_i386): Use it instead of Target_selector_i386.
5011 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
5012 (Target_x86_64_nacl): New class.
5013 (Target_selector_x86_64_nacl): New class.
5014 (target_selector_x86_64, target_selector_x32): Use it instead of
5015 Target_selector_x86_64.
5016 * arm.cc (Output_data_plt_arm_nacl): New class.
5017 (Target_arm_nacl): New class.
5018 (Target_selector_arm_nacl): New class.
5019 (target_selector_arm, target_selector_armbe): Use it instead of
5020 Target_selector_arm.
5021
5022 * target-select.cc (select_target): Take new Input_file* and off_t
5023 arguments, pass them on to recognize method of selector.
5024 * object.cc (make_elf_sized_object): Update caller.
5025 * parameters.cc (parameters_force_valid_target): Likewise.
5026 * incremental.cc (make_sized_incremental_binary): Likewise.
5027 * target-select.h: Update decl.
5028 (Target_selector::recognize): Take new Input_file* argument,
5029 pass it on to do_recognize.
5030 (Target_selector::do_recognize): Take new Input_file* argument.
5031 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
5032 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
5033 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
5034 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
5035
5036 * target.h (Target::Target_info): New members isolate_execinstr
5037 and rosegment_gap.
5038 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
5039 * arm.cc (Target_arm::arm_info): Update initializer.
5040 * i386.cc (Target_i386::i386_info): Likewise.
5041 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
5042 * sparc.cc (Target_sparc::sparc_info): Likewise.
5043 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5044 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
5045 * layout.cc (Layout::attach_allocated_section_to_segment):
5046 Take new const Target* argument. If target->isolate_execinstr(), act
5047 like --rosegment.
5048 (Layout::find_first_load_seg): Take new const Target* argument;
5049 if target->isolate_execinstr(), reject PF_X segments.
5050 (Layout::relaxation_loop_body): Update caller.
5051 (Layout::set_segment_offsets): If target->isolate_execinstr(),
5052 reset file offset to zero when we hit LOAD_SEG, and then do a second
5053 loop over the segments before LOAD_SEG to reassign offsets after
5054 addresses have been determined. Handle target->rosegment_gap().
5055 (Layout::attach_section_to_segment): Take new const Target* argument;
5056 pass it to attach_allocated_section_to_segment.
5057 (Layout::make_output_section): Update caller.
5058 (Layout::attach_sections_to_segments): Take new const Target* argument;
5059 pass it to attach_section_to_segment.
5060 * gold.cc (queue_middle_tasks): Update caller.
5061 * layout.h (Layout): Update method decls with new arguments.
5062
5063 * arm.cc (Target_arm::Target_arm): Take optional argument for the
5064 Target_info pointer to use.
5065 (Target_arm::do_make_data_plt): New virtual method.
5066 (Target_arm::make_data_plt): New method that calls it.
5067 (Target_arm::make_plt_entry): Use it.
5068 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
5069 for the section alignment.
5070 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
5071 method.
5072 (Output_data_plt_arm::first_plt_entry_offset): Call it.
5073 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
5074 method.
5075 (Output_data_plt_arm::get_plt_entry_size): Call it.
5076 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
5077 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
5078 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
5079 method.
5080 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
5081 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
5082 method instead of sizeof(plt_entry).
5083 (Output_data_plt_arm::add_entry): Likewise.
5084 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
5085 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
5086 than static method.
5087 (Target_arm::plt_entry_size): Likewise.
5088 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
5089 Move to ...
5090 (Output_data_plt_arm_standard): ... here, new class.
5091 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
5092 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
5093 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
5094
5095 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5096 Take additional argument for the PLT entry size.
5097 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
5098 Use get_plt_entry_size method rather than plt_entry_size variable.
5099 (Output_data_plt_x86_64::reserve_slot): Likewise.
5100 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
5101 (Output_data_plt_x86_64::add_entry): Likewise.
5102 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5103 (Output_data_plt_x86_64::address_for_global): Likewise.
5104 (Output_data_plt_x86_64::address_for_local): Likewise.
5105 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5106 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5107 Make method non-static.
5108 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5109 method.
5110 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5111 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5112 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5113 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5114 virtual method.
5115 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5116 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5117 virtual method.
5118 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5119 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5120 virtual method.
5121 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5122 (Output_data_plt_x86_64::plt_entry_size)
5123 (Output_data_plt_x86_64::first_plt_entry)
5124 (Output_data_plt_x86_64::plt_entry)
5125 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5126 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5127 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5128 (Output_data_plt_x86_64_standard): ... here, new class.
5129 (Target_x86_64::Target_x86_64): Take optional argument for the
5130 Target_info pointer to use.
5131 (Target_x86_64::do_make_data_plt): New virtual method.
5132 (Target_x86_64::make_data_plt): New method to call it.
5133 (Target_x86_64::init_got_plt_for_update): Use that.
5134 Call this->plt_->add_eh_frame method here.
5135 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5136 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5137 rather than static method.
5138 (Target_x86_64::plt_entry_size): Likewise.
5139 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5140 rather than plt_entry_size variable. Move guts of PLT filling to...
5141 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5142 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5143 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5144
5145 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5146 additional argument for the section alignment.
5147 Don't do add_eh_frame_for_plt here.
5148 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5149 non-static. Use get_plt_entry_size method rather than plt_entry_size
5150 variable.
5151 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5152 method.
5153 (Output_data_plt_i386::get_plt_entry_size): Call it.
5154 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5155 (Output_data_plt_i386::add_eh_frame): New method to call it.
5156 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5157 method.
5158 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5159 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5160 method.
5161 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5162 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5163 method instead of plt_entry_size.
5164 (Output_data_plt_i386::plt_entry_size)
5165 (Output_data_plt_i386::plt_eh_frame_fde_size)
5166 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5167 (Output_data_plt_i386_standard): ... here, new class.
5168 (Output_data_plt_i386_exec): New class.
5169 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5170 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5171 (Output_data_plt_i386::exec_plt_entry): Move to ...
5172 (Output_data_plt_i386_exec::plt_entry): ... here.
5173 (Output_data_plt_i386_dyn): New class.
5174 (Output_data_plt_i386::first_plt_entry): Move to ...
5175 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5176 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5177 (Output_data_plt_i386_dyn::plt_entry): ... here.
5178 (Target_i386::Target_i386): Take optional argument for the Target_info
5179 pointer to use.
5180 (Target_i386::do_make_data_plt): New virtual method.
5181 (Target_i386::make_data_plt): New method to call it.
5182 (Target_i386::make_plt_section): Use that.
5183 Call this->plt_->add_eh_frame method here.
5184 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5185 rather than plt_entry_size variable.
5186 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5187 (Output_data_plt_i386::address_for_local): Likewise.
5188 (Output_data_plt_i386::do_write): Likewise.
5189 Move guts of PLT filling to...
5190 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5191 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5192 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5193 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5194
5195 2012-05-01 Cary Coutant <ccoutant@google.com>
5196
5197 * dwarf_reader.cc (Dwarf_die::read_attributes)
5198 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5199 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5200 * reduced_debug_output.cc
5201 (Output_reduced_debug_info_section::get_die_end): Remove
5202 DW_FORM_GNU_ref_index. Add default case.
5203
5204 2012-04-26 Mark Wielaard <mjw@redhat.com>
5205
5206 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5207 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5208 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5209 DW_AT_high_pc as offset from DW_AT_low_pc.
5210
5211 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5212 * testsuite/Makefile.in: Regenerate.
5213 * testsuite/gdb_index_test_3.c: New test source file.
5214 * testsuite/gdb_index_test_3.sh: New test source file.
5215
5216 2012-04-25 Ian Lance Taylor <iant@google.com>
5217
5218 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5219 pointer.
5220 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5221 as a class, not a struct.
5222 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5223 (Target_arm::apply_cortex_a8_workaround): Likewise.
5224 * gc.h: Declare Reloc_types as a struct, not a class.
5225 * object.h: Declare Symbols_data as a struct.
5226 * reloc.h: Declare Read_relocs_data as a struct.
5227 * target.h: Declare Relocate_info as a struct.
5228
5229 2012-04-24 David S. Miller <davem@davemloft.net>
5230
5231 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5232 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5233 and R_SPARC_WPLT30.
5234
5235 2012-04-24 Cary Coutant <ccoutant@google.com>
5236
5237 * incremental-dump.cc (find_input_containing_global): Replace
5238 magic number with symbolic constant.
5239 (dump_incremental_inputs): Update version number.
5240 * incremental.cc (Output_section_incremental_inputs): Update version
5241 number; import symbolic constants from Incremental_inputs_reader.
5242 (Incremental_inputs::create_data_sections): Align relocations
5243 section correctly for 64-bit targets.
5244 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5245 constants; add padding.
5246 (Output_section_incremental_inputs::write_header): Add assert for
5247 header_size.
5248 (Output_section_incremental_inputs::write_input_files): Add assert
5249 for input_entry_size.
5250 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5251 add assert for object_info_size, input_section_entry_size,
5252 global_sym_entry_size.
5253 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5254 for data structure sizes; use them.
5255 (Incremental_input_entry_reader): Import symbolic constants from
5256 Incremental_inputs_reader; use them.
5257
5258 2012-04-23 David S. Miller <davem@davemloft.net>
5259
5260 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5261 and elf_flags_set_.
5262 (Target_sparc::Target_sparc): Initialize new fields.
5263 (Target_sparc::do_make_elf_object): New function.
5264 (Target_sparc::do_adjust_elf_header): New function.
5265
5266 2012-04-23 Cary Coutant <ccoutant@google.com>
5267
5268 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5269 CU range table of gdb index.
5270
5271 2012-04-20 David S. Miller <davem@davemloft.net>
5272
5273 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5274 instead of false.
5275
5276 2012-04-16 David S. Miller <davem@davemloft.net>
5277
5278 * sparc.cc (Target_sparc::got_address): New function.
5279 (Sparc_relocate_functions::gdop_hix22): New function.
5280 (Sparc_relocate_functions::gdop_lox10): New function.
5281 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5282 relocs.
5283 (Target_sparc::Scan::local): Likewise if the global symbol is not
5284 preemptible and is not IFUNC.
5285 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5286 transformations for local and non-preemptible non-IFUNC global
5287 symbols.
5288
5289 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5290 writing out 64-bit part of ranges.
5291
5292 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5293 -fpic and -fpie respectively.
5294 * Makefile.in: Regenerate.
5295
5296 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5297 (Target_sparc::Target_sparc): Initialize new field.
5298 (Target_sparc::do_plt_section_for_global): New function.
5299 (Target_sparc::do_plt_section_for_local): New function.
5300 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5301 (Target_sparc::make_plt_section): New function, broken out of
5302 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5303 (Target_sparc::make_plt_entry): Call make_plt_section.
5304 (Target_sparc::make_local_ifunc_plt_entry): New function.
5305 (Target_sparc::rela_ifunc_section): New function.
5306 (Target_sparc::plt_section): Remove const.
5307 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5308 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5309 and ifunc_count_ fields.
5310 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5311 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5312 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5313 (Output_data_plt_sparc::rela_ifunc): New function.
5314 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5315 (Output_data_plt_sparc::has_ifunc_section): New function.
5316 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5317 (Output_data_plt_sparc::address_for_global): New function.
5318 (Output_data_plt_sparc::address_for_local): New function.
5319 (Output_data_plt_sparc::plt_index_to_offset): New function.
5320 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5321 and entry_count.
5322 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5323 entry_count.
5324 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5325 R_SPARC_JMP_IREL to switch.
5326 (Target_sparc::Scan::check_non_pic): Likewise.
5327 (Target_sparc::Scan::local): Handle IFUNC symbols.
5328 (Target_sparc::Scan::local): Likewise.
5329 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5330 and plt_address_for_local.
5331 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5332 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5333
5334 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5335 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5336 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5337 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5338 global relocs too.
5339 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5340 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5341 calls.
5342 * sparc.cc (Target_sparc::Scan::global): Likewise.
5343 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5344
5345 2012-04-16 Cary Coutant <ccoutant@google.com>
5346
5347 * archive.cc (Library_base::should_include_member): Check for
5348 --export-dynamic-symbol.
5349 * options.h (class General_options): Add --export-dynamic-symbol.
5350 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5351 --export-dynamic-symbol.
5352 (Symbol_table::gc_mark_undef_symbols): Likewise.
5353 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5354
5355 2012-04-12 David S. Miller <davem@davemloft.net>
5356
5357 * sparc.cc (Reloc::wdisp10): New relocation method.
5358 (Reloc::h34): Likewise.
5359 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5360 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5361 R_SPARC_WDISP10.
5362 (Target_sparc::Scan::local): Likewise.
5363 (Target_sparc::Scan::global): Likewise.
5364 (Target_sparc::Relocate::relocate): Likewise.
5365
5366 2012-04-09 Cary Coutant <ccoutant@google.com>
5367
5368 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5369 low_pc == 0.
5370
5371 2012-04-06 Ian Lance Taylor <iant@google.com>
5372
5373 * timer.cc: #include <unistd.h>.
5374
5375 2012-04-06 Roland McGrath <mcgrathr@google.com>
5376
5377 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5378 * config.in: Regenerate.
5379 * configure: Regenerate.
5380
5381 2012-04-05 Nick Clifton <nickc@redhat.com>
5382
5383 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5384 (AM_LC_MESSAGES): Add.
5385 * aclocal.m4: Regenerate.
5386 * config.in: Regenerate.
5387 * configure: Regenerate.
5388
5389 2012-03-21 Cary Coutant <ccoutant@google.com>
5390
5391 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5392 * Makefile.in: Regenerate.
5393 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5394 (Sized_elf_reloc_mapper::symbol_section): New function.
5395 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5396 (make_elf_reloc_mapper): New function.
5397 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5398 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5399 (Dwarf_abbrev_table::do_get_abbrev): New function.
5400 (Dwarf_ranges_table::read_ranges_table): New function.
5401 (Dwarf_ranges_table::read_range_list): New function.
5402 (Dwarf_pubnames_table::read_section): New function.
5403 (Dwarf_pubnames_table::read_header): New function.
5404 (Dwarf_pubnames_table::next_name): New function.
5405 (Dwarf_die::Dwarf_die): New function.
5406 (Dwarf_die::read_attributes): New function.
5407 (Dwarf_die::skip_attributes): New function.
5408 (Dwarf_die::set_name): New function.
5409 (Dwarf_die::set_linkage_name): New function.
5410 (Dwarf_die::attribute): New function.
5411 (Dwarf_die::string_attribute): New function.
5412 (Dwarf_die::int_attribute): New function.
5413 (Dwarf_die::uint_attribute): New function.
5414 (Dwarf_die::ref_attribute): New function.
5415 (Dwarf_die::child_offset): New function.
5416 (Dwarf_die::sibling_offset): New function.
5417 (Dwarf_info_reader::check_buffer): New function.
5418 (Dwarf_info_reader::parse): New function.
5419 (Dwarf_info_reader::do_parse): New function.
5420 (Dwarf_info_reader::do_read_string_table): New function.
5421 (Dwarf_info_reader::lookup_reloc): New function.
5422 (Dwarf_info_reader::get_string): New function.
5423 (Dwarf_info_reader::visit_compilation_unit): New function.
5424 (Dwarf_info_reader::visit_type_unit): New function.
5425 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5426 Sized_elf_reloc_mapper.
5427 (Sized_dwarf_line_info::symbol_section): Remove function.
5428 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5429 (Sized_dwarf_line_info::read_line_mappings): Remove object
5430 parameter, adjust callers.
5431 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5432 * dwarf_reader.h: Include <sys/types.h>.
5433 (class Track_relocs): Remove forward declaration.
5434 (class Elf_reloc_mapper): New class.
5435 (class Sized_elf_reloc_mapper): New class.
5436 (class Dwarf_abbrev_table): New class.
5437 (class Dwarf_range_list): New class.
5438 (class Dwarf_ranges_table): New class.
5439 (class Dwarf_pubnames_table): New class.
5440 (class Dwarf_die): New class.
5441 (class Dwarf_info_reader): New class.
5442 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5443 (Sized_dwarf_line_info::symbol_section): Remove member function.
5444 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5445 base class.
5446 * gdb-index.cc: New source file.
5447 * gdb-index.h: New source file.
5448 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5449 and .debug_types sections, call Layout::add_to_gdb_index.
5450 (Sized_relobj_incr::do_section_name): Implement.
5451 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5452 return type; Implement.
5453 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5454 return type.
5455 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5456 parameter list and return type.
5457 (Sized_incr_dynobj::do_section_contents): Likewise.
5458 * layout.cc: Include gdb-index.h.
5459 (Layout::Layout): Initialize gdb_index_data_.
5460 (Layout::init_fixed_output_section): Check for .gdb_index section.
5461 (Layout::add_to_gdb_index): New function. Instantiate.
5462 * layout.h: Add forward declaration for class Gdb_index.
5463 (Layout::add_to_gdb_index): New member function.
5464 (Layout::gdb_index_data_): New data member.
5465 * main.cc: Include gdb-index.h.
5466 (main): Print statistics for gdb index.
5467 * object.cc (Object::section_contents): Move code into
5468 do_section_contents.
5469 (need_decompressed_section): Check for sections needed when building
5470 gdb index.
5471 (build_compressed_section_map): Likewise.
5472 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5473 gdb index.
5474 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5475 sections; call Layout::add_to_gdb_index.
5476 (Sized_relobj_file::do_decompressed_section_contents): Call
5477 do_section_contents directly.
5478 * object.h (Object::do_section_contents): Adjust parameter list and
5479 return type.
5480 (Object::do_decompressed_section_contents): Call do_section_contents
5481 directly.
5482 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5483 return type.
5484 * options.h (class General_options): Add --gdb-index option.
5485 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5486 list and return type.
5487 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5488 * reloc.h (Track_relocs::checkpoint): New function.
5489 (Track_relocs::reset): New function.
5490
5491 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5492 New test cases.
5493 * testsuite/Makefile.in: Regenerate.
5494 * testsuite/gdb_index_test.cc: New test source file.
5495 * testsuite/gdb_index_test_1.sh: New test source file.
5496 * testsuite/gdb_index_test_2.sh: New test source file.
5497
5498 2012-03-19 Doug Kwan <dougkwan@google.com>
5499
5500 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5501 (Target_arm::do_finalize_sections): Remove code which defines
5502 __exidx_start and __exidx_end. Make symbol table parameter
5503 anonymous as it is not used.
5504 * gold.cc (queue_middle_tasks): Call target hook to define any
5505 target-specific symbols.
5506 * target.h (Target::define_standard_symbols): New method.
5507 (Target::do_define_standard_symbols): Same.
5508 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5509 * testsuite/Makefile.in: Regenerate.
5510 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5511 and __exidx_end.
5512 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5513 relocations are generated for __exidx_start and __exidx_end.
5514
5515 2012-03-16 Doug Kwan <dougkwan@google.com>
5516
5517 * testsuite/Makefile.am: Disable test initpri3b.
5518 * testsuite/Makefile.in: Regenerate.
5519
5520 2012-03-15 Doug Kwan <dougkwan@google.com>
5521
5522 * arm.cc (Target_arm::got_section): Make .got section read-only
5523 if -z now is given.
5524
5525 2012-03-15 Ian Lance Taylor <iant@google.com>
5526
5527 PR gold/13850
5528 * layout.cc (Layout::make_output_section): Correctly mark
5529 SHT_INIT_ARRAY, et. al., as relro.
5530
5531 2012-03-14 Doug Kwan <dougkwan@google.com>
5532
5533 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5534 dynamic relocations for protected symbols in shared objects.
5535
5536 2012-03-13 Ian Lance Taylor <iant@google.com>
5537
5538 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5539 keep the larger alignment.
5540
5541 2012-03-12 Cary Coutant <ccoutant@google.com>
5542
5543 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5544 handling of DW_LNE_define_file.
5545
5546 2012-03-12 Cary Coutant <ccoutant@google.com>
5547
5548 * reduced_debug_output.cc
5549 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5550 codes to switch.
5551
5552 2012-02-29 Cary Coutant <ccoutant@google.com>
5553
5554 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5555
5556 2012-02-29 Cary Coutant <ccoutant@google.com>
5557
5558 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5559 Call Object::decompressed_section_contents.
5560 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5561 New dtor.
5562 (Sized_dwarf_line_info::buffer_start_): New data member.
5563 * merge.cc (Output_merge_data::do_add_input_section): Call
5564 Object::decompressed_section_contents.
5565 (Output_merge_string::do_add_input_section): Likewise.
5566 * object.cc (need_decompressed_section): New function.
5567 (build_compressed_section_map): Decompress sections needed later.
5568 (Sized_relobj_file::do_decompressed_section_contents): New function.
5569 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5570 * object.h (Object::decompressed_section_contents): New function.
5571 (Object::discard_decompressed_sections): New function.
5572 (Object::do_decompressed_section_contents): New function.
5573 (Object::do_discard_decompressed_sections): New function.
5574 (Compressed_section_info): New type.
5575 (Compressed_section_map): Include decompressed section contents.
5576 (Sized_relobj_file::do_decompressed_section_contents): New function.
5577 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5578
5579 2012-02-16 Cary Coutant <ccoutant@google.com>
5580
5581 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5582 * testsuite/Makefile.in: Regenerate.
5583
5584 2012-02-14 Cary Coutant <ccoutant@google.com>
5585
5586 * options.cc (General_options::finalize): Disallow -pie and -static.
5587
5588 2012-02-03 Doug Kwan <dougkwan@google.com>
5589
5590 * arm.cc (Arm_relocate_functions::abs8,
5591 Arm_relocate_functions::abs16): Use
5592 Bits::has_signed_unsigned_overflow32.
5593 (Arm_relocate_functions::thm_abs8): Correct range of
5594 overflow check.
5595 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5596 in assertions.
5597
5598 2012-02-02 Doug Kwan <dougkwan@google.com>
5599
5600 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5601 position independent outputs, not just shared objects.
5602
5603 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5604
5605 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5606 * configure: Regenerated.
5607
5608 2012-01-27 Ian Lance Taylor <iant@google.com>
5609
5610 * reloc.h (Bits): New class with static functions, copied from
5611 namespace utils in arm.cc.
5612 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5613 instead.
5614
5615 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5616
5617 * incremental.cc (write_info_blocks): Correct relocation offset.
5618
5619 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5620
5621 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5622 (Relocate::tls_gd_to_le): Likewise.
5623
5624 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5625
5626 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5627
5628 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5629
5630 * configure.ac: Check if -mcmodel=medium works.
5631 * configure: Regenerated.
5632
5633 2012-01-24 Cary Coutant <ccoutant@google.com>
5634
5635 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5636 definition and ...
5637 (read_unsigned_LEB_128_x): ... this new function.
5638 (read_signed_LEB_128): Replaced with inline definition and ...
5639 (read_signed_LEB_128_x): ... this new function.
5640 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5641 (read_unsigned_LEB_128): Add inline definition.
5642 (read_signed_LEB_128_x): New function.
5643 (read_signed_LEB_128): Add inline definition.
5644 * testsuite/Makefile.am (leb128_unittest): New unit test.
5645 * testsuite/Makefile.in: Regenerate.
5646 * testsuite/leb128_unittest.cc: New unit test.
5647
5648 2012-01-23 Ian Lance Taylor <iant@google.com>
5649
5650 PR gold/13617
5651 * i386.cc (Target_i386::do_code_fill): When using a jmp
5652 instruction, pad with nop instructions.
5653 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5654
5655 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5656
5657 * x86_64.cc (gc_process_relocs): Add typename on types used in
5658 template.
5659 (scan_relocs): Likewise.
5660 (relocate_section): Likewise.
5661 (apply_relocation): Likewise.
5662
5663 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5664
5665 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5666 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5667 under x32.
5668
5669 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5670
5671 * x86_64.cc: Initial support for x32.
5672
5673 2012-01-03 Cary Coutant <ccoutant@google.com>
5674
5675 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5676 Use abstract base class for GOT.
5677 * gold/output.h (class Output_data_got_base): New abstract base class.
5678 (class Output_data_got): Derive from new base class, adjust ctors.
5679 (Output_data_got::reserve_slot): Make virtual; rename to
5680 do_reserve_slot; Adjust callers.
5681 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5682 pointer to abstract base class.
5683 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5684
5685 2011-12-18 Ian Lance Taylor <iant@google.com>
5686
5687 * object.h (Relobj::local_symbol_value): New function.
5688 (Relobj::local_plt_offset): New function.
5689 (Relobj::local_has_got_offset): New function.
5690 (Relobj::local_got_offset): New function.
5691 (Relobj::set_local_got_offset): New function.
5692 (Relobj::do_local_symbol_value): New pure virtual function.
5693 (Relobj::do_local_plt_offset): Likewise.
5694 (Relobj::do_local_has_got_offset): Likewise.
5695 (Relobj::do_local_got_offset): Likewise.
5696 (Relobj::do_set_local_got_offset): Likewise.
5697 (Sized_relobj::do_local_has_got_offset): Rename from
5698 local_has_got_offset.
5699 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5700 (Sized_relobj::do_set_local_got_offset): Rename from
5701 set_local_got_offset.
5702 (Sized_relobj_file::do_local_plt_offset): Rename from
5703 local_plt_offset.
5704 (Sized_relobj_file::do_local_symbol_value): New function.
5705 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5706 local_plt_offset.
5707 * output.cc (Output_data_got::Got_entry::write): Change object to
5708 Relobj. Use local_symbol_value.
5709 (Output_data_got::add_global_with_rel): Change rel_dyn to
5710 Output_data_reloc_generic*. Use add_global_generic.
5711 (Output_data_got::add_global_with_rela): Remove. Change all
5712 callers to use add_global_with_rel.
5713 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5714 Output_data_reloc_generic*. Use add_global_generic.
5715 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5716 callers to use add_global_pair_with_rel.
5717 (Output_data_got::add_local): Change object to Relobj*.
5718 (Output_data_got::add_local_plt): Likewise.
5719 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5720 change rel_dyn to Output_data_reloc_generic*. Use
5721 add_local_generic.
5722 (Output_data_got::add_local_with_rela): Remove. Change all
5723 callers to use all_local_with_rel.
5724 (Output_data_got::add_local_pair_with_rel): Change object to
5725 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5726 add_output_section_generic.
5727 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5728 callers to use add_local_pair_with_rel.
5729 (Output_data_got::reserve_local): Change object to Relobj*.
5730 * output.h: (class Output_data_reloc_generic): Add pure virtual
5731 declarations for add_global_generic, add_local_generic,
5732 add_output_section_generic.
5733 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5734 functions for Output_data_reloc_generic. Update declarations for
5735 changes listed in output.cc.
5736 (class Output_data_got): Change template parameter to got_size.
5737 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5738 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5739 function.
5740 (Sized_relobj_incr::do_local_plt_offset): New function.
5741 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5742 add_global_generic.
5743
5744 2011-12-17 Cary Coutant <ccoutant@google.com>
5745
5746 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5747 * resolve.cc (Symbol_table::resolve): Likewise.
5748 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5749 arrays.
5750 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5751
5752 2011-12-16 Ian Lance Taylor <iant@google.com>
5753
5754 * output.h (Output_data_reloc_generic::add): Only call
5755 add_dynamic_reloc if this is a dynamic reloc section.
5756
5757 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5758
5759 PR gold/13505
5760 * target-reloc.h (apply_relocation): Replace <64, false> with
5761 <size, big_endian>.
5762
5763 2011-11-25 Nick Clifton <nickc@redhat.com>
5764
5765 * po/it.po: New Italian translation.
5766
5767 2011-11-17 Sterling Augustine <saugustine@google.com>
5768
5769 * script.cc (script_include_directive): Implement.
5770 (read_script_file): New local variables name and search_path. Update
5771 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5772 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5773 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5774
5775 2011-11-11 Sterling Augustine <saugustine@google.com>
5776
5777 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5778 (file_or_sections_cmd): Likewise.
5779
5780 2011-11-11 Doug Kwan <dougkwan@google.com>
5781
5782 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5783 if --just-symbols is given.
5784
5785 2011-11-10 Doug Kwan <dougkwan@google.com>
5786
5787 PR gold/13362
5788 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5789 when processing data relocs.
5790 * reloc.h (Relocate_functions::rel_unaligned): New method.
5791 (Relocate_functions::pcrel_unaligned): Ditto.
5792 (Relocate_functions::rel32_unaligned): Ditto.
5793 (Relocate_functions::pcrel32_unaligned): Ditto.
5794
5795 2011-11-09 Doug Kwan <dougkwan@google.com>
5796
5797 PR gold/13362
5798 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5799 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5800 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5801 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5802 (Relocate_functions::rel_unaligned): New.
5803 (Relocate_functions::rel32_unaligned): New.
5804 * target-reloc.h (relocate_for_relocatable): Add code to handle
5805 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5806 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5807 arm_unaligned_reloc_r): New targets.
5808 * testsuite/Makefile.in: Regenerate.
5809 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5810 linking.
5811
5812 2011-11-02 Ian Lance Taylor <iant@google.com>
5813
5814 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5815 NATIVE_LINKER.
5816 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5817 * options.cc (General_options::finalize): Use library search path
5818 from configure script if specified. If not native and no sysroot,
5819 only search TOOLLIBDIR.
5820 * options.h (Search_directory::Search_directory): Change name to
5821 const std::string&.
5822 (General_options::add_to_library_path_with_sysroot): Change arg to
5823 const std::string&.
5824 * configure, Makefile.in, config.in: Rebuild.
5825
5826 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5827
5828 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5829 we are working around the ARM1176 Erratum.
5830 * options.h (General_options::fix_arm1176): Add option.
5831 * testsuite/Makefile.am: Add testcases, and keep current ones
5832 working.
5833 * testsuite/Makefile.in: Regenerate.
5834 * testsuite/arm_fix_1176.s: New file.
5835 * testsuite/arm_fix_1176.sh: Likewise.
5836
5837 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5838
5839 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5840 may_use_blx_.
5841 (Target_arm::may_use_blx): Remove method.
5842 (Target_arm::set_may_use_blx): Likewise.
5843 (Target_arm::may_use_v4t_interworking): New method.
5844 (Target_arm::may_use_v5t_interworking): Likewise.
5845 (Target_arm::may_use_blx_): Remove member variable.
5846 (Arm_relocate_functions::arm_branch_common): Check for v5T
5847 interworking.
5848 (Arm_relocate_functions::thumb_branch_common): Likewise.
5849 (Reloc_stub::stub_type_for_reloc): Likewise.
5850 (Target_arm::do_finalize_sections): Correct interworking checks.
5851 * testsuite/Makefile.am: Add new tests.
5852 * testsuite/Makefile.in: Regenerate.
5853 * testsuite/arm_farcall_arm_arm.s: New test.
5854 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5855 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5856 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5857 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5858 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5859 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5860 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5861
5862 2011-10-31 Cary Coutant <ccoutant@google.com>
5863
5864 PR gold/13023
5865 * expression.cc (Expression::eval_with_dot): Add
5866 is_section_dot_assignment parameter.
5867 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5868 absolute and assigning to dot within a section.
5869 * script-sections.cc
5870 (Output_section_element_assignment::set_section_addresses): Pass
5871 dot_section to set_if_absolute.
5872 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5873 as is_section_dot_assignment flag to eval_with_dot.
5874 (Output_section_element_dot_assignment::set_section_addresses):
5875 Likewise.
5876 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5877 parameter. Also set value if relative to dot_section; set the
5878 symbol's output_section.
5879 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5880 parameter. Adjust all callers.
5881 (Expression::eval_maybe_dot): Likewise.
5882 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5883 Adjust all callers.
5884 * testsuite/script_test_2.t: Test assignment of an absolute value
5885 to dot within an output section element.
5886
5887 2011-10-31 Cary Coutant <ccoutant@google.com>
5888
5889 * options.h (class General_options): Add --[no-]gnu-unique options.
5890 * symtab.cc (Symbol_table::sized_write_globals): Convert
5891 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5892
5893 2011-10-31 Cary Coutant <ccoutant@google.com>
5894
5895 PR gold/13359
5896 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5897 unnecessary assertion.
5898 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5899
5900 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5901
5902 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5903 gc_mark_symbol.
5904 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5905 gc_mark_symbol.
5906 Change to just keep the section associated with symbol.
5907 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5908 they are externally visible and --export-dynamic is turned on.
5909 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5910
5911 2011-10-19 Ian Lance Taylor <iant@google.com>
5912
5913 PR gold/13163
5914 * script-sections.cc
5915 (Output_section_element_dot_assignment::needs_output_section): New
5916 function.
5917
5918 2011-10-19 Ian Lance Taylor <iant@google.com>
5919
5920 PR gold/13204
5921 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5922 --section-start option was seen.
5923 * options.h (General_options::any_section_start): New function.
5924
5925 2011-10-18 David S. Miller <davem@davemloft.net>
5926
5927 PR binutils/13301
5928 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5929 member to track relocation locations that have moved during TLS
5930 reloc optimizations.
5931 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5932 (Target_sparc::Relocate::relocate): Adjust view down by 4
5933 bytes if it matches reloc_adjust_addr_.
5934 (Target_sparc::Relocate::relocate_tls): Always move the
5935 __tls_get_addr call delay slot instruction forward 4 bytes when
5936 performing relaxation.
5937
5938 2011-10-18 Cary Coutant <ccoutant@google.com>
5939
5940 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5941 (Output_file::map_no_anonymous): Check for non-zero
5942 return code from posix_fallocate.
5943
5944 2011-10-17 Cary Coutant <ccoutant@google.com>
5945
5946 PR gold/13245
5947 * plugin.cc (is_visible_from_outside): Check for symbols
5948 referenced from dynamic objects.
5949 * resolve.cc (Symbol_table::resolve): Don't count references
5950 from dynamic objects as references from real ELF files.
5951 * testsuite/plugin_test_2.sh: Adjust expected result.
5952
5953 2011-10-17 Cary Coutant <ccoutant@google.com>
5954
5955 * gold.cc: Include timer.h.
5956 (queue_middle_tasks): Stamp time.
5957 (queue_final_tasks): Likewise.
5958 * main.cc (main): Store timer in parameters. Print timers
5959 for each pass.
5960 * parameters.cc (Parameters::Parameters): Initialize timer_.
5961 (Parameters::set_timer): New function.
5962 (set_parameters_timer): New function.
5963 * parameters.h (Parameters::set_timer): New function.
5964 (Parameters::timer): New function.
5965 (Parameters::timer_): New data member.
5966 (set_parameters_timer): New function.
5967 * timer.cc (Timer::stamp): New function.
5968 (Timer::get_pass_time): New function.
5969 * timer.h (Timer::stamp): New function.
5970 (Timer::get_pass_time): New function.
5971 (Timer::pass_times_): New data member.
5972
5973 2011-10-17 Cary Coutant <ccoutant@google.com>
5974
5975 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5976 task for members of lib groups.
5977
5978 2011-10-17 Cary Coutant <ccoutant@google.com>
5979
5980 PR gold/13288
5981 * fileread.cc (File_read::find_view): Add assert.
5982 (File_read::make_view): Move bounds check (replace with assert)...
5983 (File_read::find_or_make_view): ... to here.
5984
5985 2011-10-12 Cary Coutant <ccoutant@google.com>
5986
5987 * output.cc (Output_file::open_base_file): Handle case where
5988 ::read returns less than requested size.
5989
5990 2011-10-10 Cary Coutant <ccoutant@google.com>
5991
5992 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5993 Initialize defined_count_.
5994 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5995 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5996 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5997 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5998 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5999 * incremental.h (Sized_relobj_incr::defined_count_): New data
6000 member.
6001 (Sized_incr_dynobj::defined_count_): New data member.
6002 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
6003 Return zeroes instead of internal error.
6004
6005 2011-10-10 Cary Coutant <ccoutant@google.com>
6006
6007 PR gold/13249
6008 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
6009 (Output_reloc::symbol_value): Return PLT offset if flag is set.
6010 * output.h (class Output_reloc): Add use_plt_offset flag.
6011 (Output_reloc::type_): Adjust size of bit field.
6012 (Output_reloc::use_plt_offset_): New bit field.
6013 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
6014 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
6015 flag. Adjust all callers.
6016 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
6017 creating RELATIVE relocations.
6018
6019 2011-10-10 Nick Clifton <nickc@redhat.com>
6020
6021 * po/es.po: Updated Spanish translation.
6022 * po/fi.po: Updated Finnish translation.
6023
6024 2011-10-03 Diego Novillo <dnovillo@google.com>
6025
6026 * options.cc (parse_uint): Fix dereference of RETVAL.
6027
6028 2011-09-29 Sriraman Tallam <tmsriram@google.com>
6029
6030 * layout.h (section_order_map_): New member.
6031 (get_section_order_map): New member function.
6032 * output.cc (Output_section::add_input_section): Check for patterns
6033 only when --section-ordering-file is specified.
6034 * gold.cc (queue_middle_tasks): Delay updating order of sections till
6035 output_sections have been formed.
6036 * layout.cc (Layout_Layout): Initialize section_order_map_.
6037 * plugin.cc (update_section_order): Store order in order_map. Do not
6038 update the order.
6039 * testsuite/Makefile.am: Add test case for plugin_final_layout.
6040 * testsuite/Makefile.in: Regenerate.
6041 * testsuite/plugin_section_order.c: New file.
6042 * testsuite/plugin_final_layout.cc: New file.
6043 * testsuite/plugin_final_layout.sh: New file.
6044
6045 2011-09-29 Cary Coutant <ccoutant@google.com>
6046
6047 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6048 Check for NULL.
6049 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
6050 symbols during incremental update.
6051 (Symbol_table::add_from_dynobj): Likewise.
6052
6053 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6054 Ian Lance Taylor <iant@google.com>
6055
6056 * symtab.cc (Symbol_table::define_special_symbol): Always
6057 canonicalize version string.
6058
6059 2011-09-26 Cary Coutant <ccoutant@google.com>
6060
6061 * gold.cc (queue_initial_tasks): Move option checks ...
6062 * options.cc (General_options::finalize): ... to here. Disable
6063 some options; make others fatal.
6064
6065 2011-09-26 Cary Coutant <ccoutant@google.com>
6066
6067 gcc PR lto/47247
6068 * plugin.cc (get_symbols_v2): New function.
6069 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
6070 (is_referenced_from_outside): New function.
6071 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
6072 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
6073 (get_symbols): Pass version parameter.
6074 (get_symbols_v2): New function.
6075 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
6076 parameter.
6077 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
6078 (onload): Add LDPT_GET_SYMBOLS_V2.
6079 (all_symbols_read_hook): Use get_symbols_v2; check for
6080 LDPR_PREVAILING_DEF_IRONLY_EXP.
6081 * testsuite/plugin_test_3.sh: Update expected results.
6082
6083 2011-09-23 Simon Baldwin <simonb@google.com>
6084
6085 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
6086 configuration options.
6087 * configure: Regenerate.
6088 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
6089 * Makefile.in: Regenerate.
6090 * testsuite/Makefile.in: Regenerate.
6091
6092 2011-09-19 Sriraman Tallam <tmsriram@google.com>
6093
6094 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
6095
6096 2011-09-19 Cary Coutant <ccoutant@google.com>
6097
6098 * incremental.cc (can_incremental_update): Fix typo in comment.
6099 * incremental.h (can_incremental_update): Likewise.
6100
6101 2011-09-18 Cary Coutant <ccoutant@google.com>
6102
6103 * incremental.cc (can_incremental_update): New function.
6104 * incremental.h (can_incremental_update): New function.
6105 * layout.cc (Layout::init_fixed_output_section): Call it.
6106 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6107 * object.cc (Sized_relobj_file::do_layout): Call
6108 can_incremental_update.
6109
6110 2011-09-13 Cary Coutant <ccoutant@google.com>
6111
6112 * configure.ac: Check for glibc support for gnu_indirect_function
6113 support with static linking, setting automake conditional
6114 IFUNC_STATIC.
6115 * Makefile.in: Regenerate.
6116 * configure: Regenerate.
6117
6118 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6119 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6120 for IFUNC_STATIC.
6121 * testsuite/Makefile.in: Regenerate.
6122
6123 2011-09-13 Cary Coutant <ccoutant@google.com>
6124
6125 * incremental.cc (Sized_relobj_incr::do_layout): Call
6126 report_comdat_group for kept comdat sections.
6127 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6128 * testsuite/Makefile.in: Regenerate.
6129 * testsuite/incr_comdat_test_1.cc: New source file.
6130 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6131 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6132 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6133
6134 2011-09-13 Ian Lance Taylor <iant@google.com>
6135
6136 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6137 variable external_symbols_offset.
6138
6139 2011-09-12 Ian Lance Taylor <iant@google.com>
6140
6141 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6142 triggered if object has no symbols.
6143
6144 2011-09-09 David S. Miller <davem@davemloft.net>
6145
6146 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6147 (Output_fill_debug_line::do_write): Likewise.
6148
6149 2011-08-29 Cary Coutant <ccoutant@google.com>
6150
6151 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6152 casts to match formatting specs.
6153 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6154
6155 2011-08-26 Cary Coutant <ccoutant@google.com>
6156
6157 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6158 remaining hole size when allocating.
6159 (Layout::make_output_section): Set fill methods for debug sections.
6160 * layout.h (Free_list::Free_list_node): Move from private to
6161 public.
6162 (Free_list::set_min_hole_size): New function.
6163 (Free_list::begin, Free_list::end): New functions.
6164 (Free_list::min_hole_): New data member.
6165 * output.cc: Include dwarf.h.
6166 (Output_fill_debug_info::do_minimum_hole_size): New function.
6167 (Output_fill_debug_info::do_write): New function.
6168 (Output_fill_debug_line::do_minimum_hole_size): New function.
6169 (Output_fill_debug_line::do_write): New function.
6170 (Output_section::Output_section): Initialize new data member.
6171 (Output_section::set_final_data_size): Ensure patch space is larger
6172 than minimum hole size.
6173 (Output_section::do_write): Fill holes in debug sections.
6174 * output.h (Output_fill): New class.
6175 (Output_fill_debug_info): New class.
6176 (Output_fill_debug_line): New class.
6177 (Output_section::set_free_space_fill): New function.
6178 (Output_section::free_space_fill_): New data member.
6179 * testsuite/Makefile.am (incremental_test_3): Add
6180 --incremental-patch option.
6181 (incremental_test_4): Likewise.
6182 (incremental_test_5): Likewise.
6183 (incremental_test_6): Likewise.
6184 (incremental_copy_test): Likewise.
6185 (incremental_common_test_1): Likewise.
6186 * testsuite/Makefile.in: Regenerate.
6187
6188 2011-08-26 Nick Clifton <nickc@redhat.com>
6189
6190 * po/es.po: Updated Spanish translation.
6191
6192 2011-08-01 Cary Coutant <ccoutant@google.com>
6193
6194 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6195 * gold/testsuite/Makefile.in: Regenerate.
6196 * gold/testsuite/justsyms_exec.c: New source file.
6197 * gold/testsuite/justsyms_lib.c: New source file.
6198
6199 2011-08-01 Cary Coutant <ccoutant@google.com>
6200
6201 * layout.cc (Layout::set_segment_offsets): Don't realign text
6202 segment if -Ttext was specified.
6203 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6204 file type.
6205 * object.h (Sized_relobj_file::e_type): New function.
6206 (Sized_relobj_file::e_type_): New data member.
6207 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6208 base address for ET_EXEC files.
6209 * target.cc (Target::do_make_elf_object_implementation): Allow
6210 ET_EXEC files with --just-symbols option.
6211
6212 2011-07-28 Cary Coutant <ccoutant@google.com>
6213
6214 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6215 Add thread_number parameter.
6216 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6217 * workqueue-threads.cc
6218 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6219 current thread if its thread number is greater than desired thread
6220 count.
6221 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6222 Add thread_number parameter.
6223 (Workqueue::should_cancel_thread): Likewise.
6224 (Workqueue::find_runnable_or_wait): Pass thread_number to
6225 should_cancel_thread.
6226 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6227 parameter.
6228
6229 2011-07-22 Sriraman Tallam <tmsriram@google.com>
6230
6231 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6232 only after checking if it cannot be forced local.
6233 * symtab.h (is_externally_visible): Check if the symbol is not forced
6234 local.
6235
6236 2011-07-15 Ian Lance Taylor <iant@google.com>
6237
6238 * options.h (class General_options): Add --print-output-format.
6239 Move -EL next to -EB, for better --help output.
6240 * target-select.cc: Include <cstdio>, "options.h", and
6241 "parameters.h".
6242 (Target_selector::do_target_bfd_name): New function.
6243 (print_output_format): New function.
6244 * target-select.h (class Target_selector): Update declarations.
6245 (Target_selector::target_bfd_name): New function.
6246 (print_output_format): Declare.
6247 * main.cc: Include "target-select.h".
6248 (main): Handle --print-output-format.
6249 * gold.cc: Include "target-select.h".
6250 (queue_initial_tasks): Handle --print-output-format when there are
6251 no input files.
6252 * parameters.cc (parameters_force_valid_target): Give a better
6253 error message if -EB/-EL does not match target.
6254 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6255 function.
6256
6257 2011-07-15 Ian Lance Taylor <iant@google.com>
6258
6259 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6260 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6261 (Output_data_plt_i386::do_write): Write address of .dynamic
6262 section to first entry in .got.plt section.
6263 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6264 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6265 Initialize layout_.
6266 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6267 section to first entry in .got.plt section.
6268 * layout.h (Layout::dynamic_section): New function.
6269
6270 2011-07-13 Sriraman Tallam <tmsriram@google.com>
6271
6272 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6273 to claim_file call.
6274 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6275 input_section_position_, and input_section_glob_.
6276 (read_layout_from_file): Call function section_ordering_specified.
6277 * layout.h (is_section_ordering_specified): New function.
6278 (section_ordering_specified): New function.
6279 (section_ordering_specified_): New boolean member.
6280 * main.cc(main): Call load_plugins after layout object is defined.
6281 * output.cc (Output_section::add_input_section): Use
6282 function section_ordering_specified to check if section ordering is
6283 needed.
6284 * output.cc (Output_section::add_relaxed_input_section): Use
6285 function section_ordering_specified to check if section ordering is
6286 needed.
6287 (Output_section::update_section_layout): New function.
6288 (Output_section::sort_attached_input_sections): Check if input section
6289 must be reordered.
6290 * output.h (Output_section::update_section_layout): New function.
6291 * plugin.cc (get_section_count): New function.
6292 (get_section_type): New function.
6293 (get_section_name): New function.
6294 (get_section_contents): New function.
6295 (update_section_order): New function.
6296 (allow_section_ordering): New function.
6297 (Plugin::load): Add the new interfaces to the transfer vector.
6298 (Plugin_manager::load_plugins): New parameter.
6299 (Plugin_manager::all_symbols_read): New parameter.
6300 (Plugin_manager::claim_file): New parameter. Save the elf object for
6301 unclaimed objects.
6302 (Plugin_manager::get_elf_object): New function.
6303 (Plugin_manager::get_view): Change to directly use the bool to check
6304 if get_view is called from claim_file_hook.
6305 * plugin.h (input_objects): New function
6306 (Plugin__manager::load_plugins): New parameter.
6307 (Plugin_manager::claim_file): New parameter.
6308 (Plugin_manager::get_elf_object): New function.
6309 (Plugin_manager::in_claim_file_handler): New function.
6310 (Plugin_manager::in_claim_file_handler_): New member.
6311 (layout): New function.
6312 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6313 handler with an extra parameter. Make the elf object before calling
6314 claim_file handler.
6315 * testsuite/plugin_test.c (get_section_count): New function pointer.
6316 (get_section_type): New function pointer.
6317 (get_section_name): New function pointer.
6318 (get_section_contents): New function pointer.
6319 (update_section_order): New function pointer.
6320 (allow_section_ordering): New function pointer.
6321 (onload): Check if the new interfaces exist.
6322
6323 2011-07-13 Ian Lance Taylor <iant@google.com>
6324
6325 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6326 relro section.
6327 * x86_64.cc (Target_x86_64::got_section): Likewise.
6328 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6329 (relro_now_test_SOURCES): New variable.
6330 (relro_now_test_DEPENDENCIES): New variable.
6331 (relro_now_test_LDFLAGS): New variable.
6332 (relro_now_test_LDADD): New variable.
6333 (relro_now_test.so): New target.
6334 * testsuite/Makefile.in: Rebuild.
6335
6336 2011-07-12 Ian Lance Taylor <iant@google.com>
6337
6338 PR gold/12980
6339 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6340 GLOB_DAT relocation rather than a RELATIVE relocation for a
6341 protected symbol when creating a shared library.
6342 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6343 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6344 * testsuite/protected_main_1.cc (main): Test that protected
6345 function has same address.
6346
6347 2011-07-11 Ian Lance Taylor <iant@google.com>
6348
6349 PR gold/12979
6350 * options.h (class General_options): Add -Bgroup.
6351 * options.cc (General_options::finalize): If -Bgroup is set,
6352 default to --unresolved-symbols=report-all.
6353 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6354 * target-reloc.h (issue_undefined_symbol_error): Handle
6355 --unresolved-symbols=report-all.
6356
6357 2011-07-08 Ian Lance Taylor <iant@google.com>
6358
6359 PR gold/11985
6360 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6361 if linker script discards key sections.
6362 (Layout::create_dynamic_symtab): Likewise.
6363 (Layout::assign_local_dynsym_offsets): Likewise.
6364 (Layout::sized_create_version_sections): Likewise.
6365 (Layout::create_interp): Likewise.
6366 (Layout::finish_dynamic_section): Likewise.
6367 (Layout::set_dynamic_symbol_size): Likewise.
6368
6369 2011-07-08 Ian Lance Taylor <iant@google.com>
6370
6371 PR gold/12386
6372 * options.h (class General_options): Add --unresolved-symbols.
6373 * target-reloc.h (issue_undefined_symbol_error): Check
6374 --unresolved-symbols. Add comments.
6375
6376 2011-07-08 Ian Lance Taylor <iant@google.com>
6377
6378 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6379 expression more complex.
6380
6381 2011-07-08 Ian Lance Taylor <iant@google.com>
6382
6383 PR gold/11317
6384 * target-reloc.h (issue_undefined_symbol_error): New inline
6385 function, broken out of relocate_section.
6386 (relocate_section): Call issue_undefined_symbol_error.
6387 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6388 there is no TLS segment if we are about to issue an undefined
6389 symbol error.
6390 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6391
6392 2011-07-08 Ian Lance Taylor <iant@google.com>
6393
6394 PR gold/12279
6395 * resolve.cc (Symbol_table::should_override): Add fromtype
6396 parameter. Change all callers. Give error when linking together
6397 TLS and non-TLS symbol.
6398 (Symbol_table::should_override_with_special): Add fromtype
6399 parameter. Change all callers.
6400 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6401 there is no TLS segment if we have reported some errors.
6402 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6403
6404 2011-07-08 Ian Lance Taylor <iant@google.com>
6405
6406 PR gold/12372
6407 * target.h (Target::plt_address_for_global): New function.
6408 (Target::plt_address_for_local): New function.
6409 (Target::plt_section_for_global): Remove.
6410 (Target::plt_section_for_local): Remove.
6411 (Target::do_plt_address_for_global): New virtual function.
6412 (Target::do_plt_address_for_local): New virtual function.
6413 (Target::do_plt_section_for_global): Remove.
6414 (Target::do_plt_section_for_local): Remove.
6415 (Target::register_global_plt_entry): Add Symbol_table and Layout
6416 parameters.
6417 * output.cc (Output_data_got::Got_entry::write): Use
6418 plt_address_for_global and plt_address_for_local.
6419 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6420 address of output section.
6421 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6422 got_irelative_, and irelative_count_ fields. Update
6423 declarations.
6424 (Output_data_plt_i386::has_irelative_section): New function.
6425 (Output_data_plt_i386::entry_count): Add irelative_count_.
6426 (Output_data_plt_i386::set_final_data_size): Likewise.
6427 (class Target_i386): Add got_irelative_ and rel_irelative_
6428 fields. Update declarations.
6429 (Target_i386::Target_i386): Initialize new fields.
6430 (Target_i386::do_plt_address_for_global): New function replacing
6431 do_plt_section_for_global.
6432 (Target_i386::do_plt_address_for_local): New function replacing
6433 do_plt_section_for_local.
6434 (Target_i386::got_section): Create got_irelative_.
6435 (Target_i386::rel_irelative_section): New function.
6436 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6437 fields. Don't define __rel_iplt_{start,end}.
6438 (Output_data_plt_i386::add_entry): Add symtab and layout
6439 parameters. Change all callers. Use different PLT and GOT for
6440 IFUNC symbols.
6441 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6442 layout parameters. Change all callers. Use different PLT and
6443 GOT.
6444 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6445 (Output_data_plt_i386::rel_irelative): New function.
6446 (Output_data_plt_i386::address_for_global): New function.
6447 (Output_data_plt_i386::address_for_local): New function.
6448 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6449 IRELATIVE GOT when changing IFUNC GOT entries.
6450 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6451 reloc.
6452 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6453 if we didn't create an IRELATIVE GOT.
6454 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6455 plt_address_for_local.
6456 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6457 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6458 got_irelative_, and irelative_count_ fields. Update
6459 declarations.
6460 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6461 Initialize new fields. Remove symtab parameter. Change all
6462 callers.
6463 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6464 irelative_count_.
6465 (Output_data_plt_x86_64::has_irelative_section): New function.
6466 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6467 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6468 fields. Update declarations.
6469 (Target_x86_64::Target_x86_64): Initialize new fields.
6470 (Target_x86_64::do_plt_address_for_global): New function replacing
6471 do_plt_section_for_global.
6472 (Target_x86_64::do_plt_address_for_local): New function replacing
6473 do_plt_section_for_local.
6474 (Target_x86_64::got_section): Create got_irelative_.
6475 (Target_x86_64::rela_irelative_section): New function.
6476 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6477 all callers. Don't create __rel_iplt_{start,end}.
6478 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6479 parameters. Change all callers. Use different PLT and GOT for
6480 IFUNC symbols.
6481 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6482 layout parameters. Change all callers. Use different PLT and
6483 GOT.
6484 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6485 parameters. Change all callers. Use different PLT and GOT for
6486 IFUNC symbols.
6487 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6488 (Output_data_plt_x86_64::rela_irelative): New function.
6489 (Output_data_plt_x86_64::address_for_global): New function.
6490 (Output_data_plt_x86_64::address_for_local): New function.
6491 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6492 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6493 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6494 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6495 parameters.
6496 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6497 reloc.
6498 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6499 symbols if we didn't create an IRELATIVE GOT.
6500 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6501 plt_address_for_local.
6502 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6503 * testsuite/ifuncvar1.c: New test file.
6504 * testsuite/ifuncvar2.c: New test file.
6505 * testsuite/ifuncvar3.c: New test file.
6506 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6507 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6508 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6509 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6510 * testsuite/Makefile.in: Rebuild.
6511
6512 2011-07-07 Cary Coutant <ccoutant@google.com>
6513
6514 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6515 (two_file_test_1_ndebug.o): Likewise.
6516 (two_file_test_1b_ndebug.o): Likewise.
6517 (two_file_test_2_ndebug.o): Likewise.
6518 (two_file_test_main_ndebug.o): Likewise.
6519 (incremental_test_2): Link with no-debug versions.
6520
6521 2011-07-06 Cary Coutant <ccoutant@google.com>
6522
6523 * gold/incremental.cc
6524 (Output_section_incremental_inputs::write_info_blocks): Check for
6525 hidden and internal symbols.
6526
6527 2011-07-06 Cary Coutant <ccoutant@google.com>
6528
6529 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6530 Check disposition for startup file.
6531 (Incremental_inputs::report_command_line): Ignore
6532 --incremental-startup-unchanged option.
6533 * options.cc (General_options::parse_incremental_startup_unchanged):
6534 New function.
6535 (General_options::General_options): Initialize new data member.
6536 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6537 (General_options): Add --incremental-startup-unchanged option.
6538 (General_options::incremental_startup_disposition): New function.
6539 (General_options::incremental_startup_disposition_): New data member.
6540
6541 2011-07-06 Cary Coutant <ccoutant@google.com>
6542
6543 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6544 input file index to Script_info ctor.
6545 (Sized_incremental_binary::do_file_has_changed): Find the
6546 command-line argument for files named in scripts.
6547 * incremental.h (Script_info::Script_info): New ctor
6548 with input file index.
6549 (Script_info::input_file_index): New function.
6550 (Script_info::input_file_index_): New data member.
6551 (Incremental_binary::get_library): Add const.
6552 (Incremental_binary::get_script_info): Add const.
6553 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6554 * testsuite/Makefile.am (incremental_test_5): New test case.
6555 (incremental_test_6): New test case.
6556 * testsuite/Makefile.in: Regenerate.
6557
6558 2011-07-06 Cary Coutant <ccoutant@google.com>
6559
6560 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6561 debug output when command lines differ.
6562
6563 2011-07-06 Cary Coutant <ccoutant@google.com>
6564
6565 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6566 --incremental-patch option.
6567 * layout.cc (Free_list::allocate): Extend allocation beyond original
6568 end if enabled.
6569 (Layout::make_output_section): Mark sections that should get
6570 patch space.
6571 * options.cc (parse_percent): New function.
6572 * options.h (parse_percent): New function.
6573 (DEFINE_percent): New macro.
6574 (General_options): Add --incremental-patch option.
6575 * output.cc (Output_section::Output_section): Initialize new data
6576 members.
6577 (Output_section::add_input_section): Print section name when out
6578 of patch space.
6579 (Output_section::add_output_section_data): Likewise.
6580 (Output_section::set_final_data_size): Add patch space when
6581 doing --incremental-full.
6582 (Output_section::do_reset_address_and_file_offset): Remove patch
6583 space.
6584 (Output_segment::set_section_list_addresses): Print debug output
6585 only if --incremental-update.
6586 * output.h (Output_section::set_is_patch_space_allowed): New function.
6587 (Output_section::is_patch_space_allowed_): New data member.
6588 (Output_section::patch_space_): New data member.
6589 * parameters.cc (Parameters::incremental_full): New function.
6590 * parameters.h (Parameters::incremental_full): New function
6591 * testsuite/Makefile.am (incremental_test_2): Add test for
6592 --incremental-patch option.
6593 * testsuite/Makefile.in: Regenerate.
6594 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6595 (t18): Remove function body.
6596
6597 2011-07-05 Doug Kwan <dougkwan@google.com>
6598
6599 PR gold/12771
6600 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6601 Arm_Address type for relocation result.
6602 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6603 overflow check.
6604 (Arm_relocate_functions::abs32): Use unaligned access.
6605 (Arm_relocate_functions::rel32): Ditto.
6606 (Arm_relocate_functions::prel31): Ditto.
6607 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6608 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6609 static data relocations.
6610 * testsuite/Makefile.in: Regnerate.
6611 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6612
6613 2011-07-05 Ian Lance Taylor <iant@google.com>
6614
6615 PR gold/12392
6616 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6617 symbols if necessary.
6618 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6619
6620 2011-07-05 Ian Lance Taylor <iant@google.com>
6621
6622 PR gold/12952
6623 * resolve.cc (Symbol::override_base_with_special): Simply override
6624 version with special symbol version, ignoring previous version.
6625
6626 2011-07-05 Ian Lance Taylor <iant@google.com>
6627
6628 * object.cc (Sized_relobj_file::include_section_group): Add
6629 information to comment about signature location.
6630
6631 2011-07-02 Ian Lance Taylor <iant@google.com>
6632
6633 PR gold/12957
6634 * options.h (class General_options): Add -f and -F.
6635 * options.cc (General_options::finalize): Fatal error if -f/-F
6636 are used without -shared.
6637 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6638
6639 2011-07-02 Ian Lance Taylor <iant@google.com>
6640
6641 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6642
6643 2011-07-01 Ian Lance Taylor <iant@google.com>
6644
6645 PR gold/12525
6646 PR gold/12952
6647 * resolve.cc (Symbol::override_base_with_special): Don't override
6648 the version if the overriding symbol has a different name.
6649 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6650 all callers. If we give an error about an undefined version,
6651 define the base version if necessary.
6652 * dynobj.h (class Versions): Update declaration.
6653 * testsuite/weak_alias_test_5.cc: New file.
6654 * testsuite/weak_alias_test.script: New file.
6655 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6656 and versioned_alias have the right value, and call t2.
6657 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6658 weak_alias_test_5.so.
6659 (weak_alias_test_LDADD): Likewise.
6660 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6661 * testsuite/Makefile.in: Rebuild.
6662
6663 2011-07-01 Ian Lance Taylor <iant@google.com>
6664
6665 PR gold/12525
6666 * options.h (class General_options): Support -z notext.
6667 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6668 -Wl,-z,notext.
6669 (two_file_shared_nonpic.so): Likewise.
6670 (two_file_shared_mixed.so): Likewise.
6671 (two_file_shared_mixed_1.so): Likewise.
6672 (weak_undef_lib_nonpic.so): Likewise.
6673 (alt/weak_undef_lib_nonpic.so): Likewise.
6674 (tls_test_shared_nonpic.so): Likewise.
6675 * testsuite/Makefile.in: Rebuild.
6676
6677 2011-07-01 Ian Lance Taylor <iant@google.com>
6678
6679 PR gold/12525
6680 * configure.ac: Test whether static linking works, setting
6681 the automake conditional HAVE_STATIC.
6682 * testsuite/Makefile.am: Disable tests using -static if
6683 HAVE_STATIC is not true.
6684 * configure, testsuite/Makefile.in: Rebuild.
6685
6686 2011-07-01 Ian Lance Taylor <iant@google.com>
6687
6688 PR gold/12525
6689 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6690 Assert if we see DW_EH_PE_indirect.
6691 * target.h (Target::ehframe_datarel_base): New function.
6692 (Target::do_ehframe_datarel_base): New target function.
6693 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6694 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6695 function.
6696
6697 2011-07-01 Ian Lance Taylor <iant@google.com>
6698
6699 PR gold/12571
6700 * options.h (class General_options): Add
6701 --ld-generated-unwind-info.
6702 * ehframe.cc (Fde::write): Add address parameter. Change all
6703 callers. If associated with PLT, fill in address and size.
6704 (Cie::set_output_offset): Only add merge mapping if there is an
6705 object.
6706 (Cie::write): Add address parameter. Change all callers.
6707 (Eh_frame::add_ehframe_for_plt): New function.
6708 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6709 input_offset_ fields into union u_, with new plt field.
6710 (Fde::Fde): Adjust for new union field.
6711 (Fde::Fde) [Output_data version]: New constructor.
6712 (Fde::add_mapping): Only add merge mapping if there is an object.
6713 (class Cie): Update declarations.
6714 (class Eh_frame): Declare add_ehframe_for_plt.
6715 * layout.cc (Layout::layout_eh_frame): Break out code into
6716 make_eh_frame_section, and call it.
6717 (Layout::make_eh_frame_section): New function.
6718 (Layout::add_eh_frame_for_plt): New function.
6719 * layout.h (class Layout): Update declarations.
6720 * merge.cc (Merge_map::add_mapping): Add assertion.
6721 * i386.cc: Include "dwarf.h".
6722 (class Output_data_plt_i386): Make first_plt_entry,
6723 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6724 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6725 and plt_eh_frame_fde.
6726 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6727 boundary. Call add_eh_frame_for_plt if appropriate.
6728 * x86_64.cc: Include "dwarf.h".
6729 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6730 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6731 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6732 and plt_eh_frame_fde.
6733 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6734 appropriate.
6735
6736 2011-06-29 Ian Lance Taylor <iant@google.com>
6737
6738 PR gold/12629
6739 * object.cc (Sized_relobj_file::layout_section): Change shdr
6740 parameter to be const.
6741 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6742 out of do_layout.
6743 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6744 appropriate. Call layout_eh_frame_section.
6745 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6746 sections.
6747 * object.h (class Sized_relobj_file): Update declarations.
6748
6749 2011-06-29 Ian Lance Taylor <iant@google.com>
6750
6751 PR gold/12652
6752 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6753 modifier.
6754 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6755
6756 2011-06-29 Ian Lance Taylor <iant@google.com>
6757
6758 PR gold/12675
6759 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6760 SHT_X86_64_UNWIND.
6761 * layout.cc (Layout::layout_eh_frame): Likewise.
6762
6763 2011-06-29 Ian Lance Taylor <iant@google.com>
6764
6765 PR gold/12695
6766 * layout.cc (Layout::symtab_section_shndx): New function.
6767 * layout.h (class Layout): Declare symtab_section_shndx.
6768 * output.cc (Output_section::write_header): Call it.
6769
6770 2011-06-29 Ian Lance Taylor <iant@google.com>
6771
6772 PR gold/12818
6773 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6774 symbols which are not used in a relocation.
6775
6776 2011-06-28 Ian Lance Taylor <iant@google.com>
6777
6778 PR gold/12898
6779 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6780 script create indistinguishable segments.
6781 (Layout::set_segment_offsets): Use stable_sort when sorting
6782 segments. Pass this to Compare_segments constructor.
6783 * layout.h (class Layout): Make segment_precedes non-static.
6784 (class Compare_segments): Change from struct to class. Add
6785 layout_ field. Add constructor.
6786 * script-sections.cc
6787 (Script_sections::attach_sections_using_phdrs_clause): Rename
6788 local orphan to is_orphan. Don't report failure to put empty
6789 section in segment. On attachment failure, report name of
6790 section, and attach to first PT_LOAD segment.
6791
6792 2011-06-28 Ian Lance Taylor <iant@google.com>
6793
6794 PR gold/12934
6795 * target-select.cc (Target_selector::Target_selector): Add
6796 emulation parameter. Change all callers.
6797 (select_target_by_bfd_name): Rename from select_target_by_name.
6798 Change all callers.
6799 (select_target_by_emulation): New function.
6800 (supported_emulation_names): New function.
6801 * target-select.h (class Target_selector): Add emulation_ field.
6802 Update declarations.
6803 (Target_selector::recognize_by_bfd_name): Rename from
6804 recognize_by_name. Change all callers.
6805 (Target_selector::supported_bfd_names): Rename from
6806 supported_names. Change all callers.
6807 (Target_selector::recognize_by_emulation): New function.
6808 (Target_selector::supported_emulations): New function.
6809 (Target_selector::emulation): New function.
6810 (Target_selector::do_recognize_by_bfd_name): Rename from
6811 do_recognize_by_name. Change all callers.
6812 (Target_selector::do_supported_bfd_names): Rename from
6813 do_supported_names. Change all callers.
6814 (Target_selector::do_recognize_by_emulation): New function.
6815 (Target_selector::do_supported_emulations): New function.
6816 (select_target_by_bfd_name): Change name in declaration.
6817 (select_target_by_emulation): Declare.
6818 (supported_emulation_names): Declare.
6819 * parameters.cc (parameters_force_valid_target): Try to find
6820 target based on emulation from -m option.
6821 * options.h (class General_options): Change doc string for -m.
6822 * options.cc (help): Print emulations.
6823 (General_options::parse_V): Likewise.
6824 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6825 Add emulation parameter. Change all callers.
6826
6827 2011-06-28 Ian Lance Taylor <iant@google.com>
6828
6829 * target.h (class Target): Add osabi_ field.
6830 (Target::osabi): New function.
6831 (Target::set_osabi): New function.
6832 (Target::Target): Initialize osabi_.
6833 (Target::do_adjust_elf_header): Make pure virtual.
6834 (Sized_target::do_adjust_elf_header): Declare.
6835 * target.cc (Sized_target::do_adjust_elf_header): New function.
6836 (class Sized_target): Instantiate all versions.
6837 * freebsd.h (class Target_freebsd): Remove.
6838 (Target_selector_freebsd::do_recognize): Call set_osabi on
6839 Target.
6840 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6841 (Target_selector_freebsd::set_osabi): Remove.
6842 * i386.cc (class Target_i386): Inherit from Sized_target rather
6843 than Target_freebsd.
6844 * x86_64.cc (class Target_x86_64): Likewise.
6845
6846 2011-06-28 Ian Lance Taylor <iant@google.com>
6847
6848 * target.h (Target::can_check_for_function_pointers): Rewrite.
6849 Make non-virtual.
6850 (Target::can_icf_inline_merge_sections): Likewise.
6851 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6852 (Target::Target_info): Add can_icf_inline_merge_sections field.
6853 (Target::do_can_check_for_function_pointers): New virtual
6854 function.
6855 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6856 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6857 from can_check_for_function_pointers, move in file.
6858 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6859 section_may_have_icf_unsafe_poineters, move in file.
6860 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6861 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6862 Rename from can_check_for_function_pointers, move in file.
6863 (Target_i386::can_icf_inline_merge_sections): Remove.
6864 (Target_i386::i386_info): Initialize
6865 can_icf_inline_merge_sections.
6866 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6867 Initialize can_icf_inline_merge_sections.
6868 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6869 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6870 Rename from can_check_for_function_pointers, move in file.
6871 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6872 (Target_x86_64::x86_64_info): Initialize
6873 can_icf_inline_merge_sections.
6874 * testsuite/testfile.cc (Target_test::test_target_info):
6875 Likewise.
6876 * icf.cc (get_section_contents): Correct formatting.
6877
6878 2011-06-27 Ian Lance Taylor <iant@google.com>
6879
6880 * symtab.cc (Symbol::versioned_name): New function.
6881 (Symbol_table::add_to_final_symtab): Use versioned_name when
6882 appropriate.
6883 (Symbol_table::sized_write_symbol): Likewise.
6884 * symtab.h (class Symbol): Declare versioned_name.
6885 * stringpool.h (class Stringpool_template): Add variant of add
6886 which takes a std::basic_string.
6887 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6888 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6889 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6890 (ver_test_12.o): New target.
6891 * testsuite/Makefile.in: Rebuild.
6892
6893 2011-06-27 Doug Kwan <dougkwan@google.com>
6894
6895 * arm.cc (Arm_relocate_functions::thm_jump8,
6896 Arm_relocate_functions::thm_jump11): Use a wider signed
6897 type to compute offset.
6898 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6899 arm_thm_jump8.
6900 * testsuite/Makefile.in: Regenerate.
6901 * testsuite/arm_branch_in_range.sh: Check test results of
6902 arm_thm_jump11 and arm_thm_jump8.
6903 * testsuite/arm_thm_jump11.s: New test source file.
6904 * testsuite/arm_thm_jump11.t: New linker script.
6905 * testsuite/arm_thm_jump8.s: New test source file.
6906 * testsuite/arm_thm_jump8.t: New linker script.
6907
6908 2011-06-24 Ian Lance Taylor <iant@google.com>
6909
6910 * layout.cc: Include "object.h".
6911 (ctors_sections_in_init_array): New static variable.
6912 (Layout::is_ctors_in_init_array): New function.
6913 (Layout::layout): Add entry to ctors_sections_in_init_array if
6914 appropriate.
6915 * layout.h (class Layout): Declare is_ctors_in_init_array.
6916 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6917 is_ctors_reverse_view is set.
6918 (Sized_relobj_file::write_sections): Add layout parameter. Change
6919 all callers. Set is_ctors_reverse_view field of View_size.
6920 (Sized_relobj_file::reverse_words): New function.
6921 * object.h (Sized_relobj_file::View_size): Add
6922 is_ctors_reverse_view field.
6923 (class Sized_relobj_file): Update declarations.
6924 * testsuite/initpri3.c: New test.
6925 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6926 initpri3b.
6927 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6928 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6929 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6930 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6931 * testsuite/Makefile.in: Rebuild.
6932
6933 2011-06-24 Cary Coutant <ccoutant@google.com>
6934
6935 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6936 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6937 (debug_msg_cdebug.err): New targets.
6938 * testsuite/Makefile.in: Regenerate.
6939 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6940 Fix checks for link with shared library.
6941
6942 2011-06-24 Doug Kwan <dougkwan@google.com>
6943
6944 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6945 skip empty text sections.
6946 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6947
6948 2011-06-22 Ian Lance Taylor <iant@google.com>
6949
6950 PR gold/12910
6951 * options.h (class General_options): Add --ctors-in-init-array.
6952 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6953 friends as SHT_PROGBITS for merging sections.
6954 (Layout::layout): Remove special handling of .init_array and
6955 friends. Don't sort if doing relocatable link. Sort for .ctors
6956 and .dtors if ctors_in_init_array.
6957 (Layout::make_output_section): Force correct section types for
6958 .init_array and friends. Don't sort if doing relocatable link,
6959 Don't sort .ctors and .dtors if ctors_in_init_array.
6960 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6961 (Layout::output_section_name): Add relobj parameter. Change all
6962 callers. Handle .ctors. and .dtors. in code rather than table.
6963 Handle .ctors and .dtors if ctors_in_init_array.
6964 (Layout::match_file_name): New function, moved from output.cc.
6965 * layout.h (class Layout): Update declarations.
6966 * output.cc: Include "layout.h".
6967 (Input_section_sort_entry::get_priority): New function.
6968 (Input_section_sort_entry::match_file_name): Just call
6969 Layout::match_file_name.
6970 (Output_section::Input_section_sort_init_fini_compare::operator()):
6971 Handle .ctors and .dtors. Sort by explicit priority rather than
6972 by name.
6973 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6974 * testsuite/initpri2.c: New test.
6975 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6976 (check_PROGRAMS): Add initpri2.
6977 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6978 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6979 * configure, testsuite/Makefile.in: Rebuild.
6980
6981 2011-06-19 Ian Lance Taylor <iant@google.com>
6982
6983 PR gold/12880
6984 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6985 .interp section to a PT_INTERP segment even if we have seen a
6986 --dynamic-linker option. Don't do it if we have seen a PHDRS
6987 clause in a linker script.
6988 (Layout::finalize): Don't create a .interp section if we've
6989 already create a PT_INTERP segment.
6990 (Layout::create_interp): Always call choose_output_section (revert
6991 patch of 2011-06-17). Don't create PT_INTERP segment.
6992 * script-sections.cc
6993 (Script_sections::create_note_and_tls_segments): Add a .interp
6994 section to a PT_INTERP segment even if we have seen a
6995 --dynamic-linker option.
6996
6997 2011-06-18 Ian Lance Taylor <iant@google.com>
6998
6999 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
7000 merely because a non-PT_LOAD segment has a dynamic reloc.
7001
7002 2011-06-18 Ian Lance Taylor <iant@google.com>
7003
7004 * layout.cc (Layout::finish_dynamic_section): Don't create
7005 DT_FLAGS entry if not needed.
7006
7007 2011-06-18 Ian Lance Taylor <iant@google.com>
7008
7009 PR gold/12745
7010 * layout.cc (Layout::layout_eh_frame): Correct handling of
7011 writable .eh_frame section.
7012
7013 2011-06-17 Ian Lance Taylor <iant@google.com>
7014
7015 PR gold/12893
7016 * resolve.cc (Symbol_table::resolve): Don't give an error if a
7017 symbol is redefined with the exact same object and value.
7018
7019 2011-06-17 Ian Lance Taylor <iant@google.com>
7020
7021 PR gold/12880
7022 * layout.h (class Layout): Add interp_segment_ field.
7023 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
7024 (Layout::attach_allocated_section_to_segment): If making shared
7025 library, put .interp section in PT_INTERP segment.
7026 (Layout::finalize): Also call create_interp if -dynamic-linker
7027 option was used.
7028 (Layout::create_interp): Assert that there is no PT_INTERP
7029 segment. If not using a SECTIONS clause, use make_output_section.
7030 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
7031 * script-sections.cc
7032 (Script_sections::create_note_and_tls_segments): If making shared
7033 library, put .interp section in PT_INTERP segment.
7034
7035 2011-06-17 Ian Lance Taylor <iant@google.com>
7036
7037 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
7038 when making a shared library.
7039
7040 2011-06-17 Ian Lance Taylor <iant@google.com>
7041
7042 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
7043 parameter. Change all callers. Don't issue warning about PC32
7044 against locally defined symbol.
7045
7046 2011-06-16 Ian Lance Taylor <iant@google.com>
7047
7048 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
7049 occurs in same object.
7050
7051 2011-06-14 Alan Modra <amodra@gmail.com>
7052
7053 * po/POTFILES.in: Regenerate.
7054
7055 2011-06-09 Ian Lance Taylor <iant@google.com>
7056
7057 * script-sections.cc
7058 (Orphan_output_section::set_section_addresses): For a relocatable
7059 link set address to 0.
7060
7061 2011-06-09 Cary Coutant <ccoutant@google.com>
7062
7063 PR gold/12804
7064 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
7065 used with --compress-debug-sections.
7066 * gold/object.cc (Sized_relobj_file::do_layout): Report
7067 uncompressed size of compressed input sections.
7068
7069 2011-06-08 Cary Coutant <ccoutant@google.com>
7070
7071 PR gold/12804
7072 * testsuite/two_file_test_2_v1.cc: Change initialization of
7073 v2 to keep it in .data.
7074
7075 2011-06-07 Cary Coutant <ccoutant@google.com>
7076
7077 * common.cc (Symbol_table::do_allocate_commons_list): Call
7078 gold_fallback.
7079 * errors.cc (Errors::fatal): Adjust call to gold_exit.
7080 (Errors::fallback): New function.
7081 (gold_fallback): New function.
7082 * errors.h (Errors::fallback): New function.
7083 * gold.cc (gold_exit): Change status parameter to enum; adjust
7084 all callers.
7085 (queue_initial_tasks): Call gold_fallback.
7086 * gold.h: Include cstdlib.
7087 (Exit_status): New enum type.
7088 (gold_exit): Change status parameter to enum.
7089 (gold_fallback): New function.
7090 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
7091 (Layout::create_symtab_sections): Likewise.
7092 (Layout::create_shdrs): Likewise.
7093 * main.cc (main): Adjust call to gold_exit.
7094 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
7095 (Output_data_got::add_got_entry_pair): Likewise.
7096 (Output_section::add_input_section): Likewise.
7097 (Output_section::add_output_section_data): Likewise.
7098 (Output_segment::set_section_list_addresses): Likewise.
7099 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
7100
7101 2011-06-07 Cary Coutant <ccoutant@google.com>
7102
7103 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7104 for incremental links.
7105 * output.cc (Output_segment::set_section_list_addresses): Remove
7106 FIXME and test for TLS or BSS.
7107
7108 2011-06-07 Cary Coutant <ccoutant@google.com>
7109
7110 * testsuite/Makefile.am: Add incremental_copy_test,
7111 incremental_common_test_1.
7112 * testsuite/Makefile.in: Regenerate.
7113 * testsuite/common_test_1_v1.c: New source file.
7114 * testsuite/common_test_1_v2.c: New source file.
7115 * testsuite/copy_test_v1.cc: New source file.
7116
7117 2011-06-07 Cary Coutant <ccoutant@google.com>
7118
7119 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7120 update, allocate common from bss section's free list.
7121 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7122 linker-defined symbols.
7123 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7124 Skip GOT and PLT entries that are no longer referenced.
7125 (Output_section_incremental_inputs::write_info_blocks): Mark
7126 linker-defined symbols.
7127 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7128 * output.cc (Output_section::allocate): New function.
7129 * output.h (Output_section::allocate): New function.
7130 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7131 linker-defined symbols.
7132 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7133 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7134 (Symbol::init_base_output_data): Likewise.
7135 (Symbol::init_base_output_segment): Likewise.
7136 (Symbol::init_base_constant): Likewise.
7137 (Sized_symbol::init_output_data): Likewise.
7138 (Sized_symbol::init_output_segment): Likewise.
7139 (Sized_symbol::init_constant): Likewise.
7140 (Symbol_table::do_define_in_output_data): Likewise.
7141 (Symbol_table::do_define_in_output_segment): Likewise.
7142 (Symbol_table::do_define_as_constant): Likewise.
7143 * symtab.h (Symbol::is_predefined): New function.
7144 (Symbol::init_base_output_data): Add is_predefined parameter.
7145 (Symbol::init_base_output_segment): Likewise.
7146 (Symbol::init_base_constant): Likewise.
7147 (Symbol::is_predefined_): New data member.
7148 (Sized_symbol::init_output_data): Add is_predefined parameter.
7149 (Sized_symbol::init_output_segment): Likewise.
7150 (Sized_symbol::init_constant): Likewise.
7151 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7152
7153 2011-06-07 Cary Coutant <ccoutant@google.com>
7154
7155 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7156 instead of emit_copy_reloc.
7157 (Copy_relocs::emit_copy_reloc): Refactor.
7158 (Copy_relocs::make_copy_reloc): New function.
7159 (Copy_relocs::add_copy_reloc): Remove.
7160 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7161 section.
7162 (Copy_relocs::make_copy_reloc): New function.
7163 (Copy_relocs::add_copy_reloc): Remove.
7164 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7165 unchanged input files.
7166 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7167 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7168 Reserve BSS space for COPY relocations.
7169 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7170 (Output_section_incremental_inputs::write_info_blocks): Record
7171 whether a symbol is copied from a shared object.
7172 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7173 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7174 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7175 (Incremental_input_entry_reader::get_output_symbol_index): Add
7176 is_copy parameter.
7177 (Incremental_binary::emit_copy_relocs): New function.
7178 (Incremental_binary::do_emit_copy_relocs): New function.
7179 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7180 new data member.
7181 (Sized_incremental_binary::add_copy_reloc): New function.
7182 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7183 (Sized_incremental_binary::Copy_reloc): New struct.
7184 (Sized_incremental_binary::Copy_relocs): New typedef.
7185 (Sized_incremental_binary::copy_relocs_): New data member.
7186 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7187 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7188 * target.h (Sized_target::emit_copy_reloc): New function.
7189 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7190
7191 2011-06-02 Cary Coutant <ccoutant@google.com>
7192
7193 PR gold/12163
7194 * gold/archive.cc (Archive::Archive): Initialize new data member.
7195 (Archive::include_all_members): Return if archive has already been
7196 included.
7197 * gold/archive.h (Archive::include_all_members_): New data member.
7198
7199 2011-06-02 Nick Clifton <nickc@redhat.com>
7200
7201 * dynobj.h: Fix spelling mistake in comment.
7202 * output.cc: Likewise.
7203
7204 2011-05-31 Doug Kwan <dougkwan@google.com>
7205 Asier Llano
7206
7207 PR gold/12826
7208 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
7209 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7210 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7211 redundant arm_exidx_test.so.
7212 * testsuite/Makefile.in: Regenerate.
7213 (check_SCRIPTS): Add pr12826.sh
7214 (check_DATA): Add pr12826.stdout
7215 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7216 * testsuite/pr12826.sh: New file.
7217 * testsuite/pr12826_1.s: Ditto.
7218 * testsuite/pr12826_1.s: Ditto.
7219
7220 2011-05-30 Ian Lance Taylor <iant@google.com>
7221
7222 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7223 sections.
7224
7225 2011-05-29 Ian Lance Taylor <iant@google.com>
7226
7227 PR gold/12804
7228 * testsuite/Makefile.am: Use different file name for two_file_test
7229 temporary file for each incremental test.
7230 * testsuite/Makefile.in: Rebuild.
7231
7232 2011-05-29 Ian Lance Taylor <iant@google.com>
7233
7234 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7235 binary input file is empty.
7236
7237 2011-05-27 Ian Lance Taylor <iant@google.com>
7238
7239 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7240 (ver_test_9.so): Likewise.
7241 * testsuite/Makefile.in: Rebuild.
7242
7243 2011-05-26 Cary Coutant <ccoutant@google.com>
7244
7245 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7246 * incremental.cc (Incremental_inputs::report_input_section): Fix
7247 comment, indentation.
7248 (Incremental_inputs::report_comdat_group): New function.
7249 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7250 of data for incremental input file entry.
7251 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7252 group count, COMDAT group signatures.
7253 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7254 an unchanged input file.
7255 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7256 Initialize new data member.
7257 (Incremental_object_entry::add_comdat_group): New function.
7258 (Incremental_object_entry::get_comdat_group_count): New function.
7259 (Incremental_object_entry::get_comdat_signature_key): New function.
7260 (Incremental_object_entry::groups_): New data member.
7261 (Incremental_inputs::report_comdat_group): New function.
7262 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7263 data for incremental input file entry.
7264 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7265 (Incremental_input_entry_reader::get_input_section): Adjust size of
7266 data for incremental input file entry.
7267 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7268 (Incremental_input_entry_reader::get_comdat_group_signature): New
7269 function.
7270 * object.cc (Sized_relobj::include_section_group): Report kept
7271 COMDAT groups for incremental links.
7272
7273 2011-05-24 David Meyer <pdox@google.com>
7274
7275 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7276 with name parameter. Add found_name parameter.
7277 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7278 * dirsearch.h (class Dirsearch): Update declaration.
7279
7280 2011-05-24 Ian Lance Taylor <iant@google.com>
7281
7282 * archive.cc (Library_base::should_include_member): Pull in object
7283 from archive if it defines the entry symbol.
7284 * parameters.cc (Parameters::entry): New function.
7285 * parameters.h (class Parameters): Declare entry.
7286 * output.h (class Output_file_header): Remove entry_ field.
7287 * output.cc (Output_file_header::Output_file_header): Remove entry
7288 parameter. Change all callers.
7289 (Output_file_header::entry): Use parameters->entry.
7290 * gold.cc (queue_middle_tasks): Likewise.
7291 * plugin.cc (Plugin_hook::run): Likewise.
7292
7293 2011-05-24 Cary Coutant <ccoutant@google.com>
7294
7295 * gold.cc (queue_initial_tasks): Pass incremental base filename
7296 to Output_file::open_base_file; don't print error message.
7297 * incremental-dump.cc (main): Adjust call to
7298 Output_file::open_for_modification.
7299 * incremental-dump.cc (main): Likewise.
7300 * incremental.cc (Incremental_inputs::report_command_line):
7301 Ignore --incremental-base option when comparing command lines.
7302 Ignore parameter when given as separate argument.
7303 * options.h (class General_options): Add --incremental-base.
7304 * output.cc (Output_file::Output_file):
7305 (Output_file::open_base_file): Add base_name and writable parameters;
7306 read base file into new file; print error message here.
7307 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7308 callers.
7309 * output.h (Output_file::open_for_modification): Rename to...
7310 (Output_file::open_base_file): ...this; add base_name and
7311 writable parameters; adjust all callers.
7312 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7313 callers.
7314 * testsuite/Makefile.am (incremental_test_4): Test
7315 --incremental-base.
7316 * testsuite/Makefile.in: Regenerate.
7317
7318 2011-05-24 Cary Coutant <ccoutant@google.com>
7319
7320 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7321 incremental_test_4.
7322 * testsuite/Makefile.in: Regenerate.
7323 * testsuite/two_file_test_1_v1.cc: New test source file.
7324 * testsuite/two_file_test_1b_v1.cc: New test source file.
7325 * testsuite/two_file_test_2_v1.cc: New test source file.
7326
7327 2011-05-24 Cary Coutant <ccoutant@google.com>
7328
7329 * dynobj.h (Dynobj::do_dynobj): New function.
7330 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7331 flag and soname for shared objects.
7332 * incremental.cc (Incremental_inputs::report_object): Make
7333 either Incremental_object_entry or Incremental_dynobj_entry; add
7334 soname to string table.
7335 (Incremental_inputs::report_input_section): Add assertion.
7336 (Output_section_incremental_inputs::set_final_data_size): Adjust
7337 type of input file entry for shared libraries; adjust size of
7338 shared library info entry.
7339 (Output_section_incremental_inputs::write_input_files): Write
7340 as_needed flag for shared libraries.
7341 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7342 of input file entry for shared libraries; write soname.
7343 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7344 soname from incremental info.
7345 * incremental.h (enum Incremental_input_flags): Add
7346 INCREMENTAL_INPUT_AS_NEEDED.
7347 (Incremental_input_entry::Incremental_input_entry): Initialize new
7348 data member.
7349 (Incremental_input_entry::set_as_needed): New function.
7350 (Incremental_input_entry::as_needed): New function.
7351 (Incremental_input_entry::do_dynobj_entry): New function.
7352 (Incremental_input_entry::as_needed_): New data member.
7353 (Incremental_object_entry::Incremental_object_entry): Don't check
7354 for shared library.
7355 (Incremental_object_entry::do_type): Likewise.
7356 (class Incremental_dynobj_entry): New class.
7357 (Incremental_input_entry_reader::as_needed): New function.
7358 (Incremental_input_entry_reader::get_soname): New function.
7359 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7360 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7361 size of shared library info entry.
7362 * layout.cc (Layout::finish_dynamic_section): Don't test for
7363 incremental link when adding DT_NEEDED entries.
7364 * object.h (Object::Object): Initialize new data member.
7365 (Object::dynobj): New function.
7366 (Object::set_as_needed): New function.
7367 (Object::as_needed): New function.
7368 (Object::do_dynobj): New function.
7369 (Object::as_needed_): New data member.
7370
7371 2011-05-24 Cary Coutant <ccoutant@google.com>
7372
7373 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7374 info; adjust display of GOT entries.
7375 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7376 vector of input objects; remove file_status_.
7377 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7378 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7379 got_plt reader; call target hooks to reserve GOT entries.
7380 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7381 of input file info header and GOT info entry.
7382 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7383 relocation info.
7384 (Got_plt_view_info::got_descriptor): Remove.
7385 (Got_plt_view_info::sym_index): New data member.
7386 (Got_plt_view_info::input_index): New data member.
7387 (Local_got_offset_visitor::visit): Write input file index.
7388 (Global_got_offset_visitor::visit): Write 0 for input file index.
7389 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7390 with sym_index and input_index.
7391 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7392 incremental info GOT entry; replace got_descriptor with input_index.
7393 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7394 map from input file index to object.
7395 (Sized_relobj_incr::do_layout): Replace direct data member reference
7396 with accessor function.
7397 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7398 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7399 Adjust size of input file info header.
7400 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7401 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7402 (Incremental_input_entry_reader::get_input_section): Adjust size of
7403 input file info header.
7404 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7405 of incremental info GOT entry.
7406 (Incremental_got_plt_reader::get_got_desc): Remove.
7407 (Incremental_got_plt_reader::get_got_symndx): New function.
7408 (Incremental_got_plt_reader::get_got_input_index): New function.
7409 (Sized_incremental_binary::Sized_incremental_binary): Remove
7410 file_status_; add input_objects_.
7411 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7412 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7413 (Sized_incremental_binary::file_is_unchanged): Remove.
7414 (Sized_incremental_binary::set_input_object): New function.
7415 (Sized_incremental_binary::input_object): New function.
7416 (Sized_incremental_binary::file_status_): Remove.
7417 (Sized_incremental_binary::input_objects_): New data member.
7418 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7419 references.
7420 (Sized_relobj_incr::invalid_address): Move to base class.
7421 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7422 class.
7423 (Sized_relobj_incr::do_output_section_offset): Likewise.
7424 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7425 (Sized_relobj_incr::section_offsets_): Likewise.
7426 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7427 function.
7428 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7429 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7430 with accessor function.
7431 (Sized_relobj_file::do_layout): Likewise.
7432 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7433 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7434 (Sized_relobj_file::compute_final_local_value): Replace refs to
7435 section_offsets_ with accessor function.
7436 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7437 * object.h (Relobj::Relobj): Initialize new data members.
7438 (Relobj::add_dyn_reloc): New function.
7439 (Relobj::first_dyn_reloc): New function.
7440 (Relobj::dyn_reloc_count): New function.
7441 (Relobj::first_dyn_reloc_): New data member.
7442 (Relobj::dyn_reloc_count_): New data member.
7443 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7444 references.
7445 (Sized_relobj::Address): New typedef.
7446 (Sized_relobj::invalid_address): Move here from child class.
7447 (Sized_relobj::Sized_relobj): Initialize new data members.
7448 (Sized_relobj::sized_relobj): New function.
7449 (Sized_relobj::is_output_section_offset_invalid): Move here from
7450 child class.
7451 (Sized_relobj::get_output_section_offset): Likewise.
7452 (Sized_relobj::local_has_got_offset): Likewise.
7453 (Sized_relobj::local_got_offset): Likewise.
7454 (Sized_relobj::set_local_got_offset): Likewise.
7455 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7456 (Sized_relobj::clear_got_offsets): New function.
7457 (Sized_relobj::section_offsets): Move here from child class.
7458 (Sized_relobj::do_output_section_offset): Likewise.
7459 (Sized_relobj::do_set_section_offset): Likewise.
7460 (Sized_relobj::Local_got_offsets): Likewise.
7461 (Sized_relobj::local_got_offsets_): Likewise.
7462 (Sized_relobj::section_offsets_): Likewise.
7463 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7464 references.
7465 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7466 class.
7467 (Sized_relobj_file::sized_relobj): New function
7468 (Sized_relobj_file::local_has_got_offset): Move to base class.
7469 (Sized_relobj_file::local_got_offset): Likewise.
7470 (Sized_relobj_file::set_local_got_offset): Likewise.
7471 (Sized_relobj_file::get_output_section_offset): Likewise.
7472 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7473 (Sized_relobj_file::do_output_section_offset): Likewise.
7474 (Sized_relobj_file::do_set_section_offset): Likewise.
7475 (Sized_relobj_file::Local_got_offsets): Likewise.
7476 (Sized_relobj_file::local_got_offsets_): Likewise.
7477 (Sized_relobj_file::section_offsets_): Likewise.
7478 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7479 (all constructors).
7480 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7481 (Output_reloc::get_symbol_index): Likewise.
7482 (Output_reloc::local_section_offset): Likewise.
7483 (Output_reloc::get_address): Likewise.
7484 (Output_reloc::symbol_value): Likewise.
7485 (Output_data_got::reserve_slot): Move to class definition.
7486 (Output_data_got::reserve_local): New function.
7487 (Output_data_got::reserve_slot_for_global): Remove.
7488 (Output_data_got::reserve_global): New function.
7489 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7490 (all constructors, two instantiations).
7491 (Output_reloc::get_relobj): New function (two instantiations).
7492 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7493 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7494 (Output_data_reloc::add_global): Adjust type of relobj.
7495 (Output_data_reloc::add_global_relative): Likewise.
7496 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7497 (Output_data_reloc::add_local): Likewise.
7498 (Output_data_reloc::add_local_relative): Likewise.
7499 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7500 (Output_data_reloc::add_local_section): Likewise.
7501 (Output_data_reloc::add_output_section): Likewise.
7502 (Output_data_reloc::add_absolute): Likewise.
7503 (Output_data_reloc::add_target_specific): Likewise.
7504 (Output_data_got::reserve_slot): Move definition here.
7505 (Output_data_got::reserve_local): New function.
7506 (Output_data_got::reserve_global): New function.
7507 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7508 section_offsets_ with accessor function.
7509 (Sized_relobj_file::write_sections): Likewise.
7510 (Sized_relobj_file::do_relocate_sections): Likewise.
7511 * target.h (Sized_target::reserve_local_got_entry): New function.
7512 (Sized_target::reserve_global_got_entry): New function.
7513 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7514 (Target_x86_64::reserve_global_got_entry): New function.
7515 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7516
7517 2011-05-23 Cary Coutant <ccoutant@google.com>
7518
7519 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7520 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7521 bit when checking got_type.
7522 * incremental.cc (Sized_incremental_binary::setup_readers):
7523 Store symbol table and string table locations; initialize bit vector
7524 of file status flags.
7525 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7526 unchanged files.
7527 (Sized_incremental_binary::do_process_got_plt): New function.
7528 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7529 (Output_section_incremental_inputs::set_final_data_size): Record
7530 file index for each input file.
7531 (Output_section_incremental_inputs::write_got_plt): Store file index
7532 instead of input entry offset for each GOT entry.
7533 * incremental.h
7534 (Incremental_input_entry::Incremental_input_entry): Initialize new
7535 data member.
7536 (Incremental_input_entry::set_offset): Store file index.
7537 (Incremental_input_entry::get_file_index): New function.
7538 (Incremental_input_entry::file_index_): New data member.
7539 (Incremental_binary::process_got_plt): New function.
7540 (Incremental_binary::do_process_got_plt): New function.
7541 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7542 data members.
7543 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7544 (Sized_incremental_binary::set_file_is_unchanged): New function.
7545 (Sized_incremental_binary::file_is_unchanged): New function.
7546 (Sized_incremental_binary::do_process_got_plt): New function.
7547 (Sized_incremental_binary::file_status_): New data member.
7548 (Sized_incremental_binary::main_symtab_loc_): New data member.
7549 (Sized_incremental_binary::main_strtab_loc_): New data member.
7550 * output.cc (Output_data_got::Got_entry::write): Add case
7551 RESERVED_CODE.
7552 (Output_data_got::add_global): Call add_got_entry.
7553 (Output_data_got::add_global_plt): Likewise.
7554 (Output_data_got::add_global_with_rel): Likewise.
7555 (Output_data_got::add_global_with_rela): Likewise.
7556 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7557 (Output_data_got::add_global_pair_with_rela): Likewise.
7558 (Output_data_got::add_local): Call add_got_entry.
7559 (Output_data_got::add_local_plt): Likewise.
7560 (Output_data_got::add_local_with_rel): Likewise.
7561 (Output_data_got::add_local_with_rela): Likewise.
7562 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7563 (Output_data_got::add_local_pair_with_rela): Likewise.
7564 (Output_data_got::reserve_slot): New function.
7565 (Output_data_got::reserve_slot_for_global): New function.
7566 (Output_data_got::add_got_entry): New function.
7567 (Output_data_got::add_got_entry_pair): New function.
7568 (Output_section::add_output_section_data): Edit FIXME.
7569 * output.h
7570 (Output_section_data_build::Output_section_data_build): New
7571 constructor with size parameter.
7572 (Output_data_space::Output_data_space): Likewise.
7573 (Output_data_got::Output_data_got): Initialize new data member; new
7574 constructor with size parameter.
7575 (Output_data_got::add_constant): Call add_got_entry.
7576 (Output_data_got::reserve_slot): New function.
7577 (Output_data_got::reserve_slot_for_global): New function.
7578 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7579 (Output_data_got::add_got_entry): New function.
7580 (Output_data_got::add_got_entry_pair): New function.
7581 (Output_data_got::free_list_): New data member.
7582 * target.h (Sized_target::init_got_plt_for_update): New function.
7583 (Sized_target::register_global_plt_entry): New function.
7584 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7585 Initialize new data member; call init; add constructor with PLT count.
7586 (Output_data_plt_x86_64::init): New function.
7587 (Output_data_plt_x86_64::add_relocation): New function.
7588 (Output_data_plt_x86_64::reserve_slot): New function.
7589 (Output_data_plt_x86_64::free_list_): New data member.
7590 (Target_x86_64::init_got_plt_for_update): New function.
7591 (Target_x86_64::register_global_plt_entry): New function.
7592 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7593 incremental updates.
7594 (Output_data_plt_x86_64::add_relocation): New function.
7595 * testsuite/object_unittest.cc (Object_test): Set default options.
7596
7597 2011-05-16 Ian Lance Taylor <iant@google.com>
7598
7599 * options.h (class General_options): Make -i a synonym for -r.
7600
7601 2011-05-16 Ian Lance Taylor <iant@google.com>
7602
7603 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7604
7605 2011-05-10 Cary Coutant <ccoutant@google.com>
7606
7607 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7608 strip_all (-s).
7609
7610 2011-05-06 Ian Lance Taylor <iant@google.com>
7611
7612 * layout.cc (Layout::layout): If the output section flags change,
7613 update the ordering.
7614
7615 2011-04-25 Cary Coutant <ccoutant@google.com>
7616
7617 * incremental-dump.cc (dump_incremental_inputs): Print local
7618 symbol info for each input file.
7619 * incremental.cc
7620 (Output_section_incremental_inputs::set_final_data_size): Add local
7621 symbol info to input file entries in incremental info.
7622 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7623 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7624 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7625 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7626 implementation.
7627 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7628 (Sized_incr_relobj::do_relocate): Write the local symbols.
7629 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7630 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7631 Adjust size of input file header.
7632 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7633 (Incremental_inputs_reader::get_local_symbol_count): New function.
7634 (Incremental_inputs_reader::get_input_section): Adjust size of input
7635 file header.
7636 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7637 (Sized_incr_relobj::This): New typedef.
7638 (Sized_incr_relobj::sym_size): New const data member.
7639 (Sized_incr_relobj::Local_symbol): New struct.
7640 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7641 (Sized_incr_relobj::do_local_symbol_offset): New function.
7642 (Sized_incr_relobj::local_symbol_count_): New data member.
7643 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7644 (Sized_incr_relobj::local_symbol_index_): New data member.
7645 (Sized_incr_relobj::local_symbol_offset_): New data member.
7646 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7647 (Sized_incr_relobj::local_symbols_): New data member.
7648 * object.h (Relobj::output_local_symbol_count): New function.
7649 (Relobj::local_symbol_offset): New function.
7650 (Relobj::do_output_local_symbol_count): New function.
7651 (Relobj::do_local_symbol_offset): New function.
7652 (Sized_relobj::do_output_local_symbol_count): New function.
7653 (Sized_relobj::do_local_symbol_offset): New function.
7654
7655 2011-04-22 Vladimir Simonov <sv@sw.ru>
7656
7657 * descriptors.cc (set_close_on_exec): New function.
7658 (Descriptors::open): Use set_close_on_exec.
7659 * output.cc (S_ISLNK): Define if not defined.
7660
7661 2011-04-22 Cary Coutant <ccoutant@google.com>
7662
7663 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7664 global symbol map.
7665 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7666 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7667 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7668 relocations.
7669 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7670 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7671 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7672 * incremental.h
7673 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7674 function.
7675 (Incremental_binary::apply_incremental_relocs): New function.
7676 (Incremental_binary::do_apply_incremental_relocs): New function.
7677 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7678 data member.
7679 (Sized_incremental_binary::add_global_symbol): New function.
7680 (Sized_incremental_binary::global_symbol): New function.
7681 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7682 (Sized_incremental_binary::symbol_map_): New data member.
7683 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7684 * target.h (Sized_target::apply_relocation): New function.
7685 * target-reloc.h (apply_relocation): New function.
7686 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7687
7688 2011-04-22 Doug Kwan <dougkwan@google.com>
7689
7690 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7691 flag of a SHT_ARM_EXIDX section.
7692 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7693 * testsuite/Makefile.in: Regenerate.
7694 * testsuite/arm_exidx_test.s: New file.
7695 * testsuite/arm_exidx_test.sh: Same.
7696
7697 2011-04-20 Cary Coutant <ccoutant@google.com>
7698
7699 PR gold/12689
7700 * archive.h (Incremental_archive_entry::Archive_member):
7701 Initialize arg_serial_ (second constructor).
7702
7703 2011-04-17 Ian Lance Taylor <iant@google.com>
7704
7705 * object.cc (Relocate_info::location): Simplify location string.
7706 * errors.cc (Errors::error_at_location): Don't print program
7707 name.
7708 (Errors::warning_at_location): Likewise.
7709 (Errors::undefined_symbol): Likewise.
7710 * testsuite/debug_msg.sh: Update accordingly.
7711
7712 2011-04-14 Cary Coutant <ccoutant@google.com>
7713
7714 * gold/layout.cc (Layout::symtab_section_offset): New function.
7715 * gold/layout.h (Layout::symtab_section_offset): New function.
7716 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7717
7718 2011-04-12 Ian Lance Taylor <iant@google.com>
7719
7720 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7721 with MREMAP_MAYMOVE.
7722 * output.h (class Output_file): Add map_is_allocated_ field.
7723 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7724 not available, provide stubs. If mremap is not available, #define
7725 it to gold_mremap.
7726 (MREMAP_MAYMOVE): Define if not defined.
7727 (Output_file::Output_file): Initialize map_is_allocated_.
7728 (Output_file::resize): Check map_is_allocated_.
7729 (Output_file::map_anonymous): If mmap fails, use malloc.
7730 (Output_file::unmap): Don't do anything for an anonymous map.
7731 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7732 is not available, provide stubs.
7733 (File_read::View::~View): Use free rather than delete[].
7734 (File_read::make_view): Use malloc rather than new[]. If mmap
7735 fails, use malloc.
7736 (File_read::find_or_make_view): Use malloc rather than new[].
7737 * gold.h: Remove HAVE_REMAP code.
7738 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7739 exists. Rename mremap to gold_mremap. If mmap is not available
7740 don't do anything.
7741 * configure, config.in: Rebuild.
7742
7743 2011-04-11 Ian Lance Taylor <iant@google.com>
7744
7745 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7746 initialize local variable v.
7747
7748 2011-04-11 Cary Coutant <ccoutant@google.com>
7749
7750 * archive.cc (Archive::include_member): Adjust call to
7751 report_object.
7752 (Add_archive_symbols::run): Track argument serial numbers.
7753 (Lib_group::include_member): Likewise.
7754 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7755 * archive.h (Incremental_archive_entry::Archive_member):
7756 Initialize arg_serial_.
7757 (Archive_member::arg_serial_): New data member.
7758 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7759 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7760 incremental link.
7761 (Sized_dynobj::do_for_all_local_got_entries): New function.
7762 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7763 function.
7764 * fileread.cc (get_mtime): New function.
7765 * fileread.h (get_mtime): New function.
7766 * gold.cc (queue_initial_tasks): Check for incremental update.
7767 (process_incremental_input): New function.
7768 (queue_middle_tasks): Don't force valid target for incremental
7769 update.
7770 * incremental-dump.cc (find_input_containing_global): Adjust
7771 size of symbol info entry.
7772 (dump_incremental_inputs): Dump argument serial number and
7773 in_system_directory flag; bias shndx by 1; print symbol names
7774 when dumping per-file symbol lists; use new symbol info readers.
7775 * incremental.cc
7776 (Output_section_incremental_inputs:update_data_size): New function.
7777 (Sized_incremental_binary::setup_readers): Setup input readers
7778 for each input file; build maps for files added from libraries
7779 and scripts.
7780 (Sized_incremental_binary::check_input_args): New function.
7781 (Sized_incremental_binary::do_check_inputs): Build map of argument
7782 serial numbers to input arguments.
7783 (Sized_incremental_binary::do_file_has_changed): Rename
7784 do_file_is_unchanged to this; compare file modification times.
7785 (Sized_incremental_binary::do_init_layout): New function.
7786 (Sized_incremental_binary::do_reserve_layout): New function.
7787 (Sized_incremental_binary::do_get_input_reader): Remove.
7788 (Sized_incremental_binary::get_symtab_view): New function.
7789 (Incremental_checker::can_incrementally_link_output_file): Remove.
7790 (Incremental_inputs::report_command_line): Exclude --debug options.
7791 (Incremental_inputs::report_archive_begin): Add parameter; track
7792 argument serial numbers; don't put input file entry for archive
7793 before archive members.
7794 (Incremental_inputs::report_archive_end): Put input file entry
7795 for archive after archive members.
7796 (Incremental_inputs::report_object): Add parameter; track argument
7797 serial numbers and in_system_directory flag.
7798 (Incremental_inputs::report_script): Add parameter; track argument
7799 serial numbers.
7800 (Output_section_incremental_inputs::set_final_data_size): Adjust
7801 size of symbol info entry; check for forwarding symbols.
7802 (Output_section_incremental_inputs::write_input_files): Write
7803 in_system_directory flag and argument serial number.
7804 (Output_section_incremental_inputs::write_info_blocks): Map section
7805 indices between incremental info and original input file; store
7806 input section index for each symbol.
7807 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7808 change operator() to visit().
7809 (class Global_got_offset_visitor): Likewise.
7810 (class Global_symbol_visitor_got_plt):
7811 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7812 classes.
7813 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7814 (Sized_incr_relobj::do_read_symbols): New function.
7815 (Sized_incr_relobj::do_layout): New function.
7816 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7817 (Sized_incr_relobj::do_add_symbols): New function.
7818 (Sized_incr_relobj::do_should_include_member): New function.
7819 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7820 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7821 (Sized_incr_relobj::do_section_size): New function.
7822 (Sized_incr_relobj::do_section_name): New function.
7823 (Sized_incr_relobj::do_section_contents): New function.
7824 (Sized_incr_relobj::do_section_flags): New function.
7825 (Sized_incr_relobj::do_section_entsize): New function.
7826 (Sized_incr_relobj::do_section_address): New function.
7827 (Sized_incr_relobj::do_section_type): New function.
7828 (Sized_incr_relobj::do_section_link): New function.
7829 (Sized_incr_relobj::do_section_info): New function.
7830 (Sized_incr_relobj::do_section_addralign): New function.
7831 (Sized_incr_relobj::do_initialize_xindex): New function.
7832 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7833 (Sized_incr_relobj::do_read_relocs): New function.
7834 (Sized_incr_relobj::do_gc_process_relocs): New function.
7835 (Sized_incr_relobj::do_scan_relocs): New function.
7836 (Sized_incr_relobj::do_count_local_symbols): New function.
7837 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7838 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7839 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7840 (Sized_incr_relobj::do_relocate): New function.
7841 (Sized_incr_relobj::do_set_section_offset): New function.
7842 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7843 (Sized_incr_dynobj::do_read_symbols): New function.
7844 (Sized_incr_dynobj::do_layout): New function.
7845 (Sized_incr_dynobj::do_add_symbols): New function.
7846 (Sized_incr_dynobj::do_should_include_member): New function.
7847 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7848 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7849 (Sized_incr_dynobj::do_section_size): New function.
7850 (Sized_incr_dynobj::do_section_name): New function.
7851 (Sized_incr_dynobj::do_section_contents): New function.
7852 (Sized_incr_dynobj::do_section_flags): New function.
7853 (Sized_incr_dynobj::do_section_entsize): New function.
7854 (Sized_incr_dynobj::do_section_address): New function.
7855 (Sized_incr_dynobj::do_section_type): New function.
7856 (Sized_incr_dynobj::do_section_link): New function.
7857 (Sized_incr_dynobj::do_section_info): New function.
7858 (Sized_incr_dynobj::do_section_addralign): New function.
7859 (Sized_incr_dynobj::do_initialize_xindex): New function.
7860 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7861 (make_sized_incremental_object): New function.
7862 (Incremental_library::copy_unused_symbols): New function.
7863 (Incremental_library::do_for_all_unused_symbols): New function.
7864 * incremental.h (enum Incremental_input_flags): New type.
7865 (class Incremental_checker): Remove.
7866 (Incremental_input_entry::Incremental_input_entry): Add argument
7867 serial number.
7868 (Incremental_input_entry::arg_serial): New function.
7869 (Incremental_input_entry::set_is_in_system_directory): New function.
7870 (Incremental_input_entry::is_in_system_directory): New function.
7871 (Incremental_input_entry::arg_serial_): New data member.
7872 (Incremental_input_entry::is_in_system_directory_): New data member.
7873 (class Script_info): Move here from script.h.
7874 (Script_info::Script_info): Add filename parameter.
7875 (Script_info::filename): New function.
7876 (Script_info::filename_): New data member.
7877 (Incremental_script_entry::Incremental_script_entry): Add argument
7878 serial number.
7879 (Incremental_object_entry::Incremental_object_entry): Likewise.
7880 (Incremental_object_entry::add_input_section): Build list of input
7881 sections with map to original shndx.
7882 (Incremental_object_entry::get_input_section_index): New function.
7883 (Incremental_object_entry::shndx_): New data member.
7884 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7885 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7886 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7887 serial number.
7888 (Incremental_inputs::report_archive_begin): Likewise.
7889 (Incremental_inputs::report_object): Likewise.
7890 (Incremental_inputs::report_script): Likewise.
7891 (class Incremental_global_symbol_reader): New class.
7892 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7893 and store flags and input file type.
7894 (Incremental_input_entry_reader::arg_serial): New function.
7895 (Incremental_input_entry_reader::type): Extract type from flags.
7896 (Incremental_input_entry_reader::is_in_system_directory): New function.
7897 (Incremental_input_entry_reader::get_input_section_count): Call
7898 accessor function for type.
7899 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7900 function for type; adjust size of global symbol entry.
7901 (Incremental_input_entry_reader::get_global_symbol_count): Call
7902 accessor function for type.
7903 (Incremental_input_entry_reader::get_object_count): Likewise.
7904 (Incremental_input_entry_reader::get_object_offset): Likewise.
7905 (Incremental_input_entry_reader::get_member_count): Likewise.
7906 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7907 (Incremental_input_entry_reader::get_member_offset): Likewise.
7908 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7909 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7910 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7911 (Incremental_input_entry_reader::get_global_symbol_reader): New
7912 function.
7913 (Incremental_input_entry_reader::get_output_symbol_index): New
7914 function.
7915 (Incremental_input_entry_reader::type_): Remove.
7916 (Incremental_input_entry_reader::flags_): New data member.
7917 (Incremental_inputs_reader::input_file_offset): New function.
7918 (Incremental_inputs_reader::input_file_index): New function.
7919 (Incremental_inputs_reader::input_file): Call input_file_offset.
7920 (Incremental_inputs_reader::input_file_at_offset): New function.
7921 (Incremental_relocs_reader::get_r_type): Reformat.
7922 (Incremental_relocs_reader::get_r_shndx): Reformat.
7923 (Incremental_relocs_reader::get_r_offset): Reformat.
7924 (Incremental_relocs_reader::data): New function.
7925 (Incremental_binary::Incremental_binary): Initialize new data members.
7926 (Incremental_binary::check_inputs): Add cmdline parameter.
7927 (Incremental_binary::file_is_unchanged): Remove.
7928 (Input_reader::arg_serial): New function.
7929 (Input_reader::get_unused_symbol_count): New function.
7930 (Input_reader::get_unused_symbol): New function.
7931 (Input_reader::do_arg_serial): New function.
7932 (Input_reader::do_get_unused_symbol_count): New function.
7933 (Input_reader::do_get_unused_symbol): New function.
7934 (Incremental_binary::input_file_count): New function.
7935 (Incremental_binary::get_input_reader): Change signature to use
7936 index instead of filename.
7937 (Incremental_binary::file_has_changed): New function.
7938 (Incremental_binary::get_input_argument): New function.
7939 (Incremental_binary::get_library): New function.
7940 (Incremental_binary::get_script_info): New function.
7941 (Incremental_binary::init_layout): New function.
7942 (Incremental_binary::reserve_layout): New function.
7943 (Incremental_binary::output_file): New function.
7944 (Incremental_binary::do_check_inputs): New function.
7945 (Incremental_binary::do_file_is_unchanged): Remove.
7946 (Incremental_binary::do_file_has_changed): New function.
7947 (Incremental_binary::do_init_layout): New function.
7948 (Incremental_binary::do_reserve_layout): New function.
7949 (Incremental_binary::do_input_file_count): New function.
7950 (Incremental_binary::do_get_input_reader): Change signature.
7951 (Incremental_binary::input_args_map_): New data member.
7952 (Incremental_binary::library_map_): New data member.
7953 (Incremental_binary::script_map_): New data member.
7954 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7955 new data members.
7956 (Sized_incremental_binary::output_section): New function.
7957 (Sized_incremental_binary::inputs_reader): Add const.
7958 (Sized_incremental_binary::symtab_reader): Add const.
7959 (Sized_incremental_binary::relocs_reader): Add const.
7960 (Sized_incremental_binary::got_plt_reader): Add const.
7961 (Sized_incremental_binary::get_symtab_view): New function.
7962 (Sized_incremental_binary::Inputs_reader): New typedef.
7963 (Sized_incremental_binary::Input_entry_reader): New typedef.
7964 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7965 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7966 (Sized_incremental_binary::do_file_has_changed): New function.
7967 (Sized_incremental_binary::do_init_layout): New function.
7968 (Sized_incremental_binary::do_reserve_layout): New function.
7969 (Sized_input_reader::Inputs_reader): Remove.
7970 (Sized_input_reader::Input_entry_reader): Remove.
7971 (Sized_input_reader::do_arg_serial): New function.
7972 (Sized_input_reader::do_get_unused_symbol_count): New function.
7973 (Sized_input_reader::do_get_unused_symbol): New function.
7974 (Sized_incremental_binary::do_input_file_count): New function.
7975 (Sized_incremental_binary::do_get_input_reader): Change signature;
7976 use index instead of filename.
7977 (Sized_incremental_binary::section_map_): New data member.
7978 (Sized_incremental_binary::input_entry_readers_): New data member.
7979 (class Sized_incr_relobj): New class.
7980 (class Sized_incr_dynobj): New class.
7981 (make_sized_incremental_object): New function.
7982 (class Incremental_library): New class.
7983 * layout.cc (Free_list::num_lists): New static data member.
7984 (Free_list::num_nodes): New static data member.
7985 (Free_list::num_removes): New static data member.
7986 (Free_list::num_remove_visits): New static data member.
7987 (Free_list::num_allocates): New static data member.
7988 (Free_list::num_allocate_visits): New static data member.
7989 (Free_list::init): New function.
7990 (Free_list::remove): New function.
7991 (Free_list::allocate): New function.
7992 (Free_list::dump): New function.
7993 (Free_list::print_stats): New function.
7994 (Layout_task_runner::run): Resize output file for incremental updates.
7995 (Layout::Layout): Initialize new data members.
7996 (Layout::set_incremental_base): New function.
7997 (Layout::init_fixed_output_section): New function.
7998 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7999 incremental updates.
8000 (Layout::create_gold_note): Do not create gold note section for
8001 incremental updates.
8002 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
8003 for incremental updates.
8004 (Layout::set_section_offsets): For incremental updates, allocate space
8005 from free list.
8006 (Layout::create_symtab_sections): Layout with offsets relative to
8007 start of section; for incremental updates, allocate space from free
8008 list.
8009 (Layout::create_shdrs): For incremental updates, allocate space from
8010 free list.
8011 (Layout::finish_dynamic_section): For incremental updates, do not
8012 check --as-needed (fixed in subsequent patch).
8013 * layout.h (class Free_list): New class.
8014 (Layout::set_incremental_base): New function.
8015 (Layout::incremental_base): New function.
8016 (Layout::init_fixed_output_section): New function.
8017 (Layout::allocate): New function.
8018 (Layout::incremental_base_): New data member.
8019 (Layout::free_list_): New data member.
8020 * main.cc (main): Print Free_list statistics.
8021 * object.cc (Relobj::finalize_incremental_relocs): Add
8022 clear_counts parameter; clear counts only when clear_counts is set.
8023 (Sized_relobj::Sized_relobj): Initialize new base class.
8024 (Sized_relobj::do_layout): Don't report special sections.
8025 (Sized_relobj::do_for_all_local_got_entries): New function.
8026 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
8027 symtab_off to all symbol table offsets.
8028 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
8029 * object.h (class Got_offset_list): Move to top of file.
8030 (Object::Object): Allow case where input_file == NULL.
8031 (Object::~Object): Likewise.
8032 (Object::input_file): Assert that input_file != NULL.
8033 (Object::lock): Allow case where input_file == NULL.
8034 (Object::unlock): Likewise.
8035 (Object::is_locked): Likewise.
8036 (Object::token): Likewise.
8037 (Object::release): Likewise.
8038 (Object::is_incremental): New function.
8039 (Object::get_mtime): New function.
8040 (Object::for_all_local_got_entries): New function.
8041 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
8042 (Object::set_is_in_system_directory): New function.
8043 (Object::is_in_system_directory): New function.
8044 (Object::do_is_incremental): New function.
8045 (Object::do_get_mtime): New function.
8046 (Object::do_for_all_local_got_entries): New function.
8047 (Object::is_in_system_directory_): New data member.
8048 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
8049 (class Sized_relobj_base): New class.
8050 (class Sized_relobj): Derive from Sized_relobj_base.
8051 (class Sized_relobj::Symbols): Redeclare from base class.
8052 (class Sized_relobj::local_got_offset_list): Remove.
8053 (class Sized_relobj::Output_sections): Redeclare from base class.
8054 (class Sized_relobj::do_for_all_local_got_entries): New function.
8055 (class Sized_relobj::write_local_symbols): Add offset parameter.
8056 (class Sized_relobj::local_symbol_offset_): Update comment.
8057 (class Sized_relobj::local_dynsym_offset_): Update comment.
8058 * options.cc (Input_arguments::add_file): Remove const.
8059 * options.h (Input_file_argument::Input_file_argument):
8060 Initialize arg_serial_ (all constructors).
8061 (Input_file_argument::set_arg_serial): New function.
8062 (Input_file_argument::arg_serial): New function.
8063 (Input_file_argument::arg_serial_): New data member.
8064 (Input_arguments::Input_arguments): Initialize file_count_.
8065 (Input_arguments::add_file): Remove const.
8066 (Input_arguments::number_of_input_files): New function.
8067 (Input_arguments::file_count_): New data member.
8068 (Command_line::number_of_input_files): Call
8069 Input_arguments::number_of_input_files.
8070 * output.cc (Output_segment_headers::Output_segment_headers):
8071 Set current size.
8072 (Output_section::Input_section::current_data_size): New function.
8073 (Output_section::Output_section): Initialize new data members.
8074 (Output_section::add_input_section): Don't do merge sections for
8075 an incremental link; allocate space from free list for an
8076 incremental update.
8077 (Output_section::add_output_section_data): Allocate space from
8078 free list for an incremental update.
8079 (Output_section::update_data_size): New function.
8080 (Output_section::set_fixed_layout): New function.
8081 (Output_section::reserve): New function.
8082 (Output_segment::set_section_addresses): Remove const.
8083 (Output_segment::set_section_list_addresses): Remove const; allocate
8084 space from free list for an incremental update.
8085 (Output_segment::set_offset): Adjust size of RELRO segment for an
8086 incremental update.
8087 * output.h (Output_data::current_data_size): Move here from
8088 child classes.
8089 (Output_data::pre_finalize_data_size): New function.
8090 (Output_data::update_data_size): New function.
8091 (Output_section_headers::update_data_size): new function.
8092 (Output_section_data_build::current_data_size): Move to Output_data.
8093 (Output_data_strtab::update_data_size): New function.
8094 (Output_section::current_data_size): Move to Output_data.
8095 (Output_section::set_fixed_layout): New function.
8096 (Output_section::has_fixed_layout): New function.
8097 (Output_section::reserve): New function.
8098 (Output_section::update_data_size): New function.
8099 (Output_section::has_fixed_layout_): New data member.
8100 (Output_section::free_list_): New data member.
8101 (Output_segment::set_section_addresses): Remove const.
8102 (Output_segment::set_section_list_addresses): Remove const.
8103 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8104 New function.
8105 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8106 New function.
8107 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8108 parameter when calling Add_symbols constructor; store argument
8109 serial number for members of a lib group.
8110 (Add_symbols::locks): Allow case where token == NULL.
8111 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8112 (Read_member::~Read_member): New function.
8113 (Read_member::is_runnable): New function.
8114 (Read_member::locks): New function.
8115 (Read_member::run): New function.
8116 (Check_script::~Check_script): New function.
8117 (Check_script::is_runnable): New function.
8118 (Check_script::locks): New function.
8119 (Check_script::run): New function.
8120 (Check_library::~Check_library): New function.
8121 (Check_library::is_runnable): New function.
8122 (Check_library::locks): New function.
8123 (Check_library::run): New function.
8124 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8125 (Add_symbols::library_): New data member.
8126 (class Read_member): New class.
8127 (class Check_script): New class.
8128 (class Check_library): New class.
8129 * reloc.cc (Read_relocs::is_runnable): Allow case where
8130 token == NULL.
8131 (Read_relocs::locks): Likewise.
8132 (Scan_relocs::locks): Likewise.
8133 (Relocate_task::locks): Likewise.
8134 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8135 to clear counters.
8136 (Sized_relobj::incremental_relocs_scan): Fix comment.
8137 (Sized_relobj::do_relocate): Pass output file offset to
8138 write_local_symbols.
8139 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8140 from class declaration.
8141 * script.cc (read_input_script): Allocate Script_info; pass
8142 argument serial number to report_script.
8143 * script.h (class Script_info): Move to incremental.h.
8144 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8145 * symtab.h (Symbol_table::add_from_incrobj): New function.
8146 (Symbol_table::set_file_offset): New function.
8147
8148 2011-04-05 Cary Coutant <ccoutant@google.com>
8149
8150 * incremental-dump.cc (dump_incremental_inputs): Change signature
8151 to take a Sized_incremental_binary; change caller. Use readers
8152 in Sized_incremental_binary.
8153 * incremental.cc
8154 (Sized_incremental_binary::find_incremental_inputs_sections):
8155 Rename do_find_incremental_inputs_sections to this.
8156 (Sized_incremental_binary::setup_readers): New function.
8157 (Sized_incremental_binary::do_check_inputs): Check
8158 has_incremental_info_ flag; move setup code to setup_readers;
8159 use input readers.
8160 (Sized_incremental_binary::do_file_is_unchanged): New function.
8161 (Sized_incremental_binary::do_get_input_reader): New function.
8162 * incremental.h (class Incremental_binary): Move to end of file.
8163 (Incremental_binary::file_is_unchanged): New function.
8164 (Incremental_binary::do_file_is_unchanged): New function.
8165 (Incremental_binary::Input_reader): New class.
8166 (Incremental_binary::get_input_reader): New function.
8167 (class Sized_incremental_binary): Move to end of file.
8168 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8169 input section reader classes.
8170 (Sized_incremental_binary::has_incremental_info): New function.
8171 (Sized_incremental_binary::inputs_reader): New function.
8172 (Sized_incremental_binary::symtab_reader): New function.
8173 (Sized_incremental_binary::relocs_reader): New function.
8174 (Sized_incremental_binary::got_plt_reader): New function.
8175 (Sized_incremental_binary::do_file_is_unchanged): New function.
8176 (Sized_incremental_binary::Sized_input_reader): New class.
8177 (Sized_incremental_binary::get_input_reader): New function.
8178 (Sized_incremental_binary::find_incremental_inputs_sections):
8179 Rename do_find_incremental_inputs_sections to this.
8180 (Sized_incremental_binary::setup_readers): New function.
8181 (Sized_incremental_binary::has_incremental_info_): New data member.
8182 (Sized_incremental_binary::inputs_reader_): New data member.
8183 (Sized_incremental_binary::symtab_reader_): New data member.
8184 (Sized_incremental_binary::relocs_reader_): New data member.
8185 (Sized_incremental_binary::got_plt_reader_): New data member.
8186 (Sized_incremental_binary::current_input_file_): New data member.
8187
8188 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8189
8190 PR gold/12640
8191 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8192 violation.
8193
8194 2011-03-30 Cary Coutant <ccoutant@google.com>
8195
8196 * archive.cc (Archive::include_member): Adjust call to report_object.
8197 (Add_archive_symbols::run): Add script_info to call to
8198 report_archive_begin.
8199 (Lib_group::include_member): Adjust call to report_object.
8200 (Add_lib_group_symbols::run): Adjust call to report_object.
8201 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8202 blocks. Add object count for script input files.
8203 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8204 script_info parameter; change all callers.
8205 (Incremental_inputs::report_object): Add script_info parameter;
8206 change all callers.
8207 (Incremental_inputs::report_script): Store backpointer to
8208 incremental info entry.
8209 (Output_section_incremental_inputs::set_final_data_size): Record
8210 additional information for scripts.
8211 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8212 * incremental.h (Incremental_script_entry::add_object): New function.
8213 (Incremental_script_entry::get_object_count): New function.
8214 (Incremental_script_entry::get_object): New function.
8215 (Incremental_script_entry::objects_): New data member; adjust
8216 constructor.
8217 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8218 (Incremental_inputs::report_object): Add script_info parameter.
8219 (Incremental_inputs_reader::get_object_count): New function.
8220 (Incremental_inputs_reader::get_object_offset): New function.
8221 * options.cc (Input_arguments::add_file): Return reference to
8222 new input argument.
8223 * options.h (Input_argument::set_script_info): New function.
8224 (Input_argument::script_info): New function.
8225 (Input_argument::script_info_): New data member; adjust all
8226 constructors.
8227 (Input_file_group::add_file): Return reference to new input argument.
8228 (Input_file_lib::add_file): Likewise.
8229 (Input_arguments::add_file): Likewise.
8230 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8231 * script.cc (Parser_closure::Parser_closure): Add script_info
8232 parameter; adjust all callers.
8233 (Parser_closure::script_info): New function.
8234 (Parser_closure::script_info_): New data member.
8235 (read_input_script): Report scripts earlier to incremental info.
8236 (script_add_file): Set script_info in Input_argument.
8237 (script_add_library): Likewise.
8238 * script.h (Script_options::Script_info): Rewrite class.
8239
8240 2011-03-29 Cary Coutant <ccoutant@google.com>
8241
8242 * archive.cc (Library_base::should_include_member): Move
8243 method here from class Archive.
8244 (Archive::Archive): Initialize base class.
8245 (Archive::should_include_member): Move to base class.
8246 (Archive::do_for_all_unused_symbols): New function.
8247 (Add_archive_symbols::run): Remove redundant access to
8248 incremental_inputs.
8249 (Lib_group::Lib_group): Initialize base class.
8250 (Lib_group::do_filename): New function.
8251 (Lib_group::include_member): Pass pointer to Lib_group to
8252 report_object.
8253 (Lib_group::do_for_all_unused_symbols): New function.
8254 (Add_lib_group_symbols::run): Report archive information for
8255 incremental links.
8256 * archive.h (class Library_base): New base class.
8257 (class Archive): Derive from Library_base.
8258 (Archive::filename): Move to base class.
8259 (Archive::set_incremental_info): Likewise.
8260 (Archive::incremental_info): Likewise.
8261 (Archive::Should_include): Likewise.
8262 (Archive::should_include_member): Likewise.
8263 (Archive::Armap_entry): Remove.
8264 (Archive::Unused_symbol_iterator): Remove.
8265 (Archive::unused_symbols_begin): Remove.
8266 (Archive::unused_symbols_end): Remove.
8267 (Archive::do_filename): New function.
8268 (Archive::do_get_mtime): New function.
8269 (Archive::do_for_all_unused_symbols): New function.
8270 (Archive::task_): Move to base class.
8271 (Archive::incremental_info_): Likewise.
8272 (class Lib_group): Derive from Library_base.
8273 (Lib_group::do_filename): New function.
8274 (Lib_group::do_get_mtime): New function.
8275 (Lib_group::do_for_all_unused_symbols): New function.
8276 (Lib_group::task_): Move to base class.
8277 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8278 function.
8279 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8280 function.
8281 * incremental.cc (Incremental_inputs::report_archive_begin):
8282 Use Library_base; call library's get_mtime; add incremental inputs
8283 entry before members.
8284 (class Unused_symbol_visitor): New class.
8285 (Incremental_inputs::report_archive_end): Use Library_base; use
8286 visitor class to record unused symbols; don't add incremental inputs
8287 entry after members.
8288 (Incremental_inputs::report_object): Use Library_base.
8289 * incremental.h
8290 (Incremental_archive_entry::Incremental_archive_entry): Remove
8291 unused Archive parameter.
8292 (Incremental_inputs::report_archive_begin): Use Library_base.
8293 (Incremental_inputs::report_archive_end): Likewise.
8294 (Incremental_inputs::report_object): Likewise.
8295 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8296 function.
8297 * object.h (Object::for_all_global_symbols): New function.
8298 (Object::do_for_all_global_symbols): New function.
8299 (Sized_relobj::do_for_all_global_symbols): New function.
8300 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8301 function.
8302 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8303 function.
8304
8305 2011-03-27 Ian Lance Taylor <iant@google.com>
8306
8307 * archive.cc (Archive::interpret_header): Return -1 if something
8308 goes wrong. Change callers accordingly.
8309
8310 2011-03-25 Cary Coutant <ccoutant@google.com>
8311
8312 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8313 * testsuite/Makefile.in: Regenerate.
8314
8315 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8316
8317 * plugin.cc (get_view): New.
8318 (Plugin::load): Pass get_view to the plugin.
8319 (Plugin_manager::get_view): New.
8320
8321 2011-03-21 Ian Lance Taylor <iant@google.com>
8322
8323 * testsuite/final_layout.sh: Rewrite to not use dc.
8324 * testsuite/relro_test.sh: Fail if dc is not present.
8325
8326 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8327
8328 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8329 Change == to -eq.
8330 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8331 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8332 Change == to -eq.
8333 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8334 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8335
8336 2011-03-14 Ian Lance Taylor <iant@google.com>
8337
8338 * script-sections.cc (Sort_output_sections::script_compare):
8339 Rename from is_before, change return type.
8340 (Sort_output_sections::operator()): Adjust accordingly.
8341
8342 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8343
8344 PR gold/12572
8345 * testsuite/odr_violation2.cc: Add comment to make all error line
8346 numbers double digits.
8347 * testsuite/debug_msg.sh: Adjust expected errors.
8348
8349 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8350
8351 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8352 but mark earlier ones as non-canonical
8353 (offset_to_iterator): Update search target and example
8354 (do_addr2line): Return extra lines in a vector*
8355 (format_file_lineno): Extract from do_addr2line
8356 (one_addr2line): Add vector* out-param
8357 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8358 when a lineno entry appeared last for its instruction
8359 (Dwarf_line_info): Add vector* out-param
8360 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8361 * symtab.cc (Odr_violation_compare): Include the lineno in the
8362 comparison again.
8363 (linenos_from_loc): New. Combine the canonical line for an
8364 address with its other lines.
8365 (True_if_intersect): New. Helper functor to make
8366 std::set_intersection a query.
8367 (detect_odr_violations): Compare sets of lines instead of just
8368 one line for each function. This became less deterministic, but
8369 has fewer false positives.
8370 * symtab.h: Declarations.
8371 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8372 mix an optimized and non-optimized object in the same binary
8373 (odr_violation2.so): Same.
8374 * testsuite/Makefile.in: Regenerate from Makefile.am.
8375 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8376 * testsuite/debug_msg.sh: Update line numbers and add
8377 assertions.
8378 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8379 non-optimized context.
8380 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8381 isn't inlined, and use OdrDerived in an optimized context.
8382 * testsuite/odr_header1.h: Defines OdrDerived, where
8383 optimization will change the
8384 first-instruction-in-the-destructor's file and line number.
8385 * testsuite/odr_header2.h: Defines OdrBase.
8386
8387 2011-03-09 Ian Lance Taylor <iant@google.com>
8388
8389 * fileread.cc (File_read::clear_views): Don't delete the whole
8390 file view.
8391
8392 2011-03-08 Ian Lance Taylor <iant@google.com>
8393
8394 PR gold/12525
8395 * fileread.cc: #include <climits>.
8396 (GOLD_IOV_MAX): Define.
8397 (File_read::read_multiple): Limit number of entries by iov_max.
8398 * fileread.h (class File_read): Always set max_readv_entries to
8399 128.
8400
8401 2011-03-07 Ian Lance Taylor <iant@google.com>
8402
8403 PR gold/12525
8404 * options.h (class General_options): Add -dy and -dn.
8405
8406 2011-03-02 Cary Coutant <ccoutant@google.com>
8407
8408 * testsuite/script_test_9.t: Add TLS segment.
8409
8410 2011-03-02 Simon Baldwin <simonb@google.com>
8411
8412 * configure.ac: Add check for gnu_indirect_function support in
8413 the toolchain building binutils.
8414 * configure: Rebuild.
8415
8416 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8417
8418 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8419 plugin only symbols.
8420 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8421 in plugin files as not needed in the symbol table.
8422
8423 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8424
8425 * output.cc (Output_section::add_input_section): Delay fill
8426 generation for section ordering.
8427
8428 2011-02-09 Ian Lance Taylor <iant@google.com>
8429
8430 PR gold/12316
8431 * object.h (class Sized_relobj): Remove clear_local_symbols.
8432 * reloc.cc (Sized_relobj::do_relocate): Don't call
8433 clear_local_symbols.
8434
8435 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8436
8437 * plugin.cc (is_visible_from_outside): Return true for symbols
8438 in the -u option.
8439
8440 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8441
8442 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8443 filename.
8444
8445 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8446
8447 * icf.h (is_section_foldable_candidate): Change type of parameter
8448 to std::string.
8449 * icf.cc (Icf::find_identical_sections): Change type of local variable
8450 section_name to be std::string.
8451 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8452
8453 2011-01-25 Ian Lance Taylor <iant@google.com>
8454
8455 * script.cc (script_add_extern): Rewrite to use
8456 add_symbol_reference.
8457
8458 2011-01-25 Doug Kwan <dougkwan@google.com>
8459
8460 * icf.cc (get_section_contents): Always lock section's object.
8461
8462 2011-01-24 Ian Lance Taylor <iant@google.com>
8463
8464 * options.h (class General_options): Accept
8465 --no-detect-odr-violations.
8466
8467 2011-01-24 Ian Lance Taylor <iant@google.com>
8468
8469 * version.cc (version_string): Bump to 1.11.
8470
8471 2011-01-24 Ian Lance Taylor <iant@google.com>
8472
8473 * plugin.cc (class Plugin_rescan): Define new class.
8474 (Plugin_manager::claim_file): Set any_claimed_.
8475 (Plugin_manager::save_archive): New function.
8476 (Plugin_manager::save_input_group): New function.
8477 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8478 necessary.
8479 (Plugin_manager::new_undefined_symbol): New function.
8480 (Plugin_manager::rescan): New function.
8481 (Plugin_manager::rescannable_defines): New function.
8482 (Plugin_manager::add_input_file): Set any_added_.
8483 * plugin.h (class Plugin_manager): define new fields rescannable_,
8484 undefined_symbols_, any_claimed_, and any_added_. Declare
8485 Plugin_rescan as friend. Declare new functions.
8486 (Plugin_manager::Rescannable): Define type.
8487 (Plugin_manager::Rescannable_list): Define type.
8488 (Plugin_manager::Undefined_symbol_list): Define type.
8489 (Plugin_manager::Plugin_manager): Initialize new fields.
8490 * archive.cc (Archive::defines_symbol): New function.
8491 (Add_archive_symbols::run): Pass archive to plugins if any.
8492 * archive.h (class Archive): Declare defines_symbol.
8493 * readsyms.cc (Input_group::~Input_group): New function.
8494 (Finish_group::run): Pass input_group to plugins if any.
8495 * readsyms.h (class Input_group): Declare destructor.
8496 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8497 any.
8498
8499 2011-01-10 Ian Lance Taylor <iant@google.com>
8500
8501 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8502 section as relro.
8503 (Layout::set_segment_offsets): Reset increase_relro before calling
8504 set_section_addresses a second time.
8505
8506 2011-01-04 Cary Coutant <ccoutant@google.com>
8507
8508 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8509 sections before NOBITS sections.
8510
8511 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8512
8513 * version.cc (print_version): Update copyright to 2011.
8514
8515 2010-12-23 Cary Coutant <ccoutant@google.com>
8516
8517 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8518 of OS to this->add. Add OD parameter to second form of the function.
8519
8520 2010-12-20 Ian Lance Taylor <iant@google.com>
8521
8522 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8523 second of two consecutive entries with same offset.
8524
8525 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8526
8527 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8528 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8529 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8530 to avoid unneeded links against $(LDADD).
8531 * testsuite/Makefile.in: Regenerate.
8532
8533 2010-12-15 Ian Lance Taylor <iant@google.com>
8534
8535 PR gold/12324
8536 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8537 for R_X86_64_32 and R_X86_64_PC32.
8538 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8539 ver_matching_def_pic.o.
8540 (ver_matching_def_pic.o): New target.
8541
8542 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8543
8544 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8545 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8546 Move definition before File_read::View member definitions.
8547 (File_read::View::~View): Initialize and hold lock before
8548 updating current_mapped_bytes.
8549
8550 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8551
8552 * dwarf_reader.cc: Remove outdated comment.
8553 * gold-threads.cc: Fix typo in error message.
8554 * archive.cc: Fix typos in comments.
8555 * archive.h: Likewise.
8556 * arm-reloc-property.cc: Likewise.
8557 * arm-reloc-property.h: Likewise.
8558 * arm-reloc.def: Likewise.
8559 * arm.cc: Likewise.
8560 * attributes.h: Likewise.
8561 * cref.cc: Likewise.
8562 * ehframe.cc: Likewise.
8563 * fileread.h: Likewise.
8564 * gold.h: Likewise.
8565 * i386.cc: Likewise.
8566 * icf.cc: Likewise.
8567 * incremental.h: Likewise.
8568 * int_encoding.cc: Likewise.
8569 * layout.h: Likewise.
8570 * main.cc: Likewise.
8571 * merge.h: Likewise.
8572 * object.cc: Likewise.
8573 * object.h: Likewise.
8574 * options.cc: Likewise.
8575 * readsyms.cc: Likewise.
8576 * reduced_debug_output.cc: Likewise.
8577 * reloc.cc: Likewise.
8578 * script-sections.cc: Likewise.
8579 * sparc.cc: Likewise.
8580 * symtab.h: Likewise.
8581 * target-reloc.h: Likewise.
8582 * target.cc: Likewise.
8583 * target.h: Likewise.
8584 * timer.cc: Likewise.
8585 * timer.h: Likewise.
8586 * x86_64.cc: Likewise.
8587
8588 2010-12-09 Cary Coutant <ccoutant@google.com>
8589
8590 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8591 stack.
8592 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8593 parameter; change all callers.
8594 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8595 * options.h (warn_execstack): New option.
8596
8597 2010-12-07 Doug Kwan <dougkwan@google.com>
8598
8599 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8600 like function call relocations.
8601
8602 2010-12-07 Ian Lance Taylor <iant@google.com>
8603
8604 * archive.cc (Archive::get_elf_object_for_member): Permit
8605 punconfigured to be NULL.
8606 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8607 (Archive::include_member): Pass NULL to get_elf_object_for_member
8608 if we searched for the archive and this is the first included
8609 object.
8610
8611 2010-12-01 Ian Lance Taylor <iant@google.com>
8612
8613 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8614 track_relocs_type_ field.
8615 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8616 Set track_relocs_type_.
8617 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8618 contents when using RELA relocs.
8619 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8620 reloc_map_.
8621 * reloc.cc (Track_relocs::next_addend): New function.
8622 * reloc.h (class Track_relocs): Declare next_addend.
8623
8624 2010-12-01 Ian Lance Taylor <iant@google.com>
8625
8626 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8627 virtual destructor.
8628
8629 2010-12-01 Ian Lance Taylor <iant@google.com>
8630
8631 * README: Update compilers known to work and fail.
8632
8633 2010-11-23 Matthias Klose <doko@ubuntu.com>
8634
8635 * configure.in: For --enable-gold, handle value `default' instead of
8636 `both*'. Always install ld as ld.bfd, install as ld if gold is
8637 not the default.
8638 * configure: Regenerate.
8639
8640 2010-11-18 Doug Kwan <dougkwan@google.com>
8641
8642 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8643 and right_alignment to be zero. Store result alignment only if it is
8644 greater than existing alignment.
8645
8646 2010-11-16 Cary Coutant <ccoutant@google.com>
8647
8648 PR gold/12220
8649 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8650 Check for ".zdebug_line".
8651
8652 2010-11-16 Doug Kwan <dougkwan@google.com>
8653 Cary Coutant <ccoutant@google.com>
8654
8655 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8656 by reference; adjust all callers.
8657 * output.cc (Output_segment::set_section_addresses): Adjust references
8658 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8659 list is empty.
8660 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8661 end at page boundary.
8662
8663 2010-11-16 Cary Coutant <ccoutant@google.com>
8664
8665 PR gold/12220
8666 * layout.cc (Layout::choose_output_section): Transform names of
8667 compressed sections even when using a script with a SECTIONS clause.
8668 (Layout::output_section_name): Remove code to transform
8669 compressed debug section names.
8670 * output.cc (Output_section::add_input_section): Use uncompressed
8671 section size when tracking input sections.
8672
8673 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8674
8675 * symtab.h (Symbol::NON_PIC_REF): Remove.
8676 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8677 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8678 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8679 (Symbol::use_plt_offset): Take a flags argument and pass it
8680 directly to needs_dynamic_reloc. Restrict check for undefined
8681 weak symbols to function calls.
8682 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8683 (Target_arm::Scan::global): Use it.
8684 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8685 (Target_arm::Relocate::relocate): Likewise.
8686 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8687 parameter with an r_type parameter. Use get_reference_flags
8688 to get the flags.
8689 (Target_arm::Relocate::relocate): Update accordingly.
8690 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8691 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8692 (Target_i386::Scan::global): Likewise.
8693 (Target_i386::Relocate::relocate): Likewise.
8694 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8695 parameter with an r_type parameter. Use get_reference_flags
8696 to get the flags.
8697 (Target_i386::Relocate::relocate): Update accordingly.
8698 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8699 (Target_powerpc::Scan::global): Use it.
8700 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8701 (Target_powerpc::Relocate::relocate): Likewise.
8702 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8703 (Target_sparc::Scan::global): Use it.
8704 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8705 (Target_sparc::Relocate::relocate): Likewise.
8706 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8707 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8708 (Target_x86_64::Scan::global): Likewise.
8709 (Target_x86_64::Relocate::relocate): Likewise.
8710
8711 2010-11-08 Doug Kwan <dougkwan@google.com>
8712 Cary Coutant <ccoutant@google.com>
8713
8714 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8715 (Arm_exidx_merge_section::section_contents_): New data member.
8716 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8717 (Arm_input_section::~Arm_input_section): De-allocate memory.
8718 (Arm_input_section::original_contents_): New data member.
8719 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8720 in parameters instead of calling Object::section_contents without
8721 locking.
8722 (Arm_output_section::group_section): New parameter TASK. Pass it
8723 to callees that need locking objects.
8724 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8725 to lock EXIDX input sections. Fix a formatting issue. Call
8726 Arm_exidx_merged_section::build_contents to create merged section
8727 contents.
8728 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8729 to lock object of stub table owner.
8730 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8731 TEXT_SIZE to initialize data member TEXT_SIZE_.
8732 (Arm_exidx_input_section::addralign): Fix typo in comment.
8733 (Arm_exidx_input_section::text_size): New method.
8734 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8735 that require locking objects. Lock objects before scanning for stubs
8736 and updating local symbols.
8737 (Arm_input_section<big_endian>::init): Copy contents of original
8738 input section.
8739 (Arm_input_section<big_endian>::do_write): Use saved contents of
8740 original input section instead of calling Object::section_contents
8741 without locking.
8742 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8743 size without calling Object::section_size().
8744 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8745 for size. Allocate a buffer for merged EXIDX entries.
8746 (Arm_exidx_merged_section::build_contents): New method.
8747 (Arm_exidx_merged_section::do_write): Move merge section contents
8748 building code to Arm_exidx_merged_section::build_contetns. Write
8749 out contetns in buffer instead of building it on the fly.
8750 (Arm_relobj::make_exidx_input_section): Also pass text section size
8751 to Arm_exidx_input_section constructor.
8752 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8753 (Arm_dynobj::do_read_symbols): Fix memory leak.
8754 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8755 * target.h: (class Task): Add forward declaration.
8756 (Target::relax): Add new parameter TASK and pass it to
8757 Target::do_relax().
8758 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8759
8760 2010-11-05 Cary Coutant <ccoutant@google.com>
8761
8762 PR gold/10708
8763 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8764 object when reading from the file.
8765 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8766 second layout pass.
8767 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8768 when reading section contents.
8769 (get_section_contents): Likewise.
8770 (icf::find_identical_sections): Likewise.
8771 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8772 object when reading from the file.
8773 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8774 the object when doing deferred section layout.
8775
8776 2010-11-03 Nick Clifton <nickc@redhat.com>
8777
8778 PR gold/12001
8779 * script.h (class Symbol_assignment: name): New member. Returns
8780 the name of the symbol.
8781 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8782 Returns true if the given symbol name is on the list of
8783 assignments wating to be processed.
8784 * archive.cc (should_incldue_member): If the symbol is undefined,
8785 check to see if it is on the list of symbols pending assignment.
8786
8787 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8788
8789 * script-sections.cc (Script_sections::find_memory_region): Check
8790 for a NULL output section pointer.
8791
8792 2010-10-29 Doug Kwan <dougkwan@google.com>
8793
8794 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8795 Output_section::add_relaxed_input_section.
8796 * output.cc (Output_section::add_relaxed_input_section): Add new
8797 arguments LAYOUT and NAME. Set section order index.
8798 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8799 Copy section order index.
8800 * output.h (Output_section::add_relaxed_input_section): Add new
8801 arguments LAYOUT and NAME.
8802
8803 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8804
8805 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8806 NATIVE_OR_CROSS_LINKER.
8807 * testsuite/Makefile.in: Regenerate.
8808
8809 2010-10-20 Doug Kwan <dougkwan@google.com>
8810
8811 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8812 without SHF_LINK_ORDER flags.
8813 * layout.cc (Layout::choose_output_section): Do not filter
8814 SHF_LINK_ORDER flag in a relocatable link.
8815
8816 2010-10-17 Cary Coutant <ccoutant@google.com>
8817
8818 * output.h (Output_segment::set_section_addresses): Change function
8819 signature. Update all callers.
8820 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8821 sections.
8822 (Output_segment::set_section_addresses): Align after last TLS
8823 section. Add padding before last relro section instead of after.
8824
8825 2010-10-17 Doug Kwan <dougkwan@google.com>
8826
8827 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8828 GOT output section to be writable.
8829
8830 2010-10-14 Cary Coutant <ccoutant@google.com>
8831
8832 * debug.h (DEBUG_INCREMENTAL): New flag.
8833 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8834 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8835 mode.
8836 * incremental.cc (report_command_line): Ignore all forms of
8837 --incremental.
8838 * layout.cc (Layout::Layout): Check parameters for incremental link
8839 mode.
8840 * options.cc (General_options::parse_incremental): New function.
8841 (General_options::parse_no_incremental): New function.
8842 (General_options::parse_incremental_full): New function.
8843 (General_options::parse_incremental_update): New function.
8844 (General_options::incremental_mode_): New data member.
8845 (General_options::finalize): Check incremental_mode_.
8846 * options.h (General_options): Update help text for --incremental.
8847 Add --no-incremental, --incremental-full, --incremental-update.
8848 (General_options::Incremental_mode): New enum type.
8849 (General_options::incremental_mode): New function.
8850 (General_options::incremental_mode_): New data member.
8851 * parameters.cc (Parameters::incremental_mode_): New data member.
8852 (Parameters::set_options): Set incremental_mode_.
8853 (Parameters::set_incremental_full): New function.
8854 (Parameters::incremental): New function.
8855 (Parameters::incremental_update): New function.
8856 (set_parameters_incremental_full): New function.
8857 * parameters.h (Parameters::set_incremental_full): New function.
8858 (Parameters::incremental): New function.
8859 (Parameters::incremental_update): New function.
8860 (Parameters::incremental_mode_): New data member.
8861 (set_parameters_incremental_full): New function.
8862 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8863 incremental link mode.
8864 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8865 (Sized_relobj::do_relocate_sections): Likewise.
8866 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8867 option.
8868 * testsuite/Makefile.in: Regenerate.
8869 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8870
8871 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8872
8873 * script-sections.h (class Script_sections): Make
8874 Sections_elements typedef public.
8875 * script-sections.cc (class Sort_output_sections): Add elements_
8876 field. Add constructor which sets it; change all callers.
8877 (Sort_output_sections::is_before): New function.
8878 (Sort_output_sections::operator()): Call is_before.
8879 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8880 conditional.
8881 * testsuite/script_test_10.sh: New test. Test script section
8882 order.
8883 * testsuite/script_test_10.t: Likewise.
8884 * testsuite/script_test_10.s: Likewise.
8885 * testsuite/Makefile.am: Wrap the cross linker tests and the
8886 common tests into NATIVE_OR_CROSS_LINKER.
8887 (check_SCRIPTS): Add script_test_10.sh.
8888 (check_DATA): Add script_test_10.stdout.
8889 (script_test_10.o, script_test_10): New targets.
8890 (script_test_10.stdout): New target.
8891 * configure, testsuite/Makefile.in: Regenerate.
8892
8893 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8894
8895 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8896 error for the deprecated relocations.
8897 (Target_arm::Scan::global): Likewise.
8898 (Target_arm::Relocate::relocate): Likewise.
8899
8900 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8901
8902 * fileread.cc (Input_file::find_file): Initialize *found_name
8903 and *namep when using the fallback search for case 4.
8904
8905 2010-10-11 Cary Coutant <ccoutant@google.com>
8906
8907 * options.h (class General_options): Redefine -z lazy as an alias for
8908 the negation of -z now.
8909
8910 2010-10-11 Ian Lance Taylor <iant@google.com>
8911
8912 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8913 binding.
8914
8915 2010-10-06 Nick Clifton <nickc@redhat.com>
8916
8917 * script-sections.cc(class Memory_region): Remove
8918 current_lma_offset_ field. Rename current_vma_offset_ to
8919 current_offset_. Add last_section_ field.
8920 (Memory_region::get_current_vma_address): Rename to
8921 get_current_address.
8922 (Memory_region::get_current_lma_address): Delete.
8923 (Memory_region::increment_vma_offset): Rename to
8924 increment_offset.
8925 (Memory_region::increment_lma_offset): Delete.
8926 (Memory_region::attributes_compatible): New method. Returns
8927 true if the provided section is compatible with the region.
8928 (Memory_region::get_last_section): New method. Returns the last
8929 section to use the region.
8930 (Memory_region::set_last_section): New method. Stores the last
8931 section to use the region.
8932 (Script_sections::block_in_region): New method. Returns true if
8933 a block of memory is contained within a region.
8934 (Script_sections::find_memory_region): New method. Locates a
8935 memory region to be used to set a VMA or LMA address.
8936 (Output_section_definition::set_section_addresses): Add code to
8937 check for addresses set by memory regions.
8938 (Output_segment::set_section_addresses): Remove memory region
8939 walking code.
8940 (Script_sections::create_segment): Add a warning if a header
8941 segment is created outside of any region.
8942 * script-sections.h (class Script_sections): Add prototypes for
8943 find_memory_region and block_in_region methods.
8944 * testsuite/memory_test.s: Use .long instead of .word.
8945 * testsuite/memory_test.t: Add some more output sections.
8946 * testsuite/memory_test.sh: Update expected output.
8947
8948 2010-10-02 Doug Kwan <dougkwan@google.com>
8949
8950 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8951 defintion to symtab.h
8952 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8953 declaration to defintion.
8954
8955 2010-10-01 Nick Clifton <nickc@redhat.com>
8956
8957 * expression.cc (eval): Replace dummy argument with NULL.
8958 (eval_maybe_dot): Check for a NULL result section pointer.
8959 (Symbol_expression::value): Likewise.
8960 (Dot_expression::value): Likewise.
8961 (BINARY_EXPRESSION): Likewise.
8962 (Max_expression::value): Likewise.
8963 (Min_expression::value): Likewise.
8964 (Absolute_expression::value): Likewise.
8965 (Addr_expression::value_from_output_section): Likewise.
8966 (Loaddddr_expression::value_from_output_section): Likewise.
8967 (Segment_start_expression::value): Likewise.
8968 * script-sections.cc
8969 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8970 argument with NULL.
8971 (Sections_elememt_dot_assignment::set_section_addresses):
8972 Likewise.
8973 (Output_data_expression::do_write_to_buffer): Likewise.
8974 (Output_section_definition::finalize_symbols): Likewise.
8975 (Output_section_definition::set_section_addresses): Likewise.
8976
8977 2010-09-30 Doug Kwan <dougkwan@google.com>
8978
8979 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8980
8981 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8982
8983 * target.h (Target::can_icf_inline_merge_sections): New virtual
8984 function.
8985 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8986 virtual function.
8987 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8988 virtual function.
8989 * icf.cc (get_section_contents): Inline merge sections only when
8990 target allows it.
8991
8992 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8993
8994 * configure: Regenerate.
8995
8996 2010-09-17 Ian Lance Taylor <iant@google.com>
8997
8998 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8999 * testsuite/Makefile.am (memory_test.o): New target.
9000 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
9001 memory_test.t.
9002 * testsuite/Makefile.in: Rebuild.
9003
9004 2010-09-17 Doug Kwan <dougkwan@google.com>
9005
9006 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
9007 defintion if relocation uses GOT entries of the symbol.
9008 * testsuite/icf_safe_test.sh: Fix test.
9009 * testsuite/icf_safe_so_test.sh: Fix test.
9010
9011 2010-09-16 Cary Coutant <ccoutant@google.com>
9012
9013 * script_sections.cc (class Memory_region): Remove "NULL" from
9014 vector initializations.
9015
9016 2010-09-15 Cary Coutant <ccoutant@google.com>
9017
9018 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
9019 Resolve forwarding symbols.
9020
9021 2010-09-15 Doug Kwan <dougkwan@google.com>
9022
9023 * gold/testsuite/script_test_3.t: Add ARM special sections.
9024 * gold/testsuite/script_test_4.t: Same.
9025 * gold/testsuite/script_test_5.t: Same.
9026 * gold/testsuite/script_test_6.t: Same.
9027 * gold/testsuite/script_test_7.t: Same.
9028 * gold/testsuite/script_test_7.t: Same.
9029 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
9030
9031 2010-09-14 Cary Coutant <ccoutant@google.com>
9032
9033 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
9034 (Target_x86_64::Relocate::relocate_tls): Replace check for
9035 saw_tls_block_reloc_ with test for executable section.
9036
9037 2010-09-12 Cary Coutant <ccoutant@google.com>
9038
9039 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
9040 position-independent executables to shared libraries need dynamic
9041 relocations.
9042 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
9043 position-independent executables.
9044 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
9045 * testsuite/Makefile.in: Regenerate.
9046
9047 2010-09-10 Nick Clifton <nickc@redhat.com>
9048
9049 PR gold/11997
9050 * testsuite/memory_test.t: Discard any sections that are not
9051 needed.
9052
9053 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
9054
9055 PR gold/11996
9056 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
9057 "This::" to work around a bug in gcc 4.2.
9058
9059 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
9060
9061 2010-09-09 Rafael Espindola <espindola@google.com>
9062
9063 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
9064 sections with different PF_X flags in the same segment.
9065 (Layout::find_first_load_seg): Search all segments to find the first
9066 one.
9067 * options.h (rosegment): New.
9068
9069 2010-09-08 Rafael Espindola <espindola@google.com>
9070
9071 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
9072
9073 2010-09-08 Doug Kwan <dougkwan@google.com>
9074
9075 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
9076 (Arm_relobj::do_relocate_sections): Add new parameter for output
9077 file to match the parent.
9078 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
9079 of local symbols instead of input values. Update code to track
9080 changes in gold::relocate_section.
9081 * object.cc (Sized_relobj::compute_final_local_value): New methods.
9082 (Sized_relobj::compute_final_local_value_internal): New methods.
9083 (Sized_relobj::do_finalize_local_symbols): Move code from loop
9084 body into private version of Sized_relobj::compute_final_local_value.
9085 Call the inline method.
9086 * object.h (Symbol_value::Symbol_value): Define destructor. Free
9087 merged symbol value if there is one.
9088 (Symbol_value::has_output_value): New method defintiion.
9089 (Sized_relobj::Compute_final_local_value_status): New enum type.
9090 (Sized_relobj::compute_final_local_value): New methods.
9091 (Sized_relobj::compute_final_local_value_internal): New methods.
9092 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
9093 and arm_cortex_a8.sh.
9094 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
9095 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
9096 New tests.
9097 * Makefile.in: Regenerate.
9098 * testsuite/arm_bl_out_of_range.s: Update test.
9099 * testsuite/thumb_bl_out_of_range.s: Ditto.
9100 * testsuite/thumb_blx_out_of_range.s: Ditto.
9101 * testsuite/arm_branch_out_of_range.sh: New file.
9102 * testsuite/arm_cortex_a8.sh: Ditto.
9103 * testsuite/arm_cortex_a8_b.s: Ditto.
9104 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9105 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9106 * testsuite/arm_cortex_a8_bl.s: Ditto.
9107 * testsuite/arm_cortex_a8_blx.s: Ditto.
9108 * testsuite/arm_cortex_a8_local.s: Ditto.
9109 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9110 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9111
9112 2010-09-08 Rafael Espindola <espindola@google.com>
9113
9114 * Makefile.am (memory_test.stdout): Run readelf with -W.
9115 * Makefile.in: Regenerate.
9116 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9117 64 bit output.
9118
9119 2010-09-08 Rafael Espindola <espindola@google.com>
9120
9121 * script-sections.cc (Script_sections::add_memory_region): Convert
9122 field precision to int.
9123 * script.cc (script_set_section_region, script_set_section_region):
9124 Convert field precision to int.
9125
9126 2010-09-08 Rafael Espindola <espindola@google.com>
9127
9128 * arm.cc (do_finalize_sections): Create the __exidx_start and
9129 __exdix_end symbols even when the section is missing.
9130
9131 2010-09-08 Nick Clifton <nickc@redhat.com>
9132
9133 * README: Remove claim that MEMORY is not supported.
9134 * expression.cc (script_exp_function_origin)
9135 (script_exp_function_length): Move from here to ...
9136 * script.cc: ... here.
9137 (script_set_section_region, script_add_memory)
9138 (script_parse_memory_attr, script_include_directive): New
9139 functions.
9140 * script-sections.cc
9141 (class Memory_region): New class.
9142 (class Output_section_definition): Add set_memory_region,
9143 set_section_vma, set_section_lma and get_section_name methods.
9144 (class Script_Sections): Add add_memory_region,
9145 find_memory_region, find_memory_region_origin,
9146 find_memory_region_length and set_memory_region methods.
9147 Have set_section_addresses method walk the list of set memory
9148 regions.
9149 Extend the print methos to display memory regions.
9150 * script-sections.h: Add prototypes for new methods.
9151 Add enum for MEMORY region attributes.
9152 * yyscript.y: Add support for parsing MEMORY regions.
9153 * script-c.h: Add prototypes for new functions.
9154 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9155 * testsuite/Makefile.in: Regenerate.
9156 * testsuite/memory_test.sh: New script.
9157 * testsuite/memory_test.s: New assembler source file.
9158 * testsuite/memory_test.t: New linker script.
9159
9160 2010-08-27 Doug Kwan <dougkwan@google.com>
9161
9162 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9163 reference override an existing dynamic weak reference.
9164 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9165 * testsuite/Makefile.in: Regenerate.
9166 * testsuite/dyn_weak_ref.sh: New file.
9167 * testsuite/dyn_weak_ref_1.c: Ditto.
9168 * testsuite/dyn_weak_ref_2.c: Ditto.
9169
9170 2010-08-27 Ian Lance Taylor <iant@google.com>
9171
9172 * incremental.h (class Incremental_input_entry): Add virtual
9173 destructor.
9174
9175 2010-08-27 Ian Lance Taylor <iant@google.com>
9176
9177 * testsuite/start_lib_test_3.c: Mark t3 as used.
9178
9179 2010-08-27 Nick Clifton <nickc@redhat.com>
9180
9181 * options.cc (version_script): Fix small typo in previous
9182 whitespace tidyup.
9183
9184 2010-08-25 Nick Clifton <nickc@redhat.com>
9185
9186 * archive.cc: Formatting fixes: Remove whitespace between
9187 typename and following asterisk. Remove whitespace between
9188 function name and opening parenthesis.
9189 * archive.h: Likewise.
9190 * arm.cc: Likewise.
9191 * attributes.cc: Likewise.
9192 * attributes.h: Likewise.
9193 * common.cc: Likewise.
9194 * copy-relocs.cc: Likewise.
9195 * dirsearch.h: Likewise.
9196 * dynobj.cc: Likewise.
9197 * ehframe.cc: Likewise.
9198 * ehframe.h: Likewise.
9199 * expression.cc: Likewise.
9200 * fileread.cc: Likewise.
9201 * fileread.h: Likewise.
9202 * gc.h: Likewise.
9203 * gold-threads.cc: Likewise.
9204 * gold.cc: Likewise.
9205 * i386.cc: Likewise.
9206 * icf.h: Likewise.
9207 * incremental-dump.cc: Likewise.
9208 * incremental.cc: Likewise.
9209 * layout.cc: Likewise.
9210 * layout.h: Likewise.
9211 * main.cc: Likewise.
9212 * merge.cc: Likewise.
9213 * merge.h: Likewise.
9214 * object.cc: Likewise.
9215 * object.h: Likewise.
9216 * options.cc: Likewise.
9217 * options.h: Likewise.
9218 * output.cc: Likewise.
9219 * output.h: Likewise.
9220 * plugin.cc: Likewise.
9221 * plugin.h: Likewise.
9222 * powerpc.cc: Likewise.
9223 * reloc.cc: Likewise.
9224 * script-c.h: Likewise.
9225 * script-sections.cc: Likewise.
9226 * script.cc: Likewise.
9227 * stringpool.cc: Likewise.
9228 * symtab.cc: Likewise.
9229 * symtab.h: Likewise.
9230 * target.cc: Likewise.
9231 * timer.cc: Likewise.
9232 * timer.h: Likewise.
9233 * version.cc: Likewise.
9234 * x86_64.cc: Likewise.
9235
9236 2010-08-24 Nick Clifton <nickc@redhat.com>
9237
9238 PR 11899
9239 * layout.cc (segment_precedes): Sort segments by their physical
9240 addresses, if they have been set.
9241
9242 2010-08-23 Cary Coutant <ccoutant@google.com>
9243
9244 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9245 symbols data.
9246 (Lib_group::include_member): Unlock object after deleting its
9247 symbols data.
9248 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9249 the bug fixed here.
9250
9251 2010-08-19 Neil Vachharajani <nvachhar@google.com>
9252 Cary Coutant <ccoutant@google.com>
9253
9254 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9255 constructor, and set_blocker.
9256 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9257 readsyms_blocker_.
9258 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9259 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9260 * testsuite/Makefile.am (start_lib_test): New test case.
9261 * testsuite/Makefile.in: Regenerate.
9262 * testsuite/start_lib_test_main.c: New file.
9263 * testsuite/start_lib_test_1.c: New file.
9264 * testsuite/start_lib_test_2.c: New file.
9265 * testsuite/start_lib_test_3.c: New file.
9266
9267 2010-08-19 Ian Lance Taylor <iant@google.com>
9268
9269 * Makefile.in: Rebuild with automake 1.11.1.
9270 * aclocal.m4: Likewise.
9271 * testsuite/Makefile.in: Likewise.
9272
9273 2010-08-19 Ian Lance Taylor <iant@google.com>
9274
9275 PR 10893
9276 * i386.cc (class Output_data_plt_i386): Update declarations.
9277 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9278 local_ifuncs_ fields.
9279 (Target_i386::do_plt_section_for_global): New function.
9280 (Target_i386::do_plt_section_for_local): New function.
9281 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9282 parameter; change all callers. Initialize global_ifuncs_ and
9283 local_ifuncs_. If doing a static link define __rel_iplt_start and
9284 __rel_iplt_end.
9285 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9286 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9287 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9288 symbols.
9289 (Target_i386::make_plt_section): New function, broken out of
9290 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9291 (Target_i386::make_plt_entry): Call make_plt_section.
9292 (Target_i386::make_local_ifunc_plt_entry): New function.
9293 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9294 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9295 R_386_IRELATIVE to switch.
9296 (Target_i386::Scan::global): Likewise.
9297 (Target_i386::Relocate::relocate): Likewise.
9298 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9299 switch.
9300 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9301 (Target_x86_64::do_plt_section_for_global): New function.
9302 (Target_x86_64::do_plt_section_for_local): New function.
9303 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9304 parameter; change all callers. If doing a static link define
9305 __rela_iplt_start and __rela_iplt_end.
9306 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9307 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9308 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9309 to point to .plt.
9310 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9311 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9312 switch.
9313 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9314 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9315 R_X86_64_IRELATIVE to switch.
9316 (Target_x86_64::Scan::global): Likewise.
9317 (Target_x86_64::Relocate::relocate): Likewise.
9318 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9319 switch.
9320 * target.h (class Target): Add plt_section_for_global and
9321 plt_section_for_local functions. Add do_plt_section_for_global
9322 and do_plt_section_for_local virtual functions.
9323 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9324 clarifying comments.
9325 (Symbol::use_plt_offset): Handle IFUNC symbol.
9326 * object.cc (Sized_relobj::Sized_relobj): Initialize
9327 local_plt_offsets_.
9328 (Sized_relobj::local_has_plt_offset): New function.
9329 (Sized_relobj::local_plt_offset): New function.
9330 (Sized_relobj::set_local_plt_offset): New function.
9331 (Sized_relobj::do_count): Handle IFUNC symbol.
9332 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9333 a bit away from input_shndx_ field. Add set_is_func_symbol and
9334 is_ifunc_symbol functions.
9335 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9336 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9337 local_plt_offsets_ field.
9338 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9339 * output.h (class Output_section_data): Add non-const
9340 output_section function.
9341 (class Output_data_got): Update declarations.
9342 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9343 Add use_plt_offset parameter to global and local constructors.
9344 Change all callers. Change local_sym_index_ field to 31 bits.
9345 Change GSYM_CODE and CONSTANT_CODE accordingly.
9346 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9347 doing a static link don't set sh_link field.
9348 (Output_data_got::Got_entry::write): Use PLT offset if
9349 appropriate.
9350 (Output_data_got::add_global_plt): New function.
9351 (Output_data_got::add_local_plt): New function.
9352 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9353 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9354 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9355 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9356 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9357 IFUNC conditional.
9358 * testsuite/ifunc-sel.h: New file.
9359 * testsuite/ifuncmain1.c: New file.
9360 * testsuite/ifuncmain1vis.c: New file.
9361 * testsuite/ifuncmod1.c: New file.
9362 * testsuite/ifuncdep2.c: New file.
9363 * testsuite/ifuncmain2.c: New file.
9364 * testsuite/ifuncmain3.c: New file.
9365 * testsuite/ifuncmod3.c: New file.
9366 * testsuite/ifuncmain4.c: New file.
9367 * testsuite/ifuncmain5.c: New file.
9368 * testsuite/ifuncmod5.c: New file.
9369 * testsuite/ifuncmain6pie.c: New file.
9370 * testsuite/ifuncmod6.c: New file.
9371 * testsuite/ifuncmain7.c: New file.
9372 * configure, testsuite/Makefile.in: Rebuild.
9373
9374 2010-08-18 Ian Lance Taylor <iant@google.com>
9375
9376 * incremental.cc
9377 (Output_section_incremental_inputs::write_input_files): Add cast
9378 to avoid signed/unsigned comparison warning.
9379 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9380
9381 2010-08-12 Cary Coutant <ccoutant@google.com>
9382
9383 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9384
9385 2010-08-13 Ian Lance Taylor <iant@google.com>
9386
9387 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9388
9389 2010-08-12 Cary Coutant <ccoutant@google.com>
9390 Doug Kwan <dougkwan@google.com>
9391
9392 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9393 defintion overrides non-weak undef, remember that the original undef
9394 is not weak.
9395 * symtab.cc (Symbol_table::sized_write_global): For undef without
9396 an original weak binding, set binding to global in output.
9397 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9398 * testsuite/Makefile.in: Regenerate.
9399 * testsuite/strong_ref_weak_def.sh: New file.
9400 * testsuite/strong_ref_weak_def_1.c: Ditto.
9401 * testsuite/strong_ref_weak_def_2.c: Ditto.
9402
9403 2010-08-12 Cary Coutant <ccoutant@google.com>
9404
9405 * testsuite/incremental_test.sh: Rewrite.
9406 * testsuite/incremental_test_1.c: Rewrite.
9407 * testsuite/incremental_test_2.c: Rewrite.
9408
9409 2010-08-12 Cary Coutant <ccoutant@google.com>
9410
9411 * arm.cc (Target_arm::got_size): Add const.
9412 (Target_arm::got_entry_count): New function.
9413 (Target_arm::plt_entry_count): New function.
9414 (Target_arm::first_plt_entry_offset): New function.
9415 (Target_arm::plt_entry_size): New function.
9416 (Output_data_plt_arm::entry_count): New function.
9417 (Output_data_plt_arm::first_plt_entry_offset): New function.
9418 (Output_data_plt_arm::get_plt_entry_size): New function.
9419 * i386.cc (Target_i386::got_size): Add const.
9420 (Target_i386::got_entry_count): New function.
9421 (Target_i386::plt_entry_count): New function.
9422 (Target_i386::first_plt_entry_offset): New function.
9423 (Target_i386::plt_entry_size): New function.
9424 (Output_data_plt_i386::entry_count): New function.
9425 (Output_data_plt_i386::first_plt_entry_offset): New function.
9426 (Output_data_plt_i386::get_plt_entry_size): New function.
9427 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9428 find_incremental_inputs_sections. Dump incremental_got_plt section.
9429 * incremental.cc: Include target.h.
9430 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9431 parameter. Adjust all callers. Find incremental_got_plt section.
9432 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9433 section.
9434 (Output_section_incremental_inputs::set_final_data_size): Calculate
9435 size of incremental_got_plt section.
9436 (Output_section_incremental_inputs::do_write): Write the
9437 incremental_got_plt section.
9438 (Got_plt_view_info): New struct.
9439 (Local_got_offset_visitor): New class.
9440 (Global_got_offset_visitor): New class.
9441 (Global_symbol_visitor_got_plt): New class.
9442 (Output_section_incremental_inputs::write_got_plt): New function.
9443 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9444 Add parameter. Adjust all callers.
9445 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9446 (Incremental_inputs::got_plt_section): New function.
9447 (Incremental_inputs::got_plt_section_): New data member.
9448 (Incremental_got_plt_reader): New class.
9449 * layout.cc (Layout::create_incremental_info_sections): Add the
9450 incremental_got_plt section.
9451 * object.h (Got_offset_list::get_list): New function.
9452 (Got offset_list::for_all_got_offsets): New function.
9453 (Sized_relobj::local_got_offset_list): New function.
9454 * powerpc.cc (Target_powerpc::got_size): Add const.
9455 (Target_powerpc::got_entry_count): New function.
9456 (Target_powerpc::plt_entry_count): New function.
9457 (Target_powerpc::first_plt_entry_offset): New function.
9458 (Target_powerpc::plt_entry_size): New function.
9459 (Output_data_plt_powerpc::entry_count): New function.
9460 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9461 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9462 * sparc.cc (Target_sparc::got_size): Add const.
9463 (Target_sparc::got_entry_count): New function.
9464 (Target_sparc::plt_entry_count): New function.
9465 (Target_sparc::first_plt_entry_offset): New function.
9466 (Target_sparc::plt_entry_size): New function.
9467 (Output_data_plt_sparc::entry_count): New function.
9468 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9469 (Output_data_plt_sparc::get_plt_entry_size): New function.
9470 * symtab.h (Symbol::got_offset_list): New function.
9471 (Symbol_table::for_all_symbols): New function.
9472 * target.h (Sized_target::got_entry_count): New function.
9473 (Sized_target::plt_entry_count): New function.
9474 (Sized_target::plt_entry_size): New function.
9475 * x86_64.cc (Target_x86_64::got_size): Add const.
9476 (Target_x86_64::got_entry_count): New function.
9477 (Target_x86_64::plt_entry_count): New function.
9478 (Target_x86_64::first_plt_entry_offset): New function.
9479 (Target_x86_64::plt_entry_size): New function.
9480 (Output_data_plt_x86_64::entry_count): New function.
9481 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9482 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9483
9484 2010-08-12 Cary Coutant <ccoutant@google.com>
9485
9486 * archive.cc: Include incremental.h.
9487 (Archive::Archive): Initialize incremental_info_.
9488 (Archive::include_member): Record archive members in incremental info.
9489 (Add_archive_symbols::run): Record begin and end of an archive in
9490 incremental info.
9491 (Lib_group::include_member): Record objects in incremental info.
9492 * archive.h (Incremental_archive_entry): Forward declaration.
9493 (Archive::set_incremental_info): New member function.
9494 (Archive::incremental_info): New member function.
9495 (Archive::Unused_symbol_iterator): New class.
9496 (Archive::unused_symbols_begin): New member function.
9497 (Archive::unused_symbols_end): New member function.
9498 (Archive::incremental_info_): New data member.
9499 * incremental-dump.cc (find_input_containing_global): New function.
9500 (dump_incremental_inputs): Dump new incremental info sections.
9501 * incremental.cc: Include symtab.h.
9502 (Output_section_incremental_inputs): New class.
9503 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9504 new incremental info sections.
9505 (Sized_incremental_binary::do_check_inputs): Likewise.
9506 (Incremental_inputs::report_archive): Remove.
9507 (Incremental_inputs::report_archive_begin): New function.
9508 (Incremental_inputs::report_archive_end): New function.
9509 (Incremental_inputs::report_object): New function.
9510 (Incremental_inputs::finalize_inputs): Remove.
9511 (Incremental_inputs::report_input_section): New function.
9512 (Incremental_inputs::report_script): Rewrite.
9513 (Incremental_inputs::finalize): Do nothing but finalize string table.
9514 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9515 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9516 (Incremental_inputs::create_data_sections): New function.
9517 (Incremental_inputs::relocs_entsize): New function.
9518 (Output_section_incremental_inputs::set_final_data_size): New function.
9519 (Output_section_incremental_inputs::do_write): New function.
9520 (Output_section_incremental_inputs::write_header): New function.
9521 (Output_section_incremental_inputs::write_input_files): New function.
9522 (Output_section_incremental_inputs::write_info_blocks): New function.
9523 (Output_section_incremental_inputs::write_symtab): New function.
9524 * incremental.h (Incremental_script_entry): Forward declaration.
9525 (Incremental_object_entry): Forward declaration.
9526 (Incremental_archive_entry): Forward declaration.
9527 (Incremental_inputs): Forward declaration.
9528 (Incremental_inputs_header_data): Remove.
9529 (Incremental_inputs_header): Remove.
9530 (Incremental_inputs_header_write): Remove.
9531 (Incremental_inputs_entry_data): Remove.
9532 (Incremental_inputs_entry): Remove.
9533 (Incremental_inputs_entry_write): Remove.
9534 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9535 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9536 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9537 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9538 Likewise.
9539 (Incremental_input_entry): New class.
9540 (Incremental_script_entry): New class.
9541 (Incremental_object_entry): New class.
9542 (Incremental_archive_entry): New class.
9543 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9544 (Incremental_inputs::report_inputs): Remove.
9545 (Incremental_inputs::report_archive): Remove.
9546 (Incremental_inputs::report_archive_begin): New function.
9547 (Incremental_inputs::report_archive_end): New function.
9548 (Incremental_inputs::report_object): Change prototype.
9549 (Incremental_inputs::report_input_section): New function.
9550 (Incremental_inputs::report_script): Change prototype.
9551 (Incremental_inputs::get_reloc_count): New function.
9552 (Incremental_inputs::set_reloc_count): New function.
9553 (Incremental_inputs::create_data_sections): New function.
9554 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9555 (Incremental_inputs::inputs_section): New function.
9556 (Incremental_inputs::symtab_section): New function.
9557 (Incremental_inputs::relocs_section): New function.
9558 (Incremental_inputs::get_stringpool): Add const.
9559 (Incremental_inputs::command_line): Add const.
9560 (Incremental_inputs::inputs): Remove.
9561 (Incremental_inputs::command_line_key): New function.
9562 (Incremental_inputs::input_file_count): New function.
9563 (Incremental_inputs::input_files): New function.
9564 (Incremental_inputs::relocs_entsize): New function.
9565 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9566 (Incremental_inputs::finalize_inputs): Remove.
9567 (Incremental_inputs::Input_info): Remove.
9568 (Incremental_inputs::lock_): Remove.
9569 (Incremental_inputs::inputs_): Change type.
9570 (Incremental_inputs::inputs_map_): Remove.
9571 (Incremental_inputs::current_object_entry_): New data member.
9572 (Incremental_inputs::inputs_section_): New data member.
9573 (Incremental_inputs::symtab_section_): New data member.
9574 (Incremental_inputs::relocs_section_): New data member.
9575 (Incremental_inputs::reloc_count_): New data member.
9576 (Incremental_inputs_reader): New class.
9577 (Incremental_symtab_reader): New class.
9578 (Incremental_relocs_reader): New class.
9579 * layout.cc (Layout::finalize): Move finalization of incremental info
9580 and creation of incremental info sections to follow finalization of
9581 symbol table. Set offsets for postprocessing sections.
9582 (Layout::create_incremental_info_sections): Call
9583 Incremental_inputs::create_data_sections. Add incremental symtab
9584 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9585 sections to layout after input sections.
9586 * layout.h (struct Timespec): Forward declaration.
9587 (Layout::incremental_inputs): Add const.
9588 (Layout::create_incremental_info_sections): Add parameter.
9589 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9590 * object.cc: Include incremental.h.
9591 (Relobj::finalize_incremental_relocs): New function.
9592 (Sized_relobj::do_layout): Record input sections in incremental info.
9593 * object.h (Object::output_section): New function.
9594 (Object::output_section_offset): Moved from Relobj.
9595 (Object::get_incremental_reloc_base): New function.
9596 (Object::get_incremental_reloc_count): New function.
9597 (Object::do_output_section): New function.
9598 (Object::do_output_section_offset): Moved from Relobj.
9599 (Object::do_get_incremental_reloc_base): New function.
9600 (Object::do_get_incremental_reloc_count): New function.
9601 (Object::Object): Initialize new data members.
9602 (Relobj::output_section): Renamed do_output_section and moved to
9603 protected.
9604 (Relobj::output_section_offset): Moved to Object.
9605 (Relobj::do_get_incremental_reloc_base): New function.
9606 (Relobj::do_get_incremental_reloc_count): New function.
9607 (Relobj::allocate_incremental_reloc_counts): New function.
9608 (Relobj::count_incremental_reloc): New function.
9609 (Relobj::finalize_incremental_relocs): New function.
9610 (Relobj::next_incremental_reloc_index): New function.
9611 (Relobj::reloc_counts_): New data member.
9612 (Relobj::reloc_bases_): New data member.
9613 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9614 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9615 (Sized_relobj::incremental_relocs_scan): New function.
9616 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9617 (Sized_relobj::incremental_relocs_write): New function.
9618 (Sized_relobj::incremental_relocs_write_reltype): New function.
9619 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9620 incremental link.
9621 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9622 archives and object files elsewhere.
9623 (Add_symbols::run): Report object files here.
9624 (Finish_group::run): Report end of archive at end of group.
9625 * reloc.cc: Include layout.h, incremental.h.
9626 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9627 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9628 (Sized_relobj::incremental_relocs_scan): New function.
9629 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9630 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9631 (Sized_relobj::incremental_relocs_write): New function.
9632 (Sized_relobj::incremental_relocs_write_reltype): New function.
9633 * script.cc (read_input_script): Rewrite test for incremental link.
9634 Change call to Incremental_inputs::report_script.
9635 * symtab.h (Symbol_table::first_global_index): New function.
9636 (Symbol_table::output_count): New function.
9637
9638 2010-08-12 Doug Kwan <dougkwan@google.com>
9639
9640 * arm.cc (Target_arm::merge_object_attributes): Check command line
9641 options --no-wchar-size-warning and --no-enum-size-warning.
9642 * options.h (General_options): Add ld-compatible options
9643 --no-enum-size-warning and --no-wchar-size-warning.
9644
9645 2010-08-04 Ian Lance Taylor <iant@google.com>
9646
9647 * x86_64.cc (Target_x86_64::Scan::local): Use
9648 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9649 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9650 (Target_x86_64::Scan::global): Likewise.
9651 (Target_x86_64::Relocate::relocate): Likewise.
9652 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9653 Likewise.
9654
9655 2010-08-03 Cary Coutant <ccoutant@google.com>
9656
9657 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9658 to reserve space in merged_strings vector. Keep total input size
9659 for stats.
9660 (Output_merge_string::do_print_merge_stats): Print total input size.
9661 * merge.h (Output_merge_string): Add input_size_ field.
9662 * stringpool.cc (Stringpool_template::string_length): Move
9663 implementations out of Stringpool_template class and place in
9664 stringpool.h.
9665 * stringpool.h (string_length): Move out of Stringpool_template.
9666
9667 2010-08-03 Ian Lance Taylor <iant@google.com>
9668
9669 PR 11712
9670 * layout.cc (relaxation_loop_body): If address of load segment is
9671 set, adjust address to include headers if possible.
9672
9673 2010-08-03 Ian Lance Taylor <iant@google.com>
9674
9675 * version.cc (version_string): Bump to 1.10.
9676
9677 2010-08-03 Ian Lance Taylor <iant@google.com>
9678
9679 PR 11805
9680 * layout.h (enum Output_section_order): Define.
9681 (class Layout): Update declarations.
9682 * layout.cc (Layout::get_output_section): Add order parameter.
9683 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9684 is_first_non_relro parameters. Change all callers.
9685 (Layout::choose_output_section): Likewise.
9686 (Layout::add_output_section_data): Likewise.
9687 (Layout::make_output_section): Likewise. Set order.
9688 (Layout::default_section_order): New function.
9689 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9690 * output.cc (Output_section::Output_section): Initialize order_.
9691 Don't initialize deleted fields.
9692 (Output_segment::Output_segment): Don't initialize deleted
9693 fields.
9694 (Output_segment::add_output_section_to_load): New function
9695 replacing add_output_section. Change all callers to call this or
9696 add_output_section_to_nonload.
9697 (Output_segment::add_output_section_to_nonload): New function.
9698 (Output_segment::remove_output_section): Rewrite.
9699 (Output_segment::add_initial_output_data): Likewise.
9700 (Output_segment::has_any_data_sections): Likewise.
9701 (Output_segment::is_first_section_relro): Likewise.
9702 (Output_segment::maximum_alignment): Likewise.
9703 (Output_segment::has_dynamic_reloc): New function replacing
9704 dynamic_reloc_count. Change all callers.
9705 (Output_segment::has_dynamic_reloc_list): New function replacing
9706 dynamic_reloc_count_list. Change all callers.
9707 (Output_segment::set_section_addresses): Rewrite.
9708 (Output_segment::set_offset): Rewrite.
9709 (Output_segment::find_first_and_last_list): Remove.
9710 (Output_segment::set_tls_offsets): Rewrite.
9711 (Output_segment::first_section_load_address): Likewise.
9712 (Output_segment::output_section_count): Likewise.
9713 (Output_segment::section_with_lowest_load_address): Likewise.
9714 (Output_segment::write_section_headers): Likewise.
9715 (Output_segment::print_sections_to_map): Likewise.
9716 * output.h (class Output_data): Remove dynamic_reloc_count_
9717 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9718 (Output_data::add_dynamic_reloc): Rewrite.
9719 (Output_data::has_dynamic_reloc): New function.
9720 (Output_data::dynamic_reloc_count): Remove.
9721 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9722 is_last_relro_, is_first_non_relro_, is_interp_,
9723 is_dynamic_linker_section_ fields. Add order and set_order
9724 functions. Remove is_relro_local, set_is_relro_local,
9725 is_last_relro, set_is_last_relro, is_first_non_relro,
9726 set_is_first_non_relro functions, is_interp, set_is_interp,
9727 is_dynamic_linker_section, and set_is_dynamic_linker_section
9728 functions.
9729 (class Output_segment): Change Output_data_list from std::list to
9730 std:;vector. Add output_lists_ field. Remove output_data_ and
9731 output_bss_ fields. Update declarations.
9732
9733 2010-08-02 Ian Lance Taylor <iant@google.com>
9734
9735 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9736 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9737 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9738
9739 2010-08-02 Ian Lance Taylor <iant@google.com>
9740
9741 PR 11855
9742 * script.cc (Script_options::Script_options): Initialize
9743 symbol_definitions_ and symbol_references_.
9744 (Script_options::add_symbol_assignment): Update
9745 symbol_definitions_ and symbol_references_.
9746 (Script_options::add_symbol_reference): New function.
9747 (script_symbol): New function.
9748 * script.h (class Script_options): Add symbol_definitions_ and
9749 symbol_references_ fields.
9750 (Script_options::referenced_const_iterator): New type.
9751 (Script_options::referenced_begin): New function.
9752 (Script_options::referenced_end): New function.
9753 (Script_options::is_referenced): New function.
9754 (Script_options::any_unreferenced): New function.
9755 * script-c.h (script_symbol): Declare.
9756 * yyscript.y (exp): Call script_symbol.
9757 * symtab.cc: Include "script.h".
9758 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9759 Change all callers. Check symbols referenced by scripts.
9760 (Symbol_table::add_undefined_symbols_from_command_line): Add
9761 layout parameter. Change all callers.
9762 (Symbol_table::do_add_undefined_symbols_from_command_line):
9763 Likewise. Break out loop body. Check symbols referenced by
9764 scripts.
9765 (Symbol_table::add_undefined_symbol_from_command_line): New
9766 function broken out of
9767 do_add_undefined_symbols_from_command_line.
9768 * symtab.h (class Symbol_table): Update declarations.
9769 * archive.cc: Include "layout.h".
9770 (Archive::should_include_member): Add layout parameter. Change
9771 all callers. Check for symbol mentioned in expression.
9772 * archive.h (class Archive): Update declaration.
9773 * object.cc (Sized_relobj::do_should_include_member): Add layout
9774 parameter.
9775 * object.h (Object::should_include_member): Add layout parameter.
9776 Change all callers.
9777 (Object::do_should_include_member): Add layout parameter.
9778 (class Sized_relobj): Update declaration.
9779 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9780 parameter.
9781 * dynobj.h (class Sized_dynobj): Update declaration.
9782 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9783 layout parameter.
9784 * plugin.h (class Sized_pluginobj): Update declaration.
9785
9786 2010-08-02 Ian Lance Taylor <iant@google.com>
9787
9788 PR 11866
9789 * output.cc (Output_segment::set_offset): Search for the first and
9790 last sections rather than assuming that the list is in order.
9791 (Output_segment::find_first_and_last_list): New function.
9792 * output.h (class Output_segment): Update declarations.
9793 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9794 (relro_strip_test_SOURCES): New variable.
9795 (relro_strip_test_DEPENDENCIES): New variable.
9796 (relro_strip_test_LDFLAGS): New variable.
9797 (relro_strip_test_LDADD): New variable.
9798 (relro_strip_test.so): New target.
9799
9800 2010-08-02 Ian Lance Taylor <iant@google.com>
9801
9802 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9803 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9804 (Target_i386::got_tlsdesc_section): New function.
9805 (Target_i386::got_section): Create space for GOT entries for
9806 TLSDESC relocations.
9807 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9808 R_386_TLS_GOTDESC.
9809 (Target_i386::Scan::global): Likewise.
9810 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9811 using TLSDESC GOT.
9812 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9813 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9814 (Target_x86_64::got_tlsdesc_section): New function.
9815 (Target_x86_64::got_section): Create space for GOT entries for
9816 TLSDESC relocations.
9817 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9818 R_386_TLS_GOTDESC.
9819 (Target_x86_64::Scan::global): Likewise.
9820 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9821 using TLSDESC GOT.
9822
9823 2010-08-02 Ian Lance Taylor <iant@google.com>
9824
9825 * testsuite/final_layout.sh: Use dc to convert from hex to
9826 decimal.
9827
9828 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9829
9830 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9831 paramter to the call to gold::gc_process_relocs.
9832 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9833 paramter to the call to gold::gc_process_relocs.
9834 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9835 parameter to the call to gold::gc_process_relocs.
9836 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9837 template parameter to the call to gold::gc_process_relocs.
9838 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9839 paramter to the call to gold::gc_process_relocs.
9840 * gc.h (get_embedded_addend_size): New function.
9841 (gc_process_relocs): Save the size of the reloc for use by ICF.
9842 * icf.cc (get_section_contents): Get the addend from the text section
9843 for SHT_REL relocation sections.
9844 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9845 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9846 * int_encoding.h (read_from_pointer): New overloaded function.
9847 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9848 * testsuite/icf_sht_rel_addend_test.sh: New file.
9849 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9850 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9851
9852 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9853
9854 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9855 * Makefile.in: Regenerate.
9856 * testsuite/Makefile.in: Regenerate.
9857
9858 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9859
9860 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9861 * gold/testsuite/debug_msg.cc: Likewise.
9862 * gold/testsuite/odr_violation1.cc
9863 * gold/testsuite/odr_violation2.cc
9864
9865 2010-07-21 Cary Coutant <ccoutant@google.com>
9866
9867 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9868 string, and length fields.
9869 (Output_merge_string::Merged_strings_list): New type.
9870 (Output_merge_string::Merged_strings_lists): New typedef.
9871 (Output_merge_string): Replace merged_strings_ with
9872 merged_strings_lists_.
9873 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9874 Merged_strings_list per input object and section. Don't store pointer
9875 to the string. Don't store length with each merged string entry.
9876 (Output_merge_string::finalize_merged_data): Loop over list of merged
9877 strings lists. Recompute length of each merged string.
9878
9879 2010-07-15 Cary Coutant <ccoutant@google.com>
9880
9881 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9882 here.
9883
9884 2010-07-14 Ian Lance Taylor <iant@google.com>
9885
9886 * descriptors.cc (Descriptors::open): Report correct name in error
9887 message.
9888
9889 2010-07-13 Doug Kwan <dougkwan@google.com>
9890
9891 * arm.cc (Arm_input_section::Arm_input_section): For a
9892 SHT_ARM_EXIDX section, always keeps the input sections.
9893 (Arm_input_section::set_exidx_section_link): New method.
9894 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9895 has_errors_ to false.
9896 (Arm_exidx_input_section::has_errors,
9897 Arm_exidx_input_section::set_has_errors): New methods.
9898 (Arm_exidx_input_section::has_errors_): New data member.
9899 (Arm_relobj::get_exidx_shndx_list): New method.
9900 (Arm_output_section::append_text_sections_to_list): Do not skip
9901 section without SHF_EXECINSTR.
9902 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9903 errors.
9904 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9905 section header. Make error messages more verbose. Check for
9906 a non-executable section linked to an EXIDX section.
9907 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9908 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9909 check that there is no deferred EXIDX section if we exit early.
9910 Instead of not making an EXIDX section in case of an error, make one
9911 and set the has_errors flag of it.
9912 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9913 in a relocatable link.
9914 (Target_arm::do_relax): Look for the EXIDX output section instead of
9915 assuming that it is called .ARM.exidx.
9916 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9917 section list. Do not check for SHF_EXECINSTR section flags but
9918 skip any input section with errors.
9919 * output.cc (Output_section::Output_section): Initialize
9920 always_keeps_input_sections_ to false.
9921 (Output_section::add_input_section): Check for
9922 always_keeps_input_sections_.
9923 * output.h (Output_section::always_keeps_input_sections,
9924 Output_section::set_always_keeps_input_sections): New methods.
9925 (Output_section::always_keeps_input_sections): New data member.
9926
9927 2010-07-13 Rafael Espindola <espindola@google.com>
9928
9929 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9930 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9931
9932 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9933 Ian Lance Taylor <iant@google.com>
9934
9935 * output.h (Output_section_lookup_maps::add_merge_section):
9936 Correct check of whether value was inserted.
9937 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9938 (Output_section_lookup_maps::add_relaxed_input_section):
9939 Likewise.
9940 * arm.cc (Target_arm::got_section): Remove used local os.
9941 * i386.cc (Target_i386::got_section): Likewise.
9942 * x86_64.cc (Target_x86_64::got_section): Likewise.
9943 * sparc.cc (Target_sparc::got_section): Likewise.
9944 (Target_sparc::relocate): Remove unused local have_got_offset.
9945 * powerpc.cc (Target_powerpc::relocate): Likewise.
9946
9947 2010-07-13 Ian Lance Taylor <iant@google.com>
9948
9949 * compressed_output.cc (zlib_decompress): Fix signature in
9950 !HAVE_ZLIB_H case.
9951
9952 * archive.cc (Archive::include_member): Unlock an external member
9953 of a thin archive. Don't bother to delete an object we know is
9954 NULL.
9955
9956 2010-07-12 Cary Coutant <ccoutant@google.com>
9957
9958 * compressed_output.cc (zlib_decompress): New function.
9959 (get_uncompressed_size): New function.
9960 (decompress_input_section): New function.
9961 * compressed_output.h (get_uncompressed_size): New function.
9962 (decompress_input_section): New function.
9963 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9964 Handle compressed debug sections.
9965 * layout.cc (is_compressed_debug_section): New function.
9966 (Layout::output_section_name): Map compressed section names to
9967 canonical names.
9968 * layout.h (is_compressed_debug_section): New function.
9969 (is_debug_info_section): Recognize compressed debug sections.
9970 * merge.cc: Include compressed_output.h.
9971 (Output_merge_data::do_add_input_section): Handle compressed
9972 debug sections.
9973 (Output_merge_string::do_add_input_section): Handle compressed
9974 debug sections.
9975 * object.cc: Include compressed_output.h.
9976 (Sized_relobj::Sized_relobj): Initialize new data members.
9977 (build_compressed_section_map): New function.
9978 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9979 * object.h (Object::section_is_compressed): New method.
9980 (Object::do_section_is_compressed): New method.
9981 (Sized_relobj::Compressed_section_map): New type.
9982 (Sized_relobj::do_section_is_compressed): New method.
9983 (Sized_relobj::compressed_sections_): New data member.
9984 * output.cc (Output_section::add_input_section): Handle compressed
9985 debug sections.
9986 * reloc.cc: Include compressed_output.h.
9987 (Sized_relobj::write_sections): Handle compressed debug sections.
9988
9989 2010-07-08 Cary Coutant <ccoutant@google.com>
9990
9991 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9992 weak when resolving to a dynamic def.
9993 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9994 for weak undef/dynamic def cases. Adjust callers.
9995 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9996 undef_binding_weak_.
9997 (Symbol_table::sized_write_globals): Adjust symbol binding.
9998 (Symbol_table::sized_write_symbol): Add binding parameter.
9999 * symtab.h (Symbol::set_undef_binding): New method.
10000 (Symbol::is_undef_binding_weak): New method.
10001 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
10002 (Symbol_table::should_override): Add new parameter.
10003 (Symbol_table::sized_write_symbol): Add new parameter.
10004
10005 * testsuite/weak_undef_file1.cc: Add new test case.
10006 * testsuite/weak_undef_file2.cc: Fix header comment.
10007 * testsuite/weak_undef_test.cc: Add new test case.
10008
10009 2010-06-29 Doug Kwan <dougkwan@google.com>
10010
10011 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
10012 Initialize USE_SYMBOL_.
10013 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
10014 definition.
10015 (Arm_reloc_property::uses_symbol_): New data member declaration.
10016 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
10017 uses symbol value and symbol is undefined but not weakly undefined.
10018
10019 2010-06-28 Rafael Espindola <espindola@google.com>
10020
10021 * plugin.cc (Plugin::load): Use dlerror.
10022
10023 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
10024
10025 * symtab.cc (detect_odr_violations): When reporting an ODR
10026 violation, report an object where the symbol is defined.
10027
10028 2010-06-25 Doug Kwan <dougkwan@google.com>
10029
10030 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
10031 (Target_arm::section_may_have_icf_unsafe_pointers): New method
10032 definition.
10033 (Target_arm::Scan::local_reloc_may_be_function_pointer,
10034 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
10035 target hook to detect function points.
10036 (Target_arm::Scan::possible_function_pointer_reloc): New method.
10037 * icf.h (Icf::check_section_for_function_pointers): Change type of
10038 parameter SECTION_NAME to const reference to std::string. Use
10039 target hook to determine if section may have unsafe pointers.
10040 * target.h (Target::section_may_have_icf_unsafe_pointers): New
10041 method definition.
10042
10043 2010-06-21 Rafael Espindola <espindola@google.com>
10044
10045 * fileread.cc (Input_file::find_fie): New
10046 (Input_file::open): Use Input_file::find_fie.
10047 * fileread.h (Input_file::find_fie): New
10048 * plugin.cc (set_extra_library_path): New.
10049 (Plugin::load): Add set_extra_library_path to the transfer vector.
10050 (Plugin_manager::set_extra_library_path): New.
10051 (Plugin_manager::add_input_file): Use the extra search path if set.
10052 (set_extra_library_path(): New.
10053 * plugin.h (Plugin_manager): Add set_extra_library_path and
10054 extra_search_path_.
10055
10056 2010-06-19 Cary Coutant <ccoutant@google.com>
10057
10058 * layout.cc (gdb_sections): Add .debug_types.
10059 (lines_only_debug_sections): Likewise.
10060
10061 2010-06-18 Rafael Espindola <espindola@google.com>
10062
10063 * plugin.cc (add_input_file,add_input_library)
10064 (Plugin_manager::add_input_file): Make filename arguments const.
10065 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
10066 const.
10067
10068 2010-06-16 Doug Kwan <dougkwan@google.com>
10069
10070 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
10071 .ARM.attributes section if we have not merged any input
10072 attributes sections.
10073
10074 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10075
10076 * arm.cc: Allow combining objects with no EABI version
10077 information.
10078
10079 2010-06-15 Rafael Espindola <espindola@google.com>
10080
10081 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
10082
10083 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10084
10085 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
10086 (struct iovec): Correct !HAVE_READV definition.
10087
10088 2010-06-10 Cary Coutant <ccoutant@google.com>
10089
10090 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
10091 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
10092 reloc sections.
10093 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
10094
10095 PR 11683
10096 * symtab.h (Symbol::is_placeholder): New member function.
10097 * target-reloc.h (relocate_section): Check for placeholder symbols.
10098
10099 * testsuite/Makefile.am (plugin_test_8): New test.
10100 (plugin_test_9): New test.
10101 * testsuite/Makefile.in: Regenerate.
10102
10103 2010-06-09 Nick Clifton <nickc@redhat.com>
10104
10105 * yyscript.y (input_list_element): Allow strings prefixed with
10106 the '-' character. Treat these as libraries.
10107 * script.cc (script_add_library): New function. Adds a library
10108 specified by "-l<name>" found in an input script.
10109 * script-c.h: Add prototype for script_add_library.
10110
10111 2010-06-07 Doug Kwan <dougkwan@google.com>
10112
10113 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10114 Restrict stub-group size to be within long conditional branch
10115 range when working around cortex-A8 erratum.
10116
10117 2010-06-07 Damien Diederen <dd@crosstwine.com>
10118
10119 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10120 #ifdef typo.
10121
10122 2010-06-03 Sriraman Tallam <tmsriram@google.com>
10123
10124 PR gold/11658
10125 * output.cc
10126 (Output_section::Input_section_sort_entry::compare_section_ordering):
10127 Change to return non-zero correctly.
10128 (Output_section::Input_section_sort_section_order_index_compare
10129 ::operator()): Change to fix ambiguity in comparisons.
10130
10131 2010-06-01 Sriraman Tallam <tmsriram@google.com>
10132
10133 * gold.h (is_wildcard_string): New function.
10134 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10135 (Layout::layout_eh_frame): Ditto.
10136 (Layout::find_section_order_index): New method.
10137 (Layout::read_layout_from_file): New method.
10138 * layout.h (Layout::find_section_order_index): New method.
10139 (Layout::read_layout_from_file): New method.
10140 (Layout::input_section_position_): New private member.
10141 (Layout::input_section_glob_): New private member.
10142 * main.cc (main): Call read_layout_from_file here.
10143 * options.h (--section-ordering-file): New option.
10144 * output.cc (Output_section::input_section_order_specified_): New
10145 member.
10146 (Output_section::Output_section): Initialize new member.
10147 (Output_section::add_input_section): Add new parameter.
10148 Keep input sections when --section-ordering-file is used.
10149 (Output_section::set_final_data_size): Sort input sections when
10150 section ordering file is specified.
10151 (Output_section::Input_section_sort_entry): Add new parameter.
10152 Check sorting type.
10153 (Output_section::Input_section_sort_entry::compare_section_ordering):
10154 New method.
10155 (Output_section::Input_section_sort_compare::operator()): Change to
10156 consider section_order_index.
10157 (Output_section::Input_section_sort_init_fini_compare::operator()):
10158 Change to consider section_order_index.
10159 (Output_section::Input_section_sort_section_order_index_compare
10160 ::operator()): New method.
10161 (Output_section::sort_attached_input_sections): Change to sort
10162 according to section order when specified.
10163 (Output_section::add_input_section<32, true>): Add new parameter.
10164 (Output_section::add_input_section<64, true>): Add new parameter.
10165 (Output_section::add_input_section<32, false>): Add new parameter.
10166 (Output_section::add_input_section<64, false>): Add new parameter.
10167 * output.h (Output_section::add_input_section): Add new parameter.
10168 (Output_section::input_section_order_specified): New
10169 method.
10170 (Output_section::set_input_section_order_specified): New method.
10171 (Input_section::Input_section): Initialize section_order_index_.
10172 (Input_section::section_order_index): New method.
10173 (Input_section::set_section_order_index): New method.
10174 (Input_section::section_order_index_): New member.
10175 (Input_section::Input_section_sort_section_order_index_compare): New
10176 struct.
10177 (Output_section::input_section_order_specified_): New member.
10178 * script-sections.cc (is_wildcard_string): Delete and move modified
10179 method to gold.h.
10180 (Output_section_element_input::Output_section_element_input): Modify
10181 call to is_wildcard_string.
10182 (Output_section_element_input::Input_section_pattern
10183 ::Input_section_pattern): Ditto.
10184 (Output_section_element_input::Output_section_element_input): Ditto.
10185 * testsuite/Makefile.am (final_layout): New test case.
10186 * testsuite/Makefile.in: Regenerate.
10187 * testsuite/final_layout.cc: New file.
10188 * testsuite/final_layout.sh: New file.
10189
10190 2010-06-01 Rafael Espindola <espindola@google.com>
10191
10192 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10193
10194 2010-06-01 Rafael Espindola <espindola@google.com>
10195
10196 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10197 visibility of symbols.
10198
10199 2010-05-27 Doug Kwan <dougkwan@google.com>
10200
10201 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10202 from start of output section instead of address for a local symbol
10203 in a merged or relaxed section when doing a relocatable link.
10204
10205 2010-05-26 Rafael Espindola <espindola@google.com>
10206
10207 PR 11604
10208 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10209 adding sections the garbage collector removed.
10210 * gold/testsuite/Makefile.am: Add test.
10211 * gold/testsuite/Makefile.in: Regenerate.
10212 * gold/testsuite/plugin_test_7.sh: New.
10213 * gold/testsuite/plugin_test_7_1.c: New.
10214 * gold/testsuite/plugin_test_7_2.c: New.
10215
10216 2010-05-26 Rafael Espindola <espindola@google.com>
10217
10218 * script-sections.cc (Output_section_definition::set_section_addresses):
10219 Check for --section-start.
10220
10221 2010-05-26 Doug Kwan <dougkwan@google.com>
10222
10223 * arm.cc (Arm_scan_relocatable_relocs): New class.
10224 (Target_arm::relocate_special_relocatable): New method.
10225 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10226 (Arm_relocate_functions::thumb_branch_common): Same.
10227 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10228 instead of Default_scan_relocatable_relocs.
10229 * target-reloc.h (relocate_for_relocatable): Let target handle
10230 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10231 * target.h (Sized_target::relocate_special_relocatable): New method.
10232
10233 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10234
10235 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10236
10237 2010-05-23 Doug Kwan <dougkwan@google.com>
10238
10239 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10240 instead of a cast.
10241 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10242 with a direct branch, not a conditional branch, to a stub.
10243 * merge.cc (Output_merge_base::record_input_section): New method
10244 defintion.
10245 (Output_merge_data::do_add_input_section): Record input section if
10246 keeps-input-sections flag is set.
10247 (Output_merge_string::do_add_input_section): Ditto.
10248 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10249 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10250 INPUT_SECTIONS_.
10251 (Output_merge_base::keeps_input_sections,
10252 Output_merge_base::set_keeps_input_sections,
10253 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10254 method definitions.
10255 (Output_merge_base::Input_sections): New type declaration.
10256 (Output_merge_base::input_sections_begin,
10257 Output_merge_base::input_sections_end,
10258 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10259 (Output_merge_base::bool keeps_input_sections_,
10260 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10261 Output_merge_base::input_sections_): New data members.
10262 (Output_merge_data::do_set_keeps_input_sections): New method
10263 defintion.
10264 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10265 * output.cc (Output_section::Input_section::relobj): Move method
10266 defintion from class declaration to here and handle merge sections.
10267 (Output_section::Input_section::shndx): Ditto.
10268 (Output_section::Output_section): Remove initializations of removed
10269 data members and initialize new data member LOOKUP_MAPS_.
10270 (Output_section::add_input_section): Set keeps-input-sections flag
10271 for a newly created merge output section as appropriate. Adjust code
10272 to use Output_section_lookup_maps class.
10273 (Output_section::add_relaxed_input_section): Adjst code for lookup
10274 maps code refactoring.
10275 (Output_section::add_merge_input_section): Add a new parameter
10276 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10277 class. If adding input section to a newly created merge output
10278 section fails, remove the new merge section.
10279 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
10280 Adjust code for use of the Output_section_lookup_maps class.
10281 (Output_section::find_merge_section): Ditto.
10282 (Output_section::build_lookup_maps): New method defintion.
10283 (Output_section::find_relaxed_input_section): Adjust code to use
10284 Output_section_lookup_maps class.
10285 (Output_section::get_input_sections): Export merge sections. Adjust
10286 code to use Output_section_lookup_maps class.
10287 (Output_section:::add_script_input_section): Adjust code to use
10288 Output_section_lookup_maps class. Update lookup maps for merge
10289 sections also.
10290 (Output_section::discard_states): Use Output_section_lookup_maps.
10291 (Output_section::restore_states): Same.
10292 * output.h (Merge_section_properties): Move class defintion out of
10293 Output_section.
10294 (Output_section_lookup_maps): New class.
10295 (Output_section::Input_section::is_merge_section): New method
10296 defintion.
10297 (Output_section::Input_section::relobj): Move defintion out of class
10298 defintion. Declare method only.
10299 (Output_section::Input_section::shndx): Ditto.
10300 (Output_section::Input_section::output_merge_base): New method defintion.
10301 (Output_section::Input_section::u2_.pomb): New union field.
10302 (Output_section::Merge_section_by_properties_map,
10303 Output_section::Output_section_data_by_input_section_map,
10304 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10305 Remove types.
10306 (Output_section::add_merge_input_section): Add new parameter
10307 KEEPS_INPUT_SECTIONS.
10308 (Output_section::build_lookup_maps): New method declaration.
10309 (Output_section::merge_section_map_,
10310 Output_section::merge_section_by_properties_map_,
10311 Output_section::relaxed_input_section_map_,
10312 Output_section::is_relaxed_input_section_map_valid_): Remove data
10313 members.
10314 (Output_section::lookup_maps_): New data member.
10315
10316 2010-05-21 Doug Kwan <dougkwan@google.com>
10317
10318 PR gold/11619
10319 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10320 avoid a compilation error.
10321
10322 2010-05-19 Rafael Espindola <espindola@google.com>
10323
10324 * script-sections.cc (Output_section_definition::allocate_to_segment):
10325 Update the phdrs_list even when the output section is NULL.
10326 * testsuite/Makefile.am: Add test.
10327 * testsuite/Makefile.in: Regenerate.
10328 * testsuite/script_test_9.cc: New.
10329 * testsuite/script_test_9.sh: New.
10330 * testsuite/script_test_9.t: New.
10331
10332 2010-05-19 Doug Kwan <dougkwan@google.com>
10333
10334 * arm.cc (Arm_input_section::original_size): New method.
10335 (Arm_input_section::do_addralign): Add a cast.
10336 (Arm_input_section::do_output_offset): Remove static cast.
10337 (Arm_input_section::original_addralign,
10338 Arm_input_section::original_size_): Change type to uint32_t.
10339 (Arm_input_section::init): Add safe casts for section alignment
10340 and size.
10341 (Arm_input_section::set_final_data_size): Do not set address and
10342 offset of stub table.
10343 (Arm_output_section::fix_exidx_coverage): Change use of of
10344 Output_section::Simple_input_section to that of
10345 Output_section::Input_section.
10346 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10347 except for the first pass.
10348 * output.cc (Output_section::get_input_sections): Change type of
10349 input_sections to std::list<Input_section>.
10350 (Output_section::add_script_input_section): Rename from
10351 Output_section::add_simple_input_section. Change type of SIS
10352 parameter from Simple_input_section to Input_section.
10353 * output.h (Output_section::Simple_input_section): Remove class.
10354 (Output_section::Input_section): Change class visibility to public.
10355 (Output_section::Input_section::addralign): Use stored alignments
10356 for special input sections if set.
10357 (Output_section::Input_section::set_addralign): New method.
10358 (Output_section::get_input_sections): Change parameter type from
10359 list of Simple_input_section to list of Input_section.
10360 (Output_section::add_script_input_section): Rename from
10361 Output_section::add_simple_input_section. Change first parameter's
10362 type from Simple_input_section to Input_section and remove the
10363 second and third parameters.
10364 * script-sections.cc (Input_section::Input_section_list): Change
10365 type to list of Output_section::Input_section/
10366 (Input_section_info::Input_section_info): Change parameter type of
10367 INPUT_SECTION to Output_section::Input_section.
10368 (Input_section_info::input_section): Change return type.
10369 (Input_section_info::input_section_): Change type to
10370 Output_section::Input_section.
10371 (Output_section_element_input::set_section_addresses): Adjust code
10372 to use Output_section::Input_section instead of
10373 Output_section::Simple_input_section. Adjust code for renaming
10374 of Output_section::add_simple_input_section.
10375 (Orphan_output_section::set_section_addresses): Ditto.
10376
10377 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10378
10379 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10380 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10381
10382 2010-05-18 Rafael Espindola <espindola@google.com>
10383
10384 * options.cc (General_options::finalize): Handle -nostdlib.
10385 * options.h (nostdlib): New option.
10386 * script.cc (script_add_search_dir): Handle -nostdlib.
10387
10388 2010-05-12 Doug Kwan <dougkwan@google.com>
10389
10390 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10391 attributes section only if there no attributes section after merging.
10392 (Target_arm::merge_object_attributes): Move value of
10393 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10394 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10395 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10396 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10397 and arm_attr_merge_7.stdout.
10398 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10399 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10400 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10401 arm_attr_merge_7b.o): New rules.
10402 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10403 arm_attr_merge_7
10404 * testsuite/Makefile.in: Regenerate.
10405 * testsuite/arm_attr_merge.sh: New file.
10406 * testsuite/arm_attr_merge_[67][ab].s: Same.
10407
10408 2010-05-05 Nick Clifton <nickc@redhat.com>
10409
10410 * po/es.po: Updated Spanish translation.
10411
10412 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10413
10414 * Makefile.am (install-exec-local): Properly install gold as
10415 default cross linker.
10416 * Makefile.in: Regenerated.
10417
10418 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10419 Nick Clifton <nickc@redhat.com>
10420
10421 * configure.ac (install_as_default): Define and set to false
10422 unless --enable-gold or --enable-gold=both/gold has been
10423 specified.
10424 * configure: Regenerate.
10425
10426 * Makefile.am (install-exec-local): Install the executable as
10427 'ld.gold'. If install_as_default is true then also install it as
10428 'ld'.
10429 * Makefile.in: Regenerated.
10430
10431 2010-04-24 Ian Lance Taylor <iant@google.com>
10432
10433 * layout.cc (Layout::layout_reloc): In relocatable link don't
10434 combine reloc sections for grouped sections.
10435
10436 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10437
10438 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10439 sections that are not ordinary to icf.
10440 * icf.cc (get_section_contents): Handle relocation pointing to section
10441 with no object or shndx information.
10442 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10443 * testsuite/Makefile.in: Regenerate.
10444 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10445 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10446
10447 2010-04-22 Ian Lance Taylor <iant@google.com>
10448
10449 * expression.cc (Expression::Expression_eval_info): Add
10450 result_alignment_pointer field.
10451 (Expression::eval_with_dot): Add result_alignment_pointer
10452 parameter. Change all callers.
10453 (Expression::eval_maybe_dot): Likewise.
10454 (class Binary_expression): Add alignment_pointer parameter to
10455 left_value and right_value. Change all callers.
10456 (BINARY_EXPRESSION): Set result alignment.
10457 (class Trinary_expression): Add alignment_pointer parameter to
10458 arg2_value and arg3_value. Change all callers.
10459 (Trinary_cond::value): Set result alignment.
10460 (Max_expression::value, Min_expression::value): Likewise.
10461 (Align_expression::value): Likewise.
10462 * script-sections.cc (class Sections_element): Add dot_alignment
10463 parameter to set_section_addresses virtual function. Update
10464 instantiations.
10465 (class Output_section_element): Likewise.
10466 (Script_sections::create_segments): Add dot_alignment parameter.
10467 Change all callers.
10468 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10469 (Script_sections::set_phdrs_clause_addresses): Likewise.
10470 * script-sections.h: Update declarations.
10471 * script.h: Update declarations.
10472 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10473 min_p_align.
10474 * testsuite/script_test_3.t: Set large alignment.
10475 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10476 segment has expected alignment.
10477
10478 2010-04-22 Nick Clifton <nickc@redhat.com>
10479
10480 * po/gold.pot: Updated by the Translation project.
10481 * po/vi.po: Updated Vietnamese translation.
10482
10483 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10484
10485 * testsuite/Makefile.am (check_PROGRAMS): Add
10486 icf_virtual_function_folding_test.
10487 * testsuite/Makefile.in: Regenerated.
10488
10489 2010-04-15 Andrew Haley <aph@redhat.com>
10490
10491 * options.h (merge_exidx_entries): New option.
10492 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10493 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10494 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10495 (Target_arm::merge_exidx_entries): New function.
10496 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10497 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10498 to Arm_exidx_fixup constructor.
10499 Add new arg, merge_exidx_entries.
10500 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10501 Arm_output_section::fix_exidx_coverage.
10502
10503 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10504
10505 * icf.cc (get_section_contents): Check for preemptible functions.
10506 Ignore addend when appropriate.
10507 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10508 section folded.
10509 (add_from_relobj): Check for section folded.
10510 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10511 * symtab.h (should_add_dynsym_entry): Add new parameter.
10512 * target-reloc.h (scan_relocs): Check for section folded.
10513 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10514 Check reloc types for function pointers in shared objects.
10515 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10516 case.
10517 (icf_preemptible_functions_test): New test case.
10518 (icf_string_merge_test): New test case.
10519 * testsuite.Makefile.in: Regenerate.
10520 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10521 bar_glob. Refactor code.
10522 * testsuite/icf_preemptible_functions_test.cc: New file.
10523 * testsuite/icf_preemptible_functions_test.sh: New file.
10524 * testsuite/icf_string_merge_test.cc: New file.
10525 * testsuite/icf_string_merge_test.sh: New file.
10526 * testsuite/icf_virtual_function_folding_test.cc: New file.
10527 * testsuite/icf_virtual_function_folding_test.sh: New file.
10528
10529 2010-04-14 Doug Kwan <dougkwan@google.com>
10530
10531 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10532 for local symbol recounting if we remove a section due to ICF.
10533 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10534 there are no regular objects in input.
10535
10536 2010-04-13 Doug Kwan <dougkwan@google.com>
10537
10538 * arm.cc (Arm_input_section::set_final_data_size): Compute
10539 accurate final data size instead of using current data size.
10540
10541 2010-04-09 Doug Kwan <dougkwan@google.com>
10542
10543 * layout.cc (Layout::choose_output_section): Handle script section
10544 types.
10545 (Layout::make_output_section_for_script): Add section type parameter.
10546 Handle script section types.
10547 * layout.h (Layout::make_output_section_for_script): Add section
10548 type parameter.
10549 * output.cc (Output_section::Output_section): Initialize data member
10550 is_noload_.
10551 (Output_section::do_reset_address_and_file_offset): Do not set address
10552 to 0 if section is a NOLOAD section.
10553 * output.h (Output_section::is_noload): New method.
10554 (Output_section::set_is_noload): Ditto.
10555 (Output_section::is_noload_): New data member.
10556 * script-c.h (Script_section_type): New enum type.
10557 (struct Parser_output_section_header): Add new file section_type.
10558 * script-sections.cc (Sections_element::output_section_name): Add
10559 parameter for returning script section type.
10560 (Output_section_definition::output_section_name): Ditto.
10561 (Output_section_definition::section_type)P; New method.
10562 (Output_section_definiton::script_section_type_name): Ditto.
10563 (Output_section_definition::script_section_type_): New data member.
10564 (Output_section_definition::Output_section_definition): Initialize
10565 data member Output_section_definition::script_section_type_.
10566 (Output_section_definition::create_sections): Pass script section type
10567 to Layout::make_output_section_for_script.
10568 (Output_section_definition::output_section_name): Return script
10569 section type to caller.
10570 (Output_section_definition::set_section_address): Do not advance
10571 dot value and load address if section type is NOLOAD. Set address
10572 of NOLOAD sections regardless of section flags.
10573 (Output_section_definition::print): Print section type if it is
10574 not SCRIPT_SECTION_TYPE_NONE.
10575 (Output_section_definition::section_type): New method.
10576 (Output_section_definition::script_section_type_name): Ditto.
10577 (Script_sections::output_section_name): Add new parameter
10578 PSECTION_TYPE for returning script section type. Pass it to
10579 section elements. Handle discard sections.
10580 (Sort_output_sections::operator()): Handle NOLOAD sections.
10581 * script-sections.h (Script_sections::Section_type): New enum type.
10582 (Script_sections::output_section_name): Add a new parameter for
10583 returning script section type.
10584 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10585 INFO and NOLOAD.
10586 * yyscript.y (union): Add new field SECTION_TYPE.
10587 (COPY, DSECT, INFO, NOLOAD): New tokens.
10588 (opt_address_and_section_type): Change type to output_section_header.
10589 (section_type): New non-terminal
10590 (section_header): Handle section type.
10591 (opt_address_and_section_type): Return section type value.
10592
10593 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10594
10595 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10596 * testsuite/plugin_common_test_2.c (foo): Likewise.
10597
10598 2010-04-08 Doug Kwan <dougkwan@google.com>
10599
10600 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10601 Output_merge_data.
10602 * output.cc (Output_section::add_merge_input_section): Simplify
10603 code and return status of Output_merge_base::add_input_section.
10604 Update merge section map only if Output_merge_base::add_input_section
10605 returns true.
10606
10607 2010-04-07 Doug Kwan <dougkwan@google.com>
10608
10609 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10610 if section is marked as containing instructions but has no mapping
10611 symbols.
10612 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10613 correct section index.
10614 (Arm_relobj::find_linked_text_section): Ditto.
10615
10616 2010-04-07 Cary Coutant <ccoutant@google.com>
10617
10618 * archive.cc (include_member): Destroy Read_symbols_data object before
10619 releasing file.
10620 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10621 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10622 (Read_symbols_data::~Read_symbols_data) New destructor.
10623 (Section_relocs::Section_relocs) New constructor.
10624 (Section_relocs::~Section_relocs) New destructor.
10625 (Read_relocs_data::Read_relocs_data) New constructor.
10626 (Read_relocs_data::~Read_relocs_data) New destructor.
10627 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10628 pointers to NULL after deleting.
10629
10630 2010-04-07 Doug Kwan <dougkwan@google.com>
10631
10632 * arm.cc: Replace "endianity" with "endianness" in comments.
10633 (Arm_exidx_cantunwind): Ditto.
10634 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10635 (Arm_relobj::merge_flags_and_attributes): New method.
10636 (Arm_relobj::merge_flags_and_attributes_): New data member.
10637 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10638 (Arm_relobj::scan_sections_for_stubs): Ditto.
10639 (Arm_relobj::do_read_symbols): Check to see if we really want to
10640 merge processor-specific flags and attributes. Exit early if
10641 an object is empty except for section names and the undefined symbol.
10642 (Target_arm::do_finalize_sections): Move check for ELF format to
10643 Arm_relobj::do_read_symbols. Merge processor specific flags and
10644 attributes from a regular object only when we have determined that
10645 it is aapropriate. Do not create an .ARM.attributes section in
10646 output if there is no regular input object.
10647 (Target_arm::merge_processor_specific_flags): Check
10648 --warn-mismatch before printing any error.
10649 (Target_arm::merge_object_attributes): Ditto.
10650 * gold.cc (queue_middle_tasks): Handle the case in which there is
10651 no regular object in input.
10652 * options.cc (General_options::parse_EB): New method.
10653 (General_options::parse_EL): Same.
10654 (General_options::General_options): Initialize endianness_.
10655 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10656 New options.
10657 (General_options::Endianness): New enum.
10658 (General_options::endianness): New method.
10659 (General_options::endianness_): New data member.
10660 * parameters.cc (Parameters::set_options): Check target endianness.
10661 (Parameters::set_target_once): Ditto.
10662 (Parameters::check_target_endianness): New method.
10663 (parameters_force_valid_target): If either -EL or -EB is specified,
10664 use it to define endianness of default target.
10665 * parameters.h (Parameters::check_target_endianness): New method
10666 declaration.
10667 * target.h (class Target): Change "endianity" to "endianness"
10668 in comments.
10669
10670 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10671
10672 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10673 * configure: Regenerate.
10674 * Makefile.in: Regenerate.
10675 * testsuite/Makefile.in: Regenerate.
10676
10677 2010-04-06 Cary Coutant <ccoutant@google.com>
10678
10679 gcc PR lto/42757
10680 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10681 prevailing definitions of common symbols.
10682 * testsuite/plugin_test_6.sh: New test case.
10683 * testsuite/plugin_common_test_1.c: New test case.
10684 * testsuite/plugin_common_test_2.c: New test case.
10685 * testsuite/Makefile.am (plugin_test_6): New test case.
10686 * testsuite/Makefile.in: Regenerate.
10687
10688 2010-04-06 Nick Clifton <nickc@redhat.com>
10689
10690 * po/vi.po: New Vietnamese translation.
10691
10692 2010-03-30 Doug Kwan <dougkwan@google.com>
10693
10694 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10695
10696 2010-03-25 Doug Kwan <dougkwan@google.com>
10697
10698 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10699 to avoid a conversion warning on a 32-bit host.
10700
10701 2010-03-24 Ian Lance Taylor <iant@google.com>
10702
10703 * testsuite/script_test_3.t: Add a TLS segment.
10704 * testsuite/Makefile.am (check_PROGRAMS): Add
10705 tls_phdrs_script_test.
10706 (tls_phdrs_script_test_SOURCES): Define.
10707 (tls_phdrs_script_test_DEPENDENCIES): Define.
10708 (tls_phdrs_script_test_LDFLAGS): Define.
10709 (tls_phdrs_script_test_LDADD): Define.
10710 * testsuite/Makefile.in: Rebuild.
10711
10712 2010-03-23 Cary Coutant <ccoutant@google.com>
10713
10714 * fileread.cc (find_or_make_view): Fix comment.
10715
10716 2010-03-23 Ian Lance Taylor <iant@google.com>
10717
10718 * script-sections.cc (class Orphan_section_placement): Define
10719 PLACE_TLS and PLACE_TLS_BSS.
10720 (Orphan_section_placement::Orphan_section_placement): Initialize
10721 new places.
10722 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10723 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10724 (tls_script_test_SOURCES): Define.
10725 (tls_script_test_DEPENDENCIES): Define.
10726 (tls_script_test_LDFLAGS): Define.
10727 (tls_script_test_LDADD): Define.
10728 * testsuite/Makefile.in: Rebuild.
10729
10730 2010-03-22 Doug Kwan <dougkwan@google.com>
10731
10732 * arm.cc (Arm_relocate_functions::abs8,
10733 Arm_relocate_functions::abs16): Use correct check for overflow
10734 specified in the ARM ELF specs.
10735 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10736 target of a BLX instruction specially.
10737 (Reloc_stub::stub_type_for_reloc): Ditto.
10738 (Relocate::relocate): Use symbolic names instead of numeric relocation
10739 codes to report error.
10740 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10741 workaround.
10742 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10743 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10744 thumb2_blx_out_of_range.stdout
10745 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10746 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10747 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10748 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10749 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10750 thumb2_blx_in_range, thumb2_blx_in_range.o,
10751 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10752 thumb2_blx_out_of_range.o): New rules.
10753 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10754 thumb2_blx_in_range and thumb2_blx_out_of_range.
10755 * testsuite/Makefile.in: Regenerate.
10756 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10757 * testsuite/thumb_blx_in_range.s: New file.
10758 * testsuite/thumb_blx_out_of_range.s: New file.
10759
10760 2010-03-22 Rafael Espindola <espindola@google.com>
10761
10762 * archive.cc (Should_include): Move to archive.h.
10763 (should_include_member): Make it a member of Archive.
10764 (Lib_group): New.
10765 (Add_lib_group_symbols): New.
10766 * archive.h: Include options.h.
10767 (Archive_member): Moved from Archive.
10768 (Should_include): Moved from archive.cc.
10769 (Lib_group): New.
10770 (Add_lib_group_symbols): New.
10771 * dynobj.cc (do_should_include_member): New.
10772 * dynobj.h (do_should_include_member): New.
10773 * gold.cc (queue_initial_tasks): Update call to queue.
10774 * main.cc (main): Print lib group stats.
10775 * object.cc (do_should_include_member): New.
10776 * object.h: Include archive.h.
10777 (Object::should_include_member): New.
10778 (Object::do_should_include_member): New.
10779 (Sized_relobj::do_should_include_member): New.
10780 * options.cc (General_options::parse_start_lib): New.
10781 (General_options::parse_end_lib): New.
10782 (Input_arguments::add_file): Handle lib groups.
10783 (Input_arguments::start_group): Check we are not in a lib.
10784 (Input_arguments::start_lib): New.
10785 (Input_arguments::end_lib): New.
10786 * options.h (General_options): Add start_lib and end_lib.
10787 (Input_argument::lib_): New.
10788 (Input_argument::lib): New.
10789 (Input_argument::is_lib): New.
10790 (Input_file_lib): New.
10791 (Input_arguments::in_lib_): New.
10792 (Input_arguments::in_lib): New.
10793 (Input_arguments::start_lib): New.
10794 (Input_arguments::end_lib_): New.
10795 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10796 in unused members as preempted.
10797 (Sized_pluginobj::do_should_include_member): New.
10798 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10799 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10800 return the blocker.
10801 (Read_symbols::do_whole_lib_group): New.
10802 (Read_symbols::do_lib_group): New.
10803 (Read_symbols::do_read_symbols): Handle lib groups.
10804 (Read_symbols::get_name): Handle lib groups.
10805 * readsyms.h (Read_symbols): Add an archive member pointer.
10806 (Read_symbols::do_whole_lib_group): New.
10807 (Read_symbols::do_lib_group): New.
10808 (Read_symbols::member_): New.
10809 * script.cc (read_input_script): Update call to queue_soon.
10810
10811 2010-03-19 Doug Kwan <dougkwan@google.com>
10812
10813 * arm.cc (Stub_table::Stub_table): Initialize new data members
10814 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10815 (Stub_table::add_reloc_stub): Assign stub offset and update
10816 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10817 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10818 New data members.
10819 (Stub_table::update_data_size_and_addralign): Use
10820 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10821 instead of going over all reloc stubs.
10822 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10823 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10824 Stringpool_template::offset_ to size of Stringpool_char.
10825 (Stringpool_template::new_key_offset): Remove code to initialize
10826 Stringpool_template::offset_.
10827 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10828 Stringpool_template::offset_ to zero.
10829
10830 2010-03-15 Doug Kwan <dougkwan@google.com>
10831
10832 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10833 offset_.
10834 (Stringpool_template::new_key_offset): New method.
10835 (Stringpool_template::add_string): Assign offsets when adding new
10836 strings.
10837 (Stringpool_template::set_string_offsets): Do not set string offsets
10838 when not optimizing.
10839 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10840 member size_.
10841 (Chunked_vector::clear): Clear size_.
10842 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10843 (Chunked_vector::size): Return size_.
10844 (Chunked_vector::push_back): Use size_ to find insert position.
10845 (Chunked_vector::size_): New data member.
10846 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10847 (Stringpool_template::new_key_offset): New method declaration.
10848 (Stringpool_template::offset_): New data member.
10849
10850 2010-03-15 Rafael Espindola <espindola@google.com>
10851
10852 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10853 Add_symbols' constructor.
10854 * readsyms.h (Add_symbols): Remove the input_group member.
10855
10856 2010-03-10 Ian Lance Taylor <iant@google.com>
10857
10858 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10859 target to ask whether a reference to a symbol requires a stack
10860 split.
10861 * target.h (Target::is_call_to_non_split): New function.
10862 (Target::do_is_call_to_non_split): Declare virtual function.
10863 * target.cc: Include "symtab.h".
10864 (Target::do_is_call_to_non_split): New function.
10865 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10866
10867 2010-03-10 Cary Coutant <ccoutant@google.com>
10868
10869 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10870 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10871 (File_read::open[2]): Add whole_file_view_ to list of views.
10872 (File_read::make_view): Remove test of whole_file_view_.
10873 (File_read::find_or_make_view): Create whole_file_view_ if
10874 necessary.
10875 (File_read::clear_views): Replace bool parameter with enum;
10876 adjust all callers. Don't delete views with permanent data;
10877 do delete cached views and views from archives if
10878 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10879 if clearing the corresponding view.
10880 * fileread.h (File_read::Clear_views_mode): New enum.
10881 (File_read::View::is_permanent_view): New method.
10882 (File_read::clear_views): Replace bool parameter
10883 with enum; adjust all callers.
10884 * options.h (General_options): Change keep_files_mapped option;
10885 add map_whole_files.
10886 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10887 releasing the file.
10888 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10889 the file.
10890
10891 2010-03-10 David S. Miller <davem@davemloft.net>
10892
10893 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10894
10895 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10896
10897 * icf.cc (get_section_contents): Add '@' marker after processing the
10898 merge reloc.
10899
10900 2010-03-08 Doug Kwan <dougkwan@google.com>
10901
10902 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10903 due to a conversion warning.
10904 (Arm_relobj::update_output_local_symbol_count): Check for local
10905 symbol with unset output index.
10906
10907 2010-03-05 Ian Lance Taylor <iant@google.com>
10908
10909 * options.h (class General_options): Add --spare-dynamic-tags.
10910 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10911 --spare-dynamic-tags.
10912
10913 2010-03-05 Ian Lance Taylor <iant@google.com>
10914
10915 * incremental.cc: Include "libiberty.h".
10916
10917 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10918
10919 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10920 function, is_info_ member.
10921 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10922 (Versions::Versions): Update caller.
10923 (Versions::define_base_version): Likewise.
10924 (Versions::add_def): Likewise.
10925
10926 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10927
10928 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10929 (Scan::possible_function_pointer_reloc): New function.
10930 (Scan::local_reloc_may_be_function_pointer): Change to call
10931 possible_function_pointer_reloc.
10932 (Scan::global_reloc_may_be_function_pointer): Ditto.
10933 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10934 relocations in ".data.rel.ro._ZTV" section.
10935 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10936 * testsuite/icf_safe_so_test.cc: Ditto.
10937 * testsuite/icf_safe_test.cc: Ditto.
10938 * testsuite/icf_safe_test.sh: Ditto.
10939
10940 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10941 Ian Lance Taylor <iant@google.com>
10942
10943 * target-reloc.h (relocate_section): Check the symbol table index
10944 for -1U before setting the local symbol index.
10945 (scan_relocatable_relocs): If copying the relocation, record that
10946 the local symbol is required.
10947 * object.h (Symbol_value::is_output_symtab_index_set): New
10948 function.
10949 (Symbol_value::may_be_discarded_from_output_symtab): New
10950 function.
10951 (Symbol_value::has_output_symtab_entry): New function.
10952 (Symbol_value::needs_output_symtab_entry): Remove.
10953 (Symbol_value::output_symtab_index): Make sure the symbol index is
10954 set.
10955 (Symbol_value::set_output_symtab_index): Make sure the symbol
10956 index is not set. Make sure the new index is valid.
10957 (Symbol_value::set_must_have_output_symtab_entry): New function.
10958 (Symbol_value::has_output_dynsym_entry): New function.
10959 (Symbol_value::set_output_dynsym_index): Make sure the new index
10960 is valid.
10961 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10962 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10963 local symbol if permitted.
10964 (Sized_relobj::do_finalize_local_symbols): Call
10965 is_output_symtab_index_set rather than needs_output_symtab_entry.
10966 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10967 rather than needs_output_symtab_entry. Call
10968 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10969 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10970 is_output_symtab_index_set rather than needs_output_symtab_entry.
10971 * testsuite/discard_locals_relocatable_test.c: New file.
10972 * testsuite/discard_locals_test.sh: Test -r.
10973 * testsuite/Makefile.am (check_DATA): Add
10974 discard_locals_relocatable_test1.syms,
10975 discard_local_relocatable_test2.syms.
10976 (MOSTLYCLEANFILES): Likewise. Also add
10977 discard_locals_relocatable_test1.lout and
10978 discard_locals_relocatable_test2.out.
10979 (discard_locals_relocatable_test1.syms): New target.
10980 (discard_locals_relocatable_test.o): New target.
10981 (discard_locals_relocatable_test1.out): New target.
10982 (discard_locals_relocatable_test2.syms): New target.
10983 (discard_locals_relocatable_test2.out): New target.
10984 (various): Add missing ../ld-new dependencies.
10985 * testsuite/Makefile.in: Rebuild.
10986
10987 2010-03-03 Nick Clifton <nickc@redhat.com>
10988
10989 * po/fi.po: New Finnish translation.
10990
10991 2010-03-01 Doug Kwan <dougkwan@google.com>
10992
10993 * layout.cc (Layout::Layout): Force section types of .init_array*,
10994 .preinit_array* and .fini_array* sections.
10995 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10996 Fix check of return value of std::string::find.().
10997 (Output_section::Input_section_sort_compare::operator()): Remove
10998 comment about .init_array.
10999 (Output_section::Input_section_sort_init_fini_compare::operator()):
11000 New method.
11001 (Output_section::sort_attached_input_sections): Handle .init_array
11002 and .fini_array specially.
11003 * output.h (Output_section::Inut_section_sort_compare): Update
11004 comment.
11005 (Output_section::Input_section_sort_init_fini_compare): New struct.
11006
11007 2010-02-26 Doug Kwan <dougkwan@google.com>
11008
11009 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
11010 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
11011 * testsuite/debug_msg.sh: Avoid matching source line number for
11012 use of global variable undef_int.
11013
11014 2010-02-26 Doug Kwan <dougkwan@google.com>
11015
11016 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
11017 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
11018 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
11019 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
11020 * options.cc (General_options::General_options): Initialize member
11021 fix_v4bx_.
11022 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
11023 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
11024 and rm_no_fix_v4bx.stdout
11025 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
11026 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
11027 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
11028 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
11029 and arm_no_fix_v4bx.
11030 * Makefile.in: Regenerate.
11031 * testsuite/arm_fix_v4bx.s: New file.
11032 * testsuite/arm_fix_v4bx.sh: Ditto.
11033
11034 2010-02-24 Doug Kwan <dougkwan@google.com>
11035
11036 * arm.cc (Target_arm::got_section): Make the .got section the first
11037 non RELRO section in the data segment.
11038 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
11039 suffixes of section names.
11040
11041 2010-02-24 Doug Kwan <dougkwan@google.com>
11042
11043 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
11044 flags and attributes merging if an input file is a binary file.
11045 * fileread.cc (Input_file::open): Record format of original file.
11046 * fileread.h (Input_file::Format): New enum type.
11047 (Input_file::Input_file): Initialize data member format_.
11048 (Input_file::format): New method definition.
11049 (Input_file::format_):: New data member.
11050
11051 2010-02-24 Doug Kwan <dougkwan@google.com>
11052
11053 * arm.cc (Arm_output_data_got): New class.
11054 (ARM_TCB_SIZE): New constant
11055 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
11056 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
11057 If user uses a script with a SECTIONS clause, issue only a warning
11058 for a misplaced EXIDX input section. Otherwise, issue an error.
11059 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
11060 garbage collection.
11061 (Target_arm::got_mode_index_entry): Handle static linking.
11062 (Target_arm::Scan::local): Ditto.
11063 (Target_arm::Scan::global): Ditto.
11064 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
11065 all incorrectly implemented relocations.
11066 (Target_arm::fix_exidx_coverage): Pass layout to
11067 Arm_output_section::fix_exidx_coverage.
11068 * layout.cc (Layout::section_name_mapping): Remove trailing dots
11069 from ".ARM.exidx." and ".ARM.extab.".
11070
11071 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11072
11073 * arm.cc (Target_arm::do_finalize_sections): Create attribute
11074 section if it does not already exist.
11075 * attributes.cc (Attributes_section_data::Attributes_section_data):
11076 Don't crash if size is zero.
11077
11078 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11079 Ian Lance Taylor <iant@google.com>
11080
11081 * gold.cc (queue_middle_tasks): If no input files were opened,
11082 exit.
11083 * workqueue.h (Task_function::Task_function): Assert that there is
11084 a blocker.
11085
11086 2010-02-22 Doug Kwan <dougkwan@google.com>
11087
11088 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
11089 * icf.cc (get_section_contents): Cast snprintf arguments to long long
11090 types to avoid warnings due to different uint64_t implementations
11091 on different hosts.
11092
11093 2010-02-21 Doug Kwan <dougkwan@google.com>
11094
11095 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
11096 handling of the maximum backward branch offset.
11097 (Arm_relocate_functions::thumb_branch_common): Ditto.
11098 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
11099 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
11100 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
11101 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11102 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11103 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11104 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11105 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11106 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11107 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11108 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11109 thumb2_bl_out_of_range.o): New rules.
11110 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11111 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11112 thumb2_bl_out_of_range
11113 * testsuite/Makefile.in: Regenerate.
11114 * testsuite/arm_bl_in_range.s: New file.
11115 * testsuite/arm_bl_out_of_range.s: Ditto.
11116 * testsuite/arm_branch_in_range.sh: Ditto.
11117 * testsuite/arm_branch_range.t: Ditto.
11118 * testsuite/thumb2_branch_range.t: Ditto.
11119 * testsuite/thumb_bl_in_range.s: Ditto.
11120 * testsuite/thumb_bl_out_of_range.s: Ditto.
11121 * testsuite/thumb_branch_range.t: Ditto.
11122
11123 2010-02-20 Sriraman Tallam <tmsriram@google.com>
11124
11125 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11126 Add reloc offset information.
11127 * icf.cc (get_section_contents): Change iterators to point to the new
11128 vectors. Add reloc offset information to the contents.
11129 * icf.h (Icf::Sections_reachable_info): New typedef.
11130 (Icf::Sections_reachable_list): New typedef.
11131 (Icf::Offset_info): New typedef.
11132 (Icf::Reloc_info): New struct typedef.
11133 (Icf::Reloc_info_list): New typedef.
11134 (Icf::symbol_reloc_list): Delete method.
11135 (Icf::addend_reloc_list): Delete method.
11136 (Icf::section_reloc_list): Delete method.
11137 (Icf::reloc_info_list): New method.
11138 (Icf::reloc_info_list_): New member.
11139
11140 2010-02-19 Doug Kwan <dougkwan@google.com>
11141
11142 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11143 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11144 * arm.cc (Arm_relocation_functions): New forward declaration.
11145 (Target_arm::Target_arm): Initialize new data members
11146 got_mod_index_offset_ and tls_base_symbol_defined_.
11147 (Target_arm::Relocate::relocate_tls): New method.
11148 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11149 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11150 New methods.
11151 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
11152 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11153 (Target_arm::got_mod_index_offset_,
11154 Target_arm::tls_base_symbol_defined_): New data members.
11155 (Target_arm::Scan::local, Target::Scan::global,
11156 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11157 relocations.
11158
11159 2010-02-18 Doug Kwan <dougkwan@google.com>
11160
11161 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11162 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11163 text section as a parameter becuase some broken tools may not set
11164 the link in section header.
11165 (Target_arm::has_got_section): New method.
11166 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11167 without any mapping symbol as data only. Remove warning.
11168 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11169 link in its section header, try to discover the link by inspecting the
11170 REL31 relocation at the beginning of the section.
11171 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11172 in error message.
11173 (Target_arm::Scan::global): Treat any reference to the symbol
11174 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11175
11176 2010-02-12 Sriraman Tallam <tmsriram@google.com>
11177
11178 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11179 (Scan::global_reloc_may_be_function_pointer): New function.
11180 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11181 (Scan::global_reloc_may_be_function_pointer): New function.
11182 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11183 (Scan::global_reloc_may_be_function_pointer): New function.
11184 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11185 (Scan::global_reloc_may_be_function_pointer): New function.
11186 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11187 (Scan::global_reloc_may_be_function_pointer): New function.
11188 (Scan::possible_function_pointer_reloc): New function.
11189 (Target_x86_64::can_check_for_function_pointers): New function.
11190 * gc.h (gc_process_relocs): Scan relocation types to determine if
11191 function pointers were taken for targets that support it.
11192 * icf.cc (Icf::find_identical_sections): Include functions for
11193 folding in safe ICF whose pointer is not taken.
11194 * icf.h (Secn_fptr_taken_set): New typedef.
11195 (fptr_section_id_): New member.
11196 (section_has_function_pointers): New function.
11197 (set_section_has_function_pointers): New function.
11198 (check_section_for_function_pointers): New function.
11199 * options.h: Fix comment for safe ICF option.
11200 * target.h (can_check_for_function_pointers): New function.
11201 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11202 Modify icf_safe_test for X86-64.
11203 * testsuite/Makefile.in: Regenerate.
11204 * testsuite/icf_safe_so_test.cc: New file.
11205 * testsuite/icf_safe_so_test.sh: New file.
11206 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11207 (main): Change to take pointer to function kept_func_3.
11208 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11209 folding is done correctly for X86-64.
11210
11211 2010-02-12 David S. Miller <davem@davemloft.net>
11212
11213 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11214 is_symbolless parameter.
11215 (Output_reloc<SHT_REL>::is_symbolless): New.
11216 (Output_reloc<SHT_REL>::is_symbolless_): New.
11217 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11218 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11219 (Output_reloc<SHT_RELA>::is_symbolless): New.
11220 (Output_data_reloc::add_global): Handle is_symbolless.
11221 (Output_data_reloc::add_global_relative): Likewise.
11222 (Output_data_reloc::add_local): Likewise.
11223 (Output_data_reloc::add_local_relative): Likewise.
11224 (Output_data_reloc::add_symbolless_global_addend): New.
11225 (Output_data_reloc::add_symbolless_local_addend): New.
11226 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11227 is_symbolless.
11228 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11229 instead of ->is_relative_
11230 (Output_reloc::write): Likewise.
11231 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11232 (Output_reloc::write_rel): Simplify.
11233
11234 * sparc.cc (Target_sparc::Scan::local): Use
11235 ->add_symbolless_local_addend as needed.
11236 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11237 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11238 based upon relocation offset.
11239
11240 2010-02-11 Doug Kwan <dougkwan@google.com>
11241
11242 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11243 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11244 beginning of function.
11245 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11246 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11247 parameter is_32bit in calls to should_apply_static_reloc.
11248 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11249 (check_DATA): Add arm_abs_global.stdout.
11250 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11251 arm_abs_global.stdout): New rules.
11252 (MOSTLLYCLEANFILES): Add arm_abs_global
11253 * Makefile.in: Regenerate.
11254 * testsuite/arm_abs_global.s: New file.
11255 * testsuite/arm_abs_global.sh: Ditto.
11256 * testsuite/arm_abs_lib.s: Ditto.
11257
11258 2010-02-11 Ian Lance Taylor <iant@google.com>
11259
11260 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11261 Read_relocs task.
11262 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11263 Allocate_commons_task first.
11264 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11265 task, rather than symtab_lock_.
11266 (Gc_process_relocs::~Gc_process_relocs): New function.
11267 (Gc_process_relocs::is_runnable): Check this_blocker_.
11268 (Gc_process_relocs::locks): Use next_blocker_ rather than
11269 blocker_.
11270 (Scan_relocs::~Scan_relocs): New function.
11271 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11272 symtab_lock_.
11273 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11274 next_blocker_.
11275 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11276 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11277 constructor accordingly.
11278 (class Gc_process_relocs): Likewise.
11279 (class Scan_relocs): Likewise.
11280 * common.h (class Allocate_commons_task): Remove symtab_lock_
11281 field, and corresponding constructor parameter.
11282 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11283 symtab_lock_.
11284 (Allocate_commons_task::locks): Likewise.
11285
11286 2010-02-11 Ian Lance Taylor <iant@google.com>
11287
11288 * gold-threads.h (class Once): Define.
11289 (class Initialize_lock): Rewrite as child of Once.
11290 * gold-threads.cc (class Once_initialize): Define.
11291 (once_pointer_control): New static variable.
11292 (once_pointer, once_arg): New static variables.
11293 (c_run_once): New static function.
11294 (Once::Once, Once::run_once, Once::internal_run): New functions.
11295 (class Initialize_lock_once): Remove.
11296 (initialize_lock_control): Remove.
11297 (initialize_lock_pointer): Remove.
11298 (initialize_lock_once): Remove.
11299 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11300 (Initialize_lock::initialize): Rewrite.
11301 (Initialize_lock::do_run_once): New function.
11302 * archive.cc (Archive::interpret_header): Only clear name if it is
11303 not already empty.
11304 * fileread.cc: Include "gold-threads.h"
11305 (file_counts_lock): New static variable.
11306 (file_counts_initialize_lock): Likewise.
11307 (File_read::release): Only increment counts when using --stats.
11308 Use a lock around the increment.
11309 * parameters.cc (class Set_parameters_target_once): Define.
11310 (set_parameters_target_once): New static variable.
11311 (Parameters::Parameters): Move here from parameters.h.
11312 (Parameters::set_target): Rewrite.
11313 (Parameters::set_target_once): New function.
11314 (Parameters::clear_target): Move here and rewrite.
11315 * parameters.h (class Parameters): Update declarations. Add
11316 set_parameters_target_once_ field.
11317 (Parameters::Parameters): Move to parameters.cc.
11318 (Parameters::clear_target): Likewise.
11319 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11320 task.
11321 (Start_group::~Start_group): New function.
11322 (Start_group::is_runnable): New function.
11323 (Start_group::locks, Start_group::run): New functions.
11324 (Finish_group::run): Change saw_undefined to size_t.
11325 * readsyms.h (class Start_group): Define.
11326 (class Finish_group): Change saw_undefined_ field to size_t.
11327 (Finish_group::Finish_group): Remove saw_undefined and
11328 this_blocker parameters. Change all callers.
11329 (Finish_group::set_saw_undefined): New function.
11330 (Finish_group::set_blocker): New function.
11331 * symtab.h (class Symbol_table): Change saw_undefined to return
11332 size_t. Change saw_undefined_ field to size_t.
11333 * target-select.cc (Set_target_once::do_run_once): New function.
11334 (Target_selector::Target_selector): Initialize set_target_once_
11335 field. Don't initialize lock_ and initialize_lock_ fields.
11336 (Target_selector::instantiate_target): Rewrite.
11337 (Target_selector::set_target): New function.
11338 * target-select.h (class Set_target_once): Define.
11339 (class Target_selector): Update declarations. Make
11340 Set_target_once a friend. Remove lock_ and initialize_lock_
11341 fields. Add set_target_once_ field.
11342
11343 2010-02-10 Ian Lance Taylor <iant@google.com>
11344
11345 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11346 queueing any tasks.
11347 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11348 (queue_middle_tasks): Add all blockers before queueing any tasks.
11349 (queue_final_tasks): Likewise.
11350 * token.h (Task_token::add_blockers): New function.
11351 * object.h (Input_objects::number_of_relobjs): New function.
11352
11353 2010-02-10 Ian Lance Taylor <iant@google.com>
11354
11355 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11356 shared, not if not position independent.
11357 * x86_64.cc (Relocate::relocate_tls): Likewise.
11358 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11359 (tls_pie_pic_test): New target.
11360 * testsuite/Makefile.in: Rebuild.
11361
11362 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11363 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11364 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11365 * testsuite/Makefile.in: Rebuild.
11366
11367 2010-02-09 David S. Miller <davem@davemloft.net>
11368
11369 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11370 R_SPARC_RELATIVE using ->add_local_relative().
11371 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11372
11373 * output.h (Output_data_dynamic::add_section_size): New method
11374 that takes two Output_data objects.
11375 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11376 entry param. Handle it in initializers.
11377 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11378 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11379 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11380 arg.
11381 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11382 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11383 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11384 for dynrel_includes_plt.
11385 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11386 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11387 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11388 before .rela.plt
11389 (Target_sparc::do_finalize_sections): Update to pass true for
11390 dynrel_includes_plt.
11391 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11392 output before .rela.plt
11393 (Target_powerpc::do_finalize_sections): Update to pass true for
11394 dynrel_includes_plt when 32-bit.
11395
11396 2010-02-08 Doug Kwan <dougkwan@google.com>
11397
11398 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11399 method.
11400 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11401 Arm_relobj::scan_section_for_cortex_a8_stubs,
11402 Arm_relobj::do_relocation_section): Instead of calling
11403 Output_section::output_address, use faster
11404 Arm_relobj::simple_input_section_output_address.
11405
11406 2010-02-08 David S. Miller <davem@davemloft.net>
11407
11408 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11409 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11410 relocation helper function.
11411
11412 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11413 just like R_SPARC_GOT{10,13,22}.
11414 (Target_sparc::Scan::local): Likewise.
11415 (Target_sparc::Relocate:relocate): Likewise.
11416
11417 2010-02-06 Ian Lance Taylor <iant@google.com>
11418
11419 * configure.ac: Rewrite targetobjs duplicate removal code to use
11420 only shell constructs.
11421 * configure: Rebuild.
11422
11423 2010-02-05 Doug Kwan <dougkwan@google.com>
11424
11425 PR 11247
11426 * arm.cc (Arm_relobj::section_is_scannable): New method.
11427 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11428 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11429
11430 2010-02-04 Doug Kwan <dougkwan@google.com>
11431
11432 PR 11247
11433 * arm-reloc-property.cc (cstdio): Include.
11434 * configure.ac (targetobjs): Remove duplicates.
11435 * configure: Regenerate.
11436 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11437 big and little endian version for a given address size.
11438
11439 2010-02-03 Doug Kwan <dougkwan@google.com>
11440
11441 * arm-reloc-property.cc
11442 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11443 definition.
11444 * arm-reloc-property.h
11445 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11446 New method definition.
11447 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11448 declaration.
11449 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11450 overflow to N.
11451 (GOT_PREL): Change implemented to Y.
11452 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11453 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11454 (Arm_relocate_functions::movw_abs_nc): Remove method.
11455 (Arm_relocate_functions::movt_abs): Ditto.
11456 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11457 (Arm_relocate_functions::thm_movt_abs): Ditto.
11458 (Arm_relocate_functions::movw_rel_nc): Ditto.
11459 (Arm_relocate_functions::movw_rel): Ditto.
11460 (Arm_relocate_functions::movt_rel): Ditto.
11461 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11462 (Arm_relocate_functions:thm_movw_rel): Ditto.
11463 (Arm_relocate_functions:thm_movt_rel): Ditto.
11464 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11465 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11466 New method definitions.
11467 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11468 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11469 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11470 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11471 (Target_arm::Relocate::relocate): Check for non-static or
11472 unimplemented relocation code and exit early. Change calls to
11473 Target_arm::reloc_uses_thumb_bit and
11474 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11475 instead. Refactor code to handle similar relocations to increase
11476 code sharing. Remove check for unsupported relocation code in switch
11477 statement.
11478 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11479 relocation property table to find out size. Change error message to
11480 print out the name of a relocation code instead of the numeric value.
11481 (Target_arm::scan_reloc_for_stub): Use relocation property table
11482 instead of calling Target_arm::reloc_uses_thumb_bit().
11483
11484 2010-02-02 Doug Kwan <dougkwan@google.com>
11485
11486 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11487 types of relaxed input section.
11488
11489 2010-02-02 Doug Kwan <dougkwan@google.com>
11490
11491 * Makefile.am (HFILES): Add arm-reloc-property.h.
11492 (DEFFILES): New.
11493 (TARGETSOURCES): Add arm-reloc-property.cc
11494 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11495 (libgold_a_SOURCES): $(DEFFILES)
11496 * Makefile.in: Regenerate.
11497 * arm-reloc-property.cc: New file.
11498 * arm-reloc-property.h: New file.
11499 * arm-reloc.def: New file.
11500 * arm.cc: Update comments.
11501 (arm-reloc-property.h): New included header.
11502 (arm_reloc_property_table): New global variable.
11503 (Target_arm::do_select_as_default_target): New method definition.
11504 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11505 arm-reloc-property to targ_extra_obj.
11506 * parameters.cc (set_parameters_target): Call
11507 Target::select_as_default_target().
11508 * target.h (Target::select_as_default_target): New method definition.
11509 (Target::do_select_as_default_target): Same.
11510
11511 2010-02-01 Doug Kwan <dougkwan@google.com>
11512
11513 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11514 first_output_text_section_.
11515 (Arm_exidx_fixup::first_output_text_section): New method definition.
11516 (Arm_exidx_fixup::first_output_text_section_): New data member.
11517 (Arm_exidx_fixup::process_exidx_section): Record the first text
11518 output section seen.
11519 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11520 and entsize in output section header.
11521
11522 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11523
11524 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11525 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11526 (Arm_relocate_functions::thm_alu11): New Method.
11527 (Arm_relocate_functions::thm_pc8): New Method.
11528 (Arm_relocate_functions::thm_pc12): New Method.
11529 (Target_arm::Scan::local): Handle the relocations.
11530 (Target_arm::Scan::global): Likewise.
11531 (Target_arm::Relocate::relocate): Likewise.
11532 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11533
11534 2010-01-29 Doug Kwan <dougkwan@google.com>
11535
11536 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11537 of relocation types as ld.
11538
11539 2010-01-29 Doug Kwan <dougkwan@google.com>
11540
11541 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11542 to public.
11543 (Arm_relocate_functions::thumb_branch_common): Ditto.
11544 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11545 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11546 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11547 Arm_relocate_functions::jump24): Remove.
11548 (Target_arm::Relocate::relocate): Adjust code to call
11549 Arm_relocation_functions::arm_branch_common and
11550 Arm_relocation_functions::thumb_branch_common instead of their removed
11551 wrappers. Merge switch-cases together to reduce source code size.
11552
11553 2010-01-29 Doug Kwan <dougkwan@google.com>
11554
11555 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11556 output_local_symbol_count_needs_update_.
11557 (Arm_relobj::output_local_symbol_count_needs_update,
11558 Arm_relobj::set_output_local_symbol_count_needs_update,
11559 Arm_relobj::update_output_local_symbol_count): New methods.
11560 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11561 member.
11562 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11563 of pointed function as in a R_ARM_PREL31 relocation.
11564 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11565 for output local symbol count updating.
11566 (Target_arm::do_relax): Update output local symbol counts in objects
11567 if necessary.
11568 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11569
11570 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11571
11572 * arm.cc: Added support for the ARM relocations:
11573 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11574 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11575 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11576 movw_prel_nc).
11577 (Arm_relocate_functions::movw_rel): New method.
11578 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11579 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11580 thm_movw_prel_nc).
11581 (Arm_relocate_functions::thm_movw_rel): New method.
11582 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11583 thm_movt_prel).
11584 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11585 relocations.
11586 (Target_arm::Scan::global): Likewise.
11587 (Target_arm::Relocate::relocate): Likewise.
11588 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11589 Likewise.
11590
11591 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11592
11593 * arm.cc: Added support for ARM group relocations.
11594 (Target_arm::reloc_needs_sym_origin): New method.
11595 (Arm_relocate_functions::calc_grp_kn): New method.
11596 (Arm_relocate_functions::calc_grp_residual): New method.
11597 (Arm_relocate_functions::calc_grp_gn): New method.
11598 (Arm_relocate_functions::arm_grp_alu): New Method.
11599 (Arm_relocate_functions::arm_grp_ldr): New Method.
11600 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11601 (Arm_relocate_functions::arm_grp_ldc): New Method.
11602 (Target_arm::Scan::local): Handle the ARM group relocations.
11603 (Target_arm::Scan::global): Likewise.
11604 (Target_arm::Relocate::relocate): Likewise.
11605 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11606 Likewise.
11607
11608 2010-01-26 Doug Kwan <dougkwan@google.com>
11609
11610 * arm.cc (set): Include.
11611 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11612 pointer type.
11613 (Arm_output_section::Text_section_list): New type.
11614 (Arm_output_section::append_text_sections_to_list): New method.
11615 (Arm_output_section::fix_exidx_coverage): Ditto.
11616 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11617 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11618 Relobj::set_section_offset() instead of
11619 Sized_relobj::invalidate_section_offset().
11620 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11621 parameter for section headers. Ignore relocation sections for
11622 unallocated sections and EXIDX sections.
11623 (Target_arm::fix_exidx_coverage): New method.
11624 (Target_arm::output_section_address_less_than): New type.
11625 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11626 linked text section instead of the EXIDX section.
11627 (Arm_output_section::create_stub_group): Add an assertion to check
11628 that this is not an EXIDX output section.
11629 (Arm_output_section::append_text_sections_to_list): New method.
11630 (Arm_output_section::fix_exidx_coverage): Ditto.
11631 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11632 Arm_relobj::section_needs_reloc_stub_scanning.
11633 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11634 first pass.
11635 (Target_arm::fix_exidx_coverage): New method.
11636 * object.h (Relobj::set_output_section): New method.
11637 (Sized_relobj::invalidate_section_offset): Remove method.
11638 (Sized_relobj::do_invalidate_section_offset): Remove method.
11639 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11640
11641 2010-01-25 Doug Kwan <dougkwan@google.com>
11642
11643 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11644 Fix warning due to signed and unsigned comparison on a 32-bit host.
11645
11646 2010-01-22 Doug Kwan <dougkwan@google.com>
11647
11648 * arm.cc (Target_arm::do_relax): Record an output section for section
11649 offset adjustment it contains any stub table that has changed.
11650 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11651 offsets in an output section if necessary.
11652 * output.cc (Output_section::Output_section): Initialize
11653 section_offsets_need_adjustments_.
11654 (Output_section::add_input_section_for_script): Renamed to
11655 Output_section::add_simple_input_section.
11656 (Output_section::save_states): Add a comment.
11657 (Output_section::discard_states): New method defintion.
11658 (Output_section::adjust_section_offsets): Same.
11659 * output.h (Output_section::add_input_section_for_script): Renamed to
11660 Output_section::add_simple_input_section.
11661 (Output_section::discard_states): New method declaration.
11662 (Output_section::adjust_section_offsets): Same.
11663 (Output_section::section_offsets_need_adjustment,
11664 Output_section::set_section_offsets_need_adjustment): New method
11665 definitions.
11666 (Output_section::section_offsets_need_adjustment_): New data member.
11667 * script-sections.cc
11668 (Output_section_element_input::set_section_address): Adjust code for
11669 renaming of Output_section::add_input_section_for_script.
11670 (Orphan_output_section::set_section_address): Same.
11671
11672 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11673
11674 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11675 Fix_v4bx enum values .
11676 * gold/options.h (General_options): New option definitions.
11677 (General_options::fix_v4bx): New method.
11678 (General_options::Fix_v4bx): New enum.
11679 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11680 (General_options::parse_fix_v4bx_interworking): New method.
11681
11682 2010-01-22 Doug Kwan <dougkwan@google.com>
11683
11684 * arm.cc (Arm_exidx_fixup): New class.
11685
11686 2010-01-21 Doug Kwan <dougkwan@google.com>
11687
11688 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11689 classes.
11690 (Arm_exidx_section_offset_map): New type.
11691
11692 2010-01-21 Doug Kwan <dougkwan@google.com>
11693
11694 * arm.cc (Arm_exidx_input_section): New class.
11695 (Arm_relobj::exidx_input_section_by_link,
11696 Arm_relobj::exidx_input_section_by_shndx,
11697 Arm_relobj::make_exidx_input_section): New methods.
11698 (read_arm_attributes_section): Remove.
11699 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11700 information about them.
11701 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11702 to here.
11703
11704 2010-01-20 Doug Kwan <dougkwan@google.com>
11705
11706 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11707 Input_section_specifier to Section_id.
11708 (Target_arm::new_arm_input_section: Adjust code for change of key
11709 type.
11710 (Target_arm::find_arm_input_section): Ditto.
11711 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11712 (Section_id): Remove.
11713 (Garbage_collection::Section_id_hash): Remove.
11714 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11715 (Section_id): Remove.
11716 (Icf::Section_id_hash): Remove.
11717 * object.h (Section_id, Const_section_id, Section_id_hash,
11718 Const_section_id_hash): New type definitions.
11719 * output.cc (Output_section::add_relaxed_input_section): Change to
11720 use Const_section_id instead of Input_section_specifier as key type.
11721 (Output_section::add_merge_input_section): Ditto.
11722 (Output_section::build_relaxation_map): Change to use Section_id
11723 instead of Input_section_specifier as key type.
11724 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11725 Ditto.
11726 (Output_section::convert_input_sections_to_relaxed_sections): Change
11727 to use Const_section_id instead of Input_section_specifier as key type.
11728 (Output_section::find_merge_section): Ditto.
11729 (Output_section::find_relaxed_input_section): Ditto.
11730 * output.h (Input_section_specifier): Remove class.
11731 (Output_section::Output_section_data_by_input_section_map): Change
11732 key type to Const_section_id.
11733 (Output_section::Output_relaxed_input_section_by_input_section_map):
11734 Ditto.
11735 (Output_section::Relaxation_map): Change key type to Section_id.
11736
11737 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11738
11739 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11740 (class Arm_v4bx_stub): New class.
11741 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11742 (Stub_factory::make_arm_v4bx_stub): New method.
11743 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11744 (Stub_table::empty): Handle v4bx stubs.
11745 (Stub_table::add_arm_v4bx_stub): New method.
11746 (Stub_table::find_arm_v4bx_stub): New method.
11747 (Arm_relocate_functions::v4bx): New method.
11748 (Target_arm::fix_v4bx): New method.
11749 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11750 (Stub_table::relocate_stubs): Likewise.
11751 (Stub_table::do_write): Likewise.
11752 (Stub_table::update_data_size_and_addralign): Likewise.
11753 (Stub_table::finalize_stubs): Likewise.
11754 (Target_arm::Scan::local): Likewise.
11755 (Target_arm::Scan::global): Likewise.
11756 (Target_arm::do_finalize_sections): Likewise.
11757 (Target_arm::Relocate::relocate): Likewise.
11758 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11759 Likewise.
11760 (Target_arm::scan_reloc_for_stub): Likewise.
11761 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11762
11763 2010-01-19 Ian Lance Taylor <iant@google.com>
11764
11765 * output.cc (Output_section_headers::do_sized_write): Write large
11766 segment count to sh_info field.
11767 (Output_file_header::do_sized_write): For large segment count,
11768 write PN_XNUM to e_phnum field.
11769
11770 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11771
11772 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11773 (Arm_relocate_functions::thm_jump8): New function.
11774 (Arm_relocate_functions::thm_jump11): New function.
11775 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11776 R_ARM_THM_JUMP11.
11777 (Target_arm::Scan::global): Likewise.
11778 (Target_arm::Relocate::relocate): Likewise.
11779 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11780 Likewise.
11781
11782 2010-01-14 Doug Kwan <dougkwan@google.com>
11783
11784 * arm.cc (map, utility): Include headers.
11785 (Target_arm::apply_cortex_a8_workaround): New method.
11786 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11787 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11788 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11789 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11790 the --[no-]fix-cortex-a8 command line options.
11791 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11792 (Target_arm::relocate_stub): Use addend in instruction template.
11793 * options.h (DEFINE_bool): Set the user-set flag.
11794 (General_options): Add --[no-]-fix-cortex options.
11795 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11796 : Update fast look-up map after conversion.
11797
11798 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11799
11800 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11801 in the first pass of do_layout.
11802
11803 2010-01-13 Doug Kwan <dougkwan@google.com>
11804
11805 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11806 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11807 apparent compiler problem of not folding static constant integral
11808 data members of elfcpp::Elf_sizes<32>.
11809
11810 2010-01-13 Doug Kwan <dougkwan@google.com>
11811
11812 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11813 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11814 Arm_relobj::scan_section_for_cortex_a8_erratum,
11815 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11816 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11817 sections to scan for relocation stubs into a new method
11818 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11819 relocation and Cortex-A8 stub scanning.
11820 (Target_arm::do_relax): Force stubs to be after stubbed sections
11821 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11822 the beginning of a new relaxation pass. Update a comment.
11823 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11824
11825 2010-01-12 Ian Lance Taylor <iant@google.com>
11826
11827 * target-reloc.h (visibility_error): New inline function.
11828 (relocate_section): Call visibility_error.
11829 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11830 (MOSTLYCLEANFILES): Likewise.
11831 (protected_4_pic.o, protected_3.err): New targets.
11832 * testsuite/protected_4.cc: New file.
11833
11834 2010-01-12 Doug Kwan <dougkwan@google.com>
11835
11836 * arm.cc (Cortex_a8_reloc): New class.
11837 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11838 and cortex_a8_relocs_info_.
11839 (Target_arm::fix_cortex_a8): New method definition.
11840 (Target_arm::Cortex_a8_relocs_info): New type.
11841 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11842 New data member declarations.
11843 (Target_arm::scan_reloc_for_stub): Record information about
11844 relocations for THUMB branches that might be exempted from the
11845 Cortex-A8 workaround.
11846 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11847 at the beginning of a relaxation pass.
11848
11849 2010-01-12 Doug Kwan <dougkwan@google.com>
11850
11851 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11852 (Arm_relobj::Mapping_symbol_position,
11853 Arm_reloj::Mapping_symbol_position_less,
11854 Arm_relobj::Mapping_symbols_info): New types.
11855 (Target_arm::is_mapping_symbol_name): New method definition.
11856 (Arm_relobj::do_count_local_symbols): Save information about mapping
11857 symbols.
11858
11859 2010-01-11 Doug Kwan <dougkwan@google.com>
11860
11861 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11862 Arm_relocate_functions::thumb32_branch_upper,
11863 Arm_relocate_functions::thumb32_branch_lower,
11864 Arm_relocate_functions::thumb32_cond_branch_offset,
11865 Arm_relocate_functions::thumb32_cond_branch_upper,
11866 Arm_relocate_functions::thumb32_cond_branch_lower,
11867 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11868 branch offset encoding.
11869 (Arm_relocate_functions::thumb_branch_common): Use new branch
11870 offset encoding methods to avoid code duplication.
11871 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11872 (Stub_addend_reader::operator()): Use new branch encoding method
11873 to avoid code duplication.
11874
11875 2010-01-11 Doug Kwan <dougkwan@google.com>
11876
11877 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11878 (Target_arm::do_finalize_sections): Define special EXIDX section
11879 symbols only if referenced.
11880 * gc.h (Garbage_collection::add_reference): New method.
11881 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11882 code duplication.
11883
11884 2010-01-11 Ian Lance Taylor <iant@google.com>
11885
11886 * script.cc (Version_script_info::build_expression_list_lookup):
11887 Change complaing about duplicate wildcard match from error to
11888 warning.
11889
11890 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11891 of 2009-12-30.
11892 (Version_script_info::Version_script_info): Initialize globs_,
11893 default_version_, default_is_global_, and exact_. Don't
11894 initialize globals_ or locals_.
11895 (Version_script_info::build_lookup_tables): Build local symbols
11896 first.
11897 (Version_script_info::unquote): New function.
11898 (Version_script_info::add_exact_match): New function.
11899 (Version_script_info::build_expression_list_lookup): Remove lookup
11900 parameter. Add is_global parameter. Change all callers. Handle
11901 wildcard pattern specially. Unquote pattern. Call
11902 add_exact_match.
11903 (Version_script_info::get_name_to_match): New function.
11904 (Version_script_info::get_symbol_version): New function.
11905 (Version_script_info::get_symbol_version_helper): Remove.
11906 (Version_script_info::check_unmatched_names): Call unquote.
11907 * script.h (class Version_script_info): Change get_symbol_version
11908 to be non-inline and add is_global parameter; change all callers.
11909 Rewrite symbol_is_local. Update declarations. Define struct
11910 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11911 Remove globals_ and locals_ members. Add exact_, globs_,
11912 default_version_, is_global_.
11913 (Version_script_info::Glob): Remove pattern, add expression and
11914 is_global. Update constructor. Change all callers.
11915 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11916 default version.
11917 (Versions::symbol_section_contents): If a symbol is undefined, or
11918 defined in a dynamic object, set the version index to
11919 VER_NDX_LOCAL.
11920 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11921 symbol_is_local.
11922 (Symbol_table::add_from_pluginobj): Likewise.
11923 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11924
11925 2010-01-11 Doug Kwan <dougkwan@google.com>
11926
11927 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11928 (incremental_dump_LDADD): Add linking option for libintl.
11929 * Makefile.in: Regenerate.
11930
11931 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11932
11933 PR gold/11144
11934 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11935 instead of -Ds.
11936 * testsuite/Makefile.in: Regenerated.
11937
11938 2010-01-10 Doug Kwan <dougkwan@google.com>
11939
11940 * options.h (DEFINE_var): Use parentheses around argument varname__
11941 in macro body to avoid any unintended subsequent substitutions.
11942
11943 2010-01-10 Ian Lance Taylor <iant@google.com>
11944
11945 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11946 candidates before doing symbol resolution.
11947
11948 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11949 ODR candidates if only one is weak.
11950
11951 2010-01-08 Ian Lance Taylor <iant@google.com>
11952
11953 * script.cc (Version_script_info::build_expression_list_lookup):
11954 Don't warn about ambiguous version, just record the ambiguity.
11955 (Version_script_info::get_symbol_version_helper): Give error if
11956 version is ambiguous.
11957
11958 2010-01-08 Doug Kwan <dougkwan@google.com>
11959
11960 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11961 prev_data_size_ and prev_addralign_. Remove initializer for
11962 deleted data member has_been_changed_.
11963 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11964 to determine if the table is empty.
11965 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11966 Remove.
11967 (Stub_table::add_reloc_stub): Define method in class definition
11968 instead of just declaring it there.
11969 (Stub_table::add_cortex_a8_stub): New method definition.
11970 (Stub_table::update_data_size_and_addralign): Ditto.
11971 (Stub_table::finalize_stubs): Ditto.
11972 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11973 (Stub_table::do_addralign_): Return address alignment in the
11974 (Stub_table::do_reset_address_and_file_offset): Define method in
11975 class definition instead of declaring it there. Set current data
11976 size to be the data size of the previous pass.
11977 (Stub_table::set_final_data_size): Use current data size as the
11978 final data size.
11979 (Stub_table::relocate_stub): Change parameter type of stub from
11980 Reloc_stub pointer to Stub pointer.
11981 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11982 (Stub_table::Cortex_a8_stub_list): New typedef.
11983 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11984 Stub_table::prev_addralign_): New data member.
11985 (Arm_relobj::Arm_relobj): Initialize data member
11986 section_has_cortex_a8_workaround_.
11987 (Arm_relobj::section_has_cortex_a8_workaround,
11988 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11989 definitions.
11990 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11991 declarations.
11992 (Target_arm::relocate_stub): Change parameter type of stub from
11993 Reloc_stub pointer to Stub pointer.
11994 (Insn_template::size, Insn_template::alignment): Handle
11995 THUMB16_SPECIAL_TYPE.
11996 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11997 Stub_table::update_data_size_and_addralign,
11998 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11999 definitions.
12000 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
12001 (Stub_table::do_write): Ditto.
12002 (Target_arm::do_relax): Adjust code for changes in Stub_table.
12003
12004 2010-01-08 Ian Lance Taylor <iant@google.com>
12005
12006 PR 11108
12007 * symtab.h (class Symbol): Remove fields is_target_special_ and
12008 has_plt_offset_. Add field is_defined_in_discarded_section_.
12009 (Symbol::is_defined_in_discarded_section): New function.
12010 (Symbol::set_is_defined_in_discarded_section): New function.
12011 (Symbol::has_plt_offset): Rewrite.
12012 (Symbol::set_plt_offset): Verify that new offset is not -1U.
12013 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
12014 Don't initialize is_target_special_ or has_plt_offset_.
12015 Initialize is_defined_in_discarded_section_.
12016 (Symbol_table::add_from_relobj): If appropriate, set
12017 is_defined_in_discarded_section.
12018 * resolve.cc (Symbol::override_base_with_special): Don't test
12019 is_target_special_. Change has_plt_offset_ to has_plt_offset().
12020 * target-reloc.h (relocate_section): Do special handling for
12021 symbols defined in discarded sections for global symbols as well
12022 as local symbols.
12023
12024 2010-01-08 Ian Lance Taylor <iant@google.com>
12025
12026 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
12027 the SHT_SYMTAB case.
12028
12029 2010-01-08 Ian Lance Taylor <iant@google.com>
12030
12031 * object.cc (Sized_relobj::do_layout): Don't get confused if
12032 layout_eh_frame returns NULL.
12033
12034 2010-01-08 Ian Lance Taylor <iant@google.com>
12035
12036 PR 11084
12037 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
12038 dynamic symbol table, use the normal symbol table.
12039 (Sized_dynobj::do_read_symbols): Remove assertion about type of
12040 symbol table.
12041
12042 2010-01-08 Ian Lance Taylor <iant@google.com>
12043
12044 PR 11072
12045 * layout.cc (Layout::include_section): Remove .gnu_debuglink
12046 sections.
12047
12048 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
12049
12050 * version.cc (print_version): Change to "Copyright 2010".
12051
12052 2010-01-08 Ian Lance Taylor <iant@google.com>
12053
12054 PR 10287
12055 PR 11063
12056 * i386.cc (class Target_i386): Change return type of plt_section
12057 to be non-const.
12058 (class Output_data_plt_i386): Add tls_desc_rel_ field.
12059 (Output_data_plt_i386::Output_data_plt_i386): Initialize
12060 tls_desc_rel_ field.
12061 (Output_data_plt_i386::rel_tls_desc): New function.
12062 (Target_i386::rel_tls_desc_section): New function.
12063 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
12064 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
12065 R_386_TLS_DESC reloc in rel_tls_desc_section.
12066 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
12067 Define struct Tlsdesc_info.
12068 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
12069 (Target_x86_64::do_reloc_symbol_index): New function.
12070 (Target_x86_64::add_tlsdesc_info): New function.
12071 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
12072 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
12073 tlsdesc_rel_ field.
12074 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
12075 all callers.
12076 (Output_data_plt_x86_64::rela_tlsdesc): New function.
12077 (Target_x86_64::rela_tlsdesc_section): New function.
12078 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
12079 handling.
12080 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
12081 (Target_x86_64::do_reloc_addend): New function.
12082 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
12083 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
12084 declarations. Define TARGET_CODE. Add arg field to u1_ union.
12085 (Output_reloc::type): New function.
12086 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
12087 (Output_reloc::is_target_specific): New function.
12088 (Output_reloc::target_arg): New function.
12089 (class Output_reloc) [SHT_RELA]: Add four new constructors for
12090 absolute relocs and target specific relocs.
12091 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
12092 add_target_specific.
12093 (class Output_data_reloc) [SHT_RELA]: Likewise.
12094 * output.cc (Output_reloc::Output_reloc): Add four new versions
12095 for absolute relocs and target specific relocs.
12096 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
12097 (Output_reloc::get_symbol_index): Likewise.
12098 (Output_reloc::local_section_offset): Check that local_sym_index_
12099 is not TARGET_CODE or 0.
12100 (Output_reloc::symbol_value): Likewise.
12101 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12102 reloc.
12103 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12104 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12105 functions.
12106 * layout.cc (add_target_dynamic_tags): Use output section for
12107 DT_PLTRELSZ and DT_JMPREL.
12108
12109 2010-01-07 Ian Lance Taylor <iant@google.com>
12110
12111 PR 11061
12112 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12113 function.
12114 (class Output_data_reloc_generic): Define.
12115 (class Output_data_reloc_base): Change base class to
12116 Output_data_reloc_generic. Change add() method to call
12117 bump_relative_reloc_count for a relative reloc. Remove
12118 sort_relocs_ field.
12119 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12120 to sort_relocs().
12121 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12122 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12123 appropriate.
12124 * layout.h (class Layout): Update declaration.
12125
12126 2010-01-07 Ian Lance Taylor <iant@google.com>
12127
12128 * output.h (class Output_data): Add const version of
12129 output_section and do_output_section.
12130 (class Output_section_data): Add const version of
12131 do_output_section.
12132 (class Output_section): Likewise.
12133 * layout.cc (Layout::add_target_dynamic_tags): New function.
12134 * layout.h (class Layout): Update declarations.
12135 * arm.cc (Target_arm::do_finalize_sections): Use
12136 add_target_dynamic_tags.
12137 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12138 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12139 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12140 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12141
12142 2010-01-07 Ian Lance Taylor <iant@google.com>
12143
12144 PR 11042
12145 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12146 object as needed.
12147
12148 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12149 Ian Lance Taylor <iant@google.com>
12150
12151 PR 11019
12152 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12153 Xindex::read_symtab_xindex.
12154
12155 2010-01-07 Doug Kwan <dougkwan@google.com>
12156
12157 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12158 (Insn_template::thumb16_bcond_insn): New method declaration.
12159 (Insn_template): Fix spelling.
12160 (Stub::thumb16_special): New method declaration.
12161 (Stub::do_write): Define virtual method which was previously pure
12162 virtual.
12163 (Stub::do_thumb16_special): New method declaration.
12164 (Stub::do_fixed_endian_write): New template member.
12165 (Reloc_stub::do_write): Remove.
12166 (Reloc_stub::do_fixed_endian_write): Remove.
12167 (Cortex_a8_stub): New class definition.
12168 (Stub_factory::make_cortex_a8_stub): New method definition.
12169 (Stub_factory::Stub_factory): Add missing static storage class
12170 qualifier for elf32_arm_stub_a8_veneer_blx.
12171
12172 2010-01-07 Ian Lance Taylor <iant@google.com>
12173
12174 PR 10980
12175 * options.h (class General_options): Add --warn-unresolved-symbols
12176 and --error-unresolved-symbols.
12177 * errors.cc (Errors::undefined_symbol): Implement
12178 --warn-unresolved-symbols.
12179
12180 * options.h (class General_options): Add -z text and -z textoff.
12181 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12182
12183 2010-01-06 Sriraman Tallam <tmsriram@google.com>
12184
12185 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12186 (Garbage_collection::cident_sections): New function.
12187 (Garbage_collection::add_cident_section): New function.
12188 (Garbage_collection::cident_sections_): New member.
12189 (gc_process_relocs): Add references to sections whose names are C
12190 identifiers.
12191 * gold.h (cident_section_start_prefix): New constant.
12192 (cident_section_stop_prefix): New constant.
12193 (is_cident): New function.
12194 * layout.cc (Layout::define_section_symbols): Replace string constants
12195 with the newly defined constants.
12196 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12197 C identifiers.
12198 * testsuite/Makefile.am: Add gc_orphan_section_test.
12199 * testsuite/Makefile.in: Regenerate.
12200 * testsuite/gc_orphan_section_test.cc: New file.
12201 * testsuite/gc_orphan_section_test.sh: New file.
12202
12203 2010-01-06 Ian Lance Taylor <iant@google.com>
12204
12205 PR 10980
12206 * options.h (class General_options): Add --warn-shared-textrel.
12207 * layout.cc (Layout::finish_dynamic_section): Implement
12208 --warn-shared-textrel.
12209
12210 PR 10980
12211 * options.h (class General_options): Add --warn-multiple-gp.
12212
12213 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12214
12215 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12216 $(THREADSLIB) and $(LIBDL).
12217 * Makefile.in: Rebuild.
12218
12219 2010-01-06 Ian Lance Taylor <iant@google.com>
12220
12221 PR 10980
12222 * options.cc (General_options::parse_section_start): New function.
12223 (General_options::section_start): New function.
12224 (General_options::General_options): Initialize all members.
12225 * options.h: Include <map>
12226 (class General_options): Add --section-start. Add section_starts_
12227 member.
12228 * layout.cc (Layout::attach_allocated_section_to_segment): If
12229 --section-start was used, set the address of the segment. Remove
12230 local sort_sections.
12231 (Layout::relaxation_loop_body): If the address of the load segment
12232 has been set by --section-start, don't use it.
12233 * output.h (Output_segment::update_flags_for_output_section): New
12234 function.
12235 * output.cc (Output_segment::add_output_section): Call
12236 update_flags_for_output_section.
12237
12238 2010-01-05 Ian Lance Taylor <iant@google.com>
12239
12240 PR 10980
12241 * options.h (class General_options): Add --undefined-version.
12242 * script.cc (struct Version_expression): Add was_matched_by_symbol
12243 field.
12244 (Version_script_info::matched_symbol): New function.
12245 (Version_script_info::get_symbol_version_helper): Call
12246 matched_symbol.
12247 (Version_script_info::check_unmatched_names): New function.
12248 * script.h (class Version_script_info): Update declarations.
12249 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12250
12251 * options.h (class General_options): Use DEFINE_bool_alias for
12252 allow_multiple_definition.
12253 * resolve.cc (Symbol_table::should_override): Don't test
12254 allow_multiple_definition.
12255
12256 PR 10980
12257 * options.h (class General_options): Add --cref.
12258 * main.cc (main): Print cref table if --cref. Don't close mapfile
12259 until after printing cref table.
12260 * cref.cc: Include "symtab.h".
12261 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12262 (Cref_table_compare::operator()): New function.
12263 (Cref_inputs::gather_cref): New function.
12264 (filecol): New static const.
12265 (Cref_inputs::print_cref): New function.
12266 (Cref::print_cref): New function.
12267 * cref.h: Include <cstdio>.
12268 (class Cref): Update declarations.
12269 * mapfile.h (Mapfile::file): New function.
12270 * object.h (class Object): Define Symbols. Declare virtual
12271 do_get_global_symbols.
12272 (Object::get_global_symbols): New function.
12273 * object.cc (Input_objects::add_object): Pass object to cref_ if
12274 --cref.
12275 (Input_objects::archive_start): Likewise.
12276 (Input_objects::archive_stop): Likewise.
12277 (Input_objects::print_cref): New function.
12278 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12279 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12280 --cref.
12281 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12282 function.
12283 * plugin.h (class Sized_pluginobj): Update declarations.
12284
12285 2010-01-05 Ian Lance Taylor <iant@google.com>
12286
12287 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12288 to is_default_version. Rename insdef to insdefault.
12289 (Symbol_table::add_from_relobj): Rename def to is_default_version
12290 and local to is_forced_local.
12291 (Symbol_table::add_from_pluginobj): Likewise.
12292 (Symbol_table::add_from_dynobj): Likewise.
12293 (Symbol_table::define_special_symbol): Rename insdef to
12294 insdefault.
12295
12296 2010-01-04 Ian Lance Taylor <iant@google.com>
12297
12298 PR 10980
12299 * options.h (class General_options): Add
12300 --allow-multiple-definition and -z muldefs.
12301 * resolve.cc (Symbol_table::should_override): Don't warn about a
12302 multiple symbol definition if --allow-multiple-definition or -z
12303 muldefs.
12304
12305 PR 10980
12306 * options.h (class General_options): Add --add-needed and
12307 --copy-dt-needed-entries. Tweak --as-needed help entry.
12308 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12309 error if --copy-dt-needed-entries aka --add-needed is used and
12310 would cause a change in behaviour.
12311
12312 PR 10980
12313 * options.h (class General_options): Add -G as a short version of
12314 --shared. Add no-op options -assert, -g, and -i.
12315
12316 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12317
12318 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12319 check for .text or .gnu.linkonce.t sections.
12320 * icf.cc (Icf::find_identical_sections): Ditto.
12321 Change the detection for mangled function name within the section
12322 name.
12323 * icf.h (is_section_foldable_candidate): New function.
12324
12325 2009-12-30 Ian Lance Taylor <iant@google.com>
12326
12327 PR 10980
12328 * options.h (class General_options): Permit two dashes with
12329 --retain-symbols-file.
12330
12331 2009-12-30 Ian Lance Taylor <iant@google.com>
12332
12333 PR 10979
12334 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12335 don't put the file header and segment headers in the text
12336 segment.
12337
12338 PR 10979
12339 * common.cc (Sort_commons::operator()): Stabilize sort when both
12340 entries are NULL.
12341 (Symbol_table::do_allocate_commons_list): When allocating common
12342 symbols, skip a symbol which is no longer common.
12343 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12344 an object before checking its type.
12345 * testsuite/common_test_2.c: New file.
12346 * testsuite/common_test_3.c: New file.
12347 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12348 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12349 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12350 (common_test_2_pic.o, common_test_2.so): New targets.
12351 (common_test_3_pic.o, common_test_3.so): New targets.
12352 * testsuite/Makefile.in: Rebuild.
12353
12354 PR 10979
12355 * script.cc (read_input_script): If we see a new SECTIONS clause,
12356 and we have added an input section, give an error.
12357 * layout.h (class Layout): Add have_added_input_section function.
12358 Add have_added_input_section_ field.
12359 * layout.cc (Layout::Layout): Initialize
12360 have_added_input_section_.
12361 (Layout::layout): Set have_added_input_section_.
12362 (Layout::layout_eh_frame): Likewise.
12363
12364 2009-12-30 Ian Lance Taylor <iant@google.com>
12365
12366 PR 10931
12367 * options.h (class General_options): Add --sort-common option.
12368 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12369 * common.cc (Sort_common): Add sort_order parameter to
12370 constructor. Add sort_order_ field.
12371 (Sort_commons::operator): Check sort_order_.
12372 (Symbol_table::allocate_commons): Determine the sort order.
12373 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12374 Change all callers.
12375 (Symbol_table::do_allocate_commons_list): Likewise.
12376
12377 2009-12-30 Ian Lance Taylor <iant@google.com>
12378
12379 PR 10916
12380 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12381 symbols from this object, don't change the visibility of an
12382 undefined symbol.
12383 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12384
12385 2009-12-30 Ian Lance Taylor <iant@google.com>
12386
12387 PR 10861
12388 * script.h (class Version_script_info): Define Language enum.
12389 Update declarations. Define Glob, Exact, and Lookup types. Add
12390 new fields globals_, locals_, and is_finalized_.
12391 * script.cc: Various formatting fixes.
12392 (class Parser_closure): Change language_stack_ from a vector of
12393 std::string to one of Version_script_info::Language. Adjust all
12394 uses accordingly.
12395 (class Lazy_demangler): Remove.
12396 (struct Version_expression): Change language from std::string to
12397 Version_script_info::Language.
12398 (Version_script_info::Version_script_info): New function.
12399 (Version_script_info::~Version_script_info): Don't call clear.
12400 (Version_script_info::finalize): New function.
12401 (Version_script_info::build_lookup_tables): New function.
12402 (Version_script_info::build_expression_list_lookup): New
12403 function.
12404 (Version_script_info::get_symbol_version_helper): Rewrite to use
12405 lookup tables.
12406 (Version_script_info::print_expression_list): Adjust to use
12407 Version_script_info::Language.
12408 (script_push_lex_into_version_mode): Check that the version script
12409 has not been finalized.
12410 (version_script_push_lang): Change language string to
12411 Version_script_info::Language.
12412 * options.cc (Command_line::version_script): New function.
12413 * options.h (class General_options): Add finalize_dynamic_list
12414 function. Change version_script from declaration to definition.
12415 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12416 * testsuite/version_script.map: Remove duplicate def of foo.
12417 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12418 version_script.map.
12419 * testsuite/Makefile.in: Rebuild.
12420
12421 2009-12-30 Ian Lance Taylor <iant@google.com>
12422
12423 PR 10843
12424 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12425 if the input symbol index is 0, make the output symbol index 0.
12426
12427 2009-12-30 Ian Lance Taylor <iant@google.com>
12428
12429 PR 10670
12430 * options.h (class General_options): Add -x/--discard-all.
12431 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12432 --discard-all. If the local symbol needs a dynamic entry, check
12433 that before handling --discard-locals.
12434
12435 2009-12-30 Ian Lance Taylor <iant@google.com>
12436
12437 PR 10450
12438 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12439 flags to PF_R.
12440 (Output_segment::add_output_section): Don't change the flags if
12441 the type is PT_TLS.
12442
12443 PR 10450
12444 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12445 GNU hash table if they need a dynamic value. Otherwise, don't add
12446 them if they are defined in a dynamic object or are forced local.
12447
12448 2009-12-29 Ian Lance Taylor <iant@google.com>
12449
12450 PR 10450
12451 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12452 .gnu.hash table for a 32-bit target.
12453
12454 PR 10450
12455 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12456 regular and a dynamic object only needs a dynamic symbol table
12457 entry if it is externally visible.
12458
12459 PR 10450
12460 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12461 constructor. Add global_offset_table_ field.
12462 (Target_i386::got_section): Set global_offset_table_.
12463 (Target_i386::do_finalize_sections): Set global_offset_table_
12464 size.
12465 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12466 in constructor. Add global_offset_table_ field.
12467 (Target_x86_64::got_section): Set global_offset_table_.
12468 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12469 size.
12470
12471 * layout.cc (Layout::Layout): Initialize increase_relro_.
12472 (Layout::get_output_section): Add is_relro, is_last_relro, and
12473 is_first_non_relro parameters. Change all callers.
12474 (Layout::choose_output_section): Likewise.
12475 (Layout::add_output_section_data): Likewise.
12476 (Layout::make_output_section): Likewise.
12477 (Layout::set_segment_offsets): Clear increase_relro when using a
12478 linker script.
12479 * layout.h (class Layout): Add increase_relro method. Add
12480 increase_relro_ field. Update declarations.
12481 * output.cc (Output_section::Output_section): Initialize
12482 is_last_relro_ and is_first_non_relro_.
12483 (Output_segment::add_output_section): Group relro sections is
12484 do_sort is true. Handle is_last_relro and is_first_non_relro.
12485 (Output_segment::maximum_alignment): Remove relro handling.
12486 (Output_segment::set_section_addresses): Add increase_relro
12487 parameter. Change all callers. Add initial alignment to align
12488 relro sections on separate page. Remove old relro handling.
12489 (Output_segment::set_section_list_addresses): Remove in_relro
12490 parameter. Change all callers.
12491 (Output_segment::set_offset): Add increase parameter. Change all
12492 callers. Remove old relro handling.
12493 * output.h (class Output_section): Add new methods: is_last_relro,
12494 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12495 Add is_last_relro_ and is_first_non_relro_ fields.
12496 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12497 Create separate .got.plt section. Call increase_relro.
12498 * x86_64.cc (Target_x86_64::got_section): Likewise.
12499 * testsuite/relro_script_test.t: Add .got.plt.
12500
12501 PR 10450
12502 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12503 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12504 (Layout::finalize): Call set_dynamic_symbol_size.
12505 (Layout::set_dynamic_symbol_size): New function.
12506 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12507 set_dynamic_symbol_size.
12508
12509 PR 10450
12510 * output.h (class Output_section): Add is_entsize_zero_ field.
12511 * output.cc (Output_section::Output_section): Initialize
12512 is_entsize_zero_.
12513 (Output_section::set_entsize): If two different entsizes are
12514 requested, force it to zero.
12515 (Output_section::add_input_section): Set flags for .debug_str
12516 before updating section flags. Set entsize.
12517 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12518 and SHF_STRING if all input sections have those flags.
12519
12520 2009-12-29 Rafael Espindola <espindola@google.com>
12521
12522 * main.cc (main): Fix the sys time reporting.
12523 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12524 reporting.
12525
12526 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12527
12528 * options.cc (General_options::parse_version): Allow -v to exit
12529 without an error if there is nothing to link.
12530
12531 2009-12-29 Ian Lance Taylor <iant@google.com>
12532
12533 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12534 using a version of gcc before 4.1.
12535 * configure: Rebuild.
12536
12537 2009-12-28 Chris Demetriou <cgd@google.com>
12538
12539 * attributes.cc (Output_attributes_section_data::do_write): Use
12540 std::vector::front rather than std::vector::data.
12541
12542 2009-12-28 Ian Lance Taylor <iant@google.com>
12543
12544 * symtab.h (class Symbol_table): Add enum Defined.
12545 * resolve.cc (Symbol_table::should_override): Add defined
12546 parameter. Change all callers. Test whether object is NULL
12547 before calling a method on it.
12548 (Symbol_table::report_resolve_problem): Add defined parameter.
12549 Change all callers.
12550 (Symbol_table::should_override_with_special): Likewise.
12551 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12552 parameter. Change all callers.
12553 (Symbol_table::do_define_in_output_data): Likewise.
12554 (Symbol_table::define_in_output_segment): Likewise.
12555 (Symbol_table::do_define_in_output_segment): Likewise.
12556 (Symbol_table::define_as_constant): Likewise.
12557 (Symbol_table::do_define_as_constant): Likewise.
12558 * script.h (class Symbol_assignment): Add is_defsym parameter to
12559 constructor; change all callers.
12560 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12561 parameter. Change all callers. Add is_defsym_ field.
12562 (class Parser_closure): Add parsing_defsym parameter to
12563 constructor; change all callers. Add parsing_defsym accessor
12564 function. Add parsing_defsym_ field.
12565
12566 2009-12-28 Ian Lance Taylor <iant@google.com>
12567
12568 * gold.cc (queue_middle_tasks): Fix formatting.
12569 * object.cc (Relobj::is_section_name_included): Likewise.
12570
12571 2009-12-23 Ian Lance Taylor <iant@google.com>
12572
12573 * i386.cc (Target_i386::do_calls_non_split): Recognize
12574 -fsplit-stack prologue for a function with a static chain.
12575 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12576 -fsplit-stack prologue when using %r11.
12577
12578 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12579
12580 * options.cc (General_options::parse_version): Make -v continue and do
12581 the link like GNU ld does.
12582
12583 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12584
12585 * Makefile.am (CCFILES): Add timer.cc.
12586 (HFILES): Add timer.h.
12587 * configure.ac: Check for sysconf and times.
12588 * main.cc: include timer.h.
12589 (main): Use Timer instead of get_run_time.
12590 * timer.cc: New.
12591 * timer.h: New.
12592 * workqueue.cc: include timer.h.
12593 (Workqueue::find_and_run_task):
12594 Report user, sys and wall time.
12595 * Makefile.in: Regenerate.
12596 * config.in: Regenerate.
12597 * configure: Regenerate.
12598
12599 2009-12-16 Doug Kwan <dougkwan@google.com>
12600
12601 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12602 sections.
12603 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12604 relaxed input sections.
12605 * output.cc (Output_section::find_relaxed_input_section): Change
12606 return type to Output_relaxed_input_section pointer. Adjust code
12607 for new type of relaxed_input_section_map_.
12608 * output.h (Output_section::find_relaxed_input_section): Change
12609 return type to Output_relaxed_input_section pointer.
12610 (Output_section::Output_relaxed_input_section_by_input_section_map):
12611 New type.
12612 (Output_section::relaxed_input_section_map_): Change type to
12613 Output_section::Output_relaxed_input_section_by_input_section_map.
12614 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12615 input section.
12616
12617 2009-12-15 Ian Lance Taylor <iant@google.com>
12618
12619 * layout.cc (Layout::create_shstrtab): Only write out after input
12620 sections if we are compressing debug sections.
12621
12622 2009-12-15 Ian Lance Taylor <iant@google.com>
12623
12624 * archive.cc (Archive::add_symbols): Only look up a symbol without
12625 a version if there is, in fact, a version.
12626
12627 2009-12-14 Ian Lance Taylor <iant@google.com>
12628
12629 Revert -Wshadow changes, all changes from:
12630 2009-12-11 Doug Kwan <dougkwan@google.com>
12631 2009-12-11 Nick Clifton <nickc@redhat.com>
12632 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12633
12634 2009-12-11 Doug Kwan <dougkwan@google.com>
12635
12636 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12637 due to -Wshadow.
12638 * attributes.cc (Object_attribute::size): Ditto.
12639 (Attributes_section_data::size): Ditto.
12640 (Attributes_section_data::Attributes_section_data): Ditto.
12641 (Output_attributes_section_data::do_write): Ditto.
12642 * attributes.h (Object_attribute::set_type): Ditto.
12643 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12644
12645 2009-12-11 Nick Clifton <nickc@redhat.com>
12646
12647 * archive.cc: Fix shadowed variable warnings.
12648 * arm.cc: Likewise.
12649 * compressed_output.cc: Likewise.
12650 * compressed_output.h: Likewise.
12651 * configure: Likewise.
12652 * dwarf_reader.cc: Likewise.
12653 * dynobj.cc: Likewise.
12654 * dynobj.h: Likewise.
12655 * ehframe.cc: Likewise.
12656 * ehframe.h: Likewise.
12657 * errors.cc: Likewise.
12658 * expression.cc: Likewise.
12659 * fileread.cc: Likewise.
12660 * fileread.h: Likewise.
12661 * freebsd.h: Likewise.
12662 * i386.cc: Likewise.
12663 * icf.cc: Likewise.
12664 * incremental.h: Likewise.
12665 * layout.cc: Likewise.
12666 * layout.h: Likewise.
12667 * mapfile.cc: Likewise.
12668 * merge.cc: Likewise.
12669 * merge.h: Likewise.
12670 * object.cc: Likewise.
12671 * object.h: Likewise.
12672 * options.h: Likewise.
12673 * output.cc: Likewise.
12674 * output.h: Likewise.
12675 * parameters.cc: Likewise.
12676 * plugin.cc: Likewise.
12677 * powerpc.cc: Likewise.
12678 * reduced_debug_output.cc: Likewise.
12679 * reduced_debug_output.h: Likewise.
12680 * reloc.cc: Likewise.
12681 * reloc.h: Likewise.
12682 * resolve.cc: Likewise.
12683 * script-sections.cc: Likewise.
12684 * script.cc: Likewise.
12685 * script.h: Likewise.
12686 * sparc.cc: Likewise.
12687 * symtab.cc: Likewise.
12688 * symtab.h: Likewise.
12689 * target-select.cc: Likewise.
12690 * target-select.h: Likewise.
12691 * token.h: Likewise.
12692 * workqueue.cc: Likewise.
12693 * workqueue.h: Likewise.
12694 * x86_64.cc: Likewise.
12695
12696 2009-12-10 Doug Kwan <dougkwan@google.com>
12697
12698 * arm.cc (attributes.h): New include.
12699 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12700 (Arm_relobj::~Arm_relobj): Delete object pointed by
12701 attributes_section_data_.
12702 (Arm_relobj::attributes_section_data): New method definition.
12703 (Arm_relobj::attributes_section_data_): New data member declaration.
12704 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12705 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12706 attributes_section_data_.
12707 (Arm_dynobj::attributes_section_data): New method definition.
12708 (Arm_dynobj::attributes_section_data_): New data member declaration.
12709 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12710 initialization value of may_use_blx_ to false.
12711 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12712 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12713 object attributes to compute results instead of hard-coding.
12714 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12715 Target_arm::get_secondary_compatible_arch,
12716 Target_arm::set_secondary_compatible_arch
12717 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12718 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12719 New method declarations.
12720 (Target_arm::get_aeabi_object_attribute): New method definition.
12721 (Target_arm::attributes_section_data_): New data member declaration.
12722 (read_arm_attributes_section): New template definition.
12723 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12724 (Arm_dynobj::do_read_symbols): Ditto.
12725 (Target_arm::do_finalize_sections): Merge attributes sections from
12726 input. Check for BLX use after attributes section merging.
12727 Fix __exidx_start and __exidx_end visibility. Create an
12728 .ARM.attributes section if necessary.
12729 (Target_arm::get_secondary_compatible_arch,
12730 Target_arm::set_secondary_compatible_arch,
12731 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12732 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12733 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12734 New method definitions.
12735
12736 2009-12-09 Ian Lance Taylor <iant@google.com>
12737
12738 * plugin.cc (Plugin::load): Don't cast from void* to a function
12739 pointer.
12740
12741 2009-12-09 Ian Lance Taylor <iant@google.com>
12742
12743 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12744 information fields.
12745
12746 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12747
12748 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12749 Replace two_file_shared_1.so with two_file_shared_2.so.
12750 * testsuite/Makefile.in: Regenerated.
12751
12752 2009-12-08 Doug Kwan <dougkwan@google.com>
12753
12754 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12755 (HFILES): Add attributes.h and int_encoding.h.
12756 * Makefile.in: Regenerate.
12757 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12758 function definitions to int_encoding.cc
12759 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12760 prototypes to int_encoding.h
12761 * reduced_debug_output.cc (int_encoding.h): New include.
12762 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12763 function definitions to int_encoding.cc
12764 (insert_into_vector, read_from_pointer): Move template definitions to
12765 int_encoding.h
12766 * attributes.cc: New file.
12767 * attributes.h: New file.
12768 * int_encoding.cc: New file.
12769 * int_encoding.h: New file.
12770
12771 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12772
12773 PR gold/11055
12774 * incremental-dump.cc (dump_incremental_inputs): New.
12775 (main): Use dump_incremental_inputs.
12776
12777 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12778
12779 PR gold/10893
12780 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12781 checking elfcpp::STT_FUNC.
12782 (Target_i386::Relocate::relocate): Likewise.
12783 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12784
12785 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12786 symbols from shared libraries into normal FUNC symbols.
12787
12788 * symtab.h (Symbol): Add is_func and use it.
12789
12790 2009-12-05 Doug Kwan <dougkwan@google.com>
12791
12792 * arm.cc (Target_arm::arm_info): Initialize new fields
12793 attributes_section and attributes_vendor.
12794 * i386.cc (Target_i386::i386_info): Same.
12795 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12796 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12797 fields attributes_section and attributes_vendor.
12798 * sparc.cc (Target_sparc::sparc_info): Same.
12799 * target.h (Target::attributes_section, Target::attributes_vendor,
12800 Target::is_attributes_section, Target::attribute_arg_type,
12801 Target::attributes_order): New method definitions.
12802 (Target::Target_info::attributes_section,
12803 Target::Target_info::attributes_vendor): New fields.
12804 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12805 virtual method definitions.
12806 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12807 attributes_section and attributes_vendor.
12808 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12809
12810 2009-12-05 Doug Kwan <dougkwan@google.com>
12811
12812 * arm.cc: Update comments about interworking and stub generation.
12813 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12814 considered as non-PIC.
12815 (Arm_relocate_functions::base_abs): Fix formatting.
12816 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12817 of function to use GOT entry address instead of offset.
12818 (Target_arm::Scan::global): Issue an error if a symbol would need a
12819 PLT does not get one because it is untyped. Remove code to create
12820 dynamic symbols for relative branches.
12821 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12822 takes unsigned integer instead of boolean.
12823
12824 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12825
12826 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12827 (two_file_test_LDADD): Likewise.
12828 (common_test_1_LDADD): Likewise.
12829 (exception_test_LDADD) Likewise.
12830 (weak_test_LDADD): Likewise.
12831 (many_sections_test_LDADD): Likewise.
12832 (initpri1_LDADD): Likewise.
12833 (script_test_1_LDADD): Likewise.
12834 (script_test_2_LDADD): Likewise.
12835 (justsyms_LDADD): Likewise.
12836 (binary_test_LDADD): Likewise.
12837 (large_LDADD): Likewise.
12838 * testsuite/Makefile.in: Regenerated.
12839
12840 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12841
12842 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12843 (Symbol_table::override_with_special): Likewise.
12844 (Symbol_table::add_from_object): Likewise.
12845
12846 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12847
12848 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12849 Don't set the data_offset twice.
12850
12851 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12852
12853 * testsuite/Makefile.in: Regenerate.
12854
12855 2009-12-03 Doug Kwan <dougkwan@google.com>
12856
12857 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12858 (Target_arm::do_finalize_sections): Add parameter for symbol table
12859 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12860 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12861 parameter for symbol table pointer.
12862 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12863 an additional parameter for a pointer to symbol table.
12864 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12865 parameter for a symbol table pointer.
12866 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12867 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12868 Ditto.
12869 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12870 parameter for a symbol table pointer.
12871
12872 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12873
12874 * incremental.cc (Incremental_inputs_header)
12875 (Incremental_inputs_header_write, Incremental_inputs_entry)
12876 (Incremental_inputs_entry_write): Move ...
12877 * incremental.h (Incremental_inputs_header)
12878 (Incremental_inputs_header_write, Incremental_inputs_entry)
12879 (Incremental_inputs_entry_write): here.
12880
12881 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12882
12883 * incremental.cc (make_sized_incremental_binary): Set the target.
12884 Error if it is incompatible.
12885 * output.h (Output_file): Add filename method.
12886
12887 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12888
12889 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12890 from the get_* methods.
12891
12892 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12893
12894 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12895 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12896 Write 0 for the data_offset of scripts.
12897
12898 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12899
12900 * testsuite/Makefile.am: Add the incremental_test.sh test.
12901 * testsuite/incremental_test.sh: New.
12902 * testsuite/incremental_test_1.c: New.
12903 * testsuite/incremental_test_2.c: New.
12904
12905 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12906
12907 * incremental-dump.cc (main): Fix typos.
12908
12909 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12910
12911 PR gold/11025
12912 * incremental-dump.cc (main): Use llu to print 64 bit values.
12913
12914 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12915 H.J. Lu <hongjiu.lu@intel.com>
12916
12917 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12918 $(LIBDL).
12919 (incremental_dump_LDADD): Likewise.
12920 * Makefile.in: Regenerated.
12921
12922 2009-11-25 Doug Kwan <dougkwan@google.com>
12923
12924 Revert:
12925
12926 2009-11-25 Doug Kwan <dougkwan@google.com>
12927
12928 * arm.cc (Target_arm::Target_arm): Move method definition
12929 outside of class definition. Add code to handle
12930 --target1-rel, --target1-abs and --target2= options.
12931 (Target_arm::get_reloc_reloc_type): Change method to be
12932 non-static and const.
12933 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12934 New data member declaration.
12935 (Target_arm::Scan::local, Target_arm::Scan::global,
12936 Target_arm::Relocate::relocate,
12937 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12938 Adjust call to Target_arm::get_real_reloc_type.
12939 (Target_arm::get_real_reloc_type): Use command line options
12940 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12941 * options.h (--target1-rel, --target1-abs, --target2): New
12942 ARM-only options.
12943
12944 2009-11-25 Doug Kwan <dougkwan@google.com>
12945
12946 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12947 class definition. Add code to handle --target1-rel, --target1-abs
12948 and --target2= options.
12949 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12950 and const.
12951 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12952 member declaration.
12953 (Target_arm::Scan::local, Target_arm::Scan::global,
12954 Target_arm::Relocate::relocate,
12955 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12956 call to Target_arm::get_real_reloc_type.
12957 (Target_arm::get_real_reloc_type): Use command line options to
12958 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12959 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12960 options.
12961
12962 2009-11-25 Doug Kwan <dougkwan@google.com>
12963
12964 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12965 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12966 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12967 formatting.
12968 (Arm_relocate_functions::thm_call): Replace body with a call to
12969 Arm_relocate_functions::thumb_branch_common.
12970 (Arm_relocate_functions::thm_jump24,
12971 Arm_relocate_functions::thm_xpc22): New method definitions.
12972 (Arm_relocate_functions::thumb_branch_common): New method definition.
12973 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12974 operator.
12975 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12976 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12977
12978 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12979
12980 * Makefile.am: Build incremental-dump
12981 * Makefile.in: Regenerate.
12982 * incremental-dump.cc: New.
12983 * incremental.cc (Incremental_inputs_header_data,
12984 Incremental_inputs_entry_data): Move to incremental.h
12985 * incremental.h: (Incremental_inputs_header_data,
12986 Incremental_inputs_entry_data): Move from incremental.cc
12987
12988 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12989
12990 * incremental.cc (Incremental_inputs_header,
12991 Incremental_inputs_header_write, Incremental_inputs_entry,
12992 Incremental_inputs_entry_write): Add a typedef with the data type.
12993
12994 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12995
12996 * incremental.cc (Incremental_inputs_header,
12997 Incremental_inputs_header_write, Incremental_inputs_entry,
12998 Incremental_inputs_entry_write): Update comment about which
12999 type has the filed descriptions.
13000
13001 2009-11-15 Doug Kwan <dougkwan@google.com>
13002
13003 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
13004 (Arm_relocate_functions::arm_branch_common): Change method defintion
13005 in class definition to a method declaration and update list of formal
13006 parameters.
13007 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
13008 Arm_relocation_functions::jump24): Adjust call to
13009 Arm_relocate_functions::arm_branch_common. Update list of formal
13010 parameters.
13011 (Arm_relocate_functions::xpc25): New method definition.
13012 (Arm_relocate_functions::arm_branch_common): Move method defintion
13013 out from class definition. Use stubs for mode-switching and extending
13014 branch ranges.
13015 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
13016 specially. Change code to enable use of stubs in ARM branches.
13017
13018 2009-11-10 Doug Kwan <dougkwan@google.com>
13019
13020 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
13021 in method declaration.
13022 (Target_arm::relocate_stub): New method declaration.
13023 (Target_arm::default_target): Change to return a pointer instead of
13024 a const reference.
13025 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
13026 Target_arm::default_target.
13027 (Arm_Relobj::do_relocate_sections): Remove options paramater in
13028 method definition.
13029 (Target_arm::relocate_section): Adjust view.
13030 (Target_arm::relocate_stub): New method definition.
13031
13032 2009-11-10 Doug Kwan <dougkwan@google.com>
13033
13034 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
13035 a format warning.
13036 * incremental.cc (open_incremental_binary): Initialized local
13037 variables to avoid warnings.
13038 * object.cc (make_elf_object): Ditto.
13039 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
13040 a format warning.
13041
13042 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
13043
13044 PR gold/10930
13045 * testsuite/plugin_test.c: Include "config.h".
13046
13047 2009-11-09 Doug Kwan <dougkwan@google.com>
13048
13049 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
13050 (arm_symbol_value): Remove.
13051 (Arm_relocate_functions::arm_branch_common,
13052 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
13053 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
13054 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
13055 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
13056 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
13057 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
13058 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
13059 Arm_relocate_functions::thm_mobw_abs_nc,
13060 Arm_relocate_functions::thm_mov_abs,
13061 Arm_relocate_functions::movw_prel_nc,
13062 Arm_relocate_functions::thm_movt_abs,
13063 Arm_relocate_functions::movt_prel,
13064 Arm_relocate_functions::thm_movw_prel_nc,
13065 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
13066 (Target_arm::Relocate::relocate): Only decompose address into two
13067 parts if relocation type uses the thumb-bit and pass the actual
13068 bit instead of a flag indicating that the thumb-bit is used. Adjust
13069 calls to methods in Arm_relocate_functions for this change.
13070
13071 2009-11-08 Ian Lance Taylor <iant@google.com>
13072
13073 PR 10925
13074 * reloc.cc: Instantiate
13075 Sized_relobj::initialize_input_to_output_maps and
13076 Sized_relobj:free_input_to_output_maps.
13077
13078 2009-11-06 Ian Lance Taylor <iant@google.com>
13079
13080 PR 10876
13081 * defstd.cc (in_segment): Set only_if_ref true for "end".
13082
13083 2009-11-06 Doug Kwan <dougkwan@google.com>
13084
13085 * arm.cc (class Reloc_stub): Correct a comment.
13086 (Target_arm::Target_arm): Initialize arm_input_section_map_.
13087 (Target_arm::scan_section_for_stubs): New method declaration.
13088 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
13089 Change methods from private to protected.
13090 (Target_arm::do_may_relax): New method definition.
13091 (Target_arm::do_relax, Target_arm::group_sections,
13092 Target_arm::scan_reloc_for_stub,
13093 Target_arm::scan_reloc_section_for_stubs): New method declarations.
13094 (Target_arm::arm_input_section_map_): New data member declaration.
13095 (Target_arm::scan_reloc_for_stub,
13096 Target_arm::scan_reloc_section_for_stubs,
13097 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
13098 Target_arm::do_relax): New method definitions.
13099
13100 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
13101
13102 * configure.ac: Check for (struct stat)::st_mtim
13103 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13104 * config.in: Regenerate.
13105 * configure: Regenerate.
13106
13107 2009-11-05 Ian Lance Taylor <iant@google.com>
13108
13109 PR 10910
13110 * output.cc (Output_segment::add_output_section): Add missing
13111 return statement.
13112
13113 2009-11-04 Ian Lance Taylor <iant@google.com>
13114
13115 PR 10880
13116 * object.h (class Object): Add is_needed and set_is_needed
13117 methods. Add is_needed_ field. Make bool fields into bitfields.
13118 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13119 defined in a dynamic object and referenced by a regular object,
13120 set is_needed for the dynamic object.
13121 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13122 if the file is marked with as_needed and it is not needed.
13123
13124 2009-11-04 Ian Lance Taylor <iant@google.com>
13125
13126 PR 10887
13127 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13128 tags if data is discarded by linker script.
13129 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13130 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13131 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13132 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13133
13134 2009-11-04 Ian Lance Taylor <iant@google.com>
13135
13136 * layout.cc (Layout::get_output_section): Add is_interp and
13137 is_dynamic_linker_section parameters. Change all callers.
13138 (Layout::choose_output_section): Likewise.
13139 (Layout::make_output_section): Likewise.
13140 (Layout::add_output_section_data): Add is_dynamic_linker_section
13141 parameter. Change all callers.
13142 * layout.h (class Layout): Update declarations.
13143 * output.h (class Output_section): Add is_interp, set_is_interp,
13144 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13145 Add is_interp_, is_dynamic_linker_section_ fields. Change
13146 generate_code_fills_at_write_ to a bitfield.
13147 * output.cc (Output_section::Output_sections): Initialize new
13148 fields.
13149 (Output_segment::add_output_section): Add do_sort parameter.
13150 Change all callers.
13151
13152 2009-11-03 Ian Lance Taylor <iant@google.com>
13153
13154 PR 10860
13155 * options.h (class General_options): Add --warn-common.
13156 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13157 merging two common symbols.
13158 (Symbol_table::should_override): Handle --warn-common when merging
13159 a common symbol with a defined symbol. Use report_resolve_problem
13160 for multiple definitions.
13161 (Symbol_table::report_resolve_problem): New function.
13162 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13163
13164 2009-11-03 Doug Kwan <dougkwan@google.com>
13165
13166 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13167 stub_factory_.
13168 (Target_arm::stub_factory): New method definition.
13169 (Target_arm::new_arm_input_section,
13170 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13171 Target_arm::reloc_uses_thumb_bit): New method declarations.
13172 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
13173 New type definitions.
13174 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13175 member declarations.
13176 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13177 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13178 New method definitions.
13179
13180 2009-11-03 Ian Lance Taylor <iant@google.com>
13181
13182 * options.h (class General_options): Add --warn_constructors.
13183
13184 2009-11-03 Ian Lance Taylor <iant@google.com>
13185
13186 PR 10893
13187 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13188 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13189
13190 2009-11-03 Ian Lance Taylor <iant@google.com>
13191
13192 PR 10895
13193 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13194 --msgid-bugs-address.
13195 (install-pdf): New target.
13196 (install-data_yes): Look up one directory to find mkinstalldirs.
13197
13198 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13199
13200 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13201 tree.
13202
13203 2009-10-30 Doug Kwan <dougkwan@google.com>
13204
13205 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13206
13207 2009-10-30 Doug Kwan <dougkwan@google.com>
13208
13209 * arm.cc (Stub_addend_reader): New struct template definition
13210 and partial specializations.
13211 (Stub_addend_reader::operator()): New method definition for a
13212 partially specialized template.
13213
13214 2009-10-30 Doug Kwan <dougkwan@google.com>
13215
13216 * arm.cc (Arm_relobj::processor_specific_flags): New method
13217 definition.
13218 (Arm_relobj::do_read_symbols): New method declaration.
13219 (Arm_relobj::processor_specific_flags_): New data member declaration.
13220 (Arm_dynobj): New class definition.
13221 (Target_arm::do_finalize_sections): Add input_objects parameter.
13222 (Target_arm::do_adjust_elf_header): New method declaration.
13223 (Target_arm::are_eabi_versions_compatible,
13224 (Target_arm::merge_processor_specific_flags): New method declaration.
13225 (Target_arm::do_make_elf_object): New overloaded method definitions
13226 and declaration.
13227 (Arm_relobj::do_read_symbols): New method definition.
13228 (Arm_dynobj::do_read_symbols): Ditto.
13229 (Target_arm::do_finalize_sections): Add input_objects parameters.
13230 Merge processor-specific flags from all input objects.
13231 (Target_arm::are_eabi_versions_compatible,
13232 Target_arm::merge_processor_specific_flags,
13233 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13234 New method definitions.
13235 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13236 Input_objects pointer type parameter.
13237 * layout.cc (Layout::finalize): Pass input objects to target's.
13238 finalize_sections function.
13239 * output.cc (Output_file_header::do_sized_write): Set ELF file
13240 header's processor-specific flags.
13241 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13242 Input_objects pointer type parameter.
13243 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13244 * target.h (Input_objects): New forward class declaration.
13245 (Target::processor_specific_flags,
13246 Target::are_processor_specific_flags_sect): New method definitions.
13247 (Target::finalize_sections): Add input_objects parameter.
13248 (Target::Target): Initialize processor_specific_flags_ and
13249 are_processor_specific_flags_set_.
13250 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13251 parameter.
13252 (Target::set_processor_specific_flags): New method definition.
13253 (Target::processor_specific_flags_,
13254 Target::are_processor_specific_flags_set_): New data member
13255 declarations.
13256 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13257 Input_objects pointer type parameter.
13258
13259 2009-10-30 Doug Kwan <dougkwan@google.com>
13260
13261 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13262
13263 2009-10-28 Ian Lance Taylor <iant@google.com>
13264
13265 * object.h (class Relobj): Drop options parameter from
13266 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13267 do_scan_relocs, do_relocate. Change all callers.
13268 (class Sized_relobj): Drop options parameters from
13269 do_gc_process_relocs, do_scan_relocs, do_relocate,
13270 do_relocate_sections, relocate_sections, emit_relocs_scan,
13271 emit_relocs_scan_reltype. Change all callers.
13272 (struct Relocate_info): Remove options field and all references to
13273 it.
13274 * reloc.h (class Read_relocs): Remove options constructor
13275 parameter and options_ field. Change all callers.
13276 (class Gc_process_relocs, class Scan_relocs): Likewise.
13277 (class Relocate_task): Likewise.
13278 * target-reloc.h (scan_relocs): Remove options parameter. Change
13279 all callers.
13280 (scan_relocatable_relocs): Likewise.
13281 * target.h (class Sized_target): Remove options parameter from
13282 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13283 all callers.
13284 * gc.h (gc_process_relocs): Remove options parameter. Change all
13285 callers.
13286 * arm.cc: Update functions to remove options parameters.
13287 * i386.cc: Likewise.
13288 * powerpc.cc: Likewise.
13289 * sparc.cc: Likewise.
13290 * x86_64.cc: Likewise.
13291 * testsuite/testfile.cc: Likewise.
13292
13293 2009-10-28 Doug Kwan <dougkwan@google.com>
13294
13295 * arm.cc (Arm_relobj): New class definition.
13296 (Arm_relobj::scan_sections_for_stubs,
13297 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13298 New method definitions.
13299
13300 2009-10-28 Cary Coutant <ccoutant@google.com>
13301
13302 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13303 (Plugin::cleanup_done_): New member.
13304 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13305 (Plugin_manager::cleanup_done_): Remove.
13306 (Plugin_manager::add_input_file): Edit error message.
13307 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13308 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13309
13310 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13311
13312 * fileread.cc: (File_read::View::~View): Use the new
13313 data_ownership_ filed.
13314 (File_read::~File_read): Dispose the new whole_file_view_.
13315 (File_read::open): Mmap the whole file if needed.
13316 (File_read::open): Use whole_file_view_ instead of contents_.
13317 (File_read::find_view): Use whole_file_view_ if applicable.
13318 (File_read::do_read): Use whole_file_view_ instead of contents_.
13319 (File_read::make_view): Use whole_file_view_ instead of contents_,
13320 update File_read::View::View call.
13321 (File_read::find_or_make_view): Update File_read::View::View
13322 call.
13323 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13324 remove contents_
13325 (File_read::View::Data_ownership): New enum.
13326 (File_read::View::View): Replace bool mapped_ with Data_ownership
13327 argument.
13328 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13329 (File_read::View::data_ownership_): New field.
13330 (File_read::contents_): Remove (replaced by whole_file_view_).
13331 (File_read::whole_file_view_): New field.
13332 * options.h (class General_options): Add --keep-files-mapped.
13333
13334 2009-10-27 Cary Coutant <ccoutant@google.com>
13335
13336 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13337 * testsuite/Makefile.am (plugin_test_5): New test case.
13338 * testsuite/Makefile.in: Regenerate.
13339
13340 2009-10-25 Doug Kwan <dougkwan@google.com>
13341
13342 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13343 from private to protected to allow access by child class.
13344 (Sized_relobj::do_relocate_sections): New method declaration.
13345 (Sized_relobj::relocate_sections): Virtualize.
13346 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13347 Sized_relobj::relocate_sections. Instantiate template explicitly
13348 for different target sizes and endianity.
13349
13350 2009-10-24 Doug Kwan <dougkwan@google.com>
13351
13352 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13353 (Arm_input_section::as_arm_input_section): New method.
13354 (Arm_output_section): New class definition.
13355 (Arm_output_section::create_stub_group,
13356 Arm_output_section::group_sections): New method definitions.
13357
13358 2009-10-22 Doug Kwan <dougkwan@google.com>
13359
13360 * arm.cc (Arm_input_section): New class definition.
13361 (Arm_input_section::init, Arm_input_section:do_write,
13362 Arm_input_section::set_final_data_size,
13363 Arm_input_section::do_reset_address_and_file_offset): New method
13364 definitions.
13365
13366 2009-10-21 Doug Kwan <dougkwan@google.com>
13367
13368 * arm.cc (Stub_table, Arm_input_section): New forward class
13369 declarations.
13370 (Stub_table): New class defintion.
13371 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13372 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13373 New method definition.
13374
13375 2009-10-21 Doug Kwan <dougkwan@google.com>
13376
13377 * arm.cc: Update copyright comments.
13378 (Target_arm): New forward class template declaration.
13379 (Arm_address): New type.
13380 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13381 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13382 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13383 constants.
13384 (Insn_template): Same.
13385 (DEF_STUBS): New macro.
13386 (Stub_type): New enum type.
13387 (Stub_template): New class definition.
13388 (Stub): Same.
13389 (Reloc_stub): Same.
13390 (Stub_factory): Same.
13391 (Target_arm::Target_arm): Initialize may_use_blx_ and
13392 should_force_pic_veneer_.
13393 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13394 Target_arm::should_force_pic_veneer,
13395 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13396 Target_arm::using_thumb_only, Target_arm:;default_target): New
13397 method defintions.
13398 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13399 New data member declarations.
13400 (Insn_template::size, Insn_template::alignment): New method defintions.
13401 (Stub_template::Stub_template): New method definition.
13402 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13403 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13404 (Stub_factory::Stub_factory): New method definition.
13405 * gold.h (string_hash): New template.
13406 * output.h (Input_section_specifier::hash_value): Use
13407 gold::string_hash.
13408 (Input_section_specifier::string_hash): Remove.
13409 * stringpool.cc (Stringpool_template::string_hash): Use
13410 gold::string_hash.
13411
13412 2009-10-20 Doug Kwan <dougkwan@google.com>
13413
13414 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13415 symbols of relaxed input sections.
13416 * output.h (Output_section::find_relaxed_input_section): Make
13417 method public.
13418
13419 2009-10-16 Doug Kwan <dougkwan@google.com>
13420
13421 * dynobj.cc (Versions::Versions): Initialize version_script_.
13422 Only insert base version symbol definition for a shared object
13423 if version script defines any version versions.
13424 (Versions::define_base_version): New method definition.
13425 (Versions::add_def): Check that base version is not needed.
13426 (Versions::add_need): Define base version lazily.
13427 * dynobj.h (Versions::define_base_version): New method declaration.
13428 (Versions::needs_base_version_): New data member declaration.
13429 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13430 (check_DATA): Add no_version_test.stdout.
13431 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13432 New make rules.
13433 * testsuite/Makefile.in: Regenerate.
13434 * testsuite/no_version_test.c: New file.
13435 * testsuite/no_version_test.sh: Ditto.
13436
13437 2009-10-16 Doug Kwan <dougkwan@google.com>
13438
13439 * expression.cc (class Segment_start_expression): New class definition.
13440 (Segment_start_expression::value): New method definition.
13441 (script_exp_function_segment_start): Return a new
13442 Segment_start_expression.
13443 * gold/script-c.h (script_saw_segment_start_expression): New function
13444 prototype.
13445 * script-sections.cc (Script_sections::Script_sections): Initialize
13446 SAW_SEGMENT_START_EXPRESSION_ to false.
13447 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13448 and -Tbbs options to specify section addresses if given in
13449 command line and no SEGMENT_START expression is seen in a script.
13450 * script-sections.h (Script_sections::saw_segment_start_expression,
13451 Script_sections::set_saw_segment_start_expression): New method
13452 definition.
13453 (Script_sections::saw_segment_start_expression_): New data member
13454 declaration.
13455 * script.cc (script_saw_segment_start_expression): New function.
13456 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13457 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13458 script_test_7.sh and script_test_8.sh.
13459 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13460 script_test_8.stdout.
13461 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13462 (script_test_6, script_test_6.stdout, script_test_7,
13463 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13464 * Makefile.in: Regenerate.
13465 * testsuite/script_test_6.sh: New file.
13466 * testsuite/script_test_6.t: Same.
13467 * testsuite/script_test_7.sh: Same.
13468 * testsuite/script_test_7.t: Same.
13469 * testsuite/script_test_8.sh: Same.
13470
13471 2009-10-16 Doug Kwan <dougkwan@google.com>
13472
13473 * output.cc (Output_segment::set_section_list_address): Cast
13474 expressions to unsigned long long type to avoid format warnings.
13475
13476 2009-10-15 Ian Lance Taylor <iant@google.com>
13477
13478 * script.cc (Script_options::add_symbol_assignment): Always add a
13479 dot assignment to script_sections_.
13480 * script-sections.cc (Script_sections::add_dot_assignment):
13481 Initialize if necessary.
13482
13483 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13484 program headers with no load segment if there is a linker script.
13485
13486 * layout.cc (Layout::set_segment_offsets): Align the file offset
13487 to the segment aligment for -N or -n with no load segment.
13488 * output.cc (Output_segment::add_output_section): Don't crash if
13489 the first section is a TLS section.
13490 (Output_segment::set_section_list_addresses): Print an error
13491 message if the address moves backward in a linker script.
13492 * script-sections.cc
13493 (Output_section_element_input::set_section_addresses): Don't
13494 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13495 (Orphan_output_section::set_section_addresses): Likewise.
13496
13497 2009-10-15 Doug Kwan <dougkwan@google.com>
13498
13499 * layout.cc (Layout::finish_dynamic_section): Generate tags
13500 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13501 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13502 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13503
13504 2009-10-14 Ian Lance Taylor <iant@google.com>
13505
13506 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13507 fields.
13508 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13509 data_shdr fields of relinfo.
13510 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13511 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13512 R_386_TLS_LDO_32, adjust based on section flags.
13513 (Target_i386::Relocate::fix_up_ldo): Remove.
13514
13515 2009-10-13 Ian Lance Taylor <iant@google.com>
13516
13517 Add support for -pie.
13518 * options.h (class General_options): Add -pie and
13519 --pic-executable.
13520 (General_options::output_is_position_independent): Test -pie.
13521 (General_options::output_is_executable): Return true if not shared
13522 and not relocatable.
13523 (General_options::output_is_pie): Remove.
13524 * options.cc (General_options::finalize): Reject incompatible uses
13525 of -pie.
13526 * gold.cc (queue_middle_tasks): A -pie link is not static.
13527 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13528 * symtab.cc (Symbol::final_value_is_known): Return false if
13529 output_is_position_independent.
13530 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13531 output_is_position_independent.
13532 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13533 output_is_position_independent.
13534 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13535 output_is_position_independent.
13536 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13537 two_file_pie_test.
13538 (basic_pie_test.o, basic_pie_test): New targets.
13539 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13540 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13541 (two_file_pie_test): New target.
13542 * testsuite/Makefile.in: Rebuild.
13543 * README: Remove note saying that -pie is not supported.
13544
13545 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13546
13547 * options.h (class General_options): Add -init and -fini.
13548 * layout.cc (Layout::finish_dynamic_section): Emit
13549 given init and fini functions.
13550
13551 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13552
13553 * gc.h (gc_process_relocs): Check if icf is enabled using new
13554 function.
13555 * gold.cc (queue_initial_tasks): Likewise.
13556 (queue_middle_tasks): Likewise.
13557 * object.cc (do_layout): Likewise.
13558 * symtab.cc (is_section_folded): Likewise.
13559 * main.cc (main): Likewise.
13560 * reloc.cc (Read_relocs::run): Likewise.
13561 (Sized_relobj::do_scan_relocs): Likewise.
13562 * icf.cc (is_function_ctor_or_dtor): New function.
13563 (Icf::find_identical_sections): Check if function is ctor or dtor when
13564 safe icf is chosen.
13565 * options.h (General_options::icf): Change option to be an enum.
13566 (Icf_status): New enum.
13567 (icf_enabled): New method.
13568 (icf_safe_folding): New method.
13569 (set_icf_status): New method.
13570 (icf_status_): New variable.
13571 * (options.cc) (General_options::finalize): Set icf_status_.
13572 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13573 icf_test and icf_keep_unique_test to use the --icf enum flag.
13574 * testsuite/icf_safe_test.sh: New file.
13575 * testsuite/icf_safe_test.cc: New file.
13576
13577 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13578
13579 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13580 includes to gc.h and icf.h.
13581 * arm.cc: Include gc.h.
13582 * gold.cc: Likewise.
13583 * i386.cc: Likewise.
13584 * powerpc.cc: Likewise.
13585 * sparc.cc: Likewise.
13586 * x86_64.cc: Likewise.
13587 * gc.h: Include icf.h.
13588
13589 2009-10-11 Ian Lance Taylor <iant@google.com>
13590
13591 * plugin.cc: Include "gold.h" before other header files.
13592
13593 2009-10-10 Chris Demetriou <cgd@google.com>
13594
13595 * options.h (Input_file_argument::Input_file_type): New enum.
13596 (Input_file_argument::is_lib_): Replace with...
13597 (Input_file_argument::type_): New member.
13598 (Input_file_argument::Input_file_argument): Take Input_file_type
13599 'type' rather than boolean 'is_lib' as second argument.
13600 (Input_file_argument::is_lib): Use type_.
13601 (Input_file_argument::is_searched_file): New function.
13602 (Input_file_argument::may_need_search): Handle is_searched_file.
13603 * options.cc (General_options::parse_library): Support -l:filename.
13604 (General_options::parse_just_symbols): Update for Input_file_argument
13605 changes.
13606 (Command_line::process): Likewise.
13607 * archive.cc (Archive::get_file_and_offset): Likewise.
13608 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13609 * script.cc (read_script_file, script_add_file): Likewise.
13610 * fileread.cc (Input_file::Input_file): Likewise.
13611 (Input_file::will_search_for): Handle is_searched_file.
13612 (Input_file::open): Likewise.
13613 * readsyms.cc (Read_symbols::get_name): Likewise.
13614 * testsuite/Makefile.am (searched_file_test): New test.
13615 * testsuite/Makefile.in: Regenerate.
13616 * testsuite/searched_file_test.cc: New file.
13617 * testsuite/searched_file_test_lib.cc: New file.
13618
13619 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13620 Ian Lance Taylor <iant@google.com>
13621
13622 * descriptor.cc: Include <cstdio> and "binary-io.h".
13623 (Descriptors::open): Open the files in binary mode always.
13624 * script.cc (Lex::get_token): Treat \r as whitespace.
13625
13626 2009-10-09 Ian Lance Taylor <iant@google.com>
13627
13628 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13629
13630 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13631 Ian Lance Taylor <iant@google.com>
13632
13633 * configure.ac: Check for readv function also.
13634 * fileread.cc (readv): Define if not HAVE_READV.
13635 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13636 does not exist.
13637 * config.in: Regenerate.
13638 * configure: Regenerate.
13639
13640 2009-10-09 Doug Kwan <dougkwan@google.com>
13641
13642 * layout.cc (Layout::make_output_section): Call target hook to make
13643 ordinary output section.
13644 (Layout::finalize): Adjust parameter list of call the
13645 Target::may_relax().
13646 * layout.h (class Layout::section_list): New method.
13647 * merge.h (Output_merge_base::entsize): Change visibility to public.
13648 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13649 New methods.
13650 (Output_merge_string::do_is_string): New method.
13651 * object.cc (Sized_relobj::do_setup): renamed from
13652 Sized_relobj::set_up.
13653 * object.h (Sized_relobj::adjust_shndx,
13654 Sized_relobj::initializ_input_to_output_maps,
13655 Sized_relobj::free_input_to_output_maps): Change visibilities to
13656 protected.
13657 (Sized_relobj::setup): Virtualize.
13658 (Sized_relobj::do_setup): New method declaration.
13659 (Sized_relobj::invalidate_section_offset,
13660 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13661 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13662 * options.cc (parse_int): New function.
13663 * options.h (parse_int): New declaration.
13664 (DEFINE_int): New macro.
13665 (stub_group_size): New option.
13666 * output.cc (Output_section::Output_section): Initialize memebers
13667 merge_section_map_, merge_section_by_properties_map_,
13668 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13669 (Output_section::add_input_section): Handled deferred code-fill
13670 generation and remove an old comment.
13671 (Output_section::add_relaxed_input_section): New method definition.
13672 (Output_section::add_merge_input_section): Use merge section by
13673 properties map to speed to search. Update merge section maps
13674 as appropriate.
13675 (Output_section::build_relaxation_map): New method definition.
13676 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13677 Same.
13678 (Output_section::relax_input_section): Renamed to
13679 Output_section::convert_input_sections_to_relaxed_sections and change
13680 interface to take a vector of pointers to relaxed sections.
13681 (Output_section::find_merge_section,
13682 Output_section::find_relaxed_input_section): New method definitions.
13683 (Output_section::is_input_address_mapped,
13684 Output_section::output_offset, Output_section::output_address):
13685 Use output section data maps to speed up searching.
13686 (Output_section::find_starting_output_address): Add comments.
13687 (Output_section::do_write,
13688 Output_section::write_to_postprocessing_buffer): Do code-fill
13689 generation as appropriate.
13690 (Output_section::get_input_sections): Invalidate relaxed input section
13691 map.
13692 (Output_section::restore_states): Adjust type of checkpoint .
13693 Invalidate relaxed input section map.
13694 * output.h (Output_merge_base): New class declaration.
13695 (Input_section_specifier): New class defintion.
13696 (class Output_relaxed_input_section) Change base class to
13697 Output_section_data_build.
13698 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13699 base class initializer.
13700 (Output_section::add_relaxed_input_section): New method declaration.
13701 (Output_section::Input_section): Change visibility to protected.
13702 (Output_section::Input_section::relobj,
13703 Output_section::Input_section::shndx): Handle relaxed input sections.
13704 Output_section::input_sections) Change visibility to protected. Also
13705 define overload to return a non-const pointer.
13706 (Output_section::Merge_section_properties): New class defintion.
13707 (Output_section::Merge_section_by_properties_map,
13708 Output_section::Output_section_data_by_input_section_map,
13709 Output_section::Relaxation_map): New types.
13710 (Output_section::relax_input_section): Rename method to
13711 Output_section::convert_input_sections_to_relaxed_sections and change
13712 interface to take a vector of relaxed section pointers.
13713 (Output_section::find_merge_section,
13714 Output_section::find_relaxed_input_section,
13715 Output_section::build_relaxation_map,
13716 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13717 New method declarations.
13718 (Output_section::merge_section_map_
13719 Output_section::merge_section_by_properties_map_,
13720 Output_section::relaxed_input_section_map_,
13721 Output_section::is_relaxed_input_section_map_valid_,
13722 Output_section::generate_code_fills_at_write_): New data members.
13723 * script-sections.cc
13724 (Output_section_element_input::set_section_addresses): Call
13725 current_data_size and addralign methods of relaxed input sections.
13726 (Orphan_output_section::set_section_addresses): Call current_data_size
13727 and addralign methods of relaxed input sections.
13728 * symtab.cc (Symbol_table::compute_final_value): Extract template
13729 from the body of Symbol_table::sized_finalize_symbol.
13730 (Symbol_table::sized_finalized_symbol): Call
13731 Symbol_table::compute_final_value.
13732 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13733 (Symbol_table::compute_final_value): New templated method declaration.
13734 * target.cc (Target::do_make_output_section): New method defintion.
13735 * target.h (Target::make_output_section): New method declaration.
13736 (Target::relax): Add more parameters for input objects, symbol table
13737 and layout. Adjust call to do_relax.
13738 (Target::do_make_output_section): New method declaration.
13739 (Target::do_relax): Add parameters for input objects, symbol table
13740 and layout.
13741
13742 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13743
13744 * pread.c: Include stdio.h.
13745
13746 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13747
13748 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13749 defined.
13750
13751 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13752
13753 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13754 Change read_shndx type to unsigned int.
13755 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13756 int.
13757 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13758 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13759 Change read_shndx type to unsigned int.
13760 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13761 int.
13762 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13763 * layout.cc (Layout::create_symtab_sections): Cast the result of
13764 local_symcount * symsize to off_t in the gold_assert.
13765
13766 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13767
13768 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13769 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13770 R_ARM_BASE_ABS.
13771 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13772 (Arm_relocate_functions::thm_abs5): New function.
13773 (Arm_relocate_functions::abs12): New function.
13774 (Arm_relocate_functions::abs16): New function.
13775 (Arm_relocate_functions::base_abs): New function.
13776 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13777 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13778 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13779 R_ARM_BASE_ABS.
13780 (Scan::global): Likewise.
13781 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13782 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13783 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13784 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13785 R_ARM_BASE_ABS.
13786
13787 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13788
13789 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13790 (Arm_relocate_functions::movt_prel): New function.
13791 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13792 (Arm_relocate_functions::thm_movt_prel): New function.
13793 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13794 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13795 (Scan::global, Relocate::relocate): Likewise.
13796 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13797
13798 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13799
13800 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13801 Incremental_checker.
13802 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13803 unsigned int.
13804 (class Incremental_inputs_header): New class.
13805 (Incremental_inputs_header_writer): Edit comment.
13806 (Incremental_inputs_entry): New class.
13807 (Incremental_inputs_entry_writer): Edit comment.
13808 (Sized_incremental_binary::do_find_incremental_inputs_section):
13809 Add *strtab_shndx parameter, fill it.
13810 (Sized_incremental_binary::do_check_inputs): New method.
13811 (Incremental_checker::can_incrementally_link_output_file): Use
13812 Sized_incremental_binary::check_inputs.
13813 (Incremental_inputs::report_command_line): Save command line in
13814 command_line_.
13815 * incremental.h:
13816 (Incremental_binary::find_incremental_inputs_section): New
13817 method.
13818 (Incremental_binary::do_find_incremental_inputs_section): Add
13819 strtab_shndx parameter.
13820 (Incremental_binary::do_check_inputs): New pure virtual method.
13821 (Sized_incremental_binary::do_check_inputs): Declare.
13822 (Incremental_checker::Incremental_checker): Add incremental_inputs
13823 parameter, use it to initialize incremental_inputs_.
13824 (Incremental_checker::incremental_inputs_): New field.
13825 (Incremental_checker::command_line): New method.
13826 (Incremental_checker::inputs): New method.
13827 (Incremental_checker::command_line_): New field.
13828
13829 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13830
13831 * incremental.cc: Include <cstdarg> and "target-select.h".
13832 (vexplain_no_incremental): New function.
13833 (explain_no_incremental): New function.
13834 (Incremental_binary::error): New method.
13835 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13836 method.
13837 (make_sized_incremental_binary): New function.
13838 (open_incremental_binary): New function.
13839 (can_incrementally_link_file): Add checks if output is ELF and has
13840 inputs section.
13841 * incremental.h: Include "elfcpp_file.h" and "output.h".
13842 (Incremental_binary): New class.
13843 (Sized_incremental_binary): New class.
13844 (open_incremental_binary): Declare.
13845 * object.cc (is_elf_object): Use
13846 elfcpp::Elf_recognizer::is_elf_file.
13847 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13848 * output.h (Output_file::filesize): New method.
13849
13850 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13851
13852 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13853 New function.
13854 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13855 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13856 function.
13857 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13858 function.
13859 (Arm_relocate_functions::movw_abs_nc): New function.
13860 (Arm_relocate_functions::movt_abs): New function.
13861 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13862 (Arm_relocate_functions::thm_movt_abs): New function.
13863 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13864 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13865 (Scan::global): Likewise.
13866 (Relocate::relocate): Likewise.
13867 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13868
13869 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13870
13871 * arm.cc (Arm_relocate_functions::got_prel) New function.
13872 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13873 (Relocate::relocate): Likewise.
13874 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13875
13876 2009-10-06 Ian Lance Taylor <iant@google.com>
13877
13878 * options.h (class General_options): Define
13879 split_stack_adjust_size parameter.
13880 * object.h (class Object): Add uses_split_stack_ and
13881 has_no_split_stack_ fields. Add uses_split_stack and
13882 has_no_split_stack accessor functions. Declare
13883 handle_split_stack_section.
13884 (class Reloc_symbol_changes): Define.
13885 (class Sized_relobj): Define Function_offsets. Declare
13886 split_stack_adjust, split_stack_adjust_reltype, and
13887 find_functions.
13888 * object.cc (Object::handle_split_stack_section): New function.
13889 (Sized_relobj::do_layout): Call handle_split_stack_section.
13890 * dynobj.cc (Sized_dynobj::do_layout): Call
13891 handle_split_stack_section.
13892 * reloc.cc (Sized_relobj::relocate_sections): Call
13893 split_stack_adjust for executable sections in split_stack
13894 objects. Pass reloc_map to relocate_section.
13895 (Sized_relobj::split_stack_adjust): New function.
13896 (Sized_relobj::split_stack_adjust_reltype): New function.
13897 (Sized_relobj::find_functions): New function.
13898 * target-reloc.h: Include "object.h".
13899 (relocate_section): Add reloc_symbol_changes parameter. Change
13900 all callers.
13901 * target.h (class Target): Add calls_non_split method. Declare
13902 do_calls_non_split virtual method. Declare match_view and
13903 set_view_to_nop.
13904 * target.cc: Include "elfcpp.h".
13905 (Target::do_calls_non_split): New function.
13906 (Target::match_view): New function.
13907 (Target::set_view_to_nop): New function.
13908 * gold.cc (queue_middle_tasks): Give an error if mixing
13909 split-stack and non-split-stack objects with -r.
13910 * i386.cc (Target_i386::relocate_section): Add
13911 reloc_symbol_changes parameter.
13912 (Target_i386::do_calls_non_split): New function.
13913 * x86_64.cc (Target_x86_64::relocate_section): Add
13914 reloc_symbol_changes parameter.
13915 (Target_x86_64::do_calls_non_split): New function.
13916 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13917 parameter.
13918 * powerpc.cc (Target_powerpc::relocate_section): Add
13919 reloc_symbol_changes parameter.
13920 * sparc.cc (Target_sparc::relocate_section): Add
13921 reloc_symbol_changes parameter.
13922 * configure.ac: Call AM_CONDITIONAL for the default target.
13923 * configure: Rebuild.
13924 * testsuite/Makefile.am (TEST_AS): New variable.
13925 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13926 (check_DATA): Add split_i386 and split_x86_64 files.
13927 (SPLIT_DEFSYMS): Define.
13928 (split_i386_[1234n].o): New targets.
13929 (split_i386_[124]): New targets.
13930 (split_i386_[1234r].stdout): New targets.
13931 (split_x86_64_[1234n].o): New targets.
13932 (split_x86_64_[124]): New targets.
13933 (split_x86_64_[1234r].stdout): New targets.
13934 (MOSTLYCLEANFILES): Add new executables.
13935 * testsuite/split_i386.sh: New file.
13936 * testsuite/split_x86_64.sh: New file.
13937 * testsuite/split_i386_1.s: New file.
13938 * testsuite/split_i386_2.s: New file.
13939 * testsuite/split_i386_3.s: New file.
13940 * testsuite/split_i386_4.s: New file.
13941 * testsuite/split_i386_n.s: New file.
13942 * testsuite/split_x86_64_1.s: New file.
13943 * testsuite/split_x86_64_2.s: New file.
13944 * testsuite/split_x86_64_3.s: New file.
13945 * testsuite/split_x86_64_4.s: New file.
13946 * testsuite/split_x86_64_n.s: New file.
13947 * testsuite/testfile.cc (Target_test): Update relocation_section
13948 function.
13949 * testsuite/Makefile.in: Rebuild.
13950
13951 2009-10-06 Ian Lance Taylor <iant@google.com>
13952
13953 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13954 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13955 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13956 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13957 the address on ldo_addrs_.
13958 (Target_i386::Relocate::fix_up_ldo): New function.
13959
13960 2009-10-06 Rafael Espindola <espindola@google.com>
13961
13962 * plugin.cc (add_input_library): New.
13963 (Plugin::load): Add add_input_library to tv.
13964 (Plugin_manager::add_input_file): Add the is_lib argument.
13965 (add_input_file): Update call to Plugin_manager::add_input_file.
13966 (add_input_library): New.
13967 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13968
13969 2009-09-30 Doug Kwan <dougkwan@google.com>
13970
13971 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13972 symbol and call Symbol::may_need_copy_reloc to determine if
13973 a copy reloc is needed.
13974 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13975 nocopyreloc is given in command line.
13976 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13977 given in command line.
13978 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13979 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13980 of the removed Target_i386::may_need_copy_reloc.
13981 * options.h (copyreloc): New option with default value false.
13982 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13983 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13984 instead of the removed Target_powerpc::may_need_copy_reloc.
13985 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13986 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13987 instead of the removed Target_sparc::may_need_copy_reloc.
13988 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13989 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13990 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13991 instead of the removed Target_x86_64::may_need_copy_reloc.
13992
13993 2009-09-30 Ian Lance Taylor <iant@google.com>
13994
13995 * object.h (class Object): Remove target_ field, and target,
13996 sized_target, and set_target methods.
13997 (Object::sized_target): Remove.
13998 (class Sized_relobj): Update declarations. Remove sized_target.
13999 * object.cc (Sized_relobj::setup): Remove target parameter.
14000 Change all callers.
14001 (Input_objects::add_object): Don't do anything with the target.
14002 (make_elf_sized_object): Add punconfigured parameter. Change all
14003 callers. Set or test parameter target.
14004 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
14005 Change all callers.
14006 * parameters.cc (Parameters::set_target): Change parameter type to
14007 be non-const.
14008 (Parameters::default_target): Remove.
14009 (set_parameters_target): Change parameter type to be non-const.
14010 (parameters_force_valid_target): New function.
14011 (parameters_clear_target): New function.
14012 * parameters.h (class Parameters): Update declarations. Remove
14013 default_target method. Add sized_target and clear_target
14014 methods. Change target_ to be non-const.
14015 (set_parameters_target): Update declaration.
14016 (parameters_force_valid_target): Declare.
14017 (parameters_clear_target): Declare.
14018 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
14019 as NULL if we aren't searching.
14020 (Add_symbols::run): Don't check for compatible target.
14021 * fileread.cc (Input_file::open_binary): Call
14022 parameters_force_valid_target.
14023 * gold.cc (queue_middle_tasks): Likewise.
14024 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
14025 set_target on object.
14026 * dynobj.h (class Sized_dynobj): Update declarations.
14027 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
14028 make_elf_object returns NULL.
14029 (Archive::include_member): Don't check whether object target is
14030 compatible.
14031 * output.cc (Output_section::add_input_section): Get target from
14032 parameters.
14033 (Output_section::relax_input_section): Likewise.
14034 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
14035 parameters.
14036 (Sized_relobj::do_scan_relocs): Likewise.
14037 (Sized_relobj::relocate_sections): Likewise.
14038 * resolve.cc (Symbol_table::resolve): Likewise.
14039 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
14040 parameter. Change all callers.
14041 (Symbol_table::add_from_object): Get target from parameters.
14042 (Symbol_table::add_from_relobj): Don't check object target.
14043 (Symbol_table::add_from_dynobj): Likewise.
14044 (Symbol_table::define_special_symbol): Get target from
14045 parameters.
14046 * symtab.h (class Symbol_table): Update declaration.
14047 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
14048 parameter. Change all callers. Clear parameter target.
14049 (Binary_test): Test target here.
14050 * testsuite/object_unittest.cc (gold_testsuite): Remove
14051 target_test_pointer parameter. Change all callers.
14052 (Object_test): Test target here.
14053
14054 2009-09-26 Ian Lance Taylor <iant@google.com>
14055
14056 * testsuite/initpri1.c: Don't try to use constructor priorities if
14057 compiling with gcc before 4.3.
14058
14059 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
14060
14061 * testsuite/retain_symbols_file_test.sh (check_present): Change
14062 output file name to retain_symbols_file_test.stdout.
14063 (check_absent): Likewise.
14064
14065 2009-09-18 Craig Silverstein <csilvers@google.com>
14066
14067 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
14068 * options.cc: Include <cerrno> and <fstream>.
14069 (General_options::finalize): Parse -retain-symbols-file tag.
14070 * options.h: New flag.
14071 (General_options): New method should_retain_symbol, new
14072 variable symbols_to_retain.
14073 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
14074 should_retain_symbol map.
14075 * testsuite/Makefile.am (retain_symbols_file_test): New test.
14076 * testsuite/Makefile.in: Regenerate.
14077 * testsuite/retain_symbols_file_test.sh: New file.
14078
14079 2009-09-18 Nick Clifton <nickc@redhat.com>
14080
14081 * po/es.po: Updated Spanish translation.
14082
14083 2009-09-17 Doug Kwan <dougkwan@google.com>
14084
14085 * debug.h (DEBUG_RELAXATION): New constant.
14086 (DEBUG_ALL): Add DEBUG_RELAXATION.
14087 (debug_string_to_enum): Add relaxation debug option.
14088 * layout.cc
14089 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
14090 Layout::Relaxation_debug_check::read_sections,
14091 Layout::Relaxation_debug_check::read_sections): New method definitions.
14092 (Layout::Layout): Initialize data members
14093 record_output_section_data_from_scrips_,
14094 script_output_section_data_list_ and relaxation_debug_check_.
14095 (Layout::save_segments, Layout::restore_segments,
14096 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14097 Layout::relaxation_loop_body): New method definitions.
14098 (Layout::finalize): Support relaxation. Move section layout code to
14099 Layout::relaxation_loop_body.
14100 (Layout::set_asection_address_from_script): Move code for orphan
14101 section placement out.
14102 (Layout::place_orphan_sections_in_script): New method definition.
14103 * layout.h (Output_segment_headers, Output_file_header):
14104 New forward class declarations.
14105 (Layout::~Layout): Define.
14106 (Layout::new_output_section_data_from_script): New method definition.
14107 (Layout::place_orphan_sections_in_script): New method declaration.
14108 (Layout::Segment_states): New type declaration.
14109 (Layout::save_segments, Layout::restore_segments,
14110 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14111 Layout::relaxation_loop_body): New method declarations.
14112 (Layout::Output_section_data_list): New type declaration.
14113 (Layout::Relaxation_debug_check): New class definition.
14114 (Layout::record_output_section_data_from_script_,
14115 Layout::script_output_section_data_list_, Layout::segment_states_,
14116 Layout::relaxation_debug_check_): New data members.
14117 * output.cc: (Output_section_headers::do_size): New method definition.
14118 (Output_section_headers::Output_section_headers): Move size
14119 computation to Output_section_headers::do_size.
14120 (Output_segment_headers::do_size): New method definition.
14121 (Output_file_header::Output_file_header): Move size computation to
14122 Output_file_header::do_size and call it.
14123 (Output_file_header::do_size): New method definition.
14124 (Output_data_group::Output_data_group): Adjust call to
14125 Output_section_data.
14126 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14127 (Output_symtab_xindex::do_write): Add array bound check.
14128 (Output_section::Input_section::print_to_mapfile): Handle
14129 RELAXED_INPUT_SECTION_CODE.
14130 (Output_section::Output_section): Initialize data member checkpoint_.
14131 (Output_section::~Output_section): Delete checkpoint object pointed
14132 by checkpoint_.
14133 (Output_section::add_input_section): Always add an Input_section if
14134 relaxing.
14135 (Output_section::add_merge_input_section): Add assert.
14136 (Output_section::relax_input_section): New method definition.
14137 (Output_section::set_final_data_size): Set load address to zero for
14138 an unallocated section.
14139 (Output_section::do_address_and_file_offset_have_reset_values):
14140 New method definition.
14141 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14142 Handle relaxed input section.
14143 (Output_section::sort_attached_input_sections): Checkpoint input
14144 section list lazily.
14145 (Output_section::get_input_sections): Change type of input_sections to
14146 list of Simple_input_section pointers. Checkpoint input section list
14147 lazily. Also handle relaxed input sections.
14148 (Output_section::add_input_section_for_script): Take a reference to
14149 a Simple_input_section object instead of Relobj pointer and section
14150 index as parameter. Handle relaxed input sections.
14151 (Output_section::save_states, Output_section::restore_states): New
14152 method definitions.
14153 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14154 (Output_data::is_data_size_fixed): New method definition.
14155 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14156 if it is fixed.
14157 (Output_data::address_and_file_offset_have_reset_values): New method
14158 definition.
14159 (Output_data::do_address_and_file_offset_have_reset_values): New method
14160 definition.
14161 (Output_data::set_data_size): Check that data size is not fixed.
14162 (Output_data::fix_data_size): New method definition.
14163 (Output_data::is_data_size_fixed_): New data member.
14164 (Output_section_headers::set_final_data_size): New method definition.
14165 (Output_section_headers::do_size): New method declaration.
14166 (Output_segment_headers::set_final_data_size): New method definition.
14167 (Output_segment_headers::do_size): New method declaration.
14168 (Output_file_header::set_final_data_size)::New method definition.
14169 (Output_file_header::do_size)::New method declaration.
14170 (Output_section_data::Output_section_data): Add new parameter
14171 is_data_size_fixed and use it to fix data size.
14172 (Output_data_const::Output_data_const): Adjust call to base class
14173 constructor and fix data size.
14174 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14175 base class constructor and fix data size.
14176 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14177 base class constructor and fix data size.
14178 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14179 class constructor and fix data size.
14180 (Output_data_group::set_final_data_size): New method definition.
14181 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14182 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14183 class constructor and fix data size.
14184 (Output_relaxed_input_section): New class definition.
14185 (Output_section::Simple_input_section): New class definition.
14186 (Output_section::get_input_sections): Adjust parameter list.
14187 (Output_section::add_input_section_for_script): Same.
14188 (Output_section::save_states, Output_section::restore_states,
14189 Output_section::do_address_and_file_offset_have_reset_values,
14190 (Output_section::Input_section::Input_section): Handle
14191 RELAXED_INPUT_SECTION_CODE. Add new overload for
14192 Output_relaxed_input_section.
14193 (Output_section::Input_section::is_input_section,
14194 Output_section::Input_section::set_output_section): Handle relaxed
14195 input section.
14196 (Output_section::Input_section::is_relaxed_input_section,
14197 Output_section::Input_section::output_section_data,
14198 Output_section::Input_section::relaxed_input_section): New method
14199 definitions.
14200 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14201 value.
14202 (Output_section::Input_section::u1_): Update comments.
14203 (Output_section::Input_section::u2_): Add new union member poris.
14204 (Output_section::Checkpoint_output_section): New classs definition.
14205 (Output_section::relax_input_section): New method declaration.
14206 (Output_section::checkpoint_): New data member.
14207 (Output_segment): Update comments.
14208 (Output_segment::Output_segment): Un-privatize copy constructor.
14209 (Output_segment::operator=): Un-privatize.
14210 * script-sections.cc (Output_section_element::Input_section_list):
14211 Change element type to Output_section::Simple_input_section.
14212 (Output_section_element_dot_assignment::set_section_addresses):
14213 Register output section data for relaxation clean up.
14214 (Output_data_exression::Output_data_expression): Adjust call to base
14215 constructor to fix data size.
14216 (Output_section_element_data::set_section_addresses): Register
14217 Output_data_expression object for relaxation clean up.
14218 (struct Input_section_info): Replace Relobj pointer and section index
14219 pair with Output_section::Simple_input_section and Convert struct to a
14220 class.
14221 (Input_section_sorter::operator()): Adjust access to
14222 Input_section_info data member to use accessors.
14223 (Output_section_element_input::set_section_addresses): Use layout
14224 parameter. Adjust code to use Output_section::Simple_input_section
14225 and Input_secction_info classes. Register filler for relaxation
14226 clean up.
14227 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14228 and section index pair with Output_section::Simple_input_section
14229 class. Adjust code accordingly.
14230 (Phdrs_element::release_segment): New method definition.
14231 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14232 segment list.
14233 (Script_sections::release_segments): New method definition.
14234 * gold/script-sections.h (Script_sections::release_segments): New
14235 method declaration.
14236 * gold/target.h (Target::may_relax, Target::relax,
14237 Target::do_may_relax, Target::do_relax): New method definitions.
14238
14239 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14240
14241 * arm.cc (has_signed_unsigned_overflow): New function.
14242 (Arm_relocate_functions::abs8): New function.
14243 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14244 (Target_arm::Scan::global): Likewise.
14245 (Target_arm::relocate::relocate): Likewise.
14246 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14247 Likewise.
14248
14249 2009-09-16 Cary Coutant <ccoutant@google.com>
14250
14251 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14252 * testsuite/Makefile.in: Regenerate.
14253
14254 2009-09-11 Nick Clifton <nickc@redhat.com>
14255
14256 * po/gold.pot: Updated by the Translation project.
14257
14258 2009-09-08 Cary Coutant <ccoutant@google.com>
14259
14260 * output.cc (Output_file::open): Add execute permission to empty file.
14261 * testsuite/Makefile.am (permission_test): New test.
14262 * testsuite/Makefile.in: Regenerate.
14263
14264 2009-09-02 Ian Lance Taylor <iant@google.com>
14265
14266 * output.cc (Output_file::resize): Call map_no_anonymous rather
14267 than map.
14268
14269 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14270
14271 * gold.cc: Include "incremental.h".
14272 (queue_initial_tasks): Call Incremental_checker methods.
14273 * incremental.cc: Include "output.h".
14274 (Incremental_checker::can_incrementally_link_output_file): New
14275 method.
14276 * incremental.h (Incremental_checker): New class.
14277
14278 * output.cc (Output_file::open_for_modification): New method.
14279 (Output_file::map_anonymous): Changed return type to bool. Record
14280 map in base_ field.
14281 (Output_file::map_no_anonymous): New method, broken out of map.
14282 (Output_file::map): Use map_no_anonymous and map_anonymous.
14283 * output.h (class Output_file): Update declarations.
14284
14285 2009-08-24 Cary Coutant <ccoutant@google.com>
14286
14287 * options.h (Command_line::Pre_options): New class.
14288 (Command_line::pre_options): New member.
14289 * options.cc (gold::options::ready_to_register): New variable.
14290 (One_option::register_option): Do nothing if not registering options.
14291 Assert if same short option registered twice.
14292 (General_options::General_options): Turn off option registration when
14293 done constructing.
14294 (Command_line::Pre_options::Pre_options): New constructor.
14295
14296 2009-08-24 Cary Coutant <ccoutant@google.com>
14297
14298 * options.h (General_options::no_keep_memory): Remove incorrect
14299 short option.
14300
14301 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14302
14303 * Makefile.am (am__skiplex, am__skipyacc): New.
14304 * Makefile.in: Regenerate.
14305
14306 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14307
14308 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14309 (INCLUDES): ... this.
14310 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14311 (AM_CPPFLAGS): Renamed from ...
14312 (INCLUDE): ... this.
14313 * Makefile.in, testsuite/Makefile.in: Regenerate.
14314
14315 * Makefile.in: Regenerate.
14316 * aclocal.m4: Likewise.
14317 * config.in: Likewise.
14318 * configure: Likewise.
14319 * testsuite/Makefile.in: Likewise.
14320
14321 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14322 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14323 * Makefile.in: Regenerate.
14324 * testsuite/Makefile.in: Regenerate.
14325
14326 2009-08-19 Cary Coutant <ccoutant@google.com>
14327
14328 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14329 symbols in shared libraries overridden by hidden or internal symbols
14330 in the main program.
14331
14332 2009-08-19 Chris Demetriou <cgd@google.com>
14333
14334 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14335 checking source file names in error messages.
14336
14337 2009-08-18 Doug Kwan <dougkwan@google.com>
14338
14339 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14340 an elcpp::Ehdr as parameter. Adjust call to set_target.
14341 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14342 an elfcpp::Ehdr as parameter.
14343 * object.cc (Object::set_target): Remove the version that looks up
14344 a target and sets it.
14345 (Sized_relobj::setup): Take a Target object instead of
14346 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14347 (make_elf_sized_object): Find target and ask target to
14348 make an ELF object.
14349 * object.h: (Object::set_target): Remove the version that looks up
14350 a target and sets it.
14351 (Sized_relobj::setup): Take a Target object instead of
14352 an elfcpp:Ehdr as parameter.
14353 * target.cc: Include dynobj.h.
14354 (Target::do_make_elf_object_implementation): New.
14355 (Target::do_make_elf_object): New.
14356 * target.h (Target::make_elf_object): New template declaration.
14357 (Target::do_make_elf_object): New method declarations.
14358 (Target::do_make_elf_object_implementation): New template declaration.
14359
14360 2009-08-14 Ian Lance Taylor <iant@google.com>
14361
14362 * gold.h (FUNCTION_NAME): Define.
14363 (gold_unreachable): Use FUNCTION_NAME.
14364
14365 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14366
14367 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14368 symbol in the --keep-unique list is not found.
14369
14370 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14371
14372 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14373 been maked as --keep-unique.
14374 (Icf::unfold_section): New function.
14375 * icf.h (Icf::unfold_section): New function.
14376 * options.h (General_options::keep_unique): New option.
14377 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14378 * testsuite/Makefile.in: Regenerate.
14379 * testsuite/icf_keep_unique_test.sh: New file.
14380 * testsuite/icf_keep_unique_test.cc: New file.
14381
14382 2009-08-12 Cary Coutant <ccoutant@google.com>
14383
14384 PR 10471
14385 * resolve.cc (Symbol_table::resolve): Check for references from
14386 dynamic objects to hidden and internal symbols.
14387 * testsuite/Makefile.am (hidden_test.sh): New test.
14388 * testsuite/Makefile.in: Regenerate.
14389 * testsuite/hidden_test.sh: New script.
14390 * testsuite/hidden_test_1.c: New test source.
14391 * testsuite/hidden_test_main.c: New test source.
14392
14393 2009-08-11 Doug Kwan <dougkwan@google.com>
14394
14395 * arm.cc: Update comments.
14396 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14397 segment to locate the .ARM.exidx section if present.
14398
14399 2009-08-09 Doug Kwan <dougkwan@google.com>
14400
14401 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14402 patch.
14403
14404 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14405 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14406 compiler warnings.
14407
14408 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14409
14410 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14411 valid tls_segment only for non-debug-section relocations.
14412 * testsuite/Makefile.am: Add gc_tls_test.
14413 * testsuite/Makefile.in: Regenerate.
14414 * testsuite/gc_tls_test.cc: New file.
14415 * testsuite/gc_tls_test.sh: New file.
14416
14417 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14418
14419 * icf.cc: New file.
14420 * icf.h: New file.
14421 * Makefile.am (CCFILES): Add icf.cc.
14422 (HFILES): Add icf.h
14423 * Makefile.in: Regenerate.
14424 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14425 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14426 section, symbol and addend information for the relocs.
14427 * gold.cc (queue_middle_tasks): Call identical code folding.
14428 * gold.h: Add defines for multimap.
14429 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14430 to the call of finalize_local_symbols.
14431 * main.cc (main): Create object of class Icf.
14432 * object.cc (Sized_relobj::do_layout): Allow this function to be
14433 called twice during icf.
14434 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14435 to sections marked as identical by icf.
14436 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14437 when available.
14438 (Sized_relobj::do_section_entsize): New function.
14439 * object.h (Object::section_entsize): New function.
14440 (Object::do_section_entsize): New pure virtual function.
14441 (Relobj::finalize_local_symbols): Add new parameter.
14442 (Relobj::do_section_entsize): New function.
14443 * options.h (General_options::icf): New option.
14444 (General_options::icf_iterations): New option.
14445 (General_options::print_icf_sections): New option.
14446 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14447 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14448 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14449 icf.
14450 * symtab.cc (Symbol_table::is_section_folded): New function.
14451 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14452 to sections marked as identical by icf.
14453 * symtab.h (Symbol_table::set_icf): New function.
14454 (Symbol_table::icf): New function.
14455 (Symbol_table::is_section_folded): New function.
14456 (Symbol_table::icf_): New data member.
14457 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14458 * testsuite/Makefile.am: Add commands to build icf_test.
14459 * testsuite/Makefile.in: Regenerate.
14460 * testsuite/icf_test.sh: New file.
14461 * testsuite/icf_test.cc: New file.
14462
14463 2009-07-24 Chris Demetriou <cgd@google.com>
14464
14465 * layout.cc (is_compressible_debug_section): Fix incorrect
14466 comment about compressed section names.
14467
14468 2009-07-20 Ian Lance Taylor <ian@airs.com>
14469
14470 PR 10419
14471 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14472
14473 2009-07-16 Ian Lance Taylor <iant@google.com>
14474
14475 PR 10400
14476 * layout.h: #include <map>.
14477 (class Kept_section): Change from struct to class. Add accessors
14478 and setters. Add section size to Comdat_group mapping. Change
14479 Comdat_group to std::map. Add is_comdat_ field. Add
14480 linkonce_size field in union.
14481 (class Layout): Update declaration of find_or_add_kept_section.
14482 Don't declare find_kept_object.
14483 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14484 parameter. Add object, shndx, is_comdat, and is_group_name
14485 parameters. Change all callers. Adjust for new Kept_section.
14486 (Layout::find_kept_object): Remove.
14487 * object.cc (Sized_relobj::include_section_group): Update use of
14488 Kept_section. Rename secnum to shndx. Only record
14489 Kept_comdat_section if sections are the same size.
14490 (Sized_relobj::include_linkonce_section): Update use of
14491 Kept_section. Only record Kept_comdat_section if sections are the
14492 same size. Set size of linkonce section.
14493 (Sized_relobj::map_to_kept_section): Update call to
14494 get_kept_comdat_section.
14495 * object.h (class Sized_relobj): Rename fields in
14496 Kept_comdat_section to drop trailing underscores; change object
14497 field to Relobj*. Change Kept_comdat_section_table to store
14498 struct rather than pointer.
14499 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14500 Add kept_object and kept_shndx parameters. Change all callers.
14501 (Sized_relobj::get_kept_comdat_section): Change return type to
14502 bool. Add kept_object and kept_shndx parameters. Change all
14503 callers.
14504 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14505 Layout::find_or_add_kept_section.
14506
14507 2009-07-09 Ian Lance Taylor <iant@google.com>
14508
14509 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14510 Reserve space in the hash table.
14511
14512 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14513
14514 * fileread.cc (File_read::get_mtime): New method.
14515 * fileread.h (Timespec): New structure.
14516 (File_read::get_mtime): New method.
14517 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14518 Renamed from timestamp_nsec.
14519 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14520 Elf_Xword.
14521 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14522 timestamp_nsec.
14523 (Incremental_inputs::report_archive): Save mtime; style fix.
14524 (Incremental_inputs::report_obejct): Save mtime; style fix.
14525 (Incremental_inputs::report_script): Save mtime; style fix.
14526 (Incremental_inputs::finalize_inputs): Style fix.
14527 (Incremental_inputs::finalize): Style fix.
14528 (Incremental_inputs::create_input_section_data): Store inputs
14529 mtime.
14530 * incremental.h (Incremental_inputs::report_script): Add mtime
14531 argument.
14532 (Incremental_inputs::Input_info::Input_info): Intialize only one
14533 union member.
14534 (Incremental_inputs::Input_info::archive): Move to nameless
14535 union.
14536 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14537 (Incremental_inputs::Input_info::script): Move to nameless union.
14538 (Incremental_inputs::mtime): New field.
14539 * script.cc (read_input_script): Pass file mtime to
14540 Incremental_input.
14541 * script.h (Script_info::inputs): Style fix.
14542
14543 2009-07-01 Ian Lance Taylor <ian@airs.com>
14544
14545 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14546 instead of 32.
14547
14548 2009-06-24 Ian Lance Taylor <iant@google.com>
14549
14550 PR 10156
14551 * layout.cc (Layout::choose_output_section): If we find an
14552 existing section, update the flags.
14553 (Layout::create_notes): New function, broken out of
14554 Layout::finalize.
14555 (Layout::finalize): Don't create note sections.
14556 (Layout::create_note): Don't crash if linker script discards
14557 section.
14558 (Layout::create_gold_note): Likewise.
14559 (Layout::create_build_id): Likewise. Don't set
14560 after_input_sections on the section.
14561 (Layout::create_executable_stack_info): Remove target parameter.
14562 Change caller.
14563 * layout.h (class Layout): Declare create_notes. Update
14564 declaration of create_executable_stack_info.
14565 * gold.cc (queue_middle_tasks): Call create_notes.
14566 * output.cc (Output_section::update_flags_for_input_section): Move
14567 here from output.h. If SHF_ALLOC flag is newly set, mark address
14568 invalid.
14569 * output.h (Output_data::mark_address_invalid): New function.
14570 (class Output_section): Only declare, not define,
14571 update_flags_for_input_section. Remove set_flags.
14572
14573 2009-06-24 Ian Lance Taylor <iant@google.com>
14574
14575 * script-sections.cc (Output_section_definition::
14576 set_section_addresses): Rename shadowing local load_address to
14577 laddr.
14578
14579 2009-06-24 Ian Lance Taylor <iant@google.com>
14580
14581 PR 10244
14582 * reloc.cc (relocate_sections): Skip empty relocation sections.
14583
14584 2009-06-23 Ian Lance Taylor <iant@google.com>
14585
14586 PR 10156
14587 * layout.cc (Layout::create_note): Use choose_output_section
14588 rather than make_output_section.
14589
14590 2009-06-23 Ian Lance Taylor <iant@google.com>
14591
14592 PR 10237
14593 * options.cc (General_options::parse_V): Set printed_version_.
14594 (General_options::General_options): Initialize printed_version_.
14595 * options.h (class General_options): Add printed_version_ field.
14596 * gold.cc (queue_initial_tasks): If there are no input files,
14597 don't give a fatal error if we printed the version information.
14598 (queue_middle_tasks): If using -r with a shared object, give a
14599 fatal error rather than an ordinary error.
14600
14601 2009-06-23 Ian Lance Taylor <iant@google.com>
14602
14603 PR 10219
14604 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14605 (Layout::make_output_section): Set have_stabstr_section_ if we see
14606 a .stab*str section.
14607 (Layout::finalize): Call link_stabs_sections.
14608 (Layout::link_stabs_sections): New file.
14609 * layout.h (class Layout): Add have_stabstr_section_ field.
14610 Declare link_stabs_sections.
14611
14612 2009-06-23 Doug Kwan <dougkwan@google.com>
14613
14614 * Makefile.am (libgold_a_LIBADD): New.
14615 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14616 * Makefile.in: Regenerate.
14617 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14618 * configure: Regenerate.
14619 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14620 * fileread.cc: Include sys/state.h
14621 * gold.h: Declare memmem and strndup if found missing.
14622 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14623
14624 2009-06-23 Ian Lance Taylor <iant@google.com>
14625
14626 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14627 * configure: Rebuild.
14628
14629 2009-06-23 Ian Lance Taylor <iant@google.com>
14630
14631 PR 10147
14632 * object.cc (Object::section_contents): Don't try to get a view if
14633 the section has length zero.
14634 (Object::handle_gnu_warning_section): If the section is empty, use
14635 the name of the section as the warning.
14636
14637 2009-06-23 Ian Lance Taylor <iant@google.com>
14638
14639 PR 10133
14640 * stringpool.h (class Stringpool_template): Add optimize_ field.
14641 (Stringpool_template::set_optimize): New function.
14642 * stringpool.cc (Stringpool_template::Stringpool_template):
14643 Initialize optimize_ field.
14644 (Stringpool_template::set_string_offsets): Test local optimize
14645 fild rather than parameter.
14646 * layout.cc (Layout::Layout): Call set_optimize on the section
14647 name stringpool.
14648
14649 2009-06-22 Ian Lance Taylor <iant@google.com>
14650
14651 PR 10030
14652 * yyscript.y: Parse TARGET.
14653 * script.cc (script_set_target): New function.
14654 * script-c.h (script_set_target): Declare.
14655 * options.cc (General_options::string_to_object_format): Rename
14656 from string_to_object_format in anonymous namespace. Change
14657 callers.
14658 * options.h (class General_options): Declare
14659 string_to_object_format.
14660
14661 2009-06-22 Ian Lance Taylor <iant@google.com>
14662
14663 * script-sections.cc (Script_sections::create_segments): Don't put
14664 program headers in a PT_LOAD segment if -n or -N.
14665
14666 2009-06-22 Ian Lance Taylor <iant@google.com>
14667
14668 PR 10141
14669 * options.h (class General_options): Add -z lazy and -z now. Sort
14670 -z options into alphabetical order.
14671 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14672
14673 2009-06-21 Ian Lance Taylor <iant@google.com>
14674
14675 * layout.cc (Layout::make_output_section): Call
14676 Target::new_output_section.
14677 (Layout::attach_allocated_section_to_segment): Put large section
14678 sections in a separate load segment with the large segment flag
14679 set.
14680 (Layout::segment_precedes): Sort large data segments after other
14681 load segments.
14682 (align_file_offset): New static function.
14683 (Layout::set_segment_offsets): Use align_file_offset.
14684 * output.h (class Output_section): Add is_small_section_ and
14685 is_large_section_ fields.
14686 (Output_section::is_small_section): New function.
14687 (Output_section::set_is_small_section): New function.
14688 (Output_section::is_large_section): New function.
14689 (Output_section::set_is_large_section): New function.
14690 (Output_section::is_large_data_section): New function.
14691 (class Output_segment): Add is_large_data_segment_ field.
14692 (Output_segment::is_large_data_segment): New function.
14693 (Output_segment::set_is_large_data_segment): New function.
14694 * output.cc (Output_section::Output_section): Initialize new
14695 fields.
14696 (Output_segment::Output_segment): Likewise.
14697 (Output_segment::add_output_section): Add assertion that large
14698 data sections always go in large data segments. Force small data
14699 sections to the end of the list of data sections. Force small BSS
14700 sections to the start of the list of BSS sections. For large BSS
14701 sections to the end of the list of BSS sections.
14702 * symtab.h (class Symbol): Declare is_common_shndx.
14703 (Symbol::is_defined): Check Symbol::is_common_shndx.
14704 (Symbol::is_common): Likewise.
14705 (class Symbol_table): Define enum Commons_section_type. Update
14706 declarations. Add small_commons_ and large_commons_ fields.
14707 * symtab.cc (Symbol::is_common_shndx): New function.
14708 (Symbol_table::Symbol_table): Initialize new fields.
14709 (Symbol_table::add_from_object): Put small and large common
14710 symbols in the right list.
14711 (Symbol_table::sized_finalized_symbol): Check
14712 Symbol::is_common_shndx.
14713 (Symbol_table::sized_write_globals): Likewise.
14714 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14715 common symbol lists. Don't call do_allocate_commons_list if the
14716 list is empty.
14717 (Symbol_table::do_allocate_commons_list): Remove is_tls
14718 parameter. Add comons_section_type parameter. Change all
14719 callers. Handle small and large common symbols.
14720 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14721 Symbol::is_common_shndx.
14722 * resolve.cc (symbol_to_bits): Likewise.
14723 * target.h (Target::small_common_shndx): New function.
14724 (Target::small_common_section_flags): New function.
14725 (Target::large_common_shndx): New function.
14726 (Target::large_common_section_flags): New function.
14727 (Target::new_output_section): New function.
14728 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14729 small_common_section_flags, and large_common_section_flags
14730 fields.
14731 (Target::do_new_output_section): New virtual function.
14732 * arm.cc (Target_arm::arm_info): Initialize new fields.
14733 * i386.cc (Target_i386::i386_info): Likewise.
14734 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14735 Likewise.
14736 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14737 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14738 (Target_x86_64::do_new_output_section): New function.
14739 * configure.ac: Define conditional MCMODEL_MEDIUM.
14740 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14741 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14742 (large_LDFLAGS): Define.
14743 * testsuite/large.c: New file.
14744 * testsuite/testfile.cc (Target_test::test_target_info):
14745 Initialize new fields.
14746 * configure, testsuite/Makefile.in: Rebuild.
14747
14748 2009-06-05 Doug Kwan <dougkwan@google.com>
14749
14750 * Makefile.am (CCFILES): Add target.cc.
14751 * Makefile.in: Regenerate.
14752 * i386.cc (class Target_i386): Define new virtual method to
14753 override do_is_local_label_name in parent.
14754 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14755 local symbols if --discard-locals or -X is given.
14756 * options.h (class General_options): Declare new options
14757 '--discard-locals' and '-X' for discarding locals.
14758 * target.h (class Target): Define new methods is_local_label_name.
14759 Declare new virtual method do_is_local_label_name.
14760 * target.cc: New file.
14761 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14762 (check_SCRIPTS): Add discard_locals_test.sh.
14763 (check_DATA): Add discard_local_tests.syms.
14764 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14765 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14766 * testsuite/Makefile.in: Regenerate.
14767 * testsuite/discard_locals_test.c: New file.
14768 * testsuite/discard_locals_test.sh: Same.
14769
14770 2009-06-05 Doug Kwan <dougkwan@google.com>
14771
14772 * object.cc (Sized_relobj::Sized_relobj): Initialize
14773 discarded_eh_frame_shndx_ to -1U.
14774 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14775 section.
14776 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14777 a discarded .eh_frame section.
14778 (Sized_relobj::do_finalize_local_symbols): Ditto.
14779 * object.h (class Sized_relobj): Declare new member
14780 discarded_eh_frame_shndx_.
14781 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14782 (local_labels_test.o, local_labels_test): New rules.
14783 * testsuite/Makefile.in: Regenerate.
14784
14785 2009-06-04 Doug Kwan <dougkwan@google.com>
14786
14787 * layout.cc (Layout::section_name_mapping): Add mapping for
14788 special ARM sections.
14789
14790 2009-06-03 Doug Kwan <dougkwan@google.com>
14791
14792 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14793 (utils::has_overflow): Same.
14794
14795 2009-06-03 Ian Lance Taylor <iant@google.com>
14796
14797 * layout.cc (Layout::section_name_mapping): New array, replacing
14798 Layout::linkonce_mapping.
14799 (Layout::section_name_mapping_count): New variable, replacing
14800 Layout::linkonce_mapping_count.
14801 (Layout::linkonce_output_name): Remove.
14802 (Layout::output_section_name): Rewrite.
14803 * layout.h (class Layout): Rename Linkonce_mapping to
14804 Section_name_mapping, linkonce_mapping to section_name_mapping,
14805 linkonce_mapping_count to section_name_mapping_count. Don't
14806 declare linkonce_output_name.
14807
14808 2009-06-03 Doug Kwan <dougkwan@google.com>
14809
14810 * gold/arm.cc (namespace utils): New.
14811 (Target_arm::reloc_is_non_pic): Define new method.
14812 (class Arm_relocate_functions): New.
14813 (Target_arm::Relocate::relocate): Handle relocation types used by
14814 Android.
14815
14816 2009-06-03 Ian Lance Taylor <iant@google.com>
14817
14818 * arm.cc (Target_arm::scan::global): Use || instead of |.
14819
14820 2009-06-02 Doug Kwan <dougkwan@google.com>
14821
14822 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14823 issued_non_pic_error_.
14824 (class Target_arm::Scan): Declare new method check_non_pic.
14825 Define new method symbol_needs_plt_entry.
14826 Declare new data member issued_non_pic_error_.
14827 (class Target_arm::Relocate): Declare new method
14828 should_apply_static_reloc.
14829 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14830 (Target_arm::Scan::check_non_pic): Define new method.
14831 (Target_arm::Scan::local): Handle a small subset of reloc types used
14832 by Android.
14833 (Target_arm::Scan::local): Same.
14834 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14835
14836 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14837
14838 * incremental.cc (Incremental_inputs::report_command_line): Filter
14839 out --incremental-* options.
14840
14841 2009-05-29 Doug Kwan <dougkwan@google.com>
14842
14843 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14844 template class.
14845 (class Target_arm): Update comment.
14846 (Target_arm::Target_arm): Initialize new data members GOT_,
14847 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14848 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14849 and Target_arm::rel_dyn_section.
14850 Declare new_enum Target_arm::Got_type.
14851 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14852 and DYNBSS_.
14853 Update commments for member do_dynsym_value.
14854 (Target_arm::got_size, Target_arm::plt_section,
14855 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14856 new methods inside class defintion.
14857 (Target_arm::got_section): Define new method.
14858 (Target_arm::rel_dyn_section): Same.
14859 (Output_data_plt_arm): New template class.
14860 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14861 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14862 (Output_data_plt_arm::add_entry): Same.
14863 (Output_data_plt_arm::first_plt_entry): Define new
14864 static data member for PLT instruction template.
14865 (Output_data_plt_arm::plt_entry): Same.
14866 (Output_data_plt_arm::do_write): Define new method.
14867 (Target_arm::make_plt_entry): Same.
14868 (Target_arm::do_finalize_sections): Same.
14869 (Target_arm::do_dynsym_value): Same.
14870
14871 2009-05-28 Doug Kwan <dougkwan@google.com>
14872
14873 * Makefile.am (TARGETSOURCES): Add arm.cc.
14874 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14875 * Makefile.in: Regenerate.
14876 * arm.cc: New file.
14877 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14878
14879 2009-05-26 Doug Kwan <dougkwan@google.com>
14880
14881 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14882 (General_options::check_excluded_libs): Strip off directories in
14883 archive name before matching like GNU ld does.
14884 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14885 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14886 (exclude_libs_test_LDFLAGS): Add linker option
14887 -Wl,--exclude-libs,libexclude_libs_test_3
14888 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14889 an explicit archive without using -l.
14890 (alt/libexclude_libs_test_3.a): New make rule.
14891 * testsuite/Makefile.in: Regenerate.
14892 * testsuite/exclude_libs_test.c : Declare lib3_default().
14893 (main): Call it.
14894 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14895 * exclude_libs_test_3.c: New file.
14896
14897 2009-05-26 Nick Clifton <nickc@redhat.com>
14898
14899 * po/id.po: New Indonesian translation.
14900 * po/gold.pot: Updated template file.
14901
14902 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14903
14904 * testsuite/Makefile.am: Add -ffunction-sections to compile
14905 gc_comdat_test files. Add -Wl,--gc-sections to build
14906 gc_comdat_test.
14907 * testsuite/Makefile.in: Regenerate.
14908 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14909
14910 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14911
14912 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14913 kept comdat section was garbage collected.
14914 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14915 * testsuite/Makefile.in: Regenerate.
14916 * testsuite/gc_comdat_test.sh: New file.
14917 * testsuite/gc_comdat_test_1.cc: New file.
14918 * testsuite/gc_comdat_test_2.cc: New file.
14919
14920 2009-05-19 Doug Kwan <dougkwan@google.com>
14921
14922 * archive.cc (Archive::Archive): Move constructor from archive.h
14923 to here. Initialize no_export_.
14924 (Archive::get_elf_object_for_member): Set no_export flag of object.
14925 * archive.h (Archive::Archive): Move constructor body to
14926 archive.cc.
14927 (Archive::no_export): New method.
14928 (Archive::no_export_): New field.
14929 * object.h (Object::Object): Initialize no_export_ to false.
14930 (Object::no_export, Object::set_no_export): New methods.
14931 (Object::no_export_): New field.
14932 * options.cc (General_options::parse_exclude_libs): New method.
14933 (General_options::check_excluded_libs) Same.
14934 * options.h (exclude_libs): New option.
14935 (General_options::check_excluded_libs): New method declaration.
14936 (General_options::excluded_libs_): New field.
14937 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14938 default or protected visibility if an object has no-export flag set.
14939 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14940 (check_SCRIPTS): Add exclude_libs_test.sh.
14941 (check_DATA): Add exclude_libs_test.syms.
14942 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14943 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14944 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14945 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14946 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14947 libexclude_libs_test_2.a): New rules.
14948 * testsuite/Makefile.in: Regenerate.
14949 * testsuite/exclude_libs_test.c: New file.
14950 * testsuite/exclude_libs_test.sh: Ditto.
14951 * testsuite/exclude_libs_test_1.c: Ditto.
14952 * testsuite/exclude_libs_test_2.c: Ditto.
14953
14954 2009-05-15 Ian Lance Taylor <iant@google.com>
14955
14956 * configure.ac: Check for declarations for cases where libiberty.h
14957 checks HAVE_DECL_xxx.
14958 * configure, config.in: Rebuild.
14959
14960 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14961
14962 * gold.h (Incremental_argument_list): Remove (invalid) forward
14963 declaration.
14964 * incremental.cc (Incremental_inputs::report_achive): New method.
14965 (Incremental_inputs::report_object): New method.
14966 (Incremental_inputs::report_script): New method.
14967 (Incremental_inputs::finalize_inputs): New method.
14968 (Incremental_inputs::finalize): Call finalize_inputs().
14969 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14970 Create inputs entries.
14971 * incremental.h (Incremental_input_type): New enum.
14972 (Incremental_inputs::Incremental_input): Initialize new fields.
14973 (Incremental_inputs::report_inputs): New method.
14974 (Incremental_inputs::report_achive): New method.
14975 (Incremental_inputs::report_object): New method.
14976 (Incremental_inputs::report_script): New method.
14977 (Incremental_inputs::finalize_inputs): New method.
14978 (Incremental_inputs::Input_info): New struct.
14979 (Incremental_inputs::Input_info_map): New typedef.
14980 (Incremental_inputs::lock_): New field.
14981 (Incremental_inputs::Inputs_): New field.
14982 (Incremental_inputs::Inputs_map): New field.
14983 * main.cc (main): Call Incremental_input::report_inputs.
14984 * options.h (Input_argument_list): Typedef moved from
14985 Input_arguments.
14986 (Input_file_group::Files): Remove, use ::Input_argument_list.
14987 (Input_file_group::Input_argument_list): Remove, use
14988 ::Input_argument_list.
14989 * plugin.cc (Plugin_manager::add_input_file): Add error in
14990 incremental build.
14991 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14992 functions.
14993 * script.cc (read_input_script): Call
14994 Incremental_input::report_script.
14995 * script.h (Script_info): New class.
14996
14997 2009-04-27 Ian Lance Taylor <iant@google.com>
14998
14999 * x86_64.cc (do_adjust_output_section): Set entsize to
15000 plt_entry_size.
15001
15002 2009-04-23 Elliott Hughes <enh@google.com>
15003
15004 * output.cc (Output_file::close): After short writes, continue
15005 writing from the correct offset in the buffer being written.
15006
15007 2009-04-23 Chris Demetriou <cgd@google.com>
15008
15009 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
15010 * configure: Regenerate.
15011 * config.in: Regenerate.
15012 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
15013 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
15014
15015 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
15016
15017 * incremental.cc (Incremental_inputs_header_data): Renamed from
15018 Incremental_input_header_data.
15019 (Incremental_inputs_header_data::data_size): New field.
15020 (Incremental_inputs_header_data::put_input_file_count): Renamed
15021 from input_file_count.
15022 (Incremental_inputs_header_data::put_command_line_offset): Renamed
15023 from command_line_offset.
15024 (Incremental_inputs_header_data::put_reserved): Renamed from
15025 put_reserved.
15026 (Incremental_inputs_entry_data): Renamed from
15027 Incremental_input_entry_data.
15028 (Incremental_inputs_entry_data::data_size): New field.
15029 (Incremental_inputs::report_command_line): New method.
15030 (Incremental_inputs::finalize): New method.
15031 (Incremental_inputs::create_incremental_inputs_data): New method.
15032 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
15033 * incremental.h: New file.
15034 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
15035 (Layout::finalize): Create incremental inputs section in
15036 incremental builds.
15037 (Layout::create_incremental_info_sections): New method.
15038 * layout.h (Layout::incremental_inputs): New method.
15039 (Layout::create_incremental_info_sections): New method.
15040 (Layout::incremental_inputs_): New field.
15041 * main.cc (main): Notify Incremental_input of the command line.
15042
15043 2009-04-01 Ian Lance Taylor <iant@google.com>
15044 Mikolaj Zalewski <mikolajz@google.com>
15045
15046 * gold.h (reserve_unordered_map): Define, three versions, one for
15047 each version of Unordered_map.
15048 * layout.cc (Layout::Layout): Remove options parameter. Add
15049 number_of_input_files parameter. Don't initialize options_.
15050 Initialize number_of_input_files_ and resized_signatures_. Move
15051 sections_are_attached_.
15052 (Layout::layout_group): Reserve space for group_signatures_.
15053 (Layout::find_or_add_kept_section): Change name parameter to be a
15054 reference. Resize signatures_ map when it gets large enough.
15055 (Layout::layout_eh_frame): Use parameters->options() instead of
15056 this->options_.
15057 (Layout::make_output_section): Likewise.
15058 (Layout::attach_allocated_section_to_segment): Likewise.
15059 (Layout::finalize, Layout::create_executable_stack): Likewise.
15060 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
15061 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
15062 * layout.h (class Layout): Update declarations. Remove options_
15063 field. Add number_of_input_files_ and resized_signatures_
15064 fields. Move sections_are_attached_ field.
15065 * main.cc (main): Pass number of input files to Layout
15066 constructor. Don't pass options.
15067
15068 2009-03-30 Ian Lance Taylor <iant@google.com>
15069
15070 * ffsll.c (ffsll): Correct implementation.
15071
15072 2009-03-27 Ian Lance Taylor <iant@google.com>
15073
15074 * ffsll.c: New file.
15075 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
15076 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
15077 * ftruncate.c (ftruncate): Declare before definition.
15078 * mremap.c (mremap): Likewise.
15079 * pread.c (pread): Likewise.
15080 * configure, Makefile.in, config.in: Rebuild.
15081
15082 * mremap.c: New file.
15083 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
15084 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
15085 (mremap): Declare if HAVE_MREMAP is not defined.
15086 * configure, Makefile.in, config.in: Rebuild.
15087
15088 2009-03-27 Cary Coutant <ccoutant@google.com>
15089
15090 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
15091 position independent.
15092 * sparc.cc (Target_sparc::check_non_pic): Likewise.
15093 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
15094
15095 2009-03-24 Cary Coutant <ccoutant@google.com>
15096
15097 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
15098 an executable.
15099 (needs_dynamic_reloc): Likewise.
15100
15101 2009-03-24 Ian Lance Taylor <iant@google.com>
15102
15103 * yyscript.y (file_cmd): Recognize EXTERN.
15104 (extern_name_list, extern_name_list_body): New nonterminals.
15105 * script.cc (script_add_extern): Define.
15106 * script-c.h (script_add_extern): Declare.
15107
15108 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
15109
15110 * object.cc (is_elf_object): Define.
15111 * object.h (is_elf_object): Declare.
15112 * archive.cc (Archive::get_elf_object_for_member): Call
15113 is_elf_object.
15114 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
15115
15116 2009-03-24 Elliott Hughes <enh@google.com>
15117
15118 * output.cc (Output_file::map_anonymous): Define.
15119 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15120 try an anonymous one. Report the size if the mmap fails.
15121 * output.h (class Output_file): Declare map_anonymous.
15122
15123 2009-03-24 Ian Lance Taylor <iant@google.com>
15124
15125 * target-select.cc (instantiate_target): Don't acquire the lock if
15126 the instantiated_target_ field has already been set.
15127
15128 2009-03-23 Ian Lance Taylor <iant@google.com>
15129
15130 * gold-threads.h (class Initialize_lock): Define.
15131 * gold-threads.cc (class Initialize_lock_once): Define.
15132 (initialize_lock_control): New static variable.
15133 (initialize_lock_pointer): New static variable.
15134 (initialize_lock_once): New static function.
15135 (Initialize_lock::Initialize_lock): Define.
15136 (Initialize_lock::initialize): Define.
15137 * target-select.h: Include "gold-threads.h".
15138 (class Target_selector): Add lock_ and initialize_lock_ fields.
15139 Don't define instantiate_target, just declare it.
15140 * target-select.cc (Target_selector::Target_selector): Initialize
15141 new fields.
15142 (Target_selector::instantiate_target): Define.
15143 * descriptors.h: Include "gold-threads.h".
15144 (class Descriptors): Add initialize_lock_ field.
15145 * descriptors.cc (Descriptors::Descriptors): Initialize new
15146 field.
15147 (Descriptors::open): Use initialize_lock_ field
15148 * errors.h (class Errors): Add initialize_lock_ field.
15149 * errors.cc (Errors::Errors): Initialize new field.
15150 (Errors::initialize_lock): Use initialize_lock_ field.
15151 * powerpc.cc (class Target_selector_powerpc): Remove
15152 instantiated_target_ field. In do_recognize call
15153 instantiate_target rather than do_instantiate_target. In
15154 do_instantiate_target just allocate a new target.
15155 * sparc.cc (class Target_selector_sparc): Likewise.
15156
15157 * freebsd.h: New file.
15158 * i386.cc: Include "freebsd.h".
15159 (Target_i386): Derive from Target_freebsd rather than
15160 Sized_target.
15161 (Target_selector_i386): Derive from Target_selector_freebsd rather
15162 than Target_selector.
15163 * x86_64.cc: Include "freebsd.h".
15164 (Target_x86_64): Derive from Target_freebsd rather than
15165 Sized_target.
15166 (Target_selector_x86_64): Derive from Target_selector_freebsd
15167 rather than Target_selector.
15168 * target.h (class Target): Add adjust_elf_header and
15169 do_adjust_elf_header.
15170 * output.cc (Output_file_header:: do_sized_write): Call target
15171 adjust_elf_header routine.
15172 * configure.tgt: Set targ_osabi.
15173 * configure.ac: Define GOLD_DEFAULT_OSABI.
15174 * parameters.cc (Parameters::default_target): Pass
15175 GOLD_DEFAULT_OSABI to select_target.
15176 * target-select.h (class Target_selector): Make instantiate_target
15177 protected rather than private.
15178 * Makefile.am (HFILES): Add freebsd.h.
15179 * configure, Makefile.in, config.in: Rebuild.
15180
15181 * merge.cc (do_add_input_section): Correct pend value. Change
15182 message about last entry not being null terminated from error to
15183 warning.
15184
15185 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15186
15187 * incremental.cc: New file.
15188 * Makefile.am (CCFILES): Add incremental.cc.
15189 * Makefile.in: Rebuild.
15190
15191 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15192
15193 * layout.cc (Layout::output_section_name): Preserve names
15194 of '.note.' sections.
15195
15196 2009-03-19 Ian Lance Taylor <iant@google.com>
15197
15198 * descriptors.cc (Descriptors::open): Check that the options are
15199 valid before using them.
15200
15201 2009-03-18 Ian Lance Taylor <iant@google.com>
15202
15203 * script-sections.h: Include <list>.
15204 (class Script_sections): Change Sections_elements from std::vector
15205 to std::list. Typedef public Elements_iterator. Add
15206 orphan_section_placement_, data_segment_align_start_, and
15207 saw_data_segment_align_ fields. Remove data_segment_align_index_
15208 field.
15209 * script-sections.cc (class Orphan_section_placement): New class.
15210 (class Sections_element): Add virtual functions is_relro and
15211 orphan_section_init. Remove virtual function place_orphan_here.
15212 (class Output_section_definition): Add is_relro and
15213 orphan_section_init. Remove place_orphan_here.
15214 (class Orphan_output_section): Likewise.
15215 (Script_sections::Script_sections): Update for field changes.
15216 (Script_sections::data_segment_align): Set saw_data_segment_align_
15217 and data_segment_align_start_, not data_segment_align_index.
15218 (Script_sections::data_segment_relro_end): Check
15219 saw_data_segment_align_. Use data_segment_align_start_ rather
15220 than data_segment_align_index_.
15221 (Script_sections::place_orphan): Rewrite to use
15222 Orphan_section_placement.
15223
15224 2009-03-17 Ian Lance Taylor <iant@google.com>
15225
15226 * archive.cc (Archive::add_symbols): Check for a version attached
15227 to the symbol name in the archive map.
15228 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15229 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15230 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15231 (ver_test_11.a): New target.
15232 * testsuite/Makefile.in: Rebuild.
15233
15234 * configure.ac: Check for chsize and posix_fallocate. Replace
15235 ftruncate.
15236 * ftruncate.c: New file, from gnulib.
15237 * output.cc (posix_fallocate): Define dummy version if not
15238 HAVE_POSIX_FALLOCATE.
15239 (Output_file::map): Call posix_fallocate rather than lseek and
15240 write.
15241 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15242 * configure, Makefile.in, config.in: Rebuild.
15243
15244 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
15245
15246 * layout.h (Layout::create_note): Add section_name parameter.
15247 * layout.cc (Layout::create_note): Likewise.
15248 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
15249
15250 2009-03-17 Ian Lance Taylor <iant@google.com>
15251
15252 * descriptors.cc: Include "options.h".
15253 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15254 (Descriptors::open): Always use O_CLOEXEC when opening a new
15255 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15256 then set FD_CLOEXEC.
15257
15258 * sparc.cc (class Target_sparc): Add has_got_section.
15259 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15260 make sure we have a GOT section.
15261
15262 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15263 (Target_sparc::Scan::local): Likewise.
15264 (Target_sparc::Scan::global): Likewise.
15265 (Target_sparc::Relocate::relocate): Likewise.
15266 (Target_sparc::Relocate::relocate_tls): Likewise.
15267
15268 * symtab.cc (Symbol_table::define_default_version): New function,
15269 broken out of add_from_object.
15270 (Symbol_table::add_from_object): Call define_default_version.
15271 (Symbol_table::define_special_symbol): Add resolve_oldsym
15272 parameter. Change all callers. If the version for a symbol comes
15273 from a version script, resolve it with the symbol with the same
15274 name with no version. Also add the symbol without a version if
15275 appropriate.
15276 (do_define_in_output_data): If resolving with oldsym, don't delete
15277 sym.
15278 (do_define_in_output_segment): Likewise.
15279 (do_define_as_constant): Likewise.
15280 * symtab.h (class Symbol_table): Update declarations.
15281
15282 2009-03-13 Ian Lance Taylor <iant@google.com>
15283
15284 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15285 (Read_symbols::requeue): New function.
15286 (Read_symbols::do_read_symbols): If make_elf_object fails because
15287 the target type is not configured, and the file was searched for,
15288 issue a warning and retry with the next directory.
15289 (Add_symbols::run): If the file has an incompatible format, and
15290 it was searched for, requeue the Read_symbols task. On error,
15291 release the object.
15292 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15293 dirindex parameter to constructor. Change all callers. Declare
15294 incompatible_warning and requeue.
15295 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15296 input_argument_ and input_group_ fields. Add them to
15297 constructor. Change all callers.
15298 (class Read_script): Add dirindex_ field. Add it to constructor.
15299 Change all callers.
15300 * archive.cc (Archive::setup): Remove input_objects parameter.
15301 Change all callers.
15302 (Archive::get_file_and_offset): Likewise.
15303 (Archive::read_all_symbols): Likewise.
15304 (Archive::read_symbols): Likewise.
15305 (Archive::get_elf_object_for_member): Remove input_objects
15306 parameter. Add punconfigured parameter. Change all callers.
15307 (Archive::add_symbols): Change return type to bool. Check return
15308 value of include_member.
15309 (Archive::include_all_members): Likewise.
15310 (Archive::include_member): Change return type to bool. Return
15311 false if first included object has incompatible target. Set
15312 included_member_ field.
15313 (Add_archive_symbols::run): If add_symbols returns false, requeue
15314 Read_symbols task.
15315 * archive.h (class Archive): Add included_member_ field.
15316 Initialize it in constructor. Add input_file and searched_for
15317 methods. Update declarations.
15318 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15319 input_argument_ fields. Add them to constructor. Change all
15320 callers.
15321 * script.cc: Include "target-select.h".
15322 (class Parser_closure): Add skip_on_incompatible_target_ and
15323 found_incompatible_target_ fields. Add
15324 skip_on_incompatible_target parameter to constructor. Change all
15325 callers. Add methods skip_on_incompatible_target,
15326 clear_skip_on_incompatible_target, found_incompatible_target, and
15327 set_found_incompatible_target.
15328 (read_input_script): Add dirindex parameter. Change all callers.
15329 If parser finds an incompatible target, requeue Read_symbols
15330 task.
15331 (script_set_symbol): Clear skip_on_incompatible_target in
15332 closure.
15333 (script_add_assertion, script_parse_option): Likewise.
15334 (script_start_sections, script_add_phdr): Likewise.
15335 (script_check_output_format): New function.
15336 * script.h (read_input_script): Update declaration.
15337 * script-c.h (script_check_output_format): Declare.
15338 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15339 (ignore_cmd): Remove OUTPUT_FORMAT.
15340 * fileread.cc (Input_file::Input_file): Add explicit this.
15341 (Input_file::will_search_for): New function.
15342 (Input_file::open): Add pindex parameter. Change all callers.
15343 * fileread.h (class Input_file): Add input_file_argument method.
15344 Declare will_search_for. Update declarations.
15345 * object.cc (make_elf_object): Add punconfigured parameter.
15346 Change all callers.
15347 * object.h (class Object): Make input_file public. Add
15348 searched_for method.
15349 (make_elf_object): Update declaration.
15350 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15351 restart search.
15352 * dirsearch.h (class Dirsearch): Update declaration.
15353 * options.h (class General_options): Add --warn-search-mismatch.
15354 * parameters.cc (Parameters::is_compatible_target): New function.
15355 * parameters.h (class Parameters): Declare is_compatible_target.
15356 * workqueue.cc (Workqueue::add_blocker): New function.
15357 * workqueue.h (class Workqueue): Declare add_blocker.
15358
15359 * fileread.cc (Input_file::open): Remove options parameter.
15360 Change all callers.
15361 (Input_file::open_binary): Likewise.
15362 * script.cc (read_input_script): Likewise.
15363 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15364 options parameter from constructor. Change all callers.
15365 (class Read_script): Likewise.
15366 * fileread.h (class Input_file): Update declarations.
15367 * script.h (read_input_script): Update declaration.
15368
15369 2009-03-10 Nick Clifton <nickc@redhat.com>
15370
15371 * po/es.po: New Spanish translation.
15372
15373 2009-03-06 Cary Coutant <ccoutant@google.com>
15374
15375 * options.cc (parse_short_option): Keep dash_z from registering itself.
15376
15377 2009-03-03 Ian Lance Taylor <iant@google.com>
15378
15379 PR 9918
15380 * target-reloc.h (relocate_section): Pass output_section to
15381 relocate.
15382 * i386.cc (Target_i386::should_apply_static_reloc): Add
15383 output_section parameter. Change all callers.
15384 (Target_i386::Relocate::relocate): Add output_section parameter.
15385 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15386 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15387 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15388 * testsuite/two_file_shared.sh: New script.
15389 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15390 (check_DATA): Add two_file_shared.dbg.
15391 (two_file_shared.dbg): New target.
15392 * testsuite/Makefile.in: Rebuild.
15393
15394 2009-03-01 Ian Lance Taylor <iant@google.com>
15395
15396 * configure.ac: Check for byteswap.h.
15397 * configure: Rebuild.
15398 * config.in: Rebuild.
15399
15400 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15401
15402 * layout.cc (Layout::find_or_add_kept_section): New function.
15403 (Layout::add_comdat): Removed.
15404 * layout.h (struct Kept_section): Move out of class Layout.
15405 Remove trailing underscores from field names. Add group_sections
15406 field. Rename group_ field to is_group. Change all uses.
15407 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15408 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15409 comdat_groups_ field.
15410 (Sized_relobj::include_section_group): Use
15411 find_or_add_kept_section and Kept_section::group_sections.
15412 (Sized_relobj::include_linkonce_section): Likewise.
15413 * object.cc (class Sized_relobj): Don't define Comdat_group or
15414 Comdat_group_table. Remove find_comdat_group and
15415 add_comdat_group. Remove comdat_groups_ field.
15416 * plugin.cc (include_comdat_group): Use
15417 Layout::find_or_add_kept_section.
15418
15419 2009-02-28 Ian Lance Taylor <iant@google.com>
15420
15421 * README: --gc-sections and map files are now supported. Document
15422 some build requirements.
15423
15424 PR 6992
15425 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15426 relocatable link set the value of the section symbol to zero.
15427 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15428 relocatable link don't include the section address in the local
15429 symbol value.
15430
15431 2009-02-27 Ian Lance Taylor <iant@google.com>
15432
15433 PR 6811
15434 * options.h (class Search_directory): Add is_system_directory.
15435 (class General_options): Declare is_in_system_directory.
15436 * options.cc (get_relative_sysroot): Make static.
15437 (get_default_sysroot): Make static.
15438 (General_optoins::is_in_system_directory): New function.
15439 * fileread.cc (Input_file::is_in_system_directory): New function.
15440 * fileread.h (class Input_file): Declare is_in_system_directory.
15441 * object.h (class Object): Add is_in_system_directory.
15442 (class Input_objects): Remove system_library_directory_ field.
15443 * object.cc (Input_objects::add_object): Don't set
15444 system_library_directory_.
15445 (input_objects::found_in_system_library_directory): Remove.
15446 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15447 parameter. Change all callers.
15448 (Symbol_table::sized_write_globals): Likewise.
15449 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15450 Call Object::is_in_system_directory.
15451 * symtab.h (class Symbol_table): Update declarations.
15452
15453 PR 5990
15454 * descriptors.h (Open_descriptor): Add is_on_stack field.
15455 * descriptors.cc (Descriptors::open): If the descriptor is on the
15456 top of the stack, remove it. Initialize is_on_stack field.
15457 (Descriptors::release): Only add pod to stack if it is not on the
15458 stack already.
15459 (Descriptors::close_some_descriptor): Clear stack_next and
15460 is_on_stack fields.
15461
15462 PR 7091
15463 * output.cc (Output_section::find_starting_output_address): Rename
15464 from starting_output_address; add PADDR parameter; change return
15465 type.
15466 * output.h (class Output_section): Declare
15467 find_starting_output_address instead of starting_output_address.
15468 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15469 section symbol for which we can't find a merge section.
15470
15471 PR 9836
15472 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15473 hidden or internal, force the symbol to be local.
15474 * resolve.cc (Symbol::override_visibility): Define.
15475 (Symbol::override_base): Use override_visibility.
15476 (Symbol_table::resolve): Likewise.
15477 (Symbol::override_base_with_special): Likewise.
15478 (Symbol_table::override_with_special): If the visibility is hidden
15479 or internal, force the symbol to be local.
15480 * symtab.h (class Symbol): Add set_visibility and
15481 override_visibility.
15482 * testsuite/ver_test_1.sh: New file.
15483 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15484 (check_DATA): Add ver_test_1.syms.
15485 (ver_test_1.syms): New target.
15486 * testsuite/Makefile.in: Rebuild.
15487
15488 2009-02-25 Cary Coutant <ccoutant@google.com>
15489
15490 * layout.cc (Layout::choose_output_section): Don't rename sections
15491 when using a linker script that has a SECTIONS clause.
15492 * Makefile.in: Regenerate.
15493
15494 * testsuite/Makefile.am (script_test_5.sh): New test case.
15495 * testsuite/Makefile.in: Regenerate.
15496 * testsuite/script_test_5.cc: New file.
15497 * testsuite/script_test_5.sh: New file.
15498 * testsuite/script_test_5.t: New file.
15499
15500 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15501
15502 * archive.cc (Archive::include_member): Update calls to add_symbols.
15503 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15504 the Layout argument.
15505 * dynobj.h (do_add_symbols): Add the Layout argument.
15506 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15507 Layout argument.
15508 * object.h (Object::add_symbols): Add the Layout argument.
15509 (Object::do_add_symbols): Add the Layout argument.
15510 (Sized_relobj::do_add_symbols): Add the Layout argument.
15511 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15512 Unify the two versions.
15513 (Add_plugin_symbols): Remove.
15514 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15515 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15516 (Add_plugin_symbols): Remove.
15517 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15518 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15519 (Add_symbols::run): Make it work with Pulginobj.
15520
15521 2009-02-06 Ian Lance Taylor <iant@google.com>
15522
15523 * object.cc (Sized_relobj::do_layout): Make info message start
15524 with lower case letter.
15525
15526 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15527
15528 * binary.cc: Fix file comment.
15529
15530 * options.h (enum Incremental_disposition): Define.
15531 (class General_options): Add new options: --incremental,
15532 --incremental_changed, --incremental_unchanged,
15533 --incremental_unknown. Add incremental_disposition_ and
15534 implicit_incremental_ fields.
15535 (General_options::incremental_disposition): New function.
15536 (class Position_dependent_options): Add incremental_disposition
15537 option.
15538 (Position_dependent_options::copy_from_options): Set incremental
15539 dispositions.
15540 * options.cc (General_options::parse_incremental_changed): New
15541 function.
15542 (General_options::parse_incremental_unchanged): New function.
15543 (General_options::parse_incremental_unknown): New function.
15544 (General_options::General_options): Initialize new fields
15545 incremental_disposition_ and implicit_incremental_.
15546 (General_options::finalize): Check for uasge of --incremental-*
15547 without --incremental.
15548
15549 2009-02-06 Chris Demetriou <cgd@google.com>
15550
15551 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15552 pointer and to report location as the file name associated with
15553 the symbol.
15554 (gold_undefined_symbol_at_location): New function to replace the
15555 old gold_undefined_symbol functionality.
15556 * target-reloc.h (relocate_section): Update to use
15557 gold_undefined_symbol_at_location.
15558 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15559 Call gold_undefined_symbol function rather than gold_error.
15560 * errors.h (Errors::undefined_symbol): Take location as a
15561 string, rather than calculating it from a relocation.
15562 * errors.cc (Errors::fatal): Print "fatal error:" before the
15563 formatted message.
15564 (Errors::error, Errors::error_at_location): Print "error: "
15565 before the formatted message.
15566 (Errors::undefined_symbol): Take location as a string, rather
15567 than calculating it from a relocation.
15568 (gold_undefined_symbol_at_location): New function akin to
15569 old gold_undefined_symbol, calculates location from relocation.
15570 (gold_undefined_symbol): Change to take only a Symbol pointer
15571 and to report location as the file name associated with the symbol.
15572 * testsuite/debug_msg.sh: Update for changed error messages.
15573 * testsuite/undef_symbol.sh: Likewise.
15574
15575 2009-02-04 Duncan Sands <baldrick@free.fr>
15576
15577 PR 9812
15578 * reduced_debug_output.h
15579 (Output_reduced_debug_abbrev_section::failed): Use format for
15580 gold_warning.
15581 (Output_reduced_debug_info_section::faild): Likewise.
15582
15583 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15584
15585 * script.cc (Lazy_demangler): New class.
15586 (Version_script_info::get_symbol_version_helper): Demangle a
15587 symbol only once.
15588
15589 2009-01-29 Cary Coutant <ccoutant@google.com>
15590
15591 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15592 to __tls_get_addr.
15593 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15594
15595 2009-01-28 Ian Lance Taylor <iant@google.com>
15596
15597 * version.cc (version_string): Bump to 1.9.
15598
15599 * gold.h: Include <cstring> and <stdint.h>.
15600 * version.cc: Include <cstdio>.
15601 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15602 warning.
15603 * reduced_debug_output.cc (insert_into_vector): Rename from
15604 Insert_into_vector; change all callers. Use Swap_unaligned to
15605 avoid aliasing issue; remove union since it is unnecessary.
15606
15607 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15608
15609 * Makefile.am (CCFILES): Add gc.cc.
15610 (HFILES): Add gc.h.
15611 * Makefile.in: Regenerate.
15612 * gold.cc (Gc_runner): New class.
15613 (queue_initial_tasks): Call garbage collection related tasks
15614 when corresponding options are invoked.
15615 (queue_middle_gc_tasks): New function.
15616 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15617 processed early before laying out sections during garbage collection.
15618 * gold.h (queue_middle_gc_tasks): New function.
15619 (is_prefix_of): Move from "layout.cc".
15620 * i386.cc (Target_i386::gc_process_relocs): New function.
15621 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15622 * main.cc (main): Create object of class "Garbage_collection".
15623 * object.cc (Relobj::copy_symbols_data): New function.
15624 (Relobj::is_section_name_included): New function.
15625 (Sized_relobj::do_layout): Allow this function to be called twice
15626 during garbage collection and defer layout of section during the
15627 first call.
15628 * object.h (Relobj::get_symbols_data): New function.
15629 (Relobj::is_section_name_included): New function.
15630 (Relobj::copy_symbols_data): New function.
15631 (Relobj::set_symbols_data): New function.
15632 (Relobj::get_relocs_data): New function.
15633 (Relobj::set_relocs_data): New function.
15634 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15635 (Relobj::gc_process_relocs): New function.
15636 (Relobj::do_gc_process_relocs): New pure virtual function.
15637 (Relobj::sd_): New data member.
15638 (Sized_relobj::is_output_section_offset_invalid): New function.
15639 (Sized_relobj::do_gc_process_relocs): New function.
15640 * options.h (General_options::gc_sections): Modify to not be a no-op.
15641 (General_options::print_gc_sections): New option.
15642 * plugin.cc (Plugin_finish::run): Remove function call to
15643 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15644 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15645 * reloc.cc (Read_relocs::run): Add task to process relocs and
15646 determine unreferenced sections when doing garbage collection.
15647 (Gc_process_relocs): New class.
15648 (Sized_relobj::do_gc_process_relocs): New function.
15649 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15650 sections that are garbage collected.
15651 * reloc.h (Gc_process_relocs): New class.
15652 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15653 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15654 symbols whose corresponding sections are garbage collected.
15655 (Symbol_table::Symbol_table): Add new parameter for the garbage
15656 collection object.
15657 (Symbol_table::gc_mark_undef_symbols): New function.
15658 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15659 (Symbol_table::gc_mark_dyn_syms): New function.
15660 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15661 as garbage.
15662 (Symbol_table::add_from_object): Likewise.
15663 (Symbol_table::add_from_relobj): When building shared objects, do not
15664 treat externally visible symbols as garbage.
15665 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15666 table information for static and relocatable links.
15667 * symtab.h (Symbol_table::set_gc): New function.
15668 (Symbol_table::gc): New function.
15669 (Symbol_table::gc_mark_undef_symbols): New function.
15670 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15671 (Symbol_table::gc_mark_dyn_syms): New function.
15672 (Symbol_table::gc_): New data member.
15673 * target.h (Sized_target::gc_process_relocs): New pure virtual
15674 function.
15675 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15676 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15677
15678 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15679
15680 * options.h (General_options::gc_sections): Define as a no-op for now.
15681 (General_options::no_keep_memory): Ditto.
15682 (General_options::Bshareable): Define.
15683 * options.cc (General_options::finalize): Honor -Bshareable.
15684
15685 2009-01-20 Andreas Schwab <schwab@suse.de>
15686
15687 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15688 read the value in the contents, since we don't use it. Use the
15689 template endianness when writing.
15690 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15691
15692 2009-01-19 Andreas Schwab <schwab@suse.de>
15693
15694 * configure.tgt (powerpc64-*): Fix targ_obj.
15695
15696 2009-01-15 Ian Lance Taylor <iant@google.com>
15697
15698 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15699 local symbols when stripping all symbols.
15700
15701 2009-01-14 Cary Coutant <ccoutant@google.com>
15702
15703 * output.cc (Output_reloc): Add explicit instantiations.
15704
15705 2009-01-14 Cary Coutant <ccoutant@google.com>
15706
15707 * archive.cc (Archive::get_elf_object_for_member): Remove call
15708 to File_read::claim_for_plugin.
15709 * descriptors.cc (Descriptors::open): Remove reference to
15710 is_claimed.
15711 (Descriptors::claim_for_plugin): Remove.
15712 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15713 (Descriptors::is_claimed): Remove.
15714 (claim_descriptor_for_plugin): Remove.
15715 * fileread.cc (File_read::claim_for_plugin): Remove.
15716 * fileread.h (File_read::claim_for_plugin): Remove.
15717 (File_read::descriptor): Reopen descriptor if necessary.
15718 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15719 (Plugin_manager::all_symbols_read): Add task parameter. Change
15720 all callers.
15721 (Plugin_manager::get_input_file): New function.
15722 (Plugin_manager::release_input_file): New function.
15723 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15724 corresponding data member.
15725 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15726 and pass to base constructor. Change all callers.
15727 (get_input_file, release_input_file): New functions.
15728 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15729 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15730 (Plugin_manager::all_symbols_read): Add task parameter.
15731 (Plugin_manager::get_input_file): New function.
15732 (Plugin_manager::release_input_file): New function.
15733 (Plugin_manager::task_): New data member.
15734 (Pluginobj::Pluginobj): Add filesize parameter.
15735 (Pluginobj::filename): New function.
15736 (Pluginobj::descriptor): New function.
15737 (Pluginobj::filesize): New function.
15738 (Pluginobj::filesize_): New data member.
15739 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15740 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15741 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15742
15743 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15744 with archive libraries.
15745 * testsuite/Makefile.in: Regenerate.
15746 * testsuite/plugin_test.c (struct sym_info): New type.
15747 (get_input_file, release_input_file): New static variables.
15748 (onload): Capture new transfer vector entries.
15749 (claim_file_hook): Stop reading at end of file according to filesize.
15750 Factor out parsing of readelf output into separate function.
15751 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15752 APIs and get the source file name from the symbol table. Convert
15753 source file name to corresponding object file name. Print info
15754 message when adding new input files.
15755 (parse_readelf_line): New function.
15756 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15757 * testsuite/plugin_test_2.sh: Likewise.
15758 * testsuite/plugin_test_3.sh: Likewise.
15759 * testsuite/plugin_test_4.sh: New test case.
15760
15761 2009-01-07 Ian Lance Taylor <iant@google.com>
15762
15763 * version.cc (version_string): Bump to 1.8.
15764
15765 2008-12-23 Cary Coutant <ccoutant@google.com>
15766
15767 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15768 * plugin.cc (Plugin_manager::finish): Rename as
15769 layout_deferred_objects. Move cleanup to separate function.
15770 (Plugin_manager::cleanup): New function.
15771 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15772 separately.
15773 * plugin.h (Plugin_manager::finish): Rename as
15774 layout_deferred_objects.
15775 (Plugin_manager::cleanup): New function.
15776 (Plugin_manager::cleanup_done): New field.
15777
15778 2008-12-23 Cary Coutant <ccoutant@google.com>
15779
15780 * plugin.cc (is_visible_from_outside): New function.
15781 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15782 so we don't return "IR only" status for exported symbols or -r links.
15783
15784 * testsuite/Makefile.am (plugin_test_3): New test case.
15785 * testsuite/Makefile.in: Regenerate.
15786 * testsuite/plugin_test_3.sh: New file.
15787
15788 2008-12-22 Cary Coutant <ccoutant@google.com>
15789
15790 * object.cc (Sized_relobj::layout_section): New function.
15791 (Sized_relobj::do_layout): Defer layout of input sections until after
15792 plugin has provided replacement files.
15793 (Sized_relobj::do_layout_deferred_sections): New function.
15794 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15795 (Relobj::layout_deferred_sections): New function.
15796 (Relobj::do_layout_deferred_sections): New function.
15797 (Sized_relobj::do_layout_deferred_sections): New function.
15798 (Sized_relobj::layout_section): New function.
15799 (Sized_relobj::Deferred_layout): New structure.
15800 (Sized_relobj::deferred_layout_): New field.
15801 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15802 Change all callers. Layout deferred sections.
15803 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15804 references.
15805 (Plugin_hook::run): Move code from do_plugin_hook inline.
15806 (Plugin_hook::do_plugin_hook): Remove.
15807 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15808 (Plugin_manager::finish): Renamed, was cleanup.
15809 (Plugin_manager::should_defer_layout): New function.
15810 (Plugin_manager::add_deferred_layout_object): New function.
15811 (Plugin_manager::Deferred_layout_list): New type.
15812 (Plugin_manager::deferred_layout_objects_): New field.
15813 (Plugin_hook::do_plugin_hook): Remove.
15814
15815 2008-12-17 Ian Lance Taylor <iant@google.com>
15816
15817 * options.h (class General_options): Add --no case for
15818 --export-dynamic.
15819
15820 2008-12-16 Cary Coutant <ccoutant@google.com>
15821
15822 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15823 vector.
15824 (Plugin_manager::claim_file): Create plugin object even if
15825 plugin did not call the add_symbols callback.
15826 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15827 asking for more symbols than were added.
15828 * testsuite/Makefile.am (plugin_test_1): Add test case with
15829 no global symbols.
15830 (empty.syms): New target.
15831 * testsuite/Makefile.in: Regenerate.
15832 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15833 message. Don't call add_symbols if no globals.
15834 (all_symbols_read_hook): Don't provide replacement for empty
15835 claimed file.
15836
15837 2008-12-12 Ian Lance Taylor <iant@google.com>
15838
15839 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15840 r_type == 0 for a local symbol with r_sym == 0.
15841 (scan_relocatable_relocs): Pass r_sym to
15842 local_non_section_strategy.
15843 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15844 r_sym parameter.
15845
15846 * configure.ac: Update test for TLS descriptors: they are
15847 supported as of glibc 2.9.
15848 * configure: Rebuild.
15849
15850 2008-12-11 Ian Lance Taylor <iant@google.com>
15851
15852 PR 7091
15853 * target-reloc.h (Default_scan_relocatable_relocs): For each
15854 function, map r_type == 0 to RELOC_DISCARD.
15855
15856 2008-12-10 Cary Coutant <ccoutant@google.com>
15857
15858 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15859 object to override a kept COMDAT group from a plugin object.
15860
15861 2008-12-09 Ian Lance Taylor <iant@google.com>
15862
15863 PR 7088
15864 * yyscript.y (file_cmd): Handle INPUT.
15865
15866 * testsuite/initpri1.c: Change all declarations to be full
15867 prototypes by adding void, to avoid compiler warnings.
15868
15869 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15870
15871 * options.cc (General_options::parse_plugin_opt): New.
15872 (General_options::add_plugin): The argument now is just the filename.
15873 (General_options::add_plugin_option): New.
15874 * options.h (plugin_opt): New.
15875 (add_plugin): Change argument name.
15876 (add_plugin_option): New.
15877 * plugin.cc (Plugin::load): Don't parse the plugin option.
15878 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15879 (Plugin::add_option): New.
15880 (Plugin::args_): Change type.
15881 (Plugin::filename_): New.
15882 (Plugin_manager::add_plugin_option): New.
15883 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15884 * testsuite/Makefile.in: Regenerate.
15885
15886 2008-12-05 Cary Coutant <ccoutant@google.com>
15887
15888 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15889 Handle --strip-lto-sections option.
15890 * options.h (strip_lto_sections): New option.
15891
15892 2008-12-01 Cary Coutant <ccoutant@google.com>
15893
15894 * plugin.cc (ld_plugin_message): Change format parameter to const.
15895 Fix mismatch between new[] and delete.
15896
15897 2008-11-14 Cary Coutant <ccoutant@google.com>
15898
15899 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15900 instead of -1U.
15901
15902 2008-11-05 Craig Silverstein <csilvers@google.com>
15903
15904 * options.cc (General_options::parse_dynamic_list): New function.
15905 * options.h (General_options): New flags dynamic_list,
15906 dynamic_list_data, dynamic_list_cpp_new, and
15907 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15908 (General_options::in_dynamic_list): New function.
15909 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15910 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15911 (Lex::can_continue_name): Likewise.
15912 (yylex): Likewise.
15913 (read_script_file): New parameter script_options.
15914 (read_dynamic_list): New function.
15915 (Script_options::define_dynamic_list): New function.
15916 (dynamic_list_keyword_parsecodes): New variable.
15917 (dynamic_list_keywords): New variable.
15918 * script.h (Script_options::define_dynamic_list): New function
15919 prototype.
15920 (read_dynamic_list): New function prototype.
15921 * symtab.cc (strprefix): New macro.
15922 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15923 dynamic_list_data, dynamic_list_cpp_new, and
15924 dynamic_list_cpp_typeinfo.
15925 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15926 (dynamic_list_expr): New rule.
15927 (dynamic_list_nodes): Likewise.
15928 (dynamic_list_node): Likewise.
15929 * testsuite/Makefile.am (dynamic_list): New test.
15930 * testsuite/Makefile.in: Regenerated.
15931 * testsuite/dynamic_list.t: New file.
15932 * testsuite/dynamic_list.sh: New file.
15933
15934 2008-11-05 Craig Silverstein <csilvers@google.com>
15935
15936 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15937 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15938 (t11_last): Likewise.
15939 * testsuite/ver_test_6.c (main): Likewise.
15940
15941 2008-10-07 Cary Coutant <ccoutant@google.com>
15942
15943 * options.c (General_options::finalize): Add check for -static and
15944 -shared.
15945 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15946 is not empty.
15947
15948 2008-10-02 Cary Coutant <ccoutant@google.com>
15949
15950 * plugin.cc (make_sized_plugin_object): Fix conditional
15951 compilation to work when not all targets are enabled.
15952
15953 2008-09-29 Cary Coutant <ccoutant@google.com>
15954
15955 * archive.cc (Archive::get_file_and_offset): Use filename instead
15956 of name to get library path.
15957 (Archive::include_member): Unlock external member of a thin archive.
15958
15959 * testsuite/Makefile.am (TEST_AR): New variable.
15960 (thin_archive_test_1): New test.
15961 (thin_archive_test_2): New test.
15962 * testsuite/Makefile.in: Regenerate.
15963 * testsuite/thin_archive_main.cc: New file.
15964 * testsuite/thin_archive_test_1.cc: New file.
15965 * testsuite/thin_archive_test_2.cc: New file.
15966 * testsuite/thin_archive_test_3.cc: New file.
15967 * testsuite/thin_archive_test_4.cc: New file.
15968
15969 2008-09-29 Cary Coutant <ccoutant@google.com>
15970
15971 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15972 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15973 instead of -1U.
15974 (Sized_relobj::do_finalize_local_symbols): Likewise.
15975 (Sized_relobj::map_to_kept_section): Likewise.
15976 * object.h (Sized_relobj::invalid_address): New constant.
15977 (Sized_relobj::do_output_section_offset): Check for invalid_address
15978 and return -1ULL.
15979 * output.cc (Output_reloc::local_section_offset): Use constant
15980 invalid_address instead of -1U.
15981 (Output_reloc::get_address): Likewise.
15982 (Output_section::output_address): Change -1U to -1ULL.
15983 * output.h (Output_reloc::invalid_address): New constant.
15984 * reloc.cc (Sized_relobj::write_sections): Use constant
15985 invalid_address instead of -1U.
15986 (Sized_relobj::relocate_sections): Likewise.
15987 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15988 values for merge sections.
15989 * target-reloc.h (relocate_for_relocatable): Use constant
15990 invalid_address instead of -1U.
15991
15992 2008-09-19 Cary Coutant <ccoutant@google.com>
15993
15994 Add plugin functionality for link-time optimization (LTO).
15995 * configure.ac (plugins): Add --enable-plugins option.
15996 * configure: Regenerate.
15997 * config.in: Regenerate.
15998 * Makefile.am (LIBDL): New variable.
15999 (CCFILES): Add plugin.cc.
16000 (HFILES): Add plugin.h.
16001 (ldadd_var): Add LIBDL.
16002 * Makefile.in: Regenerate.
16003
16004 * archive.cc: Include "plugin.h".
16005 (Archive::setup): Don't preread archive symbols when using a plugin.
16006 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
16007 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
16008 files.
16009 (Archive::include_member): Add symbols from plugin objects.
16010 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
16011 * descriptors.cc (Descriptors::open): Check for file descriptors
16012 abandoned by plugins.
16013 (Descriptors::claim_for_plugin): New function.
16014 * descriptors.h (Descriptors::claim_for_plugin): New function.
16015 (Open_descriptor::is_claimed): New field.
16016 (claim_descriptor_for_plugin): New function.
16017 * fileread.cc (File_read::claim_for_plugin): New function.
16018 * fileread.h (File_read::claim_for_plugin): New function.
16019 (File_read::descriptor): New function.
16020 * gold.cc: Include "plugin.h".
16021 (queue_initial_tasks): Add task to call plugin hooks for generating
16022 new object files.
16023 * main.cc: Include "plugin.h".
16024 (main): Load plugin libraries.
16025 * object.h (Pluginobj): Declare.
16026 (Object::pluginobj): New function.
16027 (Object::do_pluginobj): New function.
16028 (Object::set_target): New function.
16029 * options.cc: Include "plugin.h".
16030 (General_options::parse_plugin): New function.
16031 (General_options::General_options): Initialize plugins_ field.
16032 (General_options::add_plugin): New function.
16033 * options.h (Plugin_manager): Declare.
16034 (General_options): Add --plugin option.
16035 (General_options::has_plugins): New function.
16036 (General_options::plugins): New function.
16037 (General_options::add_plugin): New function.
16038 (General_options::plugins_): New field.
16039 * plugin.cc: New file.
16040 * plugin.h: New file.
16041 * readsyms.cc: Include "plugin.h".
16042 (Read_symbols::do_read_symbols): Check for archive before checking
16043 for ELF file. Call plugin hooks to claim files.
16044 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
16045 from a real object file; force override when processing replacement
16046 files.
16047 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
16048 (Symbol::init_base_object): Likewise.
16049 (Symbol::init_base_output_data): Likewise.
16050 (Symbol::init_base_output_segment): Likewise.
16051 (Symbol::init_base_constant): Likewise.
16052 (Symbol::init_base_undefined): Likewise.
16053 (Symbol::output_section): Assert that object is not a plugin.
16054 (Symbol_table::add_from_pluginobj): New function.
16055 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
16056 undefined.
16057 (Symbol_table::sized_write_globals): Likewise.
16058 (Symbol_table::add_from_pluginobj): Instantiate template.
16059 * symtab.h (Sized_pluginobj): Declare.
16060 (Symbol::in_real_elf): New function.
16061 (Symbol::set_in_real_elf): New function.
16062 (Symbol::in_real_elf_): New field.
16063 (Symbol_table::add_from_pluginobj): New function.
16064
16065 * testsuite/Makefile.am (AM_CFLAGS): New variable.
16066 (LIBDL): New variable.
16067 (LDADD): Add LIBDL.
16068 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
16069 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
16070 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
16071 (MOSTLYCLEANFILES): Likewise.
16072 * testsuite/Makefile.in: Regenerate.
16073 * testsuite/plugin_test.c: New file.
16074 * testsuite/plugin_test_1.sh: New file.
16075 * testsuite/plugin_test_2.sh: New file.
16076
16077 2008-09-16 Ian Lance Taylor <iant@google.com>
16078
16079 * target-reloc.h (relocate_section): Check whether a symbol is
16080 defined by the ABI before reporting an undefined symbol error.
16081 * target.h (Target::is_defined_by_abi): Make parameter const.
16082 (Target::do_is_defined_by_abi): Likewise.
16083 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
16084 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
16085 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
16086 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
16087 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
16088 * testsuite/Makefile.in: Rebuild.
16089
16090 * fileread.cc (make_view): Add casts to avoid warning.
16091
16092 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
16093
16094 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
16095 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16096
16097 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
16098
16099 * options.h (General_options::output_is_executable): New.
16100 (General_options::output_is_pie): New.
16101 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16102 for shared libraries.
16103 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16104
16105 2008-09-11 Chris Demetriou <cgd@google.com>
16106
16107 * options.h (origin): New -z option.
16108 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16109 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16110 in DT_FLAGS_1.
16111
16112 2008-09-05 Cary Coutant <ccoutant@google.com>
16113
16114 * fileread.cc (File_read::make_view): Add check for attempt to map
16115 beyond end of file.
16116
16117 2008-09-05 Cary Coutant <ccoutant@google.com>
16118
16119 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16120 explicit instantiations.
16121
16122 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16123
16124 PR gold/6858
16125 * options.cc (General_options::finalize): Allow undefined symbols
16126 in shlibs if linking -shared.
16127
16128 PR gold/6859
16129 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16130 symbols as not needing a dynsym entry.
16131
16132 2008-08-20 Craig Silverstein <csilvers@google.com>
16133
16134 * fileread.cc (File_read::open): Do not lock the file unless it
16135 was successfully opened.
16136
16137 2008-08-14 Cary Coutant <ccoutant@google.com>
16138
16139 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16140 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16141 * testsuite/tls_test.cc (struct int128): 128-bit struct
16142 for testing TLS relocs with non-zero addend.
16143 (v12): New TLS variable.
16144 (t12): New test.
16145 (t_last): Add check for v12.
16146 * testsuite/tls_test.h (t12): New function.
16147 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16148
16149 2008-08-13 Ian Lance Taylor <iant@google.com>
16150
16151 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16152 set tls_segment_ or relro_segment_.
16153 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16154 when appropriate.
16155 * output.h (Output_section::clear_is_relro): New function.
16156 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16157 sections specially even when output_data_ is empty.
16158 (Output_segment::maximum_alignment): When first section is relro,
16159 only force alignment for PT_LOAD segments.
16160 * script.cc (script_data_segment_align): New function.
16161 (script_data_segment_relro_end): New function.
16162 * script-c.h (script_data_segment_align): Declare.
16163 (script_data_segment_relro_end): Declare.
16164 * script-sections.h (class Script_sections): Declare
16165 data_segment_align and data_segment_relro_end. Add fields
16166 segment_align_index_ and saw_relro_end_.
16167 * script-sections.cc (class Sections_element): Add set_is_relro
16168 virtual function. Add new bool* parameter to place_orphan_here.
16169 Add get_output_section virtual function.
16170 (class Output_section_definition): Add set_is_relro. Add new
16171 bool* parameter to place_orphan_here. Add get_output_section.
16172 Add is_relro_ field.
16173 (Output_section_definition::Output_section_definition): Initialize
16174 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16175 and is_relro_ fields.
16176 (Output_section_definition::place_orphan_here): Add is_relro
16177 parameter.
16178 (Output_section_definition::set_section_addresses): Set relro for
16179 output section.
16180 (Output_section_definition::alternate_constraint): Likewise.
16181 (class Orphan_output_section): Add new bool* parameter to
16182 place_orphan_here. Add get_output_section.
16183 (Orphan_output_section::place_orphan_here): Add is_relro
16184 parameter.
16185 (Script_sections::Script_sections): Initialize
16186 data_segment_align_index_ and saw_relro_end_.
16187 (Script_sections::data_segment_align): New function.
16188 (Script_sections::data_segment_relro_end): New function.
16189 (Script_sections::place_orphan): Set or clear is_relro.
16190 (Script_sections::set_section_addresses): Force alignment of first
16191 TLS section.
16192 * yyscript.y (exp): Call script_data_segment_align and
16193 script_data_segment_relro_end.
16194 * testsuite/relro_script_test.t: New file.
16195 * testsuite/relro_test.cc (using_script): Declare.
16196 (t1, t2): Test using_script.
16197 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16198 (relro_script_test_SOURCES): Define.
16199 (relro_script_test_DEPENDENCIES): Define.
16200 (relro_script_test_LDFLAGS): Define.
16201 (relro_script_test_LDADD): Define.
16202 (relro_script_test.so): New target.
16203 * testsuite/Makefile.in: Rebuild.
16204
16205 2008-08-06 Cary Coutant <ccoutant@google.com>
16206
16207 * archive.cc (Archive::total_archives, Archive::total_members)
16208 (Archive::total_members_loaded): New variables.
16209 (Archive::setup): Add parameter. Add option to preread
16210 archive symbols.
16211 (Archive::read_armap): Add counter.
16212 (Archive::get_file_and_offset): New function.
16213 (Archive::get_elf_object_for_member): New function.
16214 (Archive::read_all_symbols): New function.
16215 (Archive::read_symbols): New function.
16216 (Archive::add_symbols): Add counters.
16217 (Archive::include_all_members): Use armap to find members if it's
16218 already built.
16219 (Archive::include_member): Skip reading symbols if already read.
16220 Factored code into Archive::get_file_and_offset and
16221 Archive::get_elf_object_for_member. Changed call to
16222 Mapfile::report_include_archive_member.
16223 (Archive::print_stats): New function.
16224 * archive.h: Declare Object and Read_symbols_data classes.
16225 (Archive::Archive): Add initializers for new members.
16226 (Archive::setup): Add parameter.
16227 (Archive::print_stats): New function.
16228 (Archive::total_archives, Archive::total_members)
16229 (Archive::total_members_loaded): New variables.
16230 (Archive::get_file_and_offset): New function.
16231 (Archive::get_elf_object_for_member): New function.
16232 (Archive::read_all_symbols): New function.
16233 (Archive::read_symbols): New function.
16234 (Archive::Archive_member): New class.
16235 (Archive::members_): New member.
16236 (Archive::num_members_): New member.
16237 * main.cc: Include archive.h.
16238 (main): Call Archive::print_stats.
16239 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16240 archive parameter; member_name is now the fully-decorated name.
16241 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16242 * options.h: (General_options): Add --preread-archive-symbols option.
16243 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16244 Archive::setup.
16245
16246 2008-08-04 Ian Lance Taylor <iant@google.com>
16247
16248 * symtab.h (Symbol::use_plt_offset): New function.
16249 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16250 * powerpc.cc (Relocate::relocate): Likewise.
16251 * sparc.cc (Relocate::relocate): Likewise.
16252 * x86_64.cc (Relocate::relocate): Likewise.
16253 * testsuite/weak_plt.sh: New test.
16254 * testsuite/weak_plt_main.cc: New test.
16255 * testsuite/weak_plt_shared.cc: New test.
16256 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16257 (check_PROGRAMS): Add weak_plt.
16258 (check_DATA): Add weak_plt_shared.so.
16259 (weak_plt_main_pic.o, weak_plt): New targets.
16260 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16261 * testsuite/Makefile.in: Rebuild.
16262
16263 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16264 gcctestdir/ld.
16265 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16266 * testsuite/Makefile.in: Rebuild.
16267
16268 2008-08-04 Alan Modra <amodra@bigpond.net.au>
16269
16270 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16271 * Makefile.in: Regenerate.
16272 * po/POTFILES.in: Regenerate.
16273
16274 2008-07-29 Ian Lance Taylor <iant@google.com>
16275
16276 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16277 symbols before other symbols.
16278 * testsuite/script_test_2.cc (test_addr): Declare.
16279 (test_addr_alias): Declare.
16280 (main): Check that test_addr and test_addr_alias have the right
16281 values.
16282 * testsuite/script_test_2.t: Define test_addr_alias and
16283 test_addr.
16284
16285 2008-07-24 Ian Lance Taylor <iant@google.com>
16286
16287 PR 5990
16288 * descriptors.cc: New file.
16289 * descriptors.h: New file.
16290 * gold-threads.h (class Hold_optional_lock): New class.
16291 * fileread.cc: Include "descriptors.h".
16292 (File_read::~File_read): Release descriptor rather than closing
16293 it.
16294 (File_read::open) [file]: Call open_descriptor rather than open.
16295 Set is_descriptor_opened_.
16296 (File_read::open) [memory]: Assert that descriptor is not open.
16297 (File_read::reopen_descriptor): New function.
16298 (File_read::release): Release descriptor.
16299 (File_read::do_read): Make non-const. Reopen descriptor.
16300 (File_read::read): Make non-const.
16301 (File_read::make_view): Reopen descriptor.
16302 (File_read::do_readv): Likewise.
16303 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16304 Update declarations.
16305 * layout.cc: Include "descriptors.h".
16306 (Layout::create_build_id): Use open_descriptor rather than open.
16307 * output.cc: Include "descriptors.h".
16308 (Output_file::open): Use open_descriptor rather than open.
16309 * archive.cc (Archive::const_iterator): Change Archive to be
16310 non-const.
16311 (Archive::begin, Archive::end): Make non-const.
16312 (Archive::count_members): Likewise.
16313 * archive.h (class Archive): Update declarations.
16314 * object.h (Object::read): Make non-const.
16315 * Makefile.am (CCFILES): Add descriptors.cc.
16316 (HFILES): Add descriptors.h.
16317 * Makefile.in: Rebuild.
16318
16319 PR 6716
16320 * gold.h: Always include <clocale>. Add Solaris workarounds
16321 following code in binutils/sysdep.h.
16322
16323 PR 6048
16324 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16325 this->eh_frame_hdr_ is NULL before using it.
16326
16327 * dynobj.cc (Versions::Versions): Update comment.
16328
16329 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16330 the base version name.
16331
16332 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16333 array size plus one.
16334 (Stringpool_template::set_string_offsets): Subtract one from key
16335 before using it as an array index.
16336 (Stringpool_template::get_offset_with_length): Likewise.
16337 (Stringpool_template::write_to_buffer): Likewise.
16338 * stringpool.h (Stringpool_template::get_offset_from_key):
16339 Likewise.
16340
16341 2008-07-23 Ian Lance Taylor <iant@google.com>
16342
16343 PR 6658
16344 * object.h (Merged_symbol_value::value): Do our best to handle a
16345 negative addend.
16346
16347 PR 6647
16348 * script.cc (Version_script_info::get_versions): Don't add empty
16349 version tag to return value.
16350 (Version_script_info::get_symbol_version_helper): Change return
16351 type to bool. Add pversion parameter. Change all callers.
16352 (script_register_vers_node): Don't require a non-NULL tag.
16353 * script.h (class Version_script_info): Update declarations.
16354 (Version_script_info::get_symbol_version): Change return type to
16355 bool. Add version parameter. Change all callers.
16356 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16357 handling. Handle an empty version from a version script.
16358 (Symbol_table::define_special_symbol): Likewise.
16359 * testsuite/ver_test_10.script: New file.
16360 * testsuite/ver_test_10.sh: New file.
16361 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16362 (check_DATA): Add ver_test_10.syms.
16363 (ver_test_10.syms, ver_test_10.so): New target.
16364 * testsuite/Makefile.in: Rebuild.
16365
16366 2008-07-23 Simon Baldwin <simonb@google.com>
16367
16368 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16369 to zero for undefined symbols from dynamic libraries.
16370
16371 2008-07-23 Ian Lance Taylor <iant@google.com>
16372
16373 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16374 Change all callers.
16375 * symtab.h (class Symbol_table): Update declaration.
16376 * testsuite/ver_test_9.cc: New file.
16377 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16378 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16379 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16380 (ver_test_9.so, ver_test_9.o): New targets.
16381 * testsuite/Makefile.in: Rebuild.
16382
16383 2008-07-22 Ian Lance Taylor <iant@google.com>
16384
16385 * options.h (class General_options): Define --check-sections.
16386 * layout.cc (Layout::set_segment_offsets): Handle
16387 --check-sections.
16388
16389 * options.h (class General_options): Define -n/--nmagic and
16390 -N/--omagic.
16391 * options.cc (General_options::finalize): For -n/--nmagic or
16392 -N/--omagic, set -static.
16393 * layout.cc (Layout::attach_allocated_section_to_segment): If
16394 -N/--omagic, don't put read-only and read-write sections in
16395 different segments.
16396 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16397 finding a read-only segment.
16398 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16399 don't set the minimum segment alignment to the common page size,
16400 and don't set the file offset to the address modulo the page size.
16401 * script-sections.cc (Script_sections::create_segments): If
16402 -n/--omagic, don't put read-only and read-write sections in
16403 different segments.
16404
16405 * cref.cc: New file.
16406 * cref.h: New file.
16407 * options.h (class General_options): Add --print-symbol-counts.
16408 * main.cc (main): Issue defined symbol report if requested.
16409 * archive.cc (Archive::interpret_header): Make into a const member
16410 function.
16411 (Archive::add_symbols): Call Input_objects::archive_start and
16412 archive_stop.
16413 (Archive::const_iterator): Define new class.
16414 (Archive::begin, Archive::end): New functions.
16415 (Archive::include_all_members): Rewrite to use iterator.
16416 (Archive::count_members): New function.
16417 * archive.h (class Archive): Update declarations.
16418 (Archive::filename): New function.
16419 * object.cc: Include "cref.h".
16420 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16421 (Sized_relobj::do_get_global_symbol_counts): New function.
16422 (Input_objects::add_object): Add object to cross-referencer.
16423 (Input_objects::archive_start): New function.
16424 (Input_objects::archive_stop): New function.
16425 (Input_objects::print_symbol_counts): New function.
16426 * object.h: Declare Cref and Archive.
16427 (Object::get_global_symbol_counts): New function.
16428 (Object::do_get_global_symbol_counts): New pure virtual function.
16429 (class Sized_relobj): Add defined_count_ field. Update
16430 declarations.
16431 (class Input_objects): Add cref_ field. Update constructor.
16432 Update declarations.
16433 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16434 defined_count_.
16435 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16436 symbol counts.
16437 (Sized_dynobj::do_get_global_symbol_counts): New function.
16438 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16439 defined_count_. Update declarations. Define Symbols typedef.
16440 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16441 parameter. Change all callers.
16442 (Symbol_table::add_from_dynobj): Add sympointers and defined
16443 parameters. Change all callers.
16444 * symtab.h (class Symbol_table): Update declarations.
16445 * Makefile.am (CCFILES): Add cref.cc.
16446 (HFILES): Add cref.h.
16447 * Makefile.in: Rebuild.
16448
16449 2008-07-22 Simon Baldwin <simonb@google.com>
16450
16451 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16452 to zero when writing undefined symbols.
16453
16454 2008-07-22 Ian Lance Taylor <iant@google.com>
16455
16456 * output.cc (Output_section::add_input_section): Don't try to
16457 merge empty merge sections.
16458
16459 2008-07-21 Craig Silverstein <csilvers@google.com>
16460
16461 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16462 Include symbol version in error message.
16463
16464 2008-07-20 Chris Demetriou <cgd@google.com>
16465
16466 * configure.ac (gold_cv_c_random_seed): New configured variable.
16467 (RANDOM_SEED_CFLAGS): New substituted variable.
16468 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16469 * configure: Rebuild.
16470 * Makefile.in: Likewise.
16471 * testsuite/Makefile.in: Likewise.
16472
16473 2008-07-18 Ian Lance Taylor <iant@google.com>
16474
16475 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16476 where we see NAME/NULL and NAME/VERSION as separate symbols.
16477 * testsuite/ver_test_main.cc (main): Call t4.
16478 (t4, t4_2a): Define.
16479 * testsuite/ver_test_2.cc (t4_2): Define.
16480 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16481 * testsuite/ver_test_4.cc (t4_2a): Define.
16482 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16483 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16484
16485 2008-07-17 Ian Lance Taylor <iant@google.com>
16486
16487 * dynobj.cc (Versions::add_def): If we give an error about a
16488 missing version, go ahead and create the version anyhow.
16489
16490 2008-07-10 Ian Lance Taylor <iant@google.com>
16491
16492 Handle output sections with more than 0x7fffffff bytes.
16493 * object.h (class Relobj): Change map_to_output_ to
16494 output_sections_, and just keep a section pointer. Change all
16495 uses. Move comdat group support to Sized_relobj.
16496 (Relobj::is_section_specially_mapped): Remove.
16497 (Relobj::output_section): Remove poff parameter. Change all
16498 callers.
16499 (Relobj::output_section_offset): New function.
16500 (Relobj::set_section_offset): Rewrite.
16501 (Relobj::map_to_output): Remove.
16502 (Relobj::output_sections): New function.
16503 (Relobj::do_output_section_offset): New pure virtual function.
16504 (Relobj::do_set_section_offset): Likewise.
16505 (class Sized_relobj): Add section_offsets_ field. Add comdat
16506 group support from Relobj. Update declarations.
16507 (Sized_relobj::get_output_section_offset): New function.
16508 (Sized_relobj::do_output_section_offset): New function.
16509 (Sized_relobj::do_set_section_offset): New function.
16510 * object.cc (Relobj::output_section_address): Remove.
16511 (Sized_relobj::Sized_relobj): Initialize new fields.
16512 (Sized_relobj::include_section_group): Cast find_kept_object to
16513 Sized_relobj.
16514 (Sized_relobj::include_linkonce_section): Likewise.
16515 (Sized_relobj::do_layout): Use separate arrays for output section
16516 and output offset.
16517 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16518 output_sections.
16519 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16520 output_sections and section_offsets.
16521 (Sized_relobj::write_local_symbols): Likewise.
16522 (map_to_kept_section): Compute output address directly.
16523 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16524 output_sections and section_offsets.
16525 (Sized_relobj::write_sections): Likewise.
16526 (Sized_relobj::relocate_sections): Likewise.
16527 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16528 * output.h (class Output_reloc): Update declarations. Change
16529 u2_.relobj to Sized_relobj*.
16530 (class Output_data_reloc): Change add functions to use
16531 Sized_relobj*.
16532 * output.cc (Output_reloc::Output_reloc): Change relobj to
16533 Sized_relobj*.
16534 (Output_reloc::local_section_offset): Change return type to
16535 Elf_Addr. Use get_output_section_offset.
16536 (Output_reloc::get_address): Likewise.
16537 (Output_section::is_input_address_mapped): Don't call
16538 is_section_specially_mapped.
16539 (Output_section::output_offset): Likewise.
16540 (Output_section::output_address): Likewise.
16541 (Output_section::starting_output_address): Likewise.
16542 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16543 parameter to Sized_relobj*.
16544 (Copy_relocs::need_copy_reloc): Likewise.
16545 (Copy_relocs::save): Likewise.
16546 * copy-relocs.h (class Copy_relocs): Update declarations.
16547 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16548 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16549 * target-reloc.h (relocate_for_relocatable): Change
16550 offset_in_output_section type to Elf_Addr. Change code that uses
16551 it as well.
16552 * layout.cc (Layout::layout): Always set *off.
16553 * mapfile.cc (Mapfile::print_input_section): Use
16554 output_section_offset.
16555 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16556 Sized_relobj*.
16557 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16558 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16559 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16560
16561 2008-07-03 Ian Lance Taylor <iant@google.com>
16562
16563 * layout.cc (Layout::include_section): Do not discard unrecognized
16564 SHT_STRTAB sections.
16565
16566 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16567
16568 * script.cc (Lex::can_continue_name): Make '?' allowable in
16569 version-script names.
16570 * testsuite/version_script.map: Change glob pattern to use '?'
16571
16572 2008-06-30 Manish Singh <yosh@gimp.org>
16573
16574 PR 6585
16575 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16576 Correct typo.
16577
16578 2008-06-30 Ian Lance Taylor <iant@google.com>
16579
16580 PR 6660
16581 PR 6682
16582 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16583 versions]: Don't try to read the value in the contents, since we
16584 don't use it. Use the template endianness when writing.
16585
16586 2008-06-25 Cary Coutant <ccoutant@google.com>
16587
16588 * fileread.cc (File_read::make_view): Assert on zero-length view.
16589 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16590 symbol table when there are no symbols to read.
16591
16592 2008-06-23 Craig Silverstein <csilvers@google.com>
16593
16594 * version.cc (version_string): Bump to 1.7
16595
16596 2008-06-18 Craig Silverstein <csilvers@google.com>
16597
16598 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16599 constant 0xFFFF to type Valtype.
16600 (Powerpc_relocate_functions::rel16_ha): Likewise.
16601
16602 2008-06-17 Ian Lance Taylor <iant@google.com>
16603
16604 * output.h (Output_section::Input_section): Initialize p2align_ to
16605 zero for Output_section_data constructors.
16606 (Output_section::Input_section::addralign): If not an input
16607 section, return the alignment of the Output_section_data.
16608 * testsuite/copy_test.cc: New file.
16609 * testsuite/copy_test_1.cc: New file.
16610 * testsuite/copy_test_2.cc: New file.
16611 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16612 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16613 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16614 (copy_test_1_pic.o, copy_test_1.so): New targets.
16615 (copy_test_2_pic.o, copy_test_2.so): New targets.
16616 * testsuite/Makefile.in: Rebuild.
16617
16618 * script-sections.cc (Script_sections::place_orphan): Initialize
16619 local variable exact.
16620
16621 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16622
16623 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16624
16625 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16626 David S. Miller <davem@davemloft.net>
16627
16628 * powerpc.cc: New file.
16629 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16630 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16631 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16632 * Makefile.in: Rebuild.
16633
16634 2008-06-09 Ian Lance Taylor <iant@google.com>
16635
16636 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16637 <exception>.
16638 (throwing, orig_terminate): New static variables.
16639 (terminate_handler): New static function.
16640 (t2): Set terminate handler.
16641
16642 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16643
16644 PR 6584
16645 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16646 alignment.
16647
16648 2008-05-30 Cary Coutant <ccoutant@google.com>
16649
16650 * archive.cc (Archive::include_all_members) Correct to step
16651 over symbol table and extended name table in thin archives.
16652
16653 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16654
16655 PR 6407
16656 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16657 calculation.
16658
16659 2008-05-28 Caleb Howe <cshowe@google.com>
16660
16661 * reduced_debug_output.cc: New file.
16662 * reduced_debug_output.h: New file.
16663 * options.h (class General_options): Add --strip-debug-non-line.
16664 * options.cc (General_options::finalize): Add strip_debug_non_line
16665 to the strip heirarchy.
16666 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16667 fields.
16668 * layout.cc: Include "reduced_debug_output.h".
16669 (Layout::Layout): Initialize new fields.
16670 (line_only_debug_sections): New static array.
16671 (is_lines_only_debug_sections): New static inline function.
16672 (Layout::include_section): Handle --strip-debug-non-line.
16673 (Layout::make_output_section): If --strip-debug-non-line, build
16674 new output sections for .debug_abbrev and .debug_info.
16675 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16676 gold. Warn about possible overflow.
16677 (read_signed_LEB_128): Likewise.
16678 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16679 (read_signed_LEB_128): Declare.
16680 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16681 (HFILES): Add reduced_debug_output.h.
16682 * Makefile.in: Rebuild.
16683
16684 2008-05-21 Ian Lance Taylor <iant@google.com>
16685
16686 * mapfile.cc: New file.
16687 * mapfile.h: New file.
16688 * options.h (class General_options): Add -M/--print-map and -Map.
16689 * options.cc (General_options::finalize): Make -M equivalent to
16690 -Map -.
16691 * main.cc: Include <cstdio> and "mapfile.h".
16692 (main): Open mapfile if requested.
16693 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16694 constructor. Change caller.
16695 (queue_initial_tasks): Add mapfile parameter. Change caller.
16696 (queue_middle_tasks): Likewise.
16697 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16698 declarations.
16699 * archive.cc: Include "mapfile.h".
16700 (Archive::add_symbols): Add mapfile parameter. Change all
16701 callers. Pass mapfile, symbol, and reason to include_member.
16702 (Archive::include_all_members): Add mapfile parameter. Change all
16703 callers.
16704 (Archive::include_member): Add mapfile, sym, and why parameters.
16705 Change all callers. Report inclusion to map file.
16706 * archive.h: Include "fileread.h".
16707 (class Archive): Update declarations.
16708 (Archive::file): New const method.
16709 (class Add_archive_symbols): Add mapfile_ field. Update
16710 constructor. Change all callers.
16711 * readsyms.h (class Read_symbols): Likewise.
16712 (class Finish_group): Likewise.
16713 (class Read_script): Likewise.
16714 * common.cc: Include "mapfile.h".
16715 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16716 all callers.
16717 (Symbol_table::do_allocate_commons): Likewise.
16718 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16719 symbol allocation to mapfile.
16720 * common.h (class Allocate_commons_task): Add mapfile_ field.
16721 Update constructor. Change all callers.
16722 * symtab.h (class Symbol_table): Update declarations.
16723 * layout.cc: Include "mapfile.h".
16724 (Layout_task_runner::run): Print information to mapfile.
16725 (Layout::create_gold_note): Change Output_data_fixed_space to
16726 Output_data_zero_fill.
16727 (Layout::create_build_id): Likewise.
16728 (Layout::print_to_mapfile): New function.
16729 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16730 constructor. Change caller.
16731 (class Layout): Declare print_to_mapfile.
16732 * output.cc (Output_section::Input_section::print_to_mapfile): New
16733 function.
16734 (Output_section::add_input_section): If producing a map, always
16735 add to input_sections_ list.
16736 (Output_section::do_print_to_mapfile): New function.
16737 (Output_segment::print_sections_to_mapfile): New function.
16738 (Output_segment::print_section_list_to_mapfile): New function.
16739 * output.h: Include "mapfile.h".
16740 (Output_data::print_to_mapfile): New function.
16741 (Output_data::do_print_to_mapfile): New virtual function.
16742 (Output_segment_headers::do_print_to_mapfile): New function.
16743 (Output_file_header::do_print_to_mapfile): New function.
16744 (Output_data_const::do_print_to_mapfile): New function.
16745 (class Output_data_const_buffer): Add map_name_ field. Update
16746 constructor. Change all callers. Add do_print_to_mapfile
16747 function.
16748 (class Output_data_fixed_space): Likewise.
16749 (class Output_data_space): Likewise.
16750 (class Output_data_zero_fill): New class.
16751 (Output_data_strtab::do_print_to_mapfile): New function.
16752 (Output_data_reloc_base::do_print_to_mapfile): New function.
16753 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16754 (Output_data_group::do_print_to_mapfile): New function.
16755 (Output_data_got::do_print_to_mapfile): New function.
16756 (Output_data_dynamic::do_print_to_mapfile): New function.
16757 (Output_symtab_xindex::do_print_to_mapfile): New function.
16758 (class Output_section): Declare do_print_to_mapflie. Declare
16759 print_to_mapfile in Input_section.
16760 (class Output_segment): Declare new functions.
16761 * object.h (Sized_relobj::symbol_count): New function.
16762 * script-sections.cc
16763 (Output_section_element_dot_assignment::set_section_addresses):
16764 Change Output_data_fixed_space to Output_data_zero_fill.
16765 (Output_data_expression::do_print_to_mapfile): New function.
16766 * script.cc (read_input_script): Add mapfile parameter. Change
16767 all callers.
16768 * script.h (read_input_script): Update declaration.
16769 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16770 (Eh_frame::do_print_to_mapfile): New function.
16771 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16772 (Output_merge_string::do_print_to_mapfile): New function.
16773 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16774 function.
16775 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16776 function.
16777 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16778 function.
16779 * Makefile.am (CCFILES): Add mapfile.cc.
16780 (HFILES): Add mapfile.h.
16781 * Makefile.in: Rebuild.
16782
16783 2008-05-19 Ian Lance Taylor <iant@google.com>
16784
16785 * options.h (class General_options): Add -z relro.
16786 * layout.cc (Layout::Layout): Initialize relro_segment_.
16787 (Layout::add_output_section_data): Return the output section.
16788 (Layout::make_output_section): Rcognize relro sections and mark
16789 them appropriately.
16790 (Layout::attach_allocated_section_to_segment): Put relro sections
16791 in a PT_GNU_RELRO segment.
16792 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16793 section as relro.
16794 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16795 PT_TLS segments.
16796 (Layout::linkonce_mapping): Map d.rel.ro.local to
16797 .data.rel.ro.local.
16798 (Layout::output_section_name): Us .data.rel.ro.local for any
16799 section which begins with that.
16800 * layout.h (class Layout): Update add_output_section_data
16801 declaration. Add relro_segment_ field.
16802 * output.cc (Output_section::Output_section): Initialize is_relro_
16803 and is_relro_local_ fields.
16804 (Output_segment::add_output_section): Group relro sections.
16805 (Output_segment::is_first_section_relro): New function.
16806 (Output_segment::maximum_alignment): If there is a relro section,
16807 align the segment to the common page size.
16808 (Output_segment::set_section_addresses): Track whether we are
16809 looking at relro sections. If the last section is a relro
16810 section, align to the common page size.
16811 (Output_segment::set_section_list_addresses): Add in_relro
16812 parameter. Change all callers. Align to the page size when
16813 moving from relro to non-relro section.
16814 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16815 segment.
16816 * output.h (class Output_section): Add is_relro_ and
16817 is_relro_local_ fields.
16818 (Output_section::is_relro): New function.
16819 (Output_section::set_is_relro): New function.
16820 (Output_section::is_relro_local): New function.
16821 (Output_section::set_is_relro_local): New function.
16822 (class Output_segment): Update declarations.
16823 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16824 * sparc.cc (Target_sparc::got_section): Likewise.
16825 * x86_64.cc (Target_x86_64::got_section): Likewise.
16826 * testsuite/relro_test_main.cc: New file.
16827 * testsuite/relro_test.cc: New file.
16828 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16829 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16830 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16831 (relro_test.so, relro_test_pic.o): New targets.
16832 * testsuite/Makefile.in: Rebuild.
16833
16834 2008-05-16 Ian Lance Taylor <iant@google.com>
16835
16836 * output.cc (Output_segment::add_output_section): Remove front
16837 parameter.
16838 * output.h (class Output_segment): Remove
16839 add_initial_output_section and overloaded add_output_section.
16840 Update declaration of remaining add_output_section.
16841 * layout.cc (Layout::create_interp): Call add_output_section
16842 rather than add_initial_output_section.
16843 (Layout::finish_dynamic_section): Likewise.
16844
16845 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16846 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16847 know the dynamic type.
16848 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16849 field. Initialize it in constructor.
16850 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16851 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16852 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16853 reloc.
16854
16855 * output.cc (Output_reloc::get_address): Change return type to
16856 Elf_Addr.
16857 * output.h (class Output_reloc): Update get_address declaration.
16858 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16859 for section addresses.
16860
16861 2008-05-09 Ian Lance Taylor <iant@google.com>
16862
16863 PR 6493
16864 * gold.cc (gold_nomem): Use return value of write.
16865
16866 2008-05-08 Ian Lance Taylor <iant@google.com>
16867
16868 * symtab.c (Symbol::init_base_output_data): Add version
16869 parameter. Change all callers.
16870 (Symbol::init_base_output_segment): Likewise.
16871 (Symbol::init_base_constant): Likewise.
16872 (Symbol::init_base_undefined): Likewise.
16873 (Sized_symbol::init_output_data): Likewise.
16874 (Sized_symbol::init_output_segment): Likewise.
16875 (Sized_symbol::init_constant): Likewise.
16876 (Sized_symbol::init_undefined): Likewise.
16877 (Symbol_table::do_define_in_output_data): If the new symbol has a
16878 version, mark it as the default.
16879 (Symbol_table::do_define_in_output_segment): Likewise.
16880 (Symbol_table::do_define_as_constant): Likewise.
16881 * symtab.h (class Symbol): Update declarations.
16882 (class Sized_symbol): Likewise.
16883 * resolve.cc (Symbol::override_version): New function.
16884 (Symbol::override_base): Call override_version.
16885 (Symbol::override_base_with_special): Likewise.
16886 * testsuite/ver_script_8.script: New file.
16887 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16888 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16889 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16890 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16891
16892 2008-05-06 Ian Lance Taylor <iant@google.com>
16893
16894 PR 6049
16895 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16896 functions.
16897 (class General_options): Remove existing --undefined, and add
16898 --no-undefined instead. Add new --undefined as synonym for -u.
16899 * archive.cc (Archive::add_symbols): Check whether symbol was
16900 named with -u.
16901 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16902 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16903 all uses. Add IS_UNDEFINED. Update declarations to split
16904 different versions of init_base. Declare init_base_undefined.
16905 (Symbol::is_defined): Handle IS_UNDEFINED.
16906 (Symbol::is_undefined): Likewise.
16907 (Symbol::is_weak_undefined): Call is_undefined.
16908 (Symbol::is_absolute): Handle IS_CONSTANT.
16909 (class Sized_symbol): Update declarations to split different
16910 versions of init. Declare init_undefined.
16911 (class Symbol_table): Declare new functions.
16912 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16913 Change all callers.
16914 (Symbol::init_base_output_data): Likewise.
16915 (Symbol::init_base_output_segment): Likewise.
16916 (Symbol::init_base_constant): Likewise.
16917 (Symbol::init_base_undefined): New function.
16918 (Sized_symbol::init_object): Rename from init. Change all
16919 callers.
16920 (Sized_symbol::init_output_data): Likewise.
16921 (Sized_symbol::init_output_segment): Likewise.
16922 (Sized_symbol::init_constant): Likewise.
16923 (Sized_symbol::init_undefined): New function.
16924 (Symbol_table::add_undefined_symbols_from_command_line): New
16925 function.
16926 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16927 function.
16928 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16929 (Symbol::output_section): Likewise.
16930 (Symbol::set_output_section): Likewise.
16931 (Symbol_table::sized_finalize_symbol): Likewise.
16932 (Symbol_table::sized_write_globals): Likewise.
16933 * resolve.cc (Symbol_table::should_override): Likewise.
16934 (Symbol::override_base_with_special): Likewise.
16935
16936 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16937 symbol, change it to have default visibility.
16938 * testsuite/protected_1.cc: New file.
16939 * testsuite/protected_2.cc: New file.
16940 * testsuite/protected_3.cc: New file.
16941 * testsuite/protected_main_1.cc: New file.
16942 * testsuite/protected_main_2.cc: New file.
16943 * testsuite/protected_main_3.cc: New file.
16944 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16945 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16946 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16947 (protected_1.so): New target.
16948 (protected_1_pic.o, protected_2_pic.o): New targets.
16949 (protected_3_pic.o): New target.
16950 (check_PROGRAMS): Add protected_2.
16951 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16952 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16953 * testsuite/Makefile.in: Rebuild.
16954
16955 * options.h (DEFINE_var): Add set_user_set_##varname__.
16956 (DEFINE_bool_alias): New macro.
16957 (class General_options): Define -Bstatic using DEFINE_bool_alias
16958 rather than DEFINE_special. Add --undefined as an alias for -z
16959 defs.
16960 * options.cc (General_options::parse_Bstatic): Remove.
16961
16962 * options.h (class General_options): Add --fatal-warnings.
16963 * main.cc (main): Implement --fatal-warnings.
16964 * errors.h (Errors::warning_count): New function.
16965
16966 * options.h (class General_options): Add -Bsymbolic-functions.
16967 * symtab.h (Symbol::is_preemptible): Check for
16968 -Bsymbolic-functions.
16969
16970 2008-05-05 Ian Lance Taylor <iant@google.com>
16971
16972 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16973 as noVARNAME rather than no-VARNAME.
16974 (class General_options): Add option -z combreloc.
16975 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16976 get_address.
16977 (Output_reloc::sort_before) [SHT_REL]: New function.
16978 (Output_reloc::sort_before) [SHT_RELA]: New function.
16979 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16980 Sort_relocs_comparison.
16981 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16982 parameter. Change all callers.
16983 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16984 sort_relocs parameter. Change all callers.
16985 * output.cc (Output_reloc::get_address): New function, broken out
16986 of write_rel.
16987 (Output_reloc::write_rel): Call it.
16988 (Output_reloc::compare): New function.
16989 (Output_data_reloc_base::do_write): Optionally sort relocs.
16990
16991 * configure.ac: If targ_extra_obj is set, link it in.
16992 * configure.tgt: Initialize all variables.
16993 (x86_64*): Set targ_extra_obj and targ_extra_size.
16994 * configure: Rebuild.
16995
16996 * object.cc (Sized_relobj::include_section_group): Adjust section
16997 indexes read from group data. Build vector to pass to
16998 layout_group.
16999 * layout.cc (Layout::layout_group): Add flags and shndxes
17000 parameters. Remove contents parameter. Change caller. Update
17001 explicit instantiations.
17002 * layout.h (class Layout): Update layout_group declaration.
17003 * output.cc (Output_data_group::Output_data_group): Add flags and
17004 input_shndxes parameters. Remove contents parameter. Change
17005 caller.
17006 (Output_data_group::do_write): Change input_sections_ to
17007 input_shndxes_.
17008 * output.h (class Output_data_group): Update constructor
17009 declaration. Rename input_sections_ to input_shndxes_.
17010 * testsuite/many_sections_test.cc: Add template.
17011
17012 2008-04-30 Cary Coutant <ccoutant@google.com>
17013
17014 * target-reloc.h (relocate_section): Fix dead-pointer bug.
17015
17016 * layout.cc (Layout::include_section): Refactored check for debug
17017 info section.
17018 (Layout::add_comdat): Add new parameters. Change type
17019 of signature parameter. Add object and shndx to signatures table.
17020 (Layout::find_kept_object): New function.
17021 * layout.h: Include <cstring>.
17022 (Layout::is_debug_info_section): New function.
17023 (Layout::add_comdat): Add new parameters.
17024 (Layout::find_kept_object): New function.
17025 (Layout::Kept_section): New struct.
17026 (Layout::Signatures): Change type of map range.
17027 * object.cc (Relobj::output_section_address): New function.
17028 (Sized_relobj::include_section_group): Add new parameters. Change
17029 calls to Layout::add_comdat. Change to build table of kept comdat
17030 groups and table mapping discarded sections to kept sections.
17031 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
17032 (Sized_relobj::do_layout): Change calls to include_section_group and
17033 include_linkonce_section.
17034 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
17035 value to zero when section is discarded.
17036 (Sized_relobj::map_to_kept_section): New function.
17037 * object.h (Relobj::output_section_address): New function.
17038 (Relobj::Comdat_group): New type.
17039 (Relobj::find_comdat_group): New function.
17040 (Relobj::Comdat_group_table): New type.
17041 (Relobj::Kept_comdat_section): New type.
17042 (Relobj::Kept_comdat_section_table): New type.
17043 (Relobj::add_comdat_group): New function.
17044 (Relobj::set_kept_comdat_section): New function.
17045 (Relobj::get_kept_comdat_section): New function.
17046 (Relobj::comdat_groups_): New field.
17047 (Relobj::kept_comdat_sections_): New field.
17048 (Symbol_value::input_value): Update comment.
17049 (Sized_relobj::map_to_kept_section) New function.
17050 (Sized_relobj::include_linkonce_section): Add new parameter.
17051 * target-reloc.h (Comdat_behavior): New type.
17052 (get_comdat_behavior): New function.
17053 (relocate_section): Add code to map a discarded section to the
17054 corresponding kept section when applying a relocation.
17055
17056 2008-04-30 Craig Silverstein <csilvers@google.com>
17057
17058 * dwarf_reader.cc (next_generation_count): New static var.
17059 (Addr2line_cache_entry): New struct.
17060 (addr2line_cache): New static var.
17061 (Dwarf_line_info::one_addr2line): Added caching.
17062 (Dwarf_line_info::clear_addr2line_cache): New function.
17063 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
17064 cache-size parameter.
17065 (Dwarf_line_info::one_addr2line_cache): New function.
17066 * symtab.cc (Symbol_table::detect_odr_violations): Pass
17067 new cache-size argument to one_addr2line(), and clear cache.
17068
17069 2008-04-28 Cary Coutant <ccoutant@google.com>
17070
17071 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
17072 R_386_PC8 relocations.
17073
17074 2008-04-23 Ian Lance Taylor <iant@google.com>
17075
17076 * object.cc (Sized_relobj::include_section_group): Check for
17077 invalid section group.
17078
17079 * object.cc (make_elf_object): Correct test for 64-bit ELF file
17080 header size.
17081
17082 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
17083 than read for file header.
17084 * archive.cc (Archive::include_member): Likewise.
17085
17086 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
17087
17088 * aclocal.m4: Regenerate.
17089 * configure: Regenerate.
17090
17091 2008-04-19 Ian Lance Taylor <iant@google.com>
17092
17093 * version.cc (version_string): Bump to 1.6.
17094
17095 * testsuite/Makefile.am (many_sections_r_test): New target.
17096 (many_sections_r_test_SOURCES): Remove.
17097 (many_sections_r_test_DEPENDENCIES): Remove.
17098 (many_sections_r_test_LDFLAGS): Remove.
17099 (many_sections_r_test_LDADD): Remove.
17100
17101 * object.cc (Sized_relobj::do_add_symbols): Always pass
17102 local_symbol_count_ to add_from_relobj.
17103
17104 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17105 every thousand variables.
17106 * testsuite/Makefile.in: Rebuild.
17107
17108 * object.cc (Xindex::initialize_symtab_xindex): New function.
17109 (Xindex::read_symtab_xindex): New function.
17110 (Xindex::sym_xindex_to_shndx): New function.
17111 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17112 available.
17113 (Sized_relobj::do_initialize_xindex): New function.
17114 (Sized_relobj::do_read_symbols): Adjust section links.
17115 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17116 parameter. Change all callers.
17117 (Sized_relobj::include_section_group): Adjust section links and
17118 symbol section indexes.
17119 (Sized_relobj::do_layout): Adjust section links.
17120 (Sized_relobj::do_count_local_symbols): Adjust section links and
17121 symbol section indexes.
17122 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17123 ordinary and special symbols.
17124 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17125 dynsym_xindex parameters. Change all callers. Adjust section
17126 links. Use SHN_XINDEX when needed.
17127 (Sized_relobj::get_symbol_location_info): Adjust section links.
17128 Don't get fooled by special symbols.
17129 * object.h (class Xindex): Define.
17130 (class Object): Add xindex_ parameter. Declare virtual functoin
17131 do_initialize_xindex.
17132 (Object::adjust_sym_shndx): New function.
17133 (Object::set_xindex): New protected function.
17134 (class Symbol_value): Add is_ordinary_shndx_ field.
17135 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17136 (Symbol_value::value): Assert ordinary section.
17137 (Symbol_value::initialize_input_to_output_map): Likewise.
17138 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17139 Change all callers.
17140 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17141 all callers.
17142 (class Sized_relobj): Update declarations.
17143 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17144 parameter. Change all callers.
17145 (Sized_relobj::adjust_shndx): New function.
17146 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17147 field.
17148 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17149 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17150 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17151 (Sized_dynobj::read_dynsym_section): Adjust section links.
17152 (Sized_dynobj::read_dynamic): Likewise.
17153 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17154 section links.
17155 (Sized_dynobj::do_initialize_xindex): New function.
17156 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17157 do_initialize_xindex.
17158 (Sized_dynobj::adjust_shndx): New function.
17159 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17160 dynsym_xindex_ fields.
17161 (Layout::finalize): Add a call to set_section_indexes before
17162 creating the symtab sections.
17163 (Layout::set_section_indexes): Don't do anything if the section
17164 already has a section index.
17165 (Layout::create_symtab_sections): Add shnum parameter. Change
17166 caller. Create .symtab_shndx section if needed.
17167 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17168 caller.
17169 (Layout::allocated_output_section_count): New function.
17170 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17171 needed.
17172 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17173 fields. Update declarations.
17174 (Layout::symtab_xindex): New function.
17175 (Layout::dynsym_xindex): New function.
17176 (class Write_symbols_task): Add layout_ field.
17177 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17178 Change caller.
17179 * output.cc (Output_section_headers::Output_section_headers): Add
17180 shstrtab_section parameter. Change all callers.
17181 (Output_section_headers::do_sized_write): Store overflow values
17182 for section count and section string table section index in
17183 section header zero.
17184 (Output_file_header::do_sized_write): Check for overflow of
17185 section count and section string table section index.
17186 (Output_symtab_xindex::do_write): New function.
17187 (Output_symtab_xindex::endian_do_write): New function.
17188 * output.h (class Output_section_headers): Add shstrtab_section_.
17189 Update declarations.
17190 (class Output_symtab_xindex): Define.
17191 (Output_section::has_out_shndx): New function.
17192 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17193 field.
17194 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17195 Change all callers.
17196 (Sized_symbol::init): Likewise.
17197 (Symbol::output_section): Check for ordinary symbol.
17198 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17199 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17200 callers.
17201 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17202 Change all callers. Simplify handling of symbols from sections
17203 not included in the link.
17204 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17205 distinction.
17206 (Weak_alias_sorter::operator()): Assert that symbols are
17207 ordinary.
17208 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17209 distinction.
17210 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17211 parameters. Change all callers.
17212 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17213 symbol distinction. Use SHN_XINDEX when needed.
17214 (Symbol_table::write_section_symbol): Add symtab_xindex
17215 parameter. Change all callers.
17216 (Symbol_table::sized_write_section_symbol): Likewise. Use
17217 SHN_XINDEX when needed.
17218 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17219 declarations.
17220 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17221 (Symbol::is_defined): Check is_ordinary.
17222 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17223 (Symbol::is_absolute, Symbol::is_common): Likewise.
17224 (class Sized_symbol): Update declarations.
17225 (class Symbol_table): Update declarations.
17226 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17227 parameters. Change all callers.
17228 (Sized_symbol::override): Likewise.
17229 (Symbol_table::override): Likewise.
17230 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17231 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17232 is_ordinary, and orig_st_shndx parameters. Change all callers.
17233 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17234 to be in an ordinary section.
17235 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17236 object and is_ordinary parameters. Change all callers.
17237 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17238 Change all callers. Don't add undefined or non-ordinary symbols
17239 to reloc_map_.
17240 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17241 Change all callers.
17242 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17243 declarations.
17244 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17245 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17246 (Sized_relobj::relocate_sections): Likewise.
17247 * target-reloc.h (scan_relocs): Adjust section symbol index.
17248 (scan_relocatable_relocs): Likewise.
17249 * i386.cc (Scan::local): Check for ordinary symbols.
17250 * sparc.cc (Scan::local): Likewise.
17251 * x86_64.cc (Scan::local): Likewise.
17252 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17253 to symbol_section_and_value.
17254 * testsuite/many_sections_test.cc: New file.
17255 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17256 (check_PROGRAMS): Add many_sections_test.
17257 (many_sections_test_SOURCES): Define.
17258 (many_sections_test_DEPENDENCIES): Define.
17259 (many_sections_test_LDFLAGS): Define.
17260 (BUILT_SOURCES): Add many_sections_define.h.
17261 (many_sections_define.h): New target.
17262 (BUILT_SOURCES): Add many_sections_check.h.
17263 (many_sections_check.h): New target.
17264 (check_PROGRAMS): Add many_sections_r_test.
17265 (many_sections_r_test_SOURCES): Define.
17266 (many_sections_r_test_DEPENDENCIES): Define.
17267 (many_sections_r_test_LDFLAGS): Define.
17268 (many_sections_r_test_LDADD): Define.
17269 (many_sections_r_test.o): New target.
17270 * testsuite/Makefile.in: Rebuild.
17271
17272 2008-04-17 Cary Coutant <ccoutant@google.com>
17273
17274 * errors.cc (Errors::info): New function.
17275 (gold_info): New function.
17276 * errors.h (Errors::info): New function.
17277 * gold.h (gold_info): New function.
17278 * object.cc (Input_objects::add_object): Print trace output.
17279 * options.cc (options::parse_set): New function.
17280 (General_options::parse_wrap): Deleted.
17281 (General_options::General_options): Deleted initializer.
17282 * options.h (options::String_set): New typedef.
17283 (options::parse_set): New function.
17284 (DEFINE_set): New macro.
17285 (General_options::wrap): Changed to use DEFINE_set. Changed
17286 callers of any_wrap_symbols and is_wrap_symbol.
17287 (General_options::trace, General_options::trace_symbol):
17288 New options.
17289 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17290 (General_options::wrap_symbols_): Deleted.
17291 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17292
17293 2008-04-17 David S. Miller <davem@davemloft.net>
17294
17295 * options.cc (General_options::parse_V): New function.
17296 * options.h: Add entries for -V and -Qy.
17297
17298 2008-04-17 Ian Lance Taylor <iant@google.com>
17299
17300 * common.cc (Symbol_table::allocate_commons): Remove options
17301 parameter. Change caller.
17302 (Symbol_table::do_allocate_commons): Remove options parameter.
17303 Change caller. Just call do_allocate_commons_list twice.
17304 (Symbol_table::do_allocate_commons_list): New function, broken out
17305 of do_allocate_commons.
17306 * common.h (class Allocate_commons_task): Remove options_ field.
17307 Update constructor.
17308 * symtab.cc (Symbol_table::Symbol_table): Initialize
17309 tls_commons_.
17310 (Symbol_table::add_from_object): Put TLS common symbols on
17311 tls_commons_ list.
17312 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17313 which are IN_OUTPUT_DATA.
17314 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17315 allocate_commons and do_allocate_commons declarations. Declare
17316 do_allocate_commons_list.
17317 * gold.cc (queue_middle_tasks): Update creation of
17318 Allocate_commons_task to not pass options.
17319 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17320 (TLS_TEST_C_FLAGS): New variable.
17321 (tls_test_c_pic.o): New target.
17322 (tls_test_shared.so): Link in tls_test_c_pic.o.
17323 (tls_test_c_pic_ie.o): New target.
17324 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17325 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17326 (tls_test_c.o): New target.
17327 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17328 (tls_pic_test_LDADD): Likewise.
17329 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17330 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17331 (tls_test_c_gnu2.o): New target.
17332 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17333 tls_test_c_gnu2.o.
17334 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17335 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17336 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17337 * testsuite/tls_test.cc: Include "config.h".
17338 (t_last): Call t11_last.
17339 * testsuite/tls_test.h (t11, t11_last): Declare.
17340 * testsuite/tls_test_c.c: New file.
17341 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17342 * configure.ac: Check for OpenMP support.
17343 * configure, config.in, Makefile.in: Rebuild.
17344 * testsuite/Makefile.in: Rebuild.
17345
17346 2008-04-16 Cary Coutant <ccoutant@google.com>
17347
17348 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17349 (Target_i386::tls_base_symbol_defined_): New field.
17350 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17351 (Target_i386::Scan::global): Likewise.
17352 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17353 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17354 (Target_x86_64::tls_base_symbol_defined_): New field.
17355 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17356 (Target_x86_64::Scan::global): Likewise.
17357
17358 2008-04-16 Cary Coutant <ccoutant@google.com>
17359
17360 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17361 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17362 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17363 building shared libraries.
17364 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17365 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17366 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17367 * testsuite/Makefile.in: Rebuild.
17368 * testsuite/weak_undef.h: New file.
17369 * testsuite/weak_undef_file1.cc: Add extra test cases.
17370 * testsuite/weak_undef_file2.cc: Likewise.
17371 * testsuite/weak_undef_test.cc: Likewise.
17372
17373 2008-04-16 David S. Miller <davem@davemloft.net>
17374
17375 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17376 Add issued_non_pic_error_ field. Declare check_non_pic.
17377 (Target_sparc::Scan::check_non_pic): New function.
17378 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17379 (Target_sparc::Scan::global): Likewise.
17380
17381 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17382 * configure: Rebuild.
17383
17384 * options.h (DEFINE_enable): New macro.
17385 (new_dtags): New enable option.
17386 (initfirst, interpose, loadfltr, nodefaultlib,
17387 nodelete, nodlopen, nodump): New -z options.
17388 * layout.cc (Layout:finish_dynamic_section): If new
17389 dtags enabled, emit DT_RUNPATH. Also, emit a
17390 DT_FLAGS_1 containing any specified -z flags.
17391
17392 2008-04-16 Ian Lance Taylor <iant@google.com>
17393
17394 * copy-relocs.cc: New file.
17395 * copy-relocs.h: New file.
17396 * reloc.cc: Remove Copy_relocs code.
17397 * reloc.h: Likewise.
17398 * reloc-types.h (struct Reloc_types) [both versions]: Add
17399 get_reloc_addend_noerror.
17400 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17401 variants of add_global which take an addend which must be zero.
17402 * i386.cc: Include "copy-relocs.h".
17403 (class Target_i386): Change type of copy_relocs_ to variable,
17404 update initializer.
17405 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17406 Change all callers.
17407 (Target_i386::do_finalize_sections): Change handling of
17408 copy_relocs_.
17409 * sparc.cc: Include "copy-relocs.h".
17410 (class Target_sparc): Change type of copy_relocs_ to variable,
17411 update initializer.
17412 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17413 Change all callers.
17414 (Target_sparc::do_finalize_sections): Change handling of
17415 copy_relocs_.
17416 * x86_64.cc: Include "copy-relocs.h".
17417 (class Target_x86_64): Change type of copy_relocs_ to variable,
17418 update initializer.
17419 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17420 class. Change all callers.
17421 (Target_x86_64::do_finalize_sections): Change handling of
17422 copy_relocs_.
17423 * Makefile.am (CCFILES): Add copy-relocs.cc.
17424 (HFILES): Add copy-relocs.h.
17425
17426 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17427
17428 * testsuite/script_test_4.sh: Permit leading zeroes.
17429
17430 2008-04-15 Ian Lance Taylor <iant@google.com>
17431
17432 * script-sections.cc (Script_sections::create_segments): Use
17433 header_size_adjustment even when there is enough room for the
17434 headers.
17435 * testsuite/script_test_4.sh: New file.
17436 * testsuite/script_test_4.t: New file.
17437 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17438 (check_DATA): Add script_test_4.stdout.
17439 (MOSTLYCLEANFILES): Likewise.
17440 (script_test_4): New target.
17441 (script_test_4.stdout): New target.
17442 * testsuite/Makefile.in: Rebuild.
17443
17444 * sparc.cc: Add definitions for Output_data_plt_sparc class
17445 constants.
17446
17447 2008-04-14 David S. Miller <davem@davemloft.net>
17448
17449 * sparc.cc: New file.
17450 * Makefile.am (TARGETSOURCES): Add sparc.cc
17451 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17452 * configure.tgt: Document targ_extra_size and
17453 targ_extra_big_endian. Add entries for sparc-* and
17454 sparc64-*.
17455 * configure.ac: Handle targ_extra_size and
17456 targ_extra_big_endian.
17457 * Makefile.in: Rebuild.
17458 * configure: Likewise.
17459 * po/POTFILES.in: Likewise.
17460 * po/gold.pot: Likewise.
17461
17462 2008-04-14 Ian Lance Taylor <iant@google.com>
17463
17464 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17465 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17466 in the name/type/flags to section mapping. Don't call
17467 allocate_output_section.
17468 (Layout::choose_output_section): Change parameter from adjust_name
17469 to is_input_section. Don't permit input sections after sections
17470 are attached to segments. Don't call allocate_output_section.
17471 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17472 not write_enable_output_section.
17473 (Layout::make_output_section): Don't push to
17474 unattached_section_list_ nor call attach_to_segment. Call
17475 attach_section_to_segment if sections are attached.
17476 (Layout::attach_sections_to_segments): New function.
17477 (Layout::attach_section_to_segment): New function.
17478 (Layout::attach_allocated_section_to_segment): Rename from
17479 attach_to_segment. Remove flags parameter.
17480 (Layout::allocate_output_section): Remove function.
17481 (Layout::write_enable_output_section): Remove function.
17482 * layout.h (class Layout): Update for above changes. Add new
17483 field sections_are_attached_.
17484 * output.h (Output_section::update_flags_for_input_section): New
17485 function.
17486 * output.cc (Output_section::add_input_section): Call
17487 update_flags_for_input_section.
17488 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17489
17490 2008-04-11 Cary Coutant <ccoutant@google.com>
17491
17492 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17493 thought unnecessary.
17494 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17495
17496 2008-04-11 Ian Lance Taylor <iant@google.com>
17497
17498 * output.h (class Output_section_data): Remove inline definition
17499 of set_addralign.
17500 * output.cc (Output_section_data::set_addralign): New function.
17501
17502 2008-04-11 Cary Coutant <ccoutant@google.com>
17503
17504 Add support for TLS descriptors for i386 and x86_64.
17505 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17506 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17507 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17508 GOT_TYPE_TLS_DESC.
17509 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17510 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17511 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17512 relocations.
17513 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17514 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17515 Fix problem with initial-exec relocations.
17516 (Target_i386::Relocate::relocate_tls): Likewise.
17517 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17518 relaxation.
17519 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17520 support for section-plus-offset dynamic table entries.
17521 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17522 (Output_data_dynamic::Dynamic_entry): Add support for
17523 section-plus-offset dynamic table entries.
17524 (Output_data_dynamic::Classification): Likewise.
17525 (Output_data_dynamic::classification_): Renamed offset_.
17526 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17527 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17528 (Target_x86_64::make_plt_section): New function.
17529 (Target_x86_64::reserve_tlsdesc_entries): New function.
17530 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17531 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17532 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17533 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17534 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17535 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17536 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17537 add extra PLT entry for TLS descriptors.
17538 (Output_data_plt_x86_64::got_): New field.
17539 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17540 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17541 fields.
17542 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17543 descriptors.
17544 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17545 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17546 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17547 R_386_TLS_DESC_CALL relocations.
17548 (Target_x86_64::Scan::global): Likewise.
17549 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17550 for TLS descriptors.
17551 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17552 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17553 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17554 GD-to-IE relaxation.
17555 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17556 and TLS_DESCRIPTORS.
17557 * Makefile.in: Rebuild.
17558 * configure: Rebuild.
17559 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17560 (tls_test_shared2.so): New target.
17561 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17562 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17563 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17564 (tls_shared_gd_to_ie_test_LDADD): New variable.
17565 (tls_shared_gnu2_gd_to_ie_test): New target.
17566 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17567 New targets.
17568 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17569 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17570 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17571 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17572 (tls_shared_gnu2_test): New target.
17573 (tls_test_gnu2_shared.so): New target.
17574 (tls_shared_gnu2_test_SOURCES): New variable.
17575 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17576 (tls_shared_gnu2_test_LDFLAGS): New variable.
17577 (tls_shared_gnu2_test_LDADD): New variable.
17578 * testsuite/Makefile.in: Rebuild.
17579 * testsuite/Makefile.
17580
17581 2008-04-11 Ian Lance Taylor <iant@google.com>
17582
17583 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17584 justsyms.t.
17585 * testsuite/Makefile.in: Rebuild.
17586
17587 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17588 long.
17589 * testsuite/script_test_2.cc (main): Adjust test.
17590
17591 2008-04-11 David S. Miller <davem@davemloft.net>
17592 Ian Lance Taylor <iant@google.com>
17593
17594 * options.h (General_options): Add entries for '-Y' and
17595 '-relax'.
17596 * options.cc (General_options:finalize): If -Y was used, add those
17597 entries to the library path instead of the default "/lib" and
17598 "/usr/lib".
17599
17600 2008-04-11 David S. Miller <davem@davemloft.net>
17601
17602 * testsuite/justsyms.t: Start at 0x100.
17603 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17604 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17605 long.
17606 * testsuite/script_test_2.cc: Adjust string and section length
17607 checks.
17608
17609 2008-04-09 Ian Lance Taylor <iant@google.com>
17610
17611 PR gold/5996
17612 * script-sections.cc (Sections_element::allocate_to_segment): Add
17613 orphan parameter.
17614 (Output_section_definition::allocate_to_segment): Likewise.
17615 (Orphan_output_section::allocate_to_segment): Likewise.
17616 (Script_sections::attach_sections_using_phdrs_clause): Don't
17617 propagate non-PT_LOAD segments to orphan sections.
17618 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17619 readelf rather than objdump.
17620 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17621 .interp section and PT_INTERP segment are the same size.
17622 * testsuite/Makefile.in: Rebuild.
17623
17624 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17625 aliases for symbols defined in the same object.
17626 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17627 (weak_alias_test_SOURCES): New variable.
17628 (weak_alias_test_DEPENDENCIES): New variable.
17629 (weak_alias_test_LDFLAGS): New variable.
17630 (weak_alias_test_LDADD): New variable.
17631 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17632 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17633 (weak_alias_test_3.o): New target.
17634 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17635 * testsuite/weak_alias_test_main.cc: New file.
17636 * testsuite/weak_alias_test_1.cc: New file.
17637 * testsuite/weak_alias_test_2.cc: New file.
17638 * testsuite/weak_alias_test_3.cc: New file.
17639
17640 2008-04-08 Ian Lance Taylor <iant@google.com>
17641
17642 * options.h (class General_options): Add --noinhibit-exec option.
17643 * main.cc (main): Check --noinhibit-exec.
17644
17645 * options.h (class General_options): Define --wrap as a special
17646 option. Add wrap_symbols_ field.
17647 (General_options::any_wrap_symbols): New function.
17648 (General_options::is_wrap_symbol): New function.
17649 * options.cc (General_options::parse_wrap): New function.
17650 (General_options::General_options): Initialize wrap_symbols_.
17651 * symtab.cc (Symbol_table::wrap_symbol): New function.
17652 (Symbol_table::add_from_object): Handle --wrap.
17653 * symtab.h (class Symbol_table): Declare wrap_symbol.
17654 * target.h (Target::wrap_char): New function.
17655 (Target::Target_info): Add wrap_char field.
17656 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17657 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17658 * testsuite/testfile.cc (Target_test::test_target_info):
17659 Likewise.
17660
17661 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17662 there is one.
17663
17664 * layout.h (class Layout): Add added_eh_frame_data_ field.
17665 * layout.cc (Layout::Layout): Initialize new field.
17666 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17667 output section until we find a section we merged successfully.
17668 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17669 that the size be non-zero.
17670
17671 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17672 qualifier.
17673
17674 2008-04-08 Craig Silverstein <csilvers@google.com>
17675
17676 * configure.ac: Export new conditional variable HAVE_ZLIB.
17677 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17678 on HAVE_ZLIB.
17679 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17680 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17681
17682 2008-04-07 Ian Lance Taylor <iant@google.com>
17683
17684 * version.cc (version_string): Set to "1.5".
17685
17686 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17687 Add issued_non_pic_error_ field. Declare check_non_pic.
17688 (Target_x86_64::Scan::check_non_pic): New function.
17689 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17690 (Target_x86_64::Scan::global): Likewise.
17691
17692 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17693 addend parameter. Change caller. Handle merge sections.
17694 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17695 Address to Addend. Don't add in the result of
17696 local_section_offset, pass down the addend and use the returned
17697 value.
17698 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17699 Update declarations of local_section_offset and symbol_value.
17700 * testsuite/two_file_test_1.cc (t18): New function.
17701 * testsuite/two_file_test_2.cc (f18): New function.
17702 * testsuite/two_file_test_main.cc (main): Call t18.
17703 * testsuite/two_file_test.h (t18, f18): Declare.
17704
17705 * configure.ac: Don't test for objdump, c++filt, or readelf.
17706 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17707 conditionals.
17708 (TEST_READELF): New variable.
17709 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17710 (check_PROGRAMS): Add two_file_strip_test.
17711 (two_file_strip_test): New target.
17712 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17713 (two_file_same_shared_strip_test_SOURCES): New variable.
17714 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17715 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17716 (two_file_same_shared_strip_test_LDADD): New variable.
17717 (two_file_shared_strip.so): New target.
17718 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17719 (ver_test_5.syms, ver_test_7.syms): Likewise.
17720 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17721 (strip_test_3.stdout): Use TEST_OBJDUMP.
17722 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17723
17724 2008-04-04 Cary Coutant <ccoutant@google.com>
17725
17726 * symtab.h (Symbol::is_weak_undefined): New function.
17727 (Symbol::is_strong_undefined): New function.
17728 (Symbol::is_absolute): New function.
17729 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17730 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17731 absolute symbols.
17732 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17733 (weak_undef_test): New target.
17734 * testsuite/Makefile.in: Rebuild.
17735 * testsuite/weak_undef_file1.cc: New file.
17736 * testsuite/weak_undef_file2.cc: New file.
17737 * testsuite/weak_undef_test.cc: New file.
17738
17739 2008-04-03 Craig Silverstein <csilvers@google.com>
17740
17741 * compressed_output.h (class Output_compressed_section): Use
17742 unsigned buffer.
17743 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17744 add zlib header.
17745 (zlib_compressed_suffix): Removed.
17746 (Output_compressed_section::set_final_data_size): Use unsigned
17747 buffers.
17748 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17749 Fix linker invocation.
17750 (flagstest_o_specialfile_and_compress_debug_sections):
17751 Likewise.
17752 * testsuite/Makefile.in: Regenerated.
17753
17754 2008-04-02 David S. Miller <davem@davemloft.net>
17755
17756 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17757 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17758
17759 2008-04-02 Craig Silverstein <csilvers@google.com>
17760
17761 * TODO: New file.
17762
17763 2008-04-02 Ian Lance Taylor <iant@google.com>
17764
17765 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17766 parameters. Update for new key type to views_. Change all
17767 callers.
17768 (File_read::read): Adjust for byteshift in returned view.
17769 (File_read::add_view): New function, broken out of
17770 find_and_make_view.
17771 (File_read::make_view): New function, broken out of
17772 find_and_make_view.
17773 (File_read::find_or_make_view): Add offset and aligned
17774 parameters. Rewrite accordingly. Change all callers.
17775 (File_read::get_view): Add offset and aligned parameters. Adjust
17776 for byteshift in return value.
17777 (File_read::get_lasting_view): Likewise.
17778 * fileread.h (class File_read): Update declarations.
17779 (class File_read::View): Add byteshift_ field. Add byteshift to
17780 constructor. Add byteshift method.
17781 * archive.h (Archive::clear_uncached_views): New function.
17782 (Archive::get_view): Add aligned parameter. Change all callers.
17783 * object.h (Object::get_view): Add aligned parameter. Change all
17784 callers.
17785 (Object::get_lasting_view): Likewise.
17786
17787 * fileread.cc (File_read::release): Don't call clear_views if
17788 there are multiple objects.
17789 * fileread.h (File_read::clear_uncached_views): New function.
17790 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17791 on the archive.
17792
17793 2008-03-31 Cary Coutant <ccoutant@google.com>
17794
17795 Add thin archive support.
17796 * archive.cc (Archive::armagt): New const.
17797 (Archive::setup): Remove task parameter and calls to unlock.
17798 (Archive::unlock_nested_archives): New function.
17799 (Archive::read_header): Add nested_off parameter. Change
17800 all callers.
17801 (Archive::interpret_header): Likewise.
17802 (Archive::include_all_members): Change to handle thin
17803 archives.
17804 (Archive::include_member): Likewise.
17805 * archive.h (Archive::Archive): Add new parameters and
17806 initializers.
17807 (Archive::armagt): New const.
17808 (Archive::setup): Remove task parameter.
17809 (Archive::unlock_nested_archives): New function.
17810 (Archive::read_header): Add nested_off parameter.
17811 (Archive::interpret_header): Likewise.
17812 (Archive::Nested_archive_table): New typedef.
17813 (Archive::is_thin_archive_): New field.
17814 (Archive::nested_archives_): New field.
17815 (Archive::options_): New field.
17816 (Archive::dirpath_): New field.
17817 (Archive::task_): New field.
17818 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17819 for thin archives. Pass additional parameters to
17820 Archive::Archive. Unlock the archive file after calling
17821 Archive::setup.
17822
17823 2008-03-29 Ian Lance Taylor <iant@google.com>
17824
17825 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17826 version symbol to be local.
17827 * testsuite/ver_test_4.sh: New file.
17828 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17829 (check_DATA): Add ver_test_4.syms.
17830 (ver_test_4.syms): New target.
17831 * testsuite/Makefile.in: Rebuild.
17832
17833 * output.cc
17834 (Output_section::Input_section_sort_entry::has_priority): New
17835 function.
17836 (Output_section::Input_section_sort_entry::match_file_name): New
17837 function.
17838 (Output_section::Input_section_sort_entry::match_section_name):
17839 Remove.
17840 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17841 Remove.
17842 (Output_section::Input_section_sort_entry::match_section_file):
17843 Remove.
17844 (Output_section::Input_section_sort_compare::operator()): Rewrite
17845 using new Input_section_sort_entry functions. Sort crtbegin and
17846 crtend first. Sort sections with no priority before sections with
17847 a priority.
17848 * testsuite/initpri1.c (d3): Check j != 4.
17849 (cd5): New constructor/destructor function.
17850 (main): Check j != 2.
17851
17852 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17853 new symbol when resolving, don't call set_is_default.
17854 * testsuite/ver_test_7.cc: New file.
17855 * testsuite/ver_test_7.sh: New file.
17856 * testsuite/Makefile.am (ver_test_7.so): New target.
17857 (ver_test_7.o): New target.
17858 (check_SCRIPTS): Add ver_test_7.sh.
17859 (check_DATA): Add ver_test_7.syms.
17860 (ver_test_7.syms): New target.
17861
17862 2008-03-28 Ian Lance Taylor <iant@google.com>
17863
17864 * layout.cc (Layout::layout): If we see an input section with a
17865 name that needs sorting, set the must_sort flag for the output
17866 section.
17867 (Layout::make_output_section): If the name of the output section
17868 indicates that it might require sorting, set the may_sort flag.
17869 * output.h (Output_section::may_sort_attached_input_sections): New
17870 function.
17871 (Output_section::set_may_sort_attached_input_sections): New
17872 function.
17873 (Output_section::must_sort_attached_input_sections): New
17874 function.
17875 (Output_section::set_must_sort_attached_input_sections): New
17876 function.
17877 (class Output_section): Declare Input_section_sort_entry. Define
17878 Input_section_sort_compare. Declare
17879 sort_attached_input_sections. Add new fields:
17880 may_sort_attached_input_sections_,
17881 must_sort_attached_input_sections_,
17882 attached_input_sections_are_sorted_.
17883 * output.cc (Output_section::Output_section): Initialize new
17884 fields.
17885 (Output_section::add_input_section): Add an entry to
17886 input_sections_ if may_sort or must_sort are true.
17887 (Output_section::set_final_data_size): Call
17888 sort_attached_input_sections if necessary.
17889 (Output_section::Input_section_sort_entry): Define new class.
17890 (Output_section::Input_section_sort_compare::operator()): New
17891 function.
17892 (Output_section::sort_attached_input_sections): New function.
17893 * configure.ac: Check whether the compiler supports constructor
17894 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17895 * testsuite/initpri1.c: New file.
17896 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17897 CONSTRUCTOR_PRIORITY.
17898 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17899 (initpri1_LDFLAGS): New variable.
17900 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17901
17902 2008-03-27 Ian Lance Taylor <iant@google.com>
17903
17904 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17905 * testsuite/common_test_1.c: New file.
17906 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17907 (common_test_1_SOURCES): New variable.
17908 (common_test_1_DEPENDENCIES): New variable.
17909 (common_test_1_LDFLAGS): New variable.
17910
17911 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17912 and commons_ correctly when NAME/VERSION does not override
17913 NAME/NULL.
17914 * testsuite/ver_test_6.c: New file.
17915 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17916 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17917 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17918
17919 2008-03-26 Ian Lance Taylor <iant@google.com>
17920
17921 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17922 of an undefined symbol from a version script.
17923 * testsuite/Makefile.am (ver_test_5.so): New target.
17924 (ver_test_5.o): New target.
17925 (check_SCRIPTS): Add ver_test_5.sh.
17926 (check_DATA): Add ver_test_5.syms.
17927 (ver_test_5.syms): New target.
17928 * testsuite/ver_test_5.cc: New file.
17929 * testsuite/ver_test_5.script: New file.
17930 * testsuite/ver_test_5.sh: New file.
17931 * Makefile.in, testsuite/Makefile.in: Rebuild.
17932
17933 PR gold/5986
17934 Fix problems building gold with gcc 4.3.0.
17935 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17936 (gold_error_at_location, gold_warning_at_location): Use it.
17937 * configure.ac: Check whether we can compile and use a template
17938 function with a printf attribute.
17939 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17940 when jumping over bytes.
17941 * object.cc: Instantiate Object::read_section_data.
17942 * debug.h: Include <cstring>
17943 * dwarf_reader.cc: Include <algorithm>
17944 * main.cc: Include <cstring>.
17945 * options.cc: Include <cstring>.
17946 * output.cc: Include <cstring>.
17947 * script.cc: Include <cstring>.
17948 * script.h: Include <string>.
17949 * symtab.cc: Include <cstring> and <algorithm>.
17950 * target-select.cc: Include <cstring>.
17951 * version.cc: Include <string>.
17952 * testsuite/testmain.cc: Include <cstdlib>.
17953 * configure, config.in: Rebuild.
17954
17955 2008-03-25 Ian Lance Taylor <iant@google.com>
17956
17957 * options.cc: Include "../bfd/bfdver.h".
17958 (options::help): Print bug reporting address.
17959
17960 * version.cc (print_version): Adjust output for current value of
17961 BFD_VERSION_STRING.
17962
17963 * NEWS: New file.
17964
17965 * options.cc (options::help): Print list of supported targets.
17966 * target-select.h: Include <vector>.
17967 (class Target_selector): Make machine_, size_, and is_big_endian_
17968 fields const. Add bfd_name_ and instantiated_target_ fields.
17969 (Target_selector::Target_selector): Add bfd_name parameter.
17970 (Target_selector::recognize): Make non-virtual, call
17971 do_recognize.
17972 (Target_selector::recognize_by_name): Make non-virtual, call
17973 do_recognize_by_name.
17974 (Target_selector::supported_names): New function.
17975 (Target_selector::bfd_name): New function.
17976 (Target_selector::do_instantiate_target): New pure virtual
17977 function.
17978 (Target_selector::do_recognize): New virtual function.
17979 (Target_selector::do_recognize_by_name): New virtual function.
17980 (Target_selector::instantiate_target): New private function.
17981 (supported_target_names): Declare.
17982 * target-select.cc (Target_selector::Target_selector): Update for
17983 new parameter and fields.
17984 (select_target_by_name): Check that the name matches before
17985 calling recognize_by_name.
17986 (supported_target_names): New function.
17987 * i386.cc (class Target_selector_i386): Update Target_selector
17988 constructor call. Remove recognize and recognize_by_name. Add
17989 do_instantiate_target.
17990 * x86_64.cc (class Target_selector_x86_64): Likewise.
17991 * testsuite/testfile.cc (class Target_selector_test): Update for
17992 changes to Target_selector.
17993
17994 * README: Rewrite, with some notes on unsupported features.
17995
17996 2008-03-24 Cary Coutant <ccoutant@google.com>
17997
17998 * i386.cc (Target_i386::Got_type): New enum declaration.
17999 (Target_i386::Scan::local): Updated callers of Output_data_got
18000 member functions.
18001 (Target_i386::Scan::global): Likewise.
18002 (Target_i386::Relocate::relocate): Likewise.
18003 (Target_i386::Relocate::relocate_tls): Likewise.
18004 * object.h (Got_offset_list): New class.
18005 (Sized_relobj::local_has_got_offset): Added got_type parameter.
18006 (Sized_relobj::local_got_offset): Likewise.
18007 (Sized_relobj::set_local_got_offset): Likewise.
18008 (Sized_relobj::local_has_tls_got_offset): Removed.
18009 (Sized_relobj::local_tls_got_offset): Removed.
18010 (Sized_relobj::set_local_tls_got_offset): Removed.
18011 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
18012 * output.cc (Output_data_got::add_global): Added got_type parameter.
18013 (Output_data_got::add_global_with_rel): Likewise.
18014 (Output_data_got::add_global_with_rela): Likewise.
18015 (Output_data_got::add_global_pair_with_rel): New function.
18016 (Output_data_got::add_global_pair_with_rela): New function.
18017 (Output_data_got::add_local): Added got_type parameter.
18018 (Output_data_got::add_local_with_rel): Likewise.
18019 (Output_data_got::add_local_with_rela): Likewise.
18020 (Output_data_got::add_local_pair_with_rel): New function.
18021 (Output_data_got::add_local_pair_with_rela): New function.
18022 (Output_data_got::add_global_tls): Removed.
18023 (Output_data_got::add_global_tls_with_rel): Removed.
18024 (Output_data_got::add_global_tls_with_rela): Removed.
18025 (Output_data_got::add_local_tls): Removed.
18026 (Output_data_got::add_local_tls_with_rel): Removed.
18027 (Output_data_got::add_local_tls_with_rela): Removed.
18028 * output.h (Output_data_got::add_global): Added got_type parameter.
18029 (Output_data_got::add_global_with_rel): Likewise.
18030 (Output_data_got::add_global_with_rela): Likewise.
18031 (Output_data_got::add_global_pair_with_rel): New function.
18032 (Output_data_got::add_global_pair_with_rela): New function.
18033 (Output_data_got::add_local): Added got_type parameter.
18034 (Output_data_got::add_local_with_rel): Likewise.
18035 (Output_data_got::add_local_with_rela): Likewise.
18036 (Output_data_got::add_local_pair_with_rel): New function.
18037 (Output_data_got::add_local_pair_with_rela): New function.
18038 (Output_data_got::add_global_tls): Removed.
18039 (Output_data_got::add_global_tls_with_rel): Removed.
18040 (Output_data_got::add_global_tls_with_rela): Removed.
18041 (Output_data_got::add_local_tls): Removed.
18042 (Output_data_got::add_local_tls_with_rel): Removed.
18043 (Output_data_got::add_local_tls_with_rela): Removed.
18044 * resolve.cc (Symbol::override_base_with_special): Removed
18045 reference to has_got_offset_ field.
18046 * symtab.cc (Symbol::init_fields): Replaced initialization
18047 of got_offset_ with got_offsets_. Removed initialization
18048 of has_got_offset_
18049 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
18050 (Symbol::got_offset): Likewise.
18051 (Symbol::set_got_offset): Likewise.
18052 (Symbol::has_tls_got_offset): Removed.
18053 (Symbol::tls_got_offset): Removed.
18054 (Symbol::set_tls_got_offset): Removed.
18055 (Symbol::got_offset_): Removed.
18056 (Symbol::tls_mod_got_offset_): Removed.
18057 (Symbol::tls_pair_got_offset_): Removed.
18058 (Symbol::got_offsets_): New field.
18059 (Symbol::has_got_offset): Removed.
18060 (Symbol::has_tls_mod_got_offset): Removed.
18061 (Symbol::has_tls_pair_got_offset): Removed.
18062 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
18063 (Target_x86_64::Scan::local): Updated callers of Output_data_got
18064 member functions.
18065 (Target_x86_64::Scan::global): Likewise.
18066 (Target_x86_64::Relocate::relocate): Likewise.
18067 (Target_x86_64::Relocate::relocate_tls): Likewise.
18068
18069 2008-03-25 Ben Elliston <bje@au.ibm.com>
18070
18071 * yyscript.y: Fix spelling error in comment.
18072
18073 2008-03-24 Ian Lance Taylor <iant@google.com>
18074
18075 * options.h (class General_options): Define build_id option.
18076 * layout.h (class Layout): Declare write_build_id, create_note,
18077 create_build_id. Add build_id_note_ member.
18078 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
18079 "libiberty.h", "md5.h", "sha1.h".
18080 (Layout::Layout): Initialize eh_frame_data_,
18081 eh_frame_hdr_section_, and build_id_note_.
18082 (Layout::finalize): Call create_build_id.
18083 (Layout::create_note): New function, broken out of
18084 Layout::create_gold_note.
18085 (Layout::create_gold_note): Call create_note.
18086 (Layout::create_build_id): New function.
18087 (Layout::write_build_id): New function.
18088 (Close_task_runner::run): Call write_build_id.
18089
18090 * x86_64.cc: Correct license to GPLv3.
18091
18092 2008-03-23 Ian Lance Taylor <iant@google.com>
18093
18094 * options.cc: Include "demangle.h".
18095 (parse_optional_string): New function.
18096 (parse_long_option): Handle takes_optional_argument.
18097 (parse_short_option): Update dash_z initializer. Handle
18098 takes_optional_argument.
18099 (General_options::General_options): Initialize do_demangle_.
18100 (General_options::finalize): Set do_demangle_. Handle demangling
18101 style.
18102 * options.h (parse_optional_string): Declare.
18103 (struct One_option): Add optional_arg field. Update constructor.
18104 Update call constructor calls. Add takes_optional_argument
18105 function.
18106 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18107 (DEFINE_optional_string): Define.
18108 (General_options::demangle): Change from DEFINE_bool to
18109 DEFINE_optional_string.
18110 (General_options::no_demangle): New function.
18111 (General_options::do_demangle): New function.
18112 (General_options::set_do_demangle): New function.
18113 (General_options::execstack_status_): Move definition to end of
18114 class definition.
18115 (General_options::static_): Likewise.
18116 (General_options::do_demangle_): New field.
18117 * object.cc (big_endian>::get_symbol_location_info): Call
18118 Options::do_demangle, not Options::demangle.
18119 * symtab.cc (demangle): Likewise.
18120
18121 2008-03-22 Ian Lance Taylor <iant@google.com>
18122
18123 * gold.h: Include <cstddef> and <sys/types.h>
18124 * options.h: Include <cstring>.
18125
18126 2008-03-21 Ian Lance Taylor <iant@google.com>
18127
18128 * Added source code to GNU binutils.
18129 \f
18130 Copyright (C) 2008-2015 Free Software Foundation, Inc.
18131
18132 Copying and distribution of this file, with or without modification,
18133 are permitted in any medium without royalty provided the copyright
18134 notice and this notice are preserved.
18135
18136 Local Variables:
18137 mode: change-log
18138 left-margin: 8
18139 fill-column: 74
18140 version-control: never
18141 End:
This page took 0.409866 seconds and 4 git commands to generate.