Gold: Don't fail on R_X86_64_[REX_]GOTPCRELX relocations
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
2
3 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
4 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
5 as R_X86_64_GOTPCREL.
6 (Target_x86_64<size>::Scan::local): Likewise.
7 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
8 Likewise.
9 (Target_x86_64<size>::Scan::global): Likewise.
10 (Target_x86_64<size>::Relocate::relocate): Likewise.
11 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
12 Likewise.
13
14 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
15
16 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
17 R_386_GOT32X the same as R_386_GOT32.
18 (Target_i386::Scan::local): Likewise.
19 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
20 (Target_i386::Scan::global): Likewise.
21 (Target_i386::Relocate::relocate): Likewise.
22 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
23 Likewise.
24
25 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
26
27 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
28 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
29 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
30 x86_64_mov_to_lea1.o.
31 * testsuite/Makefile.in: Regenerated.
32
33 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
34
35 PR gold/19119
36 * options.h (General_options): Remove "obsolete" from -m.
37 * parameters.cc (set_parameters_target): Check if input target
38 is compatible with output emulation set by "-m emulation".
39
40 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
41
42 PR gold/19118
43 * i386.cc (Target_iamcu): New class.
44 (Target_selector_iamcu): Likewise.
45 (Target_iamcu::iamcu_info): New variable.
46 (target_selector_iamcu): Likewise.
47
48 2015-10-07 Andreas Schwab <schwab@suse.de>
49
50 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
51
52 2015-10-06 Cary Coutant <ccoutant@gmail.com>
53
54 PR gold/18855
55 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
56 parameter.
57 (Sparc_relocate_functions::gdop_lox10): Likewise.
58 (Target_sparc::Relocate::relocate): Use addend when computing
59 symbol value for R_SPARC_GOTDATA_OP*.
60
61 2015-09-07 Cary Coutant <ccoutant@gmail.com>
62
63 PR gold/18930
64 PR gold/18886
65 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
66 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
67
68 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
69
70 PR gold/18886
71 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
72 shared libraries into normal FUNC symbols.
73 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
74 symbols aren't from shared libraries.
75
76 2015-09-02 Alan Modra <amodra@gmail.com>
77
78 PR 18878
79 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
80 (Target_powerpc::Branch_info::make_stub): Determine whether long
81 branch stub is for save/restore function.
82 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
83 (Stub_table): Add need_save_res_.
84 (Stub_table:clear_stubs): Clear need_save_res_.
85 (Stub_table:set_address_and_size): Add save/restore section size.
86 (Stub_table::add_long_branch_entry): Add save_res param. Set
87 need_save_res_, but don't add space for save/restore stubs.
88 (Stub_table::find_long_branch_entry): Return offset to local copy
89 of save/restore func.
90 (Stub_table::do_write): Don't output save/restore stubs. Instead
91 copy the save/restore functions.
92 (Output_data_save_res:contents): New accessor.
93 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
94
95 2015-08-25 Cary Coutant <ccoutant@gmail.com>
96
97 PR gold/18847
98 * script-sections.cc (Memory_region::set_address): New method.
99 (Script_sections::find_memory_region): Add explicit_only parameter.
100 (Output_section_definition::set_section_addresses): Handle case where
101 script specifies both address and vma region.
102 * script-sections.h (Script_sections::find_memory_region): Add
103 explicit_only parameter.
104
105 2015-08-25 Cary Coutant <ccoutant@gmail.com>
106
107 PR gold/18859
108 * object.cc (Input_objects::add_object): Store objects in a map,
109 indexed by soname; update as-needed flag when necessary.
110 * object.h (Object::clear_as_needed): New method.
111 (Input_objects::so_names_): Change from set to map.
112
113 2015-08-25 Cary Coutant <ccoutant@gmail.com>
114
115 PR gold/14746
116 * expression.cc (Expression::Expression_eval_info): Add
117 is_valid_pointer field.
118 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
119 Adjust all callers.
120 (Addr_expression::value_from_output_section): Check whether address
121 is valid.
122 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
123 if evaluation failed due to address that is not yet valid.
124 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
125 parameter.
126
127 2015-08-25 Cary Coutant <ccoutant@gmail.com>
128
129 PR gold/18866
130 PR gold/18703
131 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
132
133 2015-08-20 Alan Modra <amodra@gmail.com>
134
135 PR gold/18846
136 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
137 Subtract os->address() from addend.
138 * powerpc.cc (relocate_relocs): Likewise.
139
140 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
141
142 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
143 lazy_stub_normal_1, lazy_stub_normal_1_n64,
144 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
145 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
146 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
147 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
148 of 'addu/daddu'.
149
150 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
151
152 * configure: Regenerated.
153
154 2015-07-26 Doug Kwan <dougkwan@google.com>
155
156 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
157 disassembler output format.
158
159 2015-07-23 Ian Coolidge <icoolidge@google.com>
160 Plumb --pic-veneer option for gold.
161
162 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
163 generation.
164 * options.h (General_options): Add --pic-veneer option.
165
166 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
167
168 PR gold/18663
169 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
170 script_test_1a.cc script_test_1b.cc.
171 (script_test_11_r.o): Replace script_test_11.o with
172 script_test_11a.o script_test_11b.o.
173 (script_test_11.o): Removed.
174 (script_test_11a.o): New.
175 (script_test_11b.o): Likewise.
176 * testsuite/Makefile.in: Regenerated.
177 * testsuite/script_test_1.h: New file.
178 * testsuite/script_test_1b.cc: Likewise.
179 * testsuite/script_test_11.h: Likewise.
180 * testsuite/script_test_11b.c: Likewise.
181 * testsuite/script_test_1.cc: Renamed to ...
182 * testsuite/script_test_1a.cc: This.
183 Include "script_test_1.h".
184 (main): Call check_int and check_ptr.
185 * testsuite/script_test_11.c: Renamed to ...
186 * testsuite/script_test_11a.c: This.
187 Include "script_test_11.h".
188 (main): Call ptr_equal.
189
190 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
191
192 PR gold/18628
193 * testsuite/ifuncdep2.c (global): Change protected to hidden.
194 * testsuite/ifuncmod1.c (global): Likewise.
195 * testsuite/ifuncmod5.c (global): Likewise.
196
197 2015-07-22 Alan Modra <amodra@gmail.com>
198
199 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
200
201 2015-07-21 Cary Coutant <ccoutant@gmail.com>
202
203 PR gold/18548
204 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
205 forced local symbol even when oldsym != NULL.
206 (Symbol_table::do_define_in_output_segment): Likewise.
207 (Symbol_table::do_define_as_constant): Likewise.
208
209 2015-07-21 Cary Coutant <ccoutant@gmail.com>
210
211 PR gold/18698
212 * archive.cc (Library_base::should_include_member): Don't use entry
213 point for relocatable links, or if target is not yet valid.
214 * parameters.cc (Parameters::entry): Check target_valid().
215
216 2015-07-20 Han Shen <shenhan@google.com>
217
218 Optimize erratum 843419 fix.
219
220 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
221 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
222 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
223 (E843419_stub): New sub-class of Erratum_stub.
224 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
225 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
226 (AArch64_relobj::create_erratum_stub): Add 1 argument.
227 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
228
229 2015-07-20 Han Shen <shenhan@google.com>
230
231 Fix arm elf header flags wrt hardfp bit.
232
233 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
234
235 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
236
237 PR gold/18689
238 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
239 from input group section for relocatable link.
240 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
241 (check_DATA): Add pr18689.stdout.
242 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
243 (pr18689.stdout): New rule.
244 (pr18689a.o): Likewise.
245 (pr18689b.o): Likewise.
246 (pr18689.o): Likewise.
247 * testsuite/pr18689.c: New file.
248 * testsuite/pr18689.sh: Likewise.
249 * testsuite/Makefile.in: Regenerated.
250
251 2015-07-20 Yiran Wang <yiran@google.com>
252 Cary Coutant <ccoutant@gmail.com>
253
254 PR gold/15574
255 * resolve.cc (Symbol_table): Remove warning about references
256 from shared objects to hidden symbols.
257 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
258 * testsuite/Makefile.in: Regenerate.
259 * testsuite/hidden_test.sh: Check dynamic symbol table; update
260 expected error messages.
261
262 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
263
264 * compressed_output.cc (Output_compressed_section::set_final_data_size):
265 Make --compress-debug-sections=zlib the same as
266 --compress-debug-sections=zlib-gabi.
267 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
268 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
269 ".zdebug_".
270 * testsuite/Makefile.in: Regenerated.
271
272 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
273
274 PR gold/18322
275 * compressed_output.cc (zlib_compress): Add argument for
276 compression header size. Set header size to compression header
277 size if it isn't 0. Don't write out the zlib header here.
278 (Output_compressed_section::set_final_data_size): Support
279 zlib-gnu and zlib-gabi compressions. Pass compression header
280 size to zlib_compress and write out compression header. Set
281 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
282 clear the SHF_COMPRESSED bit
283 * options.h (compress_debug_sections): Add zlib-gnu and
284 zlib-gabi.
285 * output.h (Output_section::set_flags): New.
286 * testsuite/Makefile.am (check_PROGRAMS): Add
287 flagstest_compress_debug_sections_none,
288 flagstest_compress_debug_sections_gnu and
289 flagstest_compress_debug_sections_gabi.
290 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
291 flagstest_compress_debug_sections.stdout,
292 flagstest_compress_debug_sections.cmp,
293 flagstest_compress_debug_sections.check,
294 flagstest_compress_debug_sections_gnu.stdout,
295 flagstest_compress_debug_sections_gnu.cmp,
296 flagstest_compress_debug_sections_gnu.check,
297 flagstest_compress_debug_sections_gabi.stdout,
298 flagstest_compress_debug_sections_gabi.cmp and
299 flagstest_compress_debug_sections_gabi.check.
300 (flagstest_compress_debug_sections_none): New.
301 (flagstest_compress_debug_sections_none.stdout): Likewise.
302 (flagstest_compress_debug_sections.stdout): Likewise.
303 (flagstest_compress_debug_sections.check): Likewise.
304 (flagstest_compress_debug_sections.cmp): Likewise.
305 (flagstest_compress_debug_sections_gnu): Likewise.
306 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
307 (flagstest_compress_debug_sections_gnu.check): Likewise.
308 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
309 (flagstest_compress_debug_sections_gabi): Likewise.
310 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
311 (flagstest_compress_debug_sections_gnu.check): Likewise.
312 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
313 * testsuite/Makefile.in: Regenerated.
314
315 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
316
317 PR gold/18321
318 * compressed_output.h (decompress_input_section): Add arguments
319 for ELF class, big endian and sh_flags.
320 * compressed_output.cc (decompress_input_section): Likewise.
321 Support the SHF_COMPRESSED section.
322 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
323 functions.
324 * plugin.h (Pluginobj): Likewise.
325 * layout.cc (Layout::get_output_section_flags): Also clear the
326 SHF_COMPRESSED bit.
327 * object.h (Compressed_section_info): Add flag to store sh_flags.
328 (Object): Add pure virtual elfsize and is_big_endian member
329 functions.
330 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
331 prefix here.
332 (build_compressed_section_map): Check SHF_COMPRESSED for
333 uncompressed size. Store sh_flags in Compressed_section_info.
334 Pass size, big_endian and sh_flags to decompress_input_section.
335 Skip the ".debug"/".zdebug" prefix when passing section name to
336 need_decompressed_section.
337 (Sized_relobj_file<size, big_endian>::do_find_special_section):
338 Don't check ".zdebug_*" sections.
339 (Object::decompressed_section_contents): Pass ELF class, big
340 endian and sh_flags to decompress_input_section.
341 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
342 Likewise.
343 * testsuite/Makefile.am (check_DATA): Add
344 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
345 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
346 gdb_index_test_2_gabi.stdout.
347 (debug_msg_cdebug_gabi.o): New.
348 (odr_violation1_cdebug_gabi.o): Likewise.
349 (odr_violation2_cdebug_gabi.o): Likewise.
350 (debug_msg_cdebug_gabi.err): Likewise.
351 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
352 (gdb_index_test_cdebug_gabi.o): Likewise.
353 (gdb_index_test_2_gabi): Likewise.
354 (gdb_index_test_2_gabi.stdout): Likewise.
355 * testsuite/gdb_index_test_2_gabi.sh: New file.
356 * testsuite/Makefile.in: Regenerated.
357
358 2015-07-09 Han Shen <shenhan@google.com>
359
360 Use "gold_info" instead of "gold_warning" for erratum fix.
361
362 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
363 'gold_info'.
364 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
365
366 2015-07-09 Han Shen <shenhan@google.com>
367
368 Drop missing symbol warning for arm/aarch64.
369
370 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
371 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
372 symbol warning.
373
374 2015-07-07 Han Shen <shenhan@google.com>
375
376 Make gold aarch64 accept long form of mapping symbols.
377
378 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
379 of mapping symbols.
380
381 2015-06-29 Doug Kwan <dougkwan@google.com>
382
383 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
384 at address expected by test.
385 * testsuite/arm_cortex_a8_b.s: Ditto.
386 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
387 * testsuite/arm_cortex_a8_bl.s: Ditto.
388 * testsuite/arm_cortex_a8_blx.s: Ditto.
389 * testsuite/arm_cortex_a8_local.s: Ditto.
390 * testsuite/arm_fix_v4bx.s: Ditto.
391 * testsuite/arm_unaligned_reloc.s: Ditto.
392 * testsuite/thumb_bl_out_of_range.s: Ditto.
393 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
394 * testsuite/thumb_blx_out_of_range.s: Ditto.
395
396 2015-06-29 Han Shen <shenhan@google.com>
397
398 Patch for erratum 843419 internal error.
399
400 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
401 (Erratum_stub::update_erratum_insn): New method.
402 (Stub_table::relocate_stubs): Modified to place relocated insn.
403 (AArch64_relobj::fix_errata): Modified gold_assert.
404
405 2015-06-12 Han Shen <shenhan@google.com>
406
407 Fix erratum 835769.
408
409 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
410 defintion outside class definition.
411 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
412 (AArch64_insn_utilities::aarch64_op31): New member.
413 (AArch64_insn_utilities::aarch64_ra): New member.
414 (AArch64_insn_utilities::aarch64_mac): New member.
415 (AArch64_insn_utilities::aarch64_mlxl): New member.
416 (ST_E_835769): New global enum member.
417 (Stub_table::relocate_stubs): Add 835769 handler.
418 (Stub_template_repertoire::Stub_template_repertoire): Install new
419 stub type.
420 (AArch64_relobj::scan_errata): This func is renamed from
421 scan_erratum_843419.
422 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
423 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
424 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
425 (Target_aarch64::scan_erratum_835769_span): New method.
426 (Target_aarch64::create_erratum_stub): New method.
427 (Target_aarch64::is_erratum_835769_sequence): New method.
428 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
429 code into create_erratum_stub.
430 * options.h (fix_cortex_a53_835769): New option.
431
432 2015-06-11 Cary Coutant <ccoutant@gmail.com>
433
434 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
435 outside class body.
436 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
437
438 2015-06-11 Cary Coutant <ccoutant@gmail.com>
439
440 PR gold/17731
441 * layout.cc (corresponding_uncompressed_section_name): New function.
442 (Layout::choose_output_section): Call it.
443 * layout.h (corresponding_uncompressed_section_name): New function.
444 * script-sections.cc (Input_section_info::set_section_name): Check
445 for compressed debug section (.zdebug style).
446
447 2015-06-11 Jing Yu <jingyu@google.com>
448
449 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
450 * testsuite/Makefile.in: Regenerate.
451
452 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
453
454 * gold.h (is_cident): Correct typo.
455
456 2015-06-10 Han Shen <shenhan@google.com>
457 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
458
459 Now fixing for 843419 is fully functional.
460
461 The first part of the erratum fix CL is here -
462 https://sourceware.org/ml/binutils/2015-04/msg00229.html
463
464 * aarch64.cc(global enum): New constants representing stub types.
465 (Stub_template): New POD struct.
466 (Stub_template_repertoire): New class.
467 (Stub_base): New class.
468 (Erratum_stub): New class.
469 (Reloc_stub): Refactored to be a subclass of Stub_base.
470 (Reloc_stub::Stub_type): Removed.
471 (Reloc_stub::offset): Moved to Stub_base.
472 (Reloc_stub::set_offset): Moved to Stub_base.
473 (Reloc_stub::destination_address): Moved to Stub_base.
474 (Reloc_stub::set_destination_address): Moved to Stub_base.
475 (Reloc_stub::reset_destination_address): Moved to Stub_base.
476 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
477 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
478 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
479 (Reloc_stub::write): Moved to Stub_base.
480 (Reloc_stub::invalid_offset): Moved to Stub_base.
481 (Reloc_stub::invalid_address): Moved to Stub_base.
482 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
483 (Reloc_stub::stub_insns_): Moved to Stub_base.
484 (Reloc_stub::offset_): Moved to Stub_base.
485 (Reloc_stub::destination_address_): Moved to Stub_base.
486 (Stub_table::The_aarch64_relobj): New typedef.
487 (Stub_table::The_erratum_stub): New typedef.
488 (Stub_table::The_erratum_stub_less): New typedef.
489 (Stub_table::The_erratum_stub_set): New typedef.
490 (Stub_table::The_erratum_stub_set_iter): New typedef.
491 (Stub_table::empty): Added emptiness testing for erratum stubs.
492 (Stub_table::add_erratum_stub): New method to add an erratum stub.
493 (Stub_table::find_erratum_stub): New method.
494 (Stub_table::find_erratum_stubs_for_input_section): New method.
495 (Stub_table::erratum_stub_address): New method.
496 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
497 (Stub_table::do_addralign): Modified to handle erratum stubs.
498 (Stub_table::erratum_stubs_): New member.
499 (Stub_table::erratum_stub_size_): New member.
500 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
501 (Stub_table::do_write): Modified to handle erratum stubs.
502 (AArch64_relobj::The_erratum_stub): New typedef.
503 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
504 (AArch64_relobj::fix_errata): New method.
505 (Target_aarch64::The_reloc_stub_type): Removed.
506 (Target_aarch64::The_erratum_stub): New typede.
507 (AArch64_relocate_functions::construct_b): New method.
508
509 2015-06-08 Nick Clifton <nickc@redhat.com>
510
511 * po/fr.po: New French Translation.
512
513 2015-06-07 Cary Coutant <ccoutant@gmail.com>
514
515 PR gold/18288
516 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
517 callers. Don't use STT_COMMON to check for common symbols.
518 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
519 symbol that's not in a common section.
520 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
521 common symbols.
522
523 2015-06-04 Cary Coutant <ccoutant@gmail.com>
524
525 PR gold/18200
526 * Makefile.am (diststuff): Add target.
527 * Makefile.in: Regenerate.
528
529 2015-06-04 Cary Coutant <ccoutant@gmail.com>
530
531 PR gold/17498
532 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
533 temporary locals in merge sections.
534 * options.cc (General_options::parse_discard_all): New method.
535 (General_options::parse_discard_locals): New method.
536 (General_options::parse_discard_none): New method.
537 (General_options::General_options): Initialize discard_locals_.
538 * options.h (--discard-all): Convert to special option.
539 (--discard-locals): Likewise.
540 (--discard-none): New option.
541 (General_options::discard_all): New method.
542 (General_options::discard_locals): New method.
543 (General_options::discard_sec_merge): New method.
544 (General_options::Discard_locals): New enum.
545 (General_options::discard_locals_): New data member.
546
547 2015-06-03 Cary Coutant <cary@google.com>
548
549 * script-sections.cc (Script_sections::Script_sections): Initialize
550 segments_created_.
551 (Script_sections::create_note_and_tls_segments): Set flag when
552 segments are created.
553 (Script_sections::expected_segment_count): Count PT_INTERP.
554 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
555 segments are created.
556 * script-sections.h (Script_sections::segments_created_): New data
557 member.
558
559 2015-06-03 Cary Coutant <ccoutant@gmail.com>
560
561 PR gold/15370
562 * script-sections.cc
563 (Output_section_element_input::set_section_addresses): When there
564 are several patterns with no sort spec, put all sections in the same
565 bin.
566 * testsuite/Makefile.am (script_test_12): New testcase.
567 (script_test_12i): New testcase.
568 * testsuite/Makefile.in: Regenerate.
569 * testsuite/script_test_12.t: New test linker script.
570 * testsuite/script_test_12i.t: New test linker script.
571 * testsuite/script_test_12a.c: New test source file.
572 * testsuite/script_test_12b.c: New test source file.
573
574 2015-06-02 Cary Coutant <ccoutant@gmail.com>
575
576 * nacl.h (Sniff_file): Switch parameters to get_view to get an
577 aligned view.
578
579 2015-06-03 Cary Coutant <ccoutant@gmail.com>
580
581 PR gold/17819
582 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
583 separate task to schedule the build id computation.
584 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
585 add Output_file and offset.
586 (Hash_task::run): Get and release the input views.
587 (Hash_task::is_runnable): Always return NULL (always runnable).
588 (Layout::queue_build_id_tasks): Remove.
589 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
590 parameters; use them instead of class members.
591 (Build_id_task_runner::run): New function.
592 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
593 to write_build_id.
594 * layout.h (Layout::queue_build_id_tasks): Remove.
595 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
596 parameters.
597 (Layout::array_of_hashes_): Remove.
598 (Layout::size_of_array_of_hashes_): Remove.
599 (Layout::input_view_): Remove.
600 (Build_id_task_runner): New class.
601 (Close_task_runner::Close_task_runner): Add array_of_hashes and
602 size_of_hashes parameters.
603 (Close_task_runner::array_of_hashes_): New data member.
604 (Close_task_runner::size_of_hashes_): New data member.
605 * testsuite/Makefile.am
606 (flagstest_compress_debug_sections_and_build_id_tree): New test.
607 * testsuite/Makefile.in: Regenerate.
608
609 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
610
611 * merge.cc (get_input_merge_map): Update for data structure change.
612 (get_or_make_input_merge_map): Update for data structure change.
613 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
614 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
615
616 2015-05-16 Alan Modra <amodra@gmail.com>
617
618 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
619 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
620 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
621 (lis_0): Rename from lis_0_0.
622
623 2015-04-29 Cary Coutant <cary@google.com>
624 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
625
626 * gc.h (Garbage_collection::is_section_garbage): Change Object*
627 to Relobj*.
628 (Garbage_collection::add_reference): Likewise.
629 (Garbage_collection::gc_process_relocs): Likewise. Don't push
630 object/shndx pair onto *secvec for dynamic objects. Don't follow
631 relocations pointing to dynamic objects for GC.
632 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
633 (Icf::unfold_section): Likewise.
634 (Icf::is_section_folded): Likewise.
635 (Icf::get_folded_section): Likewise.
636 * icf.h: (Icf::get_folded_section): Likewise.
637 (Icf::unfold_section): Likewise.
638 (Icf::is_section_folded): Likewise.
639 (Icf::section_has_function_pointers): Likewise.
640 (Icf::set_section_has_function_pointers): Likewise.
641 * object.h (Section_id): Likewise.
642 (Const_section_id): Likewise.
643 * output.cc (Output_section::update_section_layout): Likewise.
644 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
645 Likewise.
646 * plugin.cc (update_section_order): Likewise.
647 (unique_segment_for_sections): Likewise.
648 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
649 (Target_powerpc::do_gc_add_reference): Likewise.
650 (Target_powerpc::gc_process_relocs): Likewise.
651 (Target_powerpc::do_gc_add_reference): Likewise.
652 * symtab.cc (Symbol_table::is_section_folded): Likewise.
653 (Symbol_table::gc_mark_symbol): Likewise.
654 * symtab.h: (Symbol_table::is_section_folded): Likewise.
655 * target.h: (Sized_target::gc_add_reference): Likewise.
656 (Sized_target::do_gc_add_reference): Likewise.
657
658 2015-04-29 Nick Clifton <nickc@redhat.com>
659
660 * po/fi.po: Updated Finnish translation.
661
662 2015-04-28 Alan Modra <amodra@gmail.com>
663
664 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
665 than unsigned int for find_global_entry result temp. Compare
666 against invalid_address.
667 (Target_powerpc::do_plt_address_for_global): Likewise.
668 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
669 on plt call stub existence for debug info. Do assert for plt
670 and global entry stub existence if an alloc section.
671
672 2015-04-28 Alan Modra <amodra@gmail.com>
673
674 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
675 on missing global entry stub due to bogus debug info.
676
677 2015-04-27 Han Shen <shenhan@google.com>
678
679 * options.h (--fix-cortex-a53-843419): Rename option.
680 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
681 option.
682 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
683
684 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
685
686 PR gold/18327
687 * output.cc (Output_section::is_input_address_mapped): Assume a missing
688 entry is mapped.
689 * testsuite/Makefile.am: Add the eh_test test.
690 * testsuite/Makefile.in: Regenerate.
691 * testsuite/eh_test_a.cc: New test.
692 * testsuite/eh_test_b.cc: New test.
693
694 2015-04-23 Sriraman Tallam <tmsriram@google.com>
695
696 * options.h (--weak-unresolved-symbols): New option.
697 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
698 binding to weak with new option.
699 * symtab.h (is_weak_undefined): Check for new option.
700 (is_strong_undefined): Check for new option.
701 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
702 * testsuite/Makefile.in: Regenerate.
703 * testsuite/weak_unresolved_symbols_test.cc: New file.
704
705 2015-04-20 Ian Coolidge <icoolidge@google.com>
706
707 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
708 GNU_UNIQUE.
709
710 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
711
712 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
713 push_back.
714 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
715 * object.cc (Sized_relobj_file::do_layout): Use push_back.
716 * powerpc.cc (process_gc_mark): Use push_back.
717 (Target_powerpc::do_gc_mark_symbol): Use push_back.
718 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
719
720 2015-04-16 Han Shen <shenhan@google.com>
721
722 * aarch64.cc (AArch64_insn_utilities): New utility class.
723 (AArch64_relobj::Mapping_symbol_position): New struct.
724 (AArch64_relobj::Mapping_symbol_info): New typedef.
725 (AArch64_relobj::do_count_local_symbols): New function overriding
726 parent's implementation.
727 (AArch64_relobj::mapping_symbol_info_): New member
728 (AArch64_relobj::scan_erratum_843419): New method.
729 (Target_aarch64::scan_erratum_843419_span): New method.
730 (Target_aarch64::is_erratum_843419_sequence): New method.
731 * options.h (fix_cortex_a53): New option.
732
733 2015-04-09 Cary Coutant <ccoutant@google.com>
734
735 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
736 in a PIE link.
737 * testsuite/Makefile.am (tls_pie_test.sh): New test.
738 * testsuite/Makefile.in: Regenerate.
739 * testsuite/tls_pie_test.sh: New.
740
741 2015-04-09 Cary Coutant <ccoutant@google.com>
742
743 * debug.h (DEBUG_LOCATION): New.
744 (DEBUG_ALL): Include DEBUG_LOCATION.
745 (debug_string_to_enum): Add DEBUG_LOCATION.
746 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
747 output to print correct context.
748 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
749 up to 4 more locations at the beginning of the function.
750 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
751 result before sorting list of line numbers.
752 * testsuite/debug_msg.sh: Allow range of line numbers for
753 canonical results on optimized code.
754
755 2015-04-07 HC Yen <hc.yen@mediatek.com>
756
757 Add AArch32 support for gold linker.
758 gold/
759 * arm.cc: Add V8 arch combine table.
760
761 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
762
763 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
764
765 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
766
767 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
768 to find by using the return value of insert.
769
770 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
771
772 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
773 constructor call.
774
775 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
776
777 PR gold/17641
778 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
779 (Target_x86_64::Scan::local): Don't create GOT entry, when we
780 can convert mov to lea.
781 (Target_x86_64::Scan::global): Ditto.
782 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
783 %reg to lea foo(%rip), %reg if possible.
784 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
785 * testsuite/x86_64_mov_to_lea1.s: New.
786 * testsuite/x86_64_mov_to_lea2.s: Ditto.
787 * testsuite/x86_64_mov_to_lea3.s: Ditto.
788 * testsuite/x86_64_mov_to_lea4.s: Ditto.
789 * testsuite/x86_64_mov_to_lea.sh: Ditto.
790
791 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
792
793 * configure: Regenerated.
794
795 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
796
797 PR gold/17640
798 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
799 (Target_i386::Scan::local): Don't create GOT entry, when we
800 can convert GOT to GOTOFF.
801 (Target_i386::Scan::global): Ditto.
802 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
803 lea foo@GOTOFF(%reg), %reg if possible.
804 * testsuite/Makefile.am (i386_mov_to_lea): New test.
805 * testsuite/i386_mov_to_lea1.s: New.
806 * testsuite/i386_mov_to_lea2.s: Ditto.
807 * testsuite/i386_mov_to_lea3.s: Ditto.
808 * testsuite/i386_mov_to_lea4.s: Ditto.
809 * testsuite/i386_mov_to_lea5.s: Ditto.
810 * testsuite/i386_mov_to_lea.sh: Ditto.
811
812 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
813
814 * Makefile.am (ZLIB): New.
815 (ZLIBINC): Likewise.
816 (AM_CFLAGS): Add $(ZLIBINC).
817 (AM_CXXFLAGS): Likewise.
818 (ldadd_varldadd_var): Add $(ZLIB).
819 (incremental_dump_LDADD): Likewise.
820 (dwp_LDADD): Likewise.
821 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
822 <zlib.h>.
823 (zlib_compress): Don't check HAVE_ZLIB_H.
824 (zlib_decompress): Likewise.
825 * options.h (compress_debug_sections): Likewise.
826 * configure.ac (AM_CONDITIONAL): Removed.
827 * testsuite/Makefile.am (ZLIB): New.
828 (LDADD): Add $(ZLIB).
829 Don't check HAVE_ZLIB.
830 * Makefile.in: Regenerated.
831 * config.in: Likewise.
832 * configure: Likewise.
833 * testsuite/Makefile.in: Likewise.
834
835 2015-03-30 Jing Yu <jingyu@google.com>
836
837 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
838 TLSLD_ADD_DTPREL_LO12_NC.
839 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
840 _TLS_MODULE_BASE_ point to the start of tls segment.
841 (Target_aarch64::optimize_tls_reloc): Add cases for
842 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
843 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
844 (Target_aarch64::Scan::local): Likewise.
845 (Target_aarch64::Scan::global): Likewise.
846 (Target_aarch64::Relocate::relocate): Likewise.
847 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
848 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
849 relocations.
850
851 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
852
853 * merge.cc (Object_merge_map::add_mapping): call
854 Object_merge_map::Input_merge_map::add_mapping.
855 (Object_merge_map::Input_merge_map::add_mapping): New.
856 (Output_merge_data::do_add_input_section): Call
857 get_or_make_input_merge_map before a loop.
858 (Output_merge_string<Char_type>::finalize_merged_data): Call
859 get_or_make_input_merge_map before a loop.
860 * merge.h (Object_merge_map): Make Input_merge_map public.
861 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
862 (Relobj::get_or_create_merge_map): New.
863 * object.h (Relobj::get_or_create_merge_map): New.
864
865 2015-03-24 Alan Modra <amodra@gmail.com>
866
867 PR 18147
868 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
869 relocation errors for branches to strong undefined symbols.
870
871 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
872
873 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
874 (Object_merge_map::is_merge_section_for): Remove.
875 (Object_merge_map::find_merge_section): New.
876 * merge.h (Object_merge_map::is_merge_section_for): Remove.
877 (Object_merge_map::find_merge_section): New.
878 (Object_merge_map::get_input_merge_map): Add a const version.
879 * object.cc (Relobj::is_merge_section_for): Remove.
880 (Relobj::find_merge_section): New.
881 * object.h (Relobj::is_merge_section_for): Remove.
882 (Relobj::find_merge_section): New.
883 * output.cc
884 (Output_section::Input_section::is_merge_section_for): Remove.
885 (Output_section::add_merge_input_section): Don't call
886 add_merge_input_section.
887 (Output_section::find_merge_section): Return const. Use
888 object->find_merge_section.
889 (Output_section::build_lookup_maps): Don't build a map for
890 merge sections.
891 (Output_section::is_input_address_mapped): Return false if
892 section is not found.
893 (Output_section::find_starting_output_address): Use
894 find_merge_section instead of is_merge_section_for.
895 (Output_section::add_script_input_section): Don't build a map for
896 merge sections.
897 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
898 (Output_section_lookup_maps::find_merge_section): Remove.
899 (Output_section_lookup_maps::add_merge_input_section) Remove.
900 (Output_section::find_merge_section): Return const.
901
902 2015-03-22 Cary Coutant <cary@google.com>
903
904 PR gold/18106
905 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
906 non-SIB form of lea, with nop after the call.
907
908 2015-03-21 Cary Coutant <cary@google.com>
909
910 PR gold/14217
911 * output.cc (Output_segment::is_first_section_relro): Don't ignore
912 .tdata section.
913 (Output_segment::set_section_addresses): Don't align size of relro
914 segment for .tbss.
915
916 2015-03-21 Cary Coutant <cary@google.com>
917
918 PR gold/18010
919 * stringpool.cc (Stringpool_template): Don't optimize if section
920 alignment is greater than sizeof(char).
921
922 2015-03-21 Cary Coutant <cary@google.com>
923
924 PR gold/18048
925 * script-c.h (script_include_directive): Add first_token parameter.
926 * script.cc (script_include_directive): Add first_token parameter, and
927 pass it to read_script_file.
928 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
929 (PARSING_MEMORY_DEF): New tokens.
930 (top): Add new productions for INCLUDE files.
931 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
932 Pass PARSING_LINKER_SCRIPT to script_include_directive.
933 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
934 (section_cmd): Pass PARSING_SECTION_CMDS.
935 (file_or_sections_cmd): Remove.
936 (memory_def): Pass PARSING_MEMORY_DEF.
937 * testsuite/Makefile.am (memory_test_2): New test.
938 * testsuite/Makefile.in: Regenerate.
939 * testsuite/memory_test_inc.t: New script file.
940 * testsuite/memory_test_inc_1.t.src: New script file.
941 * testsuite/memory_test_inc_2.t.src: New script file.
942 * testsuite/memory_test_inc_3.t.src: New script file.
943
944 2015-03-21 Cary Coutant <cary@google.com>
945
946 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
947 (Sized_relobj_dwo::setup): Build compressed section map.
948 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
949 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
950 section map.
951 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
952 compressed_sections_ field.
953 (build_compressed_section_map): Take Object instead of
954 Sized_relobj_file parameter; add decompress_if_needed parameter.
955 (Sized_relobj_file::do_find_special_sections): Store compressed
956 section map in parent Object.
957 (Sized_relobj_file::do_decompressed_section_contents): Move
958 implementation to Object::decompressed_section_contents.
959 (Sized_relobj_file::do_discard_decompressed_sections): Move
960 implementation to Object::discard_decompressed_sections.
961 * object.h (build_compressed_section_map): Declare.
962 (Object::Object): Add compressed_sections_ field.
963 (Object::section_is_compressed): Move implementation here.
964 (Object::decompressed_section_contents): De-virtualize.
965 (Object::discard_decompressed_sections): De-virtualize.
966 (Object::do_section_is_compressed): Delete.
967 (Object::do_decompressed_section_contents): Delete.
968 (Object::set_compressed_sections): New method.
969 (Object::compressed_sections): New method.
970 (Object::compressed_sections_): New data member.
971 (Compressed_section_info, Compressed_section_map): Move to top of file.
972 (Sized_relobj_file::do_section_is_compressed): Delete.
973 (Sized_relobj_file::do_decompressed_section_contents): Delete.
974 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
975 (Sized_relobj_file::compressed_sections_): Move to Object class.
976
977 2015-03-21 Cary Coutant <ccoutant@google.com>
978
979 PR gold/18152
980 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
981 deferred objects.
982
983 2015-03-11 Cary Coutant <ccoutant@google.com>
984
985 * options.cc (General_options::finalize): Don't allow -z relro
986 with incremental linking.
987 * testsuite/Makefile.am (incremental_test): Add -z norelro.
988 (incremental_test_2): Likewise.
989 (incremental_test_3): Likewise.
990 (incremental_test_4): Likewise.
991 (incremental_test_5): Likewise.
992 (incremental_test_6): Likewise.
993 (incremental_copy_test): Likewise.
994 (incremental_common_test_1): Likewise.
995 (incremental_comdat_test_1): Likewise.
996 * testsuite/Makefile.in: Regenerate.
997
998 2015-03-09 Cary Coutant <ccoutant@google.com>
999
1000 PR gold/14675
1001 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1002 return enum indicating whether .eh_frame section is empty, optimizable,
1003 unrecognized, or an end marker. Adjust explicit instantiations.
1004 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1005 (Eh_frame::add_ehframe_input_section): Change return type.
1006 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1007 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1008 to the .eh_frame output section until we see the end marker.
1009 (Layout::finalize_eh_frame_section): New.
1010 * layout.h: (Layout::finalize_eh_frame_section): New.
1011
1012 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1013
1014 * output.cc (Relobj::initialize_input_to_output_map<size>):
1015 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1016
1017 2015-03-04 Cary Coutant <ccoutant@google.com>
1018
1019 * parameters.cc (Parameters::set_target_once): Call
1020 Target::select_as_default_target just once from here...
1021 (set_parameters_target): ...instead of from here.
1022
1023 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1024
1025 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1026 Output_section_data instead of a Merge_map.
1027 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1028 (Eh_frame::read_cie): Use add_merge_mapping instead of
1029 Merge_map::add_mapping.
1030 (Eh_frame::read_fde): Ditto.
1031 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1032 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1033 merge_map_->get_output_offset.
1034 (Eh_frame::do_is_merge_section_for): Delete.
1035 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1036 instead of a Merge_map.
1037 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1038 Merge_map.
1039 (Eh_frame::do_is_merge_section_for): Delete.
1040 (Eh_frame::merge_map_): Delete.
1041 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1042 and use a Output_section_data instead of a Merge_map.
1043 (Object_merge_map::add_mapping): Ditto.
1044 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1045 (Object_merge_map::is_merge_section_for): Pass in and use a
1046 Output_section_data instead of a Merge_map.
1047 (Merge_map): Delete.
1048 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1049 of merge_map_.get_output_offset.
1050 (Output_merge_base::do_is_merge_section_for): Delete.
1051 (Output_merge_data::do_add_input_section): Use
1052 object->add_merge_mapping instead of add_mapping.
1053 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1054 * merge.h (Merge_map): Delete forward declaration.
1055 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1056 instead of a Merge_map.
1057 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1058 (Object_merge_map::is_merge_section_for): Pass in and use a
1059 Output_section_data instead of a Merge_map.
1060 (Input_merge_map::Object_merge_map::merge_map): Replace with
1061 output_data.
1062 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1063 Output_section_data instead of a Merge_map.
1064 (Merge_map): Delete.
1065 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1066 (Output_merge_base::do_is_merge_section_for): Delete.
1067 (Output_merge_base::add_mapping): Delete.
1068 (Output_merge_base::merge_map_): Delete.
1069 * object.cc (Relobj::initialize_input_to_output_map): New.
1070 (Relobj::initialize_input_to_output_map): New.
1071 (Relobj::merge_output_offset): New.
1072 (Relobj::is_merge_section_for): New.
1073 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1074 bits.
1075 * object.h (Relobj::merge_map): Delete.
1076 (initialize_input_to_output_map): New.
1077 (set_merge_map): Delete.
1078 (add_merge_mapping): New.
1079 (merge_output_offset): New.
1080 (is_merge_section_for): New.
1081 * output.cc (Output_section::Input_section::is_merge_section_for):
1082 Use object->is_merge_section_for.
1083 * output.h (Output_section_data::is_merge_section_for): Delete.
1084 (Output_section_data::do_is_merge_section_for): Delete.
1085 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1086 Use object->initialize_input_to_output_map.
1087 (Merged_symbol_value<size>::value_from_output_section): Use
1088 object->merge_output_offset.
1089
1090 2015-03-02 Peter Collingbourne <pcc@google.com>
1091 Cary Coutant <ccoutant@google.com>
1092
1093 * output.cc (Output_section::add_merge_input_section): Do not
1094 attempt to merge sections with an entsize of 0.
1095
1096 2015-03-02 Khem Raj <raj.khem@gmail.com>
1097
1098 * attributes.h (class Output_attributes_section_data ): Add
1099 do_print_to_mapfile function.
1100
1101 2015-02-24 Alan Modra <amodra@gmail.com>
1102
1103 PR 18010
1104 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1105 complain if value is not a multiple of four.
1106 (Target_powerpc::Relocate::relocate): Correct handling of
1107 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1108
1109 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1110
1111 * configure.ac (default_size): Set to 32 for x32.
1112 * configure: Regenerated.
1113
1114 2015-02-18 Alan Modra <amodra@gmail.com>
1115
1116 PR 17954
1117 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1118 visibility.
1119
1120 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1121
1122 * gc.h (Garbage_collection::add_reference): Don't use find.
1123
1124 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1125
1126 * object.cc (write_local_symbols): avoid std::vector copy.
1127
1128 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1129
1130 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1131
1132 2015-02-09 Mark Wielaard <mjw@redhat.com>
1133
1134 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1135 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1136
1137 2015-02-16 Cary Coutant <ccoutant@google.com>
1138
1139 PR gold/13577
1140 PR gold/16992
1141 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1142 DF_SYMBOLIC if --dynamic-list option is used.
1143 * options.cc (General_options::finalize): --dynamic-list is not
1144 mutually exclusive with -Bsymbolic.
1145 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1146 listed in --dynamic-list.
1147 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1148 -Bsymbolic-functions.
1149 * testsuite/Makefile.in: Regenerate.
1150
1151 2015-02-16 Cary Coutant <ccoutant@google.com>
1152
1153 PR gold/17971
1154 * incremental.cc: Remove redundant include of "output.h".
1155
1156 2015-02-12 Jing Yu <jingyu@google.com>
1157
1158 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1159 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1160 New relocation.
1161 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1162 TLSLE_MOVW_* relocations.
1163 (Target_aarch64::Scan::global): Likewise.
1164 (Target_aarch64::Relocate::relocate): Likewise.
1165 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1166 for new TLSLE_MOVW_* relocations.
1167
1168 2015-02-11 Will Newton <will.newton@linaro.org>
1169
1170 PR gold/13321
1171 * arm.cc (Target_arm::make_plt_section): Create an ARM
1172 state mapping symbol at the start of the PLT.
1173
1174 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1175
1176 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1177 Replace two_file_shared_2.so with two_file_shared_1.so.
1178 * testsuite/Makefile.in: Regenerated.
1179
1180 2015-02-09 Alan Modra <amodra@gmail.com>
1181
1182 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1183 plugin_test_thin.a and defsym_test.
1184 * testsuite/Makefile.in: Regenerate.
1185
1186 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1187
1188 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1189 body.
1190
1191 2015-02-04 Peter Collingbourne <pcc@google.com>
1192
1193 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1194 forwarding symbols when computing symbol resolution info for plugins.
1195 * plugin.h (Plugin_manager::symtab): New method.
1196 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1197
1198 2015-02-03 Cary Coutant <ccoutant@google.com>
1199 Peter Collingbourne <pcc@google.com>
1200
1201 PR gold/15660
1202 * archive.cc (Thin_archive_object_unlocker): New class.
1203 (Archive::include_member): Unlock external members of thin archives.
1204 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1205 (plugin_test_2): Likewise.
1206 (plugin_test_3): Likewise.
1207 (plugin_test_4): Likewise.
1208 (plugin_test_5): Likewise.
1209 (plugin_test_6): Likewise.
1210 (plugin_test_7): Likewise.
1211 (plugin_test_8): Likewise.
1212 (plugin_test_9): Likewise.
1213 (plugin_test_10): Likewise.
1214 (plugin_test_11): New test case.
1215 * testsuite/Makefile.in: Regenerate.
1216 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1217 file to decide whether to claim file.
1218 (all_symbols_read_hook): Likewise.
1219 * testsuite/plugin_test_1.sh: Adjust expected output.
1220 * testsuite/plugin_test_2.sh: Likewise.
1221 * testsuite/plugin_test_3.sh: Likewise.
1222 * testsuite/plugin_test_6.sh: Likewise.
1223 * testsuite/plugin_test_tls.sh: Likewise.
1224 * testsuite/plugin_test_11.sh: New testcase.
1225
1226 2015-02-03 Cary Coutant <ccoutant@google.com>
1227
1228 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1229 file descriptors when debugging enabled. Add debug output.
1230 (Descriptors::release): Add debug output.
1231 (Descriptors::close_some_descriptor): Likewise.
1232 (Descriptors::close_all): Likewise.
1233 * fileread.cc (File_read::lock): Likewise.
1234 (File_read::unlock): Likewise.
1235
1236 2015-02-02 Cary Coutant <ccoutant@google.com>
1237
1238 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1239 executable output file.
1240
1241 2015-01-22 Han Shen <shenhan@google.com>
1242
1243 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1244 (Target_arm::do_plt_address_for_global): New method.
1245 (Target_arm::do_plt_address_for_local): New method.
1246 (Target_arm::rel_irelative_section): New method.
1247 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1248 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1249 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1250 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1251 (Target_arm::Scan::check_non_pic): Add ifunc support.
1252 (Target_arm::Scan::local): Add ifunc support.
1253 (Target_arm::Scan::global): Add ifunc support.
1254 (Target_arm::make_plt_section): New method.
1255 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1256 (Target_arm::make_local_ifunc_plt_entry): New method.
1257 (Target_arm::got_irelative_): New member.
1258 (Target_arm::rel_irelative_): New member.
1259 (Target_arm::got_section): Add creation for got_irelative_.
1260 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1261 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1262 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1263 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1264 (Output_data_plt_arm::IRelative_data): New type.
1265 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1266 (Output_data_plt_arm::add_entry): Add more parameters.
1267 (Output_data_plt_arm::add_relocation): New method.
1268 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1269 (Output_data_plt_arm::rel_irelative): New method.
1270 (Output_data_plt_arm::entry_count): Modified.
1271 (Output_data_plt_arm::address_for_global): New method.
1272 (Output_data_plt_arm::address_for_local): New method.
1273 gold/
1274 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1275 (Output_data_plt_arm::insert_irelative_data): New method.
1276 (Output_data_plt_arm::irelative_rel_): New member.
1277 (Output_data_plt_arm::got_): New member.
1278 (Output_data_plt_arm::got_irelative_): New member.
1279 (Output_data_plt_arm::irelative_count_): New member.
1280 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1281 (Output_data_plt_arm::irelative_data_vec_): New member.
1282 (Output_data_plt_arm::do_write): Write out irelative entries.
1283 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1284 more parameters to ctor.
1285 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1286 more parameters to ctor.
1287 * output.h (Output_data_reloc::add_local_relative): New method.
1288 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1289
1290 2015-01-29 Alan Modra <amodra@gmail.com>
1291
1292 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1293 and GOT_TLSGD to LE optimization.
1294
1295 2015-01-28 Cary Coutant <ccoutant@google.com>
1296
1297 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1298 for undef TLS symbols.
1299 (Target_x86_64::Relocate::relocate_tls): Likewise.
1300 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1301
1302 2015-01-25 Cary Coutant <ccoutant@google.com>
1303
1304 * output.cc (Output_segment::set_section_addresses): Fix calculation
1305 of size of relro segment.
1306
1307 2015-01-22 Alan Modra <amodra@gmail.com>
1308
1309 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1310 condition for need of ifunc plt entry.
1311 (Target_powerpc::Scan::global <got relocs>): Likewise.
1312
1313 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1314
1315 * mips.cc (reloc_high): Add r_sym.
1316 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1317 reloc_high constructor.
1318 (Mips_relocate_functions::relgot16_local): Likewise.
1319 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1320 r_type to decide whether LO16 matches HI16.
1321 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1322 rello16 and relgot16_local.
1323
1324 2015-01-09 Cary Coutant <ccoutant@google.com>
1325
1326 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1327 unless alignment is larger than page size.
1328
1329 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1330 Cary Coutant <ccoutant@google.com>
1331
1332 PR gold/17729
1333 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1334 (DEFAULT_TARGET_X32): Set for x32.
1335 * x86_64.cc (cmp_insn_32): New.
1336 (lea_r10_insn_32): Likewise.
1337 (lea_r11_insn_32): Likewise.
1338 (cmp_insn_64): Likewise.
1339 (lea_r10_insn_64): Likewise.
1340 (lea_r11_insn_64): Likewise.
1341 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1342 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1343 (check_DATA): Add split_x32 files.
1344 (split_x32_[1234n].o): New targets.
1345 (split_x32_[124]): New targets.
1346 (split_x32_[1234r].stdout): New targets.
1347 * testsuite/split_x32.sh: New file.
1348 * testsuite/split_x32_1.s: Likewise.
1349 * testsuite/split_x32_2.s: Likewise.
1350 * testsuite/split_x32_3.s: Likewise.
1351 * testsuite/split_x32_4.s: Likewise.
1352 * testsuite/split_x32_n.s: Likewise.
1353 * configure: Regenerated.
1354 * testsuite/Makefile.in: Likewise.
1355
1356 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1357
1358 PR gold/17809
1359 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1360 x32.
1361
1362 2015-01-02 Alan Modra <amodra@gmail.com>
1363
1364 * version.cc (print_version): Just print current year.
1365 * dwp.cc (print_version): Likewise.
1366
1367 2015-01-01 Alan Modra <amodra@gmail.com>
1368
1369 Update year range in copyright notice of all files.
1370
1371 2014-12-25 Alan Modra <amodra@gmail.com>
1372
1373 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1374 new enums.
1375 (Target_arm::merge_object_attributes, ): Likewise.
1376
1377 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1378
1379 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1380 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1381 AEABI_VFP_args_vfp to check that.
1382 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1383 value and replace hardcoded values by enum values.
1384
1385 2014-12-22 Cary Coutant <ccoutant@google.com>
1386
1387 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1388
1389 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1390
1391 PR gold/14608
1392 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1393 to "return i * i * 3;".
1394
1395 2014-12-16 Cary Coutant <ccoutant@google.com>
1396
1397 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1398 (Mapfile::print_output_data): Use current_data_size() to avoid
1399 assert for sections requiring postprocessing; if address is not valid,
1400 print 0.
1401 (Mapfile::print_output_section): Use current_data_size(); print note
1402 that addresses and sizes are before compression.
1403
1404 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1405
1406 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1407 Cast current_group_size to unsigned long when reporting error.
1408
1409 2014-12-10 Jing Yu <jingyu@google.com>
1410
1411 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1412 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1413 Update error message.
1414 (Target_aarch64::do_relax): Use absolute value of option
1415 stub_group_size. Replace local variable with class member
1416 stub_group_size_.
1417
1418 2014-12-04 Alan Modra <amodra@gmail.com>
1419
1420 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1421 addend of PLTREL24 reloc when not generating a plt stub. Make
1422 max_branch_offset an "Address".
1423 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1424 (Target_powerpc::Relocate::relocate): Likewise.
1425
1426 2014-12-04 Alan Modra <amodra@gmail.com>
1427
1428 PR 17670
1429 * symtab.cc (Symbol::set_undefined): Remove assertion.
1430 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1431 on symbols defined in discarded sections, instead return false.
1432 Rearrange params, update all callers.
1433 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1434 branches to syms in discarded sections.
1435 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1436 undefined and flag as discarded.
1437 (Target_powerpc::Relocate::relocate): Localize variable.
1438
1439 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1440
1441 PR gold/17675
1442 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1443 * testsuite/Makefile.in: Regenerated.
1444
1445 2014-12-03 Alan Modra <amodra@gmail.com>
1446
1447 PR 17566
1448 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1449 when adding dynamic relocations against section symbols.
1450
1451 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1452
1453 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1454 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1455 * options.h (General_options): New -z option (global).
1456
1457 2014-12-01 Cary Coutant <ccoutant@google.com>
1458
1459 PR gold/17578
1460 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1461 is given.
1462 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1463 given but some inputs require executable stack.
1464
1465 2014-11-26 Cary Coutant <ccoutant@google.com>
1466
1467 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1468 .debug_str_offsets; strip .debug_gnu_pubnames and
1469 .debug_gnu_pubtypes.
1470 (lines_only_debug_sections): Strip all four new sections.
1471
1472 2014-11-26 Jing Yu <jingyu@google.com>
1473
1474 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1475 register to be x0 when to relax TLSDESC_LD64_LO12.
1476
1477 2014-11-26 Alan Modra <amodra@gmail.com>
1478
1479 * powerpc.cc (struct Stub_table_owner): New.
1480 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1481 unsigned int vector. Update all references.
1482 (powerpc_relobj::set_stub_table): Take an unsigned int param
1483 rather than a Stub_table. Update callers.
1484 (Powerpc_relobj::clear_stub_table): New function.
1485 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1486 stub_group_size_ vars.
1487 (Target_powerpc::new_stub_table): Delete.
1488 (max_branch_delta): New function, extracted from..
1489 (Target_powerpc::Relocate::relocate): ..here..
1490 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1491 status on whether stub created successfully.
1492 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1493 default sizing to..
1494 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1495 reduce on relax failure.
1496 (Target_powerpc::group_sections): Add "no_size_errors" param.
1497 Use stub_group_size_. Set up group info in a temp vector,
1498 before building Stub_table vector. Account for input sections
1499 possibly already converted to relaxed sections.
1500 (Stub_table::init): Delete. Merge into..
1501 (Stub_table::Stub_table): ..here.
1502 (Stub_table::can_reach_stub): New function.
1503 (Stub_table::add_plt_call_entry): Add "from" parameter and
1504 return true iff stub could be reached.
1505 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1506 param too.
1507 (Stub_table::clear_stubs): Add "all" param.
1508
1509 2014-11-26 Alan Modra <amodra@gmail.com>
1510
1511 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1512 (Target_powerpc::group_sections): Use it.
1513
1514 2014-11-25 Cary Coutant <ccoutant@google.com>
1515
1516 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1517 (Binary_to_elf::write_symbol): Add st_size parameter.
1518 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1519
1520 2014-11-25 Cary Coutant <ccoutant@google.com>
1521
1522 PR gold/17639
1523 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1524 (Sized_relobj_file::do_layout): Handle deferred sections properly
1525 during GC pass 1. Don't add reloc sections to deferred list twice.
1526 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1527 (Sized_relobj_file::is_deferred_layout_): New data member.
1528
1529 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1530
1531 PR gold/17619
1532 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1533 Check PC-relative offset overflow in PLT entry.
1534
1535 2014-11-21 Alan Modra <amodra@gmail.com>
1536
1537 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1538 for undefined weaks.
1539
1540 2014-11-20 Alan Modra <amodra@gmail.com>
1541
1542 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1543 from --stub-group-size parameter divided by 1024.
1544 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1545 template parameter. Update all uses.
1546 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1547 has_stub_value. Set for long branches. Don't report overflow for
1548 branch to undefined weak symbols. Print info message on
1549 overflowing branch to stub.
1550
1551 2014-11-20 Alan Modra <amodra@gmail.com>
1552
1553 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1554
1555 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1556
1557 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1558 entry for R_X86_64_GOTPLT64.
1559 (Target_x86_64<size>::Relocate::relocate): Update comments for
1560 R_X86_64_GOTPLT64.
1561
1562 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1563
1564 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1565 * plugin.h: add lock definition
1566
1567 2014-10-29 Han Shen <shenhan@google.com>
1568 Jing Yu <jingyu@google.com>
1569
1570 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1571 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1572 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1573 Symbol::TLS_REF.
1574 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1575 method.
1576 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1577 (Target_aarch64::tls_ld_to_le): New method.
1578 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1579 for 64bit targets.
1580 (Output_data_plt_aarch64::irelative_rel_): New data member.
1581 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1582 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1583 (Output_data_plt_aarch64::add_relocation): New method.
1584 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1585 offset. Add got_irelative size to got size.
1586 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1587 type string with the new typename.
1588 (AArch64_relocate_functions::update_adr): Replace parameter x with
1589 immed.
1590 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1591 (AArch64_relocate_functions::reloc_common): New method.
1592 (AArch64_relocate_funcsions::rela_general): Extract common part out
1593 into reloc_common method.
1594 (AArch64_relocate_functions::rela_general): Likewise.
1595 (AArch64_relocate_functions::pcrela_general): Likewise.
1596 (AArch64_relocate_functions::adr): New method.
1597 (AArch64_relocate_functions::adrp): Calculate immed before calling
1598 update_adr.
1599 (AArch64_relocate_functions::adrp): Likewise.
1600 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1601 comparing x to 0. Calculate immed from ~x when x < 0.
1602 (Target_aarch64::optimize_tls_reloc): Add new cases for
1603 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1604 TLSLD_MOVW_DTPREL_G0_NC.
1605 (Target_aarch64::possible_function_pointer_reloc): Implement this
1606 method.
1607 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1608 comment.
1609 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1610 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1611 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1612 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1613 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1614 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1615 (Target_aarch64::make_plt_entry): Call add_entry with two more
1616 parameters.
1617 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1618 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1619 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1620 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1621 (Target_aarch64::Relocate::relocate_tls): Add cases for
1622 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1623 TLSLD_MOVW_DTPREL_G0_NC.
1624 * testsuite/icf_safe_so_test.cc: Correct test comment.
1625 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1626
1627 2014-10-22 Alan Modra <amodra@gmail.com>
1628
1629 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1630 thread_starter.
1631
1632 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1633
1634 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1635
1636 2014-10-17 Cary Coutant <ccoutant@google.com>
1637
1638 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1639 Add "typename" keyword.
1640
1641 2014-10-15 Han Shen <shenhan@google.com>
1642 Jing Yu <jingyu@google.com>
1643
1644 Patch for gold aarch64 backend to support relaxation.
1645 * aarch64-reloc.def: Change format.
1646 * aarch64.cc (class Reloc_stub): New class.
1647 (class Stub_table): New class.
1648 (class AArch64_relobj): New class.
1649 (class AArch64_input_section): New class.
1650 (class AArch64_output_section): New class.
1651 (Target_aarch64::new_stub_table): New method.
1652 (Target_aarch64::new_aarch64_input_section): New method.
1653 (Target_aarch64::find_aarch64_input_section): New method.
1654 (Target_aarch64::scan_section_for_stubs): New method.
1655 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1656 (Target_aarch64::relocate_stub): New method.
1657 (Target_aarch64::current_target): New method.
1658 (Target_aarch64::do_make_elf_object): New method.
1659 (Target_aarch64::do_may_relax): New method.
1660 (Target_aarch64::do_relax): New method.
1661 (Target_aarch64::group_sections): New method.
1662 (Target_aarch64::scan_reloc_for_stub): New method.
1663 (Target_aarch64::do_make_output_section): New method.
1664 (Target_aarch64::stub_tables_): New data member.
1665 (Target_aarch64::aarch64_input_section_map_): New data member.
1666 (AArch64_relocate_functions::maybe_apply_stub): New method.
1667
1668 2014-09-30 Cary Coutant <ccoutant@google.com>
1669
1670 PR gold/17432
1671 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1672
1673 2014-09-30 Kito Cheng <kito@0xlab.org>
1674
1675 PR gold/13597
1676 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1677 hash table before sysv-style hash table.
1678
1679 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1680
1681 * options.h (--pic-executable): Add negative to alias to -no-pie.
1682
1683 2014-09-26 Cary Coutant <ccoutant@google.com>
1684
1685 PR gold/16773
1686 * object.cc (Sized_relobj_file): Compute value of section symbols
1687 for TLS sections the same as TLS symbols.
1688
1689 2014-09-25 Cary Coutant <ccoutant@google.com>
1690
1691 PR gold/17432
1692 * resolve.cc (Symbol_table::resolve): Override common placeholder
1693 symbols, but adjust sizes.
1694 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1695 symbols to common lists.
1696
1697 2014-09-24 Alan Modra <amodra@gmail.com>
1698
1699 * po/POTFILES.in: Regenerate.
1700
1701 2014-09-23 Taiju Tsuiki <tzik@google.com>
1702 Cary Coutant <ccoutant@google.com>
1703
1704 PR gold/14860
1705 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1706 on input_sections_blocker.
1707 * layout.cc (Write_sections_task::locks): Unblock
1708 input_sections_blocker_.
1709 * layout.h (Write_sections_task::Write_sections_task): Add
1710 input_sections_blocker.
1711 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1712 to DEPENDENCIES.
1713 * testsuite/Makefile.in: Regenerate.
1714
1715 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1716
1717 * testsuite/Makefile.am (plugin_test_10): New test.
1718 * testsuite/Makefile.in: Regenerate
1719 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1720 * testsuite/plugin_test_10.sh: New file.
1721
1722 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1723
1724 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1725 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1726 during the replacement phase.
1727
1728 2014-09-17 Han Shen <shenhan@google.com>
1729 Jing Yu <jingyu@google.com>
1730
1731 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1732 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1733 * aarch64.cc (Target_aarch64): Add data members
1734 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1735 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1736 constructor.
1737 (Target_aarch64::do_reloc_symbol_index): New method.
1738 (Target_aarch64::do_reloc_addend): New method.
1739 (Target_aarch64::add_tlsdesc_info): New method.
1740 (Target_aarch64::do_dynsym_value): New method.
1741 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1742 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1743 (Target_aarch64::make_data_plt): Add new parameters: got,
1744 got_irelative. Pass them to do_make_data_plt.
1745 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1746 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1747 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1748 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1749 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1750 (Target_aarch64::got_tlsdesc_section): New method.
1751 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1752 (Target_aarch64::define_tls_base_symbol): New method.
1753 (Target_aarch64::reserve_tlsdesc_entries): New method.
1754 (Target_aarch64::got_mod_index_entry): New method.
1755 (Target_aarch64::rela_tlsdesc_section): New method.
1756 (Target_aarch64::rela_irelative_section): New method.
1757 (Target_aarch64::Tlsdesc_info): New struct.
1758 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1759 relocations and tlsdesc relocations.
1760 (Target_aarch64::optimize_tls_reloc): Implement method.
1761 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1762 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1763 in constructor.
1764 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1765 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1766 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1767 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1768 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1769 (Output_data_plt_aarch64::rela_irelative): New method.
1770 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1771 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1772 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1773 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1774 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1775 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1776 (Output_data_plt_aarch64_standard): New member variables:
1777 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1778 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1779 New parameter: got, got_irelative.
1780 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1781 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1782 (Output_data_plt_aarch64::do_write): Replace got_address with
1783 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1784 (AArch64_relocate_functions::update_movnz): New method.
1785 (AArch64_relocate_functions): Correct format.
1786 (AArch64_relocate_functions::movnz): New method.
1787 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1788 before the switch. Add new cases to switch.
1789 Check ie_to_le relaxation on tlsie relocations. Add code handling
1790 tlsgd tlsdesc cases.
1791 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1792 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1793 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1794 Call reloc_name_in_error_message to print unsupported reloc.
1795 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1796 make_data_plt.
1797 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1798 relocs. Fill in some more dynamic tags.
1799 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1800 Skip call tls_get_addr when tlsgd is relaxed.
1801 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1802 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1803 tlsdesc->ie relaxation.
1804
1805 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1806
1807 * mips.cc (Target_mips_nacl): New class.
1808 (Target_selector_mips_nacl): New class.
1809 (target_selector_mips32): Rename from target_selector_mips32be and use
1810 Target_selector_mips_nacl instead of Target_selector_mips.
1811 (target_selector_mips32el): Rename from target_selector_mips32 and use
1812 Target_selector_mips_nacl instead of Target_selector_mips.
1813 (target_selector_mips64): Rename from target_selector_mips64be and use
1814 Target_selector_mips_nacl instead of Target_selector_mips.
1815 (target_selector_mips64el): Rename from target_selector_mips64 and use
1816 Target_selector_mips_nacl instead of Target_selector_mips.
1817 (Target_mips::mips_info): Add const attribute.
1818
1819 2014-09-02 Cary Coutant <ccoutant@google.com>
1820
1821 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1822 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1823 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1824 (Sized_incr_dynobj::do_section_name): Likewise.
1825 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1826 (Sized_incr_dynobj::do_section_name): Likewise.
1827 * object.h (Object::section_name): Likewise.
1828 (Object::do_section_name): Likewise.
1829 (Sized_relobj_file::do_section_name): Likewise.
1830 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1831 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1832
1833 2014-09-02 Cary Coutant <ccoutant@google.com>
1834
1835 PR gold/17005
1836 * ehframe.cc (Fde::write): Add output_offset parameter.
1837 (Cie::write): Likewise.
1838 (Eh_frame::set_final_data_size): Account for offset within output
1839 section.
1840 (Eh_frame::do_sized_write): Likewise.
1841 * ehframe.h (Fde::write): Add output_offset parameter.
1842 (Cie::write): Likewise.
1843 * output.cc (Output_section::Input_section_sort_entry): Remove
1844 section_has_name_; add output_section_name parameter. Use
1845 output section name for non-input sections.
1846 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1847 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1848 (Output_section::Input_section_sort_compare): Remove logic for
1849 sections without names.
1850 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1851 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1852 Likewise.
1853 (Output_section::Input_section_sort_section_name_compare): Likewise.
1854
1855 2014-08-29 Han Shen <shenhan@google.com>
1856 Jing Yu <jingyu@google.com>
1857
1858 * aarch64-reloc-property.cc
1859 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1860 reference reloc property in the table.
1861 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1862 3 other entries.
1863 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1864 2 new overloaded methods.
1865 (Output_data_got_aarch64::do_write): Add code to write out
1866 static relocs.
1867 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1868 static relocs.
1869 (Output_data_got_aarch64::static_relocs): New vector to
1870 hold static relocs.
1871 (Target_aarch64::TCB_SIZE): New const static memeber.
1872 (Target_aarch64::tcb_size): New method.
1873 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1874 (Target_aarch64::Relocate::relocate_tls): New method.
1875 (Target_aarch64::Scan::local): Add code handling new reloc types.
1876 (Target_aarch64::Scan::global): Add code handling new reloc types.
1877
1878 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1879
1880 * options.h (-no-pie): Add option.
1881
1882 2014-08-08 Jing Yu <jingyu@google.com>
1883 Han Shen <shenhan@google.com>
1884
1885 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1886 (DEFFILES): add aarch64-reloc.def.
1887 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1888 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1889 * Makefile.in: Regenerate.
1890 * aarch64-reloc-property.cc: New file.
1891 * aarch64-reloc-property.h: New file.
1892 * aarch64-reloc.def: New file.
1893 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1894 with tab to make the format consistent.
1895 (Output_data_got_aarch64::symbol_table_): New method.
1896 (Target_aarch64::do_plt_address_for_global): New method.
1897 (Target_aarch64::do_plt_address_for_local): New method.
1898 (Target_aarch64::do_select_as_default_target): New method.
1899 (Target_aarch64::do_make_data_plt): New method.
1900 (Target_aarch64::make_data_plt): New method.
1901 (Output_data_plt_aarch64::has_irelative_section): New method.
1902 (Output_data_plt_aarch64::address_for_global): New method.
1903 (Output_data_plt_aarch64::address_for_local): New method.
1904 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1905 (Output_data_plt_aarch64::add_entry): Implement contents.
1906 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1907 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1908 the got_pov entry to plt0.
1909 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1910 Implement contents.
1911 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1912 (AArch64_howto): New struct.
1913 (aarch64_howto[]): New static const array.
1914 (AArch64_relocate_functions): New class.
1915 (Target_aarch64::Scan::get_reference_flags): Remove method.
1916 (Target_aarch64::Scan::local): Implement to support a few relocations.
1917 (Target_aarch64::Scan::global): Implement to support a few relocations.
1918 (Target_aarch64::make_plt_section): Implement contents.
1919 (Target_aarch64::make_plt_entry): Implement contents.
1920 (Target_aarch64::do_finalize_sections): Implement contents.
1921 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1922 (Target_aarch64::relocate_section): Implement contents.
1923
1924 2014-08-06 Alan Modra <amodra@gmail.com>
1925
1926 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1927
1928 2014-08-06 Alan Modra <amodra@gmail.com>
1929
1930 PR 13227
1931 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1932
1933 2014-07-21 Sriraman Tallam <tmsriram@google.com>
1934
1935 * object.cc (Relobj::is_section_name_included): Add
1936 ".rodata.nptl_version" to not garbage collect this section.
1937
1938 2014-07-08 Cary Coutant <ccoutant@google.com>
1939
1940 * expression.cc (struct Expression::Expression_eval_info): Add
1941 new fields type_pointer, vis_pointer, and nonvis_pointer.
1942 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1943 nonvis_pointer parameters. Adjust all calls.
1944 (Symbol_expression::value): Update type, visibility, and nonvis bits
1945 in caller.
1946 * script.cc (Symbol_assignment::sized_finalize): Update type,
1947 visibility, and remaining st_other bits for new symbol.
1948 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1949 vis_pointer, and nonvis_pointer parameters.
1950 * symtab.h (Symbol::set_type): New method.
1951
1952 * testsuite/Makefile.am (defsym_test): New test.
1953 * testsuite/Makefile.in: Regenerate.
1954 * testsuite/defsym_test.c: New file.
1955 * testsuite/defsym_test.sh: New file.
1956
1957 2014-07-08 Cary Coutant <ccoutant@google.com>
1958
1959 PR gold/15639
1960 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1961 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1962 (Sized_dynobj::base_read_symbols): ...new method.
1963 * object.h (Sized_relobj_file::base_read_symbols): New method.
1964 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1965 (Sized_relobj_file::base_read_symbols): ...new method.
1966 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1967 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1968 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1969
1970 2014-07-04 Alan Modra <amodra@gmail.com>
1971
1972 * po/POTFILES.in: Regenerate.
1973
1974 2014-07-02 Jing Yu <jingyu@google.com>
1975
1976 * aarch64.cc: New file
1977 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1978 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1979 * Makefile.in: Regenerate.
1980 * configure.tgt: Add entries for aarch64*.
1981 * configure.ac: Likewise.
1982 * configure: Likewise.
1983
1984 2014-06-27 Alan Modra <amodra@gmail.com>
1985
1986 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1987
1988 2014-06-24 Cary Coutant <ccoutant@google.com>
1989
1990 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1991 sections.
1992 (Dwo_file::sized_read_unit_index): Likewise.
1993
1994 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1995
1996 * mips.cc: New file.
1997 * Makefile.am (TARGETSOURCES): Add mips.cc
1998 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1999 * configure.tgt: Add entries for mips*.
2000 * configure.ac: Likewise.
2001 * Makefile.in: Regenerate.
2002 * configure: Likewise.
2003
2004 2014-06-09 Cary Coutant <ccoutant@google.com>
2005
2006 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2007 unit_length is within section bounds.
2008
2009 2014-06-09 Cary Coutant <ccoutant@google.com>
2010
2011 PR gold/16980
2012 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2013 map.
2014
2015 2014-06-07 Alan Modra <amodra@gmail.com>
2016
2017 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2018
2019 2014-06-06 Cary Coutant <ccoutant@google.com>
2020
2021 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2022 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2023 (Dwarf_pubnames_table::read_header): Likewise.
2024 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2025 .debug_gnu_pubtypes.
2026
2027 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2028
2029 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2030 * Makefile.in, configure: Regenerate.
2031
2032 2014-06-03 Alan Modra <amodra@gmail.com>
2033
2034 * powerpc.cc (addis_12_2): Define.
2035 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2036
2037 2014-06-03 Alan Modra <amodra@gmail.com>
2038
2039 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2040 st_other output.
2041
2042 2014-06-02 Alan Modra <amodra@gmail.com>
2043
2044 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2045 Only ignore relocs on ELFv1.
2046 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2047
2048 2014-05-30 Cary Coutant <ccoutant@google.com>
2049
2050 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2051 * testsuite/Makefile.in: Regenerate.
2052 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2053
2054 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2055
2056 PR gold/16945
2057 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2058 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2059
2060 2014-05-15 Alan Modra <amodra@gmail.com>
2061
2062 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2063 Compare FDE contents with DW_CFA_nop rather than 0.
2064
2065 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2066
2067 * symtab.h (may_need_copy_reloc): Remove check for position independent
2068 code.
2069 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2070 position independence before pc absolute may_need_copy_reloc call.
2071 Add check for executable output befor pc relative may_need_copy_reloc
2072 call.
2073 * i386.cc: Ditto.
2074 * arm.cc: Ditto.
2075 * sparc.cc: Ditto.
2076 * tilegx.cc: Ditto.
2077 * powerpc.cc: Add check for no position independence before
2078 may_need_copy_reloc calls.
2079 * testsuite/pie_copyrelocs_test.cc: New file.
2080 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2081 * Makefile.am (pie_copyrelocs_test): New test.
2082 * Makefile.in: Regenerate.
2083
2084 2014-05-08 Martin Liška <mliska@suse.cz>
2085
2086 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2087
2088 2014-05-06 Cary Coutant <ccoutant@google.com>
2089
2090 PR gold/16900
2091 * i386.cc (Output_data_got_plt_i386): New class.
2092 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2093 parameter. Change all callers.
2094 (Output_data_plt_i386::layout_): Remove.
2095 (Output_data_plt_i386::got_plt_): Change type.
2096 (Target_i386::got_plt_): Change type. Change all references.
2097 (Target_i386::got_section): Create instance of new class.
2098 (Output_data_got_plt_i386::do_write): New function.
2099 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2100 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2101 parameter. Change all callers.
2102 (Output_data_plt_x86_64::layout_): Remove.
2103 (Output_data_plt_x86_64::got_plt_): Change type.
2104 (Target_x86_64::got_plt_): Change type. Change all references.
2105 (Target_x86_64::got_section): Create instance of new class.
2106 (Output_data_got_plt_x86_64::do_write): New function.
2107 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2108 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2109 class.
2110
2111 2014-05-05 Cary Coutant <ccoutant@google.com>
2112
2113 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2114 if we have pubnames/pubtypes.
2115
2116 2014-05-02 Cary Coutant <ccoutant@google.com>
2117
2118 * defstd.cc (in_segment): Define __ehdr_start here...
2119 * layout.cc (Layout::finalize): ...Instead of here. Set the
2120 output segment when known.
2121 * resolve.cc (Symbol::override_base_with_special): Remember
2122 the original binding.
2123 * symtab.cc (Symbol::set_output_segment): New function.
2124 (Symbol::set_undefined): New function.
2125 * symtab.h (Symbol::is_weak_undefined): Check original undef
2126 binding.
2127 (Symbol::is_strong_undefined): New function.
2128 (Symbol::set_output_segment): New function.
2129 (Symbol::set_undefined): New function.
2130 * target-reloc.h (is_strong_undefined): Remove.
2131 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2132 Check for hidden undefs.
2133 (relocate_section): Call Symbol::is_strong_undefined.
2134
2135 * testsuite/Makefile.am (ehdr_start_test_1)
2136 (ehdr_start_test_2, ehdr_start_test_3)
2137 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2138 * testsuite/Makefile.in: Regenerate.
2139 * testsuite/ehdr_start_def.cc: New source file.
2140 * testsuite/ehdr_start_test.cc: New source file.
2141 * testsuite/ehdr_start_test.t: New linker script.
2142 * testsuite/ehdr_start_test_4.sh: New shell script.
2143
2144 2014-04-23 Cary Coutant <ccoutant@google.com>
2145
2146 PR gold/16870
2147 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2148
2149 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2150
2151 * layout.cc (Layout::include_section): Allow a target to decide
2152 whether to include a section.
2153 * target.h (Target::should_include_section): New function.
2154 (Target::do_should_include_section): New function.
2155
2156 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2157
2158 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2159 inline into ...
2160 (Copy_relocs::emit): ... here.
2161 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2162 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2163 (Copy_reloc_entry::entries_): Change from private to protected.
2164
2165 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2166
2167 * icf.cc (get_section_contents): Replace copies of reloc
2168 vectors with const references.
2169
2170 2014-04-02 Cary Coutant <ccoutant@google.com>
2171
2172 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2173 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2174 * configure: Regenerate.
2175 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2176 -fno-use-linker-plugin.
2177 (LINK1, CXXLINK1): Add it to the link command.
2178 * testsuite/Makefile.in: Regenerate.
2179
2180 2014-03-12 Alan Modra <amodra@gmail.com>
2181
2182 * Makefile.in: Regenerate.
2183
2184 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2185
2186 * symtab.h (Symbol::set_nonvis): New function.
2187
2188 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2189
2190 * symtab.cc (Sized_symbol<32>::init_output_data):
2191 Instantiate the template.
2192 (Sized_symbol<64>::init_output_data): Likewise.
2193
2194 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2195
2196 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2197 adjust dynamic symbol value.
2198 * target.h (Target::adjust_dyn_symbol): New function.
2199 (Target::do_adjust_dyn_symbol): New function.
2200
2201 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2202
2203 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2204 Get the value of DYNAMIC_CUSTOM dynamic entry.
2205 * output.h (Output_data_dynamic::add_custom): New function.
2206 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2207 dynamic entry.
2208 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2209 * target.h (Target::dynamic_tag_custom_value): New function.
2210 (Target::do_dynamic_tag_custom_value): New function.
2211
2212 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2213
2214 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2215 dynsym indexes.
2216 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2217 (Target::do_has_custom_set_dynsym_indexes): New function.
2218 (Target::set_dynsym_indexes): New function.
2219 (Target::do_set_dynsym_indexes): New function.
2220
2221 2014-03-07 Alan Modra <amodra@gmail.com>
2222
2223 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2224 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2225 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2226 (Powerpc_relocate_functions::has_overflow_bitfield,
2227 overflowed): Use the above.
2228 (Target_powerpc::Relocate::relocate): Correct overflow checking
2229 for a number of relocations. Modify overflow test for 16-bit
2230 fields in instructions to signed/unsigned according to whether
2231 the field takes a signed or unsigned value.
2232
2233 2014-03-05 Alan Modra <amodra@gmail.com>
2234
2235 Update copyright years.
2236
2237 2014-03-05 Alan Modra <amodra@gmail.com>
2238
2239 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2240 R_PPC64_ADDR64_LOCAL.
2241 (Target_powerpc::Relocate::relocate): Likewise.
2242
2243 2014-03-03 Alan Modra <amodra@gmail.com>
2244
2245 * dwp.cc (print_version): Update copyright year to current.
2246
2247 2014-02-10 Alan Modra <amodra@gmail.com>
2248
2249 * po/gold.pot: Regenerate.
2250
2251 2014-02-06 Cary Coutant <ccoutant@google.com>
2252
2253 Fix problem where -u is ignored when a weak undef is seen.
2254
2255 * archive.cc (Library_base::should_include_member): Reorder
2256 code to check for -u option if a weak undef has already been seen.
2257 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2258 * testsuite/Makefile.in: Regenerate.
2259 * testsuite/weak_undef_file3.cc: New file.
2260 * testsuite/weak_undef_file4.cc: New file.
2261 * testsuite/weak_undef_test_2.cc: New file.
2262
2263 2014-02-05 Cary Coutant <ccoutant@google.com>
2264
2265 Fix issues with gold undefined symbol diagnostics.
2266
2267 PR binutils/15435
2268 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2269 check to here.
2270 * target-reloc.h (is_strong_undefined): New function.
2271 (relocate_section): Move undef vtable symbol check from here.
2272 Check for is_strong_undefined.
2273
2274 2014-02-05 Cary Coutant <ccoutant@google.com>
2275
2276 Fix problems with the --dynamic-list option.
2277
2278 PR gold/13577
2279 * options.cc (General_options::parse_dynamic_list):
2280 Set have_dynamic_list_.
2281 (General_options::General_options): Initialize have_dynamic_list_.
2282 (General_options::finalize): Turn off -Bsymbolic and
2283 -Bsymbolic-functions if --dynamic-list provided.
2284 * options.h (General_options::have_dynamic_list): New function.
2285 (General_options::have_dynamic_list_): New data member.
2286 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2287 correctly.
2288
2289 PR gold/16530
2290 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2291 in --dynamic-list, mark it.
2292
2293 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2294 (dynamic_list_2): New test case.
2295 * testsuite/Makefile.in: Regenerate.
2296 * testsuite/dynamic_list_2.cc: New file.
2297 * testsuite/dynamic_list_2.t: New file.
2298 * testsuite/dynamic_list_lib1.cc: New file.
2299 * testsuite/dynamic_list_lib2.cc: New file.
2300 * testsuite/gc_dynamic_list_test.c: New file.
2301 * testsuite/gc_dynamic_list_test.sh: New file.
2302 * testsuite/gc_dynamic_list_test.t: New file.
2303
2304 2014-01-28 Cary Coutant <ccoutant@google.com>
2305
2306 Add .gdb_index version 7 support.
2307
2308 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2309 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2310 debug sections.
2311 (Dwarf_ranges_table::read_ranges_table): Likewise.
2312 (Dwarf_pubnames_table::read_section): Check for GNU-style
2313 sections, and for compressed debug sections.
2314 (Dwarf_pubnames_table::read_header): Compute end address of table.
2315 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2316 for end of list by offset, not by offset == 0.
2317 (Dwarf_info_reader::do_read_string_table): Check for compressed
2318 debug sections.
2319 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2320 Initialize new data members.
2321 (Dwarf_pubnames_table::next_name): return flag_byte.
2322 (Dwarf_pubnames_table::end_of_table_): New data member.
2323 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2324 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2325 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2326 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2327 read skeleton type unit DIEs.
2328 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2329 (Gdb_index::do_write): Write flag_byte.
2330 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2331 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2332 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2333 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2334
2335 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2336
2337 * version.cc (print_version): Update copyright year to 2014.
2338
2339 2013-12-19 Dimitry Andric <dimitry@andric.com>
2340
2341 * stringpool.cc (Stringpool_template::reserve): Add
2342 HAVE_UNORDERED_MAP case.
2343 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2344
2345 2013-12-18 Cary Coutant <ccoutant@google.com>
2346
2347 * configure.ac: Check for <unordered_set> and <unordered_map>.
2348 * config.in: Regenerate.
2349 * configure: Regenerate.
2350 * system.h: Use <unordered_set> and <unordered_map> if available.
2351
2352 2013-12-10 Roland McGrath <mcgrathr@google.com>
2353
2354 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2355 with $(INSTALL_PROGRAM_ENV).
2356 * Makefile.in: Regenerate.
2357
2358 2013-11-22 Cary Coutant <ccoutant@google.com>
2359
2360 * configure.ac: Add check for which library is needed for
2361 dlopen.
2362 * configure: Regenerate.
2363
2364 2013-11-22 Cary Coutant <ccoutant@google.com>
2365
2366 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2367 assembler.
2368 * testsuite/Makefile.in: Regenerate.
2369
2370 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2371
2372 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2373 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2374 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2375 (Target_x86_64<size>::Scan::local): Likewise.
2376 (Target_x86_64<size>::Scan::global): Likewise.
2377 (Target_x86_64<size>::Relocate::relocate): Likewise.
2378 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2379 Likewise.
2380 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2381 R_X86_64_PC32_BND.
2382
2383 * testsuite/Makefile.am (check_PROGRAMS): Add
2384 exception_x86_64_bnd_test.
2385 (exception_x86_64_bnd_test_SOURCES): New macro.
2386 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2387 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2388 (exception_x86_64_bnd_test_LDADD): Likewise.
2389 (exception_x86_64_bnd_1.o): New rule.
2390 (exception_x86_64_bnd_2.o): Likewise.
2391 * testsuite/Makefile.in: Regenerated.
2392
2393 2013-11-15 Alan Modra <amodra@gmail.com>
2394
2395 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2396 accessor.
2397 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2398 Only call ppc64_local_entry_offset for 64-bit. Restrict
2399 symval_for_branch lookup to ELFv1.
2400 (Stub_table::add_plt_call_entry): Use unsigned int off.
2401 (Output_data_glink::Address, invalid_address): New.
2402 (Output_data_glink::add_eh_frame): Move out of line. Add
2403 support for ELFv2.
2404 (Output_data_glink::add_global_entry, find_global_entry,
2405 global_entry_address): New functions.
2406 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2407 ge_size): New variables.
2408 (Output_data_glink::set_final_data_size): Add global entry
2409 stub sizing.
2410 (Output_data_glink::do_write): Write global entry stubs.
2411 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2412 parameter. Return true for ELFv2. Adjust callers.
2413 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2414 ELFv1. Similarly for ifunc and dynamic relocation processing
2415 specific to ELFv1. Recognize that symbols are defined on
2416 their plt entries for ELFv2.
2417 (Target_powerpc::symval_for_branch): Assert if called for
2418 ELFv2 or ppc32.
2419 (Target_powerpc::Relocate::relocate): Use global entry plt
2420 stub for symbol value if such exists on ELFv2.
2421 (Target_powerpc::Relocate::relocate): Don't call
2422 symval_for_branch when ELFv2. Do adjust for local entry
2423 offset when ELFv2.
2424 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2425 plt stub for ELFv2.
2426 (Target_powerpc::do_plt_address_for_global): Similarly.
2427
2428 2013-11-14 Cary Coutant <ccoutant@google.com>
2429
2430 Revert patch -- this did not fix the problem, and there is
2431 no race there.
2432
2433 2013-11-14 Cary Coutant <ccoutant@google.com>
2434
2435 PR gold/14860
2436 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2437 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2438 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2439 updating fde_offsets_.
2440 (Eh_frame_hdr::lock_): New data member.
2441
2442 2013-11-14 Cary Coutant <ccoutant@google.com>
2443
2444 * dwp.cc (Dwo_file_entry): New type.
2445 (File_list): Use Dwo_file_entry.
2446 (Dwo_file::verify): New function.
2447 (Dwo_file::verify_dwo_list): New function.
2448 (Dwo_file::sized_verify_dwo_list): New function.
2449 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2450 list.
2451 (Dwp_options): New enum type.
2452 (dwp_options): Add --verify-only.
2453 (usage): Likewise.
2454 (main): Likewise.
2455 * dwp.h (gold_info): Add declaration.
2456
2457 2013-11-14 Cary Coutant <ccoutant@google.com>
2458
2459 PR gold/14860
2460 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2461 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2462 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2463 updating fde_offsets_.
2464 (Eh_frame_hdr::lock_): New data member.
2465
2466 2013-11-06 Cary Coutant <ccoutant@google.com>
2467
2468 PR gold/15758
2469 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2470 before reloc sections.
2471
2472 2013-11-04 Alan Modra <amodra@gmail.com>
2473
2474 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2475 (Symbol::needs_dynamic_reloc): Test new flag.
2476 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2477 (Target_powerpc::Scan::get_reference_flags): Add target param.
2478 Return FUNC_DESC_ABI for 64-bit ELFv1.
2479 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2480 call.
2481 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2482 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2483
2484 2013-10-31 Cary Coutant <ccoutant@google.com>
2485
2486 Restore support for dwp v2 DWARF package file format.
2487
2488 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2489 tu_length parameter. Adjust all callers.
2490 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2491 * dwp.cc: Include dwarf.h.
2492 (Section_bounds): New struct type.
2493 (Unit_set): New struct type.
2494 (Dwo_file::Dwo_file): Initialize new data member.
2495 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2496 Combine and rename to...
2497 (Dwo_file::read_unit_index): ...this.
2498 (Dwo_file::sized_read_compunit_index)
2499 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2500 (Dwo_file::sized_read_unit_index): ...this.
2501 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2502 parameters; add section_id parameter.
2503 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2504 (Dwo_file::add_unit_set): ...this.
2505 (Dwo_file::shndx_map_): Remove.
2506 (Dwo_file::sect_offsets_): New data member.
2507 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2508 (Dwp_output_file::add_section): Rename to...
2509 (Dwp_output_file::add_contribution): ...this.
2510 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2511 (Dwp_output_file::add_tu_set): Likewise.
2512 (Dwp_output_file::Contribution): New type.
2513 (Dwp_output_file::Section::contributions): New data member.
2514 (Dwp_output_file::Cu_or_tu_set): Remove.
2515 (Dwp_output_file::Section::Section): New ctor.
2516 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2517 (Dwp_output_file::Dwp_index::Section_table): New type.
2518 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2519 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2520 parameter.
2521 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2522 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2523 (Dwp_output_file::Dwp_index::section_table): New member function.
2524 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2525 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2526 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2527 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2528 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2529 (Dwp_output_file::Dwp_index::section_table_): New data member.
2530 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2531 (Dwp_output_file::add_output_section): New member function.
2532 (Dwp_output_file::write_new_section): New member function.
2533 (Dwp_output_file::write_contributions): New member function.
2534 (Dwp_output_file::section_id_map_): New data member.
2535 (class Dwo_id_info_reader): Remove.
2536 (class Unit_reader): New class.
2537 (get_dwarf_section_name): New function.
2538 (Dwo_file::read_executable): Adjust initializations of class data.
2539 (Dwo_file::read): Add support for v2 package file format.
2540 (Dwo_file::read_unit_index): Likewise.
2541 (Dwo_file::sized_read_unit_index): Likewise.
2542 (Dwo_file::copy_section): Likewise.
2543 (Dwo_file::add_unit_set): Likewise.
2544 (Dwp_output_file::add_output_section): Likewise.
2545 (Dwp_output_file::add_contribution): Likewise.
2546 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2547 for empty slot.
2548 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2549 file format.
2550 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2551 slot.
2552 (Dwp_output_file::initialize): Remove unused function.
2553 (Dwp_output_file::finalize): Add support for v2 package file format.
2554 (Dwp_output_file::write_index): Likewise.
2555 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2556 function prototype.
2557
2558 2013-10-31 Cary Coutant <ccoutant@google.com>
2559
2560 * configure.ac: Fix check for -fmerge-constants.
2561 * configure.ac: Regenerate.
2562
2563 2013-10-30 Roland McGrath <mcgrathr@google.com>
2564
2565 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2566 Correct 9-byte nop sequence to match what the assembler generates.
2567
2568 2013-10-30 Alan Modra <amodra@gmail.com>
2569
2570 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2571 ppc64_local_entry_offset, ppc64_local_entry_offset,
2572 do_read_symbols): New functions.
2573 (Powerpc_relobj::e_flags_, st_other_): New vars.
2574 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2575 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2576 (Powerpc_relobj::e_flags_): New var.
2577 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2578 and adjust for ELFv2.
2579 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2580 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2581 (Powerpc_dynobj::do_find_special_sections): Likewise.
2582 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2583 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2584 to ELFv2 local entry.
2585 (Target_powerpc::do_relax): No thread safe barriers needed for
2586 ELFv2.
2587 (Output_data_plt_powerpc::initial_plt_entry_size_,
2588 plt_entry_size): Delete. Replace all uses with
2589 first_plt_entry_offset() and plt_entry_size().
2590 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2591 reserved_size parm. Update callers.
2592 (Output_data_plt_powerpc::entry_count): Update.
2593 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2594 and use Target_powerpc::first_plt_entry_offset().
2595 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2596 rename to plt_entry_size.
2597 (Output_data_plt_powerpc::add_ifunc_entry,
2598 add_local_ifunc_entry): Adjust reloc for ELFv2.
2599 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2600 (glink_eh_frame_fde_64v2): New.
2601 (Stub_table::plt_call_size): Support ELFv2 sizing.
2602 (Output_data_glink::add_eh_frame): Use the new FDE.
2603 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2604 (Stub_table::do_write): Write ELFv2 stubs and glink.
2605 (Target_powerpc::Relocate::relocate): Replaces nop after call
2606 with ld 2,24(1) and adjust local offset destination for ELFv2.
2607
2608 2013-10-30 Alan Modra <amodra@gmail.com>
2609
2610 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2611 (Target_powerpc::Scan::global, local): Likewise.
2612 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2613 on all ppc64 @h and @ha relocs.
2614
2615 2013-10-14 Alan Modra <amodra@gmail.com>
2616
2617 * output.h (Output_data_got::add_constant): Tidy.
2618 (Output_data_got::add_constant_pair): New function.
2619 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2620 methods used so as to first call reserve_ent().
2621
2622 2013-10-11 Roland McGrath <mcgrathr@google.com>
2623
2624 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2625 add_got_entry and add_got_entry_pair.
2626
2627 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2628 (HAVE_PUBNAMES): Likewise.
2629 * configure: Regenerate.
2630
2631 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2632 * testsuite/Makefile.in: Regenerate.
2633
2634 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2635 Remove const from declaration.
2636 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2637 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2638 * output.h (Output_file_header): Remove const from member target_
2639 and corresponding constructor argument.
2640 * output.cc (Output_file_header::Output_file_header): Update prototype.
2641 (Output_file_header::do_sized_write): Use this->target_ in place
2642 of parameters()->target().
2643
2644 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2645
2646 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2647 * configure: Regenerate.
2648 * Makefile.in: Regenerate.
2649 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2650 * testsuite/merge_string_literals_2.c: Likewise.
2651 * testsuite/Makefile.am
2652 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2653 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2654 literal -fmerge-constants.
2655 * testsuite/Makefile.in: Regenerate.
2656
2657 * i386.cc (Target_i386): Remove unused member dynbss_.
2658 * arm.cc (Target_arm): Likewise.
2659 * powerpc.cc (Target_powerpc): Likewise.
2660 * sparc.cc (Target_sparc): Likewise.
2661 * tilegx.cc (Target_tilegx): Likewise.
2662 * x86_64.cc (Target_x86_64): Likewise.
2663 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2664 type_signature_, type_offset_.
2665 * plugin.h (Plugin_hook): Remove unused member layout_.
2666 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2667 mapfile_.
2668 (Read_member): Remove unused members input_objects_, symtab_,
2669 mapfile_, layout_.
2670 (Check_library): Remove unused member symtab_.
2671 * archive.h (Lib_group): Remove unused member lib_.
2672 * archive.cc (Lib_group::Lib_group): Update initializer.
2673 * incremental.h (Incremental_binary): Remove unused member target_.
2674 (Incremental_script_entry): Removed unused member script_.
2675 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2676 * icf.h (Icf): Remove unused member num_tracked_relocs.
2677
2678 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2679 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2680 its only use.
2681 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2682
2683 * archive.h: Use struct rather than class for forward declaration
2684 of Read_symbols_data.
2685
2686 2013-10-07 Cary Coutant <ccoutant@google.com>
2687
2688 PR gold/16010
2689 * testsuite/Makefile.am (icf_test): Fix dependencies.
2690 (icf_safe_test): Likewise.
2691 (icf_safe_so_test): Likewise.
2692 (large_symbol_alignment): Add empty _LDADD rule.
2693 * testsuite/Makefile.in: Regenerate.
2694
2695 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2696
2697 PR gold/15927
2698 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2699 relocation for R_X86_64_32 on x32.
2700
2701 2013-08-27 Roland McGrath <mcgrathr@google.com>
2702
2703 * output.cc (Output_segment::set_section_addresses): Take new
2704 Target* argument. If target->isolate_execinstr() and the segment
2705 is executable and starts at a target->abi_pagesize() boundary,
2706 pad its end out to a target->abi_pagesize() boundary with code fill.
2707 * output.h (Output_segment::set_section_addresses): Update decl.
2708 * layout.h (Layout::check_output_data_for_reset_values): Take new
2709 argument RELAX_OUTPUTS.
2710 (Layout): New member relax_output_list_.
2711 (Layout::add_relax_output): New method.
2712 * layout.cc (Layout::Layout): Update constructor.
2713 (Layout::reset_relax_output): New method.
2714 (Layout::clean_up_after_relaxation): Call it.
2715 (Layout::prepare_for_relaxation): Update caller.
2716 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2717 Call reset_relax_output before re-processing segments for
2718 isolate_execinstr case.
2719 (Layout::write_data): Handle relax_output_list_.
2720 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2721 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2722
2723 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2724
2725 PR binutils/15834
2726 * object.h: Fix typos.
2727
2728 2013-08-16 Roland McGrath <mcgrathr@google.com>
2729
2730 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2731 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2732
2733 2013-08-07 Cary Coutant <ccoutant@google.com>
2734
2735 Revert support for v2 DWP files:
2736
2737 2013-03-01 Cary Coutant <ccoutant@google.com>
2738
2739 Add dwp support for v2 DWARF package file format.
2740 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2741 tu_length parameter. Adjust all callers.
2742 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2743 * dwp.cc: Include dwarf.h.
2744 (Section_bounds): New struct type.
2745 (Unit_set): New struct type.
2746 (Dwo_file::Dwo_file): Initialize new data member.
2747 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2748 Combine and rename to...
2749 (Dwo_file::read_unit_index): ...this.
2750 (Dwo_file::sized_read_compunit_index)
2751 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2752 (Dwo_file::sized_read_unit_index): ...this.
2753 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2754 parameters; add section_id parameter.
2755 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2756 (Dwo_file::add_unit_set): ...this.
2757 (Dwo_file::shndx_map_): Remove.
2758 (Dwo_file::sect_offsets_): New data member.
2759 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2760 (Dwp_output_file::add_section): Rename to...
2761 (Dwp_output_file::add_contribution): ...this.
2762 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2763 (Dwp_output_file::add_tu_set): Likewise.
2764 (Dwp_output_file::Contribution): New type.
2765 (Dwp_output_file::Section::contributions): New data member.
2766 (Dwp_output_file::Cu_or_tu_set): Remove.
2767 (Dwp_output_file::Section::Section): New ctor.
2768 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2769 (Dwp_output_file::Dwp_index::Section_table): New type.
2770 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2771 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2772 parameter.
2773 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2774 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2775 (Dwp_output_file::Dwp_index::section_table): New member function.
2776 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2777 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2778 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2779 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2780 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2781 (Dwp_output_file::Dwp_index::section_table_): New data member.
2782 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2783 (Dwp_output_file::add_output_section): New member function.
2784 (Dwp_output_file::write_new_section): New member function.
2785 (Dwp_output_file::write_contributions): New member function.
2786 (Dwp_output_file::section_id_map_): New data member.
2787 (class Dwo_id_info_reader): Remove.
2788 (class Unit_reader): New class.
2789 (get_dwarf_section_name): New function.
2790 (Dwo_file::read_executable): Adjust initializations of class data.
2791 (Dwo_file::read): Add support for v2 package file format.
2792 (Dwo_file::read_unit_index): Likewise.
2793 (Dwo_file::sized_read_unit_index): Likewise.
2794 (Dwo_file::copy_section): Likewise.
2795 (Dwo_file::add_unit_set): Likewise.
2796 (Dwp_output_file::add_output_section): Likewise.
2797 (Dwp_output_file::add_contribution): Likewise.
2798 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2799 for empty slot.
2800 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2801 file format.
2802 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2803 slot.
2804 (Dwp_output_file::initialize): Remove unused function.
2805 (Dwp_output_file::finalize): Add support for v2 package file format.
2806 (Dwp_output_file::write_index): Likewise.
2807 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2808 function prototype.
2809
2810 2013-07-31 Cary Coutant <ccoutant@google.com>
2811
2812 * object.cc (Sized_relobj::do_output_section_address): New function.
2813 (Sized_relobj): Instantiate explicitly.
2814 * object.h (Object::output_section_address): New function.
2815 (Object::do_output_section_address): New function.
2816 (Sized_relobj::do_output_section_address): New function.
2817 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2818
2819 2013-07-30 Cary Coutant <ccoutant@google.com>
2820 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2821
2822 * parameters.cc (Parameters::entry): Return target-specific entry
2823 symbol name.
2824 * target.h (Target::entry_symbol_name): New function.
2825 (Target_info::entry_symbol_name): New data member.
2826
2827 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2828 * i386.cc (Target_i386::i386_info): Likewise.
2829 (Target_i386_nacl::i386_nacl_info): Likewise.
2830 * sparc.cc (Target_sparc::sparc_info): Likewise.
2831 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2832 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2833 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2834 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2835
2836 2013-07-22 Sterling Augustine <saugustine@google.com>
2837
2838 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2839 Convert parameter shndx to local variable. Add parameters symtab
2840 and symtab_size. Scan over section names. Find relocation
2841 section corresponding to current section. Create and initialize
2842 reloc_mapper_ and reloc_type_.
2843 (Dwarf_pubnames_table::read_header): Add assertion. Change
2844 unit_length to off_t. Initialize member unit_length_. Fill in field
2845 cu_offset_.
2846 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2847 Initialize new fields unit_length_ and cu_offset_.
2848 (Dwarf_pubnames_table::read_section): Update prototype.
2849 (Dwarf_pubnames_table::cu_offset): New member function.
2850 (Dwarf_pubnames_table::subsection_size): Likewise.
2851 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2852 New fields.
2853 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2854 member functions public.
2855 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2856 Update comment. Rework logic. Move repeated parts to...
2857 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2858 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2859 pubtypes_table_, and stmt_list_offset.
2860 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2861 Gdb_index::find_pubtype_offset,
2862 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2863 (Gdb_index::pubnames_read): Update prototype and rework logic.
2864 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2865 Forward declare.
2866 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2867 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2868 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2869 Gdb_index::map_pubtable_to_dies):
2870 Declare functions.
2871 (Gdb_index::pubnames_read): Update declaration.
2872 (Gdb_index::Pubname_offset_map): New type.
2873 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2874 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2875 Gdb_index::stmt_list_offset): Declare.
2876 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2877 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2878 Gdb_index::pubtypes_offset_): Remove.
2879
2880 2013-07-19 Roland McGrath <mcgrathr@google.com>
2881
2882 * options.h (General_options): Add -Trodata-segment option.
2883 * parameters.cc (Parameters::check_rodata_segment): New function.
2884 (Parameters::set_target_once): Call it.
2885 * parameters.h (Parameters): Declare it (private member function).
2886 * layout.cc (load_seg_unusable_for_headers): New function, broken
2887 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2888 then validate rodata segment rather than text segment.
2889 (relaxation_loop_body): Call that.
2890 (is_text_segment): New function. Don't admit a non-executable
2891 segment if TARGET->isolate_execinstr().
2892 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2893
2894 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2895
2896 PR gold/15070
2897 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2898 * nacl.h (Sniff_file::View::View): Request aligned view.
2899
2900 2013-07-11 Cary Coutant <ccoutant@google.com>
2901
2902 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2903 correct BRLT entry size.
2904
2905 2013-07-03 Alan Modra <amodra@gmail.com>
2906
2907 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2908 comment.
2909
2910 2013-07-01 Cary Coutant <ccoutant@google.com>
2911
2912 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2913 reloc_type_.
2914 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2915 (Dwarf_ranges_table::lookup_reloc): New function.
2916 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2917 reloc_type_.
2918 (Dwarf_ranges_table::lookup_reloc): New function.
2919 (Dwarf_ranges_table::reloc_type_): New data member.
2920
2921 2013-06-27 Jing Yu <jingyu@google.com>
2922
2923 PR gold/15662
2924 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2925 function.
2926 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2927 (Target_powerpc::do_relax): Call the above.
2928
2929 2013-06-27 Cary Coutant <ccoutant@google.com>
2930
2931 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2932 on garbage collected .opd section.
2933
2934 2013-06-27 Alan Modra <amodra@gmail.com>
2935
2936 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2937 is non-zero.
2938 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2939 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2940
2941 2013-06-14 Cary Coutant <ccoutant@google.com>
2942
2943 * resolve.cc (Symbol::override_base): Don't override st_type
2944 from plugin placeholder symbols.
2945 (Symbol_table::resolve): Likewise.
2946 (Symbol_table::should_override): Don't complain about TLS mismatch
2947 if the TO symbol is a plugin placeholder.
2948 * testsuite/Makefile.am (plugin_test_tls): New test.
2949 * testsuite/Makefile.in: Regenerate.
2950 * testsuite/plugin_test_tls.sh: New test script.
2951 * testsuite/two_file_test_2_tls.cc: New test source.
2952 * testsuite/two_file_test_tls.cc: New test source.
2953
2954 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2955
2956 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2957 the maximum segment alignment is larger than the page size.
2958 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2959 correctly aligns the symbols with large alignemnt.
2960 * testsuite/Makefile.in: Regenerate.
2961 * testsuite/large_symbol_alignment.cc: New file.
2962
2963 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2964 Sriraman Tallam <tmsriram@google.com>
2965
2966 * options.h (sort_section): New option.
2967 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2968 Rename from Input_section_sort_section_name_special_ordering_compare.
2969 (Input_section_sort_section_name_compare): New struct.
2970 * output.cc (Output_section::Input_section_sort_section_name_compare::
2971 operator()): New function.
2972 (Output_section::sort_attached_input_sections): Use new sort function
2973 for .text if --sort-section=name is specified.
2974 * layout.cc (Layout::make_output_section):
2975 Add sorting by name when --sort-section=name is specified.
2976 * testsuite/Makefile.am (text_section_grouping): Test option
2977 --sort-section=name.
2978 * testsuite/Makefile.in: Regenerate.
2979 * testsuite/section_sorting_name.cc: New file.
2980 * testsuite/section_sorting_name.sh: New file.
2981
2982 2013-05-21 Cary Coutant <ccoutant@google.com>
2983
2984 * symtab.h (Symbol::is_cxx_vtable): New function.
2985 * target-reloc.h (relocate_section): Check for vtable symbol.
2986 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2987 * testsuite/Makefile.in: Regenerate.
2988 * testsuite/missing_key_func.cc: New test source.
2989 * testsuite/missing_key_func.sh: New test script.
2990
2991 2013-05-21 Cary Coutant <ccoutant@google.com>
2992
2993 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2994 type of enclosing symbol.
2995 (Relocate_info::location): Check symbol type when describing symbol.
2996 * object.h (Symbol_location_info): Remove unused line_number;
2997 add enclosing_symbol_type.
2998 * testsuite/debug_msg.sh: Adjust expected output.
2999
3000 2013-05-13 Cary Coutant <ccoutant@google.com>
3001
3002 * configure.ac: Export DEFAULT_TARGET.
3003 * configure: Regenerate.
3004 * Makefile.in: Regenerate.
3005 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3006 * testsuite/Makefile.in: Regenerate.
3007 * testsuite/debug_msg.sh: Delete duplicate tests.
3008 Don't check undef_int error message match for powerpc where the
3009 source file and line number aren't available.
3010
3011 2013-05-10 Roland McGrath <mcgrathr@google.com>
3012
3013 * options.h (General_options): Add --rosegment-gap option.
3014 * options.cc (finalize): --rosegment-gap implies --rosegment.
3015 * layout.cc (set_segment_offsets): Let user option override
3016 target->rosegment_gap().
3017
3018 2013-05-10 Roland McGrath <mcgrathr@google.com>
3019
3020 * options.h (General_options): Remove leading space from help
3021 messages for -nostdlib and --rosegment.
3022
3023 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3024
3025 PR ld/15365
3026 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3027
3028 2013-05-03 Alan Modra <amodra@gmail.com>
3029
3030 * merge.cc (Output_merge_string::do_add_input_section): Correct
3031 scan for number of strings. Rename vars to avoid shadowing.
3032 Include missing terminator in input_size_.
3033
3034 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3035
3036 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3037 Restore empty string handling.
3038
3039 2013-05-01 Cary Coutant <ccoutant@google.com>
3040
3041 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3042 uninitialized warning.
3043
3044 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3045
3046 * output.cc (Output_section::add_merge_input_section): Allow
3047 to merge sections if the alignment is more than character size.
3048 * merge.h (Output_merge_string::Output_merge_string): Remove
3049 assert.
3050 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3051 only not-null strings. Check the alignment of strings.
3052 * stringpool.h
3053 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3054 alignment as the argument.
3055 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3056 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3057 Align non-zero length strings according to the addralign_.
3058 (Stringpool_template<Stringpool_char>::set_string_offsets):
3059 Updating offsets according to the given alignment.
3060 * testsuite/Makefile.am (text_section_grouping): Test if string
3061 literals are getting merged.
3062 * testsuite/Makefile.in: Regenerate.
3063 * testsuite/merge_string_literals_1.c: New file.
3064 * testsuite/merge_string_literals_2.c: Ditto.
3065 * testsuite/merge_string_literals.sh: Ditto.
3066
3067 2013-04-26 Ian Lance Taylor <iant@google.com>
3068
3069 * target-reloc.h (relocate_section): If the reloc offset is out of
3070 range, pass VIEW as NULL to relocate.relocate.
3071 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3072 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3073 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3074 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3075 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3076 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3077
3078 2013-04-26 Geoff Pike <gpike@chromium.org>
3079
3080 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3081 * layout.cc (Hash_task): New class.
3082 (Layout::queue_build_id_tasks): New function.
3083 (Layout::write_build_id): Handle single-thread portion of build ID
3084 computation. (In some cases, all of it is single-threaded.) Replace
3085 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3086 functionality in fewer lines of code.
3087 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3088 * options.h (General_options): make "--build-id" default to tree
3089 rather than sha1. Add two new options related to --build-id=tree:
3090 --build-id-chunk-size-for-treehash and
3091 --build-id-min-file-size-for-treehash.
3092 * Makefile.am: add testing of --build-id=tree and related new options
3093 (these tests will be invoked by "make check").
3094 * Makefile.in: Regenerate.
3095
3096 2013-04-25 Alan Modra <amodra@gmail.com>
3097
3098 * configure.tgt: Add powerpcle and powerpc64le.
3099
3100 2013-04-22 Alan Modra <amodra@gmail.com>
3101
3102 PR gold/15355
3103 * layout.cc (Layout::segment_precedes): Allow more than one
3104 segment with the same type and flags.
3105
3106 2013-04-15 Cary Coutant <ccoutant@google.com>
3107
3108 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3109 allocate space in file for BSS sections.
3110
3111 2013-04-15 Cary Coutant <ccoutant@google.com>
3112
3113 * script-sections.cc (Orphan_output_section): Reset address
3114 to zero after each orphaned section for relocatable links.
3115
3116 2013-04-15 Cary Coutant <ccoutant@google.com>
3117
3118 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3119 section starting address for relocatable link.
3120 * testsuite/Makefile.am (script_test_11): New test.
3121 * testsuite/Makefile.in: Regenerate.
3122 * testsuite/script_test_11.c: New source file.
3123 * testsuite/script_test_11.t: New linker script.
3124
3125 2013-04-13 Alan Modra <amodra@gmail.com>
3126
3127 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3128 owner when sections are not adjacent and exceed group size.
3129 (Target_powerpc::group_sections): Handle corner case.
3130 (Target_powerpc::Branch_info::make_stub): Handle case where
3131 stub table doesn't exist due to branches in non-exec sections.
3132 (Target_powerpc::Relocate::relocate): Likewise.
3133
3134 2013-04-11 Alan Modra <amodra@gmail.com>
3135
3136 PR gold/15354
3137 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3138 .branch_lt to match bfd ld. Adjust comments throughout file.
3139
3140 2013-04-04 Ian Lance Taylor <iant@google.com>
3141
3142 GCC PR c++/56840
3143 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3144 sections before checking whether they are included in the link.
3145
3146 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3147
3148 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3149 object before calling the plugin claim_file handler. Pass the elf
3150 object of the archive to the plugin. Delete the elf object if the
3151 plugin claims the file.
3152
3153 2013-03-21 Alan Modra <amodra@gmail.com>
3154
3155 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3156 segment when omagic.
3157
3158 2013-03-21 Alan Modra <amodra@gmail.com>
3159
3160 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3161 comparison warning.
3162 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3163 uninitialized" warning.
3164
3165 2013-03-20 Alan Modra <amodra@gmail.com>
3166
3167 * symtab.h (Symbol::clear_version): New function.
3168 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3169 is_needed by weak references. Clear version for symbols defined
3170 in as-needed objects that are not needed.
3171
3172 2013-03-15 Alan Modra <amodra@gmail.com>
3173
3174 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3175 static and public. Add report_err param. Return false for data refs.
3176 (Target_powerpc::rela_dyn_section): New overloaded function.
3177 (Target_powerpc::plt_, iplt_): Elucidate.
3178 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3179 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3180 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3181 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3182 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3183 push_branch and make_plt_entry for ifunc syms when
3184 reloc_needs_plt_for_ifunc.
3185 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3186 for ifunc unless reloc_needs_plt_for_ifunc.
3187
3188 2013-03-15 Alan Modra <amodra@gmail.com>
3189
3190 * gc.h (gc_process_relocs): Don't look through function descriptors.
3191 * icf.cc (get_section_contents): Do so here instead.
3192
3193 2013-03-13 Alan Modra <amodra@gmail.com>
3194
3195 * powerpc.cc (is_branch_reloc): Forward declare.
3196 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3197 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3198 false for 64-bit, true for 32-bit non-branch relocs.
3199 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3200 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3201 nm output.
3202 (icf_safe_test): Generate linker map file as well as nm output.
3203 (icf_safe_so_test): Likewise.
3204 * testsuite/Makefile.in: Regenerate.
3205 * testsuite/icf_test.sh: Parse linker map file to determine
3206 section folding.
3207 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3208 * testsuite/icf_safe_so_test.sh: Likewise.
3209 (X86_32_or_ARM_specific_safe_fold): Merge into..
3210 (arch_specific_safe_fold): ..this.
3211 (X86_64_specific_safe_fold): Delete unused function.
3212
3213 2013-03-12 Alan Modra <amodra@gmail.com>
3214
3215 * gc.h (gc_process_relocs): Look through function descriptors
3216 to determine shndx, symvalue and addend used by ICF. Tidy
3217 variable duplication.
3218
3219 2013-03-11 Alan Modra <amodra@gmail.com>
3220
3221 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3222 * layout.cc (Layout_task_runner::run): ..to here.
3223 * symtab.h (struct Symbol_location): Extract from..
3224 (class Symbol_table): ..here.
3225 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3226 * target.h (class Target): Add function_location and
3227 do_function_location functions.
3228 (class Sized_target): Add do_function_location.
3229 * object.h (class Sized_relobj_file): Move find_shdr..
3230 (class Object): ..to here.
3231 * object.cc: Likewise. Update to suit. Instantiate.
3232 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3233 * powerpc.cc (class Powerpc_dynobj): New.
3234 (Target_powerpc::do_function_location): New function.
3235 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3236 (Powerpc_dynobj::do_read_symbols): New function.
3237 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3238
3239 2013-03-08 Ian Lance Taylor <iant@google.com>
3240
3241 * options.cc (General_options::string_to_object_format): Accept
3242 "default".
3243
3244 2013-03-08 Alan Modra <amodra@gmail.com>
3245
3246 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3247 pointer to Post_fde.
3248 (struct Post_fde): Move definition to here..
3249 * ehframe.cc (struct Post_fde): ..from here.
3250 (Cie::write): Don't alloc Post_fde.
3251 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3252
3253 2013-03-07 Alan Modra <amodra@gmail.com>
3254
3255 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3256 relocation referencing .LC0.
3257 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3258
3259 2013-03-07 Alan Modra <amodra@gmail.com>
3260
3261 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3262 always_inline. Add assembly for powerpc to avoid GOT.
3263
3264 2013-03-07 Alan Modra <amodra@gmail.com>
3265
3266 * testsuite/script_test_10.sh: Don't test .bss section
3267 header number.
3268
3269 2013-03-06 Alan Modra <amodra@gmail.com>
3270
3271 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3272 (Target_powerpc::symval_for_branch): Add symtab param. Update
3273 all callers. Handle folded sections.
3274 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3275 to Powerpc_relobj.
3276 (Global_symbol_visitor_opd::operator()): Likewise.
3277
3278 2013-03-04 Alan Modra <amodra@gmail.com>
3279
3280 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3281 * testsuite/Makefile.in: Regenerate.
3282
3283 2013-03-01 Cary Coutant <ccoutant@google.com>
3284
3285 Add dwp support for v2 DWARF package file format.
3286 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3287 tu_length parameter. Adjust all callers.
3288 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3289 * dwp.cc: Include dwarf.h.
3290 (Section_bounds): New struct type.
3291 (Unit_set): New struct type.
3292 (Dwo_file::Dwo_file): Initialize new data member.
3293 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3294 Combine and rename to...
3295 (Dwo_file::read_unit_index): ...this.
3296 (Dwo_file::sized_read_compunit_index)
3297 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3298 (Dwo_file::sized_read_unit_index): ...this.
3299 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3300 parameters; add section_id parameter.
3301 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3302 (Dwo_file::add_unit_set): ...this.
3303 (Dwo_file::shndx_map_): Remove.
3304 (Dwo_file::sect_offsets_): New data member.
3305 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3306 (Dwp_output_file::add_section): Rename to...
3307 (Dwp_output_file::add_contribution): ...this.
3308 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3309 (Dwp_output_file::add_tu_set): Likewise.
3310 (Dwp_output_file::Contribution): New type.
3311 (Dwp_output_file::Section::contributions): New data member.
3312 (Dwp_output_file::Cu_or_tu_set): Remove.
3313 (Dwp_output_file::Section::Section): New ctor.
3314 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3315 (Dwp_output_file::Dwp_index::Section_table): New type.
3316 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3317 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3318 parameter.
3319 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3320 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3321 (Dwp_output_file::Dwp_index::section_table): New member function.
3322 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3323 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3324 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3325 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3326 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3327 (Dwp_output_file::Dwp_index::section_table_): New data member.
3328 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3329 (Dwp_output_file::add_output_section): New member function.
3330 (Dwp_output_file::write_new_section): New member function.
3331 (Dwp_output_file::write_contributions): New member function.
3332 (Dwp_output_file::section_id_map_): New data member.
3333 (class Dwo_id_info_reader): Remove.
3334 (class Unit_reader): New class.
3335 (get_dwarf_section_name): New function.
3336 (Dwo_file::read_executable): Adjust initializations of class data.
3337 (Dwo_file::read): Add support for v2 package file format.
3338 (Dwo_file::read_unit_index): Likewise.
3339 (Dwo_file::sized_read_unit_index): Likewise.
3340 (Dwo_file::copy_section): Likewise.
3341 (Dwo_file::add_unit_set): Likewise.
3342 (Dwp_output_file::add_output_section): Likewise.
3343 (Dwp_output_file::add_contribution): Likewise.
3344 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3345 for empty slot.
3346 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3347 file format.
3348 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3349 slot.
3350 (Dwp_output_file::initialize): Remove unused function.
3351 (Dwp_output_file::finalize): Add support for v2 package file format.
3352 (Dwp_output_file::write_index): Likewise.
3353 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3354 function prototype.
3355
3356 2013-03-01 Cary Coutant <ccoutant@google.com>
3357
3358 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3359 function into class definition in header file.
3360 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3361 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3362 New function.
3363 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3364
3365 2013-02-28 Alan Modra <amodra@gmail.com>
3366
3367 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3368 * target.cc (Target::do_plt_fde_location): New function.
3369 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3370 accessor function, and constructor param.
3371 (struct Post_fde, Post_fdes): Declare.
3372 (Cie::write): Add post_fdes param.
3373 * ehframe.cc (Fde::write): Use plt_fde_location.
3374 (struct Post_fde): Define.
3375 (Cie::write): Stash FDEs added post merge mapping.
3376 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3377 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3378 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3379 other FDEs.
3380 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3381 (Target_powerpc::has_glink): New function.
3382 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3383 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3384 glink_eh_frame_fde_32, default_fde): New data.
3385 (Stub_table::eh_frame_added_): New var.
3386 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3387 Make const.
3388 (Stub_table::add_eh_frame): New function.
3389 (Output_data_glink::add_eh_frame): New function.
3390 (Target_powerpc::make_glink_section): Call add_eh_frame.
3391
3392 2013-02-15 Ian Lance Taylor <iant@google.com>
3393
3394 * options.h (DEFINE_uint64_alias): Define.
3395 (class General_options): Add -Ttext-segment as an alias for
3396 -Ttext.
3397
3398 2013-02-15 Alan Modra <amodra@gmail.com>
3399
3400 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3401 (Stub_table::do_write): ..here, two places.
3402 (Stub_table::plt_call_size): Use it here too.
3403
3404 2013-02-11 Ian Lance Taylor <iant@google.com>
3405
3406 * descriptors.cc (Descriptors::close_all): New function.
3407 * descriptors.h (class Descriptors): Declare close_all.
3408 (close_all_descriptors): New inline function.
3409 * plugin.cc: Include "descriptors.h".
3410 (Plugin_manager::cleanup): Call close_all_descriptors.
3411
3412 2013-02-06 Alan Modra <amodra@gmail.com>
3413
3414 * README: Update coding style link.
3415
3416 2013-01-28 Cary Coutant <ccoutant@google.com>
3417
3418 * dwp.cc (File_list): New typedef.
3419 (Dwo_name_info_reader): New class.
3420 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3421 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3422 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3423 (Dwo_file::read_executable): New function.
3424 (Dwo_file::read): Move common setup code to ...
3425 (Dwo_file::make_object): ... here.
3426 (dwp_options): Add --exec/-e.
3427 (usage): Likewise.
3428 (main): Likewise.
3429
3430 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3431
3432 * layout.cc (Layout::layout): Check for option text_reorder.
3433 (Layout::make_output_section): Ditto.
3434 * options.h (text_reorder): New option.
3435 * output.cc (Input_section_sort_compare): Remove special ordering
3436 of section names.
3437 (Output_section::
3438 Input_section_sort_section_name_special_ordering_compare::
3439 operator()): New function.
3440 (Output_section::sort_attached_input_sections): Use new sort function
3441 for .text.
3442 * output.h (Input_section_sort_section_name_special_ordering_compare):
3443 New struct.
3444 * testsuite/Makefile.am (text_section_grouping): Test option
3445 --no-text-reorder
3446 * testsuite/Makefile.in: Regenerate.
3447 * testsuite/text_section_grouping.sh: Check order of functions without
3448 default text reordering.
3449
3450 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3451
3452 * options.h (General_options): Change default to true for new_dtags.
3453
3454 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3455
3456 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3457 when enable_new_dtags is false. Only add DT_RUNPATH when
3458 enable_new_dtags is true.
3459
3460 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3461
3462 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3463 used in declaration and definition consistent.
3464 (Target_powerpc::symval_for_branch): Ditto.
3465
3466 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3467
3468 * testsuite/plugin_final_layout.cc: Fix comment.
3469
3470 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3471
3472 * layout.cc (Layout::layout): Do not do default sorting for
3473 text sections when section ordering is specified.
3474 (make_output_section): Ditto.
3475 * testsuite/plugin_final_layout.cc: Name the function sections
3476 to catch reordering issues.
3477
3478 2013-01-15 Alan Modra <amodra@gmail.com>
3479
3480 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3481 plt-thread-safe.
3482
3483 2013-01-15 Alan Modra <amodra@gmail.com>
3484
3485 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3486 * testsuite/Makefile.in: Regenerate.
3487
3488 2013-01-14 Alan Modra <amodra@gmail.com>
3489
3490 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3491 * testsuite/Makefile.in: Regenerate.
3492
3493 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3494
3495 PR bfd/14430
3496 Fix mingw gold build with plugins enabled
3497 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3498 * configure.ac: Export DLOPEN_LIBS and add headers check.
3499 * plugin.cc: Handle non-dlfcn case.
3500 * Makefile.in: Regenerate.
3501 * config.in: Regenerate.
3502 * configure: Regenerate.
3503 * testsuite/Makefile.in: Regenerate.
3504
3505 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3506
3507 * output.h (sort_attached_input_sections): Change to be public.
3508 * script-sections.cc
3509 (Output_section_definition::set_section_addresses): Sort
3510 attached input sections according to section order before linker
3511 script assigns section addresses.
3512 (Orphan_output_section::set_section_addresses): Sort
3513 attached input sections according to section order before linker
3514 script assigns section addresses.
3515 * Makefile.am (final_layout.sh): Use a simple linker script to
3516 check if section ordering still works.
3517 * Makefile.in: Regenerate.
3518
3519 2013-01-09 Ben Cheng <bccheng@google.com>
3520
3521 * arm.cc (Target_arm::attributes_accept_div): New function.
3522 (Target_arm::attributes_forbid_div): New function.
3523 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3524 attribute using the same new functions as what bfd/elf32_arm.c
3525 does.
3526
3527 2013-01-07 Cary Coutant <ccoutant@google.com>
3528
3529 PR gold/14993
3530 * output.cc (Output_section::add_input_section): For incremental
3531 updates, don't track input sections that are allocated from patch
3532 space.
3533
3534 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3535 Ian Lance Taylor <iant@google.com>
3536
3537 PR gold/14897
3538 * configure.ac (--enable-ld): Removed.
3539 (install_as_default): Set to yes only for --enable-gold=default
3540 or --disable-ld.
3541 * configure: Regenerated.
3542
3543 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3544
3545 * options.h (General_options): Add -fuse-ld= for GCC linker
3546 option compatibility.
3547
3548 2013-01-04 Cary Coutant <ccoutant@google.com>
3549
3550 * configure.ac: Fix typo restoring CXXFLAGS.
3551 * configure: Regenerate.
3552
3553 2013-01-04 Cary Coutant <ccoutant@google.com>
3554
3555 * testsuite/Makefile.am (CXXLINK_S): New macro.
3556 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3557 * testsuite/Makefile.in: Regenerate.
3558
3559 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3560
3561 * version.cc (print_version): Update copyright year to 2013.
3562
3563 2012-12-20 Ian Lance Taylor <iant@google.com>
3564
3565 * layout.cc (Layout::special_ordering_of_input_section): New
3566 function.
3567 (Layout::layout): If input section requires special ordering, must
3568 sort input sections.
3569 (Layout::make_output_section): May sort .text input sections.
3570 (Layout::is_section_name_prefix_grouped): Remove.
3571 * layout.h (class Layout): Declare
3572 special_ordering_of_input_section. Don't declare
3573 is_section_name_prefix_grouped.
3574 * output.cc (Output_section::add_input_section): Revert last
3575 change.
3576 (Output_section::Input_section_sort::match_file_name): Don't crash
3577 if called on output section data.
3578 (Output_section::Input_section_sort_compare): Sort based on
3579 special ordering.
3580 (Output_section::Input_section_sort_section_order_index_compare):
3581 Revert last patch.
3582 (Output_section::sort_attached_input_sections): Likewise.
3583
3584 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3585
3586 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3587 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3588 * output.cc (Output_section::add_input_section): Check if section
3589 name contains special prefix. Keep input sections to sort such
3590 sections.
3591 (Output_section::Input_section_sort_section_order_index_compare
3592 ::operator()): Group sections according to prefixes.
3593 (Output_section::sort_attached_input_sections): Add condition to
3594 Input_section_entry constructor call.
3595 * testsuite/Makefile.am (text_section_grouping): New test.
3596 * testsuite/Makefile.in: Regenerate.
3597 * testsuite/text_section_grouping.cc: New file.
3598 * testsuite/text_section_grouping.sh: New file.
3599
3600 2012-12-17 Nick Clifton <nickc@redhat.com>
3601
3602 * Makefile.am: Add copyright notice.
3603 * NEWS: Likewise.
3604 * README: Likewise.
3605 * configure.ac: Likewise.
3606 * ftruncate.c: Likewise.
3607 * Makefile.in: Regenerate.
3608
3609 2012-12-14 Cary Coutant <ccoutant@google.com>
3610
3611 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3612 --no-as-needed flag.
3613 (exception_separate_shared_12_test): Likewise.
3614 (incremental_copy_test): Likewise.
3615 * testsuite/Makefile.in: Regenerate.
3616
3617 2012-12-14 Cary Coutant <ccoutant@google.com>
3618
3619 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3620 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3621
3622 2012-12-12 Alan Modra <amodra@gmail.com>
3623
3624 * powerpc.cc (class Track_tls): New.
3625 (class Relocate, class Scan): Inherit Track_tls.
3626 (Target_powerpc::Scan::local, global): Track tls optimization
3627 and avoid creating plt entry for __tls_get_addr if all uses
3628 are optimized away.
3629 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3630
3631 2012-12-12 Alan Modra <amodra@gmail.com>
3632
3633 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3634 Replace no_toc_optimize with toc_optimize.
3635 * output.h (Output_section::input_sections): Provide non-const variant.
3636 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3637 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3638 accessors.
3639 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3640 (class Sort_toc_sections): New.
3641 (Target_powerpc::do_finalize_sections): Sort toc sections.
3642 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3643
3644 2012-12-10 Roland McGrath <mcgrathr@google.com>
3645
3646 * testsuite/binary_unittest.cc (read_all): New function.
3647 (Sized_binary_test): Use it instead of ::read.
3648 * fileread.cc (do_read): Don't assume pread always reads the whole
3649 amount in a single call.
3650
3651 2012-12-10 Alan Modra <amodra@gmail.com>
3652
3653 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3654 Set EM_PPC64 or EM_PPC here.
3655 (Target_selector_powerpc::do_recognize): Delete.
3656
3657 2012-12-10 Alan Modra <amodra@gmail.com>
3658
3659 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3660 stub_table_.
3661 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3662
3663 2012-12-07 Roland McGrath <mcgrathr@google.com>
3664
3665 * testsuite/binary_unittest.cc (Sized_binary_test):
3666 Use open_descriptor rather than ::open.
3667
3668 2012-12-07 Alan Modra <amodra@gmail.com>
3669
3670 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3671 typedef and invalid_address constant.
3672 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3673 instantiate constants.
3674
3675 2012-12-06 Roland McGrath <mcgrathr@google.com>
3676
3677 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3678 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3679 * aclocal.m4: Regenerate.
3680 * configure: Regenerate.
3681 * Makefile.in: Regenerate.
3682 * testsuite/Makefile.in: Regenerate.
3683
3684 2012-12-07 Alan Modra <amodra@gmail.com>
3685
3686 * options.h (General_options): Add no_toc_optimize.
3687 * powerpc.cc (ok_lo_toc_insn): New function.
3688 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3689
3690 2012-12-06 Alan Modra <amodra@gmail.com>
3691
3692 * options.h (General_options): Add plt_align, plt_static_chain,
3693 plt_thread_safe. Update stub_group_size help text.
3694 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3695 for new plt_thread_safe_ var.
3696 (use_plt_offset): Correct comments.
3697 (Target_powerpc::do_relax): Look for thread creation symbols to
3698 determine default plt_thread_safe value. Clear plt call stubs
3699 as well as branch stubs each iteration.
3700 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3701 insn constants.
3702 (l, hi, ha, write_insn): Move earlier.
3703 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3704 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3705 plt stubs too.
3706 (Stub_table::update_size): Adjust.
3707 (Stub_table::prev_size, set_prev_size): Delete.
3708 (Stub_table::stub_align): Let --plt-align affect result.
3709 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3710 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3711 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3712 (Stub_table::do_write): Support more stub variants.
3713
3714 2012-12-04 Alan Modra <amodra@gmail.com>
3715
3716 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3717 (Target_powerpc::do_define_standard_symbols): New function.
3718
3719 2012-12-03 Alan Modra <amodra@gmail.com>
3720
3721 * output.h: Formatting, whitespace.
3722
3723 2012-12-03 Alan Modra <amodra@gmail.com>
3724
3725 * layout.h (Layout::get_executable_sections): Declare.
3726 * layout.cc (Layout::get_executable_sections): New function.
3727 * arm.cc (Target_arm::group_sections): Use it.
3728 (Arm_output_section::group_sections): Delete now redundant test.
3729 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3730 param to handle relative relocs.
3731 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3732 (Output_data_reloc::add_absolute): Adjust.
3733 (Output_data_reloc::add_relative): New function.
3734 (Output_data::reset_data_size): New function.
3735 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3736 (Output_section::set_addralign): New function.
3737 (Output_section::checkpoint_set_addralign): New function.
3738 (Output_section::clear_section_offsets_need_adjustment): New function.
3739 (Output_section::input_sections): Make public.
3740 * powerpc.cc (class Output_data_brlt_powerpc): New.
3741 (class Stub_table, class Stub_control): New.
3742 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3743 stub_table_, set_stub_table, stub_table): New vectors and accessor
3744 functions.
3745 (Target_powerpc::do_may_relax, do_relax, push_branch,
3746 new_stub_table, stub_tables, brlt_section, group_sections,
3747 add_branch_lookup_table, find_branch_lookup_table,
3748 write_branch_lookup_table, make_brlt_section): New functions.
3749 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3750 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3751 branch_info_): New vars.
3752 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3753 make call stubs here.
3754 (Output_data_glink): Remove all call stub handling from this class.
3755 (Target_powerpc::Scan::local, global): Save interesting branch
3756 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3757 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3758 functions on final link.
3759 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3760 Handle long branch destinations too.
3761 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3762 do_plt_address_for_local): Adjust lookup of plt call stubs.
3763
3764 2012-11-30 Alan Modra <amodra@gmail.com>
3765
3766 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3767 relocs against protected symbols when building 32-bit shared libs.
3768
3769 2012-11-30 Alan Modra <amodra@gmail.com>
3770
3771 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3772 param. Call got_section() to make .got. Update all callers
3773 and their callers and so on.
3774
3775 2012-11-30 Alan Modra <amodra@gmail.com>
3776
3777 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3778 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3779 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3780 value if it already exists.
3781
3782 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3783
3784 PR gold/14858
3785 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3786
3787 2012-11-14 Roland McGrath <mcgrathr@google.com>
3788
3789 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3790 than bfc instruction for data sandboxing.
3791
3792 2012-11-08 Alan Modra <amodra@gmail.com>
3793
3794 * po/POTFILES.in: Regenerate.
3795
3796 2012-11-05 Alan Modra <amodra@gmail.com>
3797
3798 * configure.ac: Apply 2012-09-10 change to config.in here.
3799 * configure: Regenerate.
3800
3801 2012-11-05 Alan Modra <amodra@gmail.com>
3802
3803 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3804 (struct Opd_ent): Use "Address" rather than "Offset".
3805 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3806 (Target_powerpc::got_section): Make public.
3807 (Target_powerpc::scan_relocs): Move code setting symbols..
3808 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3809 Create _SDA_BASE_ only when referenced.
3810
3811 2012-11-02 Roland McGrath <mcgrathr@google.com>
3812
3813 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3814 from last change.
3815
3816 2012-11-01 Roland McGrath <mcgrathr@google.com>
3817
3818 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3819 for offset_in_output_section parameter.
3820 (Sized_target::relocate_special_relocatable): Likewise.
3821 * arm.cc (Target_arm::relocate_relocs): Likewise.
3822 (Target_arm::relocate_special_relocatable): Likewise.
3823 * i386.cc (Target_i386::relocate_relocs): Likewise.
3824 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3825 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3826 * target-reloc.h (relocate_relocs): Likewise.
3827 * testsuite/testfile.cc (Target_test): Likewise.
3828 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3829 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3830
3831 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3832 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3833
3834 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3835 parameter, which is unused in the [!F_SETFD] case.
3836
3837 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3838 SYMNDX to off_t before comparing it to this->data_size().
3839 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3840 * incremental.cc (Output_section_incremental_inputs::do_write):
3841 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3842
3843 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3844
3845 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3846
3847 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3848 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3849 in EABI_VER5.
3850
3851 2012-10-29 Cary Coutant <ccoutant@google.com>
3852
3853 * dwp.cc (usage): Add file and exit status parameters;
3854 add --help and --version options.
3855 (print_version): New function.
3856 (main): Add --help and --version options.
3857
3858 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3859
3860 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3861 final_layout_sequence.txt.
3862 * testsuite/Makefile.in: Regenerated.
3863
3864 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3865
3866 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3867 COMPILE generated by automake.
3868 (LINK1): Likewise.
3869 (CXXCOMPILE1): Likewise.
3870 (CXXLINK1): Likewise.
3871 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3872 (LINK): Likewise.
3873 (CXXCOMPILE): Likewise.
3874 (CXXLINK): Likewise.
3875 * testsuite/Makefile.in: Regenerated.
3876
3877 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3878
3879 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3880 on bad fwrite return.
3881
3882 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3883
3884 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3885 on val.
3886
3887 2012-10-23 Cary Coutant <ccoutant@google.com>
3888
3889 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3890 * testsuite/Makefile.in: Regenerate.
3891 * testsuite/dwp_test.h: New source file.
3892 * testsuite/dwp_test_1.cc: New source file.
3893 * testsuite/dwp_test_1.s: New source file.
3894 * testsuite/dwp_test_1.sh: New source file.
3895 * testsuite/dwp_test_1b.cc: New source file.
3896 * testsuite/dwp_test_1b.s: New source file.
3897 * testsuite/dwp_test_2.cc: New source file.
3898 * testsuite/dwp_test_2.s: New source file.
3899 * testsuite/dwp_test_2.sh: New source file.
3900 * testsuite/dwp_test_main.cc: New source file.
3901 * testsuite/dwp_test_main.s: New source file.
3902
3903 2012-10-23 Cary Coutant <ccoutant@google.com>
3904
3905 * dwp.h: New header file.
3906 * dwp.cc: New source file.
3907 * gold.h: Move shared declarations to system.h.
3908 * system.h: New header file.
3909 * Makefile.am: Add dwp.
3910 * Makefile.in: Regenerate.
3911
3912 2012-10-23 Cary Coutant <ccoutant@google.com>
3913
3914 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3915 Dwarf_info_reader::read_from_pointer.
3916 (Dwarf_pubnames_table::read_header): Likewise.
3917 (Dwarf_pubnames_table::next_name): Likewise.
3918 (Dwarf_die::read_attributes): Likewise.
3919 (Dwarf_die::skip_attributes): Likewise.
3920 (Dwarf_info_reader::read_from_pointer): New function template.
3921 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3922 (Dwarf_pubnames_table): Likewise.
3923 (Dwarf_info_reader::read_from_pointer): New function template.
3924 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3925 Dwarf_pubnames_table ctor.
3926
3927 2012-10-23 Cary Coutant <ccoutant@google.com>
3928
3929 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3930 abbrev_shndx.
3931 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3932 abbrev_shndx_.
3933 (Dwarf_info_reader::set_abbrev_shndx): New method.
3934 (Dwarf_info_reader::abbrev_shndx_): New data member.
3935
3936 2012-10-23 Cary Coutant <ccoutant@google.com>
3937
3938 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3939 from object, not parameters.
3940 (Dwarf_info_reader::parse): Likewise.
3941 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3942 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3943 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3944 methods.
3945
3946 2012-10-23 Cary Coutant <ccoutant@google.com>
3947
3948 * fileread.cc (Input_file::Input_file): New constructor.
3949 * fileread.h (class Input_file): Add new constructor.
3950
3951 2012-10-18 Alan Modra <amodra@gmail.com>
3952
3953 PR gold/14727
3954 * object.cc (Relobj::is_section_name_included): Also match
3955 .sdata personality section.
3956
3957 2012-10-18 Alan Modra <amodra@gmail.com>
3958
3959 * target-reloc.h (class Default_comdat_behavior): New, package up..
3960 (get_comdat_behaviour): ..this.
3961 (relocate_section): Add Relocate_comdat_behavior template arg,
3962 adjust code to suit.
3963 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3964 (Target_arm::scan_reloc_section): Likewise.
3965 * i386.cc (Target_i386::relocate_section): Likewise.
3966 * sparc.cc (Target_sparc::relocate_section): Likewise.
3967 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3968 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3969 * powerpc.cc (class Relocate_comdat_behavior): New.
3970 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3971 gold::relocate_section with new template arg.
3972
3973 2012-10-18 Alan Modra <amodra@gmail.com>
3974
3975 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3976 dynamic relocs for GOT_TPREL got entries, without symbol if
3977 resolving locally.
3978 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3979 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3980 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3981
3982 2012-10-17 Alan Modra <amodra@gmail.com>
3983
3984 PR gold/14726
3985 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3986
3987 2012-10-16 Sriraman Tallam <tmsriram@google.com>
3988
3989 * layout.cc (Layout::include_section): Keep sections marked
3990 SHF_EXCLUDE when doing relocatable links.
3991
3992 2012-10-16 Alan Modra <amodra@gmail.com>
3993
3994 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3995 (Target_powerpc::do_finalize_sections): Call it.
3996 (Output_data_save_res): New class and supporting functions.
3997 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3998 normal symbols defined in object files.
3999
4000 2012-10-12 Alan Modra <amodra@gmail.com>
4001
4002 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4003 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4004 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4005 section if scan_opd_relocs not yet called.
4006 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4007
4008 2012-10-12 Alan Modra <amodra@gmail.com>
4009
4010 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4011 add_local_ifunc_entry): Revert last change.
4012 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4013
4014 2012-10-05 Alan Modra <amodra@gmail.com>
4015
4016 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4017 do_plt_address_for_global): New functions.
4018 (Output_data_got_powerpc::do_write): Don't segfault when linking
4019 statically.
4020 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4021 add_local_ifunc_entry): Return true on adding entry..
4022 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4023 glink->add_entry call. Remove unused symtab param. Adjust calls.
4024 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4025 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4026 set up symbols here.
4027 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4028 syms here. Do so even when no .iplt. Don't segfault when linking
4029 statically.
4030 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4031 new variants without reloc param.
4032 (Glink_sym_ent::Glink_sym_ent): Likewise.
4033 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4034 reloc when refs will resolve to plt call stub.
4035 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4036 R_PPC_PLTREL24 to resolve locally.
4037 (Target_powerpc::Scan::global): Correct ifunc handling.
4038 (Target_powerpc::Relocate::relocate): Correct local sym glink
4039 lookup. Don't destroy "value" when we have a plt call stub,
4040 and when checking plt call validity.
4041 (Target_powerpc::do_dynsym_value): Simplify.
4042
4043 2012-10-05 Alan Modra <amodra@gmail.com>
4044
4045 * i386.cc (Output_data_plt_i386::address_for_global,
4046 address_for_local): Add plt offset to returned value. Adjust uses.
4047 * sparc.cc (Output_data_plt_sparc::address_for_global,
4048 address_for_local): Likewise.
4049 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4050 address_for_local): Likewise.
4051 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4052 address_for_local): Likewise.
4053 * target.h (Target::plt_address_for_global, plt_address_for_local):
4054 Update comment.
4055 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4056 (Output_data_got::Got_entry::write): Nor here.
4057 * output.h: Comment fix.
4058
4059 2012-10-02 Jiong Wang <jiwang@tilera.com>
4060
4061 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4062 global_offset_table_ value for larget got.
4063 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4064
4065 2012-09-29 Alan Modra <amodra@gmail.com>
4066
4067 * powerpc.cc (Target_powerpc::iplt_): New output section.
4068 (Target_powerpc::iplt_section, make_iplt_section,
4069 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4070 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4071 Target_powerpc::plt_entry_count): Count iplt entries too.
4072 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4073 reloc section in constructor. New params.
4074 (Target_powerpc::make_plt_section): Create reloc section here instead.
4075 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4076 functions.
4077 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4078 (Output_data_glink::add_entry, find_entry): New functions to
4079 deal with local syms.
4080 (Glink_sym_ent): Add support for local syms.
4081 (Output_data_glink::do_write): Handle ifunc plt entries.
4082 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4083 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4084 (Target_powerpc::Relocate::relocate): Likewise.
4085 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4086
4087 2012-09-25 Alan Modra <amodra@gmail.com>
4088
4089 * object.h (Sized_relobj_file::adjust_local_symbol,
4090 do_adjust_local_symbol): New functions.
4091 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4092 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4093 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4094 and irregular opd entry spacing.
4095 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4096 (Global_symbol_visitor_opd): New functor.
4097 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4098 on deleted opd entries.
4099
4100 2012-09-15 Jiong Wang <jiwang@tilera.com>
4101
4102 * tilegx.cc: New file.
4103 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4104 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4105 * configure.tgt: Add entries for tilegx*.
4106 * configure.ac: Likewise.
4107 * Makefile.in: Rebuild.
4108 * configure: Likewise.
4109 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4110 tilegx.
4111
4112 2012-09-13 Alan Modra <amodra@gmail.com>
4113
4114 * target-reloc.h (scan_relocs): Call scan.local for relocs
4115 against symbols in discarded sections. Pass is_discarded
4116 param.
4117 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4118 Add is_discarded param.
4119 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4120 is_discarded to flag opd entry as discarded. Don't emit dyn
4121 relocs on such entries.
4122 (Target_powerpc::Scan::global): Similarly detect and handle
4123 such opd entries.
4124 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4125 opd_ent_. Update all uses.
4126 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4127 (Target_powerpc::relocate_section): Zero out discarded opd
4128 entry relocs.
4129
4130 2012-09-12 Ian Lance Taylor <iant@google.com>
4131
4132 PR gold/14570
4133 * output.cc: Rename Output_data_got template parameter from size
4134 to got_size for all functions. Compile all variants of
4135 Output_data_got.
4136 (Output_data_got::Got_entry::write): Correct use of size for
4137 symbol value. Use local_is_tls rather than casting to
4138 Sized_relobj_file.
4139 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4140 (class Sized_relobj_file): Add do_local_is_tls.
4141 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4142
4143 2012-09-11 Alan Modra <amodra@gmail.com>
4144
4145 PR gold/14566
4146 * layout.cc (Layout::set_segment_offsets): When using
4147 common-page-size alignment, ensure we are on a new max-page-size
4148 page.
4149 * output.cc (Output_segment::set_section_addresses): Use
4150 abi_pagesize, not common_pagesize for relro boundary.
4151 (Output_segment::set_offset): Likewise.
4152
4153 2012-09-11 Alan Modra <amodra@gmail.com>
4154
4155 * output.h (Output_data_got::add_global_tls, add_local_tls,
4156 add_local_tls_pair): New functions.
4157 (Output_data_got::add_local_pair_with_rel): Remove second
4158 reloc param. Expand comment.
4159 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4160 use_plt_or_tls_offset_, similarly for constructor param.
4161 (Output_data_got::Got_entry::write): Add got_index param.
4162 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4163 add_local_tls_pair): New functions.
4164 (Output_data_got::Got_entry::write): Handle tls symbols
4165 with use_plt_or_tls_offset_ set specially.
4166 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4167 (Output_data_got::do_write): Replace iterator with index, pass
4168 index to entry write function.
4169 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4170 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4171 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4172 call.
4173 * i386.cc (Target_i386::Scan::local): Likewise.
4174 * sparc.cc (Target_sparc::Scan::local): Likewise.
4175 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4176 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4177 do_tls_offset_for_global): New functions.
4178 (Target_powerpc::Scan::local): Correct TLS relocations and got
4179 entry values.
4180 (Target_powerpc::Scan::global): Don't emit unnecessary
4181 dynamic relocations on TLS GOT entries.
4182
4183 2012-09-10 Matthias Klose <doko@ubuntu.com>
4184
4185 * config.in: Disable sanity check for kfreebsd.
4186
4187 2012-09-10 Sterling Augustine <saugustine@google.com>
4188
4189 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4190 (Gdb_index::pubtypes_read): New parameter.
4191 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4192 to calls.
4193 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4194 pubtypes_object_.
4195
4196 2012-09-09 Alan Modra <amodra@gmail.com>
4197
4198 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4199 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4200 * gc.h (gc_process_relocs): Call target gc_add_reference.
4201 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4202 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4203 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4204 unnecessary cast.
4205 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4206 to cater for when we don't need code offset. Update use.
4207 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4208 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4209 set_opd_valid): New functions.
4210 (Target_powerpc::do_gc_add_reference): New function.
4211 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4212 stashed refs.
4213 (Target_powerpc::do_gc_mark_symbol): New function.
4214
4215 2012-09-06 Cary Coutant <ccoutant@google.com>
4216
4217 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4218 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4219 (Dwarf_die::skip_attributes): Likewise.
4220 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4221 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4222 (main): Call it.
4223 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4224
4225 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4226
4227 * testsuite/script_test_3.t: Add .got.plt output section
4228 statement.
4229 * testsuite/script_test_4.t: Likewise.
4230
4231 2012-09-05 Alan Modra <amodra@gmail.com>
4232
4233 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4234 update all uses and lose "enum" when using type.
4235
4236 2012-09-05 Alan Modra <amodra@gmail.com>
4237
4238 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4239 * configure: Regenerate.
4240 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4241 (plugin_final_layout.stdout): Likewise.
4242 (memory_test): Set page sizes to 0x1000.
4243 * testsuite/Makefile.in: Regenerate.
4244 * testsuite/discard_locals_test.sh: Add FIXME comment.
4245 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4246 * testsuite/pr14265.t: Add .got output section statement.
4247 * testsuite/script_test_2.t: Likewise.
4248 * testsuite/script_test_3.t: Likewise.
4249 * testsuite/script_test_4.t: Likewise.
4250 * testsuite/script_test_5.t: Likewise.
4251 * testsuite/script_test_6.t: Likewise.
4252 * testsuite/script_test_7.t: Likewise.
4253 * testsuite/script_test_9.t: Likewise.
4254
4255 2012-09-05 Alan Modra <amodra@gmail.com>
4256
4257 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4258 (Powerpc_relocate_functions::Status): New typedef.
4259 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4260 (Target_powerpc::Scan::local): Handle REL64.
4261 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4262 for REL32 and REL64.
4263 (Target_powerpc::symval_for_branch): New function, extracted from..
4264 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4265 checks. Report overflow errors.
4266
4267 2012-09-05 Alan Modra <amodra@gmail.com>
4268
4269 * object.h (Sized_relobj_file::emit_relocs): Delete.
4270 (Sized_relobj_file::emit_relocs_reltype): Delete.
4271 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4272 relocate_relocs for --emit-relocs.
4273 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4274 * output.h: Update comment.
4275 (Output_segment::first_section): New function.
4276 (Output_segment::first_section_load_address): Use first_section.
4277 * output.cc (Output_segment::first_section): New function extracted..
4278 (Output_segment::first_section_load_address): ..from here. Delete.
4279 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4280 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4281 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4282 adjust call to target.h function.
4283 * i386.cc (Target_i386): Likewise.
4284 * sparc.cc (Target_sparc): Likewise.
4285 * x86_64.cc (Target_x86_64): Likewise.
4286 * powerpc.cc (Target_powerpc): Likewise.
4287 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4288 first tls section has section symbol for optimised local dynamic
4289 output relocs.
4290 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4291 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4292 optimised tls code.
4293 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4294 Rename to relocate_relocs. Update error message.
4295
4296 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4297
4298 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4299 --just-symbols.
4300
4301 2012-08-31 Alan Modra <amodra@gmail.com>
4302
4303 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4304 (Powerpc_relobj::toc_base_offset): New stub function.
4305 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4306 got_mod_index_offset to tlsld_got_offset. Update all refs.
4307 (Target_powerpc::Relocate::enum skip_tls): New.
4308 (Target_powerpc::call_tls_get_addr_): New var.
4309 (Target_powerpc::is_branch_reloc): Move to file scope.
4310 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4311 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4312 New functions.
4313 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4314 (powerpc_info): Correct common_pagesize for ppc64.
4315 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4316 (Powerpc_relocate_functions): Add overflow check enums and functions.
4317 Add non-shift version of rela, rela_ua. Delete all rel public
4318 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4319 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4320 addr16_ha3, addr14 functions.
4321 (Output_data_got_powerpc::add_constant_pair): New function.
4322 (Output_data_got_powerpc::got_base_offset): Likewise.
4323 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4324 (instruction constants): Sort, add some more.
4325 (Output_data_glink::do_write): Add and use Address typedef. Use
4326 object->toc_base_offset() stub for 64-bit.
4327 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4328 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4329 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4330 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4331 Always treat .opd relocs as against locally defined symbol.
4332 Correct condition for RELATIVE relocs.
4333 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4334 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4335 for 32-bit syms with a plt entry. Correct ppc64 toc base
4336 calculations. Handle TLS relocs, and more. Add overflow
4337 checking and adjust for Powerpc_relocate_functions changes.
4338 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4339 Reinstate --emit-relocs code with FIXME.
4340
4341 2012-08-30 Alan Modra <amodra@gmail.com>
4342
4343 * layout.cc (Layout::set_segment_offsets): Set p_align to
4344 abi_pagesize, not common_pagesize.
4345 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4346 to determine whether file header can go in segment.
4347
4348 2012-08-30 Alan Modra <amodra@gmail.com>
4349
4350 * output.h (Output_reloc::Output_reloc <output section>): Add
4351 is_relative param. Adjust calls.
4352 (Output_reloc::add_output_section_relative): New functions.
4353 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4354 is_relative.
4355 (Output_reloc::symbol_value): Handle SECTION_CODE.
4356
4357 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4358
4359 * gold.cc (queue_middle_tasks): Call layout again when unique
4360 segments for sections is desired.
4361 * layout.cc (Layout::Layout): Initialize new members.
4362 (Layout::get_output_section_flags): New function.
4363 (Layout::choose_output_section): Call get_output_section_flags.
4364 (Layout::layout): Make output section for mapping to a unique segment.
4365 (Layout::insert_section_segment_map): New function.
4366 (Layout::attach_allocated_section_to_segment): Make unique segment for
4367 output sections marked so.
4368 (Layout::segment_precedes): Check for unique segments when sorting.
4369 * layout.h (Layout::Unique_segment_info): New struct.
4370 (Layout::Section_segment_map): New typedef.
4371 (Layout::insert_section_segment_map): New function.
4372 (Layout::get_output_section_flags): New function.
4373 (Layout::is_unique_segment_for_sections_specified): New function.
4374 (Layout::set_unique_segment_for_sections_specified): New function.
4375 (Layout::unique_segment_for_sections_specified_): New member.
4376 (Layout::section_segment_map_): New member.
4377 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4378 Rename is_gc_pass_one to is_pass_one.
4379 Rename is_gc_pass_two to is_pass_two.
4380 Rename is_gc_or_icf to is_two_pass.
4381 Check for which pass based on whether symbols data is present.
4382 Make it two pass when unique segments for sections is desired.
4383 * output.cc (Output_section::Output_section): Initialize new
4384 members.
4385 * output.h (Output_section::is_unique_segment): New function.
4386 (Output_section::set_is_unique_segment): New function.
4387 (Output_section::is_unique_segment_): New member.
4388 (Output_section::extra_segment_flags): New function.
4389 (Output_section::set_extra_segment_flags): New function.
4390 (Output_section::extra_segment_flags_): New member.
4391 (Output_section::segment_alignment): New function.
4392 (Output_section::set_segment_alignment): New function.
4393 (Output_section::segment_alignment_): New member.
4394 (Output_segment::Output_segment): Initialize is_unique_segment_.
4395 (Output_segment::is_unique_segment): New function.
4396 (Output_segment::set_is_unique_segment): New function.
4397 (Output_segment::is_unique_segment_): New member.
4398 * plugin.cc (allow_unique_segment_for_sections): New function.
4399 (unique_segment_for_sections): New function.
4400 (Plugin::load): Add new functions to transfer vector.
4401 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4402 * Makefile.in: Regenerate.
4403 * testsuite/plugin_final_layout.sh: Check if unique segment
4404 functionality works.
4405 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4406 are available.
4407 (allow_unique_segment_for_sections): New global.
4408 (unique_segment_for_sections): New global.
4409 (claim_file_hook): Call allow_unique_segment_for_sections.
4410 (all_symbols_read_hook): Call unique_segment_for_sections.
4411
4412 2012-08-22 Cary Coutant <ccoutant@google.com>
4413
4414 * layout.cc (Layout::include_section): Don't assert on GROUP
4415 sections with --emit-relocs.
4416
4417 2012-08-21 Cary Coutant <ccoutant@google.com>
4418
4419 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4420 if --export-dynamic-symbol names an undef symbol.
4421
4422 2012-08-18 Alan Modra <amodra@gmail.com>
4423
4424 * powerpc.cc: Formatting and white space.
4425 (Powerpc_relobj): Rename got2_section_ to special_.
4426 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4427 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4428 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4429 (Target_powerpc): Add Address typedef and invalid_address. Use
4430 throughout.
4431 (Target_powerpc::is_branch_reloc): New function.
4432 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4433 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4434 for dst_mask, value and addend.
4435 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4436 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4437 (Output_data_glink::do_write): Correct toc base. Don't try to use
4438 uint16_t for 24-bit offset. Use get_output_section_offset and
4439 check return.
4440 (Target_powerpc::Scan::local): Handle more relocs.
4441 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4442 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4443 Plug in toc restoring insn after plt calls. Translate branches
4444 to function descriptor symbols to corresponding entry point.
4445 (Target_powerpc::relocate_for_relocatable): Check return from
4446 get_output_section_offset.
4447 * symtab.h: Comment typo.
4448
4449 2012-08-14 Ian Lance Taylor <iant@google.com>
4450
4451 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4452 unsupported_relocal_local to call unsupported_reloc_global.
4453
4454 2012-08-14 Nick Clifton <nickc@redhat.com>
4455
4456 PR ld/14265
4457 * script-sections.cc (Sections_element::output_section_name): Add
4458 keep return parameter.
4459 (Output_section_element::match_name): Add keep return parameter.
4460 Return the value of the keep_ member.
4461 * script-sections.h (class Output_section): Update
4462 output_section_name prototype.
4463 * layout.cc (Layout::keep_input_section): New public member
4464 function.
4465 (Layout::choose_output_section): Pass keep parameter to
4466 output_section_name.
4467 * layout.h (class Layout): Add keep_input_section.
4468 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4469 sections.
4470 * testsuite/Makefile.am: Add a test.
4471 * testsuite/Makefile.in: Regenerate.
4472 * testsuite/pr14265.c: Source file for the test.
4473 * testsuite/pr14265.t: Linker script for the test.
4474 * testsuite/pr14265.sh: Shell script for the test.
4475
4476 2012-08-14 Alan Modra <amodra@gmail.com>
4477
4478 * target.h (Target::output_section_name): New function.
4479 (Target::do_output_section_name): New function.
4480 * layout.cc (Layout::choose_output_section): Call the above.
4481 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4482
4483 2012-08-14 Alan Modra <amodra@gmail.com>
4484
4485 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4486 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4487 for replace_constant call.
4488 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4489 (Output_data_glink::do_print_to_mapfile): New function.
4490 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4491 (Target_powerpc::Relocate::relocate): Likewise.
4492
4493 2012-08-14 Alan Modra <amodra@gmail.com>
4494
4495 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4496 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4497 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4498 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4499 all references to shndx_. Handle special case for R_PPC_PLTREL24
4500 here.
4501 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4502 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4503 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4504 here.
4505 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4506 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4507
4508 2012-08-12 Alan Modra <amodra@gmail.com>
4509
4510 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4511 (glink insn constants): Use uint32_t.
4512 (Output_data_glink::add_entry): Use insert, not [] operator.
4513
4514 2012-08-11 Alan Modra <amodra@gmail.com>
4515
4516 * object.h (Sized_relobj_file::find_shdr): New function.
4517 (Sized_relobj_file::find_special_sections): New function.
4518 * object.cc (Sized_relobj_file::find_shdr): New function.
4519 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4520 (Sized_relobj_file::find_special_sections): New function, split out..
4521 (Sized_relobj_file::do_read_symbols): ..from here.
4522 * output.h (Output_data_got::replace_constant): New function.
4523 (Output_data_got::num_entries): New function.
4524 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4525 (Output_data_got::got_offset): Protected rather than private.
4526 (Output_data_got::replace_got_entry): New function.
4527 * output.cc (Output_data_got::replace_got_entry): New function.
4528 * powerpc.cc (class Powerpc_relobj): New.
4529 (class Powerpc_relocate_functions): Delete all psymval variants or
4530 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4531 Implement _ha functions using corresponding _hi function.
4532 (Powerpc_relobj::find_special_sections): New function.
4533 (Target_powerpc::do_make_elf_object): New function.
4534 (class Output_data_got_powerpc): New.
4535 (class Output_data_glink): New.
4536 (class Powerpc_scan_relocatable_reloc): New.
4537 Many more changes througout file.
4538
4539 2012-08-09 Nick Clifton <nickc@redhat.com>
4540
4541 * po/vi.po: Updated Vietnamese translation.
4542
4543 2012-08-07 Ian Lance Taylor <iant@google.com>
4544
4545 * layout.cc (Layout::add_target_dynamic_tags): If
4546 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4547 plt_rel.
4548
4549 2012-07-30 Nick Clifton <nickc@redhat.com>
4550
4551 * po/gold.pot: Updated template.
4552 * po/es.po: Updated Spanish translation.
4553
4554 2012-07-18 Cary Coutant <ccoutant@google.com>
4555
4556 PR gold/14344
4557 * configure.ac: Add check for -gpubnames support.
4558 * configure: Regenerate.
4559 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4560 support; force -gno-pubnames.
4561 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4562 support.
4563 (gdb_index_test_4): New test.
4564 * testsuite/Makefile.in: Regenerate.
4565 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4566 * testsuite/gdb_index_test_2.sh: Likewise.
4567 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4568 * testsuite/gdb_index_test_4.sh: New script.
4569 * testsuite/gdb_index_test_comm.sh: New script with common code;
4570 don't look for space after colon.
4571
4572 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4573
4574 * gold.cc (queue_middle_tasks): Update function order only after
4575 deferred objects due to plugins are processed.
4576
4577 2012-07-11 Ian Lance Taylor <iant@google.com>
4578
4579 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4580 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4581 (Target_arm::scan_reloc_for_stub): Likewise.
4582 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4583 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4584 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4585 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4586 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4587
4588 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4589 Ian Lance Taylor <iant@google.com>
4590
4591 PR gold/14309
4592 * configure.ac: Test whether std::tr1::hash<off_t> works.
4593 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4594 needed.
4595 * output.h (class Output_fill): Add virtual destructor.
4596 * configure, config.in: Rebuild.
4597
4598 2012-06-22 Roland McGrath <mcgrathr@google.com>
4599
4600 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4601
4602 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4603
4604 * plugin.cc (Plugin::load): Handle position independent executables.
4605
4606 2012-06-06 Cary Coutant <ccoutant@google.com>
4607
4608 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4609 add .debug_macro.
4610 (lines_only_debug_sections): Likewise.
4611 (gdb_fast_lookup_sections): New static array.
4612 (is_gdb_debug_section): Rename formal parameter.
4613 (is_lines_only_debug_section): Likewise.
4614 (is_gdb_fast_lookup_section): New function.
4615 (Layout::include_section): Check for ".zdebug_" prefix; pass
4616 section name suffix to is_gdb_debug_section, et al.; check for
4617 fast-lookup sections when building .gdb_index.
4618 * options.h (--strip-debug-gdb): Update GDB version number.
4619
4620 2012-06-06 Cary Coutant <ccoutant@google.com>
4621
4622 * configure.ac: Add check for fallocate.
4623 * configure: Regenerate.
4624 * config.in: Regenerate.
4625
4626 * options.h (class General_options): Add --mmap-output-file and
4627 --posix-fallocate options.
4628 * output.cc: (posix_fallocate): Remove; replace with...
4629 (gold_fallocate): New function.
4630 (Output_file::map_no_anonymous): Call gold_fallocate.
4631 (Output_file::map): Check --mmap-output-file option.
4632
4633 2012-06-05 Jing Yu <jingyu@google.com>
4634
4635 * gold.h (textdomain): Add do {} to empty while(0).
4636 (bindtextdomain): Likewise.
4637
4638 2012-06-04 Cary Coutant <ccoutant@google.com>
4639
4640 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4641 has_dynsym_index.
4642
4643 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4644
4645 * symtab.cc (Symbol_table::define_special_symbol):
4646 Initialize *poldsym to prevent uninitialized variable errors.
4647
4648 2012-05-23 Cary Coutant <ccoutant@google.com>
4649
4650 * layout.cc (Layout::section_name_mapping): Add rules to handle
4651 exact match on .data.rel.ro.local or .data.rel.ro.
4652 (Layout::output_section_name): Check for exact matches.
4653
4654 2012-05-23 Cary Coutant <ccoutant@google.com>
4655
4656 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4657 more carefully.
4658
4659 2012-05-22 Cary Coutant <ccoutant@google.com>
4660
4661 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4662 object before exporting symbol.
4663
4664 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4665
4666 * testsuite/tls_test.cc: Include "config.h" first.
4667 * testsuite/tls_test_c.c: Likewise.
4668
4669 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4670 Nick Clifton <nickc@redhat.com>
4671
4672 PR 14072
4673 * configure.in: Add check that sysdep.h has been included before
4674 any system header files.
4675 * configure: Regenerate.
4676 * config.in: Regenerate.
4677
4678 2012-05-14 Cary Coutant <ccoutant@google.com>
4679
4680 * layout.cc (Layout::make_output_section): Mark .tdata section
4681 as RELRO.
4682 * testsuite/relro_test.cc: Add a TLS variable.
4683
4684 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4685
4686 PR gold/14091
4687 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4688 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4689 R_X86_64_64.
4690
4691 2012-05-08 Cary Coutant <ccoutant@google.com>
4692
4693 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4694 (lines_only_debug_sections): Likewise.
4695
4696 2012-05-02 Roland McGrath <mcgrathr@google.com>
4697
4698 * nacl.cc: New file.
4699 * nacl.h: New file.
4700 * Makefile.am (CCFILES, HFILES): Add them.
4701 * Makefile.in: Regenerate.
4702 * i386.cc (Output_data_plt_i386_nacl): New class.
4703 (Output_data_plt_i386_nacl_exec): New class.
4704 (Output_data_plt_i386_nacl_dyn): New class.
4705 (Target_i386_nacl): New class.
4706 (Target_selector_i386_nacl): New class.
4707 (target_selector_i386): Use it instead of Target_selector_i386.
4708 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4709 (Target_x86_64_nacl): New class.
4710 (Target_selector_x86_64_nacl): New class.
4711 (target_selector_x86_64, target_selector_x32): Use it instead of
4712 Target_selector_x86_64.
4713 * arm.cc (Output_data_plt_arm_nacl): New class.
4714 (Target_arm_nacl): New class.
4715 (Target_selector_arm_nacl): New class.
4716 (target_selector_arm, target_selector_armbe): Use it instead of
4717 Target_selector_arm.
4718
4719 * target-select.cc (select_target): Take new Input_file* and off_t
4720 arguments, pass them on to recognize method of selector.
4721 * object.cc (make_elf_sized_object): Update caller.
4722 * parameters.cc (parameters_force_valid_target): Likewise.
4723 * incremental.cc (make_sized_incremental_binary): Likewise.
4724 * target-select.h: Update decl.
4725 (Target_selector::recognize): Take new Input_file* argument,
4726 pass it on to do_recognize.
4727 (Target_selector::do_recognize): Take new Input_file* argument.
4728 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4729 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4730 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4731 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4732
4733 * target.h (Target::Target_info): New members isolate_execinstr
4734 and rosegment_gap.
4735 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4736 * arm.cc (Target_arm::arm_info): Update initializer.
4737 * i386.cc (Target_i386::i386_info): Likewise.
4738 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4739 * sparc.cc (Target_sparc::sparc_info): Likewise.
4740 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4741 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4742 * layout.cc (Layout::attach_allocated_section_to_segment):
4743 Take new const Target* argument. If target->isolate_execinstr(), act
4744 like --rosegment.
4745 (Layout::find_first_load_seg): Take new const Target* argument;
4746 if target->isolate_execinstr(), reject PF_X segments.
4747 (Layout::relaxation_loop_body): Update caller.
4748 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4749 reset file offset to zero when we hit LOAD_SEG, and then do a second
4750 loop over the segments before LOAD_SEG to reassign offsets after
4751 addresses have been determined. Handle target->rosegment_gap().
4752 (Layout::attach_section_to_segment): Take new const Target* argument;
4753 pass it to attach_allocated_section_to_segment.
4754 (Layout::make_output_section): Update caller.
4755 (Layout::attach_sections_to_segments): Take new const Target* argument;
4756 pass it to attach_section_to_segment.
4757 * gold.cc (queue_middle_tasks): Update caller.
4758 * layout.h (Layout): Update method decls with new arguments.
4759
4760 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4761 Target_info pointer to use.
4762 (Target_arm::do_make_data_plt): New virtual method.
4763 (Target_arm::make_data_plt): New method that calls it.
4764 (Target_arm::make_plt_entry): Use it.
4765 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4766 for the section alignment.
4767 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4768 method.
4769 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4770 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4771 method.
4772 (Output_data_plt_arm::get_plt_entry_size): Call it.
4773 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4774 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4775 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4776 method.
4777 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4778 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4779 method instead of sizeof(plt_entry).
4780 (Output_data_plt_arm::add_entry): Likewise.
4781 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4782 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4783 than static method.
4784 (Target_arm::plt_entry_size): Likewise.
4785 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4786 Move to ...
4787 (Output_data_plt_arm_standard): ... here, new class.
4788 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4789 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4790 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4791
4792 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4793 Take additional argument for the PLT entry size.
4794 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4795 Use get_plt_entry_size method rather than plt_entry_size variable.
4796 (Output_data_plt_x86_64::reserve_slot): Likewise.
4797 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4798 (Output_data_plt_x86_64::add_entry): Likewise.
4799 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4800 (Output_data_plt_x86_64::address_for_global): Likewise.
4801 (Output_data_plt_x86_64::address_for_local): Likewise.
4802 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4803 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4804 Make method non-static.
4805 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4806 method.
4807 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4808 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4809 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4810 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4811 virtual method.
4812 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4813 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4814 virtual method.
4815 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4816 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4817 virtual method.
4818 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4819 (Output_data_plt_x86_64::plt_entry_size)
4820 (Output_data_plt_x86_64::first_plt_entry)
4821 (Output_data_plt_x86_64::plt_entry)
4822 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4823 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4824 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4825 (Output_data_plt_x86_64_standard): ... here, new class.
4826 (Target_x86_64::Target_x86_64): Take optional argument for the
4827 Target_info pointer to use.
4828 (Target_x86_64::do_make_data_plt): New virtual method.
4829 (Target_x86_64::make_data_plt): New method to call it.
4830 (Target_x86_64::init_got_plt_for_update): Use that.
4831 Call this->plt_->add_eh_frame method here.
4832 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4833 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4834 rather than static method.
4835 (Target_x86_64::plt_entry_size): Likewise.
4836 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4837 rather than plt_entry_size variable. Move guts of PLT filling to...
4838 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4839 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4840 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4841
4842 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4843 additional argument for the section alignment.
4844 Don't do add_eh_frame_for_plt here.
4845 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4846 non-static. Use get_plt_entry_size method rather than plt_entry_size
4847 variable.
4848 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4849 method.
4850 (Output_data_plt_i386::get_plt_entry_size): Call it.
4851 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4852 (Output_data_plt_i386::add_eh_frame): New method to call it.
4853 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4854 method.
4855 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4856 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4857 method.
4858 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4859 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4860 method instead of plt_entry_size.
4861 (Output_data_plt_i386::plt_entry_size)
4862 (Output_data_plt_i386::plt_eh_frame_fde_size)
4863 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4864 (Output_data_plt_i386_standard): ... here, new class.
4865 (Output_data_plt_i386_exec): New class.
4866 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4867 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4868 (Output_data_plt_i386::exec_plt_entry): Move to ...
4869 (Output_data_plt_i386_exec::plt_entry): ... here.
4870 (Output_data_plt_i386_dyn): New class.
4871 (Output_data_plt_i386::first_plt_entry): Move to ...
4872 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4873 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4874 (Output_data_plt_i386_dyn::plt_entry): ... here.
4875 (Target_i386::Target_i386): Take optional argument for the Target_info
4876 pointer to use.
4877 (Target_i386::do_make_data_plt): New virtual method.
4878 (Target_i386::make_data_plt): New method to call it.
4879 (Target_i386::make_plt_section): Use that.
4880 Call this->plt_->add_eh_frame method here.
4881 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4882 rather than plt_entry_size variable.
4883 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4884 (Output_data_plt_i386::address_for_local): Likewise.
4885 (Output_data_plt_i386::do_write): Likewise.
4886 Move guts of PLT filling to...
4887 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4888 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4889 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4890 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4891
4892 2012-05-01 Cary Coutant <ccoutant@google.com>
4893
4894 * dwarf_reader.cc (Dwarf_die::read_attributes)
4895 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4896 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4897 * reduced_debug_output.cc
4898 (Output_reduced_debug_info_section::get_die_end): Remove
4899 DW_FORM_GNU_ref_index. Add default case.
4900
4901 2012-04-26 Mark Wielaard <mjw@redhat.com>
4902
4903 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4904 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4905 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4906 DW_AT_high_pc as offset from DW_AT_low_pc.
4907
4908 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4909 * testsuite/Makefile.in: Regenerate.
4910 * testsuite/gdb_index_test_3.c: New test source file.
4911 * testsuite/gdb_index_test_3.sh: New test source file.
4912
4913 2012-04-25 Ian Lance Taylor <iant@google.com>
4914
4915 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4916 pointer.
4917 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4918 as a class, not a struct.
4919 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4920 (Target_arm::apply_cortex_a8_workaround): Likewise.
4921 * gc.h: Declare Reloc_types as a struct, not a class.
4922 * object.h: Declare Symbols_data as a struct.
4923 * reloc.h: Declare Read_relocs_data as a struct.
4924 * target.h: Declare Relocate_info as a struct.
4925
4926 2012-04-24 David S. Miller <davem@davemloft.net>
4927
4928 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4929 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4930 and R_SPARC_WPLT30.
4931
4932 2012-04-24 Cary Coutant <ccoutant@google.com>
4933
4934 * incremental-dump.cc (find_input_containing_global): Replace
4935 magic number with symbolic constant.
4936 (dump_incremental_inputs): Update version number.
4937 * incremental.cc (Output_section_incremental_inputs): Update version
4938 number; import symbolic constants from Incremental_inputs_reader.
4939 (Incremental_inputs::create_data_sections): Align relocations
4940 section correctly for 64-bit targets.
4941 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4942 constants; add padding.
4943 (Output_section_incremental_inputs::write_header): Add assert for
4944 header_size.
4945 (Output_section_incremental_inputs::write_input_files): Add assert
4946 for input_entry_size.
4947 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4948 add assert for object_info_size, input_section_entry_size,
4949 global_sym_entry_size.
4950 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4951 for data structure sizes; use them.
4952 (Incremental_input_entry_reader): Import symbolic constants from
4953 Incremental_inputs_reader; use them.
4954
4955 2012-04-23 David S. Miller <davem@davemloft.net>
4956
4957 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4958 and elf_flags_set_.
4959 (Target_sparc::Target_sparc): Initialize new fields.
4960 (Target_sparc::do_make_elf_object): New function.
4961 (Target_sparc::do_adjust_elf_header): New function.
4962
4963 2012-04-23 Cary Coutant <ccoutant@google.com>
4964
4965 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4966 CU range table of gdb index.
4967
4968 2012-04-20 David S. Miller <davem@davemloft.net>
4969
4970 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4971 instead of false.
4972
4973 2012-04-16 David S. Miller <davem@davemloft.net>
4974
4975 * sparc.cc (Target_sparc::got_address): New function.
4976 (Sparc_relocate_functions::gdop_hix22): New function.
4977 (Sparc_relocate_functions::gdop_lox10): New function.
4978 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4979 relocs.
4980 (Target_sparc::Scan::local): Likewise if the global symbol is not
4981 preemptible and is not IFUNC.
4982 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4983 transformations for local and non-preemptible non-IFUNC global
4984 symbols.
4985
4986 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4987 writing out 64-bit part of ranges.
4988
4989 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4990 -fpic and -fpie respectively.
4991 * Makefile.in: Regenerate.
4992
4993 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4994 (Target_sparc::Target_sparc): Initialize new field.
4995 (Target_sparc::do_plt_section_for_global): New function.
4996 (Target_sparc::do_plt_section_for_local): New function.
4997 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4998 (Target_sparc::make_plt_section): New function, broken out of
4999 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5000 (Target_sparc::make_plt_entry): Call make_plt_section.
5001 (Target_sparc::make_local_ifunc_plt_entry): New function.
5002 (Target_sparc::rela_ifunc_section): New function.
5003 (Target_sparc::plt_section): Remove const.
5004 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5005 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5006 and ifunc_count_ fields.
5007 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5008 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5009 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5010 (Output_data_plt_sparc::rela_ifunc): New function.
5011 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5012 (Output_data_plt_sparc::has_ifunc_section): New function.
5013 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5014 (Output_data_plt_sparc::address_for_global): New function.
5015 (Output_data_plt_sparc::address_for_local): New function.
5016 (Output_data_plt_sparc::plt_index_to_offset): New function.
5017 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5018 and entry_count.
5019 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5020 entry_count.
5021 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5022 R_SPARC_JMP_IREL to switch.
5023 (Target_sparc::Scan::check_non_pic): Likewise.
5024 (Target_sparc::Scan::local): Handle IFUNC symbols.
5025 (Target_sparc::Scan::local): Likewise.
5026 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5027 and plt_address_for_local.
5028 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5029 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5030
5031 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5032 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5033 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5034 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5035 global relocs too.
5036 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5037 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5038 calls.
5039 * sparc.cc (Target_sparc::Scan::global): Likewise.
5040 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5041
5042 2012-04-16 Cary Coutant <ccoutant@google.com>
5043
5044 * archive.cc (Library_base::should_include_member): Check for
5045 --export-dynamic-symbol.
5046 * options.h (class General_options): Add --export-dynamic-symbol.
5047 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5048 --export-dynamic-symbol.
5049 (Symbol_table::gc_mark_undef_symbols): Likewise.
5050 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5051
5052 2012-04-12 David S. Miller <davem@davemloft.net>
5053
5054 * sparc.cc (Reloc::wdisp10): New relocation method.
5055 (Reloc::h34): Likewise.
5056 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5057 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5058 R_SPARC_WDISP10.
5059 (Target_sparc::Scan::local): Likewise.
5060 (Target_sparc::Scan::global): Likewise.
5061 (Target_sparc::Relocate::relocate): Likewise.
5062
5063 2012-04-09 Cary Coutant <ccoutant@google.com>
5064
5065 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5066 low_pc == 0.
5067
5068 2012-04-06 Ian Lance Taylor <iant@google.com>
5069
5070 * timer.cc: #include <unistd.h>.
5071
5072 2012-04-06 Roland McGrath <mcgrathr@google.com>
5073
5074 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5075 * config.in: Regenerate.
5076 * configure: Regenerate.
5077
5078 2012-04-05 Nick Clifton <nickc@redhat.com>
5079
5080 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5081 (AM_LC_MESSAGES): Add.
5082 * aclocal.m4: Regenerate.
5083 * config.in: Regenerate.
5084 * configure: Regenerate.
5085
5086 2012-03-21 Cary Coutant <ccoutant@google.com>
5087
5088 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5089 * Makefile.in: Regenerate.
5090 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5091 (Sized_elf_reloc_mapper::symbol_section): New function.
5092 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5093 (make_elf_reloc_mapper): New function.
5094 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5095 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5096 (Dwarf_abbrev_table::do_get_abbrev): New function.
5097 (Dwarf_ranges_table::read_ranges_table): New function.
5098 (Dwarf_ranges_table::read_range_list): New function.
5099 (Dwarf_pubnames_table::read_section): New function.
5100 (Dwarf_pubnames_table::read_header): New function.
5101 (Dwarf_pubnames_table::next_name): New function.
5102 (Dwarf_die::Dwarf_die): New function.
5103 (Dwarf_die::read_attributes): New function.
5104 (Dwarf_die::skip_attributes): New function.
5105 (Dwarf_die::set_name): New function.
5106 (Dwarf_die::set_linkage_name): New function.
5107 (Dwarf_die::attribute): New function.
5108 (Dwarf_die::string_attribute): New function.
5109 (Dwarf_die::int_attribute): New function.
5110 (Dwarf_die::uint_attribute): New function.
5111 (Dwarf_die::ref_attribute): New function.
5112 (Dwarf_die::child_offset): New function.
5113 (Dwarf_die::sibling_offset): New function.
5114 (Dwarf_info_reader::check_buffer): New function.
5115 (Dwarf_info_reader::parse): New function.
5116 (Dwarf_info_reader::do_parse): New function.
5117 (Dwarf_info_reader::do_read_string_table): New function.
5118 (Dwarf_info_reader::lookup_reloc): New function.
5119 (Dwarf_info_reader::get_string): New function.
5120 (Dwarf_info_reader::visit_compilation_unit): New function.
5121 (Dwarf_info_reader::visit_type_unit): New function.
5122 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5123 Sized_elf_reloc_mapper.
5124 (Sized_dwarf_line_info::symbol_section): Remove function.
5125 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5126 (Sized_dwarf_line_info::read_line_mappings): Remove object
5127 parameter, adjust callers.
5128 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5129 * dwarf_reader.h: Include <sys/types.h>.
5130 (class Track_relocs): Remove forward declaration.
5131 (class Elf_reloc_mapper): New class.
5132 (class Sized_elf_reloc_mapper): New class.
5133 (class Dwarf_abbrev_table): New class.
5134 (class Dwarf_range_list): New class.
5135 (class Dwarf_ranges_table): New class.
5136 (class Dwarf_pubnames_table): New class.
5137 (class Dwarf_die): New class.
5138 (class Dwarf_info_reader): New class.
5139 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5140 (Sized_dwarf_line_info::symbol_section): Remove member function.
5141 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5142 base class.
5143 * gdb-index.cc: New source file.
5144 * gdb-index.h: New source file.
5145 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5146 and .debug_types sections, call Layout::add_to_gdb_index.
5147 (Sized_relobj_incr::do_section_name): Implement.
5148 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5149 return type; Implement.
5150 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5151 return type.
5152 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5153 parameter list and return type.
5154 (Sized_incr_dynobj::do_section_contents): Likewise.
5155 * layout.cc: Include gdb-index.h.
5156 (Layout::Layout): Initialize gdb_index_data_.
5157 (Layout::init_fixed_output_section): Check for .gdb_index section.
5158 (Layout::add_to_gdb_index): New function. Instantiate.
5159 * layout.h: Add forward declaration for class Gdb_index.
5160 (Layout::add_to_gdb_index): New member function.
5161 (Layout::gdb_index_data_): New data member.
5162 * main.cc: Include gdb-index.h.
5163 (main): Print statistics for gdb index.
5164 * object.cc (Object::section_contents): Move code into
5165 do_section_contents.
5166 (need_decompressed_section): Check for sections needed when building
5167 gdb index.
5168 (build_compressed_section_map): Likewise.
5169 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5170 gdb index.
5171 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5172 sections; call Layout::add_to_gdb_index.
5173 (Sized_relobj_file::do_decompressed_section_contents): Call
5174 do_section_contents directly.
5175 * object.h (Object::do_section_contents): Adjust parameter list and
5176 return type.
5177 (Object::do_decompressed_section_contents): Call do_section_contents
5178 directly.
5179 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5180 return type.
5181 * options.h (class General_options): Add --gdb-index option.
5182 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5183 list and return type.
5184 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5185 * reloc.h (Track_relocs::checkpoint): New function.
5186 (Track_relocs::reset): New function.
5187
5188 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5189 New test cases.
5190 * testsuite/Makefile.in: Regenerate.
5191 * testsuite/gdb_index_test.cc: New test source file.
5192 * testsuite/gdb_index_test_1.sh: New test source file.
5193 * testsuite/gdb_index_test_2.sh: New test source file.
5194
5195 2012-03-19 Doug Kwan <dougkwan@google.com>
5196
5197 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5198 (Target_arm::do_finalize_sections): Remove code which defines
5199 __exidx_start and __exidx_end. Make symbol table parameter
5200 anonymous as it is not used.
5201 * gold.cc (queue_middle_tasks): Call target hook to define any
5202 target-specific symbols.
5203 * target.h (Target::define_standard_symbols): New method.
5204 (Target::do_define_standard_symbols): Same.
5205 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5206 * testsuite/Makefile.in: Regenerate.
5207 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5208 and __exidx_end.
5209 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5210 relocations are generated for __exidx_start and __exidx_end.
5211
5212 2012-03-16 Doug Kwan <dougkwan@google.com>
5213
5214 * testsuite/Makefile.am: Disable test initpri3b.
5215 * testsuite/Makefile.in: Regenerate.
5216
5217 2012-03-15 Doug Kwan <dougkwan@google.com>
5218
5219 * arm.cc (Target_arm::got_section): Make .got section read-only
5220 if -z now is given.
5221
5222 2012-03-15 Ian Lance Taylor <iant@google.com>
5223
5224 PR gold/13850
5225 * layout.cc (Layout::make_output_section): Correctly mark
5226 SHT_INIT_ARRAY, et. al., as relro.
5227
5228 2012-03-14 Doug Kwan <dougkwan@google.com>
5229
5230 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5231 dynamic relocations for protected symbols in shared objects.
5232
5233 2012-03-13 Ian Lance Taylor <iant@google.com>
5234
5235 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5236 keep the larger alignment.
5237
5238 2012-03-12 Cary Coutant <ccoutant@google.com>
5239
5240 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5241 handling of DW_LNE_define_file.
5242
5243 2012-03-12 Cary Coutant <ccoutant@google.com>
5244
5245 * reduced_debug_output.cc
5246 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5247 codes to switch.
5248
5249 2012-02-29 Cary Coutant <ccoutant@google.com>
5250
5251 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5252
5253 2012-02-29 Cary Coutant <ccoutant@google.com>
5254
5255 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5256 Call Object::decompressed_section_contents.
5257 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5258 New dtor.
5259 (Sized_dwarf_line_info::buffer_start_): New data member.
5260 * merge.cc (Output_merge_data::do_add_input_section): Call
5261 Object::decompressed_section_contents.
5262 (Output_merge_string::do_add_input_section): Likewise.
5263 * object.cc (need_decompressed_section): New function.
5264 (build_compressed_section_map): Decompress sections needed later.
5265 (Sized_relobj_file::do_decompressed_section_contents): New function.
5266 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5267 * object.h (Object::decompressed_section_contents): New function.
5268 (Object::discard_decompressed_sections): New function.
5269 (Object::do_decompressed_section_contents): New function.
5270 (Object::do_discard_decompressed_sections): New function.
5271 (Compressed_section_info): New type.
5272 (Compressed_section_map): Include decompressed section contents.
5273 (Sized_relobj_file::do_decompressed_section_contents): New function.
5274 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5275
5276 2012-02-16 Cary Coutant <ccoutant@google.com>
5277
5278 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5279 * testsuite/Makefile.in: Regenerate.
5280
5281 2012-02-14 Cary Coutant <ccoutant@google.com>
5282
5283 * options.cc (General_options::finalize): Disallow -pie and -static.
5284
5285 2012-02-03 Doug Kwan <dougkwan@google.com>
5286
5287 * arm.cc (Arm_relocate_functions::abs8,
5288 Arm_relocate_functions::abs16): Use
5289 Bits::has_signed_unsigned_overflow32.
5290 (Arm_relocate_functions::thm_abs8): Correct range of
5291 overflow check.
5292 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5293 in assertions.
5294
5295 2012-02-02 Doug Kwan <dougkwan@google.com>
5296
5297 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5298 position independent outputs, not just shared objects.
5299
5300 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5301
5302 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5303 * configure: Regenerated.
5304
5305 2012-01-27 Ian Lance Taylor <iant@google.com>
5306
5307 * reloc.h (Bits): New class with static functions, copied from
5308 namespace utils in arm.cc.
5309 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5310 instead.
5311
5312 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5313
5314 * incremental.cc (write_info_blocks): Correct relocation offset.
5315
5316 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5317
5318 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5319 (Relocate::tls_gd_to_le): Likewise.
5320
5321 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5322
5323 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5324
5325 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5326
5327 * configure.ac: Check if -mcmodel=medium works.
5328 * configure: Regenerated.
5329
5330 2012-01-24 Cary Coutant <ccoutant@google.com>
5331
5332 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5333 definition and ...
5334 (read_unsigned_LEB_128_x): ... this new function.
5335 (read_signed_LEB_128): Replaced with inline definition and ...
5336 (read_signed_LEB_128_x): ... this new function.
5337 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5338 (read_unsigned_LEB_128): Add inline definition.
5339 (read_signed_LEB_128_x): New function.
5340 (read_signed_LEB_128): Add inline definition.
5341 * testsuite/Makefile.am (leb128_unittest): New unit test.
5342 * testsuite/Makefile.in: Regenerate.
5343 * testsuite/leb128_unittest.cc: New unit test.
5344
5345 2012-01-23 Ian Lance Taylor <iant@google.com>
5346
5347 PR gold/13617
5348 * i386.cc (Target_i386::do_code_fill): When using a jmp
5349 instruction, pad with nop instructions.
5350 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5351
5352 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5353
5354 * x86_64.cc (gc_process_relocs): Add typename on types used in
5355 template.
5356 (scan_relocs): Likewise.
5357 (relocate_section): Likewise.
5358 (apply_relocation): Likewise.
5359
5360 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5361
5362 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5363 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5364 under x32.
5365
5366 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5367
5368 * x86_64.cc: Initial support for x32.
5369
5370 2012-01-03 Cary Coutant <ccoutant@google.com>
5371
5372 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5373 Use abstract base class for GOT.
5374 * gold/output.h (class Output_data_got_base): New abstract base class.
5375 (class Output_data_got): Derive from new base class, adjust ctors.
5376 (Output_data_got::reserve_slot): Make virtual; rename to
5377 do_reserve_slot; Adjust callers.
5378 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5379 pointer to abstract base class.
5380 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5381
5382 2011-12-18 Ian Lance Taylor <iant@google.com>
5383
5384 * object.h (Relobj::local_symbol_value): New function.
5385 (Relobj::local_plt_offset): New function.
5386 (Relobj::local_has_got_offset): New function.
5387 (Relobj::local_got_offset): New function.
5388 (Relobj::set_local_got_offset): New function.
5389 (Relobj::do_local_symbol_value): New pure virtual function.
5390 (Relobj::do_local_plt_offset): Likewise.
5391 (Relobj::do_local_has_got_offset): Likewise.
5392 (Relobj::do_local_got_offset): Likewise.
5393 (Relobj::do_set_local_got_offset): Likewise.
5394 (Sized_relobj::do_local_has_got_offset): Rename from
5395 local_has_got_offset.
5396 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5397 (Sized_relobj::do_set_local_got_offset): Rename from
5398 set_local_got_offset.
5399 (Sized_relobj_file::do_local_plt_offset): Rename from
5400 local_plt_offset.
5401 (Sized_relobj_file::do_local_symbol_value): New function.
5402 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5403 local_plt_offset.
5404 * output.cc (Output_data_got::Got_entry::write): Change object to
5405 Relobj. Use local_symbol_value.
5406 (Output_data_got::add_global_with_rel): Change rel_dyn to
5407 Output_data_reloc_generic*. Use add_global_generic.
5408 (Output_data_got::add_global_with_rela): Remove. Change all
5409 callers to use add_global_with_rel.
5410 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5411 Output_data_reloc_generic*. Use add_global_generic.
5412 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5413 callers to use add_global_pair_with_rel.
5414 (Output_data_got::add_local): Change object to Relobj*.
5415 (Output_data_got::add_local_plt): Likewise.
5416 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5417 change rel_dyn to Output_data_reloc_generic*. Use
5418 add_local_generic.
5419 (Output_data_got::add_local_with_rela): Remove. Change all
5420 callers to use all_local_with_rel.
5421 (Output_data_got::add_local_pair_with_rel): Change object to
5422 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5423 add_output_section_generic.
5424 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5425 callers to use add_local_pair_with_rel.
5426 (Output_data_got::reserve_local): Change object to Relobj*.
5427 * output.h: (class Output_data_reloc_generic): Add pure virtual
5428 declarations for add_global_generic, add_local_generic,
5429 add_output_section_generic.
5430 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5431 functions for Output_data_reloc_generic. Update declarations for
5432 changes listed in output.cc.
5433 (class Output_data_got): Change template parameter to got_size.
5434 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5435 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5436 function.
5437 (Sized_relobj_incr::do_local_plt_offset): New function.
5438 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5439 add_global_generic.
5440
5441 2011-12-17 Cary Coutant <ccoutant@google.com>
5442
5443 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5444 * resolve.cc (Symbol_table::resolve): Likewise.
5445 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5446 arrays.
5447 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5448
5449 2011-12-16 Ian Lance Taylor <iant@google.com>
5450
5451 * output.h (Output_data_reloc_generic::add): Only call
5452 add_dynamic_reloc if this is a dynamic reloc section.
5453
5454 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5455
5456 PR gold/13505
5457 * target-reloc.h (apply_relocation): Replace <64, false> with
5458 <size, big_endian>.
5459
5460 2011-11-25 Nick Clifton <nickc@redhat.com>
5461
5462 * po/it.po: New Italian translation.
5463
5464 2011-11-17 Sterling Augustine <saugustine@google.com>
5465
5466 * script.cc (script_include_directive): Implement.
5467 (read_script_file): New local variables name and search_path. Update
5468 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5469 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5470 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5471
5472 2011-11-11 Sterling Augustine <saugustine@google.com>
5473
5474 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5475 (file_or_sections_cmd): Likewise.
5476
5477 2011-11-11 Doug Kwan <dougkwan@google.com>
5478
5479 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5480 if --just-symbols is given.
5481
5482 2011-11-10 Doug Kwan <dougkwan@google.com>
5483
5484 PR gold/13362
5485 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5486 when processing data relocs.
5487 * reloc.h (Relocate_functions::rel_unaligned): New method.
5488 (Relocate_functions::pcrel_unaligned): Ditto.
5489 (Relocate_functions::rel32_unaligned): Ditto.
5490 (Relocate_functions::pcrel32_unaligned): Ditto.
5491
5492 2011-11-09 Doug Kwan <dougkwan@google.com>
5493
5494 PR gold/13362
5495 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5496 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5497 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5498 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5499 (Relocate_functions::rel_unaligned): New.
5500 (Relocate_functions::rel32_unaligned): New.
5501 * target-reloc.h (relocate_for_relocatable): Add code to handle
5502 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5503 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5504 arm_unaligned_reloc_r): New targets.
5505 * testsuite/Makefile.in: Regenerate.
5506 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5507 linking.
5508
5509 2011-11-02 Ian Lance Taylor <iant@google.com>
5510
5511 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5512 NATIVE_LINKER.
5513 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5514 * options.cc (General_options::finalize): Use library search path
5515 from configure script if specified. If not native and no sysroot,
5516 only search TOOLLIBDIR.
5517 * options.h (Search_directory::Search_directory): Change name to
5518 const std::string&.
5519 (General_options::add_to_library_path_with_sysroot): Change arg to
5520 const std::string&.
5521 * configure, Makefile.in, config.in: Rebuild.
5522
5523 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5524
5525 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5526 we are working around the ARM1176 Erratum.
5527 * options.h (General_options::fix_arm1176): Add option.
5528 * testsuite/Makefile.am: Add testcases, and keep current ones
5529 working.
5530 * testsuite/Makefile.in: Regenerate.
5531 * testsuite/arm_fix_1176.s: New file.
5532 * testsuite/arm_fix_1176.sh: Likewise.
5533
5534 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5535
5536 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5537 may_use_blx_.
5538 (Target_arm::may_use_blx): Remove method.
5539 (Target_arm::set_may_use_blx): Likewise.
5540 (Target_arm::may_use_v4t_interworking): New method.
5541 (Target_arm::may_use_v5t_interworking): Likewise.
5542 (Target_arm::may_use_blx_): Remove member variable.
5543 (Arm_relocate_functions::arm_branch_common): Check for v5T
5544 interworking.
5545 (Arm_relocate_functions::thumb_branch_common): Likewise.
5546 (Reloc_stub::stub_type_for_reloc): Likewise.
5547 (Target_arm::do_finalize_sections): Correct interworking checks.
5548 * testsuite/Makefile.am: Add new tests.
5549 * testsuite/Makefile.in: Regenerate.
5550 * testsuite/arm_farcall_arm_arm.s: New test.
5551 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5552 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5553 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5554 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5555 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5556 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5557 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5558
5559 2011-10-31 Cary Coutant <ccoutant@google.com>
5560
5561 PR gold/13023
5562 * expression.cc (Expression::eval_with_dot): Add
5563 is_section_dot_assignment parameter.
5564 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5565 absolute and assigning to dot within a section.
5566 * script-sections.cc
5567 (Output_section_element_assignment::set_section_addresses): Pass
5568 dot_section to set_if_absolute.
5569 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5570 as is_section_dot_assignment flag to eval_with_dot.
5571 (Output_section_element_dot_assignment::set_section_addresses):
5572 Likewise.
5573 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5574 parameter. Also set value if relative to dot_section; set the
5575 symbol's output_section.
5576 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5577 parameter. Adjust all callers.
5578 (Expression::eval_maybe_dot): Likewise.
5579 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5580 Adjust all callers.
5581 * testsuite/script_test_2.t: Test assignment of an absolute value
5582 to dot within an output section element.
5583
5584 2011-10-31 Cary Coutant <ccoutant@google.com>
5585
5586 * options.h (class General_options): Add --[no-]gnu-unique options.
5587 * symtab.cc (Symbol_table::sized_write_globals): Convert
5588 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5589
5590 2011-10-31 Cary Coutant <ccoutant@google.com>
5591
5592 PR gold/13359
5593 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5594 unnecessary assertion.
5595 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5596
5597 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5598
5599 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5600 gc_mark_symbol.
5601 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5602 gc_mark_symbol.
5603 Change to just keep the section associated with symbol.
5604 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5605 they are externally visible and --export-dynamic is turned on.
5606 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5607
5608 2011-10-19 Ian Lance Taylor <iant@google.com>
5609
5610 PR gold/13163
5611 * script-sections.cc
5612 (Output_section_element_dot_assignment::needs_output_section): New
5613 function.
5614
5615 2011-10-19 Ian Lance Taylor <iant@google.com>
5616
5617 PR gold/13204
5618 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5619 --section-start option was seen.
5620 * options.h (General_options::any_section_start): New function.
5621
5622 2011-10-18 David S. Miller <davem@davemloft.net>
5623
5624 PR binutils/13301
5625 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5626 member to track relocation locations that have moved during TLS
5627 reloc optimizations.
5628 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5629 (Target_sparc::Relocate::relocate): Adjust view down by 4
5630 bytes if it matches reloc_adjust_addr_.
5631 (Target_sparc::Relocate::relocate_tls): Always move the
5632 __tls_get_addr call delay slot instruction forward 4 bytes when
5633 performing relaxation.
5634
5635 2011-10-18 Cary Coutant <ccoutant@google.com>
5636
5637 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5638 (Output_file::map_no_anonymous): Check for non-zero
5639 return code from posix_fallocate.
5640
5641 2011-10-17 Cary Coutant <ccoutant@google.com>
5642
5643 PR gold/13245
5644 * plugin.cc (is_visible_from_outside): Check for symbols
5645 referenced from dynamic objects.
5646 * resolve.cc (Symbol_table::resolve): Don't count references
5647 from dynamic objects as references from real ELF files.
5648 * testsuite/plugin_test_2.sh: Adjust expected result.
5649
5650 2011-10-17 Cary Coutant <ccoutant@google.com>
5651
5652 * gold.cc: Include timer.h.
5653 (queue_middle_tasks): Stamp time.
5654 (queue_final_tasks): Likewise.
5655 * main.cc (main): Store timer in parameters. Print timers
5656 for each pass.
5657 * parameters.cc (Parameters::Parameters): Initialize timer_.
5658 (Parameters::set_timer): New function.
5659 (set_parameters_timer): New function.
5660 * parameters.h (Parameters::set_timer): New function.
5661 (Parameters::timer): New function.
5662 (Parameters::timer_): New data member.
5663 (set_parameters_timer): New function.
5664 * timer.cc (Timer::stamp): New function.
5665 (Timer::get_pass_time): New function.
5666 * timer.h (Timer::stamp): New function.
5667 (Timer::get_pass_time): New function.
5668 (Timer::pass_times_): New data member.
5669
5670 2011-10-17 Cary Coutant <ccoutant@google.com>
5671
5672 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5673 task for members of lib groups.
5674
5675 2011-10-17 Cary Coutant <ccoutant@google.com>
5676
5677 PR gold/13288
5678 * fileread.cc (File_read::find_view): Add assert.
5679 (File_read::make_view): Move bounds check (replace with assert)...
5680 (File_read::find_or_make_view): ... to here.
5681
5682 2011-10-12 Cary Coutant <ccoutant@google.com>
5683
5684 * output.cc (Output_file::open_base_file): Handle case where
5685 ::read returns less than requested size.
5686
5687 2011-10-10 Cary Coutant <ccoutant@google.com>
5688
5689 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5690 Initialize defined_count_.
5691 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5692 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5693 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5694 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5695 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5696 * incremental.h (Sized_relobj_incr::defined_count_): New data
5697 member.
5698 (Sized_incr_dynobj::defined_count_): New data member.
5699 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5700 Return zeroes instead of internal error.
5701
5702 2011-10-10 Cary Coutant <ccoutant@google.com>
5703
5704 PR gold/13249
5705 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5706 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5707 * output.h (class Output_reloc): Add use_plt_offset flag.
5708 (Output_reloc::type_): Adjust size of bit field.
5709 (Output_reloc::use_plt_offset_): New bit field.
5710 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5711 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5712 flag. Adjust all callers.
5713 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5714 creating RELATIVE relocations.
5715
5716 2011-10-10 Nick Clifton <nickc@redhat.com>
5717
5718 * po/es.po: Updated Spanish translation.
5719 * po/fi.po: Updated Finnish translation.
5720
5721 2011-10-03 Diego Novillo <dnovillo@google.com>
5722
5723 * options.cc (parse_uint): Fix dereference of RETVAL.
5724
5725 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5726
5727 * layout.h (section_order_map_): New member.
5728 (get_section_order_map): New member function.
5729 * output.cc (Output_section::add_input_section): Check for patterns
5730 only when --section-ordering-file is specified.
5731 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5732 output_sections have been formed.
5733 * layout.cc (Layout_Layout): Initialize section_order_map_.
5734 * plugin.cc (update_section_order): Store order in order_map. Do not
5735 update the order.
5736 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5737 * testsuite/Makefile.in: Regenerate.
5738 * testsuite/plugin_section_order.c: New file.
5739 * testsuite/plugin_final_layout.cc: New file.
5740 * testsuite/plugin_final_layout.sh: New file.
5741
5742 2011-09-29 Cary Coutant <ccoutant@google.com>
5743
5744 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5745 Check for NULL.
5746 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5747 symbols during incremental update.
5748 (Symbol_table::add_from_dynobj): Likewise.
5749
5750 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5751 Ian Lance Taylor <iant@google.com>
5752
5753 * symtab.cc (Symbol_table::define_special_symbol): Always
5754 canonicalize version string.
5755
5756 2011-09-26 Cary Coutant <ccoutant@google.com>
5757
5758 * gold.cc (queue_initial_tasks): Move option checks ...
5759 * options.cc (General_options::finalize): ... to here. Disable
5760 some options; make others fatal.
5761
5762 2011-09-26 Cary Coutant <ccoutant@google.com>
5763
5764 gcc PR lto/47247
5765 * plugin.cc (get_symbols_v2): New function.
5766 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5767 (is_referenced_from_outside): New function.
5768 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5769 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5770 (get_symbols): Pass version parameter.
5771 (get_symbols_v2): New function.
5772 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5773 parameter.
5774 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5775 (onload): Add LDPT_GET_SYMBOLS_V2.
5776 (all_symbols_read_hook): Use get_symbols_v2; check for
5777 LDPR_PREVAILING_DEF_IRONLY_EXP.
5778 * testsuite/plugin_test_3.sh: Update expected results.
5779
5780 2011-09-23 Simon Baldwin <simonb@google.com>
5781
5782 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5783 configuration options.
5784 * configure: Regenerate.
5785 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5786 * Makefile.in: Regenerate.
5787 * testsuite/Makefile.in: Regenerate.
5788
5789 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5790
5791 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5792
5793 2011-09-19 Cary Coutant <ccoutant@google.com>
5794
5795 * incremental.cc (can_incremental_update): Fix typo in comment.
5796 * incremental.h (can_incremental_update): Likewise.
5797
5798 2011-09-18 Cary Coutant <ccoutant@google.com>
5799
5800 * incremental.cc (can_incremental_update): New function.
5801 * incremental.h (can_incremental_update): New function.
5802 * layout.cc (Layout::init_fixed_output_section): Call it.
5803 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5804 * object.cc (Sized_relobj_file::do_layout): Call
5805 can_incremental_update.
5806
5807 2011-09-13 Cary Coutant <ccoutant@google.com>
5808
5809 * configure.ac: Check for glibc support for gnu_indirect_function
5810 support with static linking, setting automake conditional
5811 IFUNC_STATIC.
5812 * Makefile.in: Regenerate.
5813 * configure: Regenerate.
5814
5815 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5816 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5817 for IFUNC_STATIC.
5818 * testsuite/Makefile.in: Regenerate.
5819
5820 2011-09-13 Cary Coutant <ccoutant@google.com>
5821
5822 * incremental.cc (Sized_relobj_incr::do_layout): Call
5823 report_comdat_group for kept comdat sections.
5824 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5825 * testsuite/Makefile.in: Regenerate.
5826 * testsuite/incr_comdat_test_1.cc: New source file.
5827 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5828 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5829 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5830
5831 2011-09-13 Ian Lance Taylor <iant@google.com>
5832
5833 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5834 variable external_symbols_offset.
5835
5836 2011-09-12 Ian Lance Taylor <iant@google.com>
5837
5838 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5839 triggered if object has no symbols.
5840
5841 2011-09-09 David S. Miller <davem@davemloft.net>
5842
5843 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5844 (Output_fill_debug_line::do_write): Likewise.
5845
5846 2011-08-29 Cary Coutant <ccoutant@google.com>
5847
5848 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5849 casts to match formatting specs.
5850 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5851
5852 2011-08-26 Cary Coutant <ccoutant@google.com>
5853
5854 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5855 remaining hole size when allocating.
5856 (Layout::make_output_section): Set fill methods for debug sections.
5857 * layout.h (Free_list::Free_list_node): Move from private to
5858 public.
5859 (Free_list::set_min_hole_size): New function.
5860 (Free_list::begin, Free_list::end): New functions.
5861 (Free_list::min_hole_): New data member.
5862 * output.cc: Include dwarf.h.
5863 (Output_fill_debug_info::do_minimum_hole_size): New function.
5864 (Output_fill_debug_info::do_write): New function.
5865 (Output_fill_debug_line::do_minimum_hole_size): New function.
5866 (Output_fill_debug_line::do_write): New function.
5867 (Output_section::Output_section): Initialize new data member.
5868 (Output_section::set_final_data_size): Ensure patch space is larger
5869 than minimum hole size.
5870 (Output_section::do_write): Fill holes in debug sections.
5871 * output.h (Output_fill): New class.
5872 (Output_fill_debug_info): New class.
5873 (Output_fill_debug_line): New class.
5874 (Output_section::set_free_space_fill): New function.
5875 (Output_section::free_space_fill_): New data member.
5876 * testsuite/Makefile.am (incremental_test_3): Add
5877 --incremental-patch option.
5878 (incremental_test_4): Likewise.
5879 (incremental_test_5): Likewise.
5880 (incremental_test_6): Likewise.
5881 (incremental_copy_test): Likewise.
5882 (incremental_common_test_1): Likewise.
5883 * testsuite/Makefile.in: Regenerate.
5884
5885 2011-08-26 Nick Clifton <nickc@redhat.com>
5886
5887 * po/es.po: Updated Spanish translation.
5888
5889 2011-08-01 Cary Coutant <ccoutant@google.com>
5890
5891 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5892 * gold/testsuite/Makefile.in: Regenerate.
5893 * gold/testsuite/justsyms_exec.c: New source file.
5894 * gold/testsuite/justsyms_lib.c: New source file.
5895
5896 2011-08-01 Cary Coutant <ccoutant@google.com>
5897
5898 * layout.cc (Layout::set_segment_offsets): Don't realign text
5899 segment if -Ttext was specified.
5900 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5901 file type.
5902 * object.h (Sized_relobj_file::e_type): New function.
5903 (Sized_relobj_file::e_type_): New data member.
5904 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5905 base address for ET_EXEC files.
5906 * target.cc (Target::do_make_elf_object_implementation): Allow
5907 ET_EXEC files with --just-symbols option.
5908
5909 2011-07-28 Cary Coutant <ccoutant@google.com>
5910
5911 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5912 Add thread_number parameter.
5913 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5914 * workqueue-threads.cc
5915 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5916 current thread if its thread number is greater than desired thread
5917 count.
5918 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5919 Add thread_number parameter.
5920 (Workqueue::should_cancel_thread): Likewise.
5921 (Workqueue::find_runnable_or_wait): Pass thread_number to
5922 should_cancel_thread.
5923 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5924 parameter.
5925
5926 2011-07-22 Sriraman Tallam <tmsriram@google.com>
5927
5928 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5929 only after checking if it cannot be forced local.
5930 * symtab.h (is_externally_visible): Check if the symbol is not forced
5931 local.
5932
5933 2011-07-15 Ian Lance Taylor <iant@google.com>
5934
5935 * options.h (class General_options): Add --print-output-format.
5936 Move -EL next to -EB, for better --help output.
5937 * target-select.cc: Include <cstdio>, "options.h", and
5938 "parameters.h".
5939 (Target_selector::do_target_bfd_name): New function.
5940 (print_output_format): New function.
5941 * target-select.h (class Target_selector): Update declarations.
5942 (Target_selector::target_bfd_name): New function.
5943 (print_output_format): Declare.
5944 * main.cc: Include "target-select.h".
5945 (main): Handle --print-output-format.
5946 * gold.cc: Include "target-select.h".
5947 (queue_initial_tasks): Handle --print-output-format when there are
5948 no input files.
5949 * parameters.cc (parameters_force_valid_target): Give a better
5950 error message if -EB/-EL does not match target.
5951 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5952 function.
5953
5954 2011-07-15 Ian Lance Taylor <iant@google.com>
5955
5956 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5957 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5958 (Output_data_plt_i386::do_write): Write address of .dynamic
5959 section to first entry in .got.plt section.
5960 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5961 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5962 Initialize layout_.
5963 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5964 section to first entry in .got.plt section.
5965 * layout.h (Layout::dynamic_section): New function.
5966
5967 2011-07-13 Sriraman Tallam <tmsriram@google.com>
5968
5969 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5970 to claim_file call.
5971 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5972 input_section_position_, and input_section_glob_.
5973 (read_layout_from_file): Call function section_ordering_specified.
5974 * layout.h (is_section_ordering_specified): New function.
5975 (section_ordering_specified): New function.
5976 (section_ordering_specified_): New boolean member.
5977 * main.cc(main): Call load_plugins after layout object is defined.
5978 * output.cc (Output_section::add_input_section): Use
5979 function section_ordering_specified to check if section ordering is
5980 needed.
5981 * output.cc (Output_section::add_relaxed_input_section): Use
5982 function section_ordering_specified to check if section ordering is
5983 needed.
5984 (Output_section::update_section_layout): New function.
5985 (Output_section::sort_attached_input_sections): Check if input section
5986 must be reordered.
5987 * output.h (Output_section::update_section_layout): New function.
5988 * plugin.cc (get_section_count): New function.
5989 (get_section_type): New function.
5990 (get_section_name): New function.
5991 (get_section_contents): New function.
5992 (update_section_order): New function.
5993 (allow_section_ordering): New function.
5994 (Plugin::load): Add the new interfaces to the transfer vector.
5995 (Plugin_manager::load_plugins): New parameter.
5996 (Plugin_manager::all_symbols_read): New parameter.
5997 (Plugin_manager::claim_file): New parameter. Save the elf object for
5998 unclaimed objects.
5999 (Plugin_manager::get_elf_object): New function.
6000 (Plugin_manager::get_view): Change to directly use the bool to check
6001 if get_view is called from claim_file_hook.
6002 * plugin.h (input_objects): New function
6003 (Plugin__manager::load_plugins): New parameter.
6004 (Plugin_manager::claim_file): New parameter.
6005 (Plugin_manager::get_elf_object): New function.
6006 (Plugin_manager::in_claim_file_handler): New function.
6007 (Plugin_manager::in_claim_file_handler_): New member.
6008 (layout): New function.
6009 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6010 handler with an extra parameter. Make the elf object before calling
6011 claim_file handler.
6012 * testsuite/plugin_test.c (get_section_count): New function pointer.
6013 (get_section_type): New function pointer.
6014 (get_section_name): New function pointer.
6015 (get_section_contents): New function pointer.
6016 (update_section_order): New function pointer.
6017 (allow_section_ordering): New function pointer.
6018 (onload): Check if the new interfaces exist.
6019
6020 2011-07-13 Ian Lance Taylor <iant@google.com>
6021
6022 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6023 relro section.
6024 * x86_64.cc (Target_x86_64::got_section): Likewise.
6025 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6026 (relro_now_test_SOURCES): New variable.
6027 (relro_now_test_DEPENDENCIES): New variable.
6028 (relro_now_test_LDFLAGS): New variable.
6029 (relro_now_test_LDADD): New variable.
6030 (relro_now_test.so): New target.
6031 * testsuite/Makefile.in: Rebuild.
6032
6033 2011-07-12 Ian Lance Taylor <iant@google.com>
6034
6035 PR gold/12980
6036 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6037 GLOB_DAT relocation rather than a RELATIVE relocation for a
6038 protected symbol when creating a shared library.
6039 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6040 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6041 * testsuite/protected_main_1.cc (main): Test that protected
6042 function has same address.
6043
6044 2011-07-11 Ian Lance Taylor <iant@google.com>
6045
6046 PR gold/12979
6047 * options.h (class General_options): Add -Bgroup.
6048 * options.cc (General_options::finalize): If -Bgroup is set,
6049 default to --unresolved-symbols=report-all.
6050 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6051 * target-reloc.h (issue_undefined_symbol_error): Handle
6052 --unresolved-symbols=report-all.
6053
6054 2011-07-08 Ian Lance Taylor <iant@google.com>
6055
6056 PR gold/11985
6057 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6058 if linker script discards key sections.
6059 (Layout::create_dynamic_symtab): Likewise.
6060 (Layout::assign_local_dynsym_offsets): Likewise.
6061 (Layout::sized_create_version_sections): Likewise.
6062 (Layout::create_interp): Likewise.
6063 (Layout::finish_dynamic_section): Likewise.
6064 (Layout::set_dynamic_symbol_size): Likewise.
6065
6066 2011-07-08 Ian Lance Taylor <iant@google.com>
6067
6068 PR gold/12386
6069 * options.h (class General_options): Add --unresolved-symbols.
6070 * target-reloc.h (issue_undefined_symbol_error): Check
6071 --unresolved-symbols. Add comments.
6072
6073 2011-07-08 Ian Lance Taylor <iant@google.com>
6074
6075 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6076 expression more complex.
6077
6078 2011-07-08 Ian Lance Taylor <iant@google.com>
6079
6080 PR gold/11317
6081 * target-reloc.h (issue_undefined_symbol_error): New inline
6082 function, broken out of relocate_section.
6083 (relocate_section): Call issue_undefined_symbol_error.
6084 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6085 there is no TLS segment if we are about to issue an undefined
6086 symbol error.
6087 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6088
6089 2011-07-08 Ian Lance Taylor <iant@google.com>
6090
6091 PR gold/12279
6092 * resolve.cc (Symbol_table::should_override): Add fromtype
6093 parameter. Change all callers. Give error when linking together
6094 TLS and non-TLS symbol.
6095 (Symbol_table::should_override_with_special): Add fromtype
6096 parameter. Change all callers.
6097 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6098 there is no TLS segment if we have reported some errors.
6099 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6100
6101 2011-07-08 Ian Lance Taylor <iant@google.com>
6102
6103 PR gold/12372
6104 * target.h (Target::plt_address_for_global): New function.
6105 (Target::plt_address_for_local): New function.
6106 (Target::plt_section_for_global): Remove.
6107 (Target::plt_section_for_local): Remove.
6108 (Target::do_plt_address_for_global): New virtual function.
6109 (Target::do_plt_address_for_local): New virtual function.
6110 (Target::do_plt_section_for_global): Remove.
6111 (Target::do_plt_section_for_local): Remove.
6112 (Target::register_global_plt_entry): Add Symbol_table and Layout
6113 parameters.
6114 * output.cc (Output_data_got::Got_entry::write): Use
6115 plt_address_for_global and plt_address_for_local.
6116 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6117 address of output section.
6118 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6119 got_irelative_, and irelative_count_ fields. Update
6120 declarations.
6121 (Output_data_plt_i386::has_irelative_section): New function.
6122 (Output_data_plt_i386::entry_count): Add irelative_count_.
6123 (Output_data_plt_i386::set_final_data_size): Likewise.
6124 (class Target_i386): Add got_irelative_ and rel_irelative_
6125 fields. Update declarations.
6126 (Target_i386::Target_i386): Initialize new fields.
6127 (Target_i386::do_plt_address_for_global): New function replacing
6128 do_plt_section_for_global.
6129 (Target_i386::do_plt_address_for_local): New function replacing
6130 do_plt_section_for_local.
6131 (Target_i386::got_section): Create got_irelative_.
6132 (Target_i386::rel_irelative_section): New function.
6133 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6134 fields. Don't define __rel_iplt_{start,end}.
6135 (Output_data_plt_i386::add_entry): Add symtab and layout
6136 parameters. Change all callers. Use different PLT and GOT for
6137 IFUNC symbols.
6138 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6139 layout parameters. Change all callers. Use different PLT and
6140 GOT.
6141 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6142 (Output_data_plt_i386::rel_irelative): New function.
6143 (Output_data_plt_i386::address_for_global): New function.
6144 (Output_data_plt_i386::address_for_local): New function.
6145 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6146 IRELATIVE GOT when changing IFUNC GOT entries.
6147 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6148 reloc.
6149 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6150 if we didn't create an IRELATIVE GOT.
6151 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6152 plt_address_for_local.
6153 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6154 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6155 got_irelative_, and irelative_count_ fields. Update
6156 declarations.
6157 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6158 Initialize new fields. Remove symtab parameter. Change all
6159 callers.
6160 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6161 irelative_count_.
6162 (Output_data_plt_x86_64::has_irelative_section): New function.
6163 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6164 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6165 fields. Update declarations.
6166 (Target_x86_64::Target_x86_64): Initialize new fields.
6167 (Target_x86_64::do_plt_address_for_global): New function replacing
6168 do_plt_section_for_global.
6169 (Target_x86_64::do_plt_address_for_local): New function replacing
6170 do_plt_section_for_local.
6171 (Target_x86_64::got_section): Create got_irelative_.
6172 (Target_x86_64::rela_irelative_section): New function.
6173 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6174 all callers. Don't create __rel_iplt_{start,end}.
6175 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6176 parameters. Change all callers. Use different PLT and GOT for
6177 IFUNC symbols.
6178 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6179 layout parameters. Change all callers. Use different PLT and
6180 GOT.
6181 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6182 parameters. Change all callers. Use different PLT and GOT for
6183 IFUNC symbols.
6184 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6185 (Output_data_plt_x86_64::rela_irelative): New function.
6186 (Output_data_plt_x86_64::address_for_global): New function.
6187 (Output_data_plt_x86_64::address_for_local): New function.
6188 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6189 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6190 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6191 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6192 parameters.
6193 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6194 reloc.
6195 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6196 symbols if we didn't create an IRELATIVE GOT.
6197 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6198 plt_address_for_local.
6199 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6200 * testsuite/ifuncvar1.c: New test file.
6201 * testsuite/ifuncvar2.c: New test file.
6202 * testsuite/ifuncvar3.c: New test file.
6203 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6204 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6205 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6206 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6207 * testsuite/Makefile.in: Rebuild.
6208
6209 2011-07-07 Cary Coutant <ccoutant@google.com>
6210
6211 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6212 (two_file_test_1_ndebug.o): Likewise.
6213 (two_file_test_1b_ndebug.o): Likewise.
6214 (two_file_test_2_ndebug.o): Likewise.
6215 (two_file_test_main_ndebug.o): Likewise.
6216 (incremental_test_2): Link with no-debug versions.
6217
6218 2011-07-06 Cary Coutant <ccoutant@google.com>
6219
6220 * gold/incremental.cc
6221 (Output_section_incremental_inputs::write_info_blocks): Check for
6222 hidden and internal symbols.
6223
6224 2011-07-06 Cary Coutant <ccoutant@google.com>
6225
6226 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6227 Check disposition for startup file.
6228 (Incremental_inputs::report_command_line): Ignore
6229 --incremental-startup-unchanged option.
6230 * options.cc (General_options::parse_incremental_startup_unchanged):
6231 New function.
6232 (General_options::General_options): Initialize new data member.
6233 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6234 (General_options): Add --incremental-startup-unchanged option.
6235 (General_options::incremental_startup_disposition): New function.
6236 (General_options::incremental_startup_disposition_): New data member.
6237
6238 2011-07-06 Cary Coutant <ccoutant@google.com>
6239
6240 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6241 input file index to Script_info ctor.
6242 (Sized_incremental_binary::do_file_has_changed): Find the
6243 command-line argument for files named in scripts.
6244 * incremental.h (Script_info::Script_info): New ctor
6245 with input file index.
6246 (Script_info::input_file_index): New function.
6247 (Script_info::input_file_index_): New data member.
6248 (Incremental_binary::get_library): Add const.
6249 (Incremental_binary::get_script_info): Add const.
6250 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6251 * testsuite/Makefile.am (incremental_test_5): New test case.
6252 (incremental_test_6): New test case.
6253 * testsuite/Makefile.in: Regenerate.
6254
6255 2011-07-06 Cary Coutant <ccoutant@google.com>
6256
6257 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6258 debug output when command lines differ.
6259
6260 2011-07-06 Cary Coutant <ccoutant@google.com>
6261
6262 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6263 --incremental-patch option.
6264 * layout.cc (Free_list::allocate): Extend allocation beyond original
6265 end if enabled.
6266 (Layout::make_output_section): Mark sections that should get
6267 patch space.
6268 * options.cc (parse_percent): New function.
6269 * options.h (parse_percent): New function.
6270 (DEFINE_percent): New macro.
6271 (General_options): Add --incremental-patch option.
6272 * output.cc (Output_section::Output_section): Initialize new data
6273 members.
6274 (Output_section::add_input_section): Print section name when out
6275 of patch space.
6276 (Output_section::add_output_section_data): Likewise.
6277 (Output_section::set_final_data_size): Add patch space when
6278 doing --incremental-full.
6279 (Output_section::do_reset_address_and_file_offset): Remove patch
6280 space.
6281 (Output_segment::set_section_list_addresses): Print debug output
6282 only if --incremental-update.
6283 * output.h (Output_section::set_is_patch_space_allowed): New function.
6284 (Output_section::is_patch_space_allowed_): New data member.
6285 (Output_section::patch_space_): New data member.
6286 * parameters.cc (Parameters::incremental_full): New function.
6287 * parameters.h (Parameters::incremental_full): New function
6288 * testsuite/Makefile.am (incremental_test_2): Add test for
6289 --incremental-patch option.
6290 * testsuite/Makefile.in: Regenerate.
6291 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6292 (t18): Remove function body.
6293
6294 2011-07-05 Doug Kwan <dougkwan@google.com>
6295
6296 PR gold/12771
6297 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6298 Arm_Address type for relocation result.
6299 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6300 overflow check.
6301 (Arm_relocate_functions::abs32): Use unaligned access.
6302 (Arm_relocate_functions::rel32): Ditto.
6303 (Arm_relocate_functions::prel31): Ditto.
6304 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6305 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6306 static data relocations.
6307 * testsuite/Makefile.in: Regnerate.
6308 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6309
6310 2011-07-05 Ian Lance Taylor <iant@google.com>
6311
6312 PR gold/12392
6313 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6314 symbols if necessary.
6315 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6316
6317 2011-07-05 Ian Lance Taylor <iant@google.com>
6318
6319 PR gold/12952
6320 * resolve.cc (Symbol::override_base_with_special): Simply override
6321 version with special symbol version, ignoring previous version.
6322
6323 2011-07-05 Ian Lance Taylor <iant@google.com>
6324
6325 * object.cc (Sized_relobj_file::include_section_group): Add
6326 information to comment about signature location.
6327
6328 2011-07-02 Ian Lance Taylor <iant@google.com>
6329
6330 PR gold/12957
6331 * options.h (class General_options): Add -f and -F.
6332 * options.cc (General_options::finalize): Fatal error if -f/-F
6333 are used without -shared.
6334 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6335
6336 2011-07-02 Ian Lance Taylor <iant@google.com>
6337
6338 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6339
6340 2011-07-01 Ian Lance Taylor <iant@google.com>
6341
6342 PR gold/12525
6343 PR gold/12952
6344 * resolve.cc (Symbol::override_base_with_special): Don't override
6345 the version if the overriding symbol has a different name.
6346 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6347 all callers. If we give an error about an undefined version,
6348 define the base version if necessary.
6349 * dynobj.h (class Versions): Update declaration.
6350 * testsuite/weak_alias_test_5.cc: New file.
6351 * testsuite/weak_alias_test.script: New file.
6352 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6353 and versioned_alias have the right value, and call t2.
6354 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6355 weak_alias_test_5.so.
6356 (weak_alias_test_LDADD): Likewise.
6357 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6358 * testsuite/Makefile.in: Rebuild.
6359
6360 2011-07-01 Ian Lance Taylor <iant@google.com>
6361
6362 PR gold/12525
6363 * options.h (class General_options): Support -z notext.
6364 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6365 -Wl,-z,notext.
6366 (two_file_shared_nonpic.so): Likewise.
6367 (two_file_shared_mixed.so): Likewise.
6368 (two_file_shared_mixed_1.so): Likewise.
6369 (weak_undef_lib_nonpic.so): Likewise.
6370 (alt/weak_undef_lib_nonpic.so): Likewise.
6371 (tls_test_shared_nonpic.so): Likewise.
6372 * testsuite/Makefile.in: Rebuild.
6373
6374 2011-07-01 Ian Lance Taylor <iant@google.com>
6375
6376 PR gold/12525
6377 * configure.ac: Test whether static linking works, setting
6378 the automake conditional HAVE_STATIC.
6379 * testsuite/Makefile.am: Disable tests using -static if
6380 HAVE_STATIC is not true.
6381 * configure, testsuite/Makefile.in: Rebuild.
6382
6383 2011-07-01 Ian Lance Taylor <iant@google.com>
6384
6385 PR gold/12525
6386 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6387 Assert if we see DW_EH_PE_indirect.
6388 * target.h (Target::ehframe_datarel_base): New function.
6389 (Target::do_ehframe_datarel_base): New target function.
6390 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6391 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6392 function.
6393
6394 2011-07-01 Ian Lance Taylor <iant@google.com>
6395
6396 PR gold/12571
6397 * options.h (class General_options): Add
6398 --ld-generated-unwind-info.
6399 * ehframe.cc (Fde::write): Add address parameter. Change all
6400 callers. If associated with PLT, fill in address and size.
6401 (Cie::set_output_offset): Only add merge mapping if there is an
6402 object.
6403 (Cie::write): Add address parameter. Change all callers.
6404 (Eh_frame::add_ehframe_for_plt): New function.
6405 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6406 input_offset_ fields into union u_, with new plt field.
6407 (Fde::Fde): Adjust for new union field.
6408 (Fde::Fde) [Output_data version]: New constructor.
6409 (Fde::add_mapping): Only add merge mapping if there is an object.
6410 (class Cie): Update declarations.
6411 (class Eh_frame): Declare add_ehframe_for_plt.
6412 * layout.cc (Layout::layout_eh_frame): Break out code into
6413 make_eh_frame_section, and call it.
6414 (Layout::make_eh_frame_section): New function.
6415 (Layout::add_eh_frame_for_plt): New function.
6416 * layout.h (class Layout): Update declarations.
6417 * merge.cc (Merge_map::add_mapping): Add assertion.
6418 * i386.cc: Include "dwarf.h".
6419 (class Output_data_plt_i386): Make first_plt_entry,
6420 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6421 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6422 and plt_eh_frame_fde.
6423 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6424 boundary. Call add_eh_frame_for_plt if appropriate.
6425 * x86_64.cc: Include "dwarf.h".
6426 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6427 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6428 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6429 and plt_eh_frame_fde.
6430 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6431 appropriate.
6432
6433 2011-06-29 Ian Lance Taylor <iant@google.com>
6434
6435 PR gold/12629
6436 * object.cc (Sized_relobj_file::layout_section): Change shdr
6437 parameter to be const.
6438 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6439 out of do_layout.
6440 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6441 appropriate. Call layout_eh_frame_section.
6442 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6443 sections.
6444 * object.h (class Sized_relobj_file): Update declarations.
6445
6446 2011-06-29 Ian Lance Taylor <iant@google.com>
6447
6448 PR gold/12652
6449 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6450 modifier.
6451 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6452
6453 2011-06-29 Ian Lance Taylor <iant@google.com>
6454
6455 PR gold/12675
6456 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6457 SHT_X86_64_UNWIND.
6458 * layout.cc (Layout::layout_eh_frame): Likewise.
6459
6460 2011-06-29 Ian Lance Taylor <iant@google.com>
6461
6462 PR gold/12695
6463 * layout.cc (Layout::symtab_section_shndx): New function.
6464 * layout.h (class Layout): Declare symtab_section_shndx.
6465 * output.cc (Output_section::write_header): Call it.
6466
6467 2011-06-29 Ian Lance Taylor <iant@google.com>
6468
6469 PR gold/12818
6470 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6471 symbols which are not used in a relocation.
6472
6473 2011-06-28 Ian Lance Taylor <iant@google.com>
6474
6475 PR gold/12898
6476 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6477 script create indistinguishable segments.
6478 (Layout::set_segment_offsets): Use stable_sort when sorting
6479 segments. Pass this to Compare_segments constructor.
6480 * layout.h (class Layout): Make segment_precedes non-static.
6481 (class Compare_segments): Change from struct to class. Add
6482 layout_ field. Add constructor.
6483 * script-sections.cc
6484 (Script_sections::attach_sections_using_phdrs_clause): Rename
6485 local orphan to is_orphan. Don't report failure to put empty
6486 section in segment. On attachment failure, report name of
6487 section, and attach to first PT_LOAD segment.
6488
6489 2011-06-28 Ian Lance Taylor <iant@google.com>
6490
6491 PR gold/12934
6492 * target-select.cc (Target_selector::Target_selector): Add
6493 emulation parameter. Change all callers.
6494 (select_target_by_bfd_name): Rename from select_target_by_name.
6495 Change all callers.
6496 (select_target_by_emulation): New function.
6497 (supported_emulation_names): New function.
6498 * target-select.h (class Target_selector): Add emulation_ field.
6499 Update declarations.
6500 (Target_selector::recognize_by_bfd_name): Rename from
6501 recognize_by_name. Change all callers.
6502 (Target_selector::supported_bfd_names): Rename from
6503 supported_names. Change all callers.
6504 (Target_selector::recognize_by_emulation): New function.
6505 (Target_selector::supported_emulations): New function.
6506 (Target_selector::emulation): New function.
6507 (Target_selector::do_recognize_by_bfd_name): Rename from
6508 do_recognize_by_name. Change all callers.
6509 (Target_selector::do_supported_bfd_names): Rename from
6510 do_supported_names. Change all callers.
6511 (Target_selector::do_recognize_by_emulation): New function.
6512 (Target_selector::do_supported_emulations): New function.
6513 (select_target_by_bfd_name): Change name in declaration.
6514 (select_target_by_emulation): Declare.
6515 (supported_emulation_names): Declare.
6516 * parameters.cc (parameters_force_valid_target): Try to find
6517 target based on emulation from -m option.
6518 * options.h (class General_options): Change doc string for -m.
6519 * options.cc (help): Print emulations.
6520 (General_options::parse_V): Likewise.
6521 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6522 Add emulation parameter. Change all callers.
6523
6524 2011-06-28 Ian Lance Taylor <iant@google.com>
6525
6526 * target.h (class Target): Add osabi_ field.
6527 (Target::osabi): New function.
6528 (Target::set_osabi): New function.
6529 (Target::Target): Initialize osabi_.
6530 (Target::do_adjust_elf_header): Make pure virtual.
6531 (Sized_target::do_adjust_elf_header): Declare.
6532 * target.cc (Sized_target::do_adjust_elf_header): New function.
6533 (class Sized_target): Instantiate all versions.
6534 * freebsd.h (class Target_freebsd): Remove.
6535 (Target_selector_freebsd::do_recognize): Call set_osabi on
6536 Target.
6537 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6538 (Target_selector_freebsd::set_osabi): Remove.
6539 * i386.cc (class Target_i386): Inherit from Sized_target rather
6540 than Target_freebsd.
6541 * x86_64.cc (class Target_x86_64): Likewise.
6542
6543 2011-06-28 Ian Lance Taylor <iant@google.com>
6544
6545 * target.h (Target::can_check_for_function_pointers): Rewrite.
6546 Make non-virtual.
6547 (Target::can_icf_inline_merge_sections): Likewise.
6548 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6549 (Target::Target_info): Add can_icf_inline_merge_sections field.
6550 (Target::do_can_check_for_function_pointers): New virtual
6551 function.
6552 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6553 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6554 from can_check_for_function_pointers, move in file.
6555 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6556 section_may_have_icf_unsafe_poineters, move in file.
6557 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6558 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6559 Rename from can_check_for_function_pointers, move in file.
6560 (Target_i386::can_icf_inline_merge_sections): Remove.
6561 (Target_i386::i386_info): Initialize
6562 can_icf_inline_merge_sections.
6563 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6564 Initialize can_icf_inline_merge_sections.
6565 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6566 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6567 Rename from can_check_for_function_pointers, move in file.
6568 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6569 (Target_x86_64::x86_64_info): Initialize
6570 can_icf_inline_merge_sections.
6571 * testsuite/testfile.cc (Target_test::test_target_info):
6572 Likewise.
6573 * icf.cc (get_section_contents): Correct formatting.
6574
6575 2011-06-27 Ian Lance Taylor <iant@google.com>
6576
6577 * symtab.cc (Symbol::versioned_name): New function.
6578 (Symbol_table::add_to_final_symtab): Use versioned_name when
6579 appropriate.
6580 (Symbol_table::sized_write_symbol): Likewise.
6581 * symtab.h (class Symbol): Declare versioned_name.
6582 * stringpool.h (class Stringpool_template): Add variant of add
6583 which takes a std::basic_string.
6584 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6585 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6586 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6587 (ver_test_12.o): New target.
6588 * testsuite/Makefile.in: Rebuild.
6589
6590 2011-06-27 Doug Kwan <dougkwan@google.com>
6591
6592 * arm.cc (Arm_relocate_functions::thm_jump8,
6593 Arm_relocate_functions::thm_jump11): Use a wider signed
6594 type to compute offset.
6595 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6596 arm_thm_jump8.
6597 * testsuite/Makefile.in: Regenerate.
6598 * testsuite/arm_branch_in_range.sh: Check test results of
6599 arm_thm_jump11 and arm_thm_jump8.
6600 * testsuite/arm_thm_jump11.s: New test source file.
6601 * testsuite/arm_thm_jump11.t: New linker script.
6602 * testsuite/arm_thm_jump8.s: New test source file.
6603 * testsuite/arm_thm_jump8.t: New linker script.
6604
6605 2011-06-24 Ian Lance Taylor <iant@google.com>
6606
6607 * layout.cc: Include "object.h".
6608 (ctors_sections_in_init_array): New static variable.
6609 (Layout::is_ctors_in_init_array): New function.
6610 (Layout::layout): Add entry to ctors_sections_in_init_array if
6611 appropriate.
6612 * layout.h (class Layout): Declare is_ctors_in_init_array.
6613 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6614 is_ctors_reverse_view is set.
6615 (Sized_relobj_file::write_sections): Add layout parameter. Change
6616 all callers. Set is_ctors_reverse_view field of View_size.
6617 (Sized_relobj_file::reverse_words): New function.
6618 * object.h (Sized_relobj_file::View_size): Add
6619 is_ctors_reverse_view field.
6620 (class Sized_relobj_file): Update declarations.
6621 * testsuite/initpri3.c: New test.
6622 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6623 initpri3b.
6624 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6625 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6626 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6627 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6628 * testsuite/Makefile.in: Rebuild.
6629
6630 2011-06-24 Cary Coutant <ccoutant@google.com>
6631
6632 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6633 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6634 (debug_msg_cdebug.err): New targets.
6635 * testsuite/Makefile.in: Regenerate.
6636 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6637 Fix checks for link with shared library.
6638
6639 2011-06-24 Doug Kwan <dougkwan@google.com>
6640
6641 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6642 skip empty text sections.
6643 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6644
6645 2011-06-22 Ian Lance Taylor <iant@google.com>
6646
6647 PR gold/12910
6648 * options.h (class General_options): Add --ctors-in-init-array.
6649 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6650 friends as SHT_PROGBITS for merging sections.
6651 (Layout::layout): Remove special handling of .init_array and
6652 friends. Don't sort if doing relocatable link. Sort for .ctors
6653 and .dtors if ctors_in_init_array.
6654 (Layout::make_output_section): Force correct section types for
6655 .init_array and friends. Don't sort if doing relocatable link,
6656 Don't sort .ctors and .dtors if ctors_in_init_array.
6657 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6658 (Layout::output_section_name): Add relobj parameter. Change all
6659 callers. Handle .ctors. and .dtors. in code rather than table.
6660 Handle .ctors and .dtors if ctors_in_init_array.
6661 (Layout::match_file_name): New function, moved from output.cc.
6662 * layout.h (class Layout): Update declarations.
6663 * output.cc: Include "layout.h".
6664 (Input_section_sort_entry::get_priority): New function.
6665 (Input_section_sort_entry::match_file_name): Just call
6666 Layout::match_file_name.
6667 (Output_section::Input_section_sort_init_fini_compare::operator()):
6668 Handle .ctors and .dtors. Sort by explicit priority rather than
6669 by name.
6670 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6671 * testsuite/initpri2.c: New test.
6672 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6673 (check_PROGRAMS): Add initpri2.
6674 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6675 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6676 * configure, testsuite/Makefile.in: Rebuild.
6677
6678 2011-06-19 Ian Lance Taylor <iant@google.com>
6679
6680 PR gold/12880
6681 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6682 .interp section to a PT_INTERP segment even if we have seen a
6683 --dynamic-linker option. Don't do it if we have seen a PHDRS
6684 clause in a linker script.
6685 (Layout::finalize): Don't create a .interp section if we've
6686 already create a PT_INTERP segment.
6687 (Layout::create_interp): Always call choose_output_section (revert
6688 patch of 2011-06-17). Don't create PT_INTERP segment.
6689 * script-sections.cc
6690 (Script_sections::create_note_and_tls_segments): Add a .interp
6691 section to a PT_INTERP segment even if we have seen a
6692 --dynamic-linker option.
6693
6694 2011-06-18 Ian Lance Taylor <iant@google.com>
6695
6696 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6697 merely because a non-PT_LOAD segment has a dynamic reloc.
6698
6699 2011-06-18 Ian Lance Taylor <iant@google.com>
6700
6701 * layout.cc (Layout::finish_dynamic_section): Don't create
6702 DT_FLAGS entry if not needed.
6703
6704 2011-06-18 Ian Lance Taylor <iant@google.com>
6705
6706 PR gold/12745
6707 * layout.cc (Layout::layout_eh_frame): Correct handling of
6708 writable .eh_frame section.
6709
6710 2011-06-17 Ian Lance Taylor <iant@google.com>
6711
6712 PR gold/12893
6713 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6714 symbol is redefined with the exact same object and value.
6715
6716 2011-06-17 Ian Lance Taylor <iant@google.com>
6717
6718 PR gold/12880
6719 * layout.h (class Layout): Add interp_segment_ field.
6720 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6721 (Layout::attach_allocated_section_to_segment): If making shared
6722 library, put .interp section in PT_INTERP segment.
6723 (Layout::finalize): Also call create_interp if -dynamic-linker
6724 option was used.
6725 (Layout::create_interp): Assert that there is no PT_INTERP
6726 segment. If not using a SECTIONS clause, use make_output_section.
6727 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6728 * script-sections.cc
6729 (Script_sections::create_note_and_tls_segments): If making shared
6730 library, put .interp section in PT_INTERP segment.
6731
6732 2011-06-17 Ian Lance Taylor <iant@google.com>
6733
6734 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6735 when making a shared library.
6736
6737 2011-06-17 Ian Lance Taylor <iant@google.com>
6738
6739 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6740 parameter. Change all callers. Don't issue warning about PC32
6741 against locally defined symbol.
6742
6743 2011-06-16 Ian Lance Taylor <iant@google.com>
6744
6745 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6746 occurs in same object.
6747
6748 2011-06-14 Alan Modra <amodra@gmail.com>
6749
6750 * po/POTFILES.in: Regenerate.
6751
6752 2011-06-09 Ian Lance Taylor <iant@google.com>
6753
6754 * script-sections.cc
6755 (Orphan_output_section::set_section_addresses): For a relocatable
6756 link set address to 0.
6757
6758 2011-06-09 Cary Coutant <ccoutant@google.com>
6759
6760 PR gold/12804
6761 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6762 used with --compress-debug-sections.
6763 * gold/object.cc (Sized_relobj_file::do_layout): Report
6764 uncompressed size of compressed input sections.
6765
6766 2011-06-08 Cary Coutant <ccoutant@google.com>
6767
6768 PR gold/12804
6769 * testsuite/two_file_test_2_v1.cc: Change initialization of
6770 v2 to keep it in .data.
6771
6772 2011-06-07 Cary Coutant <ccoutant@google.com>
6773
6774 * common.cc (Symbol_table::do_allocate_commons_list): Call
6775 gold_fallback.
6776 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6777 (Errors::fallback): New function.
6778 (gold_fallback): New function.
6779 * errors.h (Errors::fallback): New function.
6780 * gold.cc (gold_exit): Change status parameter to enum; adjust
6781 all callers.
6782 (queue_initial_tasks): Call gold_fallback.
6783 * gold.h: Include cstdlib.
6784 (Exit_status): New enum type.
6785 (gold_exit): Change status parameter to enum.
6786 (gold_fallback): New function.
6787 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6788 (Layout::create_symtab_sections): Likewise.
6789 (Layout::create_shdrs): Likewise.
6790 * main.cc (main): Adjust call to gold_exit.
6791 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6792 (Output_data_got::add_got_entry_pair): Likewise.
6793 (Output_section::add_input_section): Likewise.
6794 (Output_section::add_output_section_data): Likewise.
6795 (Output_segment::set_section_list_addresses): Likewise.
6796 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6797
6798 2011-06-07 Cary Coutant <ccoutant@google.com>
6799
6800 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6801 for incremental links.
6802 * output.cc (Output_segment::set_section_list_addresses): Remove
6803 FIXME and test for TLS or BSS.
6804
6805 2011-06-07 Cary Coutant <ccoutant@google.com>
6806
6807 * testsuite/Makefile.am: Add incremental_copy_test,
6808 incremental_common_test_1.
6809 * testsuite/Makefile.in: Regenerate.
6810 * testsuite/common_test_1_v1.c: New source file.
6811 * testsuite/common_test_1_v2.c: New source file.
6812 * testsuite/copy_test_v1.cc: New source file.
6813
6814 2011-06-07 Cary Coutant <ccoutant@google.com>
6815
6816 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6817 update, allocate common from bss section's free list.
6818 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6819 linker-defined symbols.
6820 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6821 Skip GOT and PLT entries that are no longer referenced.
6822 (Output_section_incremental_inputs::write_info_blocks): Mark
6823 linker-defined symbols.
6824 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6825 * output.cc (Output_section::allocate): New function.
6826 * output.h (Output_section::allocate): New function.
6827 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6828 linker-defined symbols.
6829 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6830 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6831 (Symbol::init_base_output_data): Likewise.
6832 (Symbol::init_base_output_segment): Likewise.
6833 (Symbol::init_base_constant): Likewise.
6834 (Sized_symbol::init_output_data): Likewise.
6835 (Sized_symbol::init_output_segment): Likewise.
6836 (Sized_symbol::init_constant): Likewise.
6837 (Symbol_table::do_define_in_output_data): Likewise.
6838 (Symbol_table::do_define_in_output_segment): Likewise.
6839 (Symbol_table::do_define_as_constant): Likewise.
6840 * symtab.h (Symbol::is_predefined): New function.
6841 (Symbol::init_base_output_data): Add is_predefined parameter.
6842 (Symbol::init_base_output_segment): Likewise.
6843 (Symbol::init_base_constant): Likewise.
6844 (Symbol::is_predefined_): New data member.
6845 (Sized_symbol::init_output_data): Add is_predefined parameter.
6846 (Sized_symbol::init_output_segment): Likewise.
6847 (Sized_symbol::init_constant): Likewise.
6848 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6849
6850 2011-06-07 Cary Coutant <ccoutant@google.com>
6851
6852 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6853 instead of emit_copy_reloc.
6854 (Copy_relocs::emit_copy_reloc): Refactor.
6855 (Copy_relocs::make_copy_reloc): New function.
6856 (Copy_relocs::add_copy_reloc): Remove.
6857 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6858 section.
6859 (Copy_relocs::make_copy_reloc): New function.
6860 (Copy_relocs::add_copy_reloc): Remove.
6861 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6862 unchanged input files.
6863 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6864 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6865 Reserve BSS space for COPY relocations.
6866 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6867 (Output_section_incremental_inputs::write_info_blocks): Record
6868 whether a symbol is copied from a shared object.
6869 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6870 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6871 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6872 (Incremental_input_entry_reader::get_output_symbol_index): Add
6873 is_copy parameter.
6874 (Incremental_binary::emit_copy_relocs): New function.
6875 (Incremental_binary::do_emit_copy_relocs): New function.
6876 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6877 new data member.
6878 (Sized_incremental_binary::add_copy_reloc): New function.
6879 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6880 (Sized_incremental_binary::Copy_reloc): New struct.
6881 (Sized_incremental_binary::Copy_relocs): New typedef.
6882 (Sized_incremental_binary::copy_relocs_): New data member.
6883 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6884 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6885 * target.h (Sized_target::emit_copy_reloc): New function.
6886 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6887
6888 2011-06-02 Cary Coutant <ccoutant@google.com>
6889
6890 PR gold/12163
6891 * gold/archive.cc (Archive::Archive): Initialize new data member.
6892 (Archive::include_all_members): Return if archive has already been
6893 included.
6894 * gold/archive.h (Archive::include_all_members_): New data member.
6895
6896 2011-06-02 Nick Clifton <nickc@redhat.com>
6897
6898 * dynobj.h: Fix spelling mistake in comment.
6899 * output.cc: Likewise.
6900
6901 2011-05-31 Doug Kwan <dougkwan@google.com>
6902 Asier Llano
6903
6904 PR gold/12826
6905 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
6906 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6907 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6908 redundant arm_exidx_test.so.
6909 * testsuite/Makefile.in: Regenerate.
6910 (check_SCRIPTS): Add pr12826.sh
6911 (check_DATA): Add pr12826.stdout
6912 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6913 * testsuite/pr12826.sh: New file.
6914 * testsuite/pr12826_1.s: Ditto.
6915 * testsuite/pr12826_1.s: Ditto.
6916
6917 2011-05-30 Ian Lance Taylor <iant@google.com>
6918
6919 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6920 sections.
6921
6922 2011-05-29 Ian Lance Taylor <iant@google.com>
6923
6924 PR gold/12804
6925 * testsuite/Makefile.am: Use different file name for two_file_test
6926 temporary file for each incremental test.
6927 * testsuite/Makefile.in: Rebuild.
6928
6929 2011-05-29 Ian Lance Taylor <iant@google.com>
6930
6931 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6932 binary input file is empty.
6933
6934 2011-05-27 Ian Lance Taylor <iant@google.com>
6935
6936 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6937 (ver_test_9.so): Likewise.
6938 * testsuite/Makefile.in: Rebuild.
6939
6940 2011-05-26 Cary Coutant <ccoutant@google.com>
6941
6942 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6943 * incremental.cc (Incremental_inputs::report_input_section): Fix
6944 comment, indentation.
6945 (Incremental_inputs::report_comdat_group): New function.
6946 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6947 of data for incremental input file entry.
6948 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6949 group count, COMDAT group signatures.
6950 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6951 an unchanged input file.
6952 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6953 Initialize new data member.
6954 (Incremental_object_entry::add_comdat_group): New function.
6955 (Incremental_object_entry::get_comdat_group_count): New function.
6956 (Incremental_object_entry::get_comdat_signature_key): New function.
6957 (Incremental_object_entry::groups_): New data member.
6958 (Incremental_inputs::report_comdat_group): New function.
6959 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6960 data for incremental input file entry.
6961 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6962 (Incremental_input_entry_reader::get_input_section): Adjust size of
6963 data for incremental input file entry.
6964 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6965 (Incremental_input_entry_reader::get_comdat_group_signature): New
6966 function.
6967 * object.cc (Sized_relobj::include_section_group): Report kept
6968 COMDAT groups for incremental links.
6969
6970 2011-05-24 David Meyer <pdox@google.com>
6971
6972 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6973 with name parameter. Add found_name parameter.
6974 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6975 * dirsearch.h (class Dirsearch): Update declaration.
6976
6977 2011-05-24 Ian Lance Taylor <iant@google.com>
6978
6979 * archive.cc (Library_base::should_include_member): Pull in object
6980 from archive if it defines the entry symbol.
6981 * parameters.cc (Parameters::entry): New function.
6982 * parameters.h (class Parameters): Declare entry.
6983 * output.h (class Output_file_header): Remove entry_ field.
6984 * output.cc (Output_file_header::Output_file_header): Remove entry
6985 parameter. Change all callers.
6986 (Output_file_header::entry): Use parameters->entry.
6987 * gold.cc (queue_middle_tasks): Likewise.
6988 * plugin.cc (Plugin_hook::run): Likewise.
6989
6990 2011-05-24 Cary Coutant <ccoutant@google.com>
6991
6992 * gold.cc (queue_initial_tasks): Pass incremental base filename
6993 to Output_file::open_base_file; don't print error message.
6994 * incremental-dump.cc (main): Adjust call to
6995 Output_file::open_for_modification.
6996 * incremental-dump.cc (main): Likewise.
6997 * incremental.cc (Incremental_inputs::report_command_line):
6998 Ignore --incremental-base option when comparing command lines.
6999 Ignore parameter when given as separate argument.
7000 * options.h (class General_options): Add --incremental-base.
7001 * output.cc (Output_file::Output_file):
7002 (Output_file::open_base_file): Add base_name and writable parameters;
7003 read base file into new file; print error message here.
7004 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7005 callers.
7006 * output.h (Output_file::open_for_modification): Rename to...
7007 (Output_file::open_base_file): ...this; add base_name and
7008 writable parameters; adjust all callers.
7009 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7010 callers.
7011 * testsuite/Makefile.am (incremental_test_4): Test
7012 --incremental-base.
7013 * testsuite/Makefile.in: Regenerate.
7014
7015 2011-05-24 Cary Coutant <ccoutant@google.com>
7016
7017 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7018 incremental_test_4.
7019 * testsuite/Makefile.in: Regenerate.
7020 * testsuite/two_file_test_1_v1.cc: New test source file.
7021 * testsuite/two_file_test_1b_v1.cc: New test source file.
7022 * testsuite/two_file_test_2_v1.cc: New test source file.
7023
7024 2011-05-24 Cary Coutant <ccoutant@google.com>
7025
7026 * dynobj.h (Dynobj::do_dynobj): New function.
7027 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7028 flag and soname for shared objects.
7029 * incremental.cc (Incremental_inputs::report_object): Make
7030 either Incremental_object_entry or Incremental_dynobj_entry; add
7031 soname to string table.
7032 (Incremental_inputs::report_input_section): Add assertion.
7033 (Output_section_incremental_inputs::set_final_data_size): Adjust
7034 type of input file entry for shared libraries; adjust size of
7035 shared library info entry.
7036 (Output_section_incremental_inputs::write_input_files): Write
7037 as_needed flag for shared libraries.
7038 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7039 of input file entry for shared libraries; write soname.
7040 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7041 soname from incremental info.
7042 * incremental.h (enum Incremental_input_flags): Add
7043 INCREMENTAL_INPUT_AS_NEEDED.
7044 (Incremental_input_entry::Incremental_input_entry): Initialize new
7045 data member.
7046 (Incremental_input_entry::set_as_needed): New function.
7047 (Incremental_input_entry::as_needed): New function.
7048 (Incremental_input_entry::do_dynobj_entry): New function.
7049 (Incremental_input_entry::as_needed_): New data member.
7050 (Incremental_object_entry::Incremental_object_entry): Don't check
7051 for shared library.
7052 (Incremental_object_entry::do_type): Likewise.
7053 (class Incremental_dynobj_entry): New class.
7054 (Incremental_input_entry_reader::as_needed): New function.
7055 (Incremental_input_entry_reader::get_soname): New function.
7056 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7057 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7058 size of shared library info entry.
7059 * layout.cc (Layout::finish_dynamic_section): Don't test for
7060 incremental link when adding DT_NEEDED entries.
7061 * object.h (Object::Object): Initialize new data member.
7062 (Object::dynobj): New function.
7063 (Object::set_as_needed): New function.
7064 (Object::as_needed): New function.
7065 (Object::do_dynobj): New function.
7066 (Object::as_needed_): New data member.
7067
7068 2011-05-24 Cary Coutant <ccoutant@google.com>
7069
7070 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7071 info; adjust display of GOT entries.
7072 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7073 vector of input objects; remove file_status_.
7074 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7075 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7076 got_plt reader; call target hooks to reserve GOT entries.
7077 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7078 of input file info header and GOT info entry.
7079 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7080 relocation info.
7081 (Got_plt_view_info::got_descriptor): Remove.
7082 (Got_plt_view_info::sym_index): New data member.
7083 (Got_plt_view_info::input_index): New data member.
7084 (Local_got_offset_visitor::visit): Write input file index.
7085 (Global_got_offset_visitor::visit): Write 0 for input file index.
7086 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7087 with sym_index and input_index.
7088 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7089 incremental info GOT entry; replace got_descriptor with input_index.
7090 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7091 map from input file index to object.
7092 (Sized_relobj_incr::do_layout): Replace direct data member reference
7093 with accessor function.
7094 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7095 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7096 Adjust size of input file info header.
7097 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7098 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7099 (Incremental_input_entry_reader::get_input_section): Adjust size of
7100 input file info header.
7101 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7102 of incremental info GOT entry.
7103 (Incremental_got_plt_reader::get_got_desc): Remove.
7104 (Incremental_got_plt_reader::get_got_symndx): New function.
7105 (Incremental_got_plt_reader::get_got_input_index): New function.
7106 (Sized_incremental_binary::Sized_incremental_binary): Remove
7107 file_status_; add input_objects_.
7108 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7109 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7110 (Sized_incremental_binary::file_is_unchanged): Remove.
7111 (Sized_incremental_binary::set_input_object): New function.
7112 (Sized_incremental_binary::input_object): New function.
7113 (Sized_incremental_binary::file_status_): Remove.
7114 (Sized_incremental_binary::input_objects_): New data member.
7115 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7116 references.
7117 (Sized_relobj_incr::invalid_address): Move to base class.
7118 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7119 class.
7120 (Sized_relobj_incr::do_output_section_offset): Likewise.
7121 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7122 (Sized_relobj_incr::section_offsets_): Likewise.
7123 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7124 function.
7125 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7126 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7127 with accessor function.
7128 (Sized_relobj_file::do_layout): Likewise.
7129 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7130 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7131 (Sized_relobj_file::compute_final_local_value): Replace refs to
7132 section_offsets_ with accessor function.
7133 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7134 * object.h (Relobj::Relobj): Initialize new data members.
7135 (Relobj::add_dyn_reloc): New function.
7136 (Relobj::first_dyn_reloc): New function.
7137 (Relobj::dyn_reloc_count): New function.
7138 (Relobj::first_dyn_reloc_): New data member.
7139 (Relobj::dyn_reloc_count_): New data member.
7140 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7141 references.
7142 (Sized_relobj::Address): New typedef.
7143 (Sized_relobj::invalid_address): Move here from child class.
7144 (Sized_relobj::Sized_relobj): Initialize new data members.
7145 (Sized_relobj::sized_relobj): New function.
7146 (Sized_relobj::is_output_section_offset_invalid): Move here from
7147 child class.
7148 (Sized_relobj::get_output_section_offset): Likewise.
7149 (Sized_relobj::local_has_got_offset): Likewise.
7150 (Sized_relobj::local_got_offset): Likewise.
7151 (Sized_relobj::set_local_got_offset): Likewise.
7152 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7153 (Sized_relobj::clear_got_offsets): New function.
7154 (Sized_relobj::section_offsets): Move here from child class.
7155 (Sized_relobj::do_output_section_offset): Likewise.
7156 (Sized_relobj::do_set_section_offset): Likewise.
7157 (Sized_relobj::Local_got_offsets): Likewise.
7158 (Sized_relobj::local_got_offsets_): Likewise.
7159 (Sized_relobj::section_offsets_): Likewise.
7160 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7161 references.
7162 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7163 class.
7164 (Sized_relobj_file::sized_relobj): New function
7165 (Sized_relobj_file::local_has_got_offset): Move to base class.
7166 (Sized_relobj_file::local_got_offset): Likewise.
7167 (Sized_relobj_file::set_local_got_offset): Likewise.
7168 (Sized_relobj_file::get_output_section_offset): Likewise.
7169 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7170 (Sized_relobj_file::do_output_section_offset): Likewise.
7171 (Sized_relobj_file::do_set_section_offset): Likewise.
7172 (Sized_relobj_file::Local_got_offsets): Likewise.
7173 (Sized_relobj_file::local_got_offsets_): Likewise.
7174 (Sized_relobj_file::section_offsets_): Likewise.
7175 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7176 (all constructors).
7177 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7178 (Output_reloc::get_symbol_index): Likewise.
7179 (Output_reloc::local_section_offset): Likewise.
7180 (Output_reloc::get_address): Likewise.
7181 (Output_reloc::symbol_value): Likewise.
7182 (Output_data_got::reserve_slot): Move to class definition.
7183 (Output_data_got::reserve_local): New function.
7184 (Output_data_got::reserve_slot_for_global): Remove.
7185 (Output_data_got::reserve_global): New function.
7186 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7187 (all constructors, two instantiations).
7188 (Output_reloc::get_relobj): New function (two instantiations).
7189 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7190 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7191 (Output_data_reloc::add_global): Adjust type of relobj.
7192 (Output_data_reloc::add_global_relative): Likewise.
7193 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7194 (Output_data_reloc::add_local): Likewise.
7195 (Output_data_reloc::add_local_relative): Likewise.
7196 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7197 (Output_data_reloc::add_local_section): Likewise.
7198 (Output_data_reloc::add_output_section): Likewise.
7199 (Output_data_reloc::add_absolute): Likewise.
7200 (Output_data_reloc::add_target_specific): Likewise.
7201 (Output_data_got::reserve_slot): Move definition here.
7202 (Output_data_got::reserve_local): New function.
7203 (Output_data_got::reserve_global): New function.
7204 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7205 section_offsets_ with accessor function.
7206 (Sized_relobj_file::write_sections): Likewise.
7207 (Sized_relobj_file::do_relocate_sections): Likewise.
7208 * target.h (Sized_target::reserve_local_got_entry): New function.
7209 (Sized_target::reserve_global_got_entry): New function.
7210 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7211 (Target_x86_64::reserve_global_got_entry): New function.
7212 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7213
7214 2011-05-23 Cary Coutant <ccoutant@google.com>
7215
7216 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7217 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7218 bit when checking got_type.
7219 * incremental.cc (Sized_incremental_binary::setup_readers):
7220 Store symbol table and string table locations; initialize bit vector
7221 of file status flags.
7222 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7223 unchanged files.
7224 (Sized_incremental_binary::do_process_got_plt): New function.
7225 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7226 (Output_section_incremental_inputs::set_final_data_size): Record
7227 file index for each input file.
7228 (Output_section_incremental_inputs::write_got_plt): Store file index
7229 instead of input entry offset for each GOT entry.
7230 * incremental.h
7231 (Incremental_input_entry::Incremental_input_entry): Initialize new
7232 data member.
7233 (Incremental_input_entry::set_offset): Store file index.
7234 (Incremental_input_entry::get_file_index): New function.
7235 (Incremental_input_entry::file_index_): New data member.
7236 (Incremental_binary::process_got_plt): New function.
7237 (Incremental_binary::do_process_got_plt): New function.
7238 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7239 data members.
7240 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7241 (Sized_incremental_binary::set_file_is_unchanged): New function.
7242 (Sized_incremental_binary::file_is_unchanged): New function.
7243 (Sized_incremental_binary::do_process_got_plt): New function.
7244 (Sized_incremental_binary::file_status_): New data member.
7245 (Sized_incremental_binary::main_symtab_loc_): New data member.
7246 (Sized_incremental_binary::main_strtab_loc_): New data member.
7247 * output.cc (Output_data_got::Got_entry::write): Add case
7248 RESERVED_CODE.
7249 (Output_data_got::add_global): Call add_got_entry.
7250 (Output_data_got::add_global_plt): Likewise.
7251 (Output_data_got::add_global_with_rel): Likewise.
7252 (Output_data_got::add_global_with_rela): Likewise.
7253 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7254 (Output_data_got::add_global_pair_with_rela): Likewise.
7255 (Output_data_got::add_local): Call add_got_entry.
7256 (Output_data_got::add_local_plt): Likewise.
7257 (Output_data_got::add_local_with_rel): Likewise.
7258 (Output_data_got::add_local_with_rela): Likewise.
7259 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7260 (Output_data_got::add_local_pair_with_rela): Likewise.
7261 (Output_data_got::reserve_slot): New function.
7262 (Output_data_got::reserve_slot_for_global): New function.
7263 (Output_data_got::add_got_entry): New function.
7264 (Output_data_got::add_got_entry_pair): New function.
7265 (Output_section::add_output_section_data): Edit FIXME.
7266 * output.h
7267 (Output_section_data_build::Output_section_data_build): New
7268 constructor with size parameter.
7269 (Output_data_space::Output_data_space): Likewise.
7270 (Output_data_got::Output_data_got): Initialize new data member; new
7271 constructor with size parameter.
7272 (Output_data_got::add_constant): Call add_got_entry.
7273 (Output_data_got::reserve_slot): New function.
7274 (Output_data_got::reserve_slot_for_global): New function.
7275 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7276 (Output_data_got::add_got_entry): New function.
7277 (Output_data_got::add_got_entry_pair): New function.
7278 (Output_data_got::free_list_): New data member.
7279 * target.h (Sized_target::init_got_plt_for_update): New function.
7280 (Sized_target::register_global_plt_entry): New function.
7281 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7282 Initialize new data member; call init; add constructor with PLT count.
7283 (Output_data_plt_x86_64::init): New function.
7284 (Output_data_plt_x86_64::add_relocation): New function.
7285 (Output_data_plt_x86_64::reserve_slot): New function.
7286 (Output_data_plt_x86_64::free_list_): New data member.
7287 (Target_x86_64::init_got_plt_for_update): New function.
7288 (Target_x86_64::register_global_plt_entry): New function.
7289 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7290 incremental updates.
7291 (Output_data_plt_x86_64::add_relocation): New function.
7292 * testsuite/object_unittest.cc (Object_test): Set default options.
7293
7294 2011-05-16 Ian Lance Taylor <iant@google.com>
7295
7296 * options.h (class General_options): Make -i a synonym for -r.
7297
7298 2011-05-16 Ian Lance Taylor <iant@google.com>
7299
7300 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7301
7302 2011-05-10 Cary Coutant <ccoutant@google.com>
7303
7304 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7305 strip_all (-s).
7306
7307 2011-05-06 Ian Lance Taylor <iant@google.com>
7308
7309 * layout.cc (Layout::layout): If the output section flags change,
7310 update the ordering.
7311
7312 2011-04-25 Cary Coutant <ccoutant@google.com>
7313
7314 * incremental-dump.cc (dump_incremental_inputs): Print local
7315 symbol info for each input file.
7316 * incremental.cc
7317 (Output_section_incremental_inputs::set_final_data_size): Add local
7318 symbol info to input file entries in incremental info.
7319 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7320 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7321 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7322 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7323 implementation.
7324 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7325 (Sized_incr_relobj::do_relocate): Write the local symbols.
7326 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7327 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7328 Adjust size of input file header.
7329 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7330 (Incremental_inputs_reader::get_local_symbol_count): New function.
7331 (Incremental_inputs_reader::get_input_section): Adjust size of input
7332 file header.
7333 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7334 (Sized_incr_relobj::This): New typedef.
7335 (Sized_incr_relobj::sym_size): New const data member.
7336 (Sized_incr_relobj::Local_symbol): New struct.
7337 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7338 (Sized_incr_relobj::do_local_symbol_offset): New function.
7339 (Sized_incr_relobj::local_symbol_count_): New data member.
7340 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7341 (Sized_incr_relobj::local_symbol_index_): New data member.
7342 (Sized_incr_relobj::local_symbol_offset_): New data member.
7343 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7344 (Sized_incr_relobj::local_symbols_): New data member.
7345 * object.h (Relobj::output_local_symbol_count): New function.
7346 (Relobj::local_symbol_offset): New function.
7347 (Relobj::do_output_local_symbol_count): New function.
7348 (Relobj::do_local_symbol_offset): New function.
7349 (Sized_relobj::do_output_local_symbol_count): New function.
7350 (Sized_relobj::do_local_symbol_offset): New function.
7351
7352 2011-04-22 Vladimir Simonov <sv@sw.ru>
7353
7354 * descriptors.cc (set_close_on_exec): New function.
7355 (Descriptors::open): Use set_close_on_exec.
7356 * output.cc (S_ISLNK): Define if not defined.
7357
7358 2011-04-22 Cary Coutant <ccoutant@google.com>
7359
7360 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7361 global symbol map.
7362 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7363 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7364 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7365 relocations.
7366 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7367 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7368 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7369 * incremental.h
7370 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7371 function.
7372 (Incremental_binary::apply_incremental_relocs): New function.
7373 (Incremental_binary::do_apply_incremental_relocs): New function.
7374 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7375 data member.
7376 (Sized_incremental_binary::add_global_symbol): New function.
7377 (Sized_incremental_binary::global_symbol): New function.
7378 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7379 (Sized_incremental_binary::symbol_map_): New data member.
7380 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7381 * target.h (Sized_target::apply_relocation): New function.
7382 * target-reloc.h (apply_relocation): New function.
7383 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7384
7385 2011-04-22 Doug Kwan <dougkwan@google.com>
7386
7387 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7388 flag of a SHT_ARM_EXIDX section.
7389 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7390 * testsuite/Makefile.in: Regenerate.
7391 * testsuite/arm_exidx_test.s: New file.
7392 * testsuite/arm_exidx_test.sh: Same.
7393
7394 2011-04-20 Cary Coutant <ccoutant@google.com>
7395
7396 PR gold/12689
7397 * archive.h (Incremental_archive_entry::Archive_member):
7398 Initialize arg_serial_ (second constructor).
7399
7400 2011-04-17 Ian Lance Taylor <iant@google.com>
7401
7402 * object.cc (Relocate_info::location): Simplify location string.
7403 * errors.cc (Errors::error_at_location): Don't print program
7404 name.
7405 (Errors::warning_at_location): Likewise.
7406 (Errors::undefined_symbol): Likewise.
7407 * testsuite/debug_msg.sh: Update accordingly.
7408
7409 2011-04-14 Cary Coutant <ccoutant@google.com>
7410
7411 * gold/layout.cc (Layout::symtab_section_offset): New function.
7412 * gold/layout.h (Layout::symtab_section_offset): New function.
7413 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7414
7415 2011-04-12 Ian Lance Taylor <iant@google.com>
7416
7417 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7418 with MREMAP_MAYMOVE.
7419 * output.h (class Output_file): Add map_is_allocated_ field.
7420 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7421 not available, provide stubs. If mremap is not available, #define
7422 it to gold_mremap.
7423 (MREMAP_MAYMOVE): Define if not defined.
7424 (Output_file::Output_file): Initialize map_is_allocated_.
7425 (Output_file::resize): Check map_is_allocated_.
7426 (Output_file::map_anonymous): If mmap fails, use malloc.
7427 (Output_file::unmap): Don't do anything for an anonymous map.
7428 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7429 is not available, provide stubs.
7430 (File_read::View::~View): Use free rather than delete[].
7431 (File_read::make_view): Use malloc rather than new[]. If mmap
7432 fails, use malloc.
7433 (File_read::find_or_make_view): Use malloc rather than new[].
7434 * gold.h: Remove HAVE_REMAP code.
7435 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7436 exists. Rename mremap to gold_mremap. If mmap is not available
7437 don't do anything.
7438 * configure, config.in: Rebuild.
7439
7440 2011-04-11 Ian Lance Taylor <iant@google.com>
7441
7442 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7443 initialize local variable v.
7444
7445 2011-04-11 Cary Coutant <ccoutant@google.com>
7446
7447 * archive.cc (Archive::include_member): Adjust call to
7448 report_object.
7449 (Add_archive_symbols::run): Track argument serial numbers.
7450 (Lib_group::include_member): Likewise.
7451 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7452 * archive.h (Incremental_archive_entry::Archive_member):
7453 Initialize arg_serial_.
7454 (Archive_member::arg_serial_): New data member.
7455 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7456 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7457 incremental link.
7458 (Sized_dynobj::do_for_all_local_got_entries): New function.
7459 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7460 function.
7461 * fileread.cc (get_mtime): New function.
7462 * fileread.h (get_mtime): New function.
7463 * gold.cc (queue_initial_tasks): Check for incremental update.
7464 (process_incremental_input): New function.
7465 (queue_middle_tasks): Don't force valid target for incremental
7466 update.
7467 * incremental-dump.cc (find_input_containing_global): Adjust
7468 size of symbol info entry.
7469 (dump_incremental_inputs): Dump argument serial number and
7470 in_system_directory flag; bias shndx by 1; print symbol names
7471 when dumping per-file symbol lists; use new symbol info readers.
7472 * incremental.cc
7473 (Output_section_incremental_inputs:update_data_size): New function.
7474 (Sized_incremental_binary::setup_readers): Setup input readers
7475 for each input file; build maps for files added from libraries
7476 and scripts.
7477 (Sized_incremental_binary::check_input_args): New function.
7478 (Sized_incremental_binary::do_check_inputs): Build map of argument
7479 serial numbers to input arguments.
7480 (Sized_incremental_binary::do_file_has_changed): Rename
7481 do_file_is_unchanged to this; compare file modification times.
7482 (Sized_incremental_binary::do_init_layout): New function.
7483 (Sized_incremental_binary::do_reserve_layout): New function.
7484 (Sized_incremental_binary::do_get_input_reader): Remove.
7485 (Sized_incremental_binary::get_symtab_view): New function.
7486 (Incremental_checker::can_incrementally_link_output_file): Remove.
7487 (Incremental_inputs::report_command_line): Exclude --debug options.
7488 (Incremental_inputs::report_archive_begin): Add parameter; track
7489 argument serial numbers; don't put input file entry for archive
7490 before archive members.
7491 (Incremental_inputs::report_archive_end): Put input file entry
7492 for archive after archive members.
7493 (Incremental_inputs::report_object): Add parameter; track argument
7494 serial numbers and in_system_directory flag.
7495 (Incremental_inputs::report_script): Add parameter; track argument
7496 serial numbers.
7497 (Output_section_incremental_inputs::set_final_data_size): Adjust
7498 size of symbol info entry; check for forwarding symbols.
7499 (Output_section_incremental_inputs::write_input_files): Write
7500 in_system_directory flag and argument serial number.
7501 (Output_section_incremental_inputs::write_info_blocks): Map section
7502 indices between incremental info and original input file; store
7503 input section index for each symbol.
7504 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7505 change operator() to visit().
7506 (class Global_got_offset_visitor): Likewise.
7507 (class Global_symbol_visitor_got_plt):
7508 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7509 classes.
7510 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7511 (Sized_incr_relobj::do_read_symbols): New function.
7512 (Sized_incr_relobj::do_layout): New function.
7513 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7514 (Sized_incr_relobj::do_add_symbols): New function.
7515 (Sized_incr_relobj::do_should_include_member): New function.
7516 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7517 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7518 (Sized_incr_relobj::do_section_size): New function.
7519 (Sized_incr_relobj::do_section_name): New function.
7520 (Sized_incr_relobj::do_section_contents): New function.
7521 (Sized_incr_relobj::do_section_flags): New function.
7522 (Sized_incr_relobj::do_section_entsize): New function.
7523 (Sized_incr_relobj::do_section_address): New function.
7524 (Sized_incr_relobj::do_section_type): New function.
7525 (Sized_incr_relobj::do_section_link): New function.
7526 (Sized_incr_relobj::do_section_info): New function.
7527 (Sized_incr_relobj::do_section_addralign): New function.
7528 (Sized_incr_relobj::do_initialize_xindex): New function.
7529 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7530 (Sized_incr_relobj::do_read_relocs): New function.
7531 (Sized_incr_relobj::do_gc_process_relocs): New function.
7532 (Sized_incr_relobj::do_scan_relocs): New function.
7533 (Sized_incr_relobj::do_count_local_symbols): New function.
7534 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7535 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7536 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7537 (Sized_incr_relobj::do_relocate): New function.
7538 (Sized_incr_relobj::do_set_section_offset): New function.
7539 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7540 (Sized_incr_dynobj::do_read_symbols): New function.
7541 (Sized_incr_dynobj::do_layout): New function.
7542 (Sized_incr_dynobj::do_add_symbols): New function.
7543 (Sized_incr_dynobj::do_should_include_member): New function.
7544 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7545 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7546 (Sized_incr_dynobj::do_section_size): New function.
7547 (Sized_incr_dynobj::do_section_name): New function.
7548 (Sized_incr_dynobj::do_section_contents): New function.
7549 (Sized_incr_dynobj::do_section_flags): New function.
7550 (Sized_incr_dynobj::do_section_entsize): New function.
7551 (Sized_incr_dynobj::do_section_address): New function.
7552 (Sized_incr_dynobj::do_section_type): New function.
7553 (Sized_incr_dynobj::do_section_link): New function.
7554 (Sized_incr_dynobj::do_section_info): New function.
7555 (Sized_incr_dynobj::do_section_addralign): New function.
7556 (Sized_incr_dynobj::do_initialize_xindex): New function.
7557 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7558 (make_sized_incremental_object): New function.
7559 (Incremental_library::copy_unused_symbols): New function.
7560 (Incremental_library::do_for_all_unused_symbols): New function.
7561 * incremental.h (enum Incremental_input_flags): New type.
7562 (class Incremental_checker): Remove.
7563 (Incremental_input_entry::Incremental_input_entry): Add argument
7564 serial number.
7565 (Incremental_input_entry::arg_serial): New function.
7566 (Incremental_input_entry::set_is_in_system_directory): New function.
7567 (Incremental_input_entry::is_in_system_directory): New function.
7568 (Incremental_input_entry::arg_serial_): New data member.
7569 (Incremental_input_entry::is_in_system_directory_): New data member.
7570 (class Script_info): Move here from script.h.
7571 (Script_info::Script_info): Add filename parameter.
7572 (Script_info::filename): New function.
7573 (Script_info::filename_): New data member.
7574 (Incremental_script_entry::Incremental_script_entry): Add argument
7575 serial number.
7576 (Incremental_object_entry::Incremental_object_entry): Likewise.
7577 (Incremental_object_entry::add_input_section): Build list of input
7578 sections with map to original shndx.
7579 (Incremental_object_entry::get_input_section_index): New function.
7580 (Incremental_object_entry::shndx_): New data member.
7581 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7582 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7583 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7584 serial number.
7585 (Incremental_inputs::report_archive_begin): Likewise.
7586 (Incremental_inputs::report_object): Likewise.
7587 (Incremental_inputs::report_script): Likewise.
7588 (class Incremental_global_symbol_reader): New class.
7589 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7590 and store flags and input file type.
7591 (Incremental_input_entry_reader::arg_serial): New function.
7592 (Incremental_input_entry_reader::type): Extract type from flags.
7593 (Incremental_input_entry_reader::is_in_system_directory): New function.
7594 (Incremental_input_entry_reader::get_input_section_count): Call
7595 accessor function for type.
7596 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7597 function for type; adjust size of global symbol entry.
7598 (Incremental_input_entry_reader::get_global_symbol_count): Call
7599 accessor function for type.
7600 (Incremental_input_entry_reader::get_object_count): Likewise.
7601 (Incremental_input_entry_reader::get_object_offset): Likewise.
7602 (Incremental_input_entry_reader::get_member_count): Likewise.
7603 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7604 (Incremental_input_entry_reader::get_member_offset): Likewise.
7605 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7606 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7607 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7608 (Incremental_input_entry_reader::get_global_symbol_reader): New
7609 function.
7610 (Incremental_input_entry_reader::get_output_symbol_index): New
7611 function.
7612 (Incremental_input_entry_reader::type_): Remove.
7613 (Incremental_input_entry_reader::flags_): New data member.
7614 (Incremental_inputs_reader::input_file_offset): New function.
7615 (Incremental_inputs_reader::input_file_index): New function.
7616 (Incremental_inputs_reader::input_file): Call input_file_offset.
7617 (Incremental_inputs_reader::input_file_at_offset): New function.
7618 (Incremental_relocs_reader::get_r_type): Reformat.
7619 (Incremental_relocs_reader::get_r_shndx): Reformat.
7620 (Incremental_relocs_reader::get_r_offset): Reformat.
7621 (Incremental_relocs_reader::data): New function.
7622 (Incremental_binary::Incremental_binary): Initialize new data members.
7623 (Incremental_binary::check_inputs): Add cmdline parameter.
7624 (Incremental_binary::file_is_unchanged): Remove.
7625 (Input_reader::arg_serial): New function.
7626 (Input_reader::get_unused_symbol_count): New function.
7627 (Input_reader::get_unused_symbol): New function.
7628 (Input_reader::do_arg_serial): New function.
7629 (Input_reader::do_get_unused_symbol_count): New function.
7630 (Input_reader::do_get_unused_symbol): New function.
7631 (Incremental_binary::input_file_count): New function.
7632 (Incremental_binary::get_input_reader): Change signature to use
7633 index instead of filename.
7634 (Incremental_binary::file_has_changed): New function.
7635 (Incremental_binary::get_input_argument): New function.
7636 (Incremental_binary::get_library): New function.
7637 (Incremental_binary::get_script_info): New function.
7638 (Incremental_binary::init_layout): New function.
7639 (Incremental_binary::reserve_layout): New function.
7640 (Incremental_binary::output_file): New function.
7641 (Incremental_binary::do_check_inputs): New function.
7642 (Incremental_binary::do_file_is_unchanged): Remove.
7643 (Incremental_binary::do_file_has_changed): New function.
7644 (Incremental_binary::do_init_layout): New function.
7645 (Incremental_binary::do_reserve_layout): New function.
7646 (Incremental_binary::do_input_file_count): New function.
7647 (Incremental_binary::do_get_input_reader): Change signature.
7648 (Incremental_binary::input_args_map_): New data member.
7649 (Incremental_binary::library_map_): New data member.
7650 (Incremental_binary::script_map_): New data member.
7651 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7652 new data members.
7653 (Sized_incremental_binary::output_section): New function.
7654 (Sized_incremental_binary::inputs_reader): Add const.
7655 (Sized_incremental_binary::symtab_reader): Add const.
7656 (Sized_incremental_binary::relocs_reader): Add const.
7657 (Sized_incremental_binary::got_plt_reader): Add const.
7658 (Sized_incremental_binary::get_symtab_view): New function.
7659 (Sized_incremental_binary::Inputs_reader): New typedef.
7660 (Sized_incremental_binary::Input_entry_reader): New typedef.
7661 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7662 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7663 (Sized_incremental_binary::do_file_has_changed): New function.
7664 (Sized_incremental_binary::do_init_layout): New function.
7665 (Sized_incremental_binary::do_reserve_layout): New function.
7666 (Sized_input_reader::Inputs_reader): Remove.
7667 (Sized_input_reader::Input_entry_reader): Remove.
7668 (Sized_input_reader::do_arg_serial): New function.
7669 (Sized_input_reader::do_get_unused_symbol_count): New function.
7670 (Sized_input_reader::do_get_unused_symbol): New function.
7671 (Sized_incremental_binary::do_input_file_count): New function.
7672 (Sized_incremental_binary::do_get_input_reader): Change signature;
7673 use index instead of filename.
7674 (Sized_incremental_binary::section_map_): New data member.
7675 (Sized_incremental_binary::input_entry_readers_): New data member.
7676 (class Sized_incr_relobj): New class.
7677 (class Sized_incr_dynobj): New class.
7678 (make_sized_incremental_object): New function.
7679 (class Incremental_library): New class.
7680 * layout.cc (Free_list::num_lists): New static data member.
7681 (Free_list::num_nodes): New static data member.
7682 (Free_list::num_removes): New static data member.
7683 (Free_list::num_remove_visits): New static data member.
7684 (Free_list::num_allocates): New static data member.
7685 (Free_list::num_allocate_visits): New static data member.
7686 (Free_list::init): New function.
7687 (Free_list::remove): New function.
7688 (Free_list::allocate): New function.
7689 (Free_list::dump): New function.
7690 (Free_list::print_stats): New function.
7691 (Layout_task_runner::run): Resize output file for incremental updates.
7692 (Layout::Layout): Initialize new data members.
7693 (Layout::set_incremental_base): New function.
7694 (Layout::init_fixed_output_section): New function.
7695 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7696 incremental updates.
7697 (Layout::create_gold_note): Do not create gold note section for
7698 incremental updates.
7699 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7700 for incremental updates.
7701 (Layout::set_section_offsets): For incremental updates, allocate space
7702 from free list.
7703 (Layout::create_symtab_sections): Layout with offsets relative to
7704 start of section; for incremental updates, allocate space from free
7705 list.
7706 (Layout::create_shdrs): For incremental updates, allocate space from
7707 free list.
7708 (Layout::finish_dynamic_section): For incremental updates, do not
7709 check --as-needed (fixed in subsequent patch).
7710 * layout.h (class Free_list): New class.
7711 (Layout::set_incremental_base): New function.
7712 (Layout::incremental_base): New function.
7713 (Layout::init_fixed_output_section): New function.
7714 (Layout::allocate): New function.
7715 (Layout::incremental_base_): New data member.
7716 (Layout::free_list_): New data member.
7717 * main.cc (main): Print Free_list statistics.
7718 * object.cc (Relobj::finalize_incremental_relocs): Add
7719 clear_counts parameter; clear counts only when clear_counts is set.
7720 (Sized_relobj::Sized_relobj): Initialize new base class.
7721 (Sized_relobj::do_layout): Don't report special sections.
7722 (Sized_relobj::do_for_all_local_got_entries): New function.
7723 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7724 symtab_off to all symbol table offsets.
7725 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7726 * object.h (class Got_offset_list): Move to top of file.
7727 (Object::Object): Allow case where input_file == NULL.
7728 (Object::~Object): Likewise.
7729 (Object::input_file): Assert that input_file != NULL.
7730 (Object::lock): Allow case where input_file == NULL.
7731 (Object::unlock): Likewise.
7732 (Object::is_locked): Likewise.
7733 (Object::token): Likewise.
7734 (Object::release): Likewise.
7735 (Object::is_incremental): New function.
7736 (Object::get_mtime): New function.
7737 (Object::for_all_local_got_entries): New function.
7738 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7739 (Object::set_is_in_system_directory): New function.
7740 (Object::is_in_system_directory): New function.
7741 (Object::do_is_incremental): New function.
7742 (Object::do_get_mtime): New function.
7743 (Object::do_for_all_local_got_entries): New function.
7744 (Object::is_in_system_directory_): New data member.
7745 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7746 (class Sized_relobj_base): New class.
7747 (class Sized_relobj): Derive from Sized_relobj_base.
7748 (class Sized_relobj::Symbols): Redeclare from base class.
7749 (class Sized_relobj::local_got_offset_list): Remove.
7750 (class Sized_relobj::Output_sections): Redeclare from base class.
7751 (class Sized_relobj::do_for_all_local_got_entries): New function.
7752 (class Sized_relobj::write_local_symbols): Add offset parameter.
7753 (class Sized_relobj::local_symbol_offset_): Update comment.
7754 (class Sized_relobj::local_dynsym_offset_): Update comment.
7755 * options.cc (Input_arguments::add_file): Remove const.
7756 * options.h (Input_file_argument::Input_file_argument):
7757 Initialize arg_serial_ (all constructors).
7758 (Input_file_argument::set_arg_serial): New function.
7759 (Input_file_argument::arg_serial): New function.
7760 (Input_file_argument::arg_serial_): New data member.
7761 (Input_arguments::Input_arguments): Initialize file_count_.
7762 (Input_arguments::add_file): Remove const.
7763 (Input_arguments::number_of_input_files): New function.
7764 (Input_arguments::file_count_): New data member.
7765 (Command_line::number_of_input_files): Call
7766 Input_arguments::number_of_input_files.
7767 * output.cc (Output_segment_headers::Output_segment_headers):
7768 Set current size.
7769 (Output_section::Input_section::current_data_size): New function.
7770 (Output_section::Output_section): Initialize new data members.
7771 (Output_section::add_input_section): Don't do merge sections for
7772 an incremental link; allocate space from free list for an
7773 incremental update.
7774 (Output_section::add_output_section_data): Allocate space from
7775 free list for an incremental update.
7776 (Output_section::update_data_size): New function.
7777 (Output_section::set_fixed_layout): New function.
7778 (Output_section::reserve): New function.
7779 (Output_segment::set_section_addresses): Remove const.
7780 (Output_segment::set_section_list_addresses): Remove const; allocate
7781 space from free list for an incremental update.
7782 (Output_segment::set_offset): Adjust size of RELRO segment for an
7783 incremental update.
7784 * output.h (Output_data::current_data_size): Move here from
7785 child classes.
7786 (Output_data::pre_finalize_data_size): New function.
7787 (Output_data::update_data_size): New function.
7788 (Output_section_headers::update_data_size): new function.
7789 (Output_section_data_build::current_data_size): Move to Output_data.
7790 (Output_data_strtab::update_data_size): New function.
7791 (Output_section::current_data_size): Move to Output_data.
7792 (Output_section::set_fixed_layout): New function.
7793 (Output_section::has_fixed_layout): New function.
7794 (Output_section::reserve): New function.
7795 (Output_section::update_data_size): New function.
7796 (Output_section::has_fixed_layout_): New data member.
7797 (Output_section::free_list_): New data member.
7798 (Output_segment::set_section_addresses): Remove const.
7799 (Output_segment::set_section_list_addresses): Remove const.
7800 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7801 New function.
7802 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7803 New function.
7804 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7805 parameter when calling Add_symbols constructor; store argument
7806 serial number for members of a lib group.
7807 (Add_symbols::locks): Allow case where token == NULL.
7808 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7809 (Read_member::~Read_member): New function.
7810 (Read_member::is_runnable): New function.
7811 (Read_member::locks): New function.
7812 (Read_member::run): New function.
7813 (Check_script::~Check_script): New function.
7814 (Check_script::is_runnable): New function.
7815 (Check_script::locks): New function.
7816 (Check_script::run): New function.
7817 (Check_library::~Check_library): New function.
7818 (Check_library::is_runnable): New function.
7819 (Check_library::locks): New function.
7820 (Check_library::run): New function.
7821 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7822 (Add_symbols::library_): New data member.
7823 (class Read_member): New class.
7824 (class Check_script): New class.
7825 (class Check_library): New class.
7826 * reloc.cc (Read_relocs::is_runnable): Allow case where
7827 token == NULL.
7828 (Read_relocs::locks): Likewise.
7829 (Scan_relocs::locks): Likewise.
7830 (Relocate_task::locks): Likewise.
7831 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7832 to clear counters.
7833 (Sized_relobj::incremental_relocs_scan): Fix comment.
7834 (Sized_relobj::do_relocate): Pass output file offset to
7835 write_local_symbols.
7836 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7837 from class declaration.
7838 * script.cc (read_input_script): Allocate Script_info; pass
7839 argument serial number to report_script.
7840 * script.h (class Script_info): Move to incremental.h.
7841 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7842 * symtab.h (Symbol_table::add_from_incrobj): New function.
7843 (Symbol_table::set_file_offset): New function.
7844
7845 2011-04-05 Cary Coutant <ccoutant@google.com>
7846
7847 * incremental-dump.cc (dump_incremental_inputs): Change signature
7848 to take a Sized_incremental_binary; change caller. Use readers
7849 in Sized_incremental_binary.
7850 * incremental.cc
7851 (Sized_incremental_binary::find_incremental_inputs_sections):
7852 Rename do_find_incremental_inputs_sections to this.
7853 (Sized_incremental_binary::setup_readers): New function.
7854 (Sized_incremental_binary::do_check_inputs): Check
7855 has_incremental_info_ flag; move setup code to setup_readers;
7856 use input readers.
7857 (Sized_incremental_binary::do_file_is_unchanged): New function.
7858 (Sized_incremental_binary::do_get_input_reader): New function.
7859 * incremental.h (class Incremental_binary): Move to end of file.
7860 (Incremental_binary::file_is_unchanged): New function.
7861 (Incremental_binary::do_file_is_unchanged): New function.
7862 (Incremental_binary::Input_reader): New class.
7863 (Incremental_binary::get_input_reader): New function.
7864 (class Sized_incremental_binary): Move to end of file.
7865 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7866 input section reader classes.
7867 (Sized_incremental_binary::has_incremental_info): New function.
7868 (Sized_incremental_binary::inputs_reader): New function.
7869 (Sized_incremental_binary::symtab_reader): New function.
7870 (Sized_incremental_binary::relocs_reader): New function.
7871 (Sized_incremental_binary::got_plt_reader): New function.
7872 (Sized_incremental_binary::do_file_is_unchanged): New function.
7873 (Sized_incremental_binary::Sized_input_reader): New class.
7874 (Sized_incremental_binary::get_input_reader): New function.
7875 (Sized_incremental_binary::find_incremental_inputs_sections):
7876 Rename do_find_incremental_inputs_sections to this.
7877 (Sized_incremental_binary::setup_readers): New function.
7878 (Sized_incremental_binary::has_incremental_info_): New data member.
7879 (Sized_incremental_binary::inputs_reader_): New data member.
7880 (Sized_incremental_binary::symtab_reader_): New data member.
7881 (Sized_incremental_binary::relocs_reader_): New data member.
7882 (Sized_incremental_binary::got_plt_reader_): New data member.
7883 (Sized_incremental_binary::current_input_file_): New data member.
7884
7885 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7886
7887 PR gold/12640
7888 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7889 violation.
7890
7891 2011-03-30 Cary Coutant <ccoutant@google.com>
7892
7893 * archive.cc (Archive::include_member): Adjust call to report_object.
7894 (Add_archive_symbols::run): Add script_info to call to
7895 report_archive_begin.
7896 (Lib_group::include_member): Adjust call to report_object.
7897 (Add_lib_group_symbols::run): Adjust call to report_object.
7898 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7899 blocks. Add object count for script input files.
7900 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7901 script_info parameter; change all callers.
7902 (Incremental_inputs::report_object): Add script_info parameter;
7903 change all callers.
7904 (Incremental_inputs::report_script): Store backpointer to
7905 incremental info entry.
7906 (Output_section_incremental_inputs::set_final_data_size): Record
7907 additional information for scripts.
7908 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7909 * incremental.h (Incremental_script_entry::add_object): New function.
7910 (Incremental_script_entry::get_object_count): New function.
7911 (Incremental_script_entry::get_object): New function.
7912 (Incremental_script_entry::objects_): New data member; adjust
7913 constructor.
7914 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7915 (Incremental_inputs::report_object): Add script_info parameter.
7916 (Incremental_inputs_reader::get_object_count): New function.
7917 (Incremental_inputs_reader::get_object_offset): New function.
7918 * options.cc (Input_arguments::add_file): Return reference to
7919 new input argument.
7920 * options.h (Input_argument::set_script_info): New function.
7921 (Input_argument::script_info): New function.
7922 (Input_argument::script_info_): New data member; adjust all
7923 constructors.
7924 (Input_file_group::add_file): Return reference to new input argument.
7925 (Input_file_lib::add_file): Likewise.
7926 (Input_arguments::add_file): Likewise.
7927 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7928 * script.cc (Parser_closure::Parser_closure): Add script_info
7929 parameter; adjust all callers.
7930 (Parser_closure::script_info): New function.
7931 (Parser_closure::script_info_): New data member.
7932 (read_input_script): Report scripts earlier to incremental info.
7933 (script_add_file): Set script_info in Input_argument.
7934 (script_add_library): Likewise.
7935 * script.h (Script_options::Script_info): Rewrite class.
7936
7937 2011-03-29 Cary Coutant <ccoutant@google.com>
7938
7939 * archive.cc (Library_base::should_include_member): Move
7940 method here from class Archive.
7941 (Archive::Archive): Initialize base class.
7942 (Archive::should_include_member): Move to base class.
7943 (Archive::do_for_all_unused_symbols): New function.
7944 (Add_archive_symbols::run): Remove redundant access to
7945 incremental_inputs.
7946 (Lib_group::Lib_group): Initialize base class.
7947 (Lib_group::do_filename): New function.
7948 (Lib_group::include_member): Pass pointer to Lib_group to
7949 report_object.
7950 (Lib_group::do_for_all_unused_symbols): New function.
7951 (Add_lib_group_symbols::run): Report archive information for
7952 incremental links.
7953 * archive.h (class Library_base): New base class.
7954 (class Archive): Derive from Library_base.
7955 (Archive::filename): Move to base class.
7956 (Archive::set_incremental_info): Likewise.
7957 (Archive::incremental_info): Likewise.
7958 (Archive::Should_include): Likewise.
7959 (Archive::should_include_member): Likewise.
7960 (Archive::Armap_entry): Remove.
7961 (Archive::Unused_symbol_iterator): Remove.
7962 (Archive::unused_symbols_begin): Remove.
7963 (Archive::unused_symbols_end): Remove.
7964 (Archive::do_filename): New function.
7965 (Archive::do_get_mtime): New function.
7966 (Archive::do_for_all_unused_symbols): New function.
7967 (Archive::task_): Move to base class.
7968 (Archive::incremental_info_): Likewise.
7969 (class Lib_group): Derive from Library_base.
7970 (Lib_group::do_filename): New function.
7971 (Lib_group::do_get_mtime): New function.
7972 (Lib_group::do_for_all_unused_symbols): New function.
7973 (Lib_group::task_): Move to base class.
7974 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7975 function.
7976 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7977 function.
7978 * incremental.cc (Incremental_inputs::report_archive_begin):
7979 Use Library_base; call library's get_mtime; add incremental inputs
7980 entry before members.
7981 (class Unused_symbol_visitor): New class.
7982 (Incremental_inputs::report_archive_end): Use Library_base; use
7983 visitor class to record unused symbols; don't add incremental inputs
7984 entry after members.
7985 (Incremental_inputs::report_object): Use Library_base.
7986 * incremental.h
7987 (Incremental_archive_entry::Incremental_archive_entry): Remove
7988 unused Archive parameter.
7989 (Incremental_inputs::report_archive_begin): Use Library_base.
7990 (Incremental_inputs::report_archive_end): Likewise.
7991 (Incremental_inputs::report_object): Likewise.
7992 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7993 function.
7994 * object.h (Object::for_all_global_symbols): New function.
7995 (Object::do_for_all_global_symbols): New function.
7996 (Sized_relobj::do_for_all_global_symbols): New function.
7997 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7998 function.
7999 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8000 function.
8001
8002 2011-03-27 Ian Lance Taylor <iant@google.com>
8003
8004 * archive.cc (Archive::interpret_header): Return -1 if something
8005 goes wrong. Change callers accordingly.
8006
8007 2011-03-25 Cary Coutant <ccoutant@google.com>
8008
8009 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8010 * testsuite/Makefile.in: Regenerate.
8011
8012 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8013
8014 * plugin.cc (get_view): New.
8015 (Plugin::load): Pass get_view to the plugin.
8016 (Plugin_manager::get_view): New.
8017
8018 2011-03-21 Ian Lance Taylor <iant@google.com>
8019
8020 * testsuite/final_layout.sh: Rewrite to not use dc.
8021 * testsuite/relro_test.sh: Fail if dc is not present.
8022
8023 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8024
8025 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8026 Change == to -eq.
8027 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8028 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8029 Change == to -eq.
8030 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8031 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8032
8033 2011-03-14 Ian Lance Taylor <iant@google.com>
8034
8035 * script-sections.cc (Sort_output_sections::script_compare):
8036 Rename from is_before, change return type.
8037 (Sort_output_sections::operator()): Adjust accordingly.
8038
8039 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8040
8041 PR gold/12572
8042 * testsuite/odr_violation2.cc: Add comment to make all error line
8043 numbers double digits.
8044 * testsuite/debug_msg.sh: Adjust expected errors.
8045
8046 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8047
8048 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8049 but mark earlier ones as non-canonical
8050 (offset_to_iterator): Update search target and example
8051 (do_addr2line): Return extra lines in a vector*
8052 (format_file_lineno): Extract from do_addr2line
8053 (one_addr2line): Add vector* out-param
8054 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8055 when a lineno entry appeared last for its instruction
8056 (Dwarf_line_info): Add vector* out-param
8057 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8058 * symtab.cc (Odr_violation_compare): Include the lineno in the
8059 comparison again.
8060 (linenos_from_loc): New. Combine the canonical line for an
8061 address with its other lines.
8062 (True_if_intersect): New. Helper functor to make
8063 std::set_intersection a query.
8064 (detect_odr_violations): Compare sets of lines instead of just
8065 one line for each function. This became less deterministic, but
8066 has fewer false positives.
8067 * symtab.h: Declarations.
8068 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8069 mix an optimized and non-optimized object in the same binary
8070 (odr_violation2.so): Same.
8071 * testsuite/Makefile.in: Regenerate from Makefile.am.
8072 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8073 * testsuite/debug_msg.sh: Update line numbers and add
8074 assertions.
8075 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8076 non-optimized context.
8077 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8078 isn't inlined, and use OdrDerived in an optimized context.
8079 * testsuite/odr_header1.h: Defines OdrDerived, where
8080 optimization will change the
8081 first-instruction-in-the-destructor's file and line number.
8082 * testsuite/odr_header2.h: Defines OdrBase.
8083
8084 2011-03-09 Ian Lance Taylor <iant@google.com>
8085
8086 * fileread.cc (File_read::clear_views): Don't delete the whole
8087 file view.
8088
8089 2011-03-08 Ian Lance Taylor <iant@google.com>
8090
8091 PR gold/12525
8092 * fileread.cc: #include <climits>.
8093 (GOLD_IOV_MAX): Define.
8094 (File_read::read_multiple): Limit number of entries by iov_max.
8095 * fileread.h (class File_read): Always set max_readv_entries to
8096 128.
8097
8098 2011-03-07 Ian Lance Taylor <iant@google.com>
8099
8100 PR gold/12525
8101 * options.h (class General_options): Add -dy and -dn.
8102
8103 2011-03-02 Cary Coutant <ccoutant@google.com>
8104
8105 * testsuite/script_test_9.t: Add TLS segment.
8106
8107 2011-03-02 Simon Baldwin <simonb@google.com>
8108
8109 * configure.ac: Add check for gnu_indirect_function support in
8110 the toolchain building binutils.
8111 * configure: Rebuild.
8112
8113 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8114
8115 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8116 plugin only symbols.
8117 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8118 in plugin files as not needed in the symbol table.
8119
8120 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8121
8122 * output.cc (Output_section::add_input_section): Delay fill
8123 generation for section ordering.
8124
8125 2011-02-09 Ian Lance Taylor <iant@google.com>
8126
8127 PR gold/12316
8128 * object.h (class Sized_relobj): Remove clear_local_symbols.
8129 * reloc.cc (Sized_relobj::do_relocate): Don't call
8130 clear_local_symbols.
8131
8132 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8133
8134 * plugin.cc (is_visible_from_outside): Return true for symbols
8135 in the -u option.
8136
8137 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8138
8139 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8140 filename.
8141
8142 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8143
8144 * icf.h (is_section_foldable_candidate): Change type of parameter
8145 to std::string.
8146 * icf.cc (Icf::find_identical_sections): Change type of local variable
8147 section_name to be std::string.
8148 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8149
8150 2011-01-25 Ian Lance Taylor <iant@google.com>
8151
8152 * script.cc (script_add_extern): Rewrite to use
8153 add_symbol_reference.
8154
8155 2011-01-25 Doug Kwan <dougkwan@google.com>
8156
8157 * icf.cc (get_section_contents): Always lock section's object.
8158
8159 2011-01-24 Ian Lance Taylor <iant@google.com>
8160
8161 * options.h (class General_options): Accept
8162 --no-detect-odr-violations.
8163
8164 2011-01-24 Ian Lance Taylor <iant@google.com>
8165
8166 * version.cc (version_string): Bump to 1.11.
8167
8168 2011-01-24 Ian Lance Taylor <iant@google.com>
8169
8170 * plugin.cc (class Plugin_rescan): Define new class.
8171 (Plugin_manager::claim_file): Set any_claimed_.
8172 (Plugin_manager::save_archive): New function.
8173 (Plugin_manager::save_input_group): New function.
8174 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8175 necessary.
8176 (Plugin_manager::new_undefined_symbol): New function.
8177 (Plugin_manager::rescan): New function.
8178 (Plugin_manager::rescannable_defines): New function.
8179 (Plugin_manager::add_input_file): Set any_added_.
8180 * plugin.h (class Plugin_manager): define new fields rescannable_,
8181 undefined_symbols_, any_claimed_, and any_added_. Declare
8182 Plugin_rescan as friend. Declare new functions.
8183 (Plugin_manager::Rescannable): Define type.
8184 (Plugin_manager::Rescannable_list): Define type.
8185 (Plugin_manager::Undefined_symbol_list): Define type.
8186 (Plugin_manager::Plugin_manager): Initialize new fields.
8187 * archive.cc (Archive::defines_symbol): New function.
8188 (Add_archive_symbols::run): Pass archive to plugins if any.
8189 * archive.h (class Archive): Declare defines_symbol.
8190 * readsyms.cc (Input_group::~Input_group): New function.
8191 (Finish_group::run): Pass input_group to plugins if any.
8192 * readsyms.h (class Input_group): Declare destructor.
8193 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8194 any.
8195
8196 2011-01-10 Ian Lance Taylor <iant@google.com>
8197
8198 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8199 section as relro.
8200 (Layout::set_segment_offsets): Reset increase_relro before calling
8201 set_section_addresses a second time.
8202
8203 2011-01-04 Cary Coutant <ccoutant@google.com>
8204
8205 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8206 sections before NOBITS sections.
8207
8208 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8209
8210 * version.cc (print_version): Update copyright to 2011.
8211
8212 2010-12-23 Cary Coutant <ccoutant@google.com>
8213
8214 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8215 of OS to this->add. Add OD parameter to second form of the function.
8216
8217 2010-12-20 Ian Lance Taylor <iant@google.com>
8218
8219 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8220 second of two consecutive entries with same offset.
8221
8222 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8223
8224 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8225 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8226 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8227 to avoid unneeded links against $(LDADD).
8228 * testsuite/Makefile.in: Regenerate.
8229
8230 2010-12-15 Ian Lance Taylor <iant@google.com>
8231
8232 PR gold/12324
8233 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8234 for R_X86_64_32 and R_X86_64_PC32.
8235 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8236 ver_matching_def_pic.o.
8237 (ver_matching_def_pic.o): New target.
8238
8239 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8240
8241 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8242 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8243 Move definition before File_read::View member definitions.
8244 (File_read::View::~View): Initialize and hold lock before
8245 updating current_mapped_bytes.
8246
8247 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8248
8249 * dwarf_reader.cc: Remove outdated comment.
8250 * gold-threads.cc: Fix typo in error message.
8251 * archive.cc: Fix typos in comments.
8252 * archive.h: Likewise.
8253 * arm-reloc-property.cc: Likewise.
8254 * arm-reloc-property.h: Likewise.
8255 * arm-reloc.def: Likewise.
8256 * arm.cc: Likewise.
8257 * attributes.h: Likewise.
8258 * cref.cc: Likewise.
8259 * ehframe.cc: Likewise.
8260 * fileread.h: Likewise.
8261 * gold.h: Likewise.
8262 * i386.cc: Likewise.
8263 * icf.cc: Likewise.
8264 * incremental.h: Likewise.
8265 * int_encoding.cc: Likewise.
8266 * layout.h: Likewise.
8267 * main.cc: Likewise.
8268 * merge.h: Likewise.
8269 * object.cc: Likewise.
8270 * object.h: Likewise.
8271 * options.cc: Likewise.
8272 * readsyms.cc: Likewise.
8273 * reduced_debug_output.cc: Likewise.
8274 * reloc.cc: Likewise.
8275 * script-sections.cc: Likewise.
8276 * sparc.cc: Likewise.
8277 * symtab.h: Likewise.
8278 * target-reloc.h: Likewise.
8279 * target.cc: Likewise.
8280 * target.h: Likewise.
8281 * timer.cc: Likewise.
8282 * timer.h: Likewise.
8283 * x86_64.cc: Likewise.
8284
8285 2010-12-09 Cary Coutant <ccoutant@google.com>
8286
8287 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8288 stack.
8289 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8290 parameter; change all callers.
8291 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8292 * options.h (warn_execstack): New option.
8293
8294 2010-12-07 Doug Kwan <dougkwan@google.com>
8295
8296 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8297 like function call relocations.
8298
8299 2010-12-07 Ian Lance Taylor <iant@google.com>
8300
8301 * archive.cc (Archive::get_elf_object_for_member): Permit
8302 punconfigured to be NULL.
8303 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8304 (Archive::include_member): Pass NULL to get_elf_object_for_member
8305 if we searched for the archive and this is the first included
8306 object.
8307
8308 2010-12-01 Ian Lance Taylor <iant@google.com>
8309
8310 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8311 track_relocs_type_ field.
8312 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8313 Set track_relocs_type_.
8314 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8315 contents when using RELA relocs.
8316 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8317 reloc_map_.
8318 * reloc.cc (Track_relocs::next_addend): New function.
8319 * reloc.h (class Track_relocs): Declare next_addend.
8320
8321 2010-12-01 Ian Lance Taylor <iant@google.com>
8322
8323 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8324 virtual destructor.
8325
8326 2010-12-01 Ian Lance Taylor <iant@google.com>
8327
8328 * README: Update compilers known to work and fail.
8329
8330 2010-11-23 Matthias Klose <doko@ubuntu.com>
8331
8332 * configure.in: For --enable-gold, handle value `default' instead of
8333 `both*'. Always install ld as ld.bfd, install as ld if gold is
8334 not the default.
8335 * configure: Regenerate.
8336
8337 2010-11-18 Doug Kwan <dougkwan@google.com>
8338
8339 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8340 and right_alignment to be zero. Store result alignment only if it is
8341 greater than existing alignment.
8342
8343 2010-11-16 Cary Coutant <ccoutant@google.com>
8344
8345 PR gold/12220
8346 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8347 Check for ".zdebug_line".
8348
8349 2010-11-16 Doug Kwan <dougkwan@google.com>
8350 Cary Coutant <ccoutant@google.com>
8351
8352 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8353 by reference; adjust all callers.
8354 * output.cc (Output_segment::set_section_addresses): Adjust references
8355 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8356 list is empty.
8357 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8358 end at page boundary.
8359
8360 2010-11-16 Cary Coutant <ccoutant@google.com>
8361
8362 PR gold/12220
8363 * layout.cc (Layout::choose_output_section): Transform names of
8364 compressed sections even when using a script with a SECTIONS clause.
8365 (Layout::output_section_name): Remove code to transform
8366 compressed debug section names.
8367 * output.cc (Output_section::add_input_section): Use uncompressed
8368 section size when tracking input sections.
8369
8370 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8371
8372 * symtab.h (Symbol::NON_PIC_REF): Remove.
8373 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8374 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8375 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8376 (Symbol::use_plt_offset): Take a flags argument and pass it
8377 directly to needs_dynamic_reloc. Restrict check for undefined
8378 weak symbols to function calls.
8379 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8380 (Target_arm::Scan::global): Use it.
8381 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8382 (Target_arm::Relocate::relocate): Likewise.
8383 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8384 parameter with an r_type parameter. Use get_reference_flags
8385 to get the flags.
8386 (Target_arm::Relocate::relocate): Update accordingly.
8387 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8388 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8389 (Target_i386::Scan::global): Likewise.
8390 (Target_i386::Relocate::relocate): Likewise.
8391 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8392 parameter with an r_type parameter. Use get_reference_flags
8393 to get the flags.
8394 (Target_i386::Relocate::relocate): Update accordingly.
8395 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8396 (Target_powerpc::Scan::global): Use it.
8397 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8398 (Target_powerpc::Relocate::relocate): Likewise.
8399 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8400 (Target_sparc::Scan::global): Use it.
8401 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8402 (Target_sparc::Relocate::relocate): Likewise.
8403 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8404 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8405 (Target_x86_64::Scan::global): Likewise.
8406 (Target_x86_64::Relocate::relocate): Likewise.
8407
8408 2010-11-08 Doug Kwan <dougkwan@google.com>
8409 Cary Coutant <ccoutant@google.com>
8410
8411 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8412 (Arm_exidx_merge_section::section_contents_): New data member.
8413 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8414 (Arm_input_section::~Arm_input_section): De-allocate memory.
8415 (Arm_input_section::original_contents_): New data member.
8416 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8417 in parameters instead of calling Object::section_contents without
8418 locking.
8419 (Arm_output_section::group_section): New parameter TASK. Pass it
8420 to callees that need locking objects.
8421 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8422 to lock EXIDX input sections. Fix a formatting issue. Call
8423 Arm_exidx_merged_section::build_contents to create merged section
8424 contents.
8425 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8426 to lock object of stub table owner.
8427 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8428 TEXT_SIZE to initialize data member TEXT_SIZE_.
8429 (Arm_exidx_input_section::addralign): Fix typo in comment.
8430 (Arm_exidx_input_section::text_size): New method.
8431 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8432 that require locking objects. Lock objects before scanning for stubs
8433 and updating local symbols.
8434 (Arm_input_section<big_endian>::init): Copy contents of original
8435 input section.
8436 (Arm_input_section<big_endian>::do_write): Use saved contents of
8437 original input section instead of calling Object::section_contents
8438 without locking.
8439 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8440 size without calling Object::section_size().
8441 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8442 for size. Allocate a buffer for merged EXIDX entries.
8443 (Arm_exidx_merged_section::build_contents): New method.
8444 (Arm_exidx_merged_section::do_write): Move merge section contents
8445 building code to Arm_exidx_merged_section::build_contetns. Write
8446 out contetns in buffer instead of building it on the fly.
8447 (Arm_relobj::make_exidx_input_section): Also pass text section size
8448 to Arm_exidx_input_section constructor.
8449 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8450 (Arm_dynobj::do_read_symbols): Fix memory leak.
8451 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8452 * target.h: (class Task): Add forward declaration.
8453 (Target::relax): Add new parameter TASK and pass it to
8454 Target::do_relax().
8455 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8456
8457 2010-11-05 Cary Coutant <ccoutant@google.com>
8458
8459 PR gold/10708
8460 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8461 object when reading from the file.
8462 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8463 second layout pass.
8464 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8465 when reading section contents.
8466 (get_section_contents): Likewise.
8467 (icf::find_identical_sections): Likewise.
8468 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8469 object when reading from the file.
8470 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8471 the object when doing deferred section layout.
8472
8473 2010-11-03 Nick Clifton <nickc@redhat.com>
8474
8475 PR gold/12001
8476 * script.h (class Symbol_assignment: name): New member. Returns
8477 the name of the symbol.
8478 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8479 Returns true if the given symbol name is on the list of
8480 assignments wating to be processed.
8481 * archive.cc (should_incldue_member): If the symbol is undefined,
8482 check to see if it is on the list of symbols pending assignment.
8483
8484 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8485
8486 * script-sections.cc (Script_sections::find_memory_region): Check
8487 for a NULL output section pointer.
8488
8489 2010-10-29 Doug Kwan <dougkwan@google.com>
8490
8491 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8492 Output_section::add_relaxed_input_section.
8493 * output.cc (Output_section::add_relaxed_input_section): Add new
8494 arguments LAYOUT and NAME. Set section order index.
8495 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8496 Copy section order index.
8497 * output.h (Output_section::add_relaxed_input_section): Add new
8498 arguments LAYOUT and NAME.
8499
8500 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8501
8502 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8503 NATIVE_OR_CROSS_LINKER.
8504 * testsuite/Makefile.in: Regenerate.
8505
8506 2010-10-20 Doug Kwan <dougkwan@google.com>
8507
8508 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8509 without SHF_LINK_ORDER flags.
8510 * layout.cc (Layout::choose_output_section): Do not filter
8511 SHF_LINK_ORDER flag in a relocatable link.
8512
8513 2010-10-17 Cary Coutant <ccoutant@google.com>
8514
8515 * output.h (Output_segment::set_section_addresses): Change function
8516 signature. Update all callers.
8517 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8518 sections.
8519 (Output_segment::set_section_addresses): Align after last TLS
8520 section. Add padding before last relro section instead of after.
8521
8522 2010-10-17 Doug Kwan <dougkwan@google.com>
8523
8524 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8525 GOT output section to be writable.
8526
8527 2010-10-14 Cary Coutant <ccoutant@google.com>
8528
8529 * debug.h (DEBUG_INCREMENTAL): New flag.
8530 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8531 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8532 mode.
8533 * incremental.cc (report_command_line): Ignore all forms of
8534 --incremental.
8535 * layout.cc (Layout::Layout): Check parameters for incremental link
8536 mode.
8537 * options.cc (General_options::parse_incremental): New function.
8538 (General_options::parse_no_incremental): New function.
8539 (General_options::parse_incremental_full): New function.
8540 (General_options::parse_incremental_update): New function.
8541 (General_options::incremental_mode_): New data member.
8542 (General_options::finalize): Check incremental_mode_.
8543 * options.h (General_options): Update help text for --incremental.
8544 Add --no-incremental, --incremental-full, --incremental-update.
8545 (General_options::Incremental_mode): New enum type.
8546 (General_options::incremental_mode): New function.
8547 (General_options::incremental_mode_): New data member.
8548 * parameters.cc (Parameters::incremental_mode_): New data member.
8549 (Parameters::set_options): Set incremental_mode_.
8550 (Parameters::set_incremental_full): New function.
8551 (Parameters::incremental): New function.
8552 (Parameters::incremental_update): New function.
8553 (set_parameters_incremental_full): New function.
8554 * parameters.h (Parameters::set_incremental_full): New function.
8555 (Parameters::incremental): New function.
8556 (Parameters::incremental_update): New function.
8557 (Parameters::incremental_mode_): New data member.
8558 (set_parameters_incremental_full): New function.
8559 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8560 incremental link mode.
8561 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8562 (Sized_relobj::do_relocate_sections): Likewise.
8563 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8564 option.
8565 * testsuite/Makefile.in: Regenerate.
8566 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8567
8568 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8569
8570 * script-sections.h (class Script_sections): Make
8571 Sections_elements typedef public.
8572 * script-sections.cc (class Sort_output_sections): Add elements_
8573 field. Add constructor which sets it; change all callers.
8574 (Sort_output_sections::is_before): New function.
8575 (Sort_output_sections::operator()): Call is_before.
8576 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8577 conditional.
8578 * testsuite/script_test_10.sh: New test. Test script section
8579 order.
8580 * testsuite/script_test_10.t: Likewise.
8581 * testsuite/script_test_10.s: Likewise.
8582 * testsuite/Makefile.am: Wrap the cross linker tests and the
8583 common tests into NATIVE_OR_CROSS_LINKER.
8584 (check_SCRIPTS): Add script_test_10.sh.
8585 (check_DATA): Add script_test_10.stdout.
8586 (script_test_10.o, script_test_10): New targets.
8587 (script_test_10.stdout): New target.
8588 * configure, testsuite/Makefile.in: Regenerate.
8589
8590 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8591
8592 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8593 error for the deprecated relocations.
8594 (Target_arm::Scan::global): Likewise.
8595 (Target_arm::Relocate::relocate): Likewise.
8596
8597 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8598
8599 * fileread.cc (Input_file::find_file): Initialize *found_name
8600 and *namep when using the fallback search for case 4.
8601
8602 2010-10-11 Cary Coutant <ccoutant@google.com>
8603
8604 * options.h (class General_options): Redefine -z lazy as an alias for
8605 the negation of -z now.
8606
8607 2010-10-11 Ian Lance Taylor <iant@google.com>
8608
8609 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8610 binding.
8611
8612 2010-10-06 Nick Clifton <nickc@redhat.com>
8613
8614 * script-sections.cc(class Memory_region): Remove
8615 current_lma_offset_ field. Rename current_vma_offset_ to
8616 current_offset_. Add last_section_ field.
8617 (Memory_region::get_current_vma_address): Rename to
8618 get_current_address.
8619 (Memory_region::get_current_lma_address): Delete.
8620 (Memory_region::increment_vma_offset): Rename to
8621 increment_offset.
8622 (Memory_region::increment_lma_offset): Delete.
8623 (Memory_region::attributes_compatible): New method. Returns
8624 true if the provided section is compatible with the region.
8625 (Memory_region::get_last_section): New method. Returns the last
8626 section to use the region.
8627 (Memory_region::set_last_section): New method. Stores the last
8628 section to use the region.
8629 (Script_sections::block_in_region): New method. Returns true if
8630 a block of memory is contained within a region.
8631 (Script_sections::find_memory_region): New method. Locates a
8632 memory region to be used to set a VMA or LMA address.
8633 (Output_section_definition::set_section_addresses): Add code to
8634 check for addresses set by memory regions.
8635 (Output_segment::set_section_addresses): Remove memory region
8636 walking code.
8637 (Script_sections::create_segment): Add a warning if a header
8638 segment is created outside of any region.
8639 * script-sections.h (class Script_sections): Add prototypes for
8640 find_memory_region and block_in_region methods.
8641 * testsuite/memory_test.s: Use .long instead of .word.
8642 * testsuite/memory_test.t: Add some more output sections.
8643 * testsuite/memory_test.sh: Update expected output.
8644
8645 2010-10-02 Doug Kwan <dougkwan@google.com>
8646
8647 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8648 defintion to symtab.h
8649 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8650 declaration to defintion.
8651
8652 2010-10-01 Nick Clifton <nickc@redhat.com>
8653
8654 * expression.cc (eval): Replace dummy argument with NULL.
8655 (eval_maybe_dot): Check for a NULL result section pointer.
8656 (Symbol_expression::value): Likewise.
8657 (Dot_expression::value): Likewise.
8658 (BINARY_EXPRESSION): Likewise.
8659 (Max_expression::value): Likewise.
8660 (Min_expression::value): Likewise.
8661 (Absolute_expression::value): Likewise.
8662 (Addr_expression::value_from_output_section): Likewise.
8663 (Loaddddr_expression::value_from_output_section): Likewise.
8664 (Segment_start_expression::value): Likewise.
8665 * script-sections.cc
8666 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8667 argument with NULL.
8668 (Sections_elememt_dot_assignment::set_section_addresses):
8669 Likewise.
8670 (Output_data_expression::do_write_to_buffer): Likewise.
8671 (Output_section_definition::finalize_symbols): Likewise.
8672 (Output_section_definition::set_section_addresses): Likewise.
8673
8674 2010-09-30 Doug Kwan <dougkwan@google.com>
8675
8676 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8677
8678 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8679
8680 * target.h (Target::can_icf_inline_merge_sections): New virtual
8681 function.
8682 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8683 virtual function.
8684 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8685 virtual function.
8686 * icf.cc (get_section_contents): Inline merge sections only when
8687 target allows it.
8688
8689 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8690
8691 * configure: Regenerate.
8692
8693 2010-09-17 Ian Lance Taylor <iant@google.com>
8694
8695 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8696 * testsuite/Makefile.am (memory_test.o): New target.
8697 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8698 memory_test.t.
8699 * testsuite/Makefile.in: Rebuild.
8700
8701 2010-09-17 Doug Kwan <dougkwan@google.com>
8702
8703 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8704 defintion if relocation uses GOT entries of the symbol.
8705 * testsuite/icf_safe_test.sh: Fix test.
8706 * testsuite/icf_safe_so_test.sh: Fix test.
8707
8708 2010-09-16 Cary Coutant <ccoutant@google.com>
8709
8710 * script_sections.cc (class Memory_region): Remove "NULL" from
8711 vector initializations.
8712
8713 2010-09-15 Cary Coutant <ccoutant@google.com>
8714
8715 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8716 Resolve forwarding symbols.
8717
8718 2010-09-15 Doug Kwan <dougkwan@google.com>
8719
8720 * gold/testsuite/script_test_3.t: Add ARM special sections.
8721 * gold/testsuite/script_test_4.t: Same.
8722 * gold/testsuite/script_test_5.t: Same.
8723 * gold/testsuite/script_test_6.t: Same.
8724 * gold/testsuite/script_test_7.t: Same.
8725 * gold/testsuite/script_test_7.t: Same.
8726 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8727
8728 2010-09-14 Cary Coutant <ccoutant@google.com>
8729
8730 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8731 (Target_x86_64::Relocate::relocate_tls): Replace check for
8732 saw_tls_block_reloc_ with test for executable section.
8733
8734 2010-09-12 Cary Coutant <ccoutant@google.com>
8735
8736 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8737 position-independent executables to shared libraries need dynamic
8738 relocations.
8739 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8740 position-independent executables.
8741 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8742 * testsuite/Makefile.in: Regenerate.
8743
8744 2010-09-10 Nick Clifton <nickc@redhat.com>
8745
8746 PR gold/11997
8747 * testsuite/memory_test.t: Discard any sections that are not
8748 needed.
8749
8750 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8751
8752 PR gold/11996
8753 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8754 "This::" to work around a bug in gcc 4.2.
8755
8756 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8757
8758 2010-09-09 Rafael Espindola <espindola@google.com>
8759
8760 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8761 sections with different PF_X flags in the same segment.
8762 (Layout::find_first_load_seg): Search all segments to find the first
8763 one.
8764 * options.h (rosegment): New.
8765
8766 2010-09-08 Rafael Espindola <espindola@google.com>
8767
8768 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8769
8770 2010-09-08 Doug Kwan <dougkwan@google.com>
8771
8772 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8773 (Arm_relobj::do_relocate_sections): Add new parameter for output
8774 file to match the parent.
8775 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8776 of local symbols instead of input values. Update code to track
8777 changes in gold::relocate_section.
8778 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8779 (Sized_relobj::compute_final_local_value_internal): New methods.
8780 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8781 body into private version of Sized_relobj::compute_final_local_value.
8782 Call the inline method.
8783 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8784 merged symbol value if there is one.
8785 (Symbol_value::has_output_value): New method defintiion.
8786 (Sized_relobj::Compute_final_local_value_status): New enum type.
8787 (Sized_relobj::compute_final_local_value): New methods.
8788 (Sized_relobj::compute_final_local_value_internal): New methods.
8789 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8790 and arm_cortex_a8.sh.
8791 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8792 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8793 New tests.
8794 * Makefile.in: Regenerate.
8795 * testsuite/arm_bl_out_of_range.s: Update test.
8796 * testsuite/thumb_bl_out_of_range.s: Ditto.
8797 * testsuite/thumb_blx_out_of_range.s: Ditto.
8798 * testsuite/arm_branch_out_of_range.sh: New file.
8799 * testsuite/arm_cortex_a8.sh: Ditto.
8800 * testsuite/arm_cortex_a8_b.s: Ditto.
8801 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8802 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8803 * testsuite/arm_cortex_a8_bl.s: Ditto.
8804 * testsuite/arm_cortex_a8_blx.s: Ditto.
8805 * testsuite/arm_cortex_a8_local.s: Ditto.
8806 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8807 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8808
8809 2010-09-08 Rafael Espindola <espindola@google.com>
8810
8811 * Makefile.am (memory_test.stdout): Run readelf with -W.
8812 * Makefile.in: Regenerate.
8813 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8814 64 bit output.
8815
8816 2010-09-08 Rafael Espindola <espindola@google.com>
8817
8818 * script-sections.cc (Script_sections::add_memory_region): Convert
8819 field precision to int.
8820 * script.cc (script_set_section_region, script_set_section_region):
8821 Convert field precision to int.
8822
8823 2010-09-08 Rafael Espindola <espindola@google.com>
8824
8825 * arm.cc (do_finalize_sections): Create the __exidx_start and
8826 __exdix_end symbols even when the section is missing.
8827
8828 2010-09-08 Nick Clifton <nickc@redhat.com>
8829
8830 * README: Remove claim that MEMORY is not supported.
8831 * expression.cc (script_exp_function_origin)
8832 (script_exp_function_length): Move from here to ...
8833 * script.cc: ... here.
8834 (script_set_section_region, script_add_memory)
8835 (script_parse_memory_attr, script_include_directive): New
8836 functions.
8837 * script-sections.cc
8838 (class Memory_region): New class.
8839 (class Output_section_definition): Add set_memory_region,
8840 set_section_vma, set_section_lma and get_section_name methods.
8841 (class Script_Sections): Add add_memory_region,
8842 find_memory_region, find_memory_region_origin,
8843 find_memory_region_length and set_memory_region methods.
8844 Have set_section_addresses method walk the list of set memory
8845 regions.
8846 Extend the print methos to display memory regions.
8847 * script-sections.h: Add prototypes for new methods.
8848 Add enum for MEMORY region attributes.
8849 * yyscript.y: Add support for parsing MEMORY regions.
8850 * script-c.h: Add prototypes for new functions.
8851 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8852 * testsuite/Makefile.in: Regenerate.
8853 * testsuite/memory_test.sh: New script.
8854 * testsuite/memory_test.s: New assembler source file.
8855 * testsuite/memory_test.t: New linker script.
8856
8857 2010-08-27 Doug Kwan <dougkwan@google.com>
8858
8859 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8860 reference override an existing dynamic weak reference.
8861 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8862 * testsuite/Makefile.in: Regenerate.
8863 * testsuite/dyn_weak_ref.sh: New file.
8864 * testsuite/dyn_weak_ref_1.c: Ditto.
8865 * testsuite/dyn_weak_ref_2.c: Ditto.
8866
8867 2010-08-27 Ian Lance Taylor <iant@google.com>
8868
8869 * incremental.h (class Incremental_input_entry): Add virtual
8870 destructor.
8871
8872 2010-08-27 Ian Lance Taylor <iant@google.com>
8873
8874 * testsuite/start_lib_test_3.c: Mark t3 as used.
8875
8876 2010-08-27 Nick Clifton <nickc@redhat.com>
8877
8878 * options.cc (version_script): Fix small typo in previous
8879 whitespace tidyup.
8880
8881 2010-08-25 Nick Clifton <nickc@redhat.com>
8882
8883 * archive.cc: Formatting fixes: Remove whitespace between
8884 typename and following asterisk. Remove whitespace between
8885 function name and opening parenthesis.
8886 * archive.h: Likewise.
8887 * arm.cc: Likewise.
8888 * attributes.cc: Likewise.
8889 * attributes.h: Likewise.
8890 * common.cc: Likewise.
8891 * copy-relocs.cc: Likewise.
8892 * dirsearch.h: Likewise.
8893 * dynobj.cc: Likewise.
8894 * ehframe.cc: Likewise.
8895 * ehframe.h: Likewise.
8896 * expression.cc: Likewise.
8897 * fileread.cc: Likewise.
8898 * fileread.h: Likewise.
8899 * gc.h: Likewise.
8900 * gold-threads.cc: Likewise.
8901 * gold.cc: Likewise.
8902 * i386.cc: Likewise.
8903 * icf.h: Likewise.
8904 * incremental-dump.cc: Likewise.
8905 * incremental.cc: Likewise.
8906 * layout.cc: Likewise.
8907 * layout.h: Likewise.
8908 * main.cc: Likewise.
8909 * merge.cc: Likewise.
8910 * merge.h: Likewise.
8911 * object.cc: Likewise.
8912 * object.h: Likewise.
8913 * options.cc: Likewise.
8914 * options.h: Likewise.
8915 * output.cc: Likewise.
8916 * output.h: Likewise.
8917 * plugin.cc: Likewise.
8918 * plugin.h: Likewise.
8919 * powerpc.cc: Likewise.
8920 * reloc.cc: Likewise.
8921 * script-c.h: Likewise.
8922 * script-sections.cc: Likewise.
8923 * script.cc: Likewise.
8924 * stringpool.cc: Likewise.
8925 * symtab.cc: Likewise.
8926 * symtab.h: Likewise.
8927 * target.cc: Likewise.
8928 * timer.cc: Likewise.
8929 * timer.h: Likewise.
8930 * version.cc: Likewise.
8931 * x86_64.cc: Likewise.
8932
8933 2010-08-24 Nick Clifton <nickc@redhat.com>
8934
8935 PR 11899
8936 * layout.cc (segment_precedes): Sort segments by their physical
8937 addresses, if they have been set.
8938
8939 2010-08-23 Cary Coutant <ccoutant@google.com>
8940
8941 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8942 symbols data.
8943 (Lib_group::include_member): Unlock object after deleting its
8944 symbols data.
8945 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8946 the bug fixed here.
8947
8948 2010-08-19 Neil Vachharajani <nvachhar@google.com>
8949 Cary Coutant <ccoutant@google.com>
8950
8951 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8952 constructor, and set_blocker.
8953 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8954 readsyms_blocker_.
8955 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8956 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8957 * testsuite/Makefile.am (start_lib_test): New test case.
8958 * testsuite/Makefile.in: Regenerate.
8959 * testsuite/start_lib_test_main.c: New file.
8960 * testsuite/start_lib_test_1.c: New file.
8961 * testsuite/start_lib_test_2.c: New file.
8962 * testsuite/start_lib_test_3.c: New file.
8963
8964 2010-08-19 Ian Lance Taylor <iant@google.com>
8965
8966 * Makefile.in: Rebuild with automake 1.11.1.
8967 * aclocal.m4: Likewise.
8968 * testsuite/Makefile.in: Likewise.
8969
8970 2010-08-19 Ian Lance Taylor <iant@google.com>
8971
8972 PR 10893
8973 * i386.cc (class Output_data_plt_i386): Update declarations.
8974 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8975 local_ifuncs_ fields.
8976 (Target_i386::do_plt_section_for_global): New function.
8977 (Target_i386::do_plt_section_for_local): New function.
8978 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8979 parameter; change all callers. Initialize global_ifuncs_ and
8980 local_ifuncs_. If doing a static link define __rel_iplt_start and
8981 __rel_iplt_end.
8982 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8983 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8984 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8985 symbols.
8986 (Target_i386::make_plt_section): New function, broken out of
8987 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8988 (Target_i386::make_plt_entry): Call make_plt_section.
8989 (Target_i386::make_local_ifunc_plt_entry): New function.
8990 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8991 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8992 R_386_IRELATIVE to switch.
8993 (Target_i386::Scan::global): Likewise.
8994 (Target_i386::Relocate::relocate): Likewise.
8995 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8996 switch.
8997 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8998 (Target_x86_64::do_plt_section_for_global): New function.
8999 (Target_x86_64::do_plt_section_for_local): New function.
9000 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9001 parameter; change all callers. If doing a static link define
9002 __rela_iplt_start and __rela_iplt_end.
9003 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9004 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9005 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9006 to point to .plt.
9007 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9008 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9009 switch.
9010 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9011 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9012 R_X86_64_IRELATIVE to switch.
9013 (Target_x86_64::Scan::global): Likewise.
9014 (Target_x86_64::Relocate::relocate): Likewise.
9015 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9016 switch.
9017 * target.h (class Target): Add plt_section_for_global and
9018 plt_section_for_local functions. Add do_plt_section_for_global
9019 and do_plt_section_for_local virtual functions.
9020 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9021 clarifying comments.
9022 (Symbol::use_plt_offset): Handle IFUNC symbol.
9023 * object.cc (Sized_relobj::Sized_relobj): Initialize
9024 local_plt_offsets_.
9025 (Sized_relobj::local_has_plt_offset): New function.
9026 (Sized_relobj::local_plt_offset): New function.
9027 (Sized_relobj::set_local_plt_offset): New function.
9028 (Sized_relobj::do_count): Handle IFUNC symbol.
9029 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9030 a bit away from input_shndx_ field. Add set_is_func_symbol and
9031 is_ifunc_symbol functions.
9032 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9033 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9034 local_plt_offsets_ field.
9035 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9036 * output.h (class Output_section_data): Add non-const
9037 output_section function.
9038 (class Output_data_got): Update declarations.
9039 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9040 Add use_plt_offset parameter to global and local constructors.
9041 Change all callers. Change local_sym_index_ field to 31 bits.
9042 Change GSYM_CODE and CONSTANT_CODE accordingly.
9043 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9044 doing a static link don't set sh_link field.
9045 (Output_data_got::Got_entry::write): Use PLT offset if
9046 appropriate.
9047 (Output_data_got::add_global_plt): New function.
9048 (Output_data_got::add_local_plt): New function.
9049 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9050 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9051 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9052 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9053 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9054 IFUNC conditional.
9055 * testsuite/ifunc-sel.h: New file.
9056 * testsuite/ifuncmain1.c: New file.
9057 * testsuite/ifuncmain1vis.c: New file.
9058 * testsuite/ifuncmod1.c: New file.
9059 * testsuite/ifuncdep2.c: New file.
9060 * testsuite/ifuncmain2.c: New file.
9061 * testsuite/ifuncmain3.c: New file.
9062 * testsuite/ifuncmod3.c: New file.
9063 * testsuite/ifuncmain4.c: New file.
9064 * testsuite/ifuncmain5.c: New file.
9065 * testsuite/ifuncmod5.c: New file.
9066 * testsuite/ifuncmain6pie.c: New file.
9067 * testsuite/ifuncmod6.c: New file.
9068 * testsuite/ifuncmain7.c: New file.
9069 * configure, testsuite/Makefile.in: Rebuild.
9070
9071 2010-08-18 Ian Lance Taylor <iant@google.com>
9072
9073 * incremental.cc
9074 (Output_section_incremental_inputs::write_input_files): Add cast
9075 to avoid signed/unsigned comparison warning.
9076 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9077
9078 2010-08-12 Cary Coutant <ccoutant@google.com>
9079
9080 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9081
9082 2010-08-13 Ian Lance Taylor <iant@google.com>
9083
9084 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9085
9086 2010-08-12 Cary Coutant <ccoutant@google.com>
9087 Doug Kwan <dougkwan@google.com>
9088
9089 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9090 defintion overrides non-weak undef, remember that the original undef
9091 is not weak.
9092 * symtab.cc (Symbol_table::sized_write_global): For undef without
9093 an original weak binding, set binding to global in output.
9094 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9095 * testsuite/Makefile.in: Regenerate.
9096 * testsuite/strong_ref_weak_def.sh: New file.
9097 * testsuite/strong_ref_weak_def_1.c: Ditto.
9098 * testsuite/strong_ref_weak_def_2.c: Ditto.
9099
9100 2010-08-12 Cary Coutant <ccoutant@google.com>
9101
9102 * testsuite/incremental_test.sh: Rewrite.
9103 * testsuite/incremental_test_1.c: Rewrite.
9104 * testsuite/incremental_test_2.c: Rewrite.
9105
9106 2010-08-12 Cary Coutant <ccoutant@google.com>
9107
9108 * arm.cc (Target_arm::got_size): Add const.
9109 (Target_arm::got_entry_count): New function.
9110 (Target_arm::plt_entry_count): New function.
9111 (Target_arm::first_plt_entry_offset): New function.
9112 (Target_arm::plt_entry_size): New function.
9113 (Output_data_plt_arm::entry_count): New function.
9114 (Output_data_plt_arm::first_plt_entry_offset): New function.
9115 (Output_data_plt_arm::get_plt_entry_size): New function.
9116 * i386.cc (Target_i386::got_size): Add const.
9117 (Target_i386::got_entry_count): New function.
9118 (Target_i386::plt_entry_count): New function.
9119 (Target_i386::first_plt_entry_offset): New function.
9120 (Target_i386::plt_entry_size): New function.
9121 (Output_data_plt_i386::entry_count): New function.
9122 (Output_data_plt_i386::first_plt_entry_offset): New function.
9123 (Output_data_plt_i386::get_plt_entry_size): New function.
9124 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9125 find_incremental_inputs_sections. Dump incremental_got_plt section.
9126 * incremental.cc: Include target.h.
9127 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9128 parameter. Adjust all callers. Find incremental_got_plt section.
9129 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9130 section.
9131 (Output_section_incremental_inputs::set_final_data_size): Calculate
9132 size of incremental_got_plt section.
9133 (Output_section_incremental_inputs::do_write): Write the
9134 incremental_got_plt section.
9135 (Got_plt_view_info): New struct.
9136 (Local_got_offset_visitor): New class.
9137 (Global_got_offset_visitor): New class.
9138 (Global_symbol_visitor_got_plt): New class.
9139 (Output_section_incremental_inputs::write_got_plt): New function.
9140 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9141 Add parameter. Adjust all callers.
9142 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9143 (Incremental_inputs::got_plt_section): New function.
9144 (Incremental_inputs::got_plt_section_): New data member.
9145 (Incremental_got_plt_reader): New class.
9146 * layout.cc (Layout::create_incremental_info_sections): Add the
9147 incremental_got_plt section.
9148 * object.h (Got_offset_list::get_list): New function.
9149 (Got offset_list::for_all_got_offsets): New function.
9150 (Sized_relobj::local_got_offset_list): New function.
9151 * powerpc.cc (Target_powerpc::got_size): Add const.
9152 (Target_powerpc::got_entry_count): New function.
9153 (Target_powerpc::plt_entry_count): New function.
9154 (Target_powerpc::first_plt_entry_offset): New function.
9155 (Target_powerpc::plt_entry_size): New function.
9156 (Output_data_plt_powerpc::entry_count): New function.
9157 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9158 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9159 * sparc.cc (Target_sparc::got_size): Add const.
9160 (Target_sparc::got_entry_count): New function.
9161 (Target_sparc::plt_entry_count): New function.
9162 (Target_sparc::first_plt_entry_offset): New function.
9163 (Target_sparc::plt_entry_size): New function.
9164 (Output_data_plt_sparc::entry_count): New function.
9165 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9166 (Output_data_plt_sparc::get_plt_entry_size): New function.
9167 * symtab.h (Symbol::got_offset_list): New function.
9168 (Symbol_table::for_all_symbols): New function.
9169 * target.h (Sized_target::got_entry_count): New function.
9170 (Sized_target::plt_entry_count): New function.
9171 (Sized_target::plt_entry_size): New function.
9172 * x86_64.cc (Target_x86_64::got_size): Add const.
9173 (Target_x86_64::got_entry_count): New function.
9174 (Target_x86_64::plt_entry_count): New function.
9175 (Target_x86_64::first_plt_entry_offset): New function.
9176 (Target_x86_64::plt_entry_size): New function.
9177 (Output_data_plt_x86_64::entry_count): New function.
9178 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9179 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9180
9181 2010-08-12 Cary Coutant <ccoutant@google.com>
9182
9183 * archive.cc: Include incremental.h.
9184 (Archive::Archive): Initialize incremental_info_.
9185 (Archive::include_member): Record archive members in incremental info.
9186 (Add_archive_symbols::run): Record begin and end of an archive in
9187 incremental info.
9188 (Lib_group::include_member): Record objects in incremental info.
9189 * archive.h (Incremental_archive_entry): Forward declaration.
9190 (Archive::set_incremental_info): New member function.
9191 (Archive::incremental_info): New member function.
9192 (Archive::Unused_symbol_iterator): New class.
9193 (Archive::unused_symbols_begin): New member function.
9194 (Archive::unused_symbols_end): New member function.
9195 (Archive::incremental_info_): New data member.
9196 * incremental-dump.cc (find_input_containing_global): New function.
9197 (dump_incremental_inputs): Dump new incremental info sections.
9198 * incremental.cc: Include symtab.h.
9199 (Output_section_incremental_inputs): New class.
9200 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9201 new incremental info sections.
9202 (Sized_incremental_binary::do_check_inputs): Likewise.
9203 (Incremental_inputs::report_archive): Remove.
9204 (Incremental_inputs::report_archive_begin): New function.
9205 (Incremental_inputs::report_archive_end): New function.
9206 (Incremental_inputs::report_object): New function.
9207 (Incremental_inputs::finalize_inputs): Remove.
9208 (Incremental_inputs::report_input_section): New function.
9209 (Incremental_inputs::report_script): Rewrite.
9210 (Incremental_inputs::finalize): Do nothing but finalize string table.
9211 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9212 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9213 (Incremental_inputs::create_data_sections): New function.
9214 (Incremental_inputs::relocs_entsize): New function.
9215 (Output_section_incremental_inputs::set_final_data_size): New function.
9216 (Output_section_incremental_inputs::do_write): New function.
9217 (Output_section_incremental_inputs::write_header): New function.
9218 (Output_section_incremental_inputs::write_input_files): New function.
9219 (Output_section_incremental_inputs::write_info_blocks): New function.
9220 (Output_section_incremental_inputs::write_symtab): New function.
9221 * incremental.h (Incremental_script_entry): Forward declaration.
9222 (Incremental_object_entry): Forward declaration.
9223 (Incremental_archive_entry): Forward declaration.
9224 (Incremental_inputs): Forward declaration.
9225 (Incremental_inputs_header_data): Remove.
9226 (Incremental_inputs_header): Remove.
9227 (Incremental_inputs_header_write): Remove.
9228 (Incremental_inputs_entry_data): Remove.
9229 (Incremental_inputs_entry): Remove.
9230 (Incremental_inputs_entry_write): Remove.
9231 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9232 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9233 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9234 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9235 Likewise.
9236 (Incremental_input_entry): New class.
9237 (Incremental_script_entry): New class.
9238 (Incremental_object_entry): New class.
9239 (Incremental_archive_entry): New class.
9240 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9241 (Incremental_inputs::report_inputs): Remove.
9242 (Incremental_inputs::report_archive): Remove.
9243 (Incremental_inputs::report_archive_begin): New function.
9244 (Incremental_inputs::report_archive_end): New function.
9245 (Incremental_inputs::report_object): Change prototype.
9246 (Incremental_inputs::report_input_section): New function.
9247 (Incremental_inputs::report_script): Change prototype.
9248 (Incremental_inputs::get_reloc_count): New function.
9249 (Incremental_inputs::set_reloc_count): New function.
9250 (Incremental_inputs::create_data_sections): New function.
9251 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9252 (Incremental_inputs::inputs_section): New function.
9253 (Incremental_inputs::symtab_section): New function.
9254 (Incremental_inputs::relocs_section): New function.
9255 (Incremental_inputs::get_stringpool): Add const.
9256 (Incremental_inputs::command_line): Add const.
9257 (Incremental_inputs::inputs): Remove.
9258 (Incremental_inputs::command_line_key): New function.
9259 (Incremental_inputs::input_file_count): New function.
9260 (Incremental_inputs::input_files): New function.
9261 (Incremental_inputs::relocs_entsize): New function.
9262 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9263 (Incremental_inputs::finalize_inputs): Remove.
9264 (Incremental_inputs::Input_info): Remove.
9265 (Incremental_inputs::lock_): Remove.
9266 (Incremental_inputs::inputs_): Change type.
9267 (Incremental_inputs::inputs_map_): Remove.
9268 (Incremental_inputs::current_object_entry_): New data member.
9269 (Incremental_inputs::inputs_section_): New data member.
9270 (Incremental_inputs::symtab_section_): New data member.
9271 (Incremental_inputs::relocs_section_): New data member.
9272 (Incremental_inputs::reloc_count_): New data member.
9273 (Incremental_inputs_reader): New class.
9274 (Incremental_symtab_reader): New class.
9275 (Incremental_relocs_reader): New class.
9276 * layout.cc (Layout::finalize): Move finalization of incremental info
9277 and creation of incremental info sections to follow finalization of
9278 symbol table. Set offsets for postprocessing sections.
9279 (Layout::create_incremental_info_sections): Call
9280 Incremental_inputs::create_data_sections. Add incremental symtab
9281 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9282 sections to layout after input sections.
9283 * layout.h (struct Timespec): Forward declaration.
9284 (Layout::incremental_inputs): Add const.
9285 (Layout::create_incremental_info_sections): Add parameter.
9286 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9287 * object.cc: Include incremental.h.
9288 (Relobj::finalize_incremental_relocs): New function.
9289 (Sized_relobj::do_layout): Record input sections in incremental info.
9290 * object.h (Object::output_section): New function.
9291 (Object::output_section_offset): Moved from Relobj.
9292 (Object::get_incremental_reloc_base): New function.
9293 (Object::get_incremental_reloc_count): New function.
9294 (Object::do_output_section): New function.
9295 (Object::do_output_section_offset): Moved from Relobj.
9296 (Object::do_get_incremental_reloc_base): New function.
9297 (Object::do_get_incremental_reloc_count): New function.
9298 (Object::Object): Initialize new data members.
9299 (Relobj::output_section): Renamed do_output_section and moved to
9300 protected.
9301 (Relobj::output_section_offset): Moved to Object.
9302 (Relobj::do_get_incremental_reloc_base): New function.
9303 (Relobj::do_get_incremental_reloc_count): New function.
9304 (Relobj::allocate_incremental_reloc_counts): New function.
9305 (Relobj::count_incremental_reloc): New function.
9306 (Relobj::finalize_incremental_relocs): New function.
9307 (Relobj::next_incremental_reloc_index): New function.
9308 (Relobj::reloc_counts_): New data member.
9309 (Relobj::reloc_bases_): New data member.
9310 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9311 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9312 (Sized_relobj::incremental_relocs_scan): New function.
9313 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9314 (Sized_relobj::incremental_relocs_write): New function.
9315 (Sized_relobj::incremental_relocs_write_reltype): New function.
9316 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9317 incremental link.
9318 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9319 archives and object files elsewhere.
9320 (Add_symbols::run): Report object files here.
9321 (Finish_group::run): Report end of archive at end of group.
9322 * reloc.cc: Include layout.h, incremental.h.
9323 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9324 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9325 (Sized_relobj::incremental_relocs_scan): New function.
9326 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9327 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9328 (Sized_relobj::incremental_relocs_write): New function.
9329 (Sized_relobj::incremental_relocs_write_reltype): New function.
9330 * script.cc (read_input_script): Rewrite test for incremental link.
9331 Change call to Incremental_inputs::report_script.
9332 * symtab.h (Symbol_table::first_global_index): New function.
9333 (Symbol_table::output_count): New function.
9334
9335 2010-08-12 Doug Kwan <dougkwan@google.com>
9336
9337 * arm.cc (Target_arm::merge_object_attributes): Check command line
9338 options --no-wchar-size-warning and --no-enum-size-warning.
9339 * options.h (General_options): Add ld-compatible options
9340 --no-enum-size-warning and --no-wchar-size-warning.
9341
9342 2010-08-04 Ian Lance Taylor <iant@google.com>
9343
9344 * x86_64.cc (Target_x86_64::Scan::local): Use
9345 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9346 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9347 (Target_x86_64::Scan::global): Likewise.
9348 (Target_x86_64::Relocate::relocate): Likewise.
9349 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9350 Likewise.
9351
9352 2010-08-03 Cary Coutant <ccoutant@google.com>
9353
9354 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9355 to reserve space in merged_strings vector. Keep total input size
9356 for stats.
9357 (Output_merge_string::do_print_merge_stats): Print total input size.
9358 * merge.h (Output_merge_string): Add input_size_ field.
9359 * stringpool.cc (Stringpool_template::string_length): Move
9360 implementations out of Stringpool_template class and place in
9361 stringpool.h.
9362 * stringpool.h (string_length): Move out of Stringpool_template.
9363
9364 2010-08-03 Ian Lance Taylor <iant@google.com>
9365
9366 PR 11712
9367 * layout.cc (relaxation_loop_body): If address of load segment is
9368 set, adjust address to include headers if possible.
9369
9370 2010-08-03 Ian Lance Taylor <iant@google.com>
9371
9372 * version.cc (version_string): Bump to 1.10.
9373
9374 2010-08-03 Ian Lance Taylor <iant@google.com>
9375
9376 PR 11805
9377 * layout.h (enum Output_section_order): Define.
9378 (class Layout): Update declarations.
9379 * layout.cc (Layout::get_output_section): Add order parameter.
9380 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9381 is_first_non_relro parameters. Change all callers.
9382 (Layout::choose_output_section): Likewise.
9383 (Layout::add_output_section_data): Likewise.
9384 (Layout::make_output_section): Likewise. Set order.
9385 (Layout::default_section_order): New function.
9386 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9387 * output.cc (Output_section::Output_section): Initialize order_.
9388 Don't initialize deleted fields.
9389 (Output_segment::Output_segment): Don't initialize deleted
9390 fields.
9391 (Output_segment::add_output_section_to_load): New function
9392 replacing add_output_section. Change all callers to call this or
9393 add_output_section_to_nonload.
9394 (Output_segment::add_output_section_to_nonload): New function.
9395 (Output_segment::remove_output_section): Rewrite.
9396 (Output_segment::add_initial_output_data): Likewise.
9397 (Output_segment::has_any_data_sections): Likewise.
9398 (Output_segment::is_first_section_relro): Likewise.
9399 (Output_segment::maximum_alignment): Likewise.
9400 (Output_segment::has_dynamic_reloc): New function replacing
9401 dynamic_reloc_count. Change all callers.
9402 (Output_segment::has_dynamic_reloc_list): New function replacing
9403 dynamic_reloc_count_list. Change all callers.
9404 (Output_segment::set_section_addresses): Rewrite.
9405 (Output_segment::set_offset): Rewrite.
9406 (Output_segment::find_first_and_last_list): Remove.
9407 (Output_segment::set_tls_offsets): Rewrite.
9408 (Output_segment::first_section_load_address): Likewise.
9409 (Output_segment::output_section_count): Likewise.
9410 (Output_segment::section_with_lowest_load_address): Likewise.
9411 (Output_segment::write_section_headers): Likewise.
9412 (Output_segment::print_sections_to_map): Likewise.
9413 * output.h (class Output_data): Remove dynamic_reloc_count_
9414 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9415 (Output_data::add_dynamic_reloc): Rewrite.
9416 (Output_data::has_dynamic_reloc): New function.
9417 (Output_data::dynamic_reloc_count): Remove.
9418 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9419 is_last_relro_, is_first_non_relro_, is_interp_,
9420 is_dynamic_linker_section_ fields. Add order and set_order
9421 functions. Remove is_relro_local, set_is_relro_local,
9422 is_last_relro, set_is_last_relro, is_first_non_relro,
9423 set_is_first_non_relro functions, is_interp, set_is_interp,
9424 is_dynamic_linker_section, and set_is_dynamic_linker_section
9425 functions.
9426 (class Output_segment): Change Output_data_list from std::list to
9427 std:;vector. Add output_lists_ field. Remove output_data_ and
9428 output_bss_ fields. Update declarations.
9429
9430 2010-08-02 Ian Lance Taylor <iant@google.com>
9431
9432 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9433 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9434 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9435
9436 2010-08-02 Ian Lance Taylor <iant@google.com>
9437
9438 PR 11855
9439 * script.cc (Script_options::Script_options): Initialize
9440 symbol_definitions_ and symbol_references_.
9441 (Script_options::add_symbol_assignment): Update
9442 symbol_definitions_ and symbol_references_.
9443 (Script_options::add_symbol_reference): New function.
9444 (script_symbol): New function.
9445 * script.h (class Script_options): Add symbol_definitions_ and
9446 symbol_references_ fields.
9447 (Script_options::referenced_const_iterator): New type.
9448 (Script_options::referenced_begin): New function.
9449 (Script_options::referenced_end): New function.
9450 (Script_options::is_referenced): New function.
9451 (Script_options::any_unreferenced): New function.
9452 * script-c.h (script_symbol): Declare.
9453 * yyscript.y (exp): Call script_symbol.
9454 * symtab.cc: Include "script.h".
9455 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9456 Change all callers. Check symbols referenced by scripts.
9457 (Symbol_table::add_undefined_symbols_from_command_line): Add
9458 layout parameter. Change all callers.
9459 (Symbol_table::do_add_undefined_symbols_from_command_line):
9460 Likewise. Break out loop body. Check symbols referenced by
9461 scripts.
9462 (Symbol_table::add_undefined_symbol_from_command_line): New
9463 function broken out of
9464 do_add_undefined_symbols_from_command_line.
9465 * symtab.h (class Symbol_table): Update declarations.
9466 * archive.cc: Include "layout.h".
9467 (Archive::should_include_member): Add layout parameter. Change
9468 all callers. Check for symbol mentioned in expression.
9469 * archive.h (class Archive): Update declaration.
9470 * object.cc (Sized_relobj::do_should_include_member): Add layout
9471 parameter.
9472 * object.h (Object::should_include_member): Add layout parameter.
9473 Change all callers.
9474 (Object::do_should_include_member): Add layout parameter.
9475 (class Sized_relobj): Update declaration.
9476 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9477 parameter.
9478 * dynobj.h (class Sized_dynobj): Update declaration.
9479 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9480 layout parameter.
9481 * plugin.h (class Sized_pluginobj): Update declaration.
9482
9483 2010-08-02 Ian Lance Taylor <iant@google.com>
9484
9485 PR 11866
9486 * output.cc (Output_segment::set_offset): Search for the first and
9487 last sections rather than assuming that the list is in order.
9488 (Output_segment::find_first_and_last_list): New function.
9489 * output.h (class Output_segment): Update declarations.
9490 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9491 (relro_strip_test_SOURCES): New variable.
9492 (relro_strip_test_DEPENDENCIES): New variable.
9493 (relro_strip_test_LDFLAGS): New variable.
9494 (relro_strip_test_LDADD): New variable.
9495 (relro_strip_test.so): New target.
9496
9497 2010-08-02 Ian Lance Taylor <iant@google.com>
9498
9499 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9500 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9501 (Target_i386::got_tlsdesc_section): New function.
9502 (Target_i386::got_section): Create space for GOT entries for
9503 TLSDESC relocations.
9504 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9505 R_386_TLS_GOTDESC.
9506 (Target_i386::Scan::global): Likewise.
9507 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9508 using TLSDESC GOT.
9509 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9510 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9511 (Target_x86_64::got_tlsdesc_section): New function.
9512 (Target_x86_64::got_section): Create space for GOT entries for
9513 TLSDESC relocations.
9514 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9515 R_386_TLS_GOTDESC.
9516 (Target_x86_64::Scan::global): Likewise.
9517 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9518 using TLSDESC GOT.
9519
9520 2010-08-02 Ian Lance Taylor <iant@google.com>
9521
9522 * testsuite/final_layout.sh: Use dc to convert from hex to
9523 decimal.
9524
9525 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9526
9527 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9528 paramter to the call to gold::gc_process_relocs.
9529 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9530 paramter to the call to gold::gc_process_relocs.
9531 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9532 parameter to the call to gold::gc_process_relocs.
9533 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9534 template parameter to the call to gold::gc_process_relocs.
9535 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9536 paramter to the call to gold::gc_process_relocs.
9537 * gc.h (get_embedded_addend_size): New function.
9538 (gc_process_relocs): Save the size of the reloc for use by ICF.
9539 * icf.cc (get_section_contents): Get the addend from the text section
9540 for SHT_REL relocation sections.
9541 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9542 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9543 * int_encoding.h (read_from_pointer): New overloaded function.
9544 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9545 * testsuite/icf_sht_rel_addend_test.sh: New file.
9546 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9547 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9548
9549 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9550
9551 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9552 * Makefile.in: Regenerate.
9553 * testsuite/Makefile.in: Regenerate.
9554
9555 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9556
9557 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9558 * gold/testsuite/debug_msg.cc: Likewise.
9559 * gold/testsuite/odr_violation1.cc
9560 * gold/testsuite/odr_violation2.cc
9561
9562 2010-07-21 Cary Coutant <ccoutant@google.com>
9563
9564 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9565 string, and length fields.
9566 (Output_merge_string::Merged_strings_list): New type.
9567 (Output_merge_string::Merged_strings_lists): New typedef.
9568 (Output_merge_string): Replace merged_strings_ with
9569 merged_strings_lists_.
9570 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9571 Merged_strings_list per input object and section. Don't store pointer
9572 to the string. Don't store length with each merged string entry.
9573 (Output_merge_string::finalize_merged_data): Loop over list of merged
9574 strings lists. Recompute length of each merged string.
9575
9576 2010-07-15 Cary Coutant <ccoutant@google.com>
9577
9578 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9579 here.
9580
9581 2010-07-14 Ian Lance Taylor <iant@google.com>
9582
9583 * descriptors.cc (Descriptors::open): Report correct name in error
9584 message.
9585
9586 2010-07-13 Doug Kwan <dougkwan@google.com>
9587
9588 * arm.cc (Arm_input_section::Arm_input_section): For a
9589 SHT_ARM_EXIDX section, always keeps the input sections.
9590 (Arm_input_section::set_exidx_section_link): New method.
9591 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9592 has_errors_ to false.
9593 (Arm_exidx_input_section::has_errors,
9594 Arm_exidx_input_section::set_has_errors): New methods.
9595 (Arm_exidx_input_section::has_errors_): New data member.
9596 (Arm_relobj::get_exidx_shndx_list): New method.
9597 (Arm_output_section::append_text_sections_to_list): Do not skip
9598 section without SHF_EXECINSTR.
9599 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9600 errors.
9601 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9602 section header. Make error messages more verbose. Check for
9603 a non-executable section linked to an EXIDX section.
9604 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9605 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9606 check that there is no deferred EXIDX section if we exit early.
9607 Instead of not making an EXIDX section in case of an error, make one
9608 and set the has_errors flag of it.
9609 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9610 in a relocatable link.
9611 (Target_arm::do_relax): Look for the EXIDX output section instead of
9612 assuming that it is called .ARM.exidx.
9613 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9614 section list. Do not check for SHF_EXECINSTR section flags but
9615 skip any input section with errors.
9616 * output.cc (Output_section::Output_section): Initialize
9617 always_keeps_input_sections_ to false.
9618 (Output_section::add_input_section): Check for
9619 always_keeps_input_sections_.
9620 * output.h (Output_section::always_keeps_input_sections,
9621 Output_section::set_always_keeps_input_sections): New methods.
9622 (Output_section::always_keeps_input_sections): New data member.
9623
9624 2010-07-13 Rafael Espindola <espindola@google.com>
9625
9626 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9627 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9628
9629 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9630 Ian Lance Taylor <iant@google.com>
9631
9632 * output.h (Output_section_lookup_maps::add_merge_section):
9633 Correct check of whether value was inserted.
9634 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9635 (Output_section_lookup_maps::add_relaxed_input_section):
9636 Likewise.
9637 * arm.cc (Target_arm::got_section): Remove used local os.
9638 * i386.cc (Target_i386::got_section): Likewise.
9639 * x86_64.cc (Target_x86_64::got_section): Likewise.
9640 * sparc.cc (Target_sparc::got_section): Likewise.
9641 (Target_sparc::relocate): Remove unused local have_got_offset.
9642 * powerpc.cc (Target_powerpc::relocate): Likewise.
9643
9644 2010-07-13 Ian Lance Taylor <iant@google.com>
9645
9646 * compressed_output.cc (zlib_decompress): Fix signature in
9647 !HAVE_ZLIB_H case.
9648
9649 * archive.cc (Archive::include_member): Unlock an external member
9650 of a thin archive. Don't bother to delete an object we know is
9651 NULL.
9652
9653 2010-07-12 Cary Coutant <ccoutant@google.com>
9654
9655 * compressed_output.cc (zlib_decompress): New function.
9656 (get_uncompressed_size): New function.
9657 (decompress_input_section): New function.
9658 * compressed_output.h (get_uncompressed_size): New function.
9659 (decompress_input_section): New function.
9660 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9661 Handle compressed debug sections.
9662 * layout.cc (is_compressed_debug_section): New function.
9663 (Layout::output_section_name): Map compressed section names to
9664 canonical names.
9665 * layout.h (is_compressed_debug_section): New function.
9666 (is_debug_info_section): Recognize compressed debug sections.
9667 * merge.cc: Include compressed_output.h.
9668 (Output_merge_data::do_add_input_section): Handle compressed
9669 debug sections.
9670 (Output_merge_string::do_add_input_section): Handle compressed
9671 debug sections.
9672 * object.cc: Include compressed_output.h.
9673 (Sized_relobj::Sized_relobj): Initialize new data members.
9674 (build_compressed_section_map): New function.
9675 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9676 * object.h (Object::section_is_compressed): New method.
9677 (Object::do_section_is_compressed): New method.
9678 (Sized_relobj::Compressed_section_map): New type.
9679 (Sized_relobj::do_section_is_compressed): New method.
9680 (Sized_relobj::compressed_sections_): New data member.
9681 * output.cc (Output_section::add_input_section): Handle compressed
9682 debug sections.
9683 * reloc.cc: Include compressed_output.h.
9684 (Sized_relobj::write_sections): Handle compressed debug sections.
9685
9686 2010-07-08 Cary Coutant <ccoutant@google.com>
9687
9688 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9689 weak when resolving to a dynamic def.
9690 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9691 for weak undef/dynamic def cases. Adjust callers.
9692 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9693 undef_binding_weak_.
9694 (Symbol_table::sized_write_globals): Adjust symbol binding.
9695 (Symbol_table::sized_write_symbol): Add binding parameter.
9696 * symtab.h (Symbol::set_undef_binding): New method.
9697 (Symbol::is_undef_binding_weak): New method.
9698 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9699 (Symbol_table::should_override): Add new parameter.
9700 (Symbol_table::sized_write_symbol): Add new parameter.
9701
9702 * testsuite/weak_undef_file1.cc: Add new test case.
9703 * testsuite/weak_undef_file2.cc: Fix header comment.
9704 * testsuite/weak_undef_test.cc: Add new test case.
9705
9706 2010-06-29 Doug Kwan <dougkwan@google.com>
9707
9708 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9709 Initialize USE_SYMBOL_.
9710 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9711 definition.
9712 (Arm_reloc_property::uses_symbol_): New data member declaration.
9713 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9714 uses symbol value and symbol is undefined but not weakly undefined.
9715
9716 2010-06-28 Rafael Espindola <espindola@google.com>
9717
9718 * plugin.cc (Plugin::load): Use dlerror.
9719
9720 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9721
9722 * symtab.cc (detect_odr_violations): When reporting an ODR
9723 violation, report an object where the symbol is defined.
9724
9725 2010-06-25 Doug Kwan <dougkwan@google.com>
9726
9727 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9728 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9729 definition.
9730 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9731 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9732 target hook to detect function points.
9733 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9734 * icf.h (Icf::check_section_for_function_pointers): Change type of
9735 parameter SECTION_NAME to const reference to std::string. Use
9736 target hook to determine if section may have unsafe pointers.
9737 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9738 method definition.
9739
9740 2010-06-21 Rafael Espindola <espindola@google.com>
9741
9742 * fileread.cc (Input_file::find_fie): New
9743 (Input_file::open): Use Input_file::find_fie.
9744 * fileread.h (Input_file::find_fie): New
9745 * plugin.cc (set_extra_library_path): New.
9746 (Plugin::load): Add set_extra_library_path to the transfer vector.
9747 (Plugin_manager::set_extra_library_path): New.
9748 (Plugin_manager::add_input_file): Use the extra search path if set.
9749 (set_extra_library_path(): New.
9750 * plugin.h (Plugin_manager): Add set_extra_library_path and
9751 extra_search_path_.
9752
9753 2010-06-19 Cary Coutant <ccoutant@google.com>
9754
9755 * layout.cc (gdb_sections): Add .debug_types.
9756 (lines_only_debug_sections): Likewise.
9757
9758 2010-06-18 Rafael Espindola <espindola@google.com>
9759
9760 * plugin.cc (add_input_file,add_input_library)
9761 (Plugin_manager::add_input_file): Make filename arguments const.
9762 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9763 const.
9764
9765 2010-06-16 Doug Kwan <dougkwan@google.com>
9766
9767 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9768 .ARM.attributes section if we have not merged any input
9769 attributes sections.
9770
9771 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9772
9773 * arm.cc: Allow combining objects with no EABI version
9774 information.
9775
9776 2010-06-15 Rafael Espindola <espindola@google.com>
9777
9778 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9779
9780 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9781
9782 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9783 (struct iovec): Correct !HAVE_READV definition.
9784
9785 2010-06-10 Cary Coutant <ccoutant@google.com>
9786
9787 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9788 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9789 reloc sections.
9790 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9791
9792 PR 11683
9793 * symtab.h (Symbol::is_placeholder): New member function.
9794 * target-reloc.h (relocate_section): Check for placeholder symbols.
9795
9796 * testsuite/Makefile.am (plugin_test_8): New test.
9797 (plugin_test_9): New test.
9798 * testsuite/Makefile.in: Regenerate.
9799
9800 2010-06-09 Nick Clifton <nickc@redhat.com>
9801
9802 * yyscript.y (input_list_element): Allow strings prefixed with
9803 the '-' character. Treat these as libraries.
9804 * script.cc (script_add_library): New function. Adds a library
9805 specified by "-l<name>" found in an input script.
9806 * script-c.h: Add prototype for script_add_library.
9807
9808 2010-06-07 Doug Kwan <dougkwan@google.com>
9809
9810 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9811 Restrict stub-group size to be within long conditional branch
9812 range when working around cortex-A8 erratum.
9813
9814 2010-06-07 Damien Diederen <dd@crosstwine.com>
9815
9816 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9817 #ifdef typo.
9818
9819 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9820
9821 PR gold/11658
9822 * output.cc
9823 (Output_section::Input_section_sort_entry::compare_section_ordering):
9824 Change to return non-zero correctly.
9825 (Output_section::Input_section_sort_section_order_index_compare
9826 ::operator()): Change to fix ambiguity in comparisons.
9827
9828 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9829
9830 * gold.h (is_wildcard_string): New function.
9831 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9832 (Layout::layout_eh_frame): Ditto.
9833 (Layout::find_section_order_index): New method.
9834 (Layout::read_layout_from_file): New method.
9835 * layout.h (Layout::find_section_order_index): New method.
9836 (Layout::read_layout_from_file): New method.
9837 (Layout::input_section_position_): New private member.
9838 (Layout::input_section_glob_): New private member.
9839 * main.cc (main): Call read_layout_from_file here.
9840 * options.h (--section-ordering-file): New option.
9841 * output.cc (Output_section::input_section_order_specified_): New
9842 member.
9843 (Output_section::Output_section): Initialize new member.
9844 (Output_section::add_input_section): Add new parameter.
9845 Keep input sections when --section-ordering-file is used.
9846 (Output_section::set_final_data_size): Sort input sections when
9847 section ordering file is specified.
9848 (Output_section::Input_section_sort_entry): Add new parameter.
9849 Check sorting type.
9850 (Output_section::Input_section_sort_entry::compare_section_ordering):
9851 New method.
9852 (Output_section::Input_section_sort_compare::operator()): Change to
9853 consider section_order_index.
9854 (Output_section::Input_section_sort_init_fini_compare::operator()):
9855 Change to consider section_order_index.
9856 (Output_section::Input_section_sort_section_order_index_compare
9857 ::operator()): New method.
9858 (Output_section::sort_attached_input_sections): Change to sort
9859 according to section order when specified.
9860 (Output_section::add_input_section<32, true>): Add new parameter.
9861 (Output_section::add_input_section<64, true>): Add new parameter.
9862 (Output_section::add_input_section<32, false>): Add new parameter.
9863 (Output_section::add_input_section<64, false>): Add new parameter.
9864 * output.h (Output_section::add_input_section): Add new parameter.
9865 (Output_section::input_section_order_specified): New
9866 method.
9867 (Output_section::set_input_section_order_specified): New method.
9868 (Input_section::Input_section): Initialize section_order_index_.
9869 (Input_section::section_order_index): New method.
9870 (Input_section::set_section_order_index): New method.
9871 (Input_section::section_order_index_): New member.
9872 (Input_section::Input_section_sort_section_order_index_compare): New
9873 struct.
9874 (Output_section::input_section_order_specified_): New member.
9875 * script-sections.cc (is_wildcard_string): Delete and move modified
9876 method to gold.h.
9877 (Output_section_element_input::Output_section_element_input): Modify
9878 call to is_wildcard_string.
9879 (Output_section_element_input::Input_section_pattern
9880 ::Input_section_pattern): Ditto.
9881 (Output_section_element_input::Output_section_element_input): Ditto.
9882 * testsuite/Makefile.am (final_layout): New test case.
9883 * testsuite/Makefile.in: Regenerate.
9884 * testsuite/final_layout.cc: New file.
9885 * testsuite/final_layout.sh: New file.
9886
9887 2010-06-01 Rafael Espindola <espindola@google.com>
9888
9889 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9890
9891 2010-06-01 Rafael Espindola <espindola@google.com>
9892
9893 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9894 visibility of symbols.
9895
9896 2010-05-27 Doug Kwan <dougkwan@google.com>
9897
9898 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9899 from start of output section instead of address for a local symbol
9900 in a merged or relaxed section when doing a relocatable link.
9901
9902 2010-05-26 Rafael Espindola <espindola@google.com>
9903
9904 PR 11604
9905 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9906 adding sections the garbage collector removed.
9907 * gold/testsuite/Makefile.am: Add test.
9908 * gold/testsuite/Makefile.in: Regenerate.
9909 * gold/testsuite/plugin_test_7.sh: New.
9910 * gold/testsuite/plugin_test_7_1.c: New.
9911 * gold/testsuite/plugin_test_7_2.c: New.
9912
9913 2010-05-26 Rafael Espindola <espindola@google.com>
9914
9915 * script-sections.cc (Output_section_definition::set_section_addresses):
9916 Check for --section-start.
9917
9918 2010-05-26 Doug Kwan <dougkwan@google.com>
9919
9920 * arm.cc (Arm_scan_relocatable_relocs): New class.
9921 (Target_arm::relocate_special_relocatable): New method.
9922 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9923 (Arm_relocate_functions::thumb_branch_common): Same.
9924 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9925 instead of Default_scan_relocatable_relocs.
9926 * target-reloc.h (relocate_for_relocatable): Let target handle
9927 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9928 * target.h (Sized_target::relocate_special_relocatable): New method.
9929
9930 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9931
9932 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9933
9934 2010-05-23 Doug Kwan <dougkwan@google.com>
9935
9936 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9937 instead of a cast.
9938 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9939 with a direct branch, not a conditional branch, to a stub.
9940 * merge.cc (Output_merge_base::record_input_section): New method
9941 defintion.
9942 (Output_merge_data::do_add_input_section): Record input section if
9943 keeps-input-sections flag is set.
9944 (Output_merge_string::do_add_input_section): Ditto.
9945 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9946 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9947 INPUT_SECTIONS_.
9948 (Output_merge_base::keeps_input_sections,
9949 Output_merge_base::set_keeps_input_sections,
9950 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9951 method definitions.
9952 (Output_merge_base::Input_sections): New type declaration.
9953 (Output_merge_base::input_sections_begin,
9954 Output_merge_base::input_sections_end,
9955 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9956 (Output_merge_base::bool keeps_input_sections_,
9957 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9958 Output_merge_base::input_sections_): New data members.
9959 (Output_merge_data::do_set_keeps_input_sections): New method
9960 defintion.
9961 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9962 * output.cc (Output_section::Input_section::relobj): Move method
9963 defintion from class declaration to here and handle merge sections.
9964 (Output_section::Input_section::shndx): Ditto.
9965 (Output_section::Output_section): Remove initializations of removed
9966 data members and initialize new data member LOOKUP_MAPS_.
9967 (Output_section::add_input_section): Set keeps-input-sections flag
9968 for a newly created merge output section as appropriate. Adjust code
9969 to use Output_section_lookup_maps class.
9970 (Output_section::add_relaxed_input_section): Adjst code for lookup
9971 maps code refactoring.
9972 (Output_section::add_merge_input_section): Add a new parameter
9973 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9974 class. If adding input section to a newly created merge output
9975 section fails, remove the new merge section.
9976 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
9977 Adjust code for use of the Output_section_lookup_maps class.
9978 (Output_section::find_merge_section): Ditto.
9979 (Output_section::build_lookup_maps): New method defintion.
9980 (Output_section::find_relaxed_input_section): Adjust code to use
9981 Output_section_lookup_maps class.
9982 (Output_section::get_input_sections): Export merge sections. Adjust
9983 code to use Output_section_lookup_maps class.
9984 (Output_section:::add_script_input_section): Adjust code to use
9985 Output_section_lookup_maps class. Update lookup maps for merge
9986 sections also.
9987 (Output_section::discard_states): Use Output_section_lookup_maps.
9988 (Output_section::restore_states): Same.
9989 * output.h (Merge_section_properties): Move class defintion out of
9990 Output_section.
9991 (Output_section_lookup_maps): New class.
9992 (Output_section::Input_section::is_merge_section): New method
9993 defintion.
9994 (Output_section::Input_section::relobj): Move defintion out of class
9995 defintion. Declare method only.
9996 (Output_section::Input_section::shndx): Ditto.
9997 (Output_section::Input_section::output_merge_base): New method defintion.
9998 (Output_section::Input_section::u2_.pomb): New union field.
9999 (Output_section::Merge_section_by_properties_map,
10000 Output_section::Output_section_data_by_input_section_map,
10001 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10002 Remove types.
10003 (Output_section::add_merge_input_section): Add new parameter
10004 KEEPS_INPUT_SECTIONS.
10005 (Output_section::build_lookup_maps): New method declaration.
10006 (Output_section::merge_section_map_,
10007 Output_section::merge_section_by_properties_map_,
10008 Output_section::relaxed_input_section_map_,
10009 Output_section::is_relaxed_input_section_map_valid_): Remove data
10010 members.
10011 (Output_section::lookup_maps_): New data member.
10012
10013 2010-05-21 Doug Kwan <dougkwan@google.com>
10014
10015 PR gold/11619
10016 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10017 avoid a compilation error.
10018
10019 2010-05-19 Rafael Espindola <espindola@google.com>
10020
10021 * script-sections.cc (Output_section_definition::allocate_to_segment):
10022 Update the phdrs_list even when the output section is NULL.
10023 * testsuite/Makefile.am: Add test.
10024 * testsuite/Makefile.in: Regenerate.
10025 * testsuite/script_test_9.cc: New.
10026 * testsuite/script_test_9.sh: New.
10027 * testsuite/script_test_9.t: New.
10028
10029 2010-05-19 Doug Kwan <dougkwan@google.com>
10030
10031 * arm.cc (Arm_input_section::original_size): New method.
10032 (Arm_input_section::do_addralign): Add a cast.
10033 (Arm_input_section::do_output_offset): Remove static cast.
10034 (Arm_input_section::original_addralign,
10035 Arm_input_section::original_size_): Change type to uint32_t.
10036 (Arm_input_section::init): Add safe casts for section alignment
10037 and size.
10038 (Arm_input_section::set_final_data_size): Do not set address and
10039 offset of stub table.
10040 (Arm_output_section::fix_exidx_coverage): Change use of of
10041 Output_section::Simple_input_section to that of
10042 Output_section::Input_section.
10043 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10044 except for the first pass.
10045 * output.cc (Output_section::get_input_sections): Change type of
10046 input_sections to std::list<Input_section>.
10047 (Output_section::add_script_input_section): Rename from
10048 Output_section::add_simple_input_section. Change type of SIS
10049 parameter from Simple_input_section to Input_section.
10050 * output.h (Output_section::Simple_input_section): Remove class.
10051 (Output_section::Input_section): Change class visibility to public.
10052 (Output_section::Input_section::addralign): Use stored alignments
10053 for special input sections if set.
10054 (Output_section::Input_section::set_addralign): New method.
10055 (Output_section::get_input_sections): Change parameter type from
10056 list of Simple_input_section to list of Input_section.
10057 (Output_section::add_script_input_section): Rename from
10058 Output_section::add_simple_input_section. Change first parameter's
10059 type from Simple_input_section to Input_section and remove the
10060 second and third parameters.
10061 * script-sections.cc (Input_section::Input_section_list): Change
10062 type to list of Output_section::Input_section/
10063 (Input_section_info::Input_section_info): Change parameter type of
10064 INPUT_SECTION to Output_section::Input_section.
10065 (Input_section_info::input_section): Change return type.
10066 (Input_section_info::input_section_): Change type to
10067 Output_section::Input_section.
10068 (Output_section_element_input::set_section_addresses): Adjust code
10069 to use Output_section::Input_section instead of
10070 Output_section::Simple_input_section. Adjust code for renaming
10071 of Output_section::add_simple_input_section.
10072 (Orphan_output_section::set_section_addresses): Ditto.
10073
10074 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10075
10076 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10077 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10078
10079 2010-05-18 Rafael Espindola <espindola@google.com>
10080
10081 * options.cc (General_options::finalize): Handle -nostdlib.
10082 * options.h (nostdlib): New option.
10083 * script.cc (script_add_search_dir): Handle -nostdlib.
10084
10085 2010-05-12 Doug Kwan <dougkwan@google.com>
10086
10087 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10088 attributes section only if there no attributes section after merging.
10089 (Target_arm::merge_object_attributes): Move value of
10090 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10091 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10092 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10093 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10094 and arm_attr_merge_7.stdout.
10095 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10096 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10097 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10098 arm_attr_merge_7b.o): New rules.
10099 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10100 arm_attr_merge_7
10101 * testsuite/Makefile.in: Regenerate.
10102 * testsuite/arm_attr_merge.sh: New file.
10103 * testsuite/arm_attr_merge_[67][ab].s: Same.
10104
10105 2010-05-05 Nick Clifton <nickc@redhat.com>
10106
10107 * po/es.po: Updated Spanish translation.
10108
10109 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10110
10111 * Makefile.am (install-exec-local): Properly install gold as
10112 default cross linker.
10113 * Makefile.in: Regenerated.
10114
10115 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10116 Nick Clifton <nickc@redhat.com>
10117
10118 * configure.ac (install_as_default): Define and set to false
10119 unless --enable-gold or --enable-gold=both/gold has been
10120 specified.
10121 * configure: Regenerate.
10122
10123 * Makefile.am (install-exec-local): Install the executable as
10124 'ld.gold'. If install_as_default is true then also install it as
10125 'ld'.
10126 * Makefile.in: Regenerated.
10127
10128 2010-04-24 Ian Lance Taylor <iant@google.com>
10129
10130 * layout.cc (Layout::layout_reloc): In relocatable link don't
10131 combine reloc sections for grouped sections.
10132
10133 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10134
10135 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10136 sections that are not ordinary to icf.
10137 * icf.cc (get_section_contents): Handle relocation pointing to section
10138 with no object or shndx information.
10139 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10140 * testsuite/Makefile.in: Regenerate.
10141 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10142 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10143
10144 2010-04-22 Ian Lance Taylor <iant@google.com>
10145
10146 * expression.cc (Expression::Expression_eval_info): Add
10147 result_alignment_pointer field.
10148 (Expression::eval_with_dot): Add result_alignment_pointer
10149 parameter. Change all callers.
10150 (Expression::eval_maybe_dot): Likewise.
10151 (class Binary_expression): Add alignment_pointer parameter to
10152 left_value and right_value. Change all callers.
10153 (BINARY_EXPRESSION): Set result alignment.
10154 (class Trinary_expression): Add alignment_pointer parameter to
10155 arg2_value and arg3_value. Change all callers.
10156 (Trinary_cond::value): Set result alignment.
10157 (Max_expression::value, Min_expression::value): Likewise.
10158 (Align_expression::value): Likewise.
10159 * script-sections.cc (class Sections_element): Add dot_alignment
10160 parameter to set_section_addresses virtual function. Update
10161 instantiations.
10162 (class Output_section_element): Likewise.
10163 (Script_sections::create_segments): Add dot_alignment parameter.
10164 Change all callers.
10165 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10166 (Script_sections::set_phdrs_clause_addresses): Likewise.
10167 * script-sections.h: Update declarations.
10168 * script.h: Update declarations.
10169 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10170 min_p_align.
10171 * testsuite/script_test_3.t: Set large alignment.
10172 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10173 segment has expected alignment.
10174
10175 2010-04-22 Nick Clifton <nickc@redhat.com>
10176
10177 * po/gold.pot: Updated by the Translation project.
10178 * po/vi.po: Updated Vietnamese translation.
10179
10180 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10181
10182 * testsuite/Makefile.am (check_PROGRAMS): Add
10183 icf_virtual_function_folding_test.
10184 * testsuite/Makefile.in: Regenerated.
10185
10186 2010-04-15 Andrew Haley <aph@redhat.com>
10187
10188 * options.h (merge_exidx_entries): New option.
10189 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10190 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10191 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10192 (Target_arm::merge_exidx_entries): New function.
10193 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10194 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10195 to Arm_exidx_fixup constructor.
10196 Add new arg, merge_exidx_entries.
10197 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10198 Arm_output_section::fix_exidx_coverage.
10199
10200 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10201
10202 * icf.cc (get_section_contents): Check for preemptible functions.
10203 Ignore addend when appropriate.
10204 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10205 section folded.
10206 (add_from_relobj): Check for section folded.
10207 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10208 * symtab.h (should_add_dynsym_entry): Add new parameter.
10209 * target-reloc.h (scan_relocs): Check for section folded.
10210 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10211 Check reloc types for function pointers in shared objects.
10212 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10213 case.
10214 (icf_preemptible_functions_test): New test case.
10215 (icf_string_merge_test): New test case.
10216 * testsuite.Makefile.in: Regenerate.
10217 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10218 bar_glob. Refactor code.
10219 * testsuite/icf_preemptible_functions_test.cc: New file.
10220 * testsuite/icf_preemptible_functions_test.sh: New file.
10221 * testsuite/icf_string_merge_test.cc: New file.
10222 * testsuite/icf_string_merge_test.sh: New file.
10223 * testsuite/icf_virtual_function_folding_test.cc: New file.
10224 * testsuite/icf_virtual_function_folding_test.sh: New file.
10225
10226 2010-04-14 Doug Kwan <dougkwan@google.com>
10227
10228 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10229 for local symbol recounting if we remove a section due to ICF.
10230 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10231 there are no regular objects in input.
10232
10233 2010-04-13 Doug Kwan <dougkwan@google.com>
10234
10235 * arm.cc (Arm_input_section::set_final_data_size): Compute
10236 accurate final data size instead of using current data size.
10237
10238 2010-04-09 Doug Kwan <dougkwan@google.com>
10239
10240 * layout.cc (Layout::choose_output_section): Handle script section
10241 types.
10242 (Layout::make_output_section_for_script): Add section type parameter.
10243 Handle script section types.
10244 * layout.h (Layout::make_output_section_for_script): Add section
10245 type parameter.
10246 * output.cc (Output_section::Output_section): Initialize data member
10247 is_noload_.
10248 (Output_section::do_reset_address_and_file_offset): Do not set address
10249 to 0 if section is a NOLOAD section.
10250 * output.h (Output_section::is_noload): New method.
10251 (Output_section::set_is_noload): Ditto.
10252 (Output_section::is_noload_): New data member.
10253 * script-c.h (Script_section_type): New enum type.
10254 (struct Parser_output_section_header): Add new file section_type.
10255 * script-sections.cc (Sections_element::output_section_name): Add
10256 parameter for returning script section type.
10257 (Output_section_definition::output_section_name): Ditto.
10258 (Output_section_definition::section_type)P; New method.
10259 (Output_section_definiton::script_section_type_name): Ditto.
10260 (Output_section_definition::script_section_type_): New data member.
10261 (Output_section_definition::Output_section_definition): Initialize
10262 data member Output_section_definition::script_section_type_.
10263 (Output_section_definition::create_sections): Pass script section type
10264 to Layout::make_output_section_for_script.
10265 (Output_section_definition::output_section_name): Return script
10266 section type to caller.
10267 (Output_section_definition::set_section_address): Do not advance
10268 dot value and load address if section type is NOLOAD. Set address
10269 of NOLOAD sections regardless of section flags.
10270 (Output_section_definition::print): Print section type if it is
10271 not SCRIPT_SECTION_TYPE_NONE.
10272 (Output_section_definition::section_type): New method.
10273 (Output_section_definition::script_section_type_name): Ditto.
10274 (Script_sections::output_section_name): Add new parameter
10275 PSECTION_TYPE for returning script section type. Pass it to
10276 section elements. Handle discard sections.
10277 (Sort_output_sections::operator()): Handle NOLOAD sections.
10278 * script-sections.h (Script_sections::Section_type): New enum type.
10279 (Script_sections::output_section_name): Add a new parameter for
10280 returning script section type.
10281 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10282 INFO and NOLOAD.
10283 * yyscript.y (union): Add new field SECTION_TYPE.
10284 (COPY, DSECT, INFO, NOLOAD): New tokens.
10285 (opt_address_and_section_type): Change type to output_section_header.
10286 (section_type): New non-terminal
10287 (section_header): Handle section type.
10288 (opt_address_and_section_type): Return section type value.
10289
10290 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10291
10292 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10293 * testsuite/plugin_common_test_2.c (foo): Likewise.
10294
10295 2010-04-08 Doug Kwan <dougkwan@google.com>
10296
10297 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10298 Output_merge_data.
10299 * output.cc (Output_section::add_merge_input_section): Simplify
10300 code and return status of Output_merge_base::add_input_section.
10301 Update merge section map only if Output_merge_base::add_input_section
10302 returns true.
10303
10304 2010-04-07 Doug Kwan <dougkwan@google.com>
10305
10306 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10307 if section is marked as containing instructions but has no mapping
10308 symbols.
10309 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10310 correct section index.
10311 (Arm_relobj::find_linked_text_section): Ditto.
10312
10313 2010-04-07 Cary Coutant <ccoutant@google.com>
10314
10315 * archive.cc (include_member): Destroy Read_symbols_data object before
10316 releasing file.
10317 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10318 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10319 (Read_symbols_data::~Read_symbols_data) New destructor.
10320 (Section_relocs::Section_relocs) New constructor.
10321 (Section_relocs::~Section_relocs) New destructor.
10322 (Read_relocs_data::Read_relocs_data) New constructor.
10323 (Read_relocs_data::~Read_relocs_data) New destructor.
10324 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10325 pointers to NULL after deleting.
10326
10327 2010-04-07 Doug Kwan <dougkwan@google.com>
10328
10329 * arm.cc: Replace "endianity" with "endianness" in comments.
10330 (Arm_exidx_cantunwind): Ditto.
10331 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10332 (Arm_relobj::merge_flags_and_attributes): New method.
10333 (Arm_relobj::merge_flags_and_attributes_): New data member.
10334 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10335 (Arm_relobj::scan_sections_for_stubs): Ditto.
10336 (Arm_relobj::do_read_symbols): Check to see if we really want to
10337 merge processor-specific flags and attributes. Exit early if
10338 an object is empty except for section names and the undefined symbol.
10339 (Target_arm::do_finalize_sections): Move check for ELF format to
10340 Arm_relobj::do_read_symbols. Merge processor specific flags and
10341 attributes from a regular object only when we have determined that
10342 it is aapropriate. Do not create an .ARM.attributes section in
10343 output if there is no regular input object.
10344 (Target_arm::merge_processor_specific_flags): Check
10345 --warn-mismatch before printing any error.
10346 (Target_arm::merge_object_attributes): Ditto.
10347 * gold.cc (queue_middle_tasks): Handle the case in which there is
10348 no regular object in input.
10349 * options.cc (General_options::parse_EB): New method.
10350 (General_options::parse_EL): Same.
10351 (General_options::General_options): Initialize endianness_.
10352 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10353 New options.
10354 (General_options::Endianness): New enum.
10355 (General_options::endianness): New method.
10356 (General_options::endianness_): New data member.
10357 * parameters.cc (Parameters::set_options): Check target endianness.
10358 (Parameters::set_target_once): Ditto.
10359 (Parameters::check_target_endianness): New method.
10360 (parameters_force_valid_target): If either -EL or -EB is specified,
10361 use it to define endianness of default target.
10362 * parameters.h (Parameters::check_target_endianness): New method
10363 declaration.
10364 * target.h (class Target): Change "endianity" to "endianness"
10365 in comments.
10366
10367 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10368
10369 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10370 * configure: Regenerate.
10371 * Makefile.in: Regenerate.
10372 * testsuite/Makefile.in: Regenerate.
10373
10374 2010-04-06 Cary Coutant <ccoutant@google.com>
10375
10376 gcc PR lto/42757
10377 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10378 prevailing definitions of common symbols.
10379 * testsuite/plugin_test_6.sh: New test case.
10380 * testsuite/plugin_common_test_1.c: New test case.
10381 * testsuite/plugin_common_test_2.c: New test case.
10382 * testsuite/Makefile.am (plugin_test_6): New test case.
10383 * testsuite/Makefile.in: Regenerate.
10384
10385 2010-04-06 Nick Clifton <nickc@redhat.com>
10386
10387 * po/vi.po: New Vietnamese translation.
10388
10389 2010-03-30 Doug Kwan <dougkwan@google.com>
10390
10391 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10392
10393 2010-03-25 Doug Kwan <dougkwan@google.com>
10394
10395 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10396 to avoid a conversion warning on a 32-bit host.
10397
10398 2010-03-24 Ian Lance Taylor <iant@google.com>
10399
10400 * testsuite/script_test_3.t: Add a TLS segment.
10401 * testsuite/Makefile.am (check_PROGRAMS): Add
10402 tls_phdrs_script_test.
10403 (tls_phdrs_script_test_SOURCES): Define.
10404 (tls_phdrs_script_test_DEPENDENCIES): Define.
10405 (tls_phdrs_script_test_LDFLAGS): Define.
10406 (tls_phdrs_script_test_LDADD): Define.
10407 * testsuite/Makefile.in: Rebuild.
10408
10409 2010-03-23 Cary Coutant <ccoutant@google.com>
10410
10411 * fileread.cc (find_or_make_view): Fix comment.
10412
10413 2010-03-23 Ian Lance Taylor <iant@google.com>
10414
10415 * script-sections.cc (class Orphan_section_placement): Define
10416 PLACE_TLS and PLACE_TLS_BSS.
10417 (Orphan_section_placement::Orphan_section_placement): Initialize
10418 new places.
10419 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10420 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10421 (tls_script_test_SOURCES): Define.
10422 (tls_script_test_DEPENDENCIES): Define.
10423 (tls_script_test_LDFLAGS): Define.
10424 (tls_script_test_LDADD): Define.
10425 * testsuite/Makefile.in: Rebuild.
10426
10427 2010-03-22 Doug Kwan <dougkwan@google.com>
10428
10429 * arm.cc (Arm_relocate_functions::abs8,
10430 Arm_relocate_functions::abs16): Use correct check for overflow
10431 specified in the ARM ELF specs.
10432 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10433 target of a BLX instruction specially.
10434 (Reloc_stub::stub_type_for_reloc): Ditto.
10435 (Relocate::relocate): Use symbolic names instead of numeric relocation
10436 codes to report error.
10437 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10438 workaround.
10439 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10440 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10441 thumb2_blx_out_of_range.stdout
10442 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10443 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10444 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10445 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10446 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10447 thumb2_blx_in_range, thumb2_blx_in_range.o,
10448 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10449 thumb2_blx_out_of_range.o): New rules.
10450 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10451 thumb2_blx_in_range and thumb2_blx_out_of_range.
10452 * testsuite/Makefile.in: Regenerate.
10453 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10454 * testsuite/thumb_blx_in_range.s: New file.
10455 * testsuite/thumb_blx_out_of_range.s: New file.
10456
10457 2010-03-22 Rafael Espindola <espindola@google.com>
10458
10459 * archive.cc (Should_include): Move to archive.h.
10460 (should_include_member): Make it a member of Archive.
10461 (Lib_group): New.
10462 (Add_lib_group_symbols): New.
10463 * archive.h: Include options.h.
10464 (Archive_member): Moved from Archive.
10465 (Should_include): Moved from archive.cc.
10466 (Lib_group): New.
10467 (Add_lib_group_symbols): New.
10468 * dynobj.cc (do_should_include_member): New.
10469 * dynobj.h (do_should_include_member): New.
10470 * gold.cc (queue_initial_tasks): Update call to queue.
10471 * main.cc (main): Print lib group stats.
10472 * object.cc (do_should_include_member): New.
10473 * object.h: Include archive.h.
10474 (Object::should_include_member): New.
10475 (Object::do_should_include_member): New.
10476 (Sized_relobj::do_should_include_member): New.
10477 * options.cc (General_options::parse_start_lib): New.
10478 (General_options::parse_end_lib): New.
10479 (Input_arguments::add_file): Handle lib groups.
10480 (Input_arguments::start_group): Check we are not in a lib.
10481 (Input_arguments::start_lib): New.
10482 (Input_arguments::end_lib): New.
10483 * options.h (General_options): Add start_lib and end_lib.
10484 (Input_argument::lib_): New.
10485 (Input_argument::lib): New.
10486 (Input_argument::is_lib): New.
10487 (Input_file_lib): New.
10488 (Input_arguments::in_lib_): New.
10489 (Input_arguments::in_lib): New.
10490 (Input_arguments::start_lib): New.
10491 (Input_arguments::end_lib_): New.
10492 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10493 in unused members as preempted.
10494 (Sized_pluginobj::do_should_include_member): New.
10495 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10496 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10497 return the blocker.
10498 (Read_symbols::do_whole_lib_group): New.
10499 (Read_symbols::do_lib_group): New.
10500 (Read_symbols::do_read_symbols): Handle lib groups.
10501 (Read_symbols::get_name): Handle lib groups.
10502 * readsyms.h (Read_symbols): Add an archive member pointer.
10503 (Read_symbols::do_whole_lib_group): New.
10504 (Read_symbols::do_lib_group): New.
10505 (Read_symbols::member_): New.
10506 * script.cc (read_input_script): Update call to queue_soon.
10507
10508 2010-03-19 Doug Kwan <dougkwan@google.com>
10509
10510 * arm.cc (Stub_table::Stub_table): Initialize new data members
10511 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10512 (Stub_table::add_reloc_stub): Assign stub offset and update
10513 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10514 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10515 New data members.
10516 (Stub_table::update_data_size_and_addralign): Use
10517 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10518 instead of going over all reloc stubs.
10519 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10520 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10521 Stringpool_template::offset_ to size of Stringpool_char.
10522 (Stringpool_template::new_key_offset): Remove code to initialize
10523 Stringpool_template::offset_.
10524 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10525 Stringpool_template::offset_ to zero.
10526
10527 2010-03-15 Doug Kwan <dougkwan@google.com>
10528
10529 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10530 offset_.
10531 (Stringpool_template::new_key_offset): New method.
10532 (Stringpool_template::add_string): Assign offsets when adding new
10533 strings.
10534 (Stringpool_template::set_string_offsets): Do not set string offsets
10535 when not optimizing.
10536 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10537 member size_.
10538 (Chunked_vector::clear): Clear size_.
10539 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10540 (Chunked_vector::size): Return size_.
10541 (Chunked_vector::push_back): Use size_ to find insert position.
10542 (Chunked_vector::size_): New data member.
10543 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10544 (Stringpool_template::new_key_offset): New method declaration.
10545 (Stringpool_template::offset_): New data member.
10546
10547 2010-03-15 Rafael Espindola <espindola@google.com>
10548
10549 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10550 Add_symbols' constructor.
10551 * readsyms.h (Add_symbols): Remove the input_group member.
10552
10553 2010-03-10 Ian Lance Taylor <iant@google.com>
10554
10555 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10556 target to ask whether a reference to a symbol requires a stack
10557 split.
10558 * target.h (Target::is_call_to_non_split): New function.
10559 (Target::do_is_call_to_non_split): Declare virtual function.
10560 * target.cc: Include "symtab.h".
10561 (Target::do_is_call_to_non_split): New function.
10562 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10563
10564 2010-03-10 Cary Coutant <ccoutant@google.com>
10565
10566 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10567 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10568 (File_read::open[2]): Add whole_file_view_ to list of views.
10569 (File_read::make_view): Remove test of whole_file_view_.
10570 (File_read::find_or_make_view): Create whole_file_view_ if
10571 necessary.
10572 (File_read::clear_views): Replace bool parameter with enum;
10573 adjust all callers. Don't delete views with permanent data;
10574 do delete cached views and views from archives if
10575 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10576 if clearing the corresponding view.
10577 * fileread.h (File_read::Clear_views_mode): New enum.
10578 (File_read::View::is_permanent_view): New method.
10579 (File_read::clear_views): Replace bool parameter
10580 with enum; adjust all callers.
10581 * options.h (General_options): Change keep_files_mapped option;
10582 add map_whole_files.
10583 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10584 releasing the file.
10585 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10586 the file.
10587
10588 2010-03-10 David S. Miller <davem@davemloft.net>
10589
10590 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10591
10592 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10593
10594 * icf.cc (get_section_contents): Add '@' marker after processing the
10595 merge reloc.
10596
10597 2010-03-08 Doug Kwan <dougkwan@google.com>
10598
10599 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10600 due to a conversion warning.
10601 (Arm_relobj::update_output_local_symbol_count): Check for local
10602 symbol with unset output index.
10603
10604 2010-03-05 Ian Lance Taylor <iant@google.com>
10605
10606 * options.h (class General_options): Add --spare-dynamic-tags.
10607 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10608 --spare-dynamic-tags.
10609
10610 2010-03-05 Ian Lance Taylor <iant@google.com>
10611
10612 * incremental.cc: Include "libiberty.h".
10613
10614 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10615
10616 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10617 function, is_info_ member.
10618 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10619 (Versions::Versions): Update caller.
10620 (Versions::define_base_version): Likewise.
10621 (Versions::add_def): Likewise.
10622
10623 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10624
10625 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10626 (Scan::possible_function_pointer_reloc): New function.
10627 (Scan::local_reloc_may_be_function_pointer): Change to call
10628 possible_function_pointer_reloc.
10629 (Scan::global_reloc_may_be_function_pointer): Ditto.
10630 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10631 relocations in ".data.rel.ro._ZTV" section.
10632 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10633 * testsuite/icf_safe_so_test.cc: Ditto.
10634 * testsuite/icf_safe_test.cc: Ditto.
10635 * testsuite/icf_safe_test.sh: Ditto.
10636
10637 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10638 Ian Lance Taylor <iant@google.com>
10639
10640 * target-reloc.h (relocate_section): Check the symbol table index
10641 for -1U before setting the local symbol index.
10642 (scan_relocatable_relocs): If copying the relocation, record that
10643 the local symbol is required.
10644 * object.h (Symbol_value::is_output_symtab_index_set): New
10645 function.
10646 (Symbol_value::may_be_discarded_from_output_symtab): New
10647 function.
10648 (Symbol_value::has_output_symtab_entry): New function.
10649 (Symbol_value::needs_output_symtab_entry): Remove.
10650 (Symbol_value::output_symtab_index): Make sure the symbol index is
10651 set.
10652 (Symbol_value::set_output_symtab_index): Make sure the symbol
10653 index is not set. Make sure the new index is valid.
10654 (Symbol_value::set_must_have_output_symtab_entry): New function.
10655 (Symbol_value::has_output_dynsym_entry): New function.
10656 (Symbol_value::set_output_dynsym_index): Make sure the new index
10657 is valid.
10658 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10659 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10660 local symbol if permitted.
10661 (Sized_relobj::do_finalize_local_symbols): Call
10662 is_output_symtab_index_set rather than needs_output_symtab_entry.
10663 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10664 rather than needs_output_symtab_entry. Call
10665 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10666 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10667 is_output_symtab_index_set rather than needs_output_symtab_entry.
10668 * testsuite/discard_locals_relocatable_test.c: New file.
10669 * testsuite/discard_locals_test.sh: Test -r.
10670 * testsuite/Makefile.am (check_DATA): Add
10671 discard_locals_relocatable_test1.syms,
10672 discard_local_relocatable_test2.syms.
10673 (MOSTLYCLEANFILES): Likewise. Also add
10674 discard_locals_relocatable_test1.lout and
10675 discard_locals_relocatable_test2.out.
10676 (discard_locals_relocatable_test1.syms): New target.
10677 (discard_locals_relocatable_test.o): New target.
10678 (discard_locals_relocatable_test1.out): New target.
10679 (discard_locals_relocatable_test2.syms): New target.
10680 (discard_locals_relocatable_test2.out): New target.
10681 (various): Add missing ../ld-new dependencies.
10682 * testsuite/Makefile.in: Rebuild.
10683
10684 2010-03-03 Nick Clifton <nickc@redhat.com>
10685
10686 * po/fi.po: New Finnish translation.
10687
10688 2010-03-01 Doug Kwan <dougkwan@google.com>
10689
10690 * layout.cc (Layout::Layout): Force section types of .init_array*,
10691 .preinit_array* and .fini_array* sections.
10692 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10693 Fix check of return value of std::string::find.().
10694 (Output_section::Input_section_sort_compare::operator()): Remove
10695 comment about .init_array.
10696 (Output_section::Input_section_sort_init_fini_compare::operator()):
10697 New method.
10698 (Output_section::sort_attached_input_sections): Handle .init_array
10699 and .fini_array specially.
10700 * output.h (Output_section::Inut_section_sort_compare): Update
10701 comment.
10702 (Output_section::Input_section_sort_init_fini_compare): New struct.
10703
10704 2010-02-26 Doug Kwan <dougkwan@google.com>
10705
10706 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10707 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10708 * testsuite/debug_msg.sh: Avoid matching source line number for
10709 use of global variable undef_int.
10710
10711 2010-02-26 Doug Kwan <dougkwan@google.com>
10712
10713 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10714 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10715 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10716 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10717 * options.cc (General_options::General_options): Initialize member
10718 fix_v4bx_.
10719 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10720 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10721 and rm_no_fix_v4bx.stdout
10722 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10723 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10724 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10725 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10726 and arm_no_fix_v4bx.
10727 * Makefile.in: Regenerate.
10728 * testsuite/arm_fix_v4bx.s: New file.
10729 * testsuite/arm_fix_v4bx.sh: Ditto.
10730
10731 2010-02-24 Doug Kwan <dougkwan@google.com>
10732
10733 * arm.cc (Target_arm::got_section): Make the .got section the first
10734 non RELRO section in the data segment.
10735 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10736 suffixes of section names.
10737
10738 2010-02-24 Doug Kwan <dougkwan@google.com>
10739
10740 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10741 flags and attributes merging if an input file is a binary file.
10742 * fileread.cc (Input_file::open): Record format of original file.
10743 * fileread.h (Input_file::Format): New enum type.
10744 (Input_file::Input_file): Initialize data member format_.
10745 (Input_file::format): New method definition.
10746 (Input_file::format_):: New data member.
10747
10748 2010-02-24 Doug Kwan <dougkwan@google.com>
10749
10750 * arm.cc (Arm_output_data_got): New class.
10751 (ARM_TCB_SIZE): New constant
10752 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10753 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10754 If user uses a script with a SECTIONS clause, issue only a warning
10755 for a misplaced EXIDX input section. Otherwise, issue an error.
10756 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10757 garbage collection.
10758 (Target_arm::got_mode_index_entry): Handle static linking.
10759 (Target_arm::Scan::local): Ditto.
10760 (Target_arm::Scan::global): Ditto.
10761 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10762 all incorrectly implemented relocations.
10763 (Target_arm::fix_exidx_coverage): Pass layout to
10764 Arm_output_section::fix_exidx_coverage.
10765 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10766 from ".ARM.exidx." and ".ARM.extab.".
10767
10768 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10769
10770 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10771 section if it does not already exist.
10772 * attributes.cc (Attributes_section_data::Attributes_section_data):
10773 Don't crash if size is zero.
10774
10775 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10776 Ian Lance Taylor <iant@google.com>
10777
10778 * gold.cc (queue_middle_tasks): If no input files were opened,
10779 exit.
10780 * workqueue.h (Task_function::Task_function): Assert that there is
10781 a blocker.
10782
10783 2010-02-22 Doug Kwan <dougkwan@google.com>
10784
10785 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10786 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10787 types to avoid warnings due to different uint64_t implementations
10788 on different hosts.
10789
10790 2010-02-21 Doug Kwan <dougkwan@google.com>
10791
10792 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10793 handling of the maximum backward branch offset.
10794 (Arm_relocate_functions::thumb_branch_common): Ditto.
10795 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10796 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10797 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10798 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10799 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10800 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10801 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10802 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10803 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10804 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10805 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10806 thumb2_bl_out_of_range.o): New rules.
10807 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10808 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10809 thumb2_bl_out_of_range
10810 * testsuite/Makefile.in: Regenerate.
10811 * testsuite/arm_bl_in_range.s: New file.
10812 * testsuite/arm_bl_out_of_range.s: Ditto.
10813 * testsuite/arm_branch_in_range.sh: Ditto.
10814 * testsuite/arm_branch_range.t: Ditto.
10815 * testsuite/thumb2_branch_range.t: Ditto.
10816 * testsuite/thumb_bl_in_range.s: Ditto.
10817 * testsuite/thumb_bl_out_of_range.s: Ditto.
10818 * testsuite/thumb_branch_range.t: Ditto.
10819
10820 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10821
10822 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10823 Add reloc offset information.
10824 * icf.cc (get_section_contents): Change iterators to point to the new
10825 vectors. Add reloc offset information to the contents.
10826 * icf.h (Icf::Sections_reachable_info): New typedef.
10827 (Icf::Sections_reachable_list): New typedef.
10828 (Icf::Offset_info): New typedef.
10829 (Icf::Reloc_info): New struct typedef.
10830 (Icf::Reloc_info_list): New typedef.
10831 (Icf::symbol_reloc_list): Delete method.
10832 (Icf::addend_reloc_list): Delete method.
10833 (Icf::section_reloc_list): Delete method.
10834 (Icf::reloc_info_list): New method.
10835 (Icf::reloc_info_list_): New member.
10836
10837 2010-02-19 Doug Kwan <dougkwan@google.com>
10838
10839 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10840 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10841 * arm.cc (Arm_relocation_functions): New forward declaration.
10842 (Target_arm::Target_arm): Initialize new data members
10843 got_mod_index_offset_ and tls_base_symbol_defined_.
10844 (Target_arm::Relocate::relocate_tls): New method.
10845 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10846 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10847 New methods.
10848 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10849 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10850 (Target_arm::got_mod_index_offset_,
10851 Target_arm::tls_base_symbol_defined_): New data members.
10852 (Target_arm::Scan::local, Target::Scan::global,
10853 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10854 relocations.
10855
10856 2010-02-18 Doug Kwan <dougkwan@google.com>
10857
10858 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10859 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10860 text section as a parameter becuase some broken tools may not set
10861 the link in section header.
10862 (Target_arm::has_got_section): New method.
10863 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10864 without any mapping symbol as data only. Remove warning.
10865 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10866 link in its section header, try to discover the link by inspecting the
10867 REL31 relocation at the beginning of the section.
10868 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10869 in error message.
10870 (Target_arm::Scan::global): Treat any reference to the symbol
10871 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10872
10873 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10874
10875 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10876 (Scan::global_reloc_may_be_function_pointer): New function.
10877 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10878 (Scan::global_reloc_may_be_function_pointer): New function.
10879 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10880 (Scan::global_reloc_may_be_function_pointer): New function.
10881 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10882 (Scan::global_reloc_may_be_function_pointer): New function.
10883 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10884 (Scan::global_reloc_may_be_function_pointer): New function.
10885 (Scan::possible_function_pointer_reloc): New function.
10886 (Target_x86_64::can_check_for_function_pointers): New function.
10887 * gc.h (gc_process_relocs): Scan relocation types to determine if
10888 function pointers were taken for targets that support it.
10889 * icf.cc (Icf::find_identical_sections): Include functions for
10890 folding in safe ICF whose pointer is not taken.
10891 * icf.h (Secn_fptr_taken_set): New typedef.
10892 (fptr_section_id_): New member.
10893 (section_has_function_pointers): New function.
10894 (set_section_has_function_pointers): New function.
10895 (check_section_for_function_pointers): New function.
10896 * options.h: Fix comment for safe ICF option.
10897 * target.h (can_check_for_function_pointers): New function.
10898 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10899 Modify icf_safe_test for X86-64.
10900 * testsuite/Makefile.in: Regenerate.
10901 * testsuite/icf_safe_so_test.cc: New file.
10902 * testsuite/icf_safe_so_test.sh: New file.
10903 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10904 (main): Change to take pointer to function kept_func_3.
10905 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10906 folding is done correctly for X86-64.
10907
10908 2010-02-12 David S. Miller <davem@davemloft.net>
10909
10910 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10911 is_symbolless parameter.
10912 (Output_reloc<SHT_REL>::is_symbolless): New.
10913 (Output_reloc<SHT_REL>::is_symbolless_): New.
10914 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10915 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10916 (Output_reloc<SHT_RELA>::is_symbolless): New.
10917 (Output_data_reloc::add_global): Handle is_symbolless.
10918 (Output_data_reloc::add_global_relative): Likewise.
10919 (Output_data_reloc::add_local): Likewise.
10920 (Output_data_reloc::add_local_relative): Likewise.
10921 (Output_data_reloc::add_symbolless_global_addend): New.
10922 (Output_data_reloc::add_symbolless_local_addend): New.
10923 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10924 is_symbolless.
10925 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10926 instead of ->is_relative_
10927 (Output_reloc::write): Likewise.
10928 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10929 (Output_reloc::write_rel): Simplify.
10930
10931 * sparc.cc (Target_sparc::Scan::local): Use
10932 ->add_symbolless_local_addend as needed.
10933 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10934 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10935 based upon relocation offset.
10936
10937 2010-02-11 Doug Kwan <dougkwan@google.com>
10938
10939 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10940 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10941 beginning of function.
10942 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10943 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10944 parameter is_32bit in calls to should_apply_static_reloc.
10945 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10946 (check_DATA): Add arm_abs_global.stdout.
10947 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10948 arm_abs_global.stdout): New rules.
10949 (MOSTLLYCLEANFILES): Add arm_abs_global
10950 * Makefile.in: Regenerate.
10951 * testsuite/arm_abs_global.s: New file.
10952 * testsuite/arm_abs_global.sh: Ditto.
10953 * testsuite/arm_abs_lib.s: Ditto.
10954
10955 2010-02-11 Ian Lance Taylor <iant@google.com>
10956
10957 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10958 Read_relocs task.
10959 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10960 Allocate_commons_task first.
10961 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10962 task, rather than symtab_lock_.
10963 (Gc_process_relocs::~Gc_process_relocs): New function.
10964 (Gc_process_relocs::is_runnable): Check this_blocker_.
10965 (Gc_process_relocs::locks): Use next_blocker_ rather than
10966 blocker_.
10967 (Scan_relocs::~Scan_relocs): New function.
10968 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10969 symtab_lock_.
10970 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10971 next_blocker_.
10972 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10973 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10974 constructor accordingly.
10975 (class Gc_process_relocs): Likewise.
10976 (class Scan_relocs): Likewise.
10977 * common.h (class Allocate_commons_task): Remove symtab_lock_
10978 field, and corresponding constructor parameter.
10979 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10980 symtab_lock_.
10981 (Allocate_commons_task::locks): Likewise.
10982
10983 2010-02-11 Ian Lance Taylor <iant@google.com>
10984
10985 * gold-threads.h (class Once): Define.
10986 (class Initialize_lock): Rewrite as child of Once.
10987 * gold-threads.cc (class Once_initialize): Define.
10988 (once_pointer_control): New static variable.
10989 (once_pointer, once_arg): New static variables.
10990 (c_run_once): New static function.
10991 (Once::Once, Once::run_once, Once::internal_run): New functions.
10992 (class Initialize_lock_once): Remove.
10993 (initialize_lock_control): Remove.
10994 (initialize_lock_pointer): Remove.
10995 (initialize_lock_once): Remove.
10996 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10997 (Initialize_lock::initialize): Rewrite.
10998 (Initialize_lock::do_run_once): New function.
10999 * archive.cc (Archive::interpret_header): Only clear name if it is
11000 not already empty.
11001 * fileread.cc: Include "gold-threads.h"
11002 (file_counts_lock): New static variable.
11003 (file_counts_initialize_lock): Likewise.
11004 (File_read::release): Only increment counts when using --stats.
11005 Use a lock around the increment.
11006 * parameters.cc (class Set_parameters_target_once): Define.
11007 (set_parameters_target_once): New static variable.
11008 (Parameters::Parameters): Move here from parameters.h.
11009 (Parameters::set_target): Rewrite.
11010 (Parameters::set_target_once): New function.
11011 (Parameters::clear_target): Move here and rewrite.
11012 * parameters.h (class Parameters): Update declarations. Add
11013 set_parameters_target_once_ field.
11014 (Parameters::Parameters): Move to parameters.cc.
11015 (Parameters::clear_target): Likewise.
11016 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11017 task.
11018 (Start_group::~Start_group): New function.
11019 (Start_group::is_runnable): New function.
11020 (Start_group::locks, Start_group::run): New functions.
11021 (Finish_group::run): Change saw_undefined to size_t.
11022 * readsyms.h (class Start_group): Define.
11023 (class Finish_group): Change saw_undefined_ field to size_t.
11024 (Finish_group::Finish_group): Remove saw_undefined and
11025 this_blocker parameters. Change all callers.
11026 (Finish_group::set_saw_undefined): New function.
11027 (Finish_group::set_blocker): New function.
11028 * symtab.h (class Symbol_table): Change saw_undefined to return
11029 size_t. Change saw_undefined_ field to size_t.
11030 * target-select.cc (Set_target_once::do_run_once): New function.
11031 (Target_selector::Target_selector): Initialize set_target_once_
11032 field. Don't initialize lock_ and initialize_lock_ fields.
11033 (Target_selector::instantiate_target): Rewrite.
11034 (Target_selector::set_target): New function.
11035 * target-select.h (class Set_target_once): Define.
11036 (class Target_selector): Update declarations. Make
11037 Set_target_once a friend. Remove lock_ and initialize_lock_
11038 fields. Add set_target_once_ field.
11039
11040 2010-02-10 Ian Lance Taylor <iant@google.com>
11041
11042 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11043 queueing any tasks.
11044 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11045 (queue_middle_tasks): Add all blockers before queueing any tasks.
11046 (queue_final_tasks): Likewise.
11047 * token.h (Task_token::add_blockers): New function.
11048 * object.h (Input_objects::number_of_relobjs): New function.
11049
11050 2010-02-10 Ian Lance Taylor <iant@google.com>
11051
11052 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11053 shared, not if not position independent.
11054 * x86_64.cc (Relocate::relocate_tls): Likewise.
11055 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11056 (tls_pie_pic_test): New target.
11057 * testsuite/Makefile.in: Rebuild.
11058
11059 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11060 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11061 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11062 * testsuite/Makefile.in: Rebuild.
11063
11064 2010-02-09 David S. Miller <davem@davemloft.net>
11065
11066 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11067 R_SPARC_RELATIVE using ->add_local_relative().
11068 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11069
11070 * output.h (Output_data_dynamic::add_section_size): New method
11071 that takes two Output_data objects.
11072 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11073 entry param. Handle it in initializers.
11074 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11075 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11076 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11077 arg.
11078 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11079 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11080 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11081 for dynrel_includes_plt.
11082 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11083 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11084 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11085 before .rela.plt
11086 (Target_sparc::do_finalize_sections): Update to pass true for
11087 dynrel_includes_plt.
11088 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11089 output before .rela.plt
11090 (Target_powerpc::do_finalize_sections): Update to pass true for
11091 dynrel_includes_plt when 32-bit.
11092
11093 2010-02-08 Doug Kwan <dougkwan@google.com>
11094
11095 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11096 method.
11097 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11098 Arm_relobj::scan_section_for_cortex_a8_stubs,
11099 Arm_relobj::do_relocation_section): Instead of calling
11100 Output_section::output_address, use faster
11101 Arm_relobj::simple_input_section_output_address.
11102
11103 2010-02-08 David S. Miller <davem@davemloft.net>
11104
11105 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11106 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11107 relocation helper function.
11108
11109 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11110 just like R_SPARC_GOT{10,13,22}.
11111 (Target_sparc::Scan::local): Likewise.
11112 (Target_sparc::Relocate:relocate): Likewise.
11113
11114 2010-02-06 Ian Lance Taylor <iant@google.com>
11115
11116 * configure.ac: Rewrite targetobjs duplicate removal code to use
11117 only shell constructs.
11118 * configure: Rebuild.
11119
11120 2010-02-05 Doug Kwan <dougkwan@google.com>
11121
11122 PR 11247
11123 * arm.cc (Arm_relobj::section_is_scannable): New method.
11124 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11125 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11126
11127 2010-02-04 Doug Kwan <dougkwan@google.com>
11128
11129 PR 11247
11130 * arm-reloc-property.cc (cstdio): Include.
11131 * configure.ac (targetobjs): Remove duplicates.
11132 * configure: Regenerate.
11133 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11134 big and little endian version for a given address size.
11135
11136 2010-02-03 Doug Kwan <dougkwan@google.com>
11137
11138 * arm-reloc-property.cc
11139 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11140 definition.
11141 * arm-reloc-property.h
11142 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11143 New method definition.
11144 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11145 declaration.
11146 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11147 overflow to N.
11148 (GOT_PREL): Change implemented to Y.
11149 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11150 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11151 (Arm_relocate_functions::movw_abs_nc): Remove method.
11152 (Arm_relocate_functions::movt_abs): Ditto.
11153 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11154 (Arm_relocate_functions::thm_movt_abs): Ditto.
11155 (Arm_relocate_functions::movw_rel_nc): Ditto.
11156 (Arm_relocate_functions::movw_rel): Ditto.
11157 (Arm_relocate_functions::movt_rel): Ditto.
11158 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11159 (Arm_relocate_functions:thm_movw_rel): Ditto.
11160 (Arm_relocate_functions:thm_movt_rel): Ditto.
11161 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11162 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11163 New method definitions.
11164 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11165 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11166 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11167 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11168 (Target_arm::Relocate::relocate): Check for non-static or
11169 unimplemented relocation code and exit early. Change calls to
11170 Target_arm::reloc_uses_thumb_bit and
11171 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11172 instead. Refactor code to handle similar relocations to increase
11173 code sharing. Remove check for unsupported relocation code in switch
11174 statement.
11175 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11176 relocation property table to find out size. Change error message to
11177 print out the name of a relocation code instead of the numeric value.
11178 (Target_arm::scan_reloc_for_stub): Use relocation property table
11179 instead of calling Target_arm::reloc_uses_thumb_bit().
11180
11181 2010-02-02 Doug Kwan <dougkwan@google.com>
11182
11183 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11184 types of relaxed input section.
11185
11186 2010-02-02 Doug Kwan <dougkwan@google.com>
11187
11188 * Makefile.am (HFILES): Add arm-reloc-property.h.
11189 (DEFFILES): New.
11190 (TARGETSOURCES): Add arm-reloc-property.cc
11191 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11192 (libgold_a_SOURCES): $(DEFFILES)
11193 * Makefile.in: Regenerate.
11194 * arm-reloc-property.cc: New file.
11195 * arm-reloc-property.h: New file.
11196 * arm-reloc.def: New file.
11197 * arm.cc: Update comments.
11198 (arm-reloc-property.h): New included header.
11199 (arm_reloc_property_table): New global variable.
11200 (Target_arm::do_select_as_default_target): New method definition.
11201 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11202 arm-reloc-property to targ_extra_obj.
11203 * parameters.cc (set_parameters_target): Call
11204 Target::select_as_default_target().
11205 * target.h (Target::select_as_default_target): New method definition.
11206 (Target::do_select_as_default_target): Same.
11207
11208 2010-02-01 Doug Kwan <dougkwan@google.com>
11209
11210 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11211 first_output_text_section_.
11212 (Arm_exidx_fixup::first_output_text_section): New method definition.
11213 (Arm_exidx_fixup::first_output_text_section_): New data member.
11214 (Arm_exidx_fixup::process_exidx_section): Record the first text
11215 output section seen.
11216 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11217 and entsize in output section header.
11218
11219 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11220
11221 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11222 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11223 (Arm_relocate_functions::thm_alu11): New Method.
11224 (Arm_relocate_functions::thm_pc8): New Method.
11225 (Arm_relocate_functions::thm_pc12): New Method.
11226 (Target_arm::Scan::local): Handle the relocations.
11227 (Target_arm::Scan::global): Likewise.
11228 (Target_arm::Relocate::relocate): Likewise.
11229 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11230
11231 2010-01-29 Doug Kwan <dougkwan@google.com>
11232
11233 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11234 of relocation types as ld.
11235
11236 2010-01-29 Doug Kwan <dougkwan@google.com>
11237
11238 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11239 to public.
11240 (Arm_relocate_functions::thumb_branch_common): Ditto.
11241 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11242 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11243 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11244 Arm_relocate_functions::jump24): Remove.
11245 (Target_arm::Relocate::relocate): Adjust code to call
11246 Arm_relocation_functions::arm_branch_common and
11247 Arm_relocation_functions::thumb_branch_common instead of their removed
11248 wrappers. Merge switch-cases together to reduce source code size.
11249
11250 2010-01-29 Doug Kwan <dougkwan@google.com>
11251
11252 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11253 output_local_symbol_count_needs_update_.
11254 (Arm_relobj::output_local_symbol_count_needs_update,
11255 Arm_relobj::set_output_local_symbol_count_needs_update,
11256 Arm_relobj::update_output_local_symbol_count): New methods.
11257 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11258 member.
11259 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11260 of pointed function as in a R_ARM_PREL31 relocation.
11261 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11262 for output local symbol count updating.
11263 (Target_arm::do_relax): Update output local symbol counts in objects
11264 if necessary.
11265 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11266
11267 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11268
11269 * arm.cc: Added support for the ARM relocations:
11270 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11271 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11272 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11273 movw_prel_nc).
11274 (Arm_relocate_functions::movw_rel): New method.
11275 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11276 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11277 thm_movw_prel_nc).
11278 (Arm_relocate_functions::thm_movw_rel): New method.
11279 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11280 thm_movt_prel).
11281 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11282 relocations.
11283 (Target_arm::Scan::global): Likewise.
11284 (Target_arm::Relocate::relocate): Likewise.
11285 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11286 Likewise.
11287
11288 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11289
11290 * arm.cc: Added support for ARM group relocations.
11291 (Target_arm::reloc_needs_sym_origin): New method.
11292 (Arm_relocate_functions::calc_grp_kn): New method.
11293 (Arm_relocate_functions::calc_grp_residual): New method.
11294 (Arm_relocate_functions::calc_grp_gn): New method.
11295 (Arm_relocate_functions::arm_grp_alu): New Method.
11296 (Arm_relocate_functions::arm_grp_ldr): New Method.
11297 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11298 (Arm_relocate_functions::arm_grp_ldc): New Method.
11299 (Target_arm::Scan::local): Handle the ARM group relocations.
11300 (Target_arm::Scan::global): Likewise.
11301 (Target_arm::Relocate::relocate): Likewise.
11302 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11303 Likewise.
11304
11305 2010-01-26 Doug Kwan <dougkwan@google.com>
11306
11307 * arm.cc (set): Include.
11308 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11309 pointer type.
11310 (Arm_output_section::Text_section_list): New type.
11311 (Arm_output_section::append_text_sections_to_list): New method.
11312 (Arm_output_section::fix_exidx_coverage): Ditto.
11313 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11314 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11315 Relobj::set_section_offset() instead of
11316 Sized_relobj::invalidate_section_offset().
11317 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11318 parameter for section headers. Ignore relocation sections for
11319 unallocated sections and EXIDX sections.
11320 (Target_arm::fix_exidx_coverage): New method.
11321 (Target_arm::output_section_address_less_than): New type.
11322 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11323 linked text section instead of the EXIDX section.
11324 (Arm_output_section::create_stub_group): Add an assertion to check
11325 that this is not an EXIDX output section.
11326 (Arm_output_section::append_text_sections_to_list): New method.
11327 (Arm_output_section::fix_exidx_coverage): Ditto.
11328 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11329 Arm_relobj::section_needs_reloc_stub_scanning.
11330 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11331 first pass.
11332 (Target_arm::fix_exidx_coverage): New method.
11333 * object.h (Relobj::set_output_section): New method.
11334 (Sized_relobj::invalidate_section_offset): Remove method.
11335 (Sized_relobj::do_invalidate_section_offset): Remove method.
11336 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11337
11338 2010-01-25 Doug Kwan <dougkwan@google.com>
11339
11340 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11341 Fix warning due to signed and unsigned comparison on a 32-bit host.
11342
11343 2010-01-22 Doug Kwan <dougkwan@google.com>
11344
11345 * arm.cc (Target_arm::do_relax): Record an output section for section
11346 offset adjustment it contains any stub table that has changed.
11347 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11348 offsets in an output section if necessary.
11349 * output.cc (Output_section::Output_section): Initialize
11350 section_offsets_need_adjustments_.
11351 (Output_section::add_input_section_for_script): Renamed to
11352 Output_section::add_simple_input_section.
11353 (Output_section::save_states): Add a comment.
11354 (Output_section::discard_states): New method defintion.
11355 (Output_section::adjust_section_offsets): Same.
11356 * output.h (Output_section::add_input_section_for_script): Renamed to
11357 Output_section::add_simple_input_section.
11358 (Output_section::discard_states): New method declaration.
11359 (Output_section::adjust_section_offsets): Same.
11360 (Output_section::section_offsets_need_adjustment,
11361 Output_section::set_section_offsets_need_adjustment): New method
11362 definitions.
11363 (Output_section::section_offsets_need_adjustment_): New data member.
11364 * script-sections.cc
11365 (Output_section_element_input::set_section_address): Adjust code for
11366 renaming of Output_section::add_input_section_for_script.
11367 (Orphan_output_section::set_section_address): Same.
11368
11369 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11370
11371 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11372 Fix_v4bx enum values .
11373 * gold/options.h (General_options): New option definitions.
11374 (General_options::fix_v4bx): New method.
11375 (General_options::Fix_v4bx): New enum.
11376 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11377 (General_options::parse_fix_v4bx_interworking): New method.
11378
11379 2010-01-22 Doug Kwan <dougkwan@google.com>
11380
11381 * arm.cc (Arm_exidx_fixup): New class.
11382
11383 2010-01-21 Doug Kwan <dougkwan@google.com>
11384
11385 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11386 classes.
11387 (Arm_exidx_section_offset_map): New type.
11388
11389 2010-01-21 Doug Kwan <dougkwan@google.com>
11390
11391 * arm.cc (Arm_exidx_input_section): New class.
11392 (Arm_relobj::exidx_input_section_by_link,
11393 Arm_relobj::exidx_input_section_by_shndx,
11394 Arm_relobj::make_exidx_input_section): New methods.
11395 (read_arm_attributes_section): Remove.
11396 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11397 information about them.
11398 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11399 to here.
11400
11401 2010-01-20 Doug Kwan <dougkwan@google.com>
11402
11403 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11404 Input_section_specifier to Section_id.
11405 (Target_arm::new_arm_input_section: Adjust code for change of key
11406 type.
11407 (Target_arm::find_arm_input_section): Ditto.
11408 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11409 (Section_id): Remove.
11410 (Garbage_collection::Section_id_hash): Remove.
11411 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11412 (Section_id): Remove.
11413 (Icf::Section_id_hash): Remove.
11414 * object.h (Section_id, Const_section_id, Section_id_hash,
11415 Const_section_id_hash): New type definitions.
11416 * output.cc (Output_section::add_relaxed_input_section): Change to
11417 use Const_section_id instead of Input_section_specifier as key type.
11418 (Output_section::add_merge_input_section): Ditto.
11419 (Output_section::build_relaxation_map): Change to use Section_id
11420 instead of Input_section_specifier as key type.
11421 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11422 Ditto.
11423 (Output_section::convert_input_sections_to_relaxed_sections): Change
11424 to use Const_section_id instead of Input_section_specifier as key type.
11425 (Output_section::find_merge_section): Ditto.
11426 (Output_section::find_relaxed_input_section): Ditto.
11427 * output.h (Input_section_specifier): Remove class.
11428 (Output_section::Output_section_data_by_input_section_map): Change
11429 key type to Const_section_id.
11430 (Output_section::Output_relaxed_input_section_by_input_section_map):
11431 Ditto.
11432 (Output_section::Relaxation_map): Change key type to Section_id.
11433
11434 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11435
11436 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11437 (class Arm_v4bx_stub): New class.
11438 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11439 (Stub_factory::make_arm_v4bx_stub): New method.
11440 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11441 (Stub_table::empty): Handle v4bx stubs.
11442 (Stub_table::add_arm_v4bx_stub): New method.
11443 (Stub_table::find_arm_v4bx_stub): New method.
11444 (Arm_relocate_functions::v4bx): New method.
11445 (Target_arm::fix_v4bx): New method.
11446 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11447 (Stub_table::relocate_stubs): Likewise.
11448 (Stub_table::do_write): Likewise.
11449 (Stub_table::update_data_size_and_addralign): Likewise.
11450 (Stub_table::finalize_stubs): Likewise.
11451 (Target_arm::Scan::local): Likewise.
11452 (Target_arm::Scan::global): Likewise.
11453 (Target_arm::do_finalize_sections): Likewise.
11454 (Target_arm::Relocate::relocate): Likewise.
11455 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11456 Likewise.
11457 (Target_arm::scan_reloc_for_stub): Likewise.
11458 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11459
11460 2010-01-19 Ian Lance Taylor <iant@google.com>
11461
11462 * output.cc (Output_section_headers::do_sized_write): Write large
11463 segment count to sh_info field.
11464 (Output_file_header::do_sized_write): For large segment count,
11465 write PN_XNUM to e_phnum field.
11466
11467 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11468
11469 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11470 (Arm_relocate_functions::thm_jump8): New function.
11471 (Arm_relocate_functions::thm_jump11): New function.
11472 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11473 R_ARM_THM_JUMP11.
11474 (Target_arm::Scan::global): Likewise.
11475 (Target_arm::Relocate::relocate): Likewise.
11476 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11477 Likewise.
11478
11479 2010-01-14 Doug Kwan <dougkwan@google.com>
11480
11481 * arm.cc (map, utility): Include headers.
11482 (Target_arm::apply_cortex_a8_workaround): New method.
11483 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11484 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11485 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11486 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11487 the --[no-]fix-cortex-a8 command line options.
11488 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11489 (Target_arm::relocate_stub): Use addend in instruction template.
11490 * options.h (DEFINE_bool): Set the user-set flag.
11491 (General_options): Add --[no-]-fix-cortex options.
11492 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11493 : Update fast look-up map after conversion.
11494
11495 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11496
11497 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11498 in the first pass of do_layout.
11499
11500 2010-01-13 Doug Kwan <dougkwan@google.com>
11501
11502 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11503 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11504 apparent compiler problem of not folding static constant integral
11505 data members of elfcpp::Elf_sizes<32>.
11506
11507 2010-01-13 Doug Kwan <dougkwan@google.com>
11508
11509 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11510 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11511 Arm_relobj::scan_section_for_cortex_a8_erratum,
11512 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11513 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11514 sections to scan for relocation stubs into a new method
11515 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11516 relocation and Cortex-A8 stub scanning.
11517 (Target_arm::do_relax): Force stubs to be after stubbed sections
11518 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11519 the beginning of a new relaxation pass. Update a comment.
11520 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11521
11522 2010-01-12 Ian Lance Taylor <iant@google.com>
11523
11524 * target-reloc.h (visibility_error): New inline function.
11525 (relocate_section): Call visibility_error.
11526 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11527 (MOSTLYCLEANFILES): Likewise.
11528 (protected_4_pic.o, protected_3.err): New targets.
11529 * testsuite/protected_4.cc: New file.
11530
11531 2010-01-12 Doug Kwan <dougkwan@google.com>
11532
11533 * arm.cc (Cortex_a8_reloc): New class.
11534 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11535 and cortex_a8_relocs_info_.
11536 (Target_arm::fix_cortex_a8): New method definition.
11537 (Target_arm::Cortex_a8_relocs_info): New type.
11538 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11539 New data member declarations.
11540 (Target_arm::scan_reloc_for_stub): Record information about
11541 relocations for THUMB branches that might be exempted from the
11542 Cortex-A8 workaround.
11543 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11544 at the beginning of a relaxation pass.
11545
11546 2010-01-12 Doug Kwan <dougkwan@google.com>
11547
11548 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11549 (Arm_relobj::Mapping_symbol_position,
11550 Arm_reloj::Mapping_symbol_position_less,
11551 Arm_relobj::Mapping_symbols_info): New types.
11552 (Target_arm::is_mapping_symbol_name): New method definition.
11553 (Arm_relobj::do_count_local_symbols): Save information about mapping
11554 symbols.
11555
11556 2010-01-11 Doug Kwan <dougkwan@google.com>
11557
11558 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11559 Arm_relocate_functions::thumb32_branch_upper,
11560 Arm_relocate_functions::thumb32_branch_lower,
11561 Arm_relocate_functions::thumb32_cond_branch_offset,
11562 Arm_relocate_functions::thumb32_cond_branch_upper,
11563 Arm_relocate_functions::thumb32_cond_branch_lower,
11564 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11565 branch offset encoding.
11566 (Arm_relocate_functions::thumb_branch_common): Use new branch
11567 offset encoding methods to avoid code duplication.
11568 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11569 (Stub_addend_reader::operator()): Use new branch encoding method
11570 to avoid code duplication.
11571
11572 2010-01-11 Doug Kwan <dougkwan@google.com>
11573
11574 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11575 (Target_arm::do_finalize_sections): Define special EXIDX section
11576 symbols only if referenced.
11577 * gc.h (Garbage_collection::add_reference): New method.
11578 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11579 code duplication.
11580
11581 2010-01-11 Ian Lance Taylor <iant@google.com>
11582
11583 * script.cc (Version_script_info::build_expression_list_lookup):
11584 Change complaing about duplicate wildcard match from error to
11585 warning.
11586
11587 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11588 of 2009-12-30.
11589 (Version_script_info::Version_script_info): Initialize globs_,
11590 default_version_, default_is_global_, and exact_. Don't
11591 initialize globals_ or locals_.
11592 (Version_script_info::build_lookup_tables): Build local symbols
11593 first.
11594 (Version_script_info::unquote): New function.
11595 (Version_script_info::add_exact_match): New function.
11596 (Version_script_info::build_expression_list_lookup): Remove lookup
11597 parameter. Add is_global parameter. Change all callers. Handle
11598 wildcard pattern specially. Unquote pattern. Call
11599 add_exact_match.
11600 (Version_script_info::get_name_to_match): New function.
11601 (Version_script_info::get_symbol_version): New function.
11602 (Version_script_info::get_symbol_version_helper): Remove.
11603 (Version_script_info::check_unmatched_names): Call unquote.
11604 * script.h (class Version_script_info): Change get_symbol_version
11605 to be non-inline and add is_global parameter; change all callers.
11606 Rewrite symbol_is_local. Update declarations. Define struct
11607 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11608 Remove globals_ and locals_ members. Add exact_, globs_,
11609 default_version_, is_global_.
11610 (Version_script_info::Glob): Remove pattern, add expression and
11611 is_global. Update constructor. Change all callers.
11612 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11613 default version.
11614 (Versions::symbol_section_contents): If a symbol is undefined, or
11615 defined in a dynamic object, set the version index to
11616 VER_NDX_LOCAL.
11617 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11618 symbol_is_local.
11619 (Symbol_table::add_from_pluginobj): Likewise.
11620 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11621
11622 2010-01-11 Doug Kwan <dougkwan@google.com>
11623
11624 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11625 (incremental_dump_LDADD): Add linking option for libintl.
11626 * Makefile.in: Regenerate.
11627
11628 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11629
11630 PR gold/11144
11631 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11632 instead of -Ds.
11633 * testsuite/Makefile.in: Regenerated.
11634
11635 2010-01-10 Doug Kwan <dougkwan@google.com>
11636
11637 * options.h (DEFINE_var): Use parentheses around argument varname__
11638 in macro body to avoid any unintended subsequent substitutions.
11639
11640 2010-01-10 Ian Lance Taylor <iant@google.com>
11641
11642 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11643 candidates before doing symbol resolution.
11644
11645 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11646 ODR candidates if only one is weak.
11647
11648 2010-01-08 Ian Lance Taylor <iant@google.com>
11649
11650 * script.cc (Version_script_info::build_expression_list_lookup):
11651 Don't warn about ambiguous version, just record the ambiguity.
11652 (Version_script_info::get_symbol_version_helper): Give error if
11653 version is ambiguous.
11654
11655 2010-01-08 Doug Kwan <dougkwan@google.com>
11656
11657 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11658 prev_data_size_ and prev_addralign_. Remove initializer for
11659 deleted data member has_been_changed_.
11660 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11661 to determine if the table is empty.
11662 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11663 Remove.
11664 (Stub_table::add_reloc_stub): Define method in class definition
11665 instead of just declaring it there.
11666 (Stub_table::add_cortex_a8_stub): New method definition.
11667 (Stub_table::update_data_size_and_addralign): Ditto.
11668 (Stub_table::finalize_stubs): Ditto.
11669 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11670 (Stub_table::do_addralign_): Return address alignment in the
11671 (Stub_table::do_reset_address_and_file_offset): Define method in
11672 class definition instead of declaring it there. Set current data
11673 size to be the data size of the previous pass.
11674 (Stub_table::set_final_data_size): Use current data size as the
11675 final data size.
11676 (Stub_table::relocate_stub): Change parameter type of stub from
11677 Reloc_stub pointer to Stub pointer.
11678 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11679 (Stub_table::Cortex_a8_stub_list): New typedef.
11680 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11681 Stub_table::prev_addralign_): New data member.
11682 (Arm_relobj::Arm_relobj): Initialize data member
11683 section_has_cortex_a8_workaround_.
11684 (Arm_relobj::section_has_cortex_a8_workaround,
11685 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11686 definitions.
11687 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11688 declarations.
11689 (Target_arm::relocate_stub): Change parameter type of stub from
11690 Reloc_stub pointer to Stub pointer.
11691 (Insn_template::size, Insn_template::alignment): Handle
11692 THUMB16_SPECIAL_TYPE.
11693 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11694 Stub_table::update_data_size_and_addralign,
11695 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11696 definitions.
11697 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11698 (Stub_table::do_write): Ditto.
11699 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11700
11701 2010-01-08 Ian Lance Taylor <iant@google.com>
11702
11703 PR 11108
11704 * symtab.h (class Symbol): Remove fields is_target_special_ and
11705 has_plt_offset_. Add field is_defined_in_discarded_section_.
11706 (Symbol::is_defined_in_discarded_section): New function.
11707 (Symbol::set_is_defined_in_discarded_section): New function.
11708 (Symbol::has_plt_offset): Rewrite.
11709 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11710 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11711 Don't initialize is_target_special_ or has_plt_offset_.
11712 Initialize is_defined_in_discarded_section_.
11713 (Symbol_table::add_from_relobj): If appropriate, set
11714 is_defined_in_discarded_section.
11715 * resolve.cc (Symbol::override_base_with_special): Don't test
11716 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11717 * target-reloc.h (relocate_section): Do special handling for
11718 symbols defined in discarded sections for global symbols as well
11719 as local symbols.
11720
11721 2010-01-08 Ian Lance Taylor <iant@google.com>
11722
11723 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11724 the SHT_SYMTAB case.
11725
11726 2010-01-08 Ian Lance Taylor <iant@google.com>
11727
11728 * object.cc (Sized_relobj::do_layout): Don't get confused if
11729 layout_eh_frame returns NULL.
11730
11731 2010-01-08 Ian Lance Taylor <iant@google.com>
11732
11733 PR 11084
11734 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11735 dynamic symbol table, use the normal symbol table.
11736 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11737 symbol table.
11738
11739 2010-01-08 Ian Lance Taylor <iant@google.com>
11740
11741 PR 11072
11742 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11743 sections.
11744
11745 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11746
11747 * version.cc (print_version): Change to "Copyright 2010".
11748
11749 2010-01-08 Ian Lance Taylor <iant@google.com>
11750
11751 PR 10287
11752 PR 11063
11753 * i386.cc (class Target_i386): Change return type of plt_section
11754 to be non-const.
11755 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11756 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11757 tls_desc_rel_ field.
11758 (Output_data_plt_i386::rel_tls_desc): New function.
11759 (Target_i386::rel_tls_desc_section): New function.
11760 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11761 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11762 R_386_TLS_DESC reloc in rel_tls_desc_section.
11763 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11764 Define struct Tlsdesc_info.
11765 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11766 (Target_x86_64::do_reloc_symbol_index): New function.
11767 (Target_x86_64::add_tlsdesc_info): New function.
11768 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11769 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11770 tlsdesc_rel_ field.
11771 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11772 all callers.
11773 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11774 (Target_x86_64::rela_tlsdesc_section): New function.
11775 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11776 handling.
11777 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11778 (Target_x86_64::do_reloc_addend): New function.
11779 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11780 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11781 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11782 (Output_reloc::type): New function.
11783 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11784 (Output_reloc::is_target_specific): New function.
11785 (Output_reloc::target_arg): New function.
11786 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11787 absolute relocs and target specific relocs.
11788 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11789 add_target_specific.
11790 (class Output_data_reloc) [SHT_RELA]: Likewise.
11791 * output.cc (Output_reloc::Output_reloc): Add four new versions
11792 for absolute relocs and target specific relocs.
11793 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11794 (Output_reloc::get_symbol_index): Likewise.
11795 (Output_reloc::local_section_offset): Check that local_sym_index_
11796 is not TARGET_CODE or 0.
11797 (Output_reloc::symbol_value): Likewise.
11798 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11799 reloc.
11800 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11801 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11802 functions.
11803 * layout.cc (add_target_dynamic_tags): Use output section for
11804 DT_PLTRELSZ and DT_JMPREL.
11805
11806 2010-01-07 Ian Lance Taylor <iant@google.com>
11807
11808 PR 11061
11809 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11810 function.
11811 (class Output_data_reloc_generic): Define.
11812 (class Output_data_reloc_base): Change base class to
11813 Output_data_reloc_generic. Change add() method to call
11814 bump_relative_reloc_count for a relative reloc. Remove
11815 sort_relocs_ field.
11816 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11817 to sort_relocs().
11818 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11819 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11820 appropriate.
11821 * layout.h (class Layout): Update declaration.
11822
11823 2010-01-07 Ian Lance Taylor <iant@google.com>
11824
11825 * output.h (class Output_data): Add const version of
11826 output_section and do_output_section.
11827 (class Output_section_data): Add const version of
11828 do_output_section.
11829 (class Output_section): Likewise.
11830 * layout.cc (Layout::add_target_dynamic_tags): New function.
11831 * layout.h (class Layout): Update declarations.
11832 * arm.cc (Target_arm::do_finalize_sections): Use
11833 add_target_dynamic_tags.
11834 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11835 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11836 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11837 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11838
11839 2010-01-07 Ian Lance Taylor <iant@google.com>
11840
11841 PR 11042
11842 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11843 object as needed.
11844
11845 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11846 Ian Lance Taylor <iant@google.com>
11847
11848 PR 11019
11849 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11850 Xindex::read_symtab_xindex.
11851
11852 2010-01-07 Doug Kwan <dougkwan@google.com>
11853
11854 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11855 (Insn_template::thumb16_bcond_insn): New method declaration.
11856 (Insn_template): Fix spelling.
11857 (Stub::thumb16_special): New method declaration.
11858 (Stub::do_write): Define virtual method which was previously pure
11859 virtual.
11860 (Stub::do_thumb16_special): New method declaration.
11861 (Stub::do_fixed_endian_write): New template member.
11862 (Reloc_stub::do_write): Remove.
11863 (Reloc_stub::do_fixed_endian_write): Remove.
11864 (Cortex_a8_stub): New class definition.
11865 (Stub_factory::make_cortex_a8_stub): New method definition.
11866 (Stub_factory::Stub_factory): Add missing static storage class
11867 qualifier for elf32_arm_stub_a8_veneer_blx.
11868
11869 2010-01-07 Ian Lance Taylor <iant@google.com>
11870
11871 PR 10980
11872 * options.h (class General_options): Add --warn-unresolved-symbols
11873 and --error-unresolved-symbols.
11874 * errors.cc (Errors::undefined_symbol): Implement
11875 --warn-unresolved-symbols.
11876
11877 * options.h (class General_options): Add -z text and -z textoff.
11878 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11879
11880 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11881
11882 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11883 (Garbage_collection::cident_sections): New function.
11884 (Garbage_collection::add_cident_section): New function.
11885 (Garbage_collection::cident_sections_): New member.
11886 (gc_process_relocs): Add references to sections whose names are C
11887 identifiers.
11888 * gold.h (cident_section_start_prefix): New constant.
11889 (cident_section_stop_prefix): New constant.
11890 (is_cident): New function.
11891 * layout.cc (Layout::define_section_symbols): Replace string constants
11892 with the newly defined constants.
11893 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11894 C identifiers.
11895 * testsuite/Makefile.am: Add gc_orphan_section_test.
11896 * testsuite/Makefile.in: Regenerate.
11897 * testsuite/gc_orphan_section_test.cc: New file.
11898 * testsuite/gc_orphan_section_test.sh: New file.
11899
11900 2010-01-06 Ian Lance Taylor <iant@google.com>
11901
11902 PR 10980
11903 * options.h (class General_options): Add --warn-shared-textrel.
11904 * layout.cc (Layout::finish_dynamic_section): Implement
11905 --warn-shared-textrel.
11906
11907 PR 10980
11908 * options.h (class General_options): Add --warn-multiple-gp.
11909
11910 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11911
11912 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11913 $(THREADSLIB) and $(LIBDL).
11914 * Makefile.in: Rebuild.
11915
11916 2010-01-06 Ian Lance Taylor <iant@google.com>
11917
11918 PR 10980
11919 * options.cc (General_options::parse_section_start): New function.
11920 (General_options::section_start): New function.
11921 (General_options::General_options): Initialize all members.
11922 * options.h: Include <map>
11923 (class General_options): Add --section-start. Add section_starts_
11924 member.
11925 * layout.cc (Layout::attach_allocated_section_to_segment): If
11926 --section-start was used, set the address of the segment. Remove
11927 local sort_sections.
11928 (Layout::relaxation_loop_body): If the address of the load segment
11929 has been set by --section-start, don't use it.
11930 * output.h (Output_segment::update_flags_for_output_section): New
11931 function.
11932 * output.cc (Output_segment::add_output_section): Call
11933 update_flags_for_output_section.
11934
11935 2010-01-05 Ian Lance Taylor <iant@google.com>
11936
11937 PR 10980
11938 * options.h (class General_options): Add --undefined-version.
11939 * script.cc (struct Version_expression): Add was_matched_by_symbol
11940 field.
11941 (Version_script_info::matched_symbol): New function.
11942 (Version_script_info::get_symbol_version_helper): Call
11943 matched_symbol.
11944 (Version_script_info::check_unmatched_names): New function.
11945 * script.h (class Version_script_info): Update declarations.
11946 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11947
11948 * options.h (class General_options): Use DEFINE_bool_alias for
11949 allow_multiple_definition.
11950 * resolve.cc (Symbol_table::should_override): Don't test
11951 allow_multiple_definition.
11952
11953 PR 10980
11954 * options.h (class General_options): Add --cref.
11955 * main.cc (main): Print cref table if --cref. Don't close mapfile
11956 until after printing cref table.
11957 * cref.cc: Include "symtab.h".
11958 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11959 (Cref_table_compare::operator()): New function.
11960 (Cref_inputs::gather_cref): New function.
11961 (filecol): New static const.
11962 (Cref_inputs::print_cref): New function.
11963 (Cref::print_cref): New function.
11964 * cref.h: Include <cstdio>.
11965 (class Cref): Update declarations.
11966 * mapfile.h (Mapfile::file): New function.
11967 * object.h (class Object): Define Symbols. Declare virtual
11968 do_get_global_symbols.
11969 (Object::get_global_symbols): New function.
11970 * object.cc (Input_objects::add_object): Pass object to cref_ if
11971 --cref.
11972 (Input_objects::archive_start): Likewise.
11973 (Input_objects::archive_stop): Likewise.
11974 (Input_objects::print_cref): New function.
11975 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11976 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11977 --cref.
11978 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11979 function.
11980 * plugin.h (class Sized_pluginobj): Update declarations.
11981
11982 2010-01-05 Ian Lance Taylor <iant@google.com>
11983
11984 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11985 to is_default_version. Rename insdef to insdefault.
11986 (Symbol_table::add_from_relobj): Rename def to is_default_version
11987 and local to is_forced_local.
11988 (Symbol_table::add_from_pluginobj): Likewise.
11989 (Symbol_table::add_from_dynobj): Likewise.
11990 (Symbol_table::define_special_symbol): Rename insdef to
11991 insdefault.
11992
11993 2010-01-04 Ian Lance Taylor <iant@google.com>
11994
11995 PR 10980
11996 * options.h (class General_options): Add
11997 --allow-multiple-definition and -z muldefs.
11998 * resolve.cc (Symbol_table::should_override): Don't warn about a
11999 multiple symbol definition if --allow-multiple-definition or -z
12000 muldefs.
12001
12002 PR 10980
12003 * options.h (class General_options): Add --add-needed and
12004 --copy-dt-needed-entries. Tweak --as-needed help entry.
12005 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12006 error if --copy-dt-needed-entries aka --add-needed is used and
12007 would cause a change in behaviour.
12008
12009 PR 10980
12010 * options.h (class General_options): Add -G as a short version of
12011 --shared. Add no-op options -assert, -g, and -i.
12012
12013 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12014
12015 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12016 check for .text or .gnu.linkonce.t sections.
12017 * icf.cc (Icf::find_identical_sections): Ditto.
12018 Change the detection for mangled function name within the section
12019 name.
12020 * icf.h (is_section_foldable_candidate): New function.
12021
12022 2009-12-30 Ian Lance Taylor <iant@google.com>
12023
12024 PR 10980
12025 * options.h (class General_options): Permit two dashes with
12026 --retain-symbols-file.
12027
12028 2009-12-30 Ian Lance Taylor <iant@google.com>
12029
12030 PR 10979
12031 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12032 don't put the file header and segment headers in the text
12033 segment.
12034
12035 PR 10979
12036 * common.cc (Sort_commons::operator()): Stabilize sort when both
12037 entries are NULL.
12038 (Symbol_table::do_allocate_commons_list): When allocating common
12039 symbols, skip a symbol which is no longer common.
12040 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12041 an object before checking its type.
12042 * testsuite/common_test_2.c: New file.
12043 * testsuite/common_test_3.c: New file.
12044 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12045 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12046 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12047 (common_test_2_pic.o, common_test_2.so): New targets.
12048 (common_test_3_pic.o, common_test_3.so): New targets.
12049 * testsuite/Makefile.in: Rebuild.
12050
12051 PR 10979
12052 * script.cc (read_input_script): If we see a new SECTIONS clause,
12053 and we have added an input section, give an error.
12054 * layout.h (class Layout): Add have_added_input_section function.
12055 Add have_added_input_section_ field.
12056 * layout.cc (Layout::Layout): Initialize
12057 have_added_input_section_.
12058 (Layout::layout): Set have_added_input_section_.
12059 (Layout::layout_eh_frame): Likewise.
12060
12061 2009-12-30 Ian Lance Taylor <iant@google.com>
12062
12063 PR 10931
12064 * options.h (class General_options): Add --sort-common option.
12065 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12066 * common.cc (Sort_common): Add sort_order parameter to
12067 constructor. Add sort_order_ field.
12068 (Sort_commons::operator): Check sort_order_.
12069 (Symbol_table::allocate_commons): Determine the sort order.
12070 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12071 Change all callers.
12072 (Symbol_table::do_allocate_commons_list): Likewise.
12073
12074 2009-12-30 Ian Lance Taylor <iant@google.com>
12075
12076 PR 10916
12077 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12078 symbols from this object, don't change the visibility of an
12079 undefined symbol.
12080 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12081
12082 2009-12-30 Ian Lance Taylor <iant@google.com>
12083
12084 PR 10861
12085 * script.h (class Version_script_info): Define Language enum.
12086 Update declarations. Define Glob, Exact, and Lookup types. Add
12087 new fields globals_, locals_, and is_finalized_.
12088 * script.cc: Various formatting fixes.
12089 (class Parser_closure): Change language_stack_ from a vector of
12090 std::string to one of Version_script_info::Language. Adjust all
12091 uses accordingly.
12092 (class Lazy_demangler): Remove.
12093 (struct Version_expression): Change language from std::string to
12094 Version_script_info::Language.
12095 (Version_script_info::Version_script_info): New function.
12096 (Version_script_info::~Version_script_info): Don't call clear.
12097 (Version_script_info::finalize): New function.
12098 (Version_script_info::build_lookup_tables): New function.
12099 (Version_script_info::build_expression_list_lookup): New
12100 function.
12101 (Version_script_info::get_symbol_version_helper): Rewrite to use
12102 lookup tables.
12103 (Version_script_info::print_expression_list): Adjust to use
12104 Version_script_info::Language.
12105 (script_push_lex_into_version_mode): Check that the version script
12106 has not been finalized.
12107 (version_script_push_lang): Change language string to
12108 Version_script_info::Language.
12109 * options.cc (Command_line::version_script): New function.
12110 * options.h (class General_options): Add finalize_dynamic_list
12111 function. Change version_script from declaration to definition.
12112 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12113 * testsuite/version_script.map: Remove duplicate def of foo.
12114 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12115 version_script.map.
12116 * testsuite/Makefile.in: Rebuild.
12117
12118 2009-12-30 Ian Lance Taylor <iant@google.com>
12119
12120 PR 10843
12121 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12122 if the input symbol index is 0, make the output symbol index 0.
12123
12124 2009-12-30 Ian Lance Taylor <iant@google.com>
12125
12126 PR 10670
12127 * options.h (class General_options): Add -x/--discard-all.
12128 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12129 --discard-all. If the local symbol needs a dynamic entry, check
12130 that before handling --discard-locals.
12131
12132 2009-12-30 Ian Lance Taylor <iant@google.com>
12133
12134 PR 10450
12135 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12136 flags to PF_R.
12137 (Output_segment::add_output_section): Don't change the flags if
12138 the type is PT_TLS.
12139
12140 PR 10450
12141 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12142 GNU hash table if they need a dynamic value. Otherwise, don't add
12143 them if they are defined in a dynamic object or are forced local.
12144
12145 2009-12-29 Ian Lance Taylor <iant@google.com>
12146
12147 PR 10450
12148 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12149 .gnu.hash table for a 32-bit target.
12150
12151 PR 10450
12152 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12153 regular and a dynamic object only needs a dynamic symbol table
12154 entry if it is externally visible.
12155
12156 PR 10450
12157 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12158 constructor. Add global_offset_table_ field.
12159 (Target_i386::got_section): Set global_offset_table_.
12160 (Target_i386::do_finalize_sections): Set global_offset_table_
12161 size.
12162 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12163 in constructor. Add global_offset_table_ field.
12164 (Target_x86_64::got_section): Set global_offset_table_.
12165 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12166 size.
12167
12168 * layout.cc (Layout::Layout): Initialize increase_relro_.
12169 (Layout::get_output_section): Add is_relro, is_last_relro, and
12170 is_first_non_relro parameters. Change all callers.
12171 (Layout::choose_output_section): Likewise.
12172 (Layout::add_output_section_data): Likewise.
12173 (Layout::make_output_section): Likewise.
12174 (Layout::set_segment_offsets): Clear increase_relro when using a
12175 linker script.
12176 * layout.h (class Layout): Add increase_relro method. Add
12177 increase_relro_ field. Update declarations.
12178 * output.cc (Output_section::Output_section): Initialize
12179 is_last_relro_ and is_first_non_relro_.
12180 (Output_segment::add_output_section): Group relro sections is
12181 do_sort is true. Handle is_last_relro and is_first_non_relro.
12182 (Output_segment::maximum_alignment): Remove relro handling.
12183 (Output_segment::set_section_addresses): Add increase_relro
12184 parameter. Change all callers. Add initial alignment to align
12185 relro sections on separate page. Remove old relro handling.
12186 (Output_segment::set_section_list_addresses): Remove in_relro
12187 parameter. Change all callers.
12188 (Output_segment::set_offset): Add increase parameter. Change all
12189 callers. Remove old relro handling.
12190 * output.h (class Output_section): Add new methods: is_last_relro,
12191 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12192 Add is_last_relro_ and is_first_non_relro_ fields.
12193 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12194 Create separate .got.plt section. Call increase_relro.
12195 * x86_64.cc (Target_x86_64::got_section): Likewise.
12196 * testsuite/relro_script_test.t: Add .got.plt.
12197
12198 PR 10450
12199 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12200 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12201 (Layout::finalize): Call set_dynamic_symbol_size.
12202 (Layout::set_dynamic_symbol_size): New function.
12203 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12204 set_dynamic_symbol_size.
12205
12206 PR 10450
12207 * output.h (class Output_section): Add is_entsize_zero_ field.
12208 * output.cc (Output_section::Output_section): Initialize
12209 is_entsize_zero_.
12210 (Output_section::set_entsize): If two different entsizes are
12211 requested, force it to zero.
12212 (Output_section::add_input_section): Set flags for .debug_str
12213 before updating section flags. Set entsize.
12214 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12215 and SHF_STRING if all input sections have those flags.
12216
12217 2009-12-29 Rafael Espindola <espindola@google.com>
12218
12219 * main.cc (main): Fix the sys time reporting.
12220 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12221 reporting.
12222
12223 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12224
12225 * options.cc (General_options::parse_version): Allow -v to exit
12226 without an error if there is nothing to link.
12227
12228 2009-12-29 Ian Lance Taylor <iant@google.com>
12229
12230 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12231 using a version of gcc before 4.1.
12232 * configure: Rebuild.
12233
12234 2009-12-28 Chris Demetriou <cgd@google.com>
12235
12236 * attributes.cc (Output_attributes_section_data::do_write): Use
12237 std::vector::front rather than std::vector::data.
12238
12239 2009-12-28 Ian Lance Taylor <iant@google.com>
12240
12241 * symtab.h (class Symbol_table): Add enum Defined.
12242 * resolve.cc (Symbol_table::should_override): Add defined
12243 parameter. Change all callers. Test whether object is NULL
12244 before calling a method on it.
12245 (Symbol_table::report_resolve_problem): Add defined parameter.
12246 Change all callers.
12247 (Symbol_table::should_override_with_special): Likewise.
12248 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12249 parameter. Change all callers.
12250 (Symbol_table::do_define_in_output_data): Likewise.
12251 (Symbol_table::define_in_output_segment): Likewise.
12252 (Symbol_table::do_define_in_output_segment): Likewise.
12253 (Symbol_table::define_as_constant): Likewise.
12254 (Symbol_table::do_define_as_constant): Likewise.
12255 * script.h (class Symbol_assignment): Add is_defsym parameter to
12256 constructor; change all callers.
12257 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12258 parameter. Change all callers. Add is_defsym_ field.
12259 (class Parser_closure): Add parsing_defsym parameter to
12260 constructor; change all callers. Add parsing_defsym accessor
12261 function. Add parsing_defsym_ field.
12262
12263 2009-12-28 Ian Lance Taylor <iant@google.com>
12264
12265 * gold.cc (queue_middle_tasks): Fix formatting.
12266 * object.cc (Relobj::is_section_name_included): Likewise.
12267
12268 2009-12-23 Ian Lance Taylor <iant@google.com>
12269
12270 * i386.cc (Target_i386::do_calls_non_split): Recognize
12271 -fsplit-stack prologue for a function with a static chain.
12272 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12273 -fsplit-stack prologue when using %r11.
12274
12275 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12276
12277 * options.cc (General_options::parse_version): Make -v continue and do
12278 the link like GNU ld does.
12279
12280 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12281
12282 * Makefile.am (CCFILES): Add timer.cc.
12283 (HFILES): Add timer.h.
12284 * configure.ac: Check for sysconf and times.
12285 * main.cc: include timer.h.
12286 (main): Use Timer instead of get_run_time.
12287 * timer.cc: New.
12288 * timer.h: New.
12289 * workqueue.cc: include timer.h.
12290 (Workqueue::find_and_run_task):
12291 Report user, sys and wall time.
12292 * Makefile.in: Regenerate.
12293 * config.in: Regenerate.
12294 * configure: Regenerate.
12295
12296 2009-12-16 Doug Kwan <dougkwan@google.com>
12297
12298 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12299 sections.
12300 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12301 relaxed input sections.
12302 * output.cc (Output_section::find_relaxed_input_section): Change
12303 return type to Output_relaxed_input_section pointer. Adjust code
12304 for new type of relaxed_input_section_map_.
12305 * output.h (Output_section::find_relaxed_input_section): Change
12306 return type to Output_relaxed_input_section pointer.
12307 (Output_section::Output_relaxed_input_section_by_input_section_map):
12308 New type.
12309 (Output_section::relaxed_input_section_map_): Change type to
12310 Output_section::Output_relaxed_input_section_by_input_section_map.
12311 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12312 input section.
12313
12314 2009-12-15 Ian Lance Taylor <iant@google.com>
12315
12316 * layout.cc (Layout::create_shstrtab): Only write out after input
12317 sections if we are compressing debug sections.
12318
12319 2009-12-15 Ian Lance Taylor <iant@google.com>
12320
12321 * archive.cc (Archive::add_symbols): Only look up a symbol without
12322 a version if there is, in fact, a version.
12323
12324 2009-12-14 Ian Lance Taylor <iant@google.com>
12325
12326 Revert -Wshadow changes, all changes from:
12327 2009-12-11 Doug Kwan <dougkwan@google.com>
12328 2009-12-11 Nick Clifton <nickc@redhat.com>
12329 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12330
12331 2009-12-11 Doug Kwan <dougkwan@google.com>
12332
12333 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12334 due to -Wshadow.
12335 * attributes.cc (Object_attribute::size): Ditto.
12336 (Attributes_section_data::size): Ditto.
12337 (Attributes_section_data::Attributes_section_data): Ditto.
12338 (Output_attributes_section_data::do_write): Ditto.
12339 * attributes.h (Object_attribute::set_type): Ditto.
12340 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12341
12342 2009-12-11 Nick Clifton <nickc@redhat.com>
12343
12344 * archive.cc: Fix shadowed variable warnings.
12345 * arm.cc: Likewise.
12346 * compressed_output.cc: Likewise.
12347 * compressed_output.h: Likewise.
12348 * configure: Likewise.
12349 * dwarf_reader.cc: Likewise.
12350 * dynobj.cc: Likewise.
12351 * dynobj.h: Likewise.
12352 * ehframe.cc: Likewise.
12353 * ehframe.h: Likewise.
12354 * errors.cc: Likewise.
12355 * expression.cc: Likewise.
12356 * fileread.cc: Likewise.
12357 * fileread.h: Likewise.
12358 * freebsd.h: Likewise.
12359 * i386.cc: Likewise.
12360 * icf.cc: Likewise.
12361 * incremental.h: Likewise.
12362 * layout.cc: Likewise.
12363 * layout.h: Likewise.
12364 * mapfile.cc: Likewise.
12365 * merge.cc: Likewise.
12366 * merge.h: Likewise.
12367 * object.cc: Likewise.
12368 * object.h: Likewise.
12369 * options.h: Likewise.
12370 * output.cc: Likewise.
12371 * output.h: Likewise.
12372 * parameters.cc: Likewise.
12373 * plugin.cc: Likewise.
12374 * powerpc.cc: Likewise.
12375 * reduced_debug_output.cc: Likewise.
12376 * reduced_debug_output.h: Likewise.
12377 * reloc.cc: Likewise.
12378 * reloc.h: Likewise.
12379 * resolve.cc: Likewise.
12380 * script-sections.cc: Likewise.
12381 * script.cc: Likewise.
12382 * script.h: Likewise.
12383 * sparc.cc: Likewise.
12384 * symtab.cc: Likewise.
12385 * symtab.h: Likewise.
12386 * target-select.cc: Likewise.
12387 * target-select.h: Likewise.
12388 * token.h: Likewise.
12389 * workqueue.cc: Likewise.
12390 * workqueue.h: Likewise.
12391 * x86_64.cc: Likewise.
12392
12393 2009-12-10 Doug Kwan <dougkwan@google.com>
12394
12395 * arm.cc (attributes.h): New include.
12396 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12397 (Arm_relobj::~Arm_relobj): Delete object pointed by
12398 attributes_section_data_.
12399 (Arm_relobj::attributes_section_data): New method definition.
12400 (Arm_relobj::attributes_section_data_): New data member declaration.
12401 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12402 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12403 attributes_section_data_.
12404 (Arm_dynobj::attributes_section_data): New method definition.
12405 (Arm_dynobj::attributes_section_data_): New data member declaration.
12406 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12407 initialization value of may_use_blx_ to false.
12408 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12409 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12410 object attributes to compute results instead of hard-coding.
12411 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12412 Target_arm::get_secondary_compatible_arch,
12413 Target_arm::set_secondary_compatible_arch
12414 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12415 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12416 New method declarations.
12417 (Target_arm::get_aeabi_object_attribute): New method definition.
12418 (Target_arm::attributes_section_data_): New data member declaration.
12419 (read_arm_attributes_section): New template definition.
12420 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12421 (Arm_dynobj::do_read_symbols): Ditto.
12422 (Target_arm::do_finalize_sections): Merge attributes sections from
12423 input. Check for BLX use after attributes section merging.
12424 Fix __exidx_start and __exidx_end visibility. Create an
12425 .ARM.attributes section if necessary.
12426 (Target_arm::get_secondary_compatible_arch,
12427 Target_arm::set_secondary_compatible_arch,
12428 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12429 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12430 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12431 New method definitions.
12432
12433 2009-12-09 Ian Lance Taylor <iant@google.com>
12434
12435 * plugin.cc (Plugin::load): Don't cast from void* to a function
12436 pointer.
12437
12438 2009-12-09 Ian Lance Taylor <iant@google.com>
12439
12440 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12441 information fields.
12442
12443 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12444
12445 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12446 Replace two_file_shared_1.so with two_file_shared_2.so.
12447 * testsuite/Makefile.in: Regenerated.
12448
12449 2009-12-08 Doug Kwan <dougkwan@google.com>
12450
12451 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12452 (HFILES): Add attributes.h and int_encoding.h.
12453 * Makefile.in: Regenerate.
12454 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12455 function definitions to int_encoding.cc
12456 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12457 prototypes to int_encoding.h
12458 * reduced_debug_output.cc (int_encoding.h): New include.
12459 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12460 function definitions to int_encoding.cc
12461 (insert_into_vector, read_from_pointer): Move template definitions to
12462 int_encoding.h
12463 * attributes.cc: New file.
12464 * attributes.h: New file.
12465 * int_encoding.cc: New file.
12466 * int_encoding.h: New file.
12467
12468 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12469
12470 PR gold/11055
12471 * incremental-dump.cc (dump_incremental_inputs): New.
12472 (main): Use dump_incremental_inputs.
12473
12474 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12475
12476 PR gold/10893
12477 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12478 checking elfcpp::STT_FUNC.
12479 (Target_i386::Relocate::relocate): Likewise.
12480 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12481
12482 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12483 symbols from shared libraries into normal FUNC symbols.
12484
12485 * symtab.h (Symbol): Add is_func and use it.
12486
12487 2009-12-05 Doug Kwan <dougkwan@google.com>
12488
12489 * arm.cc (Target_arm::arm_info): Initialize new fields
12490 attributes_section and attributes_vendor.
12491 * i386.cc (Target_i386::i386_info): Same.
12492 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12493 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12494 fields attributes_section and attributes_vendor.
12495 * sparc.cc (Target_sparc::sparc_info): Same.
12496 * target.h (Target::attributes_section, Target::attributes_vendor,
12497 Target::is_attributes_section, Target::attribute_arg_type,
12498 Target::attributes_order): New method definitions.
12499 (Target::Target_info::attributes_section,
12500 Target::Target_info::attributes_vendor): New fields.
12501 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12502 virtual method definitions.
12503 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12504 attributes_section and attributes_vendor.
12505 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12506
12507 2009-12-05 Doug Kwan <dougkwan@google.com>
12508
12509 * arm.cc: Update comments about interworking and stub generation.
12510 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12511 considered as non-PIC.
12512 (Arm_relocate_functions::base_abs): Fix formatting.
12513 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12514 of function to use GOT entry address instead of offset.
12515 (Target_arm::Scan::global): Issue an error if a symbol would need a
12516 PLT does not get one because it is untyped. Remove code to create
12517 dynamic symbols for relative branches.
12518 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12519 takes unsigned integer instead of boolean.
12520
12521 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12522
12523 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12524 (two_file_test_LDADD): Likewise.
12525 (common_test_1_LDADD): Likewise.
12526 (exception_test_LDADD) Likewise.
12527 (weak_test_LDADD): Likewise.
12528 (many_sections_test_LDADD): Likewise.
12529 (initpri1_LDADD): Likewise.
12530 (script_test_1_LDADD): Likewise.
12531 (script_test_2_LDADD): Likewise.
12532 (justsyms_LDADD): Likewise.
12533 (binary_test_LDADD): Likewise.
12534 (large_LDADD): Likewise.
12535 * testsuite/Makefile.in: Regenerated.
12536
12537 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12538
12539 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12540 (Symbol_table::override_with_special): Likewise.
12541 (Symbol_table::add_from_object): Likewise.
12542
12543 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12544
12545 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12546 Don't set the data_offset twice.
12547
12548 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12549
12550 * testsuite/Makefile.in: Regenerate.
12551
12552 2009-12-03 Doug Kwan <dougkwan@google.com>
12553
12554 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12555 (Target_arm::do_finalize_sections): Add parameter for symbol table
12556 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12557 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12558 parameter for symbol table pointer.
12559 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12560 an additional parameter for a pointer to symbol table.
12561 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12562 parameter for a symbol table pointer.
12563 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12564 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12565 Ditto.
12566 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12567 parameter for a symbol table pointer.
12568
12569 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12570
12571 * incremental.cc (Incremental_inputs_header)
12572 (Incremental_inputs_header_write, Incremental_inputs_entry)
12573 (Incremental_inputs_entry_write): Move ...
12574 * incremental.h (Incremental_inputs_header)
12575 (Incremental_inputs_header_write, Incremental_inputs_entry)
12576 (Incremental_inputs_entry_write): here.
12577
12578 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12579
12580 * incremental.cc (make_sized_incremental_binary): Set the target.
12581 Error if it is incompatible.
12582 * output.h (Output_file): Add filename method.
12583
12584 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12585
12586 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12587 from the get_* methods.
12588
12589 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12590
12591 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12592 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12593 Write 0 for the data_offset of scripts.
12594
12595 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12596
12597 * testsuite/Makefile.am: Add the incremental_test.sh test.
12598 * testsuite/incremental_test.sh: New.
12599 * testsuite/incremental_test_1.c: New.
12600 * testsuite/incremental_test_2.c: New.
12601
12602 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12603
12604 * incremental-dump.cc (main): Fix typos.
12605
12606 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12607
12608 PR gold/11025
12609 * incremental-dump.cc (main): Use llu to print 64 bit values.
12610
12611 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12612 H.J. Lu <hongjiu.lu@intel.com>
12613
12614 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12615 $(LIBDL).
12616 (incremental_dump_LDADD): Likewise.
12617 * Makefile.in: Regenerated.
12618
12619 2009-11-25 Doug Kwan <dougkwan@google.com>
12620
12621 Revert:
12622
12623 2009-11-25 Doug Kwan <dougkwan@google.com>
12624
12625 * arm.cc (Target_arm::Target_arm): Move method definition
12626 outside of class definition. Add code to handle
12627 --target1-rel, --target1-abs and --target2= options.
12628 (Target_arm::get_reloc_reloc_type): Change method to be
12629 non-static and const.
12630 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12631 New data member declaration.
12632 (Target_arm::Scan::local, Target_arm::Scan::global,
12633 Target_arm::Relocate::relocate,
12634 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12635 Adjust call to Target_arm::get_real_reloc_type.
12636 (Target_arm::get_real_reloc_type): Use command line options
12637 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12638 * options.h (--target1-rel, --target1-abs, --target2): New
12639 ARM-only options.
12640
12641 2009-11-25 Doug Kwan <dougkwan@google.com>
12642
12643 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12644 class definition. Add code to handle --target1-rel, --target1-abs
12645 and --target2= options.
12646 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12647 and const.
12648 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12649 member declaration.
12650 (Target_arm::Scan::local, Target_arm::Scan::global,
12651 Target_arm::Relocate::relocate,
12652 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12653 call to Target_arm::get_real_reloc_type.
12654 (Target_arm::get_real_reloc_type): Use command line options to
12655 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12656 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12657 options.
12658
12659 2009-11-25 Doug Kwan <dougkwan@google.com>
12660
12661 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12662 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12663 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12664 formatting.
12665 (Arm_relocate_functions::thm_call): Replace body with a call to
12666 Arm_relocate_functions::thumb_branch_common.
12667 (Arm_relocate_functions::thm_jump24,
12668 Arm_relocate_functions::thm_xpc22): New method definitions.
12669 (Arm_relocate_functions::thumb_branch_common): New method definition.
12670 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12671 operator.
12672 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12673 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12674
12675 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12676
12677 * Makefile.am: Build incremental-dump
12678 * Makefile.in: Regenerate.
12679 * incremental-dump.cc: New.
12680 * incremental.cc (Incremental_inputs_header_data,
12681 Incremental_inputs_entry_data): Move to incremental.h
12682 * incremental.h: (Incremental_inputs_header_data,
12683 Incremental_inputs_entry_data): Move from incremental.cc
12684
12685 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12686
12687 * incremental.cc (Incremental_inputs_header,
12688 Incremental_inputs_header_write, Incremental_inputs_entry,
12689 Incremental_inputs_entry_write): Add a typedef with the data type.
12690
12691 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12692
12693 * incremental.cc (Incremental_inputs_header,
12694 Incremental_inputs_header_write, Incremental_inputs_entry,
12695 Incremental_inputs_entry_write): Update comment about which
12696 type has the filed descriptions.
12697
12698 2009-11-15 Doug Kwan <dougkwan@google.com>
12699
12700 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12701 (Arm_relocate_functions::arm_branch_common): Change method defintion
12702 in class definition to a method declaration and update list of formal
12703 parameters.
12704 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12705 Arm_relocation_functions::jump24): Adjust call to
12706 Arm_relocate_functions::arm_branch_common. Update list of formal
12707 parameters.
12708 (Arm_relocate_functions::xpc25): New method definition.
12709 (Arm_relocate_functions::arm_branch_common): Move method defintion
12710 out from class definition. Use stubs for mode-switching and extending
12711 branch ranges.
12712 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12713 specially. Change code to enable use of stubs in ARM branches.
12714
12715 2009-11-10 Doug Kwan <dougkwan@google.com>
12716
12717 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12718 in method declaration.
12719 (Target_arm::relocate_stub): New method declaration.
12720 (Target_arm::default_target): Change to return a pointer instead of
12721 a const reference.
12722 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12723 Target_arm::default_target.
12724 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12725 method definition.
12726 (Target_arm::relocate_section): Adjust view.
12727 (Target_arm::relocate_stub): New method definition.
12728
12729 2009-11-10 Doug Kwan <dougkwan@google.com>
12730
12731 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12732 a format warning.
12733 * incremental.cc (open_incremental_binary): Initialized local
12734 variables to avoid warnings.
12735 * object.cc (make_elf_object): Ditto.
12736 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12737 a format warning.
12738
12739 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12740
12741 PR gold/10930
12742 * testsuite/plugin_test.c: Include "config.h".
12743
12744 2009-11-09 Doug Kwan <dougkwan@google.com>
12745
12746 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12747 (arm_symbol_value): Remove.
12748 (Arm_relocate_functions::arm_branch_common,
12749 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12750 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12751 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12752 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12753 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12754 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12755 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12756 Arm_relocate_functions::thm_mobw_abs_nc,
12757 Arm_relocate_functions::thm_mov_abs,
12758 Arm_relocate_functions::movw_prel_nc,
12759 Arm_relocate_functions::thm_movt_abs,
12760 Arm_relocate_functions::movt_prel,
12761 Arm_relocate_functions::thm_movw_prel_nc,
12762 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12763 (Target_arm::Relocate::relocate): Only decompose address into two
12764 parts if relocation type uses the thumb-bit and pass the actual
12765 bit instead of a flag indicating that the thumb-bit is used. Adjust
12766 calls to methods in Arm_relocate_functions for this change.
12767
12768 2009-11-08 Ian Lance Taylor <iant@google.com>
12769
12770 PR 10925
12771 * reloc.cc: Instantiate
12772 Sized_relobj::initialize_input_to_output_maps and
12773 Sized_relobj:free_input_to_output_maps.
12774
12775 2009-11-06 Ian Lance Taylor <iant@google.com>
12776
12777 PR 10876
12778 * defstd.cc (in_segment): Set only_if_ref true for "end".
12779
12780 2009-11-06 Doug Kwan <dougkwan@google.com>
12781
12782 * arm.cc (class Reloc_stub): Correct a comment.
12783 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12784 (Target_arm::scan_section_for_stubs): New method declaration.
12785 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12786 Change methods from private to protected.
12787 (Target_arm::do_may_relax): New method definition.
12788 (Target_arm::do_relax, Target_arm::group_sections,
12789 Target_arm::scan_reloc_for_stub,
12790 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12791 (Target_arm::arm_input_section_map_): New data member declaration.
12792 (Target_arm::scan_reloc_for_stub,
12793 Target_arm::scan_reloc_section_for_stubs,
12794 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12795 Target_arm::do_relax): New method definitions.
12796
12797 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12798
12799 * configure.ac: Check for (struct stat)::st_mtim
12800 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12801 * config.in: Regenerate.
12802 * configure: Regenerate.
12803
12804 2009-11-05 Ian Lance Taylor <iant@google.com>
12805
12806 PR 10910
12807 * output.cc (Output_segment::add_output_section): Add missing
12808 return statement.
12809
12810 2009-11-04 Ian Lance Taylor <iant@google.com>
12811
12812 PR 10880
12813 * object.h (class Object): Add is_needed and set_is_needed
12814 methods. Add is_needed_ field. Make bool fields into bitfields.
12815 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12816 defined in a dynamic object and referenced by a regular object,
12817 set is_needed for the dynamic object.
12818 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12819 if the file is marked with as_needed and it is not needed.
12820
12821 2009-11-04 Ian Lance Taylor <iant@google.com>
12822
12823 PR 10887
12824 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12825 tags if data is discarded by linker script.
12826 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12827 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12828 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12829 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12830
12831 2009-11-04 Ian Lance Taylor <iant@google.com>
12832
12833 * layout.cc (Layout::get_output_section): Add is_interp and
12834 is_dynamic_linker_section parameters. Change all callers.
12835 (Layout::choose_output_section): Likewise.
12836 (Layout::make_output_section): Likewise.
12837 (Layout::add_output_section_data): Add is_dynamic_linker_section
12838 parameter. Change all callers.
12839 * layout.h (class Layout): Update declarations.
12840 * output.h (class Output_section): Add is_interp, set_is_interp,
12841 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12842 Add is_interp_, is_dynamic_linker_section_ fields. Change
12843 generate_code_fills_at_write_ to a bitfield.
12844 * output.cc (Output_section::Output_sections): Initialize new
12845 fields.
12846 (Output_segment::add_output_section): Add do_sort parameter.
12847 Change all callers.
12848
12849 2009-11-03 Ian Lance Taylor <iant@google.com>
12850
12851 PR 10860
12852 * options.h (class General_options): Add --warn-common.
12853 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12854 merging two common symbols.
12855 (Symbol_table::should_override): Handle --warn-common when merging
12856 a common symbol with a defined symbol. Use report_resolve_problem
12857 for multiple definitions.
12858 (Symbol_table::report_resolve_problem): New function.
12859 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12860
12861 2009-11-03 Doug Kwan <dougkwan@google.com>
12862
12863 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12864 stub_factory_.
12865 (Target_arm::stub_factory): New method definition.
12866 (Target_arm::new_arm_input_section,
12867 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12868 Target_arm::reloc_uses_thumb_bit): New method declarations.
12869 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12870 New type definitions.
12871 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12872 member declarations.
12873 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12874 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12875 New method definitions.
12876
12877 2009-11-03 Ian Lance Taylor <iant@google.com>
12878
12879 * options.h (class General_options): Add --warn_constructors.
12880
12881 2009-11-03 Ian Lance Taylor <iant@google.com>
12882
12883 PR 10893
12884 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12885 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12886
12887 2009-11-03 Ian Lance Taylor <iant@google.com>
12888
12889 PR 10895
12890 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12891 --msgid-bugs-address.
12892 (install-pdf): New target.
12893 (install-data_yes): Look up one directory to find mkinstalldirs.
12894
12895 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12896
12897 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12898 tree.
12899
12900 2009-10-30 Doug Kwan <dougkwan@google.com>
12901
12902 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12903
12904 2009-10-30 Doug Kwan <dougkwan@google.com>
12905
12906 * arm.cc (Stub_addend_reader): New struct template definition
12907 and partial specializations.
12908 (Stub_addend_reader::operator()): New method definition for a
12909 partially specialized template.
12910
12911 2009-10-30 Doug Kwan <dougkwan@google.com>
12912
12913 * arm.cc (Arm_relobj::processor_specific_flags): New method
12914 definition.
12915 (Arm_relobj::do_read_symbols): New method declaration.
12916 (Arm_relobj::processor_specific_flags_): New data member declaration.
12917 (Arm_dynobj): New class definition.
12918 (Target_arm::do_finalize_sections): Add input_objects parameter.
12919 (Target_arm::do_adjust_elf_header): New method declaration.
12920 (Target_arm::are_eabi_versions_compatible,
12921 (Target_arm::merge_processor_specific_flags): New method declaration.
12922 (Target_arm::do_make_elf_object): New overloaded method definitions
12923 and declaration.
12924 (Arm_relobj::do_read_symbols): New method definition.
12925 (Arm_dynobj::do_read_symbols): Ditto.
12926 (Target_arm::do_finalize_sections): Add input_objects parameters.
12927 Merge processor-specific flags from all input objects.
12928 (Target_arm::are_eabi_versions_compatible,
12929 Target_arm::merge_processor_specific_flags,
12930 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12931 New method definitions.
12932 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12933 Input_objects pointer type parameter.
12934 * layout.cc (Layout::finalize): Pass input objects to target's.
12935 finalize_sections function.
12936 * output.cc (Output_file_header::do_sized_write): Set ELF file
12937 header's processor-specific flags.
12938 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12939 Input_objects pointer type parameter.
12940 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12941 * target.h (Input_objects): New forward class declaration.
12942 (Target::processor_specific_flags,
12943 Target::are_processor_specific_flags_sect): New method definitions.
12944 (Target::finalize_sections): Add input_objects parameter.
12945 (Target::Target): Initialize processor_specific_flags_ and
12946 are_processor_specific_flags_set_.
12947 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12948 parameter.
12949 (Target::set_processor_specific_flags): New method definition.
12950 (Target::processor_specific_flags_,
12951 Target::are_processor_specific_flags_set_): New data member
12952 declarations.
12953 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12954 Input_objects pointer type parameter.
12955
12956 2009-10-30 Doug Kwan <dougkwan@google.com>
12957
12958 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12959
12960 2009-10-28 Ian Lance Taylor <iant@google.com>
12961
12962 * object.h (class Relobj): Drop options parameter from
12963 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12964 do_scan_relocs, do_relocate. Change all callers.
12965 (class Sized_relobj): Drop options parameters from
12966 do_gc_process_relocs, do_scan_relocs, do_relocate,
12967 do_relocate_sections, relocate_sections, emit_relocs_scan,
12968 emit_relocs_scan_reltype. Change all callers.
12969 (struct Relocate_info): Remove options field and all references to
12970 it.
12971 * reloc.h (class Read_relocs): Remove options constructor
12972 parameter and options_ field. Change all callers.
12973 (class Gc_process_relocs, class Scan_relocs): Likewise.
12974 (class Relocate_task): Likewise.
12975 * target-reloc.h (scan_relocs): Remove options parameter. Change
12976 all callers.
12977 (scan_relocatable_relocs): Likewise.
12978 * target.h (class Sized_target): Remove options parameter from
12979 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12980 all callers.
12981 * gc.h (gc_process_relocs): Remove options parameter. Change all
12982 callers.
12983 * arm.cc: Update functions to remove options parameters.
12984 * i386.cc: Likewise.
12985 * powerpc.cc: Likewise.
12986 * sparc.cc: Likewise.
12987 * x86_64.cc: Likewise.
12988 * testsuite/testfile.cc: Likewise.
12989
12990 2009-10-28 Doug Kwan <dougkwan@google.com>
12991
12992 * arm.cc (Arm_relobj): New class definition.
12993 (Arm_relobj::scan_sections_for_stubs,
12994 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12995 New method definitions.
12996
12997 2009-10-28 Cary Coutant <ccoutant@google.com>
12998
12999 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13000 (Plugin::cleanup_done_): New member.
13001 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13002 (Plugin_manager::cleanup_done_): Remove.
13003 (Plugin_manager::add_input_file): Edit error message.
13004 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13005 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13006
13007 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13008
13009 * fileread.cc: (File_read::View::~View): Use the new
13010 data_ownership_ filed.
13011 (File_read::~File_read): Dispose the new whole_file_view_.
13012 (File_read::open): Mmap the whole file if needed.
13013 (File_read::open): Use whole_file_view_ instead of contents_.
13014 (File_read::find_view): Use whole_file_view_ if applicable.
13015 (File_read::do_read): Use whole_file_view_ instead of contents_.
13016 (File_read::make_view): Use whole_file_view_ instead of contents_,
13017 update File_read::View::View call.
13018 (File_read::find_or_make_view): Update File_read::View::View
13019 call.
13020 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13021 remove contents_
13022 (File_read::View::Data_ownership): New enum.
13023 (File_read::View::View): Replace bool mapped_ with Data_ownership
13024 argument.
13025 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13026 (File_read::View::data_ownership_): New field.
13027 (File_read::contents_): Remove (replaced by whole_file_view_).
13028 (File_read::whole_file_view_): New field.
13029 * options.h (class General_options): Add --keep-files-mapped.
13030
13031 2009-10-27 Cary Coutant <ccoutant@google.com>
13032
13033 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13034 * testsuite/Makefile.am (plugin_test_5): New test case.
13035 * testsuite/Makefile.in: Regenerate.
13036
13037 2009-10-25 Doug Kwan <dougkwan@google.com>
13038
13039 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13040 from private to protected to allow access by child class.
13041 (Sized_relobj::do_relocate_sections): New method declaration.
13042 (Sized_relobj::relocate_sections): Virtualize.
13043 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13044 Sized_relobj::relocate_sections. Instantiate template explicitly
13045 for different target sizes and endianity.
13046
13047 2009-10-24 Doug Kwan <dougkwan@google.com>
13048
13049 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13050 (Arm_input_section::as_arm_input_section): New method.
13051 (Arm_output_section): New class definition.
13052 (Arm_output_section::create_stub_group,
13053 Arm_output_section::group_sections): New method definitions.
13054
13055 2009-10-22 Doug Kwan <dougkwan@google.com>
13056
13057 * arm.cc (Arm_input_section): New class definition.
13058 (Arm_input_section::init, Arm_input_section:do_write,
13059 Arm_input_section::set_final_data_size,
13060 Arm_input_section::do_reset_address_and_file_offset): New method
13061 definitions.
13062
13063 2009-10-21 Doug Kwan <dougkwan@google.com>
13064
13065 * arm.cc (Stub_table, Arm_input_section): New forward class
13066 declarations.
13067 (Stub_table): New class defintion.
13068 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13069 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13070 New method definition.
13071
13072 2009-10-21 Doug Kwan <dougkwan@google.com>
13073
13074 * arm.cc: Update copyright comments.
13075 (Target_arm): New forward class template declaration.
13076 (Arm_address): New type.
13077 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13078 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13079 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13080 constants.
13081 (Insn_template): Same.
13082 (DEF_STUBS): New macro.
13083 (Stub_type): New enum type.
13084 (Stub_template): New class definition.
13085 (Stub): Same.
13086 (Reloc_stub): Same.
13087 (Stub_factory): Same.
13088 (Target_arm::Target_arm): Initialize may_use_blx_ and
13089 should_force_pic_veneer_.
13090 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13091 Target_arm::should_force_pic_veneer,
13092 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13093 Target_arm::using_thumb_only, Target_arm:;default_target): New
13094 method defintions.
13095 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13096 New data member declarations.
13097 (Insn_template::size, Insn_template::alignment): New method defintions.
13098 (Stub_template::Stub_template): New method definition.
13099 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13100 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13101 (Stub_factory::Stub_factory): New method definition.
13102 * gold.h (string_hash): New template.
13103 * output.h (Input_section_specifier::hash_value): Use
13104 gold::string_hash.
13105 (Input_section_specifier::string_hash): Remove.
13106 * stringpool.cc (Stringpool_template::string_hash): Use
13107 gold::string_hash.
13108
13109 2009-10-20 Doug Kwan <dougkwan@google.com>
13110
13111 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13112 symbols of relaxed input sections.
13113 * output.h (Output_section::find_relaxed_input_section): Make
13114 method public.
13115
13116 2009-10-16 Doug Kwan <dougkwan@google.com>
13117
13118 * dynobj.cc (Versions::Versions): Initialize version_script_.
13119 Only insert base version symbol definition for a shared object
13120 if version script defines any version versions.
13121 (Versions::define_base_version): New method definition.
13122 (Versions::add_def): Check that base version is not needed.
13123 (Versions::add_need): Define base version lazily.
13124 * dynobj.h (Versions::define_base_version): New method declaration.
13125 (Versions::needs_base_version_): New data member declaration.
13126 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13127 (check_DATA): Add no_version_test.stdout.
13128 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13129 New make rules.
13130 * testsuite/Makefile.in: Regenerate.
13131 * testsuite/no_version_test.c: New file.
13132 * testsuite/no_version_test.sh: Ditto.
13133
13134 2009-10-16 Doug Kwan <dougkwan@google.com>
13135
13136 * expression.cc (class Segment_start_expression): New class definition.
13137 (Segment_start_expression::value): New method definition.
13138 (script_exp_function_segment_start): Return a new
13139 Segment_start_expression.
13140 * gold/script-c.h (script_saw_segment_start_expression): New function
13141 prototype.
13142 * script-sections.cc (Script_sections::Script_sections): Initialize
13143 SAW_SEGMENT_START_EXPRESSION_ to false.
13144 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13145 and -Tbbs options to specify section addresses if given in
13146 command line and no SEGMENT_START expression is seen in a script.
13147 * script-sections.h (Script_sections::saw_segment_start_expression,
13148 Script_sections::set_saw_segment_start_expression): New method
13149 definition.
13150 (Script_sections::saw_segment_start_expression_): New data member
13151 declaration.
13152 * script.cc (script_saw_segment_start_expression): New function.
13153 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13154 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13155 script_test_7.sh and script_test_8.sh.
13156 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13157 script_test_8.stdout.
13158 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13159 (script_test_6, script_test_6.stdout, script_test_7,
13160 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13161 * Makefile.in: Regenerate.
13162 * testsuite/script_test_6.sh: New file.
13163 * testsuite/script_test_6.t: Same.
13164 * testsuite/script_test_7.sh: Same.
13165 * testsuite/script_test_7.t: Same.
13166 * testsuite/script_test_8.sh: Same.
13167
13168 2009-10-16 Doug Kwan <dougkwan@google.com>
13169
13170 * output.cc (Output_segment::set_section_list_address): Cast
13171 expressions to unsigned long long type to avoid format warnings.
13172
13173 2009-10-15 Ian Lance Taylor <iant@google.com>
13174
13175 * script.cc (Script_options::add_symbol_assignment): Always add a
13176 dot assignment to script_sections_.
13177 * script-sections.cc (Script_sections::add_dot_assignment):
13178 Initialize if necessary.
13179
13180 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13181 program headers with no load segment if there is a linker script.
13182
13183 * layout.cc (Layout::set_segment_offsets): Align the file offset
13184 to the segment aligment for -N or -n with no load segment.
13185 * output.cc (Output_segment::add_output_section): Don't crash if
13186 the first section is a TLS section.
13187 (Output_segment::set_section_list_addresses): Print an error
13188 message if the address moves backward in a linker script.
13189 * script-sections.cc
13190 (Output_section_element_input::set_section_addresses): Don't
13191 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13192 (Orphan_output_section::set_section_addresses): Likewise.
13193
13194 2009-10-15 Doug Kwan <dougkwan@google.com>
13195
13196 * layout.cc (Layout::finish_dynamic_section): Generate tags
13197 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13198 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13199 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13200
13201 2009-10-14 Ian Lance Taylor <iant@google.com>
13202
13203 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13204 fields.
13205 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13206 data_shdr fields of relinfo.
13207 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13208 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13209 R_386_TLS_LDO_32, adjust based on section flags.
13210 (Target_i386::Relocate::fix_up_ldo): Remove.
13211
13212 2009-10-13 Ian Lance Taylor <iant@google.com>
13213
13214 Add support for -pie.
13215 * options.h (class General_options): Add -pie and
13216 --pic-executable.
13217 (General_options::output_is_position_independent): Test -pie.
13218 (General_options::output_is_executable): Return true if not shared
13219 and not relocatable.
13220 (General_options::output_is_pie): Remove.
13221 * options.cc (General_options::finalize): Reject incompatible uses
13222 of -pie.
13223 * gold.cc (queue_middle_tasks): A -pie link is not static.
13224 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13225 * symtab.cc (Symbol::final_value_is_known): Return false if
13226 output_is_position_independent.
13227 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13228 output_is_position_independent.
13229 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13230 output_is_position_independent.
13231 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13232 output_is_position_independent.
13233 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13234 two_file_pie_test.
13235 (basic_pie_test.o, basic_pie_test): New targets.
13236 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13237 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13238 (two_file_pie_test): New target.
13239 * testsuite/Makefile.in: Rebuild.
13240 * README: Remove note saying that -pie is not supported.
13241
13242 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13243
13244 * options.h (class General_options): Add -init and -fini.
13245 * layout.cc (Layout::finish_dynamic_section): Emit
13246 given init and fini functions.
13247
13248 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13249
13250 * gc.h (gc_process_relocs): Check if icf is enabled using new
13251 function.
13252 * gold.cc (queue_initial_tasks): Likewise.
13253 (queue_middle_tasks): Likewise.
13254 * object.cc (do_layout): Likewise.
13255 * symtab.cc (is_section_folded): Likewise.
13256 * main.cc (main): Likewise.
13257 * reloc.cc (Read_relocs::run): Likewise.
13258 (Sized_relobj::do_scan_relocs): Likewise.
13259 * icf.cc (is_function_ctor_or_dtor): New function.
13260 (Icf::find_identical_sections): Check if function is ctor or dtor when
13261 safe icf is chosen.
13262 * options.h (General_options::icf): Change option to be an enum.
13263 (Icf_status): New enum.
13264 (icf_enabled): New method.
13265 (icf_safe_folding): New method.
13266 (set_icf_status): New method.
13267 (icf_status_): New variable.
13268 * (options.cc) (General_options::finalize): Set icf_status_.
13269 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13270 icf_test and icf_keep_unique_test to use the --icf enum flag.
13271 * testsuite/icf_safe_test.sh: New file.
13272 * testsuite/icf_safe_test.cc: New file.
13273
13274 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13275
13276 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13277 includes to gc.h and icf.h.
13278 * arm.cc: Include gc.h.
13279 * gold.cc: Likewise.
13280 * i386.cc: Likewise.
13281 * powerpc.cc: Likewise.
13282 * sparc.cc: Likewise.
13283 * x86_64.cc: Likewise.
13284 * gc.h: Include icf.h.
13285
13286 2009-10-11 Ian Lance Taylor <iant@google.com>
13287
13288 * plugin.cc: Include "gold.h" before other header files.
13289
13290 2009-10-10 Chris Demetriou <cgd@google.com>
13291
13292 * options.h (Input_file_argument::Input_file_type): New enum.
13293 (Input_file_argument::is_lib_): Replace with...
13294 (Input_file_argument::type_): New member.
13295 (Input_file_argument::Input_file_argument): Take Input_file_type
13296 'type' rather than boolean 'is_lib' as second argument.
13297 (Input_file_argument::is_lib): Use type_.
13298 (Input_file_argument::is_searched_file): New function.
13299 (Input_file_argument::may_need_search): Handle is_searched_file.
13300 * options.cc (General_options::parse_library): Support -l:filename.
13301 (General_options::parse_just_symbols): Update for Input_file_argument
13302 changes.
13303 (Command_line::process): Likewise.
13304 * archive.cc (Archive::get_file_and_offset): Likewise.
13305 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13306 * script.cc (read_script_file, script_add_file): Likewise.
13307 * fileread.cc (Input_file::Input_file): Likewise.
13308 (Input_file::will_search_for): Handle is_searched_file.
13309 (Input_file::open): Likewise.
13310 * readsyms.cc (Read_symbols::get_name): Likewise.
13311 * testsuite/Makefile.am (searched_file_test): New test.
13312 * testsuite/Makefile.in: Regenerate.
13313 * testsuite/searched_file_test.cc: New file.
13314 * testsuite/searched_file_test_lib.cc: New file.
13315
13316 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13317 Ian Lance Taylor <iant@google.com>
13318
13319 * descriptor.cc: Include <cstdio> and "binary-io.h".
13320 (Descriptors::open): Open the files in binary mode always.
13321 * script.cc (Lex::get_token): Treat \r as whitespace.
13322
13323 2009-10-09 Ian Lance Taylor <iant@google.com>
13324
13325 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13326
13327 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13328 Ian Lance Taylor <iant@google.com>
13329
13330 * configure.ac: Check for readv function also.
13331 * fileread.cc (readv): Define if not HAVE_READV.
13332 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13333 does not exist.
13334 * config.in: Regenerate.
13335 * configure: Regenerate.
13336
13337 2009-10-09 Doug Kwan <dougkwan@google.com>
13338
13339 * layout.cc (Layout::make_output_section): Call target hook to make
13340 ordinary output section.
13341 (Layout::finalize): Adjust parameter list of call the
13342 Target::may_relax().
13343 * layout.h (class Layout::section_list): New method.
13344 * merge.h (Output_merge_base::entsize): Change visibility to public.
13345 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13346 New methods.
13347 (Output_merge_string::do_is_string): New method.
13348 * object.cc (Sized_relobj::do_setup): renamed from
13349 Sized_relobj::set_up.
13350 * object.h (Sized_relobj::adjust_shndx,
13351 Sized_relobj::initializ_input_to_output_maps,
13352 Sized_relobj::free_input_to_output_maps): Change visibilities to
13353 protected.
13354 (Sized_relobj::setup): Virtualize.
13355 (Sized_relobj::do_setup): New method declaration.
13356 (Sized_relobj::invalidate_section_offset,
13357 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13358 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13359 * options.cc (parse_int): New function.
13360 * options.h (parse_int): New declaration.
13361 (DEFINE_int): New macro.
13362 (stub_group_size): New option.
13363 * output.cc (Output_section::Output_section): Initialize memebers
13364 merge_section_map_, merge_section_by_properties_map_,
13365 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13366 (Output_section::add_input_section): Handled deferred code-fill
13367 generation and remove an old comment.
13368 (Output_section::add_relaxed_input_section): New method definition.
13369 (Output_section::add_merge_input_section): Use merge section by
13370 properties map to speed to search. Update merge section maps
13371 as appropriate.
13372 (Output_section::build_relaxation_map): New method definition.
13373 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13374 Same.
13375 (Output_section::relax_input_section): Renamed to
13376 Output_section::convert_input_sections_to_relaxed_sections and change
13377 interface to take a vector of pointers to relaxed sections.
13378 (Output_section::find_merge_section,
13379 Output_section::find_relaxed_input_section): New method definitions.
13380 (Output_section::is_input_address_mapped,
13381 Output_section::output_offset, Output_section::output_address):
13382 Use output section data maps to speed up searching.
13383 (Output_section::find_starting_output_address): Add comments.
13384 (Output_section::do_write,
13385 Output_section::write_to_postprocessing_buffer): Do code-fill
13386 generation as appropriate.
13387 (Output_section::get_input_sections): Invalidate relaxed input section
13388 map.
13389 (Output_section::restore_states): Adjust type of checkpoint .
13390 Invalidate relaxed input section map.
13391 * output.h (Output_merge_base): New class declaration.
13392 (Input_section_specifier): New class defintion.
13393 (class Output_relaxed_input_section) Change base class to
13394 Output_section_data_build.
13395 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13396 base class initializer.
13397 (Output_section::add_relaxed_input_section): New method declaration.
13398 (Output_section::Input_section): Change visibility to protected.
13399 (Output_section::Input_section::relobj,
13400 Output_section::Input_section::shndx): Handle relaxed input sections.
13401 Output_section::input_sections) Change visibility to protected. Also
13402 define overload to return a non-const pointer.
13403 (Output_section::Merge_section_properties): New class defintion.
13404 (Output_section::Merge_section_by_properties_map,
13405 Output_section::Output_section_data_by_input_section_map,
13406 Output_section::Relaxation_map): New types.
13407 (Output_section::relax_input_section): Rename method to
13408 Output_section::convert_input_sections_to_relaxed_sections and change
13409 interface to take a vector of relaxed section pointers.
13410 (Output_section::find_merge_section,
13411 Output_section::find_relaxed_input_section,
13412 Output_section::build_relaxation_map,
13413 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13414 New method declarations.
13415 (Output_section::merge_section_map_
13416 Output_section::merge_section_by_properties_map_,
13417 Output_section::relaxed_input_section_map_,
13418 Output_section::is_relaxed_input_section_map_valid_,
13419 Output_section::generate_code_fills_at_write_): New data members.
13420 * script-sections.cc
13421 (Output_section_element_input::set_section_addresses): Call
13422 current_data_size and addralign methods of relaxed input sections.
13423 (Orphan_output_section::set_section_addresses): Call current_data_size
13424 and addralign methods of relaxed input sections.
13425 * symtab.cc (Symbol_table::compute_final_value): Extract template
13426 from the body of Symbol_table::sized_finalize_symbol.
13427 (Symbol_table::sized_finalized_symbol): Call
13428 Symbol_table::compute_final_value.
13429 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13430 (Symbol_table::compute_final_value): New templated method declaration.
13431 * target.cc (Target::do_make_output_section): New method defintion.
13432 * target.h (Target::make_output_section): New method declaration.
13433 (Target::relax): Add more parameters for input objects, symbol table
13434 and layout. Adjust call to do_relax.
13435 (Target::do_make_output_section): New method declaration.
13436 (Target::do_relax): Add parameters for input objects, symbol table
13437 and layout.
13438
13439 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13440
13441 * pread.c: Include stdio.h.
13442
13443 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13444
13445 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13446 defined.
13447
13448 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13449
13450 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13451 Change read_shndx type to unsigned int.
13452 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13453 int.
13454 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13455 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13456 Change read_shndx type to unsigned int.
13457 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13458 int.
13459 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13460 * layout.cc (Layout::create_symtab_sections): Cast the result of
13461 local_symcount * symsize to off_t in the gold_assert.
13462
13463 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13464
13465 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13466 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13467 R_ARM_BASE_ABS.
13468 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13469 (Arm_relocate_functions::thm_abs5): New function.
13470 (Arm_relocate_functions::abs12): New function.
13471 (Arm_relocate_functions::abs16): New function.
13472 (Arm_relocate_functions::base_abs): New function.
13473 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13474 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13475 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13476 R_ARM_BASE_ABS.
13477 (Scan::global): Likewise.
13478 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13479 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13480 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13481 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13482 R_ARM_BASE_ABS.
13483
13484 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13485
13486 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13487 (Arm_relocate_functions::movt_prel): New function.
13488 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13489 (Arm_relocate_functions::thm_movt_prel): New function.
13490 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13491 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13492 (Scan::global, Relocate::relocate): Likewise.
13493 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13494
13495 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13496
13497 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13498 Incremental_checker.
13499 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13500 unsigned int.
13501 (class Incremental_inputs_header): New class.
13502 (Incremental_inputs_header_writer): Edit comment.
13503 (Incremental_inputs_entry): New class.
13504 (Incremental_inputs_entry_writer): Edit comment.
13505 (Sized_incremental_binary::do_find_incremental_inputs_section):
13506 Add *strtab_shndx parameter, fill it.
13507 (Sized_incremental_binary::do_check_inputs): New method.
13508 (Incremental_checker::can_incrementally_link_output_file): Use
13509 Sized_incremental_binary::check_inputs.
13510 (Incremental_inputs::report_command_line): Save command line in
13511 command_line_.
13512 * incremental.h:
13513 (Incremental_binary::find_incremental_inputs_section): New
13514 method.
13515 (Incremental_binary::do_find_incremental_inputs_section): Add
13516 strtab_shndx parameter.
13517 (Incremental_binary::do_check_inputs): New pure virtual method.
13518 (Sized_incremental_binary::do_check_inputs): Declare.
13519 (Incremental_checker::Incremental_checker): Add incremental_inputs
13520 parameter, use it to initialize incremental_inputs_.
13521 (Incremental_checker::incremental_inputs_): New field.
13522 (Incremental_checker::command_line): New method.
13523 (Incremental_checker::inputs): New method.
13524 (Incremental_checker::command_line_): New field.
13525
13526 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13527
13528 * incremental.cc: Include <cstdarg> and "target-select.h".
13529 (vexplain_no_incremental): New function.
13530 (explain_no_incremental): New function.
13531 (Incremental_binary::error): New method.
13532 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13533 method.
13534 (make_sized_incremental_binary): New function.
13535 (open_incremental_binary): New function.
13536 (can_incrementally_link_file): Add checks if output is ELF and has
13537 inputs section.
13538 * incremental.h: Include "elfcpp_file.h" and "output.h".
13539 (Incremental_binary): New class.
13540 (Sized_incremental_binary): New class.
13541 (open_incremental_binary): Declare.
13542 * object.cc (is_elf_object): Use
13543 elfcpp::Elf_recognizer::is_elf_file.
13544 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13545 * output.h (Output_file::filesize): New method.
13546
13547 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13548
13549 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13550 New function.
13551 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13552 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13553 function.
13554 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13555 function.
13556 (Arm_relocate_functions::movw_abs_nc): New function.
13557 (Arm_relocate_functions::movt_abs): New function.
13558 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13559 (Arm_relocate_functions::thm_movt_abs): New function.
13560 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13561 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13562 (Scan::global): Likewise.
13563 (Relocate::relocate): Likewise.
13564 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13565
13566 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13567
13568 * arm.cc (Arm_relocate_functions::got_prel) New function.
13569 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13570 (Relocate::relocate): Likewise.
13571 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13572
13573 2009-10-06 Ian Lance Taylor <iant@google.com>
13574
13575 * options.h (class General_options): Define
13576 split_stack_adjust_size parameter.
13577 * object.h (class Object): Add uses_split_stack_ and
13578 has_no_split_stack_ fields. Add uses_split_stack and
13579 has_no_split_stack accessor functions. Declare
13580 handle_split_stack_section.
13581 (class Reloc_symbol_changes): Define.
13582 (class Sized_relobj): Define Function_offsets. Declare
13583 split_stack_adjust, split_stack_adjust_reltype, and
13584 find_functions.
13585 * object.cc (Object::handle_split_stack_section): New function.
13586 (Sized_relobj::do_layout): Call handle_split_stack_section.
13587 * dynobj.cc (Sized_dynobj::do_layout): Call
13588 handle_split_stack_section.
13589 * reloc.cc (Sized_relobj::relocate_sections): Call
13590 split_stack_adjust for executable sections in split_stack
13591 objects. Pass reloc_map to relocate_section.
13592 (Sized_relobj::split_stack_adjust): New function.
13593 (Sized_relobj::split_stack_adjust_reltype): New function.
13594 (Sized_relobj::find_functions): New function.
13595 * target-reloc.h: Include "object.h".
13596 (relocate_section): Add reloc_symbol_changes parameter. Change
13597 all callers.
13598 * target.h (class Target): Add calls_non_split method. Declare
13599 do_calls_non_split virtual method. Declare match_view and
13600 set_view_to_nop.
13601 * target.cc: Include "elfcpp.h".
13602 (Target::do_calls_non_split): New function.
13603 (Target::match_view): New function.
13604 (Target::set_view_to_nop): New function.
13605 * gold.cc (queue_middle_tasks): Give an error if mixing
13606 split-stack and non-split-stack objects with -r.
13607 * i386.cc (Target_i386::relocate_section): Add
13608 reloc_symbol_changes parameter.
13609 (Target_i386::do_calls_non_split): New function.
13610 * x86_64.cc (Target_x86_64::relocate_section): Add
13611 reloc_symbol_changes parameter.
13612 (Target_x86_64::do_calls_non_split): New function.
13613 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13614 parameter.
13615 * powerpc.cc (Target_powerpc::relocate_section): Add
13616 reloc_symbol_changes parameter.
13617 * sparc.cc (Target_sparc::relocate_section): Add
13618 reloc_symbol_changes parameter.
13619 * configure.ac: Call AM_CONDITIONAL for the default target.
13620 * configure: Rebuild.
13621 * testsuite/Makefile.am (TEST_AS): New variable.
13622 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13623 (check_DATA): Add split_i386 and split_x86_64 files.
13624 (SPLIT_DEFSYMS): Define.
13625 (split_i386_[1234n].o): New targets.
13626 (split_i386_[124]): New targets.
13627 (split_i386_[1234r].stdout): New targets.
13628 (split_x86_64_[1234n].o): New targets.
13629 (split_x86_64_[124]): New targets.
13630 (split_x86_64_[1234r].stdout): New targets.
13631 (MOSTLYCLEANFILES): Add new executables.
13632 * testsuite/split_i386.sh: New file.
13633 * testsuite/split_x86_64.sh: New file.
13634 * testsuite/split_i386_1.s: New file.
13635 * testsuite/split_i386_2.s: New file.
13636 * testsuite/split_i386_3.s: New file.
13637 * testsuite/split_i386_4.s: New file.
13638 * testsuite/split_i386_n.s: New file.
13639 * testsuite/split_x86_64_1.s: New file.
13640 * testsuite/split_x86_64_2.s: New file.
13641 * testsuite/split_x86_64_3.s: New file.
13642 * testsuite/split_x86_64_4.s: New file.
13643 * testsuite/split_x86_64_n.s: New file.
13644 * testsuite/testfile.cc (Target_test): Update relocation_section
13645 function.
13646 * testsuite/Makefile.in: Rebuild.
13647
13648 2009-10-06 Ian Lance Taylor <iant@google.com>
13649
13650 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13651 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13652 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13653 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13654 the address on ldo_addrs_.
13655 (Target_i386::Relocate::fix_up_ldo): New function.
13656
13657 2009-10-06 Rafael Espindola <espindola@google.com>
13658
13659 * plugin.cc (add_input_library): New.
13660 (Plugin::load): Add add_input_library to tv.
13661 (Plugin_manager::add_input_file): Add the is_lib argument.
13662 (add_input_file): Update call to Plugin_manager::add_input_file.
13663 (add_input_library): New.
13664 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13665
13666 2009-09-30 Doug Kwan <dougkwan@google.com>
13667
13668 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13669 symbol and call Symbol::may_need_copy_reloc to determine if
13670 a copy reloc is needed.
13671 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13672 nocopyreloc is given in command line.
13673 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13674 given in command line.
13675 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13676 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13677 of the removed Target_i386::may_need_copy_reloc.
13678 * options.h (copyreloc): New option with default value false.
13679 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13680 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13681 instead of the removed Target_powerpc::may_need_copy_reloc.
13682 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13683 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13684 instead of the removed Target_sparc::may_need_copy_reloc.
13685 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13686 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13687 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13688 instead of the removed Target_x86_64::may_need_copy_reloc.
13689
13690 2009-09-30 Ian Lance Taylor <iant@google.com>
13691
13692 * object.h (class Object): Remove target_ field, and target,
13693 sized_target, and set_target methods.
13694 (Object::sized_target): Remove.
13695 (class Sized_relobj): Update declarations. Remove sized_target.
13696 * object.cc (Sized_relobj::setup): Remove target parameter.
13697 Change all callers.
13698 (Input_objects::add_object): Don't do anything with the target.
13699 (make_elf_sized_object): Add punconfigured parameter. Change all
13700 callers. Set or test parameter target.
13701 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13702 Change all callers.
13703 * parameters.cc (Parameters::set_target): Change parameter type to
13704 be non-const.
13705 (Parameters::default_target): Remove.
13706 (set_parameters_target): Change parameter type to be non-const.
13707 (parameters_force_valid_target): New function.
13708 (parameters_clear_target): New function.
13709 * parameters.h (class Parameters): Update declarations. Remove
13710 default_target method. Add sized_target and clear_target
13711 methods. Change target_ to be non-const.
13712 (set_parameters_target): Update declaration.
13713 (parameters_force_valid_target): Declare.
13714 (parameters_clear_target): Declare.
13715 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13716 as NULL if we aren't searching.
13717 (Add_symbols::run): Don't check for compatible target.
13718 * fileread.cc (Input_file::open_binary): Call
13719 parameters_force_valid_target.
13720 * gold.cc (queue_middle_tasks): Likewise.
13721 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13722 set_target on object.
13723 * dynobj.h (class Sized_dynobj): Update declarations.
13724 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13725 make_elf_object returns NULL.
13726 (Archive::include_member): Don't check whether object target is
13727 compatible.
13728 * output.cc (Output_section::add_input_section): Get target from
13729 parameters.
13730 (Output_section::relax_input_section): Likewise.
13731 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13732 parameters.
13733 (Sized_relobj::do_scan_relocs): Likewise.
13734 (Sized_relobj::relocate_sections): Likewise.
13735 * resolve.cc (Symbol_table::resolve): Likewise.
13736 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13737 parameter. Change all callers.
13738 (Symbol_table::add_from_object): Get target from parameters.
13739 (Symbol_table::add_from_relobj): Don't check object target.
13740 (Symbol_table::add_from_dynobj): Likewise.
13741 (Symbol_table::define_special_symbol): Get target from
13742 parameters.
13743 * symtab.h (class Symbol_table): Update declaration.
13744 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13745 parameter. Change all callers. Clear parameter target.
13746 (Binary_test): Test target here.
13747 * testsuite/object_unittest.cc (gold_testsuite): Remove
13748 target_test_pointer parameter. Change all callers.
13749 (Object_test): Test target here.
13750
13751 2009-09-26 Ian Lance Taylor <iant@google.com>
13752
13753 * testsuite/initpri1.c: Don't try to use constructor priorities if
13754 compiling with gcc before 4.3.
13755
13756 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13757
13758 * testsuite/retain_symbols_file_test.sh (check_present): Change
13759 output file name to retain_symbols_file_test.stdout.
13760 (check_absent): Likewise.
13761
13762 2009-09-18 Craig Silverstein <csilvers@google.com>
13763
13764 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13765 * options.cc: Include <cerrno> and <fstream>.
13766 (General_options::finalize): Parse -retain-symbols-file tag.
13767 * options.h: New flag.
13768 (General_options): New method should_retain_symbol, new
13769 variable symbols_to_retain.
13770 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13771 should_retain_symbol map.
13772 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13773 * testsuite/Makefile.in: Regenerate.
13774 * testsuite/retain_symbols_file_test.sh: New file.
13775
13776 2009-09-18 Nick Clifton <nickc@redhat.com>
13777
13778 * po/es.po: Updated Spanish translation.
13779
13780 2009-09-17 Doug Kwan <dougkwan@google.com>
13781
13782 * debug.h (DEBUG_RELAXATION): New constant.
13783 (DEBUG_ALL): Add DEBUG_RELAXATION.
13784 (debug_string_to_enum): Add relaxation debug option.
13785 * layout.cc
13786 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13787 Layout::Relaxation_debug_check::read_sections,
13788 Layout::Relaxation_debug_check::read_sections): New method definitions.
13789 (Layout::Layout): Initialize data members
13790 record_output_section_data_from_scrips_,
13791 script_output_section_data_list_ and relaxation_debug_check_.
13792 (Layout::save_segments, Layout::restore_segments,
13793 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13794 Layout::relaxation_loop_body): New method definitions.
13795 (Layout::finalize): Support relaxation. Move section layout code to
13796 Layout::relaxation_loop_body.
13797 (Layout::set_asection_address_from_script): Move code for orphan
13798 section placement out.
13799 (Layout::place_orphan_sections_in_script): New method definition.
13800 * layout.h (Output_segment_headers, Output_file_header):
13801 New forward class declarations.
13802 (Layout::~Layout): Define.
13803 (Layout::new_output_section_data_from_script): New method definition.
13804 (Layout::place_orphan_sections_in_script): New method declaration.
13805 (Layout::Segment_states): New type declaration.
13806 (Layout::save_segments, Layout::restore_segments,
13807 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13808 Layout::relaxation_loop_body): New method declarations.
13809 (Layout::Output_section_data_list): New type declaration.
13810 (Layout::Relaxation_debug_check): New class definition.
13811 (Layout::record_output_section_data_from_script_,
13812 Layout::script_output_section_data_list_, Layout::segment_states_,
13813 Layout::relaxation_debug_check_): New data members.
13814 * output.cc: (Output_section_headers::do_size): New method definition.
13815 (Output_section_headers::Output_section_headers): Move size
13816 computation to Output_section_headers::do_size.
13817 (Output_segment_headers::do_size): New method definition.
13818 (Output_file_header::Output_file_header): Move size computation to
13819 Output_file_header::do_size and call it.
13820 (Output_file_header::do_size): New method definition.
13821 (Output_data_group::Output_data_group): Adjust call to
13822 Output_section_data.
13823 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13824 (Output_symtab_xindex::do_write): Add array bound check.
13825 (Output_section::Input_section::print_to_mapfile): Handle
13826 RELAXED_INPUT_SECTION_CODE.
13827 (Output_section::Output_section): Initialize data member checkpoint_.
13828 (Output_section::~Output_section): Delete checkpoint object pointed
13829 by checkpoint_.
13830 (Output_section::add_input_section): Always add an Input_section if
13831 relaxing.
13832 (Output_section::add_merge_input_section): Add assert.
13833 (Output_section::relax_input_section): New method definition.
13834 (Output_section::set_final_data_size): Set load address to zero for
13835 an unallocated section.
13836 (Output_section::do_address_and_file_offset_have_reset_values):
13837 New method definition.
13838 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13839 Handle relaxed input section.
13840 (Output_section::sort_attached_input_sections): Checkpoint input
13841 section list lazily.
13842 (Output_section::get_input_sections): Change type of input_sections to
13843 list of Simple_input_section pointers. Checkpoint input section list
13844 lazily. Also handle relaxed input sections.
13845 (Output_section::add_input_section_for_script): Take a reference to
13846 a Simple_input_section object instead of Relobj pointer and section
13847 index as parameter. Handle relaxed input sections.
13848 (Output_section::save_states, Output_section::restore_states): New
13849 method definitions.
13850 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13851 (Output_data::is_data_size_fixed): New method definition.
13852 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13853 if it is fixed.
13854 (Output_data::address_and_file_offset_have_reset_values): New method
13855 definition.
13856 (Output_data::do_address_and_file_offset_have_reset_values): New method
13857 definition.
13858 (Output_data::set_data_size): Check that data size is not fixed.
13859 (Output_data::fix_data_size): New method definition.
13860 (Output_data::is_data_size_fixed_): New data member.
13861 (Output_section_headers::set_final_data_size): New method definition.
13862 (Output_section_headers::do_size): New method declaration.
13863 (Output_segment_headers::set_final_data_size): New method definition.
13864 (Output_segment_headers::do_size): New method declaration.
13865 (Output_file_header::set_final_data_size)::New method definition.
13866 (Output_file_header::do_size)::New method declaration.
13867 (Output_section_data::Output_section_data): Add new parameter
13868 is_data_size_fixed and use it to fix data size.
13869 (Output_data_const::Output_data_const): Adjust call to base class
13870 constructor and fix data size.
13871 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13872 base class constructor and fix data size.
13873 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13874 base class constructor and fix data size.
13875 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13876 class constructor and fix data size.
13877 (Output_data_group::set_final_data_size): New method definition.
13878 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13879 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13880 class constructor and fix data size.
13881 (Output_relaxed_input_section): New class definition.
13882 (Output_section::Simple_input_section): New class definition.
13883 (Output_section::get_input_sections): Adjust parameter list.
13884 (Output_section::add_input_section_for_script): Same.
13885 (Output_section::save_states, Output_section::restore_states,
13886 Output_section::do_address_and_file_offset_have_reset_values,
13887 (Output_section::Input_section::Input_section): Handle
13888 RELAXED_INPUT_SECTION_CODE. Add new overload for
13889 Output_relaxed_input_section.
13890 (Output_section::Input_section::is_input_section,
13891 Output_section::Input_section::set_output_section): Handle relaxed
13892 input section.
13893 (Output_section::Input_section::is_relaxed_input_section,
13894 Output_section::Input_section::output_section_data,
13895 Output_section::Input_section::relaxed_input_section): New method
13896 definitions.
13897 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13898 value.
13899 (Output_section::Input_section::u1_): Update comments.
13900 (Output_section::Input_section::u2_): Add new union member poris.
13901 (Output_section::Checkpoint_output_section): New classs definition.
13902 (Output_section::relax_input_section): New method declaration.
13903 (Output_section::checkpoint_): New data member.
13904 (Output_segment): Update comments.
13905 (Output_segment::Output_segment): Un-privatize copy constructor.
13906 (Output_segment::operator=): Un-privatize.
13907 * script-sections.cc (Output_section_element::Input_section_list):
13908 Change element type to Output_section::Simple_input_section.
13909 (Output_section_element_dot_assignment::set_section_addresses):
13910 Register output section data for relaxation clean up.
13911 (Output_data_exression::Output_data_expression): Adjust call to base
13912 constructor to fix data size.
13913 (Output_section_element_data::set_section_addresses): Register
13914 Output_data_expression object for relaxation clean up.
13915 (struct Input_section_info): Replace Relobj pointer and section index
13916 pair with Output_section::Simple_input_section and Convert struct to a
13917 class.
13918 (Input_section_sorter::operator()): Adjust access to
13919 Input_section_info data member to use accessors.
13920 (Output_section_element_input::set_section_addresses): Use layout
13921 parameter. Adjust code to use Output_section::Simple_input_section
13922 and Input_secction_info classes. Register filler for relaxation
13923 clean up.
13924 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13925 and section index pair with Output_section::Simple_input_section
13926 class. Adjust code accordingly.
13927 (Phdrs_element::release_segment): New method definition.
13928 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13929 segment list.
13930 (Script_sections::release_segments): New method definition.
13931 * gold/script-sections.h (Script_sections::release_segments): New
13932 method declaration.
13933 * gold/target.h (Target::may_relax, Target::relax,
13934 Target::do_may_relax, Target::do_relax): New method definitions.
13935
13936 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13937
13938 * arm.cc (has_signed_unsigned_overflow): New function.
13939 (Arm_relocate_functions::abs8): New function.
13940 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13941 (Target_arm::Scan::global): Likewise.
13942 (Target_arm::relocate::relocate): Likewise.
13943 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13944 Likewise.
13945
13946 2009-09-16 Cary Coutant <ccoutant@google.com>
13947
13948 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13949 * testsuite/Makefile.in: Regenerate.
13950
13951 2009-09-11 Nick Clifton <nickc@redhat.com>
13952
13953 * po/gold.pot: Updated by the Translation project.
13954
13955 2009-09-08 Cary Coutant <ccoutant@google.com>
13956
13957 * output.cc (Output_file::open): Add execute permission to empty file.
13958 * testsuite/Makefile.am (permission_test): New test.
13959 * testsuite/Makefile.in: Regenerate.
13960
13961 2009-09-02 Ian Lance Taylor <iant@google.com>
13962
13963 * output.cc (Output_file::resize): Call map_no_anonymous rather
13964 than map.
13965
13966 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13967
13968 * gold.cc: Include "incremental.h".
13969 (queue_initial_tasks): Call Incremental_checker methods.
13970 * incremental.cc: Include "output.h".
13971 (Incremental_checker::can_incrementally_link_output_file): New
13972 method.
13973 * incremental.h (Incremental_checker): New class.
13974
13975 * output.cc (Output_file::open_for_modification): New method.
13976 (Output_file::map_anonymous): Changed return type to bool. Record
13977 map in base_ field.
13978 (Output_file::map_no_anonymous): New method, broken out of map.
13979 (Output_file::map): Use map_no_anonymous and map_anonymous.
13980 * output.h (class Output_file): Update declarations.
13981
13982 2009-08-24 Cary Coutant <ccoutant@google.com>
13983
13984 * options.h (Command_line::Pre_options): New class.
13985 (Command_line::pre_options): New member.
13986 * options.cc (gold::options::ready_to_register): New variable.
13987 (One_option::register_option): Do nothing if not registering options.
13988 Assert if same short option registered twice.
13989 (General_options::General_options): Turn off option registration when
13990 done constructing.
13991 (Command_line::Pre_options::Pre_options): New constructor.
13992
13993 2009-08-24 Cary Coutant <ccoutant@google.com>
13994
13995 * options.h (General_options::no_keep_memory): Remove incorrect
13996 short option.
13997
13998 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13999
14000 * Makefile.am (am__skiplex, am__skipyacc): New.
14001 * Makefile.in: Regenerate.
14002
14003 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14004
14005 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14006 (INCLUDES): ... this.
14007 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14008 (AM_CPPFLAGS): Renamed from ...
14009 (INCLUDE): ... this.
14010 * Makefile.in, testsuite/Makefile.in: Regenerate.
14011
14012 * Makefile.in: Regenerate.
14013 * aclocal.m4: Likewise.
14014 * config.in: Likewise.
14015 * configure: Likewise.
14016 * testsuite/Makefile.in: Likewise.
14017
14018 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14019 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14020 * Makefile.in: Regenerate.
14021 * testsuite/Makefile.in: Regenerate.
14022
14023 2009-08-19 Cary Coutant <ccoutant@google.com>
14024
14025 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14026 symbols in shared libraries overridden by hidden or internal symbols
14027 in the main program.
14028
14029 2009-08-19 Chris Demetriou <cgd@google.com>
14030
14031 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14032 checking source file names in error messages.
14033
14034 2009-08-18 Doug Kwan <dougkwan@google.com>
14035
14036 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14037 an elcpp::Ehdr as parameter. Adjust call to set_target.
14038 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14039 an elfcpp::Ehdr as parameter.
14040 * object.cc (Object::set_target): Remove the version that looks up
14041 a target and sets it.
14042 (Sized_relobj::setup): Take a Target object instead of
14043 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14044 (make_elf_sized_object): Find target and ask target to
14045 make an ELF object.
14046 * object.h: (Object::set_target): Remove the version that looks up
14047 a target and sets it.
14048 (Sized_relobj::setup): Take a Target object instead of
14049 an elfcpp:Ehdr as parameter.
14050 * target.cc: Include dynobj.h.
14051 (Target::do_make_elf_object_implementation): New.
14052 (Target::do_make_elf_object): New.
14053 * target.h (Target::make_elf_object): New template declaration.
14054 (Target::do_make_elf_object): New method declarations.
14055 (Target::do_make_elf_object_implementation): New template declaration.
14056
14057 2009-08-14 Ian Lance Taylor <iant@google.com>
14058
14059 * gold.h (FUNCTION_NAME): Define.
14060 (gold_unreachable): Use FUNCTION_NAME.
14061
14062 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14063
14064 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14065 symbol in the --keep-unique list is not found.
14066
14067 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14068
14069 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14070 been maked as --keep-unique.
14071 (Icf::unfold_section): New function.
14072 * icf.h (Icf::unfold_section): New function.
14073 * options.h (General_options::keep_unique): New option.
14074 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14075 * testsuite/Makefile.in: Regenerate.
14076 * testsuite/icf_keep_unique_test.sh: New file.
14077 * testsuite/icf_keep_unique_test.cc: New file.
14078
14079 2009-08-12 Cary Coutant <ccoutant@google.com>
14080
14081 PR 10471
14082 * resolve.cc (Symbol_table::resolve): Check for references from
14083 dynamic objects to hidden and internal symbols.
14084 * testsuite/Makefile.am (hidden_test.sh): New test.
14085 * testsuite/Makefile.in: Regenerate.
14086 * testsuite/hidden_test.sh: New script.
14087 * testsuite/hidden_test_1.c: New test source.
14088 * testsuite/hidden_test_main.c: New test source.
14089
14090 2009-08-11 Doug Kwan <dougkwan@google.com>
14091
14092 * arm.cc: Update comments.
14093 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14094 segment to locate the .ARM.exidx section if present.
14095
14096 2009-08-09 Doug Kwan <dougkwan@google.com>
14097
14098 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14099 patch.
14100
14101 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14102 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14103 compiler warnings.
14104
14105 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14106
14107 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14108 valid tls_segment only for non-debug-section relocations.
14109 * testsuite/Makefile.am: Add gc_tls_test.
14110 * testsuite/Makefile.in: Regenerate.
14111 * testsuite/gc_tls_test.cc: New file.
14112 * testsuite/gc_tls_test.sh: New file.
14113
14114 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14115
14116 * icf.cc: New file.
14117 * icf.h: New file.
14118 * Makefile.am (CCFILES): Add icf.cc.
14119 (HFILES): Add icf.h
14120 * Makefile.in: Regenerate.
14121 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14122 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14123 section, symbol and addend information for the relocs.
14124 * gold.cc (queue_middle_tasks): Call identical code folding.
14125 * gold.h: Add defines for multimap.
14126 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14127 to the call of finalize_local_symbols.
14128 * main.cc (main): Create object of class Icf.
14129 * object.cc (Sized_relobj::do_layout): Allow this function to be
14130 called twice during icf.
14131 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14132 to sections marked as identical by icf.
14133 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14134 when available.
14135 (Sized_relobj::do_section_entsize): New function.
14136 * object.h (Object::section_entsize): New function.
14137 (Object::do_section_entsize): New pure virtual function.
14138 (Relobj::finalize_local_symbols): Add new parameter.
14139 (Relobj::do_section_entsize): New function.
14140 * options.h (General_options::icf): New option.
14141 (General_options::icf_iterations): New option.
14142 (General_options::print_icf_sections): New option.
14143 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14144 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14145 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14146 icf.
14147 * symtab.cc (Symbol_table::is_section_folded): New function.
14148 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14149 to sections marked as identical by icf.
14150 * symtab.h (Symbol_table::set_icf): New function.
14151 (Symbol_table::icf): New function.
14152 (Symbol_table::is_section_folded): New function.
14153 (Symbol_table::icf_): New data member.
14154 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14155 * testsuite/Makefile.am: Add commands to build icf_test.
14156 * testsuite/Makefile.in: Regenerate.
14157 * testsuite/icf_test.sh: New file.
14158 * testsuite/icf_test.cc: New file.
14159
14160 2009-07-24 Chris Demetriou <cgd@google.com>
14161
14162 * layout.cc (is_compressible_debug_section): Fix incorrect
14163 comment about compressed section names.
14164
14165 2009-07-20 Ian Lance Taylor <ian@airs.com>
14166
14167 PR 10419
14168 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14169
14170 2009-07-16 Ian Lance Taylor <iant@google.com>
14171
14172 PR 10400
14173 * layout.h: #include <map>.
14174 (class Kept_section): Change from struct to class. Add accessors
14175 and setters. Add section size to Comdat_group mapping. Change
14176 Comdat_group to std::map. Add is_comdat_ field. Add
14177 linkonce_size field in union.
14178 (class Layout): Update declaration of find_or_add_kept_section.
14179 Don't declare find_kept_object.
14180 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14181 parameter. Add object, shndx, is_comdat, and is_group_name
14182 parameters. Change all callers. Adjust for new Kept_section.
14183 (Layout::find_kept_object): Remove.
14184 * object.cc (Sized_relobj::include_section_group): Update use of
14185 Kept_section. Rename secnum to shndx. Only record
14186 Kept_comdat_section if sections are the same size.
14187 (Sized_relobj::include_linkonce_section): Update use of
14188 Kept_section. Only record Kept_comdat_section if sections are the
14189 same size. Set size of linkonce section.
14190 (Sized_relobj::map_to_kept_section): Update call to
14191 get_kept_comdat_section.
14192 * object.h (class Sized_relobj): Rename fields in
14193 Kept_comdat_section to drop trailing underscores; change object
14194 field to Relobj*. Change Kept_comdat_section_table to store
14195 struct rather than pointer.
14196 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14197 Add kept_object and kept_shndx parameters. Change all callers.
14198 (Sized_relobj::get_kept_comdat_section): Change return type to
14199 bool. Add kept_object and kept_shndx parameters. Change all
14200 callers.
14201 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14202 Layout::find_or_add_kept_section.
14203
14204 2009-07-09 Ian Lance Taylor <iant@google.com>
14205
14206 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14207 Reserve space in the hash table.
14208
14209 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14210
14211 * fileread.cc (File_read::get_mtime): New method.
14212 * fileread.h (Timespec): New structure.
14213 (File_read::get_mtime): New method.
14214 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14215 Renamed from timestamp_nsec.
14216 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14217 Elf_Xword.
14218 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14219 timestamp_nsec.
14220 (Incremental_inputs::report_archive): Save mtime; style fix.
14221 (Incremental_inputs::report_obejct): Save mtime; style fix.
14222 (Incremental_inputs::report_script): Save mtime; style fix.
14223 (Incremental_inputs::finalize_inputs): Style fix.
14224 (Incremental_inputs::finalize): Style fix.
14225 (Incremental_inputs::create_input_section_data): Store inputs
14226 mtime.
14227 * incremental.h (Incremental_inputs::report_script): Add mtime
14228 argument.
14229 (Incremental_inputs::Input_info::Input_info): Intialize only one
14230 union member.
14231 (Incremental_inputs::Input_info::archive): Move to nameless
14232 union.
14233 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14234 (Incremental_inputs::Input_info::script): Move to nameless union.
14235 (Incremental_inputs::mtime): New field.
14236 * script.cc (read_input_script): Pass file mtime to
14237 Incremental_input.
14238 * script.h (Script_info::inputs): Style fix.
14239
14240 2009-07-01 Ian Lance Taylor <ian@airs.com>
14241
14242 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14243 instead of 32.
14244
14245 2009-06-24 Ian Lance Taylor <iant@google.com>
14246
14247 PR 10156
14248 * layout.cc (Layout::choose_output_section): If we find an
14249 existing section, update the flags.
14250 (Layout::create_notes): New function, broken out of
14251 Layout::finalize.
14252 (Layout::finalize): Don't create note sections.
14253 (Layout::create_note): Don't crash if linker script discards
14254 section.
14255 (Layout::create_gold_note): Likewise.
14256 (Layout::create_build_id): Likewise. Don't set
14257 after_input_sections on the section.
14258 (Layout::create_executable_stack_info): Remove target parameter.
14259 Change caller.
14260 * layout.h (class Layout): Declare create_notes. Update
14261 declaration of create_executable_stack_info.
14262 * gold.cc (queue_middle_tasks): Call create_notes.
14263 * output.cc (Output_section::update_flags_for_input_section): Move
14264 here from output.h. If SHF_ALLOC flag is newly set, mark address
14265 invalid.
14266 * output.h (Output_data::mark_address_invalid): New function.
14267 (class Output_section): Only declare, not define,
14268 update_flags_for_input_section. Remove set_flags.
14269
14270 2009-06-24 Ian Lance Taylor <iant@google.com>
14271
14272 * script-sections.cc (Output_section_definition::
14273 set_section_addresses): Rename shadowing local load_address to
14274 laddr.
14275
14276 2009-06-24 Ian Lance Taylor <iant@google.com>
14277
14278 PR 10244
14279 * reloc.cc (relocate_sections): Skip empty relocation sections.
14280
14281 2009-06-23 Ian Lance Taylor <iant@google.com>
14282
14283 PR 10156
14284 * layout.cc (Layout::create_note): Use choose_output_section
14285 rather than make_output_section.
14286
14287 2009-06-23 Ian Lance Taylor <iant@google.com>
14288
14289 PR 10237
14290 * options.cc (General_options::parse_V): Set printed_version_.
14291 (General_options::General_options): Initialize printed_version_.
14292 * options.h (class General_options): Add printed_version_ field.
14293 * gold.cc (queue_initial_tasks): If there are no input files,
14294 don't give a fatal error if we printed the version information.
14295 (queue_middle_tasks): If using -r with a shared object, give a
14296 fatal error rather than an ordinary error.
14297
14298 2009-06-23 Ian Lance Taylor <iant@google.com>
14299
14300 PR 10219
14301 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14302 (Layout::make_output_section): Set have_stabstr_section_ if we see
14303 a .stab*str section.
14304 (Layout::finalize): Call link_stabs_sections.
14305 (Layout::link_stabs_sections): New file.
14306 * layout.h (class Layout): Add have_stabstr_section_ field.
14307 Declare link_stabs_sections.
14308
14309 2009-06-23 Doug Kwan <dougkwan@google.com>
14310
14311 * Makefile.am (libgold_a_LIBADD): New.
14312 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14313 * Makefile.in: Regenerate.
14314 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14315 * configure: Regenerate.
14316 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14317 * fileread.cc: Include sys/state.h
14318 * gold.h: Declare memmem and strndup if found missing.
14319 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14320
14321 2009-06-23 Ian Lance Taylor <iant@google.com>
14322
14323 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14324 * configure: Rebuild.
14325
14326 2009-06-23 Ian Lance Taylor <iant@google.com>
14327
14328 PR 10147
14329 * object.cc (Object::section_contents): Don't try to get a view if
14330 the section has length zero.
14331 (Object::handle_gnu_warning_section): If the section is empty, use
14332 the name of the section as the warning.
14333
14334 2009-06-23 Ian Lance Taylor <iant@google.com>
14335
14336 PR 10133
14337 * stringpool.h (class Stringpool_template): Add optimize_ field.
14338 (Stringpool_template::set_optimize): New function.
14339 * stringpool.cc (Stringpool_template::Stringpool_template):
14340 Initialize optimize_ field.
14341 (Stringpool_template::set_string_offsets): Test local optimize
14342 fild rather than parameter.
14343 * layout.cc (Layout::Layout): Call set_optimize on the section
14344 name stringpool.
14345
14346 2009-06-22 Ian Lance Taylor <iant@google.com>
14347
14348 PR 10030
14349 * yyscript.y: Parse TARGET.
14350 * script.cc (script_set_target): New function.
14351 * script-c.h (script_set_target): Declare.
14352 * options.cc (General_options::string_to_object_format): Rename
14353 from string_to_object_format in anonymous namespace. Change
14354 callers.
14355 * options.h (class General_options): Declare
14356 string_to_object_format.
14357
14358 2009-06-22 Ian Lance Taylor <iant@google.com>
14359
14360 * script-sections.cc (Script_sections::create_segments): Don't put
14361 program headers in a PT_LOAD segment if -n or -N.
14362
14363 2009-06-22 Ian Lance Taylor <iant@google.com>
14364
14365 PR 10141
14366 * options.h (class General_options): Add -z lazy and -z now. Sort
14367 -z options into alphabetical order.
14368 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14369
14370 2009-06-21 Ian Lance Taylor <iant@google.com>
14371
14372 * layout.cc (Layout::make_output_section): Call
14373 Target::new_output_section.
14374 (Layout::attach_allocated_section_to_segment): Put large section
14375 sections in a separate load segment with the large segment flag
14376 set.
14377 (Layout::segment_precedes): Sort large data segments after other
14378 load segments.
14379 (align_file_offset): New static function.
14380 (Layout::set_segment_offsets): Use align_file_offset.
14381 * output.h (class Output_section): Add is_small_section_ and
14382 is_large_section_ fields.
14383 (Output_section::is_small_section): New function.
14384 (Output_section::set_is_small_section): New function.
14385 (Output_section::is_large_section): New function.
14386 (Output_section::set_is_large_section): New function.
14387 (Output_section::is_large_data_section): New function.
14388 (class Output_segment): Add is_large_data_segment_ field.
14389 (Output_segment::is_large_data_segment): New function.
14390 (Output_segment::set_is_large_data_segment): New function.
14391 * output.cc (Output_section::Output_section): Initialize new
14392 fields.
14393 (Output_segment::Output_segment): Likewise.
14394 (Output_segment::add_output_section): Add assertion that large
14395 data sections always go in large data segments. Force small data
14396 sections to the end of the list of data sections. Force small BSS
14397 sections to the start of the list of BSS sections. For large BSS
14398 sections to the end of the list of BSS sections.
14399 * symtab.h (class Symbol): Declare is_common_shndx.
14400 (Symbol::is_defined): Check Symbol::is_common_shndx.
14401 (Symbol::is_common): Likewise.
14402 (class Symbol_table): Define enum Commons_section_type. Update
14403 declarations. Add small_commons_ and large_commons_ fields.
14404 * symtab.cc (Symbol::is_common_shndx): New function.
14405 (Symbol_table::Symbol_table): Initialize new fields.
14406 (Symbol_table::add_from_object): Put small and large common
14407 symbols in the right list.
14408 (Symbol_table::sized_finalized_symbol): Check
14409 Symbol::is_common_shndx.
14410 (Symbol_table::sized_write_globals): Likewise.
14411 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14412 common symbol lists. Don't call do_allocate_commons_list if the
14413 list is empty.
14414 (Symbol_table::do_allocate_commons_list): Remove is_tls
14415 parameter. Add comons_section_type parameter. Change all
14416 callers. Handle small and large common symbols.
14417 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14418 Symbol::is_common_shndx.
14419 * resolve.cc (symbol_to_bits): Likewise.
14420 * target.h (Target::small_common_shndx): New function.
14421 (Target::small_common_section_flags): New function.
14422 (Target::large_common_shndx): New function.
14423 (Target::large_common_section_flags): New function.
14424 (Target::new_output_section): New function.
14425 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14426 small_common_section_flags, and large_common_section_flags
14427 fields.
14428 (Target::do_new_output_section): New virtual function.
14429 * arm.cc (Target_arm::arm_info): Initialize new fields.
14430 * i386.cc (Target_i386::i386_info): Likewise.
14431 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14432 Likewise.
14433 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14434 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14435 (Target_x86_64::do_new_output_section): New function.
14436 * configure.ac: Define conditional MCMODEL_MEDIUM.
14437 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14438 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14439 (large_LDFLAGS): Define.
14440 * testsuite/large.c: New file.
14441 * testsuite/testfile.cc (Target_test::test_target_info):
14442 Initialize new fields.
14443 * configure, testsuite/Makefile.in: Rebuild.
14444
14445 2009-06-05 Doug Kwan <dougkwan@google.com>
14446
14447 * Makefile.am (CCFILES): Add target.cc.
14448 * Makefile.in: Regenerate.
14449 * i386.cc (class Target_i386): Define new virtual method to
14450 override do_is_local_label_name in parent.
14451 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14452 local symbols if --discard-locals or -X is given.
14453 * options.h (class General_options): Declare new options
14454 '--discard-locals' and '-X' for discarding locals.
14455 * target.h (class Target): Define new methods is_local_label_name.
14456 Declare new virtual method do_is_local_label_name.
14457 * target.cc: New file.
14458 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14459 (check_SCRIPTS): Add discard_locals_test.sh.
14460 (check_DATA): Add discard_local_tests.syms.
14461 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14462 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14463 * testsuite/Makefile.in: Regenerate.
14464 * testsuite/discard_locals_test.c: New file.
14465 * testsuite/discard_locals_test.sh: Same.
14466
14467 2009-06-05 Doug Kwan <dougkwan@google.com>
14468
14469 * object.cc (Sized_relobj::Sized_relobj): Initialize
14470 discarded_eh_frame_shndx_ to -1U.
14471 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14472 section.
14473 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14474 a discarded .eh_frame section.
14475 (Sized_relobj::do_finalize_local_symbols): Ditto.
14476 * object.h (class Sized_relobj): Declare new member
14477 discarded_eh_frame_shndx_.
14478 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14479 (local_labels_test.o, local_labels_test): New rules.
14480 * testsuite/Makefile.in: Regenerate.
14481
14482 2009-06-04 Doug Kwan <dougkwan@google.com>
14483
14484 * layout.cc (Layout::section_name_mapping): Add mapping for
14485 special ARM sections.
14486
14487 2009-06-03 Doug Kwan <dougkwan@google.com>
14488
14489 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14490 (utils::has_overflow): Same.
14491
14492 2009-06-03 Ian Lance Taylor <iant@google.com>
14493
14494 * layout.cc (Layout::section_name_mapping): New array, replacing
14495 Layout::linkonce_mapping.
14496 (Layout::section_name_mapping_count): New variable, replacing
14497 Layout::linkonce_mapping_count.
14498 (Layout::linkonce_output_name): Remove.
14499 (Layout::output_section_name): Rewrite.
14500 * layout.h (class Layout): Rename Linkonce_mapping to
14501 Section_name_mapping, linkonce_mapping to section_name_mapping,
14502 linkonce_mapping_count to section_name_mapping_count. Don't
14503 declare linkonce_output_name.
14504
14505 2009-06-03 Doug Kwan <dougkwan@google.com>
14506
14507 * gold/arm.cc (namespace utils): New.
14508 (Target_arm::reloc_is_non_pic): Define new method.
14509 (class Arm_relocate_functions): New.
14510 (Target_arm::Relocate::relocate): Handle relocation types used by
14511 Android.
14512
14513 2009-06-03 Ian Lance Taylor <iant@google.com>
14514
14515 * arm.cc (Target_arm::scan::global): Use || instead of |.
14516
14517 2009-06-02 Doug Kwan <dougkwan@google.com>
14518
14519 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14520 issued_non_pic_error_.
14521 (class Target_arm::Scan): Declare new method check_non_pic.
14522 Define new method symbol_needs_plt_entry.
14523 Declare new data member issued_non_pic_error_.
14524 (class Target_arm::Relocate): Declare new method
14525 should_apply_static_reloc.
14526 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14527 (Target_arm::Scan::check_non_pic): Define new method.
14528 (Target_arm::Scan::local): Handle a small subset of reloc types used
14529 by Android.
14530 (Target_arm::Scan::local): Same.
14531 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14532
14533 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14534
14535 * incremental.cc (Incremental_inputs::report_command_line): Filter
14536 out --incremental-* options.
14537
14538 2009-05-29 Doug Kwan <dougkwan@google.com>
14539
14540 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14541 template class.
14542 (class Target_arm): Update comment.
14543 (Target_arm::Target_arm): Initialize new data members GOT_,
14544 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14545 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14546 and Target_arm::rel_dyn_section.
14547 Declare new_enum Target_arm::Got_type.
14548 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14549 and DYNBSS_.
14550 Update commments for member do_dynsym_value.
14551 (Target_arm::got_size, Target_arm::plt_section,
14552 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14553 new methods inside class defintion.
14554 (Target_arm::got_section): Define new method.
14555 (Target_arm::rel_dyn_section): Same.
14556 (Output_data_plt_arm): New template class.
14557 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14558 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14559 (Output_data_plt_arm::add_entry): Same.
14560 (Output_data_plt_arm::first_plt_entry): Define new
14561 static data member for PLT instruction template.
14562 (Output_data_plt_arm::plt_entry): Same.
14563 (Output_data_plt_arm::do_write): Define new method.
14564 (Target_arm::make_plt_entry): Same.
14565 (Target_arm::do_finalize_sections): Same.
14566 (Target_arm::do_dynsym_value): Same.
14567
14568 2009-05-28 Doug Kwan <dougkwan@google.com>
14569
14570 * Makefile.am (TARGETSOURCES): Add arm.cc.
14571 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14572 * Makefile.in: Regenerate.
14573 * arm.cc: New file.
14574 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14575
14576 2009-05-26 Doug Kwan <dougkwan@google.com>
14577
14578 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14579 (General_options::check_excluded_libs): Strip off directories in
14580 archive name before matching like GNU ld does.
14581 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14582 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14583 (exclude_libs_test_LDFLAGS): Add linker option
14584 -Wl,--exclude-libs,libexclude_libs_test_3
14585 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14586 an explicit archive without using -l.
14587 (alt/libexclude_libs_test_3.a): New make rule.
14588 * testsuite/Makefile.in: Regenerate.
14589 * testsuite/exclude_libs_test.c : Declare lib3_default().
14590 (main): Call it.
14591 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14592 * exclude_libs_test_3.c: New file.
14593
14594 2009-05-26 Nick Clifton <nickc@redhat.com>
14595
14596 * po/id.po: New Indonesian translation.
14597 * po/gold.pot: Updated template file.
14598
14599 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14600
14601 * testsuite/Makefile.am: Add -ffunction-sections to compile
14602 gc_comdat_test files. Add -Wl,--gc-sections to build
14603 gc_comdat_test.
14604 * testsuite/Makefile.in: Regenerate.
14605 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14606
14607 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14608
14609 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14610 kept comdat section was garbage collected.
14611 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14612 * testsuite/Makefile.in: Regenerate.
14613 * testsuite/gc_comdat_test.sh: New file.
14614 * testsuite/gc_comdat_test_1.cc: New file.
14615 * testsuite/gc_comdat_test_2.cc: New file.
14616
14617 2009-05-19 Doug Kwan <dougkwan@google.com>
14618
14619 * archive.cc (Archive::Archive): Move constructor from archive.h
14620 to here. Initialize no_export_.
14621 (Archive::get_elf_object_for_member): Set no_export flag of object.
14622 * archive.h (Archive::Archive): Move constructor body to
14623 archive.cc.
14624 (Archive::no_export): New method.
14625 (Archive::no_export_): New field.
14626 * object.h (Object::Object): Initialize no_export_ to false.
14627 (Object::no_export, Object::set_no_export): New methods.
14628 (Object::no_export_): New field.
14629 * options.cc (General_options::parse_exclude_libs): New method.
14630 (General_options::check_excluded_libs) Same.
14631 * options.h (exclude_libs): New option.
14632 (General_options::check_excluded_libs): New method declaration.
14633 (General_options::excluded_libs_): New field.
14634 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14635 default or protected visibility if an object has no-export flag set.
14636 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14637 (check_SCRIPTS): Add exclude_libs_test.sh.
14638 (check_DATA): Add exclude_libs_test.syms.
14639 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14640 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14641 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14642 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14643 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14644 libexclude_libs_test_2.a): New rules.
14645 * testsuite/Makefile.in: Regenerate.
14646 * testsuite/exclude_libs_test.c: New file.
14647 * testsuite/exclude_libs_test.sh: Ditto.
14648 * testsuite/exclude_libs_test_1.c: Ditto.
14649 * testsuite/exclude_libs_test_2.c: Ditto.
14650
14651 2009-05-15 Ian Lance Taylor <iant@google.com>
14652
14653 * configure.ac: Check for declarations for cases where libiberty.h
14654 checks HAVE_DECL_xxx.
14655 * configure, config.in: Rebuild.
14656
14657 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14658
14659 * gold.h (Incremental_argument_list): Remove (invalid) forward
14660 declaration.
14661 * incremental.cc (Incremental_inputs::report_achive): New method.
14662 (Incremental_inputs::report_object): New method.
14663 (Incremental_inputs::report_script): New method.
14664 (Incremental_inputs::finalize_inputs): New method.
14665 (Incremental_inputs::finalize): Call finalize_inputs().
14666 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14667 Create inputs entries.
14668 * incremental.h (Incremental_input_type): New enum.
14669 (Incremental_inputs::Incremental_input): Initialize new fields.
14670 (Incremental_inputs::report_inputs): New method.
14671 (Incremental_inputs::report_achive): New method.
14672 (Incremental_inputs::report_object): New method.
14673 (Incremental_inputs::report_script): New method.
14674 (Incremental_inputs::finalize_inputs): New method.
14675 (Incremental_inputs::Input_info): New struct.
14676 (Incremental_inputs::Input_info_map): New typedef.
14677 (Incremental_inputs::lock_): New field.
14678 (Incremental_inputs::Inputs_): New field.
14679 (Incremental_inputs::Inputs_map): New field.
14680 * main.cc (main): Call Incremental_input::report_inputs.
14681 * options.h (Input_argument_list): Typedef moved from
14682 Input_arguments.
14683 (Input_file_group::Files): Remove, use ::Input_argument_list.
14684 (Input_file_group::Input_argument_list): Remove, use
14685 ::Input_argument_list.
14686 * plugin.cc (Plugin_manager::add_input_file): Add error in
14687 incremental build.
14688 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14689 functions.
14690 * script.cc (read_input_script): Call
14691 Incremental_input::report_script.
14692 * script.h (Script_info): New class.
14693
14694 2009-04-27 Ian Lance Taylor <iant@google.com>
14695
14696 * x86_64.cc (do_adjust_output_section): Set entsize to
14697 plt_entry_size.
14698
14699 2009-04-23 Elliott Hughes <enh@google.com>
14700
14701 * output.cc (Output_file::close): After short writes, continue
14702 writing from the correct offset in the buffer being written.
14703
14704 2009-04-23 Chris Demetriou <cgd@google.com>
14705
14706 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14707 * configure: Regenerate.
14708 * config.in: Regenerate.
14709 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14710 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14711
14712 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14713
14714 * incremental.cc (Incremental_inputs_header_data): Renamed from
14715 Incremental_input_header_data.
14716 (Incremental_inputs_header_data::data_size): New field.
14717 (Incremental_inputs_header_data::put_input_file_count): Renamed
14718 from input_file_count.
14719 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14720 from command_line_offset.
14721 (Incremental_inputs_header_data::put_reserved): Renamed from
14722 put_reserved.
14723 (Incremental_inputs_entry_data): Renamed from
14724 Incremental_input_entry_data.
14725 (Incremental_inputs_entry_data::data_size): New field.
14726 (Incremental_inputs::report_command_line): New method.
14727 (Incremental_inputs::finalize): New method.
14728 (Incremental_inputs::create_incremental_inputs_data): New method.
14729 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14730 * incremental.h: New file.
14731 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14732 (Layout::finalize): Create incremental inputs section in
14733 incremental builds.
14734 (Layout::create_incremental_info_sections): New method.
14735 * layout.h (Layout::incremental_inputs): New method.
14736 (Layout::create_incremental_info_sections): New method.
14737 (Layout::incremental_inputs_): New field.
14738 * main.cc (main): Notify Incremental_input of the command line.
14739
14740 2009-04-01 Ian Lance Taylor <iant@google.com>
14741 Mikolaj Zalewski <mikolajz@google.com>
14742
14743 * gold.h (reserve_unordered_map): Define, three versions, one for
14744 each version of Unordered_map.
14745 * layout.cc (Layout::Layout): Remove options parameter. Add
14746 number_of_input_files parameter. Don't initialize options_.
14747 Initialize number_of_input_files_ and resized_signatures_. Move
14748 sections_are_attached_.
14749 (Layout::layout_group): Reserve space for group_signatures_.
14750 (Layout::find_or_add_kept_section): Change name parameter to be a
14751 reference. Resize signatures_ map when it gets large enough.
14752 (Layout::layout_eh_frame): Use parameters->options() instead of
14753 this->options_.
14754 (Layout::make_output_section): Likewise.
14755 (Layout::attach_allocated_section_to_segment): Likewise.
14756 (Layout::finalize, Layout::create_executable_stack): Likewise.
14757 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14758 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14759 * layout.h (class Layout): Update declarations. Remove options_
14760 field. Add number_of_input_files_ and resized_signatures_
14761 fields. Move sections_are_attached_ field.
14762 * main.cc (main): Pass number of input files to Layout
14763 constructor. Don't pass options.
14764
14765 2009-03-30 Ian Lance Taylor <iant@google.com>
14766
14767 * ffsll.c (ffsll): Correct implementation.
14768
14769 2009-03-27 Ian Lance Taylor <iant@google.com>
14770
14771 * ffsll.c: New file.
14772 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14773 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14774 * ftruncate.c (ftruncate): Declare before definition.
14775 * mremap.c (mremap): Likewise.
14776 * pread.c (pread): Likewise.
14777 * configure, Makefile.in, config.in: Rebuild.
14778
14779 * mremap.c: New file.
14780 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14781 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14782 (mremap): Declare if HAVE_MREMAP is not defined.
14783 * configure, Makefile.in, config.in: Rebuild.
14784
14785 2009-03-27 Cary Coutant <ccoutant@google.com>
14786
14787 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14788 position independent.
14789 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14790 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14791
14792 2009-03-24 Cary Coutant <ccoutant@google.com>
14793
14794 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14795 an executable.
14796 (needs_dynamic_reloc): Likewise.
14797
14798 2009-03-24 Ian Lance Taylor <iant@google.com>
14799
14800 * yyscript.y (file_cmd): Recognize EXTERN.
14801 (extern_name_list, extern_name_list_body): New nonterminals.
14802 * script.cc (script_add_extern): Define.
14803 * script-c.h (script_add_extern): Declare.
14804
14805 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14806
14807 * object.cc (is_elf_object): Define.
14808 * object.h (is_elf_object): Declare.
14809 * archive.cc (Archive::get_elf_object_for_member): Call
14810 is_elf_object.
14811 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14812
14813 2009-03-24 Elliott Hughes <enh@google.com>
14814
14815 * output.cc (Output_file::map_anonymous): Define.
14816 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14817 try an anonymous one. Report the size if the mmap fails.
14818 * output.h (class Output_file): Declare map_anonymous.
14819
14820 2009-03-24 Ian Lance Taylor <iant@google.com>
14821
14822 * target-select.cc (instantiate_target): Don't acquire the lock if
14823 the instantiated_target_ field has already been set.
14824
14825 2009-03-23 Ian Lance Taylor <iant@google.com>
14826
14827 * gold-threads.h (class Initialize_lock): Define.
14828 * gold-threads.cc (class Initialize_lock_once): Define.
14829 (initialize_lock_control): New static variable.
14830 (initialize_lock_pointer): New static variable.
14831 (initialize_lock_once): New static function.
14832 (Initialize_lock::Initialize_lock): Define.
14833 (Initialize_lock::initialize): Define.
14834 * target-select.h: Include "gold-threads.h".
14835 (class Target_selector): Add lock_ and initialize_lock_ fields.
14836 Don't define instantiate_target, just declare it.
14837 * target-select.cc (Target_selector::Target_selector): Initialize
14838 new fields.
14839 (Target_selector::instantiate_target): Define.
14840 * descriptors.h: Include "gold-threads.h".
14841 (class Descriptors): Add initialize_lock_ field.
14842 * descriptors.cc (Descriptors::Descriptors): Initialize new
14843 field.
14844 (Descriptors::open): Use initialize_lock_ field
14845 * errors.h (class Errors): Add initialize_lock_ field.
14846 * errors.cc (Errors::Errors): Initialize new field.
14847 (Errors::initialize_lock): Use initialize_lock_ field.
14848 * powerpc.cc (class Target_selector_powerpc): Remove
14849 instantiated_target_ field. In do_recognize call
14850 instantiate_target rather than do_instantiate_target. In
14851 do_instantiate_target just allocate a new target.
14852 * sparc.cc (class Target_selector_sparc): Likewise.
14853
14854 * freebsd.h: New file.
14855 * i386.cc: Include "freebsd.h".
14856 (Target_i386): Derive from Target_freebsd rather than
14857 Sized_target.
14858 (Target_selector_i386): Derive from Target_selector_freebsd rather
14859 than Target_selector.
14860 * x86_64.cc: Include "freebsd.h".
14861 (Target_x86_64): Derive from Target_freebsd rather than
14862 Sized_target.
14863 (Target_selector_x86_64): Derive from Target_selector_freebsd
14864 rather than Target_selector.
14865 * target.h (class Target): Add adjust_elf_header and
14866 do_adjust_elf_header.
14867 * output.cc (Output_file_header:: do_sized_write): Call target
14868 adjust_elf_header routine.
14869 * configure.tgt: Set targ_osabi.
14870 * configure.ac: Define GOLD_DEFAULT_OSABI.
14871 * parameters.cc (Parameters::default_target): Pass
14872 GOLD_DEFAULT_OSABI to select_target.
14873 * target-select.h (class Target_selector): Make instantiate_target
14874 protected rather than private.
14875 * Makefile.am (HFILES): Add freebsd.h.
14876 * configure, Makefile.in, config.in: Rebuild.
14877
14878 * merge.cc (do_add_input_section): Correct pend value. Change
14879 message about last entry not being null terminated from error to
14880 warning.
14881
14882 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14883
14884 * incremental.cc: New file.
14885 * Makefile.am (CCFILES): Add incremental.cc.
14886 * Makefile.in: Rebuild.
14887
14888 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14889
14890 * layout.cc (Layout::output_section_name): Preserve names
14891 of '.note.' sections.
14892
14893 2009-03-19 Ian Lance Taylor <iant@google.com>
14894
14895 * descriptors.cc (Descriptors::open): Check that the options are
14896 valid before using them.
14897
14898 2009-03-18 Ian Lance Taylor <iant@google.com>
14899
14900 * script-sections.h: Include <list>.
14901 (class Script_sections): Change Sections_elements from std::vector
14902 to std::list. Typedef public Elements_iterator. Add
14903 orphan_section_placement_, data_segment_align_start_, and
14904 saw_data_segment_align_ fields. Remove data_segment_align_index_
14905 field.
14906 * script-sections.cc (class Orphan_section_placement): New class.
14907 (class Sections_element): Add virtual functions is_relro and
14908 orphan_section_init. Remove virtual function place_orphan_here.
14909 (class Output_section_definition): Add is_relro and
14910 orphan_section_init. Remove place_orphan_here.
14911 (class Orphan_output_section): Likewise.
14912 (Script_sections::Script_sections): Update for field changes.
14913 (Script_sections::data_segment_align): Set saw_data_segment_align_
14914 and data_segment_align_start_, not data_segment_align_index.
14915 (Script_sections::data_segment_relro_end): Check
14916 saw_data_segment_align_. Use data_segment_align_start_ rather
14917 than data_segment_align_index_.
14918 (Script_sections::place_orphan): Rewrite to use
14919 Orphan_section_placement.
14920
14921 2009-03-17 Ian Lance Taylor <iant@google.com>
14922
14923 * archive.cc (Archive::add_symbols): Check for a version attached
14924 to the symbol name in the archive map.
14925 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14926 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14927 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14928 (ver_test_11.a): New target.
14929 * testsuite/Makefile.in: Rebuild.
14930
14931 * configure.ac: Check for chsize and posix_fallocate. Replace
14932 ftruncate.
14933 * ftruncate.c: New file, from gnulib.
14934 * output.cc (posix_fallocate): Define dummy version if not
14935 HAVE_POSIX_FALLOCATE.
14936 (Output_file::map): Call posix_fallocate rather than lseek and
14937 write.
14938 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14939 * configure, Makefile.in, config.in: Rebuild.
14940
14941 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
14942
14943 * layout.h (Layout::create_note): Add section_name parameter.
14944 * layout.cc (Layout::create_note): Likewise.
14945 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
14946
14947 2009-03-17 Ian Lance Taylor <iant@google.com>
14948
14949 * descriptors.cc: Include "options.h".
14950 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14951 (Descriptors::open): Always use O_CLOEXEC when opening a new
14952 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14953 then set FD_CLOEXEC.
14954
14955 * sparc.cc (class Target_sparc): Add has_got_section.
14956 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14957 make sure we have a GOT section.
14958
14959 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14960 (Target_sparc::Scan::local): Likewise.
14961 (Target_sparc::Scan::global): Likewise.
14962 (Target_sparc::Relocate::relocate): Likewise.
14963 (Target_sparc::Relocate::relocate_tls): Likewise.
14964
14965 * symtab.cc (Symbol_table::define_default_version): New function,
14966 broken out of add_from_object.
14967 (Symbol_table::add_from_object): Call define_default_version.
14968 (Symbol_table::define_special_symbol): Add resolve_oldsym
14969 parameter. Change all callers. If the version for a symbol comes
14970 from a version script, resolve it with the symbol with the same
14971 name with no version. Also add the symbol without a version if
14972 appropriate.
14973 (do_define_in_output_data): If resolving with oldsym, don't delete
14974 sym.
14975 (do_define_in_output_segment): Likewise.
14976 (do_define_as_constant): Likewise.
14977 * symtab.h (class Symbol_table): Update declarations.
14978
14979 2009-03-13 Ian Lance Taylor <iant@google.com>
14980
14981 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14982 (Read_symbols::requeue): New function.
14983 (Read_symbols::do_read_symbols): If make_elf_object fails because
14984 the target type is not configured, and the file was searched for,
14985 issue a warning and retry with the next directory.
14986 (Add_symbols::run): If the file has an incompatible format, and
14987 it was searched for, requeue the Read_symbols task. On error,
14988 release the object.
14989 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14990 dirindex parameter to constructor. Change all callers. Declare
14991 incompatible_warning and requeue.
14992 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14993 input_argument_ and input_group_ fields. Add them to
14994 constructor. Change all callers.
14995 (class Read_script): Add dirindex_ field. Add it to constructor.
14996 Change all callers.
14997 * archive.cc (Archive::setup): Remove input_objects parameter.
14998 Change all callers.
14999 (Archive::get_file_and_offset): Likewise.
15000 (Archive::read_all_symbols): Likewise.
15001 (Archive::read_symbols): Likewise.
15002 (Archive::get_elf_object_for_member): Remove input_objects
15003 parameter. Add punconfigured parameter. Change all callers.
15004 (Archive::add_symbols): Change return type to bool. Check return
15005 value of include_member.
15006 (Archive::include_all_members): Likewise.
15007 (Archive::include_member): Change return type to bool. Return
15008 false if first included object has incompatible target. Set
15009 included_member_ field.
15010 (Add_archive_symbols::run): If add_symbols returns false, requeue
15011 Read_symbols task.
15012 * archive.h (class Archive): Add included_member_ field.
15013 Initialize it in constructor. Add input_file and searched_for
15014 methods. Update declarations.
15015 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15016 input_argument_ fields. Add them to constructor. Change all
15017 callers.
15018 * script.cc: Include "target-select.h".
15019 (class Parser_closure): Add skip_on_incompatible_target_ and
15020 found_incompatible_target_ fields. Add
15021 skip_on_incompatible_target parameter to constructor. Change all
15022 callers. Add methods skip_on_incompatible_target,
15023 clear_skip_on_incompatible_target, found_incompatible_target, and
15024 set_found_incompatible_target.
15025 (read_input_script): Add dirindex parameter. Change all callers.
15026 If parser finds an incompatible target, requeue Read_symbols
15027 task.
15028 (script_set_symbol): Clear skip_on_incompatible_target in
15029 closure.
15030 (script_add_assertion, script_parse_option): Likewise.
15031 (script_start_sections, script_add_phdr): Likewise.
15032 (script_check_output_format): New function.
15033 * script.h (read_input_script): Update declaration.
15034 * script-c.h (script_check_output_format): Declare.
15035 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15036 (ignore_cmd): Remove OUTPUT_FORMAT.
15037 * fileread.cc (Input_file::Input_file): Add explicit this.
15038 (Input_file::will_search_for): New function.
15039 (Input_file::open): Add pindex parameter. Change all callers.
15040 * fileread.h (class Input_file): Add input_file_argument method.
15041 Declare will_search_for. Update declarations.
15042 * object.cc (make_elf_object): Add punconfigured parameter.
15043 Change all callers.
15044 * object.h (class Object): Make input_file public. Add
15045 searched_for method.
15046 (make_elf_object): Update declaration.
15047 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15048 restart search.
15049 * dirsearch.h (class Dirsearch): Update declaration.
15050 * options.h (class General_options): Add --warn-search-mismatch.
15051 * parameters.cc (Parameters::is_compatible_target): New function.
15052 * parameters.h (class Parameters): Declare is_compatible_target.
15053 * workqueue.cc (Workqueue::add_blocker): New function.
15054 * workqueue.h (class Workqueue): Declare add_blocker.
15055
15056 * fileread.cc (Input_file::open): Remove options parameter.
15057 Change all callers.
15058 (Input_file::open_binary): Likewise.
15059 * script.cc (read_input_script): Likewise.
15060 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15061 options parameter from constructor. Change all callers.
15062 (class Read_script): Likewise.
15063 * fileread.h (class Input_file): Update declarations.
15064 * script.h (read_input_script): Update declaration.
15065
15066 2009-03-10 Nick Clifton <nickc@redhat.com>
15067
15068 * po/es.po: New Spanish translation.
15069
15070 2009-03-06 Cary Coutant <ccoutant@google.com>
15071
15072 * options.cc (parse_short_option): Keep dash_z from registering itself.
15073
15074 2009-03-03 Ian Lance Taylor <iant@google.com>
15075
15076 PR 9918
15077 * target-reloc.h (relocate_section): Pass output_section to
15078 relocate.
15079 * i386.cc (Target_i386::should_apply_static_reloc): Add
15080 output_section parameter. Change all callers.
15081 (Target_i386::Relocate::relocate): Add output_section parameter.
15082 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15083 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15084 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15085 * testsuite/two_file_shared.sh: New script.
15086 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15087 (check_DATA): Add two_file_shared.dbg.
15088 (two_file_shared.dbg): New target.
15089 * testsuite/Makefile.in: Rebuild.
15090
15091 2009-03-01 Ian Lance Taylor <iant@google.com>
15092
15093 * configure.ac: Check for byteswap.h.
15094 * configure: Rebuild.
15095 * config.in: Rebuild.
15096
15097 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15098
15099 * layout.cc (Layout::find_or_add_kept_section): New function.
15100 (Layout::add_comdat): Removed.
15101 * layout.h (struct Kept_section): Move out of class Layout.
15102 Remove trailing underscores from field names. Add group_sections
15103 field. Rename group_ field to is_group. Change all uses.
15104 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15105 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15106 comdat_groups_ field.
15107 (Sized_relobj::include_section_group): Use
15108 find_or_add_kept_section and Kept_section::group_sections.
15109 (Sized_relobj::include_linkonce_section): Likewise.
15110 * object.cc (class Sized_relobj): Don't define Comdat_group or
15111 Comdat_group_table. Remove find_comdat_group and
15112 add_comdat_group. Remove comdat_groups_ field.
15113 * plugin.cc (include_comdat_group): Use
15114 Layout::find_or_add_kept_section.
15115
15116 2009-02-28 Ian Lance Taylor <iant@google.com>
15117
15118 * README: --gc-sections and map files are now supported. Document
15119 some build requirements.
15120
15121 PR 6992
15122 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15123 relocatable link set the value of the section symbol to zero.
15124 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15125 relocatable link don't include the section address in the local
15126 symbol value.
15127
15128 2009-02-27 Ian Lance Taylor <iant@google.com>
15129
15130 PR 6811
15131 * options.h (class Search_directory): Add is_system_directory.
15132 (class General_options): Declare is_in_system_directory.
15133 * options.cc (get_relative_sysroot): Make static.
15134 (get_default_sysroot): Make static.
15135 (General_optoins::is_in_system_directory): New function.
15136 * fileread.cc (Input_file::is_in_system_directory): New function.
15137 * fileread.h (class Input_file): Declare is_in_system_directory.
15138 * object.h (class Object): Add is_in_system_directory.
15139 (class Input_objects): Remove system_library_directory_ field.
15140 * object.cc (Input_objects::add_object): Don't set
15141 system_library_directory_.
15142 (input_objects::found_in_system_library_directory): Remove.
15143 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15144 parameter. Change all callers.
15145 (Symbol_table::sized_write_globals): Likewise.
15146 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15147 Call Object::is_in_system_directory.
15148 * symtab.h (class Symbol_table): Update declarations.
15149
15150 PR 5990
15151 * descriptors.h (Open_descriptor): Add is_on_stack field.
15152 * descriptors.cc (Descriptors::open): If the descriptor is on the
15153 top of the stack, remove it. Initialize is_on_stack field.
15154 (Descriptors::release): Only add pod to stack if it is not on the
15155 stack already.
15156 (Descriptors::close_some_descriptor): Clear stack_next and
15157 is_on_stack fields.
15158
15159 PR 7091
15160 * output.cc (Output_section::find_starting_output_address): Rename
15161 from starting_output_address; add PADDR parameter; change return
15162 type.
15163 * output.h (class Output_section): Declare
15164 find_starting_output_address instead of starting_output_address.
15165 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15166 section symbol for which we can't find a merge section.
15167
15168 PR 9836
15169 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15170 hidden or internal, force the symbol to be local.
15171 * resolve.cc (Symbol::override_visibility): Define.
15172 (Symbol::override_base): Use override_visibility.
15173 (Symbol_table::resolve): Likewise.
15174 (Symbol::override_base_with_special): Likewise.
15175 (Symbol_table::override_with_special): If the visibility is hidden
15176 or internal, force the symbol to be local.
15177 * symtab.h (class Symbol): Add set_visibility and
15178 override_visibility.
15179 * testsuite/ver_test_1.sh: New file.
15180 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15181 (check_DATA): Add ver_test_1.syms.
15182 (ver_test_1.syms): New target.
15183 * testsuite/Makefile.in: Rebuild.
15184
15185 2009-02-25 Cary Coutant <ccoutant@google.com>
15186
15187 * layout.cc (Layout::choose_output_section): Don't rename sections
15188 when using a linker script that has a SECTIONS clause.
15189 * Makefile.in: Regenerate.
15190
15191 * testsuite/Makefile.am (script_test_5.sh): New test case.
15192 * testsuite/Makefile.in: Regenerate.
15193 * testsuite/script_test_5.cc: New file.
15194 * testsuite/script_test_5.sh: New file.
15195 * testsuite/script_test_5.t: New file.
15196
15197 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15198
15199 * archive.cc (Archive::include_member): Update calls to add_symbols.
15200 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15201 the Layout argument.
15202 * dynobj.h (do_add_symbols): Add the Layout argument.
15203 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15204 Layout argument.
15205 * object.h (Object::add_symbols): Add the Layout argument.
15206 (Object::do_add_symbols): Add the Layout argument.
15207 (Sized_relobj::do_add_symbols): Add the Layout argument.
15208 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15209 Unify the two versions.
15210 (Add_plugin_symbols): Remove.
15211 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15212 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15213 (Add_plugin_symbols): Remove.
15214 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15215 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15216 (Add_symbols::run): Make it work with Pulginobj.
15217
15218 2009-02-06 Ian Lance Taylor <iant@google.com>
15219
15220 * object.cc (Sized_relobj::do_layout): Make info message start
15221 with lower case letter.
15222
15223 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15224
15225 * binary.cc: Fix file comment.
15226
15227 * options.h (enum Incremental_disposition): Define.
15228 (class General_options): Add new options: --incremental,
15229 --incremental_changed, --incremental_unchanged,
15230 --incremental_unknown. Add incremental_disposition_ and
15231 implicit_incremental_ fields.
15232 (General_options::incremental_disposition): New function.
15233 (class Position_dependent_options): Add incremental_disposition
15234 option.
15235 (Position_dependent_options::copy_from_options): Set incremental
15236 dispositions.
15237 * options.cc (General_options::parse_incremental_changed): New
15238 function.
15239 (General_options::parse_incremental_unchanged): New function.
15240 (General_options::parse_incremental_unknown): New function.
15241 (General_options::General_options): Initialize new fields
15242 incremental_disposition_ and implicit_incremental_.
15243 (General_options::finalize): Check for uasge of --incremental-*
15244 without --incremental.
15245
15246 2009-02-06 Chris Demetriou <cgd@google.com>
15247
15248 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15249 pointer and to report location as the file name associated with
15250 the symbol.
15251 (gold_undefined_symbol_at_location): New function to replace the
15252 old gold_undefined_symbol functionality.
15253 * target-reloc.h (relocate_section): Update to use
15254 gold_undefined_symbol_at_location.
15255 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15256 Call gold_undefined_symbol function rather than gold_error.
15257 * errors.h (Errors::undefined_symbol): Take location as a
15258 string, rather than calculating it from a relocation.
15259 * errors.cc (Errors::fatal): Print "fatal error:" before the
15260 formatted message.
15261 (Errors::error, Errors::error_at_location): Print "error: "
15262 before the formatted message.
15263 (Errors::undefined_symbol): Take location as a string, rather
15264 than calculating it from a relocation.
15265 (gold_undefined_symbol_at_location): New function akin to
15266 old gold_undefined_symbol, calculates location from relocation.
15267 (gold_undefined_symbol): Change to take only a Symbol pointer
15268 and to report location as the file name associated with the symbol.
15269 * testsuite/debug_msg.sh: Update for changed error messages.
15270 * testsuite/undef_symbol.sh: Likewise.
15271
15272 2009-02-04 Duncan Sands <baldrick@free.fr>
15273
15274 PR 9812
15275 * reduced_debug_output.h
15276 (Output_reduced_debug_abbrev_section::failed): Use format for
15277 gold_warning.
15278 (Output_reduced_debug_info_section::faild): Likewise.
15279
15280 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15281
15282 * script.cc (Lazy_demangler): New class.
15283 (Version_script_info::get_symbol_version_helper): Demangle a
15284 symbol only once.
15285
15286 2009-01-29 Cary Coutant <ccoutant@google.com>
15287
15288 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15289 to __tls_get_addr.
15290 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15291
15292 2009-01-28 Ian Lance Taylor <iant@google.com>
15293
15294 * version.cc (version_string): Bump to 1.9.
15295
15296 * gold.h: Include <cstring> and <stdint.h>.
15297 * version.cc: Include <cstdio>.
15298 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15299 warning.
15300 * reduced_debug_output.cc (insert_into_vector): Rename from
15301 Insert_into_vector; change all callers. Use Swap_unaligned to
15302 avoid aliasing issue; remove union since it is unnecessary.
15303
15304 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15305
15306 * Makefile.am (CCFILES): Add gc.cc.
15307 (HFILES): Add gc.h.
15308 * Makefile.in: Regenerate.
15309 * gold.cc (Gc_runner): New class.
15310 (queue_initial_tasks): Call garbage collection related tasks
15311 when corresponding options are invoked.
15312 (queue_middle_gc_tasks): New function.
15313 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15314 processed early before laying out sections during garbage collection.
15315 * gold.h (queue_middle_gc_tasks): New function.
15316 (is_prefix_of): Move from "layout.cc".
15317 * i386.cc (Target_i386::gc_process_relocs): New function.
15318 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15319 * main.cc (main): Create object of class "Garbage_collection".
15320 * object.cc (Relobj::copy_symbols_data): New function.
15321 (Relobj::is_section_name_included): New function.
15322 (Sized_relobj::do_layout): Allow this function to be called twice
15323 during garbage collection and defer layout of section during the
15324 first call.
15325 * object.h (Relobj::get_symbols_data): New function.
15326 (Relobj::is_section_name_included): New function.
15327 (Relobj::copy_symbols_data): New function.
15328 (Relobj::set_symbols_data): New function.
15329 (Relobj::get_relocs_data): New function.
15330 (Relobj::set_relocs_data): New function.
15331 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15332 (Relobj::gc_process_relocs): New function.
15333 (Relobj::do_gc_process_relocs): New pure virtual function.
15334 (Relobj::sd_): New data member.
15335 (Sized_relobj::is_output_section_offset_invalid): New function.
15336 (Sized_relobj::do_gc_process_relocs): New function.
15337 * options.h (General_options::gc_sections): Modify to not be a no-op.
15338 (General_options::print_gc_sections): New option.
15339 * plugin.cc (Plugin_finish::run): Remove function call to
15340 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15341 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15342 * reloc.cc (Read_relocs::run): Add task to process relocs and
15343 determine unreferenced sections when doing garbage collection.
15344 (Gc_process_relocs): New class.
15345 (Sized_relobj::do_gc_process_relocs): New function.
15346 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15347 sections that are garbage collected.
15348 * reloc.h (Gc_process_relocs): New class.
15349 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15350 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15351 symbols whose corresponding sections are garbage collected.
15352 (Symbol_table::Symbol_table): Add new parameter for the garbage
15353 collection object.
15354 (Symbol_table::gc_mark_undef_symbols): New function.
15355 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15356 (Symbol_table::gc_mark_dyn_syms): New function.
15357 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15358 as garbage.
15359 (Symbol_table::add_from_object): Likewise.
15360 (Symbol_table::add_from_relobj): When building shared objects, do not
15361 treat externally visible symbols as garbage.
15362 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15363 table information for static and relocatable links.
15364 * symtab.h (Symbol_table::set_gc): New function.
15365 (Symbol_table::gc): New function.
15366 (Symbol_table::gc_mark_undef_symbols): New function.
15367 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15368 (Symbol_table::gc_mark_dyn_syms): New function.
15369 (Symbol_table::gc_): New data member.
15370 * target.h (Sized_target::gc_process_relocs): New pure virtual
15371 function.
15372 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15373 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15374
15375 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15376
15377 * options.h (General_options::gc_sections): Define as a no-op for now.
15378 (General_options::no_keep_memory): Ditto.
15379 (General_options::Bshareable): Define.
15380 * options.cc (General_options::finalize): Honor -Bshareable.
15381
15382 2009-01-20 Andreas Schwab <schwab@suse.de>
15383
15384 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15385 read the value in the contents, since we don't use it. Use the
15386 template endianness when writing.
15387 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15388
15389 2009-01-19 Andreas Schwab <schwab@suse.de>
15390
15391 * configure.tgt (powerpc64-*): Fix targ_obj.
15392
15393 2009-01-15 Ian Lance Taylor <iant@google.com>
15394
15395 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15396 local symbols when stripping all symbols.
15397
15398 2009-01-14 Cary Coutant <ccoutant@google.com>
15399
15400 * output.cc (Output_reloc): Add explicit instantiations.
15401
15402 2009-01-14 Cary Coutant <ccoutant@google.com>
15403
15404 * archive.cc (Archive::get_elf_object_for_member): Remove call
15405 to File_read::claim_for_plugin.
15406 * descriptors.cc (Descriptors::open): Remove reference to
15407 is_claimed.
15408 (Descriptors::claim_for_plugin): Remove.
15409 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15410 (Descriptors::is_claimed): Remove.
15411 (claim_descriptor_for_plugin): Remove.
15412 * fileread.cc (File_read::claim_for_plugin): Remove.
15413 * fileread.h (File_read::claim_for_plugin): Remove.
15414 (File_read::descriptor): Reopen descriptor if necessary.
15415 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15416 (Plugin_manager::all_symbols_read): Add task parameter. Change
15417 all callers.
15418 (Plugin_manager::get_input_file): New function.
15419 (Plugin_manager::release_input_file): New function.
15420 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15421 corresponding data member.
15422 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15423 and pass to base constructor. Change all callers.
15424 (get_input_file, release_input_file): New functions.
15425 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15426 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15427 (Plugin_manager::all_symbols_read): Add task parameter.
15428 (Plugin_manager::get_input_file): New function.
15429 (Plugin_manager::release_input_file): New function.
15430 (Plugin_manager::task_): New data member.
15431 (Pluginobj::Pluginobj): Add filesize parameter.
15432 (Pluginobj::filename): New function.
15433 (Pluginobj::descriptor): New function.
15434 (Pluginobj::filesize): New function.
15435 (Pluginobj::filesize_): New data member.
15436 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15437 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15438 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15439
15440 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15441 with archive libraries.
15442 * testsuite/Makefile.in: Regenerate.
15443 * testsuite/plugin_test.c (struct sym_info): New type.
15444 (get_input_file, release_input_file): New static variables.
15445 (onload): Capture new transfer vector entries.
15446 (claim_file_hook): Stop reading at end of file according to filesize.
15447 Factor out parsing of readelf output into separate function.
15448 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15449 APIs and get the source file name from the symbol table. Convert
15450 source file name to corresponding object file name. Print info
15451 message when adding new input files.
15452 (parse_readelf_line): New function.
15453 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15454 * testsuite/plugin_test_2.sh: Likewise.
15455 * testsuite/plugin_test_3.sh: Likewise.
15456 * testsuite/plugin_test_4.sh: New test case.
15457
15458 2009-01-07 Ian Lance Taylor <iant@google.com>
15459
15460 * version.cc (version_string): Bump to 1.8.
15461
15462 2008-12-23 Cary Coutant <ccoutant@google.com>
15463
15464 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15465 * plugin.cc (Plugin_manager::finish): Rename as
15466 layout_deferred_objects. Move cleanup to separate function.
15467 (Plugin_manager::cleanup): New function.
15468 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15469 separately.
15470 * plugin.h (Plugin_manager::finish): Rename as
15471 layout_deferred_objects.
15472 (Plugin_manager::cleanup): New function.
15473 (Plugin_manager::cleanup_done): New field.
15474
15475 2008-12-23 Cary Coutant <ccoutant@google.com>
15476
15477 * plugin.cc (is_visible_from_outside): New function.
15478 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15479 so we don't return "IR only" status for exported symbols or -r links.
15480
15481 * testsuite/Makefile.am (plugin_test_3): New test case.
15482 * testsuite/Makefile.in: Regenerate.
15483 * testsuite/plugin_test_3.sh: New file.
15484
15485 2008-12-22 Cary Coutant <ccoutant@google.com>
15486
15487 * object.cc (Sized_relobj::layout_section): New function.
15488 (Sized_relobj::do_layout): Defer layout of input sections until after
15489 plugin has provided replacement files.
15490 (Sized_relobj::do_layout_deferred_sections): New function.
15491 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15492 (Relobj::layout_deferred_sections): New function.
15493 (Relobj::do_layout_deferred_sections): New function.
15494 (Sized_relobj::do_layout_deferred_sections): New function.
15495 (Sized_relobj::layout_section): New function.
15496 (Sized_relobj::Deferred_layout): New structure.
15497 (Sized_relobj::deferred_layout_): New field.
15498 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15499 Change all callers. Layout deferred sections.
15500 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15501 references.
15502 (Plugin_hook::run): Move code from do_plugin_hook inline.
15503 (Plugin_hook::do_plugin_hook): Remove.
15504 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15505 (Plugin_manager::finish): Renamed, was cleanup.
15506 (Plugin_manager::should_defer_layout): New function.
15507 (Plugin_manager::add_deferred_layout_object): New function.
15508 (Plugin_manager::Deferred_layout_list): New type.
15509 (Plugin_manager::deferred_layout_objects_): New field.
15510 (Plugin_hook::do_plugin_hook): Remove.
15511
15512 2008-12-17 Ian Lance Taylor <iant@google.com>
15513
15514 * options.h (class General_options): Add --no case for
15515 --export-dynamic.
15516
15517 2008-12-16 Cary Coutant <ccoutant@google.com>
15518
15519 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15520 vector.
15521 (Plugin_manager::claim_file): Create plugin object even if
15522 plugin did not call the add_symbols callback.
15523 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15524 asking for more symbols than were added.
15525 * testsuite/Makefile.am (plugin_test_1): Add test case with
15526 no global symbols.
15527 (empty.syms): New target.
15528 * testsuite/Makefile.in: Regenerate.
15529 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15530 message. Don't call add_symbols if no globals.
15531 (all_symbols_read_hook): Don't provide replacement for empty
15532 claimed file.
15533
15534 2008-12-12 Ian Lance Taylor <iant@google.com>
15535
15536 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15537 r_type == 0 for a local symbol with r_sym == 0.
15538 (scan_relocatable_relocs): Pass r_sym to
15539 local_non_section_strategy.
15540 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15541 r_sym parameter.
15542
15543 * configure.ac: Update test for TLS descriptors: they are
15544 supported as of glibc 2.9.
15545 * configure: Rebuild.
15546
15547 2008-12-11 Ian Lance Taylor <iant@google.com>
15548
15549 PR 7091
15550 * target-reloc.h (Default_scan_relocatable_relocs): For each
15551 function, map r_type == 0 to RELOC_DISCARD.
15552
15553 2008-12-10 Cary Coutant <ccoutant@google.com>
15554
15555 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15556 object to override a kept COMDAT group from a plugin object.
15557
15558 2008-12-09 Ian Lance Taylor <iant@google.com>
15559
15560 PR 7088
15561 * yyscript.y (file_cmd): Handle INPUT.
15562
15563 * testsuite/initpri1.c: Change all declarations to be full
15564 prototypes by adding void, to avoid compiler warnings.
15565
15566 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15567
15568 * options.cc (General_options::parse_plugin_opt): New.
15569 (General_options::add_plugin): The argument now is just the filename.
15570 (General_options::add_plugin_option): New.
15571 * options.h (plugin_opt): New.
15572 (add_plugin): Change argument name.
15573 (add_plugin_option): New.
15574 * plugin.cc (Plugin::load): Don't parse the plugin option.
15575 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15576 (Plugin::add_option): New.
15577 (Plugin::args_): Change type.
15578 (Plugin::filename_): New.
15579 (Plugin_manager::add_plugin_option): New.
15580 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15581 * testsuite/Makefile.in: Regenerate.
15582
15583 2008-12-05 Cary Coutant <ccoutant@google.com>
15584
15585 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15586 Handle --strip-lto-sections option.
15587 * options.h (strip_lto_sections): New option.
15588
15589 2008-12-01 Cary Coutant <ccoutant@google.com>
15590
15591 * plugin.cc (ld_plugin_message): Change format parameter to const.
15592 Fix mismatch between new[] and delete.
15593
15594 2008-11-14 Cary Coutant <ccoutant@google.com>
15595
15596 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15597 instead of -1U.
15598
15599 2008-11-05 Craig Silverstein <csilvers@google.com>
15600
15601 * options.cc (General_options::parse_dynamic_list): New function.
15602 * options.h (General_options): New flags dynamic_list,
15603 dynamic_list_data, dynamic_list_cpp_new, and
15604 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15605 (General_options::in_dynamic_list): New function.
15606 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15607 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15608 (Lex::can_continue_name): Likewise.
15609 (yylex): Likewise.
15610 (read_script_file): New parameter script_options.
15611 (read_dynamic_list): New function.
15612 (Script_options::define_dynamic_list): New function.
15613 (dynamic_list_keyword_parsecodes): New variable.
15614 (dynamic_list_keywords): New variable.
15615 * script.h (Script_options::define_dynamic_list): New function
15616 prototype.
15617 (read_dynamic_list): New function prototype.
15618 * symtab.cc (strprefix): New macro.
15619 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15620 dynamic_list_data, dynamic_list_cpp_new, and
15621 dynamic_list_cpp_typeinfo.
15622 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15623 (dynamic_list_expr): New rule.
15624 (dynamic_list_nodes): Likewise.
15625 (dynamic_list_node): Likewise.
15626 * testsuite/Makefile.am (dynamic_list): New test.
15627 * testsuite/Makefile.in: Regenerated.
15628 * testsuite/dynamic_list.t: New file.
15629 * testsuite/dynamic_list.sh: New file.
15630
15631 2008-11-05 Craig Silverstein <csilvers@google.com>
15632
15633 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15634 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15635 (t11_last): Likewise.
15636 * testsuite/ver_test_6.c (main): Likewise.
15637
15638 2008-10-07 Cary Coutant <ccoutant@google.com>
15639
15640 * options.c (General_options::finalize): Add check for -static and
15641 -shared.
15642 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15643 is not empty.
15644
15645 2008-10-02 Cary Coutant <ccoutant@google.com>
15646
15647 * plugin.cc (make_sized_plugin_object): Fix conditional
15648 compilation to work when not all targets are enabled.
15649
15650 2008-09-29 Cary Coutant <ccoutant@google.com>
15651
15652 * archive.cc (Archive::get_file_and_offset): Use filename instead
15653 of name to get library path.
15654 (Archive::include_member): Unlock external member of a thin archive.
15655
15656 * testsuite/Makefile.am (TEST_AR): New variable.
15657 (thin_archive_test_1): New test.
15658 (thin_archive_test_2): New test.
15659 * testsuite/Makefile.in: Regenerate.
15660 * testsuite/thin_archive_main.cc: New file.
15661 * testsuite/thin_archive_test_1.cc: New file.
15662 * testsuite/thin_archive_test_2.cc: New file.
15663 * testsuite/thin_archive_test_3.cc: New file.
15664 * testsuite/thin_archive_test_4.cc: New file.
15665
15666 2008-09-29 Cary Coutant <ccoutant@google.com>
15667
15668 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15669 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15670 instead of -1U.
15671 (Sized_relobj::do_finalize_local_symbols): Likewise.
15672 (Sized_relobj::map_to_kept_section): Likewise.
15673 * object.h (Sized_relobj::invalid_address): New constant.
15674 (Sized_relobj::do_output_section_offset): Check for invalid_address
15675 and return -1ULL.
15676 * output.cc (Output_reloc::local_section_offset): Use constant
15677 invalid_address instead of -1U.
15678 (Output_reloc::get_address): Likewise.
15679 (Output_section::output_address): Change -1U to -1ULL.
15680 * output.h (Output_reloc::invalid_address): New constant.
15681 * reloc.cc (Sized_relobj::write_sections): Use constant
15682 invalid_address instead of -1U.
15683 (Sized_relobj::relocate_sections): Likewise.
15684 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15685 values for merge sections.
15686 * target-reloc.h (relocate_for_relocatable): Use constant
15687 invalid_address instead of -1U.
15688
15689 2008-09-19 Cary Coutant <ccoutant@google.com>
15690
15691 Add plugin functionality for link-time optimization (LTO).
15692 * configure.ac (plugins): Add --enable-plugins option.
15693 * configure: Regenerate.
15694 * config.in: Regenerate.
15695 * Makefile.am (LIBDL): New variable.
15696 (CCFILES): Add plugin.cc.
15697 (HFILES): Add plugin.h.
15698 (ldadd_var): Add LIBDL.
15699 * Makefile.in: Regenerate.
15700
15701 * archive.cc: Include "plugin.h".
15702 (Archive::setup): Don't preread archive symbols when using a plugin.
15703 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15704 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15705 files.
15706 (Archive::include_member): Add symbols from plugin objects.
15707 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15708 * descriptors.cc (Descriptors::open): Check for file descriptors
15709 abandoned by plugins.
15710 (Descriptors::claim_for_plugin): New function.
15711 * descriptors.h (Descriptors::claim_for_plugin): New function.
15712 (Open_descriptor::is_claimed): New field.
15713 (claim_descriptor_for_plugin): New function.
15714 * fileread.cc (File_read::claim_for_plugin): New function.
15715 * fileread.h (File_read::claim_for_plugin): New function.
15716 (File_read::descriptor): New function.
15717 * gold.cc: Include "plugin.h".
15718 (queue_initial_tasks): Add task to call plugin hooks for generating
15719 new object files.
15720 * main.cc: Include "plugin.h".
15721 (main): Load plugin libraries.
15722 * object.h (Pluginobj): Declare.
15723 (Object::pluginobj): New function.
15724 (Object::do_pluginobj): New function.
15725 (Object::set_target): New function.
15726 * options.cc: Include "plugin.h".
15727 (General_options::parse_plugin): New function.
15728 (General_options::General_options): Initialize plugins_ field.
15729 (General_options::add_plugin): New function.
15730 * options.h (Plugin_manager): Declare.
15731 (General_options): Add --plugin option.
15732 (General_options::has_plugins): New function.
15733 (General_options::plugins): New function.
15734 (General_options::add_plugin): New function.
15735 (General_options::plugins_): New field.
15736 * plugin.cc: New file.
15737 * plugin.h: New file.
15738 * readsyms.cc: Include "plugin.h".
15739 (Read_symbols::do_read_symbols): Check for archive before checking
15740 for ELF file. Call plugin hooks to claim files.
15741 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15742 from a real object file; force override when processing replacement
15743 files.
15744 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15745 (Symbol::init_base_object): Likewise.
15746 (Symbol::init_base_output_data): Likewise.
15747 (Symbol::init_base_output_segment): Likewise.
15748 (Symbol::init_base_constant): Likewise.
15749 (Symbol::init_base_undefined): Likewise.
15750 (Symbol::output_section): Assert that object is not a plugin.
15751 (Symbol_table::add_from_pluginobj): New function.
15752 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15753 undefined.
15754 (Symbol_table::sized_write_globals): Likewise.
15755 (Symbol_table::add_from_pluginobj): Instantiate template.
15756 * symtab.h (Sized_pluginobj): Declare.
15757 (Symbol::in_real_elf): New function.
15758 (Symbol::set_in_real_elf): New function.
15759 (Symbol::in_real_elf_): New field.
15760 (Symbol_table::add_from_pluginobj): New function.
15761
15762 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15763 (LIBDL): New variable.
15764 (LDADD): Add LIBDL.
15765 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15766 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15767 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15768 (MOSTLYCLEANFILES): Likewise.
15769 * testsuite/Makefile.in: Regenerate.
15770 * testsuite/plugin_test.c: New file.
15771 * testsuite/plugin_test_1.sh: New file.
15772 * testsuite/plugin_test_2.sh: New file.
15773
15774 2008-09-16 Ian Lance Taylor <iant@google.com>
15775
15776 * target-reloc.h (relocate_section): Check whether a symbol is
15777 defined by the ABI before reporting an undefined symbol error.
15778 * target.h (Target::is_defined_by_abi): Make parameter const.
15779 (Target::do_is_defined_by_abi): Likewise.
15780 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15781 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15782 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15783 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15784 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15785 * testsuite/Makefile.in: Rebuild.
15786
15787 * fileread.cc (make_view): Add casts to avoid warning.
15788
15789 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15790
15791 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15792 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15793
15794 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15795
15796 * options.h (General_options::output_is_executable): New.
15797 (General_options::output_is_pie): New.
15798 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15799 for shared libraries.
15800 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15801
15802 2008-09-11 Chris Demetriou <cgd@google.com>
15803
15804 * options.h (origin): New -z option.
15805 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15806 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15807 in DT_FLAGS_1.
15808
15809 2008-09-05 Cary Coutant <ccoutant@google.com>
15810
15811 * fileread.cc (File_read::make_view): Add check for attempt to map
15812 beyond end of file.
15813
15814 2008-09-05 Cary Coutant <ccoutant@google.com>
15815
15816 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15817 explicit instantiations.
15818
15819 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15820
15821 PR gold/6858
15822 * options.cc (General_options::finalize): Allow undefined symbols
15823 in shlibs if linking -shared.
15824
15825 PR gold/6859
15826 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15827 symbols as not needing a dynsym entry.
15828
15829 2008-08-20 Craig Silverstein <csilvers@google.com>
15830
15831 * fileread.cc (File_read::open): Do not lock the file unless it
15832 was successfully opened.
15833
15834 2008-08-14 Cary Coutant <ccoutant@google.com>
15835
15836 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15837 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15838 * testsuite/tls_test.cc (struct int128): 128-bit struct
15839 for testing TLS relocs with non-zero addend.
15840 (v12): New TLS variable.
15841 (t12): New test.
15842 (t_last): Add check for v12.
15843 * testsuite/tls_test.h (t12): New function.
15844 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15845
15846 2008-08-13 Ian Lance Taylor <iant@google.com>
15847
15848 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15849 set tls_segment_ or relro_segment_.
15850 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15851 when appropriate.
15852 * output.h (Output_section::clear_is_relro): New function.
15853 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15854 sections specially even when output_data_ is empty.
15855 (Output_segment::maximum_alignment): When first section is relro,
15856 only force alignment for PT_LOAD segments.
15857 * script.cc (script_data_segment_align): New function.
15858 (script_data_segment_relro_end): New function.
15859 * script-c.h (script_data_segment_align): Declare.
15860 (script_data_segment_relro_end): Declare.
15861 * script-sections.h (class Script_sections): Declare
15862 data_segment_align and data_segment_relro_end. Add fields
15863 segment_align_index_ and saw_relro_end_.
15864 * script-sections.cc (class Sections_element): Add set_is_relro
15865 virtual function. Add new bool* parameter to place_orphan_here.
15866 Add get_output_section virtual function.
15867 (class Output_section_definition): Add set_is_relro. Add new
15868 bool* parameter to place_orphan_here. Add get_output_section.
15869 Add is_relro_ field.
15870 (Output_section_definition::Output_section_definition): Initialize
15871 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15872 and is_relro_ fields.
15873 (Output_section_definition::place_orphan_here): Add is_relro
15874 parameter.
15875 (Output_section_definition::set_section_addresses): Set relro for
15876 output section.
15877 (Output_section_definition::alternate_constraint): Likewise.
15878 (class Orphan_output_section): Add new bool* parameter to
15879 place_orphan_here. Add get_output_section.
15880 (Orphan_output_section::place_orphan_here): Add is_relro
15881 parameter.
15882 (Script_sections::Script_sections): Initialize
15883 data_segment_align_index_ and saw_relro_end_.
15884 (Script_sections::data_segment_align): New function.
15885 (Script_sections::data_segment_relro_end): New function.
15886 (Script_sections::place_orphan): Set or clear is_relro.
15887 (Script_sections::set_section_addresses): Force alignment of first
15888 TLS section.
15889 * yyscript.y (exp): Call script_data_segment_align and
15890 script_data_segment_relro_end.
15891 * testsuite/relro_script_test.t: New file.
15892 * testsuite/relro_test.cc (using_script): Declare.
15893 (t1, t2): Test using_script.
15894 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15895 (relro_script_test_SOURCES): Define.
15896 (relro_script_test_DEPENDENCIES): Define.
15897 (relro_script_test_LDFLAGS): Define.
15898 (relro_script_test_LDADD): Define.
15899 (relro_script_test.so): New target.
15900 * testsuite/Makefile.in: Rebuild.
15901
15902 2008-08-06 Cary Coutant <ccoutant@google.com>
15903
15904 * archive.cc (Archive::total_archives, Archive::total_members)
15905 (Archive::total_members_loaded): New variables.
15906 (Archive::setup): Add parameter. Add option to preread
15907 archive symbols.
15908 (Archive::read_armap): Add counter.
15909 (Archive::get_file_and_offset): New function.
15910 (Archive::get_elf_object_for_member): New function.
15911 (Archive::read_all_symbols): New function.
15912 (Archive::read_symbols): New function.
15913 (Archive::add_symbols): Add counters.
15914 (Archive::include_all_members): Use armap to find members if it's
15915 already built.
15916 (Archive::include_member): Skip reading symbols if already read.
15917 Factored code into Archive::get_file_and_offset and
15918 Archive::get_elf_object_for_member. Changed call to
15919 Mapfile::report_include_archive_member.
15920 (Archive::print_stats): New function.
15921 * archive.h: Declare Object and Read_symbols_data classes.
15922 (Archive::Archive): Add initializers for new members.
15923 (Archive::setup): Add parameter.
15924 (Archive::print_stats): New function.
15925 (Archive::total_archives, Archive::total_members)
15926 (Archive::total_members_loaded): New variables.
15927 (Archive::get_file_and_offset): New function.
15928 (Archive::get_elf_object_for_member): New function.
15929 (Archive::read_all_symbols): New function.
15930 (Archive::read_symbols): New function.
15931 (Archive::Archive_member): New class.
15932 (Archive::members_): New member.
15933 (Archive::num_members_): New member.
15934 * main.cc: Include archive.h.
15935 (main): Call Archive::print_stats.
15936 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15937 archive parameter; member_name is now the fully-decorated name.
15938 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15939 * options.h: (General_options): Add --preread-archive-symbols option.
15940 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15941 Archive::setup.
15942
15943 2008-08-04 Ian Lance Taylor <iant@google.com>
15944
15945 * symtab.h (Symbol::use_plt_offset): New function.
15946 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15947 * powerpc.cc (Relocate::relocate): Likewise.
15948 * sparc.cc (Relocate::relocate): Likewise.
15949 * x86_64.cc (Relocate::relocate): Likewise.
15950 * testsuite/weak_plt.sh: New test.
15951 * testsuite/weak_plt_main.cc: New test.
15952 * testsuite/weak_plt_shared.cc: New test.
15953 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15954 (check_PROGRAMS): Add weak_plt.
15955 (check_DATA): Add weak_plt_shared.so.
15956 (weak_plt_main_pic.o, weak_plt): New targets.
15957 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15958 * testsuite/Makefile.in: Rebuild.
15959
15960 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15961 gcctestdir/ld.
15962 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15963 * testsuite/Makefile.in: Rebuild.
15964
15965 2008-08-04 Alan Modra <amodra@bigpond.net.au>
15966
15967 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15968 * Makefile.in: Regenerate.
15969 * po/POTFILES.in: Regenerate.
15970
15971 2008-07-29 Ian Lance Taylor <iant@google.com>
15972
15973 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15974 symbols before other symbols.
15975 * testsuite/script_test_2.cc (test_addr): Declare.
15976 (test_addr_alias): Declare.
15977 (main): Check that test_addr and test_addr_alias have the right
15978 values.
15979 * testsuite/script_test_2.t: Define test_addr_alias and
15980 test_addr.
15981
15982 2008-07-24 Ian Lance Taylor <iant@google.com>
15983
15984 PR 5990
15985 * descriptors.cc: New file.
15986 * descriptors.h: New file.
15987 * gold-threads.h (class Hold_optional_lock): New class.
15988 * fileread.cc: Include "descriptors.h".
15989 (File_read::~File_read): Release descriptor rather than closing
15990 it.
15991 (File_read::open) [file]: Call open_descriptor rather than open.
15992 Set is_descriptor_opened_.
15993 (File_read::open) [memory]: Assert that descriptor is not open.
15994 (File_read::reopen_descriptor): New function.
15995 (File_read::release): Release descriptor.
15996 (File_read::do_read): Make non-const. Reopen descriptor.
15997 (File_read::read): Make non-const.
15998 (File_read::make_view): Reopen descriptor.
15999 (File_read::do_readv): Likewise.
16000 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16001 Update declarations.
16002 * layout.cc: Include "descriptors.h".
16003 (Layout::create_build_id): Use open_descriptor rather than open.
16004 * output.cc: Include "descriptors.h".
16005 (Output_file::open): Use open_descriptor rather than open.
16006 * archive.cc (Archive::const_iterator): Change Archive to be
16007 non-const.
16008 (Archive::begin, Archive::end): Make non-const.
16009 (Archive::count_members): Likewise.
16010 * archive.h (class Archive): Update declarations.
16011 * object.h (Object::read): Make non-const.
16012 * Makefile.am (CCFILES): Add descriptors.cc.
16013 (HFILES): Add descriptors.h.
16014 * Makefile.in: Rebuild.
16015
16016 PR 6716
16017 * gold.h: Always include <clocale>. Add Solaris workarounds
16018 following code in binutils/sysdep.h.
16019
16020 PR 6048
16021 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16022 this->eh_frame_hdr_ is NULL before using it.
16023
16024 * dynobj.cc (Versions::Versions): Update comment.
16025
16026 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16027 the base version name.
16028
16029 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16030 array size plus one.
16031 (Stringpool_template::set_string_offsets): Subtract one from key
16032 before using it as an array index.
16033 (Stringpool_template::get_offset_with_length): Likewise.
16034 (Stringpool_template::write_to_buffer): Likewise.
16035 * stringpool.h (Stringpool_template::get_offset_from_key):
16036 Likewise.
16037
16038 2008-07-23 Ian Lance Taylor <iant@google.com>
16039
16040 PR 6658
16041 * object.h (Merged_symbol_value::value): Do our best to handle a
16042 negative addend.
16043
16044 PR 6647
16045 * script.cc (Version_script_info::get_versions): Don't add empty
16046 version tag to return value.
16047 (Version_script_info::get_symbol_version_helper): Change return
16048 type to bool. Add pversion parameter. Change all callers.
16049 (script_register_vers_node): Don't require a non-NULL tag.
16050 * script.h (class Version_script_info): Update declarations.
16051 (Version_script_info::get_symbol_version): Change return type to
16052 bool. Add version parameter. Change all callers.
16053 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16054 handling. Handle an empty version from a version script.
16055 (Symbol_table::define_special_symbol): Likewise.
16056 * testsuite/ver_test_10.script: New file.
16057 * testsuite/ver_test_10.sh: New file.
16058 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16059 (check_DATA): Add ver_test_10.syms.
16060 (ver_test_10.syms, ver_test_10.so): New target.
16061 * testsuite/Makefile.in: Rebuild.
16062
16063 2008-07-23 Simon Baldwin <simonb@google.com>
16064
16065 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16066 to zero for undefined symbols from dynamic libraries.
16067
16068 2008-07-23 Ian Lance Taylor <iant@google.com>
16069
16070 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16071 Change all callers.
16072 * symtab.h (class Symbol_table): Update declaration.
16073 * testsuite/ver_test_9.cc: New file.
16074 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16075 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16076 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16077 (ver_test_9.so, ver_test_9.o): New targets.
16078 * testsuite/Makefile.in: Rebuild.
16079
16080 2008-07-22 Ian Lance Taylor <iant@google.com>
16081
16082 * options.h (class General_options): Define --check-sections.
16083 * layout.cc (Layout::set_segment_offsets): Handle
16084 --check-sections.
16085
16086 * options.h (class General_options): Define -n/--nmagic and
16087 -N/--omagic.
16088 * options.cc (General_options::finalize): For -n/--nmagic or
16089 -N/--omagic, set -static.
16090 * layout.cc (Layout::attach_allocated_section_to_segment): If
16091 -N/--omagic, don't put read-only and read-write sections in
16092 different segments.
16093 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16094 finding a read-only segment.
16095 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16096 don't set the minimum segment alignment to the common page size,
16097 and don't set the file offset to the address modulo the page size.
16098 * script-sections.cc (Script_sections::create_segments): If
16099 -n/--omagic, don't put read-only and read-write sections in
16100 different segments.
16101
16102 * cref.cc: New file.
16103 * cref.h: New file.
16104 * options.h (class General_options): Add --print-symbol-counts.
16105 * main.cc (main): Issue defined symbol report if requested.
16106 * archive.cc (Archive::interpret_header): Make into a const member
16107 function.
16108 (Archive::add_symbols): Call Input_objects::archive_start and
16109 archive_stop.
16110 (Archive::const_iterator): Define new class.
16111 (Archive::begin, Archive::end): New functions.
16112 (Archive::include_all_members): Rewrite to use iterator.
16113 (Archive::count_members): New function.
16114 * archive.h (class Archive): Update declarations.
16115 (Archive::filename): New function.
16116 * object.cc: Include "cref.h".
16117 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16118 (Sized_relobj::do_get_global_symbol_counts): New function.
16119 (Input_objects::add_object): Add object to cross-referencer.
16120 (Input_objects::archive_start): New function.
16121 (Input_objects::archive_stop): New function.
16122 (Input_objects::print_symbol_counts): New function.
16123 * object.h: Declare Cref and Archive.
16124 (Object::get_global_symbol_counts): New function.
16125 (Object::do_get_global_symbol_counts): New pure virtual function.
16126 (class Sized_relobj): Add defined_count_ field. Update
16127 declarations.
16128 (class Input_objects): Add cref_ field. Update constructor.
16129 Update declarations.
16130 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16131 defined_count_.
16132 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16133 symbol counts.
16134 (Sized_dynobj::do_get_global_symbol_counts): New function.
16135 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16136 defined_count_. Update declarations. Define Symbols typedef.
16137 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16138 parameter. Change all callers.
16139 (Symbol_table::add_from_dynobj): Add sympointers and defined
16140 parameters. Change all callers.
16141 * symtab.h (class Symbol_table): Update declarations.
16142 * Makefile.am (CCFILES): Add cref.cc.
16143 (HFILES): Add cref.h.
16144 * Makefile.in: Rebuild.
16145
16146 2008-07-22 Simon Baldwin <simonb@google.com>
16147
16148 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16149 to zero when writing undefined symbols.
16150
16151 2008-07-22 Ian Lance Taylor <iant@google.com>
16152
16153 * output.cc (Output_section::add_input_section): Don't try to
16154 merge empty merge sections.
16155
16156 2008-07-21 Craig Silverstein <csilvers@google.com>
16157
16158 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16159 Include symbol version in error message.
16160
16161 2008-07-20 Chris Demetriou <cgd@google.com>
16162
16163 * configure.ac (gold_cv_c_random_seed): New configured variable.
16164 (RANDOM_SEED_CFLAGS): New substituted variable.
16165 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16166 * configure: Rebuild.
16167 * Makefile.in: Likewise.
16168 * testsuite/Makefile.in: Likewise.
16169
16170 2008-07-18 Ian Lance Taylor <iant@google.com>
16171
16172 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16173 where we see NAME/NULL and NAME/VERSION as separate symbols.
16174 * testsuite/ver_test_main.cc (main): Call t4.
16175 (t4, t4_2a): Define.
16176 * testsuite/ver_test_2.cc (t4_2): Define.
16177 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16178 * testsuite/ver_test_4.cc (t4_2a): Define.
16179 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16180 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16181
16182 2008-07-17 Ian Lance Taylor <iant@google.com>
16183
16184 * dynobj.cc (Versions::add_def): If we give an error about a
16185 missing version, go ahead and create the version anyhow.
16186
16187 2008-07-10 Ian Lance Taylor <iant@google.com>
16188
16189 Handle output sections with more than 0x7fffffff bytes.
16190 * object.h (class Relobj): Change map_to_output_ to
16191 output_sections_, and just keep a section pointer. Change all
16192 uses. Move comdat group support to Sized_relobj.
16193 (Relobj::is_section_specially_mapped): Remove.
16194 (Relobj::output_section): Remove poff parameter. Change all
16195 callers.
16196 (Relobj::output_section_offset): New function.
16197 (Relobj::set_section_offset): Rewrite.
16198 (Relobj::map_to_output): Remove.
16199 (Relobj::output_sections): New function.
16200 (Relobj::do_output_section_offset): New pure virtual function.
16201 (Relobj::do_set_section_offset): Likewise.
16202 (class Sized_relobj): Add section_offsets_ field. Add comdat
16203 group support from Relobj. Update declarations.
16204 (Sized_relobj::get_output_section_offset): New function.
16205 (Sized_relobj::do_output_section_offset): New function.
16206 (Sized_relobj::do_set_section_offset): New function.
16207 * object.cc (Relobj::output_section_address): Remove.
16208 (Sized_relobj::Sized_relobj): Initialize new fields.
16209 (Sized_relobj::include_section_group): Cast find_kept_object to
16210 Sized_relobj.
16211 (Sized_relobj::include_linkonce_section): Likewise.
16212 (Sized_relobj::do_layout): Use separate arrays for output section
16213 and output offset.
16214 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16215 output_sections.
16216 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16217 output_sections and section_offsets.
16218 (Sized_relobj::write_local_symbols): Likewise.
16219 (map_to_kept_section): Compute output address directly.
16220 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16221 output_sections and section_offsets.
16222 (Sized_relobj::write_sections): Likewise.
16223 (Sized_relobj::relocate_sections): Likewise.
16224 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16225 * output.h (class Output_reloc): Update declarations. Change
16226 u2_.relobj to Sized_relobj*.
16227 (class Output_data_reloc): Change add functions to use
16228 Sized_relobj*.
16229 * output.cc (Output_reloc::Output_reloc): Change relobj to
16230 Sized_relobj*.
16231 (Output_reloc::local_section_offset): Change return type to
16232 Elf_Addr. Use get_output_section_offset.
16233 (Output_reloc::get_address): Likewise.
16234 (Output_section::is_input_address_mapped): Don't call
16235 is_section_specially_mapped.
16236 (Output_section::output_offset): Likewise.
16237 (Output_section::output_address): Likewise.
16238 (Output_section::starting_output_address): Likewise.
16239 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16240 parameter to Sized_relobj*.
16241 (Copy_relocs::need_copy_reloc): Likewise.
16242 (Copy_relocs::save): Likewise.
16243 * copy-relocs.h (class Copy_relocs): Update declarations.
16244 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16245 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16246 * target-reloc.h (relocate_for_relocatable): Change
16247 offset_in_output_section type to Elf_Addr. Change code that uses
16248 it as well.
16249 * layout.cc (Layout::layout): Always set *off.
16250 * mapfile.cc (Mapfile::print_input_section): Use
16251 output_section_offset.
16252 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16253 Sized_relobj*.
16254 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16255 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16256 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16257
16258 2008-07-03 Ian Lance Taylor <iant@google.com>
16259
16260 * layout.cc (Layout::include_section): Do not discard unrecognized
16261 SHT_STRTAB sections.
16262
16263 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16264
16265 * script.cc (Lex::can_continue_name): Make '?' allowable in
16266 version-script names.
16267 * testsuite/version_script.map: Change glob pattern to use '?'
16268
16269 2008-06-30 Manish Singh <yosh@gimp.org>
16270
16271 PR 6585
16272 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16273 Correct typo.
16274
16275 2008-06-30 Ian Lance Taylor <iant@google.com>
16276
16277 PR 6660
16278 PR 6682
16279 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16280 versions]: Don't try to read the value in the contents, since we
16281 don't use it. Use the template endianness when writing.
16282
16283 2008-06-25 Cary Coutant <ccoutant@google.com>
16284
16285 * fileread.cc (File_read::make_view): Assert on zero-length view.
16286 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16287 symbol table when there are no symbols to read.
16288
16289 2008-06-23 Craig Silverstein <csilvers@google.com>
16290
16291 * version.cc (version_string): Bump to 1.7
16292
16293 2008-06-18 Craig Silverstein <csilvers@google.com>
16294
16295 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16296 constant 0xFFFF to type Valtype.
16297 (Powerpc_relocate_functions::rel16_ha): Likewise.
16298
16299 2008-06-17 Ian Lance Taylor <iant@google.com>
16300
16301 * output.h (Output_section::Input_section): Initialize p2align_ to
16302 zero for Output_section_data constructors.
16303 (Output_section::Input_section::addralign): If not an input
16304 section, return the alignment of the Output_section_data.
16305 * testsuite/copy_test.cc: New file.
16306 * testsuite/copy_test_1.cc: New file.
16307 * testsuite/copy_test_2.cc: New file.
16308 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16309 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16310 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16311 (copy_test_1_pic.o, copy_test_1.so): New targets.
16312 (copy_test_2_pic.o, copy_test_2.so): New targets.
16313 * testsuite/Makefile.in: Rebuild.
16314
16315 * script-sections.cc (Script_sections::place_orphan): Initialize
16316 local variable exact.
16317
16318 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16319
16320 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16321
16322 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16323 David S. Miller <davem@davemloft.net>
16324
16325 * powerpc.cc: New file.
16326 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16327 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16328 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16329 * Makefile.in: Rebuild.
16330
16331 2008-06-09 Ian Lance Taylor <iant@google.com>
16332
16333 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16334 <exception>.
16335 (throwing, orig_terminate): New static variables.
16336 (terminate_handler): New static function.
16337 (t2): Set terminate handler.
16338
16339 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16340
16341 PR 6584
16342 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16343 alignment.
16344
16345 2008-05-30 Cary Coutant <ccoutant@google.com>
16346
16347 * archive.cc (Archive::include_all_members) Correct to step
16348 over symbol table and extended name table in thin archives.
16349
16350 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16351
16352 PR 6407
16353 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16354 calculation.
16355
16356 2008-05-28 Caleb Howe <cshowe@google.com>
16357
16358 * reduced_debug_output.cc: New file.
16359 * reduced_debug_output.h: New file.
16360 * options.h (class General_options): Add --strip-debug-non-line.
16361 * options.cc (General_options::finalize): Add strip_debug_non_line
16362 to the strip heirarchy.
16363 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16364 fields.
16365 * layout.cc: Include "reduced_debug_output.h".
16366 (Layout::Layout): Initialize new fields.
16367 (line_only_debug_sections): New static array.
16368 (is_lines_only_debug_sections): New static inline function.
16369 (Layout::include_section): Handle --strip-debug-non-line.
16370 (Layout::make_output_section): If --strip-debug-non-line, build
16371 new output sections for .debug_abbrev and .debug_info.
16372 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16373 gold. Warn about possible overflow.
16374 (read_signed_LEB_128): Likewise.
16375 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16376 (read_signed_LEB_128): Declare.
16377 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16378 (HFILES): Add reduced_debug_output.h.
16379 * Makefile.in: Rebuild.
16380
16381 2008-05-21 Ian Lance Taylor <iant@google.com>
16382
16383 * mapfile.cc: New file.
16384 * mapfile.h: New file.
16385 * options.h (class General_options): Add -M/--print-map and -Map.
16386 * options.cc (General_options::finalize): Make -M equivalent to
16387 -Map -.
16388 * main.cc: Include <cstdio> and "mapfile.h".
16389 (main): Open mapfile if requested.
16390 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16391 constructor. Change caller.
16392 (queue_initial_tasks): Add mapfile parameter. Change caller.
16393 (queue_middle_tasks): Likewise.
16394 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16395 declarations.
16396 * archive.cc: Include "mapfile.h".
16397 (Archive::add_symbols): Add mapfile parameter. Change all
16398 callers. Pass mapfile, symbol, and reason to include_member.
16399 (Archive::include_all_members): Add mapfile parameter. Change all
16400 callers.
16401 (Archive::include_member): Add mapfile, sym, and why parameters.
16402 Change all callers. Report inclusion to map file.
16403 * archive.h: Include "fileread.h".
16404 (class Archive): Update declarations.
16405 (Archive::file): New const method.
16406 (class Add_archive_symbols): Add mapfile_ field. Update
16407 constructor. Change all callers.
16408 * readsyms.h (class Read_symbols): Likewise.
16409 (class Finish_group): Likewise.
16410 (class Read_script): Likewise.
16411 * common.cc: Include "mapfile.h".
16412 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16413 all callers.
16414 (Symbol_table::do_allocate_commons): Likewise.
16415 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16416 symbol allocation to mapfile.
16417 * common.h (class Allocate_commons_task): Add mapfile_ field.
16418 Update constructor. Change all callers.
16419 * symtab.h (class Symbol_table): Update declarations.
16420 * layout.cc: Include "mapfile.h".
16421 (Layout_task_runner::run): Print information to mapfile.
16422 (Layout::create_gold_note): Change Output_data_fixed_space to
16423 Output_data_zero_fill.
16424 (Layout::create_build_id): Likewise.
16425 (Layout::print_to_mapfile): New function.
16426 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16427 constructor. Change caller.
16428 (class Layout): Declare print_to_mapfile.
16429 * output.cc (Output_section::Input_section::print_to_mapfile): New
16430 function.
16431 (Output_section::add_input_section): If producing a map, always
16432 add to input_sections_ list.
16433 (Output_section::do_print_to_mapfile): New function.
16434 (Output_segment::print_sections_to_mapfile): New function.
16435 (Output_segment::print_section_list_to_mapfile): New function.
16436 * output.h: Include "mapfile.h".
16437 (Output_data::print_to_mapfile): New function.
16438 (Output_data::do_print_to_mapfile): New virtual function.
16439 (Output_segment_headers::do_print_to_mapfile): New function.
16440 (Output_file_header::do_print_to_mapfile): New function.
16441 (Output_data_const::do_print_to_mapfile): New function.
16442 (class Output_data_const_buffer): Add map_name_ field. Update
16443 constructor. Change all callers. Add do_print_to_mapfile
16444 function.
16445 (class Output_data_fixed_space): Likewise.
16446 (class Output_data_space): Likewise.
16447 (class Output_data_zero_fill): New class.
16448 (Output_data_strtab::do_print_to_mapfile): New function.
16449 (Output_data_reloc_base::do_print_to_mapfile): New function.
16450 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16451 (Output_data_group::do_print_to_mapfile): New function.
16452 (Output_data_got::do_print_to_mapfile): New function.
16453 (Output_data_dynamic::do_print_to_mapfile): New function.
16454 (Output_symtab_xindex::do_print_to_mapfile): New function.
16455 (class Output_section): Declare do_print_to_mapflie. Declare
16456 print_to_mapfile in Input_section.
16457 (class Output_segment): Declare new functions.
16458 * object.h (Sized_relobj::symbol_count): New function.
16459 * script-sections.cc
16460 (Output_section_element_dot_assignment::set_section_addresses):
16461 Change Output_data_fixed_space to Output_data_zero_fill.
16462 (Output_data_expression::do_print_to_mapfile): New function.
16463 * script.cc (read_input_script): Add mapfile parameter. Change
16464 all callers.
16465 * script.h (read_input_script): Update declaration.
16466 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16467 (Eh_frame::do_print_to_mapfile): New function.
16468 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16469 (Output_merge_string::do_print_to_mapfile): New function.
16470 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16471 function.
16472 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16473 function.
16474 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16475 function.
16476 * Makefile.am (CCFILES): Add mapfile.cc.
16477 (HFILES): Add mapfile.h.
16478 * Makefile.in: Rebuild.
16479
16480 2008-05-19 Ian Lance Taylor <iant@google.com>
16481
16482 * options.h (class General_options): Add -z relro.
16483 * layout.cc (Layout::Layout): Initialize relro_segment_.
16484 (Layout::add_output_section_data): Return the output section.
16485 (Layout::make_output_section): Rcognize relro sections and mark
16486 them appropriately.
16487 (Layout::attach_allocated_section_to_segment): Put relro sections
16488 in a PT_GNU_RELRO segment.
16489 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16490 section as relro.
16491 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16492 PT_TLS segments.
16493 (Layout::linkonce_mapping): Map d.rel.ro.local to
16494 .data.rel.ro.local.
16495 (Layout::output_section_name): Us .data.rel.ro.local for any
16496 section which begins with that.
16497 * layout.h (class Layout): Update add_output_section_data
16498 declaration. Add relro_segment_ field.
16499 * output.cc (Output_section::Output_section): Initialize is_relro_
16500 and is_relro_local_ fields.
16501 (Output_segment::add_output_section): Group relro sections.
16502 (Output_segment::is_first_section_relro): New function.
16503 (Output_segment::maximum_alignment): If there is a relro section,
16504 align the segment to the common page size.
16505 (Output_segment::set_section_addresses): Track whether we are
16506 looking at relro sections. If the last section is a relro
16507 section, align to the common page size.
16508 (Output_segment::set_section_list_addresses): Add in_relro
16509 parameter. Change all callers. Align to the page size when
16510 moving from relro to non-relro section.
16511 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16512 segment.
16513 * output.h (class Output_section): Add is_relro_ and
16514 is_relro_local_ fields.
16515 (Output_section::is_relro): New function.
16516 (Output_section::set_is_relro): New function.
16517 (Output_section::is_relro_local): New function.
16518 (Output_section::set_is_relro_local): New function.
16519 (class Output_segment): Update declarations.
16520 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16521 * sparc.cc (Target_sparc::got_section): Likewise.
16522 * x86_64.cc (Target_x86_64::got_section): Likewise.
16523 * testsuite/relro_test_main.cc: New file.
16524 * testsuite/relro_test.cc: New file.
16525 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16526 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16527 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16528 (relro_test.so, relro_test_pic.o): New targets.
16529 * testsuite/Makefile.in: Rebuild.
16530
16531 2008-05-16 Ian Lance Taylor <iant@google.com>
16532
16533 * output.cc (Output_segment::add_output_section): Remove front
16534 parameter.
16535 * output.h (class Output_segment): Remove
16536 add_initial_output_section and overloaded add_output_section.
16537 Update declaration of remaining add_output_section.
16538 * layout.cc (Layout::create_interp): Call add_output_section
16539 rather than add_initial_output_section.
16540 (Layout::finish_dynamic_section): Likewise.
16541
16542 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16543 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16544 know the dynamic type.
16545 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16546 field. Initialize it in constructor.
16547 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16548 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16549 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16550 reloc.
16551
16552 * output.cc (Output_reloc::get_address): Change return type to
16553 Elf_Addr.
16554 * output.h (class Output_reloc): Update get_address declaration.
16555 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16556 for section addresses.
16557
16558 2008-05-09 Ian Lance Taylor <iant@google.com>
16559
16560 PR 6493
16561 * gold.cc (gold_nomem): Use return value of write.
16562
16563 2008-05-08 Ian Lance Taylor <iant@google.com>
16564
16565 * symtab.c (Symbol::init_base_output_data): Add version
16566 parameter. Change all callers.
16567 (Symbol::init_base_output_segment): Likewise.
16568 (Symbol::init_base_constant): Likewise.
16569 (Symbol::init_base_undefined): Likewise.
16570 (Sized_symbol::init_output_data): Likewise.
16571 (Sized_symbol::init_output_segment): Likewise.
16572 (Sized_symbol::init_constant): Likewise.
16573 (Sized_symbol::init_undefined): Likewise.
16574 (Symbol_table::do_define_in_output_data): If the new symbol has a
16575 version, mark it as the default.
16576 (Symbol_table::do_define_in_output_segment): Likewise.
16577 (Symbol_table::do_define_as_constant): Likewise.
16578 * symtab.h (class Symbol): Update declarations.
16579 (class Sized_symbol): Likewise.
16580 * resolve.cc (Symbol::override_version): New function.
16581 (Symbol::override_base): Call override_version.
16582 (Symbol::override_base_with_special): Likewise.
16583 * testsuite/ver_script_8.script: New file.
16584 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16585 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16586 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16587 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16588
16589 2008-05-06 Ian Lance Taylor <iant@google.com>
16590
16591 PR 6049
16592 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16593 functions.
16594 (class General_options): Remove existing --undefined, and add
16595 --no-undefined instead. Add new --undefined as synonym for -u.
16596 * archive.cc (Archive::add_symbols): Check whether symbol was
16597 named with -u.
16598 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16599 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16600 all uses. Add IS_UNDEFINED. Update declarations to split
16601 different versions of init_base. Declare init_base_undefined.
16602 (Symbol::is_defined): Handle IS_UNDEFINED.
16603 (Symbol::is_undefined): Likewise.
16604 (Symbol::is_weak_undefined): Call is_undefined.
16605 (Symbol::is_absolute): Handle IS_CONSTANT.
16606 (class Sized_symbol): Update declarations to split different
16607 versions of init. Declare init_undefined.
16608 (class Symbol_table): Declare new functions.
16609 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16610 Change all callers.
16611 (Symbol::init_base_output_data): Likewise.
16612 (Symbol::init_base_output_segment): Likewise.
16613 (Symbol::init_base_constant): Likewise.
16614 (Symbol::init_base_undefined): New function.
16615 (Sized_symbol::init_object): Rename from init. Change all
16616 callers.
16617 (Sized_symbol::init_output_data): Likewise.
16618 (Sized_symbol::init_output_segment): Likewise.
16619 (Sized_symbol::init_constant): Likewise.
16620 (Sized_symbol::init_undefined): New function.
16621 (Symbol_table::add_undefined_symbols_from_command_line): New
16622 function.
16623 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16624 function.
16625 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16626 (Symbol::output_section): Likewise.
16627 (Symbol::set_output_section): Likewise.
16628 (Symbol_table::sized_finalize_symbol): Likewise.
16629 (Symbol_table::sized_write_globals): Likewise.
16630 * resolve.cc (Symbol_table::should_override): Likewise.
16631 (Symbol::override_base_with_special): Likewise.
16632
16633 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16634 symbol, change it to have default visibility.
16635 * testsuite/protected_1.cc: New file.
16636 * testsuite/protected_2.cc: New file.
16637 * testsuite/protected_3.cc: New file.
16638 * testsuite/protected_main_1.cc: New file.
16639 * testsuite/protected_main_2.cc: New file.
16640 * testsuite/protected_main_3.cc: New file.
16641 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16642 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16643 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16644 (protected_1.so): New target.
16645 (protected_1_pic.o, protected_2_pic.o): New targets.
16646 (protected_3_pic.o): New target.
16647 (check_PROGRAMS): Add protected_2.
16648 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16649 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16650 * testsuite/Makefile.in: Rebuild.
16651
16652 * options.h (DEFINE_var): Add set_user_set_##varname__.
16653 (DEFINE_bool_alias): New macro.
16654 (class General_options): Define -Bstatic using DEFINE_bool_alias
16655 rather than DEFINE_special. Add --undefined as an alias for -z
16656 defs.
16657 * options.cc (General_options::parse_Bstatic): Remove.
16658
16659 * options.h (class General_options): Add --fatal-warnings.
16660 * main.cc (main): Implement --fatal-warnings.
16661 * errors.h (Errors::warning_count): New function.
16662
16663 * options.h (class General_options): Add -Bsymbolic-functions.
16664 * symtab.h (Symbol::is_preemptible): Check for
16665 -Bsymbolic-functions.
16666
16667 2008-05-05 Ian Lance Taylor <iant@google.com>
16668
16669 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16670 as noVARNAME rather than no-VARNAME.
16671 (class General_options): Add option -z combreloc.
16672 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16673 get_address.
16674 (Output_reloc::sort_before) [SHT_REL]: New function.
16675 (Output_reloc::sort_before) [SHT_RELA]: New function.
16676 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16677 Sort_relocs_comparison.
16678 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16679 parameter. Change all callers.
16680 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16681 sort_relocs parameter. Change all callers.
16682 * output.cc (Output_reloc::get_address): New function, broken out
16683 of write_rel.
16684 (Output_reloc::write_rel): Call it.
16685 (Output_reloc::compare): New function.
16686 (Output_data_reloc_base::do_write): Optionally sort relocs.
16687
16688 * configure.ac: If targ_extra_obj is set, link it in.
16689 * configure.tgt: Initialize all variables.
16690 (x86_64*): Set targ_extra_obj and targ_extra_size.
16691 * configure: Rebuild.
16692
16693 * object.cc (Sized_relobj::include_section_group): Adjust section
16694 indexes read from group data. Build vector to pass to
16695 layout_group.
16696 * layout.cc (Layout::layout_group): Add flags and shndxes
16697 parameters. Remove contents parameter. Change caller. Update
16698 explicit instantiations.
16699 * layout.h (class Layout): Update layout_group declaration.
16700 * output.cc (Output_data_group::Output_data_group): Add flags and
16701 input_shndxes parameters. Remove contents parameter. Change
16702 caller.
16703 (Output_data_group::do_write): Change input_sections_ to
16704 input_shndxes_.
16705 * output.h (class Output_data_group): Update constructor
16706 declaration. Rename input_sections_ to input_shndxes_.
16707 * testsuite/many_sections_test.cc: Add template.
16708
16709 2008-04-30 Cary Coutant <ccoutant@google.com>
16710
16711 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16712
16713 * layout.cc (Layout::include_section): Refactored check for debug
16714 info section.
16715 (Layout::add_comdat): Add new parameters. Change type
16716 of signature parameter. Add object and shndx to signatures table.
16717 (Layout::find_kept_object): New function.
16718 * layout.h: Include <cstring>.
16719 (Layout::is_debug_info_section): New function.
16720 (Layout::add_comdat): Add new parameters.
16721 (Layout::find_kept_object): New function.
16722 (Layout::Kept_section): New struct.
16723 (Layout::Signatures): Change type of map range.
16724 * object.cc (Relobj::output_section_address): New function.
16725 (Sized_relobj::include_section_group): Add new parameters. Change
16726 calls to Layout::add_comdat. Change to build table of kept comdat
16727 groups and table mapping discarded sections to kept sections.
16728 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16729 (Sized_relobj::do_layout): Change calls to include_section_group and
16730 include_linkonce_section.
16731 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16732 value to zero when section is discarded.
16733 (Sized_relobj::map_to_kept_section): New function.
16734 * object.h (Relobj::output_section_address): New function.
16735 (Relobj::Comdat_group): New type.
16736 (Relobj::find_comdat_group): New function.
16737 (Relobj::Comdat_group_table): New type.
16738 (Relobj::Kept_comdat_section): New type.
16739 (Relobj::Kept_comdat_section_table): New type.
16740 (Relobj::add_comdat_group): New function.
16741 (Relobj::set_kept_comdat_section): New function.
16742 (Relobj::get_kept_comdat_section): New function.
16743 (Relobj::comdat_groups_): New field.
16744 (Relobj::kept_comdat_sections_): New field.
16745 (Symbol_value::input_value): Update comment.
16746 (Sized_relobj::map_to_kept_section) New function.
16747 (Sized_relobj::include_linkonce_section): Add new parameter.
16748 * target-reloc.h (Comdat_behavior): New type.
16749 (get_comdat_behavior): New function.
16750 (relocate_section): Add code to map a discarded section to the
16751 corresponding kept section when applying a relocation.
16752
16753 2008-04-30 Craig Silverstein <csilvers@google.com>
16754
16755 * dwarf_reader.cc (next_generation_count): New static var.
16756 (Addr2line_cache_entry): New struct.
16757 (addr2line_cache): New static var.
16758 (Dwarf_line_info::one_addr2line): Added caching.
16759 (Dwarf_line_info::clear_addr2line_cache): New function.
16760 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16761 cache-size parameter.
16762 (Dwarf_line_info::one_addr2line_cache): New function.
16763 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16764 new cache-size argument to one_addr2line(), and clear cache.
16765
16766 2008-04-28 Cary Coutant <ccoutant@google.com>
16767
16768 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16769 R_386_PC8 relocations.
16770
16771 2008-04-23 Ian Lance Taylor <iant@google.com>
16772
16773 * object.cc (Sized_relobj::include_section_group): Check for
16774 invalid section group.
16775
16776 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16777 header size.
16778
16779 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16780 than read for file header.
16781 * archive.cc (Archive::include_member): Likewise.
16782
16783 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16784
16785 * aclocal.m4: Regenerate.
16786 * configure: Regenerate.
16787
16788 2008-04-19 Ian Lance Taylor <iant@google.com>
16789
16790 * version.cc (version_string): Bump to 1.6.
16791
16792 * testsuite/Makefile.am (many_sections_r_test): New target.
16793 (many_sections_r_test_SOURCES): Remove.
16794 (many_sections_r_test_DEPENDENCIES): Remove.
16795 (many_sections_r_test_LDFLAGS): Remove.
16796 (many_sections_r_test_LDADD): Remove.
16797
16798 * object.cc (Sized_relobj::do_add_symbols): Always pass
16799 local_symbol_count_ to add_from_relobj.
16800
16801 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16802 every thousand variables.
16803 * testsuite/Makefile.in: Rebuild.
16804
16805 * object.cc (Xindex::initialize_symtab_xindex): New function.
16806 (Xindex::read_symtab_xindex): New function.
16807 (Xindex::sym_xindex_to_shndx): New function.
16808 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16809 available.
16810 (Sized_relobj::do_initialize_xindex): New function.
16811 (Sized_relobj::do_read_symbols): Adjust section links.
16812 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16813 parameter. Change all callers.
16814 (Sized_relobj::include_section_group): Adjust section links and
16815 symbol section indexes.
16816 (Sized_relobj::do_layout): Adjust section links.
16817 (Sized_relobj::do_count_local_symbols): Adjust section links and
16818 symbol section indexes.
16819 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16820 ordinary and special symbols.
16821 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16822 dynsym_xindex parameters. Change all callers. Adjust section
16823 links. Use SHN_XINDEX when needed.
16824 (Sized_relobj::get_symbol_location_info): Adjust section links.
16825 Don't get fooled by special symbols.
16826 * object.h (class Xindex): Define.
16827 (class Object): Add xindex_ parameter. Declare virtual functoin
16828 do_initialize_xindex.
16829 (Object::adjust_sym_shndx): New function.
16830 (Object::set_xindex): New protected function.
16831 (class Symbol_value): Add is_ordinary_shndx_ field.
16832 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16833 (Symbol_value::value): Assert ordinary section.
16834 (Symbol_value::initialize_input_to_output_map): Likewise.
16835 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16836 Change all callers.
16837 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16838 all callers.
16839 (class Sized_relobj): Update declarations.
16840 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16841 parameter. Change all callers.
16842 (Sized_relobj::adjust_shndx): New function.
16843 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16844 field.
16845 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16846 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16847 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16848 (Sized_dynobj::read_dynsym_section): Adjust section links.
16849 (Sized_dynobj::read_dynamic): Likewise.
16850 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16851 section links.
16852 (Sized_dynobj::do_initialize_xindex): New function.
16853 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16854 do_initialize_xindex.
16855 (Sized_dynobj::adjust_shndx): New function.
16856 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16857 dynsym_xindex_ fields.
16858 (Layout::finalize): Add a call to set_section_indexes before
16859 creating the symtab sections.
16860 (Layout::set_section_indexes): Don't do anything if the section
16861 already has a section index.
16862 (Layout::create_symtab_sections): Add shnum parameter. Change
16863 caller. Create .symtab_shndx section if needed.
16864 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16865 caller.
16866 (Layout::allocated_output_section_count): New function.
16867 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16868 needed.
16869 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16870 fields. Update declarations.
16871 (Layout::symtab_xindex): New function.
16872 (Layout::dynsym_xindex): New function.
16873 (class Write_symbols_task): Add layout_ field.
16874 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16875 Change caller.
16876 * output.cc (Output_section_headers::Output_section_headers): Add
16877 shstrtab_section parameter. Change all callers.
16878 (Output_section_headers::do_sized_write): Store overflow values
16879 for section count and section string table section index in
16880 section header zero.
16881 (Output_file_header::do_sized_write): Check for overflow of
16882 section count and section string table section index.
16883 (Output_symtab_xindex::do_write): New function.
16884 (Output_symtab_xindex::endian_do_write): New function.
16885 * output.h (class Output_section_headers): Add shstrtab_section_.
16886 Update declarations.
16887 (class Output_symtab_xindex): Define.
16888 (Output_section::has_out_shndx): New function.
16889 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16890 field.
16891 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16892 Change all callers.
16893 (Sized_symbol::init): Likewise.
16894 (Symbol::output_section): Check for ordinary symbol.
16895 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16896 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16897 callers.
16898 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16899 Change all callers. Simplify handling of symbols from sections
16900 not included in the link.
16901 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16902 distinction.
16903 (Weak_alias_sorter::operator()): Assert that symbols are
16904 ordinary.
16905 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16906 distinction.
16907 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16908 parameters. Change all callers.
16909 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16910 symbol distinction. Use SHN_XINDEX when needed.
16911 (Symbol_table::write_section_symbol): Add symtab_xindex
16912 parameter. Change all callers.
16913 (Symbol_table::sized_write_section_symbol): Likewise. Use
16914 SHN_XINDEX when needed.
16915 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16916 declarations.
16917 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16918 (Symbol::is_defined): Check is_ordinary.
16919 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16920 (Symbol::is_absolute, Symbol::is_common): Likewise.
16921 (class Sized_symbol): Update declarations.
16922 (class Symbol_table): Update declarations.
16923 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16924 parameters. Change all callers.
16925 (Sized_symbol::override): Likewise.
16926 (Symbol_table::override): Likewise.
16927 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16928 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16929 is_ordinary, and orig_st_shndx parameters. Change all callers.
16930 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16931 to be in an ordinary section.
16932 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16933 object and is_ordinary parameters. Change all callers.
16934 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16935 Change all callers. Don't add undefined or non-ordinary symbols
16936 to reloc_map_.
16937 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16938 Change all callers.
16939 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16940 declarations.
16941 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16942 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16943 (Sized_relobj::relocate_sections): Likewise.
16944 * target-reloc.h (scan_relocs): Adjust section symbol index.
16945 (scan_relocatable_relocs): Likewise.
16946 * i386.cc (Scan::local): Check for ordinary symbols.
16947 * sparc.cc (Scan::local): Likewise.
16948 * x86_64.cc (Scan::local): Likewise.
16949 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16950 to symbol_section_and_value.
16951 * testsuite/many_sections_test.cc: New file.
16952 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16953 (check_PROGRAMS): Add many_sections_test.
16954 (many_sections_test_SOURCES): Define.
16955 (many_sections_test_DEPENDENCIES): Define.
16956 (many_sections_test_LDFLAGS): Define.
16957 (BUILT_SOURCES): Add many_sections_define.h.
16958 (many_sections_define.h): New target.
16959 (BUILT_SOURCES): Add many_sections_check.h.
16960 (many_sections_check.h): New target.
16961 (check_PROGRAMS): Add many_sections_r_test.
16962 (many_sections_r_test_SOURCES): Define.
16963 (many_sections_r_test_DEPENDENCIES): Define.
16964 (many_sections_r_test_LDFLAGS): Define.
16965 (many_sections_r_test_LDADD): Define.
16966 (many_sections_r_test.o): New target.
16967 * testsuite/Makefile.in: Rebuild.
16968
16969 2008-04-17 Cary Coutant <ccoutant@google.com>
16970
16971 * errors.cc (Errors::info): New function.
16972 (gold_info): New function.
16973 * errors.h (Errors::info): New function.
16974 * gold.h (gold_info): New function.
16975 * object.cc (Input_objects::add_object): Print trace output.
16976 * options.cc (options::parse_set): New function.
16977 (General_options::parse_wrap): Deleted.
16978 (General_options::General_options): Deleted initializer.
16979 * options.h (options::String_set): New typedef.
16980 (options::parse_set): New function.
16981 (DEFINE_set): New macro.
16982 (General_options::wrap): Changed to use DEFINE_set. Changed
16983 callers of any_wrap_symbols and is_wrap_symbol.
16984 (General_options::trace, General_options::trace_symbol):
16985 New options.
16986 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16987 (General_options::wrap_symbols_): Deleted.
16988 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16989
16990 2008-04-17 David S. Miller <davem@davemloft.net>
16991
16992 * options.cc (General_options::parse_V): New function.
16993 * options.h: Add entries for -V and -Qy.
16994
16995 2008-04-17 Ian Lance Taylor <iant@google.com>
16996
16997 * common.cc (Symbol_table::allocate_commons): Remove options
16998 parameter. Change caller.
16999 (Symbol_table::do_allocate_commons): Remove options parameter.
17000 Change caller. Just call do_allocate_commons_list twice.
17001 (Symbol_table::do_allocate_commons_list): New function, broken out
17002 of do_allocate_commons.
17003 * common.h (class Allocate_commons_task): Remove options_ field.
17004 Update constructor.
17005 * symtab.cc (Symbol_table::Symbol_table): Initialize
17006 tls_commons_.
17007 (Symbol_table::add_from_object): Put TLS common symbols on
17008 tls_commons_ list.
17009 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17010 which are IN_OUTPUT_DATA.
17011 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17012 allocate_commons and do_allocate_commons declarations. Declare
17013 do_allocate_commons_list.
17014 * gold.cc (queue_middle_tasks): Update creation of
17015 Allocate_commons_task to not pass options.
17016 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17017 (TLS_TEST_C_FLAGS): New variable.
17018 (tls_test_c_pic.o): New target.
17019 (tls_test_shared.so): Link in tls_test_c_pic.o.
17020 (tls_test_c_pic_ie.o): New target.
17021 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17022 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17023 (tls_test_c.o): New target.
17024 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17025 (tls_pic_test_LDADD): Likewise.
17026 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17027 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17028 (tls_test_c_gnu2.o): New target.
17029 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17030 tls_test_c_gnu2.o.
17031 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17032 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17033 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17034 * testsuite/tls_test.cc: Include "config.h".
17035 (t_last): Call t11_last.
17036 * testsuite/tls_test.h (t11, t11_last): Declare.
17037 * testsuite/tls_test_c.c: New file.
17038 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17039 * configure.ac: Check for OpenMP support.
17040 * configure, config.in, Makefile.in: Rebuild.
17041 * testsuite/Makefile.in: Rebuild.
17042
17043 2008-04-16 Cary Coutant <ccoutant@google.com>
17044
17045 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17046 (Target_i386::tls_base_symbol_defined_): New field.
17047 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17048 (Target_i386::Scan::global): Likewise.
17049 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17050 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17051 (Target_x86_64::tls_base_symbol_defined_): New field.
17052 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17053 (Target_x86_64::Scan::global): Likewise.
17054
17055 2008-04-16 Cary Coutant <ccoutant@google.com>
17056
17057 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17058 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17059 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17060 building shared libraries.
17061 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17062 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17063 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17064 * testsuite/Makefile.in: Rebuild.
17065 * testsuite/weak_undef.h: New file.
17066 * testsuite/weak_undef_file1.cc: Add extra test cases.
17067 * testsuite/weak_undef_file2.cc: Likewise.
17068 * testsuite/weak_undef_test.cc: Likewise.
17069
17070 2008-04-16 David S. Miller <davem@davemloft.net>
17071
17072 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17073 Add issued_non_pic_error_ field. Declare check_non_pic.
17074 (Target_sparc::Scan::check_non_pic): New function.
17075 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17076 (Target_sparc::Scan::global): Likewise.
17077
17078 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17079 * configure: Rebuild.
17080
17081 * options.h (DEFINE_enable): New macro.
17082 (new_dtags): New enable option.
17083 (initfirst, interpose, loadfltr, nodefaultlib,
17084 nodelete, nodlopen, nodump): New -z options.
17085 * layout.cc (Layout:finish_dynamic_section): If new
17086 dtags enabled, emit DT_RUNPATH. Also, emit a
17087 DT_FLAGS_1 containing any specified -z flags.
17088
17089 2008-04-16 Ian Lance Taylor <iant@google.com>
17090
17091 * copy-relocs.cc: New file.
17092 * copy-relocs.h: New file.
17093 * reloc.cc: Remove Copy_relocs code.
17094 * reloc.h: Likewise.
17095 * reloc-types.h (struct Reloc_types) [both versions]: Add
17096 get_reloc_addend_noerror.
17097 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17098 variants of add_global which take an addend which must be zero.
17099 * i386.cc: Include "copy-relocs.h".
17100 (class Target_i386): Change type of copy_relocs_ to variable,
17101 update initializer.
17102 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17103 Change all callers.
17104 (Target_i386::do_finalize_sections): Change handling of
17105 copy_relocs_.
17106 * sparc.cc: Include "copy-relocs.h".
17107 (class Target_sparc): Change type of copy_relocs_ to variable,
17108 update initializer.
17109 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17110 Change all callers.
17111 (Target_sparc::do_finalize_sections): Change handling of
17112 copy_relocs_.
17113 * x86_64.cc: Include "copy-relocs.h".
17114 (class Target_x86_64): Change type of copy_relocs_ to variable,
17115 update initializer.
17116 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17117 class. Change all callers.
17118 (Target_x86_64::do_finalize_sections): Change handling of
17119 copy_relocs_.
17120 * Makefile.am (CCFILES): Add copy-relocs.cc.
17121 (HFILES): Add copy-relocs.h.
17122
17123 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17124
17125 * testsuite/script_test_4.sh: Permit leading zeroes.
17126
17127 2008-04-15 Ian Lance Taylor <iant@google.com>
17128
17129 * script-sections.cc (Script_sections::create_segments): Use
17130 header_size_adjustment even when there is enough room for the
17131 headers.
17132 * testsuite/script_test_4.sh: New file.
17133 * testsuite/script_test_4.t: New file.
17134 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17135 (check_DATA): Add script_test_4.stdout.
17136 (MOSTLYCLEANFILES): Likewise.
17137 (script_test_4): New target.
17138 (script_test_4.stdout): New target.
17139 * testsuite/Makefile.in: Rebuild.
17140
17141 * sparc.cc: Add definitions for Output_data_plt_sparc class
17142 constants.
17143
17144 2008-04-14 David S. Miller <davem@davemloft.net>
17145
17146 * sparc.cc: New file.
17147 * Makefile.am (TARGETSOURCES): Add sparc.cc
17148 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17149 * configure.tgt: Document targ_extra_size and
17150 targ_extra_big_endian. Add entries for sparc-* and
17151 sparc64-*.
17152 * configure.ac: Handle targ_extra_size and
17153 targ_extra_big_endian.
17154 * Makefile.in: Rebuild.
17155 * configure: Likewise.
17156 * po/POTFILES.in: Likewise.
17157 * po/gold.pot: Likewise.
17158
17159 2008-04-14 Ian Lance Taylor <iant@google.com>
17160
17161 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17162 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17163 in the name/type/flags to section mapping. Don't call
17164 allocate_output_section.
17165 (Layout::choose_output_section): Change parameter from adjust_name
17166 to is_input_section. Don't permit input sections after sections
17167 are attached to segments. Don't call allocate_output_section.
17168 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17169 not write_enable_output_section.
17170 (Layout::make_output_section): Don't push to
17171 unattached_section_list_ nor call attach_to_segment. Call
17172 attach_section_to_segment if sections are attached.
17173 (Layout::attach_sections_to_segments): New function.
17174 (Layout::attach_section_to_segment): New function.
17175 (Layout::attach_allocated_section_to_segment): Rename from
17176 attach_to_segment. Remove flags parameter.
17177 (Layout::allocate_output_section): Remove function.
17178 (Layout::write_enable_output_section): Remove function.
17179 * layout.h (class Layout): Update for above changes. Add new
17180 field sections_are_attached_.
17181 * output.h (Output_section::update_flags_for_input_section): New
17182 function.
17183 * output.cc (Output_section::add_input_section): Call
17184 update_flags_for_input_section.
17185 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17186
17187 2008-04-11 Cary Coutant <ccoutant@google.com>
17188
17189 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17190 thought unnecessary.
17191 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17192
17193 2008-04-11 Ian Lance Taylor <iant@google.com>
17194
17195 * output.h (class Output_section_data): Remove inline definition
17196 of set_addralign.
17197 * output.cc (Output_section_data::set_addralign): New function.
17198
17199 2008-04-11 Cary Coutant <ccoutant@google.com>
17200
17201 Add support for TLS descriptors for i386 and x86_64.
17202 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17203 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17204 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17205 GOT_TYPE_TLS_DESC.
17206 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17207 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17208 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17209 relocations.
17210 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17211 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17212 Fix problem with initial-exec relocations.
17213 (Target_i386::Relocate::relocate_tls): Likewise.
17214 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17215 relaxation.
17216 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17217 support for section-plus-offset dynamic table entries.
17218 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17219 (Output_data_dynamic::Dynamic_entry): Add support for
17220 section-plus-offset dynamic table entries.
17221 (Output_data_dynamic::Classification): Likewise.
17222 (Output_data_dynamic::classification_): Renamed offset_.
17223 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17224 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17225 (Target_x86_64::make_plt_section): New function.
17226 (Target_x86_64::reserve_tlsdesc_entries): New function.
17227 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17228 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17229 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17230 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17231 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17232 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17233 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17234 add extra PLT entry for TLS descriptors.
17235 (Output_data_plt_x86_64::got_): New field.
17236 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17237 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17238 fields.
17239 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17240 descriptors.
17241 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17242 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17243 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17244 R_386_TLS_DESC_CALL relocations.
17245 (Target_x86_64::Scan::global): Likewise.
17246 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17247 for TLS descriptors.
17248 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17249 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17250 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17251 GD-to-IE relaxation.
17252 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17253 and TLS_DESCRIPTORS.
17254 * Makefile.in: Rebuild.
17255 * configure: Rebuild.
17256 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17257 (tls_test_shared2.so): New target.
17258 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17259 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17260 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17261 (tls_shared_gd_to_ie_test_LDADD): New variable.
17262 (tls_shared_gnu2_gd_to_ie_test): New target.
17263 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17264 New targets.
17265 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17266 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17267 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17268 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17269 (tls_shared_gnu2_test): New target.
17270 (tls_test_gnu2_shared.so): New target.
17271 (tls_shared_gnu2_test_SOURCES): New variable.
17272 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17273 (tls_shared_gnu2_test_LDFLAGS): New variable.
17274 (tls_shared_gnu2_test_LDADD): New variable.
17275 * testsuite/Makefile.in: Rebuild.
17276 * testsuite/Makefile.
17277
17278 2008-04-11 Ian Lance Taylor <iant@google.com>
17279
17280 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17281 justsyms.t.
17282 * testsuite/Makefile.in: Rebuild.
17283
17284 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17285 long.
17286 * testsuite/script_test_2.cc (main): Adjust test.
17287
17288 2008-04-11 David S. Miller <davem@davemloft.net>
17289 Ian Lance Taylor <iant@google.com>
17290
17291 * options.h (General_options): Add entries for '-Y' and
17292 '-relax'.
17293 * options.cc (General_options:finalize): If -Y was used, add those
17294 entries to the library path instead of the default "/lib" and
17295 "/usr/lib".
17296
17297 2008-04-11 David S. Miller <davem@davemloft.net>
17298
17299 * testsuite/justsyms.t: Start at 0x100.
17300 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17301 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17302 long.
17303 * testsuite/script_test_2.cc: Adjust string and section length
17304 checks.
17305
17306 2008-04-09 Ian Lance Taylor <iant@google.com>
17307
17308 PR gold/5996
17309 * script-sections.cc (Sections_element::allocate_to_segment): Add
17310 orphan parameter.
17311 (Output_section_definition::allocate_to_segment): Likewise.
17312 (Orphan_output_section::allocate_to_segment): Likewise.
17313 (Script_sections::attach_sections_using_phdrs_clause): Don't
17314 propagate non-PT_LOAD segments to orphan sections.
17315 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17316 readelf rather than objdump.
17317 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17318 .interp section and PT_INTERP segment are the same size.
17319 * testsuite/Makefile.in: Rebuild.
17320
17321 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17322 aliases for symbols defined in the same object.
17323 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17324 (weak_alias_test_SOURCES): New variable.
17325 (weak_alias_test_DEPENDENCIES): New variable.
17326 (weak_alias_test_LDFLAGS): New variable.
17327 (weak_alias_test_LDADD): New variable.
17328 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17329 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17330 (weak_alias_test_3.o): New target.
17331 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17332 * testsuite/weak_alias_test_main.cc: New file.
17333 * testsuite/weak_alias_test_1.cc: New file.
17334 * testsuite/weak_alias_test_2.cc: New file.
17335 * testsuite/weak_alias_test_3.cc: New file.
17336
17337 2008-04-08 Ian Lance Taylor <iant@google.com>
17338
17339 * options.h (class General_options): Add --noinhibit-exec option.
17340 * main.cc (main): Check --noinhibit-exec.
17341
17342 * options.h (class General_options): Define --wrap as a special
17343 option. Add wrap_symbols_ field.
17344 (General_options::any_wrap_symbols): New function.
17345 (General_options::is_wrap_symbol): New function.
17346 * options.cc (General_options::parse_wrap): New function.
17347 (General_options::General_options): Initialize wrap_symbols_.
17348 * symtab.cc (Symbol_table::wrap_symbol): New function.
17349 (Symbol_table::add_from_object): Handle --wrap.
17350 * symtab.h (class Symbol_table): Declare wrap_symbol.
17351 * target.h (Target::wrap_char): New function.
17352 (Target::Target_info): Add wrap_char field.
17353 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17354 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17355 * testsuite/testfile.cc (Target_test::test_target_info):
17356 Likewise.
17357
17358 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17359 there is one.
17360
17361 * layout.h (class Layout): Add added_eh_frame_data_ field.
17362 * layout.cc (Layout::Layout): Initialize new field.
17363 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17364 output section until we find a section we merged successfully.
17365 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17366 that the size be non-zero.
17367
17368 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17369 qualifier.
17370
17371 2008-04-08 Craig Silverstein <csilvers@google.com>
17372
17373 * configure.ac: Export new conditional variable HAVE_ZLIB.
17374 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17375 on HAVE_ZLIB.
17376 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17377 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17378
17379 2008-04-07 Ian Lance Taylor <iant@google.com>
17380
17381 * version.cc (version_string): Set to "1.5".
17382
17383 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17384 Add issued_non_pic_error_ field. Declare check_non_pic.
17385 (Target_x86_64::Scan::check_non_pic): New function.
17386 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17387 (Target_x86_64::Scan::global): Likewise.
17388
17389 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17390 addend parameter. Change caller. Handle merge sections.
17391 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17392 Address to Addend. Don't add in the result of
17393 local_section_offset, pass down the addend and use the returned
17394 value.
17395 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17396 Update declarations of local_section_offset and symbol_value.
17397 * testsuite/two_file_test_1.cc (t18): New function.
17398 * testsuite/two_file_test_2.cc (f18): New function.
17399 * testsuite/two_file_test_main.cc (main): Call t18.
17400 * testsuite/two_file_test.h (t18, f18): Declare.
17401
17402 * configure.ac: Don't test for objdump, c++filt, or readelf.
17403 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17404 conditionals.
17405 (TEST_READELF): New variable.
17406 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17407 (check_PROGRAMS): Add two_file_strip_test.
17408 (two_file_strip_test): New target.
17409 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17410 (two_file_same_shared_strip_test_SOURCES): New variable.
17411 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17412 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17413 (two_file_same_shared_strip_test_LDADD): New variable.
17414 (two_file_shared_strip.so): New target.
17415 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17416 (ver_test_5.syms, ver_test_7.syms): Likewise.
17417 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17418 (strip_test_3.stdout): Use TEST_OBJDUMP.
17419 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17420
17421 2008-04-04 Cary Coutant <ccoutant@google.com>
17422
17423 * symtab.h (Symbol::is_weak_undefined): New function.
17424 (Symbol::is_strong_undefined): New function.
17425 (Symbol::is_absolute): New function.
17426 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17427 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17428 absolute symbols.
17429 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17430 (weak_undef_test): New target.
17431 * testsuite/Makefile.in: Rebuild.
17432 * testsuite/weak_undef_file1.cc: New file.
17433 * testsuite/weak_undef_file2.cc: New file.
17434 * testsuite/weak_undef_test.cc: New file.
17435
17436 2008-04-03 Craig Silverstein <csilvers@google.com>
17437
17438 * compressed_output.h (class Output_compressed_section): Use
17439 unsigned buffer.
17440 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17441 add zlib header.
17442 (zlib_compressed_suffix): Removed.
17443 (Output_compressed_section::set_final_data_size): Use unsigned
17444 buffers.
17445 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17446 Fix linker invocation.
17447 (flagstest_o_specialfile_and_compress_debug_sections):
17448 Likewise.
17449 * testsuite/Makefile.in: Regenerated.
17450
17451 2008-04-02 David S. Miller <davem@davemloft.net>
17452
17453 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17454 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17455
17456 2008-04-02 Craig Silverstein <csilvers@google.com>
17457
17458 * TODO: New file.
17459
17460 2008-04-02 Ian Lance Taylor <iant@google.com>
17461
17462 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17463 parameters. Update for new key type to views_. Change all
17464 callers.
17465 (File_read::read): Adjust for byteshift in returned view.
17466 (File_read::add_view): New function, broken out of
17467 find_and_make_view.
17468 (File_read::make_view): New function, broken out of
17469 find_and_make_view.
17470 (File_read::find_or_make_view): Add offset and aligned
17471 parameters. Rewrite accordingly. Change all callers.
17472 (File_read::get_view): Add offset and aligned parameters. Adjust
17473 for byteshift in return value.
17474 (File_read::get_lasting_view): Likewise.
17475 * fileread.h (class File_read): Update declarations.
17476 (class File_read::View): Add byteshift_ field. Add byteshift to
17477 constructor. Add byteshift method.
17478 * archive.h (Archive::clear_uncached_views): New function.
17479 (Archive::get_view): Add aligned parameter. Change all callers.
17480 * object.h (Object::get_view): Add aligned parameter. Change all
17481 callers.
17482 (Object::get_lasting_view): Likewise.
17483
17484 * fileread.cc (File_read::release): Don't call clear_views if
17485 there are multiple objects.
17486 * fileread.h (File_read::clear_uncached_views): New function.
17487 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17488 on the archive.
17489
17490 2008-03-31 Cary Coutant <ccoutant@google.com>
17491
17492 Add thin archive support.
17493 * archive.cc (Archive::armagt): New const.
17494 (Archive::setup): Remove task parameter and calls to unlock.
17495 (Archive::unlock_nested_archives): New function.
17496 (Archive::read_header): Add nested_off parameter. Change
17497 all callers.
17498 (Archive::interpret_header): Likewise.
17499 (Archive::include_all_members): Change to handle thin
17500 archives.
17501 (Archive::include_member): Likewise.
17502 * archive.h (Archive::Archive): Add new parameters and
17503 initializers.
17504 (Archive::armagt): New const.
17505 (Archive::setup): Remove task parameter.
17506 (Archive::unlock_nested_archives): New function.
17507 (Archive::read_header): Add nested_off parameter.
17508 (Archive::interpret_header): Likewise.
17509 (Archive::Nested_archive_table): New typedef.
17510 (Archive::is_thin_archive_): New field.
17511 (Archive::nested_archives_): New field.
17512 (Archive::options_): New field.
17513 (Archive::dirpath_): New field.
17514 (Archive::task_): New field.
17515 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17516 for thin archives. Pass additional parameters to
17517 Archive::Archive. Unlock the archive file after calling
17518 Archive::setup.
17519
17520 2008-03-29 Ian Lance Taylor <iant@google.com>
17521
17522 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17523 version symbol to be local.
17524 * testsuite/ver_test_4.sh: New file.
17525 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17526 (check_DATA): Add ver_test_4.syms.
17527 (ver_test_4.syms): New target.
17528 * testsuite/Makefile.in: Rebuild.
17529
17530 * output.cc
17531 (Output_section::Input_section_sort_entry::has_priority): New
17532 function.
17533 (Output_section::Input_section_sort_entry::match_file_name): New
17534 function.
17535 (Output_section::Input_section_sort_entry::match_section_name):
17536 Remove.
17537 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17538 Remove.
17539 (Output_section::Input_section_sort_entry::match_section_file):
17540 Remove.
17541 (Output_section::Input_section_sort_compare::operator()): Rewrite
17542 using new Input_section_sort_entry functions. Sort crtbegin and
17543 crtend first. Sort sections with no priority before sections with
17544 a priority.
17545 * testsuite/initpri1.c (d3): Check j != 4.
17546 (cd5): New constructor/destructor function.
17547 (main): Check j != 2.
17548
17549 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17550 new symbol when resolving, don't call set_is_default.
17551 * testsuite/ver_test_7.cc: New file.
17552 * testsuite/ver_test_7.sh: New file.
17553 * testsuite/Makefile.am (ver_test_7.so): New target.
17554 (ver_test_7.o): New target.
17555 (check_SCRIPTS): Add ver_test_7.sh.
17556 (check_DATA): Add ver_test_7.syms.
17557 (ver_test_7.syms): New target.
17558
17559 2008-03-28 Ian Lance Taylor <iant@google.com>
17560
17561 * layout.cc (Layout::layout): If we see an input section with a
17562 name that needs sorting, set the must_sort flag for the output
17563 section.
17564 (Layout::make_output_section): If the name of the output section
17565 indicates that it might require sorting, set the may_sort flag.
17566 * output.h (Output_section::may_sort_attached_input_sections): New
17567 function.
17568 (Output_section::set_may_sort_attached_input_sections): New
17569 function.
17570 (Output_section::must_sort_attached_input_sections): New
17571 function.
17572 (Output_section::set_must_sort_attached_input_sections): New
17573 function.
17574 (class Output_section): Declare Input_section_sort_entry. Define
17575 Input_section_sort_compare. Declare
17576 sort_attached_input_sections. Add new fields:
17577 may_sort_attached_input_sections_,
17578 must_sort_attached_input_sections_,
17579 attached_input_sections_are_sorted_.
17580 * output.cc (Output_section::Output_section): Initialize new
17581 fields.
17582 (Output_section::add_input_section): Add an entry to
17583 input_sections_ if may_sort or must_sort are true.
17584 (Output_section::set_final_data_size): Call
17585 sort_attached_input_sections if necessary.
17586 (Output_section::Input_section_sort_entry): Define new class.
17587 (Output_section::Input_section_sort_compare::operator()): New
17588 function.
17589 (Output_section::sort_attached_input_sections): New function.
17590 * configure.ac: Check whether the compiler supports constructor
17591 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17592 * testsuite/initpri1.c: New file.
17593 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17594 CONSTRUCTOR_PRIORITY.
17595 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17596 (initpri1_LDFLAGS): New variable.
17597 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17598
17599 2008-03-27 Ian Lance Taylor <iant@google.com>
17600
17601 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17602 * testsuite/common_test_1.c: New file.
17603 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17604 (common_test_1_SOURCES): New variable.
17605 (common_test_1_DEPENDENCIES): New variable.
17606 (common_test_1_LDFLAGS): New variable.
17607
17608 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17609 and commons_ correctly when NAME/VERSION does not override
17610 NAME/NULL.
17611 * testsuite/ver_test_6.c: New file.
17612 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17613 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17614 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17615
17616 2008-03-26 Ian Lance Taylor <iant@google.com>
17617
17618 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17619 of an undefined symbol from a version script.
17620 * testsuite/Makefile.am (ver_test_5.so): New target.
17621 (ver_test_5.o): New target.
17622 (check_SCRIPTS): Add ver_test_5.sh.
17623 (check_DATA): Add ver_test_5.syms.
17624 (ver_test_5.syms): New target.
17625 * testsuite/ver_test_5.cc: New file.
17626 * testsuite/ver_test_5.script: New file.
17627 * testsuite/ver_test_5.sh: New file.
17628 * Makefile.in, testsuite/Makefile.in: Rebuild.
17629
17630 PR gold/5986
17631 Fix problems building gold with gcc 4.3.0.
17632 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17633 (gold_error_at_location, gold_warning_at_location): Use it.
17634 * configure.ac: Check whether we can compile and use a template
17635 function with a printf attribute.
17636 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17637 when jumping over bytes.
17638 * object.cc: Instantiate Object::read_section_data.
17639 * debug.h: Include <cstring>
17640 * dwarf_reader.cc: Include <algorithm>
17641 * main.cc: Include <cstring>.
17642 * options.cc: Include <cstring>.
17643 * output.cc: Include <cstring>.
17644 * script.cc: Include <cstring>.
17645 * script.h: Include <string>.
17646 * symtab.cc: Include <cstring> and <algorithm>.
17647 * target-select.cc: Include <cstring>.
17648 * version.cc: Include <string>.
17649 * testsuite/testmain.cc: Include <cstdlib>.
17650 * configure, config.in: Rebuild.
17651
17652 2008-03-25 Ian Lance Taylor <iant@google.com>
17653
17654 * options.cc: Include "../bfd/bfdver.h".
17655 (options::help): Print bug reporting address.
17656
17657 * version.cc (print_version): Adjust output for current value of
17658 BFD_VERSION_STRING.
17659
17660 * NEWS: New file.
17661
17662 * options.cc (options::help): Print list of supported targets.
17663 * target-select.h: Include <vector>.
17664 (class Target_selector): Make machine_, size_, and is_big_endian_
17665 fields const. Add bfd_name_ and instantiated_target_ fields.
17666 (Target_selector::Target_selector): Add bfd_name parameter.
17667 (Target_selector::recognize): Make non-virtual, call
17668 do_recognize.
17669 (Target_selector::recognize_by_name): Make non-virtual, call
17670 do_recognize_by_name.
17671 (Target_selector::supported_names): New function.
17672 (Target_selector::bfd_name): New function.
17673 (Target_selector::do_instantiate_target): New pure virtual
17674 function.
17675 (Target_selector::do_recognize): New virtual function.
17676 (Target_selector::do_recognize_by_name): New virtual function.
17677 (Target_selector::instantiate_target): New private function.
17678 (supported_target_names): Declare.
17679 * target-select.cc (Target_selector::Target_selector): Update for
17680 new parameter and fields.
17681 (select_target_by_name): Check that the name matches before
17682 calling recognize_by_name.
17683 (supported_target_names): New function.
17684 * i386.cc (class Target_selector_i386): Update Target_selector
17685 constructor call. Remove recognize and recognize_by_name. Add
17686 do_instantiate_target.
17687 * x86_64.cc (class Target_selector_x86_64): Likewise.
17688 * testsuite/testfile.cc (class Target_selector_test): Update for
17689 changes to Target_selector.
17690
17691 * README: Rewrite, with some notes on unsupported features.
17692
17693 2008-03-24 Cary Coutant <ccoutant@google.com>
17694
17695 * i386.cc (Target_i386::Got_type): New enum declaration.
17696 (Target_i386::Scan::local): Updated callers of Output_data_got
17697 member functions.
17698 (Target_i386::Scan::global): Likewise.
17699 (Target_i386::Relocate::relocate): Likewise.
17700 (Target_i386::Relocate::relocate_tls): Likewise.
17701 * object.h (Got_offset_list): New class.
17702 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17703 (Sized_relobj::local_got_offset): Likewise.
17704 (Sized_relobj::set_local_got_offset): Likewise.
17705 (Sized_relobj::local_has_tls_got_offset): Removed.
17706 (Sized_relobj::local_tls_got_offset): Removed.
17707 (Sized_relobj::set_local_tls_got_offset): Removed.
17708 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17709 * output.cc (Output_data_got::add_global): Added got_type parameter.
17710 (Output_data_got::add_global_with_rel): Likewise.
17711 (Output_data_got::add_global_with_rela): Likewise.
17712 (Output_data_got::add_global_pair_with_rel): New function.
17713 (Output_data_got::add_global_pair_with_rela): New function.
17714 (Output_data_got::add_local): Added got_type parameter.
17715 (Output_data_got::add_local_with_rel): Likewise.
17716 (Output_data_got::add_local_with_rela): Likewise.
17717 (Output_data_got::add_local_pair_with_rel): New function.
17718 (Output_data_got::add_local_pair_with_rela): New function.
17719 (Output_data_got::add_global_tls): Removed.
17720 (Output_data_got::add_global_tls_with_rel): Removed.
17721 (Output_data_got::add_global_tls_with_rela): Removed.
17722 (Output_data_got::add_local_tls): Removed.
17723 (Output_data_got::add_local_tls_with_rel): Removed.
17724 (Output_data_got::add_local_tls_with_rela): Removed.
17725 * output.h (Output_data_got::add_global): Added got_type parameter.
17726 (Output_data_got::add_global_with_rel): Likewise.
17727 (Output_data_got::add_global_with_rela): Likewise.
17728 (Output_data_got::add_global_pair_with_rel): New function.
17729 (Output_data_got::add_global_pair_with_rela): New function.
17730 (Output_data_got::add_local): Added got_type parameter.
17731 (Output_data_got::add_local_with_rel): Likewise.
17732 (Output_data_got::add_local_with_rela): Likewise.
17733 (Output_data_got::add_local_pair_with_rel): New function.
17734 (Output_data_got::add_local_pair_with_rela): New function.
17735 (Output_data_got::add_global_tls): Removed.
17736 (Output_data_got::add_global_tls_with_rel): Removed.
17737 (Output_data_got::add_global_tls_with_rela): Removed.
17738 (Output_data_got::add_local_tls): Removed.
17739 (Output_data_got::add_local_tls_with_rel): Removed.
17740 (Output_data_got::add_local_tls_with_rela): Removed.
17741 * resolve.cc (Symbol::override_base_with_special): Removed
17742 reference to has_got_offset_ field.
17743 * symtab.cc (Symbol::init_fields): Replaced initialization
17744 of got_offset_ with got_offsets_. Removed initialization
17745 of has_got_offset_
17746 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17747 (Symbol::got_offset): Likewise.
17748 (Symbol::set_got_offset): Likewise.
17749 (Symbol::has_tls_got_offset): Removed.
17750 (Symbol::tls_got_offset): Removed.
17751 (Symbol::set_tls_got_offset): Removed.
17752 (Symbol::got_offset_): Removed.
17753 (Symbol::tls_mod_got_offset_): Removed.
17754 (Symbol::tls_pair_got_offset_): Removed.
17755 (Symbol::got_offsets_): New field.
17756 (Symbol::has_got_offset): Removed.
17757 (Symbol::has_tls_mod_got_offset): Removed.
17758 (Symbol::has_tls_pair_got_offset): Removed.
17759 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17760 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17761 member functions.
17762 (Target_x86_64::Scan::global): Likewise.
17763 (Target_x86_64::Relocate::relocate): Likewise.
17764 (Target_x86_64::Relocate::relocate_tls): Likewise.
17765
17766 2008-03-25 Ben Elliston <bje@au.ibm.com>
17767
17768 * yyscript.y: Fix spelling error in comment.
17769
17770 2008-03-24 Ian Lance Taylor <iant@google.com>
17771
17772 * options.h (class General_options): Define build_id option.
17773 * layout.h (class Layout): Declare write_build_id, create_note,
17774 create_build_id. Add build_id_note_ member.
17775 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17776 "libiberty.h", "md5.h", "sha1.h".
17777 (Layout::Layout): Initialize eh_frame_data_,
17778 eh_frame_hdr_section_, and build_id_note_.
17779 (Layout::finalize): Call create_build_id.
17780 (Layout::create_note): New function, broken out of
17781 Layout::create_gold_note.
17782 (Layout::create_gold_note): Call create_note.
17783 (Layout::create_build_id): New function.
17784 (Layout::write_build_id): New function.
17785 (Close_task_runner::run): Call write_build_id.
17786
17787 * x86_64.cc: Correct license to GPLv3.
17788
17789 2008-03-23 Ian Lance Taylor <iant@google.com>
17790
17791 * options.cc: Include "demangle.h".
17792 (parse_optional_string): New function.
17793 (parse_long_option): Handle takes_optional_argument.
17794 (parse_short_option): Update dash_z initializer. Handle
17795 takes_optional_argument.
17796 (General_options::General_options): Initialize do_demangle_.
17797 (General_options::finalize): Set do_demangle_. Handle demangling
17798 style.
17799 * options.h (parse_optional_string): Declare.
17800 (struct One_option): Add optional_arg field. Update constructor.
17801 Update call constructor calls. Add takes_optional_argument
17802 function.
17803 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17804 (DEFINE_optional_string): Define.
17805 (General_options::demangle): Change from DEFINE_bool to
17806 DEFINE_optional_string.
17807 (General_options::no_demangle): New function.
17808 (General_options::do_demangle): New function.
17809 (General_options::set_do_demangle): New function.
17810 (General_options::execstack_status_): Move definition to end of
17811 class definition.
17812 (General_options::static_): Likewise.
17813 (General_options::do_demangle_): New field.
17814 * object.cc (big_endian>::get_symbol_location_info): Call
17815 Options::do_demangle, not Options::demangle.
17816 * symtab.cc (demangle): Likewise.
17817
17818 2008-03-22 Ian Lance Taylor <iant@google.com>
17819
17820 * gold.h: Include <cstddef> and <sys/types.h>
17821 * options.h: Include <cstring>.
17822
17823 2008-03-21 Ian Lance Taylor <iant@google.com>
17824
17825 * Added source code to GNU binutils.
17826 \f
17827 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17828
17829 Copying and distribution of this file, with or without modification,
17830 are permitted in any medium without royalty provided the copyright
17831 notice and this notice are preserved.
17832
17833 Local Variables:
17834 mode: change-log
17835 left-margin: 8
17836 fill-column: 74
17837 version-control: never
17838 End:
This page took 0.452258 seconds and 4 git commands to generate.