PR gold/17473: Fix gold build with system C++ headers that use <ctype.h>.
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-12-16 Roland McGrath <mcgrathr@google.com>
2
3 PR ld/17473
4 * binary.cc: Move #include "safe-ctype.h" to be last #include.
5
6 2015-12-13 Cary Coutant <ccoutant@gmail.com>
7
8 * object.h (Object::get_output_view): remove const from return type.
9 (Object::do_get_output_view): Likewise.
10 (Sized_relobj_file::do_get_output_view): Likewise.
11 * reloc.cc (Sized_relobj_file::do_get_output_view): Likewise.
12
13 2015-12-11 Cary Coutant <ccoutant@gmail.com>
14
15 * target.h (Target::calls_non_split): Add prelocs, reloc_count
16 parameters.
17 (Target::do_calls_non_split): Likewise.
18 * target.cc (Target::do_calls_non_split): Likewise.
19 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Adjust
20 call to Target::calls_non_split.
21 * i386.cc (Target_i386::do_calls_non_split): Add prelocs, reloc_count
22 parameters.
23 * powerpc.cc (Target_powerpc::do_calls_non_split): Likewise.
24 * x86_64.cc (Target_x86_64::do_calls_non_split): Likewise.
25
26 2015-12-11 Cary Coutant <ccoutant@gmail.com>
27
28 * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize
29 output_views_.
30 * object.h (Object::get_output_view): New function.
31 (Object::do_get_output_view): New function.
32 (Sized_relobj_file::do_get_output_view): New function.
33 (Sized_relobj_file::output_views_): New data member.
34 * reloc.cc: (Sized_relobj_file::do_relocate): Store pointer to
35 output views in class object.
36 (Sized_relobj_file::do_get_output_view): New function.
37
38 2015-12-10 H.J. Lu <hongjiu.lu@intel.com>
39
40 PR ld/19317
41 * symtab.cc (Symbol_table::add_from_relobj): Don't complain
42 plugin needed to handle slim lto object for relocatable link.
43
44 2015-12-09 Alan Modra <amodra@gmail.com>
45
46 * powerpc.cc (Target_powerpc::Relocate::relocate): New constant
47 d_offset. Use throughout.
48 (Target_powerpc::relocate_relocs): Likewise.
49
50 2015-12-09 Alan Modra <amodra@gmail.com>
51
52 * powerpc.cc (Target_powerpc::Relocate::relocate): Edit ELFv2
53 entry code.
54 (Target_powerpc::relocate_relocs): Edit relocs to suit.
55
56 2015-12-09 Alan Modra <amodra@gmail.com>
57
58 * object.h (struct Relocate_info): Add "rr".
59 * reloc.h (Relocatable_relocs::set_strategy): New accessor.
60 * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
61 relinfo.rr for relocate_section and relocate_relocs.
62 * powerpc.cc (relocate): Add rel_type and preloc parameters.
63 Delete rela and r_type params, instead recalculate these from
64 preloc.
65 (relocate_relocs): Delete Relocatable_relocs* param, instead
66 use relinfo->rr.
67 * aarch64.cc: Likewise.
68 * arm.cc: Likewise.
69 * i386.cc: Likewise.
70 * mips.cc: Likewise.
71 * s390.cc: Likewise.
72 * sparc.cc: Likewise.
73 * target.h: Likewise.
74 * tilegx.cc: Likewise.
75 * x86_64.cc: Likewise.
76 * testsuite/testfile.cc: Likewise.
77 * target-reloc.h (relocate_section): Adjust to suit.
78 (apply_relocation, relocate_relocs): Likewise.
79
80 2015-12-07 Alan Modra <amodra@gmail.com>
81
82 * powerpc.cc (add_2_2_12, ld_2_12, lis_2): Define.
83 (Target_powerpc::Scan::local, global): Handle R_PPC64_ENTRY.
84 (Target_powerpc::Relocate::relocate): Edit code at R_PPC64_ENTRY.
85
86 2015-12-03 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
87
88 * object.cc (Sized_relobj::do_for_all_local_got_entries): Use
89 Local_got_entry_key for searching in local_got_offsets_.
90 * object.h (class Local_got_entry_key): New class.
91 (Relobj::local_has_got_offset): New overloaded method.
92 (Relobj::local_got_offset): Likewise.
93 (Relobj::set_local_got_offset): Likewise.
94 (Relobj::do_local_has_got_offset): Add addend argument.
95 (Relobj::do_local_got_offset): Likewise.
96 (Relobj::do_set_local_got_offset): Likewise.
97 (Sized_relobj::do_local_has_got_offset): Add addend argument, and use
98 Local_got_entry_key for searching through local_got_offsets_.
99 (Sized_relobj::do_local_got_offset): Likewise.
100 (Sized_relobj::do_set_local_got_offset): Likewise.
101 (Sized_relobj::Local_got_offsets): Change type of the key from
102 unsigned int to Local_got_entry_key, and add hash and equal_to.
103 * output.cc (Got_entry::write): Take addend into account for
104 calculating value of the local symbol for GOT.
105 (Output_data_got::add_local): New definition of overloaded method.
106 (Output_data_got::add_local_with_rel): Likewise.
107 (Output_data_got::add_local_pair_with_rel): Likewise.
108 * output.h (Output_data_got::add_local): New declaration of overloaded
109 method.
110
111 2015-11-25 Cary Coutant <ccoutant@gmail.com>
112
113 PR gold/19291
114 * object.cc (Sized_relobj_file::write_local_symbols): If relocatable,
115 subtract section address from symbol value.
116
117 2015-11-25 Alan Modra <amodra@gmail.com>
118
119 * powerpc.cc (Output_data_got_powerpc::Output_data_got_powerpc): Align
120 to 256 byte boundary.
121
122 2015-11-19 Alan Modra <amodra@gmail.com>
123
124 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Correct
125 GOT16 and TOC16 relocs to RELATIVE_REF.
126
127 2015-11-14 Cary Coutant <ccoutant@gmail.com>
128
129 PR gold/19244
130 PR gold/18548
131 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced
132 local symbols only for predefined symbols.
133
134 2015-11-11 Alan Modra <amodra@gmail.com>
135 Peter Bergner <bergner@vnet.ibm.com>
136
137 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
138 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
139 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
140 (Target_powerpc::Scan::global): Likewise.
141 (Target_powerpc::Relocate::relocate): Likewise.
142
143 2015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
144
145 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
146 sections.
147
148 2015-11-09 Cary Coutant <ccoutant@gmail.com>
149 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
150
151 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
152 with type, offset, addend.
153 (Copy_relocs::save): Likewise.
154 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
155 (Copy_relocs::save): Likewise.
156 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
157 and r_addend to Copy_relocs::copy_reloc.
158 * arm.cc (Target_arm::copy_reloc): Likewise.
159 * i386.cc (Target_i386::copy_reloc): Likewise.
160 * mips.cc (Target_mips::copy_reloc): Likewise.
161 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
162 * s390.cc (Target_s390::copy_reloc): Likewise.
163 * sparc.cc (Target_sparc::copy_reloc): Likewise.
164 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
165 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
166
167 2015-11-05 Cary Coutant <ccoutant@gmail.com>
168
169 PR gold/19119
170 PR gold/19172
171 PR gold/19197
172 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
173 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
174 * options.h (General_options): Remove "obsolete" from -m.
175 * parameters.cc (set_parameters_target): Check if input target
176 is compatible with output emulation set by "-m emulation".
177
178 2015-11-05 Cary Coutant <ccoutant@gmail.com>
179
180 PR gold/19163
181 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
182 certain relocations if --no-apply-dynamic-relocs is set.
183 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
184
185 2015-11-03 Alan Modra <amodra@gmail.com>
186
187 * po/POTFILES.in: Regenerate.
188
189 2015-10-30 Nick Clifton <nickc@redhat.com>
190
191 * po/zh_CN.po: New (simplified) Chinese translation.
192
193 2015-10-29 H.J. Lu <hongjiu.lu@intel.com>
194
195 PR gold/19184
196 * incremental.cc (Got_plt_view_info): Add got_entry_size.
197 (Local_got_offset_visitor::visit): Replace got_entry_size_
198 with info_.got_entry_size.
199 (Local_got_offset_visitor::got_entry_size_): Removed.
200 (Global_got_offset_visitor::visit): Replace got_entry_size_
201 with info_.got_entry_size.
202 (Global_got_offset_visitor::got_entry_size_): Removed.
203 (Output_section_incremental_inputs::write_got_plt): Initialize
204 view_info.got_entry_size.
205 * target.h (Sized_target::got_entry_size): New virtual function.
206 * x86_64.cc (Target_x86_64::got_entry_size): New function.
207
208 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
209
210 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
211 * testsuite/script_test_12a.c: Likewise.
212 * testsuite/script_test_1a.cc: Likewise.
213 * testsuite/script_test_2.cc: Likewise.
214
215 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
216
217 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
218
219 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
220
221 PR gold/18959
222 * stringpool.cc (Stringpool_template::new_key_offset): Align all
223 strings, even zero-length.
224 (Stringpool_template::set_string_offsets): Likewise.
225
226 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
227
228 * s390.cc: New file.
229 * Makefile.am (TARGETSOURCES): Add s390.cc.
230 (ALL_TARGETOBJS): Add s390.o.
231 * Makefile.in: Regenerate.
232 * configure.ac: Add s390 support.
233 * configure: Regenerate.
234 * configure.tgt: Add s390-*-* and s390x-*-*.
235 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
236 support.
237
238 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
239
240 * archive.cc (Archive::sym64name): New const.
241 (Archive::setup): Add support for SYM64 armap.
242 (Archive::read_armap): Likewise.
243 (Archive::interpret_header): Likewise.
244 (Archive::const_iterator::read_next_header): Likewise.
245 * archive.h (Archive::sym64name): New const.
246 (Archive::read_armap): Add mapsize template parameter.
247
248 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
249
250 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
251 target-specific entry size.
252 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
253 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
254 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
255 hash_entry_size.
256 * target.h (Target::hash_entry_size): New method.
257 (Target::Target_info::hash_entry_size): New data member.
258
259 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
260 * arm.cc (Target_arm::arm_info): Likewise.
261 (Target_arm_nacl::arm_nacl_info): Likewise.
262 * i386.cc (Target_i386::i386_info): Likewise.
263 (Target_i386_nacl::i386_nacl_info): Likewise.
264 (Target_iamcu::iamcu_info): Likewise.
265 * mips.cc (Target_mips::mips_info): Likewise.
266 (Target_mips_nacl::mips_nacl_info): Likewise.
267 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
268 * sparc.cc (Target_sparc::sparc_info): Likewise.
269 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
270 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
271 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
272 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
273
274 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
275
276 PR gold/19177
277 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
278 and R_386_GOT32X relocations without base register.
279
280 2015-10.27 Han Shen <shenhan@google.com>
281
282 PR gold/19042 - unsupported reloc 311/312.
283
284 * aarch64.cc (Target_aarch64::Scan::local): Add support for
285 reloc 311/312.
286
287 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
288
289 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
290 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
291 as R_X86_64_GOTPCREL.
292 (Target_x86_64<size>::Scan::local): Likewise.
293 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
294 Likewise.
295 (Target_x86_64<size>::Scan::global): Likewise.
296 (Target_x86_64<size>::Relocate::relocate): Likewise.
297 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
298 Likewise.
299
300 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
301
302 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
303 R_386_GOT32X the same as R_386_GOT32.
304 (Target_i386::Scan::local): Likewise.
305 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
306 (Target_i386::Scan::global): Likewise.
307 (Target_i386::Relocate::relocate): Likewise.
308 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
309 Likewise.
310
311 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
312
313 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
314 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
315 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
316 x86_64_mov_to_lea1.o.
317 * testsuite/Makefile.in: Regenerated.
318
319 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
320
321 PR gold/19119
322 * options.h (General_options): Remove "obsolete" from -m.
323 * parameters.cc (set_parameters_target): Check if input target
324 is compatible with output emulation set by "-m emulation".
325
326 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
327
328 PR gold/19118
329 * i386.cc (Target_iamcu): New class.
330 (Target_selector_iamcu): Likewise.
331 (Target_iamcu::iamcu_info): New variable.
332 (target_selector_iamcu): Likewise.
333
334 2015-10-07 Andreas Schwab <schwab@suse.de>
335
336 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
337
338 2015-10-06 Cary Coutant <ccoutant@gmail.com>
339
340 PR gold/18855
341 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
342 parameter.
343 (Sparc_relocate_functions::gdop_lox10): Likewise.
344 (Target_sparc::Relocate::relocate): Use addend when computing
345 symbol value for R_SPARC_GOTDATA_OP*.
346
347 2015-09-07 Cary Coutant <ccoutant@gmail.com>
348
349 PR gold/18930
350 PR gold/18886
351 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
352 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
353
354 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
355
356 PR gold/18886
357 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
358 shared libraries into normal FUNC symbols.
359 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
360 symbols aren't from shared libraries.
361
362 2015-09-02 Alan Modra <amodra@gmail.com>
363
364 PR 18878
365 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
366 (Target_powerpc::Branch_info::make_stub): Determine whether long
367 branch stub is for save/restore function.
368 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
369 (Stub_table): Add need_save_res_.
370 (Stub_table:clear_stubs): Clear need_save_res_.
371 (Stub_table:set_address_and_size): Add save/restore section size.
372 (Stub_table::add_long_branch_entry): Add save_res param. Set
373 need_save_res_, but don't add space for save/restore stubs.
374 (Stub_table::find_long_branch_entry): Return offset to local copy
375 of save/restore func.
376 (Stub_table::do_write): Don't output save/restore stubs. Instead
377 copy the save/restore functions.
378 (Output_data_save_res:contents): New accessor.
379 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
380
381 2015-08-25 Cary Coutant <ccoutant@gmail.com>
382
383 PR gold/18847
384 * script-sections.cc (Memory_region::set_address): New method.
385 (Script_sections::find_memory_region): Add explicit_only parameter.
386 (Output_section_definition::set_section_addresses): Handle case where
387 script specifies both address and vma region.
388 * script-sections.h (Script_sections::find_memory_region): Add
389 explicit_only parameter.
390
391 2015-08-25 Cary Coutant <ccoutant@gmail.com>
392
393 PR gold/18859
394 * object.cc (Input_objects::add_object): Store objects in a map,
395 indexed by soname; update as-needed flag when necessary.
396 * object.h (Object::clear_as_needed): New method.
397 (Input_objects::so_names_): Change from set to map.
398
399 2015-08-25 Cary Coutant <ccoutant@gmail.com>
400
401 PR gold/14746
402 * expression.cc (Expression::Expression_eval_info): Add
403 is_valid_pointer field.
404 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
405 Adjust all callers.
406 (Addr_expression::value_from_output_section): Check whether address
407 is valid.
408 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
409 if evaluation failed due to address that is not yet valid.
410 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
411 parameter.
412
413 2015-08-25 Cary Coutant <ccoutant@gmail.com>
414
415 PR gold/18866
416 PR gold/18703
417 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
418
419 2015-08-20 Alan Modra <amodra@gmail.com>
420
421 PR gold/18846
422 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
423 Subtract os->address() from addend.
424 * powerpc.cc (relocate_relocs): Likewise.
425
426 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
427
428 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
429 lazy_stub_normal_1, lazy_stub_normal_1_n64,
430 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
431 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
432 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
433 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
434 of 'addu/daddu'.
435
436 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
437
438 * configure: Regenerated.
439
440 2015-07-26 Doug Kwan <dougkwan@google.com>
441
442 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
443 disassembler output format.
444
445 2015-07-23 Ian Coolidge <icoolidge@google.com>
446 Plumb --pic-veneer option for gold.
447
448 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
449 generation.
450 * options.h (General_options): Add --pic-veneer option.
451
452 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
453
454 PR gold/18663
455 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
456 script_test_1a.cc script_test_1b.cc.
457 (script_test_11_r.o): Replace script_test_11.o with
458 script_test_11a.o script_test_11b.o.
459 (script_test_11.o): Removed.
460 (script_test_11a.o): New.
461 (script_test_11b.o): Likewise.
462 * testsuite/Makefile.in: Regenerated.
463 * testsuite/script_test_1.h: New file.
464 * testsuite/script_test_1b.cc: Likewise.
465 * testsuite/script_test_11.h: Likewise.
466 * testsuite/script_test_11b.c: Likewise.
467 * testsuite/script_test_1.cc: Renamed to ...
468 * testsuite/script_test_1a.cc: This.
469 Include "script_test_1.h".
470 (main): Call check_int and check_ptr.
471 * testsuite/script_test_11.c: Renamed to ...
472 * testsuite/script_test_11a.c: This.
473 Include "script_test_11.h".
474 (main): Call ptr_equal.
475
476 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
477
478 PR gold/18628
479 * testsuite/ifuncdep2.c (global): Change protected to hidden.
480 * testsuite/ifuncmod1.c (global): Likewise.
481 * testsuite/ifuncmod5.c (global): Likewise.
482
483 2015-07-22 Alan Modra <amodra@gmail.com>
484
485 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
486
487 2015-07-21 Cary Coutant <ccoutant@gmail.com>
488
489 PR gold/18548
490 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
491 forced local symbol even when oldsym != NULL.
492 (Symbol_table::do_define_in_output_segment): Likewise.
493 (Symbol_table::do_define_as_constant): Likewise.
494
495 2015-07-21 Cary Coutant <ccoutant@gmail.com>
496
497 PR gold/18698
498 * archive.cc (Library_base::should_include_member): Don't use entry
499 point for relocatable links, or if target is not yet valid.
500 * parameters.cc (Parameters::entry): Check target_valid().
501
502 2015-07-20 Han Shen <shenhan@google.com>
503
504 Optimize erratum 843419 fix.
505
506 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
507 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
508 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
509 (E843419_stub): New sub-class of Erratum_stub.
510 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
511 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
512 (AArch64_relobj::create_erratum_stub): Add 1 argument.
513 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
514
515 2015-07-20 Han Shen <shenhan@google.com>
516
517 Fix arm elf header flags wrt hardfp bit.
518
519 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
520
521 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
522
523 PR gold/18689
524 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
525 from input group section for relocatable link.
526 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
527 (check_DATA): Add pr18689.stdout.
528 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
529 (pr18689.stdout): New rule.
530 (pr18689a.o): Likewise.
531 (pr18689b.o): Likewise.
532 (pr18689.o): Likewise.
533 * testsuite/pr18689.c: New file.
534 * testsuite/pr18689.sh: Likewise.
535 * testsuite/Makefile.in: Regenerated.
536
537 2015-07-20 Yiran Wang <yiran@google.com>
538 Cary Coutant <ccoutant@gmail.com>
539
540 PR gold/15574
541 * resolve.cc (Symbol_table): Remove warning about references
542 from shared objects to hidden symbols.
543 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
544 * testsuite/Makefile.in: Regenerate.
545 * testsuite/hidden_test.sh: Check dynamic symbol table; update
546 expected error messages.
547
548 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
549
550 * compressed_output.cc (Output_compressed_section::set_final_data_size):
551 Make --compress-debug-sections=zlib the same as
552 --compress-debug-sections=zlib-gabi.
553 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
554 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
555 ".zdebug_".
556 * testsuite/Makefile.in: Regenerated.
557
558 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
559
560 PR gold/18322
561 * compressed_output.cc (zlib_compress): Add argument for
562 compression header size. Set header size to compression header
563 size if it isn't 0. Don't write out the zlib header here.
564 (Output_compressed_section::set_final_data_size): Support
565 zlib-gnu and zlib-gabi compressions. Pass compression header
566 size to zlib_compress and write out compression header. Set
567 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
568 clear the SHF_COMPRESSED bit
569 * options.h (compress_debug_sections): Add zlib-gnu and
570 zlib-gabi.
571 * output.h (Output_section::set_flags): New.
572 * testsuite/Makefile.am (check_PROGRAMS): Add
573 flagstest_compress_debug_sections_none,
574 flagstest_compress_debug_sections_gnu and
575 flagstest_compress_debug_sections_gabi.
576 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
577 flagstest_compress_debug_sections.stdout,
578 flagstest_compress_debug_sections.cmp,
579 flagstest_compress_debug_sections.check,
580 flagstest_compress_debug_sections_gnu.stdout,
581 flagstest_compress_debug_sections_gnu.cmp,
582 flagstest_compress_debug_sections_gnu.check,
583 flagstest_compress_debug_sections_gabi.stdout,
584 flagstest_compress_debug_sections_gabi.cmp and
585 flagstest_compress_debug_sections_gabi.check.
586 (flagstest_compress_debug_sections_none): New.
587 (flagstest_compress_debug_sections_none.stdout): Likewise.
588 (flagstest_compress_debug_sections.stdout): Likewise.
589 (flagstest_compress_debug_sections.check): Likewise.
590 (flagstest_compress_debug_sections.cmp): Likewise.
591 (flagstest_compress_debug_sections_gnu): Likewise.
592 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
593 (flagstest_compress_debug_sections_gnu.check): Likewise.
594 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
595 (flagstest_compress_debug_sections_gabi): Likewise.
596 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
597 (flagstest_compress_debug_sections_gnu.check): Likewise.
598 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
599 * testsuite/Makefile.in: Regenerated.
600
601 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
602
603 PR gold/18321
604 * compressed_output.h (decompress_input_section): Add arguments
605 for ELF class, big endian and sh_flags.
606 * compressed_output.cc (decompress_input_section): Likewise.
607 Support the SHF_COMPRESSED section.
608 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
609 functions.
610 * plugin.h (Pluginobj): Likewise.
611 * layout.cc (Layout::get_output_section_flags): Also clear the
612 SHF_COMPRESSED bit.
613 * object.h (Compressed_section_info): Add flag to store sh_flags.
614 (Object): Add pure virtual elfsize and is_big_endian member
615 functions.
616 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
617 prefix here.
618 (build_compressed_section_map): Check SHF_COMPRESSED for
619 uncompressed size. Store sh_flags in Compressed_section_info.
620 Pass size, big_endian and sh_flags to decompress_input_section.
621 Skip the ".debug"/".zdebug" prefix when passing section name to
622 need_decompressed_section.
623 (Sized_relobj_file<size, big_endian>::do_find_special_section):
624 Don't check ".zdebug_*" sections.
625 (Object::decompressed_section_contents): Pass ELF class, big
626 endian and sh_flags to decompress_input_section.
627 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
628 Likewise.
629 * testsuite/Makefile.am (check_DATA): Add
630 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
631 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
632 gdb_index_test_2_gabi.stdout.
633 (debug_msg_cdebug_gabi.o): New.
634 (odr_violation1_cdebug_gabi.o): Likewise.
635 (odr_violation2_cdebug_gabi.o): Likewise.
636 (debug_msg_cdebug_gabi.err): Likewise.
637 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
638 (gdb_index_test_cdebug_gabi.o): Likewise.
639 (gdb_index_test_2_gabi): Likewise.
640 (gdb_index_test_2_gabi.stdout): Likewise.
641 * testsuite/gdb_index_test_2_gabi.sh: New file.
642 * testsuite/Makefile.in: Regenerated.
643
644 2015-07-09 Han Shen <shenhan@google.com>
645
646 Use "gold_info" instead of "gold_warning" for erratum fix.
647
648 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
649 'gold_info'.
650 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
651
652 2015-07-09 Han Shen <shenhan@google.com>
653
654 Drop missing symbol warning for arm/aarch64.
655
656 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
657 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
658 symbol warning.
659
660 2015-07-07 Han Shen <shenhan@google.com>
661
662 Make gold aarch64 accept long form of mapping symbols.
663
664 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
665 of mapping symbols.
666
667 2015-06-29 Doug Kwan <dougkwan@google.com>
668
669 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
670 at address expected by test.
671 * testsuite/arm_cortex_a8_b.s: Ditto.
672 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
673 * testsuite/arm_cortex_a8_bl.s: Ditto.
674 * testsuite/arm_cortex_a8_blx.s: Ditto.
675 * testsuite/arm_cortex_a8_local.s: Ditto.
676 * testsuite/arm_fix_v4bx.s: Ditto.
677 * testsuite/arm_unaligned_reloc.s: Ditto.
678 * testsuite/thumb_bl_out_of_range.s: Ditto.
679 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
680 * testsuite/thumb_blx_out_of_range.s: Ditto.
681
682 2015-06-29 Han Shen <shenhan@google.com>
683
684 Patch for erratum 843419 internal error.
685
686 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
687 (Erratum_stub::update_erratum_insn): New method.
688 (Stub_table::relocate_stubs): Modified to place relocated insn.
689 (AArch64_relobj::fix_errata): Modified gold_assert.
690
691 2015-06-12 Han Shen <shenhan@google.com>
692
693 Fix erratum 835769.
694
695 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
696 defintion outside class definition.
697 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
698 (AArch64_insn_utilities::aarch64_op31): New member.
699 (AArch64_insn_utilities::aarch64_ra): New member.
700 (AArch64_insn_utilities::aarch64_mac): New member.
701 (AArch64_insn_utilities::aarch64_mlxl): New member.
702 (ST_E_835769): New global enum member.
703 (Stub_table::relocate_stubs): Add 835769 handler.
704 (Stub_template_repertoire::Stub_template_repertoire): Install new
705 stub type.
706 (AArch64_relobj::scan_errata): This func is renamed from
707 scan_erratum_843419.
708 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
709 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
710 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
711 (Target_aarch64::scan_erratum_835769_span): New method.
712 (Target_aarch64::create_erratum_stub): New method.
713 (Target_aarch64::is_erratum_835769_sequence): New method.
714 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
715 code into create_erratum_stub.
716 * options.h (fix_cortex_a53_835769): New option.
717
718 2015-06-11 Cary Coutant <ccoutant@gmail.com>
719
720 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
721 outside class body.
722 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
723
724 2015-06-11 Cary Coutant <ccoutant@gmail.com>
725
726 PR gold/17731
727 * layout.cc (corresponding_uncompressed_section_name): New function.
728 (Layout::choose_output_section): Call it.
729 * layout.h (corresponding_uncompressed_section_name): New function.
730 * script-sections.cc (Input_section_info::set_section_name): Check
731 for compressed debug section (.zdebug style).
732
733 2015-06-11 Jing Yu <jingyu@google.com>
734
735 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
736 * testsuite/Makefile.in: Regenerate.
737
738 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
739
740 * gold.h (is_cident): Correct typo.
741
742 2015-06-10 Han Shen <shenhan@google.com>
743 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
744
745 Now fixing for 843419 is fully functional.
746
747 The first part of the erratum fix CL is here -
748 https://sourceware.org/ml/binutils/2015-04/msg00229.html
749
750 * aarch64.cc(global enum): New constants representing stub types.
751 (Stub_template): New POD struct.
752 (Stub_template_repertoire): New class.
753 (Stub_base): New class.
754 (Erratum_stub): New class.
755 (Reloc_stub): Refactored to be a subclass of Stub_base.
756 (Reloc_stub::Stub_type): Removed.
757 (Reloc_stub::offset): Moved to Stub_base.
758 (Reloc_stub::set_offset): Moved to Stub_base.
759 (Reloc_stub::destination_address): Moved to Stub_base.
760 (Reloc_stub::set_destination_address): Moved to Stub_base.
761 (Reloc_stub::reset_destination_address): Moved to Stub_base.
762 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
763 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
764 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
765 (Reloc_stub::write): Moved to Stub_base.
766 (Reloc_stub::invalid_offset): Moved to Stub_base.
767 (Reloc_stub::invalid_address): Moved to Stub_base.
768 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
769 (Reloc_stub::stub_insns_): Moved to Stub_base.
770 (Reloc_stub::offset_): Moved to Stub_base.
771 (Reloc_stub::destination_address_): Moved to Stub_base.
772 (Stub_table::The_aarch64_relobj): New typedef.
773 (Stub_table::The_erratum_stub): New typedef.
774 (Stub_table::The_erratum_stub_less): New typedef.
775 (Stub_table::The_erratum_stub_set): New typedef.
776 (Stub_table::The_erratum_stub_set_iter): New typedef.
777 (Stub_table::empty): Added emptiness testing for erratum stubs.
778 (Stub_table::add_erratum_stub): New method to add an erratum stub.
779 (Stub_table::find_erratum_stub): New method.
780 (Stub_table::find_erratum_stubs_for_input_section): New method.
781 (Stub_table::erratum_stub_address): New method.
782 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
783 (Stub_table::do_addralign): Modified to handle erratum stubs.
784 (Stub_table::erratum_stubs_): New member.
785 (Stub_table::erratum_stub_size_): New member.
786 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
787 (Stub_table::do_write): Modified to handle erratum stubs.
788 (AArch64_relobj::The_erratum_stub): New typedef.
789 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
790 (AArch64_relobj::fix_errata): New method.
791 (Target_aarch64::The_reloc_stub_type): Removed.
792 (Target_aarch64::The_erratum_stub): New typede.
793 (AArch64_relocate_functions::construct_b): New method.
794
795 2015-06-08 Nick Clifton <nickc@redhat.com>
796
797 * po/fr.po: New French Translation.
798
799 2015-06-07 Cary Coutant <ccoutant@gmail.com>
800
801 PR gold/18288
802 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
803 callers. Don't use STT_COMMON to check for common symbols.
804 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
805 symbol that's not in a common section.
806 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
807 common symbols.
808
809 2015-06-04 Cary Coutant <ccoutant@gmail.com>
810
811 PR gold/18200
812 * Makefile.am (diststuff): Add target.
813 * Makefile.in: Regenerate.
814
815 2015-06-04 Cary Coutant <ccoutant@gmail.com>
816
817 PR gold/17498
818 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
819 temporary locals in merge sections.
820 * options.cc (General_options::parse_discard_all): New method.
821 (General_options::parse_discard_locals): New method.
822 (General_options::parse_discard_none): New method.
823 (General_options::General_options): Initialize discard_locals_.
824 * options.h (--discard-all): Convert to special option.
825 (--discard-locals): Likewise.
826 (--discard-none): New option.
827 (General_options::discard_all): New method.
828 (General_options::discard_locals): New method.
829 (General_options::discard_sec_merge): New method.
830 (General_options::Discard_locals): New enum.
831 (General_options::discard_locals_): New data member.
832
833 2015-06-03 Cary Coutant <cary@google.com>
834
835 * script-sections.cc (Script_sections::Script_sections): Initialize
836 segments_created_.
837 (Script_sections::create_note_and_tls_segments): Set flag when
838 segments are created.
839 (Script_sections::expected_segment_count): Count PT_INTERP.
840 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
841 segments are created.
842 * script-sections.h (Script_sections::segments_created_): New data
843 member.
844
845 2015-06-03 Cary Coutant <ccoutant@gmail.com>
846
847 PR gold/15370
848 * script-sections.cc
849 (Output_section_element_input::set_section_addresses): When there
850 are several patterns with no sort spec, put all sections in the same
851 bin.
852 * testsuite/Makefile.am (script_test_12): New testcase.
853 (script_test_12i): New testcase.
854 * testsuite/Makefile.in: Regenerate.
855 * testsuite/script_test_12.t: New test linker script.
856 * testsuite/script_test_12i.t: New test linker script.
857 * testsuite/script_test_12a.c: New test source file.
858 * testsuite/script_test_12b.c: New test source file.
859
860 2015-06-02 Cary Coutant <ccoutant@gmail.com>
861
862 * nacl.h (Sniff_file): Switch parameters to get_view to get an
863 aligned view.
864
865 2015-06-03 Cary Coutant <ccoutant@gmail.com>
866
867 PR gold/17819
868 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
869 separate task to schedule the build id computation.
870 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
871 add Output_file and offset.
872 (Hash_task::run): Get and release the input views.
873 (Hash_task::is_runnable): Always return NULL (always runnable).
874 (Layout::queue_build_id_tasks): Remove.
875 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
876 parameters; use them instead of class members.
877 (Build_id_task_runner::run): New function.
878 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
879 to write_build_id.
880 * layout.h (Layout::queue_build_id_tasks): Remove.
881 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
882 parameters.
883 (Layout::array_of_hashes_): Remove.
884 (Layout::size_of_array_of_hashes_): Remove.
885 (Layout::input_view_): Remove.
886 (Build_id_task_runner): New class.
887 (Close_task_runner::Close_task_runner): Add array_of_hashes and
888 size_of_hashes parameters.
889 (Close_task_runner::array_of_hashes_): New data member.
890 (Close_task_runner::size_of_hashes_): New data member.
891 * testsuite/Makefile.am
892 (flagstest_compress_debug_sections_and_build_id_tree): New test.
893 * testsuite/Makefile.in: Regenerate.
894
895 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
896
897 * merge.cc (get_input_merge_map): Update for data structure change.
898 (get_or_make_input_merge_map): Update for data structure change.
899 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
900 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
901
902 2015-05-16 Alan Modra <amodra@gmail.com>
903
904 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
905 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
906 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
907 (lis_0): Rename from lis_0_0.
908
909 2015-04-29 Cary Coutant <cary@google.com>
910 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
911
912 * gc.h (Garbage_collection::is_section_garbage): Change Object*
913 to Relobj*.
914 (Garbage_collection::add_reference): Likewise.
915 (Garbage_collection::gc_process_relocs): Likewise. Don't push
916 object/shndx pair onto *secvec for dynamic objects. Don't follow
917 relocations pointing to dynamic objects for GC.
918 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
919 (Icf::unfold_section): Likewise.
920 (Icf::is_section_folded): Likewise.
921 (Icf::get_folded_section): Likewise.
922 * icf.h: (Icf::get_folded_section): Likewise.
923 (Icf::unfold_section): Likewise.
924 (Icf::is_section_folded): Likewise.
925 (Icf::section_has_function_pointers): Likewise.
926 (Icf::set_section_has_function_pointers): Likewise.
927 * object.h (Section_id): Likewise.
928 (Const_section_id): Likewise.
929 * output.cc (Output_section::update_section_layout): Likewise.
930 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
931 Likewise.
932 * plugin.cc (update_section_order): Likewise.
933 (unique_segment_for_sections): Likewise.
934 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
935 (Target_powerpc::do_gc_add_reference): Likewise.
936 (Target_powerpc::gc_process_relocs): Likewise.
937 (Target_powerpc::do_gc_add_reference): Likewise.
938 * symtab.cc (Symbol_table::is_section_folded): Likewise.
939 (Symbol_table::gc_mark_symbol): Likewise.
940 * symtab.h: (Symbol_table::is_section_folded): Likewise.
941 * target.h: (Sized_target::gc_add_reference): Likewise.
942 (Sized_target::do_gc_add_reference): Likewise.
943
944 2015-04-29 Nick Clifton <nickc@redhat.com>
945
946 * po/fi.po: Updated Finnish translation.
947
948 2015-04-28 Alan Modra <amodra@gmail.com>
949
950 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
951 than unsigned int for find_global_entry result temp. Compare
952 against invalid_address.
953 (Target_powerpc::do_plt_address_for_global): Likewise.
954 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
955 on plt call stub existence for debug info. Do assert for plt
956 and global entry stub existence if an alloc section.
957
958 2015-04-28 Alan Modra <amodra@gmail.com>
959
960 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
961 on missing global entry stub due to bogus debug info.
962
963 2015-04-27 Han Shen <shenhan@google.com>
964
965 * options.h (--fix-cortex-a53-843419): Rename option.
966 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
967 option.
968 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
969
970 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
971
972 PR gold/18327
973 * output.cc (Output_section::is_input_address_mapped): Assume a missing
974 entry is mapped.
975 * testsuite/Makefile.am: Add the eh_test test.
976 * testsuite/Makefile.in: Regenerate.
977 * testsuite/eh_test_a.cc: New test.
978 * testsuite/eh_test_b.cc: New test.
979
980 2015-04-23 Sriraman Tallam <tmsriram@google.com>
981
982 * options.h (--weak-unresolved-symbols): New option.
983 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
984 binding to weak with new option.
985 * symtab.h (is_weak_undefined): Check for new option.
986 (is_strong_undefined): Check for new option.
987 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
988 * testsuite/Makefile.in: Regenerate.
989 * testsuite/weak_unresolved_symbols_test.cc: New file.
990
991 2015-04-20 Ian Coolidge <icoolidge@google.com>
992
993 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
994 GNU_UNIQUE.
995
996 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
997
998 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
999 push_back.
1000 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
1001 * object.cc (Sized_relobj_file::do_layout): Use push_back.
1002 * powerpc.cc (process_gc_mark): Use push_back.
1003 (Target_powerpc::do_gc_mark_symbol): Use push_back.
1004 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
1005
1006 2015-04-16 Han Shen <shenhan@google.com>
1007
1008 * aarch64.cc (AArch64_insn_utilities): New utility class.
1009 (AArch64_relobj::Mapping_symbol_position): New struct.
1010 (AArch64_relobj::Mapping_symbol_info): New typedef.
1011 (AArch64_relobj::do_count_local_symbols): New function overriding
1012 parent's implementation.
1013 (AArch64_relobj::mapping_symbol_info_): New member
1014 (AArch64_relobj::scan_erratum_843419): New method.
1015 (Target_aarch64::scan_erratum_843419_span): New method.
1016 (Target_aarch64::is_erratum_843419_sequence): New method.
1017 * options.h (fix_cortex_a53): New option.
1018
1019 2015-04-09 Cary Coutant <ccoutant@google.com>
1020
1021 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
1022 in a PIE link.
1023 * testsuite/Makefile.am (tls_pie_test.sh): New test.
1024 * testsuite/Makefile.in: Regenerate.
1025 * testsuite/tls_pie_test.sh: New.
1026
1027 2015-04-09 Cary Coutant <ccoutant@google.com>
1028
1029 * debug.h (DEBUG_LOCATION): New.
1030 (DEBUG_ALL): Include DEBUG_LOCATION.
1031 (debug_string_to_enum): Add DEBUG_LOCATION.
1032 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
1033 output to print correct context.
1034 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
1035 up to 4 more locations at the beginning of the function.
1036 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
1037 result before sorting list of line numbers.
1038 * testsuite/debug_msg.sh: Allow range of line numbers for
1039 canonical results on optimized code.
1040
1041 2015-04-07 HC Yen <hc.yen@mediatek.com>
1042
1043 Add AArch32 support for gold linker.
1044 gold/
1045 * arm.cc: Add V8 arch combine table.
1046
1047 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1048
1049 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
1050
1051 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1052
1053 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
1054 to find by using the return value of insert.
1055
1056 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1057
1058 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
1059 constructor call.
1060
1061 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
1062
1063 PR gold/17641
1064 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
1065 (Target_x86_64::Scan::local): Don't create GOT entry, when we
1066 can convert mov to lea.
1067 (Target_x86_64::Scan::global): Ditto.
1068 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
1069 %reg to lea foo(%rip), %reg if possible.
1070 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
1071 * testsuite/x86_64_mov_to_lea1.s: New.
1072 * testsuite/x86_64_mov_to_lea2.s: Ditto.
1073 * testsuite/x86_64_mov_to_lea3.s: Ditto.
1074 * testsuite/x86_64_mov_to_lea4.s: Ditto.
1075 * testsuite/x86_64_mov_to_lea.sh: Ditto.
1076
1077 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
1078
1079 * configure: Regenerated.
1080
1081 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
1082
1083 PR gold/17640
1084 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
1085 (Target_i386::Scan::local): Don't create GOT entry, when we
1086 can convert GOT to GOTOFF.
1087 (Target_i386::Scan::global): Ditto.
1088 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
1089 lea foo@GOTOFF(%reg), %reg if possible.
1090 * testsuite/Makefile.am (i386_mov_to_lea): New test.
1091 * testsuite/i386_mov_to_lea1.s: New.
1092 * testsuite/i386_mov_to_lea2.s: Ditto.
1093 * testsuite/i386_mov_to_lea3.s: Ditto.
1094 * testsuite/i386_mov_to_lea4.s: Ditto.
1095 * testsuite/i386_mov_to_lea5.s: Ditto.
1096 * testsuite/i386_mov_to_lea.sh: Ditto.
1097
1098 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
1099
1100 * Makefile.am (ZLIB): New.
1101 (ZLIBINC): Likewise.
1102 (AM_CFLAGS): Add $(ZLIBINC).
1103 (AM_CXXFLAGS): Likewise.
1104 (ldadd_varldadd_var): Add $(ZLIB).
1105 (incremental_dump_LDADD): Likewise.
1106 (dwp_LDADD): Likewise.
1107 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
1108 <zlib.h>.
1109 (zlib_compress): Don't check HAVE_ZLIB_H.
1110 (zlib_decompress): Likewise.
1111 * options.h (compress_debug_sections): Likewise.
1112 * configure.ac (AM_CONDITIONAL): Removed.
1113 * testsuite/Makefile.am (ZLIB): New.
1114 (LDADD): Add $(ZLIB).
1115 Don't check HAVE_ZLIB.
1116 * Makefile.in: Regenerated.
1117 * config.in: Likewise.
1118 * configure: Likewise.
1119 * testsuite/Makefile.in: Likewise.
1120
1121 2015-03-30 Jing Yu <jingyu@google.com>
1122
1123 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
1124 TLSLD_ADD_DTPREL_LO12_NC.
1125 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
1126 _TLS_MODULE_BASE_ point to the start of tls segment.
1127 (Target_aarch64::optimize_tls_reloc): Add cases for
1128 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
1129 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1130 (Target_aarch64::Scan::local): Likewise.
1131 (Target_aarch64::Scan::global): Likewise.
1132 (Target_aarch64::Relocate::relocate): Likewise.
1133 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1134 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1135 relocations.
1136
1137 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1138
1139 * merge.cc (Object_merge_map::add_mapping): call
1140 Object_merge_map::Input_merge_map::add_mapping.
1141 (Object_merge_map::Input_merge_map::add_mapping): New.
1142 (Output_merge_data::do_add_input_section): Call
1143 get_or_make_input_merge_map before a loop.
1144 (Output_merge_string<Char_type>::finalize_merged_data): Call
1145 get_or_make_input_merge_map before a loop.
1146 * merge.h (Object_merge_map): Make Input_merge_map public.
1147 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1148 (Relobj::get_or_create_merge_map): New.
1149 * object.h (Relobj::get_or_create_merge_map): New.
1150
1151 2015-03-24 Alan Modra <amodra@gmail.com>
1152
1153 PR 18147
1154 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1155 relocation errors for branches to strong undefined symbols.
1156
1157 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1158
1159 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1160 (Object_merge_map::is_merge_section_for): Remove.
1161 (Object_merge_map::find_merge_section): New.
1162 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1163 (Object_merge_map::find_merge_section): New.
1164 (Object_merge_map::get_input_merge_map): Add a const version.
1165 * object.cc (Relobj::is_merge_section_for): Remove.
1166 (Relobj::find_merge_section): New.
1167 * object.h (Relobj::is_merge_section_for): Remove.
1168 (Relobj::find_merge_section): New.
1169 * output.cc
1170 (Output_section::Input_section::is_merge_section_for): Remove.
1171 (Output_section::add_merge_input_section): Don't call
1172 add_merge_input_section.
1173 (Output_section::find_merge_section): Return const. Use
1174 object->find_merge_section.
1175 (Output_section::build_lookup_maps): Don't build a map for
1176 merge sections.
1177 (Output_section::is_input_address_mapped): Return false if
1178 section is not found.
1179 (Output_section::find_starting_output_address): Use
1180 find_merge_section instead of is_merge_section_for.
1181 (Output_section::add_script_input_section): Don't build a map for
1182 merge sections.
1183 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1184 (Output_section_lookup_maps::find_merge_section): Remove.
1185 (Output_section_lookup_maps::add_merge_input_section) Remove.
1186 (Output_section::find_merge_section): Return const.
1187
1188 2015-03-22 Cary Coutant <cary@google.com>
1189
1190 PR gold/18106
1191 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1192 non-SIB form of lea, with nop after the call.
1193
1194 2015-03-21 Cary Coutant <cary@google.com>
1195
1196 PR gold/14217
1197 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1198 .tdata section.
1199 (Output_segment::set_section_addresses): Don't align size of relro
1200 segment for .tbss.
1201
1202 2015-03-21 Cary Coutant <cary@google.com>
1203
1204 PR gold/18010
1205 * stringpool.cc (Stringpool_template): Don't optimize if section
1206 alignment is greater than sizeof(char).
1207
1208 2015-03-21 Cary Coutant <cary@google.com>
1209
1210 PR gold/18048
1211 * script-c.h (script_include_directive): Add first_token parameter.
1212 * script.cc (script_include_directive): Add first_token parameter, and
1213 pass it to read_script_file.
1214 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1215 (PARSING_MEMORY_DEF): New tokens.
1216 (top): Add new productions for INCLUDE files.
1217 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1218 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1219 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1220 (section_cmd): Pass PARSING_SECTION_CMDS.
1221 (file_or_sections_cmd): Remove.
1222 (memory_def): Pass PARSING_MEMORY_DEF.
1223 * testsuite/Makefile.am (memory_test_2): New test.
1224 * testsuite/Makefile.in: Regenerate.
1225 * testsuite/memory_test_inc.t: New script file.
1226 * testsuite/memory_test_inc_1.t.src: New script file.
1227 * testsuite/memory_test_inc_2.t.src: New script file.
1228 * testsuite/memory_test_inc_3.t.src: New script file.
1229
1230 2015-03-21 Cary Coutant <cary@google.com>
1231
1232 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1233 (Sized_relobj_dwo::setup): Build compressed section map.
1234 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1235 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1236 section map.
1237 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1238 compressed_sections_ field.
1239 (build_compressed_section_map): Take Object instead of
1240 Sized_relobj_file parameter; add decompress_if_needed parameter.
1241 (Sized_relobj_file::do_find_special_sections): Store compressed
1242 section map in parent Object.
1243 (Sized_relobj_file::do_decompressed_section_contents): Move
1244 implementation to Object::decompressed_section_contents.
1245 (Sized_relobj_file::do_discard_decompressed_sections): Move
1246 implementation to Object::discard_decompressed_sections.
1247 * object.h (build_compressed_section_map): Declare.
1248 (Object::Object): Add compressed_sections_ field.
1249 (Object::section_is_compressed): Move implementation here.
1250 (Object::decompressed_section_contents): De-virtualize.
1251 (Object::discard_decompressed_sections): De-virtualize.
1252 (Object::do_section_is_compressed): Delete.
1253 (Object::do_decompressed_section_contents): Delete.
1254 (Object::set_compressed_sections): New method.
1255 (Object::compressed_sections): New method.
1256 (Object::compressed_sections_): New data member.
1257 (Compressed_section_info, Compressed_section_map): Move to top of file.
1258 (Sized_relobj_file::do_section_is_compressed): Delete.
1259 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1260 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1261 (Sized_relobj_file::compressed_sections_): Move to Object class.
1262
1263 2015-03-21 Cary Coutant <ccoutant@google.com>
1264
1265 PR gold/18152
1266 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1267 deferred objects.
1268
1269 2015-03-11 Cary Coutant <ccoutant@google.com>
1270
1271 * options.cc (General_options::finalize): Don't allow -z relro
1272 with incremental linking.
1273 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1274 (incremental_test_2): Likewise.
1275 (incremental_test_3): Likewise.
1276 (incremental_test_4): Likewise.
1277 (incremental_test_5): Likewise.
1278 (incremental_test_6): Likewise.
1279 (incremental_copy_test): Likewise.
1280 (incremental_common_test_1): Likewise.
1281 (incremental_comdat_test_1): Likewise.
1282 * testsuite/Makefile.in: Regenerate.
1283
1284 2015-03-09 Cary Coutant <ccoutant@google.com>
1285
1286 PR gold/14675
1287 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1288 return enum indicating whether .eh_frame section is empty, optimizable,
1289 unrecognized, or an end marker. Adjust explicit instantiations.
1290 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1291 (Eh_frame::add_ehframe_input_section): Change return type.
1292 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1293 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1294 to the .eh_frame output section until we see the end marker.
1295 (Layout::finalize_eh_frame_section): New.
1296 * layout.h: (Layout::finalize_eh_frame_section): New.
1297
1298 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1299
1300 * output.cc (Relobj::initialize_input_to_output_map<size>):
1301 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1302
1303 2015-03-04 Cary Coutant <ccoutant@google.com>
1304
1305 * parameters.cc (Parameters::set_target_once): Call
1306 Target::select_as_default_target just once from here...
1307 (set_parameters_target): ...instead of from here.
1308
1309 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1310
1311 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1312 Output_section_data instead of a Merge_map.
1313 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1314 (Eh_frame::read_cie): Use add_merge_mapping instead of
1315 Merge_map::add_mapping.
1316 (Eh_frame::read_fde): Ditto.
1317 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1318 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1319 merge_map_->get_output_offset.
1320 (Eh_frame::do_is_merge_section_for): Delete.
1321 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1322 instead of a Merge_map.
1323 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1324 Merge_map.
1325 (Eh_frame::do_is_merge_section_for): Delete.
1326 (Eh_frame::merge_map_): Delete.
1327 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1328 and use a Output_section_data instead of a Merge_map.
1329 (Object_merge_map::add_mapping): Ditto.
1330 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1331 (Object_merge_map::is_merge_section_for): Pass in and use a
1332 Output_section_data instead of a Merge_map.
1333 (Merge_map): Delete.
1334 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1335 of merge_map_.get_output_offset.
1336 (Output_merge_base::do_is_merge_section_for): Delete.
1337 (Output_merge_data::do_add_input_section): Use
1338 object->add_merge_mapping instead of add_mapping.
1339 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1340 * merge.h (Merge_map): Delete forward declaration.
1341 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1342 instead of a Merge_map.
1343 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1344 (Object_merge_map::is_merge_section_for): Pass in and use a
1345 Output_section_data instead of a Merge_map.
1346 (Input_merge_map::Object_merge_map::merge_map): Replace with
1347 output_data.
1348 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1349 Output_section_data instead of a Merge_map.
1350 (Merge_map): Delete.
1351 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1352 (Output_merge_base::do_is_merge_section_for): Delete.
1353 (Output_merge_base::add_mapping): Delete.
1354 (Output_merge_base::merge_map_): Delete.
1355 * object.cc (Relobj::initialize_input_to_output_map): New.
1356 (Relobj::initialize_input_to_output_map): New.
1357 (Relobj::merge_output_offset): New.
1358 (Relobj::is_merge_section_for): New.
1359 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1360 bits.
1361 * object.h (Relobj::merge_map): Delete.
1362 (initialize_input_to_output_map): New.
1363 (set_merge_map): Delete.
1364 (add_merge_mapping): New.
1365 (merge_output_offset): New.
1366 (is_merge_section_for): New.
1367 * output.cc (Output_section::Input_section::is_merge_section_for):
1368 Use object->is_merge_section_for.
1369 * output.h (Output_section_data::is_merge_section_for): Delete.
1370 (Output_section_data::do_is_merge_section_for): Delete.
1371 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1372 Use object->initialize_input_to_output_map.
1373 (Merged_symbol_value<size>::value_from_output_section): Use
1374 object->merge_output_offset.
1375
1376 2015-03-02 Peter Collingbourne <pcc@google.com>
1377 Cary Coutant <ccoutant@google.com>
1378
1379 * output.cc (Output_section::add_merge_input_section): Do not
1380 attempt to merge sections with an entsize of 0.
1381
1382 2015-03-02 Khem Raj <raj.khem@gmail.com>
1383
1384 * attributes.h (class Output_attributes_section_data ): Add
1385 do_print_to_mapfile function.
1386
1387 2015-02-24 Alan Modra <amodra@gmail.com>
1388
1389 PR 18010
1390 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1391 complain if value is not a multiple of four.
1392 (Target_powerpc::Relocate::relocate): Correct handling of
1393 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1394
1395 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1396
1397 * configure.ac (default_size): Set to 32 for x32.
1398 * configure: Regenerated.
1399
1400 2015-02-18 Alan Modra <amodra@gmail.com>
1401
1402 PR 17954
1403 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1404 visibility.
1405
1406 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1407
1408 * gc.h (Garbage_collection::add_reference): Don't use find.
1409
1410 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1411
1412 * object.cc (write_local_symbols): avoid std::vector copy.
1413
1414 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1415
1416 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1417
1418 2015-02-09 Mark Wielaard <mjw@redhat.com>
1419
1420 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1421 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1422
1423 2015-02-16 Cary Coutant <ccoutant@google.com>
1424
1425 PR gold/13577
1426 PR gold/16992
1427 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1428 DF_SYMBOLIC if --dynamic-list option is used.
1429 * options.cc (General_options::finalize): --dynamic-list is not
1430 mutually exclusive with -Bsymbolic.
1431 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1432 listed in --dynamic-list.
1433 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1434 -Bsymbolic-functions.
1435 * testsuite/Makefile.in: Regenerate.
1436
1437 2015-02-16 Cary Coutant <ccoutant@google.com>
1438
1439 PR gold/17971
1440 * incremental.cc: Remove redundant include of "output.h".
1441
1442 2015-02-12 Jing Yu <jingyu@google.com>
1443
1444 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1445 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1446 New relocation.
1447 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1448 TLSLE_MOVW_* relocations.
1449 (Target_aarch64::Scan::global): Likewise.
1450 (Target_aarch64::Relocate::relocate): Likewise.
1451 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1452 for new TLSLE_MOVW_* relocations.
1453
1454 2015-02-11 Will Newton <will.newton@linaro.org>
1455
1456 PR gold/13321
1457 * arm.cc (Target_arm::make_plt_section): Create an ARM
1458 state mapping symbol at the start of the PLT.
1459
1460 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1461
1462 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1463 Replace two_file_shared_2.so with two_file_shared_1.so.
1464 * testsuite/Makefile.in: Regenerated.
1465
1466 2015-02-09 Alan Modra <amodra@gmail.com>
1467
1468 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1469 plugin_test_thin.a and defsym_test.
1470 * testsuite/Makefile.in: Regenerate.
1471
1472 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1473
1474 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1475 body.
1476
1477 2015-02-04 Peter Collingbourne <pcc@google.com>
1478
1479 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1480 forwarding symbols when computing symbol resolution info for plugins.
1481 * plugin.h (Plugin_manager::symtab): New method.
1482 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1483
1484 2015-02-03 Cary Coutant <ccoutant@google.com>
1485 Peter Collingbourne <pcc@google.com>
1486
1487 PR gold/15660
1488 * archive.cc (Thin_archive_object_unlocker): New class.
1489 (Archive::include_member): Unlock external members of thin archives.
1490 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1491 (plugin_test_2): Likewise.
1492 (plugin_test_3): Likewise.
1493 (plugin_test_4): Likewise.
1494 (plugin_test_5): Likewise.
1495 (plugin_test_6): Likewise.
1496 (plugin_test_7): Likewise.
1497 (plugin_test_8): Likewise.
1498 (plugin_test_9): Likewise.
1499 (plugin_test_10): Likewise.
1500 (plugin_test_11): New test case.
1501 * testsuite/Makefile.in: Regenerate.
1502 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1503 file to decide whether to claim file.
1504 (all_symbols_read_hook): Likewise.
1505 * testsuite/plugin_test_1.sh: Adjust expected output.
1506 * testsuite/plugin_test_2.sh: Likewise.
1507 * testsuite/plugin_test_3.sh: Likewise.
1508 * testsuite/plugin_test_6.sh: Likewise.
1509 * testsuite/plugin_test_tls.sh: Likewise.
1510 * testsuite/plugin_test_11.sh: New testcase.
1511
1512 2015-02-03 Cary Coutant <ccoutant@google.com>
1513
1514 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1515 file descriptors when debugging enabled. Add debug output.
1516 (Descriptors::release): Add debug output.
1517 (Descriptors::close_some_descriptor): Likewise.
1518 (Descriptors::close_all): Likewise.
1519 * fileread.cc (File_read::lock): Likewise.
1520 (File_read::unlock): Likewise.
1521
1522 2015-02-02 Cary Coutant <ccoutant@google.com>
1523
1524 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1525 executable output file.
1526
1527 2015-01-22 Han Shen <shenhan@google.com>
1528
1529 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1530 (Target_arm::do_plt_address_for_global): New method.
1531 (Target_arm::do_plt_address_for_local): New method.
1532 (Target_arm::rel_irelative_section): New method.
1533 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1534 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1535 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1536 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1537 (Target_arm::Scan::check_non_pic): Add ifunc support.
1538 (Target_arm::Scan::local): Add ifunc support.
1539 (Target_arm::Scan::global): Add ifunc support.
1540 (Target_arm::make_plt_section): New method.
1541 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1542 (Target_arm::make_local_ifunc_plt_entry): New method.
1543 (Target_arm::got_irelative_): New member.
1544 (Target_arm::rel_irelative_): New member.
1545 (Target_arm::got_section): Add creation for got_irelative_.
1546 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1547 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1548 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1549 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1550 (Output_data_plt_arm::IRelative_data): New type.
1551 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1552 (Output_data_plt_arm::add_entry): Add more parameters.
1553 (Output_data_plt_arm::add_relocation): New method.
1554 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1555 (Output_data_plt_arm::rel_irelative): New method.
1556 (Output_data_plt_arm::entry_count): Modified.
1557 (Output_data_plt_arm::address_for_global): New method.
1558 (Output_data_plt_arm::address_for_local): New method.
1559 gold/
1560 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1561 (Output_data_plt_arm::insert_irelative_data): New method.
1562 (Output_data_plt_arm::irelative_rel_): New member.
1563 (Output_data_plt_arm::got_): New member.
1564 (Output_data_plt_arm::got_irelative_): New member.
1565 (Output_data_plt_arm::irelative_count_): New member.
1566 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1567 (Output_data_plt_arm::irelative_data_vec_): New member.
1568 (Output_data_plt_arm::do_write): Write out irelative entries.
1569 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1570 more parameters to ctor.
1571 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1572 more parameters to ctor.
1573 * output.h (Output_data_reloc::add_local_relative): New method.
1574 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1575
1576 2015-01-29 Alan Modra <amodra@gmail.com>
1577
1578 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1579 and GOT_TLSGD to LE optimization.
1580
1581 2015-01-28 Cary Coutant <ccoutant@google.com>
1582
1583 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1584 for undef TLS symbols.
1585 (Target_x86_64::Relocate::relocate_tls): Likewise.
1586 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1587
1588 2015-01-25 Cary Coutant <ccoutant@google.com>
1589
1590 * output.cc (Output_segment::set_section_addresses): Fix calculation
1591 of size of relro segment.
1592
1593 2015-01-22 Alan Modra <amodra@gmail.com>
1594
1595 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1596 condition for need of ifunc plt entry.
1597 (Target_powerpc::Scan::global <got relocs>): Likewise.
1598
1599 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1600
1601 * mips.cc (reloc_high): Add r_sym.
1602 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1603 reloc_high constructor.
1604 (Mips_relocate_functions::relgot16_local): Likewise.
1605 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1606 r_type to decide whether LO16 matches HI16.
1607 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1608 rello16 and relgot16_local.
1609
1610 2015-01-09 Cary Coutant <ccoutant@google.com>
1611
1612 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1613 unless alignment is larger than page size.
1614
1615 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1616 Cary Coutant <ccoutant@google.com>
1617
1618 PR gold/17729
1619 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1620 (DEFAULT_TARGET_X32): Set for x32.
1621 * x86_64.cc (cmp_insn_32): New.
1622 (lea_r10_insn_32): Likewise.
1623 (lea_r11_insn_32): Likewise.
1624 (cmp_insn_64): Likewise.
1625 (lea_r10_insn_64): Likewise.
1626 (lea_r11_insn_64): Likewise.
1627 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1628 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1629 (check_DATA): Add split_x32 files.
1630 (split_x32_[1234n].o): New targets.
1631 (split_x32_[124]): New targets.
1632 (split_x32_[1234r].stdout): New targets.
1633 * testsuite/split_x32.sh: New file.
1634 * testsuite/split_x32_1.s: Likewise.
1635 * testsuite/split_x32_2.s: Likewise.
1636 * testsuite/split_x32_3.s: Likewise.
1637 * testsuite/split_x32_4.s: Likewise.
1638 * testsuite/split_x32_n.s: Likewise.
1639 * configure: Regenerated.
1640 * testsuite/Makefile.in: Likewise.
1641
1642 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1643
1644 PR gold/17809
1645 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1646 x32.
1647
1648 2015-01-02 Alan Modra <amodra@gmail.com>
1649
1650 * version.cc (print_version): Just print current year.
1651 * dwp.cc (print_version): Likewise.
1652
1653 2015-01-01 Alan Modra <amodra@gmail.com>
1654
1655 Update year range in copyright notice of all files.
1656
1657 2014-12-25 Alan Modra <amodra@gmail.com>
1658
1659 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1660 new enums.
1661 (Target_arm::merge_object_attributes, ): Likewise.
1662
1663 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1664
1665 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1666 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1667 AEABI_VFP_args_vfp to check that.
1668 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1669 value and replace hardcoded values by enum values.
1670
1671 2014-12-22 Cary Coutant <ccoutant@google.com>
1672
1673 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1674
1675 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1676
1677 PR gold/14608
1678 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1679 to "return i * i * 3;".
1680
1681 2014-12-16 Cary Coutant <ccoutant@google.com>
1682
1683 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1684 (Mapfile::print_output_data): Use current_data_size() to avoid
1685 assert for sections requiring postprocessing; if address is not valid,
1686 print 0.
1687 (Mapfile::print_output_section): Use current_data_size(); print note
1688 that addresses and sizes are before compression.
1689
1690 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1691
1692 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1693 Cast current_group_size to unsigned long when reporting error.
1694
1695 2014-12-10 Jing Yu <jingyu@google.com>
1696
1697 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1698 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1699 Update error message.
1700 (Target_aarch64::do_relax): Use absolute value of option
1701 stub_group_size. Replace local variable with class member
1702 stub_group_size_.
1703
1704 2014-12-04 Alan Modra <amodra@gmail.com>
1705
1706 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1707 addend of PLTREL24 reloc when not generating a plt stub. Make
1708 max_branch_offset an "Address".
1709 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1710 (Target_powerpc::Relocate::relocate): Likewise.
1711
1712 2014-12-04 Alan Modra <amodra@gmail.com>
1713
1714 PR 17670
1715 * symtab.cc (Symbol::set_undefined): Remove assertion.
1716 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1717 on symbols defined in discarded sections, instead return false.
1718 Rearrange params, update all callers.
1719 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1720 branches to syms in discarded sections.
1721 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1722 undefined and flag as discarded.
1723 (Target_powerpc::Relocate::relocate): Localize variable.
1724
1725 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1726
1727 PR gold/17675
1728 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1729 * testsuite/Makefile.in: Regenerated.
1730
1731 2014-12-03 Alan Modra <amodra@gmail.com>
1732
1733 PR 17566
1734 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1735 when adding dynamic relocations against section symbols.
1736
1737 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1738
1739 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1740 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1741 * options.h (General_options): New -z option (global).
1742
1743 2014-12-01 Cary Coutant <ccoutant@google.com>
1744
1745 PR gold/17578
1746 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1747 is given.
1748 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1749 given but some inputs require executable stack.
1750
1751 2014-11-26 Cary Coutant <ccoutant@google.com>
1752
1753 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1754 .debug_str_offsets; strip .debug_gnu_pubnames and
1755 .debug_gnu_pubtypes.
1756 (lines_only_debug_sections): Strip all four new sections.
1757
1758 2014-11-26 Jing Yu <jingyu@google.com>
1759
1760 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1761 register to be x0 when to relax TLSDESC_LD64_LO12.
1762
1763 2014-11-26 Alan Modra <amodra@gmail.com>
1764
1765 * powerpc.cc (struct Stub_table_owner): New.
1766 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1767 unsigned int vector. Update all references.
1768 (powerpc_relobj::set_stub_table): Take an unsigned int param
1769 rather than a Stub_table. Update callers.
1770 (Powerpc_relobj::clear_stub_table): New function.
1771 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1772 stub_group_size_ vars.
1773 (Target_powerpc::new_stub_table): Delete.
1774 (max_branch_delta): New function, extracted from..
1775 (Target_powerpc::Relocate::relocate): ..here..
1776 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1777 status on whether stub created successfully.
1778 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1779 default sizing to..
1780 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1781 reduce on relax failure.
1782 (Target_powerpc::group_sections): Add "no_size_errors" param.
1783 Use stub_group_size_. Set up group info in a temp vector,
1784 before building Stub_table vector. Account for input sections
1785 possibly already converted to relaxed sections.
1786 (Stub_table::init): Delete. Merge into..
1787 (Stub_table::Stub_table): ..here.
1788 (Stub_table::can_reach_stub): New function.
1789 (Stub_table::add_plt_call_entry): Add "from" parameter and
1790 return true iff stub could be reached.
1791 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1792 param too.
1793 (Stub_table::clear_stubs): Add "all" param.
1794
1795 2014-11-26 Alan Modra <amodra@gmail.com>
1796
1797 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1798 (Target_powerpc::group_sections): Use it.
1799
1800 2014-11-25 Cary Coutant <ccoutant@google.com>
1801
1802 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1803 (Binary_to_elf::write_symbol): Add st_size parameter.
1804 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1805
1806 2014-11-25 Cary Coutant <ccoutant@google.com>
1807
1808 PR gold/17639
1809 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1810 (Sized_relobj_file::do_layout): Handle deferred sections properly
1811 during GC pass 1. Don't add reloc sections to deferred list twice.
1812 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1813 (Sized_relobj_file::is_deferred_layout_): New data member.
1814
1815 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1816
1817 PR gold/17619
1818 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1819 Check PC-relative offset overflow in PLT entry.
1820
1821 2014-11-21 Alan Modra <amodra@gmail.com>
1822
1823 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1824 for undefined weaks.
1825
1826 2014-11-20 Alan Modra <amodra@gmail.com>
1827
1828 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1829 from --stub-group-size parameter divided by 1024.
1830 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1831 template parameter. Update all uses.
1832 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1833 has_stub_value. Set for long branches. Don't report overflow for
1834 branch to undefined weak symbols. Print info message on
1835 overflowing branch to stub.
1836
1837 2014-11-20 Alan Modra <amodra@gmail.com>
1838
1839 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1840
1841 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1842
1843 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1844 entry for R_X86_64_GOTPLT64.
1845 (Target_x86_64<size>::Relocate::relocate): Update comments for
1846 R_X86_64_GOTPLT64.
1847
1848 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1849
1850 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1851 * plugin.h: add lock definition
1852
1853 2014-10-29 Han Shen <shenhan@google.com>
1854 Jing Yu <jingyu@google.com>
1855
1856 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1857 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1858 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1859 Symbol::TLS_REF.
1860 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1861 method.
1862 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1863 (Target_aarch64::tls_ld_to_le): New method.
1864 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1865 for 64bit targets.
1866 (Output_data_plt_aarch64::irelative_rel_): New data member.
1867 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1868 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1869 (Output_data_plt_aarch64::add_relocation): New method.
1870 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1871 offset. Add got_irelative size to got size.
1872 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1873 type string with the new typename.
1874 (AArch64_relocate_functions::update_adr): Replace parameter x with
1875 immed.
1876 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1877 (AArch64_relocate_functions::reloc_common): New method.
1878 (AArch64_relocate_funcsions::rela_general): Extract common part out
1879 into reloc_common method.
1880 (AArch64_relocate_functions::rela_general): Likewise.
1881 (AArch64_relocate_functions::pcrela_general): Likewise.
1882 (AArch64_relocate_functions::adr): New method.
1883 (AArch64_relocate_functions::adrp): Calculate immed before calling
1884 update_adr.
1885 (AArch64_relocate_functions::adrp): Likewise.
1886 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1887 comparing x to 0. Calculate immed from ~x when x < 0.
1888 (Target_aarch64::optimize_tls_reloc): Add new cases for
1889 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1890 TLSLD_MOVW_DTPREL_G0_NC.
1891 (Target_aarch64::possible_function_pointer_reloc): Implement this
1892 method.
1893 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1894 comment.
1895 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1896 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1897 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1898 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1899 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1900 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1901 (Target_aarch64::make_plt_entry): Call add_entry with two more
1902 parameters.
1903 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1904 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1905 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1906 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1907 (Target_aarch64::Relocate::relocate_tls): Add cases for
1908 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1909 TLSLD_MOVW_DTPREL_G0_NC.
1910 * testsuite/icf_safe_so_test.cc: Correct test comment.
1911 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1912
1913 2014-10-22 Alan Modra <amodra@gmail.com>
1914
1915 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1916 thread_starter.
1917
1918 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1919
1920 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1921
1922 2014-10-17 Cary Coutant <ccoutant@google.com>
1923
1924 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1925 Add "typename" keyword.
1926
1927 2014-10-15 Han Shen <shenhan@google.com>
1928 Jing Yu <jingyu@google.com>
1929
1930 Patch for gold aarch64 backend to support relaxation.
1931 * aarch64-reloc.def: Change format.
1932 * aarch64.cc (class Reloc_stub): New class.
1933 (class Stub_table): New class.
1934 (class AArch64_relobj): New class.
1935 (class AArch64_input_section): New class.
1936 (class AArch64_output_section): New class.
1937 (Target_aarch64::new_stub_table): New method.
1938 (Target_aarch64::new_aarch64_input_section): New method.
1939 (Target_aarch64::find_aarch64_input_section): New method.
1940 (Target_aarch64::scan_section_for_stubs): New method.
1941 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1942 (Target_aarch64::relocate_stub): New method.
1943 (Target_aarch64::current_target): New method.
1944 (Target_aarch64::do_make_elf_object): New method.
1945 (Target_aarch64::do_may_relax): New method.
1946 (Target_aarch64::do_relax): New method.
1947 (Target_aarch64::group_sections): New method.
1948 (Target_aarch64::scan_reloc_for_stub): New method.
1949 (Target_aarch64::do_make_output_section): New method.
1950 (Target_aarch64::stub_tables_): New data member.
1951 (Target_aarch64::aarch64_input_section_map_): New data member.
1952 (AArch64_relocate_functions::maybe_apply_stub): New method.
1953
1954 2014-09-30 Cary Coutant <ccoutant@google.com>
1955
1956 PR gold/17432
1957 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1958
1959 2014-09-30 Kito Cheng <kito@0xlab.org>
1960
1961 PR gold/13597
1962 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1963 hash table before sysv-style hash table.
1964
1965 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1966
1967 * options.h (--pic-executable): Add negative to alias to -no-pie.
1968
1969 2014-09-26 Cary Coutant <ccoutant@google.com>
1970
1971 PR gold/16773
1972 * object.cc (Sized_relobj_file): Compute value of section symbols
1973 for TLS sections the same as TLS symbols.
1974
1975 2014-09-25 Cary Coutant <ccoutant@google.com>
1976
1977 PR gold/17432
1978 * resolve.cc (Symbol_table::resolve): Override common placeholder
1979 symbols, but adjust sizes.
1980 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1981 symbols to common lists.
1982
1983 2014-09-24 Alan Modra <amodra@gmail.com>
1984
1985 * po/POTFILES.in: Regenerate.
1986
1987 2014-09-23 Taiju Tsuiki <tzik@google.com>
1988 Cary Coutant <ccoutant@google.com>
1989
1990 PR gold/14860
1991 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1992 on input_sections_blocker.
1993 * layout.cc (Write_sections_task::locks): Unblock
1994 input_sections_blocker_.
1995 * layout.h (Write_sections_task::Write_sections_task): Add
1996 input_sections_blocker.
1997 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1998 to DEPENDENCIES.
1999 * testsuite/Makefile.in: Regenerate.
2000
2001 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2002
2003 * testsuite/Makefile.am (plugin_test_10): New test.
2004 * testsuite/Makefile.in: Regenerate
2005 * testsuite/plugin_common_test_2.c (c1): Align to 8.
2006 * testsuite/plugin_test_10.sh: New file.
2007
2008 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2009
2010 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
2011 * resolve.cc (Symbol_table::resolve): Don't override common symbols
2012 during the replacement phase.
2013
2014 2014-09-17 Han Shen <shenhan@google.com>
2015 Jing Yu <jingyu@google.com>
2016
2017 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
2018 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
2019 * aarch64.cc (Target_aarch64): Add data members
2020 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
2021 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
2022 constructor.
2023 (Target_aarch64::do_reloc_symbol_index): New method.
2024 (Target_aarch64::do_reloc_addend): New method.
2025 (Target_aarch64::add_tlsdesc_info): New method.
2026 (Target_aarch64::do_dynsym_value): New method.
2027 (Target_aarch64::do_make_data_plt): Add new parameters: got,
2028 got_irelative. Pass them to Output_data_plt_aarch64_standard.
2029 (Target_aarch64::make_data_plt): Add new parameters: got,
2030 got_irelative. Pass them to do_make_data_plt.
2031 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
2032 (Target_aarch64::Relocate:tls_gd_to_le): New method.
2033 (Target_aarch64::Relocate:tls_ie_to_le): New method.
2034 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
2035 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
2036 (Target_aarch64::got_tlsdesc_section): New method.
2037 (Target_aarch64::make_local_ifunc_plt_entry): New method.
2038 (Target_aarch64::define_tls_base_symbol): New method.
2039 (Target_aarch64::reserve_tlsdesc_entries): New method.
2040 (Target_aarch64::got_mod_index_entry): New method.
2041 (Target_aarch64::rela_tlsdesc_section): New method.
2042 (Target_aarch64::rela_irelative_section): New method.
2043 (Target_aarch64::Tlsdesc_info): New struct.
2044 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
2045 relocations and tlsdesc relocations.
2046 (Target_aarch64::optimize_tls_reloc): Implement method.
2047 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
2048 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
2049 in constructor.
2050 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
2051 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
2052 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
2053 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
2054 (Output_data_plt_aarch64::rela_tlsdesc): New method.
2055 (Output_data_plt_aarch64::rela_irelative): New method.
2056 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
2057 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
2058 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
2059 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
2060 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
2061 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
2062 (Output_data_plt_aarch64_standard): New member variables:
2063 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
2064 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
2065 New parameter: got, got_irelative.
2066 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
2067 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
2068 (Output_data_plt_aarch64::do_write): Replace got_address with
2069 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
2070 (AArch64_relocate_functions::update_movnz): New method.
2071 (AArch64_relocate_functions): Correct format.
2072 (AArch64_relocate_functions::movnz): New method.
2073 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
2074 before the switch. Add new cases to switch.
2075 Check ie_to_le relaxation on tlsie relocations. Add code handling
2076 tlsgd tlsdesc cases.
2077 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
2078 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
2079 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
2080 Call reloc_name_in_error_message to print unsupported reloc.
2081 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
2082 make_data_plt.
2083 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
2084 relocs. Fill in some more dynamic tags.
2085 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
2086 Skip call tls_get_addr when tlsgd is relaxed.
2087 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
2088 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
2089 tlsdesc->ie relaxation.
2090
2091 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2092
2093 * mips.cc (Target_mips_nacl): New class.
2094 (Target_selector_mips_nacl): New class.
2095 (target_selector_mips32): Rename from target_selector_mips32be and use
2096 Target_selector_mips_nacl instead of Target_selector_mips.
2097 (target_selector_mips32el): Rename from target_selector_mips32 and use
2098 Target_selector_mips_nacl instead of Target_selector_mips.
2099 (target_selector_mips64): Rename from target_selector_mips64be and use
2100 Target_selector_mips_nacl instead of Target_selector_mips.
2101 (target_selector_mips64el): Rename from target_selector_mips64 and use
2102 Target_selector_mips_nacl instead of Target_selector_mips.
2103 (Target_mips::mips_info): Add const attribute.
2104
2105 2014-09-02 Cary Coutant <ccoutant@google.com>
2106
2107 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
2108 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
2109 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
2110 (Sized_incr_dynobj::do_section_name): Likewise.
2111 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
2112 (Sized_incr_dynobj::do_section_name): Likewise.
2113 * object.h (Object::section_name): Likewise.
2114 (Object::do_section_name): Likewise.
2115 (Sized_relobj_file::do_section_name): Likewise.
2116 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
2117 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
2118
2119 2014-09-02 Cary Coutant <ccoutant@google.com>
2120
2121 PR gold/17005
2122 * ehframe.cc (Fde::write): Add output_offset parameter.
2123 (Cie::write): Likewise.
2124 (Eh_frame::set_final_data_size): Account for offset within output
2125 section.
2126 (Eh_frame::do_sized_write): Likewise.
2127 * ehframe.h (Fde::write): Add output_offset parameter.
2128 (Cie::write): Likewise.
2129 * output.cc (Output_section::Input_section_sort_entry): Remove
2130 section_has_name_; add output_section_name parameter. Use
2131 output section name for non-input sections.
2132 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2133 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2134 (Output_section::Input_section_sort_compare): Remove logic for
2135 sections without names.
2136 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2137 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2138 Likewise.
2139 (Output_section::Input_section_sort_section_name_compare): Likewise.
2140
2141 2014-08-29 Han Shen <shenhan@google.com>
2142 Jing Yu <jingyu@google.com>
2143
2144 * aarch64-reloc-property.cc
2145 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2146 reference reloc property in the table.
2147 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2148 3 other entries.
2149 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2150 2 new overloaded methods.
2151 (Output_data_got_aarch64::do_write): Add code to write out
2152 static relocs.
2153 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2154 static relocs.
2155 (Output_data_got_aarch64::static_relocs): New vector to
2156 hold static relocs.
2157 (Target_aarch64::TCB_SIZE): New const static memeber.
2158 (Target_aarch64::tcb_size): New method.
2159 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2160 (Target_aarch64::Relocate::relocate_tls): New method.
2161 (Target_aarch64::Scan::local): Add code handling new reloc types.
2162 (Target_aarch64::Scan::global): Add code handling new reloc types.
2163
2164 2014-08-13 Sriraman Tallam <tmsriram@google.com>
2165
2166 * options.h (-no-pie): Add option.
2167
2168 2014-08-08 Jing Yu <jingyu@google.com>
2169 Han Shen <shenhan@google.com>
2170
2171 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2172 (DEFFILES): add aarch64-reloc.def.
2173 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2174 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2175 * Makefile.in: Regenerate.
2176 * aarch64-reloc-property.cc: New file.
2177 * aarch64-reloc-property.h: New file.
2178 * aarch64-reloc.def: New file.
2179 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2180 with tab to make the format consistent.
2181 (Output_data_got_aarch64::symbol_table_): New method.
2182 (Target_aarch64::do_plt_address_for_global): New method.
2183 (Target_aarch64::do_plt_address_for_local): New method.
2184 (Target_aarch64::do_select_as_default_target): New method.
2185 (Target_aarch64::do_make_data_plt): New method.
2186 (Target_aarch64::make_data_plt): New method.
2187 (Output_data_plt_aarch64::has_irelative_section): New method.
2188 (Output_data_plt_aarch64::address_for_global): New method.
2189 (Output_data_plt_aarch64::address_for_local): New method.
2190 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2191 (Output_data_plt_aarch64::add_entry): Implement contents.
2192 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2193 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2194 the got_pov entry to plt0.
2195 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2196 Implement contents.
2197 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2198 (AArch64_howto): New struct.
2199 (aarch64_howto[]): New static const array.
2200 (AArch64_relocate_functions): New class.
2201 (Target_aarch64::Scan::get_reference_flags): Remove method.
2202 (Target_aarch64::Scan::local): Implement to support a few relocations.
2203 (Target_aarch64::Scan::global): Implement to support a few relocations.
2204 (Target_aarch64::make_plt_section): Implement contents.
2205 (Target_aarch64::make_plt_entry): Implement contents.
2206 (Target_aarch64::do_finalize_sections): Implement contents.
2207 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2208 (Target_aarch64::relocate_section): Implement contents.
2209
2210 2014-08-06 Alan Modra <amodra@gmail.com>
2211
2212 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2213
2214 2014-08-06 Alan Modra <amodra@gmail.com>
2215
2216 PR 13227
2217 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2218
2219 2014-07-21 Sriraman Tallam <tmsriram@google.com>
2220
2221 * object.cc (Relobj::is_section_name_included): Add
2222 ".rodata.nptl_version" to not garbage collect this section.
2223
2224 2014-07-08 Cary Coutant <ccoutant@google.com>
2225
2226 * expression.cc (struct Expression::Expression_eval_info): Add
2227 new fields type_pointer, vis_pointer, and nonvis_pointer.
2228 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2229 nonvis_pointer parameters. Adjust all calls.
2230 (Symbol_expression::value): Update type, visibility, and nonvis bits
2231 in caller.
2232 * script.cc (Symbol_assignment::sized_finalize): Update type,
2233 visibility, and remaining st_other bits for new symbol.
2234 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2235 vis_pointer, and nonvis_pointer parameters.
2236 * symtab.h (Symbol::set_type): New method.
2237
2238 * testsuite/Makefile.am (defsym_test): New test.
2239 * testsuite/Makefile.in: Regenerate.
2240 * testsuite/defsym_test.c: New file.
2241 * testsuite/defsym_test.sh: New file.
2242
2243 2014-07-08 Cary Coutant <ccoutant@google.com>
2244
2245 PR gold/15639
2246 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2247 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2248 (Sized_dynobj::base_read_symbols): ...new method.
2249 * object.h (Sized_relobj_file::base_read_symbols): New method.
2250 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2251 (Sized_relobj_file::base_read_symbols): ...new method.
2252 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2253 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2254 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2255
2256 2014-07-04 Alan Modra <amodra@gmail.com>
2257
2258 * po/POTFILES.in: Regenerate.
2259
2260 2014-07-02 Jing Yu <jingyu@google.com>
2261
2262 * aarch64.cc: New file
2263 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2264 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2265 * Makefile.in: Regenerate.
2266 * configure.tgt: Add entries for aarch64*.
2267 * configure.ac: Likewise.
2268 * configure: Likewise.
2269
2270 2014-06-27 Alan Modra <amodra@gmail.com>
2271
2272 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2273
2274 2014-06-24 Cary Coutant <ccoutant@google.com>
2275
2276 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2277 sections.
2278 (Dwo_file::sized_read_unit_index): Likewise.
2279
2280 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2281
2282 * mips.cc: New file.
2283 * Makefile.am (TARGETSOURCES): Add mips.cc
2284 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2285 * configure.tgt: Add entries for mips*.
2286 * configure.ac: Likewise.
2287 * Makefile.in: Regenerate.
2288 * configure: Likewise.
2289
2290 2014-06-09 Cary Coutant <ccoutant@google.com>
2291
2292 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2293 unit_length is within section bounds.
2294
2295 2014-06-09 Cary Coutant <ccoutant@google.com>
2296
2297 PR gold/16980
2298 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2299 map.
2300
2301 2014-06-07 Alan Modra <amodra@gmail.com>
2302
2303 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2304
2305 2014-06-06 Cary Coutant <ccoutant@google.com>
2306
2307 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2308 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2309 (Dwarf_pubnames_table::read_header): Likewise.
2310 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2311 .debug_gnu_pubtypes.
2312
2313 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2314
2315 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2316 * Makefile.in, configure: Regenerate.
2317
2318 2014-06-03 Alan Modra <amodra@gmail.com>
2319
2320 * powerpc.cc (addis_12_2): Define.
2321 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2322
2323 2014-06-03 Alan Modra <amodra@gmail.com>
2324
2325 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2326 st_other output.
2327
2328 2014-06-02 Alan Modra <amodra@gmail.com>
2329
2330 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2331 Only ignore relocs on ELFv1.
2332 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2333
2334 2014-05-30 Cary Coutant <ccoutant@google.com>
2335
2336 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2337 * testsuite/Makefile.in: Regenerate.
2338 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2339
2340 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2341
2342 PR gold/16945
2343 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2344 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2345
2346 2014-05-15 Alan Modra <amodra@gmail.com>
2347
2348 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2349 Compare FDE contents with DW_CFA_nop rather than 0.
2350
2351 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2352
2353 * symtab.h (may_need_copy_reloc): Remove check for position independent
2354 code.
2355 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2356 position independence before pc absolute may_need_copy_reloc call.
2357 Add check for executable output befor pc relative may_need_copy_reloc
2358 call.
2359 * i386.cc: Ditto.
2360 * arm.cc: Ditto.
2361 * sparc.cc: Ditto.
2362 * tilegx.cc: Ditto.
2363 * powerpc.cc: Add check for no position independence before
2364 may_need_copy_reloc calls.
2365 * testsuite/pie_copyrelocs_test.cc: New file.
2366 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2367 * Makefile.am (pie_copyrelocs_test): New test.
2368 * Makefile.in: Regenerate.
2369
2370 2014-05-08 Martin Liška <mliska@suse.cz>
2371
2372 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2373
2374 2014-05-06 Cary Coutant <ccoutant@google.com>
2375
2376 PR gold/16900
2377 * i386.cc (Output_data_got_plt_i386): New class.
2378 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2379 parameter. Change all callers.
2380 (Output_data_plt_i386::layout_): Remove.
2381 (Output_data_plt_i386::got_plt_): Change type.
2382 (Target_i386::got_plt_): Change type. Change all references.
2383 (Target_i386::got_section): Create instance of new class.
2384 (Output_data_got_plt_i386::do_write): New function.
2385 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2386 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2387 parameter. Change all callers.
2388 (Output_data_plt_x86_64::layout_): Remove.
2389 (Output_data_plt_x86_64::got_plt_): Change type.
2390 (Target_x86_64::got_plt_): Change type. Change all references.
2391 (Target_x86_64::got_section): Create instance of new class.
2392 (Output_data_got_plt_x86_64::do_write): New function.
2393 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2394 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2395 class.
2396
2397 2014-05-05 Cary Coutant <ccoutant@google.com>
2398
2399 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2400 if we have pubnames/pubtypes.
2401
2402 2014-05-02 Cary Coutant <ccoutant@google.com>
2403
2404 * defstd.cc (in_segment): Define __ehdr_start here...
2405 * layout.cc (Layout::finalize): ...Instead of here. Set the
2406 output segment when known.
2407 * resolve.cc (Symbol::override_base_with_special): Remember
2408 the original binding.
2409 * symtab.cc (Symbol::set_output_segment): New function.
2410 (Symbol::set_undefined): New function.
2411 * symtab.h (Symbol::is_weak_undefined): Check original undef
2412 binding.
2413 (Symbol::is_strong_undefined): New function.
2414 (Symbol::set_output_segment): New function.
2415 (Symbol::set_undefined): New function.
2416 * target-reloc.h (is_strong_undefined): Remove.
2417 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2418 Check for hidden undefs.
2419 (relocate_section): Call Symbol::is_strong_undefined.
2420
2421 * testsuite/Makefile.am (ehdr_start_test_1)
2422 (ehdr_start_test_2, ehdr_start_test_3)
2423 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2424 * testsuite/Makefile.in: Regenerate.
2425 * testsuite/ehdr_start_def.cc: New source file.
2426 * testsuite/ehdr_start_test.cc: New source file.
2427 * testsuite/ehdr_start_test.t: New linker script.
2428 * testsuite/ehdr_start_test_4.sh: New shell script.
2429
2430 2014-04-23 Cary Coutant <ccoutant@google.com>
2431
2432 PR gold/16870
2433 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2434
2435 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2436
2437 * layout.cc (Layout::include_section): Allow a target to decide
2438 whether to include a section.
2439 * target.h (Target::should_include_section): New function.
2440 (Target::do_should_include_section): New function.
2441
2442 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2443
2444 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2445 inline into ...
2446 (Copy_relocs::emit): ... here.
2447 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2448 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2449 (Copy_reloc_entry::entries_): Change from private to protected.
2450
2451 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2452
2453 * icf.cc (get_section_contents): Replace copies of reloc
2454 vectors with const references.
2455
2456 2014-04-02 Cary Coutant <ccoutant@google.com>
2457
2458 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2459 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2460 * configure: Regenerate.
2461 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2462 -fno-use-linker-plugin.
2463 (LINK1, CXXLINK1): Add it to the link command.
2464 * testsuite/Makefile.in: Regenerate.
2465
2466 2014-03-12 Alan Modra <amodra@gmail.com>
2467
2468 * Makefile.in: Regenerate.
2469
2470 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2471
2472 * symtab.h (Symbol::set_nonvis): New function.
2473
2474 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2475
2476 * symtab.cc (Sized_symbol<32>::init_output_data):
2477 Instantiate the template.
2478 (Sized_symbol<64>::init_output_data): Likewise.
2479
2480 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2481
2482 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2483 adjust dynamic symbol value.
2484 * target.h (Target::adjust_dyn_symbol): New function.
2485 (Target::do_adjust_dyn_symbol): New function.
2486
2487 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2488
2489 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2490 Get the value of DYNAMIC_CUSTOM dynamic entry.
2491 * output.h (Output_data_dynamic::add_custom): New function.
2492 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2493 dynamic entry.
2494 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2495 * target.h (Target::dynamic_tag_custom_value): New function.
2496 (Target::do_dynamic_tag_custom_value): New function.
2497
2498 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2499
2500 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2501 dynsym indexes.
2502 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2503 (Target::do_has_custom_set_dynsym_indexes): New function.
2504 (Target::set_dynsym_indexes): New function.
2505 (Target::do_set_dynsym_indexes): New function.
2506
2507 2014-03-07 Alan Modra <amodra@gmail.com>
2508
2509 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2510 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2511 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2512 (Powerpc_relocate_functions::has_overflow_bitfield,
2513 overflowed): Use the above.
2514 (Target_powerpc::Relocate::relocate): Correct overflow checking
2515 for a number of relocations. Modify overflow test for 16-bit
2516 fields in instructions to signed/unsigned according to whether
2517 the field takes a signed or unsigned value.
2518
2519 2014-03-05 Alan Modra <amodra@gmail.com>
2520
2521 Update copyright years.
2522
2523 2014-03-05 Alan Modra <amodra@gmail.com>
2524
2525 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2526 R_PPC64_ADDR64_LOCAL.
2527 (Target_powerpc::Relocate::relocate): Likewise.
2528
2529 2014-03-03 Alan Modra <amodra@gmail.com>
2530
2531 * dwp.cc (print_version): Update copyright year to current.
2532
2533 2014-02-10 Alan Modra <amodra@gmail.com>
2534
2535 * po/gold.pot: Regenerate.
2536
2537 2014-02-06 Cary Coutant <ccoutant@google.com>
2538
2539 Fix problem where -u is ignored when a weak undef is seen.
2540
2541 * archive.cc (Library_base::should_include_member): Reorder
2542 code to check for -u option if a weak undef has already been seen.
2543 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2544 * testsuite/Makefile.in: Regenerate.
2545 * testsuite/weak_undef_file3.cc: New file.
2546 * testsuite/weak_undef_file4.cc: New file.
2547 * testsuite/weak_undef_test_2.cc: New file.
2548
2549 2014-02-05 Cary Coutant <ccoutant@google.com>
2550
2551 Fix issues with gold undefined symbol diagnostics.
2552
2553 PR binutils/15435
2554 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2555 check to here.
2556 * target-reloc.h (is_strong_undefined): New function.
2557 (relocate_section): Move undef vtable symbol check from here.
2558 Check for is_strong_undefined.
2559
2560 2014-02-05 Cary Coutant <ccoutant@google.com>
2561
2562 Fix problems with the --dynamic-list option.
2563
2564 PR gold/13577
2565 * options.cc (General_options::parse_dynamic_list):
2566 Set have_dynamic_list_.
2567 (General_options::General_options): Initialize have_dynamic_list_.
2568 (General_options::finalize): Turn off -Bsymbolic and
2569 -Bsymbolic-functions if --dynamic-list provided.
2570 * options.h (General_options::have_dynamic_list): New function.
2571 (General_options::have_dynamic_list_): New data member.
2572 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2573 correctly.
2574
2575 PR gold/16530
2576 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2577 in --dynamic-list, mark it.
2578
2579 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2580 (dynamic_list_2): New test case.
2581 * testsuite/Makefile.in: Regenerate.
2582 * testsuite/dynamic_list_2.cc: New file.
2583 * testsuite/dynamic_list_2.t: New file.
2584 * testsuite/dynamic_list_lib1.cc: New file.
2585 * testsuite/dynamic_list_lib2.cc: New file.
2586 * testsuite/gc_dynamic_list_test.c: New file.
2587 * testsuite/gc_dynamic_list_test.sh: New file.
2588 * testsuite/gc_dynamic_list_test.t: New file.
2589
2590 2014-01-28 Cary Coutant <ccoutant@google.com>
2591
2592 Add .gdb_index version 7 support.
2593
2594 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2595 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2596 debug sections.
2597 (Dwarf_ranges_table::read_ranges_table): Likewise.
2598 (Dwarf_pubnames_table::read_section): Check for GNU-style
2599 sections, and for compressed debug sections.
2600 (Dwarf_pubnames_table::read_header): Compute end address of table.
2601 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2602 for end of list by offset, not by offset == 0.
2603 (Dwarf_info_reader::do_read_string_table): Check for compressed
2604 debug sections.
2605 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2606 Initialize new data members.
2607 (Dwarf_pubnames_table::next_name): return flag_byte.
2608 (Dwarf_pubnames_table::end_of_table_): New data member.
2609 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2610 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2611 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2612 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2613 read skeleton type unit DIEs.
2614 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2615 (Gdb_index::do_write): Write flag_byte.
2616 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2617 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2618 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2619 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2620
2621 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2622
2623 * version.cc (print_version): Update copyright year to 2014.
2624
2625 2013-12-19 Dimitry Andric <dimitry@andric.com>
2626
2627 * stringpool.cc (Stringpool_template::reserve): Add
2628 HAVE_UNORDERED_MAP case.
2629 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2630
2631 2013-12-18 Cary Coutant <ccoutant@google.com>
2632
2633 * configure.ac: Check for <unordered_set> and <unordered_map>.
2634 * config.in: Regenerate.
2635 * configure: Regenerate.
2636 * system.h: Use <unordered_set> and <unordered_map> if available.
2637
2638 2013-12-10 Roland McGrath <mcgrathr@google.com>
2639
2640 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2641 with $(INSTALL_PROGRAM_ENV).
2642 * Makefile.in: Regenerate.
2643
2644 2013-11-22 Cary Coutant <ccoutant@google.com>
2645
2646 * configure.ac: Add check for which library is needed for
2647 dlopen.
2648 * configure: Regenerate.
2649
2650 2013-11-22 Cary Coutant <ccoutant@google.com>
2651
2652 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2653 assembler.
2654 * testsuite/Makefile.in: Regenerate.
2655
2656 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2657
2658 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2659 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2660 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2661 (Target_x86_64<size>::Scan::local): Likewise.
2662 (Target_x86_64<size>::Scan::global): Likewise.
2663 (Target_x86_64<size>::Relocate::relocate): Likewise.
2664 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2665 Likewise.
2666 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2667 R_X86_64_PC32_BND.
2668
2669 * testsuite/Makefile.am (check_PROGRAMS): Add
2670 exception_x86_64_bnd_test.
2671 (exception_x86_64_bnd_test_SOURCES): New macro.
2672 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2673 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2674 (exception_x86_64_bnd_test_LDADD): Likewise.
2675 (exception_x86_64_bnd_1.o): New rule.
2676 (exception_x86_64_bnd_2.o): Likewise.
2677 * testsuite/Makefile.in: Regenerated.
2678
2679 2013-11-15 Alan Modra <amodra@gmail.com>
2680
2681 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2682 accessor.
2683 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2684 Only call ppc64_local_entry_offset for 64-bit. Restrict
2685 symval_for_branch lookup to ELFv1.
2686 (Stub_table::add_plt_call_entry): Use unsigned int off.
2687 (Output_data_glink::Address, invalid_address): New.
2688 (Output_data_glink::add_eh_frame): Move out of line. Add
2689 support for ELFv2.
2690 (Output_data_glink::add_global_entry, find_global_entry,
2691 global_entry_address): New functions.
2692 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2693 ge_size): New variables.
2694 (Output_data_glink::set_final_data_size): Add global entry
2695 stub sizing.
2696 (Output_data_glink::do_write): Write global entry stubs.
2697 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2698 parameter. Return true for ELFv2. Adjust callers.
2699 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2700 ELFv1. Similarly for ifunc and dynamic relocation processing
2701 specific to ELFv1. Recognize that symbols are defined on
2702 their plt entries for ELFv2.
2703 (Target_powerpc::symval_for_branch): Assert if called for
2704 ELFv2 or ppc32.
2705 (Target_powerpc::Relocate::relocate): Use global entry plt
2706 stub for symbol value if such exists on ELFv2.
2707 (Target_powerpc::Relocate::relocate): Don't call
2708 symval_for_branch when ELFv2. Do adjust for local entry
2709 offset when ELFv2.
2710 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2711 plt stub for ELFv2.
2712 (Target_powerpc::do_plt_address_for_global): Similarly.
2713
2714 2013-11-14 Cary Coutant <ccoutant@google.com>
2715
2716 Revert patch -- this did not fix the problem, and there is
2717 no race there.
2718
2719 2013-11-14 Cary Coutant <ccoutant@google.com>
2720
2721 PR gold/14860
2722 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2723 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2724 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2725 updating fde_offsets_.
2726 (Eh_frame_hdr::lock_): New data member.
2727
2728 2013-11-14 Cary Coutant <ccoutant@google.com>
2729
2730 * dwp.cc (Dwo_file_entry): New type.
2731 (File_list): Use Dwo_file_entry.
2732 (Dwo_file::verify): New function.
2733 (Dwo_file::verify_dwo_list): New function.
2734 (Dwo_file::sized_verify_dwo_list): New function.
2735 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2736 list.
2737 (Dwp_options): New enum type.
2738 (dwp_options): Add --verify-only.
2739 (usage): Likewise.
2740 (main): Likewise.
2741 * dwp.h (gold_info): Add declaration.
2742
2743 2013-11-14 Cary Coutant <ccoutant@google.com>
2744
2745 PR gold/14860
2746 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2747 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2748 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2749 updating fde_offsets_.
2750 (Eh_frame_hdr::lock_): New data member.
2751
2752 2013-11-06 Cary Coutant <ccoutant@google.com>
2753
2754 PR gold/15758
2755 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2756 before reloc sections.
2757
2758 2013-11-04 Alan Modra <amodra@gmail.com>
2759
2760 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2761 (Symbol::needs_dynamic_reloc): Test new flag.
2762 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2763 (Target_powerpc::Scan::get_reference_flags): Add target param.
2764 Return FUNC_DESC_ABI for 64-bit ELFv1.
2765 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2766 call.
2767 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2768 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2769
2770 2013-10-31 Cary Coutant <ccoutant@google.com>
2771
2772 Restore support for dwp v2 DWARF package file format.
2773
2774 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2775 tu_length parameter. Adjust all callers.
2776 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2777 * dwp.cc: Include dwarf.h.
2778 (Section_bounds): New struct type.
2779 (Unit_set): New struct type.
2780 (Dwo_file::Dwo_file): Initialize new data member.
2781 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2782 Combine and rename to...
2783 (Dwo_file::read_unit_index): ...this.
2784 (Dwo_file::sized_read_compunit_index)
2785 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2786 (Dwo_file::sized_read_unit_index): ...this.
2787 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2788 parameters; add section_id parameter.
2789 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2790 (Dwo_file::add_unit_set): ...this.
2791 (Dwo_file::shndx_map_): Remove.
2792 (Dwo_file::sect_offsets_): New data member.
2793 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2794 (Dwp_output_file::add_section): Rename to...
2795 (Dwp_output_file::add_contribution): ...this.
2796 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2797 (Dwp_output_file::add_tu_set): Likewise.
2798 (Dwp_output_file::Contribution): New type.
2799 (Dwp_output_file::Section::contributions): New data member.
2800 (Dwp_output_file::Cu_or_tu_set): Remove.
2801 (Dwp_output_file::Section::Section): New ctor.
2802 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2803 (Dwp_output_file::Dwp_index::Section_table): New type.
2804 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2805 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2806 parameter.
2807 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2808 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2809 (Dwp_output_file::Dwp_index::section_table): New member function.
2810 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2811 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2812 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2813 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2814 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2815 (Dwp_output_file::Dwp_index::section_table_): New data member.
2816 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2817 (Dwp_output_file::add_output_section): New member function.
2818 (Dwp_output_file::write_new_section): New member function.
2819 (Dwp_output_file::write_contributions): New member function.
2820 (Dwp_output_file::section_id_map_): New data member.
2821 (class Dwo_id_info_reader): Remove.
2822 (class Unit_reader): New class.
2823 (get_dwarf_section_name): New function.
2824 (Dwo_file::read_executable): Adjust initializations of class data.
2825 (Dwo_file::read): Add support for v2 package file format.
2826 (Dwo_file::read_unit_index): Likewise.
2827 (Dwo_file::sized_read_unit_index): Likewise.
2828 (Dwo_file::copy_section): Likewise.
2829 (Dwo_file::add_unit_set): Likewise.
2830 (Dwp_output_file::add_output_section): Likewise.
2831 (Dwp_output_file::add_contribution): Likewise.
2832 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2833 for empty slot.
2834 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2835 file format.
2836 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2837 slot.
2838 (Dwp_output_file::initialize): Remove unused function.
2839 (Dwp_output_file::finalize): Add support for v2 package file format.
2840 (Dwp_output_file::write_index): Likewise.
2841 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2842 function prototype.
2843
2844 2013-10-31 Cary Coutant <ccoutant@google.com>
2845
2846 * configure.ac: Fix check for -fmerge-constants.
2847 * configure.ac: Regenerate.
2848
2849 2013-10-30 Roland McGrath <mcgrathr@google.com>
2850
2851 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2852 Correct 9-byte nop sequence to match what the assembler generates.
2853
2854 2013-10-30 Alan Modra <amodra@gmail.com>
2855
2856 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2857 ppc64_local_entry_offset, ppc64_local_entry_offset,
2858 do_read_symbols): New functions.
2859 (Powerpc_relobj::e_flags_, st_other_): New vars.
2860 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2861 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2862 (Powerpc_relobj::e_flags_): New var.
2863 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2864 and adjust for ELFv2.
2865 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2866 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2867 (Powerpc_dynobj::do_find_special_sections): Likewise.
2868 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2869 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2870 to ELFv2 local entry.
2871 (Target_powerpc::do_relax): No thread safe barriers needed for
2872 ELFv2.
2873 (Output_data_plt_powerpc::initial_plt_entry_size_,
2874 plt_entry_size): Delete. Replace all uses with
2875 first_plt_entry_offset() and plt_entry_size().
2876 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2877 reserved_size parm. Update callers.
2878 (Output_data_plt_powerpc::entry_count): Update.
2879 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2880 and use Target_powerpc::first_plt_entry_offset().
2881 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2882 rename to plt_entry_size.
2883 (Output_data_plt_powerpc::add_ifunc_entry,
2884 add_local_ifunc_entry): Adjust reloc for ELFv2.
2885 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2886 (glink_eh_frame_fde_64v2): New.
2887 (Stub_table::plt_call_size): Support ELFv2 sizing.
2888 (Output_data_glink::add_eh_frame): Use the new FDE.
2889 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2890 (Stub_table::do_write): Write ELFv2 stubs and glink.
2891 (Target_powerpc::Relocate::relocate): Replaces nop after call
2892 with ld 2,24(1) and adjust local offset destination for ELFv2.
2893
2894 2013-10-30 Alan Modra <amodra@gmail.com>
2895
2896 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2897 (Target_powerpc::Scan::global, local): Likewise.
2898 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2899 on all ppc64 @h and @ha relocs.
2900
2901 2013-10-14 Alan Modra <amodra@gmail.com>
2902
2903 * output.h (Output_data_got::add_constant): Tidy.
2904 (Output_data_got::add_constant_pair): New function.
2905 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2906 methods used so as to first call reserve_ent().
2907
2908 2013-10-11 Roland McGrath <mcgrathr@google.com>
2909
2910 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2911 add_got_entry and add_got_entry_pair.
2912
2913 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2914 (HAVE_PUBNAMES): Likewise.
2915 * configure: Regenerate.
2916
2917 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2918 * testsuite/Makefile.in: Regenerate.
2919
2920 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2921 Remove const from declaration.
2922 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2923 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2924 * output.h (Output_file_header): Remove const from member target_
2925 and corresponding constructor argument.
2926 * output.cc (Output_file_header::Output_file_header): Update prototype.
2927 (Output_file_header::do_sized_write): Use this->target_ in place
2928 of parameters()->target().
2929
2930 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2931
2932 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2933 * configure: Regenerate.
2934 * Makefile.in: Regenerate.
2935 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2936 * testsuite/merge_string_literals_2.c: Likewise.
2937 * testsuite/Makefile.am
2938 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2939 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2940 literal -fmerge-constants.
2941 * testsuite/Makefile.in: Regenerate.
2942
2943 * i386.cc (Target_i386): Remove unused member dynbss_.
2944 * arm.cc (Target_arm): Likewise.
2945 * powerpc.cc (Target_powerpc): Likewise.
2946 * sparc.cc (Target_sparc): Likewise.
2947 * tilegx.cc (Target_tilegx): Likewise.
2948 * x86_64.cc (Target_x86_64): Likewise.
2949 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2950 type_signature_, type_offset_.
2951 * plugin.h (Plugin_hook): Remove unused member layout_.
2952 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2953 mapfile_.
2954 (Read_member): Remove unused members input_objects_, symtab_,
2955 mapfile_, layout_.
2956 (Check_library): Remove unused member symtab_.
2957 * archive.h (Lib_group): Remove unused member lib_.
2958 * archive.cc (Lib_group::Lib_group): Update initializer.
2959 * incremental.h (Incremental_binary): Remove unused member target_.
2960 (Incremental_script_entry): Removed unused member script_.
2961 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2962 * icf.h (Icf): Remove unused member num_tracked_relocs.
2963
2964 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2965 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2966 its only use.
2967 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2968
2969 * archive.h: Use struct rather than class for forward declaration
2970 of Read_symbols_data.
2971
2972 2013-10-07 Cary Coutant <ccoutant@google.com>
2973
2974 PR gold/16010
2975 * testsuite/Makefile.am (icf_test): Fix dependencies.
2976 (icf_safe_test): Likewise.
2977 (icf_safe_so_test): Likewise.
2978 (large_symbol_alignment): Add empty _LDADD rule.
2979 * testsuite/Makefile.in: Regenerate.
2980
2981 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2982
2983 PR gold/15927
2984 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2985 relocation for R_X86_64_32 on x32.
2986
2987 2013-08-27 Roland McGrath <mcgrathr@google.com>
2988
2989 * output.cc (Output_segment::set_section_addresses): Take new
2990 Target* argument. If target->isolate_execinstr() and the segment
2991 is executable and starts at a target->abi_pagesize() boundary,
2992 pad its end out to a target->abi_pagesize() boundary with code fill.
2993 * output.h (Output_segment::set_section_addresses): Update decl.
2994 * layout.h (Layout::check_output_data_for_reset_values): Take new
2995 argument RELAX_OUTPUTS.
2996 (Layout): New member relax_output_list_.
2997 (Layout::add_relax_output): New method.
2998 * layout.cc (Layout::Layout): Update constructor.
2999 (Layout::reset_relax_output): New method.
3000 (Layout::clean_up_after_relaxation): Call it.
3001 (Layout::prepare_for_relaxation): Update caller.
3002 (Layout::set_segment_offsets): Update callers of set_section_addresses.
3003 Call reset_relax_output before re-processing segments for
3004 isolate_execinstr case.
3005 (Layout::write_data): Handle relax_output_list_.
3006 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
3007 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
3008
3009 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
3010
3011 PR binutils/15834
3012 * object.h: Fix typos.
3013
3014 2013-08-16 Roland McGrath <mcgrathr@google.com>
3015
3016 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
3017 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
3018
3019 2013-08-07 Cary Coutant <ccoutant@google.com>
3020
3021 Revert support for v2 DWP files:
3022
3023 2013-03-01 Cary Coutant <ccoutant@google.com>
3024
3025 Add dwp support for v2 DWARF package file format.
3026 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3027 tu_length parameter. Adjust all callers.
3028 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3029 * dwp.cc: Include dwarf.h.
3030 (Section_bounds): New struct type.
3031 (Unit_set): New struct type.
3032 (Dwo_file::Dwo_file): Initialize new data member.
3033 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3034 Combine and rename to...
3035 (Dwo_file::read_unit_index): ...this.
3036 (Dwo_file::sized_read_compunit_index)
3037 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3038 (Dwo_file::sized_read_unit_index): ...this.
3039 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3040 parameters; add section_id parameter.
3041 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3042 (Dwo_file::add_unit_set): ...this.
3043 (Dwo_file::shndx_map_): Remove.
3044 (Dwo_file::sect_offsets_): New data member.
3045 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3046 (Dwp_output_file::add_section): Rename to...
3047 (Dwp_output_file::add_contribution): ...this.
3048 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3049 (Dwp_output_file::add_tu_set): Likewise.
3050 (Dwp_output_file::Contribution): New type.
3051 (Dwp_output_file::Section::contributions): New data member.
3052 (Dwp_output_file::Cu_or_tu_set): Remove.
3053 (Dwp_output_file::Section::Section): New ctor.
3054 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3055 (Dwp_output_file::Dwp_index::Section_table): New type.
3056 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3057 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3058 parameter.
3059 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3060 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3061 (Dwp_output_file::Dwp_index::section_table): New member function.
3062 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3063 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3064 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3065 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3066 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3067 (Dwp_output_file::Dwp_index::section_table_): New data member.
3068 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3069 (Dwp_output_file::add_output_section): New member function.
3070 (Dwp_output_file::write_new_section): New member function.
3071 (Dwp_output_file::write_contributions): New member function.
3072 (Dwp_output_file::section_id_map_): New data member.
3073 (class Dwo_id_info_reader): Remove.
3074 (class Unit_reader): New class.
3075 (get_dwarf_section_name): New function.
3076 (Dwo_file::read_executable): Adjust initializations of class data.
3077 (Dwo_file::read): Add support for v2 package file format.
3078 (Dwo_file::read_unit_index): Likewise.
3079 (Dwo_file::sized_read_unit_index): Likewise.
3080 (Dwo_file::copy_section): Likewise.
3081 (Dwo_file::add_unit_set): Likewise.
3082 (Dwp_output_file::add_output_section): Likewise.
3083 (Dwp_output_file::add_contribution): Likewise.
3084 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3085 for empty slot.
3086 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3087 file format.
3088 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3089 slot.
3090 (Dwp_output_file::initialize): Remove unused function.
3091 (Dwp_output_file::finalize): Add support for v2 package file format.
3092 (Dwp_output_file::write_index): Likewise.
3093 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3094 function prototype.
3095
3096 2013-07-31 Cary Coutant <ccoutant@google.com>
3097
3098 * object.cc (Sized_relobj::do_output_section_address): New function.
3099 (Sized_relobj): Instantiate explicitly.
3100 * object.h (Object::output_section_address): New function.
3101 (Object::do_output_section_address): New function.
3102 (Sized_relobj::do_output_section_address): New function.
3103 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
3104
3105 2013-07-30 Cary Coutant <ccoutant@google.com>
3106 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
3107
3108 * parameters.cc (Parameters::entry): Return target-specific entry
3109 symbol name.
3110 * target.h (Target::entry_symbol_name): New function.
3111 (Target_info::entry_symbol_name): New data member.
3112
3113 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
3114 * i386.cc (Target_i386::i386_info): Likewise.
3115 (Target_i386_nacl::i386_nacl_info): Likewise.
3116 * sparc.cc (Target_sparc::sparc_info): Likewise.
3117 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
3118 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
3119 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
3120 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3121
3122 2013-07-22 Sterling Augustine <saugustine@google.com>
3123
3124 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
3125 Convert parameter shndx to local variable. Add parameters symtab
3126 and symtab_size. Scan over section names. Find relocation
3127 section corresponding to current section. Create and initialize
3128 reloc_mapper_ and reloc_type_.
3129 (Dwarf_pubnames_table::read_header): Add assertion. Change
3130 unit_length to off_t. Initialize member unit_length_. Fill in field
3131 cu_offset_.
3132 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3133 Initialize new fields unit_length_ and cu_offset_.
3134 (Dwarf_pubnames_table::read_section): Update prototype.
3135 (Dwarf_pubnames_table::cu_offset): New member function.
3136 (Dwarf_pubnames_table::subsection_size): Likewise.
3137 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3138 New fields.
3139 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3140 member functions public.
3141 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3142 Update comment. Rework logic. Move repeated parts to...
3143 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3144 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3145 pubtypes_table_, and stmt_list_offset.
3146 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3147 Gdb_index::find_pubtype_offset,
3148 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3149 (Gdb_index::pubnames_read): Update prototype and rework logic.
3150 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3151 Forward declare.
3152 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3153 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3154 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3155 Gdb_index::map_pubtable_to_dies):
3156 Declare functions.
3157 (Gdb_index::pubnames_read): Update declaration.
3158 (Gdb_index::Pubname_offset_map): New type.
3159 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3160 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3161 Gdb_index::stmt_list_offset): Declare.
3162 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3163 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3164 Gdb_index::pubtypes_offset_): Remove.
3165
3166 2013-07-19 Roland McGrath <mcgrathr@google.com>
3167
3168 * options.h (General_options): Add -Trodata-segment option.
3169 * parameters.cc (Parameters::check_rodata_segment): New function.
3170 (Parameters::set_target_once): Call it.
3171 * parameters.h (Parameters): Declare it (private member function).
3172 * layout.cc (load_seg_unusable_for_headers): New function, broken
3173 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3174 then validate rodata segment rather than text segment.
3175 (relaxation_loop_body): Call that.
3176 (is_text_segment): New function. Don't admit a non-executable
3177 segment if TARGET->isolate_execinstr().
3178 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3179
3180 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
3181
3182 PR gold/15070
3183 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3184 * nacl.h (Sniff_file::View::View): Request aligned view.
3185
3186 2013-07-11 Cary Coutant <ccoutant@google.com>
3187
3188 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3189 correct BRLT entry size.
3190
3191 2013-07-03 Alan Modra <amodra@gmail.com>
3192
3193 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3194 comment.
3195
3196 2013-07-01 Cary Coutant <ccoutant@google.com>
3197
3198 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3199 reloc_type_.
3200 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3201 (Dwarf_ranges_table::lookup_reloc): New function.
3202 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3203 reloc_type_.
3204 (Dwarf_ranges_table::lookup_reloc): New function.
3205 (Dwarf_ranges_table::reloc_type_): New data member.
3206
3207 2013-06-27 Jing Yu <jingyu@google.com>
3208
3209 PR gold/15662
3210 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3211 function.
3212 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3213 (Target_powerpc::do_relax): Call the above.
3214
3215 2013-06-27 Cary Coutant <ccoutant@google.com>
3216
3217 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3218 on garbage collected .opd section.
3219
3220 2013-06-27 Alan Modra <amodra@gmail.com>
3221
3222 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3223 is non-zero.
3224 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3225 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3226
3227 2013-06-14 Cary Coutant <ccoutant@google.com>
3228
3229 * resolve.cc (Symbol::override_base): Don't override st_type
3230 from plugin placeholder symbols.
3231 (Symbol_table::resolve): Likewise.
3232 (Symbol_table::should_override): Don't complain about TLS mismatch
3233 if the TO symbol is a plugin placeholder.
3234 * testsuite/Makefile.am (plugin_test_tls): New test.
3235 * testsuite/Makefile.in: Regenerate.
3236 * testsuite/plugin_test_tls.sh: New test script.
3237 * testsuite/two_file_test_2_tls.cc: New test source.
3238 * testsuite/two_file_test_tls.cc: New test source.
3239
3240 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3241
3242 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3243 the maximum segment alignment is larger than the page size.
3244 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3245 correctly aligns the symbols with large alignemnt.
3246 * testsuite/Makefile.in: Regenerate.
3247 * testsuite/large_symbol_alignment.cc: New file.
3248
3249 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3250 Sriraman Tallam <tmsriram@google.com>
3251
3252 * options.h (sort_section): New option.
3253 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3254 Rename from Input_section_sort_section_name_special_ordering_compare.
3255 (Input_section_sort_section_name_compare): New struct.
3256 * output.cc (Output_section::Input_section_sort_section_name_compare::
3257 operator()): New function.
3258 (Output_section::sort_attached_input_sections): Use new sort function
3259 for .text if --sort-section=name is specified.
3260 * layout.cc (Layout::make_output_section):
3261 Add sorting by name when --sort-section=name is specified.
3262 * testsuite/Makefile.am (text_section_grouping): Test option
3263 --sort-section=name.
3264 * testsuite/Makefile.in: Regenerate.
3265 * testsuite/section_sorting_name.cc: New file.
3266 * testsuite/section_sorting_name.sh: New file.
3267
3268 2013-05-21 Cary Coutant <ccoutant@google.com>
3269
3270 * symtab.h (Symbol::is_cxx_vtable): New function.
3271 * target-reloc.h (relocate_section): Check for vtable symbol.
3272 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3273 * testsuite/Makefile.in: Regenerate.
3274 * testsuite/missing_key_func.cc: New test source.
3275 * testsuite/missing_key_func.sh: New test script.
3276
3277 2013-05-21 Cary Coutant <ccoutant@google.com>
3278
3279 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3280 type of enclosing symbol.
3281 (Relocate_info::location): Check symbol type when describing symbol.
3282 * object.h (Symbol_location_info): Remove unused line_number;
3283 add enclosing_symbol_type.
3284 * testsuite/debug_msg.sh: Adjust expected output.
3285
3286 2013-05-13 Cary Coutant <ccoutant@google.com>
3287
3288 * configure.ac: Export DEFAULT_TARGET.
3289 * configure: Regenerate.
3290 * Makefile.in: Regenerate.
3291 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3292 * testsuite/Makefile.in: Regenerate.
3293 * testsuite/debug_msg.sh: Delete duplicate tests.
3294 Don't check undef_int error message match for powerpc where the
3295 source file and line number aren't available.
3296
3297 2013-05-10 Roland McGrath <mcgrathr@google.com>
3298
3299 * options.h (General_options): Add --rosegment-gap option.
3300 * options.cc (finalize): --rosegment-gap implies --rosegment.
3301 * layout.cc (set_segment_offsets): Let user option override
3302 target->rosegment_gap().
3303
3304 2013-05-10 Roland McGrath <mcgrathr@google.com>
3305
3306 * options.h (General_options): Remove leading space from help
3307 messages for -nostdlib and --rosegment.
3308
3309 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3310
3311 PR ld/15365
3312 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3313
3314 2013-05-03 Alan Modra <amodra@gmail.com>
3315
3316 * merge.cc (Output_merge_string::do_add_input_section): Correct
3317 scan for number of strings. Rename vars to avoid shadowing.
3318 Include missing terminator in input_size_.
3319
3320 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3321
3322 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3323 Restore empty string handling.
3324
3325 2013-05-01 Cary Coutant <ccoutant@google.com>
3326
3327 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3328 uninitialized warning.
3329
3330 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3331
3332 * output.cc (Output_section::add_merge_input_section): Allow
3333 to merge sections if the alignment is more than character size.
3334 * merge.h (Output_merge_string::Output_merge_string): Remove
3335 assert.
3336 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3337 only not-null strings. Check the alignment of strings.
3338 * stringpool.h
3339 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3340 alignment as the argument.
3341 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3342 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3343 Align non-zero length strings according to the addralign_.
3344 (Stringpool_template<Stringpool_char>::set_string_offsets):
3345 Updating offsets according to the given alignment.
3346 * testsuite/Makefile.am (text_section_grouping): Test if string
3347 literals are getting merged.
3348 * testsuite/Makefile.in: Regenerate.
3349 * testsuite/merge_string_literals_1.c: New file.
3350 * testsuite/merge_string_literals_2.c: Ditto.
3351 * testsuite/merge_string_literals.sh: Ditto.
3352
3353 2013-04-26 Ian Lance Taylor <iant@google.com>
3354
3355 * target-reloc.h (relocate_section): If the reloc offset is out of
3356 range, pass VIEW as NULL to relocate.relocate.
3357 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3358 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3359 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3360 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3361 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3362 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3363
3364 2013-04-26 Geoff Pike <gpike@chromium.org>
3365
3366 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3367 * layout.cc (Hash_task): New class.
3368 (Layout::queue_build_id_tasks): New function.
3369 (Layout::write_build_id): Handle single-thread portion of build ID
3370 computation. (In some cases, all of it is single-threaded.) Replace
3371 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3372 functionality in fewer lines of code.
3373 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3374 * options.h (General_options): make "--build-id" default to tree
3375 rather than sha1. Add two new options related to --build-id=tree:
3376 --build-id-chunk-size-for-treehash and
3377 --build-id-min-file-size-for-treehash.
3378 * Makefile.am: add testing of --build-id=tree and related new options
3379 (these tests will be invoked by "make check").
3380 * Makefile.in: Regenerate.
3381
3382 2013-04-25 Alan Modra <amodra@gmail.com>
3383
3384 * configure.tgt: Add powerpcle and powerpc64le.
3385
3386 2013-04-22 Alan Modra <amodra@gmail.com>
3387
3388 PR gold/15355
3389 * layout.cc (Layout::segment_precedes): Allow more than one
3390 segment with the same type and flags.
3391
3392 2013-04-15 Cary Coutant <ccoutant@google.com>
3393
3394 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3395 allocate space in file for BSS sections.
3396
3397 2013-04-15 Cary Coutant <ccoutant@google.com>
3398
3399 * script-sections.cc (Orphan_output_section): Reset address
3400 to zero after each orphaned section for relocatable links.
3401
3402 2013-04-15 Cary Coutant <ccoutant@google.com>
3403
3404 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3405 section starting address for relocatable link.
3406 * testsuite/Makefile.am (script_test_11): New test.
3407 * testsuite/Makefile.in: Regenerate.
3408 * testsuite/script_test_11.c: New source file.
3409 * testsuite/script_test_11.t: New linker script.
3410
3411 2013-04-13 Alan Modra <amodra@gmail.com>
3412
3413 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3414 owner when sections are not adjacent and exceed group size.
3415 (Target_powerpc::group_sections): Handle corner case.
3416 (Target_powerpc::Branch_info::make_stub): Handle case where
3417 stub table doesn't exist due to branches in non-exec sections.
3418 (Target_powerpc::Relocate::relocate): Likewise.
3419
3420 2013-04-11 Alan Modra <amodra@gmail.com>
3421
3422 PR gold/15354
3423 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3424 .branch_lt to match bfd ld. Adjust comments throughout file.
3425
3426 2013-04-04 Ian Lance Taylor <iant@google.com>
3427
3428 GCC PR c++/56840
3429 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3430 sections before checking whether they are included in the link.
3431
3432 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3433
3434 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3435 object before calling the plugin claim_file handler. Pass the elf
3436 object of the archive to the plugin. Delete the elf object if the
3437 plugin claims the file.
3438
3439 2013-03-21 Alan Modra <amodra@gmail.com>
3440
3441 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3442 segment when omagic.
3443
3444 2013-03-21 Alan Modra <amodra@gmail.com>
3445
3446 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3447 comparison warning.
3448 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3449 uninitialized" warning.
3450
3451 2013-03-20 Alan Modra <amodra@gmail.com>
3452
3453 * symtab.h (Symbol::clear_version): New function.
3454 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3455 is_needed by weak references. Clear version for symbols defined
3456 in as-needed objects that are not needed.
3457
3458 2013-03-15 Alan Modra <amodra@gmail.com>
3459
3460 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3461 static and public. Add report_err param. Return false for data refs.
3462 (Target_powerpc::rela_dyn_section): New overloaded function.
3463 (Target_powerpc::plt_, iplt_): Elucidate.
3464 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3465 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3466 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3467 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3468 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3469 push_branch and make_plt_entry for ifunc syms when
3470 reloc_needs_plt_for_ifunc.
3471 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3472 for ifunc unless reloc_needs_plt_for_ifunc.
3473
3474 2013-03-15 Alan Modra <amodra@gmail.com>
3475
3476 * gc.h (gc_process_relocs): Don't look through function descriptors.
3477 * icf.cc (get_section_contents): Do so here instead.
3478
3479 2013-03-13 Alan Modra <amodra@gmail.com>
3480
3481 * powerpc.cc (is_branch_reloc): Forward declare.
3482 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3483 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3484 false for 64-bit, true for 32-bit non-branch relocs.
3485 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3486 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3487 nm output.
3488 (icf_safe_test): Generate linker map file as well as nm output.
3489 (icf_safe_so_test): Likewise.
3490 * testsuite/Makefile.in: Regenerate.
3491 * testsuite/icf_test.sh: Parse linker map file to determine
3492 section folding.
3493 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3494 * testsuite/icf_safe_so_test.sh: Likewise.
3495 (X86_32_or_ARM_specific_safe_fold): Merge into..
3496 (arch_specific_safe_fold): ..this.
3497 (X86_64_specific_safe_fold): Delete unused function.
3498
3499 2013-03-12 Alan Modra <amodra@gmail.com>
3500
3501 * gc.h (gc_process_relocs): Look through function descriptors
3502 to determine shndx, symvalue and addend used by ICF. Tidy
3503 variable duplication.
3504
3505 2013-03-11 Alan Modra <amodra@gmail.com>
3506
3507 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3508 * layout.cc (Layout_task_runner::run): ..to here.
3509 * symtab.h (struct Symbol_location): Extract from..
3510 (class Symbol_table): ..here.
3511 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3512 * target.h (class Target): Add function_location and
3513 do_function_location functions.
3514 (class Sized_target): Add do_function_location.
3515 * object.h (class Sized_relobj_file): Move find_shdr..
3516 (class Object): ..to here.
3517 * object.cc: Likewise. Update to suit. Instantiate.
3518 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3519 * powerpc.cc (class Powerpc_dynobj): New.
3520 (Target_powerpc::do_function_location): New function.
3521 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3522 (Powerpc_dynobj::do_read_symbols): New function.
3523 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3524
3525 2013-03-08 Ian Lance Taylor <iant@google.com>
3526
3527 * options.cc (General_options::string_to_object_format): Accept
3528 "default".
3529
3530 2013-03-08 Alan Modra <amodra@gmail.com>
3531
3532 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3533 pointer to Post_fde.
3534 (struct Post_fde): Move definition to here..
3535 * ehframe.cc (struct Post_fde): ..from here.
3536 (Cie::write): Don't alloc Post_fde.
3537 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3538
3539 2013-03-07 Alan Modra <amodra@gmail.com>
3540
3541 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3542 relocation referencing .LC0.
3543 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3544
3545 2013-03-07 Alan Modra <amodra@gmail.com>
3546
3547 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3548 always_inline. Add assembly for powerpc to avoid GOT.
3549
3550 2013-03-07 Alan Modra <amodra@gmail.com>
3551
3552 * testsuite/script_test_10.sh: Don't test .bss section
3553 header number.
3554
3555 2013-03-06 Alan Modra <amodra@gmail.com>
3556
3557 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3558 (Target_powerpc::symval_for_branch): Add symtab param. Update
3559 all callers. Handle folded sections.
3560 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3561 to Powerpc_relobj.
3562 (Global_symbol_visitor_opd::operator()): Likewise.
3563
3564 2013-03-04 Alan Modra <amodra@gmail.com>
3565
3566 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3567 * testsuite/Makefile.in: Regenerate.
3568
3569 2013-03-01 Cary Coutant <ccoutant@google.com>
3570
3571 Add dwp support for v2 DWARF package file format.
3572 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3573 tu_length parameter. Adjust all callers.
3574 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3575 * dwp.cc: Include dwarf.h.
3576 (Section_bounds): New struct type.
3577 (Unit_set): New struct type.
3578 (Dwo_file::Dwo_file): Initialize new data member.
3579 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3580 Combine and rename to...
3581 (Dwo_file::read_unit_index): ...this.
3582 (Dwo_file::sized_read_compunit_index)
3583 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3584 (Dwo_file::sized_read_unit_index): ...this.
3585 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3586 parameters; add section_id parameter.
3587 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3588 (Dwo_file::add_unit_set): ...this.
3589 (Dwo_file::shndx_map_): Remove.
3590 (Dwo_file::sect_offsets_): New data member.
3591 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3592 (Dwp_output_file::add_section): Rename to...
3593 (Dwp_output_file::add_contribution): ...this.
3594 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3595 (Dwp_output_file::add_tu_set): Likewise.
3596 (Dwp_output_file::Contribution): New type.
3597 (Dwp_output_file::Section::contributions): New data member.
3598 (Dwp_output_file::Cu_or_tu_set): Remove.
3599 (Dwp_output_file::Section::Section): New ctor.
3600 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3601 (Dwp_output_file::Dwp_index::Section_table): New type.
3602 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3603 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3604 parameter.
3605 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3606 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3607 (Dwp_output_file::Dwp_index::section_table): New member function.
3608 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3609 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3610 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3611 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3612 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3613 (Dwp_output_file::Dwp_index::section_table_): New data member.
3614 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3615 (Dwp_output_file::add_output_section): New member function.
3616 (Dwp_output_file::write_new_section): New member function.
3617 (Dwp_output_file::write_contributions): New member function.
3618 (Dwp_output_file::section_id_map_): New data member.
3619 (class Dwo_id_info_reader): Remove.
3620 (class Unit_reader): New class.
3621 (get_dwarf_section_name): New function.
3622 (Dwo_file::read_executable): Adjust initializations of class data.
3623 (Dwo_file::read): Add support for v2 package file format.
3624 (Dwo_file::read_unit_index): Likewise.
3625 (Dwo_file::sized_read_unit_index): Likewise.
3626 (Dwo_file::copy_section): Likewise.
3627 (Dwo_file::add_unit_set): Likewise.
3628 (Dwp_output_file::add_output_section): Likewise.
3629 (Dwp_output_file::add_contribution): Likewise.
3630 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3631 for empty slot.
3632 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3633 file format.
3634 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3635 slot.
3636 (Dwp_output_file::initialize): Remove unused function.
3637 (Dwp_output_file::finalize): Add support for v2 package file format.
3638 (Dwp_output_file::write_index): Likewise.
3639 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3640 function prototype.
3641
3642 2013-03-01 Cary Coutant <ccoutant@google.com>
3643
3644 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3645 function into class definition in header file.
3646 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3647 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3648 New function.
3649 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3650
3651 2013-02-28 Alan Modra <amodra@gmail.com>
3652
3653 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3654 * target.cc (Target::do_plt_fde_location): New function.
3655 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3656 accessor function, and constructor param.
3657 (struct Post_fde, Post_fdes): Declare.
3658 (Cie::write): Add post_fdes param.
3659 * ehframe.cc (Fde::write): Use plt_fde_location.
3660 (struct Post_fde): Define.
3661 (Cie::write): Stash FDEs added post merge mapping.
3662 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3663 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3664 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3665 other FDEs.
3666 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3667 (Target_powerpc::has_glink): New function.
3668 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3669 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3670 glink_eh_frame_fde_32, default_fde): New data.
3671 (Stub_table::eh_frame_added_): New var.
3672 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3673 Make const.
3674 (Stub_table::add_eh_frame): New function.
3675 (Output_data_glink::add_eh_frame): New function.
3676 (Target_powerpc::make_glink_section): Call add_eh_frame.
3677
3678 2013-02-15 Ian Lance Taylor <iant@google.com>
3679
3680 * options.h (DEFINE_uint64_alias): Define.
3681 (class General_options): Add -Ttext-segment as an alias for
3682 -Ttext.
3683
3684 2013-02-15 Alan Modra <amodra@gmail.com>
3685
3686 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3687 (Stub_table::do_write): ..here, two places.
3688 (Stub_table::plt_call_size): Use it here too.
3689
3690 2013-02-11 Ian Lance Taylor <iant@google.com>
3691
3692 * descriptors.cc (Descriptors::close_all): New function.
3693 * descriptors.h (class Descriptors): Declare close_all.
3694 (close_all_descriptors): New inline function.
3695 * plugin.cc: Include "descriptors.h".
3696 (Plugin_manager::cleanup): Call close_all_descriptors.
3697
3698 2013-02-06 Alan Modra <amodra@gmail.com>
3699
3700 * README: Update coding style link.
3701
3702 2013-01-28 Cary Coutant <ccoutant@google.com>
3703
3704 * dwp.cc (File_list): New typedef.
3705 (Dwo_name_info_reader): New class.
3706 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3707 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3708 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3709 (Dwo_file::read_executable): New function.
3710 (Dwo_file::read): Move common setup code to ...
3711 (Dwo_file::make_object): ... here.
3712 (dwp_options): Add --exec/-e.
3713 (usage): Likewise.
3714 (main): Likewise.
3715
3716 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3717
3718 * layout.cc (Layout::layout): Check for option text_reorder.
3719 (Layout::make_output_section): Ditto.
3720 * options.h (text_reorder): New option.
3721 * output.cc (Input_section_sort_compare): Remove special ordering
3722 of section names.
3723 (Output_section::
3724 Input_section_sort_section_name_special_ordering_compare::
3725 operator()): New function.
3726 (Output_section::sort_attached_input_sections): Use new sort function
3727 for .text.
3728 * output.h (Input_section_sort_section_name_special_ordering_compare):
3729 New struct.
3730 * testsuite/Makefile.am (text_section_grouping): Test option
3731 --no-text-reorder
3732 * testsuite/Makefile.in: Regenerate.
3733 * testsuite/text_section_grouping.sh: Check order of functions without
3734 default text reordering.
3735
3736 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3737
3738 * options.h (General_options): Change default to true for new_dtags.
3739
3740 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3741
3742 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3743 when enable_new_dtags is false. Only add DT_RUNPATH when
3744 enable_new_dtags is true.
3745
3746 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3747
3748 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3749 used in declaration and definition consistent.
3750 (Target_powerpc::symval_for_branch): Ditto.
3751
3752 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3753
3754 * testsuite/plugin_final_layout.cc: Fix comment.
3755
3756 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3757
3758 * layout.cc (Layout::layout): Do not do default sorting for
3759 text sections when section ordering is specified.
3760 (make_output_section): Ditto.
3761 * testsuite/plugin_final_layout.cc: Name the function sections
3762 to catch reordering issues.
3763
3764 2013-01-15 Alan Modra <amodra@gmail.com>
3765
3766 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3767 plt-thread-safe.
3768
3769 2013-01-15 Alan Modra <amodra@gmail.com>
3770
3771 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3772 * testsuite/Makefile.in: Regenerate.
3773
3774 2013-01-14 Alan Modra <amodra@gmail.com>
3775
3776 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3777 * testsuite/Makefile.in: Regenerate.
3778
3779 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3780
3781 PR bfd/14430
3782 Fix mingw gold build with plugins enabled
3783 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3784 * configure.ac: Export DLOPEN_LIBS and add headers check.
3785 * plugin.cc: Handle non-dlfcn case.
3786 * Makefile.in: Regenerate.
3787 * config.in: Regenerate.
3788 * configure: Regenerate.
3789 * testsuite/Makefile.in: Regenerate.
3790
3791 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3792
3793 * output.h (sort_attached_input_sections): Change to be public.
3794 * script-sections.cc
3795 (Output_section_definition::set_section_addresses): Sort
3796 attached input sections according to section order before linker
3797 script assigns section addresses.
3798 (Orphan_output_section::set_section_addresses): Sort
3799 attached input sections according to section order before linker
3800 script assigns section addresses.
3801 * Makefile.am (final_layout.sh): Use a simple linker script to
3802 check if section ordering still works.
3803 * Makefile.in: Regenerate.
3804
3805 2013-01-09 Ben Cheng <bccheng@google.com>
3806
3807 * arm.cc (Target_arm::attributes_accept_div): New function.
3808 (Target_arm::attributes_forbid_div): New function.
3809 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3810 attribute using the same new functions as what bfd/elf32_arm.c
3811 does.
3812
3813 2013-01-07 Cary Coutant <ccoutant@google.com>
3814
3815 PR gold/14993
3816 * output.cc (Output_section::add_input_section): For incremental
3817 updates, don't track input sections that are allocated from patch
3818 space.
3819
3820 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3821 Ian Lance Taylor <iant@google.com>
3822
3823 PR gold/14897
3824 * configure.ac (--enable-ld): Removed.
3825 (install_as_default): Set to yes only for --enable-gold=default
3826 or --disable-ld.
3827 * configure: Regenerated.
3828
3829 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3830
3831 * options.h (General_options): Add -fuse-ld= for GCC linker
3832 option compatibility.
3833
3834 2013-01-04 Cary Coutant <ccoutant@google.com>
3835
3836 * configure.ac: Fix typo restoring CXXFLAGS.
3837 * configure: Regenerate.
3838
3839 2013-01-04 Cary Coutant <ccoutant@google.com>
3840
3841 * testsuite/Makefile.am (CXXLINK_S): New macro.
3842 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3843 * testsuite/Makefile.in: Regenerate.
3844
3845 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3846
3847 * version.cc (print_version): Update copyright year to 2013.
3848
3849 2012-12-20 Ian Lance Taylor <iant@google.com>
3850
3851 * layout.cc (Layout::special_ordering_of_input_section): New
3852 function.
3853 (Layout::layout): If input section requires special ordering, must
3854 sort input sections.
3855 (Layout::make_output_section): May sort .text input sections.
3856 (Layout::is_section_name_prefix_grouped): Remove.
3857 * layout.h (class Layout): Declare
3858 special_ordering_of_input_section. Don't declare
3859 is_section_name_prefix_grouped.
3860 * output.cc (Output_section::add_input_section): Revert last
3861 change.
3862 (Output_section::Input_section_sort::match_file_name): Don't crash
3863 if called on output section data.
3864 (Output_section::Input_section_sort_compare): Sort based on
3865 special ordering.
3866 (Output_section::Input_section_sort_section_order_index_compare):
3867 Revert last patch.
3868 (Output_section::sort_attached_input_sections): Likewise.
3869
3870 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3871
3872 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3873 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3874 * output.cc (Output_section::add_input_section): Check if section
3875 name contains special prefix. Keep input sections to sort such
3876 sections.
3877 (Output_section::Input_section_sort_section_order_index_compare
3878 ::operator()): Group sections according to prefixes.
3879 (Output_section::sort_attached_input_sections): Add condition to
3880 Input_section_entry constructor call.
3881 * testsuite/Makefile.am (text_section_grouping): New test.
3882 * testsuite/Makefile.in: Regenerate.
3883 * testsuite/text_section_grouping.cc: New file.
3884 * testsuite/text_section_grouping.sh: New file.
3885
3886 2012-12-17 Nick Clifton <nickc@redhat.com>
3887
3888 * Makefile.am: Add copyright notice.
3889 * NEWS: Likewise.
3890 * README: Likewise.
3891 * configure.ac: Likewise.
3892 * ftruncate.c: Likewise.
3893 * Makefile.in: Regenerate.
3894
3895 2012-12-14 Cary Coutant <ccoutant@google.com>
3896
3897 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3898 --no-as-needed flag.
3899 (exception_separate_shared_12_test): Likewise.
3900 (incremental_copy_test): Likewise.
3901 * testsuite/Makefile.in: Regenerate.
3902
3903 2012-12-14 Cary Coutant <ccoutant@google.com>
3904
3905 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3906 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3907
3908 2012-12-12 Alan Modra <amodra@gmail.com>
3909
3910 * powerpc.cc (class Track_tls): New.
3911 (class Relocate, class Scan): Inherit Track_tls.
3912 (Target_powerpc::Scan::local, global): Track tls optimization
3913 and avoid creating plt entry for __tls_get_addr if all uses
3914 are optimized away.
3915 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3916
3917 2012-12-12 Alan Modra <amodra@gmail.com>
3918
3919 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3920 Replace no_toc_optimize with toc_optimize.
3921 * output.h (Output_section::input_sections): Provide non-const variant.
3922 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3923 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3924 accessors.
3925 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3926 (class Sort_toc_sections): New.
3927 (Target_powerpc::do_finalize_sections): Sort toc sections.
3928 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3929
3930 2012-12-10 Roland McGrath <mcgrathr@google.com>
3931
3932 * testsuite/binary_unittest.cc (read_all): New function.
3933 (Sized_binary_test): Use it instead of ::read.
3934 * fileread.cc (do_read): Don't assume pread always reads the whole
3935 amount in a single call.
3936
3937 2012-12-10 Alan Modra <amodra@gmail.com>
3938
3939 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3940 Set EM_PPC64 or EM_PPC here.
3941 (Target_selector_powerpc::do_recognize): Delete.
3942
3943 2012-12-10 Alan Modra <amodra@gmail.com>
3944
3945 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3946 stub_table_.
3947 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3948
3949 2012-12-07 Roland McGrath <mcgrathr@google.com>
3950
3951 * testsuite/binary_unittest.cc (Sized_binary_test):
3952 Use open_descriptor rather than ::open.
3953
3954 2012-12-07 Alan Modra <amodra@gmail.com>
3955
3956 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3957 typedef and invalid_address constant.
3958 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3959 instantiate constants.
3960
3961 2012-12-06 Roland McGrath <mcgrathr@google.com>
3962
3963 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3964 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3965 * aclocal.m4: Regenerate.
3966 * configure: Regenerate.
3967 * Makefile.in: Regenerate.
3968 * testsuite/Makefile.in: Regenerate.
3969
3970 2012-12-07 Alan Modra <amodra@gmail.com>
3971
3972 * options.h (General_options): Add no_toc_optimize.
3973 * powerpc.cc (ok_lo_toc_insn): New function.
3974 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3975
3976 2012-12-06 Alan Modra <amodra@gmail.com>
3977
3978 * options.h (General_options): Add plt_align, plt_static_chain,
3979 plt_thread_safe. Update stub_group_size help text.
3980 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3981 for new plt_thread_safe_ var.
3982 (use_plt_offset): Correct comments.
3983 (Target_powerpc::do_relax): Look for thread creation symbols to
3984 determine default plt_thread_safe value. Clear plt call stubs
3985 as well as branch stubs each iteration.
3986 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3987 insn constants.
3988 (l, hi, ha, write_insn): Move earlier.
3989 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3990 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3991 plt stubs too.
3992 (Stub_table::update_size): Adjust.
3993 (Stub_table::prev_size, set_prev_size): Delete.
3994 (Stub_table::stub_align): Let --plt-align affect result.
3995 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3996 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3997 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3998 (Stub_table::do_write): Support more stub variants.
3999
4000 2012-12-04 Alan Modra <amodra@gmail.com>
4001
4002 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
4003 (Target_powerpc::do_define_standard_symbols): New function.
4004
4005 2012-12-03 Alan Modra <amodra@gmail.com>
4006
4007 * output.h: Formatting, whitespace.
4008
4009 2012-12-03 Alan Modra <amodra@gmail.com>
4010
4011 * layout.h (Layout::get_executable_sections): Declare.
4012 * layout.cc (Layout::get_executable_sections): New function.
4013 * arm.cc (Target_arm::group_sections): Use it.
4014 (Arm_output_section::group_sections): Delete now redundant test.
4015 * output.cc (Output_reloc::Output_reloc): Add is_relative.
4016 param to handle relative relocs.
4017 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
4018 (Output_data_reloc::add_absolute): Adjust.
4019 (Output_data_reloc::add_relative): New function.
4020 (Output_data::reset_data_size): New function.
4021 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
4022 (Output_section::set_addralign): New function.
4023 (Output_section::checkpoint_set_addralign): New function.
4024 (Output_section::clear_section_offsets_need_adjustment): New function.
4025 (Output_section::input_sections): Make public.
4026 * powerpc.cc (class Output_data_brlt_powerpc): New.
4027 (class Stub_table, class Stub_control): New.
4028 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
4029 stub_table_, set_stub_table, stub_table): New vectors and accessor
4030 functions.
4031 (Target_powerpc::do_may_relax, do_relax, push_branch,
4032 new_stub_table, stub_tables, brlt_section, group_sections,
4033 add_branch_lookup_table, find_branch_lookup_table,
4034 write_branch_lookup_table, make_brlt_section): New functions.
4035 (Target_powerpc::struct Sort_sections, class Branch_info): New.
4036 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
4037 branch_info_): New vars.
4038 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
4039 make call stubs here.
4040 (Output_data_glink): Remove all call stub handling from this class.
4041 (Target_powerpc::Scan::local, global): Save interesting branch
4042 relocs and relocs for ifunc. Adjust calls to plt entry functions.
4043 (Target_powerpc::do_finalize_sections): Only make reg save/restore
4044 functions on final link.
4045 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
4046 Handle long branch destinations too.
4047 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
4048 do_plt_address_for_local): Adjust lookup of plt call stubs.
4049
4050 2012-11-30 Alan Modra <amodra@gmail.com>
4051
4052 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
4053 relocs against protected symbols when building 32-bit shared libs.
4054
4055 2012-11-30 Alan Modra <amodra@gmail.com>
4056
4057 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
4058 param. Call got_section() to make .got. Update all callers
4059 and their callers and so on.
4060
4061 2012-11-30 Alan Modra <amodra@gmail.com>
4062
4063 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
4064 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
4065 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
4066 value if it already exists.
4067
4068 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
4069
4070 PR gold/14858
4071 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
4072
4073 2012-11-14 Roland McGrath <mcgrathr@google.com>
4074
4075 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
4076 than bfc instruction for data sandboxing.
4077
4078 2012-11-08 Alan Modra <amodra@gmail.com>
4079
4080 * po/POTFILES.in: Regenerate.
4081
4082 2012-11-05 Alan Modra <amodra@gmail.com>
4083
4084 * configure.ac: Apply 2012-09-10 change to config.in here.
4085 * configure: Regenerate.
4086
4087 2012-11-05 Alan Modra <amodra@gmail.com>
4088
4089 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
4090 (struct Opd_ent): Use "Address" rather than "Offset".
4091 (Output_data_got_powerpc::got_base_offset): Return Valtype.
4092 (Target_powerpc::got_section): Make public.
4093 (Target_powerpc::scan_relocs): Move code setting symbols..
4094 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
4095 Create _SDA_BASE_ only when referenced.
4096
4097 2012-11-02 Roland McGrath <mcgrathr@google.com>
4098
4099 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
4100 from last change.
4101
4102 2012-11-01 Roland McGrath <mcgrathr@google.com>
4103
4104 * target.h (Sized_target::relocate_relocs): Use Elf_Off
4105 for offset_in_output_section parameter.
4106 (Sized_target::relocate_special_relocatable): Likewise.
4107 * arm.cc (Target_arm::relocate_relocs): Likewise.
4108 (Target_arm::relocate_special_relocatable): Likewise.
4109 * i386.cc (Target_i386::relocate_relocs): Likewise.
4110 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
4111 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
4112 * target-reloc.h (relocate_relocs): Likewise.
4113 * testsuite/testfile.cc (Target_test): Likewise.
4114 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
4115 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
4116
4117 * system.h: Move inclusion of <clocale> to after <libintl.h> in
4118 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
4119
4120 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
4121 parameter, which is unused in the [!F_SETFD] case.
4122
4123 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
4124 SYMNDX to off_t before comparing it to this->data_size().
4125 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
4126 * incremental.cc (Output_section_incremental_inputs::do_write):
4127 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
4128
4129 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
4130
4131 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
4132
4133 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4134 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4135 in EABI_VER5.
4136
4137 2012-10-29 Cary Coutant <ccoutant@google.com>
4138
4139 * dwp.cc (usage): Add file and exit status parameters;
4140 add --help and --version options.
4141 (print_version): New function.
4142 (main): Add --help and --version options.
4143
4144 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4145
4146 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4147 final_layout_sequence.txt.
4148 * testsuite/Makefile.in: Regenerated.
4149
4150 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4151
4152 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4153 COMPILE generated by automake.
4154 (LINK1): Likewise.
4155 (CXXCOMPILE1): Likewise.
4156 (CXXLINK1): Likewise.
4157 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4158 (LINK): Likewise.
4159 (CXXCOMPILE): Likewise.
4160 (CXXLINK): Likewise.
4161 * testsuite/Makefile.in: Regenerated.
4162
4163 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4164
4165 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4166 on bad fwrite return.
4167
4168 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4169
4170 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4171 on val.
4172
4173 2012-10-23 Cary Coutant <ccoutant@google.com>
4174
4175 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4176 * testsuite/Makefile.in: Regenerate.
4177 * testsuite/dwp_test.h: New source file.
4178 * testsuite/dwp_test_1.cc: New source file.
4179 * testsuite/dwp_test_1.s: New source file.
4180 * testsuite/dwp_test_1.sh: New source file.
4181 * testsuite/dwp_test_1b.cc: New source file.
4182 * testsuite/dwp_test_1b.s: New source file.
4183 * testsuite/dwp_test_2.cc: New source file.
4184 * testsuite/dwp_test_2.s: New source file.
4185 * testsuite/dwp_test_2.sh: New source file.
4186 * testsuite/dwp_test_main.cc: New source file.
4187 * testsuite/dwp_test_main.s: New source file.
4188
4189 2012-10-23 Cary Coutant <ccoutant@google.com>
4190
4191 * dwp.h: New header file.
4192 * dwp.cc: New source file.
4193 * gold.h: Move shared declarations to system.h.
4194 * system.h: New header file.
4195 * Makefile.am: Add dwp.
4196 * Makefile.in: Regenerate.
4197
4198 2012-10-23 Cary Coutant <ccoutant@google.com>
4199
4200 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4201 Dwarf_info_reader::read_from_pointer.
4202 (Dwarf_pubnames_table::read_header): Likewise.
4203 (Dwarf_pubnames_table::next_name): Likewise.
4204 (Dwarf_die::read_attributes): Likewise.
4205 (Dwarf_die::skip_attributes): Likewise.
4206 (Dwarf_info_reader::read_from_pointer): New function template.
4207 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4208 (Dwarf_pubnames_table): Likewise.
4209 (Dwarf_info_reader::read_from_pointer): New function template.
4210 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4211 Dwarf_pubnames_table ctor.
4212
4213 2012-10-23 Cary Coutant <ccoutant@google.com>
4214
4215 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4216 abbrev_shndx.
4217 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4218 abbrev_shndx_.
4219 (Dwarf_info_reader::set_abbrev_shndx): New method.
4220 (Dwarf_info_reader::abbrev_shndx_): New data member.
4221
4222 2012-10-23 Cary Coutant <ccoutant@google.com>
4223
4224 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4225 from object, not parameters.
4226 (Dwarf_info_reader::parse): Likewise.
4227 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4228 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4229 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4230 methods.
4231
4232 2012-10-23 Cary Coutant <ccoutant@google.com>
4233
4234 * fileread.cc (Input_file::Input_file): New constructor.
4235 * fileread.h (class Input_file): Add new constructor.
4236
4237 2012-10-18 Alan Modra <amodra@gmail.com>
4238
4239 PR gold/14727
4240 * object.cc (Relobj::is_section_name_included): Also match
4241 .sdata personality section.
4242
4243 2012-10-18 Alan Modra <amodra@gmail.com>
4244
4245 * target-reloc.h (class Default_comdat_behavior): New, package up..
4246 (get_comdat_behaviour): ..this.
4247 (relocate_section): Add Relocate_comdat_behavior template arg,
4248 adjust code to suit.
4249 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4250 (Target_arm::scan_reloc_section): Likewise.
4251 * i386.cc (Target_i386::relocate_section): Likewise.
4252 * sparc.cc (Target_sparc::relocate_section): Likewise.
4253 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4254 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4255 * powerpc.cc (class Relocate_comdat_behavior): New.
4256 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4257 gold::relocate_section with new template arg.
4258
4259 2012-10-18 Alan Modra <amodra@gmail.com>
4260
4261 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4262 dynamic relocs for GOT_TPREL got entries, without symbol if
4263 resolving locally.
4264 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4265 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4266 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4267
4268 2012-10-17 Alan Modra <amodra@gmail.com>
4269
4270 PR gold/14726
4271 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4272
4273 2012-10-16 Sriraman Tallam <tmsriram@google.com>
4274
4275 * layout.cc (Layout::include_section): Keep sections marked
4276 SHF_EXCLUDE when doing relocatable links.
4277
4278 2012-10-16 Alan Modra <amodra@gmail.com>
4279
4280 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4281 (Target_powerpc::do_finalize_sections): Call it.
4282 (Output_data_save_res): New class and supporting functions.
4283 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4284 normal symbols defined in object files.
4285
4286 2012-10-12 Alan Modra <amodra@gmail.com>
4287
4288 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4289 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4290 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4291 section if scan_opd_relocs not yet called.
4292 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4293
4294 2012-10-12 Alan Modra <amodra@gmail.com>
4295
4296 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4297 add_local_ifunc_entry): Revert last change.
4298 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4299
4300 2012-10-05 Alan Modra <amodra@gmail.com>
4301
4302 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4303 do_plt_address_for_global): New functions.
4304 (Output_data_got_powerpc::do_write): Don't segfault when linking
4305 statically.
4306 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4307 add_local_ifunc_entry): Return true on adding entry..
4308 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4309 glink->add_entry call. Remove unused symtab param. Adjust calls.
4310 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4311 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4312 set up symbols here.
4313 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4314 syms here. Do so even when no .iplt. Don't segfault when linking
4315 statically.
4316 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4317 new variants without reloc param.
4318 (Glink_sym_ent::Glink_sym_ent): Likewise.
4319 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4320 reloc when refs will resolve to plt call stub.
4321 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4322 R_PPC_PLTREL24 to resolve locally.
4323 (Target_powerpc::Scan::global): Correct ifunc handling.
4324 (Target_powerpc::Relocate::relocate): Correct local sym glink
4325 lookup. Don't destroy "value" when we have a plt call stub,
4326 and when checking plt call validity.
4327 (Target_powerpc::do_dynsym_value): Simplify.
4328
4329 2012-10-05 Alan Modra <amodra@gmail.com>
4330
4331 * i386.cc (Output_data_plt_i386::address_for_global,
4332 address_for_local): Add plt offset to returned value. Adjust uses.
4333 * sparc.cc (Output_data_plt_sparc::address_for_global,
4334 address_for_local): Likewise.
4335 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4336 address_for_local): Likewise.
4337 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4338 address_for_local): Likewise.
4339 * target.h (Target::plt_address_for_global, plt_address_for_local):
4340 Update comment.
4341 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4342 (Output_data_got::Got_entry::write): Nor here.
4343 * output.h: Comment fix.
4344
4345 2012-10-02 Jiong Wang <jiwang@tilera.com>
4346
4347 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4348 global_offset_table_ value for larget got.
4349 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4350
4351 2012-09-29 Alan Modra <amodra@gmail.com>
4352
4353 * powerpc.cc (Target_powerpc::iplt_): New output section.
4354 (Target_powerpc::iplt_section, make_iplt_section,
4355 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4356 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4357 Target_powerpc::plt_entry_count): Count iplt entries too.
4358 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4359 reloc section in constructor. New params.
4360 (Target_powerpc::make_plt_section): Create reloc section here instead.
4361 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4362 functions.
4363 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4364 (Output_data_glink::add_entry, find_entry): New functions to
4365 deal with local syms.
4366 (Glink_sym_ent): Add support for local syms.
4367 (Output_data_glink::do_write): Handle ifunc plt entries.
4368 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4369 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4370 (Target_powerpc::Relocate::relocate): Likewise.
4371 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4372
4373 2012-09-25 Alan Modra <amodra@gmail.com>
4374
4375 * object.h (Sized_relobj_file::adjust_local_symbol,
4376 do_adjust_local_symbol): New functions.
4377 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4378 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4379 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4380 and irregular opd entry spacing.
4381 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4382 (Global_symbol_visitor_opd): New functor.
4383 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4384 on deleted opd entries.
4385
4386 2012-09-15 Jiong Wang <jiwang@tilera.com>
4387
4388 * tilegx.cc: New file.
4389 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4390 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4391 * configure.tgt: Add entries for tilegx*.
4392 * configure.ac: Likewise.
4393 * Makefile.in: Rebuild.
4394 * configure: Likewise.
4395 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4396 tilegx.
4397
4398 2012-09-13 Alan Modra <amodra@gmail.com>
4399
4400 * target-reloc.h (scan_relocs): Call scan.local for relocs
4401 against symbols in discarded sections. Pass is_discarded
4402 param.
4403 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4404 Add is_discarded param.
4405 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4406 is_discarded to flag opd entry as discarded. Don't emit dyn
4407 relocs on such entries.
4408 (Target_powerpc::Scan::global): Similarly detect and handle
4409 such opd entries.
4410 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4411 opd_ent_. Update all uses.
4412 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4413 (Target_powerpc::relocate_section): Zero out discarded opd
4414 entry relocs.
4415
4416 2012-09-12 Ian Lance Taylor <iant@google.com>
4417
4418 PR gold/14570
4419 * output.cc: Rename Output_data_got template parameter from size
4420 to got_size for all functions. Compile all variants of
4421 Output_data_got.
4422 (Output_data_got::Got_entry::write): Correct use of size for
4423 symbol value. Use local_is_tls rather than casting to
4424 Sized_relobj_file.
4425 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4426 (class Sized_relobj_file): Add do_local_is_tls.
4427 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4428
4429 2012-09-11 Alan Modra <amodra@gmail.com>
4430
4431 PR gold/14566
4432 * layout.cc (Layout::set_segment_offsets): When using
4433 common-page-size alignment, ensure we are on a new max-page-size
4434 page.
4435 * output.cc (Output_segment::set_section_addresses): Use
4436 abi_pagesize, not common_pagesize for relro boundary.
4437 (Output_segment::set_offset): Likewise.
4438
4439 2012-09-11 Alan Modra <amodra@gmail.com>
4440
4441 * output.h (Output_data_got::add_global_tls, add_local_tls,
4442 add_local_tls_pair): New functions.
4443 (Output_data_got::add_local_pair_with_rel): Remove second
4444 reloc param. Expand comment.
4445 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4446 use_plt_or_tls_offset_, similarly for constructor param.
4447 (Output_data_got::Got_entry::write): Add got_index param.
4448 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4449 add_local_tls_pair): New functions.
4450 (Output_data_got::Got_entry::write): Handle tls symbols
4451 with use_plt_or_tls_offset_ set specially.
4452 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4453 (Output_data_got::do_write): Replace iterator with index, pass
4454 index to entry write function.
4455 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4456 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4457 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4458 call.
4459 * i386.cc (Target_i386::Scan::local): Likewise.
4460 * sparc.cc (Target_sparc::Scan::local): Likewise.
4461 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4462 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4463 do_tls_offset_for_global): New functions.
4464 (Target_powerpc::Scan::local): Correct TLS relocations and got
4465 entry values.
4466 (Target_powerpc::Scan::global): Don't emit unnecessary
4467 dynamic relocations on TLS GOT entries.
4468
4469 2012-09-10 Matthias Klose <doko@ubuntu.com>
4470
4471 * config.in: Disable sanity check for kfreebsd.
4472
4473 2012-09-10 Sterling Augustine <saugustine@google.com>
4474
4475 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4476 (Gdb_index::pubtypes_read): New parameter.
4477 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4478 to calls.
4479 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4480 pubtypes_object_.
4481
4482 2012-09-09 Alan Modra <amodra@gmail.com>
4483
4484 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4485 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4486 * gc.h (gc_process_relocs): Call target gc_add_reference.
4487 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4488 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4489 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4490 unnecessary cast.
4491 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4492 to cater for when we don't need code offset. Update use.
4493 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4494 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4495 set_opd_valid): New functions.
4496 (Target_powerpc::do_gc_add_reference): New function.
4497 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4498 stashed refs.
4499 (Target_powerpc::do_gc_mark_symbol): New function.
4500
4501 2012-09-06 Cary Coutant <ccoutant@google.com>
4502
4503 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4504 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4505 (Dwarf_die::skip_attributes): Likewise.
4506 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4507 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4508 (main): Call it.
4509 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4510
4511 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4512
4513 * testsuite/script_test_3.t: Add .got.plt output section
4514 statement.
4515 * testsuite/script_test_4.t: Likewise.
4516
4517 2012-09-05 Alan Modra <amodra@gmail.com>
4518
4519 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4520 update all uses and lose "enum" when using type.
4521
4522 2012-09-05 Alan Modra <amodra@gmail.com>
4523
4524 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4525 * configure: Regenerate.
4526 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4527 (plugin_final_layout.stdout): Likewise.
4528 (memory_test): Set page sizes to 0x1000.
4529 * testsuite/Makefile.in: Regenerate.
4530 * testsuite/discard_locals_test.sh: Add FIXME comment.
4531 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4532 * testsuite/pr14265.t: Add .got output section statement.
4533 * testsuite/script_test_2.t: Likewise.
4534 * testsuite/script_test_3.t: Likewise.
4535 * testsuite/script_test_4.t: Likewise.
4536 * testsuite/script_test_5.t: Likewise.
4537 * testsuite/script_test_6.t: Likewise.
4538 * testsuite/script_test_7.t: Likewise.
4539 * testsuite/script_test_9.t: Likewise.
4540
4541 2012-09-05 Alan Modra <amodra@gmail.com>
4542
4543 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4544 (Powerpc_relocate_functions::Status): New typedef.
4545 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4546 (Target_powerpc::Scan::local): Handle REL64.
4547 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4548 for REL32 and REL64.
4549 (Target_powerpc::symval_for_branch): New function, extracted from..
4550 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4551 checks. Report overflow errors.
4552
4553 2012-09-05 Alan Modra <amodra@gmail.com>
4554
4555 * object.h (Sized_relobj_file::emit_relocs): Delete.
4556 (Sized_relobj_file::emit_relocs_reltype): Delete.
4557 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4558 relocate_relocs for --emit-relocs.
4559 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4560 * output.h: Update comment.
4561 (Output_segment::first_section): New function.
4562 (Output_segment::first_section_load_address): Use first_section.
4563 * output.cc (Output_segment::first_section): New function extracted..
4564 (Output_segment::first_section_load_address): ..from here. Delete.
4565 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4566 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4567 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4568 adjust call to target.h function.
4569 * i386.cc (Target_i386): Likewise.
4570 * sparc.cc (Target_sparc): Likewise.
4571 * x86_64.cc (Target_x86_64): Likewise.
4572 * powerpc.cc (Target_powerpc): Likewise.
4573 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4574 first tls section has section symbol for optimised local dynamic
4575 output relocs.
4576 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4577 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4578 optimised tls code.
4579 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4580 Rename to relocate_relocs. Update error message.
4581
4582 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4583
4584 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4585 --just-symbols.
4586
4587 2012-08-31 Alan Modra <amodra@gmail.com>
4588
4589 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4590 (Powerpc_relobj::toc_base_offset): New stub function.
4591 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4592 got_mod_index_offset to tlsld_got_offset. Update all refs.
4593 (Target_powerpc::Relocate::enum skip_tls): New.
4594 (Target_powerpc::call_tls_get_addr_): New var.
4595 (Target_powerpc::is_branch_reloc): Move to file scope.
4596 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4597 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4598 New functions.
4599 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4600 (powerpc_info): Correct common_pagesize for ppc64.
4601 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4602 (Powerpc_relocate_functions): Add overflow check enums and functions.
4603 Add non-shift version of rela, rela_ua. Delete all rel public
4604 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4605 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4606 addr16_ha3, addr14 functions.
4607 (Output_data_got_powerpc::add_constant_pair): New function.
4608 (Output_data_got_powerpc::got_base_offset): Likewise.
4609 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4610 (instruction constants): Sort, add some more.
4611 (Output_data_glink::do_write): Add and use Address typedef. Use
4612 object->toc_base_offset() stub for 64-bit.
4613 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4614 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4615 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4616 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4617 Always treat .opd relocs as against locally defined symbol.
4618 Correct condition for RELATIVE relocs.
4619 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4620 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4621 for 32-bit syms with a plt entry. Correct ppc64 toc base
4622 calculations. Handle TLS relocs, and more. Add overflow
4623 checking and adjust for Powerpc_relocate_functions changes.
4624 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4625 Reinstate --emit-relocs code with FIXME.
4626
4627 2012-08-30 Alan Modra <amodra@gmail.com>
4628
4629 * layout.cc (Layout::set_segment_offsets): Set p_align to
4630 abi_pagesize, not common_pagesize.
4631 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4632 to determine whether file header can go in segment.
4633
4634 2012-08-30 Alan Modra <amodra@gmail.com>
4635
4636 * output.h (Output_reloc::Output_reloc <output section>): Add
4637 is_relative param. Adjust calls.
4638 (Output_reloc::add_output_section_relative): New functions.
4639 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4640 is_relative.
4641 (Output_reloc::symbol_value): Handle SECTION_CODE.
4642
4643 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4644
4645 * gold.cc (queue_middle_tasks): Call layout again when unique
4646 segments for sections is desired.
4647 * layout.cc (Layout::Layout): Initialize new members.
4648 (Layout::get_output_section_flags): New function.
4649 (Layout::choose_output_section): Call get_output_section_flags.
4650 (Layout::layout): Make output section for mapping to a unique segment.
4651 (Layout::insert_section_segment_map): New function.
4652 (Layout::attach_allocated_section_to_segment): Make unique segment for
4653 output sections marked so.
4654 (Layout::segment_precedes): Check for unique segments when sorting.
4655 * layout.h (Layout::Unique_segment_info): New struct.
4656 (Layout::Section_segment_map): New typedef.
4657 (Layout::insert_section_segment_map): New function.
4658 (Layout::get_output_section_flags): New function.
4659 (Layout::is_unique_segment_for_sections_specified): New function.
4660 (Layout::set_unique_segment_for_sections_specified): New function.
4661 (Layout::unique_segment_for_sections_specified_): New member.
4662 (Layout::section_segment_map_): New member.
4663 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4664 Rename is_gc_pass_one to is_pass_one.
4665 Rename is_gc_pass_two to is_pass_two.
4666 Rename is_gc_or_icf to is_two_pass.
4667 Check for which pass based on whether symbols data is present.
4668 Make it two pass when unique segments for sections is desired.
4669 * output.cc (Output_section::Output_section): Initialize new
4670 members.
4671 * output.h (Output_section::is_unique_segment): New function.
4672 (Output_section::set_is_unique_segment): New function.
4673 (Output_section::is_unique_segment_): New member.
4674 (Output_section::extra_segment_flags): New function.
4675 (Output_section::set_extra_segment_flags): New function.
4676 (Output_section::extra_segment_flags_): New member.
4677 (Output_section::segment_alignment): New function.
4678 (Output_section::set_segment_alignment): New function.
4679 (Output_section::segment_alignment_): New member.
4680 (Output_segment::Output_segment): Initialize is_unique_segment_.
4681 (Output_segment::is_unique_segment): New function.
4682 (Output_segment::set_is_unique_segment): New function.
4683 (Output_segment::is_unique_segment_): New member.
4684 * plugin.cc (allow_unique_segment_for_sections): New function.
4685 (unique_segment_for_sections): New function.
4686 (Plugin::load): Add new functions to transfer vector.
4687 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4688 * Makefile.in: Regenerate.
4689 * testsuite/plugin_final_layout.sh: Check if unique segment
4690 functionality works.
4691 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4692 are available.
4693 (allow_unique_segment_for_sections): New global.
4694 (unique_segment_for_sections): New global.
4695 (claim_file_hook): Call allow_unique_segment_for_sections.
4696 (all_symbols_read_hook): Call unique_segment_for_sections.
4697
4698 2012-08-22 Cary Coutant <ccoutant@google.com>
4699
4700 * layout.cc (Layout::include_section): Don't assert on GROUP
4701 sections with --emit-relocs.
4702
4703 2012-08-21 Cary Coutant <ccoutant@google.com>
4704
4705 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4706 if --export-dynamic-symbol names an undef symbol.
4707
4708 2012-08-18 Alan Modra <amodra@gmail.com>
4709
4710 * powerpc.cc: Formatting and white space.
4711 (Powerpc_relobj): Rename got2_section_ to special_.
4712 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4713 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4714 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4715 (Target_powerpc): Add Address typedef and invalid_address. Use
4716 throughout.
4717 (Target_powerpc::is_branch_reloc): New function.
4718 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4719 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4720 for dst_mask, value and addend.
4721 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4722 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4723 (Output_data_glink::do_write): Correct toc base. Don't try to use
4724 uint16_t for 24-bit offset. Use get_output_section_offset and
4725 check return.
4726 (Target_powerpc::Scan::local): Handle more relocs.
4727 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4728 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4729 Plug in toc restoring insn after plt calls. Translate branches
4730 to function descriptor symbols to corresponding entry point.
4731 (Target_powerpc::relocate_for_relocatable): Check return from
4732 get_output_section_offset.
4733 * symtab.h: Comment typo.
4734
4735 2012-08-14 Ian Lance Taylor <iant@google.com>
4736
4737 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4738 unsupported_relocal_local to call unsupported_reloc_global.
4739
4740 2012-08-14 Nick Clifton <nickc@redhat.com>
4741
4742 PR ld/14265
4743 * script-sections.cc (Sections_element::output_section_name): Add
4744 keep return parameter.
4745 (Output_section_element::match_name): Add keep return parameter.
4746 Return the value of the keep_ member.
4747 * script-sections.h (class Output_section): Update
4748 output_section_name prototype.
4749 * layout.cc (Layout::keep_input_section): New public member
4750 function.
4751 (Layout::choose_output_section): Pass keep parameter to
4752 output_section_name.
4753 * layout.h (class Layout): Add keep_input_section.
4754 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4755 sections.
4756 * testsuite/Makefile.am: Add a test.
4757 * testsuite/Makefile.in: Regenerate.
4758 * testsuite/pr14265.c: Source file for the test.
4759 * testsuite/pr14265.t: Linker script for the test.
4760 * testsuite/pr14265.sh: Shell script for the test.
4761
4762 2012-08-14 Alan Modra <amodra@gmail.com>
4763
4764 * target.h (Target::output_section_name): New function.
4765 (Target::do_output_section_name): New function.
4766 * layout.cc (Layout::choose_output_section): Call the above.
4767 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4768
4769 2012-08-14 Alan Modra <amodra@gmail.com>
4770
4771 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4772 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4773 for replace_constant call.
4774 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4775 (Output_data_glink::do_print_to_mapfile): New function.
4776 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4777 (Target_powerpc::Relocate::relocate): Likewise.
4778
4779 2012-08-14 Alan Modra <amodra@gmail.com>
4780
4781 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4782 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4783 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4784 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4785 all references to shndx_. Handle special case for R_PPC_PLTREL24
4786 here.
4787 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4788 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4789 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4790 here.
4791 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4792 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4793
4794 2012-08-12 Alan Modra <amodra@gmail.com>
4795
4796 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4797 (glink insn constants): Use uint32_t.
4798 (Output_data_glink::add_entry): Use insert, not [] operator.
4799
4800 2012-08-11 Alan Modra <amodra@gmail.com>
4801
4802 * object.h (Sized_relobj_file::find_shdr): New function.
4803 (Sized_relobj_file::find_special_sections): New function.
4804 * object.cc (Sized_relobj_file::find_shdr): New function.
4805 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4806 (Sized_relobj_file::find_special_sections): New function, split out..
4807 (Sized_relobj_file::do_read_symbols): ..from here.
4808 * output.h (Output_data_got::replace_constant): New function.
4809 (Output_data_got::num_entries): New function.
4810 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4811 (Output_data_got::got_offset): Protected rather than private.
4812 (Output_data_got::replace_got_entry): New function.
4813 * output.cc (Output_data_got::replace_got_entry): New function.
4814 * powerpc.cc (class Powerpc_relobj): New.
4815 (class Powerpc_relocate_functions): Delete all psymval variants or
4816 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4817 Implement _ha functions using corresponding _hi function.
4818 (Powerpc_relobj::find_special_sections): New function.
4819 (Target_powerpc::do_make_elf_object): New function.
4820 (class Output_data_got_powerpc): New.
4821 (class Output_data_glink): New.
4822 (class Powerpc_scan_relocatable_reloc): New.
4823 Many more changes througout file.
4824
4825 2012-08-09 Nick Clifton <nickc@redhat.com>
4826
4827 * po/vi.po: Updated Vietnamese translation.
4828
4829 2012-08-07 Ian Lance Taylor <iant@google.com>
4830
4831 * layout.cc (Layout::add_target_dynamic_tags): If
4832 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4833 plt_rel.
4834
4835 2012-07-30 Nick Clifton <nickc@redhat.com>
4836
4837 * po/gold.pot: Updated template.
4838 * po/es.po: Updated Spanish translation.
4839
4840 2012-07-18 Cary Coutant <ccoutant@google.com>
4841
4842 PR gold/14344
4843 * configure.ac: Add check for -gpubnames support.
4844 * configure: Regenerate.
4845 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4846 support; force -gno-pubnames.
4847 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4848 support.
4849 (gdb_index_test_4): New test.
4850 * testsuite/Makefile.in: Regenerate.
4851 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4852 * testsuite/gdb_index_test_2.sh: Likewise.
4853 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4854 * testsuite/gdb_index_test_4.sh: New script.
4855 * testsuite/gdb_index_test_comm.sh: New script with common code;
4856 don't look for space after colon.
4857
4858 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4859
4860 * gold.cc (queue_middle_tasks): Update function order only after
4861 deferred objects due to plugins are processed.
4862
4863 2012-07-11 Ian Lance Taylor <iant@google.com>
4864
4865 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4866 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4867 (Target_arm::scan_reloc_for_stub): Likewise.
4868 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4869 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4870 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4871 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4872 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4873
4874 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4875 Ian Lance Taylor <iant@google.com>
4876
4877 PR gold/14309
4878 * configure.ac: Test whether std::tr1::hash<off_t> works.
4879 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4880 needed.
4881 * output.h (class Output_fill): Add virtual destructor.
4882 * configure, config.in: Rebuild.
4883
4884 2012-06-22 Roland McGrath <mcgrathr@google.com>
4885
4886 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4887
4888 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4889
4890 * plugin.cc (Plugin::load): Handle position independent executables.
4891
4892 2012-06-06 Cary Coutant <ccoutant@google.com>
4893
4894 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4895 add .debug_macro.
4896 (lines_only_debug_sections): Likewise.
4897 (gdb_fast_lookup_sections): New static array.
4898 (is_gdb_debug_section): Rename formal parameter.
4899 (is_lines_only_debug_section): Likewise.
4900 (is_gdb_fast_lookup_section): New function.
4901 (Layout::include_section): Check for ".zdebug_" prefix; pass
4902 section name suffix to is_gdb_debug_section, et al.; check for
4903 fast-lookup sections when building .gdb_index.
4904 * options.h (--strip-debug-gdb): Update GDB version number.
4905
4906 2012-06-06 Cary Coutant <ccoutant@google.com>
4907
4908 * configure.ac: Add check for fallocate.
4909 * configure: Regenerate.
4910 * config.in: Regenerate.
4911
4912 * options.h (class General_options): Add --mmap-output-file and
4913 --posix-fallocate options.
4914 * output.cc: (posix_fallocate): Remove; replace with...
4915 (gold_fallocate): New function.
4916 (Output_file::map_no_anonymous): Call gold_fallocate.
4917 (Output_file::map): Check --mmap-output-file option.
4918
4919 2012-06-05 Jing Yu <jingyu@google.com>
4920
4921 * gold.h (textdomain): Add do {} to empty while(0).
4922 (bindtextdomain): Likewise.
4923
4924 2012-06-04 Cary Coutant <ccoutant@google.com>
4925
4926 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4927 has_dynsym_index.
4928
4929 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4930
4931 * symtab.cc (Symbol_table::define_special_symbol):
4932 Initialize *poldsym to prevent uninitialized variable errors.
4933
4934 2012-05-23 Cary Coutant <ccoutant@google.com>
4935
4936 * layout.cc (Layout::section_name_mapping): Add rules to handle
4937 exact match on .data.rel.ro.local or .data.rel.ro.
4938 (Layout::output_section_name): Check for exact matches.
4939
4940 2012-05-23 Cary Coutant <ccoutant@google.com>
4941
4942 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4943 more carefully.
4944
4945 2012-05-22 Cary Coutant <ccoutant@google.com>
4946
4947 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4948 object before exporting symbol.
4949
4950 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4951
4952 * testsuite/tls_test.cc: Include "config.h" first.
4953 * testsuite/tls_test_c.c: Likewise.
4954
4955 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4956 Nick Clifton <nickc@redhat.com>
4957
4958 PR 14072
4959 * configure.in: Add check that sysdep.h has been included before
4960 any system header files.
4961 * configure: Regenerate.
4962 * config.in: Regenerate.
4963
4964 2012-05-14 Cary Coutant <ccoutant@google.com>
4965
4966 * layout.cc (Layout::make_output_section): Mark .tdata section
4967 as RELRO.
4968 * testsuite/relro_test.cc: Add a TLS variable.
4969
4970 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4971
4972 PR gold/14091
4973 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4974 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4975 R_X86_64_64.
4976
4977 2012-05-08 Cary Coutant <ccoutant@google.com>
4978
4979 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4980 (lines_only_debug_sections): Likewise.
4981
4982 2012-05-02 Roland McGrath <mcgrathr@google.com>
4983
4984 * nacl.cc: New file.
4985 * nacl.h: New file.
4986 * Makefile.am (CCFILES, HFILES): Add them.
4987 * Makefile.in: Regenerate.
4988 * i386.cc (Output_data_plt_i386_nacl): New class.
4989 (Output_data_plt_i386_nacl_exec): New class.
4990 (Output_data_plt_i386_nacl_dyn): New class.
4991 (Target_i386_nacl): New class.
4992 (Target_selector_i386_nacl): New class.
4993 (target_selector_i386): Use it instead of Target_selector_i386.
4994 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4995 (Target_x86_64_nacl): New class.
4996 (Target_selector_x86_64_nacl): New class.
4997 (target_selector_x86_64, target_selector_x32): Use it instead of
4998 Target_selector_x86_64.
4999 * arm.cc (Output_data_plt_arm_nacl): New class.
5000 (Target_arm_nacl): New class.
5001 (Target_selector_arm_nacl): New class.
5002 (target_selector_arm, target_selector_armbe): Use it instead of
5003 Target_selector_arm.
5004
5005 * target-select.cc (select_target): Take new Input_file* and off_t
5006 arguments, pass them on to recognize method of selector.
5007 * object.cc (make_elf_sized_object): Update caller.
5008 * parameters.cc (parameters_force_valid_target): Likewise.
5009 * incremental.cc (make_sized_incremental_binary): Likewise.
5010 * target-select.h: Update decl.
5011 (Target_selector::recognize): Take new Input_file* argument,
5012 pass it on to do_recognize.
5013 (Target_selector::do_recognize): Take new Input_file* argument.
5014 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
5015 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
5016 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
5017 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
5018
5019 * target.h (Target::Target_info): New members isolate_execinstr
5020 and rosegment_gap.
5021 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
5022 * arm.cc (Target_arm::arm_info): Update initializer.
5023 * i386.cc (Target_i386::i386_info): Likewise.
5024 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
5025 * sparc.cc (Target_sparc::sparc_info): Likewise.
5026 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5027 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
5028 * layout.cc (Layout::attach_allocated_section_to_segment):
5029 Take new const Target* argument. If target->isolate_execinstr(), act
5030 like --rosegment.
5031 (Layout::find_first_load_seg): Take new const Target* argument;
5032 if target->isolate_execinstr(), reject PF_X segments.
5033 (Layout::relaxation_loop_body): Update caller.
5034 (Layout::set_segment_offsets): If target->isolate_execinstr(),
5035 reset file offset to zero when we hit LOAD_SEG, and then do a second
5036 loop over the segments before LOAD_SEG to reassign offsets after
5037 addresses have been determined. Handle target->rosegment_gap().
5038 (Layout::attach_section_to_segment): Take new const Target* argument;
5039 pass it to attach_allocated_section_to_segment.
5040 (Layout::make_output_section): Update caller.
5041 (Layout::attach_sections_to_segments): Take new const Target* argument;
5042 pass it to attach_section_to_segment.
5043 * gold.cc (queue_middle_tasks): Update caller.
5044 * layout.h (Layout): Update method decls with new arguments.
5045
5046 * arm.cc (Target_arm::Target_arm): Take optional argument for the
5047 Target_info pointer to use.
5048 (Target_arm::do_make_data_plt): New virtual method.
5049 (Target_arm::make_data_plt): New method that calls it.
5050 (Target_arm::make_plt_entry): Use it.
5051 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
5052 for the section alignment.
5053 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
5054 method.
5055 (Output_data_plt_arm::first_plt_entry_offset): Call it.
5056 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
5057 method.
5058 (Output_data_plt_arm::get_plt_entry_size): Call it.
5059 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
5060 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
5061 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
5062 method.
5063 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
5064 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
5065 method instead of sizeof(plt_entry).
5066 (Output_data_plt_arm::add_entry): Likewise.
5067 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
5068 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
5069 than static method.
5070 (Target_arm::plt_entry_size): Likewise.
5071 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
5072 Move to ...
5073 (Output_data_plt_arm_standard): ... here, new class.
5074 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
5075 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
5076 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
5077
5078 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5079 Take additional argument for the PLT entry size.
5080 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
5081 Use get_plt_entry_size method rather than plt_entry_size variable.
5082 (Output_data_plt_x86_64::reserve_slot): Likewise.
5083 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
5084 (Output_data_plt_x86_64::add_entry): Likewise.
5085 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
5086 (Output_data_plt_x86_64::address_for_global): Likewise.
5087 (Output_data_plt_x86_64::address_for_local): Likewise.
5088 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5089 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
5090 Make method non-static.
5091 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
5092 method.
5093 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
5094 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
5095 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
5096 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
5097 virtual method.
5098 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
5099 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
5100 virtual method.
5101 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
5102 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
5103 virtual method.
5104 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
5105 (Output_data_plt_x86_64::plt_entry_size)
5106 (Output_data_plt_x86_64::first_plt_entry)
5107 (Output_data_plt_x86_64::plt_entry)
5108 (Output_data_plt_x86_64::tlsdesc_plt_entry)
5109 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
5110 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
5111 (Output_data_plt_x86_64_standard): ... here, new class.
5112 (Target_x86_64::Target_x86_64): Take optional argument for the
5113 Target_info pointer to use.
5114 (Target_x86_64::do_make_data_plt): New virtual method.
5115 (Target_x86_64::make_data_plt): New method to call it.
5116 (Target_x86_64::init_got_plt_for_update): Use that.
5117 Call this->plt_->add_eh_frame method here.
5118 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
5119 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
5120 rather than static method.
5121 (Target_x86_64::plt_entry_size): Likewise.
5122 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
5123 rather than plt_entry_size variable. Move guts of PLT filling to...
5124 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
5125 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
5126 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
5127
5128 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
5129 additional argument for the section alignment.
5130 Don't do add_eh_frame_for_plt here.
5131 (Output_data_plt_i386::first_plt_entry_offset): Make the method
5132 non-static. Use get_plt_entry_size method rather than plt_entry_size
5133 variable.
5134 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5135 method.
5136 (Output_data_plt_i386::get_plt_entry_size): Call it.
5137 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5138 (Output_data_plt_i386::add_eh_frame): New method to call it.
5139 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5140 method.
5141 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5142 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5143 method.
5144 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5145 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5146 method instead of plt_entry_size.
5147 (Output_data_plt_i386::plt_entry_size)
5148 (Output_data_plt_i386::plt_eh_frame_fde_size)
5149 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5150 (Output_data_plt_i386_standard): ... here, new class.
5151 (Output_data_plt_i386_exec): New class.
5152 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5153 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5154 (Output_data_plt_i386::exec_plt_entry): Move to ...
5155 (Output_data_plt_i386_exec::plt_entry): ... here.
5156 (Output_data_plt_i386_dyn): New class.
5157 (Output_data_plt_i386::first_plt_entry): Move to ...
5158 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5159 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5160 (Output_data_plt_i386_dyn::plt_entry): ... here.
5161 (Target_i386::Target_i386): Take optional argument for the Target_info
5162 pointer to use.
5163 (Target_i386::do_make_data_plt): New virtual method.
5164 (Target_i386::make_data_plt): New method to call it.
5165 (Target_i386::make_plt_section): Use that.
5166 Call this->plt_->add_eh_frame method here.
5167 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5168 rather than plt_entry_size variable.
5169 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5170 (Output_data_plt_i386::address_for_local): Likewise.
5171 (Output_data_plt_i386::do_write): Likewise.
5172 Move guts of PLT filling to...
5173 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5174 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5175 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5176 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5177
5178 2012-05-01 Cary Coutant <ccoutant@google.com>
5179
5180 * dwarf_reader.cc (Dwarf_die::read_attributes)
5181 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5182 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5183 * reduced_debug_output.cc
5184 (Output_reduced_debug_info_section::get_die_end): Remove
5185 DW_FORM_GNU_ref_index. Add default case.
5186
5187 2012-04-26 Mark Wielaard <mjw@redhat.com>
5188
5189 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5190 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5191 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5192 DW_AT_high_pc as offset from DW_AT_low_pc.
5193
5194 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5195 * testsuite/Makefile.in: Regenerate.
5196 * testsuite/gdb_index_test_3.c: New test source file.
5197 * testsuite/gdb_index_test_3.sh: New test source file.
5198
5199 2012-04-25 Ian Lance Taylor <iant@google.com>
5200
5201 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5202 pointer.
5203 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5204 as a class, not a struct.
5205 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5206 (Target_arm::apply_cortex_a8_workaround): Likewise.
5207 * gc.h: Declare Reloc_types as a struct, not a class.
5208 * object.h: Declare Symbols_data as a struct.
5209 * reloc.h: Declare Read_relocs_data as a struct.
5210 * target.h: Declare Relocate_info as a struct.
5211
5212 2012-04-24 David S. Miller <davem@davemloft.net>
5213
5214 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5215 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5216 and R_SPARC_WPLT30.
5217
5218 2012-04-24 Cary Coutant <ccoutant@google.com>
5219
5220 * incremental-dump.cc (find_input_containing_global): Replace
5221 magic number with symbolic constant.
5222 (dump_incremental_inputs): Update version number.
5223 * incremental.cc (Output_section_incremental_inputs): Update version
5224 number; import symbolic constants from Incremental_inputs_reader.
5225 (Incremental_inputs::create_data_sections): Align relocations
5226 section correctly for 64-bit targets.
5227 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5228 constants; add padding.
5229 (Output_section_incremental_inputs::write_header): Add assert for
5230 header_size.
5231 (Output_section_incremental_inputs::write_input_files): Add assert
5232 for input_entry_size.
5233 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5234 add assert for object_info_size, input_section_entry_size,
5235 global_sym_entry_size.
5236 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5237 for data structure sizes; use them.
5238 (Incremental_input_entry_reader): Import symbolic constants from
5239 Incremental_inputs_reader; use them.
5240
5241 2012-04-23 David S. Miller <davem@davemloft.net>
5242
5243 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5244 and elf_flags_set_.
5245 (Target_sparc::Target_sparc): Initialize new fields.
5246 (Target_sparc::do_make_elf_object): New function.
5247 (Target_sparc::do_adjust_elf_header): New function.
5248
5249 2012-04-23 Cary Coutant <ccoutant@google.com>
5250
5251 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5252 CU range table of gdb index.
5253
5254 2012-04-20 David S. Miller <davem@davemloft.net>
5255
5256 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5257 instead of false.
5258
5259 2012-04-16 David S. Miller <davem@davemloft.net>
5260
5261 * sparc.cc (Target_sparc::got_address): New function.
5262 (Sparc_relocate_functions::gdop_hix22): New function.
5263 (Sparc_relocate_functions::gdop_lox10): New function.
5264 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5265 relocs.
5266 (Target_sparc::Scan::local): Likewise if the global symbol is not
5267 preemptible and is not IFUNC.
5268 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5269 transformations for local and non-preemptible non-IFUNC global
5270 symbols.
5271
5272 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5273 writing out 64-bit part of ranges.
5274
5275 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5276 -fpic and -fpie respectively.
5277 * Makefile.in: Regenerate.
5278
5279 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5280 (Target_sparc::Target_sparc): Initialize new field.
5281 (Target_sparc::do_plt_section_for_global): New function.
5282 (Target_sparc::do_plt_section_for_local): New function.
5283 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5284 (Target_sparc::make_plt_section): New function, broken out of
5285 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5286 (Target_sparc::make_plt_entry): Call make_plt_section.
5287 (Target_sparc::make_local_ifunc_plt_entry): New function.
5288 (Target_sparc::rela_ifunc_section): New function.
5289 (Target_sparc::plt_section): Remove const.
5290 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5291 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5292 and ifunc_count_ fields.
5293 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5294 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5295 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5296 (Output_data_plt_sparc::rela_ifunc): New function.
5297 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5298 (Output_data_plt_sparc::has_ifunc_section): New function.
5299 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5300 (Output_data_plt_sparc::address_for_global): New function.
5301 (Output_data_plt_sparc::address_for_local): New function.
5302 (Output_data_plt_sparc::plt_index_to_offset): New function.
5303 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5304 and entry_count.
5305 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5306 entry_count.
5307 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5308 R_SPARC_JMP_IREL to switch.
5309 (Target_sparc::Scan::check_non_pic): Likewise.
5310 (Target_sparc::Scan::local): Handle IFUNC symbols.
5311 (Target_sparc::Scan::local): Likewise.
5312 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5313 and plt_address_for_local.
5314 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5315 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5316
5317 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5318 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5319 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5320 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5321 global relocs too.
5322 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5323 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5324 calls.
5325 * sparc.cc (Target_sparc::Scan::global): Likewise.
5326 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5327
5328 2012-04-16 Cary Coutant <ccoutant@google.com>
5329
5330 * archive.cc (Library_base::should_include_member): Check for
5331 --export-dynamic-symbol.
5332 * options.h (class General_options): Add --export-dynamic-symbol.
5333 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5334 --export-dynamic-symbol.
5335 (Symbol_table::gc_mark_undef_symbols): Likewise.
5336 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5337
5338 2012-04-12 David S. Miller <davem@davemloft.net>
5339
5340 * sparc.cc (Reloc::wdisp10): New relocation method.
5341 (Reloc::h34): Likewise.
5342 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5343 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5344 R_SPARC_WDISP10.
5345 (Target_sparc::Scan::local): Likewise.
5346 (Target_sparc::Scan::global): Likewise.
5347 (Target_sparc::Relocate::relocate): Likewise.
5348
5349 2012-04-09 Cary Coutant <ccoutant@google.com>
5350
5351 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5352 low_pc == 0.
5353
5354 2012-04-06 Ian Lance Taylor <iant@google.com>
5355
5356 * timer.cc: #include <unistd.h>.
5357
5358 2012-04-06 Roland McGrath <mcgrathr@google.com>
5359
5360 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5361 * config.in: Regenerate.
5362 * configure: Regenerate.
5363
5364 2012-04-05 Nick Clifton <nickc@redhat.com>
5365
5366 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5367 (AM_LC_MESSAGES): Add.
5368 * aclocal.m4: Regenerate.
5369 * config.in: Regenerate.
5370 * configure: Regenerate.
5371
5372 2012-03-21 Cary Coutant <ccoutant@google.com>
5373
5374 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5375 * Makefile.in: Regenerate.
5376 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5377 (Sized_elf_reloc_mapper::symbol_section): New function.
5378 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5379 (make_elf_reloc_mapper): New function.
5380 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5381 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5382 (Dwarf_abbrev_table::do_get_abbrev): New function.
5383 (Dwarf_ranges_table::read_ranges_table): New function.
5384 (Dwarf_ranges_table::read_range_list): New function.
5385 (Dwarf_pubnames_table::read_section): New function.
5386 (Dwarf_pubnames_table::read_header): New function.
5387 (Dwarf_pubnames_table::next_name): New function.
5388 (Dwarf_die::Dwarf_die): New function.
5389 (Dwarf_die::read_attributes): New function.
5390 (Dwarf_die::skip_attributes): New function.
5391 (Dwarf_die::set_name): New function.
5392 (Dwarf_die::set_linkage_name): New function.
5393 (Dwarf_die::attribute): New function.
5394 (Dwarf_die::string_attribute): New function.
5395 (Dwarf_die::int_attribute): New function.
5396 (Dwarf_die::uint_attribute): New function.
5397 (Dwarf_die::ref_attribute): New function.
5398 (Dwarf_die::child_offset): New function.
5399 (Dwarf_die::sibling_offset): New function.
5400 (Dwarf_info_reader::check_buffer): New function.
5401 (Dwarf_info_reader::parse): New function.
5402 (Dwarf_info_reader::do_parse): New function.
5403 (Dwarf_info_reader::do_read_string_table): New function.
5404 (Dwarf_info_reader::lookup_reloc): New function.
5405 (Dwarf_info_reader::get_string): New function.
5406 (Dwarf_info_reader::visit_compilation_unit): New function.
5407 (Dwarf_info_reader::visit_type_unit): New function.
5408 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5409 Sized_elf_reloc_mapper.
5410 (Sized_dwarf_line_info::symbol_section): Remove function.
5411 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5412 (Sized_dwarf_line_info::read_line_mappings): Remove object
5413 parameter, adjust callers.
5414 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5415 * dwarf_reader.h: Include <sys/types.h>.
5416 (class Track_relocs): Remove forward declaration.
5417 (class Elf_reloc_mapper): New class.
5418 (class Sized_elf_reloc_mapper): New class.
5419 (class Dwarf_abbrev_table): New class.
5420 (class Dwarf_range_list): New class.
5421 (class Dwarf_ranges_table): New class.
5422 (class Dwarf_pubnames_table): New class.
5423 (class Dwarf_die): New class.
5424 (class Dwarf_info_reader): New class.
5425 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5426 (Sized_dwarf_line_info::symbol_section): Remove member function.
5427 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5428 base class.
5429 * gdb-index.cc: New source file.
5430 * gdb-index.h: New source file.
5431 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5432 and .debug_types sections, call Layout::add_to_gdb_index.
5433 (Sized_relobj_incr::do_section_name): Implement.
5434 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5435 return type; Implement.
5436 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5437 return type.
5438 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5439 parameter list and return type.
5440 (Sized_incr_dynobj::do_section_contents): Likewise.
5441 * layout.cc: Include gdb-index.h.
5442 (Layout::Layout): Initialize gdb_index_data_.
5443 (Layout::init_fixed_output_section): Check for .gdb_index section.
5444 (Layout::add_to_gdb_index): New function. Instantiate.
5445 * layout.h: Add forward declaration for class Gdb_index.
5446 (Layout::add_to_gdb_index): New member function.
5447 (Layout::gdb_index_data_): New data member.
5448 * main.cc: Include gdb-index.h.
5449 (main): Print statistics for gdb index.
5450 * object.cc (Object::section_contents): Move code into
5451 do_section_contents.
5452 (need_decompressed_section): Check for sections needed when building
5453 gdb index.
5454 (build_compressed_section_map): Likewise.
5455 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5456 gdb index.
5457 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5458 sections; call Layout::add_to_gdb_index.
5459 (Sized_relobj_file::do_decompressed_section_contents): Call
5460 do_section_contents directly.
5461 * object.h (Object::do_section_contents): Adjust parameter list and
5462 return type.
5463 (Object::do_decompressed_section_contents): Call do_section_contents
5464 directly.
5465 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5466 return type.
5467 * options.h (class General_options): Add --gdb-index option.
5468 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5469 list and return type.
5470 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5471 * reloc.h (Track_relocs::checkpoint): New function.
5472 (Track_relocs::reset): New function.
5473
5474 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5475 New test cases.
5476 * testsuite/Makefile.in: Regenerate.
5477 * testsuite/gdb_index_test.cc: New test source file.
5478 * testsuite/gdb_index_test_1.sh: New test source file.
5479 * testsuite/gdb_index_test_2.sh: New test source file.
5480
5481 2012-03-19 Doug Kwan <dougkwan@google.com>
5482
5483 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5484 (Target_arm::do_finalize_sections): Remove code which defines
5485 __exidx_start and __exidx_end. Make symbol table parameter
5486 anonymous as it is not used.
5487 * gold.cc (queue_middle_tasks): Call target hook to define any
5488 target-specific symbols.
5489 * target.h (Target::define_standard_symbols): New method.
5490 (Target::do_define_standard_symbols): Same.
5491 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5492 * testsuite/Makefile.in: Regenerate.
5493 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5494 and __exidx_end.
5495 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5496 relocations are generated for __exidx_start and __exidx_end.
5497
5498 2012-03-16 Doug Kwan <dougkwan@google.com>
5499
5500 * testsuite/Makefile.am: Disable test initpri3b.
5501 * testsuite/Makefile.in: Regenerate.
5502
5503 2012-03-15 Doug Kwan <dougkwan@google.com>
5504
5505 * arm.cc (Target_arm::got_section): Make .got section read-only
5506 if -z now is given.
5507
5508 2012-03-15 Ian Lance Taylor <iant@google.com>
5509
5510 PR gold/13850
5511 * layout.cc (Layout::make_output_section): Correctly mark
5512 SHT_INIT_ARRAY, et. al., as relro.
5513
5514 2012-03-14 Doug Kwan <dougkwan@google.com>
5515
5516 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5517 dynamic relocations for protected symbols in shared objects.
5518
5519 2012-03-13 Ian Lance Taylor <iant@google.com>
5520
5521 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5522 keep the larger alignment.
5523
5524 2012-03-12 Cary Coutant <ccoutant@google.com>
5525
5526 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5527 handling of DW_LNE_define_file.
5528
5529 2012-03-12 Cary Coutant <ccoutant@google.com>
5530
5531 * reduced_debug_output.cc
5532 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5533 codes to switch.
5534
5535 2012-02-29 Cary Coutant <ccoutant@google.com>
5536
5537 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5538
5539 2012-02-29 Cary Coutant <ccoutant@google.com>
5540
5541 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5542 Call Object::decompressed_section_contents.
5543 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5544 New dtor.
5545 (Sized_dwarf_line_info::buffer_start_): New data member.
5546 * merge.cc (Output_merge_data::do_add_input_section): Call
5547 Object::decompressed_section_contents.
5548 (Output_merge_string::do_add_input_section): Likewise.
5549 * object.cc (need_decompressed_section): New function.
5550 (build_compressed_section_map): Decompress sections needed later.
5551 (Sized_relobj_file::do_decompressed_section_contents): New function.
5552 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5553 * object.h (Object::decompressed_section_contents): New function.
5554 (Object::discard_decompressed_sections): New function.
5555 (Object::do_decompressed_section_contents): New function.
5556 (Object::do_discard_decompressed_sections): New function.
5557 (Compressed_section_info): New type.
5558 (Compressed_section_map): Include decompressed section contents.
5559 (Sized_relobj_file::do_decompressed_section_contents): New function.
5560 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5561
5562 2012-02-16 Cary Coutant <ccoutant@google.com>
5563
5564 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5565 * testsuite/Makefile.in: Regenerate.
5566
5567 2012-02-14 Cary Coutant <ccoutant@google.com>
5568
5569 * options.cc (General_options::finalize): Disallow -pie and -static.
5570
5571 2012-02-03 Doug Kwan <dougkwan@google.com>
5572
5573 * arm.cc (Arm_relocate_functions::abs8,
5574 Arm_relocate_functions::abs16): Use
5575 Bits::has_signed_unsigned_overflow32.
5576 (Arm_relocate_functions::thm_abs8): Correct range of
5577 overflow check.
5578 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5579 in assertions.
5580
5581 2012-02-02 Doug Kwan <dougkwan@google.com>
5582
5583 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5584 position independent outputs, not just shared objects.
5585
5586 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5587
5588 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5589 * configure: Regenerated.
5590
5591 2012-01-27 Ian Lance Taylor <iant@google.com>
5592
5593 * reloc.h (Bits): New class with static functions, copied from
5594 namespace utils in arm.cc.
5595 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5596 instead.
5597
5598 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5599
5600 * incremental.cc (write_info_blocks): Correct relocation offset.
5601
5602 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5603
5604 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5605 (Relocate::tls_gd_to_le): Likewise.
5606
5607 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5608
5609 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5610
5611 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5612
5613 * configure.ac: Check if -mcmodel=medium works.
5614 * configure: Regenerated.
5615
5616 2012-01-24 Cary Coutant <ccoutant@google.com>
5617
5618 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5619 definition and ...
5620 (read_unsigned_LEB_128_x): ... this new function.
5621 (read_signed_LEB_128): Replaced with inline definition and ...
5622 (read_signed_LEB_128_x): ... this new function.
5623 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5624 (read_unsigned_LEB_128): Add inline definition.
5625 (read_signed_LEB_128_x): New function.
5626 (read_signed_LEB_128): Add inline definition.
5627 * testsuite/Makefile.am (leb128_unittest): New unit test.
5628 * testsuite/Makefile.in: Regenerate.
5629 * testsuite/leb128_unittest.cc: New unit test.
5630
5631 2012-01-23 Ian Lance Taylor <iant@google.com>
5632
5633 PR gold/13617
5634 * i386.cc (Target_i386::do_code_fill): When using a jmp
5635 instruction, pad with nop instructions.
5636 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5637
5638 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5639
5640 * x86_64.cc (gc_process_relocs): Add typename on types used in
5641 template.
5642 (scan_relocs): Likewise.
5643 (relocate_section): Likewise.
5644 (apply_relocation): Likewise.
5645
5646 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5647
5648 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5649 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5650 under x32.
5651
5652 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5653
5654 * x86_64.cc: Initial support for x32.
5655
5656 2012-01-03 Cary Coutant <ccoutant@google.com>
5657
5658 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5659 Use abstract base class for GOT.
5660 * gold/output.h (class Output_data_got_base): New abstract base class.
5661 (class Output_data_got): Derive from new base class, adjust ctors.
5662 (Output_data_got::reserve_slot): Make virtual; rename to
5663 do_reserve_slot; Adjust callers.
5664 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5665 pointer to abstract base class.
5666 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5667
5668 2011-12-18 Ian Lance Taylor <iant@google.com>
5669
5670 * object.h (Relobj::local_symbol_value): New function.
5671 (Relobj::local_plt_offset): New function.
5672 (Relobj::local_has_got_offset): New function.
5673 (Relobj::local_got_offset): New function.
5674 (Relobj::set_local_got_offset): New function.
5675 (Relobj::do_local_symbol_value): New pure virtual function.
5676 (Relobj::do_local_plt_offset): Likewise.
5677 (Relobj::do_local_has_got_offset): Likewise.
5678 (Relobj::do_local_got_offset): Likewise.
5679 (Relobj::do_set_local_got_offset): Likewise.
5680 (Sized_relobj::do_local_has_got_offset): Rename from
5681 local_has_got_offset.
5682 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5683 (Sized_relobj::do_set_local_got_offset): Rename from
5684 set_local_got_offset.
5685 (Sized_relobj_file::do_local_plt_offset): Rename from
5686 local_plt_offset.
5687 (Sized_relobj_file::do_local_symbol_value): New function.
5688 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5689 local_plt_offset.
5690 * output.cc (Output_data_got::Got_entry::write): Change object to
5691 Relobj. Use local_symbol_value.
5692 (Output_data_got::add_global_with_rel): Change rel_dyn to
5693 Output_data_reloc_generic*. Use add_global_generic.
5694 (Output_data_got::add_global_with_rela): Remove. Change all
5695 callers to use add_global_with_rel.
5696 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5697 Output_data_reloc_generic*. Use add_global_generic.
5698 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5699 callers to use add_global_pair_with_rel.
5700 (Output_data_got::add_local): Change object to Relobj*.
5701 (Output_data_got::add_local_plt): Likewise.
5702 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5703 change rel_dyn to Output_data_reloc_generic*. Use
5704 add_local_generic.
5705 (Output_data_got::add_local_with_rela): Remove. Change all
5706 callers to use all_local_with_rel.
5707 (Output_data_got::add_local_pair_with_rel): Change object to
5708 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5709 add_output_section_generic.
5710 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5711 callers to use add_local_pair_with_rel.
5712 (Output_data_got::reserve_local): Change object to Relobj*.
5713 * output.h: (class Output_data_reloc_generic): Add pure virtual
5714 declarations for add_global_generic, add_local_generic,
5715 add_output_section_generic.
5716 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5717 functions for Output_data_reloc_generic. Update declarations for
5718 changes listed in output.cc.
5719 (class Output_data_got): Change template parameter to got_size.
5720 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5721 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5722 function.
5723 (Sized_relobj_incr::do_local_plt_offset): New function.
5724 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5725 add_global_generic.
5726
5727 2011-12-17 Cary Coutant <ccoutant@google.com>
5728
5729 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5730 * resolve.cc (Symbol_table::resolve): Likewise.
5731 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5732 arrays.
5733 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5734
5735 2011-12-16 Ian Lance Taylor <iant@google.com>
5736
5737 * output.h (Output_data_reloc_generic::add): Only call
5738 add_dynamic_reloc if this is a dynamic reloc section.
5739
5740 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5741
5742 PR gold/13505
5743 * target-reloc.h (apply_relocation): Replace <64, false> with
5744 <size, big_endian>.
5745
5746 2011-11-25 Nick Clifton <nickc@redhat.com>
5747
5748 * po/it.po: New Italian translation.
5749
5750 2011-11-17 Sterling Augustine <saugustine@google.com>
5751
5752 * script.cc (script_include_directive): Implement.
5753 (read_script_file): New local variables name and search_path. Update
5754 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5755 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5756 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5757
5758 2011-11-11 Sterling Augustine <saugustine@google.com>
5759
5760 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5761 (file_or_sections_cmd): Likewise.
5762
5763 2011-11-11 Doug Kwan <dougkwan@google.com>
5764
5765 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5766 if --just-symbols is given.
5767
5768 2011-11-10 Doug Kwan <dougkwan@google.com>
5769
5770 PR gold/13362
5771 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5772 when processing data relocs.
5773 * reloc.h (Relocate_functions::rel_unaligned): New method.
5774 (Relocate_functions::pcrel_unaligned): Ditto.
5775 (Relocate_functions::rel32_unaligned): Ditto.
5776 (Relocate_functions::pcrel32_unaligned): Ditto.
5777
5778 2011-11-09 Doug Kwan <dougkwan@google.com>
5779
5780 PR gold/13362
5781 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5782 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5783 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5784 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5785 (Relocate_functions::rel_unaligned): New.
5786 (Relocate_functions::rel32_unaligned): New.
5787 * target-reloc.h (relocate_for_relocatable): Add code to handle
5788 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5789 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5790 arm_unaligned_reloc_r): New targets.
5791 * testsuite/Makefile.in: Regenerate.
5792 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5793 linking.
5794
5795 2011-11-02 Ian Lance Taylor <iant@google.com>
5796
5797 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5798 NATIVE_LINKER.
5799 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5800 * options.cc (General_options::finalize): Use library search path
5801 from configure script if specified. If not native and no sysroot,
5802 only search TOOLLIBDIR.
5803 * options.h (Search_directory::Search_directory): Change name to
5804 const std::string&.
5805 (General_options::add_to_library_path_with_sysroot): Change arg to
5806 const std::string&.
5807 * configure, Makefile.in, config.in: Rebuild.
5808
5809 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5810
5811 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5812 we are working around the ARM1176 Erratum.
5813 * options.h (General_options::fix_arm1176): Add option.
5814 * testsuite/Makefile.am: Add testcases, and keep current ones
5815 working.
5816 * testsuite/Makefile.in: Regenerate.
5817 * testsuite/arm_fix_1176.s: New file.
5818 * testsuite/arm_fix_1176.sh: Likewise.
5819
5820 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5821
5822 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5823 may_use_blx_.
5824 (Target_arm::may_use_blx): Remove method.
5825 (Target_arm::set_may_use_blx): Likewise.
5826 (Target_arm::may_use_v4t_interworking): New method.
5827 (Target_arm::may_use_v5t_interworking): Likewise.
5828 (Target_arm::may_use_blx_): Remove member variable.
5829 (Arm_relocate_functions::arm_branch_common): Check for v5T
5830 interworking.
5831 (Arm_relocate_functions::thumb_branch_common): Likewise.
5832 (Reloc_stub::stub_type_for_reloc): Likewise.
5833 (Target_arm::do_finalize_sections): Correct interworking checks.
5834 * testsuite/Makefile.am: Add new tests.
5835 * testsuite/Makefile.in: Regenerate.
5836 * testsuite/arm_farcall_arm_arm.s: New test.
5837 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5838 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5839 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5840 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5841 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5842 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5843 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5844
5845 2011-10-31 Cary Coutant <ccoutant@google.com>
5846
5847 PR gold/13023
5848 * expression.cc (Expression::eval_with_dot): Add
5849 is_section_dot_assignment parameter.
5850 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5851 absolute and assigning to dot within a section.
5852 * script-sections.cc
5853 (Output_section_element_assignment::set_section_addresses): Pass
5854 dot_section to set_if_absolute.
5855 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5856 as is_section_dot_assignment flag to eval_with_dot.
5857 (Output_section_element_dot_assignment::set_section_addresses):
5858 Likewise.
5859 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5860 parameter. Also set value if relative to dot_section; set the
5861 symbol's output_section.
5862 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5863 parameter. Adjust all callers.
5864 (Expression::eval_maybe_dot): Likewise.
5865 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5866 Adjust all callers.
5867 * testsuite/script_test_2.t: Test assignment of an absolute value
5868 to dot within an output section element.
5869
5870 2011-10-31 Cary Coutant <ccoutant@google.com>
5871
5872 * options.h (class General_options): Add --[no-]gnu-unique options.
5873 * symtab.cc (Symbol_table::sized_write_globals): Convert
5874 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5875
5876 2011-10-31 Cary Coutant <ccoutant@google.com>
5877
5878 PR gold/13359
5879 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5880 unnecessary assertion.
5881 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5882
5883 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5884
5885 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5886 gc_mark_symbol.
5887 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5888 gc_mark_symbol.
5889 Change to just keep the section associated with symbol.
5890 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5891 they are externally visible and --export-dynamic is turned on.
5892 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5893
5894 2011-10-19 Ian Lance Taylor <iant@google.com>
5895
5896 PR gold/13163
5897 * script-sections.cc
5898 (Output_section_element_dot_assignment::needs_output_section): New
5899 function.
5900
5901 2011-10-19 Ian Lance Taylor <iant@google.com>
5902
5903 PR gold/13204
5904 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5905 --section-start option was seen.
5906 * options.h (General_options::any_section_start): New function.
5907
5908 2011-10-18 David S. Miller <davem@davemloft.net>
5909
5910 PR binutils/13301
5911 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5912 member to track relocation locations that have moved during TLS
5913 reloc optimizations.
5914 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5915 (Target_sparc::Relocate::relocate): Adjust view down by 4
5916 bytes if it matches reloc_adjust_addr_.
5917 (Target_sparc::Relocate::relocate_tls): Always move the
5918 __tls_get_addr call delay slot instruction forward 4 bytes when
5919 performing relaxation.
5920
5921 2011-10-18 Cary Coutant <ccoutant@google.com>
5922
5923 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5924 (Output_file::map_no_anonymous): Check for non-zero
5925 return code from posix_fallocate.
5926
5927 2011-10-17 Cary Coutant <ccoutant@google.com>
5928
5929 PR gold/13245
5930 * plugin.cc (is_visible_from_outside): Check for symbols
5931 referenced from dynamic objects.
5932 * resolve.cc (Symbol_table::resolve): Don't count references
5933 from dynamic objects as references from real ELF files.
5934 * testsuite/plugin_test_2.sh: Adjust expected result.
5935
5936 2011-10-17 Cary Coutant <ccoutant@google.com>
5937
5938 * gold.cc: Include timer.h.
5939 (queue_middle_tasks): Stamp time.
5940 (queue_final_tasks): Likewise.
5941 * main.cc (main): Store timer in parameters. Print timers
5942 for each pass.
5943 * parameters.cc (Parameters::Parameters): Initialize timer_.
5944 (Parameters::set_timer): New function.
5945 (set_parameters_timer): New function.
5946 * parameters.h (Parameters::set_timer): New function.
5947 (Parameters::timer): New function.
5948 (Parameters::timer_): New data member.
5949 (set_parameters_timer): New function.
5950 * timer.cc (Timer::stamp): New function.
5951 (Timer::get_pass_time): New function.
5952 * timer.h (Timer::stamp): New function.
5953 (Timer::get_pass_time): New function.
5954 (Timer::pass_times_): New data member.
5955
5956 2011-10-17 Cary Coutant <ccoutant@google.com>
5957
5958 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5959 task for members of lib groups.
5960
5961 2011-10-17 Cary Coutant <ccoutant@google.com>
5962
5963 PR gold/13288
5964 * fileread.cc (File_read::find_view): Add assert.
5965 (File_read::make_view): Move bounds check (replace with assert)...
5966 (File_read::find_or_make_view): ... to here.
5967
5968 2011-10-12 Cary Coutant <ccoutant@google.com>
5969
5970 * output.cc (Output_file::open_base_file): Handle case where
5971 ::read returns less than requested size.
5972
5973 2011-10-10 Cary Coutant <ccoutant@google.com>
5974
5975 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5976 Initialize defined_count_.
5977 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5978 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5979 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5980 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5981 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5982 * incremental.h (Sized_relobj_incr::defined_count_): New data
5983 member.
5984 (Sized_incr_dynobj::defined_count_): New data member.
5985 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5986 Return zeroes instead of internal error.
5987
5988 2011-10-10 Cary Coutant <ccoutant@google.com>
5989
5990 PR gold/13249
5991 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5992 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5993 * output.h (class Output_reloc): Add use_plt_offset flag.
5994 (Output_reloc::type_): Adjust size of bit field.
5995 (Output_reloc::use_plt_offset_): New bit field.
5996 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5997 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5998 flag. Adjust all callers.
5999 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
6000 creating RELATIVE relocations.
6001
6002 2011-10-10 Nick Clifton <nickc@redhat.com>
6003
6004 * po/es.po: Updated Spanish translation.
6005 * po/fi.po: Updated Finnish translation.
6006
6007 2011-10-03 Diego Novillo <dnovillo@google.com>
6008
6009 * options.cc (parse_uint): Fix dereference of RETVAL.
6010
6011 2011-09-29 Sriraman Tallam <tmsriram@google.com>
6012
6013 * layout.h (section_order_map_): New member.
6014 (get_section_order_map): New member function.
6015 * output.cc (Output_section::add_input_section): Check for patterns
6016 only when --section-ordering-file is specified.
6017 * gold.cc (queue_middle_tasks): Delay updating order of sections till
6018 output_sections have been formed.
6019 * layout.cc (Layout_Layout): Initialize section_order_map_.
6020 * plugin.cc (update_section_order): Store order in order_map. Do not
6021 update the order.
6022 * testsuite/Makefile.am: Add test case for plugin_final_layout.
6023 * testsuite/Makefile.in: Regenerate.
6024 * testsuite/plugin_section_order.c: New file.
6025 * testsuite/plugin_final_layout.cc: New file.
6026 * testsuite/plugin_final_layout.sh: New file.
6027
6028 2011-09-29 Cary Coutant <ccoutant@google.com>
6029
6030 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6031 Check for NULL.
6032 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
6033 symbols during incremental update.
6034 (Symbol_table::add_from_dynobj): Likewise.
6035
6036 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6037 Ian Lance Taylor <iant@google.com>
6038
6039 * symtab.cc (Symbol_table::define_special_symbol): Always
6040 canonicalize version string.
6041
6042 2011-09-26 Cary Coutant <ccoutant@google.com>
6043
6044 * gold.cc (queue_initial_tasks): Move option checks ...
6045 * options.cc (General_options::finalize): ... to here. Disable
6046 some options; make others fatal.
6047
6048 2011-09-26 Cary Coutant <ccoutant@google.com>
6049
6050 gcc PR lto/47247
6051 * plugin.cc (get_symbols_v2): New function.
6052 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
6053 (is_referenced_from_outside): New function.
6054 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
6055 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
6056 (get_symbols): Pass version parameter.
6057 (get_symbols_v2): New function.
6058 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
6059 parameter.
6060 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
6061 (onload): Add LDPT_GET_SYMBOLS_V2.
6062 (all_symbols_read_hook): Use get_symbols_v2; check for
6063 LDPR_PREVAILING_DEF_IRONLY_EXP.
6064 * testsuite/plugin_test_3.sh: Update expected results.
6065
6066 2011-09-23 Simon Baldwin <simonb@google.com>
6067
6068 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
6069 configuration options.
6070 * configure: Regenerate.
6071 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
6072 * Makefile.in: Regenerate.
6073 * testsuite/Makefile.in: Regenerate.
6074
6075 2011-09-19 Sriraman Tallam <tmsriram@google.com>
6076
6077 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
6078
6079 2011-09-19 Cary Coutant <ccoutant@google.com>
6080
6081 * incremental.cc (can_incremental_update): Fix typo in comment.
6082 * incremental.h (can_incremental_update): Likewise.
6083
6084 2011-09-18 Cary Coutant <ccoutant@google.com>
6085
6086 * incremental.cc (can_incremental_update): New function.
6087 * incremental.h (can_incremental_update): New function.
6088 * layout.cc (Layout::init_fixed_output_section): Call it.
6089 (Layout::make_output_section): Don't allow patch space in .eh_frame.
6090 * object.cc (Sized_relobj_file::do_layout): Call
6091 can_incremental_update.
6092
6093 2011-09-13 Cary Coutant <ccoutant@google.com>
6094
6095 * configure.ac: Check for glibc support for gnu_indirect_function
6096 support with static linking, setting automake conditional
6097 IFUNC_STATIC.
6098 * Makefile.in: Regenerate.
6099 * configure: Regenerate.
6100
6101 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
6102 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
6103 for IFUNC_STATIC.
6104 * testsuite/Makefile.in: Regenerate.
6105
6106 2011-09-13 Cary Coutant <ccoutant@google.com>
6107
6108 * incremental.cc (Sized_relobj_incr::do_layout): Call
6109 report_comdat_group for kept comdat sections.
6110 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
6111 * testsuite/Makefile.in: Regenerate.
6112 * testsuite/incr_comdat_test_1.cc: New source file.
6113 * testsuite/incr_comdat_test_2_v1.cc: New source file.
6114 * testsuite/incr_comdat_test_2_v2.cc: New source file.
6115 * testsuite/incr_comdat_test_2_v3.cc: New source file.
6116
6117 2011-09-13 Ian Lance Taylor <iant@google.com>
6118
6119 * object.cc (Sized_relobj_file::do_layout): Remove unused local
6120 variable external_symbols_offset.
6121
6122 2011-09-12 Ian Lance Taylor <iant@google.com>
6123
6124 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
6125 triggered if object has no symbols.
6126
6127 2011-09-09 David S. Miller <davem@davemloft.net>
6128
6129 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
6130 (Output_fill_debug_line::do_write): Likewise.
6131
6132 2011-08-29 Cary Coutant <ccoutant@google.com>
6133
6134 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6135 casts to match formatting specs.
6136 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6137
6138 2011-08-26 Cary Coutant <ccoutant@google.com>
6139
6140 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6141 remaining hole size when allocating.
6142 (Layout::make_output_section): Set fill methods for debug sections.
6143 * layout.h (Free_list::Free_list_node): Move from private to
6144 public.
6145 (Free_list::set_min_hole_size): New function.
6146 (Free_list::begin, Free_list::end): New functions.
6147 (Free_list::min_hole_): New data member.
6148 * output.cc: Include dwarf.h.
6149 (Output_fill_debug_info::do_minimum_hole_size): New function.
6150 (Output_fill_debug_info::do_write): New function.
6151 (Output_fill_debug_line::do_minimum_hole_size): New function.
6152 (Output_fill_debug_line::do_write): New function.
6153 (Output_section::Output_section): Initialize new data member.
6154 (Output_section::set_final_data_size): Ensure patch space is larger
6155 than minimum hole size.
6156 (Output_section::do_write): Fill holes in debug sections.
6157 * output.h (Output_fill): New class.
6158 (Output_fill_debug_info): New class.
6159 (Output_fill_debug_line): New class.
6160 (Output_section::set_free_space_fill): New function.
6161 (Output_section::free_space_fill_): New data member.
6162 * testsuite/Makefile.am (incremental_test_3): Add
6163 --incremental-patch option.
6164 (incremental_test_4): Likewise.
6165 (incremental_test_5): Likewise.
6166 (incremental_test_6): Likewise.
6167 (incremental_copy_test): Likewise.
6168 (incremental_common_test_1): Likewise.
6169 * testsuite/Makefile.in: Regenerate.
6170
6171 2011-08-26 Nick Clifton <nickc@redhat.com>
6172
6173 * po/es.po: Updated Spanish translation.
6174
6175 2011-08-01 Cary Coutant <ccoutant@google.com>
6176
6177 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6178 * gold/testsuite/Makefile.in: Regenerate.
6179 * gold/testsuite/justsyms_exec.c: New source file.
6180 * gold/testsuite/justsyms_lib.c: New source file.
6181
6182 2011-08-01 Cary Coutant <ccoutant@google.com>
6183
6184 * layout.cc (Layout::set_segment_offsets): Don't realign text
6185 segment if -Ttext was specified.
6186 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6187 file type.
6188 * object.h (Sized_relobj_file::e_type): New function.
6189 (Sized_relobj_file::e_type_): New data member.
6190 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6191 base address for ET_EXEC files.
6192 * target.cc (Target::do_make_elf_object_implementation): Allow
6193 ET_EXEC files with --just-symbols option.
6194
6195 2011-07-28 Cary Coutant <ccoutant@google.com>
6196
6197 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6198 Add thread_number parameter.
6199 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6200 * workqueue-threads.cc
6201 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6202 current thread if its thread number is greater than desired thread
6203 count.
6204 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6205 Add thread_number parameter.
6206 (Workqueue::should_cancel_thread): Likewise.
6207 (Workqueue::find_runnable_or_wait): Pass thread_number to
6208 should_cancel_thread.
6209 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6210 parameter.
6211
6212 2011-07-22 Sriraman Tallam <tmsriram@google.com>
6213
6214 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6215 only after checking if it cannot be forced local.
6216 * symtab.h (is_externally_visible): Check if the symbol is not forced
6217 local.
6218
6219 2011-07-15 Ian Lance Taylor <iant@google.com>
6220
6221 * options.h (class General_options): Add --print-output-format.
6222 Move -EL next to -EB, for better --help output.
6223 * target-select.cc: Include <cstdio>, "options.h", and
6224 "parameters.h".
6225 (Target_selector::do_target_bfd_name): New function.
6226 (print_output_format): New function.
6227 * target-select.h (class Target_selector): Update declarations.
6228 (Target_selector::target_bfd_name): New function.
6229 (print_output_format): Declare.
6230 * main.cc: Include "target-select.h".
6231 (main): Handle --print-output-format.
6232 * gold.cc: Include "target-select.h".
6233 (queue_initial_tasks): Handle --print-output-format when there are
6234 no input files.
6235 * parameters.cc (parameters_force_valid_target): Give a better
6236 error message if -EB/-EL does not match target.
6237 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6238 function.
6239
6240 2011-07-15 Ian Lance Taylor <iant@google.com>
6241
6242 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6243 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6244 (Output_data_plt_i386::do_write): Write address of .dynamic
6245 section to first entry in .got.plt section.
6246 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6247 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6248 Initialize layout_.
6249 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6250 section to first entry in .got.plt section.
6251 * layout.h (Layout::dynamic_section): New function.
6252
6253 2011-07-13 Sriraman Tallam <tmsriram@google.com>
6254
6255 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6256 to claim_file call.
6257 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6258 input_section_position_, and input_section_glob_.
6259 (read_layout_from_file): Call function section_ordering_specified.
6260 * layout.h (is_section_ordering_specified): New function.
6261 (section_ordering_specified): New function.
6262 (section_ordering_specified_): New boolean member.
6263 * main.cc(main): Call load_plugins after layout object is defined.
6264 * output.cc (Output_section::add_input_section): Use
6265 function section_ordering_specified to check if section ordering is
6266 needed.
6267 * output.cc (Output_section::add_relaxed_input_section): Use
6268 function section_ordering_specified to check if section ordering is
6269 needed.
6270 (Output_section::update_section_layout): New function.
6271 (Output_section::sort_attached_input_sections): Check if input section
6272 must be reordered.
6273 * output.h (Output_section::update_section_layout): New function.
6274 * plugin.cc (get_section_count): New function.
6275 (get_section_type): New function.
6276 (get_section_name): New function.
6277 (get_section_contents): New function.
6278 (update_section_order): New function.
6279 (allow_section_ordering): New function.
6280 (Plugin::load): Add the new interfaces to the transfer vector.
6281 (Plugin_manager::load_plugins): New parameter.
6282 (Plugin_manager::all_symbols_read): New parameter.
6283 (Plugin_manager::claim_file): New parameter. Save the elf object for
6284 unclaimed objects.
6285 (Plugin_manager::get_elf_object): New function.
6286 (Plugin_manager::get_view): Change to directly use the bool to check
6287 if get_view is called from claim_file_hook.
6288 * plugin.h (input_objects): New function
6289 (Plugin__manager::load_plugins): New parameter.
6290 (Plugin_manager::claim_file): New parameter.
6291 (Plugin_manager::get_elf_object): New function.
6292 (Plugin_manager::in_claim_file_handler): New function.
6293 (Plugin_manager::in_claim_file_handler_): New member.
6294 (layout): New function.
6295 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6296 handler with an extra parameter. Make the elf object before calling
6297 claim_file handler.
6298 * testsuite/plugin_test.c (get_section_count): New function pointer.
6299 (get_section_type): New function pointer.
6300 (get_section_name): New function pointer.
6301 (get_section_contents): New function pointer.
6302 (update_section_order): New function pointer.
6303 (allow_section_ordering): New function pointer.
6304 (onload): Check if the new interfaces exist.
6305
6306 2011-07-13 Ian Lance Taylor <iant@google.com>
6307
6308 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6309 relro section.
6310 * x86_64.cc (Target_x86_64::got_section): Likewise.
6311 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6312 (relro_now_test_SOURCES): New variable.
6313 (relro_now_test_DEPENDENCIES): New variable.
6314 (relro_now_test_LDFLAGS): New variable.
6315 (relro_now_test_LDADD): New variable.
6316 (relro_now_test.so): New target.
6317 * testsuite/Makefile.in: Rebuild.
6318
6319 2011-07-12 Ian Lance Taylor <iant@google.com>
6320
6321 PR gold/12980
6322 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6323 GLOB_DAT relocation rather than a RELATIVE relocation for a
6324 protected symbol when creating a shared library.
6325 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6326 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6327 * testsuite/protected_main_1.cc (main): Test that protected
6328 function has same address.
6329
6330 2011-07-11 Ian Lance Taylor <iant@google.com>
6331
6332 PR gold/12979
6333 * options.h (class General_options): Add -Bgroup.
6334 * options.cc (General_options::finalize): If -Bgroup is set,
6335 default to --unresolved-symbols=report-all.
6336 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6337 * target-reloc.h (issue_undefined_symbol_error): Handle
6338 --unresolved-symbols=report-all.
6339
6340 2011-07-08 Ian Lance Taylor <iant@google.com>
6341
6342 PR gold/11985
6343 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6344 if linker script discards key sections.
6345 (Layout::create_dynamic_symtab): Likewise.
6346 (Layout::assign_local_dynsym_offsets): Likewise.
6347 (Layout::sized_create_version_sections): Likewise.
6348 (Layout::create_interp): Likewise.
6349 (Layout::finish_dynamic_section): Likewise.
6350 (Layout::set_dynamic_symbol_size): Likewise.
6351
6352 2011-07-08 Ian Lance Taylor <iant@google.com>
6353
6354 PR gold/12386
6355 * options.h (class General_options): Add --unresolved-symbols.
6356 * target-reloc.h (issue_undefined_symbol_error): Check
6357 --unresolved-symbols. Add comments.
6358
6359 2011-07-08 Ian Lance Taylor <iant@google.com>
6360
6361 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6362 expression more complex.
6363
6364 2011-07-08 Ian Lance Taylor <iant@google.com>
6365
6366 PR gold/11317
6367 * target-reloc.h (issue_undefined_symbol_error): New inline
6368 function, broken out of relocate_section.
6369 (relocate_section): Call issue_undefined_symbol_error.
6370 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6371 there is no TLS segment if we are about to issue an undefined
6372 symbol error.
6373 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6374
6375 2011-07-08 Ian Lance Taylor <iant@google.com>
6376
6377 PR gold/12279
6378 * resolve.cc (Symbol_table::should_override): Add fromtype
6379 parameter. Change all callers. Give error when linking together
6380 TLS and non-TLS symbol.
6381 (Symbol_table::should_override_with_special): Add fromtype
6382 parameter. Change all callers.
6383 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6384 there is no TLS segment if we have reported some errors.
6385 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6386
6387 2011-07-08 Ian Lance Taylor <iant@google.com>
6388
6389 PR gold/12372
6390 * target.h (Target::plt_address_for_global): New function.
6391 (Target::plt_address_for_local): New function.
6392 (Target::plt_section_for_global): Remove.
6393 (Target::plt_section_for_local): Remove.
6394 (Target::do_plt_address_for_global): New virtual function.
6395 (Target::do_plt_address_for_local): New virtual function.
6396 (Target::do_plt_section_for_global): Remove.
6397 (Target::do_plt_section_for_local): Remove.
6398 (Target::register_global_plt_entry): Add Symbol_table and Layout
6399 parameters.
6400 * output.cc (Output_data_got::Got_entry::write): Use
6401 plt_address_for_global and plt_address_for_local.
6402 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6403 address of output section.
6404 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6405 got_irelative_, and irelative_count_ fields. Update
6406 declarations.
6407 (Output_data_plt_i386::has_irelative_section): New function.
6408 (Output_data_plt_i386::entry_count): Add irelative_count_.
6409 (Output_data_plt_i386::set_final_data_size): Likewise.
6410 (class Target_i386): Add got_irelative_ and rel_irelative_
6411 fields. Update declarations.
6412 (Target_i386::Target_i386): Initialize new fields.
6413 (Target_i386::do_plt_address_for_global): New function replacing
6414 do_plt_section_for_global.
6415 (Target_i386::do_plt_address_for_local): New function replacing
6416 do_plt_section_for_local.
6417 (Target_i386::got_section): Create got_irelative_.
6418 (Target_i386::rel_irelative_section): New function.
6419 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6420 fields. Don't define __rel_iplt_{start,end}.
6421 (Output_data_plt_i386::add_entry): Add symtab and layout
6422 parameters. Change all callers. Use different PLT and GOT for
6423 IFUNC symbols.
6424 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6425 layout parameters. Change all callers. Use different PLT and
6426 GOT.
6427 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6428 (Output_data_plt_i386::rel_irelative): New function.
6429 (Output_data_plt_i386::address_for_global): New function.
6430 (Output_data_plt_i386::address_for_local): New function.
6431 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6432 IRELATIVE GOT when changing IFUNC GOT entries.
6433 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6434 reloc.
6435 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6436 if we didn't create an IRELATIVE GOT.
6437 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6438 plt_address_for_local.
6439 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6440 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6441 got_irelative_, and irelative_count_ fields. Update
6442 declarations.
6443 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6444 Initialize new fields. Remove symtab parameter. Change all
6445 callers.
6446 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6447 irelative_count_.
6448 (Output_data_plt_x86_64::has_irelative_section): New function.
6449 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6450 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6451 fields. Update declarations.
6452 (Target_x86_64::Target_x86_64): Initialize new fields.
6453 (Target_x86_64::do_plt_address_for_global): New function replacing
6454 do_plt_section_for_global.
6455 (Target_x86_64::do_plt_address_for_local): New function replacing
6456 do_plt_section_for_local.
6457 (Target_x86_64::got_section): Create got_irelative_.
6458 (Target_x86_64::rela_irelative_section): New function.
6459 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6460 all callers. Don't create __rel_iplt_{start,end}.
6461 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6462 parameters. Change all callers. Use different PLT and GOT for
6463 IFUNC symbols.
6464 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6465 layout parameters. Change all callers. Use different PLT and
6466 GOT.
6467 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6468 parameters. Change all callers. Use different PLT and GOT for
6469 IFUNC symbols.
6470 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6471 (Output_data_plt_x86_64::rela_irelative): New function.
6472 (Output_data_plt_x86_64::address_for_global): New function.
6473 (Output_data_plt_x86_64::address_for_local): New function.
6474 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6475 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6476 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6477 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6478 parameters.
6479 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6480 reloc.
6481 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6482 symbols if we didn't create an IRELATIVE GOT.
6483 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6484 plt_address_for_local.
6485 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6486 * testsuite/ifuncvar1.c: New test file.
6487 * testsuite/ifuncvar2.c: New test file.
6488 * testsuite/ifuncvar3.c: New test file.
6489 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6490 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6491 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6492 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6493 * testsuite/Makefile.in: Rebuild.
6494
6495 2011-07-07 Cary Coutant <ccoutant@google.com>
6496
6497 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6498 (two_file_test_1_ndebug.o): Likewise.
6499 (two_file_test_1b_ndebug.o): Likewise.
6500 (two_file_test_2_ndebug.o): Likewise.
6501 (two_file_test_main_ndebug.o): Likewise.
6502 (incremental_test_2): Link with no-debug versions.
6503
6504 2011-07-06 Cary Coutant <ccoutant@google.com>
6505
6506 * gold/incremental.cc
6507 (Output_section_incremental_inputs::write_info_blocks): Check for
6508 hidden and internal symbols.
6509
6510 2011-07-06 Cary Coutant <ccoutant@google.com>
6511
6512 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6513 Check disposition for startup file.
6514 (Incremental_inputs::report_command_line): Ignore
6515 --incremental-startup-unchanged option.
6516 * options.cc (General_options::parse_incremental_startup_unchanged):
6517 New function.
6518 (General_options::General_options): Initialize new data member.
6519 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6520 (General_options): Add --incremental-startup-unchanged option.
6521 (General_options::incremental_startup_disposition): New function.
6522 (General_options::incremental_startup_disposition_): New data member.
6523
6524 2011-07-06 Cary Coutant <ccoutant@google.com>
6525
6526 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6527 input file index to Script_info ctor.
6528 (Sized_incremental_binary::do_file_has_changed): Find the
6529 command-line argument for files named in scripts.
6530 * incremental.h (Script_info::Script_info): New ctor
6531 with input file index.
6532 (Script_info::input_file_index): New function.
6533 (Script_info::input_file_index_): New data member.
6534 (Incremental_binary::get_library): Add const.
6535 (Incremental_binary::get_script_info): Add const.
6536 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6537 * testsuite/Makefile.am (incremental_test_5): New test case.
6538 (incremental_test_6): New test case.
6539 * testsuite/Makefile.in: Regenerate.
6540
6541 2011-07-06 Cary Coutant <ccoutant@google.com>
6542
6543 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6544 debug output when command lines differ.
6545
6546 2011-07-06 Cary Coutant <ccoutant@google.com>
6547
6548 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6549 --incremental-patch option.
6550 * layout.cc (Free_list::allocate): Extend allocation beyond original
6551 end if enabled.
6552 (Layout::make_output_section): Mark sections that should get
6553 patch space.
6554 * options.cc (parse_percent): New function.
6555 * options.h (parse_percent): New function.
6556 (DEFINE_percent): New macro.
6557 (General_options): Add --incremental-patch option.
6558 * output.cc (Output_section::Output_section): Initialize new data
6559 members.
6560 (Output_section::add_input_section): Print section name when out
6561 of patch space.
6562 (Output_section::add_output_section_data): Likewise.
6563 (Output_section::set_final_data_size): Add patch space when
6564 doing --incremental-full.
6565 (Output_section::do_reset_address_and_file_offset): Remove patch
6566 space.
6567 (Output_segment::set_section_list_addresses): Print debug output
6568 only if --incremental-update.
6569 * output.h (Output_section::set_is_patch_space_allowed): New function.
6570 (Output_section::is_patch_space_allowed_): New data member.
6571 (Output_section::patch_space_): New data member.
6572 * parameters.cc (Parameters::incremental_full): New function.
6573 * parameters.h (Parameters::incremental_full): New function
6574 * testsuite/Makefile.am (incremental_test_2): Add test for
6575 --incremental-patch option.
6576 * testsuite/Makefile.in: Regenerate.
6577 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6578 (t18): Remove function body.
6579
6580 2011-07-05 Doug Kwan <dougkwan@google.com>
6581
6582 PR gold/12771
6583 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6584 Arm_Address type for relocation result.
6585 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6586 overflow check.
6587 (Arm_relocate_functions::abs32): Use unaligned access.
6588 (Arm_relocate_functions::rel32): Ditto.
6589 (Arm_relocate_functions::prel31): Ditto.
6590 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6591 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6592 static data relocations.
6593 * testsuite/Makefile.in: Regnerate.
6594 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6595
6596 2011-07-05 Ian Lance Taylor <iant@google.com>
6597
6598 PR gold/12392
6599 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6600 symbols if necessary.
6601 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6602
6603 2011-07-05 Ian Lance Taylor <iant@google.com>
6604
6605 PR gold/12952
6606 * resolve.cc (Symbol::override_base_with_special): Simply override
6607 version with special symbol version, ignoring previous version.
6608
6609 2011-07-05 Ian Lance Taylor <iant@google.com>
6610
6611 * object.cc (Sized_relobj_file::include_section_group): Add
6612 information to comment about signature location.
6613
6614 2011-07-02 Ian Lance Taylor <iant@google.com>
6615
6616 PR gold/12957
6617 * options.h (class General_options): Add -f and -F.
6618 * options.cc (General_options::finalize): Fatal error if -f/-F
6619 are used without -shared.
6620 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6621
6622 2011-07-02 Ian Lance Taylor <iant@google.com>
6623
6624 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6625
6626 2011-07-01 Ian Lance Taylor <iant@google.com>
6627
6628 PR gold/12525
6629 PR gold/12952
6630 * resolve.cc (Symbol::override_base_with_special): Don't override
6631 the version if the overriding symbol has a different name.
6632 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6633 all callers. If we give an error about an undefined version,
6634 define the base version if necessary.
6635 * dynobj.h (class Versions): Update declaration.
6636 * testsuite/weak_alias_test_5.cc: New file.
6637 * testsuite/weak_alias_test.script: New file.
6638 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6639 and versioned_alias have the right value, and call t2.
6640 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6641 weak_alias_test_5.so.
6642 (weak_alias_test_LDADD): Likewise.
6643 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6644 * testsuite/Makefile.in: Rebuild.
6645
6646 2011-07-01 Ian Lance Taylor <iant@google.com>
6647
6648 PR gold/12525
6649 * options.h (class General_options): Support -z notext.
6650 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6651 -Wl,-z,notext.
6652 (two_file_shared_nonpic.so): Likewise.
6653 (two_file_shared_mixed.so): Likewise.
6654 (two_file_shared_mixed_1.so): Likewise.
6655 (weak_undef_lib_nonpic.so): Likewise.
6656 (alt/weak_undef_lib_nonpic.so): Likewise.
6657 (tls_test_shared_nonpic.so): Likewise.
6658 * testsuite/Makefile.in: Rebuild.
6659
6660 2011-07-01 Ian Lance Taylor <iant@google.com>
6661
6662 PR gold/12525
6663 * configure.ac: Test whether static linking works, setting
6664 the automake conditional HAVE_STATIC.
6665 * testsuite/Makefile.am: Disable tests using -static if
6666 HAVE_STATIC is not true.
6667 * configure, testsuite/Makefile.in: Rebuild.
6668
6669 2011-07-01 Ian Lance Taylor <iant@google.com>
6670
6671 PR gold/12525
6672 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6673 Assert if we see DW_EH_PE_indirect.
6674 * target.h (Target::ehframe_datarel_base): New function.
6675 (Target::do_ehframe_datarel_base): New target function.
6676 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6677 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6678 function.
6679
6680 2011-07-01 Ian Lance Taylor <iant@google.com>
6681
6682 PR gold/12571
6683 * options.h (class General_options): Add
6684 --ld-generated-unwind-info.
6685 * ehframe.cc (Fde::write): Add address parameter. Change all
6686 callers. If associated with PLT, fill in address and size.
6687 (Cie::set_output_offset): Only add merge mapping if there is an
6688 object.
6689 (Cie::write): Add address parameter. Change all callers.
6690 (Eh_frame::add_ehframe_for_plt): New function.
6691 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6692 input_offset_ fields into union u_, with new plt field.
6693 (Fde::Fde): Adjust for new union field.
6694 (Fde::Fde) [Output_data version]: New constructor.
6695 (Fde::add_mapping): Only add merge mapping if there is an object.
6696 (class Cie): Update declarations.
6697 (class Eh_frame): Declare add_ehframe_for_plt.
6698 * layout.cc (Layout::layout_eh_frame): Break out code into
6699 make_eh_frame_section, and call it.
6700 (Layout::make_eh_frame_section): New function.
6701 (Layout::add_eh_frame_for_plt): New function.
6702 * layout.h (class Layout): Update declarations.
6703 * merge.cc (Merge_map::add_mapping): Add assertion.
6704 * i386.cc: Include "dwarf.h".
6705 (class Output_data_plt_i386): Make first_plt_entry,
6706 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6707 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6708 and plt_eh_frame_fde.
6709 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6710 boundary. Call add_eh_frame_for_plt if appropriate.
6711 * x86_64.cc: Include "dwarf.h".
6712 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6713 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6714 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6715 and plt_eh_frame_fde.
6716 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6717 appropriate.
6718
6719 2011-06-29 Ian Lance Taylor <iant@google.com>
6720
6721 PR gold/12629
6722 * object.cc (Sized_relobj_file::layout_section): Change shdr
6723 parameter to be const.
6724 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6725 out of do_layout.
6726 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6727 appropriate. Call layout_eh_frame_section.
6728 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6729 sections.
6730 * object.h (class Sized_relobj_file): Update declarations.
6731
6732 2011-06-29 Ian Lance Taylor <iant@google.com>
6733
6734 PR gold/12652
6735 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6736 modifier.
6737 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6738
6739 2011-06-29 Ian Lance Taylor <iant@google.com>
6740
6741 PR gold/12675
6742 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6743 SHT_X86_64_UNWIND.
6744 * layout.cc (Layout::layout_eh_frame): Likewise.
6745
6746 2011-06-29 Ian Lance Taylor <iant@google.com>
6747
6748 PR gold/12695
6749 * layout.cc (Layout::symtab_section_shndx): New function.
6750 * layout.h (class Layout): Declare symtab_section_shndx.
6751 * output.cc (Output_section::write_header): Call it.
6752
6753 2011-06-29 Ian Lance Taylor <iant@google.com>
6754
6755 PR gold/12818
6756 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6757 symbols which are not used in a relocation.
6758
6759 2011-06-28 Ian Lance Taylor <iant@google.com>
6760
6761 PR gold/12898
6762 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6763 script create indistinguishable segments.
6764 (Layout::set_segment_offsets): Use stable_sort when sorting
6765 segments. Pass this to Compare_segments constructor.
6766 * layout.h (class Layout): Make segment_precedes non-static.
6767 (class Compare_segments): Change from struct to class. Add
6768 layout_ field. Add constructor.
6769 * script-sections.cc
6770 (Script_sections::attach_sections_using_phdrs_clause): Rename
6771 local orphan to is_orphan. Don't report failure to put empty
6772 section in segment. On attachment failure, report name of
6773 section, and attach to first PT_LOAD segment.
6774
6775 2011-06-28 Ian Lance Taylor <iant@google.com>
6776
6777 PR gold/12934
6778 * target-select.cc (Target_selector::Target_selector): Add
6779 emulation parameter. Change all callers.
6780 (select_target_by_bfd_name): Rename from select_target_by_name.
6781 Change all callers.
6782 (select_target_by_emulation): New function.
6783 (supported_emulation_names): New function.
6784 * target-select.h (class Target_selector): Add emulation_ field.
6785 Update declarations.
6786 (Target_selector::recognize_by_bfd_name): Rename from
6787 recognize_by_name. Change all callers.
6788 (Target_selector::supported_bfd_names): Rename from
6789 supported_names. Change all callers.
6790 (Target_selector::recognize_by_emulation): New function.
6791 (Target_selector::supported_emulations): New function.
6792 (Target_selector::emulation): New function.
6793 (Target_selector::do_recognize_by_bfd_name): Rename from
6794 do_recognize_by_name. Change all callers.
6795 (Target_selector::do_supported_bfd_names): Rename from
6796 do_supported_names. Change all callers.
6797 (Target_selector::do_recognize_by_emulation): New function.
6798 (Target_selector::do_supported_emulations): New function.
6799 (select_target_by_bfd_name): Change name in declaration.
6800 (select_target_by_emulation): Declare.
6801 (supported_emulation_names): Declare.
6802 * parameters.cc (parameters_force_valid_target): Try to find
6803 target based on emulation from -m option.
6804 * options.h (class General_options): Change doc string for -m.
6805 * options.cc (help): Print emulations.
6806 (General_options::parse_V): Likewise.
6807 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6808 Add emulation parameter. Change all callers.
6809
6810 2011-06-28 Ian Lance Taylor <iant@google.com>
6811
6812 * target.h (class Target): Add osabi_ field.
6813 (Target::osabi): New function.
6814 (Target::set_osabi): New function.
6815 (Target::Target): Initialize osabi_.
6816 (Target::do_adjust_elf_header): Make pure virtual.
6817 (Sized_target::do_adjust_elf_header): Declare.
6818 * target.cc (Sized_target::do_adjust_elf_header): New function.
6819 (class Sized_target): Instantiate all versions.
6820 * freebsd.h (class Target_freebsd): Remove.
6821 (Target_selector_freebsd::do_recognize): Call set_osabi on
6822 Target.
6823 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6824 (Target_selector_freebsd::set_osabi): Remove.
6825 * i386.cc (class Target_i386): Inherit from Sized_target rather
6826 than Target_freebsd.
6827 * x86_64.cc (class Target_x86_64): Likewise.
6828
6829 2011-06-28 Ian Lance Taylor <iant@google.com>
6830
6831 * target.h (Target::can_check_for_function_pointers): Rewrite.
6832 Make non-virtual.
6833 (Target::can_icf_inline_merge_sections): Likewise.
6834 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6835 (Target::Target_info): Add can_icf_inline_merge_sections field.
6836 (Target::do_can_check_for_function_pointers): New virtual
6837 function.
6838 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6839 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6840 from can_check_for_function_pointers, move in file.
6841 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6842 section_may_have_icf_unsafe_poineters, move in file.
6843 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6844 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6845 Rename from can_check_for_function_pointers, move in file.
6846 (Target_i386::can_icf_inline_merge_sections): Remove.
6847 (Target_i386::i386_info): Initialize
6848 can_icf_inline_merge_sections.
6849 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6850 Initialize can_icf_inline_merge_sections.
6851 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6852 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6853 Rename from can_check_for_function_pointers, move in file.
6854 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6855 (Target_x86_64::x86_64_info): Initialize
6856 can_icf_inline_merge_sections.
6857 * testsuite/testfile.cc (Target_test::test_target_info):
6858 Likewise.
6859 * icf.cc (get_section_contents): Correct formatting.
6860
6861 2011-06-27 Ian Lance Taylor <iant@google.com>
6862
6863 * symtab.cc (Symbol::versioned_name): New function.
6864 (Symbol_table::add_to_final_symtab): Use versioned_name when
6865 appropriate.
6866 (Symbol_table::sized_write_symbol): Likewise.
6867 * symtab.h (class Symbol): Declare versioned_name.
6868 * stringpool.h (class Stringpool_template): Add variant of add
6869 which takes a std::basic_string.
6870 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6871 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6872 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6873 (ver_test_12.o): New target.
6874 * testsuite/Makefile.in: Rebuild.
6875
6876 2011-06-27 Doug Kwan <dougkwan@google.com>
6877
6878 * arm.cc (Arm_relocate_functions::thm_jump8,
6879 Arm_relocate_functions::thm_jump11): Use a wider signed
6880 type to compute offset.
6881 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6882 arm_thm_jump8.
6883 * testsuite/Makefile.in: Regenerate.
6884 * testsuite/arm_branch_in_range.sh: Check test results of
6885 arm_thm_jump11 and arm_thm_jump8.
6886 * testsuite/arm_thm_jump11.s: New test source file.
6887 * testsuite/arm_thm_jump11.t: New linker script.
6888 * testsuite/arm_thm_jump8.s: New test source file.
6889 * testsuite/arm_thm_jump8.t: New linker script.
6890
6891 2011-06-24 Ian Lance Taylor <iant@google.com>
6892
6893 * layout.cc: Include "object.h".
6894 (ctors_sections_in_init_array): New static variable.
6895 (Layout::is_ctors_in_init_array): New function.
6896 (Layout::layout): Add entry to ctors_sections_in_init_array if
6897 appropriate.
6898 * layout.h (class Layout): Declare is_ctors_in_init_array.
6899 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6900 is_ctors_reverse_view is set.
6901 (Sized_relobj_file::write_sections): Add layout parameter. Change
6902 all callers. Set is_ctors_reverse_view field of View_size.
6903 (Sized_relobj_file::reverse_words): New function.
6904 * object.h (Sized_relobj_file::View_size): Add
6905 is_ctors_reverse_view field.
6906 (class Sized_relobj_file): Update declarations.
6907 * testsuite/initpri3.c: New test.
6908 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6909 initpri3b.
6910 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6911 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6912 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6913 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6914 * testsuite/Makefile.in: Rebuild.
6915
6916 2011-06-24 Cary Coutant <ccoutant@google.com>
6917
6918 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6919 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6920 (debug_msg_cdebug.err): New targets.
6921 * testsuite/Makefile.in: Regenerate.
6922 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6923 Fix checks for link with shared library.
6924
6925 2011-06-24 Doug Kwan <dougkwan@google.com>
6926
6927 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6928 skip empty text sections.
6929 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6930
6931 2011-06-22 Ian Lance Taylor <iant@google.com>
6932
6933 PR gold/12910
6934 * options.h (class General_options): Add --ctors-in-init-array.
6935 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6936 friends as SHT_PROGBITS for merging sections.
6937 (Layout::layout): Remove special handling of .init_array and
6938 friends. Don't sort if doing relocatable link. Sort for .ctors
6939 and .dtors if ctors_in_init_array.
6940 (Layout::make_output_section): Force correct section types for
6941 .init_array and friends. Don't sort if doing relocatable link,
6942 Don't sort .ctors and .dtors if ctors_in_init_array.
6943 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6944 (Layout::output_section_name): Add relobj parameter. Change all
6945 callers. Handle .ctors. and .dtors. in code rather than table.
6946 Handle .ctors and .dtors if ctors_in_init_array.
6947 (Layout::match_file_name): New function, moved from output.cc.
6948 * layout.h (class Layout): Update declarations.
6949 * output.cc: Include "layout.h".
6950 (Input_section_sort_entry::get_priority): New function.
6951 (Input_section_sort_entry::match_file_name): Just call
6952 Layout::match_file_name.
6953 (Output_section::Input_section_sort_init_fini_compare::operator()):
6954 Handle .ctors and .dtors. Sort by explicit priority rather than
6955 by name.
6956 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6957 * testsuite/initpri2.c: New test.
6958 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6959 (check_PROGRAMS): Add initpri2.
6960 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6961 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6962 * configure, testsuite/Makefile.in: Rebuild.
6963
6964 2011-06-19 Ian Lance Taylor <iant@google.com>
6965
6966 PR gold/12880
6967 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6968 .interp section to a PT_INTERP segment even if we have seen a
6969 --dynamic-linker option. Don't do it if we have seen a PHDRS
6970 clause in a linker script.
6971 (Layout::finalize): Don't create a .interp section if we've
6972 already create a PT_INTERP segment.
6973 (Layout::create_interp): Always call choose_output_section (revert
6974 patch of 2011-06-17). Don't create PT_INTERP segment.
6975 * script-sections.cc
6976 (Script_sections::create_note_and_tls_segments): Add a .interp
6977 section to a PT_INTERP segment even if we have seen a
6978 --dynamic-linker option.
6979
6980 2011-06-18 Ian Lance Taylor <iant@google.com>
6981
6982 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6983 merely because a non-PT_LOAD segment has a dynamic reloc.
6984
6985 2011-06-18 Ian Lance Taylor <iant@google.com>
6986
6987 * layout.cc (Layout::finish_dynamic_section): Don't create
6988 DT_FLAGS entry if not needed.
6989
6990 2011-06-18 Ian Lance Taylor <iant@google.com>
6991
6992 PR gold/12745
6993 * layout.cc (Layout::layout_eh_frame): Correct handling of
6994 writable .eh_frame section.
6995
6996 2011-06-17 Ian Lance Taylor <iant@google.com>
6997
6998 PR gold/12893
6999 * resolve.cc (Symbol_table::resolve): Don't give an error if a
7000 symbol is redefined with the exact same object and value.
7001
7002 2011-06-17 Ian Lance Taylor <iant@google.com>
7003
7004 PR gold/12880
7005 * layout.h (class Layout): Add interp_segment_ field.
7006 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
7007 (Layout::attach_allocated_section_to_segment): If making shared
7008 library, put .interp section in PT_INTERP segment.
7009 (Layout::finalize): Also call create_interp if -dynamic-linker
7010 option was used.
7011 (Layout::create_interp): Assert that there is no PT_INTERP
7012 segment. If not using a SECTIONS clause, use make_output_section.
7013 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
7014 * script-sections.cc
7015 (Script_sections::create_note_and_tls_segments): If making shared
7016 library, put .interp section in PT_INTERP segment.
7017
7018 2011-06-17 Ian Lance Taylor <iant@google.com>
7019
7020 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
7021 when making a shared library.
7022
7023 2011-06-17 Ian Lance Taylor <iant@google.com>
7024
7025 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
7026 parameter. Change all callers. Don't issue warning about PC32
7027 against locally defined symbol.
7028
7029 2011-06-16 Ian Lance Taylor <iant@google.com>
7030
7031 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
7032 occurs in same object.
7033
7034 2011-06-14 Alan Modra <amodra@gmail.com>
7035
7036 * po/POTFILES.in: Regenerate.
7037
7038 2011-06-09 Ian Lance Taylor <iant@google.com>
7039
7040 * script-sections.cc
7041 (Orphan_output_section::set_section_addresses): For a relocatable
7042 link set address to 0.
7043
7044 2011-06-09 Cary Coutant <ccoutant@google.com>
7045
7046 PR gold/12804
7047 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
7048 used with --compress-debug-sections.
7049 * gold/object.cc (Sized_relobj_file::do_layout): Report
7050 uncompressed size of compressed input sections.
7051
7052 2011-06-08 Cary Coutant <ccoutant@google.com>
7053
7054 PR gold/12804
7055 * testsuite/two_file_test_2_v1.cc: Change initialization of
7056 v2 to keep it in .data.
7057
7058 2011-06-07 Cary Coutant <ccoutant@google.com>
7059
7060 * common.cc (Symbol_table::do_allocate_commons_list): Call
7061 gold_fallback.
7062 * errors.cc (Errors::fatal): Adjust call to gold_exit.
7063 (Errors::fallback): New function.
7064 (gold_fallback): New function.
7065 * errors.h (Errors::fallback): New function.
7066 * gold.cc (gold_exit): Change status parameter to enum; adjust
7067 all callers.
7068 (queue_initial_tasks): Call gold_fallback.
7069 * gold.h: Include cstdlib.
7070 (Exit_status): New enum type.
7071 (gold_exit): Change status parameter to enum.
7072 (gold_fallback): New function.
7073 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
7074 (Layout::create_symtab_sections): Likewise.
7075 (Layout::create_shdrs): Likewise.
7076 * main.cc (main): Adjust call to gold_exit.
7077 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
7078 (Output_data_got::add_got_entry_pair): Likewise.
7079 (Output_section::add_input_section): Likewise.
7080 (Output_section::add_output_section_data): Likewise.
7081 (Output_segment::set_section_list_addresses): Likewise.
7082 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
7083
7084 2011-06-07 Cary Coutant <ccoutant@google.com>
7085
7086 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
7087 for incremental links.
7088 * output.cc (Output_segment::set_section_list_addresses): Remove
7089 FIXME and test for TLS or BSS.
7090
7091 2011-06-07 Cary Coutant <ccoutant@google.com>
7092
7093 * testsuite/Makefile.am: Add incremental_copy_test,
7094 incremental_common_test_1.
7095 * testsuite/Makefile.in: Regenerate.
7096 * testsuite/common_test_1_v1.c: New source file.
7097 * testsuite/common_test_1_v2.c: New source file.
7098 * testsuite/copy_test_v1.cc: New source file.
7099
7100 2011-06-07 Cary Coutant <ccoutant@google.com>
7101
7102 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
7103 update, allocate common from bss section's free list.
7104 * incremental-dump.cc (dump_incremental_inputs): Print flag for
7105 linker-defined symbols.
7106 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
7107 Skip GOT and PLT entries that are no longer referenced.
7108 (Output_section_incremental_inputs::write_info_blocks): Mark
7109 linker-defined symbols.
7110 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
7111 * output.cc (Output_section::allocate): New function.
7112 * output.h (Output_section::allocate): New function.
7113 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
7114 linker-defined symbols.
7115 (Symbol::override_base_with_special): Copy is_predefined_ flag.
7116 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
7117 (Symbol::init_base_output_data): Likewise.
7118 (Symbol::init_base_output_segment): Likewise.
7119 (Symbol::init_base_constant): Likewise.
7120 (Sized_symbol::init_output_data): Likewise.
7121 (Sized_symbol::init_output_segment): Likewise.
7122 (Sized_symbol::init_constant): Likewise.
7123 (Symbol_table::do_define_in_output_data): Likewise.
7124 (Symbol_table::do_define_in_output_segment): Likewise.
7125 (Symbol_table::do_define_as_constant): Likewise.
7126 * symtab.h (Symbol::is_predefined): New function.
7127 (Symbol::init_base_output_data): Add is_predefined parameter.
7128 (Symbol::init_base_output_segment): Likewise.
7129 (Symbol::init_base_constant): Likewise.
7130 (Symbol::is_predefined_): New data member.
7131 (Sized_symbol::init_output_data): Add is_predefined parameter.
7132 (Sized_symbol::init_output_segment): Likewise.
7133 (Sized_symbol::init_constant): Likewise.
7134 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7135
7136 2011-06-07 Cary Coutant <ccoutant@google.com>
7137
7138 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7139 instead of emit_copy_reloc.
7140 (Copy_relocs::emit_copy_reloc): Refactor.
7141 (Copy_relocs::make_copy_reloc): New function.
7142 (Copy_relocs::add_copy_reloc): Remove.
7143 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7144 section.
7145 (Copy_relocs::make_copy_reloc): New function.
7146 (Copy_relocs::add_copy_reloc): Remove.
7147 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7148 unchanged input files.
7149 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7150 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7151 Reserve BSS space for COPY relocations.
7152 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7153 (Output_section_incremental_inputs::write_info_blocks): Record
7154 whether a symbol is copied from a shared object.
7155 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7156 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7157 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7158 (Incremental_input_entry_reader::get_output_symbol_index): Add
7159 is_copy parameter.
7160 (Incremental_binary::emit_copy_relocs): New function.
7161 (Incremental_binary::do_emit_copy_relocs): New function.
7162 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7163 new data member.
7164 (Sized_incremental_binary::add_copy_reloc): New function.
7165 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7166 (Sized_incremental_binary::Copy_reloc): New struct.
7167 (Sized_incremental_binary::Copy_relocs): New typedef.
7168 (Sized_incremental_binary::copy_relocs_): New data member.
7169 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7170 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7171 * target.h (Sized_target::emit_copy_reloc): New function.
7172 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7173
7174 2011-06-02 Cary Coutant <ccoutant@google.com>
7175
7176 PR gold/12163
7177 * gold/archive.cc (Archive::Archive): Initialize new data member.
7178 (Archive::include_all_members): Return if archive has already been
7179 included.
7180 * gold/archive.h (Archive::include_all_members_): New data member.
7181
7182 2011-06-02 Nick Clifton <nickc@redhat.com>
7183
7184 * dynobj.h: Fix spelling mistake in comment.
7185 * output.cc: Likewise.
7186
7187 2011-05-31 Doug Kwan <dougkwan@google.com>
7188 Asier Llano
7189
7190 PR gold/12826
7191 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
7192 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7193 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7194 redundant arm_exidx_test.so.
7195 * testsuite/Makefile.in: Regenerate.
7196 (check_SCRIPTS): Add pr12826.sh
7197 (check_DATA): Add pr12826.stdout
7198 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7199 * testsuite/pr12826.sh: New file.
7200 * testsuite/pr12826_1.s: Ditto.
7201 * testsuite/pr12826_1.s: Ditto.
7202
7203 2011-05-30 Ian Lance Taylor <iant@google.com>
7204
7205 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7206 sections.
7207
7208 2011-05-29 Ian Lance Taylor <iant@google.com>
7209
7210 PR gold/12804
7211 * testsuite/Makefile.am: Use different file name for two_file_test
7212 temporary file for each incremental test.
7213 * testsuite/Makefile.in: Rebuild.
7214
7215 2011-05-29 Ian Lance Taylor <iant@google.com>
7216
7217 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7218 binary input file is empty.
7219
7220 2011-05-27 Ian Lance Taylor <iant@google.com>
7221
7222 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7223 (ver_test_9.so): Likewise.
7224 * testsuite/Makefile.in: Rebuild.
7225
7226 2011-05-26 Cary Coutant <ccoutant@google.com>
7227
7228 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7229 * incremental.cc (Incremental_inputs::report_input_section): Fix
7230 comment, indentation.
7231 (Incremental_inputs::report_comdat_group): New function.
7232 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7233 of data for incremental input file entry.
7234 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7235 group count, COMDAT group signatures.
7236 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7237 an unchanged input file.
7238 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7239 Initialize new data member.
7240 (Incremental_object_entry::add_comdat_group): New function.
7241 (Incremental_object_entry::get_comdat_group_count): New function.
7242 (Incremental_object_entry::get_comdat_signature_key): New function.
7243 (Incremental_object_entry::groups_): New data member.
7244 (Incremental_inputs::report_comdat_group): New function.
7245 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7246 data for incremental input file entry.
7247 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7248 (Incremental_input_entry_reader::get_input_section): Adjust size of
7249 data for incremental input file entry.
7250 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7251 (Incremental_input_entry_reader::get_comdat_group_signature): New
7252 function.
7253 * object.cc (Sized_relobj::include_section_group): Report kept
7254 COMDAT groups for incremental links.
7255
7256 2011-05-24 David Meyer <pdox@google.com>
7257
7258 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7259 with name parameter. Add found_name parameter.
7260 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7261 * dirsearch.h (class Dirsearch): Update declaration.
7262
7263 2011-05-24 Ian Lance Taylor <iant@google.com>
7264
7265 * archive.cc (Library_base::should_include_member): Pull in object
7266 from archive if it defines the entry symbol.
7267 * parameters.cc (Parameters::entry): New function.
7268 * parameters.h (class Parameters): Declare entry.
7269 * output.h (class Output_file_header): Remove entry_ field.
7270 * output.cc (Output_file_header::Output_file_header): Remove entry
7271 parameter. Change all callers.
7272 (Output_file_header::entry): Use parameters->entry.
7273 * gold.cc (queue_middle_tasks): Likewise.
7274 * plugin.cc (Plugin_hook::run): Likewise.
7275
7276 2011-05-24 Cary Coutant <ccoutant@google.com>
7277
7278 * gold.cc (queue_initial_tasks): Pass incremental base filename
7279 to Output_file::open_base_file; don't print error message.
7280 * incremental-dump.cc (main): Adjust call to
7281 Output_file::open_for_modification.
7282 * incremental-dump.cc (main): Likewise.
7283 * incremental.cc (Incremental_inputs::report_command_line):
7284 Ignore --incremental-base option when comparing command lines.
7285 Ignore parameter when given as separate argument.
7286 * options.h (class General_options): Add --incremental-base.
7287 * output.cc (Output_file::Output_file):
7288 (Output_file::open_base_file): Add base_name and writable parameters;
7289 read base file into new file; print error message here.
7290 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7291 callers.
7292 * output.h (Output_file::open_for_modification): Rename to...
7293 (Output_file::open_base_file): ...this; add base_name and
7294 writable parameters; adjust all callers.
7295 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7296 callers.
7297 * testsuite/Makefile.am (incremental_test_4): Test
7298 --incremental-base.
7299 * testsuite/Makefile.in: Regenerate.
7300
7301 2011-05-24 Cary Coutant <ccoutant@google.com>
7302
7303 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7304 incremental_test_4.
7305 * testsuite/Makefile.in: Regenerate.
7306 * testsuite/two_file_test_1_v1.cc: New test source file.
7307 * testsuite/two_file_test_1b_v1.cc: New test source file.
7308 * testsuite/two_file_test_2_v1.cc: New test source file.
7309
7310 2011-05-24 Cary Coutant <ccoutant@google.com>
7311
7312 * dynobj.h (Dynobj::do_dynobj): New function.
7313 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7314 flag and soname for shared objects.
7315 * incremental.cc (Incremental_inputs::report_object): Make
7316 either Incremental_object_entry or Incremental_dynobj_entry; add
7317 soname to string table.
7318 (Incremental_inputs::report_input_section): Add assertion.
7319 (Output_section_incremental_inputs::set_final_data_size): Adjust
7320 type of input file entry for shared libraries; adjust size of
7321 shared library info entry.
7322 (Output_section_incremental_inputs::write_input_files): Write
7323 as_needed flag for shared libraries.
7324 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7325 of input file entry for shared libraries; write soname.
7326 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7327 soname from incremental info.
7328 * incremental.h (enum Incremental_input_flags): Add
7329 INCREMENTAL_INPUT_AS_NEEDED.
7330 (Incremental_input_entry::Incremental_input_entry): Initialize new
7331 data member.
7332 (Incremental_input_entry::set_as_needed): New function.
7333 (Incremental_input_entry::as_needed): New function.
7334 (Incremental_input_entry::do_dynobj_entry): New function.
7335 (Incremental_input_entry::as_needed_): New data member.
7336 (Incremental_object_entry::Incremental_object_entry): Don't check
7337 for shared library.
7338 (Incremental_object_entry::do_type): Likewise.
7339 (class Incremental_dynobj_entry): New class.
7340 (Incremental_input_entry_reader::as_needed): New function.
7341 (Incremental_input_entry_reader::get_soname): New function.
7342 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7343 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7344 size of shared library info entry.
7345 * layout.cc (Layout::finish_dynamic_section): Don't test for
7346 incremental link when adding DT_NEEDED entries.
7347 * object.h (Object::Object): Initialize new data member.
7348 (Object::dynobj): New function.
7349 (Object::set_as_needed): New function.
7350 (Object::as_needed): New function.
7351 (Object::do_dynobj): New function.
7352 (Object::as_needed_): New data member.
7353
7354 2011-05-24 Cary Coutant <ccoutant@google.com>
7355
7356 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7357 info; adjust display of GOT entries.
7358 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7359 vector of input objects; remove file_status_.
7360 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7361 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7362 got_plt reader; call target hooks to reserve GOT entries.
7363 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7364 of input file info header and GOT info entry.
7365 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7366 relocation info.
7367 (Got_plt_view_info::got_descriptor): Remove.
7368 (Got_plt_view_info::sym_index): New data member.
7369 (Got_plt_view_info::input_index): New data member.
7370 (Local_got_offset_visitor::visit): Write input file index.
7371 (Global_got_offset_visitor::visit): Write 0 for input file index.
7372 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7373 with sym_index and input_index.
7374 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7375 incremental info GOT entry; replace got_descriptor with input_index.
7376 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7377 map from input file index to object.
7378 (Sized_relobj_incr::do_layout): Replace direct data member reference
7379 with accessor function.
7380 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7381 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7382 Adjust size of input file info header.
7383 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7384 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7385 (Incremental_input_entry_reader::get_input_section): Adjust size of
7386 input file info header.
7387 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7388 of incremental info GOT entry.
7389 (Incremental_got_plt_reader::get_got_desc): Remove.
7390 (Incremental_got_plt_reader::get_got_symndx): New function.
7391 (Incremental_got_plt_reader::get_got_input_index): New function.
7392 (Sized_incremental_binary::Sized_incremental_binary): Remove
7393 file_status_; add input_objects_.
7394 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7395 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7396 (Sized_incremental_binary::file_is_unchanged): Remove.
7397 (Sized_incremental_binary::set_input_object): New function.
7398 (Sized_incremental_binary::input_object): New function.
7399 (Sized_incremental_binary::file_status_): Remove.
7400 (Sized_incremental_binary::input_objects_): New data member.
7401 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7402 references.
7403 (Sized_relobj_incr::invalid_address): Move to base class.
7404 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7405 class.
7406 (Sized_relobj_incr::do_output_section_offset): Likewise.
7407 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7408 (Sized_relobj_incr::section_offsets_): Likewise.
7409 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7410 function.
7411 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7412 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7413 with accessor function.
7414 (Sized_relobj_file::do_layout): Likewise.
7415 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7416 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7417 (Sized_relobj_file::compute_final_local_value): Replace refs to
7418 section_offsets_ with accessor function.
7419 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7420 * object.h (Relobj::Relobj): Initialize new data members.
7421 (Relobj::add_dyn_reloc): New function.
7422 (Relobj::first_dyn_reloc): New function.
7423 (Relobj::dyn_reloc_count): New function.
7424 (Relobj::first_dyn_reloc_): New data member.
7425 (Relobj::dyn_reloc_count_): New data member.
7426 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7427 references.
7428 (Sized_relobj::Address): New typedef.
7429 (Sized_relobj::invalid_address): Move here from child class.
7430 (Sized_relobj::Sized_relobj): Initialize new data members.
7431 (Sized_relobj::sized_relobj): New function.
7432 (Sized_relobj::is_output_section_offset_invalid): Move here from
7433 child class.
7434 (Sized_relobj::get_output_section_offset): Likewise.
7435 (Sized_relobj::local_has_got_offset): Likewise.
7436 (Sized_relobj::local_got_offset): Likewise.
7437 (Sized_relobj::set_local_got_offset): Likewise.
7438 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7439 (Sized_relobj::clear_got_offsets): New function.
7440 (Sized_relobj::section_offsets): Move here from child class.
7441 (Sized_relobj::do_output_section_offset): Likewise.
7442 (Sized_relobj::do_set_section_offset): Likewise.
7443 (Sized_relobj::Local_got_offsets): Likewise.
7444 (Sized_relobj::local_got_offsets_): Likewise.
7445 (Sized_relobj::section_offsets_): Likewise.
7446 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7447 references.
7448 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7449 class.
7450 (Sized_relobj_file::sized_relobj): New function
7451 (Sized_relobj_file::local_has_got_offset): Move to base class.
7452 (Sized_relobj_file::local_got_offset): Likewise.
7453 (Sized_relobj_file::set_local_got_offset): Likewise.
7454 (Sized_relobj_file::get_output_section_offset): Likewise.
7455 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7456 (Sized_relobj_file::do_output_section_offset): Likewise.
7457 (Sized_relobj_file::do_set_section_offset): Likewise.
7458 (Sized_relobj_file::Local_got_offsets): Likewise.
7459 (Sized_relobj_file::local_got_offsets_): Likewise.
7460 (Sized_relobj_file::section_offsets_): Likewise.
7461 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7462 (all constructors).
7463 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7464 (Output_reloc::get_symbol_index): Likewise.
7465 (Output_reloc::local_section_offset): Likewise.
7466 (Output_reloc::get_address): Likewise.
7467 (Output_reloc::symbol_value): Likewise.
7468 (Output_data_got::reserve_slot): Move to class definition.
7469 (Output_data_got::reserve_local): New function.
7470 (Output_data_got::reserve_slot_for_global): Remove.
7471 (Output_data_got::reserve_global): New function.
7472 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7473 (all constructors, two instantiations).
7474 (Output_reloc::get_relobj): New function (two instantiations).
7475 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7476 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7477 (Output_data_reloc::add_global): Adjust type of relobj.
7478 (Output_data_reloc::add_global_relative): Likewise.
7479 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7480 (Output_data_reloc::add_local): Likewise.
7481 (Output_data_reloc::add_local_relative): Likewise.
7482 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7483 (Output_data_reloc::add_local_section): Likewise.
7484 (Output_data_reloc::add_output_section): Likewise.
7485 (Output_data_reloc::add_absolute): Likewise.
7486 (Output_data_reloc::add_target_specific): Likewise.
7487 (Output_data_got::reserve_slot): Move definition here.
7488 (Output_data_got::reserve_local): New function.
7489 (Output_data_got::reserve_global): New function.
7490 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7491 section_offsets_ with accessor function.
7492 (Sized_relobj_file::write_sections): Likewise.
7493 (Sized_relobj_file::do_relocate_sections): Likewise.
7494 * target.h (Sized_target::reserve_local_got_entry): New function.
7495 (Sized_target::reserve_global_got_entry): New function.
7496 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7497 (Target_x86_64::reserve_global_got_entry): New function.
7498 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7499
7500 2011-05-23 Cary Coutant <ccoutant@google.com>
7501
7502 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7503 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7504 bit when checking got_type.
7505 * incremental.cc (Sized_incremental_binary::setup_readers):
7506 Store symbol table and string table locations; initialize bit vector
7507 of file status flags.
7508 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7509 unchanged files.
7510 (Sized_incremental_binary::do_process_got_plt): New function.
7511 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7512 (Output_section_incremental_inputs::set_final_data_size): Record
7513 file index for each input file.
7514 (Output_section_incremental_inputs::write_got_plt): Store file index
7515 instead of input entry offset for each GOT entry.
7516 * incremental.h
7517 (Incremental_input_entry::Incremental_input_entry): Initialize new
7518 data member.
7519 (Incremental_input_entry::set_offset): Store file index.
7520 (Incremental_input_entry::get_file_index): New function.
7521 (Incremental_input_entry::file_index_): New data member.
7522 (Incremental_binary::process_got_plt): New function.
7523 (Incremental_binary::do_process_got_plt): New function.
7524 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7525 data members.
7526 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7527 (Sized_incremental_binary::set_file_is_unchanged): New function.
7528 (Sized_incremental_binary::file_is_unchanged): New function.
7529 (Sized_incremental_binary::do_process_got_plt): New function.
7530 (Sized_incremental_binary::file_status_): New data member.
7531 (Sized_incremental_binary::main_symtab_loc_): New data member.
7532 (Sized_incremental_binary::main_strtab_loc_): New data member.
7533 * output.cc (Output_data_got::Got_entry::write): Add case
7534 RESERVED_CODE.
7535 (Output_data_got::add_global): Call add_got_entry.
7536 (Output_data_got::add_global_plt): Likewise.
7537 (Output_data_got::add_global_with_rel): Likewise.
7538 (Output_data_got::add_global_with_rela): Likewise.
7539 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7540 (Output_data_got::add_global_pair_with_rela): Likewise.
7541 (Output_data_got::add_local): Call add_got_entry.
7542 (Output_data_got::add_local_plt): Likewise.
7543 (Output_data_got::add_local_with_rel): Likewise.
7544 (Output_data_got::add_local_with_rela): Likewise.
7545 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7546 (Output_data_got::add_local_pair_with_rela): Likewise.
7547 (Output_data_got::reserve_slot): New function.
7548 (Output_data_got::reserve_slot_for_global): New function.
7549 (Output_data_got::add_got_entry): New function.
7550 (Output_data_got::add_got_entry_pair): New function.
7551 (Output_section::add_output_section_data): Edit FIXME.
7552 * output.h
7553 (Output_section_data_build::Output_section_data_build): New
7554 constructor with size parameter.
7555 (Output_data_space::Output_data_space): Likewise.
7556 (Output_data_got::Output_data_got): Initialize new data member; new
7557 constructor with size parameter.
7558 (Output_data_got::add_constant): Call add_got_entry.
7559 (Output_data_got::reserve_slot): New function.
7560 (Output_data_got::reserve_slot_for_global): New function.
7561 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7562 (Output_data_got::add_got_entry): New function.
7563 (Output_data_got::add_got_entry_pair): New function.
7564 (Output_data_got::free_list_): New data member.
7565 * target.h (Sized_target::init_got_plt_for_update): New function.
7566 (Sized_target::register_global_plt_entry): New function.
7567 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7568 Initialize new data member; call init; add constructor with PLT count.
7569 (Output_data_plt_x86_64::init): New function.
7570 (Output_data_plt_x86_64::add_relocation): New function.
7571 (Output_data_plt_x86_64::reserve_slot): New function.
7572 (Output_data_plt_x86_64::free_list_): New data member.
7573 (Target_x86_64::init_got_plt_for_update): New function.
7574 (Target_x86_64::register_global_plt_entry): New function.
7575 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7576 incremental updates.
7577 (Output_data_plt_x86_64::add_relocation): New function.
7578 * testsuite/object_unittest.cc (Object_test): Set default options.
7579
7580 2011-05-16 Ian Lance Taylor <iant@google.com>
7581
7582 * options.h (class General_options): Make -i a synonym for -r.
7583
7584 2011-05-16 Ian Lance Taylor <iant@google.com>
7585
7586 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7587
7588 2011-05-10 Cary Coutant <ccoutant@google.com>
7589
7590 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7591 strip_all (-s).
7592
7593 2011-05-06 Ian Lance Taylor <iant@google.com>
7594
7595 * layout.cc (Layout::layout): If the output section flags change,
7596 update the ordering.
7597
7598 2011-04-25 Cary Coutant <ccoutant@google.com>
7599
7600 * incremental-dump.cc (dump_incremental_inputs): Print local
7601 symbol info for each input file.
7602 * incremental.cc
7603 (Output_section_incremental_inputs::set_final_data_size): Add local
7604 symbol info to input file entries in incremental info.
7605 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7606 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7607 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7608 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7609 implementation.
7610 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7611 (Sized_incr_relobj::do_relocate): Write the local symbols.
7612 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7613 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7614 Adjust size of input file header.
7615 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7616 (Incremental_inputs_reader::get_local_symbol_count): New function.
7617 (Incremental_inputs_reader::get_input_section): Adjust size of input
7618 file header.
7619 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7620 (Sized_incr_relobj::This): New typedef.
7621 (Sized_incr_relobj::sym_size): New const data member.
7622 (Sized_incr_relobj::Local_symbol): New struct.
7623 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7624 (Sized_incr_relobj::do_local_symbol_offset): New function.
7625 (Sized_incr_relobj::local_symbol_count_): New data member.
7626 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7627 (Sized_incr_relobj::local_symbol_index_): New data member.
7628 (Sized_incr_relobj::local_symbol_offset_): New data member.
7629 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7630 (Sized_incr_relobj::local_symbols_): New data member.
7631 * object.h (Relobj::output_local_symbol_count): New function.
7632 (Relobj::local_symbol_offset): New function.
7633 (Relobj::do_output_local_symbol_count): New function.
7634 (Relobj::do_local_symbol_offset): New function.
7635 (Sized_relobj::do_output_local_symbol_count): New function.
7636 (Sized_relobj::do_local_symbol_offset): New function.
7637
7638 2011-04-22 Vladimir Simonov <sv@sw.ru>
7639
7640 * descriptors.cc (set_close_on_exec): New function.
7641 (Descriptors::open): Use set_close_on_exec.
7642 * output.cc (S_ISLNK): Define if not defined.
7643
7644 2011-04-22 Cary Coutant <ccoutant@google.com>
7645
7646 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7647 global symbol map.
7648 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7649 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7650 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7651 relocations.
7652 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7653 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7654 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7655 * incremental.h
7656 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7657 function.
7658 (Incremental_binary::apply_incremental_relocs): New function.
7659 (Incremental_binary::do_apply_incremental_relocs): New function.
7660 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7661 data member.
7662 (Sized_incremental_binary::add_global_symbol): New function.
7663 (Sized_incremental_binary::global_symbol): New function.
7664 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7665 (Sized_incremental_binary::symbol_map_): New data member.
7666 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7667 * target.h (Sized_target::apply_relocation): New function.
7668 * target-reloc.h (apply_relocation): New function.
7669 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7670
7671 2011-04-22 Doug Kwan <dougkwan@google.com>
7672
7673 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7674 flag of a SHT_ARM_EXIDX section.
7675 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7676 * testsuite/Makefile.in: Regenerate.
7677 * testsuite/arm_exidx_test.s: New file.
7678 * testsuite/arm_exidx_test.sh: Same.
7679
7680 2011-04-20 Cary Coutant <ccoutant@google.com>
7681
7682 PR gold/12689
7683 * archive.h (Incremental_archive_entry::Archive_member):
7684 Initialize arg_serial_ (second constructor).
7685
7686 2011-04-17 Ian Lance Taylor <iant@google.com>
7687
7688 * object.cc (Relocate_info::location): Simplify location string.
7689 * errors.cc (Errors::error_at_location): Don't print program
7690 name.
7691 (Errors::warning_at_location): Likewise.
7692 (Errors::undefined_symbol): Likewise.
7693 * testsuite/debug_msg.sh: Update accordingly.
7694
7695 2011-04-14 Cary Coutant <ccoutant@google.com>
7696
7697 * gold/layout.cc (Layout::symtab_section_offset): New function.
7698 * gold/layout.h (Layout::symtab_section_offset): New function.
7699 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7700
7701 2011-04-12 Ian Lance Taylor <iant@google.com>
7702
7703 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7704 with MREMAP_MAYMOVE.
7705 * output.h (class Output_file): Add map_is_allocated_ field.
7706 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7707 not available, provide stubs. If mremap is not available, #define
7708 it to gold_mremap.
7709 (MREMAP_MAYMOVE): Define if not defined.
7710 (Output_file::Output_file): Initialize map_is_allocated_.
7711 (Output_file::resize): Check map_is_allocated_.
7712 (Output_file::map_anonymous): If mmap fails, use malloc.
7713 (Output_file::unmap): Don't do anything for an anonymous map.
7714 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7715 is not available, provide stubs.
7716 (File_read::View::~View): Use free rather than delete[].
7717 (File_read::make_view): Use malloc rather than new[]. If mmap
7718 fails, use malloc.
7719 (File_read::find_or_make_view): Use malloc rather than new[].
7720 * gold.h: Remove HAVE_REMAP code.
7721 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7722 exists. Rename mremap to gold_mremap. If mmap is not available
7723 don't do anything.
7724 * configure, config.in: Rebuild.
7725
7726 2011-04-11 Ian Lance Taylor <iant@google.com>
7727
7728 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7729 initialize local variable v.
7730
7731 2011-04-11 Cary Coutant <ccoutant@google.com>
7732
7733 * archive.cc (Archive::include_member): Adjust call to
7734 report_object.
7735 (Add_archive_symbols::run): Track argument serial numbers.
7736 (Lib_group::include_member): Likewise.
7737 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7738 * archive.h (Incremental_archive_entry::Archive_member):
7739 Initialize arg_serial_.
7740 (Archive_member::arg_serial_): New data member.
7741 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7742 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7743 incremental link.
7744 (Sized_dynobj::do_for_all_local_got_entries): New function.
7745 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7746 function.
7747 * fileread.cc (get_mtime): New function.
7748 * fileread.h (get_mtime): New function.
7749 * gold.cc (queue_initial_tasks): Check for incremental update.
7750 (process_incremental_input): New function.
7751 (queue_middle_tasks): Don't force valid target for incremental
7752 update.
7753 * incremental-dump.cc (find_input_containing_global): Adjust
7754 size of symbol info entry.
7755 (dump_incremental_inputs): Dump argument serial number and
7756 in_system_directory flag; bias shndx by 1; print symbol names
7757 when dumping per-file symbol lists; use new symbol info readers.
7758 * incremental.cc
7759 (Output_section_incremental_inputs:update_data_size): New function.
7760 (Sized_incremental_binary::setup_readers): Setup input readers
7761 for each input file; build maps for files added from libraries
7762 and scripts.
7763 (Sized_incremental_binary::check_input_args): New function.
7764 (Sized_incremental_binary::do_check_inputs): Build map of argument
7765 serial numbers to input arguments.
7766 (Sized_incremental_binary::do_file_has_changed): Rename
7767 do_file_is_unchanged to this; compare file modification times.
7768 (Sized_incremental_binary::do_init_layout): New function.
7769 (Sized_incremental_binary::do_reserve_layout): New function.
7770 (Sized_incremental_binary::do_get_input_reader): Remove.
7771 (Sized_incremental_binary::get_symtab_view): New function.
7772 (Incremental_checker::can_incrementally_link_output_file): Remove.
7773 (Incremental_inputs::report_command_line): Exclude --debug options.
7774 (Incremental_inputs::report_archive_begin): Add parameter; track
7775 argument serial numbers; don't put input file entry for archive
7776 before archive members.
7777 (Incremental_inputs::report_archive_end): Put input file entry
7778 for archive after archive members.
7779 (Incremental_inputs::report_object): Add parameter; track argument
7780 serial numbers and in_system_directory flag.
7781 (Incremental_inputs::report_script): Add parameter; track argument
7782 serial numbers.
7783 (Output_section_incremental_inputs::set_final_data_size): Adjust
7784 size of symbol info entry; check for forwarding symbols.
7785 (Output_section_incremental_inputs::write_input_files): Write
7786 in_system_directory flag and argument serial number.
7787 (Output_section_incremental_inputs::write_info_blocks): Map section
7788 indices between incremental info and original input file; store
7789 input section index for each symbol.
7790 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7791 change operator() to visit().
7792 (class Global_got_offset_visitor): Likewise.
7793 (class Global_symbol_visitor_got_plt):
7794 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7795 classes.
7796 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7797 (Sized_incr_relobj::do_read_symbols): New function.
7798 (Sized_incr_relobj::do_layout): New function.
7799 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7800 (Sized_incr_relobj::do_add_symbols): New function.
7801 (Sized_incr_relobj::do_should_include_member): New function.
7802 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7803 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7804 (Sized_incr_relobj::do_section_size): New function.
7805 (Sized_incr_relobj::do_section_name): New function.
7806 (Sized_incr_relobj::do_section_contents): New function.
7807 (Sized_incr_relobj::do_section_flags): New function.
7808 (Sized_incr_relobj::do_section_entsize): New function.
7809 (Sized_incr_relobj::do_section_address): New function.
7810 (Sized_incr_relobj::do_section_type): New function.
7811 (Sized_incr_relobj::do_section_link): New function.
7812 (Sized_incr_relobj::do_section_info): New function.
7813 (Sized_incr_relobj::do_section_addralign): New function.
7814 (Sized_incr_relobj::do_initialize_xindex): New function.
7815 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7816 (Sized_incr_relobj::do_read_relocs): New function.
7817 (Sized_incr_relobj::do_gc_process_relocs): New function.
7818 (Sized_incr_relobj::do_scan_relocs): New function.
7819 (Sized_incr_relobj::do_count_local_symbols): New function.
7820 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7821 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7822 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7823 (Sized_incr_relobj::do_relocate): New function.
7824 (Sized_incr_relobj::do_set_section_offset): New function.
7825 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7826 (Sized_incr_dynobj::do_read_symbols): New function.
7827 (Sized_incr_dynobj::do_layout): New function.
7828 (Sized_incr_dynobj::do_add_symbols): New function.
7829 (Sized_incr_dynobj::do_should_include_member): New function.
7830 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7831 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7832 (Sized_incr_dynobj::do_section_size): New function.
7833 (Sized_incr_dynobj::do_section_name): New function.
7834 (Sized_incr_dynobj::do_section_contents): New function.
7835 (Sized_incr_dynobj::do_section_flags): New function.
7836 (Sized_incr_dynobj::do_section_entsize): New function.
7837 (Sized_incr_dynobj::do_section_address): New function.
7838 (Sized_incr_dynobj::do_section_type): New function.
7839 (Sized_incr_dynobj::do_section_link): New function.
7840 (Sized_incr_dynobj::do_section_info): New function.
7841 (Sized_incr_dynobj::do_section_addralign): New function.
7842 (Sized_incr_dynobj::do_initialize_xindex): New function.
7843 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7844 (make_sized_incremental_object): New function.
7845 (Incremental_library::copy_unused_symbols): New function.
7846 (Incremental_library::do_for_all_unused_symbols): New function.
7847 * incremental.h (enum Incremental_input_flags): New type.
7848 (class Incremental_checker): Remove.
7849 (Incremental_input_entry::Incremental_input_entry): Add argument
7850 serial number.
7851 (Incremental_input_entry::arg_serial): New function.
7852 (Incremental_input_entry::set_is_in_system_directory): New function.
7853 (Incremental_input_entry::is_in_system_directory): New function.
7854 (Incremental_input_entry::arg_serial_): New data member.
7855 (Incremental_input_entry::is_in_system_directory_): New data member.
7856 (class Script_info): Move here from script.h.
7857 (Script_info::Script_info): Add filename parameter.
7858 (Script_info::filename): New function.
7859 (Script_info::filename_): New data member.
7860 (Incremental_script_entry::Incremental_script_entry): Add argument
7861 serial number.
7862 (Incremental_object_entry::Incremental_object_entry): Likewise.
7863 (Incremental_object_entry::add_input_section): Build list of input
7864 sections with map to original shndx.
7865 (Incremental_object_entry::get_input_section_index): New function.
7866 (Incremental_object_entry::shndx_): New data member.
7867 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7868 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7869 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7870 serial number.
7871 (Incremental_inputs::report_archive_begin): Likewise.
7872 (Incremental_inputs::report_object): Likewise.
7873 (Incremental_inputs::report_script): Likewise.
7874 (class Incremental_global_symbol_reader): New class.
7875 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7876 and store flags and input file type.
7877 (Incremental_input_entry_reader::arg_serial): New function.
7878 (Incremental_input_entry_reader::type): Extract type from flags.
7879 (Incremental_input_entry_reader::is_in_system_directory): New function.
7880 (Incremental_input_entry_reader::get_input_section_count): Call
7881 accessor function for type.
7882 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7883 function for type; adjust size of global symbol entry.
7884 (Incremental_input_entry_reader::get_global_symbol_count): Call
7885 accessor function for type.
7886 (Incremental_input_entry_reader::get_object_count): Likewise.
7887 (Incremental_input_entry_reader::get_object_offset): Likewise.
7888 (Incremental_input_entry_reader::get_member_count): Likewise.
7889 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7890 (Incremental_input_entry_reader::get_member_offset): Likewise.
7891 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7892 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7893 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7894 (Incremental_input_entry_reader::get_global_symbol_reader): New
7895 function.
7896 (Incremental_input_entry_reader::get_output_symbol_index): New
7897 function.
7898 (Incremental_input_entry_reader::type_): Remove.
7899 (Incremental_input_entry_reader::flags_): New data member.
7900 (Incremental_inputs_reader::input_file_offset): New function.
7901 (Incremental_inputs_reader::input_file_index): New function.
7902 (Incremental_inputs_reader::input_file): Call input_file_offset.
7903 (Incremental_inputs_reader::input_file_at_offset): New function.
7904 (Incremental_relocs_reader::get_r_type): Reformat.
7905 (Incremental_relocs_reader::get_r_shndx): Reformat.
7906 (Incremental_relocs_reader::get_r_offset): Reformat.
7907 (Incremental_relocs_reader::data): New function.
7908 (Incremental_binary::Incremental_binary): Initialize new data members.
7909 (Incremental_binary::check_inputs): Add cmdline parameter.
7910 (Incremental_binary::file_is_unchanged): Remove.
7911 (Input_reader::arg_serial): New function.
7912 (Input_reader::get_unused_symbol_count): New function.
7913 (Input_reader::get_unused_symbol): New function.
7914 (Input_reader::do_arg_serial): New function.
7915 (Input_reader::do_get_unused_symbol_count): New function.
7916 (Input_reader::do_get_unused_symbol): New function.
7917 (Incremental_binary::input_file_count): New function.
7918 (Incremental_binary::get_input_reader): Change signature to use
7919 index instead of filename.
7920 (Incremental_binary::file_has_changed): New function.
7921 (Incremental_binary::get_input_argument): New function.
7922 (Incremental_binary::get_library): New function.
7923 (Incremental_binary::get_script_info): New function.
7924 (Incremental_binary::init_layout): New function.
7925 (Incremental_binary::reserve_layout): New function.
7926 (Incremental_binary::output_file): New function.
7927 (Incremental_binary::do_check_inputs): New function.
7928 (Incremental_binary::do_file_is_unchanged): Remove.
7929 (Incremental_binary::do_file_has_changed): New function.
7930 (Incremental_binary::do_init_layout): New function.
7931 (Incremental_binary::do_reserve_layout): New function.
7932 (Incremental_binary::do_input_file_count): New function.
7933 (Incremental_binary::do_get_input_reader): Change signature.
7934 (Incremental_binary::input_args_map_): New data member.
7935 (Incremental_binary::library_map_): New data member.
7936 (Incremental_binary::script_map_): New data member.
7937 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7938 new data members.
7939 (Sized_incremental_binary::output_section): New function.
7940 (Sized_incremental_binary::inputs_reader): Add const.
7941 (Sized_incremental_binary::symtab_reader): Add const.
7942 (Sized_incremental_binary::relocs_reader): Add const.
7943 (Sized_incremental_binary::got_plt_reader): Add const.
7944 (Sized_incremental_binary::get_symtab_view): New function.
7945 (Sized_incremental_binary::Inputs_reader): New typedef.
7946 (Sized_incremental_binary::Input_entry_reader): New typedef.
7947 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7948 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7949 (Sized_incremental_binary::do_file_has_changed): New function.
7950 (Sized_incremental_binary::do_init_layout): New function.
7951 (Sized_incremental_binary::do_reserve_layout): New function.
7952 (Sized_input_reader::Inputs_reader): Remove.
7953 (Sized_input_reader::Input_entry_reader): Remove.
7954 (Sized_input_reader::do_arg_serial): New function.
7955 (Sized_input_reader::do_get_unused_symbol_count): New function.
7956 (Sized_input_reader::do_get_unused_symbol): New function.
7957 (Sized_incremental_binary::do_input_file_count): New function.
7958 (Sized_incremental_binary::do_get_input_reader): Change signature;
7959 use index instead of filename.
7960 (Sized_incremental_binary::section_map_): New data member.
7961 (Sized_incremental_binary::input_entry_readers_): New data member.
7962 (class Sized_incr_relobj): New class.
7963 (class Sized_incr_dynobj): New class.
7964 (make_sized_incremental_object): New function.
7965 (class Incremental_library): New class.
7966 * layout.cc (Free_list::num_lists): New static data member.
7967 (Free_list::num_nodes): New static data member.
7968 (Free_list::num_removes): New static data member.
7969 (Free_list::num_remove_visits): New static data member.
7970 (Free_list::num_allocates): New static data member.
7971 (Free_list::num_allocate_visits): New static data member.
7972 (Free_list::init): New function.
7973 (Free_list::remove): New function.
7974 (Free_list::allocate): New function.
7975 (Free_list::dump): New function.
7976 (Free_list::print_stats): New function.
7977 (Layout_task_runner::run): Resize output file for incremental updates.
7978 (Layout::Layout): Initialize new data members.
7979 (Layout::set_incremental_base): New function.
7980 (Layout::init_fixed_output_section): New function.
7981 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7982 incremental updates.
7983 (Layout::create_gold_note): Do not create gold note section for
7984 incremental updates.
7985 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7986 for incremental updates.
7987 (Layout::set_section_offsets): For incremental updates, allocate space
7988 from free list.
7989 (Layout::create_symtab_sections): Layout with offsets relative to
7990 start of section; for incremental updates, allocate space from free
7991 list.
7992 (Layout::create_shdrs): For incremental updates, allocate space from
7993 free list.
7994 (Layout::finish_dynamic_section): For incremental updates, do not
7995 check --as-needed (fixed in subsequent patch).
7996 * layout.h (class Free_list): New class.
7997 (Layout::set_incremental_base): New function.
7998 (Layout::incremental_base): New function.
7999 (Layout::init_fixed_output_section): New function.
8000 (Layout::allocate): New function.
8001 (Layout::incremental_base_): New data member.
8002 (Layout::free_list_): New data member.
8003 * main.cc (main): Print Free_list statistics.
8004 * object.cc (Relobj::finalize_incremental_relocs): Add
8005 clear_counts parameter; clear counts only when clear_counts is set.
8006 (Sized_relobj::Sized_relobj): Initialize new base class.
8007 (Sized_relobj::do_layout): Don't report special sections.
8008 (Sized_relobj::do_for_all_local_got_entries): New function.
8009 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
8010 symtab_off to all symbol table offsets.
8011 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
8012 * object.h (class Got_offset_list): Move to top of file.
8013 (Object::Object): Allow case where input_file == NULL.
8014 (Object::~Object): Likewise.
8015 (Object::input_file): Assert that input_file != NULL.
8016 (Object::lock): Allow case where input_file == NULL.
8017 (Object::unlock): Likewise.
8018 (Object::is_locked): Likewise.
8019 (Object::token): Likewise.
8020 (Object::release): Likewise.
8021 (Object::is_incremental): New function.
8022 (Object::get_mtime): New function.
8023 (Object::for_all_local_got_entries): New function.
8024 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
8025 (Object::set_is_in_system_directory): New function.
8026 (Object::is_in_system_directory): New function.
8027 (Object::do_is_incremental): New function.
8028 (Object::do_get_mtime): New function.
8029 (Object::do_for_all_local_got_entries): New function.
8030 (Object::is_in_system_directory_): New data member.
8031 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
8032 (class Sized_relobj_base): New class.
8033 (class Sized_relobj): Derive from Sized_relobj_base.
8034 (class Sized_relobj::Symbols): Redeclare from base class.
8035 (class Sized_relobj::local_got_offset_list): Remove.
8036 (class Sized_relobj::Output_sections): Redeclare from base class.
8037 (class Sized_relobj::do_for_all_local_got_entries): New function.
8038 (class Sized_relobj::write_local_symbols): Add offset parameter.
8039 (class Sized_relobj::local_symbol_offset_): Update comment.
8040 (class Sized_relobj::local_dynsym_offset_): Update comment.
8041 * options.cc (Input_arguments::add_file): Remove const.
8042 * options.h (Input_file_argument::Input_file_argument):
8043 Initialize arg_serial_ (all constructors).
8044 (Input_file_argument::set_arg_serial): New function.
8045 (Input_file_argument::arg_serial): New function.
8046 (Input_file_argument::arg_serial_): New data member.
8047 (Input_arguments::Input_arguments): Initialize file_count_.
8048 (Input_arguments::add_file): Remove const.
8049 (Input_arguments::number_of_input_files): New function.
8050 (Input_arguments::file_count_): New data member.
8051 (Command_line::number_of_input_files): Call
8052 Input_arguments::number_of_input_files.
8053 * output.cc (Output_segment_headers::Output_segment_headers):
8054 Set current size.
8055 (Output_section::Input_section::current_data_size): New function.
8056 (Output_section::Output_section): Initialize new data members.
8057 (Output_section::add_input_section): Don't do merge sections for
8058 an incremental link; allocate space from free list for an
8059 incremental update.
8060 (Output_section::add_output_section_data): Allocate space from
8061 free list for an incremental update.
8062 (Output_section::update_data_size): New function.
8063 (Output_section::set_fixed_layout): New function.
8064 (Output_section::reserve): New function.
8065 (Output_segment::set_section_addresses): Remove const.
8066 (Output_segment::set_section_list_addresses): Remove const; allocate
8067 space from free list for an incremental update.
8068 (Output_segment::set_offset): Adjust size of RELRO segment for an
8069 incremental update.
8070 * output.h (Output_data::current_data_size): Move here from
8071 child classes.
8072 (Output_data::pre_finalize_data_size): New function.
8073 (Output_data::update_data_size): New function.
8074 (Output_section_headers::update_data_size): new function.
8075 (Output_section_data_build::current_data_size): Move to Output_data.
8076 (Output_data_strtab::update_data_size): New function.
8077 (Output_section::current_data_size): Move to Output_data.
8078 (Output_section::set_fixed_layout): New function.
8079 (Output_section::has_fixed_layout): New function.
8080 (Output_section::reserve): New function.
8081 (Output_section::update_data_size): New function.
8082 (Output_section::has_fixed_layout_): New data member.
8083 (Output_section::free_list_): New data member.
8084 (Output_segment::set_section_addresses): Remove const.
8085 (Output_segment::set_section_list_addresses): Remove const.
8086 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
8087 New function.
8088 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
8089 New function.
8090 * readsyms.cc (Read_symbols::do_read_symbols): Add library
8091 parameter when calling Add_symbols constructor; store argument
8092 serial number for members of a lib group.
8093 (Add_symbols::locks): Allow case where token == NULL.
8094 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
8095 (Read_member::~Read_member): New function.
8096 (Read_member::is_runnable): New function.
8097 (Read_member::locks): New function.
8098 (Read_member::run): New function.
8099 (Check_script::~Check_script): New function.
8100 (Check_script::is_runnable): New function.
8101 (Check_script::locks): New function.
8102 (Check_script::run): New function.
8103 (Check_library::~Check_library): New function.
8104 (Check_library::is_runnable): New function.
8105 (Check_library::locks): New function.
8106 (Check_library::run): New function.
8107 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
8108 (Add_symbols::library_): New data member.
8109 (class Read_member): New class.
8110 (class Check_script): New class.
8111 (class Check_library): New class.
8112 * reloc.cc (Read_relocs::is_runnable): Allow case where
8113 token == NULL.
8114 (Read_relocs::locks): Likewise.
8115 (Scan_relocs::locks): Likewise.
8116 (Relocate_task::locks): Likewise.
8117 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
8118 to clear counters.
8119 (Sized_relobj::incremental_relocs_scan): Fix comment.
8120 (Sized_relobj::do_relocate): Pass output file offset to
8121 write_local_symbols.
8122 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
8123 from class declaration.
8124 * script.cc (read_input_script): Allocate Script_info; pass
8125 argument serial number to report_script.
8126 * script.h (class Script_info): Move to incremental.h.
8127 * symtab.cc (Symbol_table::add_from_incrobj): New function.
8128 * symtab.h (Symbol_table::add_from_incrobj): New function.
8129 (Symbol_table::set_file_offset): New function.
8130
8131 2011-04-05 Cary Coutant <ccoutant@google.com>
8132
8133 * incremental-dump.cc (dump_incremental_inputs): Change signature
8134 to take a Sized_incremental_binary; change caller. Use readers
8135 in Sized_incremental_binary.
8136 * incremental.cc
8137 (Sized_incremental_binary::find_incremental_inputs_sections):
8138 Rename do_find_incremental_inputs_sections to this.
8139 (Sized_incremental_binary::setup_readers): New function.
8140 (Sized_incremental_binary::do_check_inputs): Check
8141 has_incremental_info_ flag; move setup code to setup_readers;
8142 use input readers.
8143 (Sized_incremental_binary::do_file_is_unchanged): New function.
8144 (Sized_incremental_binary::do_get_input_reader): New function.
8145 * incremental.h (class Incremental_binary): Move to end of file.
8146 (Incremental_binary::file_is_unchanged): New function.
8147 (Incremental_binary::do_file_is_unchanged): New function.
8148 (Incremental_binary::Input_reader): New class.
8149 (Incremental_binary::get_input_reader): New function.
8150 (class Sized_incremental_binary): Move to end of file.
8151 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8152 input section reader classes.
8153 (Sized_incremental_binary::has_incremental_info): New function.
8154 (Sized_incremental_binary::inputs_reader): New function.
8155 (Sized_incremental_binary::symtab_reader): New function.
8156 (Sized_incremental_binary::relocs_reader): New function.
8157 (Sized_incremental_binary::got_plt_reader): New function.
8158 (Sized_incremental_binary::do_file_is_unchanged): New function.
8159 (Sized_incremental_binary::Sized_input_reader): New class.
8160 (Sized_incremental_binary::get_input_reader): New function.
8161 (Sized_incremental_binary::find_incremental_inputs_sections):
8162 Rename do_find_incremental_inputs_sections to this.
8163 (Sized_incremental_binary::setup_readers): New function.
8164 (Sized_incremental_binary::has_incremental_info_): New data member.
8165 (Sized_incremental_binary::inputs_reader_): New data member.
8166 (Sized_incremental_binary::symtab_reader_): New data member.
8167 (Sized_incremental_binary::relocs_reader_): New data member.
8168 (Sized_incremental_binary::got_plt_reader_): New data member.
8169 (Sized_incremental_binary::current_input_file_): New data member.
8170
8171 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8172
8173 PR gold/12640
8174 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8175 violation.
8176
8177 2011-03-30 Cary Coutant <ccoutant@google.com>
8178
8179 * archive.cc (Archive::include_member): Adjust call to report_object.
8180 (Add_archive_symbols::run): Add script_info to call to
8181 report_archive_begin.
8182 (Lib_group::include_member): Adjust call to report_object.
8183 (Add_lib_group_symbols::run): Adjust call to report_object.
8184 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8185 blocks. Add object count for script input files.
8186 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8187 script_info parameter; change all callers.
8188 (Incremental_inputs::report_object): Add script_info parameter;
8189 change all callers.
8190 (Incremental_inputs::report_script): Store backpointer to
8191 incremental info entry.
8192 (Output_section_incremental_inputs::set_final_data_size): Record
8193 additional information for scripts.
8194 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8195 * incremental.h (Incremental_script_entry::add_object): New function.
8196 (Incremental_script_entry::get_object_count): New function.
8197 (Incremental_script_entry::get_object): New function.
8198 (Incremental_script_entry::objects_): New data member; adjust
8199 constructor.
8200 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8201 (Incremental_inputs::report_object): Add script_info parameter.
8202 (Incremental_inputs_reader::get_object_count): New function.
8203 (Incremental_inputs_reader::get_object_offset): New function.
8204 * options.cc (Input_arguments::add_file): Return reference to
8205 new input argument.
8206 * options.h (Input_argument::set_script_info): New function.
8207 (Input_argument::script_info): New function.
8208 (Input_argument::script_info_): New data member; adjust all
8209 constructors.
8210 (Input_file_group::add_file): Return reference to new input argument.
8211 (Input_file_lib::add_file): Likewise.
8212 (Input_arguments::add_file): Likewise.
8213 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8214 * script.cc (Parser_closure::Parser_closure): Add script_info
8215 parameter; adjust all callers.
8216 (Parser_closure::script_info): New function.
8217 (Parser_closure::script_info_): New data member.
8218 (read_input_script): Report scripts earlier to incremental info.
8219 (script_add_file): Set script_info in Input_argument.
8220 (script_add_library): Likewise.
8221 * script.h (Script_options::Script_info): Rewrite class.
8222
8223 2011-03-29 Cary Coutant <ccoutant@google.com>
8224
8225 * archive.cc (Library_base::should_include_member): Move
8226 method here from class Archive.
8227 (Archive::Archive): Initialize base class.
8228 (Archive::should_include_member): Move to base class.
8229 (Archive::do_for_all_unused_symbols): New function.
8230 (Add_archive_symbols::run): Remove redundant access to
8231 incremental_inputs.
8232 (Lib_group::Lib_group): Initialize base class.
8233 (Lib_group::do_filename): New function.
8234 (Lib_group::include_member): Pass pointer to Lib_group to
8235 report_object.
8236 (Lib_group::do_for_all_unused_symbols): New function.
8237 (Add_lib_group_symbols::run): Report archive information for
8238 incremental links.
8239 * archive.h (class Library_base): New base class.
8240 (class Archive): Derive from Library_base.
8241 (Archive::filename): Move to base class.
8242 (Archive::set_incremental_info): Likewise.
8243 (Archive::incremental_info): Likewise.
8244 (Archive::Should_include): Likewise.
8245 (Archive::should_include_member): Likewise.
8246 (Archive::Armap_entry): Remove.
8247 (Archive::Unused_symbol_iterator): Remove.
8248 (Archive::unused_symbols_begin): Remove.
8249 (Archive::unused_symbols_end): Remove.
8250 (Archive::do_filename): New function.
8251 (Archive::do_get_mtime): New function.
8252 (Archive::do_for_all_unused_symbols): New function.
8253 (Archive::task_): Move to base class.
8254 (Archive::incremental_info_): Likewise.
8255 (class Lib_group): Derive from Library_base.
8256 (Lib_group::do_filename): New function.
8257 (Lib_group::do_get_mtime): New function.
8258 (Lib_group::do_for_all_unused_symbols): New function.
8259 (Lib_group::task_): Move to base class.
8260 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8261 function.
8262 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8263 function.
8264 * incremental.cc (Incremental_inputs::report_archive_begin):
8265 Use Library_base; call library's get_mtime; add incremental inputs
8266 entry before members.
8267 (class Unused_symbol_visitor): New class.
8268 (Incremental_inputs::report_archive_end): Use Library_base; use
8269 visitor class to record unused symbols; don't add incremental inputs
8270 entry after members.
8271 (Incremental_inputs::report_object): Use Library_base.
8272 * incremental.h
8273 (Incremental_archive_entry::Incremental_archive_entry): Remove
8274 unused Archive parameter.
8275 (Incremental_inputs::report_archive_begin): Use Library_base.
8276 (Incremental_inputs::report_archive_end): Likewise.
8277 (Incremental_inputs::report_object): Likewise.
8278 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8279 function.
8280 * object.h (Object::for_all_global_symbols): New function.
8281 (Object::do_for_all_global_symbols): New function.
8282 (Sized_relobj::do_for_all_global_symbols): New function.
8283 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8284 function.
8285 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8286 function.
8287
8288 2011-03-27 Ian Lance Taylor <iant@google.com>
8289
8290 * archive.cc (Archive::interpret_header): Return -1 if something
8291 goes wrong. Change callers accordingly.
8292
8293 2011-03-25 Cary Coutant <ccoutant@google.com>
8294
8295 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8296 * testsuite/Makefile.in: Regenerate.
8297
8298 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8299
8300 * plugin.cc (get_view): New.
8301 (Plugin::load): Pass get_view to the plugin.
8302 (Plugin_manager::get_view): New.
8303
8304 2011-03-21 Ian Lance Taylor <iant@google.com>
8305
8306 * testsuite/final_layout.sh: Rewrite to not use dc.
8307 * testsuite/relro_test.sh: Fail if dc is not present.
8308
8309 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8310
8311 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8312 Change == to -eq.
8313 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8314 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8315 Change == to -eq.
8316 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8317 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8318
8319 2011-03-14 Ian Lance Taylor <iant@google.com>
8320
8321 * script-sections.cc (Sort_output_sections::script_compare):
8322 Rename from is_before, change return type.
8323 (Sort_output_sections::operator()): Adjust accordingly.
8324
8325 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8326
8327 PR gold/12572
8328 * testsuite/odr_violation2.cc: Add comment to make all error line
8329 numbers double digits.
8330 * testsuite/debug_msg.sh: Adjust expected errors.
8331
8332 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8333
8334 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8335 but mark earlier ones as non-canonical
8336 (offset_to_iterator): Update search target and example
8337 (do_addr2line): Return extra lines in a vector*
8338 (format_file_lineno): Extract from do_addr2line
8339 (one_addr2line): Add vector* out-param
8340 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8341 when a lineno entry appeared last for its instruction
8342 (Dwarf_line_info): Add vector* out-param
8343 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8344 * symtab.cc (Odr_violation_compare): Include the lineno in the
8345 comparison again.
8346 (linenos_from_loc): New. Combine the canonical line for an
8347 address with its other lines.
8348 (True_if_intersect): New. Helper functor to make
8349 std::set_intersection a query.
8350 (detect_odr_violations): Compare sets of lines instead of just
8351 one line for each function. This became less deterministic, but
8352 has fewer false positives.
8353 * symtab.h: Declarations.
8354 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8355 mix an optimized and non-optimized object in the same binary
8356 (odr_violation2.so): Same.
8357 * testsuite/Makefile.in: Regenerate from Makefile.am.
8358 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8359 * testsuite/debug_msg.sh: Update line numbers and add
8360 assertions.
8361 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8362 non-optimized context.
8363 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8364 isn't inlined, and use OdrDerived in an optimized context.
8365 * testsuite/odr_header1.h: Defines OdrDerived, where
8366 optimization will change the
8367 first-instruction-in-the-destructor's file and line number.
8368 * testsuite/odr_header2.h: Defines OdrBase.
8369
8370 2011-03-09 Ian Lance Taylor <iant@google.com>
8371
8372 * fileread.cc (File_read::clear_views): Don't delete the whole
8373 file view.
8374
8375 2011-03-08 Ian Lance Taylor <iant@google.com>
8376
8377 PR gold/12525
8378 * fileread.cc: #include <climits>.
8379 (GOLD_IOV_MAX): Define.
8380 (File_read::read_multiple): Limit number of entries by iov_max.
8381 * fileread.h (class File_read): Always set max_readv_entries to
8382 128.
8383
8384 2011-03-07 Ian Lance Taylor <iant@google.com>
8385
8386 PR gold/12525
8387 * options.h (class General_options): Add -dy and -dn.
8388
8389 2011-03-02 Cary Coutant <ccoutant@google.com>
8390
8391 * testsuite/script_test_9.t: Add TLS segment.
8392
8393 2011-03-02 Simon Baldwin <simonb@google.com>
8394
8395 * configure.ac: Add check for gnu_indirect_function support in
8396 the toolchain building binutils.
8397 * configure: Rebuild.
8398
8399 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8400
8401 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8402 plugin only symbols.
8403 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8404 in plugin files as not needed in the symbol table.
8405
8406 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8407
8408 * output.cc (Output_section::add_input_section): Delay fill
8409 generation for section ordering.
8410
8411 2011-02-09 Ian Lance Taylor <iant@google.com>
8412
8413 PR gold/12316
8414 * object.h (class Sized_relobj): Remove clear_local_symbols.
8415 * reloc.cc (Sized_relobj::do_relocate): Don't call
8416 clear_local_symbols.
8417
8418 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8419
8420 * plugin.cc (is_visible_from_outside): Return true for symbols
8421 in the -u option.
8422
8423 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8424
8425 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8426 filename.
8427
8428 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8429
8430 * icf.h (is_section_foldable_candidate): Change type of parameter
8431 to std::string.
8432 * icf.cc (Icf::find_identical_sections): Change type of local variable
8433 section_name to be std::string.
8434 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8435
8436 2011-01-25 Ian Lance Taylor <iant@google.com>
8437
8438 * script.cc (script_add_extern): Rewrite to use
8439 add_symbol_reference.
8440
8441 2011-01-25 Doug Kwan <dougkwan@google.com>
8442
8443 * icf.cc (get_section_contents): Always lock section's object.
8444
8445 2011-01-24 Ian Lance Taylor <iant@google.com>
8446
8447 * options.h (class General_options): Accept
8448 --no-detect-odr-violations.
8449
8450 2011-01-24 Ian Lance Taylor <iant@google.com>
8451
8452 * version.cc (version_string): Bump to 1.11.
8453
8454 2011-01-24 Ian Lance Taylor <iant@google.com>
8455
8456 * plugin.cc (class Plugin_rescan): Define new class.
8457 (Plugin_manager::claim_file): Set any_claimed_.
8458 (Plugin_manager::save_archive): New function.
8459 (Plugin_manager::save_input_group): New function.
8460 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8461 necessary.
8462 (Plugin_manager::new_undefined_symbol): New function.
8463 (Plugin_manager::rescan): New function.
8464 (Plugin_manager::rescannable_defines): New function.
8465 (Plugin_manager::add_input_file): Set any_added_.
8466 * plugin.h (class Plugin_manager): define new fields rescannable_,
8467 undefined_symbols_, any_claimed_, and any_added_. Declare
8468 Plugin_rescan as friend. Declare new functions.
8469 (Plugin_manager::Rescannable): Define type.
8470 (Plugin_manager::Rescannable_list): Define type.
8471 (Plugin_manager::Undefined_symbol_list): Define type.
8472 (Plugin_manager::Plugin_manager): Initialize new fields.
8473 * archive.cc (Archive::defines_symbol): New function.
8474 (Add_archive_symbols::run): Pass archive to plugins if any.
8475 * archive.h (class Archive): Declare defines_symbol.
8476 * readsyms.cc (Input_group::~Input_group): New function.
8477 (Finish_group::run): Pass input_group to plugins if any.
8478 * readsyms.h (class Input_group): Declare destructor.
8479 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8480 any.
8481
8482 2011-01-10 Ian Lance Taylor <iant@google.com>
8483
8484 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8485 section as relro.
8486 (Layout::set_segment_offsets): Reset increase_relro before calling
8487 set_section_addresses a second time.
8488
8489 2011-01-04 Cary Coutant <ccoutant@google.com>
8490
8491 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8492 sections before NOBITS sections.
8493
8494 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8495
8496 * version.cc (print_version): Update copyright to 2011.
8497
8498 2010-12-23 Cary Coutant <ccoutant@google.com>
8499
8500 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8501 of OS to this->add. Add OD parameter to second form of the function.
8502
8503 2010-12-20 Ian Lance Taylor <iant@google.com>
8504
8505 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8506 second of two consecutive entries with same offset.
8507
8508 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8509
8510 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8511 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8512 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8513 to avoid unneeded links against $(LDADD).
8514 * testsuite/Makefile.in: Regenerate.
8515
8516 2010-12-15 Ian Lance Taylor <iant@google.com>
8517
8518 PR gold/12324
8519 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8520 for R_X86_64_32 and R_X86_64_PC32.
8521 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8522 ver_matching_def_pic.o.
8523 (ver_matching_def_pic.o): New target.
8524
8525 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8526
8527 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8528 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8529 Move definition before File_read::View member definitions.
8530 (File_read::View::~View): Initialize and hold lock before
8531 updating current_mapped_bytes.
8532
8533 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8534
8535 * dwarf_reader.cc: Remove outdated comment.
8536 * gold-threads.cc: Fix typo in error message.
8537 * archive.cc: Fix typos in comments.
8538 * archive.h: Likewise.
8539 * arm-reloc-property.cc: Likewise.
8540 * arm-reloc-property.h: Likewise.
8541 * arm-reloc.def: Likewise.
8542 * arm.cc: Likewise.
8543 * attributes.h: Likewise.
8544 * cref.cc: Likewise.
8545 * ehframe.cc: Likewise.
8546 * fileread.h: Likewise.
8547 * gold.h: Likewise.
8548 * i386.cc: Likewise.
8549 * icf.cc: Likewise.
8550 * incremental.h: Likewise.
8551 * int_encoding.cc: Likewise.
8552 * layout.h: Likewise.
8553 * main.cc: Likewise.
8554 * merge.h: Likewise.
8555 * object.cc: Likewise.
8556 * object.h: Likewise.
8557 * options.cc: Likewise.
8558 * readsyms.cc: Likewise.
8559 * reduced_debug_output.cc: Likewise.
8560 * reloc.cc: Likewise.
8561 * script-sections.cc: Likewise.
8562 * sparc.cc: Likewise.
8563 * symtab.h: Likewise.
8564 * target-reloc.h: Likewise.
8565 * target.cc: Likewise.
8566 * target.h: Likewise.
8567 * timer.cc: Likewise.
8568 * timer.h: Likewise.
8569 * x86_64.cc: Likewise.
8570
8571 2010-12-09 Cary Coutant <ccoutant@google.com>
8572
8573 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8574 stack.
8575 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8576 parameter; change all callers.
8577 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8578 * options.h (warn_execstack): New option.
8579
8580 2010-12-07 Doug Kwan <dougkwan@google.com>
8581
8582 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8583 like function call relocations.
8584
8585 2010-12-07 Ian Lance Taylor <iant@google.com>
8586
8587 * archive.cc (Archive::get_elf_object_for_member): Permit
8588 punconfigured to be NULL.
8589 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8590 (Archive::include_member): Pass NULL to get_elf_object_for_member
8591 if we searched for the archive and this is the first included
8592 object.
8593
8594 2010-12-01 Ian Lance Taylor <iant@google.com>
8595
8596 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8597 track_relocs_type_ field.
8598 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8599 Set track_relocs_type_.
8600 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8601 contents when using RELA relocs.
8602 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8603 reloc_map_.
8604 * reloc.cc (Track_relocs::next_addend): New function.
8605 * reloc.h (class Track_relocs): Declare next_addend.
8606
8607 2010-12-01 Ian Lance Taylor <iant@google.com>
8608
8609 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8610 virtual destructor.
8611
8612 2010-12-01 Ian Lance Taylor <iant@google.com>
8613
8614 * README: Update compilers known to work and fail.
8615
8616 2010-11-23 Matthias Klose <doko@ubuntu.com>
8617
8618 * configure.in: For --enable-gold, handle value `default' instead of
8619 `both*'. Always install ld as ld.bfd, install as ld if gold is
8620 not the default.
8621 * configure: Regenerate.
8622
8623 2010-11-18 Doug Kwan <dougkwan@google.com>
8624
8625 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8626 and right_alignment to be zero. Store result alignment only if it is
8627 greater than existing alignment.
8628
8629 2010-11-16 Cary Coutant <ccoutant@google.com>
8630
8631 PR gold/12220
8632 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8633 Check for ".zdebug_line".
8634
8635 2010-11-16 Doug Kwan <dougkwan@google.com>
8636 Cary Coutant <ccoutant@google.com>
8637
8638 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8639 by reference; adjust all callers.
8640 * output.cc (Output_segment::set_section_addresses): Adjust references
8641 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8642 list is empty.
8643 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8644 end at page boundary.
8645
8646 2010-11-16 Cary Coutant <ccoutant@google.com>
8647
8648 PR gold/12220
8649 * layout.cc (Layout::choose_output_section): Transform names of
8650 compressed sections even when using a script with a SECTIONS clause.
8651 (Layout::output_section_name): Remove code to transform
8652 compressed debug section names.
8653 * output.cc (Output_section::add_input_section): Use uncompressed
8654 section size when tracking input sections.
8655
8656 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8657
8658 * symtab.h (Symbol::NON_PIC_REF): Remove.
8659 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8660 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8661 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8662 (Symbol::use_plt_offset): Take a flags argument and pass it
8663 directly to needs_dynamic_reloc. Restrict check for undefined
8664 weak symbols to function calls.
8665 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8666 (Target_arm::Scan::global): Use it.
8667 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8668 (Target_arm::Relocate::relocate): Likewise.
8669 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8670 parameter with an r_type parameter. Use get_reference_flags
8671 to get the flags.
8672 (Target_arm::Relocate::relocate): Update accordingly.
8673 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8674 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8675 (Target_i386::Scan::global): Likewise.
8676 (Target_i386::Relocate::relocate): Likewise.
8677 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8678 parameter with an r_type parameter. Use get_reference_flags
8679 to get the flags.
8680 (Target_i386::Relocate::relocate): Update accordingly.
8681 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8682 (Target_powerpc::Scan::global): Use it.
8683 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8684 (Target_powerpc::Relocate::relocate): Likewise.
8685 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8686 (Target_sparc::Scan::global): Use it.
8687 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8688 (Target_sparc::Relocate::relocate): Likewise.
8689 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8690 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8691 (Target_x86_64::Scan::global): Likewise.
8692 (Target_x86_64::Relocate::relocate): Likewise.
8693
8694 2010-11-08 Doug Kwan <dougkwan@google.com>
8695 Cary Coutant <ccoutant@google.com>
8696
8697 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8698 (Arm_exidx_merge_section::section_contents_): New data member.
8699 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8700 (Arm_input_section::~Arm_input_section): De-allocate memory.
8701 (Arm_input_section::original_contents_): New data member.
8702 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8703 in parameters instead of calling Object::section_contents without
8704 locking.
8705 (Arm_output_section::group_section): New parameter TASK. Pass it
8706 to callees that need locking objects.
8707 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8708 to lock EXIDX input sections. Fix a formatting issue. Call
8709 Arm_exidx_merged_section::build_contents to create merged section
8710 contents.
8711 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8712 to lock object of stub table owner.
8713 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8714 TEXT_SIZE to initialize data member TEXT_SIZE_.
8715 (Arm_exidx_input_section::addralign): Fix typo in comment.
8716 (Arm_exidx_input_section::text_size): New method.
8717 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8718 that require locking objects. Lock objects before scanning for stubs
8719 and updating local symbols.
8720 (Arm_input_section<big_endian>::init): Copy contents of original
8721 input section.
8722 (Arm_input_section<big_endian>::do_write): Use saved contents of
8723 original input section instead of calling Object::section_contents
8724 without locking.
8725 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8726 size without calling Object::section_size().
8727 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8728 for size. Allocate a buffer for merged EXIDX entries.
8729 (Arm_exidx_merged_section::build_contents): New method.
8730 (Arm_exidx_merged_section::do_write): Move merge section contents
8731 building code to Arm_exidx_merged_section::build_contetns. Write
8732 out contetns in buffer instead of building it on the fly.
8733 (Arm_relobj::make_exidx_input_section): Also pass text section size
8734 to Arm_exidx_input_section constructor.
8735 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8736 (Arm_dynobj::do_read_symbols): Fix memory leak.
8737 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8738 * target.h: (class Task): Add forward declaration.
8739 (Target::relax): Add new parameter TASK and pass it to
8740 Target::do_relax().
8741 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8742
8743 2010-11-05 Cary Coutant <ccoutant@google.com>
8744
8745 PR gold/10708
8746 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8747 object when reading from the file.
8748 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8749 second layout pass.
8750 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8751 when reading section contents.
8752 (get_section_contents): Likewise.
8753 (icf::find_identical_sections): Likewise.
8754 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8755 object when reading from the file.
8756 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8757 the object when doing deferred section layout.
8758
8759 2010-11-03 Nick Clifton <nickc@redhat.com>
8760
8761 PR gold/12001
8762 * script.h (class Symbol_assignment: name): New member. Returns
8763 the name of the symbol.
8764 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8765 Returns true if the given symbol name is on the list of
8766 assignments wating to be processed.
8767 * archive.cc (should_incldue_member): If the symbol is undefined,
8768 check to see if it is on the list of symbols pending assignment.
8769
8770 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8771
8772 * script-sections.cc (Script_sections::find_memory_region): Check
8773 for a NULL output section pointer.
8774
8775 2010-10-29 Doug Kwan <dougkwan@google.com>
8776
8777 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8778 Output_section::add_relaxed_input_section.
8779 * output.cc (Output_section::add_relaxed_input_section): Add new
8780 arguments LAYOUT and NAME. Set section order index.
8781 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8782 Copy section order index.
8783 * output.h (Output_section::add_relaxed_input_section): Add new
8784 arguments LAYOUT and NAME.
8785
8786 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8787
8788 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8789 NATIVE_OR_CROSS_LINKER.
8790 * testsuite/Makefile.in: Regenerate.
8791
8792 2010-10-20 Doug Kwan <dougkwan@google.com>
8793
8794 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8795 without SHF_LINK_ORDER flags.
8796 * layout.cc (Layout::choose_output_section): Do not filter
8797 SHF_LINK_ORDER flag in a relocatable link.
8798
8799 2010-10-17 Cary Coutant <ccoutant@google.com>
8800
8801 * output.h (Output_segment::set_section_addresses): Change function
8802 signature. Update all callers.
8803 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8804 sections.
8805 (Output_segment::set_section_addresses): Align after last TLS
8806 section. Add padding before last relro section instead of after.
8807
8808 2010-10-17 Doug Kwan <dougkwan@google.com>
8809
8810 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8811 GOT output section to be writable.
8812
8813 2010-10-14 Cary Coutant <ccoutant@google.com>
8814
8815 * debug.h (DEBUG_INCREMENTAL): New flag.
8816 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8817 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8818 mode.
8819 * incremental.cc (report_command_line): Ignore all forms of
8820 --incremental.
8821 * layout.cc (Layout::Layout): Check parameters for incremental link
8822 mode.
8823 * options.cc (General_options::parse_incremental): New function.
8824 (General_options::parse_no_incremental): New function.
8825 (General_options::parse_incremental_full): New function.
8826 (General_options::parse_incremental_update): New function.
8827 (General_options::incremental_mode_): New data member.
8828 (General_options::finalize): Check incremental_mode_.
8829 * options.h (General_options): Update help text for --incremental.
8830 Add --no-incremental, --incremental-full, --incremental-update.
8831 (General_options::Incremental_mode): New enum type.
8832 (General_options::incremental_mode): New function.
8833 (General_options::incremental_mode_): New data member.
8834 * parameters.cc (Parameters::incremental_mode_): New data member.
8835 (Parameters::set_options): Set incremental_mode_.
8836 (Parameters::set_incremental_full): New function.
8837 (Parameters::incremental): New function.
8838 (Parameters::incremental_update): New function.
8839 (set_parameters_incremental_full): New function.
8840 * parameters.h (Parameters::set_incremental_full): New function.
8841 (Parameters::incremental): New function.
8842 (Parameters::incremental_update): New function.
8843 (Parameters::incremental_mode_): New data member.
8844 (set_parameters_incremental_full): New function.
8845 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8846 incremental link mode.
8847 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8848 (Sized_relobj::do_relocate_sections): Likewise.
8849 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8850 option.
8851 * testsuite/Makefile.in: Regenerate.
8852 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8853
8854 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8855
8856 * script-sections.h (class Script_sections): Make
8857 Sections_elements typedef public.
8858 * script-sections.cc (class Sort_output_sections): Add elements_
8859 field. Add constructor which sets it; change all callers.
8860 (Sort_output_sections::is_before): New function.
8861 (Sort_output_sections::operator()): Call is_before.
8862 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8863 conditional.
8864 * testsuite/script_test_10.sh: New test. Test script section
8865 order.
8866 * testsuite/script_test_10.t: Likewise.
8867 * testsuite/script_test_10.s: Likewise.
8868 * testsuite/Makefile.am: Wrap the cross linker tests and the
8869 common tests into NATIVE_OR_CROSS_LINKER.
8870 (check_SCRIPTS): Add script_test_10.sh.
8871 (check_DATA): Add script_test_10.stdout.
8872 (script_test_10.o, script_test_10): New targets.
8873 (script_test_10.stdout): New target.
8874 * configure, testsuite/Makefile.in: Regenerate.
8875
8876 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8877
8878 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8879 error for the deprecated relocations.
8880 (Target_arm::Scan::global): Likewise.
8881 (Target_arm::Relocate::relocate): Likewise.
8882
8883 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8884
8885 * fileread.cc (Input_file::find_file): Initialize *found_name
8886 and *namep when using the fallback search for case 4.
8887
8888 2010-10-11 Cary Coutant <ccoutant@google.com>
8889
8890 * options.h (class General_options): Redefine -z lazy as an alias for
8891 the negation of -z now.
8892
8893 2010-10-11 Ian Lance Taylor <iant@google.com>
8894
8895 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8896 binding.
8897
8898 2010-10-06 Nick Clifton <nickc@redhat.com>
8899
8900 * script-sections.cc(class Memory_region): Remove
8901 current_lma_offset_ field. Rename current_vma_offset_ to
8902 current_offset_. Add last_section_ field.
8903 (Memory_region::get_current_vma_address): Rename to
8904 get_current_address.
8905 (Memory_region::get_current_lma_address): Delete.
8906 (Memory_region::increment_vma_offset): Rename to
8907 increment_offset.
8908 (Memory_region::increment_lma_offset): Delete.
8909 (Memory_region::attributes_compatible): New method. Returns
8910 true if the provided section is compatible with the region.
8911 (Memory_region::get_last_section): New method. Returns the last
8912 section to use the region.
8913 (Memory_region::set_last_section): New method. Stores the last
8914 section to use the region.
8915 (Script_sections::block_in_region): New method. Returns true if
8916 a block of memory is contained within a region.
8917 (Script_sections::find_memory_region): New method. Locates a
8918 memory region to be used to set a VMA or LMA address.
8919 (Output_section_definition::set_section_addresses): Add code to
8920 check for addresses set by memory regions.
8921 (Output_segment::set_section_addresses): Remove memory region
8922 walking code.
8923 (Script_sections::create_segment): Add a warning if a header
8924 segment is created outside of any region.
8925 * script-sections.h (class Script_sections): Add prototypes for
8926 find_memory_region and block_in_region methods.
8927 * testsuite/memory_test.s: Use .long instead of .word.
8928 * testsuite/memory_test.t: Add some more output sections.
8929 * testsuite/memory_test.sh: Update expected output.
8930
8931 2010-10-02 Doug Kwan <dougkwan@google.com>
8932
8933 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8934 defintion to symtab.h
8935 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8936 declaration to defintion.
8937
8938 2010-10-01 Nick Clifton <nickc@redhat.com>
8939
8940 * expression.cc (eval): Replace dummy argument with NULL.
8941 (eval_maybe_dot): Check for a NULL result section pointer.
8942 (Symbol_expression::value): Likewise.
8943 (Dot_expression::value): Likewise.
8944 (BINARY_EXPRESSION): Likewise.
8945 (Max_expression::value): Likewise.
8946 (Min_expression::value): Likewise.
8947 (Absolute_expression::value): Likewise.
8948 (Addr_expression::value_from_output_section): Likewise.
8949 (Loaddddr_expression::value_from_output_section): Likewise.
8950 (Segment_start_expression::value): Likewise.
8951 * script-sections.cc
8952 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8953 argument with NULL.
8954 (Sections_elememt_dot_assignment::set_section_addresses):
8955 Likewise.
8956 (Output_data_expression::do_write_to_buffer): Likewise.
8957 (Output_section_definition::finalize_symbols): Likewise.
8958 (Output_section_definition::set_section_addresses): Likewise.
8959
8960 2010-09-30 Doug Kwan <dougkwan@google.com>
8961
8962 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8963
8964 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8965
8966 * target.h (Target::can_icf_inline_merge_sections): New virtual
8967 function.
8968 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8969 virtual function.
8970 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8971 virtual function.
8972 * icf.cc (get_section_contents): Inline merge sections only when
8973 target allows it.
8974
8975 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8976
8977 * configure: Regenerate.
8978
8979 2010-09-17 Ian Lance Taylor <iant@google.com>
8980
8981 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8982 * testsuite/Makefile.am (memory_test.o): New target.
8983 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8984 memory_test.t.
8985 * testsuite/Makefile.in: Rebuild.
8986
8987 2010-09-17 Doug Kwan <dougkwan@google.com>
8988
8989 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8990 defintion if relocation uses GOT entries of the symbol.
8991 * testsuite/icf_safe_test.sh: Fix test.
8992 * testsuite/icf_safe_so_test.sh: Fix test.
8993
8994 2010-09-16 Cary Coutant <ccoutant@google.com>
8995
8996 * script_sections.cc (class Memory_region): Remove "NULL" from
8997 vector initializations.
8998
8999 2010-09-15 Cary Coutant <ccoutant@google.com>
9000
9001 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
9002 Resolve forwarding symbols.
9003
9004 2010-09-15 Doug Kwan <dougkwan@google.com>
9005
9006 * gold/testsuite/script_test_3.t: Add ARM special sections.
9007 * gold/testsuite/script_test_4.t: Same.
9008 * gold/testsuite/script_test_5.t: Same.
9009 * gold/testsuite/script_test_6.t: Same.
9010 * gold/testsuite/script_test_7.t: Same.
9011 * gold/testsuite/script_test_7.t: Same.
9012 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
9013
9014 2010-09-14 Cary Coutant <ccoutant@google.com>
9015
9016 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
9017 (Target_x86_64::Relocate::relocate_tls): Replace check for
9018 saw_tls_block_reloc_ with test for executable section.
9019
9020 2010-09-12 Cary Coutant <ccoutant@google.com>
9021
9022 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
9023 position-independent executables to shared libraries need dynamic
9024 relocations.
9025 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
9026 position-independent executables.
9027 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
9028 * testsuite/Makefile.in: Regenerate.
9029
9030 2010-09-10 Nick Clifton <nickc@redhat.com>
9031
9032 PR gold/11997
9033 * testsuite/memory_test.t: Discard any sections that are not
9034 needed.
9035
9036 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
9037
9038 PR gold/11996
9039 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
9040 "This::" to work around a bug in gcc 4.2.
9041
9042 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
9043
9044 2010-09-09 Rafael Espindola <espindola@google.com>
9045
9046 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
9047 sections with different PF_X flags in the same segment.
9048 (Layout::find_first_load_seg): Search all segments to find the first
9049 one.
9050 * options.h (rosegment): New.
9051
9052 2010-09-08 Rafael Espindola <espindola@google.com>
9053
9054 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
9055
9056 2010-09-08 Doug Kwan <dougkwan@google.com>
9057
9058 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
9059 (Arm_relobj::do_relocate_sections): Add new parameter for output
9060 file to match the parent.
9061 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
9062 of local symbols instead of input values. Update code to track
9063 changes in gold::relocate_section.
9064 * object.cc (Sized_relobj::compute_final_local_value): New methods.
9065 (Sized_relobj::compute_final_local_value_internal): New methods.
9066 (Sized_relobj::do_finalize_local_symbols): Move code from loop
9067 body into private version of Sized_relobj::compute_final_local_value.
9068 Call the inline method.
9069 * object.h (Symbol_value::Symbol_value): Define destructor. Free
9070 merged symbol value if there is one.
9071 (Symbol_value::has_output_value): New method defintiion.
9072 (Sized_relobj::Compute_final_local_value_status): New enum type.
9073 (Sized_relobj::compute_final_local_value): New methods.
9074 (Sized_relobj::compute_final_local_value_internal): New methods.
9075 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
9076 and arm_cortex_a8.sh.
9077 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
9078 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
9079 New tests.
9080 * Makefile.in: Regenerate.
9081 * testsuite/arm_bl_out_of_range.s: Update test.
9082 * testsuite/thumb_bl_out_of_range.s: Ditto.
9083 * testsuite/thumb_blx_out_of_range.s: Ditto.
9084 * testsuite/arm_branch_out_of_range.sh: New file.
9085 * testsuite/arm_cortex_a8.sh: Ditto.
9086 * testsuite/arm_cortex_a8_b.s: Ditto.
9087 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
9088 * testsuite/arm_cortex_a8_b_local.s: Ditto.
9089 * testsuite/arm_cortex_a8_bl.s: Ditto.
9090 * testsuite/arm_cortex_a8_blx.s: Ditto.
9091 * testsuite/arm_cortex_a8_local.s: Ditto.
9092 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
9093 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
9094
9095 2010-09-08 Rafael Espindola <espindola@google.com>
9096
9097 * Makefile.am (memory_test.stdout): Run readelf with -W.
9098 * Makefile.in: Regenerate.
9099 * testsuite/memory_test.sh: Make the regexps accept both 32 and
9100 64 bit output.
9101
9102 2010-09-08 Rafael Espindola <espindola@google.com>
9103
9104 * script-sections.cc (Script_sections::add_memory_region): Convert
9105 field precision to int.
9106 * script.cc (script_set_section_region, script_set_section_region):
9107 Convert field precision to int.
9108
9109 2010-09-08 Rafael Espindola <espindola@google.com>
9110
9111 * arm.cc (do_finalize_sections): Create the __exidx_start and
9112 __exdix_end symbols even when the section is missing.
9113
9114 2010-09-08 Nick Clifton <nickc@redhat.com>
9115
9116 * README: Remove claim that MEMORY is not supported.
9117 * expression.cc (script_exp_function_origin)
9118 (script_exp_function_length): Move from here to ...
9119 * script.cc: ... here.
9120 (script_set_section_region, script_add_memory)
9121 (script_parse_memory_attr, script_include_directive): New
9122 functions.
9123 * script-sections.cc
9124 (class Memory_region): New class.
9125 (class Output_section_definition): Add set_memory_region,
9126 set_section_vma, set_section_lma and get_section_name methods.
9127 (class Script_Sections): Add add_memory_region,
9128 find_memory_region, find_memory_region_origin,
9129 find_memory_region_length and set_memory_region methods.
9130 Have set_section_addresses method walk the list of set memory
9131 regions.
9132 Extend the print methos to display memory regions.
9133 * script-sections.h: Add prototypes for new methods.
9134 Add enum for MEMORY region attributes.
9135 * yyscript.y: Add support for parsing MEMORY regions.
9136 * script-c.h: Add prototypes for new functions.
9137 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9138 * testsuite/Makefile.in: Regenerate.
9139 * testsuite/memory_test.sh: New script.
9140 * testsuite/memory_test.s: New assembler source file.
9141 * testsuite/memory_test.t: New linker script.
9142
9143 2010-08-27 Doug Kwan <dougkwan@google.com>
9144
9145 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9146 reference override an existing dynamic weak reference.
9147 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9148 * testsuite/Makefile.in: Regenerate.
9149 * testsuite/dyn_weak_ref.sh: New file.
9150 * testsuite/dyn_weak_ref_1.c: Ditto.
9151 * testsuite/dyn_weak_ref_2.c: Ditto.
9152
9153 2010-08-27 Ian Lance Taylor <iant@google.com>
9154
9155 * incremental.h (class Incremental_input_entry): Add virtual
9156 destructor.
9157
9158 2010-08-27 Ian Lance Taylor <iant@google.com>
9159
9160 * testsuite/start_lib_test_3.c: Mark t3 as used.
9161
9162 2010-08-27 Nick Clifton <nickc@redhat.com>
9163
9164 * options.cc (version_script): Fix small typo in previous
9165 whitespace tidyup.
9166
9167 2010-08-25 Nick Clifton <nickc@redhat.com>
9168
9169 * archive.cc: Formatting fixes: Remove whitespace between
9170 typename and following asterisk. Remove whitespace between
9171 function name and opening parenthesis.
9172 * archive.h: Likewise.
9173 * arm.cc: Likewise.
9174 * attributes.cc: Likewise.
9175 * attributes.h: Likewise.
9176 * common.cc: Likewise.
9177 * copy-relocs.cc: Likewise.
9178 * dirsearch.h: Likewise.
9179 * dynobj.cc: Likewise.
9180 * ehframe.cc: Likewise.
9181 * ehframe.h: Likewise.
9182 * expression.cc: Likewise.
9183 * fileread.cc: Likewise.
9184 * fileread.h: Likewise.
9185 * gc.h: Likewise.
9186 * gold-threads.cc: Likewise.
9187 * gold.cc: Likewise.
9188 * i386.cc: Likewise.
9189 * icf.h: Likewise.
9190 * incremental-dump.cc: Likewise.
9191 * incremental.cc: Likewise.
9192 * layout.cc: Likewise.
9193 * layout.h: Likewise.
9194 * main.cc: Likewise.
9195 * merge.cc: Likewise.
9196 * merge.h: Likewise.
9197 * object.cc: Likewise.
9198 * object.h: Likewise.
9199 * options.cc: Likewise.
9200 * options.h: Likewise.
9201 * output.cc: Likewise.
9202 * output.h: Likewise.
9203 * plugin.cc: Likewise.
9204 * plugin.h: Likewise.
9205 * powerpc.cc: Likewise.
9206 * reloc.cc: Likewise.
9207 * script-c.h: Likewise.
9208 * script-sections.cc: Likewise.
9209 * script.cc: Likewise.
9210 * stringpool.cc: Likewise.
9211 * symtab.cc: Likewise.
9212 * symtab.h: Likewise.
9213 * target.cc: Likewise.
9214 * timer.cc: Likewise.
9215 * timer.h: Likewise.
9216 * version.cc: Likewise.
9217 * x86_64.cc: Likewise.
9218
9219 2010-08-24 Nick Clifton <nickc@redhat.com>
9220
9221 PR 11899
9222 * layout.cc (segment_precedes): Sort segments by their physical
9223 addresses, if they have been set.
9224
9225 2010-08-23 Cary Coutant <ccoutant@google.com>
9226
9227 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9228 symbols data.
9229 (Lib_group::include_member): Unlock object after deleting its
9230 symbols data.
9231 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9232 the bug fixed here.
9233
9234 2010-08-19 Neil Vachharajani <nvachhar@google.com>
9235 Cary Coutant <ccoutant@google.com>
9236
9237 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9238 constructor, and set_blocker.
9239 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9240 readsyms_blocker_.
9241 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9242 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9243 * testsuite/Makefile.am (start_lib_test): New test case.
9244 * testsuite/Makefile.in: Regenerate.
9245 * testsuite/start_lib_test_main.c: New file.
9246 * testsuite/start_lib_test_1.c: New file.
9247 * testsuite/start_lib_test_2.c: New file.
9248 * testsuite/start_lib_test_3.c: New file.
9249
9250 2010-08-19 Ian Lance Taylor <iant@google.com>
9251
9252 * Makefile.in: Rebuild with automake 1.11.1.
9253 * aclocal.m4: Likewise.
9254 * testsuite/Makefile.in: Likewise.
9255
9256 2010-08-19 Ian Lance Taylor <iant@google.com>
9257
9258 PR 10893
9259 * i386.cc (class Output_data_plt_i386): Update declarations.
9260 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9261 local_ifuncs_ fields.
9262 (Target_i386::do_plt_section_for_global): New function.
9263 (Target_i386::do_plt_section_for_local): New function.
9264 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9265 parameter; change all callers. Initialize global_ifuncs_ and
9266 local_ifuncs_. If doing a static link define __rel_iplt_start and
9267 __rel_iplt_end.
9268 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9269 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9270 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9271 symbols.
9272 (Target_i386::make_plt_section): New function, broken out of
9273 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9274 (Target_i386::make_plt_entry): Call make_plt_section.
9275 (Target_i386::make_local_ifunc_plt_entry): New function.
9276 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9277 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9278 R_386_IRELATIVE to switch.
9279 (Target_i386::Scan::global): Likewise.
9280 (Target_i386::Relocate::relocate): Likewise.
9281 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9282 switch.
9283 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9284 (Target_x86_64::do_plt_section_for_global): New function.
9285 (Target_x86_64::do_plt_section_for_local): New function.
9286 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9287 parameter; change all callers. If doing a static link define
9288 __rela_iplt_start and __rela_iplt_end.
9289 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9290 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9291 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9292 to point to .plt.
9293 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9294 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9295 switch.
9296 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9297 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9298 R_X86_64_IRELATIVE to switch.
9299 (Target_x86_64::Scan::global): Likewise.
9300 (Target_x86_64::Relocate::relocate): Likewise.
9301 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9302 switch.
9303 * target.h (class Target): Add plt_section_for_global and
9304 plt_section_for_local functions. Add do_plt_section_for_global
9305 and do_plt_section_for_local virtual functions.
9306 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9307 clarifying comments.
9308 (Symbol::use_plt_offset): Handle IFUNC symbol.
9309 * object.cc (Sized_relobj::Sized_relobj): Initialize
9310 local_plt_offsets_.
9311 (Sized_relobj::local_has_plt_offset): New function.
9312 (Sized_relobj::local_plt_offset): New function.
9313 (Sized_relobj::set_local_plt_offset): New function.
9314 (Sized_relobj::do_count): Handle IFUNC symbol.
9315 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9316 a bit away from input_shndx_ field. Add set_is_func_symbol and
9317 is_ifunc_symbol functions.
9318 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9319 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9320 local_plt_offsets_ field.
9321 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9322 * output.h (class Output_section_data): Add non-const
9323 output_section function.
9324 (class Output_data_got): Update declarations.
9325 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9326 Add use_plt_offset parameter to global and local constructors.
9327 Change all callers. Change local_sym_index_ field to 31 bits.
9328 Change GSYM_CODE and CONSTANT_CODE accordingly.
9329 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9330 doing a static link don't set sh_link field.
9331 (Output_data_got::Got_entry::write): Use PLT offset if
9332 appropriate.
9333 (Output_data_got::add_global_plt): New function.
9334 (Output_data_got::add_local_plt): New function.
9335 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9336 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9337 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9338 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9339 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9340 IFUNC conditional.
9341 * testsuite/ifunc-sel.h: New file.
9342 * testsuite/ifuncmain1.c: New file.
9343 * testsuite/ifuncmain1vis.c: New file.
9344 * testsuite/ifuncmod1.c: New file.
9345 * testsuite/ifuncdep2.c: New file.
9346 * testsuite/ifuncmain2.c: New file.
9347 * testsuite/ifuncmain3.c: New file.
9348 * testsuite/ifuncmod3.c: New file.
9349 * testsuite/ifuncmain4.c: New file.
9350 * testsuite/ifuncmain5.c: New file.
9351 * testsuite/ifuncmod5.c: New file.
9352 * testsuite/ifuncmain6pie.c: New file.
9353 * testsuite/ifuncmod6.c: New file.
9354 * testsuite/ifuncmain7.c: New file.
9355 * configure, testsuite/Makefile.in: Rebuild.
9356
9357 2010-08-18 Ian Lance Taylor <iant@google.com>
9358
9359 * incremental.cc
9360 (Output_section_incremental_inputs::write_input_files): Add cast
9361 to avoid signed/unsigned comparison warning.
9362 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9363
9364 2010-08-12 Cary Coutant <ccoutant@google.com>
9365
9366 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9367
9368 2010-08-13 Ian Lance Taylor <iant@google.com>
9369
9370 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9371
9372 2010-08-12 Cary Coutant <ccoutant@google.com>
9373 Doug Kwan <dougkwan@google.com>
9374
9375 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9376 defintion overrides non-weak undef, remember that the original undef
9377 is not weak.
9378 * symtab.cc (Symbol_table::sized_write_global): For undef without
9379 an original weak binding, set binding to global in output.
9380 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9381 * testsuite/Makefile.in: Regenerate.
9382 * testsuite/strong_ref_weak_def.sh: New file.
9383 * testsuite/strong_ref_weak_def_1.c: Ditto.
9384 * testsuite/strong_ref_weak_def_2.c: Ditto.
9385
9386 2010-08-12 Cary Coutant <ccoutant@google.com>
9387
9388 * testsuite/incremental_test.sh: Rewrite.
9389 * testsuite/incremental_test_1.c: Rewrite.
9390 * testsuite/incremental_test_2.c: Rewrite.
9391
9392 2010-08-12 Cary Coutant <ccoutant@google.com>
9393
9394 * arm.cc (Target_arm::got_size): Add const.
9395 (Target_arm::got_entry_count): New function.
9396 (Target_arm::plt_entry_count): New function.
9397 (Target_arm::first_plt_entry_offset): New function.
9398 (Target_arm::plt_entry_size): New function.
9399 (Output_data_plt_arm::entry_count): New function.
9400 (Output_data_plt_arm::first_plt_entry_offset): New function.
9401 (Output_data_plt_arm::get_plt_entry_size): New function.
9402 * i386.cc (Target_i386::got_size): Add const.
9403 (Target_i386::got_entry_count): New function.
9404 (Target_i386::plt_entry_count): New function.
9405 (Target_i386::first_plt_entry_offset): New function.
9406 (Target_i386::plt_entry_size): New function.
9407 (Output_data_plt_i386::entry_count): New function.
9408 (Output_data_plt_i386::first_plt_entry_offset): New function.
9409 (Output_data_plt_i386::get_plt_entry_size): New function.
9410 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9411 find_incremental_inputs_sections. Dump incremental_got_plt section.
9412 * incremental.cc: Include target.h.
9413 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9414 parameter. Adjust all callers. Find incremental_got_plt section.
9415 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9416 section.
9417 (Output_section_incremental_inputs::set_final_data_size): Calculate
9418 size of incremental_got_plt section.
9419 (Output_section_incremental_inputs::do_write): Write the
9420 incremental_got_plt section.
9421 (Got_plt_view_info): New struct.
9422 (Local_got_offset_visitor): New class.
9423 (Global_got_offset_visitor): New class.
9424 (Global_symbol_visitor_got_plt): New class.
9425 (Output_section_incremental_inputs::write_got_plt): New function.
9426 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9427 Add parameter. Adjust all callers.
9428 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9429 (Incremental_inputs::got_plt_section): New function.
9430 (Incremental_inputs::got_plt_section_): New data member.
9431 (Incremental_got_plt_reader): New class.
9432 * layout.cc (Layout::create_incremental_info_sections): Add the
9433 incremental_got_plt section.
9434 * object.h (Got_offset_list::get_list): New function.
9435 (Got offset_list::for_all_got_offsets): New function.
9436 (Sized_relobj::local_got_offset_list): New function.
9437 * powerpc.cc (Target_powerpc::got_size): Add const.
9438 (Target_powerpc::got_entry_count): New function.
9439 (Target_powerpc::plt_entry_count): New function.
9440 (Target_powerpc::first_plt_entry_offset): New function.
9441 (Target_powerpc::plt_entry_size): New function.
9442 (Output_data_plt_powerpc::entry_count): New function.
9443 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9444 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9445 * sparc.cc (Target_sparc::got_size): Add const.
9446 (Target_sparc::got_entry_count): New function.
9447 (Target_sparc::plt_entry_count): New function.
9448 (Target_sparc::first_plt_entry_offset): New function.
9449 (Target_sparc::plt_entry_size): New function.
9450 (Output_data_plt_sparc::entry_count): New function.
9451 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9452 (Output_data_plt_sparc::get_plt_entry_size): New function.
9453 * symtab.h (Symbol::got_offset_list): New function.
9454 (Symbol_table::for_all_symbols): New function.
9455 * target.h (Sized_target::got_entry_count): New function.
9456 (Sized_target::plt_entry_count): New function.
9457 (Sized_target::plt_entry_size): New function.
9458 * x86_64.cc (Target_x86_64::got_size): Add const.
9459 (Target_x86_64::got_entry_count): New function.
9460 (Target_x86_64::plt_entry_count): New function.
9461 (Target_x86_64::first_plt_entry_offset): New function.
9462 (Target_x86_64::plt_entry_size): New function.
9463 (Output_data_plt_x86_64::entry_count): New function.
9464 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9465 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9466
9467 2010-08-12 Cary Coutant <ccoutant@google.com>
9468
9469 * archive.cc: Include incremental.h.
9470 (Archive::Archive): Initialize incremental_info_.
9471 (Archive::include_member): Record archive members in incremental info.
9472 (Add_archive_symbols::run): Record begin and end of an archive in
9473 incremental info.
9474 (Lib_group::include_member): Record objects in incremental info.
9475 * archive.h (Incremental_archive_entry): Forward declaration.
9476 (Archive::set_incremental_info): New member function.
9477 (Archive::incremental_info): New member function.
9478 (Archive::Unused_symbol_iterator): New class.
9479 (Archive::unused_symbols_begin): New member function.
9480 (Archive::unused_symbols_end): New member function.
9481 (Archive::incremental_info_): New data member.
9482 * incremental-dump.cc (find_input_containing_global): New function.
9483 (dump_incremental_inputs): Dump new incremental info sections.
9484 * incremental.cc: Include symtab.h.
9485 (Output_section_incremental_inputs): New class.
9486 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9487 new incremental info sections.
9488 (Sized_incremental_binary::do_check_inputs): Likewise.
9489 (Incremental_inputs::report_archive): Remove.
9490 (Incremental_inputs::report_archive_begin): New function.
9491 (Incremental_inputs::report_archive_end): New function.
9492 (Incremental_inputs::report_object): New function.
9493 (Incremental_inputs::finalize_inputs): Remove.
9494 (Incremental_inputs::report_input_section): New function.
9495 (Incremental_inputs::report_script): Rewrite.
9496 (Incremental_inputs::finalize): Do nothing but finalize string table.
9497 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9498 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9499 (Incremental_inputs::create_data_sections): New function.
9500 (Incremental_inputs::relocs_entsize): New function.
9501 (Output_section_incremental_inputs::set_final_data_size): New function.
9502 (Output_section_incremental_inputs::do_write): New function.
9503 (Output_section_incremental_inputs::write_header): New function.
9504 (Output_section_incremental_inputs::write_input_files): New function.
9505 (Output_section_incremental_inputs::write_info_blocks): New function.
9506 (Output_section_incremental_inputs::write_symtab): New function.
9507 * incremental.h (Incremental_script_entry): Forward declaration.
9508 (Incremental_object_entry): Forward declaration.
9509 (Incremental_archive_entry): Forward declaration.
9510 (Incremental_inputs): Forward declaration.
9511 (Incremental_inputs_header_data): Remove.
9512 (Incremental_inputs_header): Remove.
9513 (Incremental_inputs_header_write): Remove.
9514 (Incremental_inputs_entry_data): Remove.
9515 (Incremental_inputs_entry): Remove.
9516 (Incremental_inputs_entry_write): Remove.
9517 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9518 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9519 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9520 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9521 Likewise.
9522 (Incremental_input_entry): New class.
9523 (Incremental_script_entry): New class.
9524 (Incremental_object_entry): New class.
9525 (Incremental_archive_entry): New class.
9526 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9527 (Incremental_inputs::report_inputs): Remove.
9528 (Incremental_inputs::report_archive): Remove.
9529 (Incremental_inputs::report_archive_begin): New function.
9530 (Incremental_inputs::report_archive_end): New function.
9531 (Incremental_inputs::report_object): Change prototype.
9532 (Incremental_inputs::report_input_section): New function.
9533 (Incremental_inputs::report_script): Change prototype.
9534 (Incremental_inputs::get_reloc_count): New function.
9535 (Incremental_inputs::set_reloc_count): New function.
9536 (Incremental_inputs::create_data_sections): New function.
9537 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9538 (Incremental_inputs::inputs_section): New function.
9539 (Incremental_inputs::symtab_section): New function.
9540 (Incremental_inputs::relocs_section): New function.
9541 (Incremental_inputs::get_stringpool): Add const.
9542 (Incremental_inputs::command_line): Add const.
9543 (Incremental_inputs::inputs): Remove.
9544 (Incremental_inputs::command_line_key): New function.
9545 (Incremental_inputs::input_file_count): New function.
9546 (Incremental_inputs::input_files): New function.
9547 (Incremental_inputs::relocs_entsize): New function.
9548 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9549 (Incremental_inputs::finalize_inputs): Remove.
9550 (Incremental_inputs::Input_info): Remove.
9551 (Incremental_inputs::lock_): Remove.
9552 (Incremental_inputs::inputs_): Change type.
9553 (Incremental_inputs::inputs_map_): Remove.
9554 (Incremental_inputs::current_object_entry_): New data member.
9555 (Incremental_inputs::inputs_section_): New data member.
9556 (Incremental_inputs::symtab_section_): New data member.
9557 (Incremental_inputs::relocs_section_): New data member.
9558 (Incremental_inputs::reloc_count_): New data member.
9559 (Incremental_inputs_reader): New class.
9560 (Incremental_symtab_reader): New class.
9561 (Incremental_relocs_reader): New class.
9562 * layout.cc (Layout::finalize): Move finalization of incremental info
9563 and creation of incremental info sections to follow finalization of
9564 symbol table. Set offsets for postprocessing sections.
9565 (Layout::create_incremental_info_sections): Call
9566 Incremental_inputs::create_data_sections. Add incremental symtab
9567 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9568 sections to layout after input sections.
9569 * layout.h (struct Timespec): Forward declaration.
9570 (Layout::incremental_inputs): Add const.
9571 (Layout::create_incremental_info_sections): Add parameter.
9572 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9573 * object.cc: Include incremental.h.
9574 (Relobj::finalize_incremental_relocs): New function.
9575 (Sized_relobj::do_layout): Record input sections in incremental info.
9576 * object.h (Object::output_section): New function.
9577 (Object::output_section_offset): Moved from Relobj.
9578 (Object::get_incremental_reloc_base): New function.
9579 (Object::get_incremental_reloc_count): New function.
9580 (Object::do_output_section): New function.
9581 (Object::do_output_section_offset): Moved from Relobj.
9582 (Object::do_get_incremental_reloc_base): New function.
9583 (Object::do_get_incremental_reloc_count): New function.
9584 (Object::Object): Initialize new data members.
9585 (Relobj::output_section): Renamed do_output_section and moved to
9586 protected.
9587 (Relobj::output_section_offset): Moved to Object.
9588 (Relobj::do_get_incremental_reloc_base): New function.
9589 (Relobj::do_get_incremental_reloc_count): New function.
9590 (Relobj::allocate_incremental_reloc_counts): New function.
9591 (Relobj::count_incremental_reloc): New function.
9592 (Relobj::finalize_incremental_relocs): New function.
9593 (Relobj::next_incremental_reloc_index): New function.
9594 (Relobj::reloc_counts_): New data member.
9595 (Relobj::reloc_bases_): New data member.
9596 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9597 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9598 (Sized_relobj::incremental_relocs_scan): New function.
9599 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9600 (Sized_relobj::incremental_relocs_write): New function.
9601 (Sized_relobj::incremental_relocs_write_reltype): New function.
9602 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9603 incremental link.
9604 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9605 archives and object files elsewhere.
9606 (Add_symbols::run): Report object files here.
9607 (Finish_group::run): Report end of archive at end of group.
9608 * reloc.cc: Include layout.h, incremental.h.
9609 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9610 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9611 (Sized_relobj::incremental_relocs_scan): New function.
9612 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9613 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9614 (Sized_relobj::incremental_relocs_write): New function.
9615 (Sized_relobj::incremental_relocs_write_reltype): New function.
9616 * script.cc (read_input_script): Rewrite test for incremental link.
9617 Change call to Incremental_inputs::report_script.
9618 * symtab.h (Symbol_table::first_global_index): New function.
9619 (Symbol_table::output_count): New function.
9620
9621 2010-08-12 Doug Kwan <dougkwan@google.com>
9622
9623 * arm.cc (Target_arm::merge_object_attributes): Check command line
9624 options --no-wchar-size-warning and --no-enum-size-warning.
9625 * options.h (General_options): Add ld-compatible options
9626 --no-enum-size-warning and --no-wchar-size-warning.
9627
9628 2010-08-04 Ian Lance Taylor <iant@google.com>
9629
9630 * x86_64.cc (Target_x86_64::Scan::local): Use
9631 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9632 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9633 (Target_x86_64::Scan::global): Likewise.
9634 (Target_x86_64::Relocate::relocate): Likewise.
9635 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9636 Likewise.
9637
9638 2010-08-03 Cary Coutant <ccoutant@google.com>
9639
9640 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9641 to reserve space in merged_strings vector. Keep total input size
9642 for stats.
9643 (Output_merge_string::do_print_merge_stats): Print total input size.
9644 * merge.h (Output_merge_string): Add input_size_ field.
9645 * stringpool.cc (Stringpool_template::string_length): Move
9646 implementations out of Stringpool_template class and place in
9647 stringpool.h.
9648 * stringpool.h (string_length): Move out of Stringpool_template.
9649
9650 2010-08-03 Ian Lance Taylor <iant@google.com>
9651
9652 PR 11712
9653 * layout.cc (relaxation_loop_body): If address of load segment is
9654 set, adjust address to include headers if possible.
9655
9656 2010-08-03 Ian Lance Taylor <iant@google.com>
9657
9658 * version.cc (version_string): Bump to 1.10.
9659
9660 2010-08-03 Ian Lance Taylor <iant@google.com>
9661
9662 PR 11805
9663 * layout.h (enum Output_section_order): Define.
9664 (class Layout): Update declarations.
9665 * layout.cc (Layout::get_output_section): Add order parameter.
9666 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9667 is_first_non_relro parameters. Change all callers.
9668 (Layout::choose_output_section): Likewise.
9669 (Layout::add_output_section_data): Likewise.
9670 (Layout::make_output_section): Likewise. Set order.
9671 (Layout::default_section_order): New function.
9672 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9673 * output.cc (Output_section::Output_section): Initialize order_.
9674 Don't initialize deleted fields.
9675 (Output_segment::Output_segment): Don't initialize deleted
9676 fields.
9677 (Output_segment::add_output_section_to_load): New function
9678 replacing add_output_section. Change all callers to call this or
9679 add_output_section_to_nonload.
9680 (Output_segment::add_output_section_to_nonload): New function.
9681 (Output_segment::remove_output_section): Rewrite.
9682 (Output_segment::add_initial_output_data): Likewise.
9683 (Output_segment::has_any_data_sections): Likewise.
9684 (Output_segment::is_first_section_relro): Likewise.
9685 (Output_segment::maximum_alignment): Likewise.
9686 (Output_segment::has_dynamic_reloc): New function replacing
9687 dynamic_reloc_count. Change all callers.
9688 (Output_segment::has_dynamic_reloc_list): New function replacing
9689 dynamic_reloc_count_list. Change all callers.
9690 (Output_segment::set_section_addresses): Rewrite.
9691 (Output_segment::set_offset): Rewrite.
9692 (Output_segment::find_first_and_last_list): Remove.
9693 (Output_segment::set_tls_offsets): Rewrite.
9694 (Output_segment::first_section_load_address): Likewise.
9695 (Output_segment::output_section_count): Likewise.
9696 (Output_segment::section_with_lowest_load_address): Likewise.
9697 (Output_segment::write_section_headers): Likewise.
9698 (Output_segment::print_sections_to_map): Likewise.
9699 * output.h (class Output_data): Remove dynamic_reloc_count_
9700 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9701 (Output_data::add_dynamic_reloc): Rewrite.
9702 (Output_data::has_dynamic_reloc): New function.
9703 (Output_data::dynamic_reloc_count): Remove.
9704 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9705 is_last_relro_, is_first_non_relro_, is_interp_,
9706 is_dynamic_linker_section_ fields. Add order and set_order
9707 functions. Remove is_relro_local, set_is_relro_local,
9708 is_last_relro, set_is_last_relro, is_first_non_relro,
9709 set_is_first_non_relro functions, is_interp, set_is_interp,
9710 is_dynamic_linker_section, and set_is_dynamic_linker_section
9711 functions.
9712 (class Output_segment): Change Output_data_list from std::list to
9713 std:;vector. Add output_lists_ field. Remove output_data_ and
9714 output_bss_ fields. Update declarations.
9715
9716 2010-08-02 Ian Lance Taylor <iant@google.com>
9717
9718 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9719 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9720 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9721
9722 2010-08-02 Ian Lance Taylor <iant@google.com>
9723
9724 PR 11855
9725 * script.cc (Script_options::Script_options): Initialize
9726 symbol_definitions_ and symbol_references_.
9727 (Script_options::add_symbol_assignment): Update
9728 symbol_definitions_ and symbol_references_.
9729 (Script_options::add_symbol_reference): New function.
9730 (script_symbol): New function.
9731 * script.h (class Script_options): Add symbol_definitions_ and
9732 symbol_references_ fields.
9733 (Script_options::referenced_const_iterator): New type.
9734 (Script_options::referenced_begin): New function.
9735 (Script_options::referenced_end): New function.
9736 (Script_options::is_referenced): New function.
9737 (Script_options::any_unreferenced): New function.
9738 * script-c.h (script_symbol): Declare.
9739 * yyscript.y (exp): Call script_symbol.
9740 * symtab.cc: Include "script.h".
9741 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9742 Change all callers. Check symbols referenced by scripts.
9743 (Symbol_table::add_undefined_symbols_from_command_line): Add
9744 layout parameter. Change all callers.
9745 (Symbol_table::do_add_undefined_symbols_from_command_line):
9746 Likewise. Break out loop body. Check symbols referenced by
9747 scripts.
9748 (Symbol_table::add_undefined_symbol_from_command_line): New
9749 function broken out of
9750 do_add_undefined_symbols_from_command_line.
9751 * symtab.h (class Symbol_table): Update declarations.
9752 * archive.cc: Include "layout.h".
9753 (Archive::should_include_member): Add layout parameter. Change
9754 all callers. Check for symbol mentioned in expression.
9755 * archive.h (class Archive): Update declaration.
9756 * object.cc (Sized_relobj::do_should_include_member): Add layout
9757 parameter.
9758 * object.h (Object::should_include_member): Add layout parameter.
9759 Change all callers.
9760 (Object::do_should_include_member): Add layout parameter.
9761 (class Sized_relobj): Update declaration.
9762 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9763 parameter.
9764 * dynobj.h (class Sized_dynobj): Update declaration.
9765 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9766 layout parameter.
9767 * plugin.h (class Sized_pluginobj): Update declaration.
9768
9769 2010-08-02 Ian Lance Taylor <iant@google.com>
9770
9771 PR 11866
9772 * output.cc (Output_segment::set_offset): Search for the first and
9773 last sections rather than assuming that the list is in order.
9774 (Output_segment::find_first_and_last_list): New function.
9775 * output.h (class Output_segment): Update declarations.
9776 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9777 (relro_strip_test_SOURCES): New variable.
9778 (relro_strip_test_DEPENDENCIES): New variable.
9779 (relro_strip_test_LDFLAGS): New variable.
9780 (relro_strip_test_LDADD): New variable.
9781 (relro_strip_test.so): New target.
9782
9783 2010-08-02 Ian Lance Taylor <iant@google.com>
9784
9785 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9786 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9787 (Target_i386::got_tlsdesc_section): New function.
9788 (Target_i386::got_section): Create space for GOT entries for
9789 TLSDESC relocations.
9790 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9791 R_386_TLS_GOTDESC.
9792 (Target_i386::Scan::global): Likewise.
9793 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9794 using TLSDESC GOT.
9795 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9796 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9797 (Target_x86_64::got_tlsdesc_section): New function.
9798 (Target_x86_64::got_section): Create space for GOT entries for
9799 TLSDESC relocations.
9800 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9801 R_386_TLS_GOTDESC.
9802 (Target_x86_64::Scan::global): Likewise.
9803 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9804 using TLSDESC GOT.
9805
9806 2010-08-02 Ian Lance Taylor <iant@google.com>
9807
9808 * testsuite/final_layout.sh: Use dc to convert from hex to
9809 decimal.
9810
9811 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9812
9813 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9814 paramter to the call to gold::gc_process_relocs.
9815 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9816 paramter to the call to gold::gc_process_relocs.
9817 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9818 parameter to the call to gold::gc_process_relocs.
9819 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9820 template parameter to the call to gold::gc_process_relocs.
9821 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9822 paramter to the call to gold::gc_process_relocs.
9823 * gc.h (get_embedded_addend_size): New function.
9824 (gc_process_relocs): Save the size of the reloc for use by ICF.
9825 * icf.cc (get_section_contents): Get the addend from the text section
9826 for SHT_REL relocation sections.
9827 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9828 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9829 * int_encoding.h (read_from_pointer): New overloaded function.
9830 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9831 * testsuite/icf_sht_rel_addend_test.sh: New file.
9832 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9833 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9834
9835 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9836
9837 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9838 * Makefile.in: Regenerate.
9839 * testsuite/Makefile.in: Regenerate.
9840
9841 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9842
9843 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9844 * gold/testsuite/debug_msg.cc: Likewise.
9845 * gold/testsuite/odr_violation1.cc
9846 * gold/testsuite/odr_violation2.cc
9847
9848 2010-07-21 Cary Coutant <ccoutant@google.com>
9849
9850 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9851 string, and length fields.
9852 (Output_merge_string::Merged_strings_list): New type.
9853 (Output_merge_string::Merged_strings_lists): New typedef.
9854 (Output_merge_string): Replace merged_strings_ with
9855 merged_strings_lists_.
9856 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9857 Merged_strings_list per input object and section. Don't store pointer
9858 to the string. Don't store length with each merged string entry.
9859 (Output_merge_string::finalize_merged_data): Loop over list of merged
9860 strings lists. Recompute length of each merged string.
9861
9862 2010-07-15 Cary Coutant <ccoutant@google.com>
9863
9864 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9865 here.
9866
9867 2010-07-14 Ian Lance Taylor <iant@google.com>
9868
9869 * descriptors.cc (Descriptors::open): Report correct name in error
9870 message.
9871
9872 2010-07-13 Doug Kwan <dougkwan@google.com>
9873
9874 * arm.cc (Arm_input_section::Arm_input_section): For a
9875 SHT_ARM_EXIDX section, always keeps the input sections.
9876 (Arm_input_section::set_exidx_section_link): New method.
9877 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9878 has_errors_ to false.
9879 (Arm_exidx_input_section::has_errors,
9880 Arm_exidx_input_section::set_has_errors): New methods.
9881 (Arm_exidx_input_section::has_errors_): New data member.
9882 (Arm_relobj::get_exidx_shndx_list): New method.
9883 (Arm_output_section::append_text_sections_to_list): Do not skip
9884 section without SHF_EXECINSTR.
9885 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9886 errors.
9887 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9888 section header. Make error messages more verbose. Check for
9889 a non-executable section linked to an EXIDX section.
9890 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9891 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9892 check that there is no deferred EXIDX section if we exit early.
9893 Instead of not making an EXIDX section in case of an error, make one
9894 and set the has_errors flag of it.
9895 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9896 in a relocatable link.
9897 (Target_arm::do_relax): Look for the EXIDX output section instead of
9898 assuming that it is called .ARM.exidx.
9899 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9900 section list. Do not check for SHF_EXECINSTR section flags but
9901 skip any input section with errors.
9902 * output.cc (Output_section::Output_section): Initialize
9903 always_keeps_input_sections_ to false.
9904 (Output_section::add_input_section): Check for
9905 always_keeps_input_sections_.
9906 * output.h (Output_section::always_keeps_input_sections,
9907 Output_section::set_always_keeps_input_sections): New methods.
9908 (Output_section::always_keeps_input_sections): New data member.
9909
9910 2010-07-13 Rafael Espindola <espindola@google.com>
9911
9912 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9913 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9914
9915 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9916 Ian Lance Taylor <iant@google.com>
9917
9918 * output.h (Output_section_lookup_maps::add_merge_section):
9919 Correct check of whether value was inserted.
9920 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9921 (Output_section_lookup_maps::add_relaxed_input_section):
9922 Likewise.
9923 * arm.cc (Target_arm::got_section): Remove used local os.
9924 * i386.cc (Target_i386::got_section): Likewise.
9925 * x86_64.cc (Target_x86_64::got_section): Likewise.
9926 * sparc.cc (Target_sparc::got_section): Likewise.
9927 (Target_sparc::relocate): Remove unused local have_got_offset.
9928 * powerpc.cc (Target_powerpc::relocate): Likewise.
9929
9930 2010-07-13 Ian Lance Taylor <iant@google.com>
9931
9932 * compressed_output.cc (zlib_decompress): Fix signature in
9933 !HAVE_ZLIB_H case.
9934
9935 * archive.cc (Archive::include_member): Unlock an external member
9936 of a thin archive. Don't bother to delete an object we know is
9937 NULL.
9938
9939 2010-07-12 Cary Coutant <ccoutant@google.com>
9940
9941 * compressed_output.cc (zlib_decompress): New function.
9942 (get_uncompressed_size): New function.
9943 (decompress_input_section): New function.
9944 * compressed_output.h (get_uncompressed_size): New function.
9945 (decompress_input_section): New function.
9946 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9947 Handle compressed debug sections.
9948 * layout.cc (is_compressed_debug_section): New function.
9949 (Layout::output_section_name): Map compressed section names to
9950 canonical names.
9951 * layout.h (is_compressed_debug_section): New function.
9952 (is_debug_info_section): Recognize compressed debug sections.
9953 * merge.cc: Include compressed_output.h.
9954 (Output_merge_data::do_add_input_section): Handle compressed
9955 debug sections.
9956 (Output_merge_string::do_add_input_section): Handle compressed
9957 debug sections.
9958 * object.cc: Include compressed_output.h.
9959 (Sized_relobj::Sized_relobj): Initialize new data members.
9960 (build_compressed_section_map): New function.
9961 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9962 * object.h (Object::section_is_compressed): New method.
9963 (Object::do_section_is_compressed): New method.
9964 (Sized_relobj::Compressed_section_map): New type.
9965 (Sized_relobj::do_section_is_compressed): New method.
9966 (Sized_relobj::compressed_sections_): New data member.
9967 * output.cc (Output_section::add_input_section): Handle compressed
9968 debug sections.
9969 * reloc.cc: Include compressed_output.h.
9970 (Sized_relobj::write_sections): Handle compressed debug sections.
9971
9972 2010-07-08 Cary Coutant <ccoutant@google.com>
9973
9974 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9975 weak when resolving to a dynamic def.
9976 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9977 for weak undef/dynamic def cases. Adjust callers.
9978 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9979 undef_binding_weak_.
9980 (Symbol_table::sized_write_globals): Adjust symbol binding.
9981 (Symbol_table::sized_write_symbol): Add binding parameter.
9982 * symtab.h (Symbol::set_undef_binding): New method.
9983 (Symbol::is_undef_binding_weak): New method.
9984 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9985 (Symbol_table::should_override): Add new parameter.
9986 (Symbol_table::sized_write_symbol): Add new parameter.
9987
9988 * testsuite/weak_undef_file1.cc: Add new test case.
9989 * testsuite/weak_undef_file2.cc: Fix header comment.
9990 * testsuite/weak_undef_test.cc: Add new test case.
9991
9992 2010-06-29 Doug Kwan <dougkwan@google.com>
9993
9994 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9995 Initialize USE_SYMBOL_.
9996 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9997 definition.
9998 (Arm_reloc_property::uses_symbol_): New data member declaration.
9999 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
10000 uses symbol value and symbol is undefined but not weakly undefined.
10001
10002 2010-06-28 Rafael Espindola <espindola@google.com>
10003
10004 * plugin.cc (Plugin::load): Use dlerror.
10005
10006 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
10007
10008 * symtab.cc (detect_odr_violations): When reporting an ODR
10009 violation, report an object where the symbol is defined.
10010
10011 2010-06-25 Doug Kwan <dougkwan@google.com>
10012
10013 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
10014 (Target_arm::section_may_have_icf_unsafe_pointers): New method
10015 definition.
10016 (Target_arm::Scan::local_reloc_may_be_function_pointer,
10017 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
10018 target hook to detect function points.
10019 (Target_arm::Scan::possible_function_pointer_reloc): New method.
10020 * icf.h (Icf::check_section_for_function_pointers): Change type of
10021 parameter SECTION_NAME to const reference to std::string. Use
10022 target hook to determine if section may have unsafe pointers.
10023 * target.h (Target::section_may_have_icf_unsafe_pointers): New
10024 method definition.
10025
10026 2010-06-21 Rafael Espindola <espindola@google.com>
10027
10028 * fileread.cc (Input_file::find_fie): New
10029 (Input_file::open): Use Input_file::find_fie.
10030 * fileread.h (Input_file::find_fie): New
10031 * plugin.cc (set_extra_library_path): New.
10032 (Plugin::load): Add set_extra_library_path to the transfer vector.
10033 (Plugin_manager::set_extra_library_path): New.
10034 (Plugin_manager::add_input_file): Use the extra search path if set.
10035 (set_extra_library_path(): New.
10036 * plugin.h (Plugin_manager): Add set_extra_library_path and
10037 extra_search_path_.
10038
10039 2010-06-19 Cary Coutant <ccoutant@google.com>
10040
10041 * layout.cc (gdb_sections): Add .debug_types.
10042 (lines_only_debug_sections): Likewise.
10043
10044 2010-06-18 Rafael Espindola <espindola@google.com>
10045
10046 * plugin.cc (add_input_file,add_input_library)
10047 (Plugin_manager::add_input_file): Make filename arguments const.
10048 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
10049 const.
10050
10051 2010-06-16 Doug Kwan <dougkwan@google.com>
10052
10053 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
10054 .ARM.attributes section if we have not merged any input
10055 attributes sections.
10056
10057 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10058
10059 * arm.cc: Allow combining objects with no EABI version
10060 information.
10061
10062 2010-06-15 Rafael Espindola <espindola@google.com>
10063
10064 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
10065
10066 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10067
10068 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
10069 (struct iovec): Correct !HAVE_READV definition.
10070
10071 2010-06-10 Cary Coutant <ccoutant@google.com>
10072
10073 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
10074 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
10075 reloc sections.
10076 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
10077
10078 PR 11683
10079 * symtab.h (Symbol::is_placeholder): New member function.
10080 * target-reloc.h (relocate_section): Check for placeholder symbols.
10081
10082 * testsuite/Makefile.am (plugin_test_8): New test.
10083 (plugin_test_9): New test.
10084 * testsuite/Makefile.in: Regenerate.
10085
10086 2010-06-09 Nick Clifton <nickc@redhat.com>
10087
10088 * yyscript.y (input_list_element): Allow strings prefixed with
10089 the '-' character. Treat these as libraries.
10090 * script.cc (script_add_library): New function. Adds a library
10091 specified by "-l<name>" found in an input script.
10092 * script-c.h: Add prototype for script_add_library.
10093
10094 2010-06-07 Doug Kwan <dougkwan@google.com>
10095
10096 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
10097 Restrict stub-group size to be within long conditional branch
10098 range when working around cortex-A8 erratum.
10099
10100 2010-06-07 Damien Diederen <dd@crosstwine.com>
10101
10102 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
10103 #ifdef typo.
10104
10105 2010-06-03 Sriraman Tallam <tmsriram@google.com>
10106
10107 PR gold/11658
10108 * output.cc
10109 (Output_section::Input_section_sort_entry::compare_section_ordering):
10110 Change to return non-zero correctly.
10111 (Output_section::Input_section_sort_section_order_index_compare
10112 ::operator()): Change to fix ambiguity in comparisons.
10113
10114 2010-06-01 Sriraman Tallam <tmsriram@google.com>
10115
10116 * gold.h (is_wildcard_string): New function.
10117 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
10118 (Layout::layout_eh_frame): Ditto.
10119 (Layout::find_section_order_index): New method.
10120 (Layout::read_layout_from_file): New method.
10121 * layout.h (Layout::find_section_order_index): New method.
10122 (Layout::read_layout_from_file): New method.
10123 (Layout::input_section_position_): New private member.
10124 (Layout::input_section_glob_): New private member.
10125 * main.cc (main): Call read_layout_from_file here.
10126 * options.h (--section-ordering-file): New option.
10127 * output.cc (Output_section::input_section_order_specified_): New
10128 member.
10129 (Output_section::Output_section): Initialize new member.
10130 (Output_section::add_input_section): Add new parameter.
10131 Keep input sections when --section-ordering-file is used.
10132 (Output_section::set_final_data_size): Sort input sections when
10133 section ordering file is specified.
10134 (Output_section::Input_section_sort_entry): Add new parameter.
10135 Check sorting type.
10136 (Output_section::Input_section_sort_entry::compare_section_ordering):
10137 New method.
10138 (Output_section::Input_section_sort_compare::operator()): Change to
10139 consider section_order_index.
10140 (Output_section::Input_section_sort_init_fini_compare::operator()):
10141 Change to consider section_order_index.
10142 (Output_section::Input_section_sort_section_order_index_compare
10143 ::operator()): New method.
10144 (Output_section::sort_attached_input_sections): Change to sort
10145 according to section order when specified.
10146 (Output_section::add_input_section<32, true>): Add new parameter.
10147 (Output_section::add_input_section<64, true>): Add new parameter.
10148 (Output_section::add_input_section<32, false>): Add new parameter.
10149 (Output_section::add_input_section<64, false>): Add new parameter.
10150 * output.h (Output_section::add_input_section): Add new parameter.
10151 (Output_section::input_section_order_specified): New
10152 method.
10153 (Output_section::set_input_section_order_specified): New method.
10154 (Input_section::Input_section): Initialize section_order_index_.
10155 (Input_section::section_order_index): New method.
10156 (Input_section::set_section_order_index): New method.
10157 (Input_section::section_order_index_): New member.
10158 (Input_section::Input_section_sort_section_order_index_compare): New
10159 struct.
10160 (Output_section::input_section_order_specified_): New member.
10161 * script-sections.cc (is_wildcard_string): Delete and move modified
10162 method to gold.h.
10163 (Output_section_element_input::Output_section_element_input): Modify
10164 call to is_wildcard_string.
10165 (Output_section_element_input::Input_section_pattern
10166 ::Input_section_pattern): Ditto.
10167 (Output_section_element_input::Output_section_element_input): Ditto.
10168 * testsuite/Makefile.am (final_layout): New test case.
10169 * testsuite/Makefile.in: Regenerate.
10170 * testsuite/final_layout.cc: New file.
10171 * testsuite/final_layout.sh: New file.
10172
10173 2010-06-01 Rafael Espindola <espindola@google.com>
10174
10175 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10176
10177 2010-06-01 Rafael Espindola <espindola@google.com>
10178
10179 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10180 visibility of symbols.
10181
10182 2010-05-27 Doug Kwan <dougkwan@google.com>
10183
10184 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10185 from start of output section instead of address for a local symbol
10186 in a merged or relaxed section when doing a relocatable link.
10187
10188 2010-05-26 Rafael Espindola <espindola@google.com>
10189
10190 PR 11604
10191 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10192 adding sections the garbage collector removed.
10193 * gold/testsuite/Makefile.am: Add test.
10194 * gold/testsuite/Makefile.in: Regenerate.
10195 * gold/testsuite/plugin_test_7.sh: New.
10196 * gold/testsuite/plugin_test_7_1.c: New.
10197 * gold/testsuite/plugin_test_7_2.c: New.
10198
10199 2010-05-26 Rafael Espindola <espindola@google.com>
10200
10201 * script-sections.cc (Output_section_definition::set_section_addresses):
10202 Check for --section-start.
10203
10204 2010-05-26 Doug Kwan <dougkwan@google.com>
10205
10206 * arm.cc (Arm_scan_relocatable_relocs): New class.
10207 (Target_arm::relocate_special_relocatable): New method.
10208 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10209 (Arm_relocate_functions::thumb_branch_common): Same.
10210 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10211 instead of Default_scan_relocatable_relocs.
10212 * target-reloc.h (relocate_for_relocatable): Let target handle
10213 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10214 * target.h (Sized_target::relocate_special_relocatable): New method.
10215
10216 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10217
10218 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10219
10220 2010-05-23 Doug Kwan <dougkwan@google.com>
10221
10222 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10223 instead of a cast.
10224 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10225 with a direct branch, not a conditional branch, to a stub.
10226 * merge.cc (Output_merge_base::record_input_section): New method
10227 defintion.
10228 (Output_merge_data::do_add_input_section): Record input section if
10229 keeps-input-sections flag is set.
10230 (Output_merge_string::do_add_input_section): Ditto.
10231 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10232 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10233 INPUT_SECTIONS_.
10234 (Output_merge_base::keeps_input_sections,
10235 Output_merge_base::set_keeps_input_sections,
10236 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10237 method definitions.
10238 (Output_merge_base::Input_sections): New type declaration.
10239 (Output_merge_base::input_sections_begin,
10240 Output_merge_base::input_sections_end,
10241 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10242 (Output_merge_base::bool keeps_input_sections_,
10243 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10244 Output_merge_base::input_sections_): New data members.
10245 (Output_merge_data::do_set_keeps_input_sections): New method
10246 defintion.
10247 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10248 * output.cc (Output_section::Input_section::relobj): Move method
10249 defintion from class declaration to here and handle merge sections.
10250 (Output_section::Input_section::shndx): Ditto.
10251 (Output_section::Output_section): Remove initializations of removed
10252 data members and initialize new data member LOOKUP_MAPS_.
10253 (Output_section::add_input_section): Set keeps-input-sections flag
10254 for a newly created merge output section as appropriate. Adjust code
10255 to use Output_section_lookup_maps class.
10256 (Output_section::add_relaxed_input_section): Adjst code for lookup
10257 maps code refactoring.
10258 (Output_section::add_merge_input_section): Add a new parameter
10259 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10260 class. If adding input section to a newly created merge output
10261 section fails, remove the new merge section.
10262 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
10263 Adjust code for use of the Output_section_lookup_maps class.
10264 (Output_section::find_merge_section): Ditto.
10265 (Output_section::build_lookup_maps): New method defintion.
10266 (Output_section::find_relaxed_input_section): Adjust code to use
10267 Output_section_lookup_maps class.
10268 (Output_section::get_input_sections): Export merge sections. Adjust
10269 code to use Output_section_lookup_maps class.
10270 (Output_section:::add_script_input_section): Adjust code to use
10271 Output_section_lookup_maps class. Update lookup maps for merge
10272 sections also.
10273 (Output_section::discard_states): Use Output_section_lookup_maps.
10274 (Output_section::restore_states): Same.
10275 * output.h (Merge_section_properties): Move class defintion out of
10276 Output_section.
10277 (Output_section_lookup_maps): New class.
10278 (Output_section::Input_section::is_merge_section): New method
10279 defintion.
10280 (Output_section::Input_section::relobj): Move defintion out of class
10281 defintion. Declare method only.
10282 (Output_section::Input_section::shndx): Ditto.
10283 (Output_section::Input_section::output_merge_base): New method defintion.
10284 (Output_section::Input_section::u2_.pomb): New union field.
10285 (Output_section::Merge_section_by_properties_map,
10286 Output_section::Output_section_data_by_input_section_map,
10287 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10288 Remove types.
10289 (Output_section::add_merge_input_section): Add new parameter
10290 KEEPS_INPUT_SECTIONS.
10291 (Output_section::build_lookup_maps): New method declaration.
10292 (Output_section::merge_section_map_,
10293 Output_section::merge_section_by_properties_map_,
10294 Output_section::relaxed_input_section_map_,
10295 Output_section::is_relaxed_input_section_map_valid_): Remove data
10296 members.
10297 (Output_section::lookup_maps_): New data member.
10298
10299 2010-05-21 Doug Kwan <dougkwan@google.com>
10300
10301 PR gold/11619
10302 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10303 avoid a compilation error.
10304
10305 2010-05-19 Rafael Espindola <espindola@google.com>
10306
10307 * script-sections.cc (Output_section_definition::allocate_to_segment):
10308 Update the phdrs_list even when the output section is NULL.
10309 * testsuite/Makefile.am: Add test.
10310 * testsuite/Makefile.in: Regenerate.
10311 * testsuite/script_test_9.cc: New.
10312 * testsuite/script_test_9.sh: New.
10313 * testsuite/script_test_9.t: New.
10314
10315 2010-05-19 Doug Kwan <dougkwan@google.com>
10316
10317 * arm.cc (Arm_input_section::original_size): New method.
10318 (Arm_input_section::do_addralign): Add a cast.
10319 (Arm_input_section::do_output_offset): Remove static cast.
10320 (Arm_input_section::original_addralign,
10321 Arm_input_section::original_size_): Change type to uint32_t.
10322 (Arm_input_section::init): Add safe casts for section alignment
10323 and size.
10324 (Arm_input_section::set_final_data_size): Do not set address and
10325 offset of stub table.
10326 (Arm_output_section::fix_exidx_coverage): Change use of of
10327 Output_section::Simple_input_section to that of
10328 Output_section::Input_section.
10329 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10330 except for the first pass.
10331 * output.cc (Output_section::get_input_sections): Change type of
10332 input_sections to std::list<Input_section>.
10333 (Output_section::add_script_input_section): Rename from
10334 Output_section::add_simple_input_section. Change type of SIS
10335 parameter from Simple_input_section to Input_section.
10336 * output.h (Output_section::Simple_input_section): Remove class.
10337 (Output_section::Input_section): Change class visibility to public.
10338 (Output_section::Input_section::addralign): Use stored alignments
10339 for special input sections if set.
10340 (Output_section::Input_section::set_addralign): New method.
10341 (Output_section::get_input_sections): Change parameter type from
10342 list of Simple_input_section to list of Input_section.
10343 (Output_section::add_script_input_section): Rename from
10344 Output_section::add_simple_input_section. Change first parameter's
10345 type from Simple_input_section to Input_section and remove the
10346 second and third parameters.
10347 * script-sections.cc (Input_section::Input_section_list): Change
10348 type to list of Output_section::Input_section/
10349 (Input_section_info::Input_section_info): Change parameter type of
10350 INPUT_SECTION to Output_section::Input_section.
10351 (Input_section_info::input_section): Change return type.
10352 (Input_section_info::input_section_): Change type to
10353 Output_section::Input_section.
10354 (Output_section_element_input::set_section_addresses): Adjust code
10355 to use Output_section::Input_section instead of
10356 Output_section::Simple_input_section. Adjust code for renaming
10357 of Output_section::add_simple_input_section.
10358 (Orphan_output_section::set_section_addresses): Ditto.
10359
10360 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10361
10362 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10363 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10364
10365 2010-05-18 Rafael Espindola <espindola@google.com>
10366
10367 * options.cc (General_options::finalize): Handle -nostdlib.
10368 * options.h (nostdlib): New option.
10369 * script.cc (script_add_search_dir): Handle -nostdlib.
10370
10371 2010-05-12 Doug Kwan <dougkwan@google.com>
10372
10373 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10374 attributes section only if there no attributes section after merging.
10375 (Target_arm::merge_object_attributes): Move value of
10376 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10377 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10378 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10379 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10380 and arm_attr_merge_7.stdout.
10381 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10382 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10383 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10384 arm_attr_merge_7b.o): New rules.
10385 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10386 arm_attr_merge_7
10387 * testsuite/Makefile.in: Regenerate.
10388 * testsuite/arm_attr_merge.sh: New file.
10389 * testsuite/arm_attr_merge_[67][ab].s: Same.
10390
10391 2010-05-05 Nick Clifton <nickc@redhat.com>
10392
10393 * po/es.po: Updated Spanish translation.
10394
10395 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10396
10397 * Makefile.am (install-exec-local): Properly install gold as
10398 default cross linker.
10399 * Makefile.in: Regenerated.
10400
10401 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10402 Nick Clifton <nickc@redhat.com>
10403
10404 * configure.ac (install_as_default): Define and set to false
10405 unless --enable-gold or --enable-gold=both/gold has been
10406 specified.
10407 * configure: Regenerate.
10408
10409 * Makefile.am (install-exec-local): Install the executable as
10410 'ld.gold'. If install_as_default is true then also install it as
10411 'ld'.
10412 * Makefile.in: Regenerated.
10413
10414 2010-04-24 Ian Lance Taylor <iant@google.com>
10415
10416 * layout.cc (Layout::layout_reloc): In relocatable link don't
10417 combine reloc sections for grouped sections.
10418
10419 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10420
10421 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10422 sections that are not ordinary to icf.
10423 * icf.cc (get_section_contents): Handle relocation pointing to section
10424 with no object or shndx information.
10425 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10426 * testsuite/Makefile.in: Regenerate.
10427 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10428 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10429
10430 2010-04-22 Ian Lance Taylor <iant@google.com>
10431
10432 * expression.cc (Expression::Expression_eval_info): Add
10433 result_alignment_pointer field.
10434 (Expression::eval_with_dot): Add result_alignment_pointer
10435 parameter. Change all callers.
10436 (Expression::eval_maybe_dot): Likewise.
10437 (class Binary_expression): Add alignment_pointer parameter to
10438 left_value and right_value. Change all callers.
10439 (BINARY_EXPRESSION): Set result alignment.
10440 (class Trinary_expression): Add alignment_pointer parameter to
10441 arg2_value and arg3_value. Change all callers.
10442 (Trinary_cond::value): Set result alignment.
10443 (Max_expression::value, Min_expression::value): Likewise.
10444 (Align_expression::value): Likewise.
10445 * script-sections.cc (class Sections_element): Add dot_alignment
10446 parameter to set_section_addresses virtual function. Update
10447 instantiations.
10448 (class Output_section_element): Likewise.
10449 (Script_sections::create_segments): Add dot_alignment parameter.
10450 Change all callers.
10451 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10452 (Script_sections::set_phdrs_clause_addresses): Likewise.
10453 * script-sections.h: Update declarations.
10454 * script.h: Update declarations.
10455 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10456 min_p_align.
10457 * testsuite/script_test_3.t: Set large alignment.
10458 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10459 segment has expected alignment.
10460
10461 2010-04-22 Nick Clifton <nickc@redhat.com>
10462
10463 * po/gold.pot: Updated by the Translation project.
10464 * po/vi.po: Updated Vietnamese translation.
10465
10466 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10467
10468 * testsuite/Makefile.am (check_PROGRAMS): Add
10469 icf_virtual_function_folding_test.
10470 * testsuite/Makefile.in: Regenerated.
10471
10472 2010-04-15 Andrew Haley <aph@redhat.com>
10473
10474 * options.h (merge_exidx_entries): New option.
10475 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10476 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10477 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10478 (Target_arm::merge_exidx_entries): New function.
10479 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10480 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10481 to Arm_exidx_fixup constructor.
10482 Add new arg, merge_exidx_entries.
10483 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10484 Arm_output_section::fix_exidx_coverage.
10485
10486 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10487
10488 * icf.cc (get_section_contents): Check for preemptible functions.
10489 Ignore addend when appropriate.
10490 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10491 section folded.
10492 (add_from_relobj): Check for section folded.
10493 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10494 * symtab.h (should_add_dynsym_entry): Add new parameter.
10495 * target-reloc.h (scan_relocs): Check for section folded.
10496 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10497 Check reloc types for function pointers in shared objects.
10498 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10499 case.
10500 (icf_preemptible_functions_test): New test case.
10501 (icf_string_merge_test): New test case.
10502 * testsuite.Makefile.in: Regenerate.
10503 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10504 bar_glob. Refactor code.
10505 * testsuite/icf_preemptible_functions_test.cc: New file.
10506 * testsuite/icf_preemptible_functions_test.sh: New file.
10507 * testsuite/icf_string_merge_test.cc: New file.
10508 * testsuite/icf_string_merge_test.sh: New file.
10509 * testsuite/icf_virtual_function_folding_test.cc: New file.
10510 * testsuite/icf_virtual_function_folding_test.sh: New file.
10511
10512 2010-04-14 Doug Kwan <dougkwan@google.com>
10513
10514 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10515 for local symbol recounting if we remove a section due to ICF.
10516 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10517 there are no regular objects in input.
10518
10519 2010-04-13 Doug Kwan <dougkwan@google.com>
10520
10521 * arm.cc (Arm_input_section::set_final_data_size): Compute
10522 accurate final data size instead of using current data size.
10523
10524 2010-04-09 Doug Kwan <dougkwan@google.com>
10525
10526 * layout.cc (Layout::choose_output_section): Handle script section
10527 types.
10528 (Layout::make_output_section_for_script): Add section type parameter.
10529 Handle script section types.
10530 * layout.h (Layout::make_output_section_for_script): Add section
10531 type parameter.
10532 * output.cc (Output_section::Output_section): Initialize data member
10533 is_noload_.
10534 (Output_section::do_reset_address_and_file_offset): Do not set address
10535 to 0 if section is a NOLOAD section.
10536 * output.h (Output_section::is_noload): New method.
10537 (Output_section::set_is_noload): Ditto.
10538 (Output_section::is_noload_): New data member.
10539 * script-c.h (Script_section_type): New enum type.
10540 (struct Parser_output_section_header): Add new file section_type.
10541 * script-sections.cc (Sections_element::output_section_name): Add
10542 parameter for returning script section type.
10543 (Output_section_definition::output_section_name): Ditto.
10544 (Output_section_definition::section_type)P; New method.
10545 (Output_section_definiton::script_section_type_name): Ditto.
10546 (Output_section_definition::script_section_type_): New data member.
10547 (Output_section_definition::Output_section_definition): Initialize
10548 data member Output_section_definition::script_section_type_.
10549 (Output_section_definition::create_sections): Pass script section type
10550 to Layout::make_output_section_for_script.
10551 (Output_section_definition::output_section_name): Return script
10552 section type to caller.
10553 (Output_section_definition::set_section_address): Do not advance
10554 dot value and load address if section type is NOLOAD. Set address
10555 of NOLOAD sections regardless of section flags.
10556 (Output_section_definition::print): Print section type if it is
10557 not SCRIPT_SECTION_TYPE_NONE.
10558 (Output_section_definition::section_type): New method.
10559 (Output_section_definition::script_section_type_name): Ditto.
10560 (Script_sections::output_section_name): Add new parameter
10561 PSECTION_TYPE for returning script section type. Pass it to
10562 section elements. Handle discard sections.
10563 (Sort_output_sections::operator()): Handle NOLOAD sections.
10564 * script-sections.h (Script_sections::Section_type): New enum type.
10565 (Script_sections::output_section_name): Add a new parameter for
10566 returning script section type.
10567 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10568 INFO and NOLOAD.
10569 * yyscript.y (union): Add new field SECTION_TYPE.
10570 (COPY, DSECT, INFO, NOLOAD): New tokens.
10571 (opt_address_and_section_type): Change type to output_section_header.
10572 (section_type): New non-terminal
10573 (section_header): Handle section type.
10574 (opt_address_and_section_type): Return section type value.
10575
10576 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10577
10578 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10579 * testsuite/plugin_common_test_2.c (foo): Likewise.
10580
10581 2010-04-08 Doug Kwan <dougkwan@google.com>
10582
10583 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10584 Output_merge_data.
10585 * output.cc (Output_section::add_merge_input_section): Simplify
10586 code and return status of Output_merge_base::add_input_section.
10587 Update merge section map only if Output_merge_base::add_input_section
10588 returns true.
10589
10590 2010-04-07 Doug Kwan <dougkwan@google.com>
10591
10592 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10593 if section is marked as containing instructions but has no mapping
10594 symbols.
10595 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10596 correct section index.
10597 (Arm_relobj::find_linked_text_section): Ditto.
10598
10599 2010-04-07 Cary Coutant <ccoutant@google.com>
10600
10601 * archive.cc (include_member): Destroy Read_symbols_data object before
10602 releasing file.
10603 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10604 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10605 (Read_symbols_data::~Read_symbols_data) New destructor.
10606 (Section_relocs::Section_relocs) New constructor.
10607 (Section_relocs::~Section_relocs) New destructor.
10608 (Read_relocs_data::Read_relocs_data) New constructor.
10609 (Read_relocs_data::~Read_relocs_data) New destructor.
10610 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10611 pointers to NULL after deleting.
10612
10613 2010-04-07 Doug Kwan <dougkwan@google.com>
10614
10615 * arm.cc: Replace "endianity" with "endianness" in comments.
10616 (Arm_exidx_cantunwind): Ditto.
10617 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10618 (Arm_relobj::merge_flags_and_attributes): New method.
10619 (Arm_relobj::merge_flags_and_attributes_): New data member.
10620 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10621 (Arm_relobj::scan_sections_for_stubs): Ditto.
10622 (Arm_relobj::do_read_symbols): Check to see if we really want to
10623 merge processor-specific flags and attributes. Exit early if
10624 an object is empty except for section names and the undefined symbol.
10625 (Target_arm::do_finalize_sections): Move check for ELF format to
10626 Arm_relobj::do_read_symbols. Merge processor specific flags and
10627 attributes from a regular object only when we have determined that
10628 it is aapropriate. Do not create an .ARM.attributes section in
10629 output if there is no regular input object.
10630 (Target_arm::merge_processor_specific_flags): Check
10631 --warn-mismatch before printing any error.
10632 (Target_arm::merge_object_attributes): Ditto.
10633 * gold.cc (queue_middle_tasks): Handle the case in which there is
10634 no regular object in input.
10635 * options.cc (General_options::parse_EB): New method.
10636 (General_options::parse_EL): Same.
10637 (General_options::General_options): Initialize endianness_.
10638 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10639 New options.
10640 (General_options::Endianness): New enum.
10641 (General_options::endianness): New method.
10642 (General_options::endianness_): New data member.
10643 * parameters.cc (Parameters::set_options): Check target endianness.
10644 (Parameters::set_target_once): Ditto.
10645 (Parameters::check_target_endianness): New method.
10646 (parameters_force_valid_target): If either -EL or -EB is specified,
10647 use it to define endianness of default target.
10648 * parameters.h (Parameters::check_target_endianness): New method
10649 declaration.
10650 * target.h (class Target): Change "endianity" to "endianness"
10651 in comments.
10652
10653 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10654
10655 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10656 * configure: Regenerate.
10657 * Makefile.in: Regenerate.
10658 * testsuite/Makefile.in: Regenerate.
10659
10660 2010-04-06 Cary Coutant <ccoutant@google.com>
10661
10662 gcc PR lto/42757
10663 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10664 prevailing definitions of common symbols.
10665 * testsuite/plugin_test_6.sh: New test case.
10666 * testsuite/plugin_common_test_1.c: New test case.
10667 * testsuite/plugin_common_test_2.c: New test case.
10668 * testsuite/Makefile.am (plugin_test_6): New test case.
10669 * testsuite/Makefile.in: Regenerate.
10670
10671 2010-04-06 Nick Clifton <nickc@redhat.com>
10672
10673 * po/vi.po: New Vietnamese translation.
10674
10675 2010-03-30 Doug Kwan <dougkwan@google.com>
10676
10677 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10678
10679 2010-03-25 Doug Kwan <dougkwan@google.com>
10680
10681 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10682 to avoid a conversion warning on a 32-bit host.
10683
10684 2010-03-24 Ian Lance Taylor <iant@google.com>
10685
10686 * testsuite/script_test_3.t: Add a TLS segment.
10687 * testsuite/Makefile.am (check_PROGRAMS): Add
10688 tls_phdrs_script_test.
10689 (tls_phdrs_script_test_SOURCES): Define.
10690 (tls_phdrs_script_test_DEPENDENCIES): Define.
10691 (tls_phdrs_script_test_LDFLAGS): Define.
10692 (tls_phdrs_script_test_LDADD): Define.
10693 * testsuite/Makefile.in: Rebuild.
10694
10695 2010-03-23 Cary Coutant <ccoutant@google.com>
10696
10697 * fileread.cc (find_or_make_view): Fix comment.
10698
10699 2010-03-23 Ian Lance Taylor <iant@google.com>
10700
10701 * script-sections.cc (class Orphan_section_placement): Define
10702 PLACE_TLS and PLACE_TLS_BSS.
10703 (Orphan_section_placement::Orphan_section_placement): Initialize
10704 new places.
10705 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10706 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10707 (tls_script_test_SOURCES): Define.
10708 (tls_script_test_DEPENDENCIES): Define.
10709 (tls_script_test_LDFLAGS): Define.
10710 (tls_script_test_LDADD): Define.
10711 * testsuite/Makefile.in: Rebuild.
10712
10713 2010-03-22 Doug Kwan <dougkwan@google.com>
10714
10715 * arm.cc (Arm_relocate_functions::abs8,
10716 Arm_relocate_functions::abs16): Use correct check for overflow
10717 specified in the ARM ELF specs.
10718 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10719 target of a BLX instruction specially.
10720 (Reloc_stub::stub_type_for_reloc): Ditto.
10721 (Relocate::relocate): Use symbolic names instead of numeric relocation
10722 codes to report error.
10723 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10724 workaround.
10725 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10726 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10727 thumb2_blx_out_of_range.stdout
10728 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10729 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10730 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10731 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10732 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10733 thumb2_blx_in_range, thumb2_blx_in_range.o,
10734 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10735 thumb2_blx_out_of_range.o): New rules.
10736 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10737 thumb2_blx_in_range and thumb2_blx_out_of_range.
10738 * testsuite/Makefile.in: Regenerate.
10739 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10740 * testsuite/thumb_blx_in_range.s: New file.
10741 * testsuite/thumb_blx_out_of_range.s: New file.
10742
10743 2010-03-22 Rafael Espindola <espindola@google.com>
10744
10745 * archive.cc (Should_include): Move to archive.h.
10746 (should_include_member): Make it a member of Archive.
10747 (Lib_group): New.
10748 (Add_lib_group_symbols): New.
10749 * archive.h: Include options.h.
10750 (Archive_member): Moved from Archive.
10751 (Should_include): Moved from archive.cc.
10752 (Lib_group): New.
10753 (Add_lib_group_symbols): New.
10754 * dynobj.cc (do_should_include_member): New.
10755 * dynobj.h (do_should_include_member): New.
10756 * gold.cc (queue_initial_tasks): Update call to queue.
10757 * main.cc (main): Print lib group stats.
10758 * object.cc (do_should_include_member): New.
10759 * object.h: Include archive.h.
10760 (Object::should_include_member): New.
10761 (Object::do_should_include_member): New.
10762 (Sized_relobj::do_should_include_member): New.
10763 * options.cc (General_options::parse_start_lib): New.
10764 (General_options::parse_end_lib): New.
10765 (Input_arguments::add_file): Handle lib groups.
10766 (Input_arguments::start_group): Check we are not in a lib.
10767 (Input_arguments::start_lib): New.
10768 (Input_arguments::end_lib): New.
10769 * options.h (General_options): Add start_lib and end_lib.
10770 (Input_argument::lib_): New.
10771 (Input_argument::lib): New.
10772 (Input_argument::is_lib): New.
10773 (Input_file_lib): New.
10774 (Input_arguments::in_lib_): New.
10775 (Input_arguments::in_lib): New.
10776 (Input_arguments::start_lib): New.
10777 (Input_arguments::end_lib_): New.
10778 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10779 in unused members as preempted.
10780 (Sized_pluginobj::do_should_include_member): New.
10781 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10782 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10783 return the blocker.
10784 (Read_symbols::do_whole_lib_group): New.
10785 (Read_symbols::do_lib_group): New.
10786 (Read_symbols::do_read_symbols): Handle lib groups.
10787 (Read_symbols::get_name): Handle lib groups.
10788 * readsyms.h (Read_symbols): Add an archive member pointer.
10789 (Read_symbols::do_whole_lib_group): New.
10790 (Read_symbols::do_lib_group): New.
10791 (Read_symbols::member_): New.
10792 * script.cc (read_input_script): Update call to queue_soon.
10793
10794 2010-03-19 Doug Kwan <dougkwan@google.com>
10795
10796 * arm.cc (Stub_table::Stub_table): Initialize new data members
10797 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10798 (Stub_table::add_reloc_stub): Assign stub offset and update
10799 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10800 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10801 New data members.
10802 (Stub_table::update_data_size_and_addralign): Use
10803 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10804 instead of going over all reloc stubs.
10805 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10806 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10807 Stringpool_template::offset_ to size of Stringpool_char.
10808 (Stringpool_template::new_key_offset): Remove code to initialize
10809 Stringpool_template::offset_.
10810 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10811 Stringpool_template::offset_ to zero.
10812
10813 2010-03-15 Doug Kwan <dougkwan@google.com>
10814
10815 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10816 offset_.
10817 (Stringpool_template::new_key_offset): New method.
10818 (Stringpool_template::add_string): Assign offsets when adding new
10819 strings.
10820 (Stringpool_template::set_string_offsets): Do not set string offsets
10821 when not optimizing.
10822 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10823 member size_.
10824 (Chunked_vector::clear): Clear size_.
10825 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10826 (Chunked_vector::size): Return size_.
10827 (Chunked_vector::push_back): Use size_ to find insert position.
10828 (Chunked_vector::size_): New data member.
10829 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10830 (Stringpool_template::new_key_offset): New method declaration.
10831 (Stringpool_template::offset_): New data member.
10832
10833 2010-03-15 Rafael Espindola <espindola@google.com>
10834
10835 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10836 Add_symbols' constructor.
10837 * readsyms.h (Add_symbols): Remove the input_group member.
10838
10839 2010-03-10 Ian Lance Taylor <iant@google.com>
10840
10841 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10842 target to ask whether a reference to a symbol requires a stack
10843 split.
10844 * target.h (Target::is_call_to_non_split): New function.
10845 (Target::do_is_call_to_non_split): Declare virtual function.
10846 * target.cc: Include "symtab.h".
10847 (Target::do_is_call_to_non_split): New function.
10848 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10849
10850 2010-03-10 Cary Coutant <ccoutant@google.com>
10851
10852 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10853 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10854 (File_read::open[2]): Add whole_file_view_ to list of views.
10855 (File_read::make_view): Remove test of whole_file_view_.
10856 (File_read::find_or_make_view): Create whole_file_view_ if
10857 necessary.
10858 (File_read::clear_views): Replace bool parameter with enum;
10859 adjust all callers. Don't delete views with permanent data;
10860 do delete cached views and views from archives if
10861 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10862 if clearing the corresponding view.
10863 * fileread.h (File_read::Clear_views_mode): New enum.
10864 (File_read::View::is_permanent_view): New method.
10865 (File_read::clear_views): Replace bool parameter
10866 with enum; adjust all callers.
10867 * options.h (General_options): Change keep_files_mapped option;
10868 add map_whole_files.
10869 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10870 releasing the file.
10871 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10872 the file.
10873
10874 2010-03-10 David S. Miller <davem@davemloft.net>
10875
10876 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10877
10878 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10879
10880 * icf.cc (get_section_contents): Add '@' marker after processing the
10881 merge reloc.
10882
10883 2010-03-08 Doug Kwan <dougkwan@google.com>
10884
10885 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10886 due to a conversion warning.
10887 (Arm_relobj::update_output_local_symbol_count): Check for local
10888 symbol with unset output index.
10889
10890 2010-03-05 Ian Lance Taylor <iant@google.com>
10891
10892 * options.h (class General_options): Add --spare-dynamic-tags.
10893 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10894 --spare-dynamic-tags.
10895
10896 2010-03-05 Ian Lance Taylor <iant@google.com>
10897
10898 * incremental.cc: Include "libiberty.h".
10899
10900 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10901
10902 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10903 function, is_info_ member.
10904 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10905 (Versions::Versions): Update caller.
10906 (Versions::define_base_version): Likewise.
10907 (Versions::add_def): Likewise.
10908
10909 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10910
10911 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10912 (Scan::possible_function_pointer_reloc): New function.
10913 (Scan::local_reloc_may_be_function_pointer): Change to call
10914 possible_function_pointer_reloc.
10915 (Scan::global_reloc_may_be_function_pointer): Ditto.
10916 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10917 relocations in ".data.rel.ro._ZTV" section.
10918 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10919 * testsuite/icf_safe_so_test.cc: Ditto.
10920 * testsuite/icf_safe_test.cc: Ditto.
10921 * testsuite/icf_safe_test.sh: Ditto.
10922
10923 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10924 Ian Lance Taylor <iant@google.com>
10925
10926 * target-reloc.h (relocate_section): Check the symbol table index
10927 for -1U before setting the local symbol index.
10928 (scan_relocatable_relocs): If copying the relocation, record that
10929 the local symbol is required.
10930 * object.h (Symbol_value::is_output_symtab_index_set): New
10931 function.
10932 (Symbol_value::may_be_discarded_from_output_symtab): New
10933 function.
10934 (Symbol_value::has_output_symtab_entry): New function.
10935 (Symbol_value::needs_output_symtab_entry): Remove.
10936 (Symbol_value::output_symtab_index): Make sure the symbol index is
10937 set.
10938 (Symbol_value::set_output_symtab_index): Make sure the symbol
10939 index is not set. Make sure the new index is valid.
10940 (Symbol_value::set_must_have_output_symtab_entry): New function.
10941 (Symbol_value::has_output_dynsym_entry): New function.
10942 (Symbol_value::set_output_dynsym_index): Make sure the new index
10943 is valid.
10944 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10945 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10946 local symbol if permitted.
10947 (Sized_relobj::do_finalize_local_symbols): Call
10948 is_output_symtab_index_set rather than needs_output_symtab_entry.
10949 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10950 rather than needs_output_symtab_entry. Call
10951 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10952 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10953 is_output_symtab_index_set rather than needs_output_symtab_entry.
10954 * testsuite/discard_locals_relocatable_test.c: New file.
10955 * testsuite/discard_locals_test.sh: Test -r.
10956 * testsuite/Makefile.am (check_DATA): Add
10957 discard_locals_relocatable_test1.syms,
10958 discard_local_relocatable_test2.syms.
10959 (MOSTLYCLEANFILES): Likewise. Also add
10960 discard_locals_relocatable_test1.lout and
10961 discard_locals_relocatable_test2.out.
10962 (discard_locals_relocatable_test1.syms): New target.
10963 (discard_locals_relocatable_test.o): New target.
10964 (discard_locals_relocatable_test1.out): New target.
10965 (discard_locals_relocatable_test2.syms): New target.
10966 (discard_locals_relocatable_test2.out): New target.
10967 (various): Add missing ../ld-new dependencies.
10968 * testsuite/Makefile.in: Rebuild.
10969
10970 2010-03-03 Nick Clifton <nickc@redhat.com>
10971
10972 * po/fi.po: New Finnish translation.
10973
10974 2010-03-01 Doug Kwan <dougkwan@google.com>
10975
10976 * layout.cc (Layout::Layout): Force section types of .init_array*,
10977 .preinit_array* and .fini_array* sections.
10978 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10979 Fix check of return value of std::string::find.().
10980 (Output_section::Input_section_sort_compare::operator()): Remove
10981 comment about .init_array.
10982 (Output_section::Input_section_sort_init_fini_compare::operator()):
10983 New method.
10984 (Output_section::sort_attached_input_sections): Handle .init_array
10985 and .fini_array specially.
10986 * output.h (Output_section::Inut_section_sort_compare): Update
10987 comment.
10988 (Output_section::Input_section_sort_init_fini_compare): New struct.
10989
10990 2010-02-26 Doug Kwan <dougkwan@google.com>
10991
10992 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10993 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10994 * testsuite/debug_msg.sh: Avoid matching source line number for
10995 use of global variable undef_int.
10996
10997 2010-02-26 Doug Kwan <dougkwan@google.com>
10998
10999 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
11000 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
11001 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
11002 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
11003 * options.cc (General_options::General_options): Initialize member
11004 fix_v4bx_.
11005 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
11006 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
11007 and rm_no_fix_v4bx.stdout
11008 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
11009 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
11010 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
11011 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
11012 and arm_no_fix_v4bx.
11013 * Makefile.in: Regenerate.
11014 * testsuite/arm_fix_v4bx.s: New file.
11015 * testsuite/arm_fix_v4bx.sh: Ditto.
11016
11017 2010-02-24 Doug Kwan <dougkwan@google.com>
11018
11019 * arm.cc (Target_arm::got_section): Make the .got section the first
11020 non RELRO section in the data segment.
11021 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
11022 suffixes of section names.
11023
11024 2010-02-24 Doug Kwan <dougkwan@google.com>
11025
11026 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
11027 flags and attributes merging if an input file is a binary file.
11028 * fileread.cc (Input_file::open): Record format of original file.
11029 * fileread.h (Input_file::Format): New enum type.
11030 (Input_file::Input_file): Initialize data member format_.
11031 (Input_file::format): New method definition.
11032 (Input_file::format_):: New data member.
11033
11034 2010-02-24 Doug Kwan <dougkwan@google.com>
11035
11036 * arm.cc (Arm_output_data_got): New class.
11037 (ARM_TCB_SIZE): New constant
11038 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
11039 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
11040 If user uses a script with a SECTIONS clause, issue only a warning
11041 for a misplaced EXIDX input section. Otherwise, issue an error.
11042 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
11043 garbage collection.
11044 (Target_arm::got_mode_index_entry): Handle static linking.
11045 (Target_arm::Scan::local): Ditto.
11046 (Target_arm::Scan::global): Ditto.
11047 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
11048 all incorrectly implemented relocations.
11049 (Target_arm::fix_exidx_coverage): Pass layout to
11050 Arm_output_section::fix_exidx_coverage.
11051 * layout.cc (Layout::section_name_mapping): Remove trailing dots
11052 from ".ARM.exidx." and ".ARM.extab.".
11053
11054 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11055
11056 * arm.cc (Target_arm::do_finalize_sections): Create attribute
11057 section if it does not already exist.
11058 * attributes.cc (Attributes_section_data::Attributes_section_data):
11059 Don't crash if size is zero.
11060
11061 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11062 Ian Lance Taylor <iant@google.com>
11063
11064 * gold.cc (queue_middle_tasks): If no input files were opened,
11065 exit.
11066 * workqueue.h (Task_function::Task_function): Assert that there is
11067 a blocker.
11068
11069 2010-02-22 Doug Kwan <dougkwan@google.com>
11070
11071 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
11072 * icf.cc (get_section_contents): Cast snprintf arguments to long long
11073 types to avoid warnings due to different uint64_t implementations
11074 on different hosts.
11075
11076 2010-02-21 Doug Kwan <dougkwan@google.com>
11077
11078 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
11079 handling of the maximum backward branch offset.
11080 (Arm_relocate_functions::thumb_branch_common): Ditto.
11081 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
11082 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
11083 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
11084 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
11085 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
11086 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
11087 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
11088 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
11089 thumb_bl_out_of_range thumb_bl_out_of_range.o,
11090 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
11091 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
11092 thumb2_bl_out_of_range.o): New rules.
11093 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
11094 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
11095 thumb2_bl_out_of_range
11096 * testsuite/Makefile.in: Regenerate.
11097 * testsuite/arm_bl_in_range.s: New file.
11098 * testsuite/arm_bl_out_of_range.s: Ditto.
11099 * testsuite/arm_branch_in_range.sh: Ditto.
11100 * testsuite/arm_branch_range.t: Ditto.
11101 * testsuite/thumb2_branch_range.t: Ditto.
11102 * testsuite/thumb_bl_in_range.s: Ditto.
11103 * testsuite/thumb_bl_out_of_range.s: Ditto.
11104 * testsuite/thumb_branch_range.t: Ditto.
11105
11106 2010-02-20 Sriraman Tallam <tmsriram@google.com>
11107
11108 * gc.h (gc_process_relocs): Change vectors to point to the new list.
11109 Add reloc offset information.
11110 * icf.cc (get_section_contents): Change iterators to point to the new
11111 vectors. Add reloc offset information to the contents.
11112 * icf.h (Icf::Sections_reachable_info): New typedef.
11113 (Icf::Sections_reachable_list): New typedef.
11114 (Icf::Offset_info): New typedef.
11115 (Icf::Reloc_info): New struct typedef.
11116 (Icf::Reloc_info_list): New typedef.
11117 (Icf::symbol_reloc_list): Delete method.
11118 (Icf::addend_reloc_list): Delete method.
11119 (Icf::section_reloc_list): Delete method.
11120 (Icf::reloc_info_list): New method.
11121 (Icf::reloc_info_list_): New member.
11122
11123 2010-02-19 Doug Kwan <dougkwan@google.com>
11124
11125 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
11126 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
11127 * arm.cc (Arm_relocation_functions): New forward declaration.
11128 (Target_arm::Target_arm): Initialize new data members
11129 got_mod_index_offset_ and tls_base_symbol_defined_.
11130 (Target_arm::Relocate::relocate_tls): New method.
11131 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
11132 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11133 New methods.
11134 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
11135 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11136 (Target_arm::got_mod_index_offset_,
11137 Target_arm::tls_base_symbol_defined_): New data members.
11138 (Target_arm::Scan::local, Target::Scan::global,
11139 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11140 relocations.
11141
11142 2010-02-18 Doug Kwan <dougkwan@google.com>
11143
11144 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11145 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11146 text section as a parameter becuase some broken tools may not set
11147 the link in section header.
11148 (Target_arm::has_got_section): New method.
11149 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11150 without any mapping symbol as data only. Remove warning.
11151 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11152 link in its section header, try to discover the link by inspecting the
11153 REL31 relocation at the beginning of the section.
11154 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11155 in error message.
11156 (Target_arm::Scan::global): Treat any reference to the symbol
11157 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11158
11159 2010-02-12 Sriraman Tallam <tmsriram@google.com>
11160
11161 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11162 (Scan::global_reloc_may_be_function_pointer): New function.
11163 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11164 (Scan::global_reloc_may_be_function_pointer): New function.
11165 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11166 (Scan::global_reloc_may_be_function_pointer): New function.
11167 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11168 (Scan::global_reloc_may_be_function_pointer): New function.
11169 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11170 (Scan::global_reloc_may_be_function_pointer): New function.
11171 (Scan::possible_function_pointer_reloc): New function.
11172 (Target_x86_64::can_check_for_function_pointers): New function.
11173 * gc.h (gc_process_relocs): Scan relocation types to determine if
11174 function pointers were taken for targets that support it.
11175 * icf.cc (Icf::find_identical_sections): Include functions for
11176 folding in safe ICF whose pointer is not taken.
11177 * icf.h (Secn_fptr_taken_set): New typedef.
11178 (fptr_section_id_): New member.
11179 (section_has_function_pointers): New function.
11180 (set_section_has_function_pointers): New function.
11181 (check_section_for_function_pointers): New function.
11182 * options.h: Fix comment for safe ICF option.
11183 * target.h (can_check_for_function_pointers): New function.
11184 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11185 Modify icf_safe_test for X86-64.
11186 * testsuite/Makefile.in: Regenerate.
11187 * testsuite/icf_safe_so_test.cc: New file.
11188 * testsuite/icf_safe_so_test.sh: New file.
11189 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11190 (main): Change to take pointer to function kept_func_3.
11191 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11192 folding is done correctly for X86-64.
11193
11194 2010-02-12 David S. Miller <davem@davemloft.net>
11195
11196 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11197 is_symbolless parameter.
11198 (Output_reloc<SHT_REL>::is_symbolless): New.
11199 (Output_reloc<SHT_REL>::is_symbolless_): New.
11200 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11201 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11202 (Output_reloc<SHT_RELA>::is_symbolless): New.
11203 (Output_data_reloc::add_global): Handle is_symbolless.
11204 (Output_data_reloc::add_global_relative): Likewise.
11205 (Output_data_reloc::add_local): Likewise.
11206 (Output_data_reloc::add_local_relative): Likewise.
11207 (Output_data_reloc::add_symbolless_global_addend): New.
11208 (Output_data_reloc::add_symbolless_local_addend): New.
11209 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11210 is_symbolless.
11211 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11212 instead of ->is_relative_
11213 (Output_reloc::write): Likewise.
11214 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11215 (Output_reloc::write_rel): Simplify.
11216
11217 * sparc.cc (Target_sparc::Scan::local): Use
11218 ->add_symbolless_local_addend as needed.
11219 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11220 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11221 based upon relocation offset.
11222
11223 2010-02-11 Doug Kwan <dougkwan@google.com>
11224
11225 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11226 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11227 beginning of function.
11228 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11229 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11230 parameter is_32bit in calls to should_apply_static_reloc.
11231 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11232 (check_DATA): Add arm_abs_global.stdout.
11233 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11234 arm_abs_global.stdout): New rules.
11235 (MOSTLLYCLEANFILES): Add arm_abs_global
11236 * Makefile.in: Regenerate.
11237 * testsuite/arm_abs_global.s: New file.
11238 * testsuite/arm_abs_global.sh: Ditto.
11239 * testsuite/arm_abs_lib.s: Ditto.
11240
11241 2010-02-11 Ian Lance Taylor <iant@google.com>
11242
11243 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11244 Read_relocs task.
11245 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11246 Allocate_commons_task first.
11247 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11248 task, rather than symtab_lock_.
11249 (Gc_process_relocs::~Gc_process_relocs): New function.
11250 (Gc_process_relocs::is_runnable): Check this_blocker_.
11251 (Gc_process_relocs::locks): Use next_blocker_ rather than
11252 blocker_.
11253 (Scan_relocs::~Scan_relocs): New function.
11254 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11255 symtab_lock_.
11256 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11257 next_blocker_.
11258 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11259 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11260 constructor accordingly.
11261 (class Gc_process_relocs): Likewise.
11262 (class Scan_relocs): Likewise.
11263 * common.h (class Allocate_commons_task): Remove symtab_lock_
11264 field, and corresponding constructor parameter.
11265 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11266 symtab_lock_.
11267 (Allocate_commons_task::locks): Likewise.
11268
11269 2010-02-11 Ian Lance Taylor <iant@google.com>
11270
11271 * gold-threads.h (class Once): Define.
11272 (class Initialize_lock): Rewrite as child of Once.
11273 * gold-threads.cc (class Once_initialize): Define.
11274 (once_pointer_control): New static variable.
11275 (once_pointer, once_arg): New static variables.
11276 (c_run_once): New static function.
11277 (Once::Once, Once::run_once, Once::internal_run): New functions.
11278 (class Initialize_lock_once): Remove.
11279 (initialize_lock_control): Remove.
11280 (initialize_lock_pointer): Remove.
11281 (initialize_lock_once): Remove.
11282 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11283 (Initialize_lock::initialize): Rewrite.
11284 (Initialize_lock::do_run_once): New function.
11285 * archive.cc (Archive::interpret_header): Only clear name if it is
11286 not already empty.
11287 * fileread.cc: Include "gold-threads.h"
11288 (file_counts_lock): New static variable.
11289 (file_counts_initialize_lock): Likewise.
11290 (File_read::release): Only increment counts when using --stats.
11291 Use a lock around the increment.
11292 * parameters.cc (class Set_parameters_target_once): Define.
11293 (set_parameters_target_once): New static variable.
11294 (Parameters::Parameters): Move here from parameters.h.
11295 (Parameters::set_target): Rewrite.
11296 (Parameters::set_target_once): New function.
11297 (Parameters::clear_target): Move here and rewrite.
11298 * parameters.h (class Parameters): Update declarations. Add
11299 set_parameters_target_once_ field.
11300 (Parameters::Parameters): Move to parameters.cc.
11301 (Parameters::clear_target): Likewise.
11302 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11303 task.
11304 (Start_group::~Start_group): New function.
11305 (Start_group::is_runnable): New function.
11306 (Start_group::locks, Start_group::run): New functions.
11307 (Finish_group::run): Change saw_undefined to size_t.
11308 * readsyms.h (class Start_group): Define.
11309 (class Finish_group): Change saw_undefined_ field to size_t.
11310 (Finish_group::Finish_group): Remove saw_undefined and
11311 this_blocker parameters. Change all callers.
11312 (Finish_group::set_saw_undefined): New function.
11313 (Finish_group::set_blocker): New function.
11314 * symtab.h (class Symbol_table): Change saw_undefined to return
11315 size_t. Change saw_undefined_ field to size_t.
11316 * target-select.cc (Set_target_once::do_run_once): New function.
11317 (Target_selector::Target_selector): Initialize set_target_once_
11318 field. Don't initialize lock_ and initialize_lock_ fields.
11319 (Target_selector::instantiate_target): Rewrite.
11320 (Target_selector::set_target): New function.
11321 * target-select.h (class Set_target_once): Define.
11322 (class Target_selector): Update declarations. Make
11323 Set_target_once a friend. Remove lock_ and initialize_lock_
11324 fields. Add set_target_once_ field.
11325
11326 2010-02-10 Ian Lance Taylor <iant@google.com>
11327
11328 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11329 queueing any tasks.
11330 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11331 (queue_middle_tasks): Add all blockers before queueing any tasks.
11332 (queue_final_tasks): Likewise.
11333 * token.h (Task_token::add_blockers): New function.
11334 * object.h (Input_objects::number_of_relobjs): New function.
11335
11336 2010-02-10 Ian Lance Taylor <iant@google.com>
11337
11338 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11339 shared, not if not position independent.
11340 * x86_64.cc (Relocate::relocate_tls): Likewise.
11341 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11342 (tls_pie_pic_test): New target.
11343 * testsuite/Makefile.in: Rebuild.
11344
11345 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11346 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11347 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11348 * testsuite/Makefile.in: Rebuild.
11349
11350 2010-02-09 David S. Miller <davem@davemloft.net>
11351
11352 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11353 R_SPARC_RELATIVE using ->add_local_relative().
11354 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11355
11356 * output.h (Output_data_dynamic::add_section_size): New method
11357 that takes two Output_data objects.
11358 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11359 entry param. Handle it in initializers.
11360 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11361 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11362 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11363 arg.
11364 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11365 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11366 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11367 for dynrel_includes_plt.
11368 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11369 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11370 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11371 before .rela.plt
11372 (Target_sparc::do_finalize_sections): Update to pass true for
11373 dynrel_includes_plt.
11374 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11375 output before .rela.plt
11376 (Target_powerpc::do_finalize_sections): Update to pass true for
11377 dynrel_includes_plt when 32-bit.
11378
11379 2010-02-08 Doug Kwan <dougkwan@google.com>
11380
11381 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11382 method.
11383 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11384 Arm_relobj::scan_section_for_cortex_a8_stubs,
11385 Arm_relobj::do_relocation_section): Instead of calling
11386 Output_section::output_address, use faster
11387 Arm_relobj::simple_input_section_output_address.
11388
11389 2010-02-08 David S. Miller <davem@davemloft.net>
11390
11391 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11392 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11393 relocation helper function.
11394
11395 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11396 just like R_SPARC_GOT{10,13,22}.
11397 (Target_sparc::Scan::local): Likewise.
11398 (Target_sparc::Relocate:relocate): Likewise.
11399
11400 2010-02-06 Ian Lance Taylor <iant@google.com>
11401
11402 * configure.ac: Rewrite targetobjs duplicate removal code to use
11403 only shell constructs.
11404 * configure: Rebuild.
11405
11406 2010-02-05 Doug Kwan <dougkwan@google.com>
11407
11408 PR 11247
11409 * arm.cc (Arm_relobj::section_is_scannable): New method.
11410 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11411 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11412
11413 2010-02-04 Doug Kwan <dougkwan@google.com>
11414
11415 PR 11247
11416 * arm-reloc-property.cc (cstdio): Include.
11417 * configure.ac (targetobjs): Remove duplicates.
11418 * configure: Regenerate.
11419 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11420 big and little endian version for a given address size.
11421
11422 2010-02-03 Doug Kwan <dougkwan@google.com>
11423
11424 * arm-reloc-property.cc
11425 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11426 definition.
11427 * arm-reloc-property.h
11428 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11429 New method definition.
11430 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11431 declaration.
11432 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11433 overflow to N.
11434 (GOT_PREL): Change implemented to Y.
11435 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11436 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11437 (Arm_relocate_functions::movw_abs_nc): Remove method.
11438 (Arm_relocate_functions::movt_abs): Ditto.
11439 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11440 (Arm_relocate_functions::thm_movt_abs): Ditto.
11441 (Arm_relocate_functions::movw_rel_nc): Ditto.
11442 (Arm_relocate_functions::movw_rel): Ditto.
11443 (Arm_relocate_functions::movt_rel): Ditto.
11444 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11445 (Arm_relocate_functions:thm_movw_rel): Ditto.
11446 (Arm_relocate_functions:thm_movt_rel): Ditto.
11447 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11448 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11449 New method definitions.
11450 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11451 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11452 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11453 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11454 (Target_arm::Relocate::relocate): Check for non-static or
11455 unimplemented relocation code and exit early. Change calls to
11456 Target_arm::reloc_uses_thumb_bit and
11457 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11458 instead. Refactor code to handle similar relocations to increase
11459 code sharing. Remove check for unsupported relocation code in switch
11460 statement.
11461 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11462 relocation property table to find out size. Change error message to
11463 print out the name of a relocation code instead of the numeric value.
11464 (Target_arm::scan_reloc_for_stub): Use relocation property table
11465 instead of calling Target_arm::reloc_uses_thumb_bit().
11466
11467 2010-02-02 Doug Kwan <dougkwan@google.com>
11468
11469 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11470 types of relaxed input section.
11471
11472 2010-02-02 Doug Kwan <dougkwan@google.com>
11473
11474 * Makefile.am (HFILES): Add arm-reloc-property.h.
11475 (DEFFILES): New.
11476 (TARGETSOURCES): Add arm-reloc-property.cc
11477 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11478 (libgold_a_SOURCES): $(DEFFILES)
11479 * Makefile.in: Regenerate.
11480 * arm-reloc-property.cc: New file.
11481 * arm-reloc-property.h: New file.
11482 * arm-reloc.def: New file.
11483 * arm.cc: Update comments.
11484 (arm-reloc-property.h): New included header.
11485 (arm_reloc_property_table): New global variable.
11486 (Target_arm::do_select_as_default_target): New method definition.
11487 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11488 arm-reloc-property to targ_extra_obj.
11489 * parameters.cc (set_parameters_target): Call
11490 Target::select_as_default_target().
11491 * target.h (Target::select_as_default_target): New method definition.
11492 (Target::do_select_as_default_target): Same.
11493
11494 2010-02-01 Doug Kwan <dougkwan@google.com>
11495
11496 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11497 first_output_text_section_.
11498 (Arm_exidx_fixup::first_output_text_section): New method definition.
11499 (Arm_exidx_fixup::first_output_text_section_): New data member.
11500 (Arm_exidx_fixup::process_exidx_section): Record the first text
11501 output section seen.
11502 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11503 and entsize in output section header.
11504
11505 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11506
11507 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11508 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11509 (Arm_relocate_functions::thm_alu11): New Method.
11510 (Arm_relocate_functions::thm_pc8): New Method.
11511 (Arm_relocate_functions::thm_pc12): New Method.
11512 (Target_arm::Scan::local): Handle the relocations.
11513 (Target_arm::Scan::global): Likewise.
11514 (Target_arm::Relocate::relocate): Likewise.
11515 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11516
11517 2010-01-29 Doug Kwan <dougkwan@google.com>
11518
11519 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11520 of relocation types as ld.
11521
11522 2010-01-29 Doug Kwan <dougkwan@google.com>
11523
11524 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11525 to public.
11526 (Arm_relocate_functions::thumb_branch_common): Ditto.
11527 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11528 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11529 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11530 Arm_relocate_functions::jump24): Remove.
11531 (Target_arm::Relocate::relocate): Adjust code to call
11532 Arm_relocation_functions::arm_branch_common and
11533 Arm_relocation_functions::thumb_branch_common instead of their removed
11534 wrappers. Merge switch-cases together to reduce source code size.
11535
11536 2010-01-29 Doug Kwan <dougkwan@google.com>
11537
11538 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11539 output_local_symbol_count_needs_update_.
11540 (Arm_relobj::output_local_symbol_count_needs_update,
11541 Arm_relobj::set_output_local_symbol_count_needs_update,
11542 Arm_relobj::update_output_local_symbol_count): New methods.
11543 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11544 member.
11545 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11546 of pointed function as in a R_ARM_PREL31 relocation.
11547 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11548 for output local symbol count updating.
11549 (Target_arm::do_relax): Update output local symbol counts in objects
11550 if necessary.
11551 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11552
11553 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11554
11555 * arm.cc: Added support for the ARM relocations:
11556 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11557 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11558 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11559 movw_prel_nc).
11560 (Arm_relocate_functions::movw_rel): New method.
11561 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11562 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11563 thm_movw_prel_nc).
11564 (Arm_relocate_functions::thm_movw_rel): New method.
11565 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11566 thm_movt_prel).
11567 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11568 relocations.
11569 (Target_arm::Scan::global): Likewise.
11570 (Target_arm::Relocate::relocate): Likewise.
11571 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11572 Likewise.
11573
11574 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11575
11576 * arm.cc: Added support for ARM group relocations.
11577 (Target_arm::reloc_needs_sym_origin): New method.
11578 (Arm_relocate_functions::calc_grp_kn): New method.
11579 (Arm_relocate_functions::calc_grp_residual): New method.
11580 (Arm_relocate_functions::calc_grp_gn): New method.
11581 (Arm_relocate_functions::arm_grp_alu): New Method.
11582 (Arm_relocate_functions::arm_grp_ldr): New Method.
11583 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11584 (Arm_relocate_functions::arm_grp_ldc): New Method.
11585 (Target_arm::Scan::local): Handle the ARM group 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-26 Doug Kwan <dougkwan@google.com>
11592
11593 * arm.cc (set): Include.
11594 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11595 pointer type.
11596 (Arm_output_section::Text_section_list): New type.
11597 (Arm_output_section::append_text_sections_to_list): New method.
11598 (Arm_output_section::fix_exidx_coverage): Ditto.
11599 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11600 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11601 Relobj::set_section_offset() instead of
11602 Sized_relobj::invalidate_section_offset().
11603 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11604 parameter for section headers. Ignore relocation sections for
11605 unallocated sections and EXIDX sections.
11606 (Target_arm::fix_exidx_coverage): New method.
11607 (Target_arm::output_section_address_less_than): New type.
11608 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11609 linked text section instead of the EXIDX section.
11610 (Arm_output_section::create_stub_group): Add an assertion to check
11611 that this is not an EXIDX output section.
11612 (Arm_output_section::append_text_sections_to_list): New method.
11613 (Arm_output_section::fix_exidx_coverage): Ditto.
11614 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11615 Arm_relobj::section_needs_reloc_stub_scanning.
11616 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11617 first pass.
11618 (Target_arm::fix_exidx_coverage): New method.
11619 * object.h (Relobj::set_output_section): New method.
11620 (Sized_relobj::invalidate_section_offset): Remove method.
11621 (Sized_relobj::do_invalidate_section_offset): Remove method.
11622 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11623
11624 2010-01-25 Doug Kwan <dougkwan@google.com>
11625
11626 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11627 Fix warning due to signed and unsigned comparison on a 32-bit host.
11628
11629 2010-01-22 Doug Kwan <dougkwan@google.com>
11630
11631 * arm.cc (Target_arm::do_relax): Record an output section for section
11632 offset adjustment it contains any stub table that has changed.
11633 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11634 offsets in an output section if necessary.
11635 * output.cc (Output_section::Output_section): Initialize
11636 section_offsets_need_adjustments_.
11637 (Output_section::add_input_section_for_script): Renamed to
11638 Output_section::add_simple_input_section.
11639 (Output_section::save_states): Add a comment.
11640 (Output_section::discard_states): New method defintion.
11641 (Output_section::adjust_section_offsets): Same.
11642 * output.h (Output_section::add_input_section_for_script): Renamed to
11643 Output_section::add_simple_input_section.
11644 (Output_section::discard_states): New method declaration.
11645 (Output_section::adjust_section_offsets): Same.
11646 (Output_section::section_offsets_need_adjustment,
11647 Output_section::set_section_offsets_need_adjustment): New method
11648 definitions.
11649 (Output_section::section_offsets_need_adjustment_): New data member.
11650 * script-sections.cc
11651 (Output_section_element_input::set_section_address): Adjust code for
11652 renaming of Output_section::add_input_section_for_script.
11653 (Orphan_output_section::set_section_address): Same.
11654
11655 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11656
11657 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11658 Fix_v4bx enum values .
11659 * gold/options.h (General_options): New option definitions.
11660 (General_options::fix_v4bx): New method.
11661 (General_options::Fix_v4bx): New enum.
11662 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11663 (General_options::parse_fix_v4bx_interworking): New method.
11664
11665 2010-01-22 Doug Kwan <dougkwan@google.com>
11666
11667 * arm.cc (Arm_exidx_fixup): New class.
11668
11669 2010-01-21 Doug Kwan <dougkwan@google.com>
11670
11671 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11672 classes.
11673 (Arm_exidx_section_offset_map): New type.
11674
11675 2010-01-21 Doug Kwan <dougkwan@google.com>
11676
11677 * arm.cc (Arm_exidx_input_section): New class.
11678 (Arm_relobj::exidx_input_section_by_link,
11679 Arm_relobj::exidx_input_section_by_shndx,
11680 Arm_relobj::make_exidx_input_section): New methods.
11681 (read_arm_attributes_section): Remove.
11682 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11683 information about them.
11684 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11685 to here.
11686
11687 2010-01-20 Doug Kwan <dougkwan@google.com>
11688
11689 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11690 Input_section_specifier to Section_id.
11691 (Target_arm::new_arm_input_section: Adjust code for change of key
11692 type.
11693 (Target_arm::find_arm_input_section): Ditto.
11694 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11695 (Section_id): Remove.
11696 (Garbage_collection::Section_id_hash): Remove.
11697 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11698 (Section_id): Remove.
11699 (Icf::Section_id_hash): Remove.
11700 * object.h (Section_id, Const_section_id, Section_id_hash,
11701 Const_section_id_hash): New type definitions.
11702 * output.cc (Output_section::add_relaxed_input_section): Change to
11703 use Const_section_id instead of Input_section_specifier as key type.
11704 (Output_section::add_merge_input_section): Ditto.
11705 (Output_section::build_relaxation_map): Change to use Section_id
11706 instead of Input_section_specifier as key type.
11707 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11708 Ditto.
11709 (Output_section::convert_input_sections_to_relaxed_sections): Change
11710 to use Const_section_id instead of Input_section_specifier as key type.
11711 (Output_section::find_merge_section): Ditto.
11712 (Output_section::find_relaxed_input_section): Ditto.
11713 * output.h (Input_section_specifier): Remove class.
11714 (Output_section::Output_section_data_by_input_section_map): Change
11715 key type to Const_section_id.
11716 (Output_section::Output_relaxed_input_section_by_input_section_map):
11717 Ditto.
11718 (Output_section::Relaxation_map): Change key type to Section_id.
11719
11720 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11721
11722 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11723 (class Arm_v4bx_stub): New class.
11724 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11725 (Stub_factory::make_arm_v4bx_stub): New method.
11726 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11727 (Stub_table::empty): Handle v4bx stubs.
11728 (Stub_table::add_arm_v4bx_stub): New method.
11729 (Stub_table::find_arm_v4bx_stub): New method.
11730 (Arm_relocate_functions::v4bx): New method.
11731 (Target_arm::fix_v4bx): New method.
11732 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11733 (Stub_table::relocate_stubs): Likewise.
11734 (Stub_table::do_write): Likewise.
11735 (Stub_table::update_data_size_and_addralign): Likewise.
11736 (Stub_table::finalize_stubs): Likewise.
11737 (Target_arm::Scan::local): Likewise.
11738 (Target_arm::Scan::global): Likewise.
11739 (Target_arm::do_finalize_sections): Likewise.
11740 (Target_arm::Relocate::relocate): Likewise.
11741 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11742 Likewise.
11743 (Target_arm::scan_reloc_for_stub): Likewise.
11744 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11745
11746 2010-01-19 Ian Lance Taylor <iant@google.com>
11747
11748 * output.cc (Output_section_headers::do_sized_write): Write large
11749 segment count to sh_info field.
11750 (Output_file_header::do_sized_write): For large segment count,
11751 write PN_XNUM to e_phnum field.
11752
11753 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11754
11755 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11756 (Arm_relocate_functions::thm_jump8): New function.
11757 (Arm_relocate_functions::thm_jump11): New function.
11758 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11759 R_ARM_THM_JUMP11.
11760 (Target_arm::Scan::global): Likewise.
11761 (Target_arm::Relocate::relocate): Likewise.
11762 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11763 Likewise.
11764
11765 2010-01-14 Doug Kwan <dougkwan@google.com>
11766
11767 * arm.cc (map, utility): Include headers.
11768 (Target_arm::apply_cortex_a8_workaround): New method.
11769 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11770 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11771 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11772 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11773 the --[no-]fix-cortex-a8 command line options.
11774 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11775 (Target_arm::relocate_stub): Use addend in instruction template.
11776 * options.h (DEFINE_bool): Set the user-set flag.
11777 (General_options): Add --[no-]-fix-cortex options.
11778 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11779 : Update fast look-up map after conversion.
11780
11781 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11782
11783 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11784 in the first pass of do_layout.
11785
11786 2010-01-13 Doug Kwan <dougkwan@google.com>
11787
11788 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11789 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11790 apparent compiler problem of not folding static constant integral
11791 data members of elfcpp::Elf_sizes<32>.
11792
11793 2010-01-13 Doug Kwan <dougkwan@google.com>
11794
11795 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11796 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11797 Arm_relobj::scan_section_for_cortex_a8_erratum,
11798 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11799 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11800 sections to scan for relocation stubs into a new method
11801 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11802 relocation and Cortex-A8 stub scanning.
11803 (Target_arm::do_relax): Force stubs to be after stubbed sections
11804 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11805 the beginning of a new relaxation pass. Update a comment.
11806 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11807
11808 2010-01-12 Ian Lance Taylor <iant@google.com>
11809
11810 * target-reloc.h (visibility_error): New inline function.
11811 (relocate_section): Call visibility_error.
11812 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11813 (MOSTLYCLEANFILES): Likewise.
11814 (protected_4_pic.o, protected_3.err): New targets.
11815 * testsuite/protected_4.cc: New file.
11816
11817 2010-01-12 Doug Kwan <dougkwan@google.com>
11818
11819 * arm.cc (Cortex_a8_reloc): New class.
11820 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11821 and cortex_a8_relocs_info_.
11822 (Target_arm::fix_cortex_a8): New method definition.
11823 (Target_arm::Cortex_a8_relocs_info): New type.
11824 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11825 New data member declarations.
11826 (Target_arm::scan_reloc_for_stub): Record information about
11827 relocations for THUMB branches that might be exempted from the
11828 Cortex-A8 workaround.
11829 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11830 at the beginning of a relaxation pass.
11831
11832 2010-01-12 Doug Kwan <dougkwan@google.com>
11833
11834 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11835 (Arm_relobj::Mapping_symbol_position,
11836 Arm_reloj::Mapping_symbol_position_less,
11837 Arm_relobj::Mapping_symbols_info): New types.
11838 (Target_arm::is_mapping_symbol_name): New method definition.
11839 (Arm_relobj::do_count_local_symbols): Save information about mapping
11840 symbols.
11841
11842 2010-01-11 Doug Kwan <dougkwan@google.com>
11843
11844 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11845 Arm_relocate_functions::thumb32_branch_upper,
11846 Arm_relocate_functions::thumb32_branch_lower,
11847 Arm_relocate_functions::thumb32_cond_branch_offset,
11848 Arm_relocate_functions::thumb32_cond_branch_upper,
11849 Arm_relocate_functions::thumb32_cond_branch_lower,
11850 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11851 branch offset encoding.
11852 (Arm_relocate_functions::thumb_branch_common): Use new branch
11853 offset encoding methods to avoid code duplication.
11854 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11855 (Stub_addend_reader::operator()): Use new branch encoding method
11856 to avoid code duplication.
11857
11858 2010-01-11 Doug Kwan <dougkwan@google.com>
11859
11860 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11861 (Target_arm::do_finalize_sections): Define special EXIDX section
11862 symbols only if referenced.
11863 * gc.h (Garbage_collection::add_reference): New method.
11864 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11865 code duplication.
11866
11867 2010-01-11 Ian Lance Taylor <iant@google.com>
11868
11869 * script.cc (Version_script_info::build_expression_list_lookup):
11870 Change complaing about duplicate wildcard match from error to
11871 warning.
11872
11873 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11874 of 2009-12-30.
11875 (Version_script_info::Version_script_info): Initialize globs_,
11876 default_version_, default_is_global_, and exact_. Don't
11877 initialize globals_ or locals_.
11878 (Version_script_info::build_lookup_tables): Build local symbols
11879 first.
11880 (Version_script_info::unquote): New function.
11881 (Version_script_info::add_exact_match): New function.
11882 (Version_script_info::build_expression_list_lookup): Remove lookup
11883 parameter. Add is_global parameter. Change all callers. Handle
11884 wildcard pattern specially. Unquote pattern. Call
11885 add_exact_match.
11886 (Version_script_info::get_name_to_match): New function.
11887 (Version_script_info::get_symbol_version): New function.
11888 (Version_script_info::get_symbol_version_helper): Remove.
11889 (Version_script_info::check_unmatched_names): Call unquote.
11890 * script.h (class Version_script_info): Change get_symbol_version
11891 to be non-inline and add is_global parameter; change all callers.
11892 Rewrite symbol_is_local. Update declarations. Define struct
11893 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11894 Remove globals_ and locals_ members. Add exact_, globs_,
11895 default_version_, is_global_.
11896 (Version_script_info::Glob): Remove pattern, add expression and
11897 is_global. Update constructor. Change all callers.
11898 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11899 default version.
11900 (Versions::symbol_section_contents): If a symbol is undefined, or
11901 defined in a dynamic object, set the version index to
11902 VER_NDX_LOCAL.
11903 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11904 symbol_is_local.
11905 (Symbol_table::add_from_pluginobj): Likewise.
11906 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11907
11908 2010-01-11 Doug Kwan <dougkwan@google.com>
11909
11910 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11911 (incremental_dump_LDADD): Add linking option for libintl.
11912 * Makefile.in: Regenerate.
11913
11914 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11915
11916 PR gold/11144
11917 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11918 instead of -Ds.
11919 * testsuite/Makefile.in: Regenerated.
11920
11921 2010-01-10 Doug Kwan <dougkwan@google.com>
11922
11923 * options.h (DEFINE_var): Use parentheses around argument varname__
11924 in macro body to avoid any unintended subsequent substitutions.
11925
11926 2010-01-10 Ian Lance Taylor <iant@google.com>
11927
11928 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11929 candidates before doing symbol resolution.
11930
11931 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11932 ODR candidates if only one is weak.
11933
11934 2010-01-08 Ian Lance Taylor <iant@google.com>
11935
11936 * script.cc (Version_script_info::build_expression_list_lookup):
11937 Don't warn about ambiguous version, just record the ambiguity.
11938 (Version_script_info::get_symbol_version_helper): Give error if
11939 version is ambiguous.
11940
11941 2010-01-08 Doug Kwan <dougkwan@google.com>
11942
11943 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11944 prev_data_size_ and prev_addralign_. Remove initializer for
11945 deleted data member has_been_changed_.
11946 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11947 to determine if the table is empty.
11948 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11949 Remove.
11950 (Stub_table::add_reloc_stub): Define method in class definition
11951 instead of just declaring it there.
11952 (Stub_table::add_cortex_a8_stub): New method definition.
11953 (Stub_table::update_data_size_and_addralign): Ditto.
11954 (Stub_table::finalize_stubs): Ditto.
11955 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11956 (Stub_table::do_addralign_): Return address alignment in the
11957 (Stub_table::do_reset_address_and_file_offset): Define method in
11958 class definition instead of declaring it there. Set current data
11959 size to be the data size of the previous pass.
11960 (Stub_table::set_final_data_size): Use current data size as the
11961 final data size.
11962 (Stub_table::relocate_stub): Change parameter type of stub from
11963 Reloc_stub pointer to Stub pointer.
11964 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11965 (Stub_table::Cortex_a8_stub_list): New typedef.
11966 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11967 Stub_table::prev_addralign_): New data member.
11968 (Arm_relobj::Arm_relobj): Initialize data member
11969 section_has_cortex_a8_workaround_.
11970 (Arm_relobj::section_has_cortex_a8_workaround,
11971 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11972 definitions.
11973 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11974 declarations.
11975 (Target_arm::relocate_stub): Change parameter type of stub from
11976 Reloc_stub pointer to Stub pointer.
11977 (Insn_template::size, Insn_template::alignment): Handle
11978 THUMB16_SPECIAL_TYPE.
11979 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11980 Stub_table::update_data_size_and_addralign,
11981 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11982 definitions.
11983 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11984 (Stub_table::do_write): Ditto.
11985 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11986
11987 2010-01-08 Ian Lance Taylor <iant@google.com>
11988
11989 PR 11108
11990 * symtab.h (class Symbol): Remove fields is_target_special_ and
11991 has_plt_offset_. Add field is_defined_in_discarded_section_.
11992 (Symbol::is_defined_in_discarded_section): New function.
11993 (Symbol::set_is_defined_in_discarded_section): New function.
11994 (Symbol::has_plt_offset): Rewrite.
11995 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11996 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11997 Don't initialize is_target_special_ or has_plt_offset_.
11998 Initialize is_defined_in_discarded_section_.
11999 (Symbol_table::add_from_relobj): If appropriate, set
12000 is_defined_in_discarded_section.
12001 * resolve.cc (Symbol::override_base_with_special): Don't test
12002 is_target_special_. Change has_plt_offset_ to has_plt_offset().
12003 * target-reloc.h (relocate_section): Do special handling for
12004 symbols defined in discarded sections for global symbols as well
12005 as local symbols.
12006
12007 2010-01-08 Ian Lance Taylor <iant@google.com>
12008
12009 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
12010 the SHT_SYMTAB case.
12011
12012 2010-01-08 Ian Lance Taylor <iant@google.com>
12013
12014 * object.cc (Sized_relobj::do_layout): Don't get confused if
12015 layout_eh_frame returns NULL.
12016
12017 2010-01-08 Ian Lance Taylor <iant@google.com>
12018
12019 PR 11084
12020 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
12021 dynamic symbol table, use the normal symbol table.
12022 (Sized_dynobj::do_read_symbols): Remove assertion about type of
12023 symbol table.
12024
12025 2010-01-08 Ian Lance Taylor <iant@google.com>
12026
12027 PR 11072
12028 * layout.cc (Layout::include_section): Remove .gnu_debuglink
12029 sections.
12030
12031 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
12032
12033 * version.cc (print_version): Change to "Copyright 2010".
12034
12035 2010-01-08 Ian Lance Taylor <iant@google.com>
12036
12037 PR 10287
12038 PR 11063
12039 * i386.cc (class Target_i386): Change return type of plt_section
12040 to be non-const.
12041 (class Output_data_plt_i386): Add tls_desc_rel_ field.
12042 (Output_data_plt_i386::Output_data_plt_i386): Initialize
12043 tls_desc_rel_ field.
12044 (Output_data_plt_i386::rel_tls_desc): New function.
12045 (Target_i386::rel_tls_desc_section): New function.
12046 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
12047 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
12048 R_386_TLS_DESC reloc in rel_tls_desc_section.
12049 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
12050 Define struct Tlsdesc_info.
12051 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
12052 (Target_x86_64::do_reloc_symbol_index): New function.
12053 (Target_x86_64::add_tlsdesc_info): New function.
12054 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
12055 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
12056 tlsdesc_rel_ field.
12057 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
12058 all callers.
12059 (Output_data_plt_x86_64::rela_tlsdesc): New function.
12060 (Target_x86_64::rela_tlsdesc_section): New function.
12061 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
12062 handling.
12063 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
12064 (Target_x86_64::do_reloc_addend): New function.
12065 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
12066 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
12067 declarations. Define TARGET_CODE. Add arg field to u1_ union.
12068 (Output_reloc::type): New function.
12069 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
12070 (Output_reloc::is_target_specific): New function.
12071 (Output_reloc::target_arg): New function.
12072 (class Output_reloc) [SHT_RELA]: Add four new constructors for
12073 absolute relocs and target specific relocs.
12074 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
12075 add_target_specific.
12076 (class Output_data_reloc) [SHT_RELA]: Likewise.
12077 * output.cc (Output_reloc::Output_reloc): Add four new versions
12078 for absolute relocs and target specific relocs.
12079 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
12080 (Output_reloc::get_symbol_index): Likewise.
12081 (Output_reloc::local_section_offset): Check that local_sym_index_
12082 is not TARGET_CODE or 0.
12083 (Output_reloc::symbol_value): Likewise.
12084 (Output_reloc::write) [SHT_RELA]: Call target for target specific
12085 reloc.
12086 * target.h (class Target): Add reloc_symbol_index and reloc_addend
12087 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
12088 functions.
12089 * layout.cc (add_target_dynamic_tags): Use output section for
12090 DT_PLTRELSZ and DT_JMPREL.
12091
12092 2010-01-07 Ian Lance Taylor <iant@google.com>
12093
12094 PR 11061
12095 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
12096 function.
12097 (class Output_data_reloc_generic): Define.
12098 (class Output_data_reloc_base): Change base class to
12099 Output_data_reloc_generic. Change add() method to call
12100 bump_relative_reloc_count for a relative reloc. Remove
12101 sort_relocs_ field.
12102 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
12103 to sort_relocs().
12104 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
12105 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
12106 appropriate.
12107 * layout.h (class Layout): Update declaration.
12108
12109 2010-01-07 Ian Lance Taylor <iant@google.com>
12110
12111 * output.h (class Output_data): Add const version of
12112 output_section and do_output_section.
12113 (class Output_section_data): Add const version of
12114 do_output_section.
12115 (class Output_section): Likewise.
12116 * layout.cc (Layout::add_target_dynamic_tags): New function.
12117 * layout.h (class Layout): Update declarations.
12118 * arm.cc (Target_arm::do_finalize_sections): Use
12119 add_target_dynamic_tags.
12120 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12121 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12122 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12123 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12124
12125 2010-01-07 Ian Lance Taylor <iant@google.com>
12126
12127 PR 11042
12128 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
12129 object as needed.
12130
12131 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
12132 Ian Lance Taylor <iant@google.com>
12133
12134 PR 11019
12135 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12136 Xindex::read_symtab_xindex.
12137
12138 2010-01-07 Doug Kwan <dougkwan@google.com>
12139
12140 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12141 (Insn_template::thumb16_bcond_insn): New method declaration.
12142 (Insn_template): Fix spelling.
12143 (Stub::thumb16_special): New method declaration.
12144 (Stub::do_write): Define virtual method which was previously pure
12145 virtual.
12146 (Stub::do_thumb16_special): New method declaration.
12147 (Stub::do_fixed_endian_write): New template member.
12148 (Reloc_stub::do_write): Remove.
12149 (Reloc_stub::do_fixed_endian_write): Remove.
12150 (Cortex_a8_stub): New class definition.
12151 (Stub_factory::make_cortex_a8_stub): New method definition.
12152 (Stub_factory::Stub_factory): Add missing static storage class
12153 qualifier for elf32_arm_stub_a8_veneer_blx.
12154
12155 2010-01-07 Ian Lance Taylor <iant@google.com>
12156
12157 PR 10980
12158 * options.h (class General_options): Add --warn-unresolved-symbols
12159 and --error-unresolved-symbols.
12160 * errors.cc (Errors::undefined_symbol): Implement
12161 --warn-unresolved-symbols.
12162
12163 * options.h (class General_options): Add -z text and -z textoff.
12164 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12165
12166 2010-01-06 Sriraman Tallam <tmsriram@google.com>
12167
12168 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12169 (Garbage_collection::cident_sections): New function.
12170 (Garbage_collection::add_cident_section): New function.
12171 (Garbage_collection::cident_sections_): New member.
12172 (gc_process_relocs): Add references to sections whose names are C
12173 identifiers.
12174 * gold.h (cident_section_start_prefix): New constant.
12175 (cident_section_stop_prefix): New constant.
12176 (is_cident): New function.
12177 * layout.cc (Layout::define_section_symbols): Replace string constants
12178 with the newly defined constants.
12179 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12180 C identifiers.
12181 * testsuite/Makefile.am: Add gc_orphan_section_test.
12182 * testsuite/Makefile.in: Regenerate.
12183 * testsuite/gc_orphan_section_test.cc: New file.
12184 * testsuite/gc_orphan_section_test.sh: New file.
12185
12186 2010-01-06 Ian Lance Taylor <iant@google.com>
12187
12188 PR 10980
12189 * options.h (class General_options): Add --warn-shared-textrel.
12190 * layout.cc (Layout::finish_dynamic_section): Implement
12191 --warn-shared-textrel.
12192
12193 PR 10980
12194 * options.h (class General_options): Add --warn-multiple-gp.
12195
12196 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12197
12198 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12199 $(THREADSLIB) and $(LIBDL).
12200 * Makefile.in: Rebuild.
12201
12202 2010-01-06 Ian Lance Taylor <iant@google.com>
12203
12204 PR 10980
12205 * options.cc (General_options::parse_section_start): New function.
12206 (General_options::section_start): New function.
12207 (General_options::General_options): Initialize all members.
12208 * options.h: Include <map>
12209 (class General_options): Add --section-start. Add section_starts_
12210 member.
12211 * layout.cc (Layout::attach_allocated_section_to_segment): If
12212 --section-start was used, set the address of the segment. Remove
12213 local sort_sections.
12214 (Layout::relaxation_loop_body): If the address of the load segment
12215 has been set by --section-start, don't use it.
12216 * output.h (Output_segment::update_flags_for_output_section): New
12217 function.
12218 * output.cc (Output_segment::add_output_section): Call
12219 update_flags_for_output_section.
12220
12221 2010-01-05 Ian Lance Taylor <iant@google.com>
12222
12223 PR 10980
12224 * options.h (class General_options): Add --undefined-version.
12225 * script.cc (struct Version_expression): Add was_matched_by_symbol
12226 field.
12227 (Version_script_info::matched_symbol): New function.
12228 (Version_script_info::get_symbol_version_helper): Call
12229 matched_symbol.
12230 (Version_script_info::check_unmatched_names): New function.
12231 * script.h (class Version_script_info): Update declarations.
12232 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12233
12234 * options.h (class General_options): Use DEFINE_bool_alias for
12235 allow_multiple_definition.
12236 * resolve.cc (Symbol_table::should_override): Don't test
12237 allow_multiple_definition.
12238
12239 PR 10980
12240 * options.h (class General_options): Add --cref.
12241 * main.cc (main): Print cref table if --cref. Don't close mapfile
12242 until after printing cref table.
12243 * cref.cc: Include "symtab.h".
12244 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12245 (Cref_table_compare::operator()): New function.
12246 (Cref_inputs::gather_cref): New function.
12247 (filecol): New static const.
12248 (Cref_inputs::print_cref): New function.
12249 (Cref::print_cref): New function.
12250 * cref.h: Include <cstdio>.
12251 (class Cref): Update declarations.
12252 * mapfile.h (Mapfile::file): New function.
12253 * object.h (class Object): Define Symbols. Declare virtual
12254 do_get_global_symbols.
12255 (Object::get_global_symbols): New function.
12256 * object.cc (Input_objects::add_object): Pass object to cref_ if
12257 --cref.
12258 (Input_objects::archive_start): Likewise.
12259 (Input_objects::archive_stop): Likewise.
12260 (Input_objects::print_cref): New function.
12261 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12262 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12263 --cref.
12264 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12265 function.
12266 * plugin.h (class Sized_pluginobj): Update declarations.
12267
12268 2010-01-05 Ian Lance Taylor <iant@google.com>
12269
12270 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12271 to is_default_version. Rename insdef to insdefault.
12272 (Symbol_table::add_from_relobj): Rename def to is_default_version
12273 and local to is_forced_local.
12274 (Symbol_table::add_from_pluginobj): Likewise.
12275 (Symbol_table::add_from_dynobj): Likewise.
12276 (Symbol_table::define_special_symbol): Rename insdef to
12277 insdefault.
12278
12279 2010-01-04 Ian Lance Taylor <iant@google.com>
12280
12281 PR 10980
12282 * options.h (class General_options): Add
12283 --allow-multiple-definition and -z muldefs.
12284 * resolve.cc (Symbol_table::should_override): Don't warn about a
12285 multiple symbol definition if --allow-multiple-definition or -z
12286 muldefs.
12287
12288 PR 10980
12289 * options.h (class General_options): Add --add-needed and
12290 --copy-dt-needed-entries. Tweak --as-needed help entry.
12291 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12292 error if --copy-dt-needed-entries aka --add-needed is used and
12293 would cause a change in behaviour.
12294
12295 PR 10980
12296 * options.h (class General_options): Add -G as a short version of
12297 --shared. Add no-op options -assert, -g, and -i.
12298
12299 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12300
12301 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12302 check for .text or .gnu.linkonce.t sections.
12303 * icf.cc (Icf::find_identical_sections): Ditto.
12304 Change the detection for mangled function name within the section
12305 name.
12306 * icf.h (is_section_foldable_candidate): New function.
12307
12308 2009-12-30 Ian Lance Taylor <iant@google.com>
12309
12310 PR 10980
12311 * options.h (class General_options): Permit two dashes with
12312 --retain-symbols-file.
12313
12314 2009-12-30 Ian Lance Taylor <iant@google.com>
12315
12316 PR 10979
12317 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12318 don't put the file header and segment headers in the text
12319 segment.
12320
12321 PR 10979
12322 * common.cc (Sort_commons::operator()): Stabilize sort when both
12323 entries are NULL.
12324 (Symbol_table::do_allocate_commons_list): When allocating common
12325 symbols, skip a symbol which is no longer common.
12326 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12327 an object before checking its type.
12328 * testsuite/common_test_2.c: New file.
12329 * testsuite/common_test_3.c: New file.
12330 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12331 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12332 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12333 (common_test_2_pic.o, common_test_2.so): New targets.
12334 (common_test_3_pic.o, common_test_3.so): New targets.
12335 * testsuite/Makefile.in: Rebuild.
12336
12337 PR 10979
12338 * script.cc (read_input_script): If we see a new SECTIONS clause,
12339 and we have added an input section, give an error.
12340 * layout.h (class Layout): Add have_added_input_section function.
12341 Add have_added_input_section_ field.
12342 * layout.cc (Layout::Layout): Initialize
12343 have_added_input_section_.
12344 (Layout::layout): Set have_added_input_section_.
12345 (Layout::layout_eh_frame): Likewise.
12346
12347 2009-12-30 Ian Lance Taylor <iant@google.com>
12348
12349 PR 10931
12350 * options.h (class General_options): Add --sort-common option.
12351 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12352 * common.cc (Sort_common): Add sort_order parameter to
12353 constructor. Add sort_order_ field.
12354 (Sort_commons::operator): Check sort_order_.
12355 (Symbol_table::allocate_commons): Determine the sort order.
12356 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12357 Change all callers.
12358 (Symbol_table::do_allocate_commons_list): Likewise.
12359
12360 2009-12-30 Ian Lance Taylor <iant@google.com>
12361
12362 PR 10916
12363 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12364 symbols from this object, don't change the visibility of an
12365 undefined symbol.
12366 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12367
12368 2009-12-30 Ian Lance Taylor <iant@google.com>
12369
12370 PR 10861
12371 * script.h (class Version_script_info): Define Language enum.
12372 Update declarations. Define Glob, Exact, and Lookup types. Add
12373 new fields globals_, locals_, and is_finalized_.
12374 * script.cc: Various formatting fixes.
12375 (class Parser_closure): Change language_stack_ from a vector of
12376 std::string to one of Version_script_info::Language. Adjust all
12377 uses accordingly.
12378 (class Lazy_demangler): Remove.
12379 (struct Version_expression): Change language from std::string to
12380 Version_script_info::Language.
12381 (Version_script_info::Version_script_info): New function.
12382 (Version_script_info::~Version_script_info): Don't call clear.
12383 (Version_script_info::finalize): New function.
12384 (Version_script_info::build_lookup_tables): New function.
12385 (Version_script_info::build_expression_list_lookup): New
12386 function.
12387 (Version_script_info::get_symbol_version_helper): Rewrite to use
12388 lookup tables.
12389 (Version_script_info::print_expression_list): Adjust to use
12390 Version_script_info::Language.
12391 (script_push_lex_into_version_mode): Check that the version script
12392 has not been finalized.
12393 (version_script_push_lang): Change language string to
12394 Version_script_info::Language.
12395 * options.cc (Command_line::version_script): New function.
12396 * options.h (class General_options): Add finalize_dynamic_list
12397 function. Change version_script from declaration to definition.
12398 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12399 * testsuite/version_script.map: Remove duplicate def of foo.
12400 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12401 version_script.map.
12402 * testsuite/Makefile.in: Rebuild.
12403
12404 2009-12-30 Ian Lance Taylor <iant@google.com>
12405
12406 PR 10843
12407 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12408 if the input symbol index is 0, make the output symbol index 0.
12409
12410 2009-12-30 Ian Lance Taylor <iant@google.com>
12411
12412 PR 10670
12413 * options.h (class General_options): Add -x/--discard-all.
12414 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12415 --discard-all. If the local symbol needs a dynamic entry, check
12416 that before handling --discard-locals.
12417
12418 2009-12-30 Ian Lance Taylor <iant@google.com>
12419
12420 PR 10450
12421 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12422 flags to PF_R.
12423 (Output_segment::add_output_section): Don't change the flags if
12424 the type is PT_TLS.
12425
12426 PR 10450
12427 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12428 GNU hash table if they need a dynamic value. Otherwise, don't add
12429 them if they are defined in a dynamic object or are forced local.
12430
12431 2009-12-29 Ian Lance Taylor <iant@google.com>
12432
12433 PR 10450
12434 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12435 .gnu.hash table for a 32-bit target.
12436
12437 PR 10450
12438 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12439 regular and a dynamic object only needs a dynamic symbol table
12440 entry if it is externally visible.
12441
12442 PR 10450
12443 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12444 constructor. Add global_offset_table_ field.
12445 (Target_i386::got_section): Set global_offset_table_.
12446 (Target_i386::do_finalize_sections): Set global_offset_table_
12447 size.
12448 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12449 in constructor. Add global_offset_table_ field.
12450 (Target_x86_64::got_section): Set global_offset_table_.
12451 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12452 size.
12453
12454 * layout.cc (Layout::Layout): Initialize increase_relro_.
12455 (Layout::get_output_section): Add is_relro, is_last_relro, and
12456 is_first_non_relro parameters. Change all callers.
12457 (Layout::choose_output_section): Likewise.
12458 (Layout::add_output_section_data): Likewise.
12459 (Layout::make_output_section): Likewise.
12460 (Layout::set_segment_offsets): Clear increase_relro when using a
12461 linker script.
12462 * layout.h (class Layout): Add increase_relro method. Add
12463 increase_relro_ field. Update declarations.
12464 * output.cc (Output_section::Output_section): Initialize
12465 is_last_relro_ and is_first_non_relro_.
12466 (Output_segment::add_output_section): Group relro sections is
12467 do_sort is true. Handle is_last_relro and is_first_non_relro.
12468 (Output_segment::maximum_alignment): Remove relro handling.
12469 (Output_segment::set_section_addresses): Add increase_relro
12470 parameter. Change all callers. Add initial alignment to align
12471 relro sections on separate page. Remove old relro handling.
12472 (Output_segment::set_section_list_addresses): Remove in_relro
12473 parameter. Change all callers.
12474 (Output_segment::set_offset): Add increase parameter. Change all
12475 callers. Remove old relro handling.
12476 * output.h (class Output_section): Add new methods: is_last_relro,
12477 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12478 Add is_last_relro_ and is_first_non_relro_ fields.
12479 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12480 Create separate .got.plt section. Call increase_relro.
12481 * x86_64.cc (Target_x86_64::got_section): Likewise.
12482 * testsuite/relro_script_test.t: Add .got.plt.
12483
12484 PR 10450
12485 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12486 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12487 (Layout::finalize): Call set_dynamic_symbol_size.
12488 (Layout::set_dynamic_symbol_size): New function.
12489 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12490 set_dynamic_symbol_size.
12491
12492 PR 10450
12493 * output.h (class Output_section): Add is_entsize_zero_ field.
12494 * output.cc (Output_section::Output_section): Initialize
12495 is_entsize_zero_.
12496 (Output_section::set_entsize): If two different entsizes are
12497 requested, force it to zero.
12498 (Output_section::add_input_section): Set flags for .debug_str
12499 before updating section flags. Set entsize.
12500 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12501 and SHF_STRING if all input sections have those flags.
12502
12503 2009-12-29 Rafael Espindola <espindola@google.com>
12504
12505 * main.cc (main): Fix the sys time reporting.
12506 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12507 reporting.
12508
12509 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12510
12511 * options.cc (General_options::parse_version): Allow -v to exit
12512 without an error if there is nothing to link.
12513
12514 2009-12-29 Ian Lance Taylor <iant@google.com>
12515
12516 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12517 using a version of gcc before 4.1.
12518 * configure: Rebuild.
12519
12520 2009-12-28 Chris Demetriou <cgd@google.com>
12521
12522 * attributes.cc (Output_attributes_section_data::do_write): Use
12523 std::vector::front rather than std::vector::data.
12524
12525 2009-12-28 Ian Lance Taylor <iant@google.com>
12526
12527 * symtab.h (class Symbol_table): Add enum Defined.
12528 * resolve.cc (Symbol_table::should_override): Add defined
12529 parameter. Change all callers. Test whether object is NULL
12530 before calling a method on it.
12531 (Symbol_table::report_resolve_problem): Add defined parameter.
12532 Change all callers.
12533 (Symbol_table::should_override_with_special): Likewise.
12534 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12535 parameter. Change all callers.
12536 (Symbol_table::do_define_in_output_data): Likewise.
12537 (Symbol_table::define_in_output_segment): Likewise.
12538 (Symbol_table::do_define_in_output_segment): Likewise.
12539 (Symbol_table::define_as_constant): Likewise.
12540 (Symbol_table::do_define_as_constant): Likewise.
12541 * script.h (class Symbol_assignment): Add is_defsym parameter to
12542 constructor; change all callers.
12543 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12544 parameter. Change all callers. Add is_defsym_ field.
12545 (class Parser_closure): Add parsing_defsym parameter to
12546 constructor; change all callers. Add parsing_defsym accessor
12547 function. Add parsing_defsym_ field.
12548
12549 2009-12-28 Ian Lance Taylor <iant@google.com>
12550
12551 * gold.cc (queue_middle_tasks): Fix formatting.
12552 * object.cc (Relobj::is_section_name_included): Likewise.
12553
12554 2009-12-23 Ian Lance Taylor <iant@google.com>
12555
12556 * i386.cc (Target_i386::do_calls_non_split): Recognize
12557 -fsplit-stack prologue for a function with a static chain.
12558 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12559 -fsplit-stack prologue when using %r11.
12560
12561 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12562
12563 * options.cc (General_options::parse_version): Make -v continue and do
12564 the link like GNU ld does.
12565
12566 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12567
12568 * Makefile.am (CCFILES): Add timer.cc.
12569 (HFILES): Add timer.h.
12570 * configure.ac: Check for sysconf and times.
12571 * main.cc: include timer.h.
12572 (main): Use Timer instead of get_run_time.
12573 * timer.cc: New.
12574 * timer.h: New.
12575 * workqueue.cc: include timer.h.
12576 (Workqueue::find_and_run_task):
12577 Report user, sys and wall time.
12578 * Makefile.in: Regenerate.
12579 * config.in: Regenerate.
12580 * configure: Regenerate.
12581
12582 2009-12-16 Doug Kwan <dougkwan@google.com>
12583
12584 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12585 sections.
12586 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12587 relaxed input sections.
12588 * output.cc (Output_section::find_relaxed_input_section): Change
12589 return type to Output_relaxed_input_section pointer. Adjust code
12590 for new type of relaxed_input_section_map_.
12591 * output.h (Output_section::find_relaxed_input_section): Change
12592 return type to Output_relaxed_input_section pointer.
12593 (Output_section::Output_relaxed_input_section_by_input_section_map):
12594 New type.
12595 (Output_section::relaxed_input_section_map_): Change type to
12596 Output_section::Output_relaxed_input_section_by_input_section_map.
12597 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12598 input section.
12599
12600 2009-12-15 Ian Lance Taylor <iant@google.com>
12601
12602 * layout.cc (Layout::create_shstrtab): Only write out after input
12603 sections if we are compressing debug sections.
12604
12605 2009-12-15 Ian Lance Taylor <iant@google.com>
12606
12607 * archive.cc (Archive::add_symbols): Only look up a symbol without
12608 a version if there is, in fact, a version.
12609
12610 2009-12-14 Ian Lance Taylor <iant@google.com>
12611
12612 Revert -Wshadow changes, all changes from:
12613 2009-12-11 Doug Kwan <dougkwan@google.com>
12614 2009-12-11 Nick Clifton <nickc@redhat.com>
12615 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12616
12617 2009-12-11 Doug Kwan <dougkwan@google.com>
12618
12619 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12620 due to -Wshadow.
12621 * attributes.cc (Object_attribute::size): Ditto.
12622 (Attributes_section_data::size): Ditto.
12623 (Attributes_section_data::Attributes_section_data): Ditto.
12624 (Output_attributes_section_data::do_write): Ditto.
12625 * attributes.h (Object_attribute::set_type): Ditto.
12626 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12627
12628 2009-12-11 Nick Clifton <nickc@redhat.com>
12629
12630 * archive.cc: Fix shadowed variable warnings.
12631 * arm.cc: Likewise.
12632 * compressed_output.cc: Likewise.
12633 * compressed_output.h: Likewise.
12634 * configure: Likewise.
12635 * dwarf_reader.cc: Likewise.
12636 * dynobj.cc: Likewise.
12637 * dynobj.h: Likewise.
12638 * ehframe.cc: Likewise.
12639 * ehframe.h: Likewise.
12640 * errors.cc: Likewise.
12641 * expression.cc: Likewise.
12642 * fileread.cc: Likewise.
12643 * fileread.h: Likewise.
12644 * freebsd.h: Likewise.
12645 * i386.cc: Likewise.
12646 * icf.cc: Likewise.
12647 * incremental.h: Likewise.
12648 * layout.cc: Likewise.
12649 * layout.h: Likewise.
12650 * mapfile.cc: Likewise.
12651 * merge.cc: Likewise.
12652 * merge.h: Likewise.
12653 * object.cc: Likewise.
12654 * object.h: Likewise.
12655 * options.h: Likewise.
12656 * output.cc: Likewise.
12657 * output.h: Likewise.
12658 * parameters.cc: Likewise.
12659 * plugin.cc: Likewise.
12660 * powerpc.cc: Likewise.
12661 * reduced_debug_output.cc: Likewise.
12662 * reduced_debug_output.h: Likewise.
12663 * reloc.cc: Likewise.
12664 * reloc.h: Likewise.
12665 * resolve.cc: Likewise.
12666 * script-sections.cc: Likewise.
12667 * script.cc: Likewise.
12668 * script.h: Likewise.
12669 * sparc.cc: Likewise.
12670 * symtab.cc: Likewise.
12671 * symtab.h: Likewise.
12672 * target-select.cc: Likewise.
12673 * target-select.h: Likewise.
12674 * token.h: Likewise.
12675 * workqueue.cc: Likewise.
12676 * workqueue.h: Likewise.
12677 * x86_64.cc: Likewise.
12678
12679 2009-12-10 Doug Kwan <dougkwan@google.com>
12680
12681 * arm.cc (attributes.h): New include.
12682 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12683 (Arm_relobj::~Arm_relobj): Delete object pointed by
12684 attributes_section_data_.
12685 (Arm_relobj::attributes_section_data): New method definition.
12686 (Arm_relobj::attributes_section_data_): New data member declaration.
12687 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12688 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12689 attributes_section_data_.
12690 (Arm_dynobj::attributes_section_data): New method definition.
12691 (Arm_dynobj::attributes_section_data_): New data member declaration.
12692 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12693 initialization value of may_use_blx_ to false.
12694 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12695 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12696 object attributes to compute results instead of hard-coding.
12697 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12698 Target_arm::get_secondary_compatible_arch,
12699 Target_arm::set_secondary_compatible_arch
12700 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12701 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12702 New method declarations.
12703 (Target_arm::get_aeabi_object_attribute): New method definition.
12704 (Target_arm::attributes_section_data_): New data member declaration.
12705 (read_arm_attributes_section): New template definition.
12706 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12707 (Arm_dynobj::do_read_symbols): Ditto.
12708 (Target_arm::do_finalize_sections): Merge attributes sections from
12709 input. Check for BLX use after attributes section merging.
12710 Fix __exidx_start and __exidx_end visibility. Create an
12711 .ARM.attributes section if necessary.
12712 (Target_arm::get_secondary_compatible_arch,
12713 Target_arm::set_secondary_compatible_arch,
12714 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12715 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12716 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12717 New method definitions.
12718
12719 2009-12-09 Ian Lance Taylor <iant@google.com>
12720
12721 * plugin.cc (Plugin::load): Don't cast from void* to a function
12722 pointer.
12723
12724 2009-12-09 Ian Lance Taylor <iant@google.com>
12725
12726 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12727 information fields.
12728
12729 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12730
12731 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12732 Replace two_file_shared_1.so with two_file_shared_2.so.
12733 * testsuite/Makefile.in: Regenerated.
12734
12735 2009-12-08 Doug Kwan <dougkwan@google.com>
12736
12737 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12738 (HFILES): Add attributes.h and int_encoding.h.
12739 * Makefile.in: Regenerate.
12740 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12741 function definitions to int_encoding.cc
12742 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12743 prototypes to int_encoding.h
12744 * reduced_debug_output.cc (int_encoding.h): New include.
12745 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12746 function definitions to int_encoding.cc
12747 (insert_into_vector, read_from_pointer): Move template definitions to
12748 int_encoding.h
12749 * attributes.cc: New file.
12750 * attributes.h: New file.
12751 * int_encoding.cc: New file.
12752 * int_encoding.h: New file.
12753
12754 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12755
12756 PR gold/11055
12757 * incremental-dump.cc (dump_incremental_inputs): New.
12758 (main): Use dump_incremental_inputs.
12759
12760 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12761
12762 PR gold/10893
12763 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12764 checking elfcpp::STT_FUNC.
12765 (Target_i386::Relocate::relocate): Likewise.
12766 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12767
12768 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12769 symbols from shared libraries into normal FUNC symbols.
12770
12771 * symtab.h (Symbol): Add is_func and use it.
12772
12773 2009-12-05 Doug Kwan <dougkwan@google.com>
12774
12775 * arm.cc (Target_arm::arm_info): Initialize new fields
12776 attributes_section and attributes_vendor.
12777 * i386.cc (Target_i386::i386_info): Same.
12778 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12779 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12780 fields attributes_section and attributes_vendor.
12781 * sparc.cc (Target_sparc::sparc_info): Same.
12782 * target.h (Target::attributes_section, Target::attributes_vendor,
12783 Target::is_attributes_section, Target::attribute_arg_type,
12784 Target::attributes_order): New method definitions.
12785 (Target::Target_info::attributes_section,
12786 Target::Target_info::attributes_vendor): New fields.
12787 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12788 virtual method definitions.
12789 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12790 attributes_section and attributes_vendor.
12791 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12792
12793 2009-12-05 Doug Kwan <dougkwan@google.com>
12794
12795 * arm.cc: Update comments about interworking and stub generation.
12796 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12797 considered as non-PIC.
12798 (Arm_relocate_functions::base_abs): Fix formatting.
12799 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12800 of function to use GOT entry address instead of offset.
12801 (Target_arm::Scan::global): Issue an error if a symbol would need a
12802 PLT does not get one because it is untyped. Remove code to create
12803 dynamic symbols for relative branches.
12804 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12805 takes unsigned integer instead of boolean.
12806
12807 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12808
12809 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12810 (two_file_test_LDADD): Likewise.
12811 (common_test_1_LDADD): Likewise.
12812 (exception_test_LDADD) Likewise.
12813 (weak_test_LDADD): Likewise.
12814 (many_sections_test_LDADD): Likewise.
12815 (initpri1_LDADD): Likewise.
12816 (script_test_1_LDADD): Likewise.
12817 (script_test_2_LDADD): Likewise.
12818 (justsyms_LDADD): Likewise.
12819 (binary_test_LDADD): Likewise.
12820 (large_LDADD): Likewise.
12821 * testsuite/Makefile.in: Regenerated.
12822
12823 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12824
12825 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12826 (Symbol_table::override_with_special): Likewise.
12827 (Symbol_table::add_from_object): Likewise.
12828
12829 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12830
12831 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12832 Don't set the data_offset twice.
12833
12834 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12835
12836 * testsuite/Makefile.in: Regenerate.
12837
12838 2009-12-03 Doug Kwan <dougkwan@google.com>
12839
12840 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12841 (Target_arm::do_finalize_sections): Add parameter for symbol table
12842 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12843 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12844 parameter for symbol table pointer.
12845 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12846 an additional parameter for a pointer to symbol table.
12847 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12848 parameter for a symbol table pointer.
12849 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12850 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12851 Ditto.
12852 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12853 parameter for a symbol table pointer.
12854
12855 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12856
12857 * incremental.cc (Incremental_inputs_header)
12858 (Incremental_inputs_header_write, Incremental_inputs_entry)
12859 (Incremental_inputs_entry_write): Move ...
12860 * incremental.h (Incremental_inputs_header)
12861 (Incremental_inputs_header_write, Incremental_inputs_entry)
12862 (Incremental_inputs_entry_write): here.
12863
12864 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12865
12866 * incremental.cc (make_sized_incremental_binary): Set the target.
12867 Error if it is incompatible.
12868 * output.h (Output_file): Add filename method.
12869
12870 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12871
12872 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12873 from the get_* methods.
12874
12875 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12876
12877 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12878 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12879 Write 0 for the data_offset of scripts.
12880
12881 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12882
12883 * testsuite/Makefile.am: Add the incremental_test.sh test.
12884 * testsuite/incremental_test.sh: New.
12885 * testsuite/incremental_test_1.c: New.
12886 * testsuite/incremental_test_2.c: New.
12887
12888 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12889
12890 * incremental-dump.cc (main): Fix typos.
12891
12892 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12893
12894 PR gold/11025
12895 * incremental-dump.cc (main): Use llu to print 64 bit values.
12896
12897 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12898 H.J. Lu <hongjiu.lu@intel.com>
12899
12900 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12901 $(LIBDL).
12902 (incremental_dump_LDADD): Likewise.
12903 * Makefile.in: Regenerated.
12904
12905 2009-11-25 Doug Kwan <dougkwan@google.com>
12906
12907 Revert:
12908
12909 2009-11-25 Doug Kwan <dougkwan@google.com>
12910
12911 * arm.cc (Target_arm::Target_arm): Move method definition
12912 outside of class definition. Add code to handle
12913 --target1-rel, --target1-abs and --target2= options.
12914 (Target_arm::get_reloc_reloc_type): Change method to be
12915 non-static and const.
12916 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12917 New data member declaration.
12918 (Target_arm::Scan::local, Target_arm::Scan::global,
12919 Target_arm::Relocate::relocate,
12920 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12921 Adjust call to Target_arm::get_real_reloc_type.
12922 (Target_arm::get_real_reloc_type): Use command line options
12923 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12924 * options.h (--target1-rel, --target1-abs, --target2): New
12925 ARM-only options.
12926
12927 2009-11-25 Doug Kwan <dougkwan@google.com>
12928
12929 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12930 class definition. Add code to handle --target1-rel, --target1-abs
12931 and --target2= options.
12932 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12933 and const.
12934 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12935 member declaration.
12936 (Target_arm::Scan::local, Target_arm::Scan::global,
12937 Target_arm::Relocate::relocate,
12938 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12939 call to Target_arm::get_real_reloc_type.
12940 (Target_arm::get_real_reloc_type): Use command line options to
12941 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12942 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12943 options.
12944
12945 2009-11-25 Doug Kwan <dougkwan@google.com>
12946
12947 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12948 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12949 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12950 formatting.
12951 (Arm_relocate_functions::thm_call): Replace body with a call to
12952 Arm_relocate_functions::thumb_branch_common.
12953 (Arm_relocate_functions::thm_jump24,
12954 Arm_relocate_functions::thm_xpc22): New method definitions.
12955 (Arm_relocate_functions::thumb_branch_common): New method definition.
12956 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12957 operator.
12958 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12959 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12960
12961 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12962
12963 * Makefile.am: Build incremental-dump
12964 * Makefile.in: Regenerate.
12965 * incremental-dump.cc: New.
12966 * incremental.cc (Incremental_inputs_header_data,
12967 Incremental_inputs_entry_data): Move to incremental.h
12968 * incremental.h: (Incremental_inputs_header_data,
12969 Incremental_inputs_entry_data): Move from incremental.cc
12970
12971 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12972
12973 * incremental.cc (Incremental_inputs_header,
12974 Incremental_inputs_header_write, Incremental_inputs_entry,
12975 Incremental_inputs_entry_write): Add a typedef with the data type.
12976
12977 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12978
12979 * incremental.cc (Incremental_inputs_header,
12980 Incremental_inputs_header_write, Incremental_inputs_entry,
12981 Incremental_inputs_entry_write): Update comment about which
12982 type has the filed descriptions.
12983
12984 2009-11-15 Doug Kwan <dougkwan@google.com>
12985
12986 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12987 (Arm_relocate_functions::arm_branch_common): Change method defintion
12988 in class definition to a method declaration and update list of formal
12989 parameters.
12990 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12991 Arm_relocation_functions::jump24): Adjust call to
12992 Arm_relocate_functions::arm_branch_common. Update list of formal
12993 parameters.
12994 (Arm_relocate_functions::xpc25): New method definition.
12995 (Arm_relocate_functions::arm_branch_common): Move method defintion
12996 out from class definition. Use stubs for mode-switching and extending
12997 branch ranges.
12998 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12999 specially. Change code to enable use of stubs in ARM branches.
13000
13001 2009-11-10 Doug Kwan <dougkwan@google.com>
13002
13003 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
13004 in method declaration.
13005 (Target_arm::relocate_stub): New method declaration.
13006 (Target_arm::default_target): Change to return a pointer instead of
13007 a const reference.
13008 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
13009 Target_arm::default_target.
13010 (Arm_Relobj::do_relocate_sections): Remove options paramater in
13011 method definition.
13012 (Target_arm::relocate_section): Adjust view.
13013 (Target_arm::relocate_stub): New method definition.
13014
13015 2009-11-10 Doug Kwan <dougkwan@google.com>
13016
13017 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
13018 a format warning.
13019 * incremental.cc (open_incremental_binary): Initialized local
13020 variables to avoid warnings.
13021 * object.cc (make_elf_object): Ditto.
13022 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
13023 a format warning.
13024
13025 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
13026
13027 PR gold/10930
13028 * testsuite/plugin_test.c: Include "config.h".
13029
13030 2009-11-09 Doug Kwan <dougkwan@google.com>
13031
13032 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
13033 (arm_symbol_value): Remove.
13034 (Arm_relocate_functions::arm_branch_common,
13035 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
13036 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
13037 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
13038 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
13039 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
13040 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
13041 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
13042 Arm_relocate_functions::thm_mobw_abs_nc,
13043 Arm_relocate_functions::thm_mov_abs,
13044 Arm_relocate_functions::movw_prel_nc,
13045 Arm_relocate_functions::thm_movt_abs,
13046 Arm_relocate_functions::movt_prel,
13047 Arm_relocate_functions::thm_movw_prel_nc,
13048 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
13049 (Target_arm::Relocate::relocate): Only decompose address into two
13050 parts if relocation type uses the thumb-bit and pass the actual
13051 bit instead of a flag indicating that the thumb-bit is used. Adjust
13052 calls to methods in Arm_relocate_functions for this change.
13053
13054 2009-11-08 Ian Lance Taylor <iant@google.com>
13055
13056 PR 10925
13057 * reloc.cc: Instantiate
13058 Sized_relobj::initialize_input_to_output_maps and
13059 Sized_relobj:free_input_to_output_maps.
13060
13061 2009-11-06 Ian Lance Taylor <iant@google.com>
13062
13063 PR 10876
13064 * defstd.cc (in_segment): Set only_if_ref true for "end".
13065
13066 2009-11-06 Doug Kwan <dougkwan@google.com>
13067
13068 * arm.cc (class Reloc_stub): Correct a comment.
13069 (Target_arm::Target_arm): Initialize arm_input_section_map_.
13070 (Target_arm::scan_section_for_stubs): New method declaration.
13071 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
13072 Change methods from private to protected.
13073 (Target_arm::do_may_relax): New method definition.
13074 (Target_arm::do_relax, Target_arm::group_sections,
13075 Target_arm::scan_reloc_for_stub,
13076 Target_arm::scan_reloc_section_for_stubs): New method declarations.
13077 (Target_arm::arm_input_section_map_): New data member declaration.
13078 (Target_arm::scan_reloc_for_stub,
13079 Target_arm::scan_reloc_section_for_stubs,
13080 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
13081 Target_arm::do_relax): New method definitions.
13082
13083 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
13084
13085 * configure.ac: Check for (struct stat)::st_mtim
13086 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
13087 * config.in: Regenerate.
13088 * configure: Regenerate.
13089
13090 2009-11-05 Ian Lance Taylor <iant@google.com>
13091
13092 PR 10910
13093 * output.cc (Output_segment::add_output_section): Add missing
13094 return statement.
13095
13096 2009-11-04 Ian Lance Taylor <iant@google.com>
13097
13098 PR 10880
13099 * object.h (class Object): Add is_needed and set_is_needed
13100 methods. Add is_needed_ field. Make bool fields into bitfields.
13101 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
13102 defined in a dynamic object and referenced by a regular object,
13103 set is_needed for the dynamic object.
13104 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
13105 if the file is marked with as_needed and it is not needed.
13106
13107 2009-11-04 Ian Lance Taylor <iant@google.com>
13108
13109 PR 10887
13110 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
13111 tags if data is discarded by linker script.
13112 * i386.cc (Target_i386::do_finalize_sections): Likewise.
13113 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
13114 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
13115 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
13116
13117 2009-11-04 Ian Lance Taylor <iant@google.com>
13118
13119 * layout.cc (Layout::get_output_section): Add is_interp and
13120 is_dynamic_linker_section parameters. Change all callers.
13121 (Layout::choose_output_section): Likewise.
13122 (Layout::make_output_section): Likewise.
13123 (Layout::add_output_section_data): Add is_dynamic_linker_section
13124 parameter. Change all callers.
13125 * layout.h (class Layout): Update declarations.
13126 * output.h (class Output_section): Add is_interp, set_is_interp,
13127 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
13128 Add is_interp_, is_dynamic_linker_section_ fields. Change
13129 generate_code_fills_at_write_ to a bitfield.
13130 * output.cc (Output_section::Output_sections): Initialize new
13131 fields.
13132 (Output_segment::add_output_section): Add do_sort parameter.
13133 Change all callers.
13134
13135 2009-11-03 Ian Lance Taylor <iant@google.com>
13136
13137 PR 10860
13138 * options.h (class General_options): Add --warn-common.
13139 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13140 merging two common symbols.
13141 (Symbol_table::should_override): Handle --warn-common when merging
13142 a common symbol with a defined symbol. Use report_resolve_problem
13143 for multiple definitions.
13144 (Symbol_table::report_resolve_problem): New function.
13145 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13146
13147 2009-11-03 Doug Kwan <dougkwan@google.com>
13148
13149 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13150 stub_factory_.
13151 (Target_arm::stub_factory): New method definition.
13152 (Target_arm::new_arm_input_section,
13153 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13154 Target_arm::reloc_uses_thumb_bit): New method declarations.
13155 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
13156 New type definitions.
13157 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13158 member declarations.
13159 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13160 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13161 New method definitions.
13162
13163 2009-11-03 Ian Lance Taylor <iant@google.com>
13164
13165 * options.h (class General_options): Add --warn_constructors.
13166
13167 2009-11-03 Ian Lance Taylor <iant@google.com>
13168
13169 PR 10893
13170 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13171 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13172
13173 2009-11-03 Ian Lance Taylor <iant@google.com>
13174
13175 PR 10895
13176 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13177 --msgid-bugs-address.
13178 (install-pdf): New target.
13179 (install-data_yes): Look up one directory to find mkinstalldirs.
13180
13181 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13182
13183 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13184 tree.
13185
13186 2009-10-30 Doug Kwan <dougkwan@google.com>
13187
13188 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13189
13190 2009-10-30 Doug Kwan <dougkwan@google.com>
13191
13192 * arm.cc (Stub_addend_reader): New struct template definition
13193 and partial specializations.
13194 (Stub_addend_reader::operator()): New method definition for a
13195 partially specialized template.
13196
13197 2009-10-30 Doug Kwan <dougkwan@google.com>
13198
13199 * arm.cc (Arm_relobj::processor_specific_flags): New method
13200 definition.
13201 (Arm_relobj::do_read_symbols): New method declaration.
13202 (Arm_relobj::processor_specific_flags_): New data member declaration.
13203 (Arm_dynobj): New class definition.
13204 (Target_arm::do_finalize_sections): Add input_objects parameter.
13205 (Target_arm::do_adjust_elf_header): New method declaration.
13206 (Target_arm::are_eabi_versions_compatible,
13207 (Target_arm::merge_processor_specific_flags): New method declaration.
13208 (Target_arm::do_make_elf_object): New overloaded method definitions
13209 and declaration.
13210 (Arm_relobj::do_read_symbols): New method definition.
13211 (Arm_dynobj::do_read_symbols): Ditto.
13212 (Target_arm::do_finalize_sections): Add input_objects parameters.
13213 Merge processor-specific flags from all input objects.
13214 (Target_arm::are_eabi_versions_compatible,
13215 Target_arm::merge_processor_specific_flags,
13216 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13217 New method definitions.
13218 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13219 Input_objects pointer type parameter.
13220 * layout.cc (Layout::finalize): Pass input objects to target's.
13221 finalize_sections function.
13222 * output.cc (Output_file_header::do_sized_write): Set ELF file
13223 header's processor-specific flags.
13224 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13225 Input_objects pointer type parameter.
13226 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13227 * target.h (Input_objects): New forward class declaration.
13228 (Target::processor_specific_flags,
13229 Target::are_processor_specific_flags_sect): New method definitions.
13230 (Target::finalize_sections): Add input_objects parameter.
13231 (Target::Target): Initialize processor_specific_flags_ and
13232 are_processor_specific_flags_set_.
13233 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13234 parameter.
13235 (Target::set_processor_specific_flags): New method definition.
13236 (Target::processor_specific_flags_,
13237 Target::are_processor_specific_flags_set_): New data member
13238 declarations.
13239 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13240 Input_objects pointer type parameter.
13241
13242 2009-10-30 Doug Kwan <dougkwan@google.com>
13243
13244 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13245
13246 2009-10-28 Ian Lance Taylor <iant@google.com>
13247
13248 * object.h (class Relobj): Drop options parameter from
13249 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13250 do_scan_relocs, do_relocate. Change all callers.
13251 (class Sized_relobj): Drop options parameters from
13252 do_gc_process_relocs, do_scan_relocs, do_relocate,
13253 do_relocate_sections, relocate_sections, emit_relocs_scan,
13254 emit_relocs_scan_reltype. Change all callers.
13255 (struct Relocate_info): Remove options field and all references to
13256 it.
13257 * reloc.h (class Read_relocs): Remove options constructor
13258 parameter and options_ field. Change all callers.
13259 (class Gc_process_relocs, class Scan_relocs): Likewise.
13260 (class Relocate_task): Likewise.
13261 * target-reloc.h (scan_relocs): Remove options parameter. Change
13262 all callers.
13263 (scan_relocatable_relocs): Likewise.
13264 * target.h (class Sized_target): Remove options parameter from
13265 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13266 all callers.
13267 * gc.h (gc_process_relocs): Remove options parameter. Change all
13268 callers.
13269 * arm.cc: Update functions to remove options parameters.
13270 * i386.cc: Likewise.
13271 * powerpc.cc: Likewise.
13272 * sparc.cc: Likewise.
13273 * x86_64.cc: Likewise.
13274 * testsuite/testfile.cc: Likewise.
13275
13276 2009-10-28 Doug Kwan <dougkwan@google.com>
13277
13278 * arm.cc (Arm_relobj): New class definition.
13279 (Arm_relobj::scan_sections_for_stubs,
13280 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13281 New method definitions.
13282
13283 2009-10-28 Cary Coutant <ccoutant@google.com>
13284
13285 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13286 (Plugin::cleanup_done_): New member.
13287 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13288 (Plugin_manager::cleanup_done_): Remove.
13289 (Plugin_manager::add_input_file): Edit error message.
13290 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13291 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13292
13293 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13294
13295 * fileread.cc: (File_read::View::~View): Use the new
13296 data_ownership_ filed.
13297 (File_read::~File_read): Dispose the new whole_file_view_.
13298 (File_read::open): Mmap the whole file if needed.
13299 (File_read::open): Use whole_file_view_ instead of contents_.
13300 (File_read::find_view): Use whole_file_view_ if applicable.
13301 (File_read::do_read): Use whole_file_view_ instead of contents_.
13302 (File_read::make_view): Use whole_file_view_ instead of contents_,
13303 update File_read::View::View call.
13304 (File_read::find_or_make_view): Update File_read::View::View
13305 call.
13306 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13307 remove contents_
13308 (File_read::View::Data_ownership): New enum.
13309 (File_read::View::View): Replace bool mapped_ with Data_ownership
13310 argument.
13311 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13312 (File_read::View::data_ownership_): New field.
13313 (File_read::contents_): Remove (replaced by whole_file_view_).
13314 (File_read::whole_file_view_): New field.
13315 * options.h (class General_options): Add --keep-files-mapped.
13316
13317 2009-10-27 Cary Coutant <ccoutant@google.com>
13318
13319 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13320 * testsuite/Makefile.am (plugin_test_5): New test case.
13321 * testsuite/Makefile.in: Regenerate.
13322
13323 2009-10-25 Doug Kwan <dougkwan@google.com>
13324
13325 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13326 from private to protected to allow access by child class.
13327 (Sized_relobj::do_relocate_sections): New method declaration.
13328 (Sized_relobj::relocate_sections): Virtualize.
13329 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13330 Sized_relobj::relocate_sections. Instantiate template explicitly
13331 for different target sizes and endianity.
13332
13333 2009-10-24 Doug Kwan <dougkwan@google.com>
13334
13335 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13336 (Arm_input_section::as_arm_input_section): New method.
13337 (Arm_output_section): New class definition.
13338 (Arm_output_section::create_stub_group,
13339 Arm_output_section::group_sections): New method definitions.
13340
13341 2009-10-22 Doug Kwan <dougkwan@google.com>
13342
13343 * arm.cc (Arm_input_section): New class definition.
13344 (Arm_input_section::init, Arm_input_section:do_write,
13345 Arm_input_section::set_final_data_size,
13346 Arm_input_section::do_reset_address_and_file_offset): New method
13347 definitions.
13348
13349 2009-10-21 Doug Kwan <dougkwan@google.com>
13350
13351 * arm.cc (Stub_table, Arm_input_section): New forward class
13352 declarations.
13353 (Stub_table): New class defintion.
13354 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13355 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13356 New method definition.
13357
13358 2009-10-21 Doug Kwan <dougkwan@google.com>
13359
13360 * arm.cc: Update copyright comments.
13361 (Target_arm): New forward class template declaration.
13362 (Arm_address): New type.
13363 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13364 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13365 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13366 constants.
13367 (Insn_template): Same.
13368 (DEF_STUBS): New macro.
13369 (Stub_type): New enum type.
13370 (Stub_template): New class definition.
13371 (Stub): Same.
13372 (Reloc_stub): Same.
13373 (Stub_factory): Same.
13374 (Target_arm::Target_arm): Initialize may_use_blx_ and
13375 should_force_pic_veneer_.
13376 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13377 Target_arm::should_force_pic_veneer,
13378 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13379 Target_arm::using_thumb_only, Target_arm:;default_target): New
13380 method defintions.
13381 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13382 New data member declarations.
13383 (Insn_template::size, Insn_template::alignment): New method defintions.
13384 (Stub_template::Stub_template): New method definition.
13385 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13386 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13387 (Stub_factory::Stub_factory): New method definition.
13388 * gold.h (string_hash): New template.
13389 * output.h (Input_section_specifier::hash_value): Use
13390 gold::string_hash.
13391 (Input_section_specifier::string_hash): Remove.
13392 * stringpool.cc (Stringpool_template::string_hash): Use
13393 gold::string_hash.
13394
13395 2009-10-20 Doug Kwan <dougkwan@google.com>
13396
13397 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13398 symbols of relaxed input sections.
13399 * output.h (Output_section::find_relaxed_input_section): Make
13400 method public.
13401
13402 2009-10-16 Doug Kwan <dougkwan@google.com>
13403
13404 * dynobj.cc (Versions::Versions): Initialize version_script_.
13405 Only insert base version symbol definition for a shared object
13406 if version script defines any version versions.
13407 (Versions::define_base_version): New method definition.
13408 (Versions::add_def): Check that base version is not needed.
13409 (Versions::add_need): Define base version lazily.
13410 * dynobj.h (Versions::define_base_version): New method declaration.
13411 (Versions::needs_base_version_): New data member declaration.
13412 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13413 (check_DATA): Add no_version_test.stdout.
13414 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13415 New make rules.
13416 * testsuite/Makefile.in: Regenerate.
13417 * testsuite/no_version_test.c: New file.
13418 * testsuite/no_version_test.sh: Ditto.
13419
13420 2009-10-16 Doug Kwan <dougkwan@google.com>
13421
13422 * expression.cc (class Segment_start_expression): New class definition.
13423 (Segment_start_expression::value): New method definition.
13424 (script_exp_function_segment_start): Return a new
13425 Segment_start_expression.
13426 * gold/script-c.h (script_saw_segment_start_expression): New function
13427 prototype.
13428 * script-sections.cc (Script_sections::Script_sections): Initialize
13429 SAW_SEGMENT_START_EXPRESSION_ to false.
13430 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13431 and -Tbbs options to specify section addresses if given in
13432 command line and no SEGMENT_START expression is seen in a script.
13433 * script-sections.h (Script_sections::saw_segment_start_expression,
13434 Script_sections::set_saw_segment_start_expression): New method
13435 definition.
13436 (Script_sections::saw_segment_start_expression_): New data member
13437 declaration.
13438 * script.cc (script_saw_segment_start_expression): New function.
13439 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13440 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13441 script_test_7.sh and script_test_8.sh.
13442 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13443 script_test_8.stdout.
13444 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13445 (script_test_6, script_test_6.stdout, script_test_7,
13446 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13447 * Makefile.in: Regenerate.
13448 * testsuite/script_test_6.sh: New file.
13449 * testsuite/script_test_6.t: Same.
13450 * testsuite/script_test_7.sh: Same.
13451 * testsuite/script_test_7.t: Same.
13452 * testsuite/script_test_8.sh: Same.
13453
13454 2009-10-16 Doug Kwan <dougkwan@google.com>
13455
13456 * output.cc (Output_segment::set_section_list_address): Cast
13457 expressions to unsigned long long type to avoid format warnings.
13458
13459 2009-10-15 Ian Lance Taylor <iant@google.com>
13460
13461 * script.cc (Script_options::add_symbol_assignment): Always add a
13462 dot assignment to script_sections_.
13463 * script-sections.cc (Script_sections::add_dot_assignment):
13464 Initialize if necessary.
13465
13466 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13467 program headers with no load segment if there is a linker script.
13468
13469 * layout.cc (Layout::set_segment_offsets): Align the file offset
13470 to the segment aligment for -N or -n with no load segment.
13471 * output.cc (Output_segment::add_output_section): Don't crash if
13472 the first section is a TLS section.
13473 (Output_segment::set_section_list_addresses): Print an error
13474 message if the address moves backward in a linker script.
13475 * script-sections.cc
13476 (Output_section_element_input::set_section_addresses): Don't
13477 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13478 (Orphan_output_section::set_section_addresses): Likewise.
13479
13480 2009-10-15 Doug Kwan <dougkwan@google.com>
13481
13482 * layout.cc (Layout::finish_dynamic_section): Generate tags
13483 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13484 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13485 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13486
13487 2009-10-14 Ian Lance Taylor <iant@google.com>
13488
13489 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13490 fields.
13491 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13492 data_shdr fields of relinfo.
13493 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13494 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13495 R_386_TLS_LDO_32, adjust based on section flags.
13496 (Target_i386::Relocate::fix_up_ldo): Remove.
13497
13498 2009-10-13 Ian Lance Taylor <iant@google.com>
13499
13500 Add support for -pie.
13501 * options.h (class General_options): Add -pie and
13502 --pic-executable.
13503 (General_options::output_is_position_independent): Test -pie.
13504 (General_options::output_is_executable): Return true if not shared
13505 and not relocatable.
13506 (General_options::output_is_pie): Remove.
13507 * options.cc (General_options::finalize): Reject incompatible uses
13508 of -pie.
13509 * gold.cc (queue_middle_tasks): A -pie link is not static.
13510 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13511 * symtab.cc (Symbol::final_value_is_known): Return false if
13512 output_is_position_independent.
13513 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13514 output_is_position_independent.
13515 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13516 output_is_position_independent.
13517 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13518 output_is_position_independent.
13519 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13520 two_file_pie_test.
13521 (basic_pie_test.o, basic_pie_test): New targets.
13522 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13523 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13524 (two_file_pie_test): New target.
13525 * testsuite/Makefile.in: Rebuild.
13526 * README: Remove note saying that -pie is not supported.
13527
13528 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13529
13530 * options.h (class General_options): Add -init and -fini.
13531 * layout.cc (Layout::finish_dynamic_section): Emit
13532 given init and fini functions.
13533
13534 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13535
13536 * gc.h (gc_process_relocs): Check if icf is enabled using new
13537 function.
13538 * gold.cc (queue_initial_tasks): Likewise.
13539 (queue_middle_tasks): Likewise.
13540 * object.cc (do_layout): Likewise.
13541 * symtab.cc (is_section_folded): Likewise.
13542 * main.cc (main): Likewise.
13543 * reloc.cc (Read_relocs::run): Likewise.
13544 (Sized_relobj::do_scan_relocs): Likewise.
13545 * icf.cc (is_function_ctor_or_dtor): New function.
13546 (Icf::find_identical_sections): Check if function is ctor or dtor when
13547 safe icf is chosen.
13548 * options.h (General_options::icf): Change option to be an enum.
13549 (Icf_status): New enum.
13550 (icf_enabled): New method.
13551 (icf_safe_folding): New method.
13552 (set_icf_status): New method.
13553 (icf_status_): New variable.
13554 * (options.cc) (General_options::finalize): Set icf_status_.
13555 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13556 icf_test and icf_keep_unique_test to use the --icf enum flag.
13557 * testsuite/icf_safe_test.sh: New file.
13558 * testsuite/icf_safe_test.cc: New file.
13559
13560 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13561
13562 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13563 includes to gc.h and icf.h.
13564 * arm.cc: Include gc.h.
13565 * gold.cc: Likewise.
13566 * i386.cc: Likewise.
13567 * powerpc.cc: Likewise.
13568 * sparc.cc: Likewise.
13569 * x86_64.cc: Likewise.
13570 * gc.h: Include icf.h.
13571
13572 2009-10-11 Ian Lance Taylor <iant@google.com>
13573
13574 * plugin.cc: Include "gold.h" before other header files.
13575
13576 2009-10-10 Chris Demetriou <cgd@google.com>
13577
13578 * options.h (Input_file_argument::Input_file_type): New enum.
13579 (Input_file_argument::is_lib_): Replace with...
13580 (Input_file_argument::type_): New member.
13581 (Input_file_argument::Input_file_argument): Take Input_file_type
13582 'type' rather than boolean 'is_lib' as second argument.
13583 (Input_file_argument::is_lib): Use type_.
13584 (Input_file_argument::is_searched_file): New function.
13585 (Input_file_argument::may_need_search): Handle is_searched_file.
13586 * options.cc (General_options::parse_library): Support -l:filename.
13587 (General_options::parse_just_symbols): Update for Input_file_argument
13588 changes.
13589 (Command_line::process): Likewise.
13590 * archive.cc (Archive::get_file_and_offset): Likewise.
13591 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13592 * script.cc (read_script_file, script_add_file): Likewise.
13593 * fileread.cc (Input_file::Input_file): Likewise.
13594 (Input_file::will_search_for): Handle is_searched_file.
13595 (Input_file::open): Likewise.
13596 * readsyms.cc (Read_symbols::get_name): Likewise.
13597 * testsuite/Makefile.am (searched_file_test): New test.
13598 * testsuite/Makefile.in: Regenerate.
13599 * testsuite/searched_file_test.cc: New file.
13600 * testsuite/searched_file_test_lib.cc: New file.
13601
13602 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13603 Ian Lance Taylor <iant@google.com>
13604
13605 * descriptor.cc: Include <cstdio> and "binary-io.h".
13606 (Descriptors::open): Open the files in binary mode always.
13607 * script.cc (Lex::get_token): Treat \r as whitespace.
13608
13609 2009-10-09 Ian Lance Taylor <iant@google.com>
13610
13611 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13612
13613 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13614 Ian Lance Taylor <iant@google.com>
13615
13616 * configure.ac: Check for readv function also.
13617 * fileread.cc (readv): Define if not HAVE_READV.
13618 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13619 does not exist.
13620 * config.in: Regenerate.
13621 * configure: Regenerate.
13622
13623 2009-10-09 Doug Kwan <dougkwan@google.com>
13624
13625 * layout.cc (Layout::make_output_section): Call target hook to make
13626 ordinary output section.
13627 (Layout::finalize): Adjust parameter list of call the
13628 Target::may_relax().
13629 * layout.h (class Layout::section_list): New method.
13630 * merge.h (Output_merge_base::entsize): Change visibility to public.
13631 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13632 New methods.
13633 (Output_merge_string::do_is_string): New method.
13634 * object.cc (Sized_relobj::do_setup): renamed from
13635 Sized_relobj::set_up.
13636 * object.h (Sized_relobj::adjust_shndx,
13637 Sized_relobj::initializ_input_to_output_maps,
13638 Sized_relobj::free_input_to_output_maps): Change visibilities to
13639 protected.
13640 (Sized_relobj::setup): Virtualize.
13641 (Sized_relobj::do_setup): New method declaration.
13642 (Sized_relobj::invalidate_section_offset,
13643 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13644 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13645 * options.cc (parse_int): New function.
13646 * options.h (parse_int): New declaration.
13647 (DEFINE_int): New macro.
13648 (stub_group_size): New option.
13649 * output.cc (Output_section::Output_section): Initialize memebers
13650 merge_section_map_, merge_section_by_properties_map_,
13651 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13652 (Output_section::add_input_section): Handled deferred code-fill
13653 generation and remove an old comment.
13654 (Output_section::add_relaxed_input_section): New method definition.
13655 (Output_section::add_merge_input_section): Use merge section by
13656 properties map to speed to search. Update merge section maps
13657 as appropriate.
13658 (Output_section::build_relaxation_map): New method definition.
13659 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13660 Same.
13661 (Output_section::relax_input_section): Renamed to
13662 Output_section::convert_input_sections_to_relaxed_sections and change
13663 interface to take a vector of pointers to relaxed sections.
13664 (Output_section::find_merge_section,
13665 Output_section::find_relaxed_input_section): New method definitions.
13666 (Output_section::is_input_address_mapped,
13667 Output_section::output_offset, Output_section::output_address):
13668 Use output section data maps to speed up searching.
13669 (Output_section::find_starting_output_address): Add comments.
13670 (Output_section::do_write,
13671 Output_section::write_to_postprocessing_buffer): Do code-fill
13672 generation as appropriate.
13673 (Output_section::get_input_sections): Invalidate relaxed input section
13674 map.
13675 (Output_section::restore_states): Adjust type of checkpoint .
13676 Invalidate relaxed input section map.
13677 * output.h (Output_merge_base): New class declaration.
13678 (Input_section_specifier): New class defintion.
13679 (class Output_relaxed_input_section) Change base class to
13680 Output_section_data_build.
13681 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13682 base class initializer.
13683 (Output_section::add_relaxed_input_section): New method declaration.
13684 (Output_section::Input_section): Change visibility to protected.
13685 (Output_section::Input_section::relobj,
13686 Output_section::Input_section::shndx): Handle relaxed input sections.
13687 Output_section::input_sections) Change visibility to protected. Also
13688 define overload to return a non-const pointer.
13689 (Output_section::Merge_section_properties): New class defintion.
13690 (Output_section::Merge_section_by_properties_map,
13691 Output_section::Output_section_data_by_input_section_map,
13692 Output_section::Relaxation_map): New types.
13693 (Output_section::relax_input_section): Rename method to
13694 Output_section::convert_input_sections_to_relaxed_sections and change
13695 interface to take a vector of relaxed section pointers.
13696 (Output_section::find_merge_section,
13697 Output_section::find_relaxed_input_section,
13698 Output_section::build_relaxation_map,
13699 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13700 New method declarations.
13701 (Output_section::merge_section_map_
13702 Output_section::merge_section_by_properties_map_,
13703 Output_section::relaxed_input_section_map_,
13704 Output_section::is_relaxed_input_section_map_valid_,
13705 Output_section::generate_code_fills_at_write_): New data members.
13706 * script-sections.cc
13707 (Output_section_element_input::set_section_addresses): Call
13708 current_data_size and addralign methods of relaxed input sections.
13709 (Orphan_output_section::set_section_addresses): Call current_data_size
13710 and addralign methods of relaxed input sections.
13711 * symtab.cc (Symbol_table::compute_final_value): Extract template
13712 from the body of Symbol_table::sized_finalize_symbol.
13713 (Symbol_table::sized_finalized_symbol): Call
13714 Symbol_table::compute_final_value.
13715 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13716 (Symbol_table::compute_final_value): New templated method declaration.
13717 * target.cc (Target::do_make_output_section): New method defintion.
13718 * target.h (Target::make_output_section): New method declaration.
13719 (Target::relax): Add more parameters for input objects, symbol table
13720 and layout. Adjust call to do_relax.
13721 (Target::do_make_output_section): New method declaration.
13722 (Target::do_relax): Add parameters for input objects, symbol table
13723 and layout.
13724
13725 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13726
13727 * pread.c: Include stdio.h.
13728
13729 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13730
13731 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13732 defined.
13733
13734 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13735
13736 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13737 Change read_shndx type to unsigned int.
13738 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13739 int.
13740 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13741 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13742 Change read_shndx type to unsigned int.
13743 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13744 int.
13745 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13746 * layout.cc (Layout::create_symtab_sections): Cast the result of
13747 local_symcount * symsize to off_t in the gold_assert.
13748
13749 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13750
13751 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13752 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13753 R_ARM_BASE_ABS.
13754 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13755 (Arm_relocate_functions::thm_abs5): New function.
13756 (Arm_relocate_functions::abs12): New function.
13757 (Arm_relocate_functions::abs16): New function.
13758 (Arm_relocate_functions::base_abs): New function.
13759 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13760 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13761 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13762 R_ARM_BASE_ABS.
13763 (Scan::global): Likewise.
13764 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13765 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13766 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13767 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13768 R_ARM_BASE_ABS.
13769
13770 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13771
13772 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13773 (Arm_relocate_functions::movt_prel): New function.
13774 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13775 (Arm_relocate_functions::thm_movt_prel): New function.
13776 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13777 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13778 (Scan::global, Relocate::relocate): Likewise.
13779 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13780
13781 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13782
13783 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13784 Incremental_checker.
13785 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13786 unsigned int.
13787 (class Incremental_inputs_header): New class.
13788 (Incremental_inputs_header_writer): Edit comment.
13789 (Incremental_inputs_entry): New class.
13790 (Incremental_inputs_entry_writer): Edit comment.
13791 (Sized_incremental_binary::do_find_incremental_inputs_section):
13792 Add *strtab_shndx parameter, fill it.
13793 (Sized_incremental_binary::do_check_inputs): New method.
13794 (Incremental_checker::can_incrementally_link_output_file): Use
13795 Sized_incremental_binary::check_inputs.
13796 (Incremental_inputs::report_command_line): Save command line in
13797 command_line_.
13798 * incremental.h:
13799 (Incremental_binary::find_incremental_inputs_section): New
13800 method.
13801 (Incremental_binary::do_find_incremental_inputs_section): Add
13802 strtab_shndx parameter.
13803 (Incremental_binary::do_check_inputs): New pure virtual method.
13804 (Sized_incremental_binary::do_check_inputs): Declare.
13805 (Incremental_checker::Incremental_checker): Add incremental_inputs
13806 parameter, use it to initialize incremental_inputs_.
13807 (Incremental_checker::incremental_inputs_): New field.
13808 (Incremental_checker::command_line): New method.
13809 (Incremental_checker::inputs): New method.
13810 (Incremental_checker::command_line_): New field.
13811
13812 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13813
13814 * incremental.cc: Include <cstdarg> and "target-select.h".
13815 (vexplain_no_incremental): New function.
13816 (explain_no_incremental): New function.
13817 (Incremental_binary::error): New method.
13818 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13819 method.
13820 (make_sized_incremental_binary): New function.
13821 (open_incremental_binary): New function.
13822 (can_incrementally_link_file): Add checks if output is ELF and has
13823 inputs section.
13824 * incremental.h: Include "elfcpp_file.h" and "output.h".
13825 (Incremental_binary): New class.
13826 (Sized_incremental_binary): New class.
13827 (open_incremental_binary): Declare.
13828 * object.cc (is_elf_object): Use
13829 elfcpp::Elf_recognizer::is_elf_file.
13830 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13831 * output.h (Output_file::filesize): New method.
13832
13833 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13834
13835 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13836 New function.
13837 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13838 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13839 function.
13840 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13841 function.
13842 (Arm_relocate_functions::movw_abs_nc): New function.
13843 (Arm_relocate_functions::movt_abs): New function.
13844 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13845 (Arm_relocate_functions::thm_movt_abs): New function.
13846 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13847 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13848 (Scan::global): Likewise.
13849 (Relocate::relocate): Likewise.
13850 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13851
13852 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13853
13854 * arm.cc (Arm_relocate_functions::got_prel) New function.
13855 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13856 (Relocate::relocate): Likewise.
13857 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13858
13859 2009-10-06 Ian Lance Taylor <iant@google.com>
13860
13861 * options.h (class General_options): Define
13862 split_stack_adjust_size parameter.
13863 * object.h (class Object): Add uses_split_stack_ and
13864 has_no_split_stack_ fields. Add uses_split_stack and
13865 has_no_split_stack accessor functions. Declare
13866 handle_split_stack_section.
13867 (class Reloc_symbol_changes): Define.
13868 (class Sized_relobj): Define Function_offsets. Declare
13869 split_stack_adjust, split_stack_adjust_reltype, and
13870 find_functions.
13871 * object.cc (Object::handle_split_stack_section): New function.
13872 (Sized_relobj::do_layout): Call handle_split_stack_section.
13873 * dynobj.cc (Sized_dynobj::do_layout): Call
13874 handle_split_stack_section.
13875 * reloc.cc (Sized_relobj::relocate_sections): Call
13876 split_stack_adjust for executable sections in split_stack
13877 objects. Pass reloc_map to relocate_section.
13878 (Sized_relobj::split_stack_adjust): New function.
13879 (Sized_relobj::split_stack_adjust_reltype): New function.
13880 (Sized_relobj::find_functions): New function.
13881 * target-reloc.h: Include "object.h".
13882 (relocate_section): Add reloc_symbol_changes parameter. Change
13883 all callers.
13884 * target.h (class Target): Add calls_non_split method. Declare
13885 do_calls_non_split virtual method. Declare match_view and
13886 set_view_to_nop.
13887 * target.cc: Include "elfcpp.h".
13888 (Target::do_calls_non_split): New function.
13889 (Target::match_view): New function.
13890 (Target::set_view_to_nop): New function.
13891 * gold.cc (queue_middle_tasks): Give an error if mixing
13892 split-stack and non-split-stack objects with -r.
13893 * i386.cc (Target_i386::relocate_section): Add
13894 reloc_symbol_changes parameter.
13895 (Target_i386::do_calls_non_split): New function.
13896 * x86_64.cc (Target_x86_64::relocate_section): Add
13897 reloc_symbol_changes parameter.
13898 (Target_x86_64::do_calls_non_split): New function.
13899 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13900 parameter.
13901 * powerpc.cc (Target_powerpc::relocate_section): Add
13902 reloc_symbol_changes parameter.
13903 * sparc.cc (Target_sparc::relocate_section): Add
13904 reloc_symbol_changes parameter.
13905 * configure.ac: Call AM_CONDITIONAL for the default target.
13906 * configure: Rebuild.
13907 * testsuite/Makefile.am (TEST_AS): New variable.
13908 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13909 (check_DATA): Add split_i386 and split_x86_64 files.
13910 (SPLIT_DEFSYMS): Define.
13911 (split_i386_[1234n].o): New targets.
13912 (split_i386_[124]): New targets.
13913 (split_i386_[1234r].stdout): New targets.
13914 (split_x86_64_[1234n].o): New targets.
13915 (split_x86_64_[124]): New targets.
13916 (split_x86_64_[1234r].stdout): New targets.
13917 (MOSTLYCLEANFILES): Add new executables.
13918 * testsuite/split_i386.sh: New file.
13919 * testsuite/split_x86_64.sh: New file.
13920 * testsuite/split_i386_1.s: New file.
13921 * testsuite/split_i386_2.s: New file.
13922 * testsuite/split_i386_3.s: New file.
13923 * testsuite/split_i386_4.s: New file.
13924 * testsuite/split_i386_n.s: New file.
13925 * testsuite/split_x86_64_1.s: New file.
13926 * testsuite/split_x86_64_2.s: New file.
13927 * testsuite/split_x86_64_3.s: New file.
13928 * testsuite/split_x86_64_4.s: New file.
13929 * testsuite/split_x86_64_n.s: New file.
13930 * testsuite/testfile.cc (Target_test): Update relocation_section
13931 function.
13932 * testsuite/Makefile.in: Rebuild.
13933
13934 2009-10-06 Ian Lance Taylor <iant@google.com>
13935
13936 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13937 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13938 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13939 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13940 the address on ldo_addrs_.
13941 (Target_i386::Relocate::fix_up_ldo): New function.
13942
13943 2009-10-06 Rafael Espindola <espindola@google.com>
13944
13945 * plugin.cc (add_input_library): New.
13946 (Plugin::load): Add add_input_library to tv.
13947 (Plugin_manager::add_input_file): Add the is_lib argument.
13948 (add_input_file): Update call to Plugin_manager::add_input_file.
13949 (add_input_library): New.
13950 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13951
13952 2009-09-30 Doug Kwan <dougkwan@google.com>
13953
13954 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13955 symbol and call Symbol::may_need_copy_reloc to determine if
13956 a copy reloc is needed.
13957 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13958 nocopyreloc is given in command line.
13959 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13960 given in command line.
13961 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13962 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13963 of the removed Target_i386::may_need_copy_reloc.
13964 * options.h (copyreloc): New option with default value false.
13965 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13966 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13967 instead of the removed Target_powerpc::may_need_copy_reloc.
13968 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13969 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13970 instead of the removed Target_sparc::may_need_copy_reloc.
13971 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13972 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13973 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13974 instead of the removed Target_x86_64::may_need_copy_reloc.
13975
13976 2009-09-30 Ian Lance Taylor <iant@google.com>
13977
13978 * object.h (class Object): Remove target_ field, and target,
13979 sized_target, and set_target methods.
13980 (Object::sized_target): Remove.
13981 (class Sized_relobj): Update declarations. Remove sized_target.
13982 * object.cc (Sized_relobj::setup): Remove target parameter.
13983 Change all callers.
13984 (Input_objects::add_object): Don't do anything with the target.
13985 (make_elf_sized_object): Add punconfigured parameter. Change all
13986 callers. Set or test parameter target.
13987 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13988 Change all callers.
13989 * parameters.cc (Parameters::set_target): Change parameter type to
13990 be non-const.
13991 (Parameters::default_target): Remove.
13992 (set_parameters_target): Change parameter type to be non-const.
13993 (parameters_force_valid_target): New function.
13994 (parameters_clear_target): New function.
13995 * parameters.h (class Parameters): Update declarations. Remove
13996 default_target method. Add sized_target and clear_target
13997 methods. Change target_ to be non-const.
13998 (set_parameters_target): Update declaration.
13999 (parameters_force_valid_target): Declare.
14000 (parameters_clear_target): Declare.
14001 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
14002 as NULL if we aren't searching.
14003 (Add_symbols::run): Don't check for compatible target.
14004 * fileread.cc (Input_file::open_binary): Call
14005 parameters_force_valid_target.
14006 * gold.cc (queue_middle_tasks): Likewise.
14007 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
14008 set_target on object.
14009 * dynobj.h (class Sized_dynobj): Update declarations.
14010 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
14011 make_elf_object returns NULL.
14012 (Archive::include_member): Don't check whether object target is
14013 compatible.
14014 * output.cc (Output_section::add_input_section): Get target from
14015 parameters.
14016 (Output_section::relax_input_section): Likewise.
14017 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
14018 parameters.
14019 (Sized_relobj::do_scan_relocs): Likewise.
14020 (Sized_relobj::relocate_sections): Likewise.
14021 * resolve.cc (Symbol_table::resolve): Likewise.
14022 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
14023 parameter. Change all callers.
14024 (Symbol_table::add_from_object): Get target from parameters.
14025 (Symbol_table::add_from_relobj): Don't check object target.
14026 (Symbol_table::add_from_dynobj): Likewise.
14027 (Symbol_table::define_special_symbol): Get target from
14028 parameters.
14029 * symtab.h (class Symbol_table): Update declaration.
14030 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
14031 parameter. Change all callers. Clear parameter target.
14032 (Binary_test): Test target here.
14033 * testsuite/object_unittest.cc (gold_testsuite): Remove
14034 target_test_pointer parameter. Change all callers.
14035 (Object_test): Test target here.
14036
14037 2009-09-26 Ian Lance Taylor <iant@google.com>
14038
14039 * testsuite/initpri1.c: Don't try to use constructor priorities if
14040 compiling with gcc before 4.3.
14041
14042 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
14043
14044 * testsuite/retain_symbols_file_test.sh (check_present): Change
14045 output file name to retain_symbols_file_test.stdout.
14046 (check_absent): Likewise.
14047
14048 2009-09-18 Craig Silverstein <csilvers@google.com>
14049
14050 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
14051 * options.cc: Include <cerrno> and <fstream>.
14052 (General_options::finalize): Parse -retain-symbols-file tag.
14053 * options.h: New flag.
14054 (General_options): New method should_retain_symbol, new
14055 variable symbols_to_retain.
14056 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
14057 should_retain_symbol map.
14058 * testsuite/Makefile.am (retain_symbols_file_test): New test.
14059 * testsuite/Makefile.in: Regenerate.
14060 * testsuite/retain_symbols_file_test.sh: New file.
14061
14062 2009-09-18 Nick Clifton <nickc@redhat.com>
14063
14064 * po/es.po: Updated Spanish translation.
14065
14066 2009-09-17 Doug Kwan <dougkwan@google.com>
14067
14068 * debug.h (DEBUG_RELAXATION): New constant.
14069 (DEBUG_ALL): Add DEBUG_RELAXATION.
14070 (debug_string_to_enum): Add relaxation debug option.
14071 * layout.cc
14072 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
14073 Layout::Relaxation_debug_check::read_sections,
14074 Layout::Relaxation_debug_check::read_sections): New method definitions.
14075 (Layout::Layout): Initialize data members
14076 record_output_section_data_from_scrips_,
14077 script_output_section_data_list_ and relaxation_debug_check_.
14078 (Layout::save_segments, Layout::restore_segments,
14079 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14080 Layout::relaxation_loop_body): New method definitions.
14081 (Layout::finalize): Support relaxation. Move section layout code to
14082 Layout::relaxation_loop_body.
14083 (Layout::set_asection_address_from_script): Move code for orphan
14084 section placement out.
14085 (Layout::place_orphan_sections_in_script): New method definition.
14086 * layout.h (Output_segment_headers, Output_file_header):
14087 New forward class declarations.
14088 (Layout::~Layout): Define.
14089 (Layout::new_output_section_data_from_script): New method definition.
14090 (Layout::place_orphan_sections_in_script): New method declaration.
14091 (Layout::Segment_states): New type declaration.
14092 (Layout::save_segments, Layout::restore_segments,
14093 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
14094 Layout::relaxation_loop_body): New method declarations.
14095 (Layout::Output_section_data_list): New type declaration.
14096 (Layout::Relaxation_debug_check): New class definition.
14097 (Layout::record_output_section_data_from_script_,
14098 Layout::script_output_section_data_list_, Layout::segment_states_,
14099 Layout::relaxation_debug_check_): New data members.
14100 * output.cc: (Output_section_headers::do_size): New method definition.
14101 (Output_section_headers::Output_section_headers): Move size
14102 computation to Output_section_headers::do_size.
14103 (Output_segment_headers::do_size): New method definition.
14104 (Output_file_header::Output_file_header): Move size computation to
14105 Output_file_header::do_size and call it.
14106 (Output_file_header::do_size): New method definition.
14107 (Output_data_group::Output_data_group): Adjust call to
14108 Output_section_data.
14109 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
14110 (Output_symtab_xindex::do_write): Add array bound check.
14111 (Output_section::Input_section::print_to_mapfile): Handle
14112 RELAXED_INPUT_SECTION_CODE.
14113 (Output_section::Output_section): Initialize data member checkpoint_.
14114 (Output_section::~Output_section): Delete checkpoint object pointed
14115 by checkpoint_.
14116 (Output_section::add_input_section): Always add an Input_section if
14117 relaxing.
14118 (Output_section::add_merge_input_section): Add assert.
14119 (Output_section::relax_input_section): New method definition.
14120 (Output_section::set_final_data_size): Set load address to zero for
14121 an unallocated section.
14122 (Output_section::do_address_and_file_offset_have_reset_values):
14123 New method definition.
14124 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
14125 Handle relaxed input section.
14126 (Output_section::sort_attached_input_sections): Checkpoint input
14127 section list lazily.
14128 (Output_section::get_input_sections): Change type of input_sections to
14129 list of Simple_input_section pointers. Checkpoint input section list
14130 lazily. Also handle relaxed input sections.
14131 (Output_section::add_input_section_for_script): Take a reference to
14132 a Simple_input_section object instead of Relobj pointer and section
14133 index as parameter. Handle relaxed input sections.
14134 (Output_section::save_states, Output_section::restore_states): New
14135 method definitions.
14136 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14137 (Output_data::is_data_size_fixed): New method definition.
14138 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14139 if it is fixed.
14140 (Output_data::address_and_file_offset_have_reset_values): New method
14141 definition.
14142 (Output_data::do_address_and_file_offset_have_reset_values): New method
14143 definition.
14144 (Output_data::set_data_size): Check that data size is not fixed.
14145 (Output_data::fix_data_size): New method definition.
14146 (Output_data::is_data_size_fixed_): New data member.
14147 (Output_section_headers::set_final_data_size): New method definition.
14148 (Output_section_headers::do_size): New method declaration.
14149 (Output_segment_headers::set_final_data_size): New method definition.
14150 (Output_segment_headers::do_size): New method declaration.
14151 (Output_file_header::set_final_data_size)::New method definition.
14152 (Output_file_header::do_size)::New method declaration.
14153 (Output_section_data::Output_section_data): Add new parameter
14154 is_data_size_fixed and use it to fix data size.
14155 (Output_data_const::Output_data_const): Adjust call to base class
14156 constructor and fix data size.
14157 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14158 base class constructor and fix data size.
14159 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14160 base class constructor and fix data size.
14161 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14162 class constructor and fix data size.
14163 (Output_data_group::set_final_data_size): New method definition.
14164 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14165 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14166 class constructor and fix data size.
14167 (Output_relaxed_input_section): New class definition.
14168 (Output_section::Simple_input_section): New class definition.
14169 (Output_section::get_input_sections): Adjust parameter list.
14170 (Output_section::add_input_section_for_script): Same.
14171 (Output_section::save_states, Output_section::restore_states,
14172 Output_section::do_address_and_file_offset_have_reset_values,
14173 (Output_section::Input_section::Input_section): Handle
14174 RELAXED_INPUT_SECTION_CODE. Add new overload for
14175 Output_relaxed_input_section.
14176 (Output_section::Input_section::is_input_section,
14177 Output_section::Input_section::set_output_section): Handle relaxed
14178 input section.
14179 (Output_section::Input_section::is_relaxed_input_section,
14180 Output_section::Input_section::output_section_data,
14181 Output_section::Input_section::relaxed_input_section): New method
14182 definitions.
14183 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14184 value.
14185 (Output_section::Input_section::u1_): Update comments.
14186 (Output_section::Input_section::u2_): Add new union member poris.
14187 (Output_section::Checkpoint_output_section): New classs definition.
14188 (Output_section::relax_input_section): New method declaration.
14189 (Output_section::checkpoint_): New data member.
14190 (Output_segment): Update comments.
14191 (Output_segment::Output_segment): Un-privatize copy constructor.
14192 (Output_segment::operator=): Un-privatize.
14193 * script-sections.cc (Output_section_element::Input_section_list):
14194 Change element type to Output_section::Simple_input_section.
14195 (Output_section_element_dot_assignment::set_section_addresses):
14196 Register output section data for relaxation clean up.
14197 (Output_data_exression::Output_data_expression): Adjust call to base
14198 constructor to fix data size.
14199 (Output_section_element_data::set_section_addresses): Register
14200 Output_data_expression object for relaxation clean up.
14201 (struct Input_section_info): Replace Relobj pointer and section index
14202 pair with Output_section::Simple_input_section and Convert struct to a
14203 class.
14204 (Input_section_sorter::operator()): Adjust access to
14205 Input_section_info data member to use accessors.
14206 (Output_section_element_input::set_section_addresses): Use layout
14207 parameter. Adjust code to use Output_section::Simple_input_section
14208 and Input_secction_info classes. Register filler for relaxation
14209 clean up.
14210 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14211 and section index pair with Output_section::Simple_input_section
14212 class. Adjust code accordingly.
14213 (Phdrs_element::release_segment): New method definition.
14214 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14215 segment list.
14216 (Script_sections::release_segments): New method definition.
14217 * gold/script-sections.h (Script_sections::release_segments): New
14218 method declaration.
14219 * gold/target.h (Target::may_relax, Target::relax,
14220 Target::do_may_relax, Target::do_relax): New method definitions.
14221
14222 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14223
14224 * arm.cc (has_signed_unsigned_overflow): New function.
14225 (Arm_relocate_functions::abs8): New function.
14226 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14227 (Target_arm::Scan::global): Likewise.
14228 (Target_arm::relocate::relocate): Likewise.
14229 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14230 Likewise.
14231
14232 2009-09-16 Cary Coutant <ccoutant@google.com>
14233
14234 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14235 * testsuite/Makefile.in: Regenerate.
14236
14237 2009-09-11 Nick Clifton <nickc@redhat.com>
14238
14239 * po/gold.pot: Updated by the Translation project.
14240
14241 2009-09-08 Cary Coutant <ccoutant@google.com>
14242
14243 * output.cc (Output_file::open): Add execute permission to empty file.
14244 * testsuite/Makefile.am (permission_test): New test.
14245 * testsuite/Makefile.in: Regenerate.
14246
14247 2009-09-02 Ian Lance Taylor <iant@google.com>
14248
14249 * output.cc (Output_file::resize): Call map_no_anonymous rather
14250 than map.
14251
14252 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14253
14254 * gold.cc: Include "incremental.h".
14255 (queue_initial_tasks): Call Incremental_checker methods.
14256 * incremental.cc: Include "output.h".
14257 (Incremental_checker::can_incrementally_link_output_file): New
14258 method.
14259 * incremental.h (Incremental_checker): New class.
14260
14261 * output.cc (Output_file::open_for_modification): New method.
14262 (Output_file::map_anonymous): Changed return type to bool. Record
14263 map in base_ field.
14264 (Output_file::map_no_anonymous): New method, broken out of map.
14265 (Output_file::map): Use map_no_anonymous and map_anonymous.
14266 * output.h (class Output_file): Update declarations.
14267
14268 2009-08-24 Cary Coutant <ccoutant@google.com>
14269
14270 * options.h (Command_line::Pre_options): New class.
14271 (Command_line::pre_options): New member.
14272 * options.cc (gold::options::ready_to_register): New variable.
14273 (One_option::register_option): Do nothing if not registering options.
14274 Assert if same short option registered twice.
14275 (General_options::General_options): Turn off option registration when
14276 done constructing.
14277 (Command_line::Pre_options::Pre_options): New constructor.
14278
14279 2009-08-24 Cary Coutant <ccoutant@google.com>
14280
14281 * options.h (General_options::no_keep_memory): Remove incorrect
14282 short option.
14283
14284 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14285
14286 * Makefile.am (am__skiplex, am__skipyacc): New.
14287 * Makefile.in: Regenerate.
14288
14289 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14290
14291 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14292 (INCLUDES): ... this.
14293 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14294 (AM_CPPFLAGS): Renamed from ...
14295 (INCLUDE): ... this.
14296 * Makefile.in, testsuite/Makefile.in: Regenerate.
14297
14298 * Makefile.in: Regenerate.
14299 * aclocal.m4: Likewise.
14300 * config.in: Likewise.
14301 * configure: Likewise.
14302 * testsuite/Makefile.in: Likewise.
14303
14304 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14305 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14306 * Makefile.in: Regenerate.
14307 * testsuite/Makefile.in: Regenerate.
14308
14309 2009-08-19 Cary Coutant <ccoutant@google.com>
14310
14311 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14312 symbols in shared libraries overridden by hidden or internal symbols
14313 in the main program.
14314
14315 2009-08-19 Chris Demetriou <cgd@google.com>
14316
14317 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14318 checking source file names in error messages.
14319
14320 2009-08-18 Doug Kwan <dougkwan@google.com>
14321
14322 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14323 an elcpp::Ehdr as parameter. Adjust call to set_target.
14324 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14325 an elfcpp::Ehdr as parameter.
14326 * object.cc (Object::set_target): Remove the version that looks up
14327 a target and sets it.
14328 (Sized_relobj::setup): Take a Target object instead of
14329 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14330 (make_elf_sized_object): Find target and ask target to
14331 make an ELF object.
14332 * object.h: (Object::set_target): Remove the version that looks up
14333 a target and sets it.
14334 (Sized_relobj::setup): Take a Target object instead of
14335 an elfcpp:Ehdr as parameter.
14336 * target.cc: Include dynobj.h.
14337 (Target::do_make_elf_object_implementation): New.
14338 (Target::do_make_elf_object): New.
14339 * target.h (Target::make_elf_object): New template declaration.
14340 (Target::do_make_elf_object): New method declarations.
14341 (Target::do_make_elf_object_implementation): New template declaration.
14342
14343 2009-08-14 Ian Lance Taylor <iant@google.com>
14344
14345 * gold.h (FUNCTION_NAME): Define.
14346 (gold_unreachable): Use FUNCTION_NAME.
14347
14348 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14349
14350 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14351 symbol in the --keep-unique list is not found.
14352
14353 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14354
14355 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14356 been maked as --keep-unique.
14357 (Icf::unfold_section): New function.
14358 * icf.h (Icf::unfold_section): New function.
14359 * options.h (General_options::keep_unique): New option.
14360 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14361 * testsuite/Makefile.in: Regenerate.
14362 * testsuite/icf_keep_unique_test.sh: New file.
14363 * testsuite/icf_keep_unique_test.cc: New file.
14364
14365 2009-08-12 Cary Coutant <ccoutant@google.com>
14366
14367 PR 10471
14368 * resolve.cc (Symbol_table::resolve): Check for references from
14369 dynamic objects to hidden and internal symbols.
14370 * testsuite/Makefile.am (hidden_test.sh): New test.
14371 * testsuite/Makefile.in: Regenerate.
14372 * testsuite/hidden_test.sh: New script.
14373 * testsuite/hidden_test_1.c: New test source.
14374 * testsuite/hidden_test_main.c: New test source.
14375
14376 2009-08-11 Doug Kwan <dougkwan@google.com>
14377
14378 * arm.cc: Update comments.
14379 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14380 segment to locate the .ARM.exidx section if present.
14381
14382 2009-08-09 Doug Kwan <dougkwan@google.com>
14383
14384 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14385 patch.
14386
14387 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14388 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14389 compiler warnings.
14390
14391 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14392
14393 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14394 valid tls_segment only for non-debug-section relocations.
14395 * testsuite/Makefile.am: Add gc_tls_test.
14396 * testsuite/Makefile.in: Regenerate.
14397 * testsuite/gc_tls_test.cc: New file.
14398 * testsuite/gc_tls_test.sh: New file.
14399
14400 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14401
14402 * icf.cc: New file.
14403 * icf.h: New file.
14404 * Makefile.am (CCFILES): Add icf.cc.
14405 (HFILES): Add icf.h
14406 * Makefile.in: Regenerate.
14407 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14408 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14409 section, symbol and addend information for the relocs.
14410 * gold.cc (queue_middle_tasks): Call identical code folding.
14411 * gold.h: Add defines for multimap.
14412 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14413 to the call of finalize_local_symbols.
14414 * main.cc (main): Create object of class Icf.
14415 * object.cc (Sized_relobj::do_layout): Allow this function to be
14416 called twice during icf.
14417 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14418 to sections marked as identical by icf.
14419 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14420 when available.
14421 (Sized_relobj::do_section_entsize): New function.
14422 * object.h (Object::section_entsize): New function.
14423 (Object::do_section_entsize): New pure virtual function.
14424 (Relobj::finalize_local_symbols): Add new parameter.
14425 (Relobj::do_section_entsize): New function.
14426 * options.h (General_options::icf): New option.
14427 (General_options::icf_iterations): New option.
14428 (General_options::print_icf_sections): New option.
14429 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14430 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14431 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14432 icf.
14433 * symtab.cc (Symbol_table::is_section_folded): New function.
14434 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14435 to sections marked as identical by icf.
14436 * symtab.h (Symbol_table::set_icf): New function.
14437 (Symbol_table::icf): New function.
14438 (Symbol_table::is_section_folded): New function.
14439 (Symbol_table::icf_): New data member.
14440 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14441 * testsuite/Makefile.am: Add commands to build icf_test.
14442 * testsuite/Makefile.in: Regenerate.
14443 * testsuite/icf_test.sh: New file.
14444 * testsuite/icf_test.cc: New file.
14445
14446 2009-07-24 Chris Demetriou <cgd@google.com>
14447
14448 * layout.cc (is_compressible_debug_section): Fix incorrect
14449 comment about compressed section names.
14450
14451 2009-07-20 Ian Lance Taylor <ian@airs.com>
14452
14453 PR 10419
14454 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14455
14456 2009-07-16 Ian Lance Taylor <iant@google.com>
14457
14458 PR 10400
14459 * layout.h: #include <map>.
14460 (class Kept_section): Change from struct to class. Add accessors
14461 and setters. Add section size to Comdat_group mapping. Change
14462 Comdat_group to std::map. Add is_comdat_ field. Add
14463 linkonce_size field in union.
14464 (class Layout): Update declaration of find_or_add_kept_section.
14465 Don't declare find_kept_object.
14466 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14467 parameter. Add object, shndx, is_comdat, and is_group_name
14468 parameters. Change all callers. Adjust for new Kept_section.
14469 (Layout::find_kept_object): Remove.
14470 * object.cc (Sized_relobj::include_section_group): Update use of
14471 Kept_section. Rename secnum to shndx. Only record
14472 Kept_comdat_section if sections are the same size.
14473 (Sized_relobj::include_linkonce_section): Update use of
14474 Kept_section. Only record Kept_comdat_section if sections are the
14475 same size. Set size of linkonce section.
14476 (Sized_relobj::map_to_kept_section): Update call to
14477 get_kept_comdat_section.
14478 * object.h (class Sized_relobj): Rename fields in
14479 Kept_comdat_section to drop trailing underscores; change object
14480 field to Relobj*. Change Kept_comdat_section_table to store
14481 struct rather than pointer.
14482 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14483 Add kept_object and kept_shndx parameters. Change all callers.
14484 (Sized_relobj::get_kept_comdat_section): Change return type to
14485 bool. Add kept_object and kept_shndx parameters. Change all
14486 callers.
14487 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14488 Layout::find_or_add_kept_section.
14489
14490 2009-07-09 Ian Lance Taylor <iant@google.com>
14491
14492 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14493 Reserve space in the hash table.
14494
14495 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14496
14497 * fileread.cc (File_read::get_mtime): New method.
14498 * fileread.h (Timespec): New structure.
14499 (File_read::get_mtime): New method.
14500 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14501 Renamed from timestamp_nsec.
14502 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14503 Elf_Xword.
14504 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14505 timestamp_nsec.
14506 (Incremental_inputs::report_archive): Save mtime; style fix.
14507 (Incremental_inputs::report_obejct): Save mtime; style fix.
14508 (Incremental_inputs::report_script): Save mtime; style fix.
14509 (Incremental_inputs::finalize_inputs): Style fix.
14510 (Incremental_inputs::finalize): Style fix.
14511 (Incremental_inputs::create_input_section_data): Store inputs
14512 mtime.
14513 * incremental.h (Incremental_inputs::report_script): Add mtime
14514 argument.
14515 (Incremental_inputs::Input_info::Input_info): Intialize only one
14516 union member.
14517 (Incremental_inputs::Input_info::archive): Move to nameless
14518 union.
14519 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14520 (Incremental_inputs::Input_info::script): Move to nameless union.
14521 (Incremental_inputs::mtime): New field.
14522 * script.cc (read_input_script): Pass file mtime to
14523 Incremental_input.
14524 * script.h (Script_info::inputs): Style fix.
14525
14526 2009-07-01 Ian Lance Taylor <ian@airs.com>
14527
14528 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14529 instead of 32.
14530
14531 2009-06-24 Ian Lance Taylor <iant@google.com>
14532
14533 PR 10156
14534 * layout.cc (Layout::choose_output_section): If we find an
14535 existing section, update the flags.
14536 (Layout::create_notes): New function, broken out of
14537 Layout::finalize.
14538 (Layout::finalize): Don't create note sections.
14539 (Layout::create_note): Don't crash if linker script discards
14540 section.
14541 (Layout::create_gold_note): Likewise.
14542 (Layout::create_build_id): Likewise. Don't set
14543 after_input_sections on the section.
14544 (Layout::create_executable_stack_info): Remove target parameter.
14545 Change caller.
14546 * layout.h (class Layout): Declare create_notes. Update
14547 declaration of create_executable_stack_info.
14548 * gold.cc (queue_middle_tasks): Call create_notes.
14549 * output.cc (Output_section::update_flags_for_input_section): Move
14550 here from output.h. If SHF_ALLOC flag is newly set, mark address
14551 invalid.
14552 * output.h (Output_data::mark_address_invalid): New function.
14553 (class Output_section): Only declare, not define,
14554 update_flags_for_input_section. Remove set_flags.
14555
14556 2009-06-24 Ian Lance Taylor <iant@google.com>
14557
14558 * script-sections.cc (Output_section_definition::
14559 set_section_addresses): Rename shadowing local load_address to
14560 laddr.
14561
14562 2009-06-24 Ian Lance Taylor <iant@google.com>
14563
14564 PR 10244
14565 * reloc.cc (relocate_sections): Skip empty relocation sections.
14566
14567 2009-06-23 Ian Lance Taylor <iant@google.com>
14568
14569 PR 10156
14570 * layout.cc (Layout::create_note): Use choose_output_section
14571 rather than make_output_section.
14572
14573 2009-06-23 Ian Lance Taylor <iant@google.com>
14574
14575 PR 10237
14576 * options.cc (General_options::parse_V): Set printed_version_.
14577 (General_options::General_options): Initialize printed_version_.
14578 * options.h (class General_options): Add printed_version_ field.
14579 * gold.cc (queue_initial_tasks): If there are no input files,
14580 don't give a fatal error if we printed the version information.
14581 (queue_middle_tasks): If using -r with a shared object, give a
14582 fatal error rather than an ordinary error.
14583
14584 2009-06-23 Ian Lance Taylor <iant@google.com>
14585
14586 PR 10219
14587 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14588 (Layout::make_output_section): Set have_stabstr_section_ if we see
14589 a .stab*str section.
14590 (Layout::finalize): Call link_stabs_sections.
14591 (Layout::link_stabs_sections): New file.
14592 * layout.h (class Layout): Add have_stabstr_section_ field.
14593 Declare link_stabs_sections.
14594
14595 2009-06-23 Doug Kwan <dougkwan@google.com>
14596
14597 * Makefile.am (libgold_a_LIBADD): New.
14598 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14599 * Makefile.in: Regenerate.
14600 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14601 * configure: Regenerate.
14602 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14603 * fileread.cc: Include sys/state.h
14604 * gold.h: Declare memmem and strndup if found missing.
14605 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14606
14607 2009-06-23 Ian Lance Taylor <iant@google.com>
14608
14609 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14610 * configure: Rebuild.
14611
14612 2009-06-23 Ian Lance Taylor <iant@google.com>
14613
14614 PR 10147
14615 * object.cc (Object::section_contents): Don't try to get a view if
14616 the section has length zero.
14617 (Object::handle_gnu_warning_section): If the section is empty, use
14618 the name of the section as the warning.
14619
14620 2009-06-23 Ian Lance Taylor <iant@google.com>
14621
14622 PR 10133
14623 * stringpool.h (class Stringpool_template): Add optimize_ field.
14624 (Stringpool_template::set_optimize): New function.
14625 * stringpool.cc (Stringpool_template::Stringpool_template):
14626 Initialize optimize_ field.
14627 (Stringpool_template::set_string_offsets): Test local optimize
14628 fild rather than parameter.
14629 * layout.cc (Layout::Layout): Call set_optimize on the section
14630 name stringpool.
14631
14632 2009-06-22 Ian Lance Taylor <iant@google.com>
14633
14634 PR 10030
14635 * yyscript.y: Parse TARGET.
14636 * script.cc (script_set_target): New function.
14637 * script-c.h (script_set_target): Declare.
14638 * options.cc (General_options::string_to_object_format): Rename
14639 from string_to_object_format in anonymous namespace. Change
14640 callers.
14641 * options.h (class General_options): Declare
14642 string_to_object_format.
14643
14644 2009-06-22 Ian Lance Taylor <iant@google.com>
14645
14646 * script-sections.cc (Script_sections::create_segments): Don't put
14647 program headers in a PT_LOAD segment if -n or -N.
14648
14649 2009-06-22 Ian Lance Taylor <iant@google.com>
14650
14651 PR 10141
14652 * options.h (class General_options): Add -z lazy and -z now. Sort
14653 -z options into alphabetical order.
14654 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14655
14656 2009-06-21 Ian Lance Taylor <iant@google.com>
14657
14658 * layout.cc (Layout::make_output_section): Call
14659 Target::new_output_section.
14660 (Layout::attach_allocated_section_to_segment): Put large section
14661 sections in a separate load segment with the large segment flag
14662 set.
14663 (Layout::segment_precedes): Sort large data segments after other
14664 load segments.
14665 (align_file_offset): New static function.
14666 (Layout::set_segment_offsets): Use align_file_offset.
14667 * output.h (class Output_section): Add is_small_section_ and
14668 is_large_section_ fields.
14669 (Output_section::is_small_section): New function.
14670 (Output_section::set_is_small_section): New function.
14671 (Output_section::is_large_section): New function.
14672 (Output_section::set_is_large_section): New function.
14673 (Output_section::is_large_data_section): New function.
14674 (class Output_segment): Add is_large_data_segment_ field.
14675 (Output_segment::is_large_data_segment): New function.
14676 (Output_segment::set_is_large_data_segment): New function.
14677 * output.cc (Output_section::Output_section): Initialize new
14678 fields.
14679 (Output_segment::Output_segment): Likewise.
14680 (Output_segment::add_output_section): Add assertion that large
14681 data sections always go in large data segments. Force small data
14682 sections to the end of the list of data sections. Force small BSS
14683 sections to the start of the list of BSS sections. For large BSS
14684 sections to the end of the list of BSS sections.
14685 * symtab.h (class Symbol): Declare is_common_shndx.
14686 (Symbol::is_defined): Check Symbol::is_common_shndx.
14687 (Symbol::is_common): Likewise.
14688 (class Symbol_table): Define enum Commons_section_type. Update
14689 declarations. Add small_commons_ and large_commons_ fields.
14690 * symtab.cc (Symbol::is_common_shndx): New function.
14691 (Symbol_table::Symbol_table): Initialize new fields.
14692 (Symbol_table::add_from_object): Put small and large common
14693 symbols in the right list.
14694 (Symbol_table::sized_finalized_symbol): Check
14695 Symbol::is_common_shndx.
14696 (Symbol_table::sized_write_globals): Likewise.
14697 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14698 common symbol lists. Don't call do_allocate_commons_list if the
14699 list is empty.
14700 (Symbol_table::do_allocate_commons_list): Remove is_tls
14701 parameter. Add comons_section_type parameter. Change all
14702 callers. Handle small and large common symbols.
14703 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14704 Symbol::is_common_shndx.
14705 * resolve.cc (symbol_to_bits): Likewise.
14706 * target.h (Target::small_common_shndx): New function.
14707 (Target::small_common_section_flags): New function.
14708 (Target::large_common_shndx): New function.
14709 (Target::large_common_section_flags): New function.
14710 (Target::new_output_section): New function.
14711 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14712 small_common_section_flags, and large_common_section_flags
14713 fields.
14714 (Target::do_new_output_section): New virtual function.
14715 * arm.cc (Target_arm::arm_info): Initialize new fields.
14716 * i386.cc (Target_i386::i386_info): Likewise.
14717 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14718 Likewise.
14719 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14720 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14721 (Target_x86_64::do_new_output_section): New function.
14722 * configure.ac: Define conditional MCMODEL_MEDIUM.
14723 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14724 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14725 (large_LDFLAGS): Define.
14726 * testsuite/large.c: New file.
14727 * testsuite/testfile.cc (Target_test::test_target_info):
14728 Initialize new fields.
14729 * configure, testsuite/Makefile.in: Rebuild.
14730
14731 2009-06-05 Doug Kwan <dougkwan@google.com>
14732
14733 * Makefile.am (CCFILES): Add target.cc.
14734 * Makefile.in: Regenerate.
14735 * i386.cc (class Target_i386): Define new virtual method to
14736 override do_is_local_label_name in parent.
14737 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14738 local symbols if --discard-locals or -X is given.
14739 * options.h (class General_options): Declare new options
14740 '--discard-locals' and '-X' for discarding locals.
14741 * target.h (class Target): Define new methods is_local_label_name.
14742 Declare new virtual method do_is_local_label_name.
14743 * target.cc: New file.
14744 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14745 (check_SCRIPTS): Add discard_locals_test.sh.
14746 (check_DATA): Add discard_local_tests.syms.
14747 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14748 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14749 * testsuite/Makefile.in: Regenerate.
14750 * testsuite/discard_locals_test.c: New file.
14751 * testsuite/discard_locals_test.sh: Same.
14752
14753 2009-06-05 Doug Kwan <dougkwan@google.com>
14754
14755 * object.cc (Sized_relobj::Sized_relobj): Initialize
14756 discarded_eh_frame_shndx_ to -1U.
14757 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14758 section.
14759 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14760 a discarded .eh_frame section.
14761 (Sized_relobj::do_finalize_local_symbols): Ditto.
14762 * object.h (class Sized_relobj): Declare new member
14763 discarded_eh_frame_shndx_.
14764 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14765 (local_labels_test.o, local_labels_test): New rules.
14766 * testsuite/Makefile.in: Regenerate.
14767
14768 2009-06-04 Doug Kwan <dougkwan@google.com>
14769
14770 * layout.cc (Layout::section_name_mapping): Add mapping for
14771 special ARM sections.
14772
14773 2009-06-03 Doug Kwan <dougkwan@google.com>
14774
14775 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14776 (utils::has_overflow): Same.
14777
14778 2009-06-03 Ian Lance Taylor <iant@google.com>
14779
14780 * layout.cc (Layout::section_name_mapping): New array, replacing
14781 Layout::linkonce_mapping.
14782 (Layout::section_name_mapping_count): New variable, replacing
14783 Layout::linkonce_mapping_count.
14784 (Layout::linkonce_output_name): Remove.
14785 (Layout::output_section_name): Rewrite.
14786 * layout.h (class Layout): Rename Linkonce_mapping to
14787 Section_name_mapping, linkonce_mapping to section_name_mapping,
14788 linkonce_mapping_count to section_name_mapping_count. Don't
14789 declare linkonce_output_name.
14790
14791 2009-06-03 Doug Kwan <dougkwan@google.com>
14792
14793 * gold/arm.cc (namespace utils): New.
14794 (Target_arm::reloc_is_non_pic): Define new method.
14795 (class Arm_relocate_functions): New.
14796 (Target_arm::Relocate::relocate): Handle relocation types used by
14797 Android.
14798
14799 2009-06-03 Ian Lance Taylor <iant@google.com>
14800
14801 * arm.cc (Target_arm::scan::global): Use || instead of |.
14802
14803 2009-06-02 Doug Kwan <dougkwan@google.com>
14804
14805 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14806 issued_non_pic_error_.
14807 (class Target_arm::Scan): Declare new method check_non_pic.
14808 Define new method symbol_needs_plt_entry.
14809 Declare new data member issued_non_pic_error_.
14810 (class Target_arm::Relocate): Declare new method
14811 should_apply_static_reloc.
14812 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14813 (Target_arm::Scan::check_non_pic): Define new method.
14814 (Target_arm::Scan::local): Handle a small subset of reloc types used
14815 by Android.
14816 (Target_arm::Scan::local): Same.
14817 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14818
14819 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14820
14821 * incremental.cc (Incremental_inputs::report_command_line): Filter
14822 out --incremental-* options.
14823
14824 2009-05-29 Doug Kwan <dougkwan@google.com>
14825
14826 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14827 template class.
14828 (class Target_arm): Update comment.
14829 (Target_arm::Target_arm): Initialize new data members GOT_,
14830 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14831 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14832 and Target_arm::rel_dyn_section.
14833 Declare new_enum Target_arm::Got_type.
14834 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14835 and DYNBSS_.
14836 Update commments for member do_dynsym_value.
14837 (Target_arm::got_size, Target_arm::plt_section,
14838 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14839 new methods inside class defintion.
14840 (Target_arm::got_section): Define new method.
14841 (Target_arm::rel_dyn_section): Same.
14842 (Output_data_plt_arm): New template class.
14843 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14844 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14845 (Output_data_plt_arm::add_entry): Same.
14846 (Output_data_plt_arm::first_plt_entry): Define new
14847 static data member for PLT instruction template.
14848 (Output_data_plt_arm::plt_entry): Same.
14849 (Output_data_plt_arm::do_write): Define new method.
14850 (Target_arm::make_plt_entry): Same.
14851 (Target_arm::do_finalize_sections): Same.
14852 (Target_arm::do_dynsym_value): Same.
14853
14854 2009-05-28 Doug Kwan <dougkwan@google.com>
14855
14856 * Makefile.am (TARGETSOURCES): Add arm.cc.
14857 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14858 * Makefile.in: Regenerate.
14859 * arm.cc: New file.
14860 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14861
14862 2009-05-26 Doug Kwan <dougkwan@google.com>
14863
14864 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14865 (General_options::check_excluded_libs): Strip off directories in
14866 archive name before matching like GNU ld does.
14867 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14868 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14869 (exclude_libs_test_LDFLAGS): Add linker option
14870 -Wl,--exclude-libs,libexclude_libs_test_3
14871 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14872 an explicit archive without using -l.
14873 (alt/libexclude_libs_test_3.a): New make rule.
14874 * testsuite/Makefile.in: Regenerate.
14875 * testsuite/exclude_libs_test.c : Declare lib3_default().
14876 (main): Call it.
14877 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14878 * exclude_libs_test_3.c: New file.
14879
14880 2009-05-26 Nick Clifton <nickc@redhat.com>
14881
14882 * po/id.po: New Indonesian translation.
14883 * po/gold.pot: Updated template file.
14884
14885 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14886
14887 * testsuite/Makefile.am: Add -ffunction-sections to compile
14888 gc_comdat_test files. Add -Wl,--gc-sections to build
14889 gc_comdat_test.
14890 * testsuite/Makefile.in: Regenerate.
14891 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14892
14893 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14894
14895 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14896 kept comdat section was garbage collected.
14897 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14898 * testsuite/Makefile.in: Regenerate.
14899 * testsuite/gc_comdat_test.sh: New file.
14900 * testsuite/gc_comdat_test_1.cc: New file.
14901 * testsuite/gc_comdat_test_2.cc: New file.
14902
14903 2009-05-19 Doug Kwan <dougkwan@google.com>
14904
14905 * archive.cc (Archive::Archive): Move constructor from archive.h
14906 to here. Initialize no_export_.
14907 (Archive::get_elf_object_for_member): Set no_export flag of object.
14908 * archive.h (Archive::Archive): Move constructor body to
14909 archive.cc.
14910 (Archive::no_export): New method.
14911 (Archive::no_export_): New field.
14912 * object.h (Object::Object): Initialize no_export_ to false.
14913 (Object::no_export, Object::set_no_export): New methods.
14914 (Object::no_export_): New field.
14915 * options.cc (General_options::parse_exclude_libs): New method.
14916 (General_options::check_excluded_libs) Same.
14917 * options.h (exclude_libs): New option.
14918 (General_options::check_excluded_libs): New method declaration.
14919 (General_options::excluded_libs_): New field.
14920 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14921 default or protected visibility if an object has no-export flag set.
14922 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14923 (check_SCRIPTS): Add exclude_libs_test.sh.
14924 (check_DATA): Add exclude_libs_test.syms.
14925 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14926 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14927 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14928 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14929 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14930 libexclude_libs_test_2.a): New rules.
14931 * testsuite/Makefile.in: Regenerate.
14932 * testsuite/exclude_libs_test.c: New file.
14933 * testsuite/exclude_libs_test.sh: Ditto.
14934 * testsuite/exclude_libs_test_1.c: Ditto.
14935 * testsuite/exclude_libs_test_2.c: Ditto.
14936
14937 2009-05-15 Ian Lance Taylor <iant@google.com>
14938
14939 * configure.ac: Check for declarations for cases where libiberty.h
14940 checks HAVE_DECL_xxx.
14941 * configure, config.in: Rebuild.
14942
14943 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14944
14945 * gold.h (Incremental_argument_list): Remove (invalid) forward
14946 declaration.
14947 * incremental.cc (Incremental_inputs::report_achive): New method.
14948 (Incremental_inputs::report_object): New method.
14949 (Incremental_inputs::report_script): New method.
14950 (Incremental_inputs::finalize_inputs): New method.
14951 (Incremental_inputs::finalize): Call finalize_inputs().
14952 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14953 Create inputs entries.
14954 * incremental.h (Incremental_input_type): New enum.
14955 (Incremental_inputs::Incremental_input): Initialize new fields.
14956 (Incremental_inputs::report_inputs): New method.
14957 (Incremental_inputs::report_achive): New method.
14958 (Incremental_inputs::report_object): New method.
14959 (Incremental_inputs::report_script): New method.
14960 (Incremental_inputs::finalize_inputs): New method.
14961 (Incremental_inputs::Input_info): New struct.
14962 (Incremental_inputs::Input_info_map): New typedef.
14963 (Incremental_inputs::lock_): New field.
14964 (Incremental_inputs::Inputs_): New field.
14965 (Incremental_inputs::Inputs_map): New field.
14966 * main.cc (main): Call Incremental_input::report_inputs.
14967 * options.h (Input_argument_list): Typedef moved from
14968 Input_arguments.
14969 (Input_file_group::Files): Remove, use ::Input_argument_list.
14970 (Input_file_group::Input_argument_list): Remove, use
14971 ::Input_argument_list.
14972 * plugin.cc (Plugin_manager::add_input_file): Add error in
14973 incremental build.
14974 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14975 functions.
14976 * script.cc (read_input_script): Call
14977 Incremental_input::report_script.
14978 * script.h (Script_info): New class.
14979
14980 2009-04-27 Ian Lance Taylor <iant@google.com>
14981
14982 * x86_64.cc (do_adjust_output_section): Set entsize to
14983 plt_entry_size.
14984
14985 2009-04-23 Elliott Hughes <enh@google.com>
14986
14987 * output.cc (Output_file::close): After short writes, continue
14988 writing from the correct offset in the buffer being written.
14989
14990 2009-04-23 Chris Demetriou <cgd@google.com>
14991
14992 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14993 * configure: Regenerate.
14994 * config.in: Regenerate.
14995 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14996 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14997
14998 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14999
15000 * incremental.cc (Incremental_inputs_header_data): Renamed from
15001 Incremental_input_header_data.
15002 (Incremental_inputs_header_data::data_size): New field.
15003 (Incremental_inputs_header_data::put_input_file_count): Renamed
15004 from input_file_count.
15005 (Incremental_inputs_header_data::put_command_line_offset): Renamed
15006 from command_line_offset.
15007 (Incremental_inputs_header_data::put_reserved): Renamed from
15008 put_reserved.
15009 (Incremental_inputs_entry_data): Renamed from
15010 Incremental_input_entry_data.
15011 (Incremental_inputs_entry_data::data_size): New field.
15012 (Incremental_inputs::report_command_line): New method.
15013 (Incremental_inputs::finalize): New method.
15014 (Incremental_inputs::create_incremental_inputs_data): New method.
15015 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
15016 * incremental.h: New file.
15017 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
15018 (Layout::finalize): Create incremental inputs section in
15019 incremental builds.
15020 (Layout::create_incremental_info_sections): New method.
15021 * layout.h (Layout::incremental_inputs): New method.
15022 (Layout::create_incremental_info_sections): New method.
15023 (Layout::incremental_inputs_): New field.
15024 * main.cc (main): Notify Incremental_input of the command line.
15025
15026 2009-04-01 Ian Lance Taylor <iant@google.com>
15027 Mikolaj Zalewski <mikolajz@google.com>
15028
15029 * gold.h (reserve_unordered_map): Define, three versions, one for
15030 each version of Unordered_map.
15031 * layout.cc (Layout::Layout): Remove options parameter. Add
15032 number_of_input_files parameter. Don't initialize options_.
15033 Initialize number_of_input_files_ and resized_signatures_. Move
15034 sections_are_attached_.
15035 (Layout::layout_group): Reserve space for group_signatures_.
15036 (Layout::find_or_add_kept_section): Change name parameter to be a
15037 reference. Resize signatures_ map when it gets large enough.
15038 (Layout::layout_eh_frame): Use parameters->options() instead of
15039 this->options_.
15040 (Layout::make_output_section): Likewise.
15041 (Layout::attach_allocated_section_to_segment): Likewise.
15042 (Layout::finalize, Layout::create_executable_stack): Likewise.
15043 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
15044 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
15045 * layout.h (class Layout): Update declarations. Remove options_
15046 field. Add number_of_input_files_ and resized_signatures_
15047 fields. Move sections_are_attached_ field.
15048 * main.cc (main): Pass number of input files to Layout
15049 constructor. Don't pass options.
15050
15051 2009-03-30 Ian Lance Taylor <iant@google.com>
15052
15053 * ffsll.c (ffsll): Correct implementation.
15054
15055 2009-03-27 Ian Lance Taylor <iant@google.com>
15056
15057 * ffsll.c: New file.
15058 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
15059 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
15060 * ftruncate.c (ftruncate): Declare before definition.
15061 * mremap.c (mremap): Likewise.
15062 * pread.c (pread): Likewise.
15063 * configure, Makefile.in, config.in: Rebuild.
15064
15065 * mremap.c: New file.
15066 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
15067 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
15068 (mremap): Declare if HAVE_MREMAP is not defined.
15069 * configure, Makefile.in, config.in: Rebuild.
15070
15071 2009-03-27 Cary Coutant <ccoutant@google.com>
15072
15073 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
15074 position independent.
15075 * sparc.cc (Target_sparc::check_non_pic): Likewise.
15076 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
15077
15078 2009-03-24 Cary Coutant <ccoutant@google.com>
15079
15080 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
15081 an executable.
15082 (needs_dynamic_reloc): Likewise.
15083
15084 2009-03-24 Ian Lance Taylor <iant@google.com>
15085
15086 * yyscript.y (file_cmd): Recognize EXTERN.
15087 (extern_name_list, extern_name_list_body): New nonterminals.
15088 * script.cc (script_add_extern): Define.
15089 * script-c.h (script_add_extern): Declare.
15090
15091 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
15092
15093 * object.cc (is_elf_object): Define.
15094 * object.h (is_elf_object): Declare.
15095 * archive.cc (Archive::get_elf_object_for_member): Call
15096 is_elf_object.
15097 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
15098
15099 2009-03-24 Elliott Hughes <enh@google.com>
15100
15101 * output.cc (Output_file::map_anonymous): Define.
15102 (Output_file::map): Use map_anonymous. If the regular mmap fails,
15103 try an anonymous one. Report the size if the mmap fails.
15104 * output.h (class Output_file): Declare map_anonymous.
15105
15106 2009-03-24 Ian Lance Taylor <iant@google.com>
15107
15108 * target-select.cc (instantiate_target): Don't acquire the lock if
15109 the instantiated_target_ field has already been set.
15110
15111 2009-03-23 Ian Lance Taylor <iant@google.com>
15112
15113 * gold-threads.h (class Initialize_lock): Define.
15114 * gold-threads.cc (class Initialize_lock_once): Define.
15115 (initialize_lock_control): New static variable.
15116 (initialize_lock_pointer): New static variable.
15117 (initialize_lock_once): New static function.
15118 (Initialize_lock::Initialize_lock): Define.
15119 (Initialize_lock::initialize): Define.
15120 * target-select.h: Include "gold-threads.h".
15121 (class Target_selector): Add lock_ and initialize_lock_ fields.
15122 Don't define instantiate_target, just declare it.
15123 * target-select.cc (Target_selector::Target_selector): Initialize
15124 new fields.
15125 (Target_selector::instantiate_target): Define.
15126 * descriptors.h: Include "gold-threads.h".
15127 (class Descriptors): Add initialize_lock_ field.
15128 * descriptors.cc (Descriptors::Descriptors): Initialize new
15129 field.
15130 (Descriptors::open): Use initialize_lock_ field
15131 * errors.h (class Errors): Add initialize_lock_ field.
15132 * errors.cc (Errors::Errors): Initialize new field.
15133 (Errors::initialize_lock): Use initialize_lock_ field.
15134 * powerpc.cc (class Target_selector_powerpc): Remove
15135 instantiated_target_ field. In do_recognize call
15136 instantiate_target rather than do_instantiate_target. In
15137 do_instantiate_target just allocate a new target.
15138 * sparc.cc (class Target_selector_sparc): Likewise.
15139
15140 * freebsd.h: New file.
15141 * i386.cc: Include "freebsd.h".
15142 (Target_i386): Derive from Target_freebsd rather than
15143 Sized_target.
15144 (Target_selector_i386): Derive from Target_selector_freebsd rather
15145 than Target_selector.
15146 * x86_64.cc: Include "freebsd.h".
15147 (Target_x86_64): Derive from Target_freebsd rather than
15148 Sized_target.
15149 (Target_selector_x86_64): Derive from Target_selector_freebsd
15150 rather than Target_selector.
15151 * target.h (class Target): Add adjust_elf_header and
15152 do_adjust_elf_header.
15153 * output.cc (Output_file_header:: do_sized_write): Call target
15154 adjust_elf_header routine.
15155 * configure.tgt: Set targ_osabi.
15156 * configure.ac: Define GOLD_DEFAULT_OSABI.
15157 * parameters.cc (Parameters::default_target): Pass
15158 GOLD_DEFAULT_OSABI to select_target.
15159 * target-select.h (class Target_selector): Make instantiate_target
15160 protected rather than private.
15161 * Makefile.am (HFILES): Add freebsd.h.
15162 * configure, Makefile.in, config.in: Rebuild.
15163
15164 * merge.cc (do_add_input_section): Correct pend value. Change
15165 message about last entry not being null terminated from error to
15166 warning.
15167
15168 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15169
15170 * incremental.cc: New file.
15171 * Makefile.am (CCFILES): Add incremental.cc.
15172 * Makefile.in: Rebuild.
15173
15174 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15175
15176 * layout.cc (Layout::output_section_name): Preserve names
15177 of '.note.' sections.
15178
15179 2009-03-19 Ian Lance Taylor <iant@google.com>
15180
15181 * descriptors.cc (Descriptors::open): Check that the options are
15182 valid before using them.
15183
15184 2009-03-18 Ian Lance Taylor <iant@google.com>
15185
15186 * script-sections.h: Include <list>.
15187 (class Script_sections): Change Sections_elements from std::vector
15188 to std::list. Typedef public Elements_iterator. Add
15189 orphan_section_placement_, data_segment_align_start_, and
15190 saw_data_segment_align_ fields. Remove data_segment_align_index_
15191 field.
15192 * script-sections.cc (class Orphan_section_placement): New class.
15193 (class Sections_element): Add virtual functions is_relro and
15194 orphan_section_init. Remove virtual function place_orphan_here.
15195 (class Output_section_definition): Add is_relro and
15196 orphan_section_init. Remove place_orphan_here.
15197 (class Orphan_output_section): Likewise.
15198 (Script_sections::Script_sections): Update for field changes.
15199 (Script_sections::data_segment_align): Set saw_data_segment_align_
15200 and data_segment_align_start_, not data_segment_align_index.
15201 (Script_sections::data_segment_relro_end): Check
15202 saw_data_segment_align_. Use data_segment_align_start_ rather
15203 than data_segment_align_index_.
15204 (Script_sections::place_orphan): Rewrite to use
15205 Orphan_section_placement.
15206
15207 2009-03-17 Ian Lance Taylor <iant@google.com>
15208
15209 * archive.cc (Archive::add_symbols): Check for a version attached
15210 to the symbol name in the archive map.
15211 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15212 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15213 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15214 (ver_test_11.a): New target.
15215 * testsuite/Makefile.in: Rebuild.
15216
15217 * configure.ac: Check for chsize and posix_fallocate. Replace
15218 ftruncate.
15219 * ftruncate.c: New file, from gnulib.
15220 * output.cc (posix_fallocate): Define dummy version if not
15221 HAVE_POSIX_FALLOCATE.
15222 (Output_file::map): Call posix_fallocate rather than lseek and
15223 write.
15224 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15225 * configure, Makefile.in, config.in: Rebuild.
15226
15227 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
15228
15229 * layout.h (Layout::create_note): Add section_name parameter.
15230 * layout.cc (Layout::create_note): Likewise.
15231 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
15232
15233 2009-03-17 Ian Lance Taylor <iant@google.com>
15234
15235 * descriptors.cc: Include "options.h".
15236 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15237 (Descriptors::open): Always use O_CLOEXEC when opening a new
15238 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15239 then set FD_CLOEXEC.
15240
15241 * sparc.cc (class Target_sparc): Add has_got_section.
15242 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15243 make sure we have a GOT section.
15244
15245 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15246 (Target_sparc::Scan::local): Likewise.
15247 (Target_sparc::Scan::global): Likewise.
15248 (Target_sparc::Relocate::relocate): Likewise.
15249 (Target_sparc::Relocate::relocate_tls): Likewise.
15250
15251 * symtab.cc (Symbol_table::define_default_version): New function,
15252 broken out of add_from_object.
15253 (Symbol_table::add_from_object): Call define_default_version.
15254 (Symbol_table::define_special_symbol): Add resolve_oldsym
15255 parameter. Change all callers. If the version for a symbol comes
15256 from a version script, resolve it with the symbol with the same
15257 name with no version. Also add the symbol without a version if
15258 appropriate.
15259 (do_define_in_output_data): If resolving with oldsym, don't delete
15260 sym.
15261 (do_define_in_output_segment): Likewise.
15262 (do_define_as_constant): Likewise.
15263 * symtab.h (class Symbol_table): Update declarations.
15264
15265 2009-03-13 Ian Lance Taylor <iant@google.com>
15266
15267 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15268 (Read_symbols::requeue): New function.
15269 (Read_symbols::do_read_symbols): If make_elf_object fails because
15270 the target type is not configured, and the file was searched for,
15271 issue a warning and retry with the next directory.
15272 (Add_symbols::run): If the file has an incompatible format, and
15273 it was searched for, requeue the Read_symbols task. On error,
15274 release the object.
15275 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15276 dirindex parameter to constructor. Change all callers. Declare
15277 incompatible_warning and requeue.
15278 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15279 input_argument_ and input_group_ fields. Add them to
15280 constructor. Change all callers.
15281 (class Read_script): Add dirindex_ field. Add it to constructor.
15282 Change all callers.
15283 * archive.cc (Archive::setup): Remove input_objects parameter.
15284 Change all callers.
15285 (Archive::get_file_and_offset): Likewise.
15286 (Archive::read_all_symbols): Likewise.
15287 (Archive::read_symbols): Likewise.
15288 (Archive::get_elf_object_for_member): Remove input_objects
15289 parameter. Add punconfigured parameter. Change all callers.
15290 (Archive::add_symbols): Change return type to bool. Check return
15291 value of include_member.
15292 (Archive::include_all_members): Likewise.
15293 (Archive::include_member): Change return type to bool. Return
15294 false if first included object has incompatible target. Set
15295 included_member_ field.
15296 (Add_archive_symbols::run): If add_symbols returns false, requeue
15297 Read_symbols task.
15298 * archive.h (class Archive): Add included_member_ field.
15299 Initialize it in constructor. Add input_file and searched_for
15300 methods. Update declarations.
15301 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15302 input_argument_ fields. Add them to constructor. Change all
15303 callers.
15304 * script.cc: Include "target-select.h".
15305 (class Parser_closure): Add skip_on_incompatible_target_ and
15306 found_incompatible_target_ fields. Add
15307 skip_on_incompatible_target parameter to constructor. Change all
15308 callers. Add methods skip_on_incompatible_target,
15309 clear_skip_on_incompatible_target, found_incompatible_target, and
15310 set_found_incompatible_target.
15311 (read_input_script): Add dirindex parameter. Change all callers.
15312 If parser finds an incompatible target, requeue Read_symbols
15313 task.
15314 (script_set_symbol): Clear skip_on_incompatible_target in
15315 closure.
15316 (script_add_assertion, script_parse_option): Likewise.
15317 (script_start_sections, script_add_phdr): Likewise.
15318 (script_check_output_format): New function.
15319 * script.h (read_input_script): Update declaration.
15320 * script-c.h (script_check_output_format): Declare.
15321 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15322 (ignore_cmd): Remove OUTPUT_FORMAT.
15323 * fileread.cc (Input_file::Input_file): Add explicit this.
15324 (Input_file::will_search_for): New function.
15325 (Input_file::open): Add pindex parameter. Change all callers.
15326 * fileread.h (class Input_file): Add input_file_argument method.
15327 Declare will_search_for. Update declarations.
15328 * object.cc (make_elf_object): Add punconfigured parameter.
15329 Change all callers.
15330 * object.h (class Object): Make input_file public. Add
15331 searched_for method.
15332 (make_elf_object): Update declaration.
15333 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15334 restart search.
15335 * dirsearch.h (class Dirsearch): Update declaration.
15336 * options.h (class General_options): Add --warn-search-mismatch.
15337 * parameters.cc (Parameters::is_compatible_target): New function.
15338 * parameters.h (class Parameters): Declare is_compatible_target.
15339 * workqueue.cc (Workqueue::add_blocker): New function.
15340 * workqueue.h (class Workqueue): Declare add_blocker.
15341
15342 * fileread.cc (Input_file::open): Remove options parameter.
15343 Change all callers.
15344 (Input_file::open_binary): Likewise.
15345 * script.cc (read_input_script): Likewise.
15346 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15347 options parameter from constructor. Change all callers.
15348 (class Read_script): Likewise.
15349 * fileread.h (class Input_file): Update declarations.
15350 * script.h (read_input_script): Update declaration.
15351
15352 2009-03-10 Nick Clifton <nickc@redhat.com>
15353
15354 * po/es.po: New Spanish translation.
15355
15356 2009-03-06 Cary Coutant <ccoutant@google.com>
15357
15358 * options.cc (parse_short_option): Keep dash_z from registering itself.
15359
15360 2009-03-03 Ian Lance Taylor <iant@google.com>
15361
15362 PR 9918
15363 * target-reloc.h (relocate_section): Pass output_section to
15364 relocate.
15365 * i386.cc (Target_i386::should_apply_static_reloc): Add
15366 output_section parameter. Change all callers.
15367 (Target_i386::Relocate::relocate): Add output_section parameter.
15368 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15369 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15370 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15371 * testsuite/two_file_shared.sh: New script.
15372 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15373 (check_DATA): Add two_file_shared.dbg.
15374 (two_file_shared.dbg): New target.
15375 * testsuite/Makefile.in: Rebuild.
15376
15377 2009-03-01 Ian Lance Taylor <iant@google.com>
15378
15379 * configure.ac: Check for byteswap.h.
15380 * configure: Rebuild.
15381 * config.in: Rebuild.
15382
15383 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15384
15385 * layout.cc (Layout::find_or_add_kept_section): New function.
15386 (Layout::add_comdat): Removed.
15387 * layout.h (struct Kept_section): Move out of class Layout.
15388 Remove trailing underscores from field names. Add group_sections
15389 field. Rename group_ field to is_group. Change all uses.
15390 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15391 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15392 comdat_groups_ field.
15393 (Sized_relobj::include_section_group): Use
15394 find_or_add_kept_section and Kept_section::group_sections.
15395 (Sized_relobj::include_linkonce_section): Likewise.
15396 * object.cc (class Sized_relobj): Don't define Comdat_group or
15397 Comdat_group_table. Remove find_comdat_group and
15398 add_comdat_group. Remove comdat_groups_ field.
15399 * plugin.cc (include_comdat_group): Use
15400 Layout::find_or_add_kept_section.
15401
15402 2009-02-28 Ian Lance Taylor <iant@google.com>
15403
15404 * README: --gc-sections and map files are now supported. Document
15405 some build requirements.
15406
15407 PR 6992
15408 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15409 relocatable link set the value of the section symbol to zero.
15410 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15411 relocatable link don't include the section address in the local
15412 symbol value.
15413
15414 2009-02-27 Ian Lance Taylor <iant@google.com>
15415
15416 PR 6811
15417 * options.h (class Search_directory): Add is_system_directory.
15418 (class General_options): Declare is_in_system_directory.
15419 * options.cc (get_relative_sysroot): Make static.
15420 (get_default_sysroot): Make static.
15421 (General_optoins::is_in_system_directory): New function.
15422 * fileread.cc (Input_file::is_in_system_directory): New function.
15423 * fileread.h (class Input_file): Declare is_in_system_directory.
15424 * object.h (class Object): Add is_in_system_directory.
15425 (class Input_objects): Remove system_library_directory_ field.
15426 * object.cc (Input_objects::add_object): Don't set
15427 system_library_directory_.
15428 (input_objects::found_in_system_library_directory): Remove.
15429 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15430 parameter. Change all callers.
15431 (Symbol_table::sized_write_globals): Likewise.
15432 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15433 Call Object::is_in_system_directory.
15434 * symtab.h (class Symbol_table): Update declarations.
15435
15436 PR 5990
15437 * descriptors.h (Open_descriptor): Add is_on_stack field.
15438 * descriptors.cc (Descriptors::open): If the descriptor is on the
15439 top of the stack, remove it. Initialize is_on_stack field.
15440 (Descriptors::release): Only add pod to stack if it is not on the
15441 stack already.
15442 (Descriptors::close_some_descriptor): Clear stack_next and
15443 is_on_stack fields.
15444
15445 PR 7091
15446 * output.cc (Output_section::find_starting_output_address): Rename
15447 from starting_output_address; add PADDR parameter; change return
15448 type.
15449 * output.h (class Output_section): Declare
15450 find_starting_output_address instead of starting_output_address.
15451 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15452 section symbol for which we can't find a merge section.
15453
15454 PR 9836
15455 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15456 hidden or internal, force the symbol to be local.
15457 * resolve.cc (Symbol::override_visibility): Define.
15458 (Symbol::override_base): Use override_visibility.
15459 (Symbol_table::resolve): Likewise.
15460 (Symbol::override_base_with_special): Likewise.
15461 (Symbol_table::override_with_special): If the visibility is hidden
15462 or internal, force the symbol to be local.
15463 * symtab.h (class Symbol): Add set_visibility and
15464 override_visibility.
15465 * testsuite/ver_test_1.sh: New file.
15466 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15467 (check_DATA): Add ver_test_1.syms.
15468 (ver_test_1.syms): New target.
15469 * testsuite/Makefile.in: Rebuild.
15470
15471 2009-02-25 Cary Coutant <ccoutant@google.com>
15472
15473 * layout.cc (Layout::choose_output_section): Don't rename sections
15474 when using a linker script that has a SECTIONS clause.
15475 * Makefile.in: Regenerate.
15476
15477 * testsuite/Makefile.am (script_test_5.sh): New test case.
15478 * testsuite/Makefile.in: Regenerate.
15479 * testsuite/script_test_5.cc: New file.
15480 * testsuite/script_test_5.sh: New file.
15481 * testsuite/script_test_5.t: New file.
15482
15483 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15484
15485 * archive.cc (Archive::include_member): Update calls to add_symbols.
15486 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15487 the Layout argument.
15488 * dynobj.h (do_add_symbols): Add the Layout argument.
15489 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15490 Layout argument.
15491 * object.h (Object::add_symbols): Add the Layout argument.
15492 (Object::do_add_symbols): Add the Layout argument.
15493 (Sized_relobj::do_add_symbols): Add the Layout argument.
15494 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15495 Unify the two versions.
15496 (Add_plugin_symbols): Remove.
15497 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15498 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15499 (Add_plugin_symbols): Remove.
15500 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15501 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15502 (Add_symbols::run): Make it work with Pulginobj.
15503
15504 2009-02-06 Ian Lance Taylor <iant@google.com>
15505
15506 * object.cc (Sized_relobj::do_layout): Make info message start
15507 with lower case letter.
15508
15509 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15510
15511 * binary.cc: Fix file comment.
15512
15513 * options.h (enum Incremental_disposition): Define.
15514 (class General_options): Add new options: --incremental,
15515 --incremental_changed, --incremental_unchanged,
15516 --incremental_unknown. Add incremental_disposition_ and
15517 implicit_incremental_ fields.
15518 (General_options::incremental_disposition): New function.
15519 (class Position_dependent_options): Add incremental_disposition
15520 option.
15521 (Position_dependent_options::copy_from_options): Set incremental
15522 dispositions.
15523 * options.cc (General_options::parse_incremental_changed): New
15524 function.
15525 (General_options::parse_incremental_unchanged): New function.
15526 (General_options::parse_incremental_unknown): New function.
15527 (General_options::General_options): Initialize new fields
15528 incremental_disposition_ and implicit_incremental_.
15529 (General_options::finalize): Check for uasge of --incremental-*
15530 without --incremental.
15531
15532 2009-02-06 Chris Demetriou <cgd@google.com>
15533
15534 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15535 pointer and to report location as the file name associated with
15536 the symbol.
15537 (gold_undefined_symbol_at_location): New function to replace the
15538 old gold_undefined_symbol functionality.
15539 * target-reloc.h (relocate_section): Update to use
15540 gold_undefined_symbol_at_location.
15541 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15542 Call gold_undefined_symbol function rather than gold_error.
15543 * errors.h (Errors::undefined_symbol): Take location as a
15544 string, rather than calculating it from a relocation.
15545 * errors.cc (Errors::fatal): Print "fatal error:" before the
15546 formatted message.
15547 (Errors::error, Errors::error_at_location): Print "error: "
15548 before the formatted message.
15549 (Errors::undefined_symbol): Take location as a string, rather
15550 than calculating it from a relocation.
15551 (gold_undefined_symbol_at_location): New function akin to
15552 old gold_undefined_symbol, calculates location from relocation.
15553 (gold_undefined_symbol): Change to take only a Symbol pointer
15554 and to report location as the file name associated with the symbol.
15555 * testsuite/debug_msg.sh: Update for changed error messages.
15556 * testsuite/undef_symbol.sh: Likewise.
15557
15558 2009-02-04 Duncan Sands <baldrick@free.fr>
15559
15560 PR 9812
15561 * reduced_debug_output.h
15562 (Output_reduced_debug_abbrev_section::failed): Use format for
15563 gold_warning.
15564 (Output_reduced_debug_info_section::faild): Likewise.
15565
15566 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15567
15568 * script.cc (Lazy_demangler): New class.
15569 (Version_script_info::get_symbol_version_helper): Demangle a
15570 symbol only once.
15571
15572 2009-01-29 Cary Coutant <ccoutant@google.com>
15573
15574 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15575 to __tls_get_addr.
15576 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15577
15578 2009-01-28 Ian Lance Taylor <iant@google.com>
15579
15580 * version.cc (version_string): Bump to 1.9.
15581
15582 * gold.h: Include <cstring> and <stdint.h>.
15583 * version.cc: Include <cstdio>.
15584 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15585 warning.
15586 * reduced_debug_output.cc (insert_into_vector): Rename from
15587 Insert_into_vector; change all callers. Use Swap_unaligned to
15588 avoid aliasing issue; remove union since it is unnecessary.
15589
15590 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15591
15592 * Makefile.am (CCFILES): Add gc.cc.
15593 (HFILES): Add gc.h.
15594 * Makefile.in: Regenerate.
15595 * gold.cc (Gc_runner): New class.
15596 (queue_initial_tasks): Call garbage collection related tasks
15597 when corresponding options are invoked.
15598 (queue_middle_gc_tasks): New function.
15599 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15600 processed early before laying out sections during garbage collection.
15601 * gold.h (queue_middle_gc_tasks): New function.
15602 (is_prefix_of): Move from "layout.cc".
15603 * i386.cc (Target_i386::gc_process_relocs): New function.
15604 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15605 * main.cc (main): Create object of class "Garbage_collection".
15606 * object.cc (Relobj::copy_symbols_data): New function.
15607 (Relobj::is_section_name_included): New function.
15608 (Sized_relobj::do_layout): Allow this function to be called twice
15609 during garbage collection and defer layout of section during the
15610 first call.
15611 * object.h (Relobj::get_symbols_data): New function.
15612 (Relobj::is_section_name_included): New function.
15613 (Relobj::copy_symbols_data): New function.
15614 (Relobj::set_symbols_data): New function.
15615 (Relobj::get_relocs_data): New function.
15616 (Relobj::set_relocs_data): New function.
15617 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15618 (Relobj::gc_process_relocs): New function.
15619 (Relobj::do_gc_process_relocs): New pure virtual function.
15620 (Relobj::sd_): New data member.
15621 (Sized_relobj::is_output_section_offset_invalid): New function.
15622 (Sized_relobj::do_gc_process_relocs): New function.
15623 * options.h (General_options::gc_sections): Modify to not be a no-op.
15624 (General_options::print_gc_sections): New option.
15625 * plugin.cc (Plugin_finish::run): Remove function call to
15626 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15627 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15628 * reloc.cc (Read_relocs::run): Add task to process relocs and
15629 determine unreferenced sections when doing garbage collection.
15630 (Gc_process_relocs): New class.
15631 (Sized_relobj::do_gc_process_relocs): New function.
15632 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15633 sections that are garbage collected.
15634 * reloc.h (Gc_process_relocs): New class.
15635 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15636 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15637 symbols whose corresponding sections are garbage collected.
15638 (Symbol_table::Symbol_table): Add new parameter for the garbage
15639 collection object.
15640 (Symbol_table::gc_mark_undef_symbols): New function.
15641 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15642 (Symbol_table::gc_mark_dyn_syms): New function.
15643 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15644 as garbage.
15645 (Symbol_table::add_from_object): Likewise.
15646 (Symbol_table::add_from_relobj): When building shared objects, do not
15647 treat externally visible symbols as garbage.
15648 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15649 table information for static and relocatable links.
15650 * symtab.h (Symbol_table::set_gc): New function.
15651 (Symbol_table::gc): New function.
15652 (Symbol_table::gc_mark_undef_symbols): New function.
15653 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15654 (Symbol_table::gc_mark_dyn_syms): New function.
15655 (Symbol_table::gc_): New data member.
15656 * target.h (Sized_target::gc_process_relocs): New pure virtual
15657 function.
15658 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15659 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15660
15661 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15662
15663 * options.h (General_options::gc_sections): Define as a no-op for now.
15664 (General_options::no_keep_memory): Ditto.
15665 (General_options::Bshareable): Define.
15666 * options.cc (General_options::finalize): Honor -Bshareable.
15667
15668 2009-01-20 Andreas Schwab <schwab@suse.de>
15669
15670 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15671 read the value in the contents, since we don't use it. Use the
15672 template endianness when writing.
15673 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15674
15675 2009-01-19 Andreas Schwab <schwab@suse.de>
15676
15677 * configure.tgt (powerpc64-*): Fix targ_obj.
15678
15679 2009-01-15 Ian Lance Taylor <iant@google.com>
15680
15681 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15682 local symbols when stripping all symbols.
15683
15684 2009-01-14 Cary Coutant <ccoutant@google.com>
15685
15686 * output.cc (Output_reloc): Add explicit instantiations.
15687
15688 2009-01-14 Cary Coutant <ccoutant@google.com>
15689
15690 * archive.cc (Archive::get_elf_object_for_member): Remove call
15691 to File_read::claim_for_plugin.
15692 * descriptors.cc (Descriptors::open): Remove reference to
15693 is_claimed.
15694 (Descriptors::claim_for_plugin): Remove.
15695 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15696 (Descriptors::is_claimed): Remove.
15697 (claim_descriptor_for_plugin): Remove.
15698 * fileread.cc (File_read::claim_for_plugin): Remove.
15699 * fileread.h (File_read::claim_for_plugin): Remove.
15700 (File_read::descriptor): Reopen descriptor if necessary.
15701 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15702 (Plugin_manager::all_symbols_read): Add task parameter. Change
15703 all callers.
15704 (Plugin_manager::get_input_file): New function.
15705 (Plugin_manager::release_input_file): New function.
15706 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15707 corresponding data member.
15708 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15709 and pass to base constructor. Change all callers.
15710 (get_input_file, release_input_file): New functions.
15711 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15712 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15713 (Plugin_manager::all_symbols_read): Add task parameter.
15714 (Plugin_manager::get_input_file): New function.
15715 (Plugin_manager::release_input_file): New function.
15716 (Plugin_manager::task_): New data member.
15717 (Pluginobj::Pluginobj): Add filesize parameter.
15718 (Pluginobj::filename): New function.
15719 (Pluginobj::descriptor): New function.
15720 (Pluginobj::filesize): New function.
15721 (Pluginobj::filesize_): New data member.
15722 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15723 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15724 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15725
15726 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15727 with archive libraries.
15728 * testsuite/Makefile.in: Regenerate.
15729 * testsuite/plugin_test.c (struct sym_info): New type.
15730 (get_input_file, release_input_file): New static variables.
15731 (onload): Capture new transfer vector entries.
15732 (claim_file_hook): Stop reading at end of file according to filesize.
15733 Factor out parsing of readelf output into separate function.
15734 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15735 APIs and get the source file name from the symbol table. Convert
15736 source file name to corresponding object file name. Print info
15737 message when adding new input files.
15738 (parse_readelf_line): New function.
15739 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15740 * testsuite/plugin_test_2.sh: Likewise.
15741 * testsuite/plugin_test_3.sh: Likewise.
15742 * testsuite/plugin_test_4.sh: New test case.
15743
15744 2009-01-07 Ian Lance Taylor <iant@google.com>
15745
15746 * version.cc (version_string): Bump to 1.8.
15747
15748 2008-12-23 Cary Coutant <ccoutant@google.com>
15749
15750 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15751 * plugin.cc (Plugin_manager::finish): Rename as
15752 layout_deferred_objects. Move cleanup to separate function.
15753 (Plugin_manager::cleanup): New function.
15754 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15755 separately.
15756 * plugin.h (Plugin_manager::finish): Rename as
15757 layout_deferred_objects.
15758 (Plugin_manager::cleanup): New function.
15759 (Plugin_manager::cleanup_done): New field.
15760
15761 2008-12-23 Cary Coutant <ccoutant@google.com>
15762
15763 * plugin.cc (is_visible_from_outside): New function.
15764 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15765 so we don't return "IR only" status for exported symbols or -r links.
15766
15767 * testsuite/Makefile.am (plugin_test_3): New test case.
15768 * testsuite/Makefile.in: Regenerate.
15769 * testsuite/plugin_test_3.sh: New file.
15770
15771 2008-12-22 Cary Coutant <ccoutant@google.com>
15772
15773 * object.cc (Sized_relobj::layout_section): New function.
15774 (Sized_relobj::do_layout): Defer layout of input sections until after
15775 plugin has provided replacement files.
15776 (Sized_relobj::do_layout_deferred_sections): New function.
15777 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15778 (Relobj::layout_deferred_sections): New function.
15779 (Relobj::do_layout_deferred_sections): New function.
15780 (Sized_relobj::do_layout_deferred_sections): New function.
15781 (Sized_relobj::layout_section): New function.
15782 (Sized_relobj::Deferred_layout): New structure.
15783 (Sized_relobj::deferred_layout_): New field.
15784 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15785 Change all callers. Layout deferred sections.
15786 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15787 references.
15788 (Plugin_hook::run): Move code from do_plugin_hook inline.
15789 (Plugin_hook::do_plugin_hook): Remove.
15790 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15791 (Plugin_manager::finish): Renamed, was cleanup.
15792 (Plugin_manager::should_defer_layout): New function.
15793 (Plugin_manager::add_deferred_layout_object): New function.
15794 (Plugin_manager::Deferred_layout_list): New type.
15795 (Plugin_manager::deferred_layout_objects_): New field.
15796 (Plugin_hook::do_plugin_hook): Remove.
15797
15798 2008-12-17 Ian Lance Taylor <iant@google.com>
15799
15800 * options.h (class General_options): Add --no case for
15801 --export-dynamic.
15802
15803 2008-12-16 Cary Coutant <ccoutant@google.com>
15804
15805 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15806 vector.
15807 (Plugin_manager::claim_file): Create plugin object even if
15808 plugin did not call the add_symbols callback.
15809 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15810 asking for more symbols than were added.
15811 * testsuite/Makefile.am (plugin_test_1): Add test case with
15812 no global symbols.
15813 (empty.syms): New target.
15814 * testsuite/Makefile.in: Regenerate.
15815 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15816 message. Don't call add_symbols if no globals.
15817 (all_symbols_read_hook): Don't provide replacement for empty
15818 claimed file.
15819
15820 2008-12-12 Ian Lance Taylor <iant@google.com>
15821
15822 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15823 r_type == 0 for a local symbol with r_sym == 0.
15824 (scan_relocatable_relocs): Pass r_sym to
15825 local_non_section_strategy.
15826 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15827 r_sym parameter.
15828
15829 * configure.ac: Update test for TLS descriptors: they are
15830 supported as of glibc 2.9.
15831 * configure: Rebuild.
15832
15833 2008-12-11 Ian Lance Taylor <iant@google.com>
15834
15835 PR 7091
15836 * target-reloc.h (Default_scan_relocatable_relocs): For each
15837 function, map r_type == 0 to RELOC_DISCARD.
15838
15839 2008-12-10 Cary Coutant <ccoutant@google.com>
15840
15841 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15842 object to override a kept COMDAT group from a plugin object.
15843
15844 2008-12-09 Ian Lance Taylor <iant@google.com>
15845
15846 PR 7088
15847 * yyscript.y (file_cmd): Handle INPUT.
15848
15849 * testsuite/initpri1.c: Change all declarations to be full
15850 prototypes by adding void, to avoid compiler warnings.
15851
15852 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15853
15854 * options.cc (General_options::parse_plugin_opt): New.
15855 (General_options::add_plugin): The argument now is just the filename.
15856 (General_options::add_plugin_option): New.
15857 * options.h (plugin_opt): New.
15858 (add_plugin): Change argument name.
15859 (add_plugin_option): New.
15860 * plugin.cc (Plugin::load): Don't parse the plugin option.
15861 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15862 (Plugin::add_option): New.
15863 (Plugin::args_): Change type.
15864 (Plugin::filename_): New.
15865 (Plugin_manager::add_plugin_option): New.
15866 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15867 * testsuite/Makefile.in: Regenerate.
15868
15869 2008-12-05 Cary Coutant <ccoutant@google.com>
15870
15871 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15872 Handle --strip-lto-sections option.
15873 * options.h (strip_lto_sections): New option.
15874
15875 2008-12-01 Cary Coutant <ccoutant@google.com>
15876
15877 * plugin.cc (ld_plugin_message): Change format parameter to const.
15878 Fix mismatch between new[] and delete.
15879
15880 2008-11-14 Cary Coutant <ccoutant@google.com>
15881
15882 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15883 instead of -1U.
15884
15885 2008-11-05 Craig Silverstein <csilvers@google.com>
15886
15887 * options.cc (General_options::parse_dynamic_list): New function.
15888 * options.h (General_options): New flags dynamic_list,
15889 dynamic_list_data, dynamic_list_cpp_new, and
15890 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15891 (General_options::in_dynamic_list): New function.
15892 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15893 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15894 (Lex::can_continue_name): Likewise.
15895 (yylex): Likewise.
15896 (read_script_file): New parameter script_options.
15897 (read_dynamic_list): New function.
15898 (Script_options::define_dynamic_list): New function.
15899 (dynamic_list_keyword_parsecodes): New variable.
15900 (dynamic_list_keywords): New variable.
15901 * script.h (Script_options::define_dynamic_list): New function
15902 prototype.
15903 (read_dynamic_list): New function prototype.
15904 * symtab.cc (strprefix): New macro.
15905 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15906 dynamic_list_data, dynamic_list_cpp_new, and
15907 dynamic_list_cpp_typeinfo.
15908 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15909 (dynamic_list_expr): New rule.
15910 (dynamic_list_nodes): Likewise.
15911 (dynamic_list_node): Likewise.
15912 * testsuite/Makefile.am (dynamic_list): New test.
15913 * testsuite/Makefile.in: Regenerated.
15914 * testsuite/dynamic_list.t: New file.
15915 * testsuite/dynamic_list.sh: New file.
15916
15917 2008-11-05 Craig Silverstein <csilvers@google.com>
15918
15919 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15920 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15921 (t11_last): Likewise.
15922 * testsuite/ver_test_6.c (main): Likewise.
15923
15924 2008-10-07 Cary Coutant <ccoutant@google.com>
15925
15926 * options.c (General_options::finalize): Add check for -static and
15927 -shared.
15928 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15929 is not empty.
15930
15931 2008-10-02 Cary Coutant <ccoutant@google.com>
15932
15933 * plugin.cc (make_sized_plugin_object): Fix conditional
15934 compilation to work when not all targets are enabled.
15935
15936 2008-09-29 Cary Coutant <ccoutant@google.com>
15937
15938 * archive.cc (Archive::get_file_and_offset): Use filename instead
15939 of name to get library path.
15940 (Archive::include_member): Unlock external member of a thin archive.
15941
15942 * testsuite/Makefile.am (TEST_AR): New variable.
15943 (thin_archive_test_1): New test.
15944 (thin_archive_test_2): New test.
15945 * testsuite/Makefile.in: Regenerate.
15946 * testsuite/thin_archive_main.cc: New file.
15947 * testsuite/thin_archive_test_1.cc: New file.
15948 * testsuite/thin_archive_test_2.cc: New file.
15949 * testsuite/thin_archive_test_3.cc: New file.
15950 * testsuite/thin_archive_test_4.cc: New file.
15951
15952 2008-09-29 Cary Coutant <ccoutant@google.com>
15953
15954 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15955 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15956 instead of -1U.
15957 (Sized_relobj::do_finalize_local_symbols): Likewise.
15958 (Sized_relobj::map_to_kept_section): Likewise.
15959 * object.h (Sized_relobj::invalid_address): New constant.
15960 (Sized_relobj::do_output_section_offset): Check for invalid_address
15961 and return -1ULL.
15962 * output.cc (Output_reloc::local_section_offset): Use constant
15963 invalid_address instead of -1U.
15964 (Output_reloc::get_address): Likewise.
15965 (Output_section::output_address): Change -1U to -1ULL.
15966 * output.h (Output_reloc::invalid_address): New constant.
15967 * reloc.cc (Sized_relobj::write_sections): Use constant
15968 invalid_address instead of -1U.
15969 (Sized_relobj::relocate_sections): Likewise.
15970 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15971 values for merge sections.
15972 * target-reloc.h (relocate_for_relocatable): Use constant
15973 invalid_address instead of -1U.
15974
15975 2008-09-19 Cary Coutant <ccoutant@google.com>
15976
15977 Add plugin functionality for link-time optimization (LTO).
15978 * configure.ac (plugins): Add --enable-plugins option.
15979 * configure: Regenerate.
15980 * config.in: Regenerate.
15981 * Makefile.am (LIBDL): New variable.
15982 (CCFILES): Add plugin.cc.
15983 (HFILES): Add plugin.h.
15984 (ldadd_var): Add LIBDL.
15985 * Makefile.in: Regenerate.
15986
15987 * archive.cc: Include "plugin.h".
15988 (Archive::setup): Don't preread archive symbols when using a plugin.
15989 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15990 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15991 files.
15992 (Archive::include_member): Add symbols from plugin objects.
15993 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15994 * descriptors.cc (Descriptors::open): Check for file descriptors
15995 abandoned by plugins.
15996 (Descriptors::claim_for_plugin): New function.
15997 * descriptors.h (Descriptors::claim_for_plugin): New function.
15998 (Open_descriptor::is_claimed): New field.
15999 (claim_descriptor_for_plugin): New function.
16000 * fileread.cc (File_read::claim_for_plugin): New function.
16001 * fileread.h (File_read::claim_for_plugin): New function.
16002 (File_read::descriptor): New function.
16003 * gold.cc: Include "plugin.h".
16004 (queue_initial_tasks): Add task to call plugin hooks for generating
16005 new object files.
16006 * main.cc: Include "plugin.h".
16007 (main): Load plugin libraries.
16008 * object.h (Pluginobj): Declare.
16009 (Object::pluginobj): New function.
16010 (Object::do_pluginobj): New function.
16011 (Object::set_target): New function.
16012 * options.cc: Include "plugin.h".
16013 (General_options::parse_plugin): New function.
16014 (General_options::General_options): Initialize plugins_ field.
16015 (General_options::add_plugin): New function.
16016 * options.h (Plugin_manager): Declare.
16017 (General_options): Add --plugin option.
16018 (General_options::has_plugins): New function.
16019 (General_options::plugins): New function.
16020 (General_options::add_plugin): New function.
16021 (General_options::plugins_): New field.
16022 * plugin.cc: New file.
16023 * plugin.h: New file.
16024 * readsyms.cc: Include "plugin.h".
16025 (Read_symbols::do_read_symbols): Check for archive before checking
16026 for ELF file. Call plugin hooks to claim files.
16027 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
16028 from a real object file; force override when processing replacement
16029 files.
16030 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
16031 (Symbol::init_base_object): Likewise.
16032 (Symbol::init_base_output_data): Likewise.
16033 (Symbol::init_base_output_segment): Likewise.
16034 (Symbol::init_base_constant): Likewise.
16035 (Symbol::init_base_undefined): Likewise.
16036 (Symbol::output_section): Assert that object is not a plugin.
16037 (Symbol_table::add_from_pluginobj): New function.
16038 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
16039 undefined.
16040 (Symbol_table::sized_write_globals): Likewise.
16041 (Symbol_table::add_from_pluginobj): Instantiate template.
16042 * symtab.h (Sized_pluginobj): Declare.
16043 (Symbol::in_real_elf): New function.
16044 (Symbol::set_in_real_elf): New function.
16045 (Symbol::in_real_elf_): New field.
16046 (Symbol_table::add_from_pluginobj): New function.
16047
16048 * testsuite/Makefile.am (AM_CFLAGS): New variable.
16049 (LIBDL): New variable.
16050 (LDADD): Add LIBDL.
16051 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
16052 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
16053 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
16054 (MOSTLYCLEANFILES): Likewise.
16055 * testsuite/Makefile.in: Regenerate.
16056 * testsuite/plugin_test.c: New file.
16057 * testsuite/plugin_test_1.sh: New file.
16058 * testsuite/plugin_test_2.sh: New file.
16059
16060 2008-09-16 Ian Lance Taylor <iant@google.com>
16061
16062 * target-reloc.h (relocate_section): Check whether a symbol is
16063 defined by the ABI before reporting an undefined symbol error.
16064 * target.h (Target::is_defined_by_abi): Make parameter const.
16065 (Target::do_is_defined_by_abi): Likewise.
16066 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
16067 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
16068 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
16069 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
16070 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
16071 * testsuite/Makefile.in: Rebuild.
16072
16073 * fileread.cc (make_view): Add casts to avoid warning.
16074
16075 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
16076
16077 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
16078 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16079
16080 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
16081
16082 * options.h (General_options::output_is_executable): New.
16083 (General_options::output_is_pie): New.
16084 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
16085 for shared libraries.
16086 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
16087
16088 2008-09-11 Chris Demetriou <cgd@google.com>
16089
16090 * options.h (origin): New -z option.
16091 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
16092 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
16093 in DT_FLAGS_1.
16094
16095 2008-09-05 Cary Coutant <ccoutant@google.com>
16096
16097 * fileread.cc (File_read::make_view): Add check for attempt to map
16098 beyond end of file.
16099
16100 2008-09-05 Cary Coutant <ccoutant@google.com>
16101
16102 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
16103 explicit instantiations.
16104
16105 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
16106
16107 PR gold/6858
16108 * options.cc (General_options::finalize): Allow undefined symbols
16109 in shlibs if linking -shared.
16110
16111 PR gold/6859
16112 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
16113 symbols as not needing a dynsym entry.
16114
16115 2008-08-20 Craig Silverstein <csilvers@google.com>
16116
16117 * fileread.cc (File_read::open): Do not lock the file unless it
16118 was successfully opened.
16119
16120 2008-08-14 Cary Coutant <ccoutant@google.com>
16121
16122 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
16123 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
16124 * testsuite/tls_test.cc (struct int128): 128-bit struct
16125 for testing TLS relocs with non-zero addend.
16126 (v12): New TLS variable.
16127 (t12): New test.
16128 (t_last): Add check for v12.
16129 * testsuite/tls_test.h (t12): New function.
16130 * testsuite/tls_test_main.cc (thread_routine): Call new test.
16131
16132 2008-08-13 Ian Lance Taylor <iant@google.com>
16133
16134 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16135 set tls_segment_ or relro_segment_.
16136 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16137 when appropriate.
16138 * output.h (Output_section::clear_is_relro): New function.
16139 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16140 sections specially even when output_data_ is empty.
16141 (Output_segment::maximum_alignment): When first section is relro,
16142 only force alignment for PT_LOAD segments.
16143 * script.cc (script_data_segment_align): New function.
16144 (script_data_segment_relro_end): New function.
16145 * script-c.h (script_data_segment_align): Declare.
16146 (script_data_segment_relro_end): Declare.
16147 * script-sections.h (class Script_sections): Declare
16148 data_segment_align and data_segment_relro_end. Add fields
16149 segment_align_index_ and saw_relro_end_.
16150 * script-sections.cc (class Sections_element): Add set_is_relro
16151 virtual function. Add new bool* parameter to place_orphan_here.
16152 Add get_output_section virtual function.
16153 (class Output_section_definition): Add set_is_relro. Add new
16154 bool* parameter to place_orphan_here. Add get_output_section.
16155 Add is_relro_ field.
16156 (Output_section_definition::Output_section_definition): Initialize
16157 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16158 and is_relro_ fields.
16159 (Output_section_definition::place_orphan_here): Add is_relro
16160 parameter.
16161 (Output_section_definition::set_section_addresses): Set relro for
16162 output section.
16163 (Output_section_definition::alternate_constraint): Likewise.
16164 (class Orphan_output_section): Add new bool* parameter to
16165 place_orphan_here. Add get_output_section.
16166 (Orphan_output_section::place_orphan_here): Add is_relro
16167 parameter.
16168 (Script_sections::Script_sections): Initialize
16169 data_segment_align_index_ and saw_relro_end_.
16170 (Script_sections::data_segment_align): New function.
16171 (Script_sections::data_segment_relro_end): New function.
16172 (Script_sections::place_orphan): Set or clear is_relro.
16173 (Script_sections::set_section_addresses): Force alignment of first
16174 TLS section.
16175 * yyscript.y (exp): Call script_data_segment_align and
16176 script_data_segment_relro_end.
16177 * testsuite/relro_script_test.t: New file.
16178 * testsuite/relro_test.cc (using_script): Declare.
16179 (t1, t2): Test using_script.
16180 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16181 (relro_script_test_SOURCES): Define.
16182 (relro_script_test_DEPENDENCIES): Define.
16183 (relro_script_test_LDFLAGS): Define.
16184 (relro_script_test_LDADD): Define.
16185 (relro_script_test.so): New target.
16186 * testsuite/Makefile.in: Rebuild.
16187
16188 2008-08-06 Cary Coutant <ccoutant@google.com>
16189
16190 * archive.cc (Archive::total_archives, Archive::total_members)
16191 (Archive::total_members_loaded): New variables.
16192 (Archive::setup): Add parameter. Add option to preread
16193 archive symbols.
16194 (Archive::read_armap): Add counter.
16195 (Archive::get_file_and_offset): New function.
16196 (Archive::get_elf_object_for_member): New function.
16197 (Archive::read_all_symbols): New function.
16198 (Archive::read_symbols): New function.
16199 (Archive::add_symbols): Add counters.
16200 (Archive::include_all_members): Use armap to find members if it's
16201 already built.
16202 (Archive::include_member): Skip reading symbols if already read.
16203 Factored code into Archive::get_file_and_offset and
16204 Archive::get_elf_object_for_member. Changed call to
16205 Mapfile::report_include_archive_member.
16206 (Archive::print_stats): New function.
16207 * archive.h: Declare Object and Read_symbols_data classes.
16208 (Archive::Archive): Add initializers for new members.
16209 (Archive::setup): Add parameter.
16210 (Archive::print_stats): New function.
16211 (Archive::total_archives, Archive::total_members)
16212 (Archive::total_members_loaded): New variables.
16213 (Archive::get_file_and_offset): New function.
16214 (Archive::get_elf_object_for_member): New function.
16215 (Archive::read_all_symbols): New function.
16216 (Archive::read_symbols): New function.
16217 (Archive::Archive_member): New class.
16218 (Archive::members_): New member.
16219 (Archive::num_members_): New member.
16220 * main.cc: Include archive.h.
16221 (main): Call Archive::print_stats.
16222 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16223 archive parameter; member_name is now the fully-decorated name.
16224 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16225 * options.h: (General_options): Add --preread-archive-symbols option.
16226 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16227 Archive::setup.
16228
16229 2008-08-04 Ian Lance Taylor <iant@google.com>
16230
16231 * symtab.h (Symbol::use_plt_offset): New function.
16232 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16233 * powerpc.cc (Relocate::relocate): Likewise.
16234 * sparc.cc (Relocate::relocate): Likewise.
16235 * x86_64.cc (Relocate::relocate): Likewise.
16236 * testsuite/weak_plt.sh: New test.
16237 * testsuite/weak_plt_main.cc: New test.
16238 * testsuite/weak_plt_shared.cc: New test.
16239 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16240 (check_PROGRAMS): Add weak_plt.
16241 (check_DATA): Add weak_plt_shared.so.
16242 (weak_plt_main_pic.o, weak_plt): New targets.
16243 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16244 * testsuite/Makefile.in: Rebuild.
16245
16246 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16247 gcctestdir/ld.
16248 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16249 * testsuite/Makefile.in: Rebuild.
16250
16251 2008-08-04 Alan Modra <amodra@bigpond.net.au>
16252
16253 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16254 * Makefile.in: Regenerate.
16255 * po/POTFILES.in: Regenerate.
16256
16257 2008-07-29 Ian Lance Taylor <iant@google.com>
16258
16259 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16260 symbols before other symbols.
16261 * testsuite/script_test_2.cc (test_addr): Declare.
16262 (test_addr_alias): Declare.
16263 (main): Check that test_addr and test_addr_alias have the right
16264 values.
16265 * testsuite/script_test_2.t: Define test_addr_alias and
16266 test_addr.
16267
16268 2008-07-24 Ian Lance Taylor <iant@google.com>
16269
16270 PR 5990
16271 * descriptors.cc: New file.
16272 * descriptors.h: New file.
16273 * gold-threads.h (class Hold_optional_lock): New class.
16274 * fileread.cc: Include "descriptors.h".
16275 (File_read::~File_read): Release descriptor rather than closing
16276 it.
16277 (File_read::open) [file]: Call open_descriptor rather than open.
16278 Set is_descriptor_opened_.
16279 (File_read::open) [memory]: Assert that descriptor is not open.
16280 (File_read::reopen_descriptor): New function.
16281 (File_read::release): Release descriptor.
16282 (File_read::do_read): Make non-const. Reopen descriptor.
16283 (File_read::read): Make non-const.
16284 (File_read::make_view): Reopen descriptor.
16285 (File_read::do_readv): Likewise.
16286 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16287 Update declarations.
16288 * layout.cc: Include "descriptors.h".
16289 (Layout::create_build_id): Use open_descriptor rather than open.
16290 * output.cc: Include "descriptors.h".
16291 (Output_file::open): Use open_descriptor rather than open.
16292 * archive.cc (Archive::const_iterator): Change Archive to be
16293 non-const.
16294 (Archive::begin, Archive::end): Make non-const.
16295 (Archive::count_members): Likewise.
16296 * archive.h (class Archive): Update declarations.
16297 * object.h (Object::read): Make non-const.
16298 * Makefile.am (CCFILES): Add descriptors.cc.
16299 (HFILES): Add descriptors.h.
16300 * Makefile.in: Rebuild.
16301
16302 PR 6716
16303 * gold.h: Always include <clocale>. Add Solaris workarounds
16304 following code in binutils/sysdep.h.
16305
16306 PR 6048
16307 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16308 this->eh_frame_hdr_ is NULL before using it.
16309
16310 * dynobj.cc (Versions::Versions): Update comment.
16311
16312 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16313 the base version name.
16314
16315 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16316 array size plus one.
16317 (Stringpool_template::set_string_offsets): Subtract one from key
16318 before using it as an array index.
16319 (Stringpool_template::get_offset_with_length): Likewise.
16320 (Stringpool_template::write_to_buffer): Likewise.
16321 * stringpool.h (Stringpool_template::get_offset_from_key):
16322 Likewise.
16323
16324 2008-07-23 Ian Lance Taylor <iant@google.com>
16325
16326 PR 6658
16327 * object.h (Merged_symbol_value::value): Do our best to handle a
16328 negative addend.
16329
16330 PR 6647
16331 * script.cc (Version_script_info::get_versions): Don't add empty
16332 version tag to return value.
16333 (Version_script_info::get_symbol_version_helper): Change return
16334 type to bool. Add pversion parameter. Change all callers.
16335 (script_register_vers_node): Don't require a non-NULL tag.
16336 * script.h (class Version_script_info): Update declarations.
16337 (Version_script_info::get_symbol_version): Change return type to
16338 bool. Add version parameter. Change all callers.
16339 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16340 handling. Handle an empty version from a version script.
16341 (Symbol_table::define_special_symbol): Likewise.
16342 * testsuite/ver_test_10.script: New file.
16343 * testsuite/ver_test_10.sh: New file.
16344 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16345 (check_DATA): Add ver_test_10.syms.
16346 (ver_test_10.syms, ver_test_10.so): New target.
16347 * testsuite/Makefile.in: Rebuild.
16348
16349 2008-07-23 Simon Baldwin <simonb@google.com>
16350
16351 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16352 to zero for undefined symbols from dynamic libraries.
16353
16354 2008-07-23 Ian Lance Taylor <iant@google.com>
16355
16356 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16357 Change all callers.
16358 * symtab.h (class Symbol_table): Update declaration.
16359 * testsuite/ver_test_9.cc: New file.
16360 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16361 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16362 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16363 (ver_test_9.so, ver_test_9.o): New targets.
16364 * testsuite/Makefile.in: Rebuild.
16365
16366 2008-07-22 Ian Lance Taylor <iant@google.com>
16367
16368 * options.h (class General_options): Define --check-sections.
16369 * layout.cc (Layout::set_segment_offsets): Handle
16370 --check-sections.
16371
16372 * options.h (class General_options): Define -n/--nmagic and
16373 -N/--omagic.
16374 * options.cc (General_options::finalize): For -n/--nmagic or
16375 -N/--omagic, set -static.
16376 * layout.cc (Layout::attach_allocated_section_to_segment): If
16377 -N/--omagic, don't put read-only and read-write sections in
16378 different segments.
16379 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16380 finding a read-only segment.
16381 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16382 don't set the minimum segment alignment to the common page size,
16383 and don't set the file offset to the address modulo the page size.
16384 * script-sections.cc (Script_sections::create_segments): If
16385 -n/--omagic, don't put read-only and read-write sections in
16386 different segments.
16387
16388 * cref.cc: New file.
16389 * cref.h: New file.
16390 * options.h (class General_options): Add --print-symbol-counts.
16391 * main.cc (main): Issue defined symbol report if requested.
16392 * archive.cc (Archive::interpret_header): Make into a const member
16393 function.
16394 (Archive::add_symbols): Call Input_objects::archive_start and
16395 archive_stop.
16396 (Archive::const_iterator): Define new class.
16397 (Archive::begin, Archive::end): New functions.
16398 (Archive::include_all_members): Rewrite to use iterator.
16399 (Archive::count_members): New function.
16400 * archive.h (class Archive): Update declarations.
16401 (Archive::filename): New function.
16402 * object.cc: Include "cref.h".
16403 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16404 (Sized_relobj::do_get_global_symbol_counts): New function.
16405 (Input_objects::add_object): Add object to cross-referencer.
16406 (Input_objects::archive_start): New function.
16407 (Input_objects::archive_stop): New function.
16408 (Input_objects::print_symbol_counts): New function.
16409 * object.h: Declare Cref and Archive.
16410 (Object::get_global_symbol_counts): New function.
16411 (Object::do_get_global_symbol_counts): New pure virtual function.
16412 (class Sized_relobj): Add defined_count_ field. Update
16413 declarations.
16414 (class Input_objects): Add cref_ field. Update constructor.
16415 Update declarations.
16416 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16417 defined_count_.
16418 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16419 symbol counts.
16420 (Sized_dynobj::do_get_global_symbol_counts): New function.
16421 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16422 defined_count_. Update declarations. Define Symbols typedef.
16423 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16424 parameter. Change all callers.
16425 (Symbol_table::add_from_dynobj): Add sympointers and defined
16426 parameters. Change all callers.
16427 * symtab.h (class Symbol_table): Update declarations.
16428 * Makefile.am (CCFILES): Add cref.cc.
16429 (HFILES): Add cref.h.
16430 * Makefile.in: Rebuild.
16431
16432 2008-07-22 Simon Baldwin <simonb@google.com>
16433
16434 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16435 to zero when writing undefined symbols.
16436
16437 2008-07-22 Ian Lance Taylor <iant@google.com>
16438
16439 * output.cc (Output_section::add_input_section): Don't try to
16440 merge empty merge sections.
16441
16442 2008-07-21 Craig Silverstein <csilvers@google.com>
16443
16444 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16445 Include symbol version in error message.
16446
16447 2008-07-20 Chris Demetriou <cgd@google.com>
16448
16449 * configure.ac (gold_cv_c_random_seed): New configured variable.
16450 (RANDOM_SEED_CFLAGS): New substituted variable.
16451 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16452 * configure: Rebuild.
16453 * Makefile.in: Likewise.
16454 * testsuite/Makefile.in: Likewise.
16455
16456 2008-07-18 Ian Lance Taylor <iant@google.com>
16457
16458 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16459 where we see NAME/NULL and NAME/VERSION as separate symbols.
16460 * testsuite/ver_test_main.cc (main): Call t4.
16461 (t4, t4_2a): Define.
16462 * testsuite/ver_test_2.cc (t4_2): Define.
16463 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16464 * testsuite/ver_test_4.cc (t4_2a): Define.
16465 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16466 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16467
16468 2008-07-17 Ian Lance Taylor <iant@google.com>
16469
16470 * dynobj.cc (Versions::add_def): If we give an error about a
16471 missing version, go ahead and create the version anyhow.
16472
16473 2008-07-10 Ian Lance Taylor <iant@google.com>
16474
16475 Handle output sections with more than 0x7fffffff bytes.
16476 * object.h (class Relobj): Change map_to_output_ to
16477 output_sections_, and just keep a section pointer. Change all
16478 uses. Move comdat group support to Sized_relobj.
16479 (Relobj::is_section_specially_mapped): Remove.
16480 (Relobj::output_section): Remove poff parameter. Change all
16481 callers.
16482 (Relobj::output_section_offset): New function.
16483 (Relobj::set_section_offset): Rewrite.
16484 (Relobj::map_to_output): Remove.
16485 (Relobj::output_sections): New function.
16486 (Relobj::do_output_section_offset): New pure virtual function.
16487 (Relobj::do_set_section_offset): Likewise.
16488 (class Sized_relobj): Add section_offsets_ field. Add comdat
16489 group support from Relobj. Update declarations.
16490 (Sized_relobj::get_output_section_offset): New function.
16491 (Sized_relobj::do_output_section_offset): New function.
16492 (Sized_relobj::do_set_section_offset): New function.
16493 * object.cc (Relobj::output_section_address): Remove.
16494 (Sized_relobj::Sized_relobj): Initialize new fields.
16495 (Sized_relobj::include_section_group): Cast find_kept_object to
16496 Sized_relobj.
16497 (Sized_relobj::include_linkonce_section): Likewise.
16498 (Sized_relobj::do_layout): Use separate arrays for output section
16499 and output offset.
16500 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16501 output_sections.
16502 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16503 output_sections and section_offsets.
16504 (Sized_relobj::write_local_symbols): Likewise.
16505 (map_to_kept_section): Compute output address directly.
16506 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16507 output_sections and section_offsets.
16508 (Sized_relobj::write_sections): Likewise.
16509 (Sized_relobj::relocate_sections): Likewise.
16510 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16511 * output.h (class Output_reloc): Update declarations. Change
16512 u2_.relobj to Sized_relobj*.
16513 (class Output_data_reloc): Change add functions to use
16514 Sized_relobj*.
16515 * output.cc (Output_reloc::Output_reloc): Change relobj to
16516 Sized_relobj*.
16517 (Output_reloc::local_section_offset): Change return type to
16518 Elf_Addr. Use get_output_section_offset.
16519 (Output_reloc::get_address): Likewise.
16520 (Output_section::is_input_address_mapped): Don't call
16521 is_section_specially_mapped.
16522 (Output_section::output_offset): Likewise.
16523 (Output_section::output_address): Likewise.
16524 (Output_section::starting_output_address): Likewise.
16525 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16526 parameter to Sized_relobj*.
16527 (Copy_relocs::need_copy_reloc): Likewise.
16528 (Copy_relocs::save): Likewise.
16529 * copy-relocs.h (class Copy_relocs): Update declarations.
16530 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16531 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16532 * target-reloc.h (relocate_for_relocatable): Change
16533 offset_in_output_section type to Elf_Addr. Change code that uses
16534 it as well.
16535 * layout.cc (Layout::layout): Always set *off.
16536 * mapfile.cc (Mapfile::print_input_section): Use
16537 output_section_offset.
16538 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16539 Sized_relobj*.
16540 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16541 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16542 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16543
16544 2008-07-03 Ian Lance Taylor <iant@google.com>
16545
16546 * layout.cc (Layout::include_section): Do not discard unrecognized
16547 SHT_STRTAB sections.
16548
16549 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16550
16551 * script.cc (Lex::can_continue_name): Make '?' allowable in
16552 version-script names.
16553 * testsuite/version_script.map: Change glob pattern to use '?'
16554
16555 2008-06-30 Manish Singh <yosh@gimp.org>
16556
16557 PR 6585
16558 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16559 Correct typo.
16560
16561 2008-06-30 Ian Lance Taylor <iant@google.com>
16562
16563 PR 6660
16564 PR 6682
16565 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16566 versions]: Don't try to read the value in the contents, since we
16567 don't use it. Use the template endianness when writing.
16568
16569 2008-06-25 Cary Coutant <ccoutant@google.com>
16570
16571 * fileread.cc (File_read::make_view): Assert on zero-length view.
16572 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16573 symbol table when there are no symbols to read.
16574
16575 2008-06-23 Craig Silverstein <csilvers@google.com>
16576
16577 * version.cc (version_string): Bump to 1.7
16578
16579 2008-06-18 Craig Silverstein <csilvers@google.com>
16580
16581 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16582 constant 0xFFFF to type Valtype.
16583 (Powerpc_relocate_functions::rel16_ha): Likewise.
16584
16585 2008-06-17 Ian Lance Taylor <iant@google.com>
16586
16587 * output.h (Output_section::Input_section): Initialize p2align_ to
16588 zero for Output_section_data constructors.
16589 (Output_section::Input_section::addralign): If not an input
16590 section, return the alignment of the Output_section_data.
16591 * testsuite/copy_test.cc: New file.
16592 * testsuite/copy_test_1.cc: New file.
16593 * testsuite/copy_test_2.cc: New file.
16594 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16595 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16596 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16597 (copy_test_1_pic.o, copy_test_1.so): New targets.
16598 (copy_test_2_pic.o, copy_test_2.so): New targets.
16599 * testsuite/Makefile.in: Rebuild.
16600
16601 * script-sections.cc (Script_sections::place_orphan): Initialize
16602 local variable exact.
16603
16604 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16605
16606 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16607
16608 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16609 David S. Miller <davem@davemloft.net>
16610
16611 * powerpc.cc: New file.
16612 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16613 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16614 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16615 * Makefile.in: Rebuild.
16616
16617 2008-06-09 Ian Lance Taylor <iant@google.com>
16618
16619 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16620 <exception>.
16621 (throwing, orig_terminate): New static variables.
16622 (terminate_handler): New static function.
16623 (t2): Set terminate handler.
16624
16625 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16626
16627 PR 6584
16628 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16629 alignment.
16630
16631 2008-05-30 Cary Coutant <ccoutant@google.com>
16632
16633 * archive.cc (Archive::include_all_members) Correct to step
16634 over symbol table and extended name table in thin archives.
16635
16636 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16637
16638 PR 6407
16639 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16640 calculation.
16641
16642 2008-05-28 Caleb Howe <cshowe@google.com>
16643
16644 * reduced_debug_output.cc: New file.
16645 * reduced_debug_output.h: New file.
16646 * options.h (class General_options): Add --strip-debug-non-line.
16647 * options.cc (General_options::finalize): Add strip_debug_non_line
16648 to the strip heirarchy.
16649 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16650 fields.
16651 * layout.cc: Include "reduced_debug_output.h".
16652 (Layout::Layout): Initialize new fields.
16653 (line_only_debug_sections): New static array.
16654 (is_lines_only_debug_sections): New static inline function.
16655 (Layout::include_section): Handle --strip-debug-non-line.
16656 (Layout::make_output_section): If --strip-debug-non-line, build
16657 new output sections for .debug_abbrev and .debug_info.
16658 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16659 gold. Warn about possible overflow.
16660 (read_signed_LEB_128): Likewise.
16661 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16662 (read_signed_LEB_128): Declare.
16663 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16664 (HFILES): Add reduced_debug_output.h.
16665 * Makefile.in: Rebuild.
16666
16667 2008-05-21 Ian Lance Taylor <iant@google.com>
16668
16669 * mapfile.cc: New file.
16670 * mapfile.h: New file.
16671 * options.h (class General_options): Add -M/--print-map and -Map.
16672 * options.cc (General_options::finalize): Make -M equivalent to
16673 -Map -.
16674 * main.cc: Include <cstdio> and "mapfile.h".
16675 (main): Open mapfile if requested.
16676 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16677 constructor. Change caller.
16678 (queue_initial_tasks): Add mapfile parameter. Change caller.
16679 (queue_middle_tasks): Likewise.
16680 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16681 declarations.
16682 * archive.cc: Include "mapfile.h".
16683 (Archive::add_symbols): Add mapfile parameter. Change all
16684 callers. Pass mapfile, symbol, and reason to include_member.
16685 (Archive::include_all_members): Add mapfile parameter. Change all
16686 callers.
16687 (Archive::include_member): Add mapfile, sym, and why parameters.
16688 Change all callers. Report inclusion to map file.
16689 * archive.h: Include "fileread.h".
16690 (class Archive): Update declarations.
16691 (Archive::file): New const method.
16692 (class Add_archive_symbols): Add mapfile_ field. Update
16693 constructor. Change all callers.
16694 * readsyms.h (class Read_symbols): Likewise.
16695 (class Finish_group): Likewise.
16696 (class Read_script): Likewise.
16697 * common.cc: Include "mapfile.h".
16698 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16699 all callers.
16700 (Symbol_table::do_allocate_commons): Likewise.
16701 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16702 symbol allocation to mapfile.
16703 * common.h (class Allocate_commons_task): Add mapfile_ field.
16704 Update constructor. Change all callers.
16705 * symtab.h (class Symbol_table): Update declarations.
16706 * layout.cc: Include "mapfile.h".
16707 (Layout_task_runner::run): Print information to mapfile.
16708 (Layout::create_gold_note): Change Output_data_fixed_space to
16709 Output_data_zero_fill.
16710 (Layout::create_build_id): Likewise.
16711 (Layout::print_to_mapfile): New function.
16712 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16713 constructor. Change caller.
16714 (class Layout): Declare print_to_mapfile.
16715 * output.cc (Output_section::Input_section::print_to_mapfile): New
16716 function.
16717 (Output_section::add_input_section): If producing a map, always
16718 add to input_sections_ list.
16719 (Output_section::do_print_to_mapfile): New function.
16720 (Output_segment::print_sections_to_mapfile): New function.
16721 (Output_segment::print_section_list_to_mapfile): New function.
16722 * output.h: Include "mapfile.h".
16723 (Output_data::print_to_mapfile): New function.
16724 (Output_data::do_print_to_mapfile): New virtual function.
16725 (Output_segment_headers::do_print_to_mapfile): New function.
16726 (Output_file_header::do_print_to_mapfile): New function.
16727 (Output_data_const::do_print_to_mapfile): New function.
16728 (class Output_data_const_buffer): Add map_name_ field. Update
16729 constructor. Change all callers. Add do_print_to_mapfile
16730 function.
16731 (class Output_data_fixed_space): Likewise.
16732 (class Output_data_space): Likewise.
16733 (class Output_data_zero_fill): New class.
16734 (Output_data_strtab::do_print_to_mapfile): New function.
16735 (Output_data_reloc_base::do_print_to_mapfile): New function.
16736 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16737 (Output_data_group::do_print_to_mapfile): New function.
16738 (Output_data_got::do_print_to_mapfile): New function.
16739 (Output_data_dynamic::do_print_to_mapfile): New function.
16740 (Output_symtab_xindex::do_print_to_mapfile): New function.
16741 (class Output_section): Declare do_print_to_mapflie. Declare
16742 print_to_mapfile in Input_section.
16743 (class Output_segment): Declare new functions.
16744 * object.h (Sized_relobj::symbol_count): New function.
16745 * script-sections.cc
16746 (Output_section_element_dot_assignment::set_section_addresses):
16747 Change Output_data_fixed_space to Output_data_zero_fill.
16748 (Output_data_expression::do_print_to_mapfile): New function.
16749 * script.cc (read_input_script): Add mapfile parameter. Change
16750 all callers.
16751 * script.h (read_input_script): Update declaration.
16752 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16753 (Eh_frame::do_print_to_mapfile): New function.
16754 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16755 (Output_merge_string::do_print_to_mapfile): New function.
16756 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16757 function.
16758 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16759 function.
16760 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16761 function.
16762 * Makefile.am (CCFILES): Add mapfile.cc.
16763 (HFILES): Add mapfile.h.
16764 * Makefile.in: Rebuild.
16765
16766 2008-05-19 Ian Lance Taylor <iant@google.com>
16767
16768 * options.h (class General_options): Add -z relro.
16769 * layout.cc (Layout::Layout): Initialize relro_segment_.
16770 (Layout::add_output_section_data): Return the output section.
16771 (Layout::make_output_section): Rcognize relro sections and mark
16772 them appropriately.
16773 (Layout::attach_allocated_section_to_segment): Put relro sections
16774 in a PT_GNU_RELRO segment.
16775 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16776 section as relro.
16777 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16778 PT_TLS segments.
16779 (Layout::linkonce_mapping): Map d.rel.ro.local to
16780 .data.rel.ro.local.
16781 (Layout::output_section_name): Us .data.rel.ro.local for any
16782 section which begins with that.
16783 * layout.h (class Layout): Update add_output_section_data
16784 declaration. Add relro_segment_ field.
16785 * output.cc (Output_section::Output_section): Initialize is_relro_
16786 and is_relro_local_ fields.
16787 (Output_segment::add_output_section): Group relro sections.
16788 (Output_segment::is_first_section_relro): New function.
16789 (Output_segment::maximum_alignment): If there is a relro section,
16790 align the segment to the common page size.
16791 (Output_segment::set_section_addresses): Track whether we are
16792 looking at relro sections. If the last section is a relro
16793 section, align to the common page size.
16794 (Output_segment::set_section_list_addresses): Add in_relro
16795 parameter. Change all callers. Align to the page size when
16796 moving from relro to non-relro section.
16797 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16798 segment.
16799 * output.h (class Output_section): Add is_relro_ and
16800 is_relro_local_ fields.
16801 (Output_section::is_relro): New function.
16802 (Output_section::set_is_relro): New function.
16803 (Output_section::is_relro_local): New function.
16804 (Output_section::set_is_relro_local): New function.
16805 (class Output_segment): Update declarations.
16806 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16807 * sparc.cc (Target_sparc::got_section): Likewise.
16808 * x86_64.cc (Target_x86_64::got_section): Likewise.
16809 * testsuite/relro_test_main.cc: New file.
16810 * testsuite/relro_test.cc: New file.
16811 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16812 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16813 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16814 (relro_test.so, relro_test_pic.o): New targets.
16815 * testsuite/Makefile.in: Rebuild.
16816
16817 2008-05-16 Ian Lance Taylor <iant@google.com>
16818
16819 * output.cc (Output_segment::add_output_section): Remove front
16820 parameter.
16821 * output.h (class Output_segment): Remove
16822 add_initial_output_section and overloaded add_output_section.
16823 Update declaration of remaining add_output_section.
16824 * layout.cc (Layout::create_interp): Call add_output_section
16825 rather than add_initial_output_section.
16826 (Layout::finish_dynamic_section): Likewise.
16827
16828 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16829 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16830 know the dynamic type.
16831 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16832 field. Initialize it in constructor.
16833 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16834 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16835 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16836 reloc.
16837
16838 * output.cc (Output_reloc::get_address): Change return type to
16839 Elf_Addr.
16840 * output.h (class Output_reloc): Update get_address declaration.
16841 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16842 for section addresses.
16843
16844 2008-05-09 Ian Lance Taylor <iant@google.com>
16845
16846 PR 6493
16847 * gold.cc (gold_nomem): Use return value of write.
16848
16849 2008-05-08 Ian Lance Taylor <iant@google.com>
16850
16851 * symtab.c (Symbol::init_base_output_data): Add version
16852 parameter. Change all callers.
16853 (Symbol::init_base_output_segment): Likewise.
16854 (Symbol::init_base_constant): Likewise.
16855 (Symbol::init_base_undefined): Likewise.
16856 (Sized_symbol::init_output_data): Likewise.
16857 (Sized_symbol::init_output_segment): Likewise.
16858 (Sized_symbol::init_constant): Likewise.
16859 (Sized_symbol::init_undefined): Likewise.
16860 (Symbol_table::do_define_in_output_data): If the new symbol has a
16861 version, mark it as the default.
16862 (Symbol_table::do_define_in_output_segment): Likewise.
16863 (Symbol_table::do_define_as_constant): Likewise.
16864 * symtab.h (class Symbol): Update declarations.
16865 (class Sized_symbol): Likewise.
16866 * resolve.cc (Symbol::override_version): New function.
16867 (Symbol::override_base): Call override_version.
16868 (Symbol::override_base_with_special): Likewise.
16869 * testsuite/ver_script_8.script: New file.
16870 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16871 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16872 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16873 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16874
16875 2008-05-06 Ian Lance Taylor <iant@google.com>
16876
16877 PR 6049
16878 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16879 functions.
16880 (class General_options): Remove existing --undefined, and add
16881 --no-undefined instead. Add new --undefined as synonym for -u.
16882 * archive.cc (Archive::add_symbols): Check whether symbol was
16883 named with -u.
16884 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16885 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16886 all uses. Add IS_UNDEFINED. Update declarations to split
16887 different versions of init_base. Declare init_base_undefined.
16888 (Symbol::is_defined): Handle IS_UNDEFINED.
16889 (Symbol::is_undefined): Likewise.
16890 (Symbol::is_weak_undefined): Call is_undefined.
16891 (Symbol::is_absolute): Handle IS_CONSTANT.
16892 (class Sized_symbol): Update declarations to split different
16893 versions of init. Declare init_undefined.
16894 (class Symbol_table): Declare new functions.
16895 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16896 Change all callers.
16897 (Symbol::init_base_output_data): Likewise.
16898 (Symbol::init_base_output_segment): Likewise.
16899 (Symbol::init_base_constant): Likewise.
16900 (Symbol::init_base_undefined): New function.
16901 (Sized_symbol::init_object): Rename from init. Change all
16902 callers.
16903 (Sized_symbol::init_output_data): Likewise.
16904 (Sized_symbol::init_output_segment): Likewise.
16905 (Sized_symbol::init_constant): Likewise.
16906 (Sized_symbol::init_undefined): New function.
16907 (Symbol_table::add_undefined_symbols_from_command_line): New
16908 function.
16909 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16910 function.
16911 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16912 (Symbol::output_section): Likewise.
16913 (Symbol::set_output_section): Likewise.
16914 (Symbol_table::sized_finalize_symbol): Likewise.
16915 (Symbol_table::sized_write_globals): Likewise.
16916 * resolve.cc (Symbol_table::should_override): Likewise.
16917 (Symbol::override_base_with_special): Likewise.
16918
16919 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16920 symbol, change it to have default visibility.
16921 * testsuite/protected_1.cc: New file.
16922 * testsuite/protected_2.cc: New file.
16923 * testsuite/protected_3.cc: New file.
16924 * testsuite/protected_main_1.cc: New file.
16925 * testsuite/protected_main_2.cc: New file.
16926 * testsuite/protected_main_3.cc: New file.
16927 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16928 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16929 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16930 (protected_1.so): New target.
16931 (protected_1_pic.o, protected_2_pic.o): New targets.
16932 (protected_3_pic.o): New target.
16933 (check_PROGRAMS): Add protected_2.
16934 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16935 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16936 * testsuite/Makefile.in: Rebuild.
16937
16938 * options.h (DEFINE_var): Add set_user_set_##varname__.
16939 (DEFINE_bool_alias): New macro.
16940 (class General_options): Define -Bstatic using DEFINE_bool_alias
16941 rather than DEFINE_special. Add --undefined as an alias for -z
16942 defs.
16943 * options.cc (General_options::parse_Bstatic): Remove.
16944
16945 * options.h (class General_options): Add --fatal-warnings.
16946 * main.cc (main): Implement --fatal-warnings.
16947 * errors.h (Errors::warning_count): New function.
16948
16949 * options.h (class General_options): Add -Bsymbolic-functions.
16950 * symtab.h (Symbol::is_preemptible): Check for
16951 -Bsymbolic-functions.
16952
16953 2008-05-05 Ian Lance Taylor <iant@google.com>
16954
16955 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16956 as noVARNAME rather than no-VARNAME.
16957 (class General_options): Add option -z combreloc.
16958 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16959 get_address.
16960 (Output_reloc::sort_before) [SHT_REL]: New function.
16961 (Output_reloc::sort_before) [SHT_RELA]: New function.
16962 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16963 Sort_relocs_comparison.
16964 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16965 parameter. Change all callers.
16966 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16967 sort_relocs parameter. Change all callers.
16968 * output.cc (Output_reloc::get_address): New function, broken out
16969 of write_rel.
16970 (Output_reloc::write_rel): Call it.
16971 (Output_reloc::compare): New function.
16972 (Output_data_reloc_base::do_write): Optionally sort relocs.
16973
16974 * configure.ac: If targ_extra_obj is set, link it in.
16975 * configure.tgt: Initialize all variables.
16976 (x86_64*): Set targ_extra_obj and targ_extra_size.
16977 * configure: Rebuild.
16978
16979 * object.cc (Sized_relobj::include_section_group): Adjust section
16980 indexes read from group data. Build vector to pass to
16981 layout_group.
16982 * layout.cc (Layout::layout_group): Add flags and shndxes
16983 parameters. Remove contents parameter. Change caller. Update
16984 explicit instantiations.
16985 * layout.h (class Layout): Update layout_group declaration.
16986 * output.cc (Output_data_group::Output_data_group): Add flags and
16987 input_shndxes parameters. Remove contents parameter. Change
16988 caller.
16989 (Output_data_group::do_write): Change input_sections_ to
16990 input_shndxes_.
16991 * output.h (class Output_data_group): Update constructor
16992 declaration. Rename input_sections_ to input_shndxes_.
16993 * testsuite/many_sections_test.cc: Add template.
16994
16995 2008-04-30 Cary Coutant <ccoutant@google.com>
16996
16997 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16998
16999 * layout.cc (Layout::include_section): Refactored check for debug
17000 info section.
17001 (Layout::add_comdat): Add new parameters. Change type
17002 of signature parameter. Add object and shndx to signatures table.
17003 (Layout::find_kept_object): New function.
17004 * layout.h: Include <cstring>.
17005 (Layout::is_debug_info_section): New function.
17006 (Layout::add_comdat): Add new parameters.
17007 (Layout::find_kept_object): New function.
17008 (Layout::Kept_section): New struct.
17009 (Layout::Signatures): Change type of map range.
17010 * object.cc (Relobj::output_section_address): New function.
17011 (Sized_relobj::include_section_group): Add new parameters. Change
17012 calls to Layout::add_comdat. Change to build table of kept comdat
17013 groups and table mapping discarded sections to kept sections.
17014 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
17015 (Sized_relobj::do_layout): Change calls to include_section_group and
17016 include_linkonce_section.
17017 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
17018 value to zero when section is discarded.
17019 (Sized_relobj::map_to_kept_section): New function.
17020 * object.h (Relobj::output_section_address): New function.
17021 (Relobj::Comdat_group): New type.
17022 (Relobj::find_comdat_group): New function.
17023 (Relobj::Comdat_group_table): New type.
17024 (Relobj::Kept_comdat_section): New type.
17025 (Relobj::Kept_comdat_section_table): New type.
17026 (Relobj::add_comdat_group): New function.
17027 (Relobj::set_kept_comdat_section): New function.
17028 (Relobj::get_kept_comdat_section): New function.
17029 (Relobj::comdat_groups_): New field.
17030 (Relobj::kept_comdat_sections_): New field.
17031 (Symbol_value::input_value): Update comment.
17032 (Sized_relobj::map_to_kept_section) New function.
17033 (Sized_relobj::include_linkonce_section): Add new parameter.
17034 * target-reloc.h (Comdat_behavior): New type.
17035 (get_comdat_behavior): New function.
17036 (relocate_section): Add code to map a discarded section to the
17037 corresponding kept section when applying a relocation.
17038
17039 2008-04-30 Craig Silverstein <csilvers@google.com>
17040
17041 * dwarf_reader.cc (next_generation_count): New static var.
17042 (Addr2line_cache_entry): New struct.
17043 (addr2line_cache): New static var.
17044 (Dwarf_line_info::one_addr2line): Added caching.
17045 (Dwarf_line_info::clear_addr2line_cache): New function.
17046 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
17047 cache-size parameter.
17048 (Dwarf_line_info::one_addr2line_cache): New function.
17049 * symtab.cc (Symbol_table::detect_odr_violations): Pass
17050 new cache-size argument to one_addr2line(), and clear cache.
17051
17052 2008-04-28 Cary Coutant <ccoutant@google.com>
17053
17054 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
17055 R_386_PC8 relocations.
17056
17057 2008-04-23 Ian Lance Taylor <iant@google.com>
17058
17059 * object.cc (Sized_relobj::include_section_group): Check for
17060 invalid section group.
17061
17062 * object.cc (make_elf_object): Correct test for 64-bit ELF file
17063 header size.
17064
17065 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
17066 than read for file header.
17067 * archive.cc (Archive::include_member): Likewise.
17068
17069 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
17070
17071 * aclocal.m4: Regenerate.
17072 * configure: Regenerate.
17073
17074 2008-04-19 Ian Lance Taylor <iant@google.com>
17075
17076 * version.cc (version_string): Bump to 1.6.
17077
17078 * testsuite/Makefile.am (many_sections_r_test): New target.
17079 (many_sections_r_test_SOURCES): Remove.
17080 (many_sections_r_test_DEPENDENCIES): Remove.
17081 (many_sections_r_test_LDFLAGS): Remove.
17082 (many_sections_r_test_LDADD): Remove.
17083
17084 * object.cc (Sized_relobj::do_add_symbols): Always pass
17085 local_symbol_count_ to add_from_relobj.
17086
17087 * testsuite/Makefile.am (many_sections_check.h): Only check one in
17088 every thousand variables.
17089 * testsuite/Makefile.in: Rebuild.
17090
17091 * object.cc (Xindex::initialize_symtab_xindex): New function.
17092 (Xindex::read_symtab_xindex): New function.
17093 (Xindex::sym_xindex_to_shndx): New function.
17094 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
17095 available.
17096 (Sized_relobj::do_initialize_xindex): New function.
17097 (Sized_relobj::do_read_symbols): Adjust section links.
17098 (Sized_relobj::symbol_section_and_value): Add is_ordinary
17099 parameter. Change all callers.
17100 (Sized_relobj::include_section_group): Adjust section links and
17101 symbol section indexes.
17102 (Sized_relobj::do_layout): Adjust section links.
17103 (Sized_relobj::do_count_local_symbols): Adjust section links and
17104 symbol section indexes.
17105 (Sized_relobj::do_finalize_local_symbols): Distinguish between
17106 ordinary and special symbols.
17107 (Sized_relobj::write_local_symbols): Add symtab_xindex and
17108 dynsym_xindex parameters. Change all callers. Adjust section
17109 links. Use SHN_XINDEX when needed.
17110 (Sized_relobj::get_symbol_location_info): Adjust section links.
17111 Don't get fooled by special symbols.
17112 * object.h (class Xindex): Define.
17113 (class Object): Add xindex_ parameter. Declare virtual functoin
17114 do_initialize_xindex.
17115 (Object::adjust_sym_shndx): New function.
17116 (Object::set_xindex): New protected function.
17117 (class Symbol_value): Add is_ordinary_shndx_ field.
17118 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
17119 (Symbol_value::value): Assert ordinary section.
17120 (Symbol_value::initialize_input_to_output_map): Likewise.
17121 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
17122 Change all callers.
17123 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
17124 all callers.
17125 (class Sized_relobj): Update declarations.
17126 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
17127 parameter. Change all callers.
17128 (Sized_relobj::adjust_shndx): New function.
17129 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
17130 field.
17131 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
17132 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17133 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17134 (Sized_dynobj::read_dynsym_section): Adjust section links.
17135 (Sized_dynobj::read_dynamic): Likewise.
17136 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17137 section links.
17138 (Sized_dynobj::do_initialize_xindex): New function.
17139 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17140 do_initialize_xindex.
17141 (Sized_dynobj::adjust_shndx): New function.
17142 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17143 dynsym_xindex_ fields.
17144 (Layout::finalize): Add a call to set_section_indexes before
17145 creating the symtab sections.
17146 (Layout::set_section_indexes): Don't do anything if the section
17147 already has a section index.
17148 (Layout::create_symtab_sections): Add shnum parameter. Change
17149 caller. Create .symtab_shndx section if needed.
17150 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17151 caller.
17152 (Layout::allocated_output_section_count): New function.
17153 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17154 needed.
17155 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17156 fields. Update declarations.
17157 (Layout::symtab_xindex): New function.
17158 (Layout::dynsym_xindex): New function.
17159 (class Write_symbols_task): Add layout_ field.
17160 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17161 Change caller.
17162 * output.cc (Output_section_headers::Output_section_headers): Add
17163 shstrtab_section parameter. Change all callers.
17164 (Output_section_headers::do_sized_write): Store overflow values
17165 for section count and section string table section index in
17166 section header zero.
17167 (Output_file_header::do_sized_write): Check for overflow of
17168 section count and section string table section index.
17169 (Output_symtab_xindex::do_write): New function.
17170 (Output_symtab_xindex::endian_do_write): New function.
17171 * output.h (class Output_section_headers): Add shstrtab_section_.
17172 Update declarations.
17173 (class Output_symtab_xindex): Define.
17174 (Output_section::has_out_shndx): New function.
17175 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17176 field.
17177 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17178 Change all callers.
17179 (Sized_symbol::init): Likewise.
17180 (Symbol::output_section): Check for ordinary symbol.
17181 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17182 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17183 callers.
17184 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17185 Change all callers. Simplify handling of symbols from sections
17186 not included in the link.
17187 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17188 distinction.
17189 (Weak_alias_sorter::operator()): Assert that symbols are
17190 ordinary.
17191 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17192 distinction.
17193 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17194 parameters. Change all callers.
17195 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17196 symbol distinction. Use SHN_XINDEX when needed.
17197 (Symbol_table::write_section_symbol): Add symtab_xindex
17198 parameter. Change all callers.
17199 (Symbol_table::sized_write_section_symbol): Likewise. Use
17200 SHN_XINDEX when needed.
17201 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17202 declarations.
17203 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17204 (Symbol::is_defined): Check is_ordinary.
17205 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17206 (Symbol::is_absolute, Symbol::is_common): Likewise.
17207 (class Sized_symbol): Update declarations.
17208 (class Symbol_table): Update declarations.
17209 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17210 parameters. Change all callers.
17211 (Sized_symbol::override): Likewise.
17212 (Symbol_table::override): Likewise.
17213 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17214 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17215 is_ordinary, and orig_st_shndx parameters. Change all callers.
17216 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17217 to be in an ordinary section.
17218 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17219 object and is_ordinary parameters. Change all callers.
17220 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17221 Change all callers. Don't add undefined or non-ordinary symbols
17222 to reloc_map_.
17223 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17224 Change all callers.
17225 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17226 declarations.
17227 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17228 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17229 (Sized_relobj::relocate_sections): Likewise.
17230 * target-reloc.h (scan_relocs): Adjust section symbol index.
17231 (scan_relocatable_relocs): Likewise.
17232 * i386.cc (Scan::local): Check for ordinary symbols.
17233 * sparc.cc (Scan::local): Likewise.
17234 * x86_64.cc (Scan::local): Likewise.
17235 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17236 to symbol_section_and_value.
17237 * testsuite/many_sections_test.cc: New file.
17238 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17239 (check_PROGRAMS): Add many_sections_test.
17240 (many_sections_test_SOURCES): Define.
17241 (many_sections_test_DEPENDENCIES): Define.
17242 (many_sections_test_LDFLAGS): Define.
17243 (BUILT_SOURCES): Add many_sections_define.h.
17244 (many_sections_define.h): New target.
17245 (BUILT_SOURCES): Add many_sections_check.h.
17246 (many_sections_check.h): New target.
17247 (check_PROGRAMS): Add many_sections_r_test.
17248 (many_sections_r_test_SOURCES): Define.
17249 (many_sections_r_test_DEPENDENCIES): Define.
17250 (many_sections_r_test_LDFLAGS): Define.
17251 (many_sections_r_test_LDADD): Define.
17252 (many_sections_r_test.o): New target.
17253 * testsuite/Makefile.in: Rebuild.
17254
17255 2008-04-17 Cary Coutant <ccoutant@google.com>
17256
17257 * errors.cc (Errors::info): New function.
17258 (gold_info): New function.
17259 * errors.h (Errors::info): New function.
17260 * gold.h (gold_info): New function.
17261 * object.cc (Input_objects::add_object): Print trace output.
17262 * options.cc (options::parse_set): New function.
17263 (General_options::parse_wrap): Deleted.
17264 (General_options::General_options): Deleted initializer.
17265 * options.h (options::String_set): New typedef.
17266 (options::parse_set): New function.
17267 (DEFINE_set): New macro.
17268 (General_options::wrap): Changed to use DEFINE_set. Changed
17269 callers of any_wrap_symbols and is_wrap_symbol.
17270 (General_options::trace, General_options::trace_symbol):
17271 New options.
17272 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17273 (General_options::wrap_symbols_): Deleted.
17274 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17275
17276 2008-04-17 David S. Miller <davem@davemloft.net>
17277
17278 * options.cc (General_options::parse_V): New function.
17279 * options.h: Add entries for -V and -Qy.
17280
17281 2008-04-17 Ian Lance Taylor <iant@google.com>
17282
17283 * common.cc (Symbol_table::allocate_commons): Remove options
17284 parameter. Change caller.
17285 (Symbol_table::do_allocate_commons): Remove options parameter.
17286 Change caller. Just call do_allocate_commons_list twice.
17287 (Symbol_table::do_allocate_commons_list): New function, broken out
17288 of do_allocate_commons.
17289 * common.h (class Allocate_commons_task): Remove options_ field.
17290 Update constructor.
17291 * symtab.cc (Symbol_table::Symbol_table): Initialize
17292 tls_commons_.
17293 (Symbol_table::add_from_object): Put TLS common symbols on
17294 tls_commons_ list.
17295 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17296 which are IN_OUTPUT_DATA.
17297 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17298 allocate_commons and do_allocate_commons declarations. Declare
17299 do_allocate_commons_list.
17300 * gold.cc (queue_middle_tasks): Update creation of
17301 Allocate_commons_task to not pass options.
17302 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17303 (TLS_TEST_C_FLAGS): New variable.
17304 (tls_test_c_pic.o): New target.
17305 (tls_test_shared.so): Link in tls_test_c_pic.o.
17306 (tls_test_c_pic_ie.o): New target.
17307 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17308 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17309 (tls_test_c.o): New target.
17310 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17311 (tls_pic_test_LDADD): Likewise.
17312 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17313 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17314 (tls_test_c_gnu2.o): New target.
17315 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17316 tls_test_c_gnu2.o.
17317 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17318 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17319 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17320 * testsuite/tls_test.cc: Include "config.h".
17321 (t_last): Call t11_last.
17322 * testsuite/tls_test.h (t11, t11_last): Declare.
17323 * testsuite/tls_test_c.c: New file.
17324 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17325 * configure.ac: Check for OpenMP support.
17326 * configure, config.in, Makefile.in: Rebuild.
17327 * testsuite/Makefile.in: Rebuild.
17328
17329 2008-04-16 Cary Coutant <ccoutant@google.com>
17330
17331 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17332 (Target_i386::tls_base_symbol_defined_): New field.
17333 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17334 (Target_i386::Scan::global): Likewise.
17335 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17336 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17337 (Target_x86_64::tls_base_symbol_defined_): New field.
17338 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17339 (Target_x86_64::Scan::global): Likewise.
17340
17341 2008-04-16 Cary Coutant <ccoutant@google.com>
17342
17343 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17344 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17345 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17346 building shared libraries.
17347 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17348 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17349 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17350 * testsuite/Makefile.in: Rebuild.
17351 * testsuite/weak_undef.h: New file.
17352 * testsuite/weak_undef_file1.cc: Add extra test cases.
17353 * testsuite/weak_undef_file2.cc: Likewise.
17354 * testsuite/weak_undef_test.cc: Likewise.
17355
17356 2008-04-16 David S. Miller <davem@davemloft.net>
17357
17358 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17359 Add issued_non_pic_error_ field. Declare check_non_pic.
17360 (Target_sparc::Scan::check_non_pic): New function.
17361 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17362 (Target_sparc::Scan::global): Likewise.
17363
17364 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17365 * configure: Rebuild.
17366
17367 * options.h (DEFINE_enable): New macro.
17368 (new_dtags): New enable option.
17369 (initfirst, interpose, loadfltr, nodefaultlib,
17370 nodelete, nodlopen, nodump): New -z options.
17371 * layout.cc (Layout:finish_dynamic_section): If new
17372 dtags enabled, emit DT_RUNPATH. Also, emit a
17373 DT_FLAGS_1 containing any specified -z flags.
17374
17375 2008-04-16 Ian Lance Taylor <iant@google.com>
17376
17377 * copy-relocs.cc: New file.
17378 * copy-relocs.h: New file.
17379 * reloc.cc: Remove Copy_relocs code.
17380 * reloc.h: Likewise.
17381 * reloc-types.h (struct Reloc_types) [both versions]: Add
17382 get_reloc_addend_noerror.
17383 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17384 variants of add_global which take an addend which must be zero.
17385 * i386.cc: Include "copy-relocs.h".
17386 (class Target_i386): Change type of copy_relocs_ to variable,
17387 update initializer.
17388 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17389 Change all callers.
17390 (Target_i386::do_finalize_sections): Change handling of
17391 copy_relocs_.
17392 * sparc.cc: Include "copy-relocs.h".
17393 (class Target_sparc): Change type of copy_relocs_ to variable,
17394 update initializer.
17395 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17396 Change all callers.
17397 (Target_sparc::do_finalize_sections): Change handling of
17398 copy_relocs_.
17399 * x86_64.cc: Include "copy-relocs.h".
17400 (class Target_x86_64): Change type of copy_relocs_ to variable,
17401 update initializer.
17402 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17403 class. Change all callers.
17404 (Target_x86_64::do_finalize_sections): Change handling of
17405 copy_relocs_.
17406 * Makefile.am (CCFILES): Add copy-relocs.cc.
17407 (HFILES): Add copy-relocs.h.
17408
17409 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17410
17411 * testsuite/script_test_4.sh: Permit leading zeroes.
17412
17413 2008-04-15 Ian Lance Taylor <iant@google.com>
17414
17415 * script-sections.cc (Script_sections::create_segments): Use
17416 header_size_adjustment even when there is enough room for the
17417 headers.
17418 * testsuite/script_test_4.sh: New file.
17419 * testsuite/script_test_4.t: New file.
17420 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17421 (check_DATA): Add script_test_4.stdout.
17422 (MOSTLYCLEANFILES): Likewise.
17423 (script_test_4): New target.
17424 (script_test_4.stdout): New target.
17425 * testsuite/Makefile.in: Rebuild.
17426
17427 * sparc.cc: Add definitions for Output_data_plt_sparc class
17428 constants.
17429
17430 2008-04-14 David S. Miller <davem@davemloft.net>
17431
17432 * sparc.cc: New file.
17433 * Makefile.am (TARGETSOURCES): Add sparc.cc
17434 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17435 * configure.tgt: Document targ_extra_size and
17436 targ_extra_big_endian. Add entries for sparc-* and
17437 sparc64-*.
17438 * configure.ac: Handle targ_extra_size and
17439 targ_extra_big_endian.
17440 * Makefile.in: Rebuild.
17441 * configure: Likewise.
17442 * po/POTFILES.in: Likewise.
17443 * po/gold.pot: Likewise.
17444
17445 2008-04-14 Ian Lance Taylor <iant@google.com>
17446
17447 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17448 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17449 in the name/type/flags to section mapping. Don't call
17450 allocate_output_section.
17451 (Layout::choose_output_section): Change parameter from adjust_name
17452 to is_input_section. Don't permit input sections after sections
17453 are attached to segments. Don't call allocate_output_section.
17454 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17455 not write_enable_output_section.
17456 (Layout::make_output_section): Don't push to
17457 unattached_section_list_ nor call attach_to_segment. Call
17458 attach_section_to_segment if sections are attached.
17459 (Layout::attach_sections_to_segments): New function.
17460 (Layout::attach_section_to_segment): New function.
17461 (Layout::attach_allocated_section_to_segment): Rename from
17462 attach_to_segment. Remove flags parameter.
17463 (Layout::allocate_output_section): Remove function.
17464 (Layout::write_enable_output_section): Remove function.
17465 * layout.h (class Layout): Update for above changes. Add new
17466 field sections_are_attached_.
17467 * output.h (Output_section::update_flags_for_input_section): New
17468 function.
17469 * output.cc (Output_section::add_input_section): Call
17470 update_flags_for_input_section.
17471 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17472
17473 2008-04-11 Cary Coutant <ccoutant@google.com>
17474
17475 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17476 thought unnecessary.
17477 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17478
17479 2008-04-11 Ian Lance Taylor <iant@google.com>
17480
17481 * output.h (class Output_section_data): Remove inline definition
17482 of set_addralign.
17483 * output.cc (Output_section_data::set_addralign): New function.
17484
17485 2008-04-11 Cary Coutant <ccoutant@google.com>
17486
17487 Add support for TLS descriptors for i386 and x86_64.
17488 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17489 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17490 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17491 GOT_TYPE_TLS_DESC.
17492 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17493 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17494 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17495 relocations.
17496 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17497 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17498 Fix problem with initial-exec relocations.
17499 (Target_i386::Relocate::relocate_tls): Likewise.
17500 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17501 relaxation.
17502 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17503 support for section-plus-offset dynamic table entries.
17504 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17505 (Output_data_dynamic::Dynamic_entry): Add support for
17506 section-plus-offset dynamic table entries.
17507 (Output_data_dynamic::Classification): Likewise.
17508 (Output_data_dynamic::classification_): Renamed offset_.
17509 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17510 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17511 (Target_x86_64::make_plt_section): New function.
17512 (Target_x86_64::reserve_tlsdesc_entries): New function.
17513 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17514 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17515 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17516 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17517 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17518 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17519 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17520 add extra PLT entry for TLS descriptors.
17521 (Output_data_plt_x86_64::got_): New field.
17522 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17523 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17524 fields.
17525 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17526 descriptors.
17527 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17528 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17529 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17530 R_386_TLS_DESC_CALL relocations.
17531 (Target_x86_64::Scan::global): Likewise.
17532 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17533 for TLS descriptors.
17534 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17535 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17536 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17537 GD-to-IE relaxation.
17538 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17539 and TLS_DESCRIPTORS.
17540 * Makefile.in: Rebuild.
17541 * configure: Rebuild.
17542 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17543 (tls_test_shared2.so): New target.
17544 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17545 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17546 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17547 (tls_shared_gd_to_ie_test_LDADD): New variable.
17548 (tls_shared_gnu2_gd_to_ie_test): New target.
17549 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17550 New targets.
17551 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17552 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17553 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17554 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17555 (tls_shared_gnu2_test): New target.
17556 (tls_test_gnu2_shared.so): New target.
17557 (tls_shared_gnu2_test_SOURCES): New variable.
17558 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17559 (tls_shared_gnu2_test_LDFLAGS): New variable.
17560 (tls_shared_gnu2_test_LDADD): New variable.
17561 * testsuite/Makefile.in: Rebuild.
17562 * testsuite/Makefile.
17563
17564 2008-04-11 Ian Lance Taylor <iant@google.com>
17565
17566 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17567 justsyms.t.
17568 * testsuite/Makefile.in: Rebuild.
17569
17570 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17571 long.
17572 * testsuite/script_test_2.cc (main): Adjust test.
17573
17574 2008-04-11 David S. Miller <davem@davemloft.net>
17575 Ian Lance Taylor <iant@google.com>
17576
17577 * options.h (General_options): Add entries for '-Y' and
17578 '-relax'.
17579 * options.cc (General_options:finalize): If -Y was used, add those
17580 entries to the library path instead of the default "/lib" and
17581 "/usr/lib".
17582
17583 2008-04-11 David S. Miller <davem@davemloft.net>
17584
17585 * testsuite/justsyms.t: Start at 0x100.
17586 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17587 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17588 long.
17589 * testsuite/script_test_2.cc: Adjust string and section length
17590 checks.
17591
17592 2008-04-09 Ian Lance Taylor <iant@google.com>
17593
17594 PR gold/5996
17595 * script-sections.cc (Sections_element::allocate_to_segment): Add
17596 orphan parameter.
17597 (Output_section_definition::allocate_to_segment): Likewise.
17598 (Orphan_output_section::allocate_to_segment): Likewise.
17599 (Script_sections::attach_sections_using_phdrs_clause): Don't
17600 propagate non-PT_LOAD segments to orphan sections.
17601 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17602 readelf rather than objdump.
17603 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17604 .interp section and PT_INTERP segment are the same size.
17605 * testsuite/Makefile.in: Rebuild.
17606
17607 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17608 aliases for symbols defined in the same object.
17609 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17610 (weak_alias_test_SOURCES): New variable.
17611 (weak_alias_test_DEPENDENCIES): New variable.
17612 (weak_alias_test_LDFLAGS): New variable.
17613 (weak_alias_test_LDADD): New variable.
17614 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17615 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17616 (weak_alias_test_3.o): New target.
17617 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17618 * testsuite/weak_alias_test_main.cc: New file.
17619 * testsuite/weak_alias_test_1.cc: New file.
17620 * testsuite/weak_alias_test_2.cc: New file.
17621 * testsuite/weak_alias_test_3.cc: New file.
17622
17623 2008-04-08 Ian Lance Taylor <iant@google.com>
17624
17625 * options.h (class General_options): Add --noinhibit-exec option.
17626 * main.cc (main): Check --noinhibit-exec.
17627
17628 * options.h (class General_options): Define --wrap as a special
17629 option. Add wrap_symbols_ field.
17630 (General_options::any_wrap_symbols): New function.
17631 (General_options::is_wrap_symbol): New function.
17632 * options.cc (General_options::parse_wrap): New function.
17633 (General_options::General_options): Initialize wrap_symbols_.
17634 * symtab.cc (Symbol_table::wrap_symbol): New function.
17635 (Symbol_table::add_from_object): Handle --wrap.
17636 * symtab.h (class Symbol_table): Declare wrap_symbol.
17637 * target.h (Target::wrap_char): New function.
17638 (Target::Target_info): Add wrap_char field.
17639 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17640 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17641 * testsuite/testfile.cc (Target_test::test_target_info):
17642 Likewise.
17643
17644 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17645 there is one.
17646
17647 * layout.h (class Layout): Add added_eh_frame_data_ field.
17648 * layout.cc (Layout::Layout): Initialize new field.
17649 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17650 output section until we find a section we merged successfully.
17651 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17652 that the size be non-zero.
17653
17654 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17655 qualifier.
17656
17657 2008-04-08 Craig Silverstein <csilvers@google.com>
17658
17659 * configure.ac: Export new conditional variable HAVE_ZLIB.
17660 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17661 on HAVE_ZLIB.
17662 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17663 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17664
17665 2008-04-07 Ian Lance Taylor <iant@google.com>
17666
17667 * version.cc (version_string): Set to "1.5".
17668
17669 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17670 Add issued_non_pic_error_ field. Declare check_non_pic.
17671 (Target_x86_64::Scan::check_non_pic): New function.
17672 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17673 (Target_x86_64::Scan::global): Likewise.
17674
17675 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17676 addend parameter. Change caller. Handle merge sections.
17677 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17678 Address to Addend. Don't add in the result of
17679 local_section_offset, pass down the addend and use the returned
17680 value.
17681 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17682 Update declarations of local_section_offset and symbol_value.
17683 * testsuite/two_file_test_1.cc (t18): New function.
17684 * testsuite/two_file_test_2.cc (f18): New function.
17685 * testsuite/two_file_test_main.cc (main): Call t18.
17686 * testsuite/two_file_test.h (t18, f18): Declare.
17687
17688 * configure.ac: Don't test for objdump, c++filt, or readelf.
17689 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17690 conditionals.
17691 (TEST_READELF): New variable.
17692 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17693 (check_PROGRAMS): Add two_file_strip_test.
17694 (two_file_strip_test): New target.
17695 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17696 (two_file_same_shared_strip_test_SOURCES): New variable.
17697 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17698 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17699 (two_file_same_shared_strip_test_LDADD): New variable.
17700 (two_file_shared_strip.so): New target.
17701 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17702 (ver_test_5.syms, ver_test_7.syms): Likewise.
17703 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17704 (strip_test_3.stdout): Use TEST_OBJDUMP.
17705 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17706
17707 2008-04-04 Cary Coutant <ccoutant@google.com>
17708
17709 * symtab.h (Symbol::is_weak_undefined): New function.
17710 (Symbol::is_strong_undefined): New function.
17711 (Symbol::is_absolute): New function.
17712 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17713 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17714 absolute symbols.
17715 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17716 (weak_undef_test): New target.
17717 * testsuite/Makefile.in: Rebuild.
17718 * testsuite/weak_undef_file1.cc: New file.
17719 * testsuite/weak_undef_file2.cc: New file.
17720 * testsuite/weak_undef_test.cc: New file.
17721
17722 2008-04-03 Craig Silverstein <csilvers@google.com>
17723
17724 * compressed_output.h (class Output_compressed_section): Use
17725 unsigned buffer.
17726 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17727 add zlib header.
17728 (zlib_compressed_suffix): Removed.
17729 (Output_compressed_section::set_final_data_size): Use unsigned
17730 buffers.
17731 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17732 Fix linker invocation.
17733 (flagstest_o_specialfile_and_compress_debug_sections):
17734 Likewise.
17735 * testsuite/Makefile.in: Regenerated.
17736
17737 2008-04-02 David S. Miller <davem@davemloft.net>
17738
17739 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17740 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17741
17742 2008-04-02 Craig Silverstein <csilvers@google.com>
17743
17744 * TODO: New file.
17745
17746 2008-04-02 Ian Lance Taylor <iant@google.com>
17747
17748 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17749 parameters. Update for new key type to views_. Change all
17750 callers.
17751 (File_read::read): Adjust for byteshift in returned view.
17752 (File_read::add_view): New function, broken out of
17753 find_and_make_view.
17754 (File_read::make_view): New function, broken out of
17755 find_and_make_view.
17756 (File_read::find_or_make_view): Add offset and aligned
17757 parameters. Rewrite accordingly. Change all callers.
17758 (File_read::get_view): Add offset and aligned parameters. Adjust
17759 for byteshift in return value.
17760 (File_read::get_lasting_view): Likewise.
17761 * fileread.h (class File_read): Update declarations.
17762 (class File_read::View): Add byteshift_ field. Add byteshift to
17763 constructor. Add byteshift method.
17764 * archive.h (Archive::clear_uncached_views): New function.
17765 (Archive::get_view): Add aligned parameter. Change all callers.
17766 * object.h (Object::get_view): Add aligned parameter. Change all
17767 callers.
17768 (Object::get_lasting_view): Likewise.
17769
17770 * fileread.cc (File_read::release): Don't call clear_views if
17771 there are multiple objects.
17772 * fileread.h (File_read::clear_uncached_views): New function.
17773 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17774 on the archive.
17775
17776 2008-03-31 Cary Coutant <ccoutant@google.com>
17777
17778 Add thin archive support.
17779 * archive.cc (Archive::armagt): New const.
17780 (Archive::setup): Remove task parameter and calls to unlock.
17781 (Archive::unlock_nested_archives): New function.
17782 (Archive::read_header): Add nested_off parameter. Change
17783 all callers.
17784 (Archive::interpret_header): Likewise.
17785 (Archive::include_all_members): Change to handle thin
17786 archives.
17787 (Archive::include_member): Likewise.
17788 * archive.h (Archive::Archive): Add new parameters and
17789 initializers.
17790 (Archive::armagt): New const.
17791 (Archive::setup): Remove task parameter.
17792 (Archive::unlock_nested_archives): New function.
17793 (Archive::read_header): Add nested_off parameter.
17794 (Archive::interpret_header): Likewise.
17795 (Archive::Nested_archive_table): New typedef.
17796 (Archive::is_thin_archive_): New field.
17797 (Archive::nested_archives_): New field.
17798 (Archive::options_): New field.
17799 (Archive::dirpath_): New field.
17800 (Archive::task_): New field.
17801 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17802 for thin archives. Pass additional parameters to
17803 Archive::Archive. Unlock the archive file after calling
17804 Archive::setup.
17805
17806 2008-03-29 Ian Lance Taylor <iant@google.com>
17807
17808 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17809 version symbol to be local.
17810 * testsuite/ver_test_4.sh: New file.
17811 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17812 (check_DATA): Add ver_test_4.syms.
17813 (ver_test_4.syms): New target.
17814 * testsuite/Makefile.in: Rebuild.
17815
17816 * output.cc
17817 (Output_section::Input_section_sort_entry::has_priority): New
17818 function.
17819 (Output_section::Input_section_sort_entry::match_file_name): New
17820 function.
17821 (Output_section::Input_section_sort_entry::match_section_name):
17822 Remove.
17823 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17824 Remove.
17825 (Output_section::Input_section_sort_entry::match_section_file):
17826 Remove.
17827 (Output_section::Input_section_sort_compare::operator()): Rewrite
17828 using new Input_section_sort_entry functions. Sort crtbegin and
17829 crtend first. Sort sections with no priority before sections with
17830 a priority.
17831 * testsuite/initpri1.c (d3): Check j != 4.
17832 (cd5): New constructor/destructor function.
17833 (main): Check j != 2.
17834
17835 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17836 new symbol when resolving, don't call set_is_default.
17837 * testsuite/ver_test_7.cc: New file.
17838 * testsuite/ver_test_7.sh: New file.
17839 * testsuite/Makefile.am (ver_test_7.so): New target.
17840 (ver_test_7.o): New target.
17841 (check_SCRIPTS): Add ver_test_7.sh.
17842 (check_DATA): Add ver_test_7.syms.
17843 (ver_test_7.syms): New target.
17844
17845 2008-03-28 Ian Lance Taylor <iant@google.com>
17846
17847 * layout.cc (Layout::layout): If we see an input section with a
17848 name that needs sorting, set the must_sort flag for the output
17849 section.
17850 (Layout::make_output_section): If the name of the output section
17851 indicates that it might require sorting, set the may_sort flag.
17852 * output.h (Output_section::may_sort_attached_input_sections): New
17853 function.
17854 (Output_section::set_may_sort_attached_input_sections): New
17855 function.
17856 (Output_section::must_sort_attached_input_sections): New
17857 function.
17858 (Output_section::set_must_sort_attached_input_sections): New
17859 function.
17860 (class Output_section): Declare Input_section_sort_entry. Define
17861 Input_section_sort_compare. Declare
17862 sort_attached_input_sections. Add new fields:
17863 may_sort_attached_input_sections_,
17864 must_sort_attached_input_sections_,
17865 attached_input_sections_are_sorted_.
17866 * output.cc (Output_section::Output_section): Initialize new
17867 fields.
17868 (Output_section::add_input_section): Add an entry to
17869 input_sections_ if may_sort or must_sort are true.
17870 (Output_section::set_final_data_size): Call
17871 sort_attached_input_sections if necessary.
17872 (Output_section::Input_section_sort_entry): Define new class.
17873 (Output_section::Input_section_sort_compare::operator()): New
17874 function.
17875 (Output_section::sort_attached_input_sections): New function.
17876 * configure.ac: Check whether the compiler supports constructor
17877 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17878 * testsuite/initpri1.c: New file.
17879 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17880 CONSTRUCTOR_PRIORITY.
17881 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17882 (initpri1_LDFLAGS): New variable.
17883 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17884
17885 2008-03-27 Ian Lance Taylor <iant@google.com>
17886
17887 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17888 * testsuite/common_test_1.c: New file.
17889 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17890 (common_test_1_SOURCES): New variable.
17891 (common_test_1_DEPENDENCIES): New variable.
17892 (common_test_1_LDFLAGS): New variable.
17893
17894 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17895 and commons_ correctly when NAME/VERSION does not override
17896 NAME/NULL.
17897 * testsuite/ver_test_6.c: New file.
17898 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17899 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17900 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17901
17902 2008-03-26 Ian Lance Taylor <iant@google.com>
17903
17904 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17905 of an undefined symbol from a version script.
17906 * testsuite/Makefile.am (ver_test_5.so): New target.
17907 (ver_test_5.o): New target.
17908 (check_SCRIPTS): Add ver_test_5.sh.
17909 (check_DATA): Add ver_test_5.syms.
17910 (ver_test_5.syms): New target.
17911 * testsuite/ver_test_5.cc: New file.
17912 * testsuite/ver_test_5.script: New file.
17913 * testsuite/ver_test_5.sh: New file.
17914 * Makefile.in, testsuite/Makefile.in: Rebuild.
17915
17916 PR gold/5986
17917 Fix problems building gold with gcc 4.3.0.
17918 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17919 (gold_error_at_location, gold_warning_at_location): Use it.
17920 * configure.ac: Check whether we can compile and use a template
17921 function with a printf attribute.
17922 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17923 when jumping over bytes.
17924 * object.cc: Instantiate Object::read_section_data.
17925 * debug.h: Include <cstring>
17926 * dwarf_reader.cc: Include <algorithm>
17927 * main.cc: Include <cstring>.
17928 * options.cc: Include <cstring>.
17929 * output.cc: Include <cstring>.
17930 * script.cc: Include <cstring>.
17931 * script.h: Include <string>.
17932 * symtab.cc: Include <cstring> and <algorithm>.
17933 * target-select.cc: Include <cstring>.
17934 * version.cc: Include <string>.
17935 * testsuite/testmain.cc: Include <cstdlib>.
17936 * configure, config.in: Rebuild.
17937
17938 2008-03-25 Ian Lance Taylor <iant@google.com>
17939
17940 * options.cc: Include "../bfd/bfdver.h".
17941 (options::help): Print bug reporting address.
17942
17943 * version.cc (print_version): Adjust output for current value of
17944 BFD_VERSION_STRING.
17945
17946 * NEWS: New file.
17947
17948 * options.cc (options::help): Print list of supported targets.
17949 * target-select.h: Include <vector>.
17950 (class Target_selector): Make machine_, size_, and is_big_endian_
17951 fields const. Add bfd_name_ and instantiated_target_ fields.
17952 (Target_selector::Target_selector): Add bfd_name parameter.
17953 (Target_selector::recognize): Make non-virtual, call
17954 do_recognize.
17955 (Target_selector::recognize_by_name): Make non-virtual, call
17956 do_recognize_by_name.
17957 (Target_selector::supported_names): New function.
17958 (Target_selector::bfd_name): New function.
17959 (Target_selector::do_instantiate_target): New pure virtual
17960 function.
17961 (Target_selector::do_recognize): New virtual function.
17962 (Target_selector::do_recognize_by_name): New virtual function.
17963 (Target_selector::instantiate_target): New private function.
17964 (supported_target_names): Declare.
17965 * target-select.cc (Target_selector::Target_selector): Update for
17966 new parameter and fields.
17967 (select_target_by_name): Check that the name matches before
17968 calling recognize_by_name.
17969 (supported_target_names): New function.
17970 * i386.cc (class Target_selector_i386): Update Target_selector
17971 constructor call. Remove recognize and recognize_by_name. Add
17972 do_instantiate_target.
17973 * x86_64.cc (class Target_selector_x86_64): Likewise.
17974 * testsuite/testfile.cc (class Target_selector_test): Update for
17975 changes to Target_selector.
17976
17977 * README: Rewrite, with some notes on unsupported features.
17978
17979 2008-03-24 Cary Coutant <ccoutant@google.com>
17980
17981 * i386.cc (Target_i386::Got_type): New enum declaration.
17982 (Target_i386::Scan::local): Updated callers of Output_data_got
17983 member functions.
17984 (Target_i386::Scan::global): Likewise.
17985 (Target_i386::Relocate::relocate): Likewise.
17986 (Target_i386::Relocate::relocate_tls): Likewise.
17987 * object.h (Got_offset_list): New class.
17988 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17989 (Sized_relobj::local_got_offset): Likewise.
17990 (Sized_relobj::set_local_got_offset): Likewise.
17991 (Sized_relobj::local_has_tls_got_offset): Removed.
17992 (Sized_relobj::local_tls_got_offset): Removed.
17993 (Sized_relobj::set_local_tls_got_offset): Removed.
17994 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17995 * output.cc (Output_data_got::add_global): Added got_type parameter.
17996 (Output_data_got::add_global_with_rel): Likewise.
17997 (Output_data_got::add_global_with_rela): Likewise.
17998 (Output_data_got::add_global_pair_with_rel): New function.
17999 (Output_data_got::add_global_pair_with_rela): New function.
18000 (Output_data_got::add_local): Added got_type parameter.
18001 (Output_data_got::add_local_with_rel): Likewise.
18002 (Output_data_got::add_local_with_rela): Likewise.
18003 (Output_data_got::add_local_pair_with_rel): New function.
18004 (Output_data_got::add_local_pair_with_rela): New function.
18005 (Output_data_got::add_global_tls): Removed.
18006 (Output_data_got::add_global_tls_with_rel): Removed.
18007 (Output_data_got::add_global_tls_with_rela): Removed.
18008 (Output_data_got::add_local_tls): Removed.
18009 (Output_data_got::add_local_tls_with_rel): Removed.
18010 (Output_data_got::add_local_tls_with_rela): Removed.
18011 * output.h (Output_data_got::add_global): Added got_type parameter.
18012 (Output_data_got::add_global_with_rel): Likewise.
18013 (Output_data_got::add_global_with_rela): Likewise.
18014 (Output_data_got::add_global_pair_with_rel): New function.
18015 (Output_data_got::add_global_pair_with_rela): New function.
18016 (Output_data_got::add_local): Added got_type parameter.
18017 (Output_data_got::add_local_with_rel): Likewise.
18018 (Output_data_got::add_local_with_rela): Likewise.
18019 (Output_data_got::add_local_pair_with_rel): New function.
18020 (Output_data_got::add_local_pair_with_rela): New function.
18021 (Output_data_got::add_global_tls): Removed.
18022 (Output_data_got::add_global_tls_with_rel): Removed.
18023 (Output_data_got::add_global_tls_with_rela): Removed.
18024 (Output_data_got::add_local_tls): Removed.
18025 (Output_data_got::add_local_tls_with_rel): Removed.
18026 (Output_data_got::add_local_tls_with_rela): Removed.
18027 * resolve.cc (Symbol::override_base_with_special): Removed
18028 reference to has_got_offset_ field.
18029 * symtab.cc (Symbol::init_fields): Replaced initialization
18030 of got_offset_ with got_offsets_. Removed initialization
18031 of has_got_offset_
18032 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
18033 (Symbol::got_offset): Likewise.
18034 (Symbol::set_got_offset): Likewise.
18035 (Symbol::has_tls_got_offset): Removed.
18036 (Symbol::tls_got_offset): Removed.
18037 (Symbol::set_tls_got_offset): Removed.
18038 (Symbol::got_offset_): Removed.
18039 (Symbol::tls_mod_got_offset_): Removed.
18040 (Symbol::tls_pair_got_offset_): Removed.
18041 (Symbol::got_offsets_): New field.
18042 (Symbol::has_got_offset): Removed.
18043 (Symbol::has_tls_mod_got_offset): Removed.
18044 (Symbol::has_tls_pair_got_offset): Removed.
18045 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
18046 (Target_x86_64::Scan::local): Updated callers of Output_data_got
18047 member functions.
18048 (Target_x86_64::Scan::global): Likewise.
18049 (Target_x86_64::Relocate::relocate): Likewise.
18050 (Target_x86_64::Relocate::relocate_tls): Likewise.
18051
18052 2008-03-25 Ben Elliston <bje@au.ibm.com>
18053
18054 * yyscript.y: Fix spelling error in comment.
18055
18056 2008-03-24 Ian Lance Taylor <iant@google.com>
18057
18058 * options.h (class General_options): Define build_id option.
18059 * layout.h (class Layout): Declare write_build_id, create_note,
18060 create_build_id. Add build_id_note_ member.
18061 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
18062 "libiberty.h", "md5.h", "sha1.h".
18063 (Layout::Layout): Initialize eh_frame_data_,
18064 eh_frame_hdr_section_, and build_id_note_.
18065 (Layout::finalize): Call create_build_id.
18066 (Layout::create_note): New function, broken out of
18067 Layout::create_gold_note.
18068 (Layout::create_gold_note): Call create_note.
18069 (Layout::create_build_id): New function.
18070 (Layout::write_build_id): New function.
18071 (Close_task_runner::run): Call write_build_id.
18072
18073 * x86_64.cc: Correct license to GPLv3.
18074
18075 2008-03-23 Ian Lance Taylor <iant@google.com>
18076
18077 * options.cc: Include "demangle.h".
18078 (parse_optional_string): New function.
18079 (parse_long_option): Handle takes_optional_argument.
18080 (parse_short_option): Update dash_z initializer. Handle
18081 takes_optional_argument.
18082 (General_options::General_options): Initialize do_demangle_.
18083 (General_options::finalize): Set do_demangle_. Handle demangling
18084 style.
18085 * options.h (parse_optional_string): Declare.
18086 (struct One_option): Add optional_arg field. Update constructor.
18087 Update call constructor calls. Add takes_optional_argument
18088 function.
18089 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
18090 (DEFINE_optional_string): Define.
18091 (General_options::demangle): Change from DEFINE_bool to
18092 DEFINE_optional_string.
18093 (General_options::no_demangle): New function.
18094 (General_options::do_demangle): New function.
18095 (General_options::set_do_demangle): New function.
18096 (General_options::execstack_status_): Move definition to end of
18097 class definition.
18098 (General_options::static_): Likewise.
18099 (General_options::do_demangle_): New field.
18100 * object.cc (big_endian>::get_symbol_location_info): Call
18101 Options::do_demangle, not Options::demangle.
18102 * symtab.cc (demangle): Likewise.
18103
18104 2008-03-22 Ian Lance Taylor <iant@google.com>
18105
18106 * gold.h: Include <cstddef> and <sys/types.h>
18107 * options.h: Include <cstring>.
18108
18109 2008-03-21 Ian Lance Taylor <iant@google.com>
18110
18111 * Added source code to GNU binutils.
18112 \f
18113 Copyright (C) 2008-2015 Free Software Foundation, Inc.
18114
18115 Copying and distribution of this file, with or without modification,
18116 are permitted in any medium without royalty provided the copyright
18117 notice and this notice are preserved.
18118
18119 Local Variables:
18120 mode: change-log
18121 left-margin: 8
18122 fill-column: 74
18123 version-control: never
18124 End:
This page took 0.420809 seconds and 5 git commands to generate.