Patch for PR gold/19042 - unsupported reloc 311/312.
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-10.27 Han Shen <shenhan@google.com>
2
3 PR gold/19042 - unsupported reloc 311/312.
4
5 * aarch64.cc (Target_aarch64::Scan::local): Add support for
6 reloc 311/312.
7
8 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
9
10 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
11 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
12 as R_X86_64_GOTPCREL.
13 (Target_x86_64<size>::Scan::local): Likewise.
14 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
15 Likewise.
16 (Target_x86_64<size>::Scan::global): Likewise.
17 (Target_x86_64<size>::Relocate::relocate): Likewise.
18 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
19 Likewise.
20
21 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
22
23 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
24 R_386_GOT32X the same as R_386_GOT32.
25 (Target_i386::Scan::local): Likewise.
26 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
27 (Target_i386::Scan::global): Likewise.
28 (Target_i386::Relocate::relocate): Likewise.
29 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
30 Likewise.
31
32 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
33
34 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
35 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
36 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
37 x86_64_mov_to_lea1.o.
38 * testsuite/Makefile.in: Regenerated.
39
40 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
41
42 PR gold/19119
43 * options.h (General_options): Remove "obsolete" from -m.
44 * parameters.cc (set_parameters_target): Check if input target
45 is compatible with output emulation set by "-m emulation".
46
47 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
48
49 PR gold/19118
50 * i386.cc (Target_iamcu): New class.
51 (Target_selector_iamcu): Likewise.
52 (Target_iamcu::iamcu_info): New variable.
53 (target_selector_iamcu): Likewise.
54
55 2015-10-07 Andreas Schwab <schwab@suse.de>
56
57 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
58
59 2015-10-06 Cary Coutant <ccoutant@gmail.com>
60
61 PR gold/18855
62 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
63 parameter.
64 (Sparc_relocate_functions::gdop_lox10): Likewise.
65 (Target_sparc::Relocate::relocate): Use addend when computing
66 symbol value for R_SPARC_GOTDATA_OP*.
67
68 2015-09-07 Cary Coutant <ccoutant@gmail.com>
69
70 PR gold/18930
71 PR gold/18886
72 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
73 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
74
75 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
76
77 PR gold/18886
78 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
79 shared libraries into normal FUNC symbols.
80 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
81 symbols aren't from shared libraries.
82
83 2015-09-02 Alan Modra <amodra@gmail.com>
84
85 PR 18878
86 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
87 (Target_powerpc::Branch_info::make_stub): Determine whether long
88 branch stub is for save/restore function.
89 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
90 (Stub_table): Add need_save_res_.
91 (Stub_table:clear_stubs): Clear need_save_res_.
92 (Stub_table:set_address_and_size): Add save/restore section size.
93 (Stub_table::add_long_branch_entry): Add save_res param. Set
94 need_save_res_, but don't add space for save/restore stubs.
95 (Stub_table::find_long_branch_entry): Return offset to local copy
96 of save/restore func.
97 (Stub_table::do_write): Don't output save/restore stubs. Instead
98 copy the save/restore functions.
99 (Output_data_save_res:contents): New accessor.
100 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
101
102 2015-08-25 Cary Coutant <ccoutant@gmail.com>
103
104 PR gold/18847
105 * script-sections.cc (Memory_region::set_address): New method.
106 (Script_sections::find_memory_region): Add explicit_only parameter.
107 (Output_section_definition::set_section_addresses): Handle case where
108 script specifies both address and vma region.
109 * script-sections.h (Script_sections::find_memory_region): Add
110 explicit_only parameter.
111
112 2015-08-25 Cary Coutant <ccoutant@gmail.com>
113
114 PR gold/18859
115 * object.cc (Input_objects::add_object): Store objects in a map,
116 indexed by soname; update as-needed flag when necessary.
117 * object.h (Object::clear_as_needed): New method.
118 (Input_objects::so_names_): Change from set to map.
119
120 2015-08-25 Cary Coutant <ccoutant@gmail.com>
121
122 PR gold/14746
123 * expression.cc (Expression::Expression_eval_info): Add
124 is_valid_pointer field.
125 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
126 Adjust all callers.
127 (Addr_expression::value_from_output_section): Check whether address
128 is valid.
129 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
130 if evaluation failed due to address that is not yet valid.
131 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
132 parameter.
133
134 2015-08-25 Cary Coutant <ccoutant@gmail.com>
135
136 PR gold/18866
137 PR gold/18703
138 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
139
140 2015-08-20 Alan Modra <amodra@gmail.com>
141
142 PR gold/18846
143 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
144 Subtract os->address() from addend.
145 * powerpc.cc (relocate_relocs): Likewise.
146
147 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
148
149 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
150 lazy_stub_normal_1, lazy_stub_normal_1_n64,
151 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
152 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
153 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
154 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
155 of 'addu/daddu'.
156
157 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
158
159 * configure: Regenerated.
160
161 2015-07-26 Doug Kwan <dougkwan@google.com>
162
163 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
164 disassembler output format.
165
166 2015-07-23 Ian Coolidge <icoolidge@google.com>
167 Plumb --pic-veneer option for gold.
168
169 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
170 generation.
171 * options.h (General_options): Add --pic-veneer option.
172
173 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
174
175 PR gold/18663
176 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
177 script_test_1a.cc script_test_1b.cc.
178 (script_test_11_r.o): Replace script_test_11.o with
179 script_test_11a.o script_test_11b.o.
180 (script_test_11.o): Removed.
181 (script_test_11a.o): New.
182 (script_test_11b.o): Likewise.
183 * testsuite/Makefile.in: Regenerated.
184 * testsuite/script_test_1.h: New file.
185 * testsuite/script_test_1b.cc: Likewise.
186 * testsuite/script_test_11.h: Likewise.
187 * testsuite/script_test_11b.c: Likewise.
188 * testsuite/script_test_1.cc: Renamed to ...
189 * testsuite/script_test_1a.cc: This.
190 Include "script_test_1.h".
191 (main): Call check_int and check_ptr.
192 * testsuite/script_test_11.c: Renamed to ...
193 * testsuite/script_test_11a.c: This.
194 Include "script_test_11.h".
195 (main): Call ptr_equal.
196
197 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
198
199 PR gold/18628
200 * testsuite/ifuncdep2.c (global): Change protected to hidden.
201 * testsuite/ifuncmod1.c (global): Likewise.
202 * testsuite/ifuncmod5.c (global): Likewise.
203
204 2015-07-22 Alan Modra <amodra@gmail.com>
205
206 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
207
208 2015-07-21 Cary Coutant <ccoutant@gmail.com>
209
210 PR gold/18548
211 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
212 forced local symbol even when oldsym != NULL.
213 (Symbol_table::do_define_in_output_segment): Likewise.
214 (Symbol_table::do_define_as_constant): Likewise.
215
216 2015-07-21 Cary Coutant <ccoutant@gmail.com>
217
218 PR gold/18698
219 * archive.cc (Library_base::should_include_member): Don't use entry
220 point for relocatable links, or if target is not yet valid.
221 * parameters.cc (Parameters::entry): Check target_valid().
222
223 2015-07-20 Han Shen <shenhan@google.com>
224
225 Optimize erratum 843419 fix.
226
227 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
228 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
229 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
230 (E843419_stub): New sub-class of Erratum_stub.
231 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
232 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
233 (AArch64_relobj::create_erratum_stub): Add 1 argument.
234 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
235
236 2015-07-20 Han Shen <shenhan@google.com>
237
238 Fix arm elf header flags wrt hardfp bit.
239
240 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
241
242 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
243
244 PR gold/18689
245 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
246 from input group section for relocatable link.
247 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
248 (check_DATA): Add pr18689.stdout.
249 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
250 (pr18689.stdout): New rule.
251 (pr18689a.o): Likewise.
252 (pr18689b.o): Likewise.
253 (pr18689.o): Likewise.
254 * testsuite/pr18689.c: New file.
255 * testsuite/pr18689.sh: Likewise.
256 * testsuite/Makefile.in: Regenerated.
257
258 2015-07-20 Yiran Wang <yiran@google.com>
259 Cary Coutant <ccoutant@gmail.com>
260
261 PR gold/15574
262 * resolve.cc (Symbol_table): Remove warning about references
263 from shared objects to hidden symbols.
264 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
265 * testsuite/Makefile.in: Regenerate.
266 * testsuite/hidden_test.sh: Check dynamic symbol table; update
267 expected error messages.
268
269 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
270
271 * compressed_output.cc (Output_compressed_section::set_final_data_size):
272 Make --compress-debug-sections=zlib the same as
273 --compress-debug-sections=zlib-gabi.
274 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
275 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
276 ".zdebug_".
277 * testsuite/Makefile.in: Regenerated.
278
279 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
280
281 PR gold/18322
282 * compressed_output.cc (zlib_compress): Add argument for
283 compression header size. Set header size to compression header
284 size if it isn't 0. Don't write out the zlib header here.
285 (Output_compressed_section::set_final_data_size): Support
286 zlib-gnu and zlib-gabi compressions. Pass compression header
287 size to zlib_compress and write out compression header. Set
288 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
289 clear the SHF_COMPRESSED bit
290 * options.h (compress_debug_sections): Add zlib-gnu and
291 zlib-gabi.
292 * output.h (Output_section::set_flags): New.
293 * testsuite/Makefile.am (check_PROGRAMS): Add
294 flagstest_compress_debug_sections_none,
295 flagstest_compress_debug_sections_gnu and
296 flagstest_compress_debug_sections_gabi.
297 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
298 flagstest_compress_debug_sections.stdout,
299 flagstest_compress_debug_sections.cmp,
300 flagstest_compress_debug_sections.check,
301 flagstest_compress_debug_sections_gnu.stdout,
302 flagstest_compress_debug_sections_gnu.cmp,
303 flagstest_compress_debug_sections_gnu.check,
304 flagstest_compress_debug_sections_gabi.stdout,
305 flagstest_compress_debug_sections_gabi.cmp and
306 flagstest_compress_debug_sections_gabi.check.
307 (flagstest_compress_debug_sections_none): New.
308 (flagstest_compress_debug_sections_none.stdout): Likewise.
309 (flagstest_compress_debug_sections.stdout): Likewise.
310 (flagstest_compress_debug_sections.check): Likewise.
311 (flagstest_compress_debug_sections.cmp): Likewise.
312 (flagstest_compress_debug_sections_gnu): Likewise.
313 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
314 (flagstest_compress_debug_sections_gnu.check): Likewise.
315 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
316 (flagstest_compress_debug_sections_gabi): Likewise.
317 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
318 (flagstest_compress_debug_sections_gnu.check): Likewise.
319 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
320 * testsuite/Makefile.in: Regenerated.
321
322 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
323
324 PR gold/18321
325 * compressed_output.h (decompress_input_section): Add arguments
326 for ELF class, big endian and sh_flags.
327 * compressed_output.cc (decompress_input_section): Likewise.
328 Support the SHF_COMPRESSED section.
329 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
330 functions.
331 * plugin.h (Pluginobj): Likewise.
332 * layout.cc (Layout::get_output_section_flags): Also clear the
333 SHF_COMPRESSED bit.
334 * object.h (Compressed_section_info): Add flag to store sh_flags.
335 (Object): Add pure virtual elfsize and is_big_endian member
336 functions.
337 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
338 prefix here.
339 (build_compressed_section_map): Check SHF_COMPRESSED for
340 uncompressed size. Store sh_flags in Compressed_section_info.
341 Pass size, big_endian and sh_flags to decompress_input_section.
342 Skip the ".debug"/".zdebug" prefix when passing section name to
343 need_decompressed_section.
344 (Sized_relobj_file<size, big_endian>::do_find_special_section):
345 Don't check ".zdebug_*" sections.
346 (Object::decompressed_section_contents): Pass ELF class, big
347 endian and sh_flags to decompress_input_section.
348 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
349 Likewise.
350 * testsuite/Makefile.am (check_DATA): Add
351 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
352 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
353 gdb_index_test_2_gabi.stdout.
354 (debug_msg_cdebug_gabi.o): New.
355 (odr_violation1_cdebug_gabi.o): Likewise.
356 (odr_violation2_cdebug_gabi.o): Likewise.
357 (debug_msg_cdebug_gabi.err): Likewise.
358 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
359 (gdb_index_test_cdebug_gabi.o): Likewise.
360 (gdb_index_test_2_gabi): Likewise.
361 (gdb_index_test_2_gabi.stdout): Likewise.
362 * testsuite/gdb_index_test_2_gabi.sh: New file.
363 * testsuite/Makefile.in: Regenerated.
364
365 2015-07-09 Han Shen <shenhan@google.com>
366
367 Use "gold_info" instead of "gold_warning" for erratum fix.
368
369 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
370 'gold_info'.
371 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
372
373 2015-07-09 Han Shen <shenhan@google.com>
374
375 Drop missing symbol warning for arm/aarch64.
376
377 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
378 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
379 symbol warning.
380
381 2015-07-07 Han Shen <shenhan@google.com>
382
383 Make gold aarch64 accept long form of mapping symbols.
384
385 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
386 of mapping symbols.
387
388 2015-06-29 Doug Kwan <dougkwan@google.com>
389
390 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
391 at address expected by test.
392 * testsuite/arm_cortex_a8_b.s: Ditto.
393 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
394 * testsuite/arm_cortex_a8_bl.s: Ditto.
395 * testsuite/arm_cortex_a8_blx.s: Ditto.
396 * testsuite/arm_cortex_a8_local.s: Ditto.
397 * testsuite/arm_fix_v4bx.s: Ditto.
398 * testsuite/arm_unaligned_reloc.s: Ditto.
399 * testsuite/thumb_bl_out_of_range.s: Ditto.
400 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
401 * testsuite/thumb_blx_out_of_range.s: Ditto.
402
403 2015-06-29 Han Shen <shenhan@google.com>
404
405 Patch for erratum 843419 internal error.
406
407 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
408 (Erratum_stub::update_erratum_insn): New method.
409 (Stub_table::relocate_stubs): Modified to place relocated insn.
410 (AArch64_relobj::fix_errata): Modified gold_assert.
411
412 2015-06-12 Han Shen <shenhan@google.com>
413
414 Fix erratum 835769.
415
416 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
417 defintion outside class definition.
418 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
419 (AArch64_insn_utilities::aarch64_op31): New member.
420 (AArch64_insn_utilities::aarch64_ra): New member.
421 (AArch64_insn_utilities::aarch64_mac): New member.
422 (AArch64_insn_utilities::aarch64_mlxl): New member.
423 (ST_E_835769): New global enum member.
424 (Stub_table::relocate_stubs): Add 835769 handler.
425 (Stub_template_repertoire::Stub_template_repertoire): Install new
426 stub type.
427 (AArch64_relobj::scan_errata): This func is renamed from
428 scan_erratum_843419.
429 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
430 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
431 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
432 (Target_aarch64::scan_erratum_835769_span): New method.
433 (Target_aarch64::create_erratum_stub): New method.
434 (Target_aarch64::is_erratum_835769_sequence): New method.
435 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
436 code into create_erratum_stub.
437 * options.h (fix_cortex_a53_835769): New option.
438
439 2015-06-11 Cary Coutant <ccoutant@gmail.com>
440
441 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
442 outside class body.
443 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
444
445 2015-06-11 Cary Coutant <ccoutant@gmail.com>
446
447 PR gold/17731
448 * layout.cc (corresponding_uncompressed_section_name): New function.
449 (Layout::choose_output_section): Call it.
450 * layout.h (corresponding_uncompressed_section_name): New function.
451 * script-sections.cc (Input_section_info::set_section_name): Check
452 for compressed debug section (.zdebug style).
453
454 2015-06-11 Jing Yu <jingyu@google.com>
455
456 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
457 * testsuite/Makefile.in: Regenerate.
458
459 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
460
461 * gold.h (is_cident): Correct typo.
462
463 2015-06-10 Han Shen <shenhan@google.com>
464 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
465
466 Now fixing for 843419 is fully functional.
467
468 The first part of the erratum fix CL is here -
469 https://sourceware.org/ml/binutils/2015-04/msg00229.html
470
471 * aarch64.cc(global enum): New constants representing stub types.
472 (Stub_template): New POD struct.
473 (Stub_template_repertoire): New class.
474 (Stub_base): New class.
475 (Erratum_stub): New class.
476 (Reloc_stub): Refactored to be a subclass of Stub_base.
477 (Reloc_stub::Stub_type): Removed.
478 (Reloc_stub::offset): Moved to Stub_base.
479 (Reloc_stub::set_offset): Moved to Stub_base.
480 (Reloc_stub::destination_address): Moved to Stub_base.
481 (Reloc_stub::set_destination_address): Moved to Stub_base.
482 (Reloc_stub::reset_destination_address): Moved to Stub_base.
483 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
484 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
485 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
486 (Reloc_stub::write): Moved to Stub_base.
487 (Reloc_stub::invalid_offset): Moved to Stub_base.
488 (Reloc_stub::invalid_address): Moved to Stub_base.
489 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
490 (Reloc_stub::stub_insns_): Moved to Stub_base.
491 (Reloc_stub::offset_): Moved to Stub_base.
492 (Reloc_stub::destination_address_): Moved to Stub_base.
493 (Stub_table::The_aarch64_relobj): New typedef.
494 (Stub_table::The_erratum_stub): New typedef.
495 (Stub_table::The_erratum_stub_less): New typedef.
496 (Stub_table::The_erratum_stub_set): New typedef.
497 (Stub_table::The_erratum_stub_set_iter): New typedef.
498 (Stub_table::empty): Added emptiness testing for erratum stubs.
499 (Stub_table::add_erratum_stub): New method to add an erratum stub.
500 (Stub_table::find_erratum_stub): New method.
501 (Stub_table::find_erratum_stubs_for_input_section): New method.
502 (Stub_table::erratum_stub_address): New method.
503 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
504 (Stub_table::do_addralign): Modified to handle erratum stubs.
505 (Stub_table::erratum_stubs_): New member.
506 (Stub_table::erratum_stub_size_): New member.
507 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
508 (Stub_table::do_write): Modified to handle erratum stubs.
509 (AArch64_relobj::The_erratum_stub): New typedef.
510 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
511 (AArch64_relobj::fix_errata): New method.
512 (Target_aarch64::The_reloc_stub_type): Removed.
513 (Target_aarch64::The_erratum_stub): New typede.
514 (AArch64_relocate_functions::construct_b): New method.
515
516 2015-06-08 Nick Clifton <nickc@redhat.com>
517
518 * po/fr.po: New French Translation.
519
520 2015-06-07 Cary Coutant <ccoutant@gmail.com>
521
522 PR gold/18288
523 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
524 callers. Don't use STT_COMMON to check for common symbols.
525 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
526 symbol that's not in a common section.
527 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
528 common symbols.
529
530 2015-06-04 Cary Coutant <ccoutant@gmail.com>
531
532 PR gold/18200
533 * Makefile.am (diststuff): Add target.
534 * Makefile.in: Regenerate.
535
536 2015-06-04 Cary Coutant <ccoutant@gmail.com>
537
538 PR gold/17498
539 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
540 temporary locals in merge sections.
541 * options.cc (General_options::parse_discard_all): New method.
542 (General_options::parse_discard_locals): New method.
543 (General_options::parse_discard_none): New method.
544 (General_options::General_options): Initialize discard_locals_.
545 * options.h (--discard-all): Convert to special option.
546 (--discard-locals): Likewise.
547 (--discard-none): New option.
548 (General_options::discard_all): New method.
549 (General_options::discard_locals): New method.
550 (General_options::discard_sec_merge): New method.
551 (General_options::Discard_locals): New enum.
552 (General_options::discard_locals_): New data member.
553
554 2015-06-03 Cary Coutant <cary@google.com>
555
556 * script-sections.cc (Script_sections::Script_sections): Initialize
557 segments_created_.
558 (Script_sections::create_note_and_tls_segments): Set flag when
559 segments are created.
560 (Script_sections::expected_segment_count): Count PT_INTERP.
561 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
562 segments are created.
563 * script-sections.h (Script_sections::segments_created_): New data
564 member.
565
566 2015-06-03 Cary Coutant <ccoutant@gmail.com>
567
568 PR gold/15370
569 * script-sections.cc
570 (Output_section_element_input::set_section_addresses): When there
571 are several patterns with no sort spec, put all sections in the same
572 bin.
573 * testsuite/Makefile.am (script_test_12): New testcase.
574 (script_test_12i): New testcase.
575 * testsuite/Makefile.in: Regenerate.
576 * testsuite/script_test_12.t: New test linker script.
577 * testsuite/script_test_12i.t: New test linker script.
578 * testsuite/script_test_12a.c: New test source file.
579 * testsuite/script_test_12b.c: New test source file.
580
581 2015-06-02 Cary Coutant <ccoutant@gmail.com>
582
583 * nacl.h (Sniff_file): Switch parameters to get_view to get an
584 aligned view.
585
586 2015-06-03 Cary Coutant <ccoutant@gmail.com>
587
588 PR gold/17819
589 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
590 separate task to schedule the build id computation.
591 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
592 add Output_file and offset.
593 (Hash_task::run): Get and release the input views.
594 (Hash_task::is_runnable): Always return NULL (always runnable).
595 (Layout::queue_build_id_tasks): Remove.
596 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
597 parameters; use them instead of class members.
598 (Build_id_task_runner::run): New function.
599 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
600 to write_build_id.
601 * layout.h (Layout::queue_build_id_tasks): Remove.
602 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
603 parameters.
604 (Layout::array_of_hashes_): Remove.
605 (Layout::size_of_array_of_hashes_): Remove.
606 (Layout::input_view_): Remove.
607 (Build_id_task_runner): New class.
608 (Close_task_runner::Close_task_runner): Add array_of_hashes and
609 size_of_hashes parameters.
610 (Close_task_runner::array_of_hashes_): New data member.
611 (Close_task_runner::size_of_hashes_): New data member.
612 * testsuite/Makefile.am
613 (flagstest_compress_debug_sections_and_build_id_tree): New test.
614 * testsuite/Makefile.in: Regenerate.
615
616 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
617
618 * merge.cc (get_input_merge_map): Update for data structure change.
619 (get_or_make_input_merge_map): Update for data structure change.
620 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
621 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
622
623 2015-05-16 Alan Modra <amodra@gmail.com>
624
625 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
626 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
627 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
628 (lis_0): Rename from lis_0_0.
629
630 2015-04-29 Cary Coutant <cary@google.com>
631 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
632
633 * gc.h (Garbage_collection::is_section_garbage): Change Object*
634 to Relobj*.
635 (Garbage_collection::add_reference): Likewise.
636 (Garbage_collection::gc_process_relocs): Likewise. Don't push
637 object/shndx pair onto *secvec for dynamic objects. Don't follow
638 relocations pointing to dynamic objects for GC.
639 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
640 (Icf::unfold_section): Likewise.
641 (Icf::is_section_folded): Likewise.
642 (Icf::get_folded_section): Likewise.
643 * icf.h: (Icf::get_folded_section): Likewise.
644 (Icf::unfold_section): Likewise.
645 (Icf::is_section_folded): Likewise.
646 (Icf::section_has_function_pointers): Likewise.
647 (Icf::set_section_has_function_pointers): Likewise.
648 * object.h (Section_id): Likewise.
649 (Const_section_id): Likewise.
650 * output.cc (Output_section::update_section_layout): Likewise.
651 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
652 Likewise.
653 * plugin.cc (update_section_order): Likewise.
654 (unique_segment_for_sections): Likewise.
655 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
656 (Target_powerpc::do_gc_add_reference): Likewise.
657 (Target_powerpc::gc_process_relocs): Likewise.
658 (Target_powerpc::do_gc_add_reference): Likewise.
659 * symtab.cc (Symbol_table::is_section_folded): Likewise.
660 (Symbol_table::gc_mark_symbol): Likewise.
661 * symtab.h: (Symbol_table::is_section_folded): Likewise.
662 * target.h: (Sized_target::gc_add_reference): Likewise.
663 (Sized_target::do_gc_add_reference): Likewise.
664
665 2015-04-29 Nick Clifton <nickc@redhat.com>
666
667 * po/fi.po: Updated Finnish translation.
668
669 2015-04-28 Alan Modra <amodra@gmail.com>
670
671 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
672 than unsigned int for find_global_entry result temp. Compare
673 against invalid_address.
674 (Target_powerpc::do_plt_address_for_global): Likewise.
675 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
676 on plt call stub existence for debug info. Do assert for plt
677 and global entry stub existence if an alloc section.
678
679 2015-04-28 Alan Modra <amodra@gmail.com>
680
681 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
682 on missing global entry stub due to bogus debug info.
683
684 2015-04-27 Han Shen <shenhan@google.com>
685
686 * options.h (--fix-cortex-a53-843419): Rename option.
687 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
688 option.
689 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
690
691 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
692
693 PR gold/18327
694 * output.cc (Output_section::is_input_address_mapped): Assume a missing
695 entry is mapped.
696 * testsuite/Makefile.am: Add the eh_test test.
697 * testsuite/Makefile.in: Regenerate.
698 * testsuite/eh_test_a.cc: New test.
699 * testsuite/eh_test_b.cc: New test.
700
701 2015-04-23 Sriraman Tallam <tmsriram@google.com>
702
703 * options.h (--weak-unresolved-symbols): New option.
704 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
705 binding to weak with new option.
706 * symtab.h (is_weak_undefined): Check for new option.
707 (is_strong_undefined): Check for new option.
708 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
709 * testsuite/Makefile.in: Regenerate.
710 * testsuite/weak_unresolved_symbols_test.cc: New file.
711
712 2015-04-20 Ian Coolidge <icoolidge@google.com>
713
714 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
715 GNU_UNIQUE.
716
717 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
718
719 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
720 push_back.
721 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
722 * object.cc (Sized_relobj_file::do_layout): Use push_back.
723 * powerpc.cc (process_gc_mark): Use push_back.
724 (Target_powerpc::do_gc_mark_symbol): Use push_back.
725 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
726
727 2015-04-16 Han Shen <shenhan@google.com>
728
729 * aarch64.cc (AArch64_insn_utilities): New utility class.
730 (AArch64_relobj::Mapping_symbol_position): New struct.
731 (AArch64_relobj::Mapping_symbol_info): New typedef.
732 (AArch64_relobj::do_count_local_symbols): New function overriding
733 parent's implementation.
734 (AArch64_relobj::mapping_symbol_info_): New member
735 (AArch64_relobj::scan_erratum_843419): New method.
736 (Target_aarch64::scan_erratum_843419_span): New method.
737 (Target_aarch64::is_erratum_843419_sequence): New method.
738 * options.h (fix_cortex_a53): New option.
739
740 2015-04-09 Cary Coutant <ccoutant@google.com>
741
742 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
743 in a PIE link.
744 * testsuite/Makefile.am (tls_pie_test.sh): New test.
745 * testsuite/Makefile.in: Regenerate.
746 * testsuite/tls_pie_test.sh: New.
747
748 2015-04-09 Cary Coutant <ccoutant@google.com>
749
750 * debug.h (DEBUG_LOCATION): New.
751 (DEBUG_ALL): Include DEBUG_LOCATION.
752 (debug_string_to_enum): Add DEBUG_LOCATION.
753 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
754 output to print correct context.
755 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
756 up to 4 more locations at the beginning of the function.
757 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
758 result before sorting list of line numbers.
759 * testsuite/debug_msg.sh: Allow range of line numbers for
760 canonical results on optimized code.
761
762 2015-04-07 HC Yen <hc.yen@mediatek.com>
763
764 Add AArch32 support for gold linker.
765 gold/
766 * arm.cc: Add V8 arch combine table.
767
768 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
769
770 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
771
772 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
773
774 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
775 to find by using the return value of insert.
776
777 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
778
779 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
780 constructor call.
781
782 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
783
784 PR gold/17641
785 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
786 (Target_x86_64::Scan::local): Don't create GOT entry, when we
787 can convert mov to lea.
788 (Target_x86_64::Scan::global): Ditto.
789 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
790 %reg to lea foo(%rip), %reg if possible.
791 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
792 * testsuite/x86_64_mov_to_lea1.s: New.
793 * testsuite/x86_64_mov_to_lea2.s: Ditto.
794 * testsuite/x86_64_mov_to_lea3.s: Ditto.
795 * testsuite/x86_64_mov_to_lea4.s: Ditto.
796 * testsuite/x86_64_mov_to_lea.sh: Ditto.
797
798 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
799
800 * configure: Regenerated.
801
802 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
803
804 PR gold/17640
805 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
806 (Target_i386::Scan::local): Don't create GOT entry, when we
807 can convert GOT to GOTOFF.
808 (Target_i386::Scan::global): Ditto.
809 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
810 lea foo@GOTOFF(%reg), %reg if possible.
811 * testsuite/Makefile.am (i386_mov_to_lea): New test.
812 * testsuite/i386_mov_to_lea1.s: New.
813 * testsuite/i386_mov_to_lea2.s: Ditto.
814 * testsuite/i386_mov_to_lea3.s: Ditto.
815 * testsuite/i386_mov_to_lea4.s: Ditto.
816 * testsuite/i386_mov_to_lea5.s: Ditto.
817 * testsuite/i386_mov_to_lea.sh: Ditto.
818
819 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
820
821 * Makefile.am (ZLIB): New.
822 (ZLIBINC): Likewise.
823 (AM_CFLAGS): Add $(ZLIBINC).
824 (AM_CXXFLAGS): Likewise.
825 (ldadd_varldadd_var): Add $(ZLIB).
826 (incremental_dump_LDADD): Likewise.
827 (dwp_LDADD): Likewise.
828 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
829 <zlib.h>.
830 (zlib_compress): Don't check HAVE_ZLIB_H.
831 (zlib_decompress): Likewise.
832 * options.h (compress_debug_sections): Likewise.
833 * configure.ac (AM_CONDITIONAL): Removed.
834 * testsuite/Makefile.am (ZLIB): New.
835 (LDADD): Add $(ZLIB).
836 Don't check HAVE_ZLIB.
837 * Makefile.in: Regenerated.
838 * config.in: Likewise.
839 * configure: Likewise.
840 * testsuite/Makefile.in: Likewise.
841
842 2015-03-30 Jing Yu <jingyu@google.com>
843
844 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
845 TLSLD_ADD_DTPREL_LO12_NC.
846 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
847 _TLS_MODULE_BASE_ point to the start of tls segment.
848 (Target_aarch64::optimize_tls_reloc): Add cases for
849 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
850 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
851 (Target_aarch64::Scan::local): Likewise.
852 (Target_aarch64::Scan::global): Likewise.
853 (Target_aarch64::Relocate::relocate): Likewise.
854 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
855 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
856 relocations.
857
858 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
859
860 * merge.cc (Object_merge_map::add_mapping): call
861 Object_merge_map::Input_merge_map::add_mapping.
862 (Object_merge_map::Input_merge_map::add_mapping): New.
863 (Output_merge_data::do_add_input_section): Call
864 get_or_make_input_merge_map before a loop.
865 (Output_merge_string<Char_type>::finalize_merged_data): Call
866 get_or_make_input_merge_map before a loop.
867 * merge.h (Object_merge_map): Make Input_merge_map public.
868 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
869 (Relobj::get_or_create_merge_map): New.
870 * object.h (Relobj::get_or_create_merge_map): New.
871
872 2015-03-24 Alan Modra <amodra@gmail.com>
873
874 PR 18147
875 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
876 relocation errors for branches to strong undefined symbols.
877
878 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
879
880 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
881 (Object_merge_map::is_merge_section_for): Remove.
882 (Object_merge_map::find_merge_section): New.
883 * merge.h (Object_merge_map::is_merge_section_for): Remove.
884 (Object_merge_map::find_merge_section): New.
885 (Object_merge_map::get_input_merge_map): Add a const version.
886 * object.cc (Relobj::is_merge_section_for): Remove.
887 (Relobj::find_merge_section): New.
888 * object.h (Relobj::is_merge_section_for): Remove.
889 (Relobj::find_merge_section): New.
890 * output.cc
891 (Output_section::Input_section::is_merge_section_for): Remove.
892 (Output_section::add_merge_input_section): Don't call
893 add_merge_input_section.
894 (Output_section::find_merge_section): Return const. Use
895 object->find_merge_section.
896 (Output_section::build_lookup_maps): Don't build a map for
897 merge sections.
898 (Output_section::is_input_address_mapped): Return false if
899 section is not found.
900 (Output_section::find_starting_output_address): Use
901 find_merge_section instead of is_merge_section_for.
902 (Output_section::add_script_input_section): Don't build a map for
903 merge sections.
904 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
905 (Output_section_lookup_maps::find_merge_section): Remove.
906 (Output_section_lookup_maps::add_merge_input_section) Remove.
907 (Output_section::find_merge_section): Return const.
908
909 2015-03-22 Cary Coutant <cary@google.com>
910
911 PR gold/18106
912 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
913 non-SIB form of lea, with nop after the call.
914
915 2015-03-21 Cary Coutant <cary@google.com>
916
917 PR gold/14217
918 * output.cc (Output_segment::is_first_section_relro): Don't ignore
919 .tdata section.
920 (Output_segment::set_section_addresses): Don't align size of relro
921 segment for .tbss.
922
923 2015-03-21 Cary Coutant <cary@google.com>
924
925 PR gold/18010
926 * stringpool.cc (Stringpool_template): Don't optimize if section
927 alignment is greater than sizeof(char).
928
929 2015-03-21 Cary Coutant <cary@google.com>
930
931 PR gold/18048
932 * script-c.h (script_include_directive): Add first_token parameter.
933 * script.cc (script_include_directive): Add first_token parameter, and
934 pass it to read_script_file.
935 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
936 (PARSING_MEMORY_DEF): New tokens.
937 (top): Add new productions for INCLUDE files.
938 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
939 Pass PARSING_LINKER_SCRIPT to script_include_directive.
940 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
941 (section_cmd): Pass PARSING_SECTION_CMDS.
942 (file_or_sections_cmd): Remove.
943 (memory_def): Pass PARSING_MEMORY_DEF.
944 * testsuite/Makefile.am (memory_test_2): New test.
945 * testsuite/Makefile.in: Regenerate.
946 * testsuite/memory_test_inc.t: New script file.
947 * testsuite/memory_test_inc_1.t.src: New script file.
948 * testsuite/memory_test_inc_2.t.src: New script file.
949 * testsuite/memory_test_inc_3.t.src: New script file.
950
951 2015-03-21 Cary Coutant <cary@google.com>
952
953 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
954 (Sized_relobj_dwo::setup): Build compressed section map.
955 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
956 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
957 section map.
958 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
959 compressed_sections_ field.
960 (build_compressed_section_map): Take Object instead of
961 Sized_relobj_file parameter; add decompress_if_needed parameter.
962 (Sized_relobj_file::do_find_special_sections): Store compressed
963 section map in parent Object.
964 (Sized_relobj_file::do_decompressed_section_contents): Move
965 implementation to Object::decompressed_section_contents.
966 (Sized_relobj_file::do_discard_decompressed_sections): Move
967 implementation to Object::discard_decompressed_sections.
968 * object.h (build_compressed_section_map): Declare.
969 (Object::Object): Add compressed_sections_ field.
970 (Object::section_is_compressed): Move implementation here.
971 (Object::decompressed_section_contents): De-virtualize.
972 (Object::discard_decompressed_sections): De-virtualize.
973 (Object::do_section_is_compressed): Delete.
974 (Object::do_decompressed_section_contents): Delete.
975 (Object::set_compressed_sections): New method.
976 (Object::compressed_sections): New method.
977 (Object::compressed_sections_): New data member.
978 (Compressed_section_info, Compressed_section_map): Move to top of file.
979 (Sized_relobj_file::do_section_is_compressed): Delete.
980 (Sized_relobj_file::do_decompressed_section_contents): Delete.
981 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
982 (Sized_relobj_file::compressed_sections_): Move to Object class.
983
984 2015-03-21 Cary Coutant <ccoutant@google.com>
985
986 PR gold/18152
987 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
988 deferred objects.
989
990 2015-03-11 Cary Coutant <ccoutant@google.com>
991
992 * options.cc (General_options::finalize): Don't allow -z relro
993 with incremental linking.
994 * testsuite/Makefile.am (incremental_test): Add -z norelro.
995 (incremental_test_2): Likewise.
996 (incremental_test_3): Likewise.
997 (incremental_test_4): Likewise.
998 (incremental_test_5): Likewise.
999 (incremental_test_6): Likewise.
1000 (incremental_copy_test): Likewise.
1001 (incremental_common_test_1): Likewise.
1002 (incremental_comdat_test_1): Likewise.
1003 * testsuite/Makefile.in: Regenerate.
1004
1005 2015-03-09 Cary Coutant <ccoutant@google.com>
1006
1007 PR gold/14675
1008 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1009 return enum indicating whether .eh_frame section is empty, optimizable,
1010 unrecognized, or an end marker. Adjust explicit instantiations.
1011 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1012 (Eh_frame::add_ehframe_input_section): Change return type.
1013 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1014 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1015 to the .eh_frame output section until we see the end marker.
1016 (Layout::finalize_eh_frame_section): New.
1017 * layout.h: (Layout::finalize_eh_frame_section): New.
1018
1019 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1020
1021 * output.cc (Relobj::initialize_input_to_output_map<size>):
1022 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1023
1024 2015-03-04 Cary Coutant <ccoutant@google.com>
1025
1026 * parameters.cc (Parameters::set_target_once): Call
1027 Target::select_as_default_target just once from here...
1028 (set_parameters_target): ...instead of from here.
1029
1030 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1031
1032 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1033 Output_section_data instead of a Merge_map.
1034 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1035 (Eh_frame::read_cie): Use add_merge_mapping instead of
1036 Merge_map::add_mapping.
1037 (Eh_frame::read_fde): Ditto.
1038 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1039 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1040 merge_map_->get_output_offset.
1041 (Eh_frame::do_is_merge_section_for): Delete.
1042 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1043 instead of a Merge_map.
1044 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1045 Merge_map.
1046 (Eh_frame::do_is_merge_section_for): Delete.
1047 (Eh_frame::merge_map_): Delete.
1048 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1049 and use a Output_section_data instead of a Merge_map.
1050 (Object_merge_map::add_mapping): Ditto.
1051 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1052 (Object_merge_map::is_merge_section_for): Pass in and use a
1053 Output_section_data instead of a Merge_map.
1054 (Merge_map): Delete.
1055 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1056 of merge_map_.get_output_offset.
1057 (Output_merge_base::do_is_merge_section_for): Delete.
1058 (Output_merge_data::do_add_input_section): Use
1059 object->add_merge_mapping instead of add_mapping.
1060 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1061 * merge.h (Merge_map): Delete forward declaration.
1062 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1063 instead of a Merge_map.
1064 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1065 (Object_merge_map::is_merge_section_for): Pass in and use a
1066 Output_section_data instead of a Merge_map.
1067 (Input_merge_map::Object_merge_map::merge_map): Replace with
1068 output_data.
1069 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1070 Output_section_data instead of a Merge_map.
1071 (Merge_map): Delete.
1072 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1073 (Output_merge_base::do_is_merge_section_for): Delete.
1074 (Output_merge_base::add_mapping): Delete.
1075 (Output_merge_base::merge_map_): Delete.
1076 * object.cc (Relobj::initialize_input_to_output_map): New.
1077 (Relobj::initialize_input_to_output_map): New.
1078 (Relobj::merge_output_offset): New.
1079 (Relobj::is_merge_section_for): New.
1080 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1081 bits.
1082 * object.h (Relobj::merge_map): Delete.
1083 (initialize_input_to_output_map): New.
1084 (set_merge_map): Delete.
1085 (add_merge_mapping): New.
1086 (merge_output_offset): New.
1087 (is_merge_section_for): New.
1088 * output.cc (Output_section::Input_section::is_merge_section_for):
1089 Use object->is_merge_section_for.
1090 * output.h (Output_section_data::is_merge_section_for): Delete.
1091 (Output_section_data::do_is_merge_section_for): Delete.
1092 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1093 Use object->initialize_input_to_output_map.
1094 (Merged_symbol_value<size>::value_from_output_section): Use
1095 object->merge_output_offset.
1096
1097 2015-03-02 Peter Collingbourne <pcc@google.com>
1098 Cary Coutant <ccoutant@google.com>
1099
1100 * output.cc (Output_section::add_merge_input_section): Do not
1101 attempt to merge sections with an entsize of 0.
1102
1103 2015-03-02 Khem Raj <raj.khem@gmail.com>
1104
1105 * attributes.h (class Output_attributes_section_data ): Add
1106 do_print_to_mapfile function.
1107
1108 2015-02-24 Alan Modra <amodra@gmail.com>
1109
1110 PR 18010
1111 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1112 complain if value is not a multiple of four.
1113 (Target_powerpc::Relocate::relocate): Correct handling of
1114 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1115
1116 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1117
1118 * configure.ac (default_size): Set to 32 for x32.
1119 * configure: Regenerated.
1120
1121 2015-02-18 Alan Modra <amodra@gmail.com>
1122
1123 PR 17954
1124 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1125 visibility.
1126
1127 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1128
1129 * gc.h (Garbage_collection::add_reference): Don't use find.
1130
1131 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1132
1133 * object.cc (write_local_symbols): avoid std::vector copy.
1134
1135 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1136
1137 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1138
1139 2015-02-09 Mark Wielaard <mjw@redhat.com>
1140
1141 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1142 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1143
1144 2015-02-16 Cary Coutant <ccoutant@google.com>
1145
1146 PR gold/13577
1147 PR gold/16992
1148 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1149 DF_SYMBOLIC if --dynamic-list option is used.
1150 * options.cc (General_options::finalize): --dynamic-list is not
1151 mutually exclusive with -Bsymbolic.
1152 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1153 listed in --dynamic-list.
1154 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1155 -Bsymbolic-functions.
1156 * testsuite/Makefile.in: Regenerate.
1157
1158 2015-02-16 Cary Coutant <ccoutant@google.com>
1159
1160 PR gold/17971
1161 * incremental.cc: Remove redundant include of "output.h".
1162
1163 2015-02-12 Jing Yu <jingyu@google.com>
1164
1165 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1166 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1167 New relocation.
1168 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1169 TLSLE_MOVW_* relocations.
1170 (Target_aarch64::Scan::global): Likewise.
1171 (Target_aarch64::Relocate::relocate): Likewise.
1172 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1173 for new TLSLE_MOVW_* relocations.
1174
1175 2015-02-11 Will Newton <will.newton@linaro.org>
1176
1177 PR gold/13321
1178 * arm.cc (Target_arm::make_plt_section): Create an ARM
1179 state mapping symbol at the start of the PLT.
1180
1181 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1182
1183 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1184 Replace two_file_shared_2.so with two_file_shared_1.so.
1185 * testsuite/Makefile.in: Regenerated.
1186
1187 2015-02-09 Alan Modra <amodra@gmail.com>
1188
1189 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1190 plugin_test_thin.a and defsym_test.
1191 * testsuite/Makefile.in: Regenerate.
1192
1193 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1194
1195 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1196 body.
1197
1198 2015-02-04 Peter Collingbourne <pcc@google.com>
1199
1200 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1201 forwarding symbols when computing symbol resolution info for plugins.
1202 * plugin.h (Plugin_manager::symtab): New method.
1203 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1204
1205 2015-02-03 Cary Coutant <ccoutant@google.com>
1206 Peter Collingbourne <pcc@google.com>
1207
1208 PR gold/15660
1209 * archive.cc (Thin_archive_object_unlocker): New class.
1210 (Archive::include_member): Unlock external members of thin archives.
1211 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1212 (plugin_test_2): Likewise.
1213 (plugin_test_3): Likewise.
1214 (plugin_test_4): Likewise.
1215 (plugin_test_5): Likewise.
1216 (plugin_test_6): Likewise.
1217 (plugin_test_7): Likewise.
1218 (plugin_test_8): Likewise.
1219 (plugin_test_9): Likewise.
1220 (plugin_test_10): Likewise.
1221 (plugin_test_11): New test case.
1222 * testsuite/Makefile.in: Regenerate.
1223 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1224 file to decide whether to claim file.
1225 (all_symbols_read_hook): Likewise.
1226 * testsuite/plugin_test_1.sh: Adjust expected output.
1227 * testsuite/plugin_test_2.sh: Likewise.
1228 * testsuite/plugin_test_3.sh: Likewise.
1229 * testsuite/plugin_test_6.sh: Likewise.
1230 * testsuite/plugin_test_tls.sh: Likewise.
1231 * testsuite/plugin_test_11.sh: New testcase.
1232
1233 2015-02-03 Cary Coutant <ccoutant@google.com>
1234
1235 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1236 file descriptors when debugging enabled. Add debug output.
1237 (Descriptors::release): Add debug output.
1238 (Descriptors::close_some_descriptor): Likewise.
1239 (Descriptors::close_all): Likewise.
1240 * fileread.cc (File_read::lock): Likewise.
1241 (File_read::unlock): Likewise.
1242
1243 2015-02-02 Cary Coutant <ccoutant@google.com>
1244
1245 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1246 executable output file.
1247
1248 2015-01-22 Han Shen <shenhan@google.com>
1249
1250 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1251 (Target_arm::do_plt_address_for_global): New method.
1252 (Target_arm::do_plt_address_for_local): New method.
1253 (Target_arm::rel_irelative_section): New method.
1254 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1255 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1256 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1257 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1258 (Target_arm::Scan::check_non_pic): Add ifunc support.
1259 (Target_arm::Scan::local): Add ifunc support.
1260 (Target_arm::Scan::global): Add ifunc support.
1261 (Target_arm::make_plt_section): New method.
1262 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1263 (Target_arm::make_local_ifunc_plt_entry): New method.
1264 (Target_arm::got_irelative_): New member.
1265 (Target_arm::rel_irelative_): New member.
1266 (Target_arm::got_section): Add creation for got_irelative_.
1267 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1268 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1269 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1270 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1271 (Output_data_plt_arm::IRelative_data): New type.
1272 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1273 (Output_data_plt_arm::add_entry): Add more parameters.
1274 (Output_data_plt_arm::add_relocation): New method.
1275 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1276 (Output_data_plt_arm::rel_irelative): New method.
1277 (Output_data_plt_arm::entry_count): Modified.
1278 (Output_data_plt_arm::address_for_global): New method.
1279 (Output_data_plt_arm::address_for_local): New method.
1280 gold/
1281 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1282 (Output_data_plt_arm::insert_irelative_data): New method.
1283 (Output_data_plt_arm::irelative_rel_): New member.
1284 (Output_data_plt_arm::got_): New member.
1285 (Output_data_plt_arm::got_irelative_): New member.
1286 (Output_data_plt_arm::irelative_count_): New member.
1287 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1288 (Output_data_plt_arm::irelative_data_vec_): New member.
1289 (Output_data_plt_arm::do_write): Write out irelative entries.
1290 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1291 more parameters to ctor.
1292 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1293 more parameters to ctor.
1294 * output.h (Output_data_reloc::add_local_relative): New method.
1295 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1296
1297 2015-01-29 Alan Modra <amodra@gmail.com>
1298
1299 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1300 and GOT_TLSGD to LE optimization.
1301
1302 2015-01-28 Cary Coutant <ccoutant@google.com>
1303
1304 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1305 for undef TLS symbols.
1306 (Target_x86_64::Relocate::relocate_tls): Likewise.
1307 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1308
1309 2015-01-25 Cary Coutant <ccoutant@google.com>
1310
1311 * output.cc (Output_segment::set_section_addresses): Fix calculation
1312 of size of relro segment.
1313
1314 2015-01-22 Alan Modra <amodra@gmail.com>
1315
1316 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1317 condition for need of ifunc plt entry.
1318 (Target_powerpc::Scan::global <got relocs>): Likewise.
1319
1320 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1321
1322 * mips.cc (reloc_high): Add r_sym.
1323 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1324 reloc_high constructor.
1325 (Mips_relocate_functions::relgot16_local): Likewise.
1326 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1327 r_type to decide whether LO16 matches HI16.
1328 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1329 rello16 and relgot16_local.
1330
1331 2015-01-09 Cary Coutant <ccoutant@google.com>
1332
1333 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1334 unless alignment is larger than page size.
1335
1336 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1337 Cary Coutant <ccoutant@google.com>
1338
1339 PR gold/17729
1340 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1341 (DEFAULT_TARGET_X32): Set for x32.
1342 * x86_64.cc (cmp_insn_32): New.
1343 (lea_r10_insn_32): Likewise.
1344 (lea_r11_insn_32): Likewise.
1345 (cmp_insn_64): Likewise.
1346 (lea_r10_insn_64): Likewise.
1347 (lea_r11_insn_64): Likewise.
1348 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1349 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1350 (check_DATA): Add split_x32 files.
1351 (split_x32_[1234n].o): New targets.
1352 (split_x32_[124]): New targets.
1353 (split_x32_[1234r].stdout): New targets.
1354 * testsuite/split_x32.sh: New file.
1355 * testsuite/split_x32_1.s: Likewise.
1356 * testsuite/split_x32_2.s: Likewise.
1357 * testsuite/split_x32_3.s: Likewise.
1358 * testsuite/split_x32_4.s: Likewise.
1359 * testsuite/split_x32_n.s: Likewise.
1360 * configure: Regenerated.
1361 * testsuite/Makefile.in: Likewise.
1362
1363 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1364
1365 PR gold/17809
1366 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1367 x32.
1368
1369 2015-01-02 Alan Modra <amodra@gmail.com>
1370
1371 * version.cc (print_version): Just print current year.
1372 * dwp.cc (print_version): Likewise.
1373
1374 2015-01-01 Alan Modra <amodra@gmail.com>
1375
1376 Update year range in copyright notice of all files.
1377
1378 2014-12-25 Alan Modra <amodra@gmail.com>
1379
1380 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1381 new enums.
1382 (Target_arm::merge_object_attributes, ): Likewise.
1383
1384 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1385
1386 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1387 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1388 AEABI_VFP_args_vfp to check that.
1389 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1390 value and replace hardcoded values by enum values.
1391
1392 2014-12-22 Cary Coutant <ccoutant@google.com>
1393
1394 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1395
1396 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1397
1398 PR gold/14608
1399 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1400 to "return i * i * 3;".
1401
1402 2014-12-16 Cary Coutant <ccoutant@google.com>
1403
1404 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1405 (Mapfile::print_output_data): Use current_data_size() to avoid
1406 assert for sections requiring postprocessing; if address is not valid,
1407 print 0.
1408 (Mapfile::print_output_section): Use current_data_size(); print note
1409 that addresses and sizes are before compression.
1410
1411 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1412
1413 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1414 Cast current_group_size to unsigned long when reporting error.
1415
1416 2014-12-10 Jing Yu <jingyu@google.com>
1417
1418 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1419 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1420 Update error message.
1421 (Target_aarch64::do_relax): Use absolute value of option
1422 stub_group_size. Replace local variable with class member
1423 stub_group_size_.
1424
1425 2014-12-04 Alan Modra <amodra@gmail.com>
1426
1427 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1428 addend of PLTREL24 reloc when not generating a plt stub. Make
1429 max_branch_offset an "Address".
1430 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1431 (Target_powerpc::Relocate::relocate): Likewise.
1432
1433 2014-12-04 Alan Modra <amodra@gmail.com>
1434
1435 PR 17670
1436 * symtab.cc (Symbol::set_undefined): Remove assertion.
1437 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1438 on symbols defined in discarded sections, instead return false.
1439 Rearrange params, update all callers.
1440 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1441 branches to syms in discarded sections.
1442 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1443 undefined and flag as discarded.
1444 (Target_powerpc::Relocate::relocate): Localize variable.
1445
1446 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1447
1448 PR gold/17675
1449 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1450 * testsuite/Makefile.in: Regenerated.
1451
1452 2014-12-03 Alan Modra <amodra@gmail.com>
1453
1454 PR 17566
1455 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1456 when adding dynamic relocations against section symbols.
1457
1458 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1459
1460 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1461 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1462 * options.h (General_options): New -z option (global).
1463
1464 2014-12-01 Cary Coutant <ccoutant@google.com>
1465
1466 PR gold/17578
1467 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1468 is given.
1469 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1470 given but some inputs require executable stack.
1471
1472 2014-11-26 Cary Coutant <ccoutant@google.com>
1473
1474 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1475 .debug_str_offsets; strip .debug_gnu_pubnames and
1476 .debug_gnu_pubtypes.
1477 (lines_only_debug_sections): Strip all four new sections.
1478
1479 2014-11-26 Jing Yu <jingyu@google.com>
1480
1481 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1482 register to be x0 when to relax TLSDESC_LD64_LO12.
1483
1484 2014-11-26 Alan Modra <amodra@gmail.com>
1485
1486 * powerpc.cc (struct Stub_table_owner): New.
1487 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1488 unsigned int vector. Update all references.
1489 (powerpc_relobj::set_stub_table): Take an unsigned int param
1490 rather than a Stub_table. Update callers.
1491 (Powerpc_relobj::clear_stub_table): New function.
1492 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1493 stub_group_size_ vars.
1494 (Target_powerpc::new_stub_table): Delete.
1495 (max_branch_delta): New function, extracted from..
1496 (Target_powerpc::Relocate::relocate): ..here..
1497 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1498 status on whether stub created successfully.
1499 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1500 default sizing to..
1501 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1502 reduce on relax failure.
1503 (Target_powerpc::group_sections): Add "no_size_errors" param.
1504 Use stub_group_size_. Set up group info in a temp vector,
1505 before building Stub_table vector. Account for input sections
1506 possibly already converted to relaxed sections.
1507 (Stub_table::init): Delete. Merge into..
1508 (Stub_table::Stub_table): ..here.
1509 (Stub_table::can_reach_stub): New function.
1510 (Stub_table::add_plt_call_entry): Add "from" parameter and
1511 return true iff stub could be reached.
1512 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1513 param too.
1514 (Stub_table::clear_stubs): Add "all" param.
1515
1516 2014-11-26 Alan Modra <amodra@gmail.com>
1517
1518 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1519 (Target_powerpc::group_sections): Use it.
1520
1521 2014-11-25 Cary Coutant <ccoutant@google.com>
1522
1523 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1524 (Binary_to_elf::write_symbol): Add st_size parameter.
1525 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1526
1527 2014-11-25 Cary Coutant <ccoutant@google.com>
1528
1529 PR gold/17639
1530 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1531 (Sized_relobj_file::do_layout): Handle deferred sections properly
1532 during GC pass 1. Don't add reloc sections to deferred list twice.
1533 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1534 (Sized_relobj_file::is_deferred_layout_): New data member.
1535
1536 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1537
1538 PR gold/17619
1539 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1540 Check PC-relative offset overflow in PLT entry.
1541
1542 2014-11-21 Alan Modra <amodra@gmail.com>
1543
1544 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1545 for undefined weaks.
1546
1547 2014-11-20 Alan Modra <amodra@gmail.com>
1548
1549 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1550 from --stub-group-size parameter divided by 1024.
1551 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1552 template parameter. Update all uses.
1553 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1554 has_stub_value. Set for long branches. Don't report overflow for
1555 branch to undefined weak symbols. Print info message on
1556 overflowing branch to stub.
1557
1558 2014-11-20 Alan Modra <amodra@gmail.com>
1559
1560 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1561
1562 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1563
1564 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1565 entry for R_X86_64_GOTPLT64.
1566 (Target_x86_64<size>::Relocate::relocate): Update comments for
1567 R_X86_64_GOTPLT64.
1568
1569 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1570
1571 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1572 * plugin.h: add lock definition
1573
1574 2014-10-29 Han Shen <shenhan@google.com>
1575 Jing Yu <jingyu@google.com>
1576
1577 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1578 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1579 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1580 Symbol::TLS_REF.
1581 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1582 method.
1583 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1584 (Target_aarch64::tls_ld_to_le): New method.
1585 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1586 for 64bit targets.
1587 (Output_data_plt_aarch64::irelative_rel_): New data member.
1588 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1589 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1590 (Output_data_plt_aarch64::add_relocation): New method.
1591 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1592 offset. Add got_irelative size to got size.
1593 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1594 type string with the new typename.
1595 (AArch64_relocate_functions::update_adr): Replace parameter x with
1596 immed.
1597 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1598 (AArch64_relocate_functions::reloc_common): New method.
1599 (AArch64_relocate_funcsions::rela_general): Extract common part out
1600 into reloc_common method.
1601 (AArch64_relocate_functions::rela_general): Likewise.
1602 (AArch64_relocate_functions::pcrela_general): Likewise.
1603 (AArch64_relocate_functions::adr): New method.
1604 (AArch64_relocate_functions::adrp): Calculate immed before calling
1605 update_adr.
1606 (AArch64_relocate_functions::adrp): Likewise.
1607 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1608 comparing x to 0. Calculate immed from ~x when x < 0.
1609 (Target_aarch64::optimize_tls_reloc): Add new cases for
1610 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1611 TLSLD_MOVW_DTPREL_G0_NC.
1612 (Target_aarch64::possible_function_pointer_reloc): Implement this
1613 method.
1614 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1615 comment.
1616 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1617 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1618 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1619 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1620 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1621 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1622 (Target_aarch64::make_plt_entry): Call add_entry with two more
1623 parameters.
1624 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1625 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1626 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1627 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1628 (Target_aarch64::Relocate::relocate_tls): Add cases for
1629 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1630 TLSLD_MOVW_DTPREL_G0_NC.
1631 * testsuite/icf_safe_so_test.cc: Correct test comment.
1632 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1633
1634 2014-10-22 Alan Modra <amodra@gmail.com>
1635
1636 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1637 thread_starter.
1638
1639 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1640
1641 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1642
1643 2014-10-17 Cary Coutant <ccoutant@google.com>
1644
1645 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1646 Add "typename" keyword.
1647
1648 2014-10-15 Han Shen <shenhan@google.com>
1649 Jing Yu <jingyu@google.com>
1650
1651 Patch for gold aarch64 backend to support relaxation.
1652 * aarch64-reloc.def: Change format.
1653 * aarch64.cc (class Reloc_stub): New class.
1654 (class Stub_table): New class.
1655 (class AArch64_relobj): New class.
1656 (class AArch64_input_section): New class.
1657 (class AArch64_output_section): New class.
1658 (Target_aarch64::new_stub_table): New method.
1659 (Target_aarch64::new_aarch64_input_section): New method.
1660 (Target_aarch64::find_aarch64_input_section): New method.
1661 (Target_aarch64::scan_section_for_stubs): New method.
1662 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1663 (Target_aarch64::relocate_stub): New method.
1664 (Target_aarch64::current_target): New method.
1665 (Target_aarch64::do_make_elf_object): New method.
1666 (Target_aarch64::do_may_relax): New method.
1667 (Target_aarch64::do_relax): New method.
1668 (Target_aarch64::group_sections): New method.
1669 (Target_aarch64::scan_reloc_for_stub): New method.
1670 (Target_aarch64::do_make_output_section): New method.
1671 (Target_aarch64::stub_tables_): New data member.
1672 (Target_aarch64::aarch64_input_section_map_): New data member.
1673 (AArch64_relocate_functions::maybe_apply_stub): New method.
1674
1675 2014-09-30 Cary Coutant <ccoutant@google.com>
1676
1677 PR gold/17432
1678 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1679
1680 2014-09-30 Kito Cheng <kito@0xlab.org>
1681
1682 PR gold/13597
1683 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1684 hash table before sysv-style hash table.
1685
1686 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1687
1688 * options.h (--pic-executable): Add negative to alias to -no-pie.
1689
1690 2014-09-26 Cary Coutant <ccoutant@google.com>
1691
1692 PR gold/16773
1693 * object.cc (Sized_relobj_file): Compute value of section symbols
1694 for TLS sections the same as TLS symbols.
1695
1696 2014-09-25 Cary Coutant <ccoutant@google.com>
1697
1698 PR gold/17432
1699 * resolve.cc (Symbol_table::resolve): Override common placeholder
1700 symbols, but adjust sizes.
1701 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1702 symbols to common lists.
1703
1704 2014-09-24 Alan Modra <amodra@gmail.com>
1705
1706 * po/POTFILES.in: Regenerate.
1707
1708 2014-09-23 Taiju Tsuiki <tzik@google.com>
1709 Cary Coutant <ccoutant@google.com>
1710
1711 PR gold/14860
1712 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1713 on input_sections_blocker.
1714 * layout.cc (Write_sections_task::locks): Unblock
1715 input_sections_blocker_.
1716 * layout.h (Write_sections_task::Write_sections_task): Add
1717 input_sections_blocker.
1718 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1719 to DEPENDENCIES.
1720 * testsuite/Makefile.in: Regenerate.
1721
1722 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1723
1724 * testsuite/Makefile.am (plugin_test_10): New test.
1725 * testsuite/Makefile.in: Regenerate
1726 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1727 * testsuite/plugin_test_10.sh: New file.
1728
1729 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1730
1731 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1732 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1733 during the replacement phase.
1734
1735 2014-09-17 Han Shen <shenhan@google.com>
1736 Jing Yu <jingyu@google.com>
1737
1738 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1739 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1740 * aarch64.cc (Target_aarch64): Add data members
1741 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1742 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1743 constructor.
1744 (Target_aarch64::do_reloc_symbol_index): New method.
1745 (Target_aarch64::do_reloc_addend): New method.
1746 (Target_aarch64::add_tlsdesc_info): New method.
1747 (Target_aarch64::do_dynsym_value): New method.
1748 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1749 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1750 (Target_aarch64::make_data_plt): Add new parameters: got,
1751 got_irelative. Pass them to do_make_data_plt.
1752 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1753 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1754 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1755 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1756 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1757 (Target_aarch64::got_tlsdesc_section): New method.
1758 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1759 (Target_aarch64::define_tls_base_symbol): New method.
1760 (Target_aarch64::reserve_tlsdesc_entries): New method.
1761 (Target_aarch64::got_mod_index_entry): New method.
1762 (Target_aarch64::rela_tlsdesc_section): New method.
1763 (Target_aarch64::rela_irelative_section): New method.
1764 (Target_aarch64::Tlsdesc_info): New struct.
1765 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1766 relocations and tlsdesc relocations.
1767 (Target_aarch64::optimize_tls_reloc): Implement method.
1768 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1769 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1770 in constructor.
1771 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1772 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1773 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1774 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1775 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1776 (Output_data_plt_aarch64::rela_irelative): New method.
1777 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1778 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1779 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1780 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1781 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1782 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1783 (Output_data_plt_aarch64_standard): New member variables:
1784 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1785 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1786 New parameter: got, got_irelative.
1787 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1788 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1789 (Output_data_plt_aarch64::do_write): Replace got_address with
1790 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1791 (AArch64_relocate_functions::update_movnz): New method.
1792 (AArch64_relocate_functions): Correct format.
1793 (AArch64_relocate_functions::movnz): New method.
1794 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1795 before the switch. Add new cases to switch.
1796 Check ie_to_le relaxation on tlsie relocations. Add code handling
1797 tlsgd tlsdesc cases.
1798 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1799 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1800 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1801 Call reloc_name_in_error_message to print unsupported reloc.
1802 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1803 make_data_plt.
1804 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1805 relocs. Fill in some more dynamic tags.
1806 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1807 Skip call tls_get_addr when tlsgd is relaxed.
1808 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1809 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1810 tlsdesc->ie relaxation.
1811
1812 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1813
1814 * mips.cc (Target_mips_nacl): New class.
1815 (Target_selector_mips_nacl): New class.
1816 (target_selector_mips32): Rename from target_selector_mips32be and use
1817 Target_selector_mips_nacl instead of Target_selector_mips.
1818 (target_selector_mips32el): Rename from target_selector_mips32 and use
1819 Target_selector_mips_nacl instead of Target_selector_mips.
1820 (target_selector_mips64): Rename from target_selector_mips64be and use
1821 Target_selector_mips_nacl instead of Target_selector_mips.
1822 (target_selector_mips64el): Rename from target_selector_mips64 and use
1823 Target_selector_mips_nacl instead of Target_selector_mips.
1824 (Target_mips::mips_info): Add const attribute.
1825
1826 2014-09-02 Cary Coutant <ccoutant@google.com>
1827
1828 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1829 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1830 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1831 (Sized_incr_dynobj::do_section_name): Likewise.
1832 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1833 (Sized_incr_dynobj::do_section_name): Likewise.
1834 * object.h (Object::section_name): Likewise.
1835 (Object::do_section_name): Likewise.
1836 (Sized_relobj_file::do_section_name): Likewise.
1837 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1838 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1839
1840 2014-09-02 Cary Coutant <ccoutant@google.com>
1841
1842 PR gold/17005
1843 * ehframe.cc (Fde::write): Add output_offset parameter.
1844 (Cie::write): Likewise.
1845 (Eh_frame::set_final_data_size): Account for offset within output
1846 section.
1847 (Eh_frame::do_sized_write): Likewise.
1848 * ehframe.h (Fde::write): Add output_offset parameter.
1849 (Cie::write): Likewise.
1850 * output.cc (Output_section::Input_section_sort_entry): Remove
1851 section_has_name_; add output_section_name parameter. Use
1852 output section name for non-input sections.
1853 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1854 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1855 (Output_section::Input_section_sort_compare): Remove logic for
1856 sections without names.
1857 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1858 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1859 Likewise.
1860 (Output_section::Input_section_sort_section_name_compare): Likewise.
1861
1862 2014-08-29 Han Shen <shenhan@google.com>
1863 Jing Yu <jingyu@google.com>
1864
1865 * aarch64-reloc-property.cc
1866 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1867 reference reloc property in the table.
1868 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1869 3 other entries.
1870 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1871 2 new overloaded methods.
1872 (Output_data_got_aarch64::do_write): Add code to write out
1873 static relocs.
1874 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1875 static relocs.
1876 (Output_data_got_aarch64::static_relocs): New vector to
1877 hold static relocs.
1878 (Target_aarch64::TCB_SIZE): New const static memeber.
1879 (Target_aarch64::tcb_size): New method.
1880 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1881 (Target_aarch64::Relocate::relocate_tls): New method.
1882 (Target_aarch64::Scan::local): Add code handling new reloc types.
1883 (Target_aarch64::Scan::global): Add code handling new reloc types.
1884
1885 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1886
1887 * options.h (-no-pie): Add option.
1888
1889 2014-08-08 Jing Yu <jingyu@google.com>
1890 Han Shen <shenhan@google.com>
1891
1892 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1893 (DEFFILES): add aarch64-reloc.def.
1894 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1895 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1896 * Makefile.in: Regenerate.
1897 * aarch64-reloc-property.cc: New file.
1898 * aarch64-reloc-property.h: New file.
1899 * aarch64-reloc.def: New file.
1900 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1901 with tab to make the format consistent.
1902 (Output_data_got_aarch64::symbol_table_): New method.
1903 (Target_aarch64::do_plt_address_for_global): New method.
1904 (Target_aarch64::do_plt_address_for_local): New method.
1905 (Target_aarch64::do_select_as_default_target): New method.
1906 (Target_aarch64::do_make_data_plt): New method.
1907 (Target_aarch64::make_data_plt): New method.
1908 (Output_data_plt_aarch64::has_irelative_section): New method.
1909 (Output_data_plt_aarch64::address_for_global): New method.
1910 (Output_data_plt_aarch64::address_for_local): New method.
1911 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1912 (Output_data_plt_aarch64::add_entry): Implement contents.
1913 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1914 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1915 the got_pov entry to plt0.
1916 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1917 Implement contents.
1918 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1919 (AArch64_howto): New struct.
1920 (aarch64_howto[]): New static const array.
1921 (AArch64_relocate_functions): New class.
1922 (Target_aarch64::Scan::get_reference_flags): Remove method.
1923 (Target_aarch64::Scan::local): Implement to support a few relocations.
1924 (Target_aarch64::Scan::global): Implement to support a few relocations.
1925 (Target_aarch64::make_plt_section): Implement contents.
1926 (Target_aarch64::make_plt_entry): Implement contents.
1927 (Target_aarch64::do_finalize_sections): Implement contents.
1928 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1929 (Target_aarch64::relocate_section): Implement contents.
1930
1931 2014-08-06 Alan Modra <amodra@gmail.com>
1932
1933 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1934
1935 2014-08-06 Alan Modra <amodra@gmail.com>
1936
1937 PR 13227
1938 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1939
1940 2014-07-21 Sriraman Tallam <tmsriram@google.com>
1941
1942 * object.cc (Relobj::is_section_name_included): Add
1943 ".rodata.nptl_version" to not garbage collect this section.
1944
1945 2014-07-08 Cary Coutant <ccoutant@google.com>
1946
1947 * expression.cc (struct Expression::Expression_eval_info): Add
1948 new fields type_pointer, vis_pointer, and nonvis_pointer.
1949 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1950 nonvis_pointer parameters. Adjust all calls.
1951 (Symbol_expression::value): Update type, visibility, and nonvis bits
1952 in caller.
1953 * script.cc (Symbol_assignment::sized_finalize): Update type,
1954 visibility, and remaining st_other bits for new symbol.
1955 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1956 vis_pointer, and nonvis_pointer parameters.
1957 * symtab.h (Symbol::set_type): New method.
1958
1959 * testsuite/Makefile.am (defsym_test): New test.
1960 * testsuite/Makefile.in: Regenerate.
1961 * testsuite/defsym_test.c: New file.
1962 * testsuite/defsym_test.sh: New file.
1963
1964 2014-07-08 Cary Coutant <ccoutant@google.com>
1965
1966 PR gold/15639
1967 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1968 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1969 (Sized_dynobj::base_read_symbols): ...new method.
1970 * object.h (Sized_relobj_file::base_read_symbols): New method.
1971 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1972 (Sized_relobj_file::base_read_symbols): ...new method.
1973 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1974 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1975 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1976
1977 2014-07-04 Alan Modra <amodra@gmail.com>
1978
1979 * po/POTFILES.in: Regenerate.
1980
1981 2014-07-02 Jing Yu <jingyu@google.com>
1982
1983 * aarch64.cc: New file
1984 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1985 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1986 * Makefile.in: Regenerate.
1987 * configure.tgt: Add entries for aarch64*.
1988 * configure.ac: Likewise.
1989 * configure: Likewise.
1990
1991 2014-06-27 Alan Modra <amodra@gmail.com>
1992
1993 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1994
1995 2014-06-24 Cary Coutant <ccoutant@google.com>
1996
1997 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1998 sections.
1999 (Dwo_file::sized_read_unit_index): Likewise.
2000
2001 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2002
2003 * mips.cc: New file.
2004 * Makefile.am (TARGETSOURCES): Add mips.cc
2005 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2006 * configure.tgt: Add entries for mips*.
2007 * configure.ac: Likewise.
2008 * Makefile.in: Regenerate.
2009 * configure: Likewise.
2010
2011 2014-06-09 Cary Coutant <ccoutant@google.com>
2012
2013 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2014 unit_length is within section bounds.
2015
2016 2014-06-09 Cary Coutant <ccoutant@google.com>
2017
2018 PR gold/16980
2019 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2020 map.
2021
2022 2014-06-07 Alan Modra <amodra@gmail.com>
2023
2024 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2025
2026 2014-06-06 Cary Coutant <ccoutant@google.com>
2027
2028 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2029 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2030 (Dwarf_pubnames_table::read_header): Likewise.
2031 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2032 .debug_gnu_pubtypes.
2033
2034 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2035
2036 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2037 * Makefile.in, configure: Regenerate.
2038
2039 2014-06-03 Alan Modra <amodra@gmail.com>
2040
2041 * powerpc.cc (addis_12_2): Define.
2042 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2043
2044 2014-06-03 Alan Modra <amodra@gmail.com>
2045
2046 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2047 st_other output.
2048
2049 2014-06-02 Alan Modra <amodra@gmail.com>
2050
2051 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2052 Only ignore relocs on ELFv1.
2053 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2054
2055 2014-05-30 Cary Coutant <ccoutant@google.com>
2056
2057 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2058 * testsuite/Makefile.in: Regenerate.
2059 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2060
2061 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2062
2063 PR gold/16945
2064 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2065 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2066
2067 2014-05-15 Alan Modra <amodra@gmail.com>
2068
2069 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2070 Compare FDE contents with DW_CFA_nop rather than 0.
2071
2072 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2073
2074 * symtab.h (may_need_copy_reloc): Remove check for position independent
2075 code.
2076 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2077 position independence before pc absolute may_need_copy_reloc call.
2078 Add check for executable output befor pc relative may_need_copy_reloc
2079 call.
2080 * i386.cc: Ditto.
2081 * arm.cc: Ditto.
2082 * sparc.cc: Ditto.
2083 * tilegx.cc: Ditto.
2084 * powerpc.cc: Add check for no position independence before
2085 may_need_copy_reloc calls.
2086 * testsuite/pie_copyrelocs_test.cc: New file.
2087 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2088 * Makefile.am (pie_copyrelocs_test): New test.
2089 * Makefile.in: Regenerate.
2090
2091 2014-05-08 Martin Liška <mliska@suse.cz>
2092
2093 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2094
2095 2014-05-06 Cary Coutant <ccoutant@google.com>
2096
2097 PR gold/16900
2098 * i386.cc (Output_data_got_plt_i386): New class.
2099 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2100 parameter. Change all callers.
2101 (Output_data_plt_i386::layout_): Remove.
2102 (Output_data_plt_i386::got_plt_): Change type.
2103 (Target_i386::got_plt_): Change type. Change all references.
2104 (Target_i386::got_section): Create instance of new class.
2105 (Output_data_got_plt_i386::do_write): New function.
2106 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2107 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2108 parameter. Change all callers.
2109 (Output_data_plt_x86_64::layout_): Remove.
2110 (Output_data_plt_x86_64::got_plt_): Change type.
2111 (Target_x86_64::got_plt_): Change type. Change all references.
2112 (Target_x86_64::got_section): Create instance of new class.
2113 (Output_data_got_plt_x86_64::do_write): New function.
2114 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2115 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2116 class.
2117
2118 2014-05-05 Cary Coutant <ccoutant@google.com>
2119
2120 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2121 if we have pubnames/pubtypes.
2122
2123 2014-05-02 Cary Coutant <ccoutant@google.com>
2124
2125 * defstd.cc (in_segment): Define __ehdr_start here...
2126 * layout.cc (Layout::finalize): ...Instead of here. Set the
2127 output segment when known.
2128 * resolve.cc (Symbol::override_base_with_special): Remember
2129 the original binding.
2130 * symtab.cc (Symbol::set_output_segment): New function.
2131 (Symbol::set_undefined): New function.
2132 * symtab.h (Symbol::is_weak_undefined): Check original undef
2133 binding.
2134 (Symbol::is_strong_undefined): New function.
2135 (Symbol::set_output_segment): New function.
2136 (Symbol::set_undefined): New function.
2137 * target-reloc.h (is_strong_undefined): Remove.
2138 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2139 Check for hidden undefs.
2140 (relocate_section): Call Symbol::is_strong_undefined.
2141
2142 * testsuite/Makefile.am (ehdr_start_test_1)
2143 (ehdr_start_test_2, ehdr_start_test_3)
2144 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2145 * testsuite/Makefile.in: Regenerate.
2146 * testsuite/ehdr_start_def.cc: New source file.
2147 * testsuite/ehdr_start_test.cc: New source file.
2148 * testsuite/ehdr_start_test.t: New linker script.
2149 * testsuite/ehdr_start_test_4.sh: New shell script.
2150
2151 2014-04-23 Cary Coutant <ccoutant@google.com>
2152
2153 PR gold/16870
2154 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2155
2156 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2157
2158 * layout.cc (Layout::include_section): Allow a target to decide
2159 whether to include a section.
2160 * target.h (Target::should_include_section): New function.
2161 (Target::do_should_include_section): New function.
2162
2163 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2164
2165 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2166 inline into ...
2167 (Copy_relocs::emit): ... here.
2168 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2169 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2170 (Copy_reloc_entry::entries_): Change from private to protected.
2171
2172 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2173
2174 * icf.cc (get_section_contents): Replace copies of reloc
2175 vectors with const references.
2176
2177 2014-04-02 Cary Coutant <ccoutant@google.com>
2178
2179 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2180 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2181 * configure: Regenerate.
2182 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2183 -fno-use-linker-plugin.
2184 (LINK1, CXXLINK1): Add it to the link command.
2185 * testsuite/Makefile.in: Regenerate.
2186
2187 2014-03-12 Alan Modra <amodra@gmail.com>
2188
2189 * Makefile.in: Regenerate.
2190
2191 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2192
2193 * symtab.h (Symbol::set_nonvis): New function.
2194
2195 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2196
2197 * symtab.cc (Sized_symbol<32>::init_output_data):
2198 Instantiate the template.
2199 (Sized_symbol<64>::init_output_data): Likewise.
2200
2201 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2202
2203 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2204 adjust dynamic symbol value.
2205 * target.h (Target::adjust_dyn_symbol): New function.
2206 (Target::do_adjust_dyn_symbol): New function.
2207
2208 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2209
2210 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2211 Get the value of DYNAMIC_CUSTOM dynamic entry.
2212 * output.h (Output_data_dynamic::add_custom): New function.
2213 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2214 dynamic entry.
2215 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2216 * target.h (Target::dynamic_tag_custom_value): New function.
2217 (Target::do_dynamic_tag_custom_value): New function.
2218
2219 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2220
2221 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2222 dynsym indexes.
2223 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2224 (Target::do_has_custom_set_dynsym_indexes): New function.
2225 (Target::set_dynsym_indexes): New function.
2226 (Target::do_set_dynsym_indexes): New function.
2227
2228 2014-03-07 Alan Modra <amodra@gmail.com>
2229
2230 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2231 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2232 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2233 (Powerpc_relocate_functions::has_overflow_bitfield,
2234 overflowed): Use the above.
2235 (Target_powerpc::Relocate::relocate): Correct overflow checking
2236 for a number of relocations. Modify overflow test for 16-bit
2237 fields in instructions to signed/unsigned according to whether
2238 the field takes a signed or unsigned value.
2239
2240 2014-03-05 Alan Modra <amodra@gmail.com>
2241
2242 Update copyright years.
2243
2244 2014-03-05 Alan Modra <amodra@gmail.com>
2245
2246 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2247 R_PPC64_ADDR64_LOCAL.
2248 (Target_powerpc::Relocate::relocate): Likewise.
2249
2250 2014-03-03 Alan Modra <amodra@gmail.com>
2251
2252 * dwp.cc (print_version): Update copyright year to current.
2253
2254 2014-02-10 Alan Modra <amodra@gmail.com>
2255
2256 * po/gold.pot: Regenerate.
2257
2258 2014-02-06 Cary Coutant <ccoutant@google.com>
2259
2260 Fix problem where -u is ignored when a weak undef is seen.
2261
2262 * archive.cc (Library_base::should_include_member): Reorder
2263 code to check for -u option if a weak undef has already been seen.
2264 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2265 * testsuite/Makefile.in: Regenerate.
2266 * testsuite/weak_undef_file3.cc: New file.
2267 * testsuite/weak_undef_file4.cc: New file.
2268 * testsuite/weak_undef_test_2.cc: New file.
2269
2270 2014-02-05 Cary Coutant <ccoutant@google.com>
2271
2272 Fix issues with gold undefined symbol diagnostics.
2273
2274 PR binutils/15435
2275 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2276 check to here.
2277 * target-reloc.h (is_strong_undefined): New function.
2278 (relocate_section): Move undef vtable symbol check from here.
2279 Check for is_strong_undefined.
2280
2281 2014-02-05 Cary Coutant <ccoutant@google.com>
2282
2283 Fix problems with the --dynamic-list option.
2284
2285 PR gold/13577
2286 * options.cc (General_options::parse_dynamic_list):
2287 Set have_dynamic_list_.
2288 (General_options::General_options): Initialize have_dynamic_list_.
2289 (General_options::finalize): Turn off -Bsymbolic and
2290 -Bsymbolic-functions if --dynamic-list provided.
2291 * options.h (General_options::have_dynamic_list): New function.
2292 (General_options::have_dynamic_list_): New data member.
2293 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2294 correctly.
2295
2296 PR gold/16530
2297 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2298 in --dynamic-list, mark it.
2299
2300 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2301 (dynamic_list_2): New test case.
2302 * testsuite/Makefile.in: Regenerate.
2303 * testsuite/dynamic_list_2.cc: New file.
2304 * testsuite/dynamic_list_2.t: New file.
2305 * testsuite/dynamic_list_lib1.cc: New file.
2306 * testsuite/dynamic_list_lib2.cc: New file.
2307 * testsuite/gc_dynamic_list_test.c: New file.
2308 * testsuite/gc_dynamic_list_test.sh: New file.
2309 * testsuite/gc_dynamic_list_test.t: New file.
2310
2311 2014-01-28 Cary Coutant <ccoutant@google.com>
2312
2313 Add .gdb_index version 7 support.
2314
2315 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2316 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2317 debug sections.
2318 (Dwarf_ranges_table::read_ranges_table): Likewise.
2319 (Dwarf_pubnames_table::read_section): Check for GNU-style
2320 sections, and for compressed debug sections.
2321 (Dwarf_pubnames_table::read_header): Compute end address of table.
2322 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2323 for end of list by offset, not by offset == 0.
2324 (Dwarf_info_reader::do_read_string_table): Check for compressed
2325 debug sections.
2326 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2327 Initialize new data members.
2328 (Dwarf_pubnames_table::next_name): return flag_byte.
2329 (Dwarf_pubnames_table::end_of_table_): New data member.
2330 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2331 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2332 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2333 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2334 read skeleton type unit DIEs.
2335 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2336 (Gdb_index::do_write): Write flag_byte.
2337 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2338 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2339 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2340 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2341
2342 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2343
2344 * version.cc (print_version): Update copyright year to 2014.
2345
2346 2013-12-19 Dimitry Andric <dimitry@andric.com>
2347
2348 * stringpool.cc (Stringpool_template::reserve): Add
2349 HAVE_UNORDERED_MAP case.
2350 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2351
2352 2013-12-18 Cary Coutant <ccoutant@google.com>
2353
2354 * configure.ac: Check for <unordered_set> and <unordered_map>.
2355 * config.in: Regenerate.
2356 * configure: Regenerate.
2357 * system.h: Use <unordered_set> and <unordered_map> if available.
2358
2359 2013-12-10 Roland McGrath <mcgrathr@google.com>
2360
2361 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2362 with $(INSTALL_PROGRAM_ENV).
2363 * Makefile.in: Regenerate.
2364
2365 2013-11-22 Cary Coutant <ccoutant@google.com>
2366
2367 * configure.ac: Add check for which library is needed for
2368 dlopen.
2369 * configure: Regenerate.
2370
2371 2013-11-22 Cary Coutant <ccoutant@google.com>
2372
2373 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2374 assembler.
2375 * testsuite/Makefile.in: Regenerate.
2376
2377 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2378
2379 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2380 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2381 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2382 (Target_x86_64<size>::Scan::local): Likewise.
2383 (Target_x86_64<size>::Scan::global): Likewise.
2384 (Target_x86_64<size>::Relocate::relocate): Likewise.
2385 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2386 Likewise.
2387 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2388 R_X86_64_PC32_BND.
2389
2390 * testsuite/Makefile.am (check_PROGRAMS): Add
2391 exception_x86_64_bnd_test.
2392 (exception_x86_64_bnd_test_SOURCES): New macro.
2393 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2394 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2395 (exception_x86_64_bnd_test_LDADD): Likewise.
2396 (exception_x86_64_bnd_1.o): New rule.
2397 (exception_x86_64_bnd_2.o): Likewise.
2398 * testsuite/Makefile.in: Regenerated.
2399
2400 2013-11-15 Alan Modra <amodra@gmail.com>
2401
2402 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2403 accessor.
2404 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2405 Only call ppc64_local_entry_offset for 64-bit. Restrict
2406 symval_for_branch lookup to ELFv1.
2407 (Stub_table::add_plt_call_entry): Use unsigned int off.
2408 (Output_data_glink::Address, invalid_address): New.
2409 (Output_data_glink::add_eh_frame): Move out of line. Add
2410 support for ELFv2.
2411 (Output_data_glink::add_global_entry, find_global_entry,
2412 global_entry_address): New functions.
2413 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2414 ge_size): New variables.
2415 (Output_data_glink::set_final_data_size): Add global entry
2416 stub sizing.
2417 (Output_data_glink::do_write): Write global entry stubs.
2418 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2419 parameter. Return true for ELFv2. Adjust callers.
2420 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2421 ELFv1. Similarly for ifunc and dynamic relocation processing
2422 specific to ELFv1. Recognize that symbols are defined on
2423 their plt entries for ELFv2.
2424 (Target_powerpc::symval_for_branch): Assert if called for
2425 ELFv2 or ppc32.
2426 (Target_powerpc::Relocate::relocate): Use global entry plt
2427 stub for symbol value if such exists on ELFv2.
2428 (Target_powerpc::Relocate::relocate): Don't call
2429 symval_for_branch when ELFv2. Do adjust for local entry
2430 offset when ELFv2.
2431 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2432 plt stub for ELFv2.
2433 (Target_powerpc::do_plt_address_for_global): Similarly.
2434
2435 2013-11-14 Cary Coutant <ccoutant@google.com>
2436
2437 Revert patch -- this did not fix the problem, and there is
2438 no race there.
2439
2440 2013-11-14 Cary Coutant <ccoutant@google.com>
2441
2442 PR gold/14860
2443 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2444 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2445 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2446 updating fde_offsets_.
2447 (Eh_frame_hdr::lock_): New data member.
2448
2449 2013-11-14 Cary Coutant <ccoutant@google.com>
2450
2451 * dwp.cc (Dwo_file_entry): New type.
2452 (File_list): Use Dwo_file_entry.
2453 (Dwo_file::verify): New function.
2454 (Dwo_file::verify_dwo_list): New function.
2455 (Dwo_file::sized_verify_dwo_list): New function.
2456 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2457 list.
2458 (Dwp_options): New enum type.
2459 (dwp_options): Add --verify-only.
2460 (usage): Likewise.
2461 (main): Likewise.
2462 * dwp.h (gold_info): Add declaration.
2463
2464 2013-11-14 Cary Coutant <ccoutant@google.com>
2465
2466 PR gold/14860
2467 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2468 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2469 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2470 updating fde_offsets_.
2471 (Eh_frame_hdr::lock_): New data member.
2472
2473 2013-11-06 Cary Coutant <ccoutant@google.com>
2474
2475 PR gold/15758
2476 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2477 before reloc sections.
2478
2479 2013-11-04 Alan Modra <amodra@gmail.com>
2480
2481 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2482 (Symbol::needs_dynamic_reloc): Test new flag.
2483 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2484 (Target_powerpc::Scan::get_reference_flags): Add target param.
2485 Return FUNC_DESC_ABI for 64-bit ELFv1.
2486 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2487 call.
2488 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2489 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2490
2491 2013-10-31 Cary Coutant <ccoutant@google.com>
2492
2493 Restore support for dwp v2 DWARF package file format.
2494
2495 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2496 tu_length parameter. Adjust all callers.
2497 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2498 * dwp.cc: Include dwarf.h.
2499 (Section_bounds): New struct type.
2500 (Unit_set): New struct type.
2501 (Dwo_file::Dwo_file): Initialize new data member.
2502 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2503 Combine and rename to...
2504 (Dwo_file::read_unit_index): ...this.
2505 (Dwo_file::sized_read_compunit_index)
2506 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2507 (Dwo_file::sized_read_unit_index): ...this.
2508 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2509 parameters; add section_id parameter.
2510 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2511 (Dwo_file::add_unit_set): ...this.
2512 (Dwo_file::shndx_map_): Remove.
2513 (Dwo_file::sect_offsets_): New data member.
2514 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2515 (Dwp_output_file::add_section): Rename to...
2516 (Dwp_output_file::add_contribution): ...this.
2517 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2518 (Dwp_output_file::add_tu_set): Likewise.
2519 (Dwp_output_file::Contribution): New type.
2520 (Dwp_output_file::Section::contributions): New data member.
2521 (Dwp_output_file::Cu_or_tu_set): Remove.
2522 (Dwp_output_file::Section::Section): New ctor.
2523 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2524 (Dwp_output_file::Dwp_index::Section_table): New type.
2525 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2526 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2527 parameter.
2528 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2529 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2530 (Dwp_output_file::Dwp_index::section_table): New member function.
2531 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2532 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2533 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2534 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2535 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2536 (Dwp_output_file::Dwp_index::section_table_): New data member.
2537 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2538 (Dwp_output_file::add_output_section): New member function.
2539 (Dwp_output_file::write_new_section): New member function.
2540 (Dwp_output_file::write_contributions): New member function.
2541 (Dwp_output_file::section_id_map_): New data member.
2542 (class Dwo_id_info_reader): Remove.
2543 (class Unit_reader): New class.
2544 (get_dwarf_section_name): New function.
2545 (Dwo_file::read_executable): Adjust initializations of class data.
2546 (Dwo_file::read): Add support for v2 package file format.
2547 (Dwo_file::read_unit_index): Likewise.
2548 (Dwo_file::sized_read_unit_index): Likewise.
2549 (Dwo_file::copy_section): Likewise.
2550 (Dwo_file::add_unit_set): Likewise.
2551 (Dwp_output_file::add_output_section): Likewise.
2552 (Dwp_output_file::add_contribution): Likewise.
2553 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2554 for empty slot.
2555 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2556 file format.
2557 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2558 slot.
2559 (Dwp_output_file::initialize): Remove unused function.
2560 (Dwp_output_file::finalize): Add support for v2 package file format.
2561 (Dwp_output_file::write_index): Likewise.
2562 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2563 function prototype.
2564
2565 2013-10-31 Cary Coutant <ccoutant@google.com>
2566
2567 * configure.ac: Fix check for -fmerge-constants.
2568 * configure.ac: Regenerate.
2569
2570 2013-10-30 Roland McGrath <mcgrathr@google.com>
2571
2572 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2573 Correct 9-byte nop sequence to match what the assembler generates.
2574
2575 2013-10-30 Alan Modra <amodra@gmail.com>
2576
2577 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2578 ppc64_local_entry_offset, ppc64_local_entry_offset,
2579 do_read_symbols): New functions.
2580 (Powerpc_relobj::e_flags_, st_other_): New vars.
2581 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2582 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2583 (Powerpc_relobj::e_flags_): New var.
2584 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2585 and adjust for ELFv2.
2586 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2587 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2588 (Powerpc_dynobj::do_find_special_sections): Likewise.
2589 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2590 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2591 to ELFv2 local entry.
2592 (Target_powerpc::do_relax): No thread safe barriers needed for
2593 ELFv2.
2594 (Output_data_plt_powerpc::initial_plt_entry_size_,
2595 plt_entry_size): Delete. Replace all uses with
2596 first_plt_entry_offset() and plt_entry_size().
2597 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2598 reserved_size parm. Update callers.
2599 (Output_data_plt_powerpc::entry_count): Update.
2600 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2601 and use Target_powerpc::first_plt_entry_offset().
2602 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2603 rename to plt_entry_size.
2604 (Output_data_plt_powerpc::add_ifunc_entry,
2605 add_local_ifunc_entry): Adjust reloc for ELFv2.
2606 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2607 (glink_eh_frame_fde_64v2): New.
2608 (Stub_table::plt_call_size): Support ELFv2 sizing.
2609 (Output_data_glink::add_eh_frame): Use the new FDE.
2610 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2611 (Stub_table::do_write): Write ELFv2 stubs and glink.
2612 (Target_powerpc::Relocate::relocate): Replaces nop after call
2613 with ld 2,24(1) and adjust local offset destination for ELFv2.
2614
2615 2013-10-30 Alan Modra <amodra@gmail.com>
2616
2617 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2618 (Target_powerpc::Scan::global, local): Likewise.
2619 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2620 on all ppc64 @h and @ha relocs.
2621
2622 2013-10-14 Alan Modra <amodra@gmail.com>
2623
2624 * output.h (Output_data_got::add_constant): Tidy.
2625 (Output_data_got::add_constant_pair): New function.
2626 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2627 methods used so as to first call reserve_ent().
2628
2629 2013-10-11 Roland McGrath <mcgrathr@google.com>
2630
2631 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2632 add_got_entry and add_got_entry_pair.
2633
2634 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2635 (HAVE_PUBNAMES): Likewise.
2636 * configure: Regenerate.
2637
2638 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2639 * testsuite/Makefile.in: Regenerate.
2640
2641 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2642 Remove const from declaration.
2643 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2644 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2645 * output.h (Output_file_header): Remove const from member target_
2646 and corresponding constructor argument.
2647 * output.cc (Output_file_header::Output_file_header): Update prototype.
2648 (Output_file_header::do_sized_write): Use this->target_ in place
2649 of parameters()->target().
2650
2651 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2652
2653 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2654 * configure: Regenerate.
2655 * Makefile.in: Regenerate.
2656 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2657 * testsuite/merge_string_literals_2.c: Likewise.
2658 * testsuite/Makefile.am
2659 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2660 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2661 literal -fmerge-constants.
2662 * testsuite/Makefile.in: Regenerate.
2663
2664 * i386.cc (Target_i386): Remove unused member dynbss_.
2665 * arm.cc (Target_arm): Likewise.
2666 * powerpc.cc (Target_powerpc): Likewise.
2667 * sparc.cc (Target_sparc): Likewise.
2668 * tilegx.cc (Target_tilegx): Likewise.
2669 * x86_64.cc (Target_x86_64): Likewise.
2670 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2671 type_signature_, type_offset_.
2672 * plugin.h (Plugin_hook): Remove unused member layout_.
2673 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2674 mapfile_.
2675 (Read_member): Remove unused members input_objects_, symtab_,
2676 mapfile_, layout_.
2677 (Check_library): Remove unused member symtab_.
2678 * archive.h (Lib_group): Remove unused member lib_.
2679 * archive.cc (Lib_group::Lib_group): Update initializer.
2680 * incremental.h (Incremental_binary): Remove unused member target_.
2681 (Incremental_script_entry): Removed unused member script_.
2682 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2683 * icf.h (Icf): Remove unused member num_tracked_relocs.
2684
2685 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2686 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2687 its only use.
2688 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2689
2690 * archive.h: Use struct rather than class for forward declaration
2691 of Read_symbols_data.
2692
2693 2013-10-07 Cary Coutant <ccoutant@google.com>
2694
2695 PR gold/16010
2696 * testsuite/Makefile.am (icf_test): Fix dependencies.
2697 (icf_safe_test): Likewise.
2698 (icf_safe_so_test): Likewise.
2699 (large_symbol_alignment): Add empty _LDADD rule.
2700 * testsuite/Makefile.in: Regenerate.
2701
2702 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2703
2704 PR gold/15927
2705 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2706 relocation for R_X86_64_32 on x32.
2707
2708 2013-08-27 Roland McGrath <mcgrathr@google.com>
2709
2710 * output.cc (Output_segment::set_section_addresses): Take new
2711 Target* argument. If target->isolate_execinstr() and the segment
2712 is executable and starts at a target->abi_pagesize() boundary,
2713 pad its end out to a target->abi_pagesize() boundary with code fill.
2714 * output.h (Output_segment::set_section_addresses): Update decl.
2715 * layout.h (Layout::check_output_data_for_reset_values): Take new
2716 argument RELAX_OUTPUTS.
2717 (Layout): New member relax_output_list_.
2718 (Layout::add_relax_output): New method.
2719 * layout.cc (Layout::Layout): Update constructor.
2720 (Layout::reset_relax_output): New method.
2721 (Layout::clean_up_after_relaxation): Call it.
2722 (Layout::prepare_for_relaxation): Update caller.
2723 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2724 Call reset_relax_output before re-processing segments for
2725 isolate_execinstr case.
2726 (Layout::write_data): Handle relax_output_list_.
2727 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2728 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2729
2730 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2731
2732 PR binutils/15834
2733 * object.h: Fix typos.
2734
2735 2013-08-16 Roland McGrath <mcgrathr@google.com>
2736
2737 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2738 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2739
2740 2013-08-07 Cary Coutant <ccoutant@google.com>
2741
2742 Revert support for v2 DWP files:
2743
2744 2013-03-01 Cary Coutant <ccoutant@google.com>
2745
2746 Add dwp support for v2 DWARF package file format.
2747 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2748 tu_length parameter. Adjust all callers.
2749 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2750 * dwp.cc: Include dwarf.h.
2751 (Section_bounds): New struct type.
2752 (Unit_set): New struct type.
2753 (Dwo_file::Dwo_file): Initialize new data member.
2754 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2755 Combine and rename to...
2756 (Dwo_file::read_unit_index): ...this.
2757 (Dwo_file::sized_read_compunit_index)
2758 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2759 (Dwo_file::sized_read_unit_index): ...this.
2760 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2761 parameters; add section_id parameter.
2762 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2763 (Dwo_file::add_unit_set): ...this.
2764 (Dwo_file::shndx_map_): Remove.
2765 (Dwo_file::sect_offsets_): New data member.
2766 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2767 (Dwp_output_file::add_section): Rename to...
2768 (Dwp_output_file::add_contribution): ...this.
2769 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2770 (Dwp_output_file::add_tu_set): Likewise.
2771 (Dwp_output_file::Contribution): New type.
2772 (Dwp_output_file::Section::contributions): New data member.
2773 (Dwp_output_file::Cu_or_tu_set): Remove.
2774 (Dwp_output_file::Section::Section): New ctor.
2775 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2776 (Dwp_output_file::Dwp_index::Section_table): New type.
2777 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2778 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2779 parameter.
2780 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2781 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2782 (Dwp_output_file::Dwp_index::section_table): New member function.
2783 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2784 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2785 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2786 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2787 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2788 (Dwp_output_file::Dwp_index::section_table_): New data member.
2789 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2790 (Dwp_output_file::add_output_section): New member function.
2791 (Dwp_output_file::write_new_section): New member function.
2792 (Dwp_output_file::write_contributions): New member function.
2793 (Dwp_output_file::section_id_map_): New data member.
2794 (class Dwo_id_info_reader): Remove.
2795 (class Unit_reader): New class.
2796 (get_dwarf_section_name): New function.
2797 (Dwo_file::read_executable): Adjust initializations of class data.
2798 (Dwo_file::read): Add support for v2 package file format.
2799 (Dwo_file::read_unit_index): Likewise.
2800 (Dwo_file::sized_read_unit_index): Likewise.
2801 (Dwo_file::copy_section): Likewise.
2802 (Dwo_file::add_unit_set): Likewise.
2803 (Dwp_output_file::add_output_section): Likewise.
2804 (Dwp_output_file::add_contribution): Likewise.
2805 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2806 for empty slot.
2807 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2808 file format.
2809 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2810 slot.
2811 (Dwp_output_file::initialize): Remove unused function.
2812 (Dwp_output_file::finalize): Add support for v2 package file format.
2813 (Dwp_output_file::write_index): Likewise.
2814 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2815 function prototype.
2816
2817 2013-07-31 Cary Coutant <ccoutant@google.com>
2818
2819 * object.cc (Sized_relobj::do_output_section_address): New function.
2820 (Sized_relobj): Instantiate explicitly.
2821 * object.h (Object::output_section_address): New function.
2822 (Object::do_output_section_address): New function.
2823 (Sized_relobj::do_output_section_address): New function.
2824 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2825
2826 2013-07-30 Cary Coutant <ccoutant@google.com>
2827 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2828
2829 * parameters.cc (Parameters::entry): Return target-specific entry
2830 symbol name.
2831 * target.h (Target::entry_symbol_name): New function.
2832 (Target_info::entry_symbol_name): New data member.
2833
2834 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2835 * i386.cc (Target_i386::i386_info): Likewise.
2836 (Target_i386_nacl::i386_nacl_info): Likewise.
2837 * sparc.cc (Target_sparc::sparc_info): Likewise.
2838 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2839 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2840 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2841 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2842
2843 2013-07-22 Sterling Augustine <saugustine@google.com>
2844
2845 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2846 Convert parameter shndx to local variable. Add parameters symtab
2847 and symtab_size. Scan over section names. Find relocation
2848 section corresponding to current section. Create and initialize
2849 reloc_mapper_ and reloc_type_.
2850 (Dwarf_pubnames_table::read_header): Add assertion. Change
2851 unit_length to off_t. Initialize member unit_length_. Fill in field
2852 cu_offset_.
2853 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2854 Initialize new fields unit_length_ and cu_offset_.
2855 (Dwarf_pubnames_table::read_section): Update prototype.
2856 (Dwarf_pubnames_table::cu_offset): New member function.
2857 (Dwarf_pubnames_table::subsection_size): Likewise.
2858 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2859 New fields.
2860 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2861 member functions public.
2862 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2863 Update comment. Rework logic. Move repeated parts to...
2864 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2865 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2866 pubtypes_table_, and stmt_list_offset.
2867 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2868 Gdb_index::find_pubtype_offset,
2869 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2870 (Gdb_index::pubnames_read): Update prototype and rework logic.
2871 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2872 Forward declare.
2873 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2874 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2875 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2876 Gdb_index::map_pubtable_to_dies):
2877 Declare functions.
2878 (Gdb_index::pubnames_read): Update declaration.
2879 (Gdb_index::Pubname_offset_map): New type.
2880 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2881 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2882 Gdb_index::stmt_list_offset): Declare.
2883 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2884 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2885 Gdb_index::pubtypes_offset_): Remove.
2886
2887 2013-07-19 Roland McGrath <mcgrathr@google.com>
2888
2889 * options.h (General_options): Add -Trodata-segment option.
2890 * parameters.cc (Parameters::check_rodata_segment): New function.
2891 (Parameters::set_target_once): Call it.
2892 * parameters.h (Parameters): Declare it (private member function).
2893 * layout.cc (load_seg_unusable_for_headers): New function, broken
2894 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2895 then validate rodata segment rather than text segment.
2896 (relaxation_loop_body): Call that.
2897 (is_text_segment): New function. Don't admit a non-executable
2898 segment if TARGET->isolate_execinstr().
2899 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2900
2901 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2902
2903 PR gold/15070
2904 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2905 * nacl.h (Sniff_file::View::View): Request aligned view.
2906
2907 2013-07-11 Cary Coutant <ccoutant@google.com>
2908
2909 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2910 correct BRLT entry size.
2911
2912 2013-07-03 Alan Modra <amodra@gmail.com>
2913
2914 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2915 comment.
2916
2917 2013-07-01 Cary Coutant <ccoutant@google.com>
2918
2919 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2920 reloc_type_.
2921 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2922 (Dwarf_ranges_table::lookup_reloc): New function.
2923 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2924 reloc_type_.
2925 (Dwarf_ranges_table::lookup_reloc): New function.
2926 (Dwarf_ranges_table::reloc_type_): New data member.
2927
2928 2013-06-27 Jing Yu <jingyu@google.com>
2929
2930 PR gold/15662
2931 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2932 function.
2933 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2934 (Target_powerpc::do_relax): Call the above.
2935
2936 2013-06-27 Cary Coutant <ccoutant@google.com>
2937
2938 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2939 on garbage collected .opd section.
2940
2941 2013-06-27 Alan Modra <amodra@gmail.com>
2942
2943 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2944 is non-zero.
2945 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2946 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2947
2948 2013-06-14 Cary Coutant <ccoutant@google.com>
2949
2950 * resolve.cc (Symbol::override_base): Don't override st_type
2951 from plugin placeholder symbols.
2952 (Symbol_table::resolve): Likewise.
2953 (Symbol_table::should_override): Don't complain about TLS mismatch
2954 if the TO symbol is a plugin placeholder.
2955 * testsuite/Makefile.am (plugin_test_tls): New test.
2956 * testsuite/Makefile.in: Regenerate.
2957 * testsuite/plugin_test_tls.sh: New test script.
2958 * testsuite/two_file_test_2_tls.cc: New test source.
2959 * testsuite/two_file_test_tls.cc: New test source.
2960
2961 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2962
2963 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2964 the maximum segment alignment is larger than the page size.
2965 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2966 correctly aligns the symbols with large alignemnt.
2967 * testsuite/Makefile.in: Regenerate.
2968 * testsuite/large_symbol_alignment.cc: New file.
2969
2970 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2971 Sriraman Tallam <tmsriram@google.com>
2972
2973 * options.h (sort_section): New option.
2974 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2975 Rename from Input_section_sort_section_name_special_ordering_compare.
2976 (Input_section_sort_section_name_compare): New struct.
2977 * output.cc (Output_section::Input_section_sort_section_name_compare::
2978 operator()): New function.
2979 (Output_section::sort_attached_input_sections): Use new sort function
2980 for .text if --sort-section=name is specified.
2981 * layout.cc (Layout::make_output_section):
2982 Add sorting by name when --sort-section=name is specified.
2983 * testsuite/Makefile.am (text_section_grouping): Test option
2984 --sort-section=name.
2985 * testsuite/Makefile.in: Regenerate.
2986 * testsuite/section_sorting_name.cc: New file.
2987 * testsuite/section_sorting_name.sh: New file.
2988
2989 2013-05-21 Cary Coutant <ccoutant@google.com>
2990
2991 * symtab.h (Symbol::is_cxx_vtable): New function.
2992 * target-reloc.h (relocate_section): Check for vtable symbol.
2993 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2994 * testsuite/Makefile.in: Regenerate.
2995 * testsuite/missing_key_func.cc: New test source.
2996 * testsuite/missing_key_func.sh: New test script.
2997
2998 2013-05-21 Cary Coutant <ccoutant@google.com>
2999
3000 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3001 type of enclosing symbol.
3002 (Relocate_info::location): Check symbol type when describing symbol.
3003 * object.h (Symbol_location_info): Remove unused line_number;
3004 add enclosing_symbol_type.
3005 * testsuite/debug_msg.sh: Adjust expected output.
3006
3007 2013-05-13 Cary Coutant <ccoutant@google.com>
3008
3009 * configure.ac: Export DEFAULT_TARGET.
3010 * configure: Regenerate.
3011 * Makefile.in: Regenerate.
3012 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3013 * testsuite/Makefile.in: Regenerate.
3014 * testsuite/debug_msg.sh: Delete duplicate tests.
3015 Don't check undef_int error message match for powerpc where the
3016 source file and line number aren't available.
3017
3018 2013-05-10 Roland McGrath <mcgrathr@google.com>
3019
3020 * options.h (General_options): Add --rosegment-gap option.
3021 * options.cc (finalize): --rosegment-gap implies --rosegment.
3022 * layout.cc (set_segment_offsets): Let user option override
3023 target->rosegment_gap().
3024
3025 2013-05-10 Roland McGrath <mcgrathr@google.com>
3026
3027 * options.h (General_options): Remove leading space from help
3028 messages for -nostdlib and --rosegment.
3029
3030 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3031
3032 PR ld/15365
3033 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3034
3035 2013-05-03 Alan Modra <amodra@gmail.com>
3036
3037 * merge.cc (Output_merge_string::do_add_input_section): Correct
3038 scan for number of strings. Rename vars to avoid shadowing.
3039 Include missing terminator in input_size_.
3040
3041 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3042
3043 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3044 Restore empty string handling.
3045
3046 2013-05-01 Cary Coutant <ccoutant@google.com>
3047
3048 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3049 uninitialized warning.
3050
3051 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3052
3053 * output.cc (Output_section::add_merge_input_section): Allow
3054 to merge sections if the alignment is more than character size.
3055 * merge.h (Output_merge_string::Output_merge_string): Remove
3056 assert.
3057 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3058 only not-null strings. Check the alignment of strings.
3059 * stringpool.h
3060 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3061 alignment as the argument.
3062 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3063 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3064 Align non-zero length strings according to the addralign_.
3065 (Stringpool_template<Stringpool_char>::set_string_offsets):
3066 Updating offsets according to the given alignment.
3067 * testsuite/Makefile.am (text_section_grouping): Test if string
3068 literals are getting merged.
3069 * testsuite/Makefile.in: Regenerate.
3070 * testsuite/merge_string_literals_1.c: New file.
3071 * testsuite/merge_string_literals_2.c: Ditto.
3072 * testsuite/merge_string_literals.sh: Ditto.
3073
3074 2013-04-26 Ian Lance Taylor <iant@google.com>
3075
3076 * target-reloc.h (relocate_section): If the reloc offset is out of
3077 range, pass VIEW as NULL to relocate.relocate.
3078 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3079 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3080 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3081 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3082 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3083 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3084
3085 2013-04-26 Geoff Pike <gpike@chromium.org>
3086
3087 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3088 * layout.cc (Hash_task): New class.
3089 (Layout::queue_build_id_tasks): New function.
3090 (Layout::write_build_id): Handle single-thread portion of build ID
3091 computation. (In some cases, all of it is single-threaded.) Replace
3092 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3093 functionality in fewer lines of code.
3094 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3095 * options.h (General_options): make "--build-id" default to tree
3096 rather than sha1. Add two new options related to --build-id=tree:
3097 --build-id-chunk-size-for-treehash and
3098 --build-id-min-file-size-for-treehash.
3099 * Makefile.am: add testing of --build-id=tree and related new options
3100 (these tests will be invoked by "make check").
3101 * Makefile.in: Regenerate.
3102
3103 2013-04-25 Alan Modra <amodra@gmail.com>
3104
3105 * configure.tgt: Add powerpcle and powerpc64le.
3106
3107 2013-04-22 Alan Modra <amodra@gmail.com>
3108
3109 PR gold/15355
3110 * layout.cc (Layout::segment_precedes): Allow more than one
3111 segment with the same type and flags.
3112
3113 2013-04-15 Cary Coutant <ccoutant@google.com>
3114
3115 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3116 allocate space in file for BSS sections.
3117
3118 2013-04-15 Cary Coutant <ccoutant@google.com>
3119
3120 * script-sections.cc (Orphan_output_section): Reset address
3121 to zero after each orphaned section for relocatable links.
3122
3123 2013-04-15 Cary Coutant <ccoutant@google.com>
3124
3125 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3126 section starting address for relocatable link.
3127 * testsuite/Makefile.am (script_test_11): New test.
3128 * testsuite/Makefile.in: Regenerate.
3129 * testsuite/script_test_11.c: New source file.
3130 * testsuite/script_test_11.t: New linker script.
3131
3132 2013-04-13 Alan Modra <amodra@gmail.com>
3133
3134 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3135 owner when sections are not adjacent and exceed group size.
3136 (Target_powerpc::group_sections): Handle corner case.
3137 (Target_powerpc::Branch_info::make_stub): Handle case where
3138 stub table doesn't exist due to branches in non-exec sections.
3139 (Target_powerpc::Relocate::relocate): Likewise.
3140
3141 2013-04-11 Alan Modra <amodra@gmail.com>
3142
3143 PR gold/15354
3144 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3145 .branch_lt to match bfd ld. Adjust comments throughout file.
3146
3147 2013-04-04 Ian Lance Taylor <iant@google.com>
3148
3149 GCC PR c++/56840
3150 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3151 sections before checking whether they are included in the link.
3152
3153 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3154
3155 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3156 object before calling the plugin claim_file handler. Pass the elf
3157 object of the archive to the plugin. Delete the elf object if the
3158 plugin claims the file.
3159
3160 2013-03-21 Alan Modra <amodra@gmail.com>
3161
3162 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3163 segment when omagic.
3164
3165 2013-03-21 Alan Modra <amodra@gmail.com>
3166
3167 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3168 comparison warning.
3169 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3170 uninitialized" warning.
3171
3172 2013-03-20 Alan Modra <amodra@gmail.com>
3173
3174 * symtab.h (Symbol::clear_version): New function.
3175 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3176 is_needed by weak references. Clear version for symbols defined
3177 in as-needed objects that are not needed.
3178
3179 2013-03-15 Alan Modra <amodra@gmail.com>
3180
3181 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3182 static and public. Add report_err param. Return false for data refs.
3183 (Target_powerpc::rela_dyn_section): New overloaded function.
3184 (Target_powerpc::plt_, iplt_): Elucidate.
3185 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3186 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3187 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3188 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3189 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3190 push_branch and make_plt_entry for ifunc syms when
3191 reloc_needs_plt_for_ifunc.
3192 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3193 for ifunc unless reloc_needs_plt_for_ifunc.
3194
3195 2013-03-15 Alan Modra <amodra@gmail.com>
3196
3197 * gc.h (gc_process_relocs): Don't look through function descriptors.
3198 * icf.cc (get_section_contents): Do so here instead.
3199
3200 2013-03-13 Alan Modra <amodra@gmail.com>
3201
3202 * powerpc.cc (is_branch_reloc): Forward declare.
3203 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3204 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3205 false for 64-bit, true for 32-bit non-branch relocs.
3206 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3207 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3208 nm output.
3209 (icf_safe_test): Generate linker map file as well as nm output.
3210 (icf_safe_so_test): Likewise.
3211 * testsuite/Makefile.in: Regenerate.
3212 * testsuite/icf_test.sh: Parse linker map file to determine
3213 section folding.
3214 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3215 * testsuite/icf_safe_so_test.sh: Likewise.
3216 (X86_32_or_ARM_specific_safe_fold): Merge into..
3217 (arch_specific_safe_fold): ..this.
3218 (X86_64_specific_safe_fold): Delete unused function.
3219
3220 2013-03-12 Alan Modra <amodra@gmail.com>
3221
3222 * gc.h (gc_process_relocs): Look through function descriptors
3223 to determine shndx, symvalue and addend used by ICF. Tidy
3224 variable duplication.
3225
3226 2013-03-11 Alan Modra <amodra@gmail.com>
3227
3228 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3229 * layout.cc (Layout_task_runner::run): ..to here.
3230 * symtab.h (struct Symbol_location): Extract from..
3231 (class Symbol_table): ..here.
3232 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3233 * target.h (class Target): Add function_location and
3234 do_function_location functions.
3235 (class Sized_target): Add do_function_location.
3236 * object.h (class Sized_relobj_file): Move find_shdr..
3237 (class Object): ..to here.
3238 * object.cc: Likewise. Update to suit. Instantiate.
3239 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3240 * powerpc.cc (class Powerpc_dynobj): New.
3241 (Target_powerpc::do_function_location): New function.
3242 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3243 (Powerpc_dynobj::do_read_symbols): New function.
3244 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3245
3246 2013-03-08 Ian Lance Taylor <iant@google.com>
3247
3248 * options.cc (General_options::string_to_object_format): Accept
3249 "default".
3250
3251 2013-03-08 Alan Modra <amodra@gmail.com>
3252
3253 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3254 pointer to Post_fde.
3255 (struct Post_fde): Move definition to here..
3256 * ehframe.cc (struct Post_fde): ..from here.
3257 (Cie::write): Don't alloc Post_fde.
3258 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3259
3260 2013-03-07 Alan Modra <amodra@gmail.com>
3261
3262 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3263 relocation referencing .LC0.
3264 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3265
3266 2013-03-07 Alan Modra <amodra@gmail.com>
3267
3268 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3269 always_inline. Add assembly for powerpc to avoid GOT.
3270
3271 2013-03-07 Alan Modra <amodra@gmail.com>
3272
3273 * testsuite/script_test_10.sh: Don't test .bss section
3274 header number.
3275
3276 2013-03-06 Alan Modra <amodra@gmail.com>
3277
3278 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3279 (Target_powerpc::symval_for_branch): Add symtab param. Update
3280 all callers. Handle folded sections.
3281 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3282 to Powerpc_relobj.
3283 (Global_symbol_visitor_opd::operator()): Likewise.
3284
3285 2013-03-04 Alan Modra <amodra@gmail.com>
3286
3287 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3288 * testsuite/Makefile.in: Regenerate.
3289
3290 2013-03-01 Cary Coutant <ccoutant@google.com>
3291
3292 Add dwp support for v2 DWARF package file format.
3293 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3294 tu_length parameter. Adjust all callers.
3295 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3296 * dwp.cc: Include dwarf.h.
3297 (Section_bounds): New struct type.
3298 (Unit_set): New struct type.
3299 (Dwo_file::Dwo_file): Initialize new data member.
3300 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3301 Combine and rename to...
3302 (Dwo_file::read_unit_index): ...this.
3303 (Dwo_file::sized_read_compunit_index)
3304 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3305 (Dwo_file::sized_read_unit_index): ...this.
3306 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3307 parameters; add section_id parameter.
3308 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3309 (Dwo_file::add_unit_set): ...this.
3310 (Dwo_file::shndx_map_): Remove.
3311 (Dwo_file::sect_offsets_): New data member.
3312 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3313 (Dwp_output_file::add_section): Rename to...
3314 (Dwp_output_file::add_contribution): ...this.
3315 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3316 (Dwp_output_file::add_tu_set): Likewise.
3317 (Dwp_output_file::Contribution): New type.
3318 (Dwp_output_file::Section::contributions): New data member.
3319 (Dwp_output_file::Cu_or_tu_set): Remove.
3320 (Dwp_output_file::Section::Section): New ctor.
3321 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3322 (Dwp_output_file::Dwp_index::Section_table): New type.
3323 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3324 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3325 parameter.
3326 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3327 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3328 (Dwp_output_file::Dwp_index::section_table): New member function.
3329 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3330 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3331 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3332 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3333 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3334 (Dwp_output_file::Dwp_index::section_table_): New data member.
3335 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3336 (Dwp_output_file::add_output_section): New member function.
3337 (Dwp_output_file::write_new_section): New member function.
3338 (Dwp_output_file::write_contributions): New member function.
3339 (Dwp_output_file::section_id_map_): New data member.
3340 (class Dwo_id_info_reader): Remove.
3341 (class Unit_reader): New class.
3342 (get_dwarf_section_name): New function.
3343 (Dwo_file::read_executable): Adjust initializations of class data.
3344 (Dwo_file::read): Add support for v2 package file format.
3345 (Dwo_file::read_unit_index): Likewise.
3346 (Dwo_file::sized_read_unit_index): Likewise.
3347 (Dwo_file::copy_section): Likewise.
3348 (Dwo_file::add_unit_set): Likewise.
3349 (Dwp_output_file::add_output_section): Likewise.
3350 (Dwp_output_file::add_contribution): Likewise.
3351 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3352 for empty slot.
3353 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3354 file format.
3355 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3356 slot.
3357 (Dwp_output_file::initialize): Remove unused function.
3358 (Dwp_output_file::finalize): Add support for v2 package file format.
3359 (Dwp_output_file::write_index): Likewise.
3360 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3361 function prototype.
3362
3363 2013-03-01 Cary Coutant <ccoutant@google.com>
3364
3365 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3366 function into class definition in header file.
3367 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3368 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3369 New function.
3370 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3371
3372 2013-02-28 Alan Modra <amodra@gmail.com>
3373
3374 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3375 * target.cc (Target::do_plt_fde_location): New function.
3376 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3377 accessor function, and constructor param.
3378 (struct Post_fde, Post_fdes): Declare.
3379 (Cie::write): Add post_fdes param.
3380 * ehframe.cc (Fde::write): Use plt_fde_location.
3381 (struct Post_fde): Define.
3382 (Cie::write): Stash FDEs added post merge mapping.
3383 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3384 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3385 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3386 other FDEs.
3387 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3388 (Target_powerpc::has_glink): New function.
3389 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3390 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3391 glink_eh_frame_fde_32, default_fde): New data.
3392 (Stub_table::eh_frame_added_): New var.
3393 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3394 Make const.
3395 (Stub_table::add_eh_frame): New function.
3396 (Output_data_glink::add_eh_frame): New function.
3397 (Target_powerpc::make_glink_section): Call add_eh_frame.
3398
3399 2013-02-15 Ian Lance Taylor <iant@google.com>
3400
3401 * options.h (DEFINE_uint64_alias): Define.
3402 (class General_options): Add -Ttext-segment as an alias for
3403 -Ttext.
3404
3405 2013-02-15 Alan Modra <amodra@gmail.com>
3406
3407 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3408 (Stub_table::do_write): ..here, two places.
3409 (Stub_table::plt_call_size): Use it here too.
3410
3411 2013-02-11 Ian Lance Taylor <iant@google.com>
3412
3413 * descriptors.cc (Descriptors::close_all): New function.
3414 * descriptors.h (class Descriptors): Declare close_all.
3415 (close_all_descriptors): New inline function.
3416 * plugin.cc: Include "descriptors.h".
3417 (Plugin_manager::cleanup): Call close_all_descriptors.
3418
3419 2013-02-06 Alan Modra <amodra@gmail.com>
3420
3421 * README: Update coding style link.
3422
3423 2013-01-28 Cary Coutant <ccoutant@google.com>
3424
3425 * dwp.cc (File_list): New typedef.
3426 (Dwo_name_info_reader): New class.
3427 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3428 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3429 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3430 (Dwo_file::read_executable): New function.
3431 (Dwo_file::read): Move common setup code to ...
3432 (Dwo_file::make_object): ... here.
3433 (dwp_options): Add --exec/-e.
3434 (usage): Likewise.
3435 (main): Likewise.
3436
3437 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3438
3439 * layout.cc (Layout::layout): Check for option text_reorder.
3440 (Layout::make_output_section): Ditto.
3441 * options.h (text_reorder): New option.
3442 * output.cc (Input_section_sort_compare): Remove special ordering
3443 of section names.
3444 (Output_section::
3445 Input_section_sort_section_name_special_ordering_compare::
3446 operator()): New function.
3447 (Output_section::sort_attached_input_sections): Use new sort function
3448 for .text.
3449 * output.h (Input_section_sort_section_name_special_ordering_compare):
3450 New struct.
3451 * testsuite/Makefile.am (text_section_grouping): Test option
3452 --no-text-reorder
3453 * testsuite/Makefile.in: Regenerate.
3454 * testsuite/text_section_grouping.sh: Check order of functions without
3455 default text reordering.
3456
3457 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3458
3459 * options.h (General_options): Change default to true for new_dtags.
3460
3461 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3462
3463 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3464 when enable_new_dtags is false. Only add DT_RUNPATH when
3465 enable_new_dtags is true.
3466
3467 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3468
3469 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3470 used in declaration and definition consistent.
3471 (Target_powerpc::symval_for_branch): Ditto.
3472
3473 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3474
3475 * testsuite/plugin_final_layout.cc: Fix comment.
3476
3477 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3478
3479 * layout.cc (Layout::layout): Do not do default sorting for
3480 text sections when section ordering is specified.
3481 (make_output_section): Ditto.
3482 * testsuite/plugin_final_layout.cc: Name the function sections
3483 to catch reordering issues.
3484
3485 2013-01-15 Alan Modra <amodra@gmail.com>
3486
3487 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3488 plt-thread-safe.
3489
3490 2013-01-15 Alan Modra <amodra@gmail.com>
3491
3492 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3493 * testsuite/Makefile.in: Regenerate.
3494
3495 2013-01-14 Alan Modra <amodra@gmail.com>
3496
3497 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3498 * testsuite/Makefile.in: Regenerate.
3499
3500 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3501
3502 PR bfd/14430
3503 Fix mingw gold build with plugins enabled
3504 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3505 * configure.ac: Export DLOPEN_LIBS and add headers check.
3506 * plugin.cc: Handle non-dlfcn case.
3507 * Makefile.in: Regenerate.
3508 * config.in: Regenerate.
3509 * configure: Regenerate.
3510 * testsuite/Makefile.in: Regenerate.
3511
3512 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3513
3514 * output.h (sort_attached_input_sections): Change to be public.
3515 * script-sections.cc
3516 (Output_section_definition::set_section_addresses): Sort
3517 attached input sections according to section order before linker
3518 script assigns section addresses.
3519 (Orphan_output_section::set_section_addresses): Sort
3520 attached input sections according to section order before linker
3521 script assigns section addresses.
3522 * Makefile.am (final_layout.sh): Use a simple linker script to
3523 check if section ordering still works.
3524 * Makefile.in: Regenerate.
3525
3526 2013-01-09 Ben Cheng <bccheng@google.com>
3527
3528 * arm.cc (Target_arm::attributes_accept_div): New function.
3529 (Target_arm::attributes_forbid_div): New function.
3530 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3531 attribute using the same new functions as what bfd/elf32_arm.c
3532 does.
3533
3534 2013-01-07 Cary Coutant <ccoutant@google.com>
3535
3536 PR gold/14993
3537 * output.cc (Output_section::add_input_section): For incremental
3538 updates, don't track input sections that are allocated from patch
3539 space.
3540
3541 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3542 Ian Lance Taylor <iant@google.com>
3543
3544 PR gold/14897
3545 * configure.ac (--enable-ld): Removed.
3546 (install_as_default): Set to yes only for --enable-gold=default
3547 or --disable-ld.
3548 * configure: Regenerated.
3549
3550 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3551
3552 * options.h (General_options): Add -fuse-ld= for GCC linker
3553 option compatibility.
3554
3555 2013-01-04 Cary Coutant <ccoutant@google.com>
3556
3557 * configure.ac: Fix typo restoring CXXFLAGS.
3558 * configure: Regenerate.
3559
3560 2013-01-04 Cary Coutant <ccoutant@google.com>
3561
3562 * testsuite/Makefile.am (CXXLINK_S): New macro.
3563 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3564 * testsuite/Makefile.in: Regenerate.
3565
3566 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3567
3568 * version.cc (print_version): Update copyright year to 2013.
3569
3570 2012-12-20 Ian Lance Taylor <iant@google.com>
3571
3572 * layout.cc (Layout::special_ordering_of_input_section): New
3573 function.
3574 (Layout::layout): If input section requires special ordering, must
3575 sort input sections.
3576 (Layout::make_output_section): May sort .text input sections.
3577 (Layout::is_section_name_prefix_grouped): Remove.
3578 * layout.h (class Layout): Declare
3579 special_ordering_of_input_section. Don't declare
3580 is_section_name_prefix_grouped.
3581 * output.cc (Output_section::add_input_section): Revert last
3582 change.
3583 (Output_section::Input_section_sort::match_file_name): Don't crash
3584 if called on output section data.
3585 (Output_section::Input_section_sort_compare): Sort based on
3586 special ordering.
3587 (Output_section::Input_section_sort_section_order_index_compare):
3588 Revert last patch.
3589 (Output_section::sort_attached_input_sections): Likewise.
3590
3591 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3592
3593 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3594 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3595 * output.cc (Output_section::add_input_section): Check if section
3596 name contains special prefix. Keep input sections to sort such
3597 sections.
3598 (Output_section::Input_section_sort_section_order_index_compare
3599 ::operator()): Group sections according to prefixes.
3600 (Output_section::sort_attached_input_sections): Add condition to
3601 Input_section_entry constructor call.
3602 * testsuite/Makefile.am (text_section_grouping): New test.
3603 * testsuite/Makefile.in: Regenerate.
3604 * testsuite/text_section_grouping.cc: New file.
3605 * testsuite/text_section_grouping.sh: New file.
3606
3607 2012-12-17 Nick Clifton <nickc@redhat.com>
3608
3609 * Makefile.am: Add copyright notice.
3610 * NEWS: Likewise.
3611 * README: Likewise.
3612 * configure.ac: Likewise.
3613 * ftruncate.c: Likewise.
3614 * Makefile.in: Regenerate.
3615
3616 2012-12-14 Cary Coutant <ccoutant@google.com>
3617
3618 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3619 --no-as-needed flag.
3620 (exception_separate_shared_12_test): Likewise.
3621 (incremental_copy_test): Likewise.
3622 * testsuite/Makefile.in: Regenerate.
3623
3624 2012-12-14 Cary Coutant <ccoutant@google.com>
3625
3626 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3627 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3628
3629 2012-12-12 Alan Modra <amodra@gmail.com>
3630
3631 * powerpc.cc (class Track_tls): New.
3632 (class Relocate, class Scan): Inherit Track_tls.
3633 (Target_powerpc::Scan::local, global): Track tls optimization
3634 and avoid creating plt entry for __tls_get_addr if all uses
3635 are optimized away.
3636 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3637
3638 2012-12-12 Alan Modra <amodra@gmail.com>
3639
3640 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3641 Replace no_toc_optimize with toc_optimize.
3642 * output.h (Output_section::input_sections): Provide non-const variant.
3643 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3644 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3645 accessors.
3646 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3647 (class Sort_toc_sections): New.
3648 (Target_powerpc::do_finalize_sections): Sort toc sections.
3649 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3650
3651 2012-12-10 Roland McGrath <mcgrathr@google.com>
3652
3653 * testsuite/binary_unittest.cc (read_all): New function.
3654 (Sized_binary_test): Use it instead of ::read.
3655 * fileread.cc (do_read): Don't assume pread always reads the whole
3656 amount in a single call.
3657
3658 2012-12-10 Alan Modra <amodra@gmail.com>
3659
3660 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3661 Set EM_PPC64 or EM_PPC here.
3662 (Target_selector_powerpc::do_recognize): Delete.
3663
3664 2012-12-10 Alan Modra <amodra@gmail.com>
3665
3666 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3667 stub_table_.
3668 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3669
3670 2012-12-07 Roland McGrath <mcgrathr@google.com>
3671
3672 * testsuite/binary_unittest.cc (Sized_binary_test):
3673 Use open_descriptor rather than ::open.
3674
3675 2012-12-07 Alan Modra <amodra@gmail.com>
3676
3677 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3678 typedef and invalid_address constant.
3679 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3680 instantiate constants.
3681
3682 2012-12-06 Roland McGrath <mcgrathr@google.com>
3683
3684 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3685 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3686 * aclocal.m4: Regenerate.
3687 * configure: Regenerate.
3688 * Makefile.in: Regenerate.
3689 * testsuite/Makefile.in: Regenerate.
3690
3691 2012-12-07 Alan Modra <amodra@gmail.com>
3692
3693 * options.h (General_options): Add no_toc_optimize.
3694 * powerpc.cc (ok_lo_toc_insn): New function.
3695 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3696
3697 2012-12-06 Alan Modra <amodra@gmail.com>
3698
3699 * options.h (General_options): Add plt_align, plt_static_chain,
3700 plt_thread_safe. Update stub_group_size help text.
3701 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3702 for new plt_thread_safe_ var.
3703 (use_plt_offset): Correct comments.
3704 (Target_powerpc::do_relax): Look for thread creation symbols to
3705 determine default plt_thread_safe value. Clear plt call stubs
3706 as well as branch stubs each iteration.
3707 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3708 insn constants.
3709 (l, hi, ha, write_insn): Move earlier.
3710 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3711 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3712 plt stubs too.
3713 (Stub_table::update_size): Adjust.
3714 (Stub_table::prev_size, set_prev_size): Delete.
3715 (Stub_table::stub_align): Let --plt-align affect result.
3716 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3717 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3718 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3719 (Stub_table::do_write): Support more stub variants.
3720
3721 2012-12-04 Alan Modra <amodra@gmail.com>
3722
3723 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3724 (Target_powerpc::do_define_standard_symbols): New function.
3725
3726 2012-12-03 Alan Modra <amodra@gmail.com>
3727
3728 * output.h: Formatting, whitespace.
3729
3730 2012-12-03 Alan Modra <amodra@gmail.com>
3731
3732 * layout.h (Layout::get_executable_sections): Declare.
3733 * layout.cc (Layout::get_executable_sections): New function.
3734 * arm.cc (Target_arm::group_sections): Use it.
3735 (Arm_output_section::group_sections): Delete now redundant test.
3736 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3737 param to handle relative relocs.
3738 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3739 (Output_data_reloc::add_absolute): Adjust.
3740 (Output_data_reloc::add_relative): New function.
3741 (Output_data::reset_data_size): New function.
3742 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3743 (Output_section::set_addralign): New function.
3744 (Output_section::checkpoint_set_addralign): New function.
3745 (Output_section::clear_section_offsets_need_adjustment): New function.
3746 (Output_section::input_sections): Make public.
3747 * powerpc.cc (class Output_data_brlt_powerpc): New.
3748 (class Stub_table, class Stub_control): New.
3749 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3750 stub_table_, set_stub_table, stub_table): New vectors and accessor
3751 functions.
3752 (Target_powerpc::do_may_relax, do_relax, push_branch,
3753 new_stub_table, stub_tables, brlt_section, group_sections,
3754 add_branch_lookup_table, find_branch_lookup_table,
3755 write_branch_lookup_table, make_brlt_section): New functions.
3756 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3757 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3758 branch_info_): New vars.
3759 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3760 make call stubs here.
3761 (Output_data_glink): Remove all call stub handling from this class.
3762 (Target_powerpc::Scan::local, global): Save interesting branch
3763 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3764 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3765 functions on final link.
3766 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3767 Handle long branch destinations too.
3768 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3769 do_plt_address_for_local): Adjust lookup of plt call stubs.
3770
3771 2012-11-30 Alan Modra <amodra@gmail.com>
3772
3773 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3774 relocs against protected symbols when building 32-bit shared libs.
3775
3776 2012-11-30 Alan Modra <amodra@gmail.com>
3777
3778 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3779 param. Call got_section() to make .got. Update all callers
3780 and their callers and so on.
3781
3782 2012-11-30 Alan Modra <amodra@gmail.com>
3783
3784 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3785 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3786 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3787 value if it already exists.
3788
3789 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3790
3791 PR gold/14858
3792 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3793
3794 2012-11-14 Roland McGrath <mcgrathr@google.com>
3795
3796 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3797 than bfc instruction for data sandboxing.
3798
3799 2012-11-08 Alan Modra <amodra@gmail.com>
3800
3801 * po/POTFILES.in: Regenerate.
3802
3803 2012-11-05 Alan Modra <amodra@gmail.com>
3804
3805 * configure.ac: Apply 2012-09-10 change to config.in here.
3806 * configure: Regenerate.
3807
3808 2012-11-05 Alan Modra <amodra@gmail.com>
3809
3810 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3811 (struct Opd_ent): Use "Address" rather than "Offset".
3812 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3813 (Target_powerpc::got_section): Make public.
3814 (Target_powerpc::scan_relocs): Move code setting symbols..
3815 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3816 Create _SDA_BASE_ only when referenced.
3817
3818 2012-11-02 Roland McGrath <mcgrathr@google.com>
3819
3820 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3821 from last change.
3822
3823 2012-11-01 Roland McGrath <mcgrathr@google.com>
3824
3825 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3826 for offset_in_output_section parameter.
3827 (Sized_target::relocate_special_relocatable): Likewise.
3828 * arm.cc (Target_arm::relocate_relocs): Likewise.
3829 (Target_arm::relocate_special_relocatable): Likewise.
3830 * i386.cc (Target_i386::relocate_relocs): Likewise.
3831 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3832 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3833 * target-reloc.h (relocate_relocs): Likewise.
3834 * testsuite/testfile.cc (Target_test): Likewise.
3835 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3836 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3837
3838 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3839 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3840
3841 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3842 parameter, which is unused in the [!F_SETFD] case.
3843
3844 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3845 SYMNDX to off_t before comparing it to this->data_size().
3846 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3847 * incremental.cc (Output_section_incremental_inputs::do_write):
3848 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3849
3850 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3851
3852 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3853
3854 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3855 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3856 in EABI_VER5.
3857
3858 2012-10-29 Cary Coutant <ccoutant@google.com>
3859
3860 * dwp.cc (usage): Add file and exit status parameters;
3861 add --help and --version options.
3862 (print_version): New function.
3863 (main): Add --help and --version options.
3864
3865 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3866
3867 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3868 final_layout_sequence.txt.
3869 * testsuite/Makefile.in: Regenerated.
3870
3871 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3872
3873 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3874 COMPILE generated by automake.
3875 (LINK1): Likewise.
3876 (CXXCOMPILE1): Likewise.
3877 (CXXLINK1): Likewise.
3878 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3879 (LINK): Likewise.
3880 (CXXCOMPILE): Likewise.
3881 (CXXLINK): Likewise.
3882 * testsuite/Makefile.in: Regenerated.
3883
3884 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3885
3886 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3887 on bad fwrite return.
3888
3889 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3890
3891 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3892 on val.
3893
3894 2012-10-23 Cary Coutant <ccoutant@google.com>
3895
3896 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3897 * testsuite/Makefile.in: Regenerate.
3898 * testsuite/dwp_test.h: New source file.
3899 * testsuite/dwp_test_1.cc: New source file.
3900 * testsuite/dwp_test_1.s: New source file.
3901 * testsuite/dwp_test_1.sh: New source file.
3902 * testsuite/dwp_test_1b.cc: New source file.
3903 * testsuite/dwp_test_1b.s: New source file.
3904 * testsuite/dwp_test_2.cc: New source file.
3905 * testsuite/dwp_test_2.s: New source file.
3906 * testsuite/dwp_test_2.sh: New source file.
3907 * testsuite/dwp_test_main.cc: New source file.
3908 * testsuite/dwp_test_main.s: New source file.
3909
3910 2012-10-23 Cary Coutant <ccoutant@google.com>
3911
3912 * dwp.h: New header file.
3913 * dwp.cc: New source file.
3914 * gold.h: Move shared declarations to system.h.
3915 * system.h: New header file.
3916 * Makefile.am: Add dwp.
3917 * Makefile.in: Regenerate.
3918
3919 2012-10-23 Cary Coutant <ccoutant@google.com>
3920
3921 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3922 Dwarf_info_reader::read_from_pointer.
3923 (Dwarf_pubnames_table::read_header): Likewise.
3924 (Dwarf_pubnames_table::next_name): Likewise.
3925 (Dwarf_die::read_attributes): Likewise.
3926 (Dwarf_die::skip_attributes): Likewise.
3927 (Dwarf_info_reader::read_from_pointer): New function template.
3928 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3929 (Dwarf_pubnames_table): Likewise.
3930 (Dwarf_info_reader::read_from_pointer): New function template.
3931 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3932 Dwarf_pubnames_table ctor.
3933
3934 2012-10-23 Cary Coutant <ccoutant@google.com>
3935
3936 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3937 abbrev_shndx.
3938 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3939 abbrev_shndx_.
3940 (Dwarf_info_reader::set_abbrev_shndx): New method.
3941 (Dwarf_info_reader::abbrev_shndx_): New data member.
3942
3943 2012-10-23 Cary Coutant <ccoutant@google.com>
3944
3945 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3946 from object, not parameters.
3947 (Dwarf_info_reader::parse): Likewise.
3948 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3949 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3950 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3951 methods.
3952
3953 2012-10-23 Cary Coutant <ccoutant@google.com>
3954
3955 * fileread.cc (Input_file::Input_file): New constructor.
3956 * fileread.h (class Input_file): Add new constructor.
3957
3958 2012-10-18 Alan Modra <amodra@gmail.com>
3959
3960 PR gold/14727
3961 * object.cc (Relobj::is_section_name_included): Also match
3962 .sdata personality section.
3963
3964 2012-10-18 Alan Modra <amodra@gmail.com>
3965
3966 * target-reloc.h (class Default_comdat_behavior): New, package up..
3967 (get_comdat_behaviour): ..this.
3968 (relocate_section): Add Relocate_comdat_behavior template arg,
3969 adjust code to suit.
3970 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3971 (Target_arm::scan_reloc_section): Likewise.
3972 * i386.cc (Target_i386::relocate_section): Likewise.
3973 * sparc.cc (Target_sparc::relocate_section): Likewise.
3974 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3975 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3976 * powerpc.cc (class Relocate_comdat_behavior): New.
3977 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3978 gold::relocate_section with new template arg.
3979
3980 2012-10-18 Alan Modra <amodra@gmail.com>
3981
3982 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3983 dynamic relocs for GOT_TPREL got entries, without symbol if
3984 resolving locally.
3985 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3986 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3987 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3988
3989 2012-10-17 Alan Modra <amodra@gmail.com>
3990
3991 PR gold/14726
3992 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3993
3994 2012-10-16 Sriraman Tallam <tmsriram@google.com>
3995
3996 * layout.cc (Layout::include_section): Keep sections marked
3997 SHF_EXCLUDE when doing relocatable links.
3998
3999 2012-10-16 Alan Modra <amodra@gmail.com>
4000
4001 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4002 (Target_powerpc::do_finalize_sections): Call it.
4003 (Output_data_save_res): New class and supporting functions.
4004 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4005 normal symbols defined in object files.
4006
4007 2012-10-12 Alan Modra <amodra@gmail.com>
4008
4009 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4010 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4011 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4012 section if scan_opd_relocs not yet called.
4013 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4014
4015 2012-10-12 Alan Modra <amodra@gmail.com>
4016
4017 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4018 add_local_ifunc_entry): Revert last change.
4019 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4020
4021 2012-10-05 Alan Modra <amodra@gmail.com>
4022
4023 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4024 do_plt_address_for_global): New functions.
4025 (Output_data_got_powerpc::do_write): Don't segfault when linking
4026 statically.
4027 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4028 add_local_ifunc_entry): Return true on adding entry..
4029 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4030 glink->add_entry call. Remove unused symtab param. Adjust calls.
4031 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4032 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4033 set up symbols here.
4034 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4035 syms here. Do so even when no .iplt. Don't segfault when linking
4036 statically.
4037 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4038 new variants without reloc param.
4039 (Glink_sym_ent::Glink_sym_ent): Likewise.
4040 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4041 reloc when refs will resolve to plt call stub.
4042 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4043 R_PPC_PLTREL24 to resolve locally.
4044 (Target_powerpc::Scan::global): Correct ifunc handling.
4045 (Target_powerpc::Relocate::relocate): Correct local sym glink
4046 lookup. Don't destroy "value" when we have a plt call stub,
4047 and when checking plt call validity.
4048 (Target_powerpc::do_dynsym_value): Simplify.
4049
4050 2012-10-05 Alan Modra <amodra@gmail.com>
4051
4052 * i386.cc (Output_data_plt_i386::address_for_global,
4053 address_for_local): Add plt offset to returned value. Adjust uses.
4054 * sparc.cc (Output_data_plt_sparc::address_for_global,
4055 address_for_local): Likewise.
4056 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4057 address_for_local): Likewise.
4058 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4059 address_for_local): Likewise.
4060 * target.h (Target::plt_address_for_global, plt_address_for_local):
4061 Update comment.
4062 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4063 (Output_data_got::Got_entry::write): Nor here.
4064 * output.h: Comment fix.
4065
4066 2012-10-02 Jiong Wang <jiwang@tilera.com>
4067
4068 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4069 global_offset_table_ value for larget got.
4070 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4071
4072 2012-09-29 Alan Modra <amodra@gmail.com>
4073
4074 * powerpc.cc (Target_powerpc::iplt_): New output section.
4075 (Target_powerpc::iplt_section, make_iplt_section,
4076 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4077 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4078 Target_powerpc::plt_entry_count): Count iplt entries too.
4079 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4080 reloc section in constructor. New params.
4081 (Target_powerpc::make_plt_section): Create reloc section here instead.
4082 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4083 functions.
4084 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4085 (Output_data_glink::add_entry, find_entry): New functions to
4086 deal with local syms.
4087 (Glink_sym_ent): Add support for local syms.
4088 (Output_data_glink::do_write): Handle ifunc plt entries.
4089 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4090 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4091 (Target_powerpc::Relocate::relocate): Likewise.
4092 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4093
4094 2012-09-25 Alan Modra <amodra@gmail.com>
4095
4096 * object.h (Sized_relobj_file::adjust_local_symbol,
4097 do_adjust_local_symbol): New functions.
4098 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4099 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4100 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4101 and irregular opd entry spacing.
4102 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4103 (Global_symbol_visitor_opd): New functor.
4104 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4105 on deleted opd entries.
4106
4107 2012-09-15 Jiong Wang <jiwang@tilera.com>
4108
4109 * tilegx.cc: New file.
4110 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4111 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4112 * configure.tgt: Add entries for tilegx*.
4113 * configure.ac: Likewise.
4114 * Makefile.in: Rebuild.
4115 * configure: Likewise.
4116 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4117 tilegx.
4118
4119 2012-09-13 Alan Modra <amodra@gmail.com>
4120
4121 * target-reloc.h (scan_relocs): Call scan.local for relocs
4122 against symbols in discarded sections. Pass is_discarded
4123 param.
4124 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4125 Add is_discarded param.
4126 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4127 is_discarded to flag opd entry as discarded. Don't emit dyn
4128 relocs on such entries.
4129 (Target_powerpc::Scan::global): Similarly detect and handle
4130 such opd entries.
4131 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4132 opd_ent_. Update all uses.
4133 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4134 (Target_powerpc::relocate_section): Zero out discarded opd
4135 entry relocs.
4136
4137 2012-09-12 Ian Lance Taylor <iant@google.com>
4138
4139 PR gold/14570
4140 * output.cc: Rename Output_data_got template parameter from size
4141 to got_size for all functions. Compile all variants of
4142 Output_data_got.
4143 (Output_data_got::Got_entry::write): Correct use of size for
4144 symbol value. Use local_is_tls rather than casting to
4145 Sized_relobj_file.
4146 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4147 (class Sized_relobj_file): Add do_local_is_tls.
4148 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4149
4150 2012-09-11 Alan Modra <amodra@gmail.com>
4151
4152 PR gold/14566
4153 * layout.cc (Layout::set_segment_offsets): When using
4154 common-page-size alignment, ensure we are on a new max-page-size
4155 page.
4156 * output.cc (Output_segment::set_section_addresses): Use
4157 abi_pagesize, not common_pagesize for relro boundary.
4158 (Output_segment::set_offset): Likewise.
4159
4160 2012-09-11 Alan Modra <amodra@gmail.com>
4161
4162 * output.h (Output_data_got::add_global_tls, add_local_tls,
4163 add_local_tls_pair): New functions.
4164 (Output_data_got::add_local_pair_with_rel): Remove second
4165 reloc param. Expand comment.
4166 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4167 use_plt_or_tls_offset_, similarly for constructor param.
4168 (Output_data_got::Got_entry::write): Add got_index param.
4169 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4170 add_local_tls_pair): New functions.
4171 (Output_data_got::Got_entry::write): Handle tls symbols
4172 with use_plt_or_tls_offset_ set specially.
4173 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4174 (Output_data_got::do_write): Replace iterator with index, pass
4175 index to entry write function.
4176 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4177 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4178 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4179 call.
4180 * i386.cc (Target_i386::Scan::local): Likewise.
4181 * sparc.cc (Target_sparc::Scan::local): Likewise.
4182 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4183 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4184 do_tls_offset_for_global): New functions.
4185 (Target_powerpc::Scan::local): Correct TLS relocations and got
4186 entry values.
4187 (Target_powerpc::Scan::global): Don't emit unnecessary
4188 dynamic relocations on TLS GOT entries.
4189
4190 2012-09-10 Matthias Klose <doko@ubuntu.com>
4191
4192 * config.in: Disable sanity check for kfreebsd.
4193
4194 2012-09-10 Sterling Augustine <saugustine@google.com>
4195
4196 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4197 (Gdb_index::pubtypes_read): New parameter.
4198 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4199 to calls.
4200 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4201 pubtypes_object_.
4202
4203 2012-09-09 Alan Modra <amodra@gmail.com>
4204
4205 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4206 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4207 * gc.h (gc_process_relocs): Call target gc_add_reference.
4208 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4209 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4210 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4211 unnecessary cast.
4212 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4213 to cater for when we don't need code offset. Update use.
4214 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4215 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4216 set_opd_valid): New functions.
4217 (Target_powerpc::do_gc_add_reference): New function.
4218 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4219 stashed refs.
4220 (Target_powerpc::do_gc_mark_symbol): New function.
4221
4222 2012-09-06 Cary Coutant <ccoutant@google.com>
4223
4224 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4225 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4226 (Dwarf_die::skip_attributes): Likewise.
4227 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4228 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4229 (main): Call it.
4230 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4231
4232 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4233
4234 * testsuite/script_test_3.t: Add .got.plt output section
4235 statement.
4236 * testsuite/script_test_4.t: Likewise.
4237
4238 2012-09-05 Alan Modra <amodra@gmail.com>
4239
4240 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4241 update all uses and lose "enum" when using type.
4242
4243 2012-09-05 Alan Modra <amodra@gmail.com>
4244
4245 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4246 * configure: Regenerate.
4247 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4248 (plugin_final_layout.stdout): Likewise.
4249 (memory_test): Set page sizes to 0x1000.
4250 * testsuite/Makefile.in: Regenerate.
4251 * testsuite/discard_locals_test.sh: Add FIXME comment.
4252 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4253 * testsuite/pr14265.t: Add .got output section statement.
4254 * testsuite/script_test_2.t: Likewise.
4255 * testsuite/script_test_3.t: Likewise.
4256 * testsuite/script_test_4.t: Likewise.
4257 * testsuite/script_test_5.t: Likewise.
4258 * testsuite/script_test_6.t: Likewise.
4259 * testsuite/script_test_7.t: Likewise.
4260 * testsuite/script_test_9.t: Likewise.
4261
4262 2012-09-05 Alan Modra <amodra@gmail.com>
4263
4264 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4265 (Powerpc_relocate_functions::Status): New typedef.
4266 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4267 (Target_powerpc::Scan::local): Handle REL64.
4268 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4269 for REL32 and REL64.
4270 (Target_powerpc::symval_for_branch): New function, extracted from..
4271 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4272 checks. Report overflow errors.
4273
4274 2012-09-05 Alan Modra <amodra@gmail.com>
4275
4276 * object.h (Sized_relobj_file::emit_relocs): Delete.
4277 (Sized_relobj_file::emit_relocs_reltype): Delete.
4278 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4279 relocate_relocs for --emit-relocs.
4280 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4281 * output.h: Update comment.
4282 (Output_segment::first_section): New function.
4283 (Output_segment::first_section_load_address): Use first_section.
4284 * output.cc (Output_segment::first_section): New function extracted..
4285 (Output_segment::first_section_load_address): ..from here. Delete.
4286 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4287 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4288 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4289 adjust call to target.h function.
4290 * i386.cc (Target_i386): Likewise.
4291 * sparc.cc (Target_sparc): Likewise.
4292 * x86_64.cc (Target_x86_64): Likewise.
4293 * powerpc.cc (Target_powerpc): Likewise.
4294 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4295 first tls section has section symbol for optimised local dynamic
4296 output relocs.
4297 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4298 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4299 optimised tls code.
4300 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4301 Rename to relocate_relocs. Update error message.
4302
4303 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4304
4305 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4306 --just-symbols.
4307
4308 2012-08-31 Alan Modra <amodra@gmail.com>
4309
4310 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4311 (Powerpc_relobj::toc_base_offset): New stub function.
4312 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4313 got_mod_index_offset to tlsld_got_offset. Update all refs.
4314 (Target_powerpc::Relocate::enum skip_tls): New.
4315 (Target_powerpc::call_tls_get_addr_): New var.
4316 (Target_powerpc::is_branch_reloc): Move to file scope.
4317 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4318 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4319 New functions.
4320 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4321 (powerpc_info): Correct common_pagesize for ppc64.
4322 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4323 (Powerpc_relocate_functions): Add overflow check enums and functions.
4324 Add non-shift version of rela, rela_ua. Delete all rel public
4325 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4326 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4327 addr16_ha3, addr14 functions.
4328 (Output_data_got_powerpc::add_constant_pair): New function.
4329 (Output_data_got_powerpc::got_base_offset): Likewise.
4330 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4331 (instruction constants): Sort, add some more.
4332 (Output_data_glink::do_write): Add and use Address typedef. Use
4333 object->toc_base_offset() stub for 64-bit.
4334 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4335 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4336 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4337 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4338 Always treat .opd relocs as against locally defined symbol.
4339 Correct condition for RELATIVE relocs.
4340 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4341 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4342 for 32-bit syms with a plt entry. Correct ppc64 toc base
4343 calculations. Handle TLS relocs, and more. Add overflow
4344 checking and adjust for Powerpc_relocate_functions changes.
4345 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4346 Reinstate --emit-relocs code with FIXME.
4347
4348 2012-08-30 Alan Modra <amodra@gmail.com>
4349
4350 * layout.cc (Layout::set_segment_offsets): Set p_align to
4351 abi_pagesize, not common_pagesize.
4352 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4353 to determine whether file header can go in segment.
4354
4355 2012-08-30 Alan Modra <amodra@gmail.com>
4356
4357 * output.h (Output_reloc::Output_reloc <output section>): Add
4358 is_relative param. Adjust calls.
4359 (Output_reloc::add_output_section_relative): New functions.
4360 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4361 is_relative.
4362 (Output_reloc::symbol_value): Handle SECTION_CODE.
4363
4364 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4365
4366 * gold.cc (queue_middle_tasks): Call layout again when unique
4367 segments for sections is desired.
4368 * layout.cc (Layout::Layout): Initialize new members.
4369 (Layout::get_output_section_flags): New function.
4370 (Layout::choose_output_section): Call get_output_section_flags.
4371 (Layout::layout): Make output section for mapping to a unique segment.
4372 (Layout::insert_section_segment_map): New function.
4373 (Layout::attach_allocated_section_to_segment): Make unique segment for
4374 output sections marked so.
4375 (Layout::segment_precedes): Check for unique segments when sorting.
4376 * layout.h (Layout::Unique_segment_info): New struct.
4377 (Layout::Section_segment_map): New typedef.
4378 (Layout::insert_section_segment_map): New function.
4379 (Layout::get_output_section_flags): New function.
4380 (Layout::is_unique_segment_for_sections_specified): New function.
4381 (Layout::set_unique_segment_for_sections_specified): New function.
4382 (Layout::unique_segment_for_sections_specified_): New member.
4383 (Layout::section_segment_map_): New member.
4384 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4385 Rename is_gc_pass_one to is_pass_one.
4386 Rename is_gc_pass_two to is_pass_two.
4387 Rename is_gc_or_icf to is_two_pass.
4388 Check for which pass based on whether symbols data is present.
4389 Make it two pass when unique segments for sections is desired.
4390 * output.cc (Output_section::Output_section): Initialize new
4391 members.
4392 * output.h (Output_section::is_unique_segment): New function.
4393 (Output_section::set_is_unique_segment): New function.
4394 (Output_section::is_unique_segment_): New member.
4395 (Output_section::extra_segment_flags): New function.
4396 (Output_section::set_extra_segment_flags): New function.
4397 (Output_section::extra_segment_flags_): New member.
4398 (Output_section::segment_alignment): New function.
4399 (Output_section::set_segment_alignment): New function.
4400 (Output_section::segment_alignment_): New member.
4401 (Output_segment::Output_segment): Initialize is_unique_segment_.
4402 (Output_segment::is_unique_segment): New function.
4403 (Output_segment::set_is_unique_segment): New function.
4404 (Output_segment::is_unique_segment_): New member.
4405 * plugin.cc (allow_unique_segment_for_sections): New function.
4406 (unique_segment_for_sections): New function.
4407 (Plugin::load): Add new functions to transfer vector.
4408 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4409 * Makefile.in: Regenerate.
4410 * testsuite/plugin_final_layout.sh: Check if unique segment
4411 functionality works.
4412 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4413 are available.
4414 (allow_unique_segment_for_sections): New global.
4415 (unique_segment_for_sections): New global.
4416 (claim_file_hook): Call allow_unique_segment_for_sections.
4417 (all_symbols_read_hook): Call unique_segment_for_sections.
4418
4419 2012-08-22 Cary Coutant <ccoutant@google.com>
4420
4421 * layout.cc (Layout::include_section): Don't assert on GROUP
4422 sections with --emit-relocs.
4423
4424 2012-08-21 Cary Coutant <ccoutant@google.com>
4425
4426 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4427 if --export-dynamic-symbol names an undef symbol.
4428
4429 2012-08-18 Alan Modra <amodra@gmail.com>
4430
4431 * powerpc.cc: Formatting and white space.
4432 (Powerpc_relobj): Rename got2_section_ to special_.
4433 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4434 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4435 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4436 (Target_powerpc): Add Address typedef and invalid_address. Use
4437 throughout.
4438 (Target_powerpc::is_branch_reloc): New function.
4439 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4440 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4441 for dst_mask, value and addend.
4442 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4443 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4444 (Output_data_glink::do_write): Correct toc base. Don't try to use
4445 uint16_t for 24-bit offset. Use get_output_section_offset and
4446 check return.
4447 (Target_powerpc::Scan::local): Handle more relocs.
4448 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4449 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4450 Plug in toc restoring insn after plt calls. Translate branches
4451 to function descriptor symbols to corresponding entry point.
4452 (Target_powerpc::relocate_for_relocatable): Check return from
4453 get_output_section_offset.
4454 * symtab.h: Comment typo.
4455
4456 2012-08-14 Ian Lance Taylor <iant@google.com>
4457
4458 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4459 unsupported_relocal_local to call unsupported_reloc_global.
4460
4461 2012-08-14 Nick Clifton <nickc@redhat.com>
4462
4463 PR ld/14265
4464 * script-sections.cc (Sections_element::output_section_name): Add
4465 keep return parameter.
4466 (Output_section_element::match_name): Add keep return parameter.
4467 Return the value of the keep_ member.
4468 * script-sections.h (class Output_section): Update
4469 output_section_name prototype.
4470 * layout.cc (Layout::keep_input_section): New public member
4471 function.
4472 (Layout::choose_output_section): Pass keep parameter to
4473 output_section_name.
4474 * layout.h (class Layout): Add keep_input_section.
4475 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4476 sections.
4477 * testsuite/Makefile.am: Add a test.
4478 * testsuite/Makefile.in: Regenerate.
4479 * testsuite/pr14265.c: Source file for the test.
4480 * testsuite/pr14265.t: Linker script for the test.
4481 * testsuite/pr14265.sh: Shell script for the test.
4482
4483 2012-08-14 Alan Modra <amodra@gmail.com>
4484
4485 * target.h (Target::output_section_name): New function.
4486 (Target::do_output_section_name): New function.
4487 * layout.cc (Layout::choose_output_section): Call the above.
4488 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4489
4490 2012-08-14 Alan Modra <amodra@gmail.com>
4491
4492 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4493 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4494 for replace_constant call.
4495 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4496 (Output_data_glink::do_print_to_mapfile): New function.
4497 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4498 (Target_powerpc::Relocate::relocate): Likewise.
4499
4500 2012-08-14 Alan Modra <amodra@gmail.com>
4501
4502 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4503 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4504 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4505 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4506 all references to shndx_. Handle special case for R_PPC_PLTREL24
4507 here.
4508 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4509 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4510 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4511 here.
4512 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4513 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4514
4515 2012-08-12 Alan Modra <amodra@gmail.com>
4516
4517 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4518 (glink insn constants): Use uint32_t.
4519 (Output_data_glink::add_entry): Use insert, not [] operator.
4520
4521 2012-08-11 Alan Modra <amodra@gmail.com>
4522
4523 * object.h (Sized_relobj_file::find_shdr): New function.
4524 (Sized_relobj_file::find_special_sections): New function.
4525 * object.cc (Sized_relobj_file::find_shdr): New function.
4526 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4527 (Sized_relobj_file::find_special_sections): New function, split out..
4528 (Sized_relobj_file::do_read_symbols): ..from here.
4529 * output.h (Output_data_got::replace_constant): New function.
4530 (Output_data_got::num_entries): New function.
4531 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4532 (Output_data_got::got_offset): Protected rather than private.
4533 (Output_data_got::replace_got_entry): New function.
4534 * output.cc (Output_data_got::replace_got_entry): New function.
4535 * powerpc.cc (class Powerpc_relobj): New.
4536 (class Powerpc_relocate_functions): Delete all psymval variants or
4537 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4538 Implement _ha functions using corresponding _hi function.
4539 (Powerpc_relobj::find_special_sections): New function.
4540 (Target_powerpc::do_make_elf_object): New function.
4541 (class Output_data_got_powerpc): New.
4542 (class Output_data_glink): New.
4543 (class Powerpc_scan_relocatable_reloc): New.
4544 Many more changes througout file.
4545
4546 2012-08-09 Nick Clifton <nickc@redhat.com>
4547
4548 * po/vi.po: Updated Vietnamese translation.
4549
4550 2012-08-07 Ian Lance Taylor <iant@google.com>
4551
4552 * layout.cc (Layout::add_target_dynamic_tags): If
4553 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4554 plt_rel.
4555
4556 2012-07-30 Nick Clifton <nickc@redhat.com>
4557
4558 * po/gold.pot: Updated template.
4559 * po/es.po: Updated Spanish translation.
4560
4561 2012-07-18 Cary Coutant <ccoutant@google.com>
4562
4563 PR gold/14344
4564 * configure.ac: Add check for -gpubnames support.
4565 * configure: Regenerate.
4566 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4567 support; force -gno-pubnames.
4568 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4569 support.
4570 (gdb_index_test_4): New test.
4571 * testsuite/Makefile.in: Regenerate.
4572 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4573 * testsuite/gdb_index_test_2.sh: Likewise.
4574 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4575 * testsuite/gdb_index_test_4.sh: New script.
4576 * testsuite/gdb_index_test_comm.sh: New script with common code;
4577 don't look for space after colon.
4578
4579 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4580
4581 * gold.cc (queue_middle_tasks): Update function order only after
4582 deferred objects due to plugins are processed.
4583
4584 2012-07-11 Ian Lance Taylor <iant@google.com>
4585
4586 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4587 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4588 (Target_arm::scan_reloc_for_stub): Likewise.
4589 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4590 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4591 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4592 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4593 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4594
4595 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4596 Ian Lance Taylor <iant@google.com>
4597
4598 PR gold/14309
4599 * configure.ac: Test whether std::tr1::hash<off_t> works.
4600 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4601 needed.
4602 * output.h (class Output_fill): Add virtual destructor.
4603 * configure, config.in: Rebuild.
4604
4605 2012-06-22 Roland McGrath <mcgrathr@google.com>
4606
4607 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4608
4609 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4610
4611 * plugin.cc (Plugin::load): Handle position independent executables.
4612
4613 2012-06-06 Cary Coutant <ccoutant@google.com>
4614
4615 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4616 add .debug_macro.
4617 (lines_only_debug_sections): Likewise.
4618 (gdb_fast_lookup_sections): New static array.
4619 (is_gdb_debug_section): Rename formal parameter.
4620 (is_lines_only_debug_section): Likewise.
4621 (is_gdb_fast_lookup_section): New function.
4622 (Layout::include_section): Check for ".zdebug_" prefix; pass
4623 section name suffix to is_gdb_debug_section, et al.; check for
4624 fast-lookup sections when building .gdb_index.
4625 * options.h (--strip-debug-gdb): Update GDB version number.
4626
4627 2012-06-06 Cary Coutant <ccoutant@google.com>
4628
4629 * configure.ac: Add check for fallocate.
4630 * configure: Regenerate.
4631 * config.in: Regenerate.
4632
4633 * options.h (class General_options): Add --mmap-output-file and
4634 --posix-fallocate options.
4635 * output.cc: (posix_fallocate): Remove; replace with...
4636 (gold_fallocate): New function.
4637 (Output_file::map_no_anonymous): Call gold_fallocate.
4638 (Output_file::map): Check --mmap-output-file option.
4639
4640 2012-06-05 Jing Yu <jingyu@google.com>
4641
4642 * gold.h (textdomain): Add do {} to empty while(0).
4643 (bindtextdomain): Likewise.
4644
4645 2012-06-04 Cary Coutant <ccoutant@google.com>
4646
4647 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4648 has_dynsym_index.
4649
4650 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4651
4652 * symtab.cc (Symbol_table::define_special_symbol):
4653 Initialize *poldsym to prevent uninitialized variable errors.
4654
4655 2012-05-23 Cary Coutant <ccoutant@google.com>
4656
4657 * layout.cc (Layout::section_name_mapping): Add rules to handle
4658 exact match on .data.rel.ro.local or .data.rel.ro.
4659 (Layout::output_section_name): Check for exact matches.
4660
4661 2012-05-23 Cary Coutant <ccoutant@google.com>
4662
4663 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4664 more carefully.
4665
4666 2012-05-22 Cary Coutant <ccoutant@google.com>
4667
4668 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4669 object before exporting symbol.
4670
4671 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4672
4673 * testsuite/tls_test.cc: Include "config.h" first.
4674 * testsuite/tls_test_c.c: Likewise.
4675
4676 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4677 Nick Clifton <nickc@redhat.com>
4678
4679 PR 14072
4680 * configure.in: Add check that sysdep.h has been included before
4681 any system header files.
4682 * configure: Regenerate.
4683 * config.in: Regenerate.
4684
4685 2012-05-14 Cary Coutant <ccoutant@google.com>
4686
4687 * layout.cc (Layout::make_output_section): Mark .tdata section
4688 as RELRO.
4689 * testsuite/relro_test.cc: Add a TLS variable.
4690
4691 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4692
4693 PR gold/14091
4694 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4695 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4696 R_X86_64_64.
4697
4698 2012-05-08 Cary Coutant <ccoutant@google.com>
4699
4700 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4701 (lines_only_debug_sections): Likewise.
4702
4703 2012-05-02 Roland McGrath <mcgrathr@google.com>
4704
4705 * nacl.cc: New file.
4706 * nacl.h: New file.
4707 * Makefile.am (CCFILES, HFILES): Add them.
4708 * Makefile.in: Regenerate.
4709 * i386.cc (Output_data_plt_i386_nacl): New class.
4710 (Output_data_plt_i386_nacl_exec): New class.
4711 (Output_data_plt_i386_nacl_dyn): New class.
4712 (Target_i386_nacl): New class.
4713 (Target_selector_i386_nacl): New class.
4714 (target_selector_i386): Use it instead of Target_selector_i386.
4715 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4716 (Target_x86_64_nacl): New class.
4717 (Target_selector_x86_64_nacl): New class.
4718 (target_selector_x86_64, target_selector_x32): Use it instead of
4719 Target_selector_x86_64.
4720 * arm.cc (Output_data_plt_arm_nacl): New class.
4721 (Target_arm_nacl): New class.
4722 (Target_selector_arm_nacl): New class.
4723 (target_selector_arm, target_selector_armbe): Use it instead of
4724 Target_selector_arm.
4725
4726 * target-select.cc (select_target): Take new Input_file* and off_t
4727 arguments, pass them on to recognize method of selector.
4728 * object.cc (make_elf_sized_object): Update caller.
4729 * parameters.cc (parameters_force_valid_target): Likewise.
4730 * incremental.cc (make_sized_incremental_binary): Likewise.
4731 * target-select.h: Update decl.
4732 (Target_selector::recognize): Take new Input_file* argument,
4733 pass it on to do_recognize.
4734 (Target_selector::do_recognize): Take new Input_file* argument.
4735 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4736 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4737 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4738 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4739
4740 * target.h (Target::Target_info): New members isolate_execinstr
4741 and rosegment_gap.
4742 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4743 * arm.cc (Target_arm::arm_info): Update initializer.
4744 * i386.cc (Target_i386::i386_info): Likewise.
4745 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4746 * sparc.cc (Target_sparc::sparc_info): Likewise.
4747 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4748 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4749 * layout.cc (Layout::attach_allocated_section_to_segment):
4750 Take new const Target* argument. If target->isolate_execinstr(), act
4751 like --rosegment.
4752 (Layout::find_first_load_seg): Take new const Target* argument;
4753 if target->isolate_execinstr(), reject PF_X segments.
4754 (Layout::relaxation_loop_body): Update caller.
4755 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4756 reset file offset to zero when we hit LOAD_SEG, and then do a second
4757 loop over the segments before LOAD_SEG to reassign offsets after
4758 addresses have been determined. Handle target->rosegment_gap().
4759 (Layout::attach_section_to_segment): Take new const Target* argument;
4760 pass it to attach_allocated_section_to_segment.
4761 (Layout::make_output_section): Update caller.
4762 (Layout::attach_sections_to_segments): Take new const Target* argument;
4763 pass it to attach_section_to_segment.
4764 * gold.cc (queue_middle_tasks): Update caller.
4765 * layout.h (Layout): Update method decls with new arguments.
4766
4767 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4768 Target_info pointer to use.
4769 (Target_arm::do_make_data_plt): New virtual method.
4770 (Target_arm::make_data_plt): New method that calls it.
4771 (Target_arm::make_plt_entry): Use it.
4772 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4773 for the section alignment.
4774 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4775 method.
4776 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4777 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4778 method.
4779 (Output_data_plt_arm::get_plt_entry_size): Call it.
4780 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4781 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4782 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4783 method.
4784 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4785 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4786 method instead of sizeof(plt_entry).
4787 (Output_data_plt_arm::add_entry): Likewise.
4788 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4789 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4790 than static method.
4791 (Target_arm::plt_entry_size): Likewise.
4792 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4793 Move to ...
4794 (Output_data_plt_arm_standard): ... here, new class.
4795 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4796 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4797 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4798
4799 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4800 Take additional argument for the PLT entry size.
4801 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4802 Use get_plt_entry_size method rather than plt_entry_size variable.
4803 (Output_data_plt_x86_64::reserve_slot): Likewise.
4804 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4805 (Output_data_plt_x86_64::add_entry): Likewise.
4806 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4807 (Output_data_plt_x86_64::address_for_global): Likewise.
4808 (Output_data_plt_x86_64::address_for_local): Likewise.
4809 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4810 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4811 Make method non-static.
4812 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4813 method.
4814 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4815 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4816 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4817 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4818 virtual method.
4819 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4820 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4821 virtual method.
4822 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4823 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4824 virtual method.
4825 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4826 (Output_data_plt_x86_64::plt_entry_size)
4827 (Output_data_plt_x86_64::first_plt_entry)
4828 (Output_data_plt_x86_64::plt_entry)
4829 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4830 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4831 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4832 (Output_data_plt_x86_64_standard): ... here, new class.
4833 (Target_x86_64::Target_x86_64): Take optional argument for the
4834 Target_info pointer to use.
4835 (Target_x86_64::do_make_data_plt): New virtual method.
4836 (Target_x86_64::make_data_plt): New method to call it.
4837 (Target_x86_64::init_got_plt_for_update): Use that.
4838 Call this->plt_->add_eh_frame method here.
4839 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4840 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4841 rather than static method.
4842 (Target_x86_64::plt_entry_size): Likewise.
4843 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4844 rather than plt_entry_size variable. Move guts of PLT filling to...
4845 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4846 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4847 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4848
4849 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4850 additional argument for the section alignment.
4851 Don't do add_eh_frame_for_plt here.
4852 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4853 non-static. Use get_plt_entry_size method rather than plt_entry_size
4854 variable.
4855 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4856 method.
4857 (Output_data_plt_i386::get_plt_entry_size): Call it.
4858 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4859 (Output_data_plt_i386::add_eh_frame): New method to call it.
4860 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4861 method.
4862 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4863 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4864 method.
4865 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4866 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4867 method instead of plt_entry_size.
4868 (Output_data_plt_i386::plt_entry_size)
4869 (Output_data_plt_i386::plt_eh_frame_fde_size)
4870 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4871 (Output_data_plt_i386_standard): ... here, new class.
4872 (Output_data_plt_i386_exec): New class.
4873 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4874 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4875 (Output_data_plt_i386::exec_plt_entry): Move to ...
4876 (Output_data_plt_i386_exec::plt_entry): ... here.
4877 (Output_data_plt_i386_dyn): New class.
4878 (Output_data_plt_i386::first_plt_entry): Move to ...
4879 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4880 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4881 (Output_data_plt_i386_dyn::plt_entry): ... here.
4882 (Target_i386::Target_i386): Take optional argument for the Target_info
4883 pointer to use.
4884 (Target_i386::do_make_data_plt): New virtual method.
4885 (Target_i386::make_data_plt): New method to call it.
4886 (Target_i386::make_plt_section): Use that.
4887 Call this->plt_->add_eh_frame method here.
4888 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4889 rather than plt_entry_size variable.
4890 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4891 (Output_data_plt_i386::address_for_local): Likewise.
4892 (Output_data_plt_i386::do_write): Likewise.
4893 Move guts of PLT filling to...
4894 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4895 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4896 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4897 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4898
4899 2012-05-01 Cary Coutant <ccoutant@google.com>
4900
4901 * dwarf_reader.cc (Dwarf_die::read_attributes)
4902 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4903 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4904 * reduced_debug_output.cc
4905 (Output_reduced_debug_info_section::get_die_end): Remove
4906 DW_FORM_GNU_ref_index. Add default case.
4907
4908 2012-04-26 Mark Wielaard <mjw@redhat.com>
4909
4910 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4911 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4912 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4913 DW_AT_high_pc as offset from DW_AT_low_pc.
4914
4915 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4916 * testsuite/Makefile.in: Regenerate.
4917 * testsuite/gdb_index_test_3.c: New test source file.
4918 * testsuite/gdb_index_test_3.sh: New test source file.
4919
4920 2012-04-25 Ian Lance Taylor <iant@google.com>
4921
4922 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4923 pointer.
4924 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4925 as a class, not a struct.
4926 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4927 (Target_arm::apply_cortex_a8_workaround): Likewise.
4928 * gc.h: Declare Reloc_types as a struct, not a class.
4929 * object.h: Declare Symbols_data as a struct.
4930 * reloc.h: Declare Read_relocs_data as a struct.
4931 * target.h: Declare Relocate_info as a struct.
4932
4933 2012-04-24 David S. Miller <davem@davemloft.net>
4934
4935 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4936 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4937 and R_SPARC_WPLT30.
4938
4939 2012-04-24 Cary Coutant <ccoutant@google.com>
4940
4941 * incremental-dump.cc (find_input_containing_global): Replace
4942 magic number with symbolic constant.
4943 (dump_incremental_inputs): Update version number.
4944 * incremental.cc (Output_section_incremental_inputs): Update version
4945 number; import symbolic constants from Incremental_inputs_reader.
4946 (Incremental_inputs::create_data_sections): Align relocations
4947 section correctly for 64-bit targets.
4948 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4949 constants; add padding.
4950 (Output_section_incremental_inputs::write_header): Add assert for
4951 header_size.
4952 (Output_section_incremental_inputs::write_input_files): Add assert
4953 for input_entry_size.
4954 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4955 add assert for object_info_size, input_section_entry_size,
4956 global_sym_entry_size.
4957 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4958 for data structure sizes; use them.
4959 (Incremental_input_entry_reader): Import symbolic constants from
4960 Incremental_inputs_reader; use them.
4961
4962 2012-04-23 David S. Miller <davem@davemloft.net>
4963
4964 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4965 and elf_flags_set_.
4966 (Target_sparc::Target_sparc): Initialize new fields.
4967 (Target_sparc::do_make_elf_object): New function.
4968 (Target_sparc::do_adjust_elf_header): New function.
4969
4970 2012-04-23 Cary Coutant <ccoutant@google.com>
4971
4972 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4973 CU range table of gdb index.
4974
4975 2012-04-20 David S. Miller <davem@davemloft.net>
4976
4977 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4978 instead of false.
4979
4980 2012-04-16 David S. Miller <davem@davemloft.net>
4981
4982 * sparc.cc (Target_sparc::got_address): New function.
4983 (Sparc_relocate_functions::gdop_hix22): New function.
4984 (Sparc_relocate_functions::gdop_lox10): New function.
4985 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4986 relocs.
4987 (Target_sparc::Scan::local): Likewise if the global symbol is not
4988 preemptible and is not IFUNC.
4989 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4990 transformations for local and non-preemptible non-IFUNC global
4991 symbols.
4992
4993 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4994 writing out 64-bit part of ranges.
4995
4996 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4997 -fpic and -fpie respectively.
4998 * Makefile.in: Regenerate.
4999
5000 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5001 (Target_sparc::Target_sparc): Initialize new field.
5002 (Target_sparc::do_plt_section_for_global): New function.
5003 (Target_sparc::do_plt_section_for_local): New function.
5004 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5005 (Target_sparc::make_plt_section): New function, broken out of
5006 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5007 (Target_sparc::make_plt_entry): Call make_plt_section.
5008 (Target_sparc::make_local_ifunc_plt_entry): New function.
5009 (Target_sparc::rela_ifunc_section): New function.
5010 (Target_sparc::plt_section): Remove const.
5011 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5012 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5013 and ifunc_count_ fields.
5014 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5015 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5016 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5017 (Output_data_plt_sparc::rela_ifunc): New function.
5018 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5019 (Output_data_plt_sparc::has_ifunc_section): New function.
5020 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5021 (Output_data_plt_sparc::address_for_global): New function.
5022 (Output_data_plt_sparc::address_for_local): New function.
5023 (Output_data_plt_sparc::plt_index_to_offset): New function.
5024 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5025 and entry_count.
5026 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5027 entry_count.
5028 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5029 R_SPARC_JMP_IREL to switch.
5030 (Target_sparc::Scan::check_non_pic): Likewise.
5031 (Target_sparc::Scan::local): Handle IFUNC symbols.
5032 (Target_sparc::Scan::local): Likewise.
5033 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5034 and plt_address_for_local.
5035 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5036 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5037
5038 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5039 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5040 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5041 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5042 global relocs too.
5043 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5044 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5045 calls.
5046 * sparc.cc (Target_sparc::Scan::global): Likewise.
5047 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5048
5049 2012-04-16 Cary Coutant <ccoutant@google.com>
5050
5051 * archive.cc (Library_base::should_include_member): Check for
5052 --export-dynamic-symbol.
5053 * options.h (class General_options): Add --export-dynamic-symbol.
5054 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5055 --export-dynamic-symbol.
5056 (Symbol_table::gc_mark_undef_symbols): Likewise.
5057 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5058
5059 2012-04-12 David S. Miller <davem@davemloft.net>
5060
5061 * sparc.cc (Reloc::wdisp10): New relocation method.
5062 (Reloc::h34): Likewise.
5063 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5064 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5065 R_SPARC_WDISP10.
5066 (Target_sparc::Scan::local): Likewise.
5067 (Target_sparc::Scan::global): Likewise.
5068 (Target_sparc::Relocate::relocate): Likewise.
5069
5070 2012-04-09 Cary Coutant <ccoutant@google.com>
5071
5072 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5073 low_pc == 0.
5074
5075 2012-04-06 Ian Lance Taylor <iant@google.com>
5076
5077 * timer.cc: #include <unistd.h>.
5078
5079 2012-04-06 Roland McGrath <mcgrathr@google.com>
5080
5081 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5082 * config.in: Regenerate.
5083 * configure: Regenerate.
5084
5085 2012-04-05 Nick Clifton <nickc@redhat.com>
5086
5087 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5088 (AM_LC_MESSAGES): Add.
5089 * aclocal.m4: Regenerate.
5090 * config.in: Regenerate.
5091 * configure: Regenerate.
5092
5093 2012-03-21 Cary Coutant <ccoutant@google.com>
5094
5095 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5096 * Makefile.in: Regenerate.
5097 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5098 (Sized_elf_reloc_mapper::symbol_section): New function.
5099 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5100 (make_elf_reloc_mapper): New function.
5101 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5102 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5103 (Dwarf_abbrev_table::do_get_abbrev): New function.
5104 (Dwarf_ranges_table::read_ranges_table): New function.
5105 (Dwarf_ranges_table::read_range_list): New function.
5106 (Dwarf_pubnames_table::read_section): New function.
5107 (Dwarf_pubnames_table::read_header): New function.
5108 (Dwarf_pubnames_table::next_name): New function.
5109 (Dwarf_die::Dwarf_die): New function.
5110 (Dwarf_die::read_attributes): New function.
5111 (Dwarf_die::skip_attributes): New function.
5112 (Dwarf_die::set_name): New function.
5113 (Dwarf_die::set_linkage_name): New function.
5114 (Dwarf_die::attribute): New function.
5115 (Dwarf_die::string_attribute): New function.
5116 (Dwarf_die::int_attribute): New function.
5117 (Dwarf_die::uint_attribute): New function.
5118 (Dwarf_die::ref_attribute): New function.
5119 (Dwarf_die::child_offset): New function.
5120 (Dwarf_die::sibling_offset): New function.
5121 (Dwarf_info_reader::check_buffer): New function.
5122 (Dwarf_info_reader::parse): New function.
5123 (Dwarf_info_reader::do_parse): New function.
5124 (Dwarf_info_reader::do_read_string_table): New function.
5125 (Dwarf_info_reader::lookup_reloc): New function.
5126 (Dwarf_info_reader::get_string): New function.
5127 (Dwarf_info_reader::visit_compilation_unit): New function.
5128 (Dwarf_info_reader::visit_type_unit): New function.
5129 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5130 Sized_elf_reloc_mapper.
5131 (Sized_dwarf_line_info::symbol_section): Remove function.
5132 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5133 (Sized_dwarf_line_info::read_line_mappings): Remove object
5134 parameter, adjust callers.
5135 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5136 * dwarf_reader.h: Include <sys/types.h>.
5137 (class Track_relocs): Remove forward declaration.
5138 (class Elf_reloc_mapper): New class.
5139 (class Sized_elf_reloc_mapper): New class.
5140 (class Dwarf_abbrev_table): New class.
5141 (class Dwarf_range_list): New class.
5142 (class Dwarf_ranges_table): New class.
5143 (class Dwarf_pubnames_table): New class.
5144 (class Dwarf_die): New class.
5145 (class Dwarf_info_reader): New class.
5146 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5147 (Sized_dwarf_line_info::symbol_section): Remove member function.
5148 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5149 base class.
5150 * gdb-index.cc: New source file.
5151 * gdb-index.h: New source file.
5152 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5153 and .debug_types sections, call Layout::add_to_gdb_index.
5154 (Sized_relobj_incr::do_section_name): Implement.
5155 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5156 return type; Implement.
5157 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5158 return type.
5159 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5160 parameter list and return type.
5161 (Sized_incr_dynobj::do_section_contents): Likewise.
5162 * layout.cc: Include gdb-index.h.
5163 (Layout::Layout): Initialize gdb_index_data_.
5164 (Layout::init_fixed_output_section): Check for .gdb_index section.
5165 (Layout::add_to_gdb_index): New function. Instantiate.
5166 * layout.h: Add forward declaration for class Gdb_index.
5167 (Layout::add_to_gdb_index): New member function.
5168 (Layout::gdb_index_data_): New data member.
5169 * main.cc: Include gdb-index.h.
5170 (main): Print statistics for gdb index.
5171 * object.cc (Object::section_contents): Move code into
5172 do_section_contents.
5173 (need_decompressed_section): Check for sections needed when building
5174 gdb index.
5175 (build_compressed_section_map): Likewise.
5176 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5177 gdb index.
5178 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5179 sections; call Layout::add_to_gdb_index.
5180 (Sized_relobj_file::do_decompressed_section_contents): Call
5181 do_section_contents directly.
5182 * object.h (Object::do_section_contents): Adjust parameter list and
5183 return type.
5184 (Object::do_decompressed_section_contents): Call do_section_contents
5185 directly.
5186 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5187 return type.
5188 * options.h (class General_options): Add --gdb-index option.
5189 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5190 list and return type.
5191 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5192 * reloc.h (Track_relocs::checkpoint): New function.
5193 (Track_relocs::reset): New function.
5194
5195 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5196 New test cases.
5197 * testsuite/Makefile.in: Regenerate.
5198 * testsuite/gdb_index_test.cc: New test source file.
5199 * testsuite/gdb_index_test_1.sh: New test source file.
5200 * testsuite/gdb_index_test_2.sh: New test source file.
5201
5202 2012-03-19 Doug Kwan <dougkwan@google.com>
5203
5204 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5205 (Target_arm::do_finalize_sections): Remove code which defines
5206 __exidx_start and __exidx_end. Make symbol table parameter
5207 anonymous as it is not used.
5208 * gold.cc (queue_middle_tasks): Call target hook to define any
5209 target-specific symbols.
5210 * target.h (Target::define_standard_symbols): New method.
5211 (Target::do_define_standard_symbols): Same.
5212 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5213 * testsuite/Makefile.in: Regenerate.
5214 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5215 and __exidx_end.
5216 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5217 relocations are generated for __exidx_start and __exidx_end.
5218
5219 2012-03-16 Doug Kwan <dougkwan@google.com>
5220
5221 * testsuite/Makefile.am: Disable test initpri3b.
5222 * testsuite/Makefile.in: Regenerate.
5223
5224 2012-03-15 Doug Kwan <dougkwan@google.com>
5225
5226 * arm.cc (Target_arm::got_section): Make .got section read-only
5227 if -z now is given.
5228
5229 2012-03-15 Ian Lance Taylor <iant@google.com>
5230
5231 PR gold/13850
5232 * layout.cc (Layout::make_output_section): Correctly mark
5233 SHT_INIT_ARRAY, et. al., as relro.
5234
5235 2012-03-14 Doug Kwan <dougkwan@google.com>
5236
5237 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5238 dynamic relocations for protected symbols in shared objects.
5239
5240 2012-03-13 Ian Lance Taylor <iant@google.com>
5241
5242 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5243 keep the larger alignment.
5244
5245 2012-03-12 Cary Coutant <ccoutant@google.com>
5246
5247 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5248 handling of DW_LNE_define_file.
5249
5250 2012-03-12 Cary Coutant <ccoutant@google.com>
5251
5252 * reduced_debug_output.cc
5253 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5254 codes to switch.
5255
5256 2012-02-29 Cary Coutant <ccoutant@google.com>
5257
5258 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5259
5260 2012-02-29 Cary Coutant <ccoutant@google.com>
5261
5262 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5263 Call Object::decompressed_section_contents.
5264 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5265 New dtor.
5266 (Sized_dwarf_line_info::buffer_start_): New data member.
5267 * merge.cc (Output_merge_data::do_add_input_section): Call
5268 Object::decompressed_section_contents.
5269 (Output_merge_string::do_add_input_section): Likewise.
5270 * object.cc (need_decompressed_section): New function.
5271 (build_compressed_section_map): Decompress sections needed later.
5272 (Sized_relobj_file::do_decompressed_section_contents): New function.
5273 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5274 * object.h (Object::decompressed_section_contents): New function.
5275 (Object::discard_decompressed_sections): New function.
5276 (Object::do_decompressed_section_contents): New function.
5277 (Object::do_discard_decompressed_sections): New function.
5278 (Compressed_section_info): New type.
5279 (Compressed_section_map): Include decompressed section contents.
5280 (Sized_relobj_file::do_decompressed_section_contents): New function.
5281 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5282
5283 2012-02-16 Cary Coutant <ccoutant@google.com>
5284
5285 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5286 * testsuite/Makefile.in: Regenerate.
5287
5288 2012-02-14 Cary Coutant <ccoutant@google.com>
5289
5290 * options.cc (General_options::finalize): Disallow -pie and -static.
5291
5292 2012-02-03 Doug Kwan <dougkwan@google.com>
5293
5294 * arm.cc (Arm_relocate_functions::abs8,
5295 Arm_relocate_functions::abs16): Use
5296 Bits::has_signed_unsigned_overflow32.
5297 (Arm_relocate_functions::thm_abs8): Correct range of
5298 overflow check.
5299 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5300 in assertions.
5301
5302 2012-02-02 Doug Kwan <dougkwan@google.com>
5303
5304 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5305 position independent outputs, not just shared objects.
5306
5307 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5308
5309 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5310 * configure: Regenerated.
5311
5312 2012-01-27 Ian Lance Taylor <iant@google.com>
5313
5314 * reloc.h (Bits): New class with static functions, copied from
5315 namespace utils in arm.cc.
5316 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5317 instead.
5318
5319 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5320
5321 * incremental.cc (write_info_blocks): Correct relocation offset.
5322
5323 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5324
5325 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5326 (Relocate::tls_gd_to_le): Likewise.
5327
5328 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5329
5330 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5331
5332 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5333
5334 * configure.ac: Check if -mcmodel=medium works.
5335 * configure: Regenerated.
5336
5337 2012-01-24 Cary Coutant <ccoutant@google.com>
5338
5339 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5340 definition and ...
5341 (read_unsigned_LEB_128_x): ... this new function.
5342 (read_signed_LEB_128): Replaced with inline definition and ...
5343 (read_signed_LEB_128_x): ... this new function.
5344 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5345 (read_unsigned_LEB_128): Add inline definition.
5346 (read_signed_LEB_128_x): New function.
5347 (read_signed_LEB_128): Add inline definition.
5348 * testsuite/Makefile.am (leb128_unittest): New unit test.
5349 * testsuite/Makefile.in: Regenerate.
5350 * testsuite/leb128_unittest.cc: New unit test.
5351
5352 2012-01-23 Ian Lance Taylor <iant@google.com>
5353
5354 PR gold/13617
5355 * i386.cc (Target_i386::do_code_fill): When using a jmp
5356 instruction, pad with nop instructions.
5357 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5358
5359 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5360
5361 * x86_64.cc (gc_process_relocs): Add typename on types used in
5362 template.
5363 (scan_relocs): Likewise.
5364 (relocate_section): Likewise.
5365 (apply_relocation): Likewise.
5366
5367 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5368
5369 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5370 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5371 under x32.
5372
5373 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5374
5375 * x86_64.cc: Initial support for x32.
5376
5377 2012-01-03 Cary Coutant <ccoutant@google.com>
5378
5379 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5380 Use abstract base class for GOT.
5381 * gold/output.h (class Output_data_got_base): New abstract base class.
5382 (class Output_data_got): Derive from new base class, adjust ctors.
5383 (Output_data_got::reserve_slot): Make virtual; rename to
5384 do_reserve_slot; Adjust callers.
5385 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5386 pointer to abstract base class.
5387 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5388
5389 2011-12-18 Ian Lance Taylor <iant@google.com>
5390
5391 * object.h (Relobj::local_symbol_value): New function.
5392 (Relobj::local_plt_offset): New function.
5393 (Relobj::local_has_got_offset): New function.
5394 (Relobj::local_got_offset): New function.
5395 (Relobj::set_local_got_offset): New function.
5396 (Relobj::do_local_symbol_value): New pure virtual function.
5397 (Relobj::do_local_plt_offset): Likewise.
5398 (Relobj::do_local_has_got_offset): Likewise.
5399 (Relobj::do_local_got_offset): Likewise.
5400 (Relobj::do_set_local_got_offset): Likewise.
5401 (Sized_relobj::do_local_has_got_offset): Rename from
5402 local_has_got_offset.
5403 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5404 (Sized_relobj::do_set_local_got_offset): Rename from
5405 set_local_got_offset.
5406 (Sized_relobj_file::do_local_plt_offset): Rename from
5407 local_plt_offset.
5408 (Sized_relobj_file::do_local_symbol_value): New function.
5409 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5410 local_plt_offset.
5411 * output.cc (Output_data_got::Got_entry::write): Change object to
5412 Relobj. Use local_symbol_value.
5413 (Output_data_got::add_global_with_rel): Change rel_dyn to
5414 Output_data_reloc_generic*. Use add_global_generic.
5415 (Output_data_got::add_global_with_rela): Remove. Change all
5416 callers to use add_global_with_rel.
5417 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5418 Output_data_reloc_generic*. Use add_global_generic.
5419 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5420 callers to use add_global_pair_with_rel.
5421 (Output_data_got::add_local): Change object to Relobj*.
5422 (Output_data_got::add_local_plt): Likewise.
5423 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5424 change rel_dyn to Output_data_reloc_generic*. Use
5425 add_local_generic.
5426 (Output_data_got::add_local_with_rela): Remove. Change all
5427 callers to use all_local_with_rel.
5428 (Output_data_got::add_local_pair_with_rel): Change object to
5429 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5430 add_output_section_generic.
5431 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5432 callers to use add_local_pair_with_rel.
5433 (Output_data_got::reserve_local): Change object to Relobj*.
5434 * output.h: (class Output_data_reloc_generic): Add pure virtual
5435 declarations for add_global_generic, add_local_generic,
5436 add_output_section_generic.
5437 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5438 functions for Output_data_reloc_generic. Update declarations for
5439 changes listed in output.cc.
5440 (class Output_data_got): Change template parameter to got_size.
5441 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5442 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5443 function.
5444 (Sized_relobj_incr::do_local_plt_offset): New function.
5445 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5446 add_global_generic.
5447
5448 2011-12-17 Cary Coutant <ccoutant@google.com>
5449
5450 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5451 * resolve.cc (Symbol_table::resolve): Likewise.
5452 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5453 arrays.
5454 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5455
5456 2011-12-16 Ian Lance Taylor <iant@google.com>
5457
5458 * output.h (Output_data_reloc_generic::add): Only call
5459 add_dynamic_reloc if this is a dynamic reloc section.
5460
5461 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5462
5463 PR gold/13505
5464 * target-reloc.h (apply_relocation): Replace <64, false> with
5465 <size, big_endian>.
5466
5467 2011-11-25 Nick Clifton <nickc@redhat.com>
5468
5469 * po/it.po: New Italian translation.
5470
5471 2011-11-17 Sterling Augustine <saugustine@google.com>
5472
5473 * script.cc (script_include_directive): Implement.
5474 (read_script_file): New local variables name and search_path. Update
5475 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5476 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5477 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5478
5479 2011-11-11 Sterling Augustine <saugustine@google.com>
5480
5481 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5482 (file_or_sections_cmd): Likewise.
5483
5484 2011-11-11 Doug Kwan <dougkwan@google.com>
5485
5486 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5487 if --just-symbols is given.
5488
5489 2011-11-10 Doug Kwan <dougkwan@google.com>
5490
5491 PR gold/13362
5492 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5493 when processing data relocs.
5494 * reloc.h (Relocate_functions::rel_unaligned): New method.
5495 (Relocate_functions::pcrel_unaligned): Ditto.
5496 (Relocate_functions::rel32_unaligned): Ditto.
5497 (Relocate_functions::pcrel32_unaligned): Ditto.
5498
5499 2011-11-09 Doug Kwan <dougkwan@google.com>
5500
5501 PR gold/13362
5502 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5503 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5504 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5505 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5506 (Relocate_functions::rel_unaligned): New.
5507 (Relocate_functions::rel32_unaligned): New.
5508 * target-reloc.h (relocate_for_relocatable): Add code to handle
5509 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5510 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5511 arm_unaligned_reloc_r): New targets.
5512 * testsuite/Makefile.in: Regenerate.
5513 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5514 linking.
5515
5516 2011-11-02 Ian Lance Taylor <iant@google.com>
5517
5518 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5519 NATIVE_LINKER.
5520 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5521 * options.cc (General_options::finalize): Use library search path
5522 from configure script if specified. If not native and no sysroot,
5523 only search TOOLLIBDIR.
5524 * options.h (Search_directory::Search_directory): Change name to
5525 const std::string&.
5526 (General_options::add_to_library_path_with_sysroot): Change arg to
5527 const std::string&.
5528 * configure, Makefile.in, config.in: Rebuild.
5529
5530 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5531
5532 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5533 we are working around the ARM1176 Erratum.
5534 * options.h (General_options::fix_arm1176): Add option.
5535 * testsuite/Makefile.am: Add testcases, and keep current ones
5536 working.
5537 * testsuite/Makefile.in: Regenerate.
5538 * testsuite/arm_fix_1176.s: New file.
5539 * testsuite/arm_fix_1176.sh: Likewise.
5540
5541 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5542
5543 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5544 may_use_blx_.
5545 (Target_arm::may_use_blx): Remove method.
5546 (Target_arm::set_may_use_blx): Likewise.
5547 (Target_arm::may_use_v4t_interworking): New method.
5548 (Target_arm::may_use_v5t_interworking): Likewise.
5549 (Target_arm::may_use_blx_): Remove member variable.
5550 (Arm_relocate_functions::arm_branch_common): Check for v5T
5551 interworking.
5552 (Arm_relocate_functions::thumb_branch_common): Likewise.
5553 (Reloc_stub::stub_type_for_reloc): Likewise.
5554 (Target_arm::do_finalize_sections): Correct interworking checks.
5555 * testsuite/Makefile.am: Add new tests.
5556 * testsuite/Makefile.in: Regenerate.
5557 * testsuite/arm_farcall_arm_arm.s: New test.
5558 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5559 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5560 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5561 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5562 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5563 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5564 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5565
5566 2011-10-31 Cary Coutant <ccoutant@google.com>
5567
5568 PR gold/13023
5569 * expression.cc (Expression::eval_with_dot): Add
5570 is_section_dot_assignment parameter.
5571 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5572 absolute and assigning to dot within a section.
5573 * script-sections.cc
5574 (Output_section_element_assignment::set_section_addresses): Pass
5575 dot_section to set_if_absolute.
5576 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5577 as is_section_dot_assignment flag to eval_with_dot.
5578 (Output_section_element_dot_assignment::set_section_addresses):
5579 Likewise.
5580 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5581 parameter. Also set value if relative to dot_section; set the
5582 symbol's output_section.
5583 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5584 parameter. Adjust all callers.
5585 (Expression::eval_maybe_dot): Likewise.
5586 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5587 Adjust all callers.
5588 * testsuite/script_test_2.t: Test assignment of an absolute value
5589 to dot within an output section element.
5590
5591 2011-10-31 Cary Coutant <ccoutant@google.com>
5592
5593 * options.h (class General_options): Add --[no-]gnu-unique options.
5594 * symtab.cc (Symbol_table::sized_write_globals): Convert
5595 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5596
5597 2011-10-31 Cary Coutant <ccoutant@google.com>
5598
5599 PR gold/13359
5600 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5601 unnecessary assertion.
5602 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5603
5604 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5605
5606 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5607 gc_mark_symbol.
5608 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5609 gc_mark_symbol.
5610 Change to just keep the section associated with symbol.
5611 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5612 they are externally visible and --export-dynamic is turned on.
5613 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5614
5615 2011-10-19 Ian Lance Taylor <iant@google.com>
5616
5617 PR gold/13163
5618 * script-sections.cc
5619 (Output_section_element_dot_assignment::needs_output_section): New
5620 function.
5621
5622 2011-10-19 Ian Lance Taylor <iant@google.com>
5623
5624 PR gold/13204
5625 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5626 --section-start option was seen.
5627 * options.h (General_options::any_section_start): New function.
5628
5629 2011-10-18 David S. Miller <davem@davemloft.net>
5630
5631 PR binutils/13301
5632 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5633 member to track relocation locations that have moved during TLS
5634 reloc optimizations.
5635 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5636 (Target_sparc::Relocate::relocate): Adjust view down by 4
5637 bytes if it matches reloc_adjust_addr_.
5638 (Target_sparc::Relocate::relocate_tls): Always move the
5639 __tls_get_addr call delay slot instruction forward 4 bytes when
5640 performing relaxation.
5641
5642 2011-10-18 Cary Coutant <ccoutant@google.com>
5643
5644 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5645 (Output_file::map_no_anonymous): Check for non-zero
5646 return code from posix_fallocate.
5647
5648 2011-10-17 Cary Coutant <ccoutant@google.com>
5649
5650 PR gold/13245
5651 * plugin.cc (is_visible_from_outside): Check for symbols
5652 referenced from dynamic objects.
5653 * resolve.cc (Symbol_table::resolve): Don't count references
5654 from dynamic objects as references from real ELF files.
5655 * testsuite/plugin_test_2.sh: Adjust expected result.
5656
5657 2011-10-17 Cary Coutant <ccoutant@google.com>
5658
5659 * gold.cc: Include timer.h.
5660 (queue_middle_tasks): Stamp time.
5661 (queue_final_tasks): Likewise.
5662 * main.cc (main): Store timer in parameters. Print timers
5663 for each pass.
5664 * parameters.cc (Parameters::Parameters): Initialize timer_.
5665 (Parameters::set_timer): New function.
5666 (set_parameters_timer): New function.
5667 * parameters.h (Parameters::set_timer): New function.
5668 (Parameters::timer): New function.
5669 (Parameters::timer_): New data member.
5670 (set_parameters_timer): New function.
5671 * timer.cc (Timer::stamp): New function.
5672 (Timer::get_pass_time): New function.
5673 * timer.h (Timer::stamp): New function.
5674 (Timer::get_pass_time): New function.
5675 (Timer::pass_times_): New data member.
5676
5677 2011-10-17 Cary Coutant <ccoutant@google.com>
5678
5679 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5680 task for members of lib groups.
5681
5682 2011-10-17 Cary Coutant <ccoutant@google.com>
5683
5684 PR gold/13288
5685 * fileread.cc (File_read::find_view): Add assert.
5686 (File_read::make_view): Move bounds check (replace with assert)...
5687 (File_read::find_or_make_view): ... to here.
5688
5689 2011-10-12 Cary Coutant <ccoutant@google.com>
5690
5691 * output.cc (Output_file::open_base_file): Handle case where
5692 ::read returns less than requested size.
5693
5694 2011-10-10 Cary Coutant <ccoutant@google.com>
5695
5696 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5697 Initialize defined_count_.
5698 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5699 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5700 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5701 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5702 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5703 * incremental.h (Sized_relobj_incr::defined_count_): New data
5704 member.
5705 (Sized_incr_dynobj::defined_count_): New data member.
5706 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5707 Return zeroes instead of internal error.
5708
5709 2011-10-10 Cary Coutant <ccoutant@google.com>
5710
5711 PR gold/13249
5712 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5713 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5714 * output.h (class Output_reloc): Add use_plt_offset flag.
5715 (Output_reloc::type_): Adjust size of bit field.
5716 (Output_reloc::use_plt_offset_): New bit field.
5717 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5718 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5719 flag. Adjust all callers.
5720 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5721 creating RELATIVE relocations.
5722
5723 2011-10-10 Nick Clifton <nickc@redhat.com>
5724
5725 * po/es.po: Updated Spanish translation.
5726 * po/fi.po: Updated Finnish translation.
5727
5728 2011-10-03 Diego Novillo <dnovillo@google.com>
5729
5730 * options.cc (parse_uint): Fix dereference of RETVAL.
5731
5732 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5733
5734 * layout.h (section_order_map_): New member.
5735 (get_section_order_map): New member function.
5736 * output.cc (Output_section::add_input_section): Check for patterns
5737 only when --section-ordering-file is specified.
5738 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5739 output_sections have been formed.
5740 * layout.cc (Layout_Layout): Initialize section_order_map_.
5741 * plugin.cc (update_section_order): Store order in order_map. Do not
5742 update the order.
5743 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5744 * testsuite/Makefile.in: Regenerate.
5745 * testsuite/plugin_section_order.c: New file.
5746 * testsuite/plugin_final_layout.cc: New file.
5747 * testsuite/plugin_final_layout.sh: New file.
5748
5749 2011-09-29 Cary Coutant <ccoutant@google.com>
5750
5751 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5752 Check for NULL.
5753 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5754 symbols during incremental update.
5755 (Symbol_table::add_from_dynobj): Likewise.
5756
5757 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5758 Ian Lance Taylor <iant@google.com>
5759
5760 * symtab.cc (Symbol_table::define_special_symbol): Always
5761 canonicalize version string.
5762
5763 2011-09-26 Cary Coutant <ccoutant@google.com>
5764
5765 * gold.cc (queue_initial_tasks): Move option checks ...
5766 * options.cc (General_options::finalize): ... to here. Disable
5767 some options; make others fatal.
5768
5769 2011-09-26 Cary Coutant <ccoutant@google.com>
5770
5771 gcc PR lto/47247
5772 * plugin.cc (get_symbols_v2): New function.
5773 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5774 (is_referenced_from_outside): New function.
5775 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5776 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5777 (get_symbols): Pass version parameter.
5778 (get_symbols_v2): New function.
5779 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5780 parameter.
5781 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5782 (onload): Add LDPT_GET_SYMBOLS_V2.
5783 (all_symbols_read_hook): Use get_symbols_v2; check for
5784 LDPR_PREVAILING_DEF_IRONLY_EXP.
5785 * testsuite/plugin_test_3.sh: Update expected results.
5786
5787 2011-09-23 Simon Baldwin <simonb@google.com>
5788
5789 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5790 configuration options.
5791 * configure: Regenerate.
5792 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5793 * Makefile.in: Regenerate.
5794 * testsuite/Makefile.in: Regenerate.
5795
5796 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5797
5798 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5799
5800 2011-09-19 Cary Coutant <ccoutant@google.com>
5801
5802 * incremental.cc (can_incremental_update): Fix typo in comment.
5803 * incremental.h (can_incremental_update): Likewise.
5804
5805 2011-09-18 Cary Coutant <ccoutant@google.com>
5806
5807 * incremental.cc (can_incremental_update): New function.
5808 * incremental.h (can_incremental_update): New function.
5809 * layout.cc (Layout::init_fixed_output_section): Call it.
5810 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5811 * object.cc (Sized_relobj_file::do_layout): Call
5812 can_incremental_update.
5813
5814 2011-09-13 Cary Coutant <ccoutant@google.com>
5815
5816 * configure.ac: Check for glibc support for gnu_indirect_function
5817 support with static linking, setting automake conditional
5818 IFUNC_STATIC.
5819 * Makefile.in: Regenerate.
5820 * configure: Regenerate.
5821
5822 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5823 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5824 for IFUNC_STATIC.
5825 * testsuite/Makefile.in: Regenerate.
5826
5827 2011-09-13 Cary Coutant <ccoutant@google.com>
5828
5829 * incremental.cc (Sized_relobj_incr::do_layout): Call
5830 report_comdat_group for kept comdat sections.
5831 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5832 * testsuite/Makefile.in: Regenerate.
5833 * testsuite/incr_comdat_test_1.cc: New source file.
5834 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5835 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5836 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5837
5838 2011-09-13 Ian Lance Taylor <iant@google.com>
5839
5840 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5841 variable external_symbols_offset.
5842
5843 2011-09-12 Ian Lance Taylor <iant@google.com>
5844
5845 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5846 triggered if object has no symbols.
5847
5848 2011-09-09 David S. Miller <davem@davemloft.net>
5849
5850 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5851 (Output_fill_debug_line::do_write): Likewise.
5852
5853 2011-08-29 Cary Coutant <ccoutant@google.com>
5854
5855 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5856 casts to match formatting specs.
5857 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5858
5859 2011-08-26 Cary Coutant <ccoutant@google.com>
5860
5861 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5862 remaining hole size when allocating.
5863 (Layout::make_output_section): Set fill methods for debug sections.
5864 * layout.h (Free_list::Free_list_node): Move from private to
5865 public.
5866 (Free_list::set_min_hole_size): New function.
5867 (Free_list::begin, Free_list::end): New functions.
5868 (Free_list::min_hole_): New data member.
5869 * output.cc: Include dwarf.h.
5870 (Output_fill_debug_info::do_minimum_hole_size): New function.
5871 (Output_fill_debug_info::do_write): New function.
5872 (Output_fill_debug_line::do_minimum_hole_size): New function.
5873 (Output_fill_debug_line::do_write): New function.
5874 (Output_section::Output_section): Initialize new data member.
5875 (Output_section::set_final_data_size): Ensure patch space is larger
5876 than minimum hole size.
5877 (Output_section::do_write): Fill holes in debug sections.
5878 * output.h (Output_fill): New class.
5879 (Output_fill_debug_info): New class.
5880 (Output_fill_debug_line): New class.
5881 (Output_section::set_free_space_fill): New function.
5882 (Output_section::free_space_fill_): New data member.
5883 * testsuite/Makefile.am (incremental_test_3): Add
5884 --incremental-patch option.
5885 (incremental_test_4): Likewise.
5886 (incremental_test_5): Likewise.
5887 (incremental_test_6): Likewise.
5888 (incremental_copy_test): Likewise.
5889 (incremental_common_test_1): Likewise.
5890 * testsuite/Makefile.in: Regenerate.
5891
5892 2011-08-26 Nick Clifton <nickc@redhat.com>
5893
5894 * po/es.po: Updated Spanish translation.
5895
5896 2011-08-01 Cary Coutant <ccoutant@google.com>
5897
5898 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5899 * gold/testsuite/Makefile.in: Regenerate.
5900 * gold/testsuite/justsyms_exec.c: New source file.
5901 * gold/testsuite/justsyms_lib.c: New source file.
5902
5903 2011-08-01 Cary Coutant <ccoutant@google.com>
5904
5905 * layout.cc (Layout::set_segment_offsets): Don't realign text
5906 segment if -Ttext was specified.
5907 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5908 file type.
5909 * object.h (Sized_relobj_file::e_type): New function.
5910 (Sized_relobj_file::e_type_): New data member.
5911 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5912 base address for ET_EXEC files.
5913 * target.cc (Target::do_make_elf_object_implementation): Allow
5914 ET_EXEC files with --just-symbols option.
5915
5916 2011-07-28 Cary Coutant <ccoutant@google.com>
5917
5918 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5919 Add thread_number parameter.
5920 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5921 * workqueue-threads.cc
5922 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5923 current thread if its thread number is greater than desired thread
5924 count.
5925 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5926 Add thread_number parameter.
5927 (Workqueue::should_cancel_thread): Likewise.
5928 (Workqueue::find_runnable_or_wait): Pass thread_number to
5929 should_cancel_thread.
5930 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5931 parameter.
5932
5933 2011-07-22 Sriraman Tallam <tmsriram@google.com>
5934
5935 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5936 only after checking if it cannot be forced local.
5937 * symtab.h (is_externally_visible): Check if the symbol is not forced
5938 local.
5939
5940 2011-07-15 Ian Lance Taylor <iant@google.com>
5941
5942 * options.h (class General_options): Add --print-output-format.
5943 Move -EL next to -EB, for better --help output.
5944 * target-select.cc: Include <cstdio>, "options.h", and
5945 "parameters.h".
5946 (Target_selector::do_target_bfd_name): New function.
5947 (print_output_format): New function.
5948 * target-select.h (class Target_selector): Update declarations.
5949 (Target_selector::target_bfd_name): New function.
5950 (print_output_format): Declare.
5951 * main.cc: Include "target-select.h".
5952 (main): Handle --print-output-format.
5953 * gold.cc: Include "target-select.h".
5954 (queue_initial_tasks): Handle --print-output-format when there are
5955 no input files.
5956 * parameters.cc (parameters_force_valid_target): Give a better
5957 error message if -EB/-EL does not match target.
5958 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5959 function.
5960
5961 2011-07-15 Ian Lance Taylor <iant@google.com>
5962
5963 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5964 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5965 (Output_data_plt_i386::do_write): Write address of .dynamic
5966 section to first entry in .got.plt section.
5967 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5968 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5969 Initialize layout_.
5970 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5971 section to first entry in .got.plt section.
5972 * layout.h (Layout::dynamic_section): New function.
5973
5974 2011-07-13 Sriraman Tallam <tmsriram@google.com>
5975
5976 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5977 to claim_file call.
5978 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5979 input_section_position_, and input_section_glob_.
5980 (read_layout_from_file): Call function section_ordering_specified.
5981 * layout.h (is_section_ordering_specified): New function.
5982 (section_ordering_specified): New function.
5983 (section_ordering_specified_): New boolean member.
5984 * main.cc(main): Call load_plugins after layout object is defined.
5985 * output.cc (Output_section::add_input_section): Use
5986 function section_ordering_specified to check if section ordering is
5987 needed.
5988 * output.cc (Output_section::add_relaxed_input_section): Use
5989 function section_ordering_specified to check if section ordering is
5990 needed.
5991 (Output_section::update_section_layout): New function.
5992 (Output_section::sort_attached_input_sections): Check if input section
5993 must be reordered.
5994 * output.h (Output_section::update_section_layout): New function.
5995 * plugin.cc (get_section_count): New function.
5996 (get_section_type): New function.
5997 (get_section_name): New function.
5998 (get_section_contents): New function.
5999 (update_section_order): New function.
6000 (allow_section_ordering): New function.
6001 (Plugin::load): Add the new interfaces to the transfer vector.
6002 (Plugin_manager::load_plugins): New parameter.
6003 (Plugin_manager::all_symbols_read): New parameter.
6004 (Plugin_manager::claim_file): New parameter. Save the elf object for
6005 unclaimed objects.
6006 (Plugin_manager::get_elf_object): New function.
6007 (Plugin_manager::get_view): Change to directly use the bool to check
6008 if get_view is called from claim_file_hook.
6009 * plugin.h (input_objects): New function
6010 (Plugin__manager::load_plugins): New parameter.
6011 (Plugin_manager::claim_file): New parameter.
6012 (Plugin_manager::get_elf_object): New function.
6013 (Plugin_manager::in_claim_file_handler): New function.
6014 (Plugin_manager::in_claim_file_handler_): New member.
6015 (layout): New function.
6016 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6017 handler with an extra parameter. Make the elf object before calling
6018 claim_file handler.
6019 * testsuite/plugin_test.c (get_section_count): New function pointer.
6020 (get_section_type): New function pointer.
6021 (get_section_name): New function pointer.
6022 (get_section_contents): New function pointer.
6023 (update_section_order): New function pointer.
6024 (allow_section_ordering): New function pointer.
6025 (onload): Check if the new interfaces exist.
6026
6027 2011-07-13 Ian Lance Taylor <iant@google.com>
6028
6029 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6030 relro section.
6031 * x86_64.cc (Target_x86_64::got_section): Likewise.
6032 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6033 (relro_now_test_SOURCES): New variable.
6034 (relro_now_test_DEPENDENCIES): New variable.
6035 (relro_now_test_LDFLAGS): New variable.
6036 (relro_now_test_LDADD): New variable.
6037 (relro_now_test.so): New target.
6038 * testsuite/Makefile.in: Rebuild.
6039
6040 2011-07-12 Ian Lance Taylor <iant@google.com>
6041
6042 PR gold/12980
6043 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6044 GLOB_DAT relocation rather than a RELATIVE relocation for a
6045 protected symbol when creating a shared library.
6046 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6047 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6048 * testsuite/protected_main_1.cc (main): Test that protected
6049 function has same address.
6050
6051 2011-07-11 Ian Lance Taylor <iant@google.com>
6052
6053 PR gold/12979
6054 * options.h (class General_options): Add -Bgroup.
6055 * options.cc (General_options::finalize): If -Bgroup is set,
6056 default to --unresolved-symbols=report-all.
6057 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6058 * target-reloc.h (issue_undefined_symbol_error): Handle
6059 --unresolved-symbols=report-all.
6060
6061 2011-07-08 Ian Lance Taylor <iant@google.com>
6062
6063 PR gold/11985
6064 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6065 if linker script discards key sections.
6066 (Layout::create_dynamic_symtab): Likewise.
6067 (Layout::assign_local_dynsym_offsets): Likewise.
6068 (Layout::sized_create_version_sections): Likewise.
6069 (Layout::create_interp): Likewise.
6070 (Layout::finish_dynamic_section): Likewise.
6071 (Layout::set_dynamic_symbol_size): Likewise.
6072
6073 2011-07-08 Ian Lance Taylor <iant@google.com>
6074
6075 PR gold/12386
6076 * options.h (class General_options): Add --unresolved-symbols.
6077 * target-reloc.h (issue_undefined_symbol_error): Check
6078 --unresolved-symbols. Add comments.
6079
6080 2011-07-08 Ian Lance Taylor <iant@google.com>
6081
6082 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6083 expression more complex.
6084
6085 2011-07-08 Ian Lance Taylor <iant@google.com>
6086
6087 PR gold/11317
6088 * target-reloc.h (issue_undefined_symbol_error): New inline
6089 function, broken out of relocate_section.
6090 (relocate_section): Call issue_undefined_symbol_error.
6091 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6092 there is no TLS segment if we are about to issue an undefined
6093 symbol error.
6094 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6095
6096 2011-07-08 Ian Lance Taylor <iant@google.com>
6097
6098 PR gold/12279
6099 * resolve.cc (Symbol_table::should_override): Add fromtype
6100 parameter. Change all callers. Give error when linking together
6101 TLS and non-TLS symbol.
6102 (Symbol_table::should_override_with_special): Add fromtype
6103 parameter. Change all callers.
6104 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6105 there is no TLS segment if we have reported some errors.
6106 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6107
6108 2011-07-08 Ian Lance Taylor <iant@google.com>
6109
6110 PR gold/12372
6111 * target.h (Target::plt_address_for_global): New function.
6112 (Target::plt_address_for_local): New function.
6113 (Target::plt_section_for_global): Remove.
6114 (Target::plt_section_for_local): Remove.
6115 (Target::do_plt_address_for_global): New virtual function.
6116 (Target::do_plt_address_for_local): New virtual function.
6117 (Target::do_plt_section_for_global): Remove.
6118 (Target::do_plt_section_for_local): Remove.
6119 (Target::register_global_plt_entry): Add Symbol_table and Layout
6120 parameters.
6121 * output.cc (Output_data_got::Got_entry::write): Use
6122 plt_address_for_global and plt_address_for_local.
6123 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6124 address of output section.
6125 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6126 got_irelative_, and irelative_count_ fields. Update
6127 declarations.
6128 (Output_data_plt_i386::has_irelative_section): New function.
6129 (Output_data_plt_i386::entry_count): Add irelative_count_.
6130 (Output_data_plt_i386::set_final_data_size): Likewise.
6131 (class Target_i386): Add got_irelative_ and rel_irelative_
6132 fields. Update declarations.
6133 (Target_i386::Target_i386): Initialize new fields.
6134 (Target_i386::do_plt_address_for_global): New function replacing
6135 do_plt_section_for_global.
6136 (Target_i386::do_plt_address_for_local): New function replacing
6137 do_plt_section_for_local.
6138 (Target_i386::got_section): Create got_irelative_.
6139 (Target_i386::rel_irelative_section): New function.
6140 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6141 fields. Don't define __rel_iplt_{start,end}.
6142 (Output_data_plt_i386::add_entry): Add symtab and layout
6143 parameters. Change all callers. Use different PLT and GOT for
6144 IFUNC symbols.
6145 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6146 layout parameters. Change all callers. Use different PLT and
6147 GOT.
6148 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6149 (Output_data_plt_i386::rel_irelative): New function.
6150 (Output_data_plt_i386::address_for_global): New function.
6151 (Output_data_plt_i386::address_for_local): New function.
6152 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6153 IRELATIVE GOT when changing IFUNC GOT entries.
6154 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6155 reloc.
6156 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6157 if we didn't create an IRELATIVE GOT.
6158 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6159 plt_address_for_local.
6160 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6161 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6162 got_irelative_, and irelative_count_ fields. Update
6163 declarations.
6164 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6165 Initialize new fields. Remove symtab parameter. Change all
6166 callers.
6167 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6168 irelative_count_.
6169 (Output_data_plt_x86_64::has_irelative_section): New function.
6170 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6171 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6172 fields. Update declarations.
6173 (Target_x86_64::Target_x86_64): Initialize new fields.
6174 (Target_x86_64::do_plt_address_for_global): New function replacing
6175 do_plt_section_for_global.
6176 (Target_x86_64::do_plt_address_for_local): New function replacing
6177 do_plt_section_for_local.
6178 (Target_x86_64::got_section): Create got_irelative_.
6179 (Target_x86_64::rela_irelative_section): New function.
6180 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6181 all callers. Don't create __rel_iplt_{start,end}.
6182 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6183 parameters. Change all callers. Use different PLT and GOT for
6184 IFUNC symbols.
6185 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6186 layout parameters. Change all callers. Use different PLT and
6187 GOT.
6188 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6189 parameters. Change all callers. Use different PLT and GOT for
6190 IFUNC symbols.
6191 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6192 (Output_data_plt_x86_64::rela_irelative): New function.
6193 (Output_data_plt_x86_64::address_for_global): New function.
6194 (Output_data_plt_x86_64::address_for_local): New function.
6195 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6196 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6197 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6198 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6199 parameters.
6200 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6201 reloc.
6202 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6203 symbols if we didn't create an IRELATIVE GOT.
6204 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6205 plt_address_for_local.
6206 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6207 * testsuite/ifuncvar1.c: New test file.
6208 * testsuite/ifuncvar2.c: New test file.
6209 * testsuite/ifuncvar3.c: New test file.
6210 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6211 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6212 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6213 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6214 * testsuite/Makefile.in: Rebuild.
6215
6216 2011-07-07 Cary Coutant <ccoutant@google.com>
6217
6218 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6219 (two_file_test_1_ndebug.o): Likewise.
6220 (two_file_test_1b_ndebug.o): Likewise.
6221 (two_file_test_2_ndebug.o): Likewise.
6222 (two_file_test_main_ndebug.o): Likewise.
6223 (incremental_test_2): Link with no-debug versions.
6224
6225 2011-07-06 Cary Coutant <ccoutant@google.com>
6226
6227 * gold/incremental.cc
6228 (Output_section_incremental_inputs::write_info_blocks): Check for
6229 hidden and internal symbols.
6230
6231 2011-07-06 Cary Coutant <ccoutant@google.com>
6232
6233 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6234 Check disposition for startup file.
6235 (Incremental_inputs::report_command_line): Ignore
6236 --incremental-startup-unchanged option.
6237 * options.cc (General_options::parse_incremental_startup_unchanged):
6238 New function.
6239 (General_options::General_options): Initialize new data member.
6240 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6241 (General_options): Add --incremental-startup-unchanged option.
6242 (General_options::incremental_startup_disposition): New function.
6243 (General_options::incremental_startup_disposition_): New data member.
6244
6245 2011-07-06 Cary Coutant <ccoutant@google.com>
6246
6247 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6248 input file index to Script_info ctor.
6249 (Sized_incremental_binary::do_file_has_changed): Find the
6250 command-line argument for files named in scripts.
6251 * incremental.h (Script_info::Script_info): New ctor
6252 with input file index.
6253 (Script_info::input_file_index): New function.
6254 (Script_info::input_file_index_): New data member.
6255 (Incremental_binary::get_library): Add const.
6256 (Incremental_binary::get_script_info): Add const.
6257 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6258 * testsuite/Makefile.am (incremental_test_5): New test case.
6259 (incremental_test_6): New test case.
6260 * testsuite/Makefile.in: Regenerate.
6261
6262 2011-07-06 Cary Coutant <ccoutant@google.com>
6263
6264 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6265 debug output when command lines differ.
6266
6267 2011-07-06 Cary Coutant <ccoutant@google.com>
6268
6269 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6270 --incremental-patch option.
6271 * layout.cc (Free_list::allocate): Extend allocation beyond original
6272 end if enabled.
6273 (Layout::make_output_section): Mark sections that should get
6274 patch space.
6275 * options.cc (parse_percent): New function.
6276 * options.h (parse_percent): New function.
6277 (DEFINE_percent): New macro.
6278 (General_options): Add --incremental-patch option.
6279 * output.cc (Output_section::Output_section): Initialize new data
6280 members.
6281 (Output_section::add_input_section): Print section name when out
6282 of patch space.
6283 (Output_section::add_output_section_data): Likewise.
6284 (Output_section::set_final_data_size): Add patch space when
6285 doing --incremental-full.
6286 (Output_section::do_reset_address_and_file_offset): Remove patch
6287 space.
6288 (Output_segment::set_section_list_addresses): Print debug output
6289 only if --incremental-update.
6290 * output.h (Output_section::set_is_patch_space_allowed): New function.
6291 (Output_section::is_patch_space_allowed_): New data member.
6292 (Output_section::patch_space_): New data member.
6293 * parameters.cc (Parameters::incremental_full): New function.
6294 * parameters.h (Parameters::incremental_full): New function
6295 * testsuite/Makefile.am (incremental_test_2): Add test for
6296 --incremental-patch option.
6297 * testsuite/Makefile.in: Regenerate.
6298 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6299 (t18): Remove function body.
6300
6301 2011-07-05 Doug Kwan <dougkwan@google.com>
6302
6303 PR gold/12771
6304 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6305 Arm_Address type for relocation result.
6306 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6307 overflow check.
6308 (Arm_relocate_functions::abs32): Use unaligned access.
6309 (Arm_relocate_functions::rel32): Ditto.
6310 (Arm_relocate_functions::prel31): Ditto.
6311 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6312 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6313 static data relocations.
6314 * testsuite/Makefile.in: Regnerate.
6315 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6316
6317 2011-07-05 Ian Lance Taylor <iant@google.com>
6318
6319 PR gold/12392
6320 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6321 symbols if necessary.
6322 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6323
6324 2011-07-05 Ian Lance Taylor <iant@google.com>
6325
6326 PR gold/12952
6327 * resolve.cc (Symbol::override_base_with_special): Simply override
6328 version with special symbol version, ignoring previous version.
6329
6330 2011-07-05 Ian Lance Taylor <iant@google.com>
6331
6332 * object.cc (Sized_relobj_file::include_section_group): Add
6333 information to comment about signature location.
6334
6335 2011-07-02 Ian Lance Taylor <iant@google.com>
6336
6337 PR gold/12957
6338 * options.h (class General_options): Add -f and -F.
6339 * options.cc (General_options::finalize): Fatal error if -f/-F
6340 are used without -shared.
6341 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6342
6343 2011-07-02 Ian Lance Taylor <iant@google.com>
6344
6345 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6346
6347 2011-07-01 Ian Lance Taylor <iant@google.com>
6348
6349 PR gold/12525
6350 PR gold/12952
6351 * resolve.cc (Symbol::override_base_with_special): Don't override
6352 the version if the overriding symbol has a different name.
6353 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6354 all callers. If we give an error about an undefined version,
6355 define the base version if necessary.
6356 * dynobj.h (class Versions): Update declaration.
6357 * testsuite/weak_alias_test_5.cc: New file.
6358 * testsuite/weak_alias_test.script: New file.
6359 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6360 and versioned_alias have the right value, and call t2.
6361 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6362 weak_alias_test_5.so.
6363 (weak_alias_test_LDADD): Likewise.
6364 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6365 * testsuite/Makefile.in: Rebuild.
6366
6367 2011-07-01 Ian Lance Taylor <iant@google.com>
6368
6369 PR gold/12525
6370 * options.h (class General_options): Support -z notext.
6371 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6372 -Wl,-z,notext.
6373 (two_file_shared_nonpic.so): Likewise.
6374 (two_file_shared_mixed.so): Likewise.
6375 (two_file_shared_mixed_1.so): Likewise.
6376 (weak_undef_lib_nonpic.so): Likewise.
6377 (alt/weak_undef_lib_nonpic.so): Likewise.
6378 (tls_test_shared_nonpic.so): Likewise.
6379 * testsuite/Makefile.in: Rebuild.
6380
6381 2011-07-01 Ian Lance Taylor <iant@google.com>
6382
6383 PR gold/12525
6384 * configure.ac: Test whether static linking works, setting
6385 the automake conditional HAVE_STATIC.
6386 * testsuite/Makefile.am: Disable tests using -static if
6387 HAVE_STATIC is not true.
6388 * configure, testsuite/Makefile.in: Rebuild.
6389
6390 2011-07-01 Ian Lance Taylor <iant@google.com>
6391
6392 PR gold/12525
6393 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6394 Assert if we see DW_EH_PE_indirect.
6395 * target.h (Target::ehframe_datarel_base): New function.
6396 (Target::do_ehframe_datarel_base): New target function.
6397 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6398 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6399 function.
6400
6401 2011-07-01 Ian Lance Taylor <iant@google.com>
6402
6403 PR gold/12571
6404 * options.h (class General_options): Add
6405 --ld-generated-unwind-info.
6406 * ehframe.cc (Fde::write): Add address parameter. Change all
6407 callers. If associated with PLT, fill in address and size.
6408 (Cie::set_output_offset): Only add merge mapping if there is an
6409 object.
6410 (Cie::write): Add address parameter. Change all callers.
6411 (Eh_frame::add_ehframe_for_plt): New function.
6412 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6413 input_offset_ fields into union u_, with new plt field.
6414 (Fde::Fde): Adjust for new union field.
6415 (Fde::Fde) [Output_data version]: New constructor.
6416 (Fde::add_mapping): Only add merge mapping if there is an object.
6417 (class Cie): Update declarations.
6418 (class Eh_frame): Declare add_ehframe_for_plt.
6419 * layout.cc (Layout::layout_eh_frame): Break out code into
6420 make_eh_frame_section, and call it.
6421 (Layout::make_eh_frame_section): New function.
6422 (Layout::add_eh_frame_for_plt): New function.
6423 * layout.h (class Layout): Update declarations.
6424 * merge.cc (Merge_map::add_mapping): Add assertion.
6425 * i386.cc: Include "dwarf.h".
6426 (class Output_data_plt_i386): Make first_plt_entry,
6427 dyn_first_plt_entry, exec_plt_entry, and dyn_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_i386::Output_data_plt_i386): Align to 16-byte
6431 boundary. Call add_eh_frame_for_plt if appropriate.
6432 * x86_64.cc: Include "dwarf.h".
6433 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6434 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6435 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6436 and plt_eh_frame_fde.
6437 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6438 appropriate.
6439
6440 2011-06-29 Ian Lance Taylor <iant@google.com>
6441
6442 PR gold/12629
6443 * object.cc (Sized_relobj_file::layout_section): Change shdr
6444 parameter to be const.
6445 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6446 out of do_layout.
6447 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6448 appropriate. Call layout_eh_frame_section.
6449 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6450 sections.
6451 * object.h (class Sized_relobj_file): Update declarations.
6452
6453 2011-06-29 Ian Lance Taylor <iant@google.com>
6454
6455 PR gold/12652
6456 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6457 modifier.
6458 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6459
6460 2011-06-29 Ian Lance Taylor <iant@google.com>
6461
6462 PR gold/12675
6463 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6464 SHT_X86_64_UNWIND.
6465 * layout.cc (Layout::layout_eh_frame): Likewise.
6466
6467 2011-06-29 Ian Lance Taylor <iant@google.com>
6468
6469 PR gold/12695
6470 * layout.cc (Layout::symtab_section_shndx): New function.
6471 * layout.h (class Layout): Declare symtab_section_shndx.
6472 * output.cc (Output_section::write_header): Call it.
6473
6474 2011-06-29 Ian Lance Taylor <iant@google.com>
6475
6476 PR gold/12818
6477 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6478 symbols which are not used in a relocation.
6479
6480 2011-06-28 Ian Lance Taylor <iant@google.com>
6481
6482 PR gold/12898
6483 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6484 script create indistinguishable segments.
6485 (Layout::set_segment_offsets): Use stable_sort when sorting
6486 segments. Pass this to Compare_segments constructor.
6487 * layout.h (class Layout): Make segment_precedes non-static.
6488 (class Compare_segments): Change from struct to class. Add
6489 layout_ field. Add constructor.
6490 * script-sections.cc
6491 (Script_sections::attach_sections_using_phdrs_clause): Rename
6492 local orphan to is_orphan. Don't report failure to put empty
6493 section in segment. On attachment failure, report name of
6494 section, and attach to first PT_LOAD segment.
6495
6496 2011-06-28 Ian Lance Taylor <iant@google.com>
6497
6498 PR gold/12934
6499 * target-select.cc (Target_selector::Target_selector): Add
6500 emulation parameter. Change all callers.
6501 (select_target_by_bfd_name): Rename from select_target_by_name.
6502 Change all callers.
6503 (select_target_by_emulation): New function.
6504 (supported_emulation_names): New function.
6505 * target-select.h (class Target_selector): Add emulation_ field.
6506 Update declarations.
6507 (Target_selector::recognize_by_bfd_name): Rename from
6508 recognize_by_name. Change all callers.
6509 (Target_selector::supported_bfd_names): Rename from
6510 supported_names. Change all callers.
6511 (Target_selector::recognize_by_emulation): New function.
6512 (Target_selector::supported_emulations): New function.
6513 (Target_selector::emulation): New function.
6514 (Target_selector::do_recognize_by_bfd_name): Rename from
6515 do_recognize_by_name. Change all callers.
6516 (Target_selector::do_supported_bfd_names): Rename from
6517 do_supported_names. Change all callers.
6518 (Target_selector::do_recognize_by_emulation): New function.
6519 (Target_selector::do_supported_emulations): New function.
6520 (select_target_by_bfd_name): Change name in declaration.
6521 (select_target_by_emulation): Declare.
6522 (supported_emulation_names): Declare.
6523 * parameters.cc (parameters_force_valid_target): Try to find
6524 target based on emulation from -m option.
6525 * options.h (class General_options): Change doc string for -m.
6526 * options.cc (help): Print emulations.
6527 (General_options::parse_V): Likewise.
6528 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6529 Add emulation parameter. Change all callers.
6530
6531 2011-06-28 Ian Lance Taylor <iant@google.com>
6532
6533 * target.h (class Target): Add osabi_ field.
6534 (Target::osabi): New function.
6535 (Target::set_osabi): New function.
6536 (Target::Target): Initialize osabi_.
6537 (Target::do_adjust_elf_header): Make pure virtual.
6538 (Sized_target::do_adjust_elf_header): Declare.
6539 * target.cc (Sized_target::do_adjust_elf_header): New function.
6540 (class Sized_target): Instantiate all versions.
6541 * freebsd.h (class Target_freebsd): Remove.
6542 (Target_selector_freebsd::do_recognize): Call set_osabi on
6543 Target.
6544 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6545 (Target_selector_freebsd::set_osabi): Remove.
6546 * i386.cc (class Target_i386): Inherit from Sized_target rather
6547 than Target_freebsd.
6548 * x86_64.cc (class Target_x86_64): Likewise.
6549
6550 2011-06-28 Ian Lance Taylor <iant@google.com>
6551
6552 * target.h (Target::can_check_for_function_pointers): Rewrite.
6553 Make non-virtual.
6554 (Target::can_icf_inline_merge_sections): Likewise.
6555 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6556 (Target::Target_info): Add can_icf_inline_merge_sections field.
6557 (Target::do_can_check_for_function_pointers): New virtual
6558 function.
6559 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6560 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6561 from can_check_for_function_pointers, move in file.
6562 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6563 section_may_have_icf_unsafe_poineters, move in file.
6564 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6565 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6566 Rename from can_check_for_function_pointers, move in file.
6567 (Target_i386::can_icf_inline_merge_sections): Remove.
6568 (Target_i386::i386_info): Initialize
6569 can_icf_inline_merge_sections.
6570 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6571 Initialize can_icf_inline_merge_sections.
6572 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6573 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6574 Rename from can_check_for_function_pointers, move in file.
6575 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6576 (Target_x86_64::x86_64_info): Initialize
6577 can_icf_inline_merge_sections.
6578 * testsuite/testfile.cc (Target_test::test_target_info):
6579 Likewise.
6580 * icf.cc (get_section_contents): Correct formatting.
6581
6582 2011-06-27 Ian Lance Taylor <iant@google.com>
6583
6584 * symtab.cc (Symbol::versioned_name): New function.
6585 (Symbol_table::add_to_final_symtab): Use versioned_name when
6586 appropriate.
6587 (Symbol_table::sized_write_symbol): Likewise.
6588 * symtab.h (class Symbol): Declare versioned_name.
6589 * stringpool.h (class Stringpool_template): Add variant of add
6590 which takes a std::basic_string.
6591 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6592 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6593 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6594 (ver_test_12.o): New target.
6595 * testsuite/Makefile.in: Rebuild.
6596
6597 2011-06-27 Doug Kwan <dougkwan@google.com>
6598
6599 * arm.cc (Arm_relocate_functions::thm_jump8,
6600 Arm_relocate_functions::thm_jump11): Use a wider signed
6601 type to compute offset.
6602 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6603 arm_thm_jump8.
6604 * testsuite/Makefile.in: Regenerate.
6605 * testsuite/arm_branch_in_range.sh: Check test results of
6606 arm_thm_jump11 and arm_thm_jump8.
6607 * testsuite/arm_thm_jump11.s: New test source file.
6608 * testsuite/arm_thm_jump11.t: New linker script.
6609 * testsuite/arm_thm_jump8.s: New test source file.
6610 * testsuite/arm_thm_jump8.t: New linker script.
6611
6612 2011-06-24 Ian Lance Taylor <iant@google.com>
6613
6614 * layout.cc: Include "object.h".
6615 (ctors_sections_in_init_array): New static variable.
6616 (Layout::is_ctors_in_init_array): New function.
6617 (Layout::layout): Add entry to ctors_sections_in_init_array if
6618 appropriate.
6619 * layout.h (class Layout): Declare is_ctors_in_init_array.
6620 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6621 is_ctors_reverse_view is set.
6622 (Sized_relobj_file::write_sections): Add layout parameter. Change
6623 all callers. Set is_ctors_reverse_view field of View_size.
6624 (Sized_relobj_file::reverse_words): New function.
6625 * object.h (Sized_relobj_file::View_size): Add
6626 is_ctors_reverse_view field.
6627 (class Sized_relobj_file): Update declarations.
6628 * testsuite/initpri3.c: New test.
6629 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6630 initpri3b.
6631 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6632 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6633 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6634 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6635 * testsuite/Makefile.in: Rebuild.
6636
6637 2011-06-24 Cary Coutant <ccoutant@google.com>
6638
6639 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6640 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6641 (debug_msg_cdebug.err): New targets.
6642 * testsuite/Makefile.in: Regenerate.
6643 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6644 Fix checks for link with shared library.
6645
6646 2011-06-24 Doug Kwan <dougkwan@google.com>
6647
6648 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6649 skip empty text sections.
6650 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6651
6652 2011-06-22 Ian Lance Taylor <iant@google.com>
6653
6654 PR gold/12910
6655 * options.h (class General_options): Add --ctors-in-init-array.
6656 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6657 friends as SHT_PROGBITS for merging sections.
6658 (Layout::layout): Remove special handling of .init_array and
6659 friends. Don't sort if doing relocatable link. Sort for .ctors
6660 and .dtors if ctors_in_init_array.
6661 (Layout::make_output_section): Force correct section types for
6662 .init_array and friends. Don't sort if doing relocatable link,
6663 Don't sort .ctors and .dtors if ctors_in_init_array.
6664 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6665 (Layout::output_section_name): Add relobj parameter. Change all
6666 callers. Handle .ctors. and .dtors. in code rather than table.
6667 Handle .ctors and .dtors if ctors_in_init_array.
6668 (Layout::match_file_name): New function, moved from output.cc.
6669 * layout.h (class Layout): Update declarations.
6670 * output.cc: Include "layout.h".
6671 (Input_section_sort_entry::get_priority): New function.
6672 (Input_section_sort_entry::match_file_name): Just call
6673 Layout::match_file_name.
6674 (Output_section::Input_section_sort_init_fini_compare::operator()):
6675 Handle .ctors and .dtors. Sort by explicit priority rather than
6676 by name.
6677 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6678 * testsuite/initpri2.c: New test.
6679 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6680 (check_PROGRAMS): Add initpri2.
6681 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6682 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6683 * configure, testsuite/Makefile.in: Rebuild.
6684
6685 2011-06-19 Ian Lance Taylor <iant@google.com>
6686
6687 PR gold/12880
6688 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6689 .interp section to a PT_INTERP segment even if we have seen a
6690 --dynamic-linker option. Don't do it if we have seen a PHDRS
6691 clause in a linker script.
6692 (Layout::finalize): Don't create a .interp section if we've
6693 already create a PT_INTERP segment.
6694 (Layout::create_interp): Always call choose_output_section (revert
6695 patch of 2011-06-17). Don't create PT_INTERP segment.
6696 * script-sections.cc
6697 (Script_sections::create_note_and_tls_segments): Add a .interp
6698 section to a PT_INTERP segment even if we have seen a
6699 --dynamic-linker option.
6700
6701 2011-06-18 Ian Lance Taylor <iant@google.com>
6702
6703 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6704 merely because a non-PT_LOAD segment has a dynamic reloc.
6705
6706 2011-06-18 Ian Lance Taylor <iant@google.com>
6707
6708 * layout.cc (Layout::finish_dynamic_section): Don't create
6709 DT_FLAGS entry if not needed.
6710
6711 2011-06-18 Ian Lance Taylor <iant@google.com>
6712
6713 PR gold/12745
6714 * layout.cc (Layout::layout_eh_frame): Correct handling of
6715 writable .eh_frame section.
6716
6717 2011-06-17 Ian Lance Taylor <iant@google.com>
6718
6719 PR gold/12893
6720 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6721 symbol is redefined with the exact same object and value.
6722
6723 2011-06-17 Ian Lance Taylor <iant@google.com>
6724
6725 PR gold/12880
6726 * layout.h (class Layout): Add interp_segment_ field.
6727 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6728 (Layout::attach_allocated_section_to_segment): If making shared
6729 library, put .interp section in PT_INTERP segment.
6730 (Layout::finalize): Also call create_interp if -dynamic-linker
6731 option was used.
6732 (Layout::create_interp): Assert that there is no PT_INTERP
6733 segment. If not using a SECTIONS clause, use make_output_section.
6734 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6735 * script-sections.cc
6736 (Script_sections::create_note_and_tls_segments): If making shared
6737 library, put .interp section in PT_INTERP segment.
6738
6739 2011-06-17 Ian Lance Taylor <iant@google.com>
6740
6741 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6742 when making a shared library.
6743
6744 2011-06-17 Ian Lance Taylor <iant@google.com>
6745
6746 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6747 parameter. Change all callers. Don't issue warning about PC32
6748 against locally defined symbol.
6749
6750 2011-06-16 Ian Lance Taylor <iant@google.com>
6751
6752 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6753 occurs in same object.
6754
6755 2011-06-14 Alan Modra <amodra@gmail.com>
6756
6757 * po/POTFILES.in: Regenerate.
6758
6759 2011-06-09 Ian Lance Taylor <iant@google.com>
6760
6761 * script-sections.cc
6762 (Orphan_output_section::set_section_addresses): For a relocatable
6763 link set address to 0.
6764
6765 2011-06-09 Cary Coutant <ccoutant@google.com>
6766
6767 PR gold/12804
6768 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6769 used with --compress-debug-sections.
6770 * gold/object.cc (Sized_relobj_file::do_layout): Report
6771 uncompressed size of compressed input sections.
6772
6773 2011-06-08 Cary Coutant <ccoutant@google.com>
6774
6775 PR gold/12804
6776 * testsuite/two_file_test_2_v1.cc: Change initialization of
6777 v2 to keep it in .data.
6778
6779 2011-06-07 Cary Coutant <ccoutant@google.com>
6780
6781 * common.cc (Symbol_table::do_allocate_commons_list): Call
6782 gold_fallback.
6783 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6784 (Errors::fallback): New function.
6785 (gold_fallback): New function.
6786 * errors.h (Errors::fallback): New function.
6787 * gold.cc (gold_exit): Change status parameter to enum; adjust
6788 all callers.
6789 (queue_initial_tasks): Call gold_fallback.
6790 * gold.h: Include cstdlib.
6791 (Exit_status): New enum type.
6792 (gold_exit): Change status parameter to enum.
6793 (gold_fallback): New function.
6794 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6795 (Layout::create_symtab_sections): Likewise.
6796 (Layout::create_shdrs): Likewise.
6797 * main.cc (main): Adjust call to gold_exit.
6798 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6799 (Output_data_got::add_got_entry_pair): Likewise.
6800 (Output_section::add_input_section): Likewise.
6801 (Output_section::add_output_section_data): Likewise.
6802 (Output_segment::set_section_list_addresses): Likewise.
6803 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6804
6805 2011-06-07 Cary Coutant <ccoutant@google.com>
6806
6807 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6808 for incremental links.
6809 * output.cc (Output_segment::set_section_list_addresses): Remove
6810 FIXME and test for TLS or BSS.
6811
6812 2011-06-07 Cary Coutant <ccoutant@google.com>
6813
6814 * testsuite/Makefile.am: Add incremental_copy_test,
6815 incremental_common_test_1.
6816 * testsuite/Makefile.in: Regenerate.
6817 * testsuite/common_test_1_v1.c: New source file.
6818 * testsuite/common_test_1_v2.c: New source file.
6819 * testsuite/copy_test_v1.cc: New source file.
6820
6821 2011-06-07 Cary Coutant <ccoutant@google.com>
6822
6823 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6824 update, allocate common from bss section's free list.
6825 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6826 linker-defined symbols.
6827 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6828 Skip GOT and PLT entries that are no longer referenced.
6829 (Output_section_incremental_inputs::write_info_blocks): Mark
6830 linker-defined symbols.
6831 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6832 * output.cc (Output_section::allocate): New function.
6833 * output.h (Output_section::allocate): New function.
6834 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6835 linker-defined symbols.
6836 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6837 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6838 (Symbol::init_base_output_data): Likewise.
6839 (Symbol::init_base_output_segment): Likewise.
6840 (Symbol::init_base_constant): Likewise.
6841 (Sized_symbol::init_output_data): Likewise.
6842 (Sized_symbol::init_output_segment): Likewise.
6843 (Sized_symbol::init_constant): Likewise.
6844 (Symbol_table::do_define_in_output_data): Likewise.
6845 (Symbol_table::do_define_in_output_segment): Likewise.
6846 (Symbol_table::do_define_as_constant): Likewise.
6847 * symtab.h (Symbol::is_predefined): New function.
6848 (Symbol::init_base_output_data): Add is_predefined parameter.
6849 (Symbol::init_base_output_segment): Likewise.
6850 (Symbol::init_base_constant): Likewise.
6851 (Symbol::is_predefined_): New data member.
6852 (Sized_symbol::init_output_data): Add is_predefined parameter.
6853 (Sized_symbol::init_output_segment): Likewise.
6854 (Sized_symbol::init_constant): Likewise.
6855 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6856
6857 2011-06-07 Cary Coutant <ccoutant@google.com>
6858
6859 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6860 instead of emit_copy_reloc.
6861 (Copy_relocs::emit_copy_reloc): Refactor.
6862 (Copy_relocs::make_copy_reloc): New function.
6863 (Copy_relocs::add_copy_reloc): Remove.
6864 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6865 section.
6866 (Copy_relocs::make_copy_reloc): New function.
6867 (Copy_relocs::add_copy_reloc): Remove.
6868 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6869 unchanged input files.
6870 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6871 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6872 Reserve BSS space for COPY relocations.
6873 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6874 (Output_section_incremental_inputs::write_info_blocks): Record
6875 whether a symbol is copied from a shared object.
6876 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6877 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6878 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6879 (Incremental_input_entry_reader::get_output_symbol_index): Add
6880 is_copy parameter.
6881 (Incremental_binary::emit_copy_relocs): New function.
6882 (Incremental_binary::do_emit_copy_relocs): New function.
6883 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6884 new data member.
6885 (Sized_incremental_binary::add_copy_reloc): New function.
6886 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6887 (Sized_incremental_binary::Copy_reloc): New struct.
6888 (Sized_incremental_binary::Copy_relocs): New typedef.
6889 (Sized_incremental_binary::copy_relocs_): New data member.
6890 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6891 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6892 * target.h (Sized_target::emit_copy_reloc): New function.
6893 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6894
6895 2011-06-02 Cary Coutant <ccoutant@google.com>
6896
6897 PR gold/12163
6898 * gold/archive.cc (Archive::Archive): Initialize new data member.
6899 (Archive::include_all_members): Return if archive has already been
6900 included.
6901 * gold/archive.h (Archive::include_all_members_): New data member.
6902
6903 2011-06-02 Nick Clifton <nickc@redhat.com>
6904
6905 * dynobj.h: Fix spelling mistake in comment.
6906 * output.cc: Likewise.
6907
6908 2011-05-31 Doug Kwan <dougkwan@google.com>
6909 Asier Llano
6910
6911 PR gold/12826
6912 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
6913 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6914 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6915 redundant arm_exidx_test.so.
6916 * testsuite/Makefile.in: Regenerate.
6917 (check_SCRIPTS): Add pr12826.sh
6918 (check_DATA): Add pr12826.stdout
6919 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6920 * testsuite/pr12826.sh: New file.
6921 * testsuite/pr12826_1.s: Ditto.
6922 * testsuite/pr12826_1.s: Ditto.
6923
6924 2011-05-30 Ian Lance Taylor <iant@google.com>
6925
6926 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6927 sections.
6928
6929 2011-05-29 Ian Lance Taylor <iant@google.com>
6930
6931 PR gold/12804
6932 * testsuite/Makefile.am: Use different file name for two_file_test
6933 temporary file for each incremental test.
6934 * testsuite/Makefile.in: Rebuild.
6935
6936 2011-05-29 Ian Lance Taylor <iant@google.com>
6937
6938 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6939 binary input file is empty.
6940
6941 2011-05-27 Ian Lance Taylor <iant@google.com>
6942
6943 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6944 (ver_test_9.so): Likewise.
6945 * testsuite/Makefile.in: Rebuild.
6946
6947 2011-05-26 Cary Coutant <ccoutant@google.com>
6948
6949 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6950 * incremental.cc (Incremental_inputs::report_input_section): Fix
6951 comment, indentation.
6952 (Incremental_inputs::report_comdat_group): New function.
6953 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6954 of data for incremental input file entry.
6955 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6956 group count, COMDAT group signatures.
6957 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6958 an unchanged input file.
6959 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6960 Initialize new data member.
6961 (Incremental_object_entry::add_comdat_group): New function.
6962 (Incremental_object_entry::get_comdat_group_count): New function.
6963 (Incremental_object_entry::get_comdat_signature_key): New function.
6964 (Incremental_object_entry::groups_): New data member.
6965 (Incremental_inputs::report_comdat_group): New function.
6966 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6967 data for incremental input file entry.
6968 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6969 (Incremental_input_entry_reader::get_input_section): Adjust size of
6970 data for incremental input file entry.
6971 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6972 (Incremental_input_entry_reader::get_comdat_group_signature): New
6973 function.
6974 * object.cc (Sized_relobj::include_section_group): Report kept
6975 COMDAT groups for incremental links.
6976
6977 2011-05-24 David Meyer <pdox@google.com>
6978
6979 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6980 with name parameter. Add found_name parameter.
6981 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6982 * dirsearch.h (class Dirsearch): Update declaration.
6983
6984 2011-05-24 Ian Lance Taylor <iant@google.com>
6985
6986 * archive.cc (Library_base::should_include_member): Pull in object
6987 from archive if it defines the entry symbol.
6988 * parameters.cc (Parameters::entry): New function.
6989 * parameters.h (class Parameters): Declare entry.
6990 * output.h (class Output_file_header): Remove entry_ field.
6991 * output.cc (Output_file_header::Output_file_header): Remove entry
6992 parameter. Change all callers.
6993 (Output_file_header::entry): Use parameters->entry.
6994 * gold.cc (queue_middle_tasks): Likewise.
6995 * plugin.cc (Plugin_hook::run): Likewise.
6996
6997 2011-05-24 Cary Coutant <ccoutant@google.com>
6998
6999 * gold.cc (queue_initial_tasks): Pass incremental base filename
7000 to Output_file::open_base_file; don't print error message.
7001 * incremental-dump.cc (main): Adjust call to
7002 Output_file::open_for_modification.
7003 * incremental-dump.cc (main): Likewise.
7004 * incremental.cc (Incremental_inputs::report_command_line):
7005 Ignore --incremental-base option when comparing command lines.
7006 Ignore parameter when given as separate argument.
7007 * options.h (class General_options): Add --incremental-base.
7008 * output.cc (Output_file::Output_file):
7009 (Output_file::open_base_file): Add base_name and writable parameters;
7010 read base file into new file; print error message here.
7011 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7012 callers.
7013 * output.h (Output_file::open_for_modification): Rename to...
7014 (Output_file::open_base_file): ...this; add base_name and
7015 writable parameters; adjust all callers.
7016 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7017 callers.
7018 * testsuite/Makefile.am (incremental_test_4): Test
7019 --incremental-base.
7020 * testsuite/Makefile.in: Regenerate.
7021
7022 2011-05-24 Cary Coutant <ccoutant@google.com>
7023
7024 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7025 incremental_test_4.
7026 * testsuite/Makefile.in: Regenerate.
7027 * testsuite/two_file_test_1_v1.cc: New test source file.
7028 * testsuite/two_file_test_1b_v1.cc: New test source file.
7029 * testsuite/two_file_test_2_v1.cc: New test source file.
7030
7031 2011-05-24 Cary Coutant <ccoutant@google.com>
7032
7033 * dynobj.h (Dynobj::do_dynobj): New function.
7034 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7035 flag and soname for shared objects.
7036 * incremental.cc (Incremental_inputs::report_object): Make
7037 either Incremental_object_entry or Incremental_dynobj_entry; add
7038 soname to string table.
7039 (Incremental_inputs::report_input_section): Add assertion.
7040 (Output_section_incremental_inputs::set_final_data_size): Adjust
7041 type of input file entry for shared libraries; adjust size of
7042 shared library info entry.
7043 (Output_section_incremental_inputs::write_input_files): Write
7044 as_needed flag for shared libraries.
7045 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7046 of input file entry for shared libraries; write soname.
7047 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7048 soname from incremental info.
7049 * incremental.h (enum Incremental_input_flags): Add
7050 INCREMENTAL_INPUT_AS_NEEDED.
7051 (Incremental_input_entry::Incremental_input_entry): Initialize new
7052 data member.
7053 (Incremental_input_entry::set_as_needed): New function.
7054 (Incremental_input_entry::as_needed): New function.
7055 (Incremental_input_entry::do_dynobj_entry): New function.
7056 (Incremental_input_entry::as_needed_): New data member.
7057 (Incremental_object_entry::Incremental_object_entry): Don't check
7058 for shared library.
7059 (Incremental_object_entry::do_type): Likewise.
7060 (class Incremental_dynobj_entry): New class.
7061 (Incremental_input_entry_reader::as_needed): New function.
7062 (Incremental_input_entry_reader::get_soname): New function.
7063 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7064 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7065 size of shared library info entry.
7066 * layout.cc (Layout::finish_dynamic_section): Don't test for
7067 incremental link when adding DT_NEEDED entries.
7068 * object.h (Object::Object): Initialize new data member.
7069 (Object::dynobj): New function.
7070 (Object::set_as_needed): New function.
7071 (Object::as_needed): New function.
7072 (Object::do_dynobj): New function.
7073 (Object::as_needed_): New data member.
7074
7075 2011-05-24 Cary Coutant <ccoutant@google.com>
7076
7077 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7078 info; adjust display of GOT entries.
7079 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7080 vector of input objects; remove file_status_.
7081 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7082 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7083 got_plt reader; call target hooks to reserve GOT entries.
7084 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7085 of input file info header and GOT info entry.
7086 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7087 relocation info.
7088 (Got_plt_view_info::got_descriptor): Remove.
7089 (Got_plt_view_info::sym_index): New data member.
7090 (Got_plt_view_info::input_index): New data member.
7091 (Local_got_offset_visitor::visit): Write input file index.
7092 (Global_got_offset_visitor::visit): Write 0 for input file index.
7093 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7094 with sym_index and input_index.
7095 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7096 incremental info GOT entry; replace got_descriptor with input_index.
7097 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7098 map from input file index to object.
7099 (Sized_relobj_incr::do_layout): Replace direct data member reference
7100 with accessor function.
7101 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7102 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7103 Adjust size of input file info header.
7104 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7105 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7106 (Incremental_input_entry_reader::get_input_section): Adjust size of
7107 input file info header.
7108 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7109 of incremental info GOT entry.
7110 (Incremental_got_plt_reader::get_got_desc): Remove.
7111 (Incremental_got_plt_reader::get_got_symndx): New function.
7112 (Incremental_got_plt_reader::get_got_input_index): New function.
7113 (Sized_incremental_binary::Sized_incremental_binary): Remove
7114 file_status_; add input_objects_.
7115 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7116 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7117 (Sized_incremental_binary::file_is_unchanged): Remove.
7118 (Sized_incremental_binary::set_input_object): New function.
7119 (Sized_incremental_binary::input_object): New function.
7120 (Sized_incremental_binary::file_status_): Remove.
7121 (Sized_incremental_binary::input_objects_): New data member.
7122 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7123 references.
7124 (Sized_relobj_incr::invalid_address): Move to base class.
7125 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7126 class.
7127 (Sized_relobj_incr::do_output_section_offset): Likewise.
7128 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7129 (Sized_relobj_incr::section_offsets_): Likewise.
7130 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7131 function.
7132 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7133 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7134 with accessor function.
7135 (Sized_relobj_file::do_layout): Likewise.
7136 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7137 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7138 (Sized_relobj_file::compute_final_local_value): Replace refs to
7139 section_offsets_ with accessor function.
7140 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7141 * object.h (Relobj::Relobj): Initialize new data members.
7142 (Relobj::add_dyn_reloc): New function.
7143 (Relobj::first_dyn_reloc): New function.
7144 (Relobj::dyn_reloc_count): New function.
7145 (Relobj::first_dyn_reloc_): New data member.
7146 (Relobj::dyn_reloc_count_): New data member.
7147 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7148 references.
7149 (Sized_relobj::Address): New typedef.
7150 (Sized_relobj::invalid_address): Move here from child class.
7151 (Sized_relobj::Sized_relobj): Initialize new data members.
7152 (Sized_relobj::sized_relobj): New function.
7153 (Sized_relobj::is_output_section_offset_invalid): Move here from
7154 child class.
7155 (Sized_relobj::get_output_section_offset): Likewise.
7156 (Sized_relobj::local_has_got_offset): Likewise.
7157 (Sized_relobj::local_got_offset): Likewise.
7158 (Sized_relobj::set_local_got_offset): Likewise.
7159 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7160 (Sized_relobj::clear_got_offsets): New function.
7161 (Sized_relobj::section_offsets): Move here from child class.
7162 (Sized_relobj::do_output_section_offset): Likewise.
7163 (Sized_relobj::do_set_section_offset): Likewise.
7164 (Sized_relobj::Local_got_offsets): Likewise.
7165 (Sized_relobj::local_got_offsets_): Likewise.
7166 (Sized_relobj::section_offsets_): Likewise.
7167 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7168 references.
7169 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7170 class.
7171 (Sized_relobj_file::sized_relobj): New function
7172 (Sized_relobj_file::local_has_got_offset): Move to base class.
7173 (Sized_relobj_file::local_got_offset): Likewise.
7174 (Sized_relobj_file::set_local_got_offset): Likewise.
7175 (Sized_relobj_file::get_output_section_offset): Likewise.
7176 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7177 (Sized_relobj_file::do_output_section_offset): Likewise.
7178 (Sized_relobj_file::do_set_section_offset): Likewise.
7179 (Sized_relobj_file::Local_got_offsets): Likewise.
7180 (Sized_relobj_file::local_got_offsets_): Likewise.
7181 (Sized_relobj_file::section_offsets_): Likewise.
7182 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7183 (all constructors).
7184 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7185 (Output_reloc::get_symbol_index): Likewise.
7186 (Output_reloc::local_section_offset): Likewise.
7187 (Output_reloc::get_address): Likewise.
7188 (Output_reloc::symbol_value): Likewise.
7189 (Output_data_got::reserve_slot): Move to class definition.
7190 (Output_data_got::reserve_local): New function.
7191 (Output_data_got::reserve_slot_for_global): Remove.
7192 (Output_data_got::reserve_global): New function.
7193 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7194 (all constructors, two instantiations).
7195 (Output_reloc::get_relobj): New function (two instantiations).
7196 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7197 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7198 (Output_data_reloc::add_global): Adjust type of relobj.
7199 (Output_data_reloc::add_global_relative): Likewise.
7200 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7201 (Output_data_reloc::add_local): Likewise.
7202 (Output_data_reloc::add_local_relative): Likewise.
7203 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7204 (Output_data_reloc::add_local_section): Likewise.
7205 (Output_data_reloc::add_output_section): Likewise.
7206 (Output_data_reloc::add_absolute): Likewise.
7207 (Output_data_reloc::add_target_specific): Likewise.
7208 (Output_data_got::reserve_slot): Move definition here.
7209 (Output_data_got::reserve_local): New function.
7210 (Output_data_got::reserve_global): New function.
7211 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7212 section_offsets_ with accessor function.
7213 (Sized_relobj_file::write_sections): Likewise.
7214 (Sized_relobj_file::do_relocate_sections): Likewise.
7215 * target.h (Sized_target::reserve_local_got_entry): New function.
7216 (Sized_target::reserve_global_got_entry): New function.
7217 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7218 (Target_x86_64::reserve_global_got_entry): New function.
7219 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7220
7221 2011-05-23 Cary Coutant <ccoutant@google.com>
7222
7223 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7224 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7225 bit when checking got_type.
7226 * incremental.cc (Sized_incremental_binary::setup_readers):
7227 Store symbol table and string table locations; initialize bit vector
7228 of file status flags.
7229 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7230 unchanged files.
7231 (Sized_incremental_binary::do_process_got_plt): New function.
7232 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7233 (Output_section_incremental_inputs::set_final_data_size): Record
7234 file index for each input file.
7235 (Output_section_incremental_inputs::write_got_plt): Store file index
7236 instead of input entry offset for each GOT entry.
7237 * incremental.h
7238 (Incremental_input_entry::Incremental_input_entry): Initialize new
7239 data member.
7240 (Incremental_input_entry::set_offset): Store file index.
7241 (Incremental_input_entry::get_file_index): New function.
7242 (Incremental_input_entry::file_index_): New data member.
7243 (Incremental_binary::process_got_plt): New function.
7244 (Incremental_binary::do_process_got_plt): New function.
7245 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7246 data members.
7247 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7248 (Sized_incremental_binary::set_file_is_unchanged): New function.
7249 (Sized_incremental_binary::file_is_unchanged): New function.
7250 (Sized_incremental_binary::do_process_got_plt): New function.
7251 (Sized_incremental_binary::file_status_): New data member.
7252 (Sized_incremental_binary::main_symtab_loc_): New data member.
7253 (Sized_incremental_binary::main_strtab_loc_): New data member.
7254 * output.cc (Output_data_got::Got_entry::write): Add case
7255 RESERVED_CODE.
7256 (Output_data_got::add_global): Call add_got_entry.
7257 (Output_data_got::add_global_plt): Likewise.
7258 (Output_data_got::add_global_with_rel): Likewise.
7259 (Output_data_got::add_global_with_rela): Likewise.
7260 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7261 (Output_data_got::add_global_pair_with_rela): Likewise.
7262 (Output_data_got::add_local): Call add_got_entry.
7263 (Output_data_got::add_local_plt): Likewise.
7264 (Output_data_got::add_local_with_rel): Likewise.
7265 (Output_data_got::add_local_with_rela): Likewise.
7266 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7267 (Output_data_got::add_local_pair_with_rela): Likewise.
7268 (Output_data_got::reserve_slot): New function.
7269 (Output_data_got::reserve_slot_for_global): New function.
7270 (Output_data_got::add_got_entry): New function.
7271 (Output_data_got::add_got_entry_pair): New function.
7272 (Output_section::add_output_section_data): Edit FIXME.
7273 * output.h
7274 (Output_section_data_build::Output_section_data_build): New
7275 constructor with size parameter.
7276 (Output_data_space::Output_data_space): Likewise.
7277 (Output_data_got::Output_data_got): Initialize new data member; new
7278 constructor with size parameter.
7279 (Output_data_got::add_constant): Call add_got_entry.
7280 (Output_data_got::reserve_slot): New function.
7281 (Output_data_got::reserve_slot_for_global): New function.
7282 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7283 (Output_data_got::add_got_entry): New function.
7284 (Output_data_got::add_got_entry_pair): New function.
7285 (Output_data_got::free_list_): New data member.
7286 * target.h (Sized_target::init_got_plt_for_update): New function.
7287 (Sized_target::register_global_plt_entry): New function.
7288 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7289 Initialize new data member; call init; add constructor with PLT count.
7290 (Output_data_plt_x86_64::init): New function.
7291 (Output_data_plt_x86_64::add_relocation): New function.
7292 (Output_data_plt_x86_64::reserve_slot): New function.
7293 (Output_data_plt_x86_64::free_list_): New data member.
7294 (Target_x86_64::init_got_plt_for_update): New function.
7295 (Target_x86_64::register_global_plt_entry): New function.
7296 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7297 incremental updates.
7298 (Output_data_plt_x86_64::add_relocation): New function.
7299 * testsuite/object_unittest.cc (Object_test): Set default options.
7300
7301 2011-05-16 Ian Lance Taylor <iant@google.com>
7302
7303 * options.h (class General_options): Make -i a synonym for -r.
7304
7305 2011-05-16 Ian Lance Taylor <iant@google.com>
7306
7307 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7308
7309 2011-05-10 Cary Coutant <ccoutant@google.com>
7310
7311 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7312 strip_all (-s).
7313
7314 2011-05-06 Ian Lance Taylor <iant@google.com>
7315
7316 * layout.cc (Layout::layout): If the output section flags change,
7317 update the ordering.
7318
7319 2011-04-25 Cary Coutant <ccoutant@google.com>
7320
7321 * incremental-dump.cc (dump_incremental_inputs): Print local
7322 symbol info for each input file.
7323 * incremental.cc
7324 (Output_section_incremental_inputs::set_final_data_size): Add local
7325 symbol info to input file entries in incremental info.
7326 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7327 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7328 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7329 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7330 implementation.
7331 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7332 (Sized_incr_relobj::do_relocate): Write the local symbols.
7333 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7334 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7335 Adjust size of input file header.
7336 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7337 (Incremental_inputs_reader::get_local_symbol_count): New function.
7338 (Incremental_inputs_reader::get_input_section): Adjust size of input
7339 file header.
7340 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7341 (Sized_incr_relobj::This): New typedef.
7342 (Sized_incr_relobj::sym_size): New const data member.
7343 (Sized_incr_relobj::Local_symbol): New struct.
7344 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7345 (Sized_incr_relobj::do_local_symbol_offset): New function.
7346 (Sized_incr_relobj::local_symbol_count_): New data member.
7347 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7348 (Sized_incr_relobj::local_symbol_index_): New data member.
7349 (Sized_incr_relobj::local_symbol_offset_): New data member.
7350 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7351 (Sized_incr_relobj::local_symbols_): New data member.
7352 * object.h (Relobj::output_local_symbol_count): New function.
7353 (Relobj::local_symbol_offset): New function.
7354 (Relobj::do_output_local_symbol_count): New function.
7355 (Relobj::do_local_symbol_offset): New function.
7356 (Sized_relobj::do_output_local_symbol_count): New function.
7357 (Sized_relobj::do_local_symbol_offset): New function.
7358
7359 2011-04-22 Vladimir Simonov <sv@sw.ru>
7360
7361 * descriptors.cc (set_close_on_exec): New function.
7362 (Descriptors::open): Use set_close_on_exec.
7363 * output.cc (S_ISLNK): Define if not defined.
7364
7365 2011-04-22 Cary Coutant <ccoutant@google.com>
7366
7367 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7368 global symbol map.
7369 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7370 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7371 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7372 relocations.
7373 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7374 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7375 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7376 * incremental.h
7377 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7378 function.
7379 (Incremental_binary::apply_incremental_relocs): New function.
7380 (Incremental_binary::do_apply_incremental_relocs): New function.
7381 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7382 data member.
7383 (Sized_incremental_binary::add_global_symbol): New function.
7384 (Sized_incremental_binary::global_symbol): New function.
7385 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7386 (Sized_incremental_binary::symbol_map_): New data member.
7387 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7388 * target.h (Sized_target::apply_relocation): New function.
7389 * target-reloc.h (apply_relocation): New function.
7390 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7391
7392 2011-04-22 Doug Kwan <dougkwan@google.com>
7393
7394 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7395 flag of a SHT_ARM_EXIDX section.
7396 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7397 * testsuite/Makefile.in: Regenerate.
7398 * testsuite/arm_exidx_test.s: New file.
7399 * testsuite/arm_exidx_test.sh: Same.
7400
7401 2011-04-20 Cary Coutant <ccoutant@google.com>
7402
7403 PR gold/12689
7404 * archive.h (Incremental_archive_entry::Archive_member):
7405 Initialize arg_serial_ (second constructor).
7406
7407 2011-04-17 Ian Lance Taylor <iant@google.com>
7408
7409 * object.cc (Relocate_info::location): Simplify location string.
7410 * errors.cc (Errors::error_at_location): Don't print program
7411 name.
7412 (Errors::warning_at_location): Likewise.
7413 (Errors::undefined_symbol): Likewise.
7414 * testsuite/debug_msg.sh: Update accordingly.
7415
7416 2011-04-14 Cary Coutant <ccoutant@google.com>
7417
7418 * gold/layout.cc (Layout::symtab_section_offset): New function.
7419 * gold/layout.h (Layout::symtab_section_offset): New function.
7420 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7421
7422 2011-04-12 Ian Lance Taylor <iant@google.com>
7423
7424 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7425 with MREMAP_MAYMOVE.
7426 * output.h (class Output_file): Add map_is_allocated_ field.
7427 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7428 not available, provide stubs. If mremap is not available, #define
7429 it to gold_mremap.
7430 (MREMAP_MAYMOVE): Define if not defined.
7431 (Output_file::Output_file): Initialize map_is_allocated_.
7432 (Output_file::resize): Check map_is_allocated_.
7433 (Output_file::map_anonymous): If mmap fails, use malloc.
7434 (Output_file::unmap): Don't do anything for an anonymous map.
7435 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7436 is not available, provide stubs.
7437 (File_read::View::~View): Use free rather than delete[].
7438 (File_read::make_view): Use malloc rather than new[]. If mmap
7439 fails, use malloc.
7440 (File_read::find_or_make_view): Use malloc rather than new[].
7441 * gold.h: Remove HAVE_REMAP code.
7442 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7443 exists. Rename mremap to gold_mremap. If mmap is not available
7444 don't do anything.
7445 * configure, config.in: Rebuild.
7446
7447 2011-04-11 Ian Lance Taylor <iant@google.com>
7448
7449 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7450 initialize local variable v.
7451
7452 2011-04-11 Cary Coutant <ccoutant@google.com>
7453
7454 * archive.cc (Archive::include_member): Adjust call to
7455 report_object.
7456 (Add_archive_symbols::run): Track argument serial numbers.
7457 (Lib_group::include_member): Likewise.
7458 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7459 * archive.h (Incremental_archive_entry::Archive_member):
7460 Initialize arg_serial_.
7461 (Archive_member::arg_serial_): New data member.
7462 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7463 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7464 incremental link.
7465 (Sized_dynobj::do_for_all_local_got_entries): New function.
7466 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7467 function.
7468 * fileread.cc (get_mtime): New function.
7469 * fileread.h (get_mtime): New function.
7470 * gold.cc (queue_initial_tasks): Check for incremental update.
7471 (process_incremental_input): New function.
7472 (queue_middle_tasks): Don't force valid target for incremental
7473 update.
7474 * incremental-dump.cc (find_input_containing_global): Adjust
7475 size of symbol info entry.
7476 (dump_incremental_inputs): Dump argument serial number and
7477 in_system_directory flag; bias shndx by 1; print symbol names
7478 when dumping per-file symbol lists; use new symbol info readers.
7479 * incremental.cc
7480 (Output_section_incremental_inputs:update_data_size): New function.
7481 (Sized_incremental_binary::setup_readers): Setup input readers
7482 for each input file; build maps for files added from libraries
7483 and scripts.
7484 (Sized_incremental_binary::check_input_args): New function.
7485 (Sized_incremental_binary::do_check_inputs): Build map of argument
7486 serial numbers to input arguments.
7487 (Sized_incremental_binary::do_file_has_changed): Rename
7488 do_file_is_unchanged to this; compare file modification times.
7489 (Sized_incremental_binary::do_init_layout): New function.
7490 (Sized_incremental_binary::do_reserve_layout): New function.
7491 (Sized_incremental_binary::do_get_input_reader): Remove.
7492 (Sized_incremental_binary::get_symtab_view): New function.
7493 (Incremental_checker::can_incrementally_link_output_file): Remove.
7494 (Incremental_inputs::report_command_line): Exclude --debug options.
7495 (Incremental_inputs::report_archive_begin): Add parameter; track
7496 argument serial numbers; don't put input file entry for archive
7497 before archive members.
7498 (Incremental_inputs::report_archive_end): Put input file entry
7499 for archive after archive members.
7500 (Incremental_inputs::report_object): Add parameter; track argument
7501 serial numbers and in_system_directory flag.
7502 (Incremental_inputs::report_script): Add parameter; track argument
7503 serial numbers.
7504 (Output_section_incremental_inputs::set_final_data_size): Adjust
7505 size of symbol info entry; check for forwarding symbols.
7506 (Output_section_incremental_inputs::write_input_files): Write
7507 in_system_directory flag and argument serial number.
7508 (Output_section_incremental_inputs::write_info_blocks): Map section
7509 indices between incremental info and original input file; store
7510 input section index for each symbol.
7511 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7512 change operator() to visit().
7513 (class Global_got_offset_visitor): Likewise.
7514 (class Global_symbol_visitor_got_plt):
7515 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7516 classes.
7517 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7518 (Sized_incr_relobj::do_read_symbols): New function.
7519 (Sized_incr_relobj::do_layout): New function.
7520 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7521 (Sized_incr_relobj::do_add_symbols): New function.
7522 (Sized_incr_relobj::do_should_include_member): New function.
7523 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7524 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7525 (Sized_incr_relobj::do_section_size): New function.
7526 (Sized_incr_relobj::do_section_name): New function.
7527 (Sized_incr_relobj::do_section_contents): New function.
7528 (Sized_incr_relobj::do_section_flags): New function.
7529 (Sized_incr_relobj::do_section_entsize): New function.
7530 (Sized_incr_relobj::do_section_address): New function.
7531 (Sized_incr_relobj::do_section_type): New function.
7532 (Sized_incr_relobj::do_section_link): New function.
7533 (Sized_incr_relobj::do_section_info): New function.
7534 (Sized_incr_relobj::do_section_addralign): New function.
7535 (Sized_incr_relobj::do_initialize_xindex): New function.
7536 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7537 (Sized_incr_relobj::do_read_relocs): New function.
7538 (Sized_incr_relobj::do_gc_process_relocs): New function.
7539 (Sized_incr_relobj::do_scan_relocs): New function.
7540 (Sized_incr_relobj::do_count_local_symbols): New function.
7541 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7542 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7543 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7544 (Sized_incr_relobj::do_relocate): New function.
7545 (Sized_incr_relobj::do_set_section_offset): New function.
7546 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7547 (Sized_incr_dynobj::do_read_symbols): New function.
7548 (Sized_incr_dynobj::do_layout): New function.
7549 (Sized_incr_dynobj::do_add_symbols): New function.
7550 (Sized_incr_dynobj::do_should_include_member): New function.
7551 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7552 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7553 (Sized_incr_dynobj::do_section_size): New function.
7554 (Sized_incr_dynobj::do_section_name): New function.
7555 (Sized_incr_dynobj::do_section_contents): New function.
7556 (Sized_incr_dynobj::do_section_flags): New function.
7557 (Sized_incr_dynobj::do_section_entsize): New function.
7558 (Sized_incr_dynobj::do_section_address): New function.
7559 (Sized_incr_dynobj::do_section_type): New function.
7560 (Sized_incr_dynobj::do_section_link): New function.
7561 (Sized_incr_dynobj::do_section_info): New function.
7562 (Sized_incr_dynobj::do_section_addralign): New function.
7563 (Sized_incr_dynobj::do_initialize_xindex): New function.
7564 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7565 (make_sized_incremental_object): New function.
7566 (Incremental_library::copy_unused_symbols): New function.
7567 (Incremental_library::do_for_all_unused_symbols): New function.
7568 * incremental.h (enum Incremental_input_flags): New type.
7569 (class Incremental_checker): Remove.
7570 (Incremental_input_entry::Incremental_input_entry): Add argument
7571 serial number.
7572 (Incremental_input_entry::arg_serial): New function.
7573 (Incremental_input_entry::set_is_in_system_directory): New function.
7574 (Incremental_input_entry::is_in_system_directory): New function.
7575 (Incremental_input_entry::arg_serial_): New data member.
7576 (Incremental_input_entry::is_in_system_directory_): New data member.
7577 (class Script_info): Move here from script.h.
7578 (Script_info::Script_info): Add filename parameter.
7579 (Script_info::filename): New function.
7580 (Script_info::filename_): New data member.
7581 (Incremental_script_entry::Incremental_script_entry): Add argument
7582 serial number.
7583 (Incremental_object_entry::Incremental_object_entry): Likewise.
7584 (Incremental_object_entry::add_input_section): Build list of input
7585 sections with map to original shndx.
7586 (Incremental_object_entry::get_input_section_index): New function.
7587 (Incremental_object_entry::shndx_): New data member.
7588 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7589 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7590 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7591 serial number.
7592 (Incremental_inputs::report_archive_begin): Likewise.
7593 (Incremental_inputs::report_object): Likewise.
7594 (Incremental_inputs::report_script): Likewise.
7595 (class Incremental_global_symbol_reader): New class.
7596 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7597 and store flags and input file type.
7598 (Incremental_input_entry_reader::arg_serial): New function.
7599 (Incremental_input_entry_reader::type): Extract type from flags.
7600 (Incremental_input_entry_reader::is_in_system_directory): New function.
7601 (Incremental_input_entry_reader::get_input_section_count): Call
7602 accessor function for type.
7603 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7604 function for type; adjust size of global symbol entry.
7605 (Incremental_input_entry_reader::get_global_symbol_count): Call
7606 accessor function for type.
7607 (Incremental_input_entry_reader::get_object_count): Likewise.
7608 (Incremental_input_entry_reader::get_object_offset): Likewise.
7609 (Incremental_input_entry_reader::get_member_count): Likewise.
7610 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7611 (Incremental_input_entry_reader::get_member_offset): Likewise.
7612 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7613 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7614 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7615 (Incremental_input_entry_reader::get_global_symbol_reader): New
7616 function.
7617 (Incremental_input_entry_reader::get_output_symbol_index): New
7618 function.
7619 (Incremental_input_entry_reader::type_): Remove.
7620 (Incremental_input_entry_reader::flags_): New data member.
7621 (Incremental_inputs_reader::input_file_offset): New function.
7622 (Incremental_inputs_reader::input_file_index): New function.
7623 (Incremental_inputs_reader::input_file): Call input_file_offset.
7624 (Incremental_inputs_reader::input_file_at_offset): New function.
7625 (Incremental_relocs_reader::get_r_type): Reformat.
7626 (Incremental_relocs_reader::get_r_shndx): Reformat.
7627 (Incremental_relocs_reader::get_r_offset): Reformat.
7628 (Incremental_relocs_reader::data): New function.
7629 (Incremental_binary::Incremental_binary): Initialize new data members.
7630 (Incremental_binary::check_inputs): Add cmdline parameter.
7631 (Incremental_binary::file_is_unchanged): Remove.
7632 (Input_reader::arg_serial): New function.
7633 (Input_reader::get_unused_symbol_count): New function.
7634 (Input_reader::get_unused_symbol): New function.
7635 (Input_reader::do_arg_serial): New function.
7636 (Input_reader::do_get_unused_symbol_count): New function.
7637 (Input_reader::do_get_unused_symbol): New function.
7638 (Incremental_binary::input_file_count): New function.
7639 (Incremental_binary::get_input_reader): Change signature to use
7640 index instead of filename.
7641 (Incremental_binary::file_has_changed): New function.
7642 (Incremental_binary::get_input_argument): New function.
7643 (Incremental_binary::get_library): New function.
7644 (Incremental_binary::get_script_info): New function.
7645 (Incremental_binary::init_layout): New function.
7646 (Incremental_binary::reserve_layout): New function.
7647 (Incremental_binary::output_file): New function.
7648 (Incremental_binary::do_check_inputs): New function.
7649 (Incremental_binary::do_file_is_unchanged): Remove.
7650 (Incremental_binary::do_file_has_changed): New function.
7651 (Incremental_binary::do_init_layout): New function.
7652 (Incremental_binary::do_reserve_layout): New function.
7653 (Incremental_binary::do_input_file_count): New function.
7654 (Incremental_binary::do_get_input_reader): Change signature.
7655 (Incremental_binary::input_args_map_): New data member.
7656 (Incremental_binary::library_map_): New data member.
7657 (Incremental_binary::script_map_): New data member.
7658 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7659 new data members.
7660 (Sized_incremental_binary::output_section): New function.
7661 (Sized_incremental_binary::inputs_reader): Add const.
7662 (Sized_incremental_binary::symtab_reader): Add const.
7663 (Sized_incremental_binary::relocs_reader): Add const.
7664 (Sized_incremental_binary::got_plt_reader): Add const.
7665 (Sized_incremental_binary::get_symtab_view): New function.
7666 (Sized_incremental_binary::Inputs_reader): New typedef.
7667 (Sized_incremental_binary::Input_entry_reader): New typedef.
7668 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7669 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7670 (Sized_incremental_binary::do_file_has_changed): New function.
7671 (Sized_incremental_binary::do_init_layout): New function.
7672 (Sized_incremental_binary::do_reserve_layout): New function.
7673 (Sized_input_reader::Inputs_reader): Remove.
7674 (Sized_input_reader::Input_entry_reader): Remove.
7675 (Sized_input_reader::do_arg_serial): New function.
7676 (Sized_input_reader::do_get_unused_symbol_count): New function.
7677 (Sized_input_reader::do_get_unused_symbol): New function.
7678 (Sized_incremental_binary::do_input_file_count): New function.
7679 (Sized_incremental_binary::do_get_input_reader): Change signature;
7680 use index instead of filename.
7681 (Sized_incremental_binary::section_map_): New data member.
7682 (Sized_incremental_binary::input_entry_readers_): New data member.
7683 (class Sized_incr_relobj): New class.
7684 (class Sized_incr_dynobj): New class.
7685 (make_sized_incremental_object): New function.
7686 (class Incremental_library): New class.
7687 * layout.cc (Free_list::num_lists): New static data member.
7688 (Free_list::num_nodes): New static data member.
7689 (Free_list::num_removes): New static data member.
7690 (Free_list::num_remove_visits): New static data member.
7691 (Free_list::num_allocates): New static data member.
7692 (Free_list::num_allocate_visits): New static data member.
7693 (Free_list::init): New function.
7694 (Free_list::remove): New function.
7695 (Free_list::allocate): New function.
7696 (Free_list::dump): New function.
7697 (Free_list::print_stats): New function.
7698 (Layout_task_runner::run): Resize output file for incremental updates.
7699 (Layout::Layout): Initialize new data members.
7700 (Layout::set_incremental_base): New function.
7701 (Layout::init_fixed_output_section): New function.
7702 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7703 incremental updates.
7704 (Layout::create_gold_note): Do not create gold note section for
7705 incremental updates.
7706 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7707 for incremental updates.
7708 (Layout::set_section_offsets): For incremental updates, allocate space
7709 from free list.
7710 (Layout::create_symtab_sections): Layout with offsets relative to
7711 start of section; for incremental updates, allocate space from free
7712 list.
7713 (Layout::create_shdrs): For incremental updates, allocate space from
7714 free list.
7715 (Layout::finish_dynamic_section): For incremental updates, do not
7716 check --as-needed (fixed in subsequent patch).
7717 * layout.h (class Free_list): New class.
7718 (Layout::set_incremental_base): New function.
7719 (Layout::incremental_base): New function.
7720 (Layout::init_fixed_output_section): New function.
7721 (Layout::allocate): New function.
7722 (Layout::incremental_base_): New data member.
7723 (Layout::free_list_): New data member.
7724 * main.cc (main): Print Free_list statistics.
7725 * object.cc (Relobj::finalize_incremental_relocs): Add
7726 clear_counts parameter; clear counts only when clear_counts is set.
7727 (Sized_relobj::Sized_relobj): Initialize new base class.
7728 (Sized_relobj::do_layout): Don't report special sections.
7729 (Sized_relobj::do_for_all_local_got_entries): New function.
7730 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7731 symtab_off to all symbol table offsets.
7732 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7733 * object.h (class Got_offset_list): Move to top of file.
7734 (Object::Object): Allow case where input_file == NULL.
7735 (Object::~Object): Likewise.
7736 (Object::input_file): Assert that input_file != NULL.
7737 (Object::lock): Allow case where input_file == NULL.
7738 (Object::unlock): Likewise.
7739 (Object::is_locked): Likewise.
7740 (Object::token): Likewise.
7741 (Object::release): Likewise.
7742 (Object::is_incremental): New function.
7743 (Object::get_mtime): New function.
7744 (Object::for_all_local_got_entries): New function.
7745 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7746 (Object::set_is_in_system_directory): New function.
7747 (Object::is_in_system_directory): New function.
7748 (Object::do_is_incremental): New function.
7749 (Object::do_get_mtime): New function.
7750 (Object::do_for_all_local_got_entries): New function.
7751 (Object::is_in_system_directory_): New data member.
7752 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7753 (class Sized_relobj_base): New class.
7754 (class Sized_relobj): Derive from Sized_relobj_base.
7755 (class Sized_relobj::Symbols): Redeclare from base class.
7756 (class Sized_relobj::local_got_offset_list): Remove.
7757 (class Sized_relobj::Output_sections): Redeclare from base class.
7758 (class Sized_relobj::do_for_all_local_got_entries): New function.
7759 (class Sized_relobj::write_local_symbols): Add offset parameter.
7760 (class Sized_relobj::local_symbol_offset_): Update comment.
7761 (class Sized_relobj::local_dynsym_offset_): Update comment.
7762 * options.cc (Input_arguments::add_file): Remove const.
7763 * options.h (Input_file_argument::Input_file_argument):
7764 Initialize arg_serial_ (all constructors).
7765 (Input_file_argument::set_arg_serial): New function.
7766 (Input_file_argument::arg_serial): New function.
7767 (Input_file_argument::arg_serial_): New data member.
7768 (Input_arguments::Input_arguments): Initialize file_count_.
7769 (Input_arguments::add_file): Remove const.
7770 (Input_arguments::number_of_input_files): New function.
7771 (Input_arguments::file_count_): New data member.
7772 (Command_line::number_of_input_files): Call
7773 Input_arguments::number_of_input_files.
7774 * output.cc (Output_segment_headers::Output_segment_headers):
7775 Set current size.
7776 (Output_section::Input_section::current_data_size): New function.
7777 (Output_section::Output_section): Initialize new data members.
7778 (Output_section::add_input_section): Don't do merge sections for
7779 an incremental link; allocate space from free list for an
7780 incremental update.
7781 (Output_section::add_output_section_data): Allocate space from
7782 free list for an incremental update.
7783 (Output_section::update_data_size): New function.
7784 (Output_section::set_fixed_layout): New function.
7785 (Output_section::reserve): New function.
7786 (Output_segment::set_section_addresses): Remove const.
7787 (Output_segment::set_section_list_addresses): Remove const; allocate
7788 space from free list for an incremental update.
7789 (Output_segment::set_offset): Adjust size of RELRO segment for an
7790 incremental update.
7791 * output.h (Output_data::current_data_size): Move here from
7792 child classes.
7793 (Output_data::pre_finalize_data_size): New function.
7794 (Output_data::update_data_size): New function.
7795 (Output_section_headers::update_data_size): new function.
7796 (Output_section_data_build::current_data_size): Move to Output_data.
7797 (Output_data_strtab::update_data_size): New function.
7798 (Output_section::current_data_size): Move to Output_data.
7799 (Output_section::set_fixed_layout): New function.
7800 (Output_section::has_fixed_layout): New function.
7801 (Output_section::reserve): New function.
7802 (Output_section::update_data_size): New function.
7803 (Output_section::has_fixed_layout_): New data member.
7804 (Output_section::free_list_): New data member.
7805 (Output_segment::set_section_addresses): Remove const.
7806 (Output_segment::set_section_list_addresses): Remove const.
7807 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7808 New function.
7809 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7810 New function.
7811 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7812 parameter when calling Add_symbols constructor; store argument
7813 serial number for members of a lib group.
7814 (Add_symbols::locks): Allow case where token == NULL.
7815 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7816 (Read_member::~Read_member): New function.
7817 (Read_member::is_runnable): New function.
7818 (Read_member::locks): New function.
7819 (Read_member::run): New function.
7820 (Check_script::~Check_script): New function.
7821 (Check_script::is_runnable): New function.
7822 (Check_script::locks): New function.
7823 (Check_script::run): New function.
7824 (Check_library::~Check_library): New function.
7825 (Check_library::is_runnable): New function.
7826 (Check_library::locks): New function.
7827 (Check_library::run): New function.
7828 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7829 (Add_symbols::library_): New data member.
7830 (class Read_member): New class.
7831 (class Check_script): New class.
7832 (class Check_library): New class.
7833 * reloc.cc (Read_relocs::is_runnable): Allow case where
7834 token == NULL.
7835 (Read_relocs::locks): Likewise.
7836 (Scan_relocs::locks): Likewise.
7837 (Relocate_task::locks): Likewise.
7838 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7839 to clear counters.
7840 (Sized_relobj::incremental_relocs_scan): Fix comment.
7841 (Sized_relobj::do_relocate): Pass output file offset to
7842 write_local_symbols.
7843 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7844 from class declaration.
7845 * script.cc (read_input_script): Allocate Script_info; pass
7846 argument serial number to report_script.
7847 * script.h (class Script_info): Move to incremental.h.
7848 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7849 * symtab.h (Symbol_table::add_from_incrobj): New function.
7850 (Symbol_table::set_file_offset): New function.
7851
7852 2011-04-05 Cary Coutant <ccoutant@google.com>
7853
7854 * incremental-dump.cc (dump_incremental_inputs): Change signature
7855 to take a Sized_incremental_binary; change caller. Use readers
7856 in Sized_incremental_binary.
7857 * incremental.cc
7858 (Sized_incremental_binary::find_incremental_inputs_sections):
7859 Rename do_find_incremental_inputs_sections to this.
7860 (Sized_incremental_binary::setup_readers): New function.
7861 (Sized_incremental_binary::do_check_inputs): Check
7862 has_incremental_info_ flag; move setup code to setup_readers;
7863 use input readers.
7864 (Sized_incremental_binary::do_file_is_unchanged): New function.
7865 (Sized_incremental_binary::do_get_input_reader): New function.
7866 * incremental.h (class Incremental_binary): Move to end of file.
7867 (Incremental_binary::file_is_unchanged): New function.
7868 (Incremental_binary::do_file_is_unchanged): New function.
7869 (Incremental_binary::Input_reader): New class.
7870 (Incremental_binary::get_input_reader): New function.
7871 (class Sized_incremental_binary): Move to end of file.
7872 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7873 input section reader classes.
7874 (Sized_incremental_binary::has_incremental_info): New function.
7875 (Sized_incremental_binary::inputs_reader): New function.
7876 (Sized_incremental_binary::symtab_reader): New function.
7877 (Sized_incremental_binary::relocs_reader): New function.
7878 (Sized_incremental_binary::got_plt_reader): New function.
7879 (Sized_incremental_binary::do_file_is_unchanged): New function.
7880 (Sized_incremental_binary::Sized_input_reader): New class.
7881 (Sized_incremental_binary::get_input_reader): New function.
7882 (Sized_incremental_binary::find_incremental_inputs_sections):
7883 Rename do_find_incremental_inputs_sections to this.
7884 (Sized_incremental_binary::setup_readers): New function.
7885 (Sized_incremental_binary::has_incremental_info_): New data member.
7886 (Sized_incremental_binary::inputs_reader_): New data member.
7887 (Sized_incremental_binary::symtab_reader_): New data member.
7888 (Sized_incremental_binary::relocs_reader_): New data member.
7889 (Sized_incremental_binary::got_plt_reader_): New data member.
7890 (Sized_incremental_binary::current_input_file_): New data member.
7891
7892 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7893
7894 PR gold/12640
7895 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7896 violation.
7897
7898 2011-03-30 Cary Coutant <ccoutant@google.com>
7899
7900 * archive.cc (Archive::include_member): Adjust call to report_object.
7901 (Add_archive_symbols::run): Add script_info to call to
7902 report_archive_begin.
7903 (Lib_group::include_member): Adjust call to report_object.
7904 (Add_lib_group_symbols::run): Adjust call to report_object.
7905 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7906 blocks. Add object count for script input files.
7907 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7908 script_info parameter; change all callers.
7909 (Incremental_inputs::report_object): Add script_info parameter;
7910 change all callers.
7911 (Incremental_inputs::report_script): Store backpointer to
7912 incremental info entry.
7913 (Output_section_incremental_inputs::set_final_data_size): Record
7914 additional information for scripts.
7915 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7916 * incremental.h (Incremental_script_entry::add_object): New function.
7917 (Incremental_script_entry::get_object_count): New function.
7918 (Incremental_script_entry::get_object): New function.
7919 (Incremental_script_entry::objects_): New data member; adjust
7920 constructor.
7921 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7922 (Incremental_inputs::report_object): Add script_info parameter.
7923 (Incremental_inputs_reader::get_object_count): New function.
7924 (Incremental_inputs_reader::get_object_offset): New function.
7925 * options.cc (Input_arguments::add_file): Return reference to
7926 new input argument.
7927 * options.h (Input_argument::set_script_info): New function.
7928 (Input_argument::script_info): New function.
7929 (Input_argument::script_info_): New data member; adjust all
7930 constructors.
7931 (Input_file_group::add_file): Return reference to new input argument.
7932 (Input_file_lib::add_file): Likewise.
7933 (Input_arguments::add_file): Likewise.
7934 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7935 * script.cc (Parser_closure::Parser_closure): Add script_info
7936 parameter; adjust all callers.
7937 (Parser_closure::script_info): New function.
7938 (Parser_closure::script_info_): New data member.
7939 (read_input_script): Report scripts earlier to incremental info.
7940 (script_add_file): Set script_info in Input_argument.
7941 (script_add_library): Likewise.
7942 * script.h (Script_options::Script_info): Rewrite class.
7943
7944 2011-03-29 Cary Coutant <ccoutant@google.com>
7945
7946 * archive.cc (Library_base::should_include_member): Move
7947 method here from class Archive.
7948 (Archive::Archive): Initialize base class.
7949 (Archive::should_include_member): Move to base class.
7950 (Archive::do_for_all_unused_symbols): New function.
7951 (Add_archive_symbols::run): Remove redundant access to
7952 incremental_inputs.
7953 (Lib_group::Lib_group): Initialize base class.
7954 (Lib_group::do_filename): New function.
7955 (Lib_group::include_member): Pass pointer to Lib_group to
7956 report_object.
7957 (Lib_group::do_for_all_unused_symbols): New function.
7958 (Add_lib_group_symbols::run): Report archive information for
7959 incremental links.
7960 * archive.h (class Library_base): New base class.
7961 (class Archive): Derive from Library_base.
7962 (Archive::filename): Move to base class.
7963 (Archive::set_incremental_info): Likewise.
7964 (Archive::incremental_info): Likewise.
7965 (Archive::Should_include): Likewise.
7966 (Archive::should_include_member): Likewise.
7967 (Archive::Armap_entry): Remove.
7968 (Archive::Unused_symbol_iterator): Remove.
7969 (Archive::unused_symbols_begin): Remove.
7970 (Archive::unused_symbols_end): Remove.
7971 (Archive::do_filename): New function.
7972 (Archive::do_get_mtime): New function.
7973 (Archive::do_for_all_unused_symbols): New function.
7974 (Archive::task_): Move to base class.
7975 (Archive::incremental_info_): Likewise.
7976 (class Lib_group): Derive from Library_base.
7977 (Lib_group::do_filename): New function.
7978 (Lib_group::do_get_mtime): New function.
7979 (Lib_group::do_for_all_unused_symbols): New function.
7980 (Lib_group::task_): Move to base class.
7981 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7982 function.
7983 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7984 function.
7985 * incremental.cc (Incremental_inputs::report_archive_begin):
7986 Use Library_base; call library's get_mtime; add incremental inputs
7987 entry before members.
7988 (class Unused_symbol_visitor): New class.
7989 (Incremental_inputs::report_archive_end): Use Library_base; use
7990 visitor class to record unused symbols; don't add incremental inputs
7991 entry after members.
7992 (Incremental_inputs::report_object): Use Library_base.
7993 * incremental.h
7994 (Incremental_archive_entry::Incremental_archive_entry): Remove
7995 unused Archive parameter.
7996 (Incremental_inputs::report_archive_begin): Use Library_base.
7997 (Incremental_inputs::report_archive_end): Likewise.
7998 (Incremental_inputs::report_object): Likewise.
7999 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8000 function.
8001 * object.h (Object::for_all_global_symbols): New function.
8002 (Object::do_for_all_global_symbols): New function.
8003 (Sized_relobj::do_for_all_global_symbols): New function.
8004 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8005 function.
8006 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8007 function.
8008
8009 2011-03-27 Ian Lance Taylor <iant@google.com>
8010
8011 * archive.cc (Archive::interpret_header): Return -1 if something
8012 goes wrong. Change callers accordingly.
8013
8014 2011-03-25 Cary Coutant <ccoutant@google.com>
8015
8016 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8017 * testsuite/Makefile.in: Regenerate.
8018
8019 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8020
8021 * plugin.cc (get_view): New.
8022 (Plugin::load): Pass get_view to the plugin.
8023 (Plugin_manager::get_view): New.
8024
8025 2011-03-21 Ian Lance Taylor <iant@google.com>
8026
8027 * testsuite/final_layout.sh: Rewrite to not use dc.
8028 * testsuite/relro_test.sh: Fail if dc is not present.
8029
8030 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8031
8032 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8033 Change == to -eq.
8034 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8035 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8036 Change == to -eq.
8037 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8038 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8039
8040 2011-03-14 Ian Lance Taylor <iant@google.com>
8041
8042 * script-sections.cc (Sort_output_sections::script_compare):
8043 Rename from is_before, change return type.
8044 (Sort_output_sections::operator()): Adjust accordingly.
8045
8046 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8047
8048 PR gold/12572
8049 * testsuite/odr_violation2.cc: Add comment to make all error line
8050 numbers double digits.
8051 * testsuite/debug_msg.sh: Adjust expected errors.
8052
8053 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8054
8055 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8056 but mark earlier ones as non-canonical
8057 (offset_to_iterator): Update search target and example
8058 (do_addr2line): Return extra lines in a vector*
8059 (format_file_lineno): Extract from do_addr2line
8060 (one_addr2line): Add vector* out-param
8061 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8062 when a lineno entry appeared last for its instruction
8063 (Dwarf_line_info): Add vector* out-param
8064 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8065 * symtab.cc (Odr_violation_compare): Include the lineno in the
8066 comparison again.
8067 (linenos_from_loc): New. Combine the canonical line for an
8068 address with its other lines.
8069 (True_if_intersect): New. Helper functor to make
8070 std::set_intersection a query.
8071 (detect_odr_violations): Compare sets of lines instead of just
8072 one line for each function. This became less deterministic, but
8073 has fewer false positives.
8074 * symtab.h: Declarations.
8075 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8076 mix an optimized and non-optimized object in the same binary
8077 (odr_violation2.so): Same.
8078 * testsuite/Makefile.in: Regenerate from Makefile.am.
8079 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8080 * testsuite/debug_msg.sh: Update line numbers and add
8081 assertions.
8082 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8083 non-optimized context.
8084 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8085 isn't inlined, and use OdrDerived in an optimized context.
8086 * testsuite/odr_header1.h: Defines OdrDerived, where
8087 optimization will change the
8088 first-instruction-in-the-destructor's file and line number.
8089 * testsuite/odr_header2.h: Defines OdrBase.
8090
8091 2011-03-09 Ian Lance Taylor <iant@google.com>
8092
8093 * fileread.cc (File_read::clear_views): Don't delete the whole
8094 file view.
8095
8096 2011-03-08 Ian Lance Taylor <iant@google.com>
8097
8098 PR gold/12525
8099 * fileread.cc: #include <climits>.
8100 (GOLD_IOV_MAX): Define.
8101 (File_read::read_multiple): Limit number of entries by iov_max.
8102 * fileread.h (class File_read): Always set max_readv_entries to
8103 128.
8104
8105 2011-03-07 Ian Lance Taylor <iant@google.com>
8106
8107 PR gold/12525
8108 * options.h (class General_options): Add -dy and -dn.
8109
8110 2011-03-02 Cary Coutant <ccoutant@google.com>
8111
8112 * testsuite/script_test_9.t: Add TLS segment.
8113
8114 2011-03-02 Simon Baldwin <simonb@google.com>
8115
8116 * configure.ac: Add check for gnu_indirect_function support in
8117 the toolchain building binutils.
8118 * configure: Rebuild.
8119
8120 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8121
8122 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8123 plugin only symbols.
8124 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8125 in plugin files as not needed in the symbol table.
8126
8127 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8128
8129 * output.cc (Output_section::add_input_section): Delay fill
8130 generation for section ordering.
8131
8132 2011-02-09 Ian Lance Taylor <iant@google.com>
8133
8134 PR gold/12316
8135 * object.h (class Sized_relobj): Remove clear_local_symbols.
8136 * reloc.cc (Sized_relobj::do_relocate): Don't call
8137 clear_local_symbols.
8138
8139 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8140
8141 * plugin.cc (is_visible_from_outside): Return true for symbols
8142 in the -u option.
8143
8144 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8145
8146 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8147 filename.
8148
8149 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8150
8151 * icf.h (is_section_foldable_candidate): Change type of parameter
8152 to std::string.
8153 * icf.cc (Icf::find_identical_sections): Change type of local variable
8154 section_name to be std::string.
8155 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8156
8157 2011-01-25 Ian Lance Taylor <iant@google.com>
8158
8159 * script.cc (script_add_extern): Rewrite to use
8160 add_symbol_reference.
8161
8162 2011-01-25 Doug Kwan <dougkwan@google.com>
8163
8164 * icf.cc (get_section_contents): Always lock section's object.
8165
8166 2011-01-24 Ian Lance Taylor <iant@google.com>
8167
8168 * options.h (class General_options): Accept
8169 --no-detect-odr-violations.
8170
8171 2011-01-24 Ian Lance Taylor <iant@google.com>
8172
8173 * version.cc (version_string): Bump to 1.11.
8174
8175 2011-01-24 Ian Lance Taylor <iant@google.com>
8176
8177 * plugin.cc (class Plugin_rescan): Define new class.
8178 (Plugin_manager::claim_file): Set any_claimed_.
8179 (Plugin_manager::save_archive): New function.
8180 (Plugin_manager::save_input_group): New function.
8181 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8182 necessary.
8183 (Plugin_manager::new_undefined_symbol): New function.
8184 (Plugin_manager::rescan): New function.
8185 (Plugin_manager::rescannable_defines): New function.
8186 (Plugin_manager::add_input_file): Set any_added_.
8187 * plugin.h (class Plugin_manager): define new fields rescannable_,
8188 undefined_symbols_, any_claimed_, and any_added_. Declare
8189 Plugin_rescan as friend. Declare new functions.
8190 (Plugin_manager::Rescannable): Define type.
8191 (Plugin_manager::Rescannable_list): Define type.
8192 (Plugin_manager::Undefined_symbol_list): Define type.
8193 (Plugin_manager::Plugin_manager): Initialize new fields.
8194 * archive.cc (Archive::defines_symbol): New function.
8195 (Add_archive_symbols::run): Pass archive to plugins if any.
8196 * archive.h (class Archive): Declare defines_symbol.
8197 * readsyms.cc (Input_group::~Input_group): New function.
8198 (Finish_group::run): Pass input_group to plugins if any.
8199 * readsyms.h (class Input_group): Declare destructor.
8200 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8201 any.
8202
8203 2011-01-10 Ian Lance Taylor <iant@google.com>
8204
8205 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8206 section as relro.
8207 (Layout::set_segment_offsets): Reset increase_relro before calling
8208 set_section_addresses a second time.
8209
8210 2011-01-04 Cary Coutant <ccoutant@google.com>
8211
8212 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8213 sections before NOBITS sections.
8214
8215 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8216
8217 * version.cc (print_version): Update copyright to 2011.
8218
8219 2010-12-23 Cary Coutant <ccoutant@google.com>
8220
8221 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8222 of OS to this->add. Add OD parameter to second form of the function.
8223
8224 2010-12-20 Ian Lance Taylor <iant@google.com>
8225
8226 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8227 second of two consecutive entries with same offset.
8228
8229 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8230
8231 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8232 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8233 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8234 to avoid unneeded links against $(LDADD).
8235 * testsuite/Makefile.in: Regenerate.
8236
8237 2010-12-15 Ian Lance Taylor <iant@google.com>
8238
8239 PR gold/12324
8240 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8241 for R_X86_64_32 and R_X86_64_PC32.
8242 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8243 ver_matching_def_pic.o.
8244 (ver_matching_def_pic.o): New target.
8245
8246 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8247
8248 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8249 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8250 Move definition before File_read::View member definitions.
8251 (File_read::View::~View): Initialize and hold lock before
8252 updating current_mapped_bytes.
8253
8254 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8255
8256 * dwarf_reader.cc: Remove outdated comment.
8257 * gold-threads.cc: Fix typo in error message.
8258 * archive.cc: Fix typos in comments.
8259 * archive.h: Likewise.
8260 * arm-reloc-property.cc: Likewise.
8261 * arm-reloc-property.h: Likewise.
8262 * arm-reloc.def: Likewise.
8263 * arm.cc: Likewise.
8264 * attributes.h: Likewise.
8265 * cref.cc: Likewise.
8266 * ehframe.cc: Likewise.
8267 * fileread.h: Likewise.
8268 * gold.h: Likewise.
8269 * i386.cc: Likewise.
8270 * icf.cc: Likewise.
8271 * incremental.h: Likewise.
8272 * int_encoding.cc: Likewise.
8273 * layout.h: Likewise.
8274 * main.cc: Likewise.
8275 * merge.h: Likewise.
8276 * object.cc: Likewise.
8277 * object.h: Likewise.
8278 * options.cc: Likewise.
8279 * readsyms.cc: Likewise.
8280 * reduced_debug_output.cc: Likewise.
8281 * reloc.cc: Likewise.
8282 * script-sections.cc: Likewise.
8283 * sparc.cc: Likewise.
8284 * symtab.h: Likewise.
8285 * target-reloc.h: Likewise.
8286 * target.cc: Likewise.
8287 * target.h: Likewise.
8288 * timer.cc: Likewise.
8289 * timer.h: Likewise.
8290 * x86_64.cc: Likewise.
8291
8292 2010-12-09 Cary Coutant <ccoutant@google.com>
8293
8294 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8295 stack.
8296 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8297 parameter; change all callers.
8298 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8299 * options.h (warn_execstack): New option.
8300
8301 2010-12-07 Doug Kwan <dougkwan@google.com>
8302
8303 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8304 like function call relocations.
8305
8306 2010-12-07 Ian Lance Taylor <iant@google.com>
8307
8308 * archive.cc (Archive::get_elf_object_for_member): Permit
8309 punconfigured to be NULL.
8310 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8311 (Archive::include_member): Pass NULL to get_elf_object_for_member
8312 if we searched for the archive and this is the first included
8313 object.
8314
8315 2010-12-01 Ian Lance Taylor <iant@google.com>
8316
8317 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8318 track_relocs_type_ field.
8319 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8320 Set track_relocs_type_.
8321 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8322 contents when using RELA relocs.
8323 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8324 reloc_map_.
8325 * reloc.cc (Track_relocs::next_addend): New function.
8326 * reloc.h (class Track_relocs): Declare next_addend.
8327
8328 2010-12-01 Ian Lance Taylor <iant@google.com>
8329
8330 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8331 virtual destructor.
8332
8333 2010-12-01 Ian Lance Taylor <iant@google.com>
8334
8335 * README: Update compilers known to work and fail.
8336
8337 2010-11-23 Matthias Klose <doko@ubuntu.com>
8338
8339 * configure.in: For --enable-gold, handle value `default' instead of
8340 `both*'. Always install ld as ld.bfd, install as ld if gold is
8341 not the default.
8342 * configure: Regenerate.
8343
8344 2010-11-18 Doug Kwan <dougkwan@google.com>
8345
8346 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8347 and right_alignment to be zero. Store result alignment only if it is
8348 greater than existing alignment.
8349
8350 2010-11-16 Cary Coutant <ccoutant@google.com>
8351
8352 PR gold/12220
8353 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8354 Check for ".zdebug_line".
8355
8356 2010-11-16 Doug Kwan <dougkwan@google.com>
8357 Cary Coutant <ccoutant@google.com>
8358
8359 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8360 by reference; adjust all callers.
8361 * output.cc (Output_segment::set_section_addresses): Adjust references
8362 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8363 list is empty.
8364 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8365 end at page boundary.
8366
8367 2010-11-16 Cary Coutant <ccoutant@google.com>
8368
8369 PR gold/12220
8370 * layout.cc (Layout::choose_output_section): Transform names of
8371 compressed sections even when using a script with a SECTIONS clause.
8372 (Layout::output_section_name): Remove code to transform
8373 compressed debug section names.
8374 * output.cc (Output_section::add_input_section): Use uncompressed
8375 section size when tracking input sections.
8376
8377 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8378
8379 * symtab.h (Symbol::NON_PIC_REF): Remove.
8380 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8381 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8382 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8383 (Symbol::use_plt_offset): Take a flags argument and pass it
8384 directly to needs_dynamic_reloc. Restrict check for undefined
8385 weak symbols to function calls.
8386 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8387 (Target_arm::Scan::global): Use it.
8388 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8389 (Target_arm::Relocate::relocate): Likewise.
8390 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8391 parameter with an r_type parameter. Use get_reference_flags
8392 to get the flags.
8393 (Target_arm::Relocate::relocate): Update accordingly.
8394 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8395 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8396 (Target_i386::Scan::global): Likewise.
8397 (Target_i386::Relocate::relocate): Likewise.
8398 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8399 parameter with an r_type parameter. Use get_reference_flags
8400 to get the flags.
8401 (Target_i386::Relocate::relocate): Update accordingly.
8402 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8403 (Target_powerpc::Scan::global): Use it.
8404 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8405 (Target_powerpc::Relocate::relocate): Likewise.
8406 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8407 (Target_sparc::Scan::global): Use it.
8408 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8409 (Target_sparc::Relocate::relocate): Likewise.
8410 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8411 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8412 (Target_x86_64::Scan::global): Likewise.
8413 (Target_x86_64::Relocate::relocate): Likewise.
8414
8415 2010-11-08 Doug Kwan <dougkwan@google.com>
8416 Cary Coutant <ccoutant@google.com>
8417
8418 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8419 (Arm_exidx_merge_section::section_contents_): New data member.
8420 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8421 (Arm_input_section::~Arm_input_section): De-allocate memory.
8422 (Arm_input_section::original_contents_): New data member.
8423 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8424 in parameters instead of calling Object::section_contents without
8425 locking.
8426 (Arm_output_section::group_section): New parameter TASK. Pass it
8427 to callees that need locking objects.
8428 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8429 to lock EXIDX input sections. Fix a formatting issue. Call
8430 Arm_exidx_merged_section::build_contents to create merged section
8431 contents.
8432 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8433 to lock object of stub table owner.
8434 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8435 TEXT_SIZE to initialize data member TEXT_SIZE_.
8436 (Arm_exidx_input_section::addralign): Fix typo in comment.
8437 (Arm_exidx_input_section::text_size): New method.
8438 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8439 that require locking objects. Lock objects before scanning for stubs
8440 and updating local symbols.
8441 (Arm_input_section<big_endian>::init): Copy contents of original
8442 input section.
8443 (Arm_input_section<big_endian>::do_write): Use saved contents of
8444 original input section instead of calling Object::section_contents
8445 without locking.
8446 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8447 size without calling Object::section_size().
8448 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8449 for size. Allocate a buffer for merged EXIDX entries.
8450 (Arm_exidx_merged_section::build_contents): New method.
8451 (Arm_exidx_merged_section::do_write): Move merge section contents
8452 building code to Arm_exidx_merged_section::build_contetns. Write
8453 out contetns in buffer instead of building it on the fly.
8454 (Arm_relobj::make_exidx_input_section): Also pass text section size
8455 to Arm_exidx_input_section constructor.
8456 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8457 (Arm_dynobj::do_read_symbols): Fix memory leak.
8458 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8459 * target.h: (class Task): Add forward declaration.
8460 (Target::relax): Add new parameter TASK and pass it to
8461 Target::do_relax().
8462 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8463
8464 2010-11-05 Cary Coutant <ccoutant@google.com>
8465
8466 PR gold/10708
8467 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8468 object when reading from the file.
8469 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8470 second layout pass.
8471 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8472 when reading section contents.
8473 (get_section_contents): Likewise.
8474 (icf::find_identical_sections): Likewise.
8475 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8476 object when reading from the file.
8477 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8478 the object when doing deferred section layout.
8479
8480 2010-11-03 Nick Clifton <nickc@redhat.com>
8481
8482 PR gold/12001
8483 * script.h (class Symbol_assignment: name): New member. Returns
8484 the name of the symbol.
8485 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8486 Returns true if the given symbol name is on the list of
8487 assignments wating to be processed.
8488 * archive.cc (should_incldue_member): If the symbol is undefined,
8489 check to see if it is on the list of symbols pending assignment.
8490
8491 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8492
8493 * script-sections.cc (Script_sections::find_memory_region): Check
8494 for a NULL output section pointer.
8495
8496 2010-10-29 Doug Kwan <dougkwan@google.com>
8497
8498 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8499 Output_section::add_relaxed_input_section.
8500 * output.cc (Output_section::add_relaxed_input_section): Add new
8501 arguments LAYOUT and NAME. Set section order index.
8502 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8503 Copy section order index.
8504 * output.h (Output_section::add_relaxed_input_section): Add new
8505 arguments LAYOUT and NAME.
8506
8507 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8508
8509 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8510 NATIVE_OR_CROSS_LINKER.
8511 * testsuite/Makefile.in: Regenerate.
8512
8513 2010-10-20 Doug Kwan <dougkwan@google.com>
8514
8515 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8516 without SHF_LINK_ORDER flags.
8517 * layout.cc (Layout::choose_output_section): Do not filter
8518 SHF_LINK_ORDER flag in a relocatable link.
8519
8520 2010-10-17 Cary Coutant <ccoutant@google.com>
8521
8522 * output.h (Output_segment::set_section_addresses): Change function
8523 signature. Update all callers.
8524 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8525 sections.
8526 (Output_segment::set_section_addresses): Align after last TLS
8527 section. Add padding before last relro section instead of after.
8528
8529 2010-10-17 Doug Kwan <dougkwan@google.com>
8530
8531 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8532 GOT output section to be writable.
8533
8534 2010-10-14 Cary Coutant <ccoutant@google.com>
8535
8536 * debug.h (DEBUG_INCREMENTAL): New flag.
8537 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8538 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8539 mode.
8540 * incremental.cc (report_command_line): Ignore all forms of
8541 --incremental.
8542 * layout.cc (Layout::Layout): Check parameters for incremental link
8543 mode.
8544 * options.cc (General_options::parse_incremental): New function.
8545 (General_options::parse_no_incremental): New function.
8546 (General_options::parse_incremental_full): New function.
8547 (General_options::parse_incremental_update): New function.
8548 (General_options::incremental_mode_): New data member.
8549 (General_options::finalize): Check incremental_mode_.
8550 * options.h (General_options): Update help text for --incremental.
8551 Add --no-incremental, --incremental-full, --incremental-update.
8552 (General_options::Incremental_mode): New enum type.
8553 (General_options::incremental_mode): New function.
8554 (General_options::incremental_mode_): New data member.
8555 * parameters.cc (Parameters::incremental_mode_): New data member.
8556 (Parameters::set_options): Set incremental_mode_.
8557 (Parameters::set_incremental_full): New function.
8558 (Parameters::incremental): New function.
8559 (Parameters::incremental_update): New function.
8560 (set_parameters_incremental_full): New function.
8561 * parameters.h (Parameters::set_incremental_full): New function.
8562 (Parameters::incremental): New function.
8563 (Parameters::incremental_update): New function.
8564 (Parameters::incremental_mode_): New data member.
8565 (set_parameters_incremental_full): New function.
8566 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8567 incremental link mode.
8568 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8569 (Sized_relobj::do_relocate_sections): Likewise.
8570 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8571 option.
8572 * testsuite/Makefile.in: Regenerate.
8573 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8574
8575 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8576
8577 * script-sections.h (class Script_sections): Make
8578 Sections_elements typedef public.
8579 * script-sections.cc (class Sort_output_sections): Add elements_
8580 field. Add constructor which sets it; change all callers.
8581 (Sort_output_sections::is_before): New function.
8582 (Sort_output_sections::operator()): Call is_before.
8583 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8584 conditional.
8585 * testsuite/script_test_10.sh: New test. Test script section
8586 order.
8587 * testsuite/script_test_10.t: Likewise.
8588 * testsuite/script_test_10.s: Likewise.
8589 * testsuite/Makefile.am: Wrap the cross linker tests and the
8590 common tests into NATIVE_OR_CROSS_LINKER.
8591 (check_SCRIPTS): Add script_test_10.sh.
8592 (check_DATA): Add script_test_10.stdout.
8593 (script_test_10.o, script_test_10): New targets.
8594 (script_test_10.stdout): New target.
8595 * configure, testsuite/Makefile.in: Regenerate.
8596
8597 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8598
8599 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8600 error for the deprecated relocations.
8601 (Target_arm::Scan::global): Likewise.
8602 (Target_arm::Relocate::relocate): Likewise.
8603
8604 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8605
8606 * fileread.cc (Input_file::find_file): Initialize *found_name
8607 and *namep when using the fallback search for case 4.
8608
8609 2010-10-11 Cary Coutant <ccoutant@google.com>
8610
8611 * options.h (class General_options): Redefine -z lazy as an alias for
8612 the negation of -z now.
8613
8614 2010-10-11 Ian Lance Taylor <iant@google.com>
8615
8616 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8617 binding.
8618
8619 2010-10-06 Nick Clifton <nickc@redhat.com>
8620
8621 * script-sections.cc(class Memory_region): Remove
8622 current_lma_offset_ field. Rename current_vma_offset_ to
8623 current_offset_. Add last_section_ field.
8624 (Memory_region::get_current_vma_address): Rename to
8625 get_current_address.
8626 (Memory_region::get_current_lma_address): Delete.
8627 (Memory_region::increment_vma_offset): Rename to
8628 increment_offset.
8629 (Memory_region::increment_lma_offset): Delete.
8630 (Memory_region::attributes_compatible): New method. Returns
8631 true if the provided section is compatible with the region.
8632 (Memory_region::get_last_section): New method. Returns the last
8633 section to use the region.
8634 (Memory_region::set_last_section): New method. Stores the last
8635 section to use the region.
8636 (Script_sections::block_in_region): New method. Returns true if
8637 a block of memory is contained within a region.
8638 (Script_sections::find_memory_region): New method. Locates a
8639 memory region to be used to set a VMA or LMA address.
8640 (Output_section_definition::set_section_addresses): Add code to
8641 check for addresses set by memory regions.
8642 (Output_segment::set_section_addresses): Remove memory region
8643 walking code.
8644 (Script_sections::create_segment): Add a warning if a header
8645 segment is created outside of any region.
8646 * script-sections.h (class Script_sections): Add prototypes for
8647 find_memory_region and block_in_region methods.
8648 * testsuite/memory_test.s: Use .long instead of .word.
8649 * testsuite/memory_test.t: Add some more output sections.
8650 * testsuite/memory_test.sh: Update expected output.
8651
8652 2010-10-02 Doug Kwan <dougkwan@google.com>
8653
8654 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8655 defintion to symtab.h
8656 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8657 declaration to defintion.
8658
8659 2010-10-01 Nick Clifton <nickc@redhat.com>
8660
8661 * expression.cc (eval): Replace dummy argument with NULL.
8662 (eval_maybe_dot): Check for a NULL result section pointer.
8663 (Symbol_expression::value): Likewise.
8664 (Dot_expression::value): Likewise.
8665 (BINARY_EXPRESSION): Likewise.
8666 (Max_expression::value): Likewise.
8667 (Min_expression::value): Likewise.
8668 (Absolute_expression::value): Likewise.
8669 (Addr_expression::value_from_output_section): Likewise.
8670 (Loaddddr_expression::value_from_output_section): Likewise.
8671 (Segment_start_expression::value): Likewise.
8672 * script-sections.cc
8673 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8674 argument with NULL.
8675 (Sections_elememt_dot_assignment::set_section_addresses):
8676 Likewise.
8677 (Output_data_expression::do_write_to_buffer): Likewise.
8678 (Output_section_definition::finalize_symbols): Likewise.
8679 (Output_section_definition::set_section_addresses): Likewise.
8680
8681 2010-09-30 Doug Kwan <dougkwan@google.com>
8682
8683 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8684
8685 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8686
8687 * target.h (Target::can_icf_inline_merge_sections): New virtual
8688 function.
8689 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8690 virtual function.
8691 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8692 virtual function.
8693 * icf.cc (get_section_contents): Inline merge sections only when
8694 target allows it.
8695
8696 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8697
8698 * configure: Regenerate.
8699
8700 2010-09-17 Ian Lance Taylor <iant@google.com>
8701
8702 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8703 * testsuite/Makefile.am (memory_test.o): New target.
8704 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8705 memory_test.t.
8706 * testsuite/Makefile.in: Rebuild.
8707
8708 2010-09-17 Doug Kwan <dougkwan@google.com>
8709
8710 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8711 defintion if relocation uses GOT entries of the symbol.
8712 * testsuite/icf_safe_test.sh: Fix test.
8713 * testsuite/icf_safe_so_test.sh: Fix test.
8714
8715 2010-09-16 Cary Coutant <ccoutant@google.com>
8716
8717 * script_sections.cc (class Memory_region): Remove "NULL" from
8718 vector initializations.
8719
8720 2010-09-15 Cary Coutant <ccoutant@google.com>
8721
8722 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8723 Resolve forwarding symbols.
8724
8725 2010-09-15 Doug Kwan <dougkwan@google.com>
8726
8727 * gold/testsuite/script_test_3.t: Add ARM special sections.
8728 * gold/testsuite/script_test_4.t: Same.
8729 * gold/testsuite/script_test_5.t: Same.
8730 * gold/testsuite/script_test_6.t: Same.
8731 * gold/testsuite/script_test_7.t: Same.
8732 * gold/testsuite/script_test_7.t: Same.
8733 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8734
8735 2010-09-14 Cary Coutant <ccoutant@google.com>
8736
8737 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8738 (Target_x86_64::Relocate::relocate_tls): Replace check for
8739 saw_tls_block_reloc_ with test for executable section.
8740
8741 2010-09-12 Cary Coutant <ccoutant@google.com>
8742
8743 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8744 position-independent executables to shared libraries need dynamic
8745 relocations.
8746 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8747 position-independent executables.
8748 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8749 * testsuite/Makefile.in: Regenerate.
8750
8751 2010-09-10 Nick Clifton <nickc@redhat.com>
8752
8753 PR gold/11997
8754 * testsuite/memory_test.t: Discard any sections that are not
8755 needed.
8756
8757 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8758
8759 PR gold/11996
8760 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8761 "This::" to work around a bug in gcc 4.2.
8762
8763 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8764
8765 2010-09-09 Rafael Espindola <espindola@google.com>
8766
8767 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8768 sections with different PF_X flags in the same segment.
8769 (Layout::find_first_load_seg): Search all segments to find the first
8770 one.
8771 * options.h (rosegment): New.
8772
8773 2010-09-08 Rafael Espindola <espindola@google.com>
8774
8775 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8776
8777 2010-09-08 Doug Kwan <dougkwan@google.com>
8778
8779 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8780 (Arm_relobj::do_relocate_sections): Add new parameter for output
8781 file to match the parent.
8782 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8783 of local symbols instead of input values. Update code to track
8784 changes in gold::relocate_section.
8785 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8786 (Sized_relobj::compute_final_local_value_internal): New methods.
8787 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8788 body into private version of Sized_relobj::compute_final_local_value.
8789 Call the inline method.
8790 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8791 merged symbol value if there is one.
8792 (Symbol_value::has_output_value): New method defintiion.
8793 (Sized_relobj::Compute_final_local_value_status): New enum type.
8794 (Sized_relobj::compute_final_local_value): New methods.
8795 (Sized_relobj::compute_final_local_value_internal): New methods.
8796 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8797 and arm_cortex_a8.sh.
8798 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8799 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8800 New tests.
8801 * Makefile.in: Regenerate.
8802 * testsuite/arm_bl_out_of_range.s: Update test.
8803 * testsuite/thumb_bl_out_of_range.s: Ditto.
8804 * testsuite/thumb_blx_out_of_range.s: Ditto.
8805 * testsuite/arm_branch_out_of_range.sh: New file.
8806 * testsuite/arm_cortex_a8.sh: Ditto.
8807 * testsuite/arm_cortex_a8_b.s: Ditto.
8808 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8809 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8810 * testsuite/arm_cortex_a8_bl.s: Ditto.
8811 * testsuite/arm_cortex_a8_blx.s: Ditto.
8812 * testsuite/arm_cortex_a8_local.s: Ditto.
8813 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8814 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8815
8816 2010-09-08 Rafael Espindola <espindola@google.com>
8817
8818 * Makefile.am (memory_test.stdout): Run readelf with -W.
8819 * Makefile.in: Regenerate.
8820 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8821 64 bit output.
8822
8823 2010-09-08 Rafael Espindola <espindola@google.com>
8824
8825 * script-sections.cc (Script_sections::add_memory_region): Convert
8826 field precision to int.
8827 * script.cc (script_set_section_region, script_set_section_region):
8828 Convert field precision to int.
8829
8830 2010-09-08 Rafael Espindola <espindola@google.com>
8831
8832 * arm.cc (do_finalize_sections): Create the __exidx_start and
8833 __exdix_end symbols even when the section is missing.
8834
8835 2010-09-08 Nick Clifton <nickc@redhat.com>
8836
8837 * README: Remove claim that MEMORY is not supported.
8838 * expression.cc (script_exp_function_origin)
8839 (script_exp_function_length): Move from here to ...
8840 * script.cc: ... here.
8841 (script_set_section_region, script_add_memory)
8842 (script_parse_memory_attr, script_include_directive): New
8843 functions.
8844 * script-sections.cc
8845 (class Memory_region): New class.
8846 (class Output_section_definition): Add set_memory_region,
8847 set_section_vma, set_section_lma and get_section_name methods.
8848 (class Script_Sections): Add add_memory_region,
8849 find_memory_region, find_memory_region_origin,
8850 find_memory_region_length and set_memory_region methods.
8851 Have set_section_addresses method walk the list of set memory
8852 regions.
8853 Extend the print methos to display memory regions.
8854 * script-sections.h: Add prototypes for new methods.
8855 Add enum for MEMORY region attributes.
8856 * yyscript.y: Add support for parsing MEMORY regions.
8857 * script-c.h: Add prototypes for new functions.
8858 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8859 * testsuite/Makefile.in: Regenerate.
8860 * testsuite/memory_test.sh: New script.
8861 * testsuite/memory_test.s: New assembler source file.
8862 * testsuite/memory_test.t: New linker script.
8863
8864 2010-08-27 Doug Kwan <dougkwan@google.com>
8865
8866 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8867 reference override an existing dynamic weak reference.
8868 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8869 * testsuite/Makefile.in: Regenerate.
8870 * testsuite/dyn_weak_ref.sh: New file.
8871 * testsuite/dyn_weak_ref_1.c: Ditto.
8872 * testsuite/dyn_weak_ref_2.c: Ditto.
8873
8874 2010-08-27 Ian Lance Taylor <iant@google.com>
8875
8876 * incremental.h (class Incremental_input_entry): Add virtual
8877 destructor.
8878
8879 2010-08-27 Ian Lance Taylor <iant@google.com>
8880
8881 * testsuite/start_lib_test_3.c: Mark t3 as used.
8882
8883 2010-08-27 Nick Clifton <nickc@redhat.com>
8884
8885 * options.cc (version_script): Fix small typo in previous
8886 whitespace tidyup.
8887
8888 2010-08-25 Nick Clifton <nickc@redhat.com>
8889
8890 * archive.cc: Formatting fixes: Remove whitespace between
8891 typename and following asterisk. Remove whitespace between
8892 function name and opening parenthesis.
8893 * archive.h: Likewise.
8894 * arm.cc: Likewise.
8895 * attributes.cc: Likewise.
8896 * attributes.h: Likewise.
8897 * common.cc: Likewise.
8898 * copy-relocs.cc: Likewise.
8899 * dirsearch.h: Likewise.
8900 * dynobj.cc: Likewise.
8901 * ehframe.cc: Likewise.
8902 * ehframe.h: Likewise.
8903 * expression.cc: Likewise.
8904 * fileread.cc: Likewise.
8905 * fileread.h: Likewise.
8906 * gc.h: Likewise.
8907 * gold-threads.cc: Likewise.
8908 * gold.cc: Likewise.
8909 * i386.cc: Likewise.
8910 * icf.h: Likewise.
8911 * incremental-dump.cc: Likewise.
8912 * incremental.cc: Likewise.
8913 * layout.cc: Likewise.
8914 * layout.h: Likewise.
8915 * main.cc: Likewise.
8916 * merge.cc: Likewise.
8917 * merge.h: Likewise.
8918 * object.cc: Likewise.
8919 * object.h: Likewise.
8920 * options.cc: Likewise.
8921 * options.h: Likewise.
8922 * output.cc: Likewise.
8923 * output.h: Likewise.
8924 * plugin.cc: Likewise.
8925 * plugin.h: Likewise.
8926 * powerpc.cc: Likewise.
8927 * reloc.cc: Likewise.
8928 * script-c.h: Likewise.
8929 * script-sections.cc: Likewise.
8930 * script.cc: Likewise.
8931 * stringpool.cc: Likewise.
8932 * symtab.cc: Likewise.
8933 * symtab.h: Likewise.
8934 * target.cc: Likewise.
8935 * timer.cc: Likewise.
8936 * timer.h: Likewise.
8937 * version.cc: Likewise.
8938 * x86_64.cc: Likewise.
8939
8940 2010-08-24 Nick Clifton <nickc@redhat.com>
8941
8942 PR 11899
8943 * layout.cc (segment_precedes): Sort segments by their physical
8944 addresses, if they have been set.
8945
8946 2010-08-23 Cary Coutant <ccoutant@google.com>
8947
8948 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8949 symbols data.
8950 (Lib_group::include_member): Unlock object after deleting its
8951 symbols data.
8952 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8953 the bug fixed here.
8954
8955 2010-08-19 Neil Vachharajani <nvachhar@google.com>
8956 Cary Coutant <ccoutant@google.com>
8957
8958 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8959 constructor, and set_blocker.
8960 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8961 readsyms_blocker_.
8962 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8963 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8964 * testsuite/Makefile.am (start_lib_test): New test case.
8965 * testsuite/Makefile.in: Regenerate.
8966 * testsuite/start_lib_test_main.c: New file.
8967 * testsuite/start_lib_test_1.c: New file.
8968 * testsuite/start_lib_test_2.c: New file.
8969 * testsuite/start_lib_test_3.c: New file.
8970
8971 2010-08-19 Ian Lance Taylor <iant@google.com>
8972
8973 * Makefile.in: Rebuild with automake 1.11.1.
8974 * aclocal.m4: Likewise.
8975 * testsuite/Makefile.in: Likewise.
8976
8977 2010-08-19 Ian Lance Taylor <iant@google.com>
8978
8979 PR 10893
8980 * i386.cc (class Output_data_plt_i386): Update declarations.
8981 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8982 local_ifuncs_ fields.
8983 (Target_i386::do_plt_section_for_global): New function.
8984 (Target_i386::do_plt_section_for_local): New function.
8985 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8986 parameter; change all callers. Initialize global_ifuncs_ and
8987 local_ifuncs_. If doing a static link define __rel_iplt_start and
8988 __rel_iplt_end.
8989 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8990 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8991 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8992 symbols.
8993 (Target_i386::make_plt_section): New function, broken out of
8994 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8995 (Target_i386::make_plt_entry): Call make_plt_section.
8996 (Target_i386::make_local_ifunc_plt_entry): New function.
8997 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8998 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8999 R_386_IRELATIVE to switch.
9000 (Target_i386::Scan::global): Likewise.
9001 (Target_i386::Relocate::relocate): Likewise.
9002 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9003 switch.
9004 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9005 (Target_x86_64::do_plt_section_for_global): New function.
9006 (Target_x86_64::do_plt_section_for_local): New function.
9007 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9008 parameter; change all callers. If doing a static link define
9009 __rela_iplt_start and __rela_iplt_end.
9010 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9011 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9012 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9013 to point to .plt.
9014 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9015 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9016 switch.
9017 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9018 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9019 R_X86_64_IRELATIVE to switch.
9020 (Target_x86_64::Scan::global): Likewise.
9021 (Target_x86_64::Relocate::relocate): Likewise.
9022 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9023 switch.
9024 * target.h (class Target): Add plt_section_for_global and
9025 plt_section_for_local functions. Add do_plt_section_for_global
9026 and do_plt_section_for_local virtual functions.
9027 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9028 clarifying comments.
9029 (Symbol::use_plt_offset): Handle IFUNC symbol.
9030 * object.cc (Sized_relobj::Sized_relobj): Initialize
9031 local_plt_offsets_.
9032 (Sized_relobj::local_has_plt_offset): New function.
9033 (Sized_relobj::local_plt_offset): New function.
9034 (Sized_relobj::set_local_plt_offset): New function.
9035 (Sized_relobj::do_count): Handle IFUNC symbol.
9036 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9037 a bit away from input_shndx_ field. Add set_is_func_symbol and
9038 is_ifunc_symbol functions.
9039 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9040 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9041 local_plt_offsets_ field.
9042 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9043 * output.h (class Output_section_data): Add non-const
9044 output_section function.
9045 (class Output_data_got): Update declarations.
9046 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9047 Add use_plt_offset parameter to global and local constructors.
9048 Change all callers. Change local_sym_index_ field to 31 bits.
9049 Change GSYM_CODE and CONSTANT_CODE accordingly.
9050 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9051 doing a static link don't set sh_link field.
9052 (Output_data_got::Got_entry::write): Use PLT offset if
9053 appropriate.
9054 (Output_data_got::add_global_plt): New function.
9055 (Output_data_got::add_local_plt): New function.
9056 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9057 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9058 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9059 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9060 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9061 IFUNC conditional.
9062 * testsuite/ifunc-sel.h: New file.
9063 * testsuite/ifuncmain1.c: New file.
9064 * testsuite/ifuncmain1vis.c: New file.
9065 * testsuite/ifuncmod1.c: New file.
9066 * testsuite/ifuncdep2.c: New file.
9067 * testsuite/ifuncmain2.c: New file.
9068 * testsuite/ifuncmain3.c: New file.
9069 * testsuite/ifuncmod3.c: New file.
9070 * testsuite/ifuncmain4.c: New file.
9071 * testsuite/ifuncmain5.c: New file.
9072 * testsuite/ifuncmod5.c: New file.
9073 * testsuite/ifuncmain6pie.c: New file.
9074 * testsuite/ifuncmod6.c: New file.
9075 * testsuite/ifuncmain7.c: New file.
9076 * configure, testsuite/Makefile.in: Rebuild.
9077
9078 2010-08-18 Ian Lance Taylor <iant@google.com>
9079
9080 * incremental.cc
9081 (Output_section_incremental_inputs::write_input_files): Add cast
9082 to avoid signed/unsigned comparison warning.
9083 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9084
9085 2010-08-12 Cary Coutant <ccoutant@google.com>
9086
9087 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9088
9089 2010-08-13 Ian Lance Taylor <iant@google.com>
9090
9091 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9092
9093 2010-08-12 Cary Coutant <ccoutant@google.com>
9094 Doug Kwan <dougkwan@google.com>
9095
9096 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9097 defintion overrides non-weak undef, remember that the original undef
9098 is not weak.
9099 * symtab.cc (Symbol_table::sized_write_global): For undef without
9100 an original weak binding, set binding to global in output.
9101 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9102 * testsuite/Makefile.in: Regenerate.
9103 * testsuite/strong_ref_weak_def.sh: New file.
9104 * testsuite/strong_ref_weak_def_1.c: Ditto.
9105 * testsuite/strong_ref_weak_def_2.c: Ditto.
9106
9107 2010-08-12 Cary Coutant <ccoutant@google.com>
9108
9109 * testsuite/incremental_test.sh: Rewrite.
9110 * testsuite/incremental_test_1.c: Rewrite.
9111 * testsuite/incremental_test_2.c: Rewrite.
9112
9113 2010-08-12 Cary Coutant <ccoutant@google.com>
9114
9115 * arm.cc (Target_arm::got_size): Add const.
9116 (Target_arm::got_entry_count): New function.
9117 (Target_arm::plt_entry_count): New function.
9118 (Target_arm::first_plt_entry_offset): New function.
9119 (Target_arm::plt_entry_size): New function.
9120 (Output_data_plt_arm::entry_count): New function.
9121 (Output_data_plt_arm::first_plt_entry_offset): New function.
9122 (Output_data_plt_arm::get_plt_entry_size): New function.
9123 * i386.cc (Target_i386::got_size): Add const.
9124 (Target_i386::got_entry_count): New function.
9125 (Target_i386::plt_entry_count): New function.
9126 (Target_i386::first_plt_entry_offset): New function.
9127 (Target_i386::plt_entry_size): New function.
9128 (Output_data_plt_i386::entry_count): New function.
9129 (Output_data_plt_i386::first_plt_entry_offset): New function.
9130 (Output_data_plt_i386::get_plt_entry_size): New function.
9131 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9132 find_incremental_inputs_sections. Dump incremental_got_plt section.
9133 * incremental.cc: Include target.h.
9134 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9135 parameter. Adjust all callers. Find incremental_got_plt section.
9136 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9137 section.
9138 (Output_section_incremental_inputs::set_final_data_size): Calculate
9139 size of incremental_got_plt section.
9140 (Output_section_incremental_inputs::do_write): Write the
9141 incremental_got_plt section.
9142 (Got_plt_view_info): New struct.
9143 (Local_got_offset_visitor): New class.
9144 (Global_got_offset_visitor): New class.
9145 (Global_symbol_visitor_got_plt): New class.
9146 (Output_section_incremental_inputs::write_got_plt): New function.
9147 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9148 Add parameter. Adjust all callers.
9149 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9150 (Incremental_inputs::got_plt_section): New function.
9151 (Incremental_inputs::got_plt_section_): New data member.
9152 (Incremental_got_plt_reader): New class.
9153 * layout.cc (Layout::create_incremental_info_sections): Add the
9154 incremental_got_plt section.
9155 * object.h (Got_offset_list::get_list): New function.
9156 (Got offset_list::for_all_got_offsets): New function.
9157 (Sized_relobj::local_got_offset_list): New function.
9158 * powerpc.cc (Target_powerpc::got_size): Add const.
9159 (Target_powerpc::got_entry_count): New function.
9160 (Target_powerpc::plt_entry_count): New function.
9161 (Target_powerpc::first_plt_entry_offset): New function.
9162 (Target_powerpc::plt_entry_size): New function.
9163 (Output_data_plt_powerpc::entry_count): New function.
9164 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9165 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9166 * sparc.cc (Target_sparc::got_size): Add const.
9167 (Target_sparc::got_entry_count): New function.
9168 (Target_sparc::plt_entry_count): New function.
9169 (Target_sparc::first_plt_entry_offset): New function.
9170 (Target_sparc::plt_entry_size): New function.
9171 (Output_data_plt_sparc::entry_count): New function.
9172 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9173 (Output_data_plt_sparc::get_plt_entry_size): New function.
9174 * symtab.h (Symbol::got_offset_list): New function.
9175 (Symbol_table::for_all_symbols): New function.
9176 * target.h (Sized_target::got_entry_count): New function.
9177 (Sized_target::plt_entry_count): New function.
9178 (Sized_target::plt_entry_size): New function.
9179 * x86_64.cc (Target_x86_64::got_size): Add const.
9180 (Target_x86_64::got_entry_count): New function.
9181 (Target_x86_64::plt_entry_count): New function.
9182 (Target_x86_64::first_plt_entry_offset): New function.
9183 (Target_x86_64::plt_entry_size): New function.
9184 (Output_data_plt_x86_64::entry_count): New function.
9185 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9186 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9187
9188 2010-08-12 Cary Coutant <ccoutant@google.com>
9189
9190 * archive.cc: Include incremental.h.
9191 (Archive::Archive): Initialize incremental_info_.
9192 (Archive::include_member): Record archive members in incremental info.
9193 (Add_archive_symbols::run): Record begin and end of an archive in
9194 incremental info.
9195 (Lib_group::include_member): Record objects in incremental info.
9196 * archive.h (Incremental_archive_entry): Forward declaration.
9197 (Archive::set_incremental_info): New member function.
9198 (Archive::incremental_info): New member function.
9199 (Archive::Unused_symbol_iterator): New class.
9200 (Archive::unused_symbols_begin): New member function.
9201 (Archive::unused_symbols_end): New member function.
9202 (Archive::incremental_info_): New data member.
9203 * incremental-dump.cc (find_input_containing_global): New function.
9204 (dump_incremental_inputs): Dump new incremental info sections.
9205 * incremental.cc: Include symtab.h.
9206 (Output_section_incremental_inputs): New class.
9207 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9208 new incremental info sections.
9209 (Sized_incremental_binary::do_check_inputs): Likewise.
9210 (Incremental_inputs::report_archive): Remove.
9211 (Incremental_inputs::report_archive_begin): New function.
9212 (Incremental_inputs::report_archive_end): New function.
9213 (Incremental_inputs::report_object): New function.
9214 (Incremental_inputs::finalize_inputs): Remove.
9215 (Incremental_inputs::report_input_section): New function.
9216 (Incremental_inputs::report_script): Rewrite.
9217 (Incremental_inputs::finalize): Do nothing but finalize string table.
9218 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9219 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9220 (Incremental_inputs::create_data_sections): New function.
9221 (Incremental_inputs::relocs_entsize): New function.
9222 (Output_section_incremental_inputs::set_final_data_size): New function.
9223 (Output_section_incremental_inputs::do_write): New function.
9224 (Output_section_incremental_inputs::write_header): New function.
9225 (Output_section_incremental_inputs::write_input_files): New function.
9226 (Output_section_incremental_inputs::write_info_blocks): New function.
9227 (Output_section_incremental_inputs::write_symtab): New function.
9228 * incremental.h (Incremental_script_entry): Forward declaration.
9229 (Incremental_object_entry): Forward declaration.
9230 (Incremental_archive_entry): Forward declaration.
9231 (Incremental_inputs): Forward declaration.
9232 (Incremental_inputs_header_data): Remove.
9233 (Incremental_inputs_header): Remove.
9234 (Incremental_inputs_header_write): Remove.
9235 (Incremental_inputs_entry_data): Remove.
9236 (Incremental_inputs_entry): Remove.
9237 (Incremental_inputs_entry_write): Remove.
9238 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9239 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9240 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9241 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9242 Likewise.
9243 (Incremental_input_entry): New class.
9244 (Incremental_script_entry): New class.
9245 (Incremental_object_entry): New class.
9246 (Incremental_archive_entry): New class.
9247 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9248 (Incremental_inputs::report_inputs): Remove.
9249 (Incremental_inputs::report_archive): Remove.
9250 (Incremental_inputs::report_archive_begin): New function.
9251 (Incremental_inputs::report_archive_end): New function.
9252 (Incremental_inputs::report_object): Change prototype.
9253 (Incremental_inputs::report_input_section): New function.
9254 (Incremental_inputs::report_script): Change prototype.
9255 (Incremental_inputs::get_reloc_count): New function.
9256 (Incremental_inputs::set_reloc_count): New function.
9257 (Incremental_inputs::create_data_sections): New function.
9258 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9259 (Incremental_inputs::inputs_section): New function.
9260 (Incremental_inputs::symtab_section): New function.
9261 (Incremental_inputs::relocs_section): New function.
9262 (Incremental_inputs::get_stringpool): Add const.
9263 (Incremental_inputs::command_line): Add const.
9264 (Incremental_inputs::inputs): Remove.
9265 (Incremental_inputs::command_line_key): New function.
9266 (Incremental_inputs::input_file_count): New function.
9267 (Incremental_inputs::input_files): New function.
9268 (Incremental_inputs::relocs_entsize): New function.
9269 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9270 (Incremental_inputs::finalize_inputs): Remove.
9271 (Incremental_inputs::Input_info): Remove.
9272 (Incremental_inputs::lock_): Remove.
9273 (Incremental_inputs::inputs_): Change type.
9274 (Incremental_inputs::inputs_map_): Remove.
9275 (Incremental_inputs::current_object_entry_): New data member.
9276 (Incremental_inputs::inputs_section_): New data member.
9277 (Incremental_inputs::symtab_section_): New data member.
9278 (Incremental_inputs::relocs_section_): New data member.
9279 (Incremental_inputs::reloc_count_): New data member.
9280 (Incremental_inputs_reader): New class.
9281 (Incremental_symtab_reader): New class.
9282 (Incremental_relocs_reader): New class.
9283 * layout.cc (Layout::finalize): Move finalization of incremental info
9284 and creation of incremental info sections to follow finalization of
9285 symbol table. Set offsets for postprocessing sections.
9286 (Layout::create_incremental_info_sections): Call
9287 Incremental_inputs::create_data_sections. Add incremental symtab
9288 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9289 sections to layout after input sections.
9290 * layout.h (struct Timespec): Forward declaration.
9291 (Layout::incremental_inputs): Add const.
9292 (Layout::create_incremental_info_sections): Add parameter.
9293 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9294 * object.cc: Include incremental.h.
9295 (Relobj::finalize_incremental_relocs): New function.
9296 (Sized_relobj::do_layout): Record input sections in incremental info.
9297 * object.h (Object::output_section): New function.
9298 (Object::output_section_offset): Moved from Relobj.
9299 (Object::get_incremental_reloc_base): New function.
9300 (Object::get_incremental_reloc_count): New function.
9301 (Object::do_output_section): New function.
9302 (Object::do_output_section_offset): Moved from Relobj.
9303 (Object::do_get_incremental_reloc_base): New function.
9304 (Object::do_get_incremental_reloc_count): New function.
9305 (Object::Object): Initialize new data members.
9306 (Relobj::output_section): Renamed do_output_section and moved to
9307 protected.
9308 (Relobj::output_section_offset): Moved to Object.
9309 (Relobj::do_get_incremental_reloc_base): New function.
9310 (Relobj::do_get_incremental_reloc_count): New function.
9311 (Relobj::allocate_incremental_reloc_counts): New function.
9312 (Relobj::count_incremental_reloc): New function.
9313 (Relobj::finalize_incremental_relocs): New function.
9314 (Relobj::next_incremental_reloc_index): New function.
9315 (Relobj::reloc_counts_): New data member.
9316 (Relobj::reloc_bases_): New data member.
9317 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9318 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9319 (Sized_relobj::incremental_relocs_scan): New function.
9320 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9321 (Sized_relobj::incremental_relocs_write): New function.
9322 (Sized_relobj::incremental_relocs_write_reltype): New function.
9323 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9324 incremental link.
9325 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9326 archives and object files elsewhere.
9327 (Add_symbols::run): Report object files here.
9328 (Finish_group::run): Report end of archive at end of group.
9329 * reloc.cc: Include layout.h, incremental.h.
9330 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9331 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9332 (Sized_relobj::incremental_relocs_scan): New function.
9333 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9334 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9335 (Sized_relobj::incremental_relocs_write): New function.
9336 (Sized_relobj::incremental_relocs_write_reltype): New function.
9337 * script.cc (read_input_script): Rewrite test for incremental link.
9338 Change call to Incremental_inputs::report_script.
9339 * symtab.h (Symbol_table::first_global_index): New function.
9340 (Symbol_table::output_count): New function.
9341
9342 2010-08-12 Doug Kwan <dougkwan@google.com>
9343
9344 * arm.cc (Target_arm::merge_object_attributes): Check command line
9345 options --no-wchar-size-warning and --no-enum-size-warning.
9346 * options.h (General_options): Add ld-compatible options
9347 --no-enum-size-warning and --no-wchar-size-warning.
9348
9349 2010-08-04 Ian Lance Taylor <iant@google.com>
9350
9351 * x86_64.cc (Target_x86_64::Scan::local): Use
9352 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9353 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9354 (Target_x86_64::Scan::global): Likewise.
9355 (Target_x86_64::Relocate::relocate): Likewise.
9356 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9357 Likewise.
9358
9359 2010-08-03 Cary Coutant <ccoutant@google.com>
9360
9361 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9362 to reserve space in merged_strings vector. Keep total input size
9363 for stats.
9364 (Output_merge_string::do_print_merge_stats): Print total input size.
9365 * merge.h (Output_merge_string): Add input_size_ field.
9366 * stringpool.cc (Stringpool_template::string_length): Move
9367 implementations out of Stringpool_template class and place in
9368 stringpool.h.
9369 * stringpool.h (string_length): Move out of Stringpool_template.
9370
9371 2010-08-03 Ian Lance Taylor <iant@google.com>
9372
9373 PR 11712
9374 * layout.cc (relaxation_loop_body): If address of load segment is
9375 set, adjust address to include headers if possible.
9376
9377 2010-08-03 Ian Lance Taylor <iant@google.com>
9378
9379 * version.cc (version_string): Bump to 1.10.
9380
9381 2010-08-03 Ian Lance Taylor <iant@google.com>
9382
9383 PR 11805
9384 * layout.h (enum Output_section_order): Define.
9385 (class Layout): Update declarations.
9386 * layout.cc (Layout::get_output_section): Add order parameter.
9387 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9388 is_first_non_relro parameters. Change all callers.
9389 (Layout::choose_output_section): Likewise.
9390 (Layout::add_output_section_data): Likewise.
9391 (Layout::make_output_section): Likewise. Set order.
9392 (Layout::default_section_order): New function.
9393 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9394 * output.cc (Output_section::Output_section): Initialize order_.
9395 Don't initialize deleted fields.
9396 (Output_segment::Output_segment): Don't initialize deleted
9397 fields.
9398 (Output_segment::add_output_section_to_load): New function
9399 replacing add_output_section. Change all callers to call this or
9400 add_output_section_to_nonload.
9401 (Output_segment::add_output_section_to_nonload): New function.
9402 (Output_segment::remove_output_section): Rewrite.
9403 (Output_segment::add_initial_output_data): Likewise.
9404 (Output_segment::has_any_data_sections): Likewise.
9405 (Output_segment::is_first_section_relro): Likewise.
9406 (Output_segment::maximum_alignment): Likewise.
9407 (Output_segment::has_dynamic_reloc): New function replacing
9408 dynamic_reloc_count. Change all callers.
9409 (Output_segment::has_dynamic_reloc_list): New function replacing
9410 dynamic_reloc_count_list. Change all callers.
9411 (Output_segment::set_section_addresses): Rewrite.
9412 (Output_segment::set_offset): Rewrite.
9413 (Output_segment::find_first_and_last_list): Remove.
9414 (Output_segment::set_tls_offsets): Rewrite.
9415 (Output_segment::first_section_load_address): Likewise.
9416 (Output_segment::output_section_count): Likewise.
9417 (Output_segment::section_with_lowest_load_address): Likewise.
9418 (Output_segment::write_section_headers): Likewise.
9419 (Output_segment::print_sections_to_map): Likewise.
9420 * output.h (class Output_data): Remove dynamic_reloc_count_
9421 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9422 (Output_data::add_dynamic_reloc): Rewrite.
9423 (Output_data::has_dynamic_reloc): New function.
9424 (Output_data::dynamic_reloc_count): Remove.
9425 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9426 is_last_relro_, is_first_non_relro_, is_interp_,
9427 is_dynamic_linker_section_ fields. Add order and set_order
9428 functions. Remove is_relro_local, set_is_relro_local,
9429 is_last_relro, set_is_last_relro, is_first_non_relro,
9430 set_is_first_non_relro functions, is_interp, set_is_interp,
9431 is_dynamic_linker_section, and set_is_dynamic_linker_section
9432 functions.
9433 (class Output_segment): Change Output_data_list from std::list to
9434 std:;vector. Add output_lists_ field. Remove output_data_ and
9435 output_bss_ fields. Update declarations.
9436
9437 2010-08-02 Ian Lance Taylor <iant@google.com>
9438
9439 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9440 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9441 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9442
9443 2010-08-02 Ian Lance Taylor <iant@google.com>
9444
9445 PR 11855
9446 * script.cc (Script_options::Script_options): Initialize
9447 symbol_definitions_ and symbol_references_.
9448 (Script_options::add_symbol_assignment): Update
9449 symbol_definitions_ and symbol_references_.
9450 (Script_options::add_symbol_reference): New function.
9451 (script_symbol): New function.
9452 * script.h (class Script_options): Add symbol_definitions_ and
9453 symbol_references_ fields.
9454 (Script_options::referenced_const_iterator): New type.
9455 (Script_options::referenced_begin): New function.
9456 (Script_options::referenced_end): New function.
9457 (Script_options::is_referenced): New function.
9458 (Script_options::any_unreferenced): New function.
9459 * script-c.h (script_symbol): Declare.
9460 * yyscript.y (exp): Call script_symbol.
9461 * symtab.cc: Include "script.h".
9462 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9463 Change all callers. Check symbols referenced by scripts.
9464 (Symbol_table::add_undefined_symbols_from_command_line): Add
9465 layout parameter. Change all callers.
9466 (Symbol_table::do_add_undefined_symbols_from_command_line):
9467 Likewise. Break out loop body. Check symbols referenced by
9468 scripts.
9469 (Symbol_table::add_undefined_symbol_from_command_line): New
9470 function broken out of
9471 do_add_undefined_symbols_from_command_line.
9472 * symtab.h (class Symbol_table): Update declarations.
9473 * archive.cc: Include "layout.h".
9474 (Archive::should_include_member): Add layout parameter. Change
9475 all callers. Check for symbol mentioned in expression.
9476 * archive.h (class Archive): Update declaration.
9477 * object.cc (Sized_relobj::do_should_include_member): Add layout
9478 parameter.
9479 * object.h (Object::should_include_member): Add layout parameter.
9480 Change all callers.
9481 (Object::do_should_include_member): Add layout parameter.
9482 (class Sized_relobj): Update declaration.
9483 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9484 parameter.
9485 * dynobj.h (class Sized_dynobj): Update declaration.
9486 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9487 layout parameter.
9488 * plugin.h (class Sized_pluginobj): Update declaration.
9489
9490 2010-08-02 Ian Lance Taylor <iant@google.com>
9491
9492 PR 11866
9493 * output.cc (Output_segment::set_offset): Search for the first and
9494 last sections rather than assuming that the list is in order.
9495 (Output_segment::find_first_and_last_list): New function.
9496 * output.h (class Output_segment): Update declarations.
9497 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9498 (relro_strip_test_SOURCES): New variable.
9499 (relro_strip_test_DEPENDENCIES): New variable.
9500 (relro_strip_test_LDFLAGS): New variable.
9501 (relro_strip_test_LDADD): New variable.
9502 (relro_strip_test.so): New target.
9503
9504 2010-08-02 Ian Lance Taylor <iant@google.com>
9505
9506 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9507 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9508 (Target_i386::got_tlsdesc_section): New function.
9509 (Target_i386::got_section): Create space for GOT entries for
9510 TLSDESC relocations.
9511 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9512 R_386_TLS_GOTDESC.
9513 (Target_i386::Scan::global): Likewise.
9514 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9515 using TLSDESC GOT.
9516 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9517 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9518 (Target_x86_64::got_tlsdesc_section): New function.
9519 (Target_x86_64::got_section): Create space for GOT entries for
9520 TLSDESC relocations.
9521 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9522 R_386_TLS_GOTDESC.
9523 (Target_x86_64::Scan::global): Likewise.
9524 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9525 using TLSDESC GOT.
9526
9527 2010-08-02 Ian Lance Taylor <iant@google.com>
9528
9529 * testsuite/final_layout.sh: Use dc to convert from hex to
9530 decimal.
9531
9532 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9533
9534 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9535 paramter to the call to gold::gc_process_relocs.
9536 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9537 paramter to the call to gold::gc_process_relocs.
9538 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9539 parameter to the call to gold::gc_process_relocs.
9540 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9541 template parameter to the call to gold::gc_process_relocs.
9542 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9543 paramter to the call to gold::gc_process_relocs.
9544 * gc.h (get_embedded_addend_size): New function.
9545 (gc_process_relocs): Save the size of the reloc for use by ICF.
9546 * icf.cc (get_section_contents): Get the addend from the text section
9547 for SHT_REL relocation sections.
9548 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9549 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9550 * int_encoding.h (read_from_pointer): New overloaded function.
9551 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9552 * testsuite/icf_sht_rel_addend_test.sh: New file.
9553 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9554 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9555
9556 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9557
9558 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9559 * Makefile.in: Regenerate.
9560 * testsuite/Makefile.in: Regenerate.
9561
9562 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9563
9564 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9565 * gold/testsuite/debug_msg.cc: Likewise.
9566 * gold/testsuite/odr_violation1.cc
9567 * gold/testsuite/odr_violation2.cc
9568
9569 2010-07-21 Cary Coutant <ccoutant@google.com>
9570
9571 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9572 string, and length fields.
9573 (Output_merge_string::Merged_strings_list): New type.
9574 (Output_merge_string::Merged_strings_lists): New typedef.
9575 (Output_merge_string): Replace merged_strings_ with
9576 merged_strings_lists_.
9577 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9578 Merged_strings_list per input object and section. Don't store pointer
9579 to the string. Don't store length with each merged string entry.
9580 (Output_merge_string::finalize_merged_data): Loop over list of merged
9581 strings lists. Recompute length of each merged string.
9582
9583 2010-07-15 Cary Coutant <ccoutant@google.com>
9584
9585 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9586 here.
9587
9588 2010-07-14 Ian Lance Taylor <iant@google.com>
9589
9590 * descriptors.cc (Descriptors::open): Report correct name in error
9591 message.
9592
9593 2010-07-13 Doug Kwan <dougkwan@google.com>
9594
9595 * arm.cc (Arm_input_section::Arm_input_section): For a
9596 SHT_ARM_EXIDX section, always keeps the input sections.
9597 (Arm_input_section::set_exidx_section_link): New method.
9598 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9599 has_errors_ to false.
9600 (Arm_exidx_input_section::has_errors,
9601 Arm_exidx_input_section::set_has_errors): New methods.
9602 (Arm_exidx_input_section::has_errors_): New data member.
9603 (Arm_relobj::get_exidx_shndx_list): New method.
9604 (Arm_output_section::append_text_sections_to_list): Do not skip
9605 section without SHF_EXECINSTR.
9606 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9607 errors.
9608 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9609 section header. Make error messages more verbose. Check for
9610 a non-executable section linked to an EXIDX section.
9611 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9612 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9613 check that there is no deferred EXIDX section if we exit early.
9614 Instead of not making an EXIDX section in case of an error, make one
9615 and set the has_errors flag of it.
9616 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9617 in a relocatable link.
9618 (Target_arm::do_relax): Look for the EXIDX output section instead of
9619 assuming that it is called .ARM.exidx.
9620 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9621 section list. Do not check for SHF_EXECINSTR section flags but
9622 skip any input section with errors.
9623 * output.cc (Output_section::Output_section): Initialize
9624 always_keeps_input_sections_ to false.
9625 (Output_section::add_input_section): Check for
9626 always_keeps_input_sections_.
9627 * output.h (Output_section::always_keeps_input_sections,
9628 Output_section::set_always_keeps_input_sections): New methods.
9629 (Output_section::always_keeps_input_sections): New data member.
9630
9631 2010-07-13 Rafael Espindola <espindola@google.com>
9632
9633 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9634 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9635
9636 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9637 Ian Lance Taylor <iant@google.com>
9638
9639 * output.h (Output_section_lookup_maps::add_merge_section):
9640 Correct check of whether value was inserted.
9641 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9642 (Output_section_lookup_maps::add_relaxed_input_section):
9643 Likewise.
9644 * arm.cc (Target_arm::got_section): Remove used local os.
9645 * i386.cc (Target_i386::got_section): Likewise.
9646 * x86_64.cc (Target_x86_64::got_section): Likewise.
9647 * sparc.cc (Target_sparc::got_section): Likewise.
9648 (Target_sparc::relocate): Remove unused local have_got_offset.
9649 * powerpc.cc (Target_powerpc::relocate): Likewise.
9650
9651 2010-07-13 Ian Lance Taylor <iant@google.com>
9652
9653 * compressed_output.cc (zlib_decompress): Fix signature in
9654 !HAVE_ZLIB_H case.
9655
9656 * archive.cc (Archive::include_member): Unlock an external member
9657 of a thin archive. Don't bother to delete an object we know is
9658 NULL.
9659
9660 2010-07-12 Cary Coutant <ccoutant@google.com>
9661
9662 * compressed_output.cc (zlib_decompress): New function.
9663 (get_uncompressed_size): New function.
9664 (decompress_input_section): New function.
9665 * compressed_output.h (get_uncompressed_size): New function.
9666 (decompress_input_section): New function.
9667 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9668 Handle compressed debug sections.
9669 * layout.cc (is_compressed_debug_section): New function.
9670 (Layout::output_section_name): Map compressed section names to
9671 canonical names.
9672 * layout.h (is_compressed_debug_section): New function.
9673 (is_debug_info_section): Recognize compressed debug sections.
9674 * merge.cc: Include compressed_output.h.
9675 (Output_merge_data::do_add_input_section): Handle compressed
9676 debug sections.
9677 (Output_merge_string::do_add_input_section): Handle compressed
9678 debug sections.
9679 * object.cc: Include compressed_output.h.
9680 (Sized_relobj::Sized_relobj): Initialize new data members.
9681 (build_compressed_section_map): New function.
9682 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9683 * object.h (Object::section_is_compressed): New method.
9684 (Object::do_section_is_compressed): New method.
9685 (Sized_relobj::Compressed_section_map): New type.
9686 (Sized_relobj::do_section_is_compressed): New method.
9687 (Sized_relobj::compressed_sections_): New data member.
9688 * output.cc (Output_section::add_input_section): Handle compressed
9689 debug sections.
9690 * reloc.cc: Include compressed_output.h.
9691 (Sized_relobj::write_sections): Handle compressed debug sections.
9692
9693 2010-07-08 Cary Coutant <ccoutant@google.com>
9694
9695 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9696 weak when resolving to a dynamic def.
9697 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9698 for weak undef/dynamic def cases. Adjust callers.
9699 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9700 undef_binding_weak_.
9701 (Symbol_table::sized_write_globals): Adjust symbol binding.
9702 (Symbol_table::sized_write_symbol): Add binding parameter.
9703 * symtab.h (Symbol::set_undef_binding): New method.
9704 (Symbol::is_undef_binding_weak): New method.
9705 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9706 (Symbol_table::should_override): Add new parameter.
9707 (Symbol_table::sized_write_symbol): Add new parameter.
9708
9709 * testsuite/weak_undef_file1.cc: Add new test case.
9710 * testsuite/weak_undef_file2.cc: Fix header comment.
9711 * testsuite/weak_undef_test.cc: Add new test case.
9712
9713 2010-06-29 Doug Kwan <dougkwan@google.com>
9714
9715 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9716 Initialize USE_SYMBOL_.
9717 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9718 definition.
9719 (Arm_reloc_property::uses_symbol_): New data member declaration.
9720 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9721 uses symbol value and symbol is undefined but not weakly undefined.
9722
9723 2010-06-28 Rafael Espindola <espindola@google.com>
9724
9725 * plugin.cc (Plugin::load): Use dlerror.
9726
9727 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9728
9729 * symtab.cc (detect_odr_violations): When reporting an ODR
9730 violation, report an object where the symbol is defined.
9731
9732 2010-06-25 Doug Kwan <dougkwan@google.com>
9733
9734 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9735 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9736 definition.
9737 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9738 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9739 target hook to detect function points.
9740 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9741 * icf.h (Icf::check_section_for_function_pointers): Change type of
9742 parameter SECTION_NAME to const reference to std::string. Use
9743 target hook to determine if section may have unsafe pointers.
9744 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9745 method definition.
9746
9747 2010-06-21 Rafael Espindola <espindola@google.com>
9748
9749 * fileread.cc (Input_file::find_fie): New
9750 (Input_file::open): Use Input_file::find_fie.
9751 * fileread.h (Input_file::find_fie): New
9752 * plugin.cc (set_extra_library_path): New.
9753 (Plugin::load): Add set_extra_library_path to the transfer vector.
9754 (Plugin_manager::set_extra_library_path): New.
9755 (Plugin_manager::add_input_file): Use the extra search path if set.
9756 (set_extra_library_path(): New.
9757 * plugin.h (Plugin_manager): Add set_extra_library_path and
9758 extra_search_path_.
9759
9760 2010-06-19 Cary Coutant <ccoutant@google.com>
9761
9762 * layout.cc (gdb_sections): Add .debug_types.
9763 (lines_only_debug_sections): Likewise.
9764
9765 2010-06-18 Rafael Espindola <espindola@google.com>
9766
9767 * plugin.cc (add_input_file,add_input_library)
9768 (Plugin_manager::add_input_file): Make filename arguments const.
9769 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9770 const.
9771
9772 2010-06-16 Doug Kwan <dougkwan@google.com>
9773
9774 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9775 .ARM.attributes section if we have not merged any input
9776 attributes sections.
9777
9778 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9779
9780 * arm.cc: Allow combining objects with no EABI version
9781 information.
9782
9783 2010-06-15 Rafael Espindola <espindola@google.com>
9784
9785 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9786
9787 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9788
9789 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9790 (struct iovec): Correct !HAVE_READV definition.
9791
9792 2010-06-10 Cary Coutant <ccoutant@google.com>
9793
9794 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9795 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9796 reloc sections.
9797 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9798
9799 PR 11683
9800 * symtab.h (Symbol::is_placeholder): New member function.
9801 * target-reloc.h (relocate_section): Check for placeholder symbols.
9802
9803 * testsuite/Makefile.am (plugin_test_8): New test.
9804 (plugin_test_9): New test.
9805 * testsuite/Makefile.in: Regenerate.
9806
9807 2010-06-09 Nick Clifton <nickc@redhat.com>
9808
9809 * yyscript.y (input_list_element): Allow strings prefixed with
9810 the '-' character. Treat these as libraries.
9811 * script.cc (script_add_library): New function. Adds a library
9812 specified by "-l<name>" found in an input script.
9813 * script-c.h: Add prototype for script_add_library.
9814
9815 2010-06-07 Doug Kwan <dougkwan@google.com>
9816
9817 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9818 Restrict stub-group size to be within long conditional branch
9819 range when working around cortex-A8 erratum.
9820
9821 2010-06-07 Damien Diederen <dd@crosstwine.com>
9822
9823 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9824 #ifdef typo.
9825
9826 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9827
9828 PR gold/11658
9829 * output.cc
9830 (Output_section::Input_section_sort_entry::compare_section_ordering):
9831 Change to return non-zero correctly.
9832 (Output_section::Input_section_sort_section_order_index_compare
9833 ::operator()): Change to fix ambiguity in comparisons.
9834
9835 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9836
9837 * gold.h (is_wildcard_string): New function.
9838 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9839 (Layout::layout_eh_frame): Ditto.
9840 (Layout::find_section_order_index): New method.
9841 (Layout::read_layout_from_file): New method.
9842 * layout.h (Layout::find_section_order_index): New method.
9843 (Layout::read_layout_from_file): New method.
9844 (Layout::input_section_position_): New private member.
9845 (Layout::input_section_glob_): New private member.
9846 * main.cc (main): Call read_layout_from_file here.
9847 * options.h (--section-ordering-file): New option.
9848 * output.cc (Output_section::input_section_order_specified_): New
9849 member.
9850 (Output_section::Output_section): Initialize new member.
9851 (Output_section::add_input_section): Add new parameter.
9852 Keep input sections when --section-ordering-file is used.
9853 (Output_section::set_final_data_size): Sort input sections when
9854 section ordering file is specified.
9855 (Output_section::Input_section_sort_entry): Add new parameter.
9856 Check sorting type.
9857 (Output_section::Input_section_sort_entry::compare_section_ordering):
9858 New method.
9859 (Output_section::Input_section_sort_compare::operator()): Change to
9860 consider section_order_index.
9861 (Output_section::Input_section_sort_init_fini_compare::operator()):
9862 Change to consider section_order_index.
9863 (Output_section::Input_section_sort_section_order_index_compare
9864 ::operator()): New method.
9865 (Output_section::sort_attached_input_sections): Change to sort
9866 according to section order when specified.
9867 (Output_section::add_input_section<32, true>): Add new parameter.
9868 (Output_section::add_input_section<64, true>): Add new parameter.
9869 (Output_section::add_input_section<32, false>): Add new parameter.
9870 (Output_section::add_input_section<64, false>): Add new parameter.
9871 * output.h (Output_section::add_input_section): Add new parameter.
9872 (Output_section::input_section_order_specified): New
9873 method.
9874 (Output_section::set_input_section_order_specified): New method.
9875 (Input_section::Input_section): Initialize section_order_index_.
9876 (Input_section::section_order_index): New method.
9877 (Input_section::set_section_order_index): New method.
9878 (Input_section::section_order_index_): New member.
9879 (Input_section::Input_section_sort_section_order_index_compare): New
9880 struct.
9881 (Output_section::input_section_order_specified_): New member.
9882 * script-sections.cc (is_wildcard_string): Delete and move modified
9883 method to gold.h.
9884 (Output_section_element_input::Output_section_element_input): Modify
9885 call to is_wildcard_string.
9886 (Output_section_element_input::Input_section_pattern
9887 ::Input_section_pattern): Ditto.
9888 (Output_section_element_input::Output_section_element_input): Ditto.
9889 * testsuite/Makefile.am (final_layout): New test case.
9890 * testsuite/Makefile.in: Regenerate.
9891 * testsuite/final_layout.cc: New file.
9892 * testsuite/final_layout.sh: New file.
9893
9894 2010-06-01 Rafael Espindola <espindola@google.com>
9895
9896 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9897
9898 2010-06-01 Rafael Espindola <espindola@google.com>
9899
9900 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9901 visibility of symbols.
9902
9903 2010-05-27 Doug Kwan <dougkwan@google.com>
9904
9905 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9906 from start of output section instead of address for a local symbol
9907 in a merged or relaxed section when doing a relocatable link.
9908
9909 2010-05-26 Rafael Espindola <espindola@google.com>
9910
9911 PR 11604
9912 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9913 adding sections the garbage collector removed.
9914 * gold/testsuite/Makefile.am: Add test.
9915 * gold/testsuite/Makefile.in: Regenerate.
9916 * gold/testsuite/plugin_test_7.sh: New.
9917 * gold/testsuite/plugin_test_7_1.c: New.
9918 * gold/testsuite/plugin_test_7_2.c: New.
9919
9920 2010-05-26 Rafael Espindola <espindola@google.com>
9921
9922 * script-sections.cc (Output_section_definition::set_section_addresses):
9923 Check for --section-start.
9924
9925 2010-05-26 Doug Kwan <dougkwan@google.com>
9926
9927 * arm.cc (Arm_scan_relocatable_relocs): New class.
9928 (Target_arm::relocate_special_relocatable): New method.
9929 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9930 (Arm_relocate_functions::thumb_branch_common): Same.
9931 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9932 instead of Default_scan_relocatable_relocs.
9933 * target-reloc.h (relocate_for_relocatable): Let target handle
9934 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9935 * target.h (Sized_target::relocate_special_relocatable): New method.
9936
9937 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9938
9939 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9940
9941 2010-05-23 Doug Kwan <dougkwan@google.com>
9942
9943 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9944 instead of a cast.
9945 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9946 with a direct branch, not a conditional branch, to a stub.
9947 * merge.cc (Output_merge_base::record_input_section): New method
9948 defintion.
9949 (Output_merge_data::do_add_input_section): Record input section if
9950 keeps-input-sections flag is set.
9951 (Output_merge_string::do_add_input_section): Ditto.
9952 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9953 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9954 INPUT_SECTIONS_.
9955 (Output_merge_base::keeps_input_sections,
9956 Output_merge_base::set_keeps_input_sections,
9957 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9958 method definitions.
9959 (Output_merge_base::Input_sections): New type declaration.
9960 (Output_merge_base::input_sections_begin,
9961 Output_merge_base::input_sections_end,
9962 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9963 (Output_merge_base::bool keeps_input_sections_,
9964 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9965 Output_merge_base::input_sections_): New data members.
9966 (Output_merge_data::do_set_keeps_input_sections): New method
9967 defintion.
9968 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9969 * output.cc (Output_section::Input_section::relobj): Move method
9970 defintion from class declaration to here and handle merge sections.
9971 (Output_section::Input_section::shndx): Ditto.
9972 (Output_section::Output_section): Remove initializations of removed
9973 data members and initialize new data member LOOKUP_MAPS_.
9974 (Output_section::add_input_section): Set keeps-input-sections flag
9975 for a newly created merge output section as appropriate. Adjust code
9976 to use Output_section_lookup_maps class.
9977 (Output_section::add_relaxed_input_section): Adjst code for lookup
9978 maps code refactoring.
9979 (Output_section::add_merge_input_section): Add a new parameter
9980 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9981 class. If adding input section to a newly created merge output
9982 section fails, remove the new merge section.
9983 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
9984 Adjust code for use of the Output_section_lookup_maps class.
9985 (Output_section::find_merge_section): Ditto.
9986 (Output_section::build_lookup_maps): New method defintion.
9987 (Output_section::find_relaxed_input_section): Adjust code to use
9988 Output_section_lookup_maps class.
9989 (Output_section::get_input_sections): Export merge sections. Adjust
9990 code to use Output_section_lookup_maps class.
9991 (Output_section:::add_script_input_section): Adjust code to use
9992 Output_section_lookup_maps class. Update lookup maps for merge
9993 sections also.
9994 (Output_section::discard_states): Use Output_section_lookup_maps.
9995 (Output_section::restore_states): Same.
9996 * output.h (Merge_section_properties): Move class defintion out of
9997 Output_section.
9998 (Output_section_lookup_maps): New class.
9999 (Output_section::Input_section::is_merge_section): New method
10000 defintion.
10001 (Output_section::Input_section::relobj): Move defintion out of class
10002 defintion. Declare method only.
10003 (Output_section::Input_section::shndx): Ditto.
10004 (Output_section::Input_section::output_merge_base): New method defintion.
10005 (Output_section::Input_section::u2_.pomb): New union field.
10006 (Output_section::Merge_section_by_properties_map,
10007 Output_section::Output_section_data_by_input_section_map,
10008 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10009 Remove types.
10010 (Output_section::add_merge_input_section): Add new parameter
10011 KEEPS_INPUT_SECTIONS.
10012 (Output_section::build_lookup_maps): New method declaration.
10013 (Output_section::merge_section_map_,
10014 Output_section::merge_section_by_properties_map_,
10015 Output_section::relaxed_input_section_map_,
10016 Output_section::is_relaxed_input_section_map_valid_): Remove data
10017 members.
10018 (Output_section::lookup_maps_): New data member.
10019
10020 2010-05-21 Doug Kwan <dougkwan@google.com>
10021
10022 PR gold/11619
10023 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10024 avoid a compilation error.
10025
10026 2010-05-19 Rafael Espindola <espindola@google.com>
10027
10028 * script-sections.cc (Output_section_definition::allocate_to_segment):
10029 Update the phdrs_list even when the output section is NULL.
10030 * testsuite/Makefile.am: Add test.
10031 * testsuite/Makefile.in: Regenerate.
10032 * testsuite/script_test_9.cc: New.
10033 * testsuite/script_test_9.sh: New.
10034 * testsuite/script_test_9.t: New.
10035
10036 2010-05-19 Doug Kwan <dougkwan@google.com>
10037
10038 * arm.cc (Arm_input_section::original_size): New method.
10039 (Arm_input_section::do_addralign): Add a cast.
10040 (Arm_input_section::do_output_offset): Remove static cast.
10041 (Arm_input_section::original_addralign,
10042 Arm_input_section::original_size_): Change type to uint32_t.
10043 (Arm_input_section::init): Add safe casts for section alignment
10044 and size.
10045 (Arm_input_section::set_final_data_size): Do not set address and
10046 offset of stub table.
10047 (Arm_output_section::fix_exidx_coverage): Change use of of
10048 Output_section::Simple_input_section to that of
10049 Output_section::Input_section.
10050 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10051 except for the first pass.
10052 * output.cc (Output_section::get_input_sections): Change type of
10053 input_sections to std::list<Input_section>.
10054 (Output_section::add_script_input_section): Rename from
10055 Output_section::add_simple_input_section. Change type of SIS
10056 parameter from Simple_input_section to Input_section.
10057 * output.h (Output_section::Simple_input_section): Remove class.
10058 (Output_section::Input_section): Change class visibility to public.
10059 (Output_section::Input_section::addralign): Use stored alignments
10060 for special input sections if set.
10061 (Output_section::Input_section::set_addralign): New method.
10062 (Output_section::get_input_sections): Change parameter type from
10063 list of Simple_input_section to list of Input_section.
10064 (Output_section::add_script_input_section): Rename from
10065 Output_section::add_simple_input_section. Change first parameter's
10066 type from Simple_input_section to Input_section and remove the
10067 second and third parameters.
10068 * script-sections.cc (Input_section::Input_section_list): Change
10069 type to list of Output_section::Input_section/
10070 (Input_section_info::Input_section_info): Change parameter type of
10071 INPUT_SECTION to Output_section::Input_section.
10072 (Input_section_info::input_section): Change return type.
10073 (Input_section_info::input_section_): Change type to
10074 Output_section::Input_section.
10075 (Output_section_element_input::set_section_addresses): Adjust code
10076 to use Output_section::Input_section instead of
10077 Output_section::Simple_input_section. Adjust code for renaming
10078 of Output_section::add_simple_input_section.
10079 (Orphan_output_section::set_section_addresses): Ditto.
10080
10081 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10082
10083 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10084 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10085
10086 2010-05-18 Rafael Espindola <espindola@google.com>
10087
10088 * options.cc (General_options::finalize): Handle -nostdlib.
10089 * options.h (nostdlib): New option.
10090 * script.cc (script_add_search_dir): Handle -nostdlib.
10091
10092 2010-05-12 Doug Kwan <dougkwan@google.com>
10093
10094 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10095 attributes section only if there no attributes section after merging.
10096 (Target_arm::merge_object_attributes): Move value of
10097 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10098 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10099 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10100 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10101 and arm_attr_merge_7.stdout.
10102 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10103 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10104 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10105 arm_attr_merge_7b.o): New rules.
10106 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10107 arm_attr_merge_7
10108 * testsuite/Makefile.in: Regenerate.
10109 * testsuite/arm_attr_merge.sh: New file.
10110 * testsuite/arm_attr_merge_[67][ab].s: Same.
10111
10112 2010-05-05 Nick Clifton <nickc@redhat.com>
10113
10114 * po/es.po: Updated Spanish translation.
10115
10116 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10117
10118 * Makefile.am (install-exec-local): Properly install gold as
10119 default cross linker.
10120 * Makefile.in: Regenerated.
10121
10122 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10123 Nick Clifton <nickc@redhat.com>
10124
10125 * configure.ac (install_as_default): Define and set to false
10126 unless --enable-gold or --enable-gold=both/gold has been
10127 specified.
10128 * configure: Regenerate.
10129
10130 * Makefile.am (install-exec-local): Install the executable as
10131 'ld.gold'. If install_as_default is true then also install it as
10132 'ld'.
10133 * Makefile.in: Regenerated.
10134
10135 2010-04-24 Ian Lance Taylor <iant@google.com>
10136
10137 * layout.cc (Layout::layout_reloc): In relocatable link don't
10138 combine reloc sections for grouped sections.
10139
10140 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10141
10142 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10143 sections that are not ordinary to icf.
10144 * icf.cc (get_section_contents): Handle relocation pointing to section
10145 with no object or shndx information.
10146 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10147 * testsuite/Makefile.in: Regenerate.
10148 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10149 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10150
10151 2010-04-22 Ian Lance Taylor <iant@google.com>
10152
10153 * expression.cc (Expression::Expression_eval_info): Add
10154 result_alignment_pointer field.
10155 (Expression::eval_with_dot): Add result_alignment_pointer
10156 parameter. Change all callers.
10157 (Expression::eval_maybe_dot): Likewise.
10158 (class Binary_expression): Add alignment_pointer parameter to
10159 left_value and right_value. Change all callers.
10160 (BINARY_EXPRESSION): Set result alignment.
10161 (class Trinary_expression): Add alignment_pointer parameter to
10162 arg2_value and arg3_value. Change all callers.
10163 (Trinary_cond::value): Set result alignment.
10164 (Max_expression::value, Min_expression::value): Likewise.
10165 (Align_expression::value): Likewise.
10166 * script-sections.cc (class Sections_element): Add dot_alignment
10167 parameter to set_section_addresses virtual function. Update
10168 instantiations.
10169 (class Output_section_element): Likewise.
10170 (Script_sections::create_segments): Add dot_alignment parameter.
10171 Change all callers.
10172 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10173 (Script_sections::set_phdrs_clause_addresses): Likewise.
10174 * script-sections.h: Update declarations.
10175 * script.h: Update declarations.
10176 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10177 min_p_align.
10178 * testsuite/script_test_3.t: Set large alignment.
10179 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10180 segment has expected alignment.
10181
10182 2010-04-22 Nick Clifton <nickc@redhat.com>
10183
10184 * po/gold.pot: Updated by the Translation project.
10185 * po/vi.po: Updated Vietnamese translation.
10186
10187 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10188
10189 * testsuite/Makefile.am (check_PROGRAMS): Add
10190 icf_virtual_function_folding_test.
10191 * testsuite/Makefile.in: Regenerated.
10192
10193 2010-04-15 Andrew Haley <aph@redhat.com>
10194
10195 * options.h (merge_exidx_entries): New option.
10196 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10197 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10198 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10199 (Target_arm::merge_exidx_entries): New function.
10200 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10201 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10202 to Arm_exidx_fixup constructor.
10203 Add new arg, merge_exidx_entries.
10204 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10205 Arm_output_section::fix_exidx_coverage.
10206
10207 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10208
10209 * icf.cc (get_section_contents): Check for preemptible functions.
10210 Ignore addend when appropriate.
10211 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10212 section folded.
10213 (add_from_relobj): Check for section folded.
10214 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10215 * symtab.h (should_add_dynsym_entry): Add new parameter.
10216 * target-reloc.h (scan_relocs): Check for section folded.
10217 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10218 Check reloc types for function pointers in shared objects.
10219 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10220 case.
10221 (icf_preemptible_functions_test): New test case.
10222 (icf_string_merge_test): New test case.
10223 * testsuite.Makefile.in: Regenerate.
10224 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10225 bar_glob. Refactor code.
10226 * testsuite/icf_preemptible_functions_test.cc: New file.
10227 * testsuite/icf_preemptible_functions_test.sh: New file.
10228 * testsuite/icf_string_merge_test.cc: New file.
10229 * testsuite/icf_string_merge_test.sh: New file.
10230 * testsuite/icf_virtual_function_folding_test.cc: New file.
10231 * testsuite/icf_virtual_function_folding_test.sh: New file.
10232
10233 2010-04-14 Doug Kwan <dougkwan@google.com>
10234
10235 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10236 for local symbol recounting if we remove a section due to ICF.
10237 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10238 there are no regular objects in input.
10239
10240 2010-04-13 Doug Kwan <dougkwan@google.com>
10241
10242 * arm.cc (Arm_input_section::set_final_data_size): Compute
10243 accurate final data size instead of using current data size.
10244
10245 2010-04-09 Doug Kwan <dougkwan@google.com>
10246
10247 * layout.cc (Layout::choose_output_section): Handle script section
10248 types.
10249 (Layout::make_output_section_for_script): Add section type parameter.
10250 Handle script section types.
10251 * layout.h (Layout::make_output_section_for_script): Add section
10252 type parameter.
10253 * output.cc (Output_section::Output_section): Initialize data member
10254 is_noload_.
10255 (Output_section::do_reset_address_and_file_offset): Do not set address
10256 to 0 if section is a NOLOAD section.
10257 * output.h (Output_section::is_noload): New method.
10258 (Output_section::set_is_noload): Ditto.
10259 (Output_section::is_noload_): New data member.
10260 * script-c.h (Script_section_type): New enum type.
10261 (struct Parser_output_section_header): Add new file section_type.
10262 * script-sections.cc (Sections_element::output_section_name): Add
10263 parameter for returning script section type.
10264 (Output_section_definition::output_section_name): Ditto.
10265 (Output_section_definition::section_type)P; New method.
10266 (Output_section_definiton::script_section_type_name): Ditto.
10267 (Output_section_definition::script_section_type_): New data member.
10268 (Output_section_definition::Output_section_definition): Initialize
10269 data member Output_section_definition::script_section_type_.
10270 (Output_section_definition::create_sections): Pass script section type
10271 to Layout::make_output_section_for_script.
10272 (Output_section_definition::output_section_name): Return script
10273 section type to caller.
10274 (Output_section_definition::set_section_address): Do not advance
10275 dot value and load address if section type is NOLOAD. Set address
10276 of NOLOAD sections regardless of section flags.
10277 (Output_section_definition::print): Print section type if it is
10278 not SCRIPT_SECTION_TYPE_NONE.
10279 (Output_section_definition::section_type): New method.
10280 (Output_section_definition::script_section_type_name): Ditto.
10281 (Script_sections::output_section_name): Add new parameter
10282 PSECTION_TYPE for returning script section type. Pass it to
10283 section elements. Handle discard sections.
10284 (Sort_output_sections::operator()): Handle NOLOAD sections.
10285 * script-sections.h (Script_sections::Section_type): New enum type.
10286 (Script_sections::output_section_name): Add a new parameter for
10287 returning script section type.
10288 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10289 INFO and NOLOAD.
10290 * yyscript.y (union): Add new field SECTION_TYPE.
10291 (COPY, DSECT, INFO, NOLOAD): New tokens.
10292 (opt_address_and_section_type): Change type to output_section_header.
10293 (section_type): New non-terminal
10294 (section_header): Handle section type.
10295 (opt_address_and_section_type): Return section type value.
10296
10297 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10298
10299 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10300 * testsuite/plugin_common_test_2.c (foo): Likewise.
10301
10302 2010-04-08 Doug Kwan <dougkwan@google.com>
10303
10304 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10305 Output_merge_data.
10306 * output.cc (Output_section::add_merge_input_section): Simplify
10307 code and return status of Output_merge_base::add_input_section.
10308 Update merge section map only if Output_merge_base::add_input_section
10309 returns true.
10310
10311 2010-04-07 Doug Kwan <dougkwan@google.com>
10312
10313 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10314 if section is marked as containing instructions but has no mapping
10315 symbols.
10316 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10317 correct section index.
10318 (Arm_relobj::find_linked_text_section): Ditto.
10319
10320 2010-04-07 Cary Coutant <ccoutant@google.com>
10321
10322 * archive.cc (include_member): Destroy Read_symbols_data object before
10323 releasing file.
10324 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10325 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10326 (Read_symbols_data::~Read_symbols_data) New destructor.
10327 (Section_relocs::Section_relocs) New constructor.
10328 (Section_relocs::~Section_relocs) New destructor.
10329 (Read_relocs_data::Read_relocs_data) New constructor.
10330 (Read_relocs_data::~Read_relocs_data) New destructor.
10331 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10332 pointers to NULL after deleting.
10333
10334 2010-04-07 Doug Kwan <dougkwan@google.com>
10335
10336 * arm.cc: Replace "endianity" with "endianness" in comments.
10337 (Arm_exidx_cantunwind): Ditto.
10338 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10339 (Arm_relobj::merge_flags_and_attributes): New method.
10340 (Arm_relobj::merge_flags_and_attributes_): New data member.
10341 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10342 (Arm_relobj::scan_sections_for_stubs): Ditto.
10343 (Arm_relobj::do_read_symbols): Check to see if we really want to
10344 merge processor-specific flags and attributes. Exit early if
10345 an object is empty except for section names and the undefined symbol.
10346 (Target_arm::do_finalize_sections): Move check for ELF format to
10347 Arm_relobj::do_read_symbols. Merge processor specific flags and
10348 attributes from a regular object only when we have determined that
10349 it is aapropriate. Do not create an .ARM.attributes section in
10350 output if there is no regular input object.
10351 (Target_arm::merge_processor_specific_flags): Check
10352 --warn-mismatch before printing any error.
10353 (Target_arm::merge_object_attributes): Ditto.
10354 * gold.cc (queue_middle_tasks): Handle the case in which there is
10355 no regular object in input.
10356 * options.cc (General_options::parse_EB): New method.
10357 (General_options::parse_EL): Same.
10358 (General_options::General_options): Initialize endianness_.
10359 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10360 New options.
10361 (General_options::Endianness): New enum.
10362 (General_options::endianness): New method.
10363 (General_options::endianness_): New data member.
10364 * parameters.cc (Parameters::set_options): Check target endianness.
10365 (Parameters::set_target_once): Ditto.
10366 (Parameters::check_target_endianness): New method.
10367 (parameters_force_valid_target): If either -EL or -EB is specified,
10368 use it to define endianness of default target.
10369 * parameters.h (Parameters::check_target_endianness): New method
10370 declaration.
10371 * target.h (class Target): Change "endianity" to "endianness"
10372 in comments.
10373
10374 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10375
10376 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10377 * configure: Regenerate.
10378 * Makefile.in: Regenerate.
10379 * testsuite/Makefile.in: Regenerate.
10380
10381 2010-04-06 Cary Coutant <ccoutant@google.com>
10382
10383 gcc PR lto/42757
10384 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10385 prevailing definitions of common symbols.
10386 * testsuite/plugin_test_6.sh: New test case.
10387 * testsuite/plugin_common_test_1.c: New test case.
10388 * testsuite/plugin_common_test_2.c: New test case.
10389 * testsuite/Makefile.am (plugin_test_6): New test case.
10390 * testsuite/Makefile.in: Regenerate.
10391
10392 2010-04-06 Nick Clifton <nickc@redhat.com>
10393
10394 * po/vi.po: New Vietnamese translation.
10395
10396 2010-03-30 Doug Kwan <dougkwan@google.com>
10397
10398 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10399
10400 2010-03-25 Doug Kwan <dougkwan@google.com>
10401
10402 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10403 to avoid a conversion warning on a 32-bit host.
10404
10405 2010-03-24 Ian Lance Taylor <iant@google.com>
10406
10407 * testsuite/script_test_3.t: Add a TLS segment.
10408 * testsuite/Makefile.am (check_PROGRAMS): Add
10409 tls_phdrs_script_test.
10410 (tls_phdrs_script_test_SOURCES): Define.
10411 (tls_phdrs_script_test_DEPENDENCIES): Define.
10412 (tls_phdrs_script_test_LDFLAGS): Define.
10413 (tls_phdrs_script_test_LDADD): Define.
10414 * testsuite/Makefile.in: Rebuild.
10415
10416 2010-03-23 Cary Coutant <ccoutant@google.com>
10417
10418 * fileread.cc (find_or_make_view): Fix comment.
10419
10420 2010-03-23 Ian Lance Taylor <iant@google.com>
10421
10422 * script-sections.cc (class Orphan_section_placement): Define
10423 PLACE_TLS and PLACE_TLS_BSS.
10424 (Orphan_section_placement::Orphan_section_placement): Initialize
10425 new places.
10426 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10427 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10428 (tls_script_test_SOURCES): Define.
10429 (tls_script_test_DEPENDENCIES): Define.
10430 (tls_script_test_LDFLAGS): Define.
10431 (tls_script_test_LDADD): Define.
10432 * testsuite/Makefile.in: Rebuild.
10433
10434 2010-03-22 Doug Kwan <dougkwan@google.com>
10435
10436 * arm.cc (Arm_relocate_functions::abs8,
10437 Arm_relocate_functions::abs16): Use correct check for overflow
10438 specified in the ARM ELF specs.
10439 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10440 target of a BLX instruction specially.
10441 (Reloc_stub::stub_type_for_reloc): Ditto.
10442 (Relocate::relocate): Use symbolic names instead of numeric relocation
10443 codes to report error.
10444 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10445 workaround.
10446 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10447 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10448 thumb2_blx_out_of_range.stdout
10449 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10450 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10451 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10452 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10453 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10454 thumb2_blx_in_range, thumb2_blx_in_range.o,
10455 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10456 thumb2_blx_out_of_range.o): New rules.
10457 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10458 thumb2_blx_in_range and thumb2_blx_out_of_range.
10459 * testsuite/Makefile.in: Regenerate.
10460 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10461 * testsuite/thumb_blx_in_range.s: New file.
10462 * testsuite/thumb_blx_out_of_range.s: New file.
10463
10464 2010-03-22 Rafael Espindola <espindola@google.com>
10465
10466 * archive.cc (Should_include): Move to archive.h.
10467 (should_include_member): Make it a member of Archive.
10468 (Lib_group): New.
10469 (Add_lib_group_symbols): New.
10470 * archive.h: Include options.h.
10471 (Archive_member): Moved from Archive.
10472 (Should_include): Moved from archive.cc.
10473 (Lib_group): New.
10474 (Add_lib_group_symbols): New.
10475 * dynobj.cc (do_should_include_member): New.
10476 * dynobj.h (do_should_include_member): New.
10477 * gold.cc (queue_initial_tasks): Update call to queue.
10478 * main.cc (main): Print lib group stats.
10479 * object.cc (do_should_include_member): New.
10480 * object.h: Include archive.h.
10481 (Object::should_include_member): New.
10482 (Object::do_should_include_member): New.
10483 (Sized_relobj::do_should_include_member): New.
10484 * options.cc (General_options::parse_start_lib): New.
10485 (General_options::parse_end_lib): New.
10486 (Input_arguments::add_file): Handle lib groups.
10487 (Input_arguments::start_group): Check we are not in a lib.
10488 (Input_arguments::start_lib): New.
10489 (Input_arguments::end_lib): New.
10490 * options.h (General_options): Add start_lib and end_lib.
10491 (Input_argument::lib_): New.
10492 (Input_argument::lib): New.
10493 (Input_argument::is_lib): New.
10494 (Input_file_lib): New.
10495 (Input_arguments::in_lib_): New.
10496 (Input_arguments::in_lib): New.
10497 (Input_arguments::start_lib): New.
10498 (Input_arguments::end_lib_): New.
10499 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10500 in unused members as preempted.
10501 (Sized_pluginobj::do_should_include_member): New.
10502 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10503 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10504 return the blocker.
10505 (Read_symbols::do_whole_lib_group): New.
10506 (Read_symbols::do_lib_group): New.
10507 (Read_symbols::do_read_symbols): Handle lib groups.
10508 (Read_symbols::get_name): Handle lib groups.
10509 * readsyms.h (Read_symbols): Add an archive member pointer.
10510 (Read_symbols::do_whole_lib_group): New.
10511 (Read_symbols::do_lib_group): New.
10512 (Read_symbols::member_): New.
10513 * script.cc (read_input_script): Update call to queue_soon.
10514
10515 2010-03-19 Doug Kwan <dougkwan@google.com>
10516
10517 * arm.cc (Stub_table::Stub_table): Initialize new data members
10518 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10519 (Stub_table::add_reloc_stub): Assign stub offset and update
10520 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10521 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10522 New data members.
10523 (Stub_table::update_data_size_and_addralign): Use
10524 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10525 instead of going over all reloc stubs.
10526 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10527 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10528 Stringpool_template::offset_ to size of Stringpool_char.
10529 (Stringpool_template::new_key_offset): Remove code to initialize
10530 Stringpool_template::offset_.
10531 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10532 Stringpool_template::offset_ to zero.
10533
10534 2010-03-15 Doug Kwan <dougkwan@google.com>
10535
10536 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10537 offset_.
10538 (Stringpool_template::new_key_offset): New method.
10539 (Stringpool_template::add_string): Assign offsets when adding new
10540 strings.
10541 (Stringpool_template::set_string_offsets): Do not set string offsets
10542 when not optimizing.
10543 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10544 member size_.
10545 (Chunked_vector::clear): Clear size_.
10546 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10547 (Chunked_vector::size): Return size_.
10548 (Chunked_vector::push_back): Use size_ to find insert position.
10549 (Chunked_vector::size_): New data member.
10550 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10551 (Stringpool_template::new_key_offset): New method declaration.
10552 (Stringpool_template::offset_): New data member.
10553
10554 2010-03-15 Rafael Espindola <espindola@google.com>
10555
10556 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10557 Add_symbols' constructor.
10558 * readsyms.h (Add_symbols): Remove the input_group member.
10559
10560 2010-03-10 Ian Lance Taylor <iant@google.com>
10561
10562 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10563 target to ask whether a reference to a symbol requires a stack
10564 split.
10565 * target.h (Target::is_call_to_non_split): New function.
10566 (Target::do_is_call_to_non_split): Declare virtual function.
10567 * target.cc: Include "symtab.h".
10568 (Target::do_is_call_to_non_split): New function.
10569 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10570
10571 2010-03-10 Cary Coutant <ccoutant@google.com>
10572
10573 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10574 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10575 (File_read::open[2]): Add whole_file_view_ to list of views.
10576 (File_read::make_view): Remove test of whole_file_view_.
10577 (File_read::find_or_make_view): Create whole_file_view_ if
10578 necessary.
10579 (File_read::clear_views): Replace bool parameter with enum;
10580 adjust all callers. Don't delete views with permanent data;
10581 do delete cached views and views from archives if
10582 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10583 if clearing the corresponding view.
10584 * fileread.h (File_read::Clear_views_mode): New enum.
10585 (File_read::View::is_permanent_view): New method.
10586 (File_read::clear_views): Replace bool parameter
10587 with enum; adjust all callers.
10588 * options.h (General_options): Change keep_files_mapped option;
10589 add map_whole_files.
10590 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10591 releasing the file.
10592 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10593 the file.
10594
10595 2010-03-10 David S. Miller <davem@davemloft.net>
10596
10597 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10598
10599 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10600
10601 * icf.cc (get_section_contents): Add '@' marker after processing the
10602 merge reloc.
10603
10604 2010-03-08 Doug Kwan <dougkwan@google.com>
10605
10606 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10607 due to a conversion warning.
10608 (Arm_relobj::update_output_local_symbol_count): Check for local
10609 symbol with unset output index.
10610
10611 2010-03-05 Ian Lance Taylor <iant@google.com>
10612
10613 * options.h (class General_options): Add --spare-dynamic-tags.
10614 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10615 --spare-dynamic-tags.
10616
10617 2010-03-05 Ian Lance Taylor <iant@google.com>
10618
10619 * incremental.cc: Include "libiberty.h".
10620
10621 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10622
10623 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10624 function, is_info_ member.
10625 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10626 (Versions::Versions): Update caller.
10627 (Versions::define_base_version): Likewise.
10628 (Versions::add_def): Likewise.
10629
10630 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10631
10632 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10633 (Scan::possible_function_pointer_reloc): New function.
10634 (Scan::local_reloc_may_be_function_pointer): Change to call
10635 possible_function_pointer_reloc.
10636 (Scan::global_reloc_may_be_function_pointer): Ditto.
10637 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10638 relocations in ".data.rel.ro._ZTV" section.
10639 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10640 * testsuite/icf_safe_so_test.cc: Ditto.
10641 * testsuite/icf_safe_test.cc: Ditto.
10642 * testsuite/icf_safe_test.sh: Ditto.
10643
10644 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10645 Ian Lance Taylor <iant@google.com>
10646
10647 * target-reloc.h (relocate_section): Check the symbol table index
10648 for -1U before setting the local symbol index.
10649 (scan_relocatable_relocs): If copying the relocation, record that
10650 the local symbol is required.
10651 * object.h (Symbol_value::is_output_symtab_index_set): New
10652 function.
10653 (Symbol_value::may_be_discarded_from_output_symtab): New
10654 function.
10655 (Symbol_value::has_output_symtab_entry): New function.
10656 (Symbol_value::needs_output_symtab_entry): Remove.
10657 (Symbol_value::output_symtab_index): Make sure the symbol index is
10658 set.
10659 (Symbol_value::set_output_symtab_index): Make sure the symbol
10660 index is not set. Make sure the new index is valid.
10661 (Symbol_value::set_must_have_output_symtab_entry): New function.
10662 (Symbol_value::has_output_dynsym_entry): New function.
10663 (Symbol_value::set_output_dynsym_index): Make sure the new index
10664 is valid.
10665 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10666 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10667 local symbol if permitted.
10668 (Sized_relobj::do_finalize_local_symbols): Call
10669 is_output_symtab_index_set rather than needs_output_symtab_entry.
10670 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10671 rather than needs_output_symtab_entry. Call
10672 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10673 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10674 is_output_symtab_index_set rather than needs_output_symtab_entry.
10675 * testsuite/discard_locals_relocatable_test.c: New file.
10676 * testsuite/discard_locals_test.sh: Test -r.
10677 * testsuite/Makefile.am (check_DATA): Add
10678 discard_locals_relocatable_test1.syms,
10679 discard_local_relocatable_test2.syms.
10680 (MOSTLYCLEANFILES): Likewise. Also add
10681 discard_locals_relocatable_test1.lout and
10682 discard_locals_relocatable_test2.out.
10683 (discard_locals_relocatable_test1.syms): New target.
10684 (discard_locals_relocatable_test.o): New target.
10685 (discard_locals_relocatable_test1.out): New target.
10686 (discard_locals_relocatable_test2.syms): New target.
10687 (discard_locals_relocatable_test2.out): New target.
10688 (various): Add missing ../ld-new dependencies.
10689 * testsuite/Makefile.in: Rebuild.
10690
10691 2010-03-03 Nick Clifton <nickc@redhat.com>
10692
10693 * po/fi.po: New Finnish translation.
10694
10695 2010-03-01 Doug Kwan <dougkwan@google.com>
10696
10697 * layout.cc (Layout::Layout): Force section types of .init_array*,
10698 .preinit_array* and .fini_array* sections.
10699 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10700 Fix check of return value of std::string::find.().
10701 (Output_section::Input_section_sort_compare::operator()): Remove
10702 comment about .init_array.
10703 (Output_section::Input_section_sort_init_fini_compare::operator()):
10704 New method.
10705 (Output_section::sort_attached_input_sections): Handle .init_array
10706 and .fini_array specially.
10707 * output.h (Output_section::Inut_section_sort_compare): Update
10708 comment.
10709 (Output_section::Input_section_sort_init_fini_compare): New struct.
10710
10711 2010-02-26 Doug Kwan <dougkwan@google.com>
10712
10713 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10714 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10715 * testsuite/debug_msg.sh: Avoid matching source line number for
10716 use of global variable undef_int.
10717
10718 2010-02-26 Doug Kwan <dougkwan@google.com>
10719
10720 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10721 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10722 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10723 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10724 * options.cc (General_options::General_options): Initialize member
10725 fix_v4bx_.
10726 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10727 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10728 and rm_no_fix_v4bx.stdout
10729 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10730 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10731 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10732 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10733 and arm_no_fix_v4bx.
10734 * Makefile.in: Regenerate.
10735 * testsuite/arm_fix_v4bx.s: New file.
10736 * testsuite/arm_fix_v4bx.sh: Ditto.
10737
10738 2010-02-24 Doug Kwan <dougkwan@google.com>
10739
10740 * arm.cc (Target_arm::got_section): Make the .got section the first
10741 non RELRO section in the data segment.
10742 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10743 suffixes of section names.
10744
10745 2010-02-24 Doug Kwan <dougkwan@google.com>
10746
10747 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10748 flags and attributes merging if an input file is a binary file.
10749 * fileread.cc (Input_file::open): Record format of original file.
10750 * fileread.h (Input_file::Format): New enum type.
10751 (Input_file::Input_file): Initialize data member format_.
10752 (Input_file::format): New method definition.
10753 (Input_file::format_):: New data member.
10754
10755 2010-02-24 Doug Kwan <dougkwan@google.com>
10756
10757 * arm.cc (Arm_output_data_got): New class.
10758 (ARM_TCB_SIZE): New constant
10759 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10760 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10761 If user uses a script with a SECTIONS clause, issue only a warning
10762 for a misplaced EXIDX input section. Otherwise, issue an error.
10763 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10764 garbage collection.
10765 (Target_arm::got_mode_index_entry): Handle static linking.
10766 (Target_arm::Scan::local): Ditto.
10767 (Target_arm::Scan::global): Ditto.
10768 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10769 all incorrectly implemented relocations.
10770 (Target_arm::fix_exidx_coverage): Pass layout to
10771 Arm_output_section::fix_exidx_coverage.
10772 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10773 from ".ARM.exidx." and ".ARM.extab.".
10774
10775 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10776
10777 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10778 section if it does not already exist.
10779 * attributes.cc (Attributes_section_data::Attributes_section_data):
10780 Don't crash if size is zero.
10781
10782 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10783 Ian Lance Taylor <iant@google.com>
10784
10785 * gold.cc (queue_middle_tasks): If no input files were opened,
10786 exit.
10787 * workqueue.h (Task_function::Task_function): Assert that there is
10788 a blocker.
10789
10790 2010-02-22 Doug Kwan <dougkwan@google.com>
10791
10792 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10793 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10794 types to avoid warnings due to different uint64_t implementations
10795 on different hosts.
10796
10797 2010-02-21 Doug Kwan <dougkwan@google.com>
10798
10799 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10800 handling of the maximum backward branch offset.
10801 (Arm_relocate_functions::thumb_branch_common): Ditto.
10802 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10803 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10804 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10805 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10806 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10807 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10808 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10809 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10810 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10811 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10812 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10813 thumb2_bl_out_of_range.o): New rules.
10814 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10815 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10816 thumb2_bl_out_of_range
10817 * testsuite/Makefile.in: Regenerate.
10818 * testsuite/arm_bl_in_range.s: New file.
10819 * testsuite/arm_bl_out_of_range.s: Ditto.
10820 * testsuite/arm_branch_in_range.sh: Ditto.
10821 * testsuite/arm_branch_range.t: Ditto.
10822 * testsuite/thumb2_branch_range.t: Ditto.
10823 * testsuite/thumb_bl_in_range.s: Ditto.
10824 * testsuite/thumb_bl_out_of_range.s: Ditto.
10825 * testsuite/thumb_branch_range.t: Ditto.
10826
10827 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10828
10829 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10830 Add reloc offset information.
10831 * icf.cc (get_section_contents): Change iterators to point to the new
10832 vectors. Add reloc offset information to the contents.
10833 * icf.h (Icf::Sections_reachable_info): New typedef.
10834 (Icf::Sections_reachable_list): New typedef.
10835 (Icf::Offset_info): New typedef.
10836 (Icf::Reloc_info): New struct typedef.
10837 (Icf::Reloc_info_list): New typedef.
10838 (Icf::symbol_reloc_list): Delete method.
10839 (Icf::addend_reloc_list): Delete method.
10840 (Icf::section_reloc_list): Delete method.
10841 (Icf::reloc_info_list): New method.
10842 (Icf::reloc_info_list_): New member.
10843
10844 2010-02-19 Doug Kwan <dougkwan@google.com>
10845
10846 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10847 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10848 * arm.cc (Arm_relocation_functions): New forward declaration.
10849 (Target_arm::Target_arm): Initialize new data members
10850 got_mod_index_offset_ and tls_base_symbol_defined_.
10851 (Target_arm::Relocate::relocate_tls): New method.
10852 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10853 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10854 New methods.
10855 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10856 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10857 (Target_arm::got_mod_index_offset_,
10858 Target_arm::tls_base_symbol_defined_): New data members.
10859 (Target_arm::Scan::local, Target::Scan::global,
10860 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10861 relocations.
10862
10863 2010-02-18 Doug Kwan <dougkwan@google.com>
10864
10865 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10866 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10867 text section as a parameter becuase some broken tools may not set
10868 the link in section header.
10869 (Target_arm::has_got_section): New method.
10870 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10871 without any mapping symbol as data only. Remove warning.
10872 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10873 link in its section header, try to discover the link by inspecting the
10874 REL31 relocation at the beginning of the section.
10875 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10876 in error message.
10877 (Target_arm::Scan::global): Treat any reference to the symbol
10878 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10879
10880 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10881
10882 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10883 (Scan::global_reloc_may_be_function_pointer): New function.
10884 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10885 (Scan::global_reloc_may_be_function_pointer): New function.
10886 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10887 (Scan::global_reloc_may_be_function_pointer): New function.
10888 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10889 (Scan::global_reloc_may_be_function_pointer): New function.
10890 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10891 (Scan::global_reloc_may_be_function_pointer): New function.
10892 (Scan::possible_function_pointer_reloc): New function.
10893 (Target_x86_64::can_check_for_function_pointers): New function.
10894 * gc.h (gc_process_relocs): Scan relocation types to determine if
10895 function pointers were taken for targets that support it.
10896 * icf.cc (Icf::find_identical_sections): Include functions for
10897 folding in safe ICF whose pointer is not taken.
10898 * icf.h (Secn_fptr_taken_set): New typedef.
10899 (fptr_section_id_): New member.
10900 (section_has_function_pointers): New function.
10901 (set_section_has_function_pointers): New function.
10902 (check_section_for_function_pointers): New function.
10903 * options.h: Fix comment for safe ICF option.
10904 * target.h (can_check_for_function_pointers): New function.
10905 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10906 Modify icf_safe_test for X86-64.
10907 * testsuite/Makefile.in: Regenerate.
10908 * testsuite/icf_safe_so_test.cc: New file.
10909 * testsuite/icf_safe_so_test.sh: New file.
10910 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10911 (main): Change to take pointer to function kept_func_3.
10912 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10913 folding is done correctly for X86-64.
10914
10915 2010-02-12 David S. Miller <davem@davemloft.net>
10916
10917 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10918 is_symbolless parameter.
10919 (Output_reloc<SHT_REL>::is_symbolless): New.
10920 (Output_reloc<SHT_REL>::is_symbolless_): New.
10921 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10922 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10923 (Output_reloc<SHT_RELA>::is_symbolless): New.
10924 (Output_data_reloc::add_global): Handle is_symbolless.
10925 (Output_data_reloc::add_global_relative): Likewise.
10926 (Output_data_reloc::add_local): Likewise.
10927 (Output_data_reloc::add_local_relative): Likewise.
10928 (Output_data_reloc::add_symbolless_global_addend): New.
10929 (Output_data_reloc::add_symbolless_local_addend): New.
10930 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10931 is_symbolless.
10932 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10933 instead of ->is_relative_
10934 (Output_reloc::write): Likewise.
10935 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10936 (Output_reloc::write_rel): Simplify.
10937
10938 * sparc.cc (Target_sparc::Scan::local): Use
10939 ->add_symbolless_local_addend as needed.
10940 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10941 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10942 based upon relocation offset.
10943
10944 2010-02-11 Doug Kwan <dougkwan@google.com>
10945
10946 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10947 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10948 beginning of function.
10949 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10950 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10951 parameter is_32bit in calls to should_apply_static_reloc.
10952 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10953 (check_DATA): Add arm_abs_global.stdout.
10954 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10955 arm_abs_global.stdout): New rules.
10956 (MOSTLLYCLEANFILES): Add arm_abs_global
10957 * Makefile.in: Regenerate.
10958 * testsuite/arm_abs_global.s: New file.
10959 * testsuite/arm_abs_global.sh: Ditto.
10960 * testsuite/arm_abs_lib.s: Ditto.
10961
10962 2010-02-11 Ian Lance Taylor <iant@google.com>
10963
10964 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10965 Read_relocs task.
10966 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10967 Allocate_commons_task first.
10968 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10969 task, rather than symtab_lock_.
10970 (Gc_process_relocs::~Gc_process_relocs): New function.
10971 (Gc_process_relocs::is_runnable): Check this_blocker_.
10972 (Gc_process_relocs::locks): Use next_blocker_ rather than
10973 blocker_.
10974 (Scan_relocs::~Scan_relocs): New function.
10975 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10976 symtab_lock_.
10977 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10978 next_blocker_.
10979 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10980 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10981 constructor accordingly.
10982 (class Gc_process_relocs): Likewise.
10983 (class Scan_relocs): Likewise.
10984 * common.h (class Allocate_commons_task): Remove symtab_lock_
10985 field, and corresponding constructor parameter.
10986 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10987 symtab_lock_.
10988 (Allocate_commons_task::locks): Likewise.
10989
10990 2010-02-11 Ian Lance Taylor <iant@google.com>
10991
10992 * gold-threads.h (class Once): Define.
10993 (class Initialize_lock): Rewrite as child of Once.
10994 * gold-threads.cc (class Once_initialize): Define.
10995 (once_pointer_control): New static variable.
10996 (once_pointer, once_arg): New static variables.
10997 (c_run_once): New static function.
10998 (Once::Once, Once::run_once, Once::internal_run): New functions.
10999 (class Initialize_lock_once): Remove.
11000 (initialize_lock_control): Remove.
11001 (initialize_lock_pointer): Remove.
11002 (initialize_lock_once): Remove.
11003 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11004 (Initialize_lock::initialize): Rewrite.
11005 (Initialize_lock::do_run_once): New function.
11006 * archive.cc (Archive::interpret_header): Only clear name if it is
11007 not already empty.
11008 * fileread.cc: Include "gold-threads.h"
11009 (file_counts_lock): New static variable.
11010 (file_counts_initialize_lock): Likewise.
11011 (File_read::release): Only increment counts when using --stats.
11012 Use a lock around the increment.
11013 * parameters.cc (class Set_parameters_target_once): Define.
11014 (set_parameters_target_once): New static variable.
11015 (Parameters::Parameters): Move here from parameters.h.
11016 (Parameters::set_target): Rewrite.
11017 (Parameters::set_target_once): New function.
11018 (Parameters::clear_target): Move here and rewrite.
11019 * parameters.h (class Parameters): Update declarations. Add
11020 set_parameters_target_once_ field.
11021 (Parameters::Parameters): Move to parameters.cc.
11022 (Parameters::clear_target): Likewise.
11023 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11024 task.
11025 (Start_group::~Start_group): New function.
11026 (Start_group::is_runnable): New function.
11027 (Start_group::locks, Start_group::run): New functions.
11028 (Finish_group::run): Change saw_undefined to size_t.
11029 * readsyms.h (class Start_group): Define.
11030 (class Finish_group): Change saw_undefined_ field to size_t.
11031 (Finish_group::Finish_group): Remove saw_undefined and
11032 this_blocker parameters. Change all callers.
11033 (Finish_group::set_saw_undefined): New function.
11034 (Finish_group::set_blocker): New function.
11035 * symtab.h (class Symbol_table): Change saw_undefined to return
11036 size_t. Change saw_undefined_ field to size_t.
11037 * target-select.cc (Set_target_once::do_run_once): New function.
11038 (Target_selector::Target_selector): Initialize set_target_once_
11039 field. Don't initialize lock_ and initialize_lock_ fields.
11040 (Target_selector::instantiate_target): Rewrite.
11041 (Target_selector::set_target): New function.
11042 * target-select.h (class Set_target_once): Define.
11043 (class Target_selector): Update declarations. Make
11044 Set_target_once a friend. Remove lock_ and initialize_lock_
11045 fields. Add set_target_once_ field.
11046
11047 2010-02-10 Ian Lance Taylor <iant@google.com>
11048
11049 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11050 queueing any tasks.
11051 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11052 (queue_middle_tasks): Add all blockers before queueing any tasks.
11053 (queue_final_tasks): Likewise.
11054 * token.h (Task_token::add_blockers): New function.
11055 * object.h (Input_objects::number_of_relobjs): New function.
11056
11057 2010-02-10 Ian Lance Taylor <iant@google.com>
11058
11059 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11060 shared, not if not position independent.
11061 * x86_64.cc (Relocate::relocate_tls): Likewise.
11062 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11063 (tls_pie_pic_test): New target.
11064 * testsuite/Makefile.in: Rebuild.
11065
11066 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11067 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11068 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11069 * testsuite/Makefile.in: Rebuild.
11070
11071 2010-02-09 David S. Miller <davem@davemloft.net>
11072
11073 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11074 R_SPARC_RELATIVE using ->add_local_relative().
11075 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11076
11077 * output.h (Output_data_dynamic::add_section_size): New method
11078 that takes two Output_data objects.
11079 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11080 entry param. Handle it in initializers.
11081 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11082 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11083 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11084 arg.
11085 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11086 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11087 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11088 for dynrel_includes_plt.
11089 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11090 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11091 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11092 before .rela.plt
11093 (Target_sparc::do_finalize_sections): Update to pass true for
11094 dynrel_includes_plt.
11095 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11096 output before .rela.plt
11097 (Target_powerpc::do_finalize_sections): Update to pass true for
11098 dynrel_includes_plt when 32-bit.
11099
11100 2010-02-08 Doug Kwan <dougkwan@google.com>
11101
11102 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11103 method.
11104 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11105 Arm_relobj::scan_section_for_cortex_a8_stubs,
11106 Arm_relobj::do_relocation_section): Instead of calling
11107 Output_section::output_address, use faster
11108 Arm_relobj::simple_input_section_output_address.
11109
11110 2010-02-08 David S. Miller <davem@davemloft.net>
11111
11112 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11113 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11114 relocation helper function.
11115
11116 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11117 just like R_SPARC_GOT{10,13,22}.
11118 (Target_sparc::Scan::local): Likewise.
11119 (Target_sparc::Relocate:relocate): Likewise.
11120
11121 2010-02-06 Ian Lance Taylor <iant@google.com>
11122
11123 * configure.ac: Rewrite targetobjs duplicate removal code to use
11124 only shell constructs.
11125 * configure: Rebuild.
11126
11127 2010-02-05 Doug Kwan <dougkwan@google.com>
11128
11129 PR 11247
11130 * arm.cc (Arm_relobj::section_is_scannable): New method.
11131 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11132 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11133
11134 2010-02-04 Doug Kwan <dougkwan@google.com>
11135
11136 PR 11247
11137 * arm-reloc-property.cc (cstdio): Include.
11138 * configure.ac (targetobjs): Remove duplicates.
11139 * configure: Regenerate.
11140 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11141 big and little endian version for a given address size.
11142
11143 2010-02-03 Doug Kwan <dougkwan@google.com>
11144
11145 * arm-reloc-property.cc
11146 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11147 definition.
11148 * arm-reloc-property.h
11149 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11150 New method definition.
11151 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11152 declaration.
11153 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11154 overflow to N.
11155 (GOT_PREL): Change implemented to Y.
11156 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11157 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11158 (Arm_relocate_functions::movw_abs_nc): Remove method.
11159 (Arm_relocate_functions::movt_abs): Ditto.
11160 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11161 (Arm_relocate_functions::thm_movt_abs): Ditto.
11162 (Arm_relocate_functions::movw_rel_nc): Ditto.
11163 (Arm_relocate_functions::movw_rel): Ditto.
11164 (Arm_relocate_functions::movt_rel): Ditto.
11165 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11166 (Arm_relocate_functions:thm_movw_rel): Ditto.
11167 (Arm_relocate_functions:thm_movt_rel): Ditto.
11168 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11169 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11170 New method definitions.
11171 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11172 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11173 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11174 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11175 (Target_arm::Relocate::relocate): Check for non-static or
11176 unimplemented relocation code and exit early. Change calls to
11177 Target_arm::reloc_uses_thumb_bit and
11178 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11179 instead. Refactor code to handle similar relocations to increase
11180 code sharing. Remove check for unsupported relocation code in switch
11181 statement.
11182 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11183 relocation property table to find out size. Change error message to
11184 print out the name of a relocation code instead of the numeric value.
11185 (Target_arm::scan_reloc_for_stub): Use relocation property table
11186 instead of calling Target_arm::reloc_uses_thumb_bit().
11187
11188 2010-02-02 Doug Kwan <dougkwan@google.com>
11189
11190 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11191 types of relaxed input section.
11192
11193 2010-02-02 Doug Kwan <dougkwan@google.com>
11194
11195 * Makefile.am (HFILES): Add arm-reloc-property.h.
11196 (DEFFILES): New.
11197 (TARGETSOURCES): Add arm-reloc-property.cc
11198 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11199 (libgold_a_SOURCES): $(DEFFILES)
11200 * Makefile.in: Regenerate.
11201 * arm-reloc-property.cc: New file.
11202 * arm-reloc-property.h: New file.
11203 * arm-reloc.def: New file.
11204 * arm.cc: Update comments.
11205 (arm-reloc-property.h): New included header.
11206 (arm_reloc_property_table): New global variable.
11207 (Target_arm::do_select_as_default_target): New method definition.
11208 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11209 arm-reloc-property to targ_extra_obj.
11210 * parameters.cc (set_parameters_target): Call
11211 Target::select_as_default_target().
11212 * target.h (Target::select_as_default_target): New method definition.
11213 (Target::do_select_as_default_target): Same.
11214
11215 2010-02-01 Doug Kwan <dougkwan@google.com>
11216
11217 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11218 first_output_text_section_.
11219 (Arm_exidx_fixup::first_output_text_section): New method definition.
11220 (Arm_exidx_fixup::first_output_text_section_): New data member.
11221 (Arm_exidx_fixup::process_exidx_section): Record the first text
11222 output section seen.
11223 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11224 and entsize in output section header.
11225
11226 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11227
11228 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11229 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11230 (Arm_relocate_functions::thm_alu11): New Method.
11231 (Arm_relocate_functions::thm_pc8): New Method.
11232 (Arm_relocate_functions::thm_pc12): New Method.
11233 (Target_arm::Scan::local): Handle the relocations.
11234 (Target_arm::Scan::global): Likewise.
11235 (Target_arm::Relocate::relocate): Likewise.
11236 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11237
11238 2010-01-29 Doug Kwan <dougkwan@google.com>
11239
11240 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11241 of relocation types as ld.
11242
11243 2010-01-29 Doug Kwan <dougkwan@google.com>
11244
11245 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11246 to public.
11247 (Arm_relocate_functions::thumb_branch_common): Ditto.
11248 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11249 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11250 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11251 Arm_relocate_functions::jump24): Remove.
11252 (Target_arm::Relocate::relocate): Adjust code to call
11253 Arm_relocation_functions::arm_branch_common and
11254 Arm_relocation_functions::thumb_branch_common instead of their removed
11255 wrappers. Merge switch-cases together to reduce source code size.
11256
11257 2010-01-29 Doug Kwan <dougkwan@google.com>
11258
11259 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11260 output_local_symbol_count_needs_update_.
11261 (Arm_relobj::output_local_symbol_count_needs_update,
11262 Arm_relobj::set_output_local_symbol_count_needs_update,
11263 Arm_relobj::update_output_local_symbol_count): New methods.
11264 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11265 member.
11266 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11267 of pointed function as in a R_ARM_PREL31 relocation.
11268 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11269 for output local symbol count updating.
11270 (Target_arm::do_relax): Update output local symbol counts in objects
11271 if necessary.
11272 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11273
11274 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11275
11276 * arm.cc: Added support for the ARM relocations:
11277 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11278 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11279 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11280 movw_prel_nc).
11281 (Arm_relocate_functions::movw_rel): New method.
11282 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11283 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11284 thm_movw_prel_nc).
11285 (Arm_relocate_functions::thm_movw_rel): New method.
11286 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11287 thm_movt_prel).
11288 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11289 relocations.
11290 (Target_arm::Scan::global): Likewise.
11291 (Target_arm::Relocate::relocate): Likewise.
11292 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11293 Likewise.
11294
11295 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11296
11297 * arm.cc: Added support for ARM group relocations.
11298 (Target_arm::reloc_needs_sym_origin): New method.
11299 (Arm_relocate_functions::calc_grp_kn): New method.
11300 (Arm_relocate_functions::calc_grp_residual): New method.
11301 (Arm_relocate_functions::calc_grp_gn): New method.
11302 (Arm_relocate_functions::arm_grp_alu): New Method.
11303 (Arm_relocate_functions::arm_grp_ldr): New Method.
11304 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11305 (Arm_relocate_functions::arm_grp_ldc): New Method.
11306 (Target_arm::Scan::local): Handle the ARM group relocations.
11307 (Target_arm::Scan::global): Likewise.
11308 (Target_arm::Relocate::relocate): Likewise.
11309 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11310 Likewise.
11311
11312 2010-01-26 Doug Kwan <dougkwan@google.com>
11313
11314 * arm.cc (set): Include.
11315 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11316 pointer type.
11317 (Arm_output_section::Text_section_list): New type.
11318 (Arm_output_section::append_text_sections_to_list): New method.
11319 (Arm_output_section::fix_exidx_coverage): Ditto.
11320 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11321 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11322 Relobj::set_section_offset() instead of
11323 Sized_relobj::invalidate_section_offset().
11324 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11325 parameter for section headers. Ignore relocation sections for
11326 unallocated sections and EXIDX sections.
11327 (Target_arm::fix_exidx_coverage): New method.
11328 (Target_arm::output_section_address_less_than): New type.
11329 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11330 linked text section instead of the EXIDX section.
11331 (Arm_output_section::create_stub_group): Add an assertion to check
11332 that this is not an EXIDX output section.
11333 (Arm_output_section::append_text_sections_to_list): New method.
11334 (Arm_output_section::fix_exidx_coverage): Ditto.
11335 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11336 Arm_relobj::section_needs_reloc_stub_scanning.
11337 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11338 first pass.
11339 (Target_arm::fix_exidx_coverage): New method.
11340 * object.h (Relobj::set_output_section): New method.
11341 (Sized_relobj::invalidate_section_offset): Remove method.
11342 (Sized_relobj::do_invalidate_section_offset): Remove method.
11343 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11344
11345 2010-01-25 Doug Kwan <dougkwan@google.com>
11346
11347 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11348 Fix warning due to signed and unsigned comparison on a 32-bit host.
11349
11350 2010-01-22 Doug Kwan <dougkwan@google.com>
11351
11352 * arm.cc (Target_arm::do_relax): Record an output section for section
11353 offset adjustment it contains any stub table that has changed.
11354 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11355 offsets in an output section if necessary.
11356 * output.cc (Output_section::Output_section): Initialize
11357 section_offsets_need_adjustments_.
11358 (Output_section::add_input_section_for_script): Renamed to
11359 Output_section::add_simple_input_section.
11360 (Output_section::save_states): Add a comment.
11361 (Output_section::discard_states): New method defintion.
11362 (Output_section::adjust_section_offsets): Same.
11363 * output.h (Output_section::add_input_section_for_script): Renamed to
11364 Output_section::add_simple_input_section.
11365 (Output_section::discard_states): New method declaration.
11366 (Output_section::adjust_section_offsets): Same.
11367 (Output_section::section_offsets_need_adjustment,
11368 Output_section::set_section_offsets_need_adjustment): New method
11369 definitions.
11370 (Output_section::section_offsets_need_adjustment_): New data member.
11371 * script-sections.cc
11372 (Output_section_element_input::set_section_address): Adjust code for
11373 renaming of Output_section::add_input_section_for_script.
11374 (Orphan_output_section::set_section_address): Same.
11375
11376 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11377
11378 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11379 Fix_v4bx enum values .
11380 * gold/options.h (General_options): New option definitions.
11381 (General_options::fix_v4bx): New method.
11382 (General_options::Fix_v4bx): New enum.
11383 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11384 (General_options::parse_fix_v4bx_interworking): New method.
11385
11386 2010-01-22 Doug Kwan <dougkwan@google.com>
11387
11388 * arm.cc (Arm_exidx_fixup): New class.
11389
11390 2010-01-21 Doug Kwan <dougkwan@google.com>
11391
11392 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11393 classes.
11394 (Arm_exidx_section_offset_map): New type.
11395
11396 2010-01-21 Doug Kwan <dougkwan@google.com>
11397
11398 * arm.cc (Arm_exidx_input_section): New class.
11399 (Arm_relobj::exidx_input_section_by_link,
11400 Arm_relobj::exidx_input_section_by_shndx,
11401 Arm_relobj::make_exidx_input_section): New methods.
11402 (read_arm_attributes_section): Remove.
11403 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11404 information about them.
11405 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11406 to here.
11407
11408 2010-01-20 Doug Kwan <dougkwan@google.com>
11409
11410 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11411 Input_section_specifier to Section_id.
11412 (Target_arm::new_arm_input_section: Adjust code for change of key
11413 type.
11414 (Target_arm::find_arm_input_section): Ditto.
11415 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11416 (Section_id): Remove.
11417 (Garbage_collection::Section_id_hash): Remove.
11418 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11419 (Section_id): Remove.
11420 (Icf::Section_id_hash): Remove.
11421 * object.h (Section_id, Const_section_id, Section_id_hash,
11422 Const_section_id_hash): New type definitions.
11423 * output.cc (Output_section::add_relaxed_input_section): Change to
11424 use Const_section_id instead of Input_section_specifier as key type.
11425 (Output_section::add_merge_input_section): Ditto.
11426 (Output_section::build_relaxation_map): Change to use Section_id
11427 instead of Input_section_specifier as key type.
11428 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11429 Ditto.
11430 (Output_section::convert_input_sections_to_relaxed_sections): Change
11431 to use Const_section_id instead of Input_section_specifier as key type.
11432 (Output_section::find_merge_section): Ditto.
11433 (Output_section::find_relaxed_input_section): Ditto.
11434 * output.h (Input_section_specifier): Remove class.
11435 (Output_section::Output_section_data_by_input_section_map): Change
11436 key type to Const_section_id.
11437 (Output_section::Output_relaxed_input_section_by_input_section_map):
11438 Ditto.
11439 (Output_section::Relaxation_map): Change key type to Section_id.
11440
11441 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11442
11443 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11444 (class Arm_v4bx_stub): New class.
11445 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11446 (Stub_factory::make_arm_v4bx_stub): New method.
11447 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11448 (Stub_table::empty): Handle v4bx stubs.
11449 (Stub_table::add_arm_v4bx_stub): New method.
11450 (Stub_table::find_arm_v4bx_stub): New method.
11451 (Arm_relocate_functions::v4bx): New method.
11452 (Target_arm::fix_v4bx): New method.
11453 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11454 (Stub_table::relocate_stubs): Likewise.
11455 (Stub_table::do_write): Likewise.
11456 (Stub_table::update_data_size_and_addralign): Likewise.
11457 (Stub_table::finalize_stubs): Likewise.
11458 (Target_arm::Scan::local): Likewise.
11459 (Target_arm::Scan::global): Likewise.
11460 (Target_arm::do_finalize_sections): Likewise.
11461 (Target_arm::Relocate::relocate): Likewise.
11462 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11463 Likewise.
11464 (Target_arm::scan_reloc_for_stub): Likewise.
11465 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11466
11467 2010-01-19 Ian Lance Taylor <iant@google.com>
11468
11469 * output.cc (Output_section_headers::do_sized_write): Write large
11470 segment count to sh_info field.
11471 (Output_file_header::do_sized_write): For large segment count,
11472 write PN_XNUM to e_phnum field.
11473
11474 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11475
11476 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11477 (Arm_relocate_functions::thm_jump8): New function.
11478 (Arm_relocate_functions::thm_jump11): New function.
11479 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11480 R_ARM_THM_JUMP11.
11481 (Target_arm::Scan::global): Likewise.
11482 (Target_arm::Relocate::relocate): Likewise.
11483 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11484 Likewise.
11485
11486 2010-01-14 Doug Kwan <dougkwan@google.com>
11487
11488 * arm.cc (map, utility): Include headers.
11489 (Target_arm::apply_cortex_a8_workaround): New method.
11490 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11491 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11492 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11493 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11494 the --[no-]fix-cortex-a8 command line options.
11495 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11496 (Target_arm::relocate_stub): Use addend in instruction template.
11497 * options.h (DEFINE_bool): Set the user-set flag.
11498 (General_options): Add --[no-]-fix-cortex options.
11499 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11500 : Update fast look-up map after conversion.
11501
11502 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11503
11504 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11505 in the first pass of do_layout.
11506
11507 2010-01-13 Doug Kwan <dougkwan@google.com>
11508
11509 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11510 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11511 apparent compiler problem of not folding static constant integral
11512 data members of elfcpp::Elf_sizes<32>.
11513
11514 2010-01-13 Doug Kwan <dougkwan@google.com>
11515
11516 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11517 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11518 Arm_relobj::scan_section_for_cortex_a8_erratum,
11519 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11520 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11521 sections to scan for relocation stubs into a new method
11522 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11523 relocation and Cortex-A8 stub scanning.
11524 (Target_arm::do_relax): Force stubs to be after stubbed sections
11525 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11526 the beginning of a new relaxation pass. Update a comment.
11527 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11528
11529 2010-01-12 Ian Lance Taylor <iant@google.com>
11530
11531 * target-reloc.h (visibility_error): New inline function.
11532 (relocate_section): Call visibility_error.
11533 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11534 (MOSTLYCLEANFILES): Likewise.
11535 (protected_4_pic.o, protected_3.err): New targets.
11536 * testsuite/protected_4.cc: New file.
11537
11538 2010-01-12 Doug Kwan <dougkwan@google.com>
11539
11540 * arm.cc (Cortex_a8_reloc): New class.
11541 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11542 and cortex_a8_relocs_info_.
11543 (Target_arm::fix_cortex_a8): New method definition.
11544 (Target_arm::Cortex_a8_relocs_info): New type.
11545 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11546 New data member declarations.
11547 (Target_arm::scan_reloc_for_stub): Record information about
11548 relocations for THUMB branches that might be exempted from the
11549 Cortex-A8 workaround.
11550 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11551 at the beginning of a relaxation pass.
11552
11553 2010-01-12 Doug Kwan <dougkwan@google.com>
11554
11555 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11556 (Arm_relobj::Mapping_symbol_position,
11557 Arm_reloj::Mapping_symbol_position_less,
11558 Arm_relobj::Mapping_symbols_info): New types.
11559 (Target_arm::is_mapping_symbol_name): New method definition.
11560 (Arm_relobj::do_count_local_symbols): Save information about mapping
11561 symbols.
11562
11563 2010-01-11 Doug Kwan <dougkwan@google.com>
11564
11565 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11566 Arm_relocate_functions::thumb32_branch_upper,
11567 Arm_relocate_functions::thumb32_branch_lower,
11568 Arm_relocate_functions::thumb32_cond_branch_offset,
11569 Arm_relocate_functions::thumb32_cond_branch_upper,
11570 Arm_relocate_functions::thumb32_cond_branch_lower,
11571 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11572 branch offset encoding.
11573 (Arm_relocate_functions::thumb_branch_common): Use new branch
11574 offset encoding methods to avoid code duplication.
11575 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11576 (Stub_addend_reader::operator()): Use new branch encoding method
11577 to avoid code duplication.
11578
11579 2010-01-11 Doug Kwan <dougkwan@google.com>
11580
11581 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11582 (Target_arm::do_finalize_sections): Define special EXIDX section
11583 symbols only if referenced.
11584 * gc.h (Garbage_collection::add_reference): New method.
11585 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11586 code duplication.
11587
11588 2010-01-11 Ian Lance Taylor <iant@google.com>
11589
11590 * script.cc (Version_script_info::build_expression_list_lookup):
11591 Change complaing about duplicate wildcard match from error to
11592 warning.
11593
11594 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11595 of 2009-12-30.
11596 (Version_script_info::Version_script_info): Initialize globs_,
11597 default_version_, default_is_global_, and exact_. Don't
11598 initialize globals_ or locals_.
11599 (Version_script_info::build_lookup_tables): Build local symbols
11600 first.
11601 (Version_script_info::unquote): New function.
11602 (Version_script_info::add_exact_match): New function.
11603 (Version_script_info::build_expression_list_lookup): Remove lookup
11604 parameter. Add is_global parameter. Change all callers. Handle
11605 wildcard pattern specially. Unquote pattern. Call
11606 add_exact_match.
11607 (Version_script_info::get_name_to_match): New function.
11608 (Version_script_info::get_symbol_version): New function.
11609 (Version_script_info::get_symbol_version_helper): Remove.
11610 (Version_script_info::check_unmatched_names): Call unquote.
11611 * script.h (class Version_script_info): Change get_symbol_version
11612 to be non-inline and add is_global parameter; change all callers.
11613 Rewrite symbol_is_local. Update declarations. Define struct
11614 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11615 Remove globals_ and locals_ members. Add exact_, globs_,
11616 default_version_, is_global_.
11617 (Version_script_info::Glob): Remove pattern, add expression and
11618 is_global. Update constructor. Change all callers.
11619 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11620 default version.
11621 (Versions::symbol_section_contents): If a symbol is undefined, or
11622 defined in a dynamic object, set the version index to
11623 VER_NDX_LOCAL.
11624 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11625 symbol_is_local.
11626 (Symbol_table::add_from_pluginobj): Likewise.
11627 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11628
11629 2010-01-11 Doug Kwan <dougkwan@google.com>
11630
11631 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11632 (incremental_dump_LDADD): Add linking option for libintl.
11633 * Makefile.in: Regenerate.
11634
11635 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11636
11637 PR gold/11144
11638 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11639 instead of -Ds.
11640 * testsuite/Makefile.in: Regenerated.
11641
11642 2010-01-10 Doug Kwan <dougkwan@google.com>
11643
11644 * options.h (DEFINE_var): Use parentheses around argument varname__
11645 in macro body to avoid any unintended subsequent substitutions.
11646
11647 2010-01-10 Ian Lance Taylor <iant@google.com>
11648
11649 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11650 candidates before doing symbol resolution.
11651
11652 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11653 ODR candidates if only one is weak.
11654
11655 2010-01-08 Ian Lance Taylor <iant@google.com>
11656
11657 * script.cc (Version_script_info::build_expression_list_lookup):
11658 Don't warn about ambiguous version, just record the ambiguity.
11659 (Version_script_info::get_symbol_version_helper): Give error if
11660 version is ambiguous.
11661
11662 2010-01-08 Doug Kwan <dougkwan@google.com>
11663
11664 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11665 prev_data_size_ and prev_addralign_. Remove initializer for
11666 deleted data member has_been_changed_.
11667 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11668 to determine if the table is empty.
11669 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11670 Remove.
11671 (Stub_table::add_reloc_stub): Define method in class definition
11672 instead of just declaring it there.
11673 (Stub_table::add_cortex_a8_stub): New method definition.
11674 (Stub_table::update_data_size_and_addralign): Ditto.
11675 (Stub_table::finalize_stubs): Ditto.
11676 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11677 (Stub_table::do_addralign_): Return address alignment in the
11678 (Stub_table::do_reset_address_and_file_offset): Define method in
11679 class definition instead of declaring it there. Set current data
11680 size to be the data size of the previous pass.
11681 (Stub_table::set_final_data_size): Use current data size as the
11682 final data size.
11683 (Stub_table::relocate_stub): Change parameter type of stub from
11684 Reloc_stub pointer to Stub pointer.
11685 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11686 (Stub_table::Cortex_a8_stub_list): New typedef.
11687 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11688 Stub_table::prev_addralign_): New data member.
11689 (Arm_relobj::Arm_relobj): Initialize data member
11690 section_has_cortex_a8_workaround_.
11691 (Arm_relobj::section_has_cortex_a8_workaround,
11692 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11693 definitions.
11694 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11695 declarations.
11696 (Target_arm::relocate_stub): Change parameter type of stub from
11697 Reloc_stub pointer to Stub pointer.
11698 (Insn_template::size, Insn_template::alignment): Handle
11699 THUMB16_SPECIAL_TYPE.
11700 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11701 Stub_table::update_data_size_and_addralign,
11702 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11703 definitions.
11704 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11705 (Stub_table::do_write): Ditto.
11706 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11707
11708 2010-01-08 Ian Lance Taylor <iant@google.com>
11709
11710 PR 11108
11711 * symtab.h (class Symbol): Remove fields is_target_special_ and
11712 has_plt_offset_. Add field is_defined_in_discarded_section_.
11713 (Symbol::is_defined_in_discarded_section): New function.
11714 (Symbol::set_is_defined_in_discarded_section): New function.
11715 (Symbol::has_plt_offset): Rewrite.
11716 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11717 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11718 Don't initialize is_target_special_ or has_plt_offset_.
11719 Initialize is_defined_in_discarded_section_.
11720 (Symbol_table::add_from_relobj): If appropriate, set
11721 is_defined_in_discarded_section.
11722 * resolve.cc (Symbol::override_base_with_special): Don't test
11723 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11724 * target-reloc.h (relocate_section): Do special handling for
11725 symbols defined in discarded sections for global symbols as well
11726 as local symbols.
11727
11728 2010-01-08 Ian Lance Taylor <iant@google.com>
11729
11730 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11731 the SHT_SYMTAB case.
11732
11733 2010-01-08 Ian Lance Taylor <iant@google.com>
11734
11735 * object.cc (Sized_relobj::do_layout): Don't get confused if
11736 layout_eh_frame returns NULL.
11737
11738 2010-01-08 Ian Lance Taylor <iant@google.com>
11739
11740 PR 11084
11741 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11742 dynamic symbol table, use the normal symbol table.
11743 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11744 symbol table.
11745
11746 2010-01-08 Ian Lance Taylor <iant@google.com>
11747
11748 PR 11072
11749 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11750 sections.
11751
11752 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11753
11754 * version.cc (print_version): Change to "Copyright 2010".
11755
11756 2010-01-08 Ian Lance Taylor <iant@google.com>
11757
11758 PR 10287
11759 PR 11063
11760 * i386.cc (class Target_i386): Change return type of plt_section
11761 to be non-const.
11762 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11763 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11764 tls_desc_rel_ field.
11765 (Output_data_plt_i386::rel_tls_desc): New function.
11766 (Target_i386::rel_tls_desc_section): New function.
11767 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11768 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11769 R_386_TLS_DESC reloc in rel_tls_desc_section.
11770 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11771 Define struct Tlsdesc_info.
11772 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11773 (Target_x86_64::do_reloc_symbol_index): New function.
11774 (Target_x86_64::add_tlsdesc_info): New function.
11775 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11776 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11777 tlsdesc_rel_ field.
11778 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11779 all callers.
11780 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11781 (Target_x86_64::rela_tlsdesc_section): New function.
11782 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11783 handling.
11784 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11785 (Target_x86_64::do_reloc_addend): New function.
11786 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11787 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11788 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11789 (Output_reloc::type): New function.
11790 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11791 (Output_reloc::is_target_specific): New function.
11792 (Output_reloc::target_arg): New function.
11793 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11794 absolute relocs and target specific relocs.
11795 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11796 add_target_specific.
11797 (class Output_data_reloc) [SHT_RELA]: Likewise.
11798 * output.cc (Output_reloc::Output_reloc): Add four new versions
11799 for absolute relocs and target specific relocs.
11800 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11801 (Output_reloc::get_symbol_index): Likewise.
11802 (Output_reloc::local_section_offset): Check that local_sym_index_
11803 is not TARGET_CODE or 0.
11804 (Output_reloc::symbol_value): Likewise.
11805 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11806 reloc.
11807 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11808 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11809 functions.
11810 * layout.cc (add_target_dynamic_tags): Use output section for
11811 DT_PLTRELSZ and DT_JMPREL.
11812
11813 2010-01-07 Ian Lance Taylor <iant@google.com>
11814
11815 PR 11061
11816 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11817 function.
11818 (class Output_data_reloc_generic): Define.
11819 (class Output_data_reloc_base): Change base class to
11820 Output_data_reloc_generic. Change add() method to call
11821 bump_relative_reloc_count for a relative reloc. Remove
11822 sort_relocs_ field.
11823 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11824 to sort_relocs().
11825 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11826 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11827 appropriate.
11828 * layout.h (class Layout): Update declaration.
11829
11830 2010-01-07 Ian Lance Taylor <iant@google.com>
11831
11832 * output.h (class Output_data): Add const version of
11833 output_section and do_output_section.
11834 (class Output_section_data): Add const version of
11835 do_output_section.
11836 (class Output_section): Likewise.
11837 * layout.cc (Layout::add_target_dynamic_tags): New function.
11838 * layout.h (class Layout): Update declarations.
11839 * arm.cc (Target_arm::do_finalize_sections): Use
11840 add_target_dynamic_tags.
11841 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11842 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11843 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11844 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11845
11846 2010-01-07 Ian Lance Taylor <iant@google.com>
11847
11848 PR 11042
11849 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11850 object as needed.
11851
11852 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11853 Ian Lance Taylor <iant@google.com>
11854
11855 PR 11019
11856 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11857 Xindex::read_symtab_xindex.
11858
11859 2010-01-07 Doug Kwan <dougkwan@google.com>
11860
11861 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11862 (Insn_template::thumb16_bcond_insn): New method declaration.
11863 (Insn_template): Fix spelling.
11864 (Stub::thumb16_special): New method declaration.
11865 (Stub::do_write): Define virtual method which was previously pure
11866 virtual.
11867 (Stub::do_thumb16_special): New method declaration.
11868 (Stub::do_fixed_endian_write): New template member.
11869 (Reloc_stub::do_write): Remove.
11870 (Reloc_stub::do_fixed_endian_write): Remove.
11871 (Cortex_a8_stub): New class definition.
11872 (Stub_factory::make_cortex_a8_stub): New method definition.
11873 (Stub_factory::Stub_factory): Add missing static storage class
11874 qualifier for elf32_arm_stub_a8_veneer_blx.
11875
11876 2010-01-07 Ian Lance Taylor <iant@google.com>
11877
11878 PR 10980
11879 * options.h (class General_options): Add --warn-unresolved-symbols
11880 and --error-unresolved-symbols.
11881 * errors.cc (Errors::undefined_symbol): Implement
11882 --warn-unresolved-symbols.
11883
11884 * options.h (class General_options): Add -z text and -z textoff.
11885 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11886
11887 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11888
11889 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11890 (Garbage_collection::cident_sections): New function.
11891 (Garbage_collection::add_cident_section): New function.
11892 (Garbage_collection::cident_sections_): New member.
11893 (gc_process_relocs): Add references to sections whose names are C
11894 identifiers.
11895 * gold.h (cident_section_start_prefix): New constant.
11896 (cident_section_stop_prefix): New constant.
11897 (is_cident): New function.
11898 * layout.cc (Layout::define_section_symbols): Replace string constants
11899 with the newly defined constants.
11900 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11901 C identifiers.
11902 * testsuite/Makefile.am: Add gc_orphan_section_test.
11903 * testsuite/Makefile.in: Regenerate.
11904 * testsuite/gc_orphan_section_test.cc: New file.
11905 * testsuite/gc_orphan_section_test.sh: New file.
11906
11907 2010-01-06 Ian Lance Taylor <iant@google.com>
11908
11909 PR 10980
11910 * options.h (class General_options): Add --warn-shared-textrel.
11911 * layout.cc (Layout::finish_dynamic_section): Implement
11912 --warn-shared-textrel.
11913
11914 PR 10980
11915 * options.h (class General_options): Add --warn-multiple-gp.
11916
11917 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11918
11919 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11920 $(THREADSLIB) and $(LIBDL).
11921 * Makefile.in: Rebuild.
11922
11923 2010-01-06 Ian Lance Taylor <iant@google.com>
11924
11925 PR 10980
11926 * options.cc (General_options::parse_section_start): New function.
11927 (General_options::section_start): New function.
11928 (General_options::General_options): Initialize all members.
11929 * options.h: Include <map>
11930 (class General_options): Add --section-start. Add section_starts_
11931 member.
11932 * layout.cc (Layout::attach_allocated_section_to_segment): If
11933 --section-start was used, set the address of the segment. Remove
11934 local sort_sections.
11935 (Layout::relaxation_loop_body): If the address of the load segment
11936 has been set by --section-start, don't use it.
11937 * output.h (Output_segment::update_flags_for_output_section): New
11938 function.
11939 * output.cc (Output_segment::add_output_section): Call
11940 update_flags_for_output_section.
11941
11942 2010-01-05 Ian Lance Taylor <iant@google.com>
11943
11944 PR 10980
11945 * options.h (class General_options): Add --undefined-version.
11946 * script.cc (struct Version_expression): Add was_matched_by_symbol
11947 field.
11948 (Version_script_info::matched_symbol): New function.
11949 (Version_script_info::get_symbol_version_helper): Call
11950 matched_symbol.
11951 (Version_script_info::check_unmatched_names): New function.
11952 * script.h (class Version_script_info): Update declarations.
11953 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11954
11955 * options.h (class General_options): Use DEFINE_bool_alias for
11956 allow_multiple_definition.
11957 * resolve.cc (Symbol_table::should_override): Don't test
11958 allow_multiple_definition.
11959
11960 PR 10980
11961 * options.h (class General_options): Add --cref.
11962 * main.cc (main): Print cref table if --cref. Don't close mapfile
11963 until after printing cref table.
11964 * cref.cc: Include "symtab.h".
11965 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11966 (Cref_table_compare::operator()): New function.
11967 (Cref_inputs::gather_cref): New function.
11968 (filecol): New static const.
11969 (Cref_inputs::print_cref): New function.
11970 (Cref::print_cref): New function.
11971 * cref.h: Include <cstdio>.
11972 (class Cref): Update declarations.
11973 * mapfile.h (Mapfile::file): New function.
11974 * object.h (class Object): Define Symbols. Declare virtual
11975 do_get_global_symbols.
11976 (Object::get_global_symbols): New function.
11977 * object.cc (Input_objects::add_object): Pass object to cref_ if
11978 --cref.
11979 (Input_objects::archive_start): Likewise.
11980 (Input_objects::archive_stop): Likewise.
11981 (Input_objects::print_cref): New function.
11982 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11983 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11984 --cref.
11985 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11986 function.
11987 * plugin.h (class Sized_pluginobj): Update declarations.
11988
11989 2010-01-05 Ian Lance Taylor <iant@google.com>
11990
11991 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11992 to is_default_version. Rename insdef to insdefault.
11993 (Symbol_table::add_from_relobj): Rename def to is_default_version
11994 and local to is_forced_local.
11995 (Symbol_table::add_from_pluginobj): Likewise.
11996 (Symbol_table::add_from_dynobj): Likewise.
11997 (Symbol_table::define_special_symbol): Rename insdef to
11998 insdefault.
11999
12000 2010-01-04 Ian Lance Taylor <iant@google.com>
12001
12002 PR 10980
12003 * options.h (class General_options): Add
12004 --allow-multiple-definition and -z muldefs.
12005 * resolve.cc (Symbol_table::should_override): Don't warn about a
12006 multiple symbol definition if --allow-multiple-definition or -z
12007 muldefs.
12008
12009 PR 10980
12010 * options.h (class General_options): Add --add-needed and
12011 --copy-dt-needed-entries. Tweak --as-needed help entry.
12012 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12013 error if --copy-dt-needed-entries aka --add-needed is used and
12014 would cause a change in behaviour.
12015
12016 PR 10980
12017 * options.h (class General_options): Add -G as a short version of
12018 --shared. Add no-op options -assert, -g, and -i.
12019
12020 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12021
12022 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12023 check for .text or .gnu.linkonce.t sections.
12024 * icf.cc (Icf::find_identical_sections): Ditto.
12025 Change the detection for mangled function name within the section
12026 name.
12027 * icf.h (is_section_foldable_candidate): New function.
12028
12029 2009-12-30 Ian Lance Taylor <iant@google.com>
12030
12031 PR 10980
12032 * options.h (class General_options): Permit two dashes with
12033 --retain-symbols-file.
12034
12035 2009-12-30 Ian Lance Taylor <iant@google.com>
12036
12037 PR 10979
12038 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12039 don't put the file header and segment headers in the text
12040 segment.
12041
12042 PR 10979
12043 * common.cc (Sort_commons::operator()): Stabilize sort when both
12044 entries are NULL.
12045 (Symbol_table::do_allocate_commons_list): When allocating common
12046 symbols, skip a symbol which is no longer common.
12047 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12048 an object before checking its type.
12049 * testsuite/common_test_2.c: New file.
12050 * testsuite/common_test_3.c: New file.
12051 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12052 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12053 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12054 (common_test_2_pic.o, common_test_2.so): New targets.
12055 (common_test_3_pic.o, common_test_3.so): New targets.
12056 * testsuite/Makefile.in: Rebuild.
12057
12058 PR 10979
12059 * script.cc (read_input_script): If we see a new SECTIONS clause,
12060 and we have added an input section, give an error.
12061 * layout.h (class Layout): Add have_added_input_section function.
12062 Add have_added_input_section_ field.
12063 * layout.cc (Layout::Layout): Initialize
12064 have_added_input_section_.
12065 (Layout::layout): Set have_added_input_section_.
12066 (Layout::layout_eh_frame): Likewise.
12067
12068 2009-12-30 Ian Lance Taylor <iant@google.com>
12069
12070 PR 10931
12071 * options.h (class General_options): Add --sort-common option.
12072 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12073 * common.cc (Sort_common): Add sort_order parameter to
12074 constructor. Add sort_order_ field.
12075 (Sort_commons::operator): Check sort_order_.
12076 (Symbol_table::allocate_commons): Determine the sort order.
12077 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12078 Change all callers.
12079 (Symbol_table::do_allocate_commons_list): Likewise.
12080
12081 2009-12-30 Ian Lance Taylor <iant@google.com>
12082
12083 PR 10916
12084 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12085 symbols from this object, don't change the visibility of an
12086 undefined symbol.
12087 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12088
12089 2009-12-30 Ian Lance Taylor <iant@google.com>
12090
12091 PR 10861
12092 * script.h (class Version_script_info): Define Language enum.
12093 Update declarations. Define Glob, Exact, and Lookup types. Add
12094 new fields globals_, locals_, and is_finalized_.
12095 * script.cc: Various formatting fixes.
12096 (class Parser_closure): Change language_stack_ from a vector of
12097 std::string to one of Version_script_info::Language. Adjust all
12098 uses accordingly.
12099 (class Lazy_demangler): Remove.
12100 (struct Version_expression): Change language from std::string to
12101 Version_script_info::Language.
12102 (Version_script_info::Version_script_info): New function.
12103 (Version_script_info::~Version_script_info): Don't call clear.
12104 (Version_script_info::finalize): New function.
12105 (Version_script_info::build_lookup_tables): New function.
12106 (Version_script_info::build_expression_list_lookup): New
12107 function.
12108 (Version_script_info::get_symbol_version_helper): Rewrite to use
12109 lookup tables.
12110 (Version_script_info::print_expression_list): Adjust to use
12111 Version_script_info::Language.
12112 (script_push_lex_into_version_mode): Check that the version script
12113 has not been finalized.
12114 (version_script_push_lang): Change language string to
12115 Version_script_info::Language.
12116 * options.cc (Command_line::version_script): New function.
12117 * options.h (class General_options): Add finalize_dynamic_list
12118 function. Change version_script from declaration to definition.
12119 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12120 * testsuite/version_script.map: Remove duplicate def of foo.
12121 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12122 version_script.map.
12123 * testsuite/Makefile.in: Rebuild.
12124
12125 2009-12-30 Ian Lance Taylor <iant@google.com>
12126
12127 PR 10843
12128 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12129 if the input symbol index is 0, make the output symbol index 0.
12130
12131 2009-12-30 Ian Lance Taylor <iant@google.com>
12132
12133 PR 10670
12134 * options.h (class General_options): Add -x/--discard-all.
12135 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12136 --discard-all. If the local symbol needs a dynamic entry, check
12137 that before handling --discard-locals.
12138
12139 2009-12-30 Ian Lance Taylor <iant@google.com>
12140
12141 PR 10450
12142 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12143 flags to PF_R.
12144 (Output_segment::add_output_section): Don't change the flags if
12145 the type is PT_TLS.
12146
12147 PR 10450
12148 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12149 GNU hash table if they need a dynamic value. Otherwise, don't add
12150 them if they are defined in a dynamic object or are forced local.
12151
12152 2009-12-29 Ian Lance Taylor <iant@google.com>
12153
12154 PR 10450
12155 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12156 .gnu.hash table for a 32-bit target.
12157
12158 PR 10450
12159 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12160 regular and a dynamic object only needs a dynamic symbol table
12161 entry if it is externally visible.
12162
12163 PR 10450
12164 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12165 constructor. Add global_offset_table_ field.
12166 (Target_i386::got_section): Set global_offset_table_.
12167 (Target_i386::do_finalize_sections): Set global_offset_table_
12168 size.
12169 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12170 in constructor. Add global_offset_table_ field.
12171 (Target_x86_64::got_section): Set global_offset_table_.
12172 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12173 size.
12174
12175 * layout.cc (Layout::Layout): Initialize increase_relro_.
12176 (Layout::get_output_section): Add is_relro, is_last_relro, and
12177 is_first_non_relro parameters. Change all callers.
12178 (Layout::choose_output_section): Likewise.
12179 (Layout::add_output_section_data): Likewise.
12180 (Layout::make_output_section): Likewise.
12181 (Layout::set_segment_offsets): Clear increase_relro when using a
12182 linker script.
12183 * layout.h (class Layout): Add increase_relro method. Add
12184 increase_relro_ field. Update declarations.
12185 * output.cc (Output_section::Output_section): Initialize
12186 is_last_relro_ and is_first_non_relro_.
12187 (Output_segment::add_output_section): Group relro sections is
12188 do_sort is true. Handle is_last_relro and is_first_non_relro.
12189 (Output_segment::maximum_alignment): Remove relro handling.
12190 (Output_segment::set_section_addresses): Add increase_relro
12191 parameter. Change all callers. Add initial alignment to align
12192 relro sections on separate page. Remove old relro handling.
12193 (Output_segment::set_section_list_addresses): Remove in_relro
12194 parameter. Change all callers.
12195 (Output_segment::set_offset): Add increase parameter. Change all
12196 callers. Remove old relro handling.
12197 * output.h (class Output_section): Add new methods: is_last_relro,
12198 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12199 Add is_last_relro_ and is_first_non_relro_ fields.
12200 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12201 Create separate .got.plt section. Call increase_relro.
12202 * x86_64.cc (Target_x86_64::got_section): Likewise.
12203 * testsuite/relro_script_test.t: Add .got.plt.
12204
12205 PR 10450
12206 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12207 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12208 (Layout::finalize): Call set_dynamic_symbol_size.
12209 (Layout::set_dynamic_symbol_size): New function.
12210 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12211 set_dynamic_symbol_size.
12212
12213 PR 10450
12214 * output.h (class Output_section): Add is_entsize_zero_ field.
12215 * output.cc (Output_section::Output_section): Initialize
12216 is_entsize_zero_.
12217 (Output_section::set_entsize): If two different entsizes are
12218 requested, force it to zero.
12219 (Output_section::add_input_section): Set flags for .debug_str
12220 before updating section flags. Set entsize.
12221 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12222 and SHF_STRING if all input sections have those flags.
12223
12224 2009-12-29 Rafael Espindola <espindola@google.com>
12225
12226 * main.cc (main): Fix the sys time reporting.
12227 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12228 reporting.
12229
12230 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12231
12232 * options.cc (General_options::parse_version): Allow -v to exit
12233 without an error if there is nothing to link.
12234
12235 2009-12-29 Ian Lance Taylor <iant@google.com>
12236
12237 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12238 using a version of gcc before 4.1.
12239 * configure: Rebuild.
12240
12241 2009-12-28 Chris Demetriou <cgd@google.com>
12242
12243 * attributes.cc (Output_attributes_section_data::do_write): Use
12244 std::vector::front rather than std::vector::data.
12245
12246 2009-12-28 Ian Lance Taylor <iant@google.com>
12247
12248 * symtab.h (class Symbol_table): Add enum Defined.
12249 * resolve.cc (Symbol_table::should_override): Add defined
12250 parameter. Change all callers. Test whether object is NULL
12251 before calling a method on it.
12252 (Symbol_table::report_resolve_problem): Add defined parameter.
12253 Change all callers.
12254 (Symbol_table::should_override_with_special): Likewise.
12255 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12256 parameter. Change all callers.
12257 (Symbol_table::do_define_in_output_data): Likewise.
12258 (Symbol_table::define_in_output_segment): Likewise.
12259 (Symbol_table::do_define_in_output_segment): Likewise.
12260 (Symbol_table::define_as_constant): Likewise.
12261 (Symbol_table::do_define_as_constant): Likewise.
12262 * script.h (class Symbol_assignment): Add is_defsym parameter to
12263 constructor; change all callers.
12264 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12265 parameter. Change all callers. Add is_defsym_ field.
12266 (class Parser_closure): Add parsing_defsym parameter to
12267 constructor; change all callers. Add parsing_defsym accessor
12268 function. Add parsing_defsym_ field.
12269
12270 2009-12-28 Ian Lance Taylor <iant@google.com>
12271
12272 * gold.cc (queue_middle_tasks): Fix formatting.
12273 * object.cc (Relobj::is_section_name_included): Likewise.
12274
12275 2009-12-23 Ian Lance Taylor <iant@google.com>
12276
12277 * i386.cc (Target_i386::do_calls_non_split): Recognize
12278 -fsplit-stack prologue for a function with a static chain.
12279 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12280 -fsplit-stack prologue when using %r11.
12281
12282 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12283
12284 * options.cc (General_options::parse_version): Make -v continue and do
12285 the link like GNU ld does.
12286
12287 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12288
12289 * Makefile.am (CCFILES): Add timer.cc.
12290 (HFILES): Add timer.h.
12291 * configure.ac: Check for sysconf and times.
12292 * main.cc: include timer.h.
12293 (main): Use Timer instead of get_run_time.
12294 * timer.cc: New.
12295 * timer.h: New.
12296 * workqueue.cc: include timer.h.
12297 (Workqueue::find_and_run_task):
12298 Report user, sys and wall time.
12299 * Makefile.in: Regenerate.
12300 * config.in: Regenerate.
12301 * configure: Regenerate.
12302
12303 2009-12-16 Doug Kwan <dougkwan@google.com>
12304
12305 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12306 sections.
12307 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12308 relaxed input sections.
12309 * output.cc (Output_section::find_relaxed_input_section): Change
12310 return type to Output_relaxed_input_section pointer. Adjust code
12311 for new type of relaxed_input_section_map_.
12312 * output.h (Output_section::find_relaxed_input_section): Change
12313 return type to Output_relaxed_input_section pointer.
12314 (Output_section::Output_relaxed_input_section_by_input_section_map):
12315 New type.
12316 (Output_section::relaxed_input_section_map_): Change type to
12317 Output_section::Output_relaxed_input_section_by_input_section_map.
12318 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12319 input section.
12320
12321 2009-12-15 Ian Lance Taylor <iant@google.com>
12322
12323 * layout.cc (Layout::create_shstrtab): Only write out after input
12324 sections if we are compressing debug sections.
12325
12326 2009-12-15 Ian Lance Taylor <iant@google.com>
12327
12328 * archive.cc (Archive::add_symbols): Only look up a symbol without
12329 a version if there is, in fact, a version.
12330
12331 2009-12-14 Ian Lance Taylor <iant@google.com>
12332
12333 Revert -Wshadow changes, all changes from:
12334 2009-12-11 Doug Kwan <dougkwan@google.com>
12335 2009-12-11 Nick Clifton <nickc@redhat.com>
12336 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12337
12338 2009-12-11 Doug Kwan <dougkwan@google.com>
12339
12340 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12341 due to -Wshadow.
12342 * attributes.cc (Object_attribute::size): Ditto.
12343 (Attributes_section_data::size): Ditto.
12344 (Attributes_section_data::Attributes_section_data): Ditto.
12345 (Output_attributes_section_data::do_write): Ditto.
12346 * attributes.h (Object_attribute::set_type): Ditto.
12347 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12348
12349 2009-12-11 Nick Clifton <nickc@redhat.com>
12350
12351 * archive.cc: Fix shadowed variable warnings.
12352 * arm.cc: Likewise.
12353 * compressed_output.cc: Likewise.
12354 * compressed_output.h: Likewise.
12355 * configure: Likewise.
12356 * dwarf_reader.cc: Likewise.
12357 * dynobj.cc: Likewise.
12358 * dynobj.h: Likewise.
12359 * ehframe.cc: Likewise.
12360 * ehframe.h: Likewise.
12361 * errors.cc: Likewise.
12362 * expression.cc: Likewise.
12363 * fileread.cc: Likewise.
12364 * fileread.h: Likewise.
12365 * freebsd.h: Likewise.
12366 * i386.cc: Likewise.
12367 * icf.cc: Likewise.
12368 * incremental.h: Likewise.
12369 * layout.cc: Likewise.
12370 * layout.h: Likewise.
12371 * mapfile.cc: Likewise.
12372 * merge.cc: Likewise.
12373 * merge.h: Likewise.
12374 * object.cc: Likewise.
12375 * object.h: Likewise.
12376 * options.h: Likewise.
12377 * output.cc: Likewise.
12378 * output.h: Likewise.
12379 * parameters.cc: Likewise.
12380 * plugin.cc: Likewise.
12381 * powerpc.cc: Likewise.
12382 * reduced_debug_output.cc: Likewise.
12383 * reduced_debug_output.h: Likewise.
12384 * reloc.cc: Likewise.
12385 * reloc.h: Likewise.
12386 * resolve.cc: Likewise.
12387 * script-sections.cc: Likewise.
12388 * script.cc: Likewise.
12389 * script.h: Likewise.
12390 * sparc.cc: Likewise.
12391 * symtab.cc: Likewise.
12392 * symtab.h: Likewise.
12393 * target-select.cc: Likewise.
12394 * target-select.h: Likewise.
12395 * token.h: Likewise.
12396 * workqueue.cc: Likewise.
12397 * workqueue.h: Likewise.
12398 * x86_64.cc: Likewise.
12399
12400 2009-12-10 Doug Kwan <dougkwan@google.com>
12401
12402 * arm.cc (attributes.h): New include.
12403 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12404 (Arm_relobj::~Arm_relobj): Delete object pointed by
12405 attributes_section_data_.
12406 (Arm_relobj::attributes_section_data): New method definition.
12407 (Arm_relobj::attributes_section_data_): New data member declaration.
12408 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12409 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12410 attributes_section_data_.
12411 (Arm_dynobj::attributes_section_data): New method definition.
12412 (Arm_dynobj::attributes_section_data_): New data member declaration.
12413 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12414 initialization value of may_use_blx_ to false.
12415 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12416 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12417 object attributes to compute results instead of hard-coding.
12418 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12419 Target_arm::get_secondary_compatible_arch,
12420 Target_arm::set_secondary_compatible_arch
12421 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12422 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12423 New method declarations.
12424 (Target_arm::get_aeabi_object_attribute): New method definition.
12425 (Target_arm::attributes_section_data_): New data member declaration.
12426 (read_arm_attributes_section): New template definition.
12427 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12428 (Arm_dynobj::do_read_symbols): Ditto.
12429 (Target_arm::do_finalize_sections): Merge attributes sections from
12430 input. Check for BLX use after attributes section merging.
12431 Fix __exidx_start and __exidx_end visibility. Create an
12432 .ARM.attributes section if necessary.
12433 (Target_arm::get_secondary_compatible_arch,
12434 Target_arm::set_secondary_compatible_arch,
12435 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12436 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12437 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12438 New method definitions.
12439
12440 2009-12-09 Ian Lance Taylor <iant@google.com>
12441
12442 * plugin.cc (Plugin::load): Don't cast from void* to a function
12443 pointer.
12444
12445 2009-12-09 Ian Lance Taylor <iant@google.com>
12446
12447 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12448 information fields.
12449
12450 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12451
12452 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12453 Replace two_file_shared_1.so with two_file_shared_2.so.
12454 * testsuite/Makefile.in: Regenerated.
12455
12456 2009-12-08 Doug Kwan <dougkwan@google.com>
12457
12458 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12459 (HFILES): Add attributes.h and int_encoding.h.
12460 * Makefile.in: Regenerate.
12461 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12462 function definitions to int_encoding.cc
12463 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12464 prototypes to int_encoding.h
12465 * reduced_debug_output.cc (int_encoding.h): New include.
12466 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12467 function definitions to int_encoding.cc
12468 (insert_into_vector, read_from_pointer): Move template definitions to
12469 int_encoding.h
12470 * attributes.cc: New file.
12471 * attributes.h: New file.
12472 * int_encoding.cc: New file.
12473 * int_encoding.h: New file.
12474
12475 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12476
12477 PR gold/11055
12478 * incremental-dump.cc (dump_incremental_inputs): New.
12479 (main): Use dump_incremental_inputs.
12480
12481 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12482
12483 PR gold/10893
12484 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12485 checking elfcpp::STT_FUNC.
12486 (Target_i386::Relocate::relocate): Likewise.
12487 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12488
12489 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12490 symbols from shared libraries into normal FUNC symbols.
12491
12492 * symtab.h (Symbol): Add is_func and use it.
12493
12494 2009-12-05 Doug Kwan <dougkwan@google.com>
12495
12496 * arm.cc (Target_arm::arm_info): Initialize new fields
12497 attributes_section and attributes_vendor.
12498 * i386.cc (Target_i386::i386_info): Same.
12499 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12500 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12501 fields attributes_section and attributes_vendor.
12502 * sparc.cc (Target_sparc::sparc_info): Same.
12503 * target.h (Target::attributes_section, Target::attributes_vendor,
12504 Target::is_attributes_section, Target::attribute_arg_type,
12505 Target::attributes_order): New method definitions.
12506 (Target::Target_info::attributes_section,
12507 Target::Target_info::attributes_vendor): New fields.
12508 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12509 virtual method definitions.
12510 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12511 attributes_section and attributes_vendor.
12512 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12513
12514 2009-12-05 Doug Kwan <dougkwan@google.com>
12515
12516 * arm.cc: Update comments about interworking and stub generation.
12517 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12518 considered as non-PIC.
12519 (Arm_relocate_functions::base_abs): Fix formatting.
12520 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12521 of function to use GOT entry address instead of offset.
12522 (Target_arm::Scan::global): Issue an error if a symbol would need a
12523 PLT does not get one because it is untyped. Remove code to create
12524 dynamic symbols for relative branches.
12525 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12526 takes unsigned integer instead of boolean.
12527
12528 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12529
12530 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12531 (two_file_test_LDADD): Likewise.
12532 (common_test_1_LDADD): Likewise.
12533 (exception_test_LDADD) Likewise.
12534 (weak_test_LDADD): Likewise.
12535 (many_sections_test_LDADD): Likewise.
12536 (initpri1_LDADD): Likewise.
12537 (script_test_1_LDADD): Likewise.
12538 (script_test_2_LDADD): Likewise.
12539 (justsyms_LDADD): Likewise.
12540 (binary_test_LDADD): Likewise.
12541 (large_LDADD): Likewise.
12542 * testsuite/Makefile.in: Regenerated.
12543
12544 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12545
12546 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12547 (Symbol_table::override_with_special): Likewise.
12548 (Symbol_table::add_from_object): Likewise.
12549
12550 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12551
12552 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12553 Don't set the data_offset twice.
12554
12555 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12556
12557 * testsuite/Makefile.in: Regenerate.
12558
12559 2009-12-03 Doug Kwan <dougkwan@google.com>
12560
12561 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12562 (Target_arm::do_finalize_sections): Add parameter for symbol table
12563 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12564 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12565 parameter for symbol table pointer.
12566 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12567 an additional parameter for a pointer to symbol table.
12568 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12569 parameter for a symbol table pointer.
12570 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12571 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12572 Ditto.
12573 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12574 parameter for a symbol table pointer.
12575
12576 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12577
12578 * incremental.cc (Incremental_inputs_header)
12579 (Incremental_inputs_header_write, Incremental_inputs_entry)
12580 (Incremental_inputs_entry_write): Move ...
12581 * incremental.h (Incremental_inputs_header)
12582 (Incremental_inputs_header_write, Incremental_inputs_entry)
12583 (Incremental_inputs_entry_write): here.
12584
12585 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12586
12587 * incremental.cc (make_sized_incremental_binary): Set the target.
12588 Error if it is incompatible.
12589 * output.h (Output_file): Add filename method.
12590
12591 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12592
12593 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12594 from the get_* methods.
12595
12596 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12597
12598 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12599 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12600 Write 0 for the data_offset of scripts.
12601
12602 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12603
12604 * testsuite/Makefile.am: Add the incremental_test.sh test.
12605 * testsuite/incremental_test.sh: New.
12606 * testsuite/incremental_test_1.c: New.
12607 * testsuite/incremental_test_2.c: New.
12608
12609 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12610
12611 * incremental-dump.cc (main): Fix typos.
12612
12613 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12614
12615 PR gold/11025
12616 * incremental-dump.cc (main): Use llu to print 64 bit values.
12617
12618 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12619 H.J. Lu <hongjiu.lu@intel.com>
12620
12621 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12622 $(LIBDL).
12623 (incremental_dump_LDADD): Likewise.
12624 * Makefile.in: Regenerated.
12625
12626 2009-11-25 Doug Kwan <dougkwan@google.com>
12627
12628 Revert:
12629
12630 2009-11-25 Doug Kwan <dougkwan@google.com>
12631
12632 * arm.cc (Target_arm::Target_arm): Move method definition
12633 outside of class definition. Add code to handle
12634 --target1-rel, --target1-abs and --target2= options.
12635 (Target_arm::get_reloc_reloc_type): Change method to be
12636 non-static and const.
12637 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12638 New data member declaration.
12639 (Target_arm::Scan::local, Target_arm::Scan::global,
12640 Target_arm::Relocate::relocate,
12641 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12642 Adjust call to Target_arm::get_real_reloc_type.
12643 (Target_arm::get_real_reloc_type): Use command line options
12644 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12645 * options.h (--target1-rel, --target1-abs, --target2): New
12646 ARM-only options.
12647
12648 2009-11-25 Doug Kwan <dougkwan@google.com>
12649
12650 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12651 class definition. Add code to handle --target1-rel, --target1-abs
12652 and --target2= options.
12653 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12654 and const.
12655 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12656 member declaration.
12657 (Target_arm::Scan::local, Target_arm::Scan::global,
12658 Target_arm::Relocate::relocate,
12659 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12660 call to Target_arm::get_real_reloc_type.
12661 (Target_arm::get_real_reloc_type): Use command line options to
12662 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12663 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12664 options.
12665
12666 2009-11-25 Doug Kwan <dougkwan@google.com>
12667
12668 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12669 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12670 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12671 formatting.
12672 (Arm_relocate_functions::thm_call): Replace body with a call to
12673 Arm_relocate_functions::thumb_branch_common.
12674 (Arm_relocate_functions::thm_jump24,
12675 Arm_relocate_functions::thm_xpc22): New method definitions.
12676 (Arm_relocate_functions::thumb_branch_common): New method definition.
12677 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12678 operator.
12679 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12680 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12681
12682 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12683
12684 * Makefile.am: Build incremental-dump
12685 * Makefile.in: Regenerate.
12686 * incremental-dump.cc: New.
12687 * incremental.cc (Incremental_inputs_header_data,
12688 Incremental_inputs_entry_data): Move to incremental.h
12689 * incremental.h: (Incremental_inputs_header_data,
12690 Incremental_inputs_entry_data): Move from incremental.cc
12691
12692 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12693
12694 * incremental.cc (Incremental_inputs_header,
12695 Incremental_inputs_header_write, Incremental_inputs_entry,
12696 Incremental_inputs_entry_write): Add a typedef with the data type.
12697
12698 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12699
12700 * incremental.cc (Incremental_inputs_header,
12701 Incremental_inputs_header_write, Incremental_inputs_entry,
12702 Incremental_inputs_entry_write): Update comment about which
12703 type has the filed descriptions.
12704
12705 2009-11-15 Doug Kwan <dougkwan@google.com>
12706
12707 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12708 (Arm_relocate_functions::arm_branch_common): Change method defintion
12709 in class definition to a method declaration and update list of formal
12710 parameters.
12711 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12712 Arm_relocation_functions::jump24): Adjust call to
12713 Arm_relocate_functions::arm_branch_common. Update list of formal
12714 parameters.
12715 (Arm_relocate_functions::xpc25): New method definition.
12716 (Arm_relocate_functions::arm_branch_common): Move method defintion
12717 out from class definition. Use stubs for mode-switching and extending
12718 branch ranges.
12719 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12720 specially. Change code to enable use of stubs in ARM branches.
12721
12722 2009-11-10 Doug Kwan <dougkwan@google.com>
12723
12724 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12725 in method declaration.
12726 (Target_arm::relocate_stub): New method declaration.
12727 (Target_arm::default_target): Change to return a pointer instead of
12728 a const reference.
12729 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12730 Target_arm::default_target.
12731 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12732 method definition.
12733 (Target_arm::relocate_section): Adjust view.
12734 (Target_arm::relocate_stub): New method definition.
12735
12736 2009-11-10 Doug Kwan <dougkwan@google.com>
12737
12738 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12739 a format warning.
12740 * incremental.cc (open_incremental_binary): Initialized local
12741 variables to avoid warnings.
12742 * object.cc (make_elf_object): Ditto.
12743 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12744 a format warning.
12745
12746 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12747
12748 PR gold/10930
12749 * testsuite/plugin_test.c: Include "config.h".
12750
12751 2009-11-09 Doug Kwan <dougkwan@google.com>
12752
12753 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12754 (arm_symbol_value): Remove.
12755 (Arm_relocate_functions::arm_branch_common,
12756 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12757 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12758 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12759 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12760 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12761 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12762 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12763 Arm_relocate_functions::thm_mobw_abs_nc,
12764 Arm_relocate_functions::thm_mov_abs,
12765 Arm_relocate_functions::movw_prel_nc,
12766 Arm_relocate_functions::thm_movt_abs,
12767 Arm_relocate_functions::movt_prel,
12768 Arm_relocate_functions::thm_movw_prel_nc,
12769 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12770 (Target_arm::Relocate::relocate): Only decompose address into two
12771 parts if relocation type uses the thumb-bit and pass the actual
12772 bit instead of a flag indicating that the thumb-bit is used. Adjust
12773 calls to methods in Arm_relocate_functions for this change.
12774
12775 2009-11-08 Ian Lance Taylor <iant@google.com>
12776
12777 PR 10925
12778 * reloc.cc: Instantiate
12779 Sized_relobj::initialize_input_to_output_maps and
12780 Sized_relobj:free_input_to_output_maps.
12781
12782 2009-11-06 Ian Lance Taylor <iant@google.com>
12783
12784 PR 10876
12785 * defstd.cc (in_segment): Set only_if_ref true for "end".
12786
12787 2009-11-06 Doug Kwan <dougkwan@google.com>
12788
12789 * arm.cc (class Reloc_stub): Correct a comment.
12790 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12791 (Target_arm::scan_section_for_stubs): New method declaration.
12792 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12793 Change methods from private to protected.
12794 (Target_arm::do_may_relax): New method definition.
12795 (Target_arm::do_relax, Target_arm::group_sections,
12796 Target_arm::scan_reloc_for_stub,
12797 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12798 (Target_arm::arm_input_section_map_): New data member declaration.
12799 (Target_arm::scan_reloc_for_stub,
12800 Target_arm::scan_reloc_section_for_stubs,
12801 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12802 Target_arm::do_relax): New method definitions.
12803
12804 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12805
12806 * configure.ac: Check for (struct stat)::st_mtim
12807 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12808 * config.in: Regenerate.
12809 * configure: Regenerate.
12810
12811 2009-11-05 Ian Lance Taylor <iant@google.com>
12812
12813 PR 10910
12814 * output.cc (Output_segment::add_output_section): Add missing
12815 return statement.
12816
12817 2009-11-04 Ian Lance Taylor <iant@google.com>
12818
12819 PR 10880
12820 * object.h (class Object): Add is_needed and set_is_needed
12821 methods. Add is_needed_ field. Make bool fields into bitfields.
12822 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12823 defined in a dynamic object and referenced by a regular object,
12824 set is_needed for the dynamic object.
12825 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12826 if the file is marked with as_needed and it is not needed.
12827
12828 2009-11-04 Ian Lance Taylor <iant@google.com>
12829
12830 PR 10887
12831 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12832 tags if data is discarded by linker script.
12833 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12834 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12835 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12836 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12837
12838 2009-11-04 Ian Lance Taylor <iant@google.com>
12839
12840 * layout.cc (Layout::get_output_section): Add is_interp and
12841 is_dynamic_linker_section parameters. Change all callers.
12842 (Layout::choose_output_section): Likewise.
12843 (Layout::make_output_section): Likewise.
12844 (Layout::add_output_section_data): Add is_dynamic_linker_section
12845 parameter. Change all callers.
12846 * layout.h (class Layout): Update declarations.
12847 * output.h (class Output_section): Add is_interp, set_is_interp,
12848 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12849 Add is_interp_, is_dynamic_linker_section_ fields. Change
12850 generate_code_fills_at_write_ to a bitfield.
12851 * output.cc (Output_section::Output_sections): Initialize new
12852 fields.
12853 (Output_segment::add_output_section): Add do_sort parameter.
12854 Change all callers.
12855
12856 2009-11-03 Ian Lance Taylor <iant@google.com>
12857
12858 PR 10860
12859 * options.h (class General_options): Add --warn-common.
12860 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12861 merging two common symbols.
12862 (Symbol_table::should_override): Handle --warn-common when merging
12863 a common symbol with a defined symbol. Use report_resolve_problem
12864 for multiple definitions.
12865 (Symbol_table::report_resolve_problem): New function.
12866 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12867
12868 2009-11-03 Doug Kwan <dougkwan@google.com>
12869
12870 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12871 stub_factory_.
12872 (Target_arm::stub_factory): New method definition.
12873 (Target_arm::new_arm_input_section,
12874 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12875 Target_arm::reloc_uses_thumb_bit): New method declarations.
12876 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12877 New type definitions.
12878 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12879 member declarations.
12880 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12881 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12882 New method definitions.
12883
12884 2009-11-03 Ian Lance Taylor <iant@google.com>
12885
12886 * options.h (class General_options): Add --warn_constructors.
12887
12888 2009-11-03 Ian Lance Taylor <iant@google.com>
12889
12890 PR 10893
12891 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12892 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12893
12894 2009-11-03 Ian Lance Taylor <iant@google.com>
12895
12896 PR 10895
12897 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12898 --msgid-bugs-address.
12899 (install-pdf): New target.
12900 (install-data_yes): Look up one directory to find mkinstalldirs.
12901
12902 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12903
12904 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12905 tree.
12906
12907 2009-10-30 Doug Kwan <dougkwan@google.com>
12908
12909 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12910
12911 2009-10-30 Doug Kwan <dougkwan@google.com>
12912
12913 * arm.cc (Stub_addend_reader): New struct template definition
12914 and partial specializations.
12915 (Stub_addend_reader::operator()): New method definition for a
12916 partially specialized template.
12917
12918 2009-10-30 Doug Kwan <dougkwan@google.com>
12919
12920 * arm.cc (Arm_relobj::processor_specific_flags): New method
12921 definition.
12922 (Arm_relobj::do_read_symbols): New method declaration.
12923 (Arm_relobj::processor_specific_flags_): New data member declaration.
12924 (Arm_dynobj): New class definition.
12925 (Target_arm::do_finalize_sections): Add input_objects parameter.
12926 (Target_arm::do_adjust_elf_header): New method declaration.
12927 (Target_arm::are_eabi_versions_compatible,
12928 (Target_arm::merge_processor_specific_flags): New method declaration.
12929 (Target_arm::do_make_elf_object): New overloaded method definitions
12930 and declaration.
12931 (Arm_relobj::do_read_symbols): New method definition.
12932 (Arm_dynobj::do_read_symbols): Ditto.
12933 (Target_arm::do_finalize_sections): Add input_objects parameters.
12934 Merge processor-specific flags from all input objects.
12935 (Target_arm::are_eabi_versions_compatible,
12936 Target_arm::merge_processor_specific_flags,
12937 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12938 New method definitions.
12939 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12940 Input_objects pointer type parameter.
12941 * layout.cc (Layout::finalize): Pass input objects to target's.
12942 finalize_sections function.
12943 * output.cc (Output_file_header::do_sized_write): Set ELF file
12944 header's processor-specific flags.
12945 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12946 Input_objects pointer type parameter.
12947 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12948 * target.h (Input_objects): New forward class declaration.
12949 (Target::processor_specific_flags,
12950 Target::are_processor_specific_flags_sect): New method definitions.
12951 (Target::finalize_sections): Add input_objects parameter.
12952 (Target::Target): Initialize processor_specific_flags_ and
12953 are_processor_specific_flags_set_.
12954 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12955 parameter.
12956 (Target::set_processor_specific_flags): New method definition.
12957 (Target::processor_specific_flags_,
12958 Target::are_processor_specific_flags_set_): New data member
12959 declarations.
12960 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12961 Input_objects pointer type parameter.
12962
12963 2009-10-30 Doug Kwan <dougkwan@google.com>
12964
12965 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12966
12967 2009-10-28 Ian Lance Taylor <iant@google.com>
12968
12969 * object.h (class Relobj): Drop options parameter from
12970 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12971 do_scan_relocs, do_relocate. Change all callers.
12972 (class Sized_relobj): Drop options parameters from
12973 do_gc_process_relocs, do_scan_relocs, do_relocate,
12974 do_relocate_sections, relocate_sections, emit_relocs_scan,
12975 emit_relocs_scan_reltype. Change all callers.
12976 (struct Relocate_info): Remove options field and all references to
12977 it.
12978 * reloc.h (class Read_relocs): Remove options constructor
12979 parameter and options_ field. Change all callers.
12980 (class Gc_process_relocs, class Scan_relocs): Likewise.
12981 (class Relocate_task): Likewise.
12982 * target-reloc.h (scan_relocs): Remove options parameter. Change
12983 all callers.
12984 (scan_relocatable_relocs): Likewise.
12985 * target.h (class Sized_target): Remove options parameter from
12986 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12987 all callers.
12988 * gc.h (gc_process_relocs): Remove options parameter. Change all
12989 callers.
12990 * arm.cc: Update functions to remove options parameters.
12991 * i386.cc: Likewise.
12992 * powerpc.cc: Likewise.
12993 * sparc.cc: Likewise.
12994 * x86_64.cc: Likewise.
12995 * testsuite/testfile.cc: Likewise.
12996
12997 2009-10-28 Doug Kwan <dougkwan@google.com>
12998
12999 * arm.cc (Arm_relobj): New class definition.
13000 (Arm_relobj::scan_sections_for_stubs,
13001 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13002 New method definitions.
13003
13004 2009-10-28 Cary Coutant <ccoutant@google.com>
13005
13006 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13007 (Plugin::cleanup_done_): New member.
13008 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13009 (Plugin_manager::cleanup_done_): Remove.
13010 (Plugin_manager::add_input_file): Edit error message.
13011 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13012 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13013
13014 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13015
13016 * fileread.cc: (File_read::View::~View): Use the new
13017 data_ownership_ filed.
13018 (File_read::~File_read): Dispose the new whole_file_view_.
13019 (File_read::open): Mmap the whole file if needed.
13020 (File_read::open): Use whole_file_view_ instead of contents_.
13021 (File_read::find_view): Use whole_file_view_ if applicable.
13022 (File_read::do_read): Use whole_file_view_ instead of contents_.
13023 (File_read::make_view): Use whole_file_view_ instead of contents_,
13024 update File_read::View::View call.
13025 (File_read::find_or_make_view): Update File_read::View::View
13026 call.
13027 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13028 remove contents_
13029 (File_read::View::Data_ownership): New enum.
13030 (File_read::View::View): Replace bool mapped_ with Data_ownership
13031 argument.
13032 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13033 (File_read::View::data_ownership_): New field.
13034 (File_read::contents_): Remove (replaced by whole_file_view_).
13035 (File_read::whole_file_view_): New field.
13036 * options.h (class General_options): Add --keep-files-mapped.
13037
13038 2009-10-27 Cary Coutant <ccoutant@google.com>
13039
13040 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13041 * testsuite/Makefile.am (plugin_test_5): New test case.
13042 * testsuite/Makefile.in: Regenerate.
13043
13044 2009-10-25 Doug Kwan <dougkwan@google.com>
13045
13046 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13047 from private to protected to allow access by child class.
13048 (Sized_relobj::do_relocate_sections): New method declaration.
13049 (Sized_relobj::relocate_sections): Virtualize.
13050 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13051 Sized_relobj::relocate_sections. Instantiate template explicitly
13052 for different target sizes and endianity.
13053
13054 2009-10-24 Doug Kwan <dougkwan@google.com>
13055
13056 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13057 (Arm_input_section::as_arm_input_section): New method.
13058 (Arm_output_section): New class definition.
13059 (Arm_output_section::create_stub_group,
13060 Arm_output_section::group_sections): New method definitions.
13061
13062 2009-10-22 Doug Kwan <dougkwan@google.com>
13063
13064 * arm.cc (Arm_input_section): New class definition.
13065 (Arm_input_section::init, Arm_input_section:do_write,
13066 Arm_input_section::set_final_data_size,
13067 Arm_input_section::do_reset_address_and_file_offset): New method
13068 definitions.
13069
13070 2009-10-21 Doug Kwan <dougkwan@google.com>
13071
13072 * arm.cc (Stub_table, Arm_input_section): New forward class
13073 declarations.
13074 (Stub_table): New class defintion.
13075 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13076 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13077 New method definition.
13078
13079 2009-10-21 Doug Kwan <dougkwan@google.com>
13080
13081 * arm.cc: Update copyright comments.
13082 (Target_arm): New forward class template declaration.
13083 (Arm_address): New type.
13084 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13085 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13086 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13087 constants.
13088 (Insn_template): Same.
13089 (DEF_STUBS): New macro.
13090 (Stub_type): New enum type.
13091 (Stub_template): New class definition.
13092 (Stub): Same.
13093 (Reloc_stub): Same.
13094 (Stub_factory): Same.
13095 (Target_arm::Target_arm): Initialize may_use_blx_ and
13096 should_force_pic_veneer_.
13097 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13098 Target_arm::should_force_pic_veneer,
13099 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13100 Target_arm::using_thumb_only, Target_arm:;default_target): New
13101 method defintions.
13102 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13103 New data member declarations.
13104 (Insn_template::size, Insn_template::alignment): New method defintions.
13105 (Stub_template::Stub_template): New method definition.
13106 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13107 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13108 (Stub_factory::Stub_factory): New method definition.
13109 * gold.h (string_hash): New template.
13110 * output.h (Input_section_specifier::hash_value): Use
13111 gold::string_hash.
13112 (Input_section_specifier::string_hash): Remove.
13113 * stringpool.cc (Stringpool_template::string_hash): Use
13114 gold::string_hash.
13115
13116 2009-10-20 Doug Kwan <dougkwan@google.com>
13117
13118 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13119 symbols of relaxed input sections.
13120 * output.h (Output_section::find_relaxed_input_section): Make
13121 method public.
13122
13123 2009-10-16 Doug Kwan <dougkwan@google.com>
13124
13125 * dynobj.cc (Versions::Versions): Initialize version_script_.
13126 Only insert base version symbol definition for a shared object
13127 if version script defines any version versions.
13128 (Versions::define_base_version): New method definition.
13129 (Versions::add_def): Check that base version is not needed.
13130 (Versions::add_need): Define base version lazily.
13131 * dynobj.h (Versions::define_base_version): New method declaration.
13132 (Versions::needs_base_version_): New data member declaration.
13133 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13134 (check_DATA): Add no_version_test.stdout.
13135 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13136 New make rules.
13137 * testsuite/Makefile.in: Regenerate.
13138 * testsuite/no_version_test.c: New file.
13139 * testsuite/no_version_test.sh: Ditto.
13140
13141 2009-10-16 Doug Kwan <dougkwan@google.com>
13142
13143 * expression.cc (class Segment_start_expression): New class definition.
13144 (Segment_start_expression::value): New method definition.
13145 (script_exp_function_segment_start): Return a new
13146 Segment_start_expression.
13147 * gold/script-c.h (script_saw_segment_start_expression): New function
13148 prototype.
13149 * script-sections.cc (Script_sections::Script_sections): Initialize
13150 SAW_SEGMENT_START_EXPRESSION_ to false.
13151 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13152 and -Tbbs options to specify section addresses if given in
13153 command line and no SEGMENT_START expression is seen in a script.
13154 * script-sections.h (Script_sections::saw_segment_start_expression,
13155 Script_sections::set_saw_segment_start_expression): New method
13156 definition.
13157 (Script_sections::saw_segment_start_expression_): New data member
13158 declaration.
13159 * script.cc (script_saw_segment_start_expression): New function.
13160 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13161 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13162 script_test_7.sh and script_test_8.sh.
13163 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13164 script_test_8.stdout.
13165 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13166 (script_test_6, script_test_6.stdout, script_test_7,
13167 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13168 * Makefile.in: Regenerate.
13169 * testsuite/script_test_6.sh: New file.
13170 * testsuite/script_test_6.t: Same.
13171 * testsuite/script_test_7.sh: Same.
13172 * testsuite/script_test_7.t: Same.
13173 * testsuite/script_test_8.sh: Same.
13174
13175 2009-10-16 Doug Kwan <dougkwan@google.com>
13176
13177 * output.cc (Output_segment::set_section_list_address): Cast
13178 expressions to unsigned long long type to avoid format warnings.
13179
13180 2009-10-15 Ian Lance Taylor <iant@google.com>
13181
13182 * script.cc (Script_options::add_symbol_assignment): Always add a
13183 dot assignment to script_sections_.
13184 * script-sections.cc (Script_sections::add_dot_assignment):
13185 Initialize if necessary.
13186
13187 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13188 program headers with no load segment if there is a linker script.
13189
13190 * layout.cc (Layout::set_segment_offsets): Align the file offset
13191 to the segment aligment for -N or -n with no load segment.
13192 * output.cc (Output_segment::add_output_section): Don't crash if
13193 the first section is a TLS section.
13194 (Output_segment::set_section_list_addresses): Print an error
13195 message if the address moves backward in a linker script.
13196 * script-sections.cc
13197 (Output_section_element_input::set_section_addresses): Don't
13198 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13199 (Orphan_output_section::set_section_addresses): Likewise.
13200
13201 2009-10-15 Doug Kwan <dougkwan@google.com>
13202
13203 * layout.cc (Layout::finish_dynamic_section): Generate tags
13204 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13205 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13206 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13207
13208 2009-10-14 Ian Lance Taylor <iant@google.com>
13209
13210 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13211 fields.
13212 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13213 data_shdr fields of relinfo.
13214 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13215 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13216 R_386_TLS_LDO_32, adjust based on section flags.
13217 (Target_i386::Relocate::fix_up_ldo): Remove.
13218
13219 2009-10-13 Ian Lance Taylor <iant@google.com>
13220
13221 Add support for -pie.
13222 * options.h (class General_options): Add -pie and
13223 --pic-executable.
13224 (General_options::output_is_position_independent): Test -pie.
13225 (General_options::output_is_executable): Return true if not shared
13226 and not relocatable.
13227 (General_options::output_is_pie): Remove.
13228 * options.cc (General_options::finalize): Reject incompatible uses
13229 of -pie.
13230 * gold.cc (queue_middle_tasks): A -pie link is not static.
13231 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13232 * symtab.cc (Symbol::final_value_is_known): Return false if
13233 output_is_position_independent.
13234 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13235 output_is_position_independent.
13236 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13237 output_is_position_independent.
13238 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13239 output_is_position_independent.
13240 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13241 two_file_pie_test.
13242 (basic_pie_test.o, basic_pie_test): New targets.
13243 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13244 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13245 (two_file_pie_test): New target.
13246 * testsuite/Makefile.in: Rebuild.
13247 * README: Remove note saying that -pie is not supported.
13248
13249 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13250
13251 * options.h (class General_options): Add -init and -fini.
13252 * layout.cc (Layout::finish_dynamic_section): Emit
13253 given init and fini functions.
13254
13255 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13256
13257 * gc.h (gc_process_relocs): Check if icf is enabled using new
13258 function.
13259 * gold.cc (queue_initial_tasks): Likewise.
13260 (queue_middle_tasks): Likewise.
13261 * object.cc (do_layout): Likewise.
13262 * symtab.cc (is_section_folded): Likewise.
13263 * main.cc (main): Likewise.
13264 * reloc.cc (Read_relocs::run): Likewise.
13265 (Sized_relobj::do_scan_relocs): Likewise.
13266 * icf.cc (is_function_ctor_or_dtor): New function.
13267 (Icf::find_identical_sections): Check if function is ctor or dtor when
13268 safe icf is chosen.
13269 * options.h (General_options::icf): Change option to be an enum.
13270 (Icf_status): New enum.
13271 (icf_enabled): New method.
13272 (icf_safe_folding): New method.
13273 (set_icf_status): New method.
13274 (icf_status_): New variable.
13275 * (options.cc) (General_options::finalize): Set icf_status_.
13276 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13277 icf_test and icf_keep_unique_test to use the --icf enum flag.
13278 * testsuite/icf_safe_test.sh: New file.
13279 * testsuite/icf_safe_test.cc: New file.
13280
13281 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13282
13283 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13284 includes to gc.h and icf.h.
13285 * arm.cc: Include gc.h.
13286 * gold.cc: Likewise.
13287 * i386.cc: Likewise.
13288 * powerpc.cc: Likewise.
13289 * sparc.cc: Likewise.
13290 * x86_64.cc: Likewise.
13291 * gc.h: Include icf.h.
13292
13293 2009-10-11 Ian Lance Taylor <iant@google.com>
13294
13295 * plugin.cc: Include "gold.h" before other header files.
13296
13297 2009-10-10 Chris Demetriou <cgd@google.com>
13298
13299 * options.h (Input_file_argument::Input_file_type): New enum.
13300 (Input_file_argument::is_lib_): Replace with...
13301 (Input_file_argument::type_): New member.
13302 (Input_file_argument::Input_file_argument): Take Input_file_type
13303 'type' rather than boolean 'is_lib' as second argument.
13304 (Input_file_argument::is_lib): Use type_.
13305 (Input_file_argument::is_searched_file): New function.
13306 (Input_file_argument::may_need_search): Handle is_searched_file.
13307 * options.cc (General_options::parse_library): Support -l:filename.
13308 (General_options::parse_just_symbols): Update for Input_file_argument
13309 changes.
13310 (Command_line::process): Likewise.
13311 * archive.cc (Archive::get_file_and_offset): Likewise.
13312 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13313 * script.cc (read_script_file, script_add_file): Likewise.
13314 * fileread.cc (Input_file::Input_file): Likewise.
13315 (Input_file::will_search_for): Handle is_searched_file.
13316 (Input_file::open): Likewise.
13317 * readsyms.cc (Read_symbols::get_name): Likewise.
13318 * testsuite/Makefile.am (searched_file_test): New test.
13319 * testsuite/Makefile.in: Regenerate.
13320 * testsuite/searched_file_test.cc: New file.
13321 * testsuite/searched_file_test_lib.cc: New file.
13322
13323 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13324 Ian Lance Taylor <iant@google.com>
13325
13326 * descriptor.cc: Include <cstdio> and "binary-io.h".
13327 (Descriptors::open): Open the files in binary mode always.
13328 * script.cc (Lex::get_token): Treat \r as whitespace.
13329
13330 2009-10-09 Ian Lance Taylor <iant@google.com>
13331
13332 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13333
13334 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13335 Ian Lance Taylor <iant@google.com>
13336
13337 * configure.ac: Check for readv function also.
13338 * fileread.cc (readv): Define if not HAVE_READV.
13339 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13340 does not exist.
13341 * config.in: Regenerate.
13342 * configure: Regenerate.
13343
13344 2009-10-09 Doug Kwan <dougkwan@google.com>
13345
13346 * layout.cc (Layout::make_output_section): Call target hook to make
13347 ordinary output section.
13348 (Layout::finalize): Adjust parameter list of call the
13349 Target::may_relax().
13350 * layout.h (class Layout::section_list): New method.
13351 * merge.h (Output_merge_base::entsize): Change visibility to public.
13352 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13353 New methods.
13354 (Output_merge_string::do_is_string): New method.
13355 * object.cc (Sized_relobj::do_setup): renamed from
13356 Sized_relobj::set_up.
13357 * object.h (Sized_relobj::adjust_shndx,
13358 Sized_relobj::initializ_input_to_output_maps,
13359 Sized_relobj::free_input_to_output_maps): Change visibilities to
13360 protected.
13361 (Sized_relobj::setup): Virtualize.
13362 (Sized_relobj::do_setup): New method declaration.
13363 (Sized_relobj::invalidate_section_offset,
13364 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13365 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13366 * options.cc (parse_int): New function.
13367 * options.h (parse_int): New declaration.
13368 (DEFINE_int): New macro.
13369 (stub_group_size): New option.
13370 * output.cc (Output_section::Output_section): Initialize memebers
13371 merge_section_map_, merge_section_by_properties_map_,
13372 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13373 (Output_section::add_input_section): Handled deferred code-fill
13374 generation and remove an old comment.
13375 (Output_section::add_relaxed_input_section): New method definition.
13376 (Output_section::add_merge_input_section): Use merge section by
13377 properties map to speed to search. Update merge section maps
13378 as appropriate.
13379 (Output_section::build_relaxation_map): New method definition.
13380 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13381 Same.
13382 (Output_section::relax_input_section): Renamed to
13383 Output_section::convert_input_sections_to_relaxed_sections and change
13384 interface to take a vector of pointers to relaxed sections.
13385 (Output_section::find_merge_section,
13386 Output_section::find_relaxed_input_section): New method definitions.
13387 (Output_section::is_input_address_mapped,
13388 Output_section::output_offset, Output_section::output_address):
13389 Use output section data maps to speed up searching.
13390 (Output_section::find_starting_output_address): Add comments.
13391 (Output_section::do_write,
13392 Output_section::write_to_postprocessing_buffer): Do code-fill
13393 generation as appropriate.
13394 (Output_section::get_input_sections): Invalidate relaxed input section
13395 map.
13396 (Output_section::restore_states): Adjust type of checkpoint .
13397 Invalidate relaxed input section map.
13398 * output.h (Output_merge_base): New class declaration.
13399 (Input_section_specifier): New class defintion.
13400 (class Output_relaxed_input_section) Change base class to
13401 Output_section_data_build.
13402 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13403 base class initializer.
13404 (Output_section::add_relaxed_input_section): New method declaration.
13405 (Output_section::Input_section): Change visibility to protected.
13406 (Output_section::Input_section::relobj,
13407 Output_section::Input_section::shndx): Handle relaxed input sections.
13408 Output_section::input_sections) Change visibility to protected. Also
13409 define overload to return a non-const pointer.
13410 (Output_section::Merge_section_properties): New class defintion.
13411 (Output_section::Merge_section_by_properties_map,
13412 Output_section::Output_section_data_by_input_section_map,
13413 Output_section::Relaxation_map): New types.
13414 (Output_section::relax_input_section): Rename method to
13415 Output_section::convert_input_sections_to_relaxed_sections and change
13416 interface to take a vector of relaxed section pointers.
13417 (Output_section::find_merge_section,
13418 Output_section::find_relaxed_input_section,
13419 Output_section::build_relaxation_map,
13420 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13421 New method declarations.
13422 (Output_section::merge_section_map_
13423 Output_section::merge_section_by_properties_map_,
13424 Output_section::relaxed_input_section_map_,
13425 Output_section::is_relaxed_input_section_map_valid_,
13426 Output_section::generate_code_fills_at_write_): New data members.
13427 * script-sections.cc
13428 (Output_section_element_input::set_section_addresses): Call
13429 current_data_size and addralign methods of relaxed input sections.
13430 (Orphan_output_section::set_section_addresses): Call current_data_size
13431 and addralign methods of relaxed input sections.
13432 * symtab.cc (Symbol_table::compute_final_value): Extract template
13433 from the body of Symbol_table::sized_finalize_symbol.
13434 (Symbol_table::sized_finalized_symbol): Call
13435 Symbol_table::compute_final_value.
13436 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13437 (Symbol_table::compute_final_value): New templated method declaration.
13438 * target.cc (Target::do_make_output_section): New method defintion.
13439 * target.h (Target::make_output_section): New method declaration.
13440 (Target::relax): Add more parameters for input objects, symbol table
13441 and layout. Adjust call to do_relax.
13442 (Target::do_make_output_section): New method declaration.
13443 (Target::do_relax): Add parameters for input objects, symbol table
13444 and layout.
13445
13446 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13447
13448 * pread.c: Include stdio.h.
13449
13450 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13451
13452 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13453 defined.
13454
13455 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13456
13457 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13458 Change read_shndx type to unsigned int.
13459 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13460 int.
13461 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13462 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13463 Change read_shndx type to unsigned int.
13464 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13465 int.
13466 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13467 * layout.cc (Layout::create_symtab_sections): Cast the result of
13468 local_symcount * symsize to off_t in the gold_assert.
13469
13470 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13471
13472 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13473 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13474 R_ARM_BASE_ABS.
13475 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13476 (Arm_relocate_functions::thm_abs5): New function.
13477 (Arm_relocate_functions::abs12): New function.
13478 (Arm_relocate_functions::abs16): New function.
13479 (Arm_relocate_functions::base_abs): New function.
13480 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13481 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13482 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13483 R_ARM_BASE_ABS.
13484 (Scan::global): Likewise.
13485 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13486 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13487 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13488 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13489 R_ARM_BASE_ABS.
13490
13491 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13492
13493 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13494 (Arm_relocate_functions::movt_prel): New function.
13495 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13496 (Arm_relocate_functions::thm_movt_prel): New function.
13497 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13498 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13499 (Scan::global, Relocate::relocate): Likewise.
13500 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13501
13502 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13503
13504 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13505 Incremental_checker.
13506 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13507 unsigned int.
13508 (class Incremental_inputs_header): New class.
13509 (Incremental_inputs_header_writer): Edit comment.
13510 (Incremental_inputs_entry): New class.
13511 (Incremental_inputs_entry_writer): Edit comment.
13512 (Sized_incremental_binary::do_find_incremental_inputs_section):
13513 Add *strtab_shndx parameter, fill it.
13514 (Sized_incremental_binary::do_check_inputs): New method.
13515 (Incremental_checker::can_incrementally_link_output_file): Use
13516 Sized_incremental_binary::check_inputs.
13517 (Incremental_inputs::report_command_line): Save command line in
13518 command_line_.
13519 * incremental.h:
13520 (Incremental_binary::find_incremental_inputs_section): New
13521 method.
13522 (Incremental_binary::do_find_incremental_inputs_section): Add
13523 strtab_shndx parameter.
13524 (Incremental_binary::do_check_inputs): New pure virtual method.
13525 (Sized_incremental_binary::do_check_inputs): Declare.
13526 (Incremental_checker::Incremental_checker): Add incremental_inputs
13527 parameter, use it to initialize incremental_inputs_.
13528 (Incremental_checker::incremental_inputs_): New field.
13529 (Incremental_checker::command_line): New method.
13530 (Incremental_checker::inputs): New method.
13531 (Incremental_checker::command_line_): New field.
13532
13533 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13534
13535 * incremental.cc: Include <cstdarg> and "target-select.h".
13536 (vexplain_no_incremental): New function.
13537 (explain_no_incremental): New function.
13538 (Incremental_binary::error): New method.
13539 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13540 method.
13541 (make_sized_incremental_binary): New function.
13542 (open_incremental_binary): New function.
13543 (can_incrementally_link_file): Add checks if output is ELF and has
13544 inputs section.
13545 * incremental.h: Include "elfcpp_file.h" and "output.h".
13546 (Incremental_binary): New class.
13547 (Sized_incremental_binary): New class.
13548 (open_incremental_binary): Declare.
13549 * object.cc (is_elf_object): Use
13550 elfcpp::Elf_recognizer::is_elf_file.
13551 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13552 * output.h (Output_file::filesize): New method.
13553
13554 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13555
13556 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13557 New function.
13558 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13559 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13560 function.
13561 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13562 function.
13563 (Arm_relocate_functions::movw_abs_nc): New function.
13564 (Arm_relocate_functions::movt_abs): New function.
13565 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13566 (Arm_relocate_functions::thm_movt_abs): New function.
13567 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13568 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13569 (Scan::global): Likewise.
13570 (Relocate::relocate): Likewise.
13571 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13572
13573 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13574
13575 * arm.cc (Arm_relocate_functions::got_prel) New function.
13576 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13577 (Relocate::relocate): Likewise.
13578 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13579
13580 2009-10-06 Ian Lance Taylor <iant@google.com>
13581
13582 * options.h (class General_options): Define
13583 split_stack_adjust_size parameter.
13584 * object.h (class Object): Add uses_split_stack_ and
13585 has_no_split_stack_ fields. Add uses_split_stack and
13586 has_no_split_stack accessor functions. Declare
13587 handle_split_stack_section.
13588 (class Reloc_symbol_changes): Define.
13589 (class Sized_relobj): Define Function_offsets. Declare
13590 split_stack_adjust, split_stack_adjust_reltype, and
13591 find_functions.
13592 * object.cc (Object::handle_split_stack_section): New function.
13593 (Sized_relobj::do_layout): Call handle_split_stack_section.
13594 * dynobj.cc (Sized_dynobj::do_layout): Call
13595 handle_split_stack_section.
13596 * reloc.cc (Sized_relobj::relocate_sections): Call
13597 split_stack_adjust for executable sections in split_stack
13598 objects. Pass reloc_map to relocate_section.
13599 (Sized_relobj::split_stack_adjust): New function.
13600 (Sized_relobj::split_stack_adjust_reltype): New function.
13601 (Sized_relobj::find_functions): New function.
13602 * target-reloc.h: Include "object.h".
13603 (relocate_section): Add reloc_symbol_changes parameter. Change
13604 all callers.
13605 * target.h (class Target): Add calls_non_split method. Declare
13606 do_calls_non_split virtual method. Declare match_view and
13607 set_view_to_nop.
13608 * target.cc: Include "elfcpp.h".
13609 (Target::do_calls_non_split): New function.
13610 (Target::match_view): New function.
13611 (Target::set_view_to_nop): New function.
13612 * gold.cc (queue_middle_tasks): Give an error if mixing
13613 split-stack and non-split-stack objects with -r.
13614 * i386.cc (Target_i386::relocate_section): Add
13615 reloc_symbol_changes parameter.
13616 (Target_i386::do_calls_non_split): New function.
13617 * x86_64.cc (Target_x86_64::relocate_section): Add
13618 reloc_symbol_changes parameter.
13619 (Target_x86_64::do_calls_non_split): New function.
13620 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13621 parameter.
13622 * powerpc.cc (Target_powerpc::relocate_section): Add
13623 reloc_symbol_changes parameter.
13624 * sparc.cc (Target_sparc::relocate_section): Add
13625 reloc_symbol_changes parameter.
13626 * configure.ac: Call AM_CONDITIONAL for the default target.
13627 * configure: Rebuild.
13628 * testsuite/Makefile.am (TEST_AS): New variable.
13629 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13630 (check_DATA): Add split_i386 and split_x86_64 files.
13631 (SPLIT_DEFSYMS): Define.
13632 (split_i386_[1234n].o): New targets.
13633 (split_i386_[124]): New targets.
13634 (split_i386_[1234r].stdout): New targets.
13635 (split_x86_64_[1234n].o): New targets.
13636 (split_x86_64_[124]): New targets.
13637 (split_x86_64_[1234r].stdout): New targets.
13638 (MOSTLYCLEANFILES): Add new executables.
13639 * testsuite/split_i386.sh: New file.
13640 * testsuite/split_x86_64.sh: New file.
13641 * testsuite/split_i386_1.s: New file.
13642 * testsuite/split_i386_2.s: New file.
13643 * testsuite/split_i386_3.s: New file.
13644 * testsuite/split_i386_4.s: New file.
13645 * testsuite/split_i386_n.s: New file.
13646 * testsuite/split_x86_64_1.s: New file.
13647 * testsuite/split_x86_64_2.s: New file.
13648 * testsuite/split_x86_64_3.s: New file.
13649 * testsuite/split_x86_64_4.s: New file.
13650 * testsuite/split_x86_64_n.s: New file.
13651 * testsuite/testfile.cc (Target_test): Update relocation_section
13652 function.
13653 * testsuite/Makefile.in: Rebuild.
13654
13655 2009-10-06 Ian Lance Taylor <iant@google.com>
13656
13657 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13658 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13659 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13660 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13661 the address on ldo_addrs_.
13662 (Target_i386::Relocate::fix_up_ldo): New function.
13663
13664 2009-10-06 Rafael Espindola <espindola@google.com>
13665
13666 * plugin.cc (add_input_library): New.
13667 (Plugin::load): Add add_input_library to tv.
13668 (Plugin_manager::add_input_file): Add the is_lib argument.
13669 (add_input_file): Update call to Plugin_manager::add_input_file.
13670 (add_input_library): New.
13671 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13672
13673 2009-09-30 Doug Kwan <dougkwan@google.com>
13674
13675 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13676 symbol and call Symbol::may_need_copy_reloc to determine if
13677 a copy reloc is needed.
13678 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13679 nocopyreloc is given in command line.
13680 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13681 given in command line.
13682 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13683 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13684 of the removed Target_i386::may_need_copy_reloc.
13685 * options.h (copyreloc): New option with default value false.
13686 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13687 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13688 instead of the removed Target_powerpc::may_need_copy_reloc.
13689 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13690 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13691 instead of the removed Target_sparc::may_need_copy_reloc.
13692 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13693 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13694 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13695 instead of the removed Target_x86_64::may_need_copy_reloc.
13696
13697 2009-09-30 Ian Lance Taylor <iant@google.com>
13698
13699 * object.h (class Object): Remove target_ field, and target,
13700 sized_target, and set_target methods.
13701 (Object::sized_target): Remove.
13702 (class Sized_relobj): Update declarations. Remove sized_target.
13703 * object.cc (Sized_relobj::setup): Remove target parameter.
13704 Change all callers.
13705 (Input_objects::add_object): Don't do anything with the target.
13706 (make_elf_sized_object): Add punconfigured parameter. Change all
13707 callers. Set or test parameter target.
13708 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13709 Change all callers.
13710 * parameters.cc (Parameters::set_target): Change parameter type to
13711 be non-const.
13712 (Parameters::default_target): Remove.
13713 (set_parameters_target): Change parameter type to be non-const.
13714 (parameters_force_valid_target): New function.
13715 (parameters_clear_target): New function.
13716 * parameters.h (class Parameters): Update declarations. Remove
13717 default_target method. Add sized_target and clear_target
13718 methods. Change target_ to be non-const.
13719 (set_parameters_target): Update declaration.
13720 (parameters_force_valid_target): Declare.
13721 (parameters_clear_target): Declare.
13722 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13723 as NULL if we aren't searching.
13724 (Add_symbols::run): Don't check for compatible target.
13725 * fileread.cc (Input_file::open_binary): Call
13726 parameters_force_valid_target.
13727 * gold.cc (queue_middle_tasks): Likewise.
13728 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13729 set_target on object.
13730 * dynobj.h (class Sized_dynobj): Update declarations.
13731 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13732 make_elf_object returns NULL.
13733 (Archive::include_member): Don't check whether object target is
13734 compatible.
13735 * output.cc (Output_section::add_input_section): Get target from
13736 parameters.
13737 (Output_section::relax_input_section): Likewise.
13738 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13739 parameters.
13740 (Sized_relobj::do_scan_relocs): Likewise.
13741 (Sized_relobj::relocate_sections): Likewise.
13742 * resolve.cc (Symbol_table::resolve): Likewise.
13743 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13744 parameter. Change all callers.
13745 (Symbol_table::add_from_object): Get target from parameters.
13746 (Symbol_table::add_from_relobj): Don't check object target.
13747 (Symbol_table::add_from_dynobj): Likewise.
13748 (Symbol_table::define_special_symbol): Get target from
13749 parameters.
13750 * symtab.h (class Symbol_table): Update declaration.
13751 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13752 parameter. Change all callers. Clear parameter target.
13753 (Binary_test): Test target here.
13754 * testsuite/object_unittest.cc (gold_testsuite): Remove
13755 target_test_pointer parameter. Change all callers.
13756 (Object_test): Test target here.
13757
13758 2009-09-26 Ian Lance Taylor <iant@google.com>
13759
13760 * testsuite/initpri1.c: Don't try to use constructor priorities if
13761 compiling with gcc before 4.3.
13762
13763 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13764
13765 * testsuite/retain_symbols_file_test.sh (check_present): Change
13766 output file name to retain_symbols_file_test.stdout.
13767 (check_absent): Likewise.
13768
13769 2009-09-18 Craig Silverstein <csilvers@google.com>
13770
13771 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13772 * options.cc: Include <cerrno> and <fstream>.
13773 (General_options::finalize): Parse -retain-symbols-file tag.
13774 * options.h: New flag.
13775 (General_options): New method should_retain_symbol, new
13776 variable symbols_to_retain.
13777 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13778 should_retain_symbol map.
13779 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13780 * testsuite/Makefile.in: Regenerate.
13781 * testsuite/retain_symbols_file_test.sh: New file.
13782
13783 2009-09-18 Nick Clifton <nickc@redhat.com>
13784
13785 * po/es.po: Updated Spanish translation.
13786
13787 2009-09-17 Doug Kwan <dougkwan@google.com>
13788
13789 * debug.h (DEBUG_RELAXATION): New constant.
13790 (DEBUG_ALL): Add DEBUG_RELAXATION.
13791 (debug_string_to_enum): Add relaxation debug option.
13792 * layout.cc
13793 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13794 Layout::Relaxation_debug_check::read_sections,
13795 Layout::Relaxation_debug_check::read_sections): New method definitions.
13796 (Layout::Layout): Initialize data members
13797 record_output_section_data_from_scrips_,
13798 script_output_section_data_list_ and relaxation_debug_check_.
13799 (Layout::save_segments, Layout::restore_segments,
13800 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13801 Layout::relaxation_loop_body): New method definitions.
13802 (Layout::finalize): Support relaxation. Move section layout code to
13803 Layout::relaxation_loop_body.
13804 (Layout::set_asection_address_from_script): Move code for orphan
13805 section placement out.
13806 (Layout::place_orphan_sections_in_script): New method definition.
13807 * layout.h (Output_segment_headers, Output_file_header):
13808 New forward class declarations.
13809 (Layout::~Layout): Define.
13810 (Layout::new_output_section_data_from_script): New method definition.
13811 (Layout::place_orphan_sections_in_script): New method declaration.
13812 (Layout::Segment_states): New type declaration.
13813 (Layout::save_segments, Layout::restore_segments,
13814 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13815 Layout::relaxation_loop_body): New method declarations.
13816 (Layout::Output_section_data_list): New type declaration.
13817 (Layout::Relaxation_debug_check): New class definition.
13818 (Layout::record_output_section_data_from_script_,
13819 Layout::script_output_section_data_list_, Layout::segment_states_,
13820 Layout::relaxation_debug_check_): New data members.
13821 * output.cc: (Output_section_headers::do_size): New method definition.
13822 (Output_section_headers::Output_section_headers): Move size
13823 computation to Output_section_headers::do_size.
13824 (Output_segment_headers::do_size): New method definition.
13825 (Output_file_header::Output_file_header): Move size computation to
13826 Output_file_header::do_size and call it.
13827 (Output_file_header::do_size): New method definition.
13828 (Output_data_group::Output_data_group): Adjust call to
13829 Output_section_data.
13830 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13831 (Output_symtab_xindex::do_write): Add array bound check.
13832 (Output_section::Input_section::print_to_mapfile): Handle
13833 RELAXED_INPUT_SECTION_CODE.
13834 (Output_section::Output_section): Initialize data member checkpoint_.
13835 (Output_section::~Output_section): Delete checkpoint object pointed
13836 by checkpoint_.
13837 (Output_section::add_input_section): Always add an Input_section if
13838 relaxing.
13839 (Output_section::add_merge_input_section): Add assert.
13840 (Output_section::relax_input_section): New method definition.
13841 (Output_section::set_final_data_size): Set load address to zero for
13842 an unallocated section.
13843 (Output_section::do_address_and_file_offset_have_reset_values):
13844 New method definition.
13845 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13846 Handle relaxed input section.
13847 (Output_section::sort_attached_input_sections): Checkpoint input
13848 section list lazily.
13849 (Output_section::get_input_sections): Change type of input_sections to
13850 list of Simple_input_section pointers. Checkpoint input section list
13851 lazily. Also handle relaxed input sections.
13852 (Output_section::add_input_section_for_script): Take a reference to
13853 a Simple_input_section object instead of Relobj pointer and section
13854 index as parameter. Handle relaxed input sections.
13855 (Output_section::save_states, Output_section::restore_states): New
13856 method definitions.
13857 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13858 (Output_data::is_data_size_fixed): New method definition.
13859 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13860 if it is fixed.
13861 (Output_data::address_and_file_offset_have_reset_values): New method
13862 definition.
13863 (Output_data::do_address_and_file_offset_have_reset_values): New method
13864 definition.
13865 (Output_data::set_data_size): Check that data size is not fixed.
13866 (Output_data::fix_data_size): New method definition.
13867 (Output_data::is_data_size_fixed_): New data member.
13868 (Output_section_headers::set_final_data_size): New method definition.
13869 (Output_section_headers::do_size): New method declaration.
13870 (Output_segment_headers::set_final_data_size): New method definition.
13871 (Output_segment_headers::do_size): New method declaration.
13872 (Output_file_header::set_final_data_size)::New method definition.
13873 (Output_file_header::do_size)::New method declaration.
13874 (Output_section_data::Output_section_data): Add new parameter
13875 is_data_size_fixed and use it to fix data size.
13876 (Output_data_const::Output_data_const): Adjust call to base class
13877 constructor and fix data size.
13878 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13879 base class constructor and fix data size.
13880 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13881 base class constructor and fix data size.
13882 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13883 class constructor and fix data size.
13884 (Output_data_group::set_final_data_size): New method definition.
13885 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13886 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13887 class constructor and fix data size.
13888 (Output_relaxed_input_section): New class definition.
13889 (Output_section::Simple_input_section): New class definition.
13890 (Output_section::get_input_sections): Adjust parameter list.
13891 (Output_section::add_input_section_for_script): Same.
13892 (Output_section::save_states, Output_section::restore_states,
13893 Output_section::do_address_and_file_offset_have_reset_values,
13894 (Output_section::Input_section::Input_section): Handle
13895 RELAXED_INPUT_SECTION_CODE. Add new overload for
13896 Output_relaxed_input_section.
13897 (Output_section::Input_section::is_input_section,
13898 Output_section::Input_section::set_output_section): Handle relaxed
13899 input section.
13900 (Output_section::Input_section::is_relaxed_input_section,
13901 Output_section::Input_section::output_section_data,
13902 Output_section::Input_section::relaxed_input_section): New method
13903 definitions.
13904 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13905 value.
13906 (Output_section::Input_section::u1_): Update comments.
13907 (Output_section::Input_section::u2_): Add new union member poris.
13908 (Output_section::Checkpoint_output_section): New classs definition.
13909 (Output_section::relax_input_section): New method declaration.
13910 (Output_section::checkpoint_): New data member.
13911 (Output_segment): Update comments.
13912 (Output_segment::Output_segment): Un-privatize copy constructor.
13913 (Output_segment::operator=): Un-privatize.
13914 * script-sections.cc (Output_section_element::Input_section_list):
13915 Change element type to Output_section::Simple_input_section.
13916 (Output_section_element_dot_assignment::set_section_addresses):
13917 Register output section data for relaxation clean up.
13918 (Output_data_exression::Output_data_expression): Adjust call to base
13919 constructor to fix data size.
13920 (Output_section_element_data::set_section_addresses): Register
13921 Output_data_expression object for relaxation clean up.
13922 (struct Input_section_info): Replace Relobj pointer and section index
13923 pair with Output_section::Simple_input_section and Convert struct to a
13924 class.
13925 (Input_section_sorter::operator()): Adjust access to
13926 Input_section_info data member to use accessors.
13927 (Output_section_element_input::set_section_addresses): Use layout
13928 parameter. Adjust code to use Output_section::Simple_input_section
13929 and Input_secction_info classes. Register filler for relaxation
13930 clean up.
13931 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13932 and section index pair with Output_section::Simple_input_section
13933 class. Adjust code accordingly.
13934 (Phdrs_element::release_segment): New method definition.
13935 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13936 segment list.
13937 (Script_sections::release_segments): New method definition.
13938 * gold/script-sections.h (Script_sections::release_segments): New
13939 method declaration.
13940 * gold/target.h (Target::may_relax, Target::relax,
13941 Target::do_may_relax, Target::do_relax): New method definitions.
13942
13943 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13944
13945 * arm.cc (has_signed_unsigned_overflow): New function.
13946 (Arm_relocate_functions::abs8): New function.
13947 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13948 (Target_arm::Scan::global): Likewise.
13949 (Target_arm::relocate::relocate): Likewise.
13950 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13951 Likewise.
13952
13953 2009-09-16 Cary Coutant <ccoutant@google.com>
13954
13955 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13956 * testsuite/Makefile.in: Regenerate.
13957
13958 2009-09-11 Nick Clifton <nickc@redhat.com>
13959
13960 * po/gold.pot: Updated by the Translation project.
13961
13962 2009-09-08 Cary Coutant <ccoutant@google.com>
13963
13964 * output.cc (Output_file::open): Add execute permission to empty file.
13965 * testsuite/Makefile.am (permission_test): New test.
13966 * testsuite/Makefile.in: Regenerate.
13967
13968 2009-09-02 Ian Lance Taylor <iant@google.com>
13969
13970 * output.cc (Output_file::resize): Call map_no_anonymous rather
13971 than map.
13972
13973 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13974
13975 * gold.cc: Include "incremental.h".
13976 (queue_initial_tasks): Call Incremental_checker methods.
13977 * incremental.cc: Include "output.h".
13978 (Incremental_checker::can_incrementally_link_output_file): New
13979 method.
13980 * incremental.h (Incremental_checker): New class.
13981
13982 * output.cc (Output_file::open_for_modification): New method.
13983 (Output_file::map_anonymous): Changed return type to bool. Record
13984 map in base_ field.
13985 (Output_file::map_no_anonymous): New method, broken out of map.
13986 (Output_file::map): Use map_no_anonymous and map_anonymous.
13987 * output.h (class Output_file): Update declarations.
13988
13989 2009-08-24 Cary Coutant <ccoutant@google.com>
13990
13991 * options.h (Command_line::Pre_options): New class.
13992 (Command_line::pre_options): New member.
13993 * options.cc (gold::options::ready_to_register): New variable.
13994 (One_option::register_option): Do nothing if not registering options.
13995 Assert if same short option registered twice.
13996 (General_options::General_options): Turn off option registration when
13997 done constructing.
13998 (Command_line::Pre_options::Pre_options): New constructor.
13999
14000 2009-08-24 Cary Coutant <ccoutant@google.com>
14001
14002 * options.h (General_options::no_keep_memory): Remove incorrect
14003 short option.
14004
14005 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14006
14007 * Makefile.am (am__skiplex, am__skipyacc): New.
14008 * Makefile.in: Regenerate.
14009
14010 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14011
14012 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14013 (INCLUDES): ... this.
14014 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14015 (AM_CPPFLAGS): Renamed from ...
14016 (INCLUDE): ... this.
14017 * Makefile.in, testsuite/Makefile.in: Regenerate.
14018
14019 * Makefile.in: Regenerate.
14020 * aclocal.m4: Likewise.
14021 * config.in: Likewise.
14022 * configure: Likewise.
14023 * testsuite/Makefile.in: Likewise.
14024
14025 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14026 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14027 * Makefile.in: Regenerate.
14028 * testsuite/Makefile.in: Regenerate.
14029
14030 2009-08-19 Cary Coutant <ccoutant@google.com>
14031
14032 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14033 symbols in shared libraries overridden by hidden or internal symbols
14034 in the main program.
14035
14036 2009-08-19 Chris Demetriou <cgd@google.com>
14037
14038 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14039 checking source file names in error messages.
14040
14041 2009-08-18 Doug Kwan <dougkwan@google.com>
14042
14043 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14044 an elcpp::Ehdr as parameter. Adjust call to set_target.
14045 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14046 an elfcpp::Ehdr as parameter.
14047 * object.cc (Object::set_target): Remove the version that looks up
14048 a target and sets it.
14049 (Sized_relobj::setup): Take a Target object instead of
14050 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14051 (make_elf_sized_object): Find target and ask target to
14052 make an ELF object.
14053 * object.h: (Object::set_target): Remove the version that looks up
14054 a target and sets it.
14055 (Sized_relobj::setup): Take a Target object instead of
14056 an elfcpp:Ehdr as parameter.
14057 * target.cc: Include dynobj.h.
14058 (Target::do_make_elf_object_implementation): New.
14059 (Target::do_make_elf_object): New.
14060 * target.h (Target::make_elf_object): New template declaration.
14061 (Target::do_make_elf_object): New method declarations.
14062 (Target::do_make_elf_object_implementation): New template declaration.
14063
14064 2009-08-14 Ian Lance Taylor <iant@google.com>
14065
14066 * gold.h (FUNCTION_NAME): Define.
14067 (gold_unreachable): Use FUNCTION_NAME.
14068
14069 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14070
14071 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14072 symbol in the --keep-unique list is not found.
14073
14074 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14075
14076 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14077 been maked as --keep-unique.
14078 (Icf::unfold_section): New function.
14079 * icf.h (Icf::unfold_section): New function.
14080 * options.h (General_options::keep_unique): New option.
14081 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14082 * testsuite/Makefile.in: Regenerate.
14083 * testsuite/icf_keep_unique_test.sh: New file.
14084 * testsuite/icf_keep_unique_test.cc: New file.
14085
14086 2009-08-12 Cary Coutant <ccoutant@google.com>
14087
14088 PR 10471
14089 * resolve.cc (Symbol_table::resolve): Check for references from
14090 dynamic objects to hidden and internal symbols.
14091 * testsuite/Makefile.am (hidden_test.sh): New test.
14092 * testsuite/Makefile.in: Regenerate.
14093 * testsuite/hidden_test.sh: New script.
14094 * testsuite/hidden_test_1.c: New test source.
14095 * testsuite/hidden_test_main.c: New test source.
14096
14097 2009-08-11 Doug Kwan <dougkwan@google.com>
14098
14099 * arm.cc: Update comments.
14100 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14101 segment to locate the .ARM.exidx section if present.
14102
14103 2009-08-09 Doug Kwan <dougkwan@google.com>
14104
14105 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14106 patch.
14107
14108 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14109 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14110 compiler warnings.
14111
14112 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14113
14114 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14115 valid tls_segment only for non-debug-section relocations.
14116 * testsuite/Makefile.am: Add gc_tls_test.
14117 * testsuite/Makefile.in: Regenerate.
14118 * testsuite/gc_tls_test.cc: New file.
14119 * testsuite/gc_tls_test.sh: New file.
14120
14121 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14122
14123 * icf.cc: New file.
14124 * icf.h: New file.
14125 * Makefile.am (CCFILES): Add icf.cc.
14126 (HFILES): Add icf.h
14127 * Makefile.in: Regenerate.
14128 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14129 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14130 section, symbol and addend information for the relocs.
14131 * gold.cc (queue_middle_tasks): Call identical code folding.
14132 * gold.h: Add defines for multimap.
14133 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14134 to the call of finalize_local_symbols.
14135 * main.cc (main): Create object of class Icf.
14136 * object.cc (Sized_relobj::do_layout): Allow this function to be
14137 called twice during icf.
14138 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14139 to sections marked as identical by icf.
14140 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14141 when available.
14142 (Sized_relobj::do_section_entsize): New function.
14143 * object.h (Object::section_entsize): New function.
14144 (Object::do_section_entsize): New pure virtual function.
14145 (Relobj::finalize_local_symbols): Add new parameter.
14146 (Relobj::do_section_entsize): New function.
14147 * options.h (General_options::icf): New option.
14148 (General_options::icf_iterations): New option.
14149 (General_options::print_icf_sections): New option.
14150 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14151 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14152 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14153 icf.
14154 * symtab.cc (Symbol_table::is_section_folded): New function.
14155 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14156 to sections marked as identical by icf.
14157 * symtab.h (Symbol_table::set_icf): New function.
14158 (Symbol_table::icf): New function.
14159 (Symbol_table::is_section_folded): New function.
14160 (Symbol_table::icf_): New data member.
14161 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14162 * testsuite/Makefile.am: Add commands to build icf_test.
14163 * testsuite/Makefile.in: Regenerate.
14164 * testsuite/icf_test.sh: New file.
14165 * testsuite/icf_test.cc: New file.
14166
14167 2009-07-24 Chris Demetriou <cgd@google.com>
14168
14169 * layout.cc (is_compressible_debug_section): Fix incorrect
14170 comment about compressed section names.
14171
14172 2009-07-20 Ian Lance Taylor <ian@airs.com>
14173
14174 PR 10419
14175 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14176
14177 2009-07-16 Ian Lance Taylor <iant@google.com>
14178
14179 PR 10400
14180 * layout.h: #include <map>.
14181 (class Kept_section): Change from struct to class. Add accessors
14182 and setters. Add section size to Comdat_group mapping. Change
14183 Comdat_group to std::map. Add is_comdat_ field. Add
14184 linkonce_size field in union.
14185 (class Layout): Update declaration of find_or_add_kept_section.
14186 Don't declare find_kept_object.
14187 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14188 parameter. Add object, shndx, is_comdat, and is_group_name
14189 parameters. Change all callers. Adjust for new Kept_section.
14190 (Layout::find_kept_object): Remove.
14191 * object.cc (Sized_relobj::include_section_group): Update use of
14192 Kept_section. Rename secnum to shndx. Only record
14193 Kept_comdat_section if sections are the same size.
14194 (Sized_relobj::include_linkonce_section): Update use of
14195 Kept_section. Only record Kept_comdat_section if sections are the
14196 same size. Set size of linkonce section.
14197 (Sized_relobj::map_to_kept_section): Update call to
14198 get_kept_comdat_section.
14199 * object.h (class Sized_relobj): Rename fields in
14200 Kept_comdat_section to drop trailing underscores; change object
14201 field to Relobj*. Change Kept_comdat_section_table to store
14202 struct rather than pointer.
14203 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14204 Add kept_object and kept_shndx parameters. Change all callers.
14205 (Sized_relobj::get_kept_comdat_section): Change return type to
14206 bool. Add kept_object and kept_shndx parameters. Change all
14207 callers.
14208 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14209 Layout::find_or_add_kept_section.
14210
14211 2009-07-09 Ian Lance Taylor <iant@google.com>
14212
14213 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14214 Reserve space in the hash table.
14215
14216 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14217
14218 * fileread.cc (File_read::get_mtime): New method.
14219 * fileread.h (Timespec): New structure.
14220 (File_read::get_mtime): New method.
14221 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14222 Renamed from timestamp_nsec.
14223 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14224 Elf_Xword.
14225 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14226 timestamp_nsec.
14227 (Incremental_inputs::report_archive): Save mtime; style fix.
14228 (Incremental_inputs::report_obejct): Save mtime; style fix.
14229 (Incremental_inputs::report_script): Save mtime; style fix.
14230 (Incremental_inputs::finalize_inputs): Style fix.
14231 (Incremental_inputs::finalize): Style fix.
14232 (Incremental_inputs::create_input_section_data): Store inputs
14233 mtime.
14234 * incremental.h (Incremental_inputs::report_script): Add mtime
14235 argument.
14236 (Incremental_inputs::Input_info::Input_info): Intialize only one
14237 union member.
14238 (Incremental_inputs::Input_info::archive): Move to nameless
14239 union.
14240 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14241 (Incremental_inputs::Input_info::script): Move to nameless union.
14242 (Incremental_inputs::mtime): New field.
14243 * script.cc (read_input_script): Pass file mtime to
14244 Incremental_input.
14245 * script.h (Script_info::inputs): Style fix.
14246
14247 2009-07-01 Ian Lance Taylor <ian@airs.com>
14248
14249 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14250 instead of 32.
14251
14252 2009-06-24 Ian Lance Taylor <iant@google.com>
14253
14254 PR 10156
14255 * layout.cc (Layout::choose_output_section): If we find an
14256 existing section, update the flags.
14257 (Layout::create_notes): New function, broken out of
14258 Layout::finalize.
14259 (Layout::finalize): Don't create note sections.
14260 (Layout::create_note): Don't crash if linker script discards
14261 section.
14262 (Layout::create_gold_note): Likewise.
14263 (Layout::create_build_id): Likewise. Don't set
14264 after_input_sections on the section.
14265 (Layout::create_executable_stack_info): Remove target parameter.
14266 Change caller.
14267 * layout.h (class Layout): Declare create_notes. Update
14268 declaration of create_executable_stack_info.
14269 * gold.cc (queue_middle_tasks): Call create_notes.
14270 * output.cc (Output_section::update_flags_for_input_section): Move
14271 here from output.h. If SHF_ALLOC flag is newly set, mark address
14272 invalid.
14273 * output.h (Output_data::mark_address_invalid): New function.
14274 (class Output_section): Only declare, not define,
14275 update_flags_for_input_section. Remove set_flags.
14276
14277 2009-06-24 Ian Lance Taylor <iant@google.com>
14278
14279 * script-sections.cc (Output_section_definition::
14280 set_section_addresses): Rename shadowing local load_address to
14281 laddr.
14282
14283 2009-06-24 Ian Lance Taylor <iant@google.com>
14284
14285 PR 10244
14286 * reloc.cc (relocate_sections): Skip empty relocation sections.
14287
14288 2009-06-23 Ian Lance Taylor <iant@google.com>
14289
14290 PR 10156
14291 * layout.cc (Layout::create_note): Use choose_output_section
14292 rather than make_output_section.
14293
14294 2009-06-23 Ian Lance Taylor <iant@google.com>
14295
14296 PR 10237
14297 * options.cc (General_options::parse_V): Set printed_version_.
14298 (General_options::General_options): Initialize printed_version_.
14299 * options.h (class General_options): Add printed_version_ field.
14300 * gold.cc (queue_initial_tasks): If there are no input files,
14301 don't give a fatal error if we printed the version information.
14302 (queue_middle_tasks): If using -r with a shared object, give a
14303 fatal error rather than an ordinary error.
14304
14305 2009-06-23 Ian Lance Taylor <iant@google.com>
14306
14307 PR 10219
14308 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14309 (Layout::make_output_section): Set have_stabstr_section_ if we see
14310 a .stab*str section.
14311 (Layout::finalize): Call link_stabs_sections.
14312 (Layout::link_stabs_sections): New file.
14313 * layout.h (class Layout): Add have_stabstr_section_ field.
14314 Declare link_stabs_sections.
14315
14316 2009-06-23 Doug Kwan <dougkwan@google.com>
14317
14318 * Makefile.am (libgold_a_LIBADD): New.
14319 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14320 * Makefile.in: Regenerate.
14321 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14322 * configure: Regenerate.
14323 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14324 * fileread.cc: Include sys/state.h
14325 * gold.h: Declare memmem and strndup if found missing.
14326 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14327
14328 2009-06-23 Ian Lance Taylor <iant@google.com>
14329
14330 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14331 * configure: Rebuild.
14332
14333 2009-06-23 Ian Lance Taylor <iant@google.com>
14334
14335 PR 10147
14336 * object.cc (Object::section_contents): Don't try to get a view if
14337 the section has length zero.
14338 (Object::handle_gnu_warning_section): If the section is empty, use
14339 the name of the section as the warning.
14340
14341 2009-06-23 Ian Lance Taylor <iant@google.com>
14342
14343 PR 10133
14344 * stringpool.h (class Stringpool_template): Add optimize_ field.
14345 (Stringpool_template::set_optimize): New function.
14346 * stringpool.cc (Stringpool_template::Stringpool_template):
14347 Initialize optimize_ field.
14348 (Stringpool_template::set_string_offsets): Test local optimize
14349 fild rather than parameter.
14350 * layout.cc (Layout::Layout): Call set_optimize on the section
14351 name stringpool.
14352
14353 2009-06-22 Ian Lance Taylor <iant@google.com>
14354
14355 PR 10030
14356 * yyscript.y: Parse TARGET.
14357 * script.cc (script_set_target): New function.
14358 * script-c.h (script_set_target): Declare.
14359 * options.cc (General_options::string_to_object_format): Rename
14360 from string_to_object_format in anonymous namespace. Change
14361 callers.
14362 * options.h (class General_options): Declare
14363 string_to_object_format.
14364
14365 2009-06-22 Ian Lance Taylor <iant@google.com>
14366
14367 * script-sections.cc (Script_sections::create_segments): Don't put
14368 program headers in a PT_LOAD segment if -n or -N.
14369
14370 2009-06-22 Ian Lance Taylor <iant@google.com>
14371
14372 PR 10141
14373 * options.h (class General_options): Add -z lazy and -z now. Sort
14374 -z options into alphabetical order.
14375 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14376
14377 2009-06-21 Ian Lance Taylor <iant@google.com>
14378
14379 * layout.cc (Layout::make_output_section): Call
14380 Target::new_output_section.
14381 (Layout::attach_allocated_section_to_segment): Put large section
14382 sections in a separate load segment with the large segment flag
14383 set.
14384 (Layout::segment_precedes): Sort large data segments after other
14385 load segments.
14386 (align_file_offset): New static function.
14387 (Layout::set_segment_offsets): Use align_file_offset.
14388 * output.h (class Output_section): Add is_small_section_ and
14389 is_large_section_ fields.
14390 (Output_section::is_small_section): New function.
14391 (Output_section::set_is_small_section): New function.
14392 (Output_section::is_large_section): New function.
14393 (Output_section::set_is_large_section): New function.
14394 (Output_section::is_large_data_section): New function.
14395 (class Output_segment): Add is_large_data_segment_ field.
14396 (Output_segment::is_large_data_segment): New function.
14397 (Output_segment::set_is_large_data_segment): New function.
14398 * output.cc (Output_section::Output_section): Initialize new
14399 fields.
14400 (Output_segment::Output_segment): Likewise.
14401 (Output_segment::add_output_section): Add assertion that large
14402 data sections always go in large data segments. Force small data
14403 sections to the end of the list of data sections. Force small BSS
14404 sections to the start of the list of BSS sections. For large BSS
14405 sections to the end of the list of BSS sections.
14406 * symtab.h (class Symbol): Declare is_common_shndx.
14407 (Symbol::is_defined): Check Symbol::is_common_shndx.
14408 (Symbol::is_common): Likewise.
14409 (class Symbol_table): Define enum Commons_section_type. Update
14410 declarations. Add small_commons_ and large_commons_ fields.
14411 * symtab.cc (Symbol::is_common_shndx): New function.
14412 (Symbol_table::Symbol_table): Initialize new fields.
14413 (Symbol_table::add_from_object): Put small and large common
14414 symbols in the right list.
14415 (Symbol_table::sized_finalized_symbol): Check
14416 Symbol::is_common_shndx.
14417 (Symbol_table::sized_write_globals): Likewise.
14418 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14419 common symbol lists. Don't call do_allocate_commons_list if the
14420 list is empty.
14421 (Symbol_table::do_allocate_commons_list): Remove is_tls
14422 parameter. Add comons_section_type parameter. Change all
14423 callers. Handle small and large common symbols.
14424 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14425 Symbol::is_common_shndx.
14426 * resolve.cc (symbol_to_bits): Likewise.
14427 * target.h (Target::small_common_shndx): New function.
14428 (Target::small_common_section_flags): New function.
14429 (Target::large_common_shndx): New function.
14430 (Target::large_common_section_flags): New function.
14431 (Target::new_output_section): New function.
14432 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14433 small_common_section_flags, and large_common_section_flags
14434 fields.
14435 (Target::do_new_output_section): New virtual function.
14436 * arm.cc (Target_arm::arm_info): Initialize new fields.
14437 * i386.cc (Target_i386::i386_info): Likewise.
14438 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14439 Likewise.
14440 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14441 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14442 (Target_x86_64::do_new_output_section): New function.
14443 * configure.ac: Define conditional MCMODEL_MEDIUM.
14444 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14445 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14446 (large_LDFLAGS): Define.
14447 * testsuite/large.c: New file.
14448 * testsuite/testfile.cc (Target_test::test_target_info):
14449 Initialize new fields.
14450 * configure, testsuite/Makefile.in: Rebuild.
14451
14452 2009-06-05 Doug Kwan <dougkwan@google.com>
14453
14454 * Makefile.am (CCFILES): Add target.cc.
14455 * Makefile.in: Regenerate.
14456 * i386.cc (class Target_i386): Define new virtual method to
14457 override do_is_local_label_name in parent.
14458 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14459 local symbols if --discard-locals or -X is given.
14460 * options.h (class General_options): Declare new options
14461 '--discard-locals' and '-X' for discarding locals.
14462 * target.h (class Target): Define new methods is_local_label_name.
14463 Declare new virtual method do_is_local_label_name.
14464 * target.cc: New file.
14465 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14466 (check_SCRIPTS): Add discard_locals_test.sh.
14467 (check_DATA): Add discard_local_tests.syms.
14468 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14469 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14470 * testsuite/Makefile.in: Regenerate.
14471 * testsuite/discard_locals_test.c: New file.
14472 * testsuite/discard_locals_test.sh: Same.
14473
14474 2009-06-05 Doug Kwan <dougkwan@google.com>
14475
14476 * object.cc (Sized_relobj::Sized_relobj): Initialize
14477 discarded_eh_frame_shndx_ to -1U.
14478 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14479 section.
14480 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14481 a discarded .eh_frame section.
14482 (Sized_relobj::do_finalize_local_symbols): Ditto.
14483 * object.h (class Sized_relobj): Declare new member
14484 discarded_eh_frame_shndx_.
14485 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14486 (local_labels_test.o, local_labels_test): New rules.
14487 * testsuite/Makefile.in: Regenerate.
14488
14489 2009-06-04 Doug Kwan <dougkwan@google.com>
14490
14491 * layout.cc (Layout::section_name_mapping): Add mapping for
14492 special ARM sections.
14493
14494 2009-06-03 Doug Kwan <dougkwan@google.com>
14495
14496 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14497 (utils::has_overflow): Same.
14498
14499 2009-06-03 Ian Lance Taylor <iant@google.com>
14500
14501 * layout.cc (Layout::section_name_mapping): New array, replacing
14502 Layout::linkonce_mapping.
14503 (Layout::section_name_mapping_count): New variable, replacing
14504 Layout::linkonce_mapping_count.
14505 (Layout::linkonce_output_name): Remove.
14506 (Layout::output_section_name): Rewrite.
14507 * layout.h (class Layout): Rename Linkonce_mapping to
14508 Section_name_mapping, linkonce_mapping to section_name_mapping,
14509 linkonce_mapping_count to section_name_mapping_count. Don't
14510 declare linkonce_output_name.
14511
14512 2009-06-03 Doug Kwan <dougkwan@google.com>
14513
14514 * gold/arm.cc (namespace utils): New.
14515 (Target_arm::reloc_is_non_pic): Define new method.
14516 (class Arm_relocate_functions): New.
14517 (Target_arm::Relocate::relocate): Handle relocation types used by
14518 Android.
14519
14520 2009-06-03 Ian Lance Taylor <iant@google.com>
14521
14522 * arm.cc (Target_arm::scan::global): Use || instead of |.
14523
14524 2009-06-02 Doug Kwan <dougkwan@google.com>
14525
14526 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14527 issued_non_pic_error_.
14528 (class Target_arm::Scan): Declare new method check_non_pic.
14529 Define new method symbol_needs_plt_entry.
14530 Declare new data member issued_non_pic_error_.
14531 (class Target_arm::Relocate): Declare new method
14532 should_apply_static_reloc.
14533 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14534 (Target_arm::Scan::check_non_pic): Define new method.
14535 (Target_arm::Scan::local): Handle a small subset of reloc types used
14536 by Android.
14537 (Target_arm::Scan::local): Same.
14538 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14539
14540 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14541
14542 * incremental.cc (Incremental_inputs::report_command_line): Filter
14543 out --incremental-* options.
14544
14545 2009-05-29 Doug Kwan <dougkwan@google.com>
14546
14547 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14548 template class.
14549 (class Target_arm): Update comment.
14550 (Target_arm::Target_arm): Initialize new data members GOT_,
14551 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14552 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14553 and Target_arm::rel_dyn_section.
14554 Declare new_enum Target_arm::Got_type.
14555 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14556 and DYNBSS_.
14557 Update commments for member do_dynsym_value.
14558 (Target_arm::got_size, Target_arm::plt_section,
14559 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14560 new methods inside class defintion.
14561 (Target_arm::got_section): Define new method.
14562 (Target_arm::rel_dyn_section): Same.
14563 (Output_data_plt_arm): New template class.
14564 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14565 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14566 (Output_data_plt_arm::add_entry): Same.
14567 (Output_data_plt_arm::first_plt_entry): Define new
14568 static data member for PLT instruction template.
14569 (Output_data_plt_arm::plt_entry): Same.
14570 (Output_data_plt_arm::do_write): Define new method.
14571 (Target_arm::make_plt_entry): Same.
14572 (Target_arm::do_finalize_sections): Same.
14573 (Target_arm::do_dynsym_value): Same.
14574
14575 2009-05-28 Doug Kwan <dougkwan@google.com>
14576
14577 * Makefile.am (TARGETSOURCES): Add arm.cc.
14578 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14579 * Makefile.in: Regenerate.
14580 * arm.cc: New file.
14581 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14582
14583 2009-05-26 Doug Kwan <dougkwan@google.com>
14584
14585 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14586 (General_options::check_excluded_libs): Strip off directories in
14587 archive name before matching like GNU ld does.
14588 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14589 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14590 (exclude_libs_test_LDFLAGS): Add linker option
14591 -Wl,--exclude-libs,libexclude_libs_test_3
14592 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14593 an explicit archive without using -l.
14594 (alt/libexclude_libs_test_3.a): New make rule.
14595 * testsuite/Makefile.in: Regenerate.
14596 * testsuite/exclude_libs_test.c : Declare lib3_default().
14597 (main): Call it.
14598 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14599 * exclude_libs_test_3.c: New file.
14600
14601 2009-05-26 Nick Clifton <nickc@redhat.com>
14602
14603 * po/id.po: New Indonesian translation.
14604 * po/gold.pot: Updated template file.
14605
14606 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14607
14608 * testsuite/Makefile.am: Add -ffunction-sections to compile
14609 gc_comdat_test files. Add -Wl,--gc-sections to build
14610 gc_comdat_test.
14611 * testsuite/Makefile.in: Regenerate.
14612 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14613
14614 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14615
14616 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14617 kept comdat section was garbage collected.
14618 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14619 * testsuite/Makefile.in: Regenerate.
14620 * testsuite/gc_comdat_test.sh: New file.
14621 * testsuite/gc_comdat_test_1.cc: New file.
14622 * testsuite/gc_comdat_test_2.cc: New file.
14623
14624 2009-05-19 Doug Kwan <dougkwan@google.com>
14625
14626 * archive.cc (Archive::Archive): Move constructor from archive.h
14627 to here. Initialize no_export_.
14628 (Archive::get_elf_object_for_member): Set no_export flag of object.
14629 * archive.h (Archive::Archive): Move constructor body to
14630 archive.cc.
14631 (Archive::no_export): New method.
14632 (Archive::no_export_): New field.
14633 * object.h (Object::Object): Initialize no_export_ to false.
14634 (Object::no_export, Object::set_no_export): New methods.
14635 (Object::no_export_): New field.
14636 * options.cc (General_options::parse_exclude_libs): New method.
14637 (General_options::check_excluded_libs) Same.
14638 * options.h (exclude_libs): New option.
14639 (General_options::check_excluded_libs): New method declaration.
14640 (General_options::excluded_libs_): New field.
14641 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14642 default or protected visibility if an object has no-export flag set.
14643 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14644 (check_SCRIPTS): Add exclude_libs_test.sh.
14645 (check_DATA): Add exclude_libs_test.syms.
14646 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14647 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14648 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14649 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14650 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14651 libexclude_libs_test_2.a): New rules.
14652 * testsuite/Makefile.in: Regenerate.
14653 * testsuite/exclude_libs_test.c: New file.
14654 * testsuite/exclude_libs_test.sh: Ditto.
14655 * testsuite/exclude_libs_test_1.c: Ditto.
14656 * testsuite/exclude_libs_test_2.c: Ditto.
14657
14658 2009-05-15 Ian Lance Taylor <iant@google.com>
14659
14660 * configure.ac: Check for declarations for cases where libiberty.h
14661 checks HAVE_DECL_xxx.
14662 * configure, config.in: Rebuild.
14663
14664 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14665
14666 * gold.h (Incremental_argument_list): Remove (invalid) forward
14667 declaration.
14668 * incremental.cc (Incremental_inputs::report_achive): New method.
14669 (Incremental_inputs::report_object): New method.
14670 (Incremental_inputs::report_script): New method.
14671 (Incremental_inputs::finalize_inputs): New method.
14672 (Incremental_inputs::finalize): Call finalize_inputs().
14673 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14674 Create inputs entries.
14675 * incremental.h (Incremental_input_type): New enum.
14676 (Incremental_inputs::Incremental_input): Initialize new fields.
14677 (Incremental_inputs::report_inputs): New method.
14678 (Incremental_inputs::report_achive): New method.
14679 (Incremental_inputs::report_object): New method.
14680 (Incremental_inputs::report_script): New method.
14681 (Incremental_inputs::finalize_inputs): New method.
14682 (Incremental_inputs::Input_info): New struct.
14683 (Incremental_inputs::Input_info_map): New typedef.
14684 (Incremental_inputs::lock_): New field.
14685 (Incremental_inputs::Inputs_): New field.
14686 (Incremental_inputs::Inputs_map): New field.
14687 * main.cc (main): Call Incremental_input::report_inputs.
14688 * options.h (Input_argument_list): Typedef moved from
14689 Input_arguments.
14690 (Input_file_group::Files): Remove, use ::Input_argument_list.
14691 (Input_file_group::Input_argument_list): Remove, use
14692 ::Input_argument_list.
14693 * plugin.cc (Plugin_manager::add_input_file): Add error in
14694 incremental build.
14695 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14696 functions.
14697 * script.cc (read_input_script): Call
14698 Incremental_input::report_script.
14699 * script.h (Script_info): New class.
14700
14701 2009-04-27 Ian Lance Taylor <iant@google.com>
14702
14703 * x86_64.cc (do_adjust_output_section): Set entsize to
14704 plt_entry_size.
14705
14706 2009-04-23 Elliott Hughes <enh@google.com>
14707
14708 * output.cc (Output_file::close): After short writes, continue
14709 writing from the correct offset in the buffer being written.
14710
14711 2009-04-23 Chris Demetriou <cgd@google.com>
14712
14713 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14714 * configure: Regenerate.
14715 * config.in: Regenerate.
14716 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14717 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14718
14719 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14720
14721 * incremental.cc (Incremental_inputs_header_data): Renamed from
14722 Incremental_input_header_data.
14723 (Incremental_inputs_header_data::data_size): New field.
14724 (Incremental_inputs_header_data::put_input_file_count): Renamed
14725 from input_file_count.
14726 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14727 from command_line_offset.
14728 (Incremental_inputs_header_data::put_reserved): Renamed from
14729 put_reserved.
14730 (Incremental_inputs_entry_data): Renamed from
14731 Incremental_input_entry_data.
14732 (Incremental_inputs_entry_data::data_size): New field.
14733 (Incremental_inputs::report_command_line): New method.
14734 (Incremental_inputs::finalize): New method.
14735 (Incremental_inputs::create_incremental_inputs_data): New method.
14736 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14737 * incremental.h: New file.
14738 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14739 (Layout::finalize): Create incremental inputs section in
14740 incremental builds.
14741 (Layout::create_incremental_info_sections): New method.
14742 * layout.h (Layout::incremental_inputs): New method.
14743 (Layout::create_incremental_info_sections): New method.
14744 (Layout::incremental_inputs_): New field.
14745 * main.cc (main): Notify Incremental_input of the command line.
14746
14747 2009-04-01 Ian Lance Taylor <iant@google.com>
14748 Mikolaj Zalewski <mikolajz@google.com>
14749
14750 * gold.h (reserve_unordered_map): Define, three versions, one for
14751 each version of Unordered_map.
14752 * layout.cc (Layout::Layout): Remove options parameter. Add
14753 number_of_input_files parameter. Don't initialize options_.
14754 Initialize number_of_input_files_ and resized_signatures_. Move
14755 sections_are_attached_.
14756 (Layout::layout_group): Reserve space for group_signatures_.
14757 (Layout::find_or_add_kept_section): Change name parameter to be a
14758 reference. Resize signatures_ map when it gets large enough.
14759 (Layout::layout_eh_frame): Use parameters->options() instead of
14760 this->options_.
14761 (Layout::make_output_section): Likewise.
14762 (Layout::attach_allocated_section_to_segment): Likewise.
14763 (Layout::finalize, Layout::create_executable_stack): Likewise.
14764 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14765 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14766 * layout.h (class Layout): Update declarations. Remove options_
14767 field. Add number_of_input_files_ and resized_signatures_
14768 fields. Move sections_are_attached_ field.
14769 * main.cc (main): Pass number of input files to Layout
14770 constructor. Don't pass options.
14771
14772 2009-03-30 Ian Lance Taylor <iant@google.com>
14773
14774 * ffsll.c (ffsll): Correct implementation.
14775
14776 2009-03-27 Ian Lance Taylor <iant@google.com>
14777
14778 * ffsll.c: New file.
14779 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14780 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14781 * ftruncate.c (ftruncate): Declare before definition.
14782 * mremap.c (mremap): Likewise.
14783 * pread.c (pread): Likewise.
14784 * configure, Makefile.in, config.in: Rebuild.
14785
14786 * mremap.c: New file.
14787 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14788 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14789 (mremap): Declare if HAVE_MREMAP is not defined.
14790 * configure, Makefile.in, config.in: Rebuild.
14791
14792 2009-03-27 Cary Coutant <ccoutant@google.com>
14793
14794 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14795 position independent.
14796 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14797 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14798
14799 2009-03-24 Cary Coutant <ccoutant@google.com>
14800
14801 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14802 an executable.
14803 (needs_dynamic_reloc): Likewise.
14804
14805 2009-03-24 Ian Lance Taylor <iant@google.com>
14806
14807 * yyscript.y (file_cmd): Recognize EXTERN.
14808 (extern_name_list, extern_name_list_body): New nonterminals.
14809 * script.cc (script_add_extern): Define.
14810 * script-c.h (script_add_extern): Declare.
14811
14812 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14813
14814 * object.cc (is_elf_object): Define.
14815 * object.h (is_elf_object): Declare.
14816 * archive.cc (Archive::get_elf_object_for_member): Call
14817 is_elf_object.
14818 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14819
14820 2009-03-24 Elliott Hughes <enh@google.com>
14821
14822 * output.cc (Output_file::map_anonymous): Define.
14823 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14824 try an anonymous one. Report the size if the mmap fails.
14825 * output.h (class Output_file): Declare map_anonymous.
14826
14827 2009-03-24 Ian Lance Taylor <iant@google.com>
14828
14829 * target-select.cc (instantiate_target): Don't acquire the lock if
14830 the instantiated_target_ field has already been set.
14831
14832 2009-03-23 Ian Lance Taylor <iant@google.com>
14833
14834 * gold-threads.h (class Initialize_lock): Define.
14835 * gold-threads.cc (class Initialize_lock_once): Define.
14836 (initialize_lock_control): New static variable.
14837 (initialize_lock_pointer): New static variable.
14838 (initialize_lock_once): New static function.
14839 (Initialize_lock::Initialize_lock): Define.
14840 (Initialize_lock::initialize): Define.
14841 * target-select.h: Include "gold-threads.h".
14842 (class Target_selector): Add lock_ and initialize_lock_ fields.
14843 Don't define instantiate_target, just declare it.
14844 * target-select.cc (Target_selector::Target_selector): Initialize
14845 new fields.
14846 (Target_selector::instantiate_target): Define.
14847 * descriptors.h: Include "gold-threads.h".
14848 (class Descriptors): Add initialize_lock_ field.
14849 * descriptors.cc (Descriptors::Descriptors): Initialize new
14850 field.
14851 (Descriptors::open): Use initialize_lock_ field
14852 * errors.h (class Errors): Add initialize_lock_ field.
14853 * errors.cc (Errors::Errors): Initialize new field.
14854 (Errors::initialize_lock): Use initialize_lock_ field.
14855 * powerpc.cc (class Target_selector_powerpc): Remove
14856 instantiated_target_ field. In do_recognize call
14857 instantiate_target rather than do_instantiate_target. In
14858 do_instantiate_target just allocate a new target.
14859 * sparc.cc (class Target_selector_sparc): Likewise.
14860
14861 * freebsd.h: New file.
14862 * i386.cc: Include "freebsd.h".
14863 (Target_i386): Derive from Target_freebsd rather than
14864 Sized_target.
14865 (Target_selector_i386): Derive from Target_selector_freebsd rather
14866 than Target_selector.
14867 * x86_64.cc: Include "freebsd.h".
14868 (Target_x86_64): Derive from Target_freebsd rather than
14869 Sized_target.
14870 (Target_selector_x86_64): Derive from Target_selector_freebsd
14871 rather than Target_selector.
14872 * target.h (class Target): Add adjust_elf_header and
14873 do_adjust_elf_header.
14874 * output.cc (Output_file_header:: do_sized_write): Call target
14875 adjust_elf_header routine.
14876 * configure.tgt: Set targ_osabi.
14877 * configure.ac: Define GOLD_DEFAULT_OSABI.
14878 * parameters.cc (Parameters::default_target): Pass
14879 GOLD_DEFAULT_OSABI to select_target.
14880 * target-select.h (class Target_selector): Make instantiate_target
14881 protected rather than private.
14882 * Makefile.am (HFILES): Add freebsd.h.
14883 * configure, Makefile.in, config.in: Rebuild.
14884
14885 * merge.cc (do_add_input_section): Correct pend value. Change
14886 message about last entry not being null terminated from error to
14887 warning.
14888
14889 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14890
14891 * incremental.cc: New file.
14892 * Makefile.am (CCFILES): Add incremental.cc.
14893 * Makefile.in: Rebuild.
14894
14895 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14896
14897 * layout.cc (Layout::output_section_name): Preserve names
14898 of '.note.' sections.
14899
14900 2009-03-19 Ian Lance Taylor <iant@google.com>
14901
14902 * descriptors.cc (Descriptors::open): Check that the options are
14903 valid before using them.
14904
14905 2009-03-18 Ian Lance Taylor <iant@google.com>
14906
14907 * script-sections.h: Include <list>.
14908 (class Script_sections): Change Sections_elements from std::vector
14909 to std::list. Typedef public Elements_iterator. Add
14910 orphan_section_placement_, data_segment_align_start_, and
14911 saw_data_segment_align_ fields. Remove data_segment_align_index_
14912 field.
14913 * script-sections.cc (class Orphan_section_placement): New class.
14914 (class Sections_element): Add virtual functions is_relro and
14915 orphan_section_init. Remove virtual function place_orphan_here.
14916 (class Output_section_definition): Add is_relro and
14917 orphan_section_init. Remove place_orphan_here.
14918 (class Orphan_output_section): Likewise.
14919 (Script_sections::Script_sections): Update for field changes.
14920 (Script_sections::data_segment_align): Set saw_data_segment_align_
14921 and data_segment_align_start_, not data_segment_align_index.
14922 (Script_sections::data_segment_relro_end): Check
14923 saw_data_segment_align_. Use data_segment_align_start_ rather
14924 than data_segment_align_index_.
14925 (Script_sections::place_orphan): Rewrite to use
14926 Orphan_section_placement.
14927
14928 2009-03-17 Ian Lance Taylor <iant@google.com>
14929
14930 * archive.cc (Archive::add_symbols): Check for a version attached
14931 to the symbol name in the archive map.
14932 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14933 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14934 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14935 (ver_test_11.a): New target.
14936 * testsuite/Makefile.in: Rebuild.
14937
14938 * configure.ac: Check for chsize and posix_fallocate. Replace
14939 ftruncate.
14940 * ftruncate.c: New file, from gnulib.
14941 * output.cc (posix_fallocate): Define dummy version if not
14942 HAVE_POSIX_FALLOCATE.
14943 (Output_file::map): Call posix_fallocate rather than lseek and
14944 write.
14945 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14946 * configure, Makefile.in, config.in: Rebuild.
14947
14948 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
14949
14950 * layout.h (Layout::create_note): Add section_name parameter.
14951 * layout.cc (Layout::create_note): Likewise.
14952 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
14953
14954 2009-03-17 Ian Lance Taylor <iant@google.com>
14955
14956 * descriptors.cc: Include "options.h".
14957 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14958 (Descriptors::open): Always use O_CLOEXEC when opening a new
14959 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14960 then set FD_CLOEXEC.
14961
14962 * sparc.cc (class Target_sparc): Add has_got_section.
14963 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14964 make sure we have a GOT section.
14965
14966 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14967 (Target_sparc::Scan::local): Likewise.
14968 (Target_sparc::Scan::global): Likewise.
14969 (Target_sparc::Relocate::relocate): Likewise.
14970 (Target_sparc::Relocate::relocate_tls): Likewise.
14971
14972 * symtab.cc (Symbol_table::define_default_version): New function,
14973 broken out of add_from_object.
14974 (Symbol_table::add_from_object): Call define_default_version.
14975 (Symbol_table::define_special_symbol): Add resolve_oldsym
14976 parameter. Change all callers. If the version for a symbol comes
14977 from a version script, resolve it with the symbol with the same
14978 name with no version. Also add the symbol without a version if
14979 appropriate.
14980 (do_define_in_output_data): If resolving with oldsym, don't delete
14981 sym.
14982 (do_define_in_output_segment): Likewise.
14983 (do_define_as_constant): Likewise.
14984 * symtab.h (class Symbol_table): Update declarations.
14985
14986 2009-03-13 Ian Lance Taylor <iant@google.com>
14987
14988 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14989 (Read_symbols::requeue): New function.
14990 (Read_symbols::do_read_symbols): If make_elf_object fails because
14991 the target type is not configured, and the file was searched for,
14992 issue a warning and retry with the next directory.
14993 (Add_symbols::run): If the file has an incompatible format, and
14994 it was searched for, requeue the Read_symbols task. On error,
14995 release the object.
14996 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14997 dirindex parameter to constructor. Change all callers. Declare
14998 incompatible_warning and requeue.
14999 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15000 input_argument_ and input_group_ fields. Add them to
15001 constructor. Change all callers.
15002 (class Read_script): Add dirindex_ field. Add it to constructor.
15003 Change all callers.
15004 * archive.cc (Archive::setup): Remove input_objects parameter.
15005 Change all callers.
15006 (Archive::get_file_and_offset): Likewise.
15007 (Archive::read_all_symbols): Likewise.
15008 (Archive::read_symbols): Likewise.
15009 (Archive::get_elf_object_for_member): Remove input_objects
15010 parameter. Add punconfigured parameter. Change all callers.
15011 (Archive::add_symbols): Change return type to bool. Check return
15012 value of include_member.
15013 (Archive::include_all_members): Likewise.
15014 (Archive::include_member): Change return type to bool. Return
15015 false if first included object has incompatible target. Set
15016 included_member_ field.
15017 (Add_archive_symbols::run): If add_symbols returns false, requeue
15018 Read_symbols task.
15019 * archive.h (class Archive): Add included_member_ field.
15020 Initialize it in constructor. Add input_file and searched_for
15021 methods. Update declarations.
15022 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15023 input_argument_ fields. Add them to constructor. Change all
15024 callers.
15025 * script.cc: Include "target-select.h".
15026 (class Parser_closure): Add skip_on_incompatible_target_ and
15027 found_incompatible_target_ fields. Add
15028 skip_on_incompatible_target parameter to constructor. Change all
15029 callers. Add methods skip_on_incompatible_target,
15030 clear_skip_on_incompatible_target, found_incompatible_target, and
15031 set_found_incompatible_target.
15032 (read_input_script): Add dirindex parameter. Change all callers.
15033 If parser finds an incompatible target, requeue Read_symbols
15034 task.
15035 (script_set_symbol): Clear skip_on_incompatible_target in
15036 closure.
15037 (script_add_assertion, script_parse_option): Likewise.
15038 (script_start_sections, script_add_phdr): Likewise.
15039 (script_check_output_format): New function.
15040 * script.h (read_input_script): Update declaration.
15041 * script-c.h (script_check_output_format): Declare.
15042 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15043 (ignore_cmd): Remove OUTPUT_FORMAT.
15044 * fileread.cc (Input_file::Input_file): Add explicit this.
15045 (Input_file::will_search_for): New function.
15046 (Input_file::open): Add pindex parameter. Change all callers.
15047 * fileread.h (class Input_file): Add input_file_argument method.
15048 Declare will_search_for. Update declarations.
15049 * object.cc (make_elf_object): Add punconfigured parameter.
15050 Change all callers.
15051 * object.h (class Object): Make input_file public. Add
15052 searched_for method.
15053 (make_elf_object): Update declaration.
15054 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15055 restart search.
15056 * dirsearch.h (class Dirsearch): Update declaration.
15057 * options.h (class General_options): Add --warn-search-mismatch.
15058 * parameters.cc (Parameters::is_compatible_target): New function.
15059 * parameters.h (class Parameters): Declare is_compatible_target.
15060 * workqueue.cc (Workqueue::add_blocker): New function.
15061 * workqueue.h (class Workqueue): Declare add_blocker.
15062
15063 * fileread.cc (Input_file::open): Remove options parameter.
15064 Change all callers.
15065 (Input_file::open_binary): Likewise.
15066 * script.cc (read_input_script): Likewise.
15067 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15068 options parameter from constructor. Change all callers.
15069 (class Read_script): Likewise.
15070 * fileread.h (class Input_file): Update declarations.
15071 * script.h (read_input_script): Update declaration.
15072
15073 2009-03-10 Nick Clifton <nickc@redhat.com>
15074
15075 * po/es.po: New Spanish translation.
15076
15077 2009-03-06 Cary Coutant <ccoutant@google.com>
15078
15079 * options.cc (parse_short_option): Keep dash_z from registering itself.
15080
15081 2009-03-03 Ian Lance Taylor <iant@google.com>
15082
15083 PR 9918
15084 * target-reloc.h (relocate_section): Pass output_section to
15085 relocate.
15086 * i386.cc (Target_i386::should_apply_static_reloc): Add
15087 output_section parameter. Change all callers.
15088 (Target_i386::Relocate::relocate): Add output_section parameter.
15089 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15090 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15091 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15092 * testsuite/two_file_shared.sh: New script.
15093 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15094 (check_DATA): Add two_file_shared.dbg.
15095 (two_file_shared.dbg): New target.
15096 * testsuite/Makefile.in: Rebuild.
15097
15098 2009-03-01 Ian Lance Taylor <iant@google.com>
15099
15100 * configure.ac: Check for byteswap.h.
15101 * configure: Rebuild.
15102 * config.in: Rebuild.
15103
15104 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15105
15106 * layout.cc (Layout::find_or_add_kept_section): New function.
15107 (Layout::add_comdat): Removed.
15108 * layout.h (struct Kept_section): Move out of class Layout.
15109 Remove trailing underscores from field names. Add group_sections
15110 field. Rename group_ field to is_group. Change all uses.
15111 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15112 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15113 comdat_groups_ field.
15114 (Sized_relobj::include_section_group): Use
15115 find_or_add_kept_section and Kept_section::group_sections.
15116 (Sized_relobj::include_linkonce_section): Likewise.
15117 * object.cc (class Sized_relobj): Don't define Comdat_group or
15118 Comdat_group_table. Remove find_comdat_group and
15119 add_comdat_group. Remove comdat_groups_ field.
15120 * plugin.cc (include_comdat_group): Use
15121 Layout::find_or_add_kept_section.
15122
15123 2009-02-28 Ian Lance Taylor <iant@google.com>
15124
15125 * README: --gc-sections and map files are now supported. Document
15126 some build requirements.
15127
15128 PR 6992
15129 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15130 relocatable link set the value of the section symbol to zero.
15131 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15132 relocatable link don't include the section address in the local
15133 symbol value.
15134
15135 2009-02-27 Ian Lance Taylor <iant@google.com>
15136
15137 PR 6811
15138 * options.h (class Search_directory): Add is_system_directory.
15139 (class General_options): Declare is_in_system_directory.
15140 * options.cc (get_relative_sysroot): Make static.
15141 (get_default_sysroot): Make static.
15142 (General_optoins::is_in_system_directory): New function.
15143 * fileread.cc (Input_file::is_in_system_directory): New function.
15144 * fileread.h (class Input_file): Declare is_in_system_directory.
15145 * object.h (class Object): Add is_in_system_directory.
15146 (class Input_objects): Remove system_library_directory_ field.
15147 * object.cc (Input_objects::add_object): Don't set
15148 system_library_directory_.
15149 (input_objects::found_in_system_library_directory): Remove.
15150 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15151 parameter. Change all callers.
15152 (Symbol_table::sized_write_globals): Likewise.
15153 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15154 Call Object::is_in_system_directory.
15155 * symtab.h (class Symbol_table): Update declarations.
15156
15157 PR 5990
15158 * descriptors.h (Open_descriptor): Add is_on_stack field.
15159 * descriptors.cc (Descriptors::open): If the descriptor is on the
15160 top of the stack, remove it. Initialize is_on_stack field.
15161 (Descriptors::release): Only add pod to stack if it is not on the
15162 stack already.
15163 (Descriptors::close_some_descriptor): Clear stack_next and
15164 is_on_stack fields.
15165
15166 PR 7091
15167 * output.cc (Output_section::find_starting_output_address): Rename
15168 from starting_output_address; add PADDR parameter; change return
15169 type.
15170 * output.h (class Output_section): Declare
15171 find_starting_output_address instead of starting_output_address.
15172 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15173 section symbol for which we can't find a merge section.
15174
15175 PR 9836
15176 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15177 hidden or internal, force the symbol to be local.
15178 * resolve.cc (Symbol::override_visibility): Define.
15179 (Symbol::override_base): Use override_visibility.
15180 (Symbol_table::resolve): Likewise.
15181 (Symbol::override_base_with_special): Likewise.
15182 (Symbol_table::override_with_special): If the visibility is hidden
15183 or internal, force the symbol to be local.
15184 * symtab.h (class Symbol): Add set_visibility and
15185 override_visibility.
15186 * testsuite/ver_test_1.sh: New file.
15187 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15188 (check_DATA): Add ver_test_1.syms.
15189 (ver_test_1.syms): New target.
15190 * testsuite/Makefile.in: Rebuild.
15191
15192 2009-02-25 Cary Coutant <ccoutant@google.com>
15193
15194 * layout.cc (Layout::choose_output_section): Don't rename sections
15195 when using a linker script that has a SECTIONS clause.
15196 * Makefile.in: Regenerate.
15197
15198 * testsuite/Makefile.am (script_test_5.sh): New test case.
15199 * testsuite/Makefile.in: Regenerate.
15200 * testsuite/script_test_5.cc: New file.
15201 * testsuite/script_test_5.sh: New file.
15202 * testsuite/script_test_5.t: New file.
15203
15204 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15205
15206 * archive.cc (Archive::include_member): Update calls to add_symbols.
15207 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15208 the Layout argument.
15209 * dynobj.h (do_add_symbols): Add the Layout argument.
15210 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15211 Layout argument.
15212 * object.h (Object::add_symbols): Add the Layout argument.
15213 (Object::do_add_symbols): Add the Layout argument.
15214 (Sized_relobj::do_add_symbols): Add the Layout argument.
15215 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15216 Unify the two versions.
15217 (Add_plugin_symbols): Remove.
15218 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15219 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15220 (Add_plugin_symbols): Remove.
15221 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15222 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15223 (Add_symbols::run): Make it work with Pulginobj.
15224
15225 2009-02-06 Ian Lance Taylor <iant@google.com>
15226
15227 * object.cc (Sized_relobj::do_layout): Make info message start
15228 with lower case letter.
15229
15230 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15231
15232 * binary.cc: Fix file comment.
15233
15234 * options.h (enum Incremental_disposition): Define.
15235 (class General_options): Add new options: --incremental,
15236 --incremental_changed, --incremental_unchanged,
15237 --incremental_unknown. Add incremental_disposition_ and
15238 implicit_incremental_ fields.
15239 (General_options::incremental_disposition): New function.
15240 (class Position_dependent_options): Add incremental_disposition
15241 option.
15242 (Position_dependent_options::copy_from_options): Set incremental
15243 dispositions.
15244 * options.cc (General_options::parse_incremental_changed): New
15245 function.
15246 (General_options::parse_incremental_unchanged): New function.
15247 (General_options::parse_incremental_unknown): New function.
15248 (General_options::General_options): Initialize new fields
15249 incremental_disposition_ and implicit_incremental_.
15250 (General_options::finalize): Check for uasge of --incremental-*
15251 without --incremental.
15252
15253 2009-02-06 Chris Demetriou <cgd@google.com>
15254
15255 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15256 pointer and to report location as the file name associated with
15257 the symbol.
15258 (gold_undefined_symbol_at_location): New function to replace the
15259 old gold_undefined_symbol functionality.
15260 * target-reloc.h (relocate_section): Update to use
15261 gold_undefined_symbol_at_location.
15262 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15263 Call gold_undefined_symbol function rather than gold_error.
15264 * errors.h (Errors::undefined_symbol): Take location as a
15265 string, rather than calculating it from a relocation.
15266 * errors.cc (Errors::fatal): Print "fatal error:" before the
15267 formatted message.
15268 (Errors::error, Errors::error_at_location): Print "error: "
15269 before the formatted message.
15270 (Errors::undefined_symbol): Take location as a string, rather
15271 than calculating it from a relocation.
15272 (gold_undefined_symbol_at_location): New function akin to
15273 old gold_undefined_symbol, calculates location from relocation.
15274 (gold_undefined_symbol): Change to take only a Symbol pointer
15275 and to report location as the file name associated with the symbol.
15276 * testsuite/debug_msg.sh: Update for changed error messages.
15277 * testsuite/undef_symbol.sh: Likewise.
15278
15279 2009-02-04 Duncan Sands <baldrick@free.fr>
15280
15281 PR 9812
15282 * reduced_debug_output.h
15283 (Output_reduced_debug_abbrev_section::failed): Use format for
15284 gold_warning.
15285 (Output_reduced_debug_info_section::faild): Likewise.
15286
15287 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15288
15289 * script.cc (Lazy_demangler): New class.
15290 (Version_script_info::get_symbol_version_helper): Demangle a
15291 symbol only once.
15292
15293 2009-01-29 Cary Coutant <ccoutant@google.com>
15294
15295 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15296 to __tls_get_addr.
15297 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15298
15299 2009-01-28 Ian Lance Taylor <iant@google.com>
15300
15301 * version.cc (version_string): Bump to 1.9.
15302
15303 * gold.h: Include <cstring> and <stdint.h>.
15304 * version.cc: Include <cstdio>.
15305 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15306 warning.
15307 * reduced_debug_output.cc (insert_into_vector): Rename from
15308 Insert_into_vector; change all callers. Use Swap_unaligned to
15309 avoid aliasing issue; remove union since it is unnecessary.
15310
15311 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15312
15313 * Makefile.am (CCFILES): Add gc.cc.
15314 (HFILES): Add gc.h.
15315 * Makefile.in: Regenerate.
15316 * gold.cc (Gc_runner): New class.
15317 (queue_initial_tasks): Call garbage collection related tasks
15318 when corresponding options are invoked.
15319 (queue_middle_gc_tasks): New function.
15320 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15321 processed early before laying out sections during garbage collection.
15322 * gold.h (queue_middle_gc_tasks): New function.
15323 (is_prefix_of): Move from "layout.cc".
15324 * i386.cc (Target_i386::gc_process_relocs): New function.
15325 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15326 * main.cc (main): Create object of class "Garbage_collection".
15327 * object.cc (Relobj::copy_symbols_data): New function.
15328 (Relobj::is_section_name_included): New function.
15329 (Sized_relobj::do_layout): Allow this function to be called twice
15330 during garbage collection and defer layout of section during the
15331 first call.
15332 * object.h (Relobj::get_symbols_data): New function.
15333 (Relobj::is_section_name_included): New function.
15334 (Relobj::copy_symbols_data): New function.
15335 (Relobj::set_symbols_data): New function.
15336 (Relobj::get_relocs_data): New function.
15337 (Relobj::set_relocs_data): New function.
15338 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15339 (Relobj::gc_process_relocs): New function.
15340 (Relobj::do_gc_process_relocs): New pure virtual function.
15341 (Relobj::sd_): New data member.
15342 (Sized_relobj::is_output_section_offset_invalid): New function.
15343 (Sized_relobj::do_gc_process_relocs): New function.
15344 * options.h (General_options::gc_sections): Modify to not be a no-op.
15345 (General_options::print_gc_sections): New option.
15346 * plugin.cc (Plugin_finish::run): Remove function call to
15347 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15348 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15349 * reloc.cc (Read_relocs::run): Add task to process relocs and
15350 determine unreferenced sections when doing garbage collection.
15351 (Gc_process_relocs): New class.
15352 (Sized_relobj::do_gc_process_relocs): New function.
15353 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15354 sections that are garbage collected.
15355 * reloc.h (Gc_process_relocs): New class.
15356 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15357 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15358 symbols whose corresponding sections are garbage collected.
15359 (Symbol_table::Symbol_table): Add new parameter for the garbage
15360 collection object.
15361 (Symbol_table::gc_mark_undef_symbols): New function.
15362 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15363 (Symbol_table::gc_mark_dyn_syms): New function.
15364 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15365 as garbage.
15366 (Symbol_table::add_from_object): Likewise.
15367 (Symbol_table::add_from_relobj): When building shared objects, do not
15368 treat externally visible symbols as garbage.
15369 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15370 table information for static and relocatable links.
15371 * symtab.h (Symbol_table::set_gc): New function.
15372 (Symbol_table::gc): New function.
15373 (Symbol_table::gc_mark_undef_symbols): New function.
15374 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15375 (Symbol_table::gc_mark_dyn_syms): New function.
15376 (Symbol_table::gc_): New data member.
15377 * target.h (Sized_target::gc_process_relocs): New pure virtual
15378 function.
15379 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15380 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15381
15382 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15383
15384 * options.h (General_options::gc_sections): Define as a no-op for now.
15385 (General_options::no_keep_memory): Ditto.
15386 (General_options::Bshareable): Define.
15387 * options.cc (General_options::finalize): Honor -Bshareable.
15388
15389 2009-01-20 Andreas Schwab <schwab@suse.de>
15390
15391 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15392 read the value in the contents, since we don't use it. Use the
15393 template endianness when writing.
15394 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15395
15396 2009-01-19 Andreas Schwab <schwab@suse.de>
15397
15398 * configure.tgt (powerpc64-*): Fix targ_obj.
15399
15400 2009-01-15 Ian Lance Taylor <iant@google.com>
15401
15402 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15403 local symbols when stripping all symbols.
15404
15405 2009-01-14 Cary Coutant <ccoutant@google.com>
15406
15407 * output.cc (Output_reloc): Add explicit instantiations.
15408
15409 2009-01-14 Cary Coutant <ccoutant@google.com>
15410
15411 * archive.cc (Archive::get_elf_object_for_member): Remove call
15412 to File_read::claim_for_plugin.
15413 * descriptors.cc (Descriptors::open): Remove reference to
15414 is_claimed.
15415 (Descriptors::claim_for_plugin): Remove.
15416 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15417 (Descriptors::is_claimed): Remove.
15418 (claim_descriptor_for_plugin): Remove.
15419 * fileread.cc (File_read::claim_for_plugin): Remove.
15420 * fileread.h (File_read::claim_for_plugin): Remove.
15421 (File_read::descriptor): Reopen descriptor if necessary.
15422 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15423 (Plugin_manager::all_symbols_read): Add task parameter. Change
15424 all callers.
15425 (Plugin_manager::get_input_file): New function.
15426 (Plugin_manager::release_input_file): New function.
15427 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15428 corresponding data member.
15429 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15430 and pass to base constructor. Change all callers.
15431 (get_input_file, release_input_file): New functions.
15432 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15433 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15434 (Plugin_manager::all_symbols_read): Add task parameter.
15435 (Plugin_manager::get_input_file): New function.
15436 (Plugin_manager::release_input_file): New function.
15437 (Plugin_manager::task_): New data member.
15438 (Pluginobj::Pluginobj): Add filesize parameter.
15439 (Pluginobj::filename): New function.
15440 (Pluginobj::descriptor): New function.
15441 (Pluginobj::filesize): New function.
15442 (Pluginobj::filesize_): New data member.
15443 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15444 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15445 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15446
15447 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15448 with archive libraries.
15449 * testsuite/Makefile.in: Regenerate.
15450 * testsuite/plugin_test.c (struct sym_info): New type.
15451 (get_input_file, release_input_file): New static variables.
15452 (onload): Capture new transfer vector entries.
15453 (claim_file_hook): Stop reading at end of file according to filesize.
15454 Factor out parsing of readelf output into separate function.
15455 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15456 APIs and get the source file name from the symbol table. Convert
15457 source file name to corresponding object file name. Print info
15458 message when adding new input files.
15459 (parse_readelf_line): New function.
15460 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15461 * testsuite/plugin_test_2.sh: Likewise.
15462 * testsuite/plugin_test_3.sh: Likewise.
15463 * testsuite/plugin_test_4.sh: New test case.
15464
15465 2009-01-07 Ian Lance Taylor <iant@google.com>
15466
15467 * version.cc (version_string): Bump to 1.8.
15468
15469 2008-12-23 Cary Coutant <ccoutant@google.com>
15470
15471 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15472 * plugin.cc (Plugin_manager::finish): Rename as
15473 layout_deferred_objects. Move cleanup to separate function.
15474 (Plugin_manager::cleanup): New function.
15475 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15476 separately.
15477 * plugin.h (Plugin_manager::finish): Rename as
15478 layout_deferred_objects.
15479 (Plugin_manager::cleanup): New function.
15480 (Plugin_manager::cleanup_done): New field.
15481
15482 2008-12-23 Cary Coutant <ccoutant@google.com>
15483
15484 * plugin.cc (is_visible_from_outside): New function.
15485 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15486 so we don't return "IR only" status for exported symbols or -r links.
15487
15488 * testsuite/Makefile.am (plugin_test_3): New test case.
15489 * testsuite/Makefile.in: Regenerate.
15490 * testsuite/plugin_test_3.sh: New file.
15491
15492 2008-12-22 Cary Coutant <ccoutant@google.com>
15493
15494 * object.cc (Sized_relobj::layout_section): New function.
15495 (Sized_relobj::do_layout): Defer layout of input sections until after
15496 plugin has provided replacement files.
15497 (Sized_relobj::do_layout_deferred_sections): New function.
15498 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15499 (Relobj::layout_deferred_sections): New function.
15500 (Relobj::do_layout_deferred_sections): New function.
15501 (Sized_relobj::do_layout_deferred_sections): New function.
15502 (Sized_relobj::layout_section): New function.
15503 (Sized_relobj::Deferred_layout): New structure.
15504 (Sized_relobj::deferred_layout_): New field.
15505 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15506 Change all callers. Layout deferred sections.
15507 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15508 references.
15509 (Plugin_hook::run): Move code from do_plugin_hook inline.
15510 (Plugin_hook::do_plugin_hook): Remove.
15511 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15512 (Plugin_manager::finish): Renamed, was cleanup.
15513 (Plugin_manager::should_defer_layout): New function.
15514 (Plugin_manager::add_deferred_layout_object): New function.
15515 (Plugin_manager::Deferred_layout_list): New type.
15516 (Plugin_manager::deferred_layout_objects_): New field.
15517 (Plugin_hook::do_plugin_hook): Remove.
15518
15519 2008-12-17 Ian Lance Taylor <iant@google.com>
15520
15521 * options.h (class General_options): Add --no case for
15522 --export-dynamic.
15523
15524 2008-12-16 Cary Coutant <ccoutant@google.com>
15525
15526 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15527 vector.
15528 (Plugin_manager::claim_file): Create plugin object even if
15529 plugin did not call the add_symbols callback.
15530 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15531 asking for more symbols than were added.
15532 * testsuite/Makefile.am (plugin_test_1): Add test case with
15533 no global symbols.
15534 (empty.syms): New target.
15535 * testsuite/Makefile.in: Regenerate.
15536 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15537 message. Don't call add_symbols if no globals.
15538 (all_symbols_read_hook): Don't provide replacement for empty
15539 claimed file.
15540
15541 2008-12-12 Ian Lance Taylor <iant@google.com>
15542
15543 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15544 r_type == 0 for a local symbol with r_sym == 0.
15545 (scan_relocatable_relocs): Pass r_sym to
15546 local_non_section_strategy.
15547 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15548 r_sym parameter.
15549
15550 * configure.ac: Update test for TLS descriptors: they are
15551 supported as of glibc 2.9.
15552 * configure: Rebuild.
15553
15554 2008-12-11 Ian Lance Taylor <iant@google.com>
15555
15556 PR 7091
15557 * target-reloc.h (Default_scan_relocatable_relocs): For each
15558 function, map r_type == 0 to RELOC_DISCARD.
15559
15560 2008-12-10 Cary Coutant <ccoutant@google.com>
15561
15562 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15563 object to override a kept COMDAT group from a plugin object.
15564
15565 2008-12-09 Ian Lance Taylor <iant@google.com>
15566
15567 PR 7088
15568 * yyscript.y (file_cmd): Handle INPUT.
15569
15570 * testsuite/initpri1.c: Change all declarations to be full
15571 prototypes by adding void, to avoid compiler warnings.
15572
15573 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15574
15575 * options.cc (General_options::parse_plugin_opt): New.
15576 (General_options::add_plugin): The argument now is just the filename.
15577 (General_options::add_plugin_option): New.
15578 * options.h (plugin_opt): New.
15579 (add_plugin): Change argument name.
15580 (add_plugin_option): New.
15581 * plugin.cc (Plugin::load): Don't parse the plugin option.
15582 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15583 (Plugin::add_option): New.
15584 (Plugin::args_): Change type.
15585 (Plugin::filename_): New.
15586 (Plugin_manager::add_plugin_option): New.
15587 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15588 * testsuite/Makefile.in: Regenerate.
15589
15590 2008-12-05 Cary Coutant <ccoutant@google.com>
15591
15592 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15593 Handle --strip-lto-sections option.
15594 * options.h (strip_lto_sections): New option.
15595
15596 2008-12-01 Cary Coutant <ccoutant@google.com>
15597
15598 * plugin.cc (ld_plugin_message): Change format parameter to const.
15599 Fix mismatch between new[] and delete.
15600
15601 2008-11-14 Cary Coutant <ccoutant@google.com>
15602
15603 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15604 instead of -1U.
15605
15606 2008-11-05 Craig Silverstein <csilvers@google.com>
15607
15608 * options.cc (General_options::parse_dynamic_list): New function.
15609 * options.h (General_options): New flags dynamic_list,
15610 dynamic_list_data, dynamic_list_cpp_new, and
15611 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15612 (General_options::in_dynamic_list): New function.
15613 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15614 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15615 (Lex::can_continue_name): Likewise.
15616 (yylex): Likewise.
15617 (read_script_file): New parameter script_options.
15618 (read_dynamic_list): New function.
15619 (Script_options::define_dynamic_list): New function.
15620 (dynamic_list_keyword_parsecodes): New variable.
15621 (dynamic_list_keywords): New variable.
15622 * script.h (Script_options::define_dynamic_list): New function
15623 prototype.
15624 (read_dynamic_list): New function prototype.
15625 * symtab.cc (strprefix): New macro.
15626 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15627 dynamic_list_data, dynamic_list_cpp_new, and
15628 dynamic_list_cpp_typeinfo.
15629 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15630 (dynamic_list_expr): New rule.
15631 (dynamic_list_nodes): Likewise.
15632 (dynamic_list_node): Likewise.
15633 * testsuite/Makefile.am (dynamic_list): New test.
15634 * testsuite/Makefile.in: Regenerated.
15635 * testsuite/dynamic_list.t: New file.
15636 * testsuite/dynamic_list.sh: New file.
15637
15638 2008-11-05 Craig Silverstein <csilvers@google.com>
15639
15640 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15641 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15642 (t11_last): Likewise.
15643 * testsuite/ver_test_6.c (main): Likewise.
15644
15645 2008-10-07 Cary Coutant <ccoutant@google.com>
15646
15647 * options.c (General_options::finalize): Add check for -static and
15648 -shared.
15649 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15650 is not empty.
15651
15652 2008-10-02 Cary Coutant <ccoutant@google.com>
15653
15654 * plugin.cc (make_sized_plugin_object): Fix conditional
15655 compilation to work when not all targets are enabled.
15656
15657 2008-09-29 Cary Coutant <ccoutant@google.com>
15658
15659 * archive.cc (Archive::get_file_and_offset): Use filename instead
15660 of name to get library path.
15661 (Archive::include_member): Unlock external member of a thin archive.
15662
15663 * testsuite/Makefile.am (TEST_AR): New variable.
15664 (thin_archive_test_1): New test.
15665 (thin_archive_test_2): New test.
15666 * testsuite/Makefile.in: Regenerate.
15667 * testsuite/thin_archive_main.cc: New file.
15668 * testsuite/thin_archive_test_1.cc: New file.
15669 * testsuite/thin_archive_test_2.cc: New file.
15670 * testsuite/thin_archive_test_3.cc: New file.
15671 * testsuite/thin_archive_test_4.cc: New file.
15672
15673 2008-09-29 Cary Coutant <ccoutant@google.com>
15674
15675 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15676 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15677 instead of -1U.
15678 (Sized_relobj::do_finalize_local_symbols): Likewise.
15679 (Sized_relobj::map_to_kept_section): Likewise.
15680 * object.h (Sized_relobj::invalid_address): New constant.
15681 (Sized_relobj::do_output_section_offset): Check for invalid_address
15682 and return -1ULL.
15683 * output.cc (Output_reloc::local_section_offset): Use constant
15684 invalid_address instead of -1U.
15685 (Output_reloc::get_address): Likewise.
15686 (Output_section::output_address): Change -1U to -1ULL.
15687 * output.h (Output_reloc::invalid_address): New constant.
15688 * reloc.cc (Sized_relobj::write_sections): Use constant
15689 invalid_address instead of -1U.
15690 (Sized_relobj::relocate_sections): Likewise.
15691 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15692 values for merge sections.
15693 * target-reloc.h (relocate_for_relocatable): Use constant
15694 invalid_address instead of -1U.
15695
15696 2008-09-19 Cary Coutant <ccoutant@google.com>
15697
15698 Add plugin functionality for link-time optimization (LTO).
15699 * configure.ac (plugins): Add --enable-plugins option.
15700 * configure: Regenerate.
15701 * config.in: Regenerate.
15702 * Makefile.am (LIBDL): New variable.
15703 (CCFILES): Add plugin.cc.
15704 (HFILES): Add plugin.h.
15705 (ldadd_var): Add LIBDL.
15706 * Makefile.in: Regenerate.
15707
15708 * archive.cc: Include "plugin.h".
15709 (Archive::setup): Don't preread archive symbols when using a plugin.
15710 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15711 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15712 files.
15713 (Archive::include_member): Add symbols from plugin objects.
15714 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15715 * descriptors.cc (Descriptors::open): Check for file descriptors
15716 abandoned by plugins.
15717 (Descriptors::claim_for_plugin): New function.
15718 * descriptors.h (Descriptors::claim_for_plugin): New function.
15719 (Open_descriptor::is_claimed): New field.
15720 (claim_descriptor_for_plugin): New function.
15721 * fileread.cc (File_read::claim_for_plugin): New function.
15722 * fileread.h (File_read::claim_for_plugin): New function.
15723 (File_read::descriptor): New function.
15724 * gold.cc: Include "plugin.h".
15725 (queue_initial_tasks): Add task to call plugin hooks for generating
15726 new object files.
15727 * main.cc: Include "plugin.h".
15728 (main): Load plugin libraries.
15729 * object.h (Pluginobj): Declare.
15730 (Object::pluginobj): New function.
15731 (Object::do_pluginobj): New function.
15732 (Object::set_target): New function.
15733 * options.cc: Include "plugin.h".
15734 (General_options::parse_plugin): New function.
15735 (General_options::General_options): Initialize plugins_ field.
15736 (General_options::add_plugin): New function.
15737 * options.h (Plugin_manager): Declare.
15738 (General_options): Add --plugin option.
15739 (General_options::has_plugins): New function.
15740 (General_options::plugins): New function.
15741 (General_options::add_plugin): New function.
15742 (General_options::plugins_): New field.
15743 * plugin.cc: New file.
15744 * plugin.h: New file.
15745 * readsyms.cc: Include "plugin.h".
15746 (Read_symbols::do_read_symbols): Check for archive before checking
15747 for ELF file. Call plugin hooks to claim files.
15748 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15749 from a real object file; force override when processing replacement
15750 files.
15751 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15752 (Symbol::init_base_object): Likewise.
15753 (Symbol::init_base_output_data): Likewise.
15754 (Symbol::init_base_output_segment): Likewise.
15755 (Symbol::init_base_constant): Likewise.
15756 (Symbol::init_base_undefined): Likewise.
15757 (Symbol::output_section): Assert that object is not a plugin.
15758 (Symbol_table::add_from_pluginobj): New function.
15759 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15760 undefined.
15761 (Symbol_table::sized_write_globals): Likewise.
15762 (Symbol_table::add_from_pluginobj): Instantiate template.
15763 * symtab.h (Sized_pluginobj): Declare.
15764 (Symbol::in_real_elf): New function.
15765 (Symbol::set_in_real_elf): New function.
15766 (Symbol::in_real_elf_): New field.
15767 (Symbol_table::add_from_pluginobj): New function.
15768
15769 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15770 (LIBDL): New variable.
15771 (LDADD): Add LIBDL.
15772 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15773 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15774 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15775 (MOSTLYCLEANFILES): Likewise.
15776 * testsuite/Makefile.in: Regenerate.
15777 * testsuite/plugin_test.c: New file.
15778 * testsuite/plugin_test_1.sh: New file.
15779 * testsuite/plugin_test_2.sh: New file.
15780
15781 2008-09-16 Ian Lance Taylor <iant@google.com>
15782
15783 * target-reloc.h (relocate_section): Check whether a symbol is
15784 defined by the ABI before reporting an undefined symbol error.
15785 * target.h (Target::is_defined_by_abi): Make parameter const.
15786 (Target::do_is_defined_by_abi): Likewise.
15787 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15788 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15789 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15790 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15791 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15792 * testsuite/Makefile.in: Rebuild.
15793
15794 * fileread.cc (make_view): Add casts to avoid warning.
15795
15796 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15797
15798 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15799 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15800
15801 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15802
15803 * options.h (General_options::output_is_executable): New.
15804 (General_options::output_is_pie): New.
15805 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15806 for shared libraries.
15807 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15808
15809 2008-09-11 Chris Demetriou <cgd@google.com>
15810
15811 * options.h (origin): New -z option.
15812 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15813 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15814 in DT_FLAGS_1.
15815
15816 2008-09-05 Cary Coutant <ccoutant@google.com>
15817
15818 * fileread.cc (File_read::make_view): Add check for attempt to map
15819 beyond end of file.
15820
15821 2008-09-05 Cary Coutant <ccoutant@google.com>
15822
15823 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15824 explicit instantiations.
15825
15826 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15827
15828 PR gold/6858
15829 * options.cc (General_options::finalize): Allow undefined symbols
15830 in shlibs if linking -shared.
15831
15832 PR gold/6859
15833 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15834 symbols as not needing a dynsym entry.
15835
15836 2008-08-20 Craig Silverstein <csilvers@google.com>
15837
15838 * fileread.cc (File_read::open): Do not lock the file unless it
15839 was successfully opened.
15840
15841 2008-08-14 Cary Coutant <ccoutant@google.com>
15842
15843 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15844 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15845 * testsuite/tls_test.cc (struct int128): 128-bit struct
15846 for testing TLS relocs with non-zero addend.
15847 (v12): New TLS variable.
15848 (t12): New test.
15849 (t_last): Add check for v12.
15850 * testsuite/tls_test.h (t12): New function.
15851 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15852
15853 2008-08-13 Ian Lance Taylor <iant@google.com>
15854
15855 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15856 set tls_segment_ or relro_segment_.
15857 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15858 when appropriate.
15859 * output.h (Output_section::clear_is_relro): New function.
15860 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15861 sections specially even when output_data_ is empty.
15862 (Output_segment::maximum_alignment): When first section is relro,
15863 only force alignment for PT_LOAD segments.
15864 * script.cc (script_data_segment_align): New function.
15865 (script_data_segment_relro_end): New function.
15866 * script-c.h (script_data_segment_align): Declare.
15867 (script_data_segment_relro_end): Declare.
15868 * script-sections.h (class Script_sections): Declare
15869 data_segment_align and data_segment_relro_end. Add fields
15870 segment_align_index_ and saw_relro_end_.
15871 * script-sections.cc (class Sections_element): Add set_is_relro
15872 virtual function. Add new bool* parameter to place_orphan_here.
15873 Add get_output_section virtual function.
15874 (class Output_section_definition): Add set_is_relro. Add new
15875 bool* parameter to place_orphan_here. Add get_output_section.
15876 Add is_relro_ field.
15877 (Output_section_definition::Output_section_definition): Initialize
15878 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15879 and is_relro_ fields.
15880 (Output_section_definition::place_orphan_here): Add is_relro
15881 parameter.
15882 (Output_section_definition::set_section_addresses): Set relro for
15883 output section.
15884 (Output_section_definition::alternate_constraint): Likewise.
15885 (class Orphan_output_section): Add new bool* parameter to
15886 place_orphan_here. Add get_output_section.
15887 (Orphan_output_section::place_orphan_here): Add is_relro
15888 parameter.
15889 (Script_sections::Script_sections): Initialize
15890 data_segment_align_index_ and saw_relro_end_.
15891 (Script_sections::data_segment_align): New function.
15892 (Script_sections::data_segment_relro_end): New function.
15893 (Script_sections::place_orphan): Set or clear is_relro.
15894 (Script_sections::set_section_addresses): Force alignment of first
15895 TLS section.
15896 * yyscript.y (exp): Call script_data_segment_align and
15897 script_data_segment_relro_end.
15898 * testsuite/relro_script_test.t: New file.
15899 * testsuite/relro_test.cc (using_script): Declare.
15900 (t1, t2): Test using_script.
15901 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15902 (relro_script_test_SOURCES): Define.
15903 (relro_script_test_DEPENDENCIES): Define.
15904 (relro_script_test_LDFLAGS): Define.
15905 (relro_script_test_LDADD): Define.
15906 (relro_script_test.so): New target.
15907 * testsuite/Makefile.in: Rebuild.
15908
15909 2008-08-06 Cary Coutant <ccoutant@google.com>
15910
15911 * archive.cc (Archive::total_archives, Archive::total_members)
15912 (Archive::total_members_loaded): New variables.
15913 (Archive::setup): Add parameter. Add option to preread
15914 archive symbols.
15915 (Archive::read_armap): Add counter.
15916 (Archive::get_file_and_offset): New function.
15917 (Archive::get_elf_object_for_member): New function.
15918 (Archive::read_all_symbols): New function.
15919 (Archive::read_symbols): New function.
15920 (Archive::add_symbols): Add counters.
15921 (Archive::include_all_members): Use armap to find members if it's
15922 already built.
15923 (Archive::include_member): Skip reading symbols if already read.
15924 Factored code into Archive::get_file_and_offset and
15925 Archive::get_elf_object_for_member. Changed call to
15926 Mapfile::report_include_archive_member.
15927 (Archive::print_stats): New function.
15928 * archive.h: Declare Object and Read_symbols_data classes.
15929 (Archive::Archive): Add initializers for new members.
15930 (Archive::setup): Add parameter.
15931 (Archive::print_stats): New function.
15932 (Archive::total_archives, Archive::total_members)
15933 (Archive::total_members_loaded): New variables.
15934 (Archive::get_file_and_offset): New function.
15935 (Archive::get_elf_object_for_member): New function.
15936 (Archive::read_all_symbols): New function.
15937 (Archive::read_symbols): New function.
15938 (Archive::Archive_member): New class.
15939 (Archive::members_): New member.
15940 (Archive::num_members_): New member.
15941 * main.cc: Include archive.h.
15942 (main): Call Archive::print_stats.
15943 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15944 archive parameter; member_name is now the fully-decorated name.
15945 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15946 * options.h: (General_options): Add --preread-archive-symbols option.
15947 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15948 Archive::setup.
15949
15950 2008-08-04 Ian Lance Taylor <iant@google.com>
15951
15952 * symtab.h (Symbol::use_plt_offset): New function.
15953 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15954 * powerpc.cc (Relocate::relocate): Likewise.
15955 * sparc.cc (Relocate::relocate): Likewise.
15956 * x86_64.cc (Relocate::relocate): Likewise.
15957 * testsuite/weak_plt.sh: New test.
15958 * testsuite/weak_plt_main.cc: New test.
15959 * testsuite/weak_plt_shared.cc: New test.
15960 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15961 (check_PROGRAMS): Add weak_plt.
15962 (check_DATA): Add weak_plt_shared.so.
15963 (weak_plt_main_pic.o, weak_plt): New targets.
15964 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15965 * testsuite/Makefile.in: Rebuild.
15966
15967 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15968 gcctestdir/ld.
15969 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15970 * testsuite/Makefile.in: Rebuild.
15971
15972 2008-08-04 Alan Modra <amodra@bigpond.net.au>
15973
15974 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15975 * Makefile.in: Regenerate.
15976 * po/POTFILES.in: Regenerate.
15977
15978 2008-07-29 Ian Lance Taylor <iant@google.com>
15979
15980 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15981 symbols before other symbols.
15982 * testsuite/script_test_2.cc (test_addr): Declare.
15983 (test_addr_alias): Declare.
15984 (main): Check that test_addr and test_addr_alias have the right
15985 values.
15986 * testsuite/script_test_2.t: Define test_addr_alias and
15987 test_addr.
15988
15989 2008-07-24 Ian Lance Taylor <iant@google.com>
15990
15991 PR 5990
15992 * descriptors.cc: New file.
15993 * descriptors.h: New file.
15994 * gold-threads.h (class Hold_optional_lock): New class.
15995 * fileread.cc: Include "descriptors.h".
15996 (File_read::~File_read): Release descriptor rather than closing
15997 it.
15998 (File_read::open) [file]: Call open_descriptor rather than open.
15999 Set is_descriptor_opened_.
16000 (File_read::open) [memory]: Assert that descriptor is not open.
16001 (File_read::reopen_descriptor): New function.
16002 (File_read::release): Release descriptor.
16003 (File_read::do_read): Make non-const. Reopen descriptor.
16004 (File_read::read): Make non-const.
16005 (File_read::make_view): Reopen descriptor.
16006 (File_read::do_readv): Likewise.
16007 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16008 Update declarations.
16009 * layout.cc: Include "descriptors.h".
16010 (Layout::create_build_id): Use open_descriptor rather than open.
16011 * output.cc: Include "descriptors.h".
16012 (Output_file::open): Use open_descriptor rather than open.
16013 * archive.cc (Archive::const_iterator): Change Archive to be
16014 non-const.
16015 (Archive::begin, Archive::end): Make non-const.
16016 (Archive::count_members): Likewise.
16017 * archive.h (class Archive): Update declarations.
16018 * object.h (Object::read): Make non-const.
16019 * Makefile.am (CCFILES): Add descriptors.cc.
16020 (HFILES): Add descriptors.h.
16021 * Makefile.in: Rebuild.
16022
16023 PR 6716
16024 * gold.h: Always include <clocale>. Add Solaris workarounds
16025 following code in binutils/sysdep.h.
16026
16027 PR 6048
16028 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16029 this->eh_frame_hdr_ is NULL before using it.
16030
16031 * dynobj.cc (Versions::Versions): Update comment.
16032
16033 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16034 the base version name.
16035
16036 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16037 array size plus one.
16038 (Stringpool_template::set_string_offsets): Subtract one from key
16039 before using it as an array index.
16040 (Stringpool_template::get_offset_with_length): Likewise.
16041 (Stringpool_template::write_to_buffer): Likewise.
16042 * stringpool.h (Stringpool_template::get_offset_from_key):
16043 Likewise.
16044
16045 2008-07-23 Ian Lance Taylor <iant@google.com>
16046
16047 PR 6658
16048 * object.h (Merged_symbol_value::value): Do our best to handle a
16049 negative addend.
16050
16051 PR 6647
16052 * script.cc (Version_script_info::get_versions): Don't add empty
16053 version tag to return value.
16054 (Version_script_info::get_symbol_version_helper): Change return
16055 type to bool. Add pversion parameter. Change all callers.
16056 (script_register_vers_node): Don't require a non-NULL tag.
16057 * script.h (class Version_script_info): Update declarations.
16058 (Version_script_info::get_symbol_version): Change return type to
16059 bool. Add version parameter. Change all callers.
16060 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16061 handling. Handle an empty version from a version script.
16062 (Symbol_table::define_special_symbol): Likewise.
16063 * testsuite/ver_test_10.script: New file.
16064 * testsuite/ver_test_10.sh: New file.
16065 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16066 (check_DATA): Add ver_test_10.syms.
16067 (ver_test_10.syms, ver_test_10.so): New target.
16068 * testsuite/Makefile.in: Rebuild.
16069
16070 2008-07-23 Simon Baldwin <simonb@google.com>
16071
16072 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16073 to zero for undefined symbols from dynamic libraries.
16074
16075 2008-07-23 Ian Lance Taylor <iant@google.com>
16076
16077 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16078 Change all callers.
16079 * symtab.h (class Symbol_table): Update declaration.
16080 * testsuite/ver_test_9.cc: New file.
16081 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16082 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16083 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16084 (ver_test_9.so, ver_test_9.o): New targets.
16085 * testsuite/Makefile.in: Rebuild.
16086
16087 2008-07-22 Ian Lance Taylor <iant@google.com>
16088
16089 * options.h (class General_options): Define --check-sections.
16090 * layout.cc (Layout::set_segment_offsets): Handle
16091 --check-sections.
16092
16093 * options.h (class General_options): Define -n/--nmagic and
16094 -N/--omagic.
16095 * options.cc (General_options::finalize): For -n/--nmagic or
16096 -N/--omagic, set -static.
16097 * layout.cc (Layout::attach_allocated_section_to_segment): If
16098 -N/--omagic, don't put read-only and read-write sections in
16099 different segments.
16100 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16101 finding a read-only segment.
16102 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16103 don't set the minimum segment alignment to the common page size,
16104 and don't set the file offset to the address modulo the page size.
16105 * script-sections.cc (Script_sections::create_segments): If
16106 -n/--omagic, don't put read-only and read-write sections in
16107 different segments.
16108
16109 * cref.cc: New file.
16110 * cref.h: New file.
16111 * options.h (class General_options): Add --print-symbol-counts.
16112 * main.cc (main): Issue defined symbol report if requested.
16113 * archive.cc (Archive::interpret_header): Make into a const member
16114 function.
16115 (Archive::add_symbols): Call Input_objects::archive_start and
16116 archive_stop.
16117 (Archive::const_iterator): Define new class.
16118 (Archive::begin, Archive::end): New functions.
16119 (Archive::include_all_members): Rewrite to use iterator.
16120 (Archive::count_members): New function.
16121 * archive.h (class Archive): Update declarations.
16122 (Archive::filename): New function.
16123 * object.cc: Include "cref.h".
16124 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16125 (Sized_relobj::do_get_global_symbol_counts): New function.
16126 (Input_objects::add_object): Add object to cross-referencer.
16127 (Input_objects::archive_start): New function.
16128 (Input_objects::archive_stop): New function.
16129 (Input_objects::print_symbol_counts): New function.
16130 * object.h: Declare Cref and Archive.
16131 (Object::get_global_symbol_counts): New function.
16132 (Object::do_get_global_symbol_counts): New pure virtual function.
16133 (class Sized_relobj): Add defined_count_ field. Update
16134 declarations.
16135 (class Input_objects): Add cref_ field. Update constructor.
16136 Update declarations.
16137 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16138 defined_count_.
16139 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16140 symbol counts.
16141 (Sized_dynobj::do_get_global_symbol_counts): New function.
16142 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16143 defined_count_. Update declarations. Define Symbols typedef.
16144 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16145 parameter. Change all callers.
16146 (Symbol_table::add_from_dynobj): Add sympointers and defined
16147 parameters. Change all callers.
16148 * symtab.h (class Symbol_table): Update declarations.
16149 * Makefile.am (CCFILES): Add cref.cc.
16150 (HFILES): Add cref.h.
16151 * Makefile.in: Rebuild.
16152
16153 2008-07-22 Simon Baldwin <simonb@google.com>
16154
16155 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16156 to zero when writing undefined symbols.
16157
16158 2008-07-22 Ian Lance Taylor <iant@google.com>
16159
16160 * output.cc (Output_section::add_input_section): Don't try to
16161 merge empty merge sections.
16162
16163 2008-07-21 Craig Silverstein <csilvers@google.com>
16164
16165 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16166 Include symbol version in error message.
16167
16168 2008-07-20 Chris Demetriou <cgd@google.com>
16169
16170 * configure.ac (gold_cv_c_random_seed): New configured variable.
16171 (RANDOM_SEED_CFLAGS): New substituted variable.
16172 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16173 * configure: Rebuild.
16174 * Makefile.in: Likewise.
16175 * testsuite/Makefile.in: Likewise.
16176
16177 2008-07-18 Ian Lance Taylor <iant@google.com>
16178
16179 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16180 where we see NAME/NULL and NAME/VERSION as separate symbols.
16181 * testsuite/ver_test_main.cc (main): Call t4.
16182 (t4, t4_2a): Define.
16183 * testsuite/ver_test_2.cc (t4_2): Define.
16184 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16185 * testsuite/ver_test_4.cc (t4_2a): Define.
16186 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16187 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16188
16189 2008-07-17 Ian Lance Taylor <iant@google.com>
16190
16191 * dynobj.cc (Versions::add_def): If we give an error about a
16192 missing version, go ahead and create the version anyhow.
16193
16194 2008-07-10 Ian Lance Taylor <iant@google.com>
16195
16196 Handle output sections with more than 0x7fffffff bytes.
16197 * object.h (class Relobj): Change map_to_output_ to
16198 output_sections_, and just keep a section pointer. Change all
16199 uses. Move comdat group support to Sized_relobj.
16200 (Relobj::is_section_specially_mapped): Remove.
16201 (Relobj::output_section): Remove poff parameter. Change all
16202 callers.
16203 (Relobj::output_section_offset): New function.
16204 (Relobj::set_section_offset): Rewrite.
16205 (Relobj::map_to_output): Remove.
16206 (Relobj::output_sections): New function.
16207 (Relobj::do_output_section_offset): New pure virtual function.
16208 (Relobj::do_set_section_offset): Likewise.
16209 (class Sized_relobj): Add section_offsets_ field. Add comdat
16210 group support from Relobj. Update declarations.
16211 (Sized_relobj::get_output_section_offset): New function.
16212 (Sized_relobj::do_output_section_offset): New function.
16213 (Sized_relobj::do_set_section_offset): New function.
16214 * object.cc (Relobj::output_section_address): Remove.
16215 (Sized_relobj::Sized_relobj): Initialize new fields.
16216 (Sized_relobj::include_section_group): Cast find_kept_object to
16217 Sized_relobj.
16218 (Sized_relobj::include_linkonce_section): Likewise.
16219 (Sized_relobj::do_layout): Use separate arrays for output section
16220 and output offset.
16221 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16222 output_sections.
16223 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16224 output_sections and section_offsets.
16225 (Sized_relobj::write_local_symbols): Likewise.
16226 (map_to_kept_section): Compute output address directly.
16227 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16228 output_sections and section_offsets.
16229 (Sized_relobj::write_sections): Likewise.
16230 (Sized_relobj::relocate_sections): Likewise.
16231 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16232 * output.h (class Output_reloc): Update declarations. Change
16233 u2_.relobj to Sized_relobj*.
16234 (class Output_data_reloc): Change add functions to use
16235 Sized_relobj*.
16236 * output.cc (Output_reloc::Output_reloc): Change relobj to
16237 Sized_relobj*.
16238 (Output_reloc::local_section_offset): Change return type to
16239 Elf_Addr. Use get_output_section_offset.
16240 (Output_reloc::get_address): Likewise.
16241 (Output_section::is_input_address_mapped): Don't call
16242 is_section_specially_mapped.
16243 (Output_section::output_offset): Likewise.
16244 (Output_section::output_address): Likewise.
16245 (Output_section::starting_output_address): Likewise.
16246 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16247 parameter to Sized_relobj*.
16248 (Copy_relocs::need_copy_reloc): Likewise.
16249 (Copy_relocs::save): Likewise.
16250 * copy-relocs.h (class Copy_relocs): Update declarations.
16251 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16252 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16253 * target-reloc.h (relocate_for_relocatable): Change
16254 offset_in_output_section type to Elf_Addr. Change code that uses
16255 it as well.
16256 * layout.cc (Layout::layout): Always set *off.
16257 * mapfile.cc (Mapfile::print_input_section): Use
16258 output_section_offset.
16259 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16260 Sized_relobj*.
16261 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16262 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16263 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16264
16265 2008-07-03 Ian Lance Taylor <iant@google.com>
16266
16267 * layout.cc (Layout::include_section): Do not discard unrecognized
16268 SHT_STRTAB sections.
16269
16270 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16271
16272 * script.cc (Lex::can_continue_name): Make '?' allowable in
16273 version-script names.
16274 * testsuite/version_script.map: Change glob pattern to use '?'
16275
16276 2008-06-30 Manish Singh <yosh@gimp.org>
16277
16278 PR 6585
16279 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16280 Correct typo.
16281
16282 2008-06-30 Ian Lance Taylor <iant@google.com>
16283
16284 PR 6660
16285 PR 6682
16286 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16287 versions]: Don't try to read the value in the contents, since we
16288 don't use it. Use the template endianness when writing.
16289
16290 2008-06-25 Cary Coutant <ccoutant@google.com>
16291
16292 * fileread.cc (File_read::make_view): Assert on zero-length view.
16293 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16294 symbol table when there are no symbols to read.
16295
16296 2008-06-23 Craig Silverstein <csilvers@google.com>
16297
16298 * version.cc (version_string): Bump to 1.7
16299
16300 2008-06-18 Craig Silverstein <csilvers@google.com>
16301
16302 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16303 constant 0xFFFF to type Valtype.
16304 (Powerpc_relocate_functions::rel16_ha): Likewise.
16305
16306 2008-06-17 Ian Lance Taylor <iant@google.com>
16307
16308 * output.h (Output_section::Input_section): Initialize p2align_ to
16309 zero for Output_section_data constructors.
16310 (Output_section::Input_section::addralign): If not an input
16311 section, return the alignment of the Output_section_data.
16312 * testsuite/copy_test.cc: New file.
16313 * testsuite/copy_test_1.cc: New file.
16314 * testsuite/copy_test_2.cc: New file.
16315 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16316 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16317 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16318 (copy_test_1_pic.o, copy_test_1.so): New targets.
16319 (copy_test_2_pic.o, copy_test_2.so): New targets.
16320 * testsuite/Makefile.in: Rebuild.
16321
16322 * script-sections.cc (Script_sections::place_orphan): Initialize
16323 local variable exact.
16324
16325 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16326
16327 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16328
16329 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16330 David S. Miller <davem@davemloft.net>
16331
16332 * powerpc.cc: New file.
16333 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16334 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16335 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16336 * Makefile.in: Rebuild.
16337
16338 2008-06-09 Ian Lance Taylor <iant@google.com>
16339
16340 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16341 <exception>.
16342 (throwing, orig_terminate): New static variables.
16343 (terminate_handler): New static function.
16344 (t2): Set terminate handler.
16345
16346 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16347
16348 PR 6584
16349 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16350 alignment.
16351
16352 2008-05-30 Cary Coutant <ccoutant@google.com>
16353
16354 * archive.cc (Archive::include_all_members) Correct to step
16355 over symbol table and extended name table in thin archives.
16356
16357 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16358
16359 PR 6407
16360 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16361 calculation.
16362
16363 2008-05-28 Caleb Howe <cshowe@google.com>
16364
16365 * reduced_debug_output.cc: New file.
16366 * reduced_debug_output.h: New file.
16367 * options.h (class General_options): Add --strip-debug-non-line.
16368 * options.cc (General_options::finalize): Add strip_debug_non_line
16369 to the strip heirarchy.
16370 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16371 fields.
16372 * layout.cc: Include "reduced_debug_output.h".
16373 (Layout::Layout): Initialize new fields.
16374 (line_only_debug_sections): New static array.
16375 (is_lines_only_debug_sections): New static inline function.
16376 (Layout::include_section): Handle --strip-debug-non-line.
16377 (Layout::make_output_section): If --strip-debug-non-line, build
16378 new output sections for .debug_abbrev and .debug_info.
16379 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16380 gold. Warn about possible overflow.
16381 (read_signed_LEB_128): Likewise.
16382 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16383 (read_signed_LEB_128): Declare.
16384 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16385 (HFILES): Add reduced_debug_output.h.
16386 * Makefile.in: Rebuild.
16387
16388 2008-05-21 Ian Lance Taylor <iant@google.com>
16389
16390 * mapfile.cc: New file.
16391 * mapfile.h: New file.
16392 * options.h (class General_options): Add -M/--print-map and -Map.
16393 * options.cc (General_options::finalize): Make -M equivalent to
16394 -Map -.
16395 * main.cc: Include <cstdio> and "mapfile.h".
16396 (main): Open mapfile if requested.
16397 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16398 constructor. Change caller.
16399 (queue_initial_tasks): Add mapfile parameter. Change caller.
16400 (queue_middle_tasks): Likewise.
16401 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16402 declarations.
16403 * archive.cc: Include "mapfile.h".
16404 (Archive::add_symbols): Add mapfile parameter. Change all
16405 callers. Pass mapfile, symbol, and reason to include_member.
16406 (Archive::include_all_members): Add mapfile parameter. Change all
16407 callers.
16408 (Archive::include_member): Add mapfile, sym, and why parameters.
16409 Change all callers. Report inclusion to map file.
16410 * archive.h: Include "fileread.h".
16411 (class Archive): Update declarations.
16412 (Archive::file): New const method.
16413 (class Add_archive_symbols): Add mapfile_ field. Update
16414 constructor. Change all callers.
16415 * readsyms.h (class Read_symbols): Likewise.
16416 (class Finish_group): Likewise.
16417 (class Read_script): Likewise.
16418 * common.cc: Include "mapfile.h".
16419 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16420 all callers.
16421 (Symbol_table::do_allocate_commons): Likewise.
16422 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16423 symbol allocation to mapfile.
16424 * common.h (class Allocate_commons_task): Add mapfile_ field.
16425 Update constructor. Change all callers.
16426 * symtab.h (class Symbol_table): Update declarations.
16427 * layout.cc: Include "mapfile.h".
16428 (Layout_task_runner::run): Print information to mapfile.
16429 (Layout::create_gold_note): Change Output_data_fixed_space to
16430 Output_data_zero_fill.
16431 (Layout::create_build_id): Likewise.
16432 (Layout::print_to_mapfile): New function.
16433 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16434 constructor. Change caller.
16435 (class Layout): Declare print_to_mapfile.
16436 * output.cc (Output_section::Input_section::print_to_mapfile): New
16437 function.
16438 (Output_section::add_input_section): If producing a map, always
16439 add to input_sections_ list.
16440 (Output_section::do_print_to_mapfile): New function.
16441 (Output_segment::print_sections_to_mapfile): New function.
16442 (Output_segment::print_section_list_to_mapfile): New function.
16443 * output.h: Include "mapfile.h".
16444 (Output_data::print_to_mapfile): New function.
16445 (Output_data::do_print_to_mapfile): New virtual function.
16446 (Output_segment_headers::do_print_to_mapfile): New function.
16447 (Output_file_header::do_print_to_mapfile): New function.
16448 (Output_data_const::do_print_to_mapfile): New function.
16449 (class Output_data_const_buffer): Add map_name_ field. Update
16450 constructor. Change all callers. Add do_print_to_mapfile
16451 function.
16452 (class Output_data_fixed_space): Likewise.
16453 (class Output_data_space): Likewise.
16454 (class Output_data_zero_fill): New class.
16455 (Output_data_strtab::do_print_to_mapfile): New function.
16456 (Output_data_reloc_base::do_print_to_mapfile): New function.
16457 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16458 (Output_data_group::do_print_to_mapfile): New function.
16459 (Output_data_got::do_print_to_mapfile): New function.
16460 (Output_data_dynamic::do_print_to_mapfile): New function.
16461 (Output_symtab_xindex::do_print_to_mapfile): New function.
16462 (class Output_section): Declare do_print_to_mapflie. Declare
16463 print_to_mapfile in Input_section.
16464 (class Output_segment): Declare new functions.
16465 * object.h (Sized_relobj::symbol_count): New function.
16466 * script-sections.cc
16467 (Output_section_element_dot_assignment::set_section_addresses):
16468 Change Output_data_fixed_space to Output_data_zero_fill.
16469 (Output_data_expression::do_print_to_mapfile): New function.
16470 * script.cc (read_input_script): Add mapfile parameter. Change
16471 all callers.
16472 * script.h (read_input_script): Update declaration.
16473 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16474 (Eh_frame::do_print_to_mapfile): New function.
16475 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16476 (Output_merge_string::do_print_to_mapfile): New function.
16477 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16478 function.
16479 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16480 function.
16481 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16482 function.
16483 * Makefile.am (CCFILES): Add mapfile.cc.
16484 (HFILES): Add mapfile.h.
16485 * Makefile.in: Rebuild.
16486
16487 2008-05-19 Ian Lance Taylor <iant@google.com>
16488
16489 * options.h (class General_options): Add -z relro.
16490 * layout.cc (Layout::Layout): Initialize relro_segment_.
16491 (Layout::add_output_section_data): Return the output section.
16492 (Layout::make_output_section): Rcognize relro sections and mark
16493 them appropriately.
16494 (Layout::attach_allocated_section_to_segment): Put relro sections
16495 in a PT_GNU_RELRO segment.
16496 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16497 section as relro.
16498 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16499 PT_TLS segments.
16500 (Layout::linkonce_mapping): Map d.rel.ro.local to
16501 .data.rel.ro.local.
16502 (Layout::output_section_name): Us .data.rel.ro.local for any
16503 section which begins with that.
16504 * layout.h (class Layout): Update add_output_section_data
16505 declaration. Add relro_segment_ field.
16506 * output.cc (Output_section::Output_section): Initialize is_relro_
16507 and is_relro_local_ fields.
16508 (Output_segment::add_output_section): Group relro sections.
16509 (Output_segment::is_first_section_relro): New function.
16510 (Output_segment::maximum_alignment): If there is a relro section,
16511 align the segment to the common page size.
16512 (Output_segment::set_section_addresses): Track whether we are
16513 looking at relro sections. If the last section is a relro
16514 section, align to the common page size.
16515 (Output_segment::set_section_list_addresses): Add in_relro
16516 parameter. Change all callers. Align to the page size when
16517 moving from relro to non-relro section.
16518 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16519 segment.
16520 * output.h (class Output_section): Add is_relro_ and
16521 is_relro_local_ fields.
16522 (Output_section::is_relro): New function.
16523 (Output_section::set_is_relro): New function.
16524 (Output_section::is_relro_local): New function.
16525 (Output_section::set_is_relro_local): New function.
16526 (class Output_segment): Update declarations.
16527 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16528 * sparc.cc (Target_sparc::got_section): Likewise.
16529 * x86_64.cc (Target_x86_64::got_section): Likewise.
16530 * testsuite/relro_test_main.cc: New file.
16531 * testsuite/relro_test.cc: New file.
16532 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16533 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16534 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16535 (relro_test.so, relro_test_pic.o): New targets.
16536 * testsuite/Makefile.in: Rebuild.
16537
16538 2008-05-16 Ian Lance Taylor <iant@google.com>
16539
16540 * output.cc (Output_segment::add_output_section): Remove front
16541 parameter.
16542 * output.h (class Output_segment): Remove
16543 add_initial_output_section and overloaded add_output_section.
16544 Update declaration of remaining add_output_section.
16545 * layout.cc (Layout::create_interp): Call add_output_section
16546 rather than add_initial_output_section.
16547 (Layout::finish_dynamic_section): Likewise.
16548
16549 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16550 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16551 know the dynamic type.
16552 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16553 field. Initialize it in constructor.
16554 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16555 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16556 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16557 reloc.
16558
16559 * output.cc (Output_reloc::get_address): Change return type to
16560 Elf_Addr.
16561 * output.h (class Output_reloc): Update get_address declaration.
16562 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16563 for section addresses.
16564
16565 2008-05-09 Ian Lance Taylor <iant@google.com>
16566
16567 PR 6493
16568 * gold.cc (gold_nomem): Use return value of write.
16569
16570 2008-05-08 Ian Lance Taylor <iant@google.com>
16571
16572 * symtab.c (Symbol::init_base_output_data): Add version
16573 parameter. Change all callers.
16574 (Symbol::init_base_output_segment): Likewise.
16575 (Symbol::init_base_constant): Likewise.
16576 (Symbol::init_base_undefined): Likewise.
16577 (Sized_symbol::init_output_data): Likewise.
16578 (Sized_symbol::init_output_segment): Likewise.
16579 (Sized_symbol::init_constant): Likewise.
16580 (Sized_symbol::init_undefined): Likewise.
16581 (Symbol_table::do_define_in_output_data): If the new symbol has a
16582 version, mark it as the default.
16583 (Symbol_table::do_define_in_output_segment): Likewise.
16584 (Symbol_table::do_define_as_constant): Likewise.
16585 * symtab.h (class Symbol): Update declarations.
16586 (class Sized_symbol): Likewise.
16587 * resolve.cc (Symbol::override_version): New function.
16588 (Symbol::override_base): Call override_version.
16589 (Symbol::override_base_with_special): Likewise.
16590 * testsuite/ver_script_8.script: New file.
16591 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16592 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16593 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16594 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16595
16596 2008-05-06 Ian Lance Taylor <iant@google.com>
16597
16598 PR 6049
16599 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16600 functions.
16601 (class General_options): Remove existing --undefined, and add
16602 --no-undefined instead. Add new --undefined as synonym for -u.
16603 * archive.cc (Archive::add_symbols): Check whether symbol was
16604 named with -u.
16605 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16606 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16607 all uses. Add IS_UNDEFINED. Update declarations to split
16608 different versions of init_base. Declare init_base_undefined.
16609 (Symbol::is_defined): Handle IS_UNDEFINED.
16610 (Symbol::is_undefined): Likewise.
16611 (Symbol::is_weak_undefined): Call is_undefined.
16612 (Symbol::is_absolute): Handle IS_CONSTANT.
16613 (class Sized_symbol): Update declarations to split different
16614 versions of init. Declare init_undefined.
16615 (class Symbol_table): Declare new functions.
16616 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16617 Change all callers.
16618 (Symbol::init_base_output_data): Likewise.
16619 (Symbol::init_base_output_segment): Likewise.
16620 (Symbol::init_base_constant): Likewise.
16621 (Symbol::init_base_undefined): New function.
16622 (Sized_symbol::init_object): Rename from init. Change all
16623 callers.
16624 (Sized_symbol::init_output_data): Likewise.
16625 (Sized_symbol::init_output_segment): Likewise.
16626 (Sized_symbol::init_constant): Likewise.
16627 (Sized_symbol::init_undefined): New function.
16628 (Symbol_table::add_undefined_symbols_from_command_line): New
16629 function.
16630 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16631 function.
16632 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16633 (Symbol::output_section): Likewise.
16634 (Symbol::set_output_section): Likewise.
16635 (Symbol_table::sized_finalize_symbol): Likewise.
16636 (Symbol_table::sized_write_globals): Likewise.
16637 * resolve.cc (Symbol_table::should_override): Likewise.
16638 (Symbol::override_base_with_special): Likewise.
16639
16640 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16641 symbol, change it to have default visibility.
16642 * testsuite/protected_1.cc: New file.
16643 * testsuite/protected_2.cc: New file.
16644 * testsuite/protected_3.cc: New file.
16645 * testsuite/protected_main_1.cc: New file.
16646 * testsuite/protected_main_2.cc: New file.
16647 * testsuite/protected_main_3.cc: New file.
16648 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16649 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16650 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16651 (protected_1.so): New target.
16652 (protected_1_pic.o, protected_2_pic.o): New targets.
16653 (protected_3_pic.o): New target.
16654 (check_PROGRAMS): Add protected_2.
16655 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16656 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16657 * testsuite/Makefile.in: Rebuild.
16658
16659 * options.h (DEFINE_var): Add set_user_set_##varname__.
16660 (DEFINE_bool_alias): New macro.
16661 (class General_options): Define -Bstatic using DEFINE_bool_alias
16662 rather than DEFINE_special. Add --undefined as an alias for -z
16663 defs.
16664 * options.cc (General_options::parse_Bstatic): Remove.
16665
16666 * options.h (class General_options): Add --fatal-warnings.
16667 * main.cc (main): Implement --fatal-warnings.
16668 * errors.h (Errors::warning_count): New function.
16669
16670 * options.h (class General_options): Add -Bsymbolic-functions.
16671 * symtab.h (Symbol::is_preemptible): Check for
16672 -Bsymbolic-functions.
16673
16674 2008-05-05 Ian Lance Taylor <iant@google.com>
16675
16676 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16677 as noVARNAME rather than no-VARNAME.
16678 (class General_options): Add option -z combreloc.
16679 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16680 get_address.
16681 (Output_reloc::sort_before) [SHT_REL]: New function.
16682 (Output_reloc::sort_before) [SHT_RELA]: New function.
16683 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16684 Sort_relocs_comparison.
16685 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16686 parameter. Change all callers.
16687 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16688 sort_relocs parameter. Change all callers.
16689 * output.cc (Output_reloc::get_address): New function, broken out
16690 of write_rel.
16691 (Output_reloc::write_rel): Call it.
16692 (Output_reloc::compare): New function.
16693 (Output_data_reloc_base::do_write): Optionally sort relocs.
16694
16695 * configure.ac: If targ_extra_obj is set, link it in.
16696 * configure.tgt: Initialize all variables.
16697 (x86_64*): Set targ_extra_obj and targ_extra_size.
16698 * configure: Rebuild.
16699
16700 * object.cc (Sized_relobj::include_section_group): Adjust section
16701 indexes read from group data. Build vector to pass to
16702 layout_group.
16703 * layout.cc (Layout::layout_group): Add flags and shndxes
16704 parameters. Remove contents parameter. Change caller. Update
16705 explicit instantiations.
16706 * layout.h (class Layout): Update layout_group declaration.
16707 * output.cc (Output_data_group::Output_data_group): Add flags and
16708 input_shndxes parameters. Remove contents parameter. Change
16709 caller.
16710 (Output_data_group::do_write): Change input_sections_ to
16711 input_shndxes_.
16712 * output.h (class Output_data_group): Update constructor
16713 declaration. Rename input_sections_ to input_shndxes_.
16714 * testsuite/many_sections_test.cc: Add template.
16715
16716 2008-04-30 Cary Coutant <ccoutant@google.com>
16717
16718 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16719
16720 * layout.cc (Layout::include_section): Refactored check for debug
16721 info section.
16722 (Layout::add_comdat): Add new parameters. Change type
16723 of signature parameter. Add object and shndx to signatures table.
16724 (Layout::find_kept_object): New function.
16725 * layout.h: Include <cstring>.
16726 (Layout::is_debug_info_section): New function.
16727 (Layout::add_comdat): Add new parameters.
16728 (Layout::find_kept_object): New function.
16729 (Layout::Kept_section): New struct.
16730 (Layout::Signatures): Change type of map range.
16731 * object.cc (Relobj::output_section_address): New function.
16732 (Sized_relobj::include_section_group): Add new parameters. Change
16733 calls to Layout::add_comdat. Change to build table of kept comdat
16734 groups and table mapping discarded sections to kept sections.
16735 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16736 (Sized_relobj::do_layout): Change calls to include_section_group and
16737 include_linkonce_section.
16738 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16739 value to zero when section is discarded.
16740 (Sized_relobj::map_to_kept_section): New function.
16741 * object.h (Relobj::output_section_address): New function.
16742 (Relobj::Comdat_group): New type.
16743 (Relobj::find_comdat_group): New function.
16744 (Relobj::Comdat_group_table): New type.
16745 (Relobj::Kept_comdat_section): New type.
16746 (Relobj::Kept_comdat_section_table): New type.
16747 (Relobj::add_comdat_group): New function.
16748 (Relobj::set_kept_comdat_section): New function.
16749 (Relobj::get_kept_comdat_section): New function.
16750 (Relobj::comdat_groups_): New field.
16751 (Relobj::kept_comdat_sections_): New field.
16752 (Symbol_value::input_value): Update comment.
16753 (Sized_relobj::map_to_kept_section) New function.
16754 (Sized_relobj::include_linkonce_section): Add new parameter.
16755 * target-reloc.h (Comdat_behavior): New type.
16756 (get_comdat_behavior): New function.
16757 (relocate_section): Add code to map a discarded section to the
16758 corresponding kept section when applying a relocation.
16759
16760 2008-04-30 Craig Silverstein <csilvers@google.com>
16761
16762 * dwarf_reader.cc (next_generation_count): New static var.
16763 (Addr2line_cache_entry): New struct.
16764 (addr2line_cache): New static var.
16765 (Dwarf_line_info::one_addr2line): Added caching.
16766 (Dwarf_line_info::clear_addr2line_cache): New function.
16767 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16768 cache-size parameter.
16769 (Dwarf_line_info::one_addr2line_cache): New function.
16770 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16771 new cache-size argument to one_addr2line(), and clear cache.
16772
16773 2008-04-28 Cary Coutant <ccoutant@google.com>
16774
16775 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16776 R_386_PC8 relocations.
16777
16778 2008-04-23 Ian Lance Taylor <iant@google.com>
16779
16780 * object.cc (Sized_relobj::include_section_group): Check for
16781 invalid section group.
16782
16783 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16784 header size.
16785
16786 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16787 than read for file header.
16788 * archive.cc (Archive::include_member): Likewise.
16789
16790 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16791
16792 * aclocal.m4: Regenerate.
16793 * configure: Regenerate.
16794
16795 2008-04-19 Ian Lance Taylor <iant@google.com>
16796
16797 * version.cc (version_string): Bump to 1.6.
16798
16799 * testsuite/Makefile.am (many_sections_r_test): New target.
16800 (many_sections_r_test_SOURCES): Remove.
16801 (many_sections_r_test_DEPENDENCIES): Remove.
16802 (many_sections_r_test_LDFLAGS): Remove.
16803 (many_sections_r_test_LDADD): Remove.
16804
16805 * object.cc (Sized_relobj::do_add_symbols): Always pass
16806 local_symbol_count_ to add_from_relobj.
16807
16808 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16809 every thousand variables.
16810 * testsuite/Makefile.in: Rebuild.
16811
16812 * object.cc (Xindex::initialize_symtab_xindex): New function.
16813 (Xindex::read_symtab_xindex): New function.
16814 (Xindex::sym_xindex_to_shndx): New function.
16815 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16816 available.
16817 (Sized_relobj::do_initialize_xindex): New function.
16818 (Sized_relobj::do_read_symbols): Adjust section links.
16819 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16820 parameter. Change all callers.
16821 (Sized_relobj::include_section_group): Adjust section links and
16822 symbol section indexes.
16823 (Sized_relobj::do_layout): Adjust section links.
16824 (Sized_relobj::do_count_local_symbols): Adjust section links and
16825 symbol section indexes.
16826 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16827 ordinary and special symbols.
16828 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16829 dynsym_xindex parameters. Change all callers. Adjust section
16830 links. Use SHN_XINDEX when needed.
16831 (Sized_relobj::get_symbol_location_info): Adjust section links.
16832 Don't get fooled by special symbols.
16833 * object.h (class Xindex): Define.
16834 (class Object): Add xindex_ parameter. Declare virtual functoin
16835 do_initialize_xindex.
16836 (Object::adjust_sym_shndx): New function.
16837 (Object::set_xindex): New protected function.
16838 (class Symbol_value): Add is_ordinary_shndx_ field.
16839 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16840 (Symbol_value::value): Assert ordinary section.
16841 (Symbol_value::initialize_input_to_output_map): Likewise.
16842 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16843 Change all callers.
16844 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16845 all callers.
16846 (class Sized_relobj): Update declarations.
16847 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16848 parameter. Change all callers.
16849 (Sized_relobj::adjust_shndx): New function.
16850 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16851 field.
16852 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16853 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16854 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16855 (Sized_dynobj::read_dynsym_section): Adjust section links.
16856 (Sized_dynobj::read_dynamic): Likewise.
16857 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16858 section links.
16859 (Sized_dynobj::do_initialize_xindex): New function.
16860 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16861 do_initialize_xindex.
16862 (Sized_dynobj::adjust_shndx): New function.
16863 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16864 dynsym_xindex_ fields.
16865 (Layout::finalize): Add a call to set_section_indexes before
16866 creating the symtab sections.
16867 (Layout::set_section_indexes): Don't do anything if the section
16868 already has a section index.
16869 (Layout::create_symtab_sections): Add shnum parameter. Change
16870 caller. Create .symtab_shndx section if needed.
16871 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16872 caller.
16873 (Layout::allocated_output_section_count): New function.
16874 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16875 needed.
16876 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16877 fields. Update declarations.
16878 (Layout::symtab_xindex): New function.
16879 (Layout::dynsym_xindex): New function.
16880 (class Write_symbols_task): Add layout_ field.
16881 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16882 Change caller.
16883 * output.cc (Output_section_headers::Output_section_headers): Add
16884 shstrtab_section parameter. Change all callers.
16885 (Output_section_headers::do_sized_write): Store overflow values
16886 for section count and section string table section index in
16887 section header zero.
16888 (Output_file_header::do_sized_write): Check for overflow of
16889 section count and section string table section index.
16890 (Output_symtab_xindex::do_write): New function.
16891 (Output_symtab_xindex::endian_do_write): New function.
16892 * output.h (class Output_section_headers): Add shstrtab_section_.
16893 Update declarations.
16894 (class Output_symtab_xindex): Define.
16895 (Output_section::has_out_shndx): New function.
16896 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16897 field.
16898 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16899 Change all callers.
16900 (Sized_symbol::init): Likewise.
16901 (Symbol::output_section): Check for ordinary symbol.
16902 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16903 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16904 callers.
16905 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16906 Change all callers. Simplify handling of symbols from sections
16907 not included in the link.
16908 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16909 distinction.
16910 (Weak_alias_sorter::operator()): Assert that symbols are
16911 ordinary.
16912 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16913 distinction.
16914 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16915 parameters. Change all callers.
16916 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16917 symbol distinction. Use SHN_XINDEX when needed.
16918 (Symbol_table::write_section_symbol): Add symtab_xindex
16919 parameter. Change all callers.
16920 (Symbol_table::sized_write_section_symbol): Likewise. Use
16921 SHN_XINDEX when needed.
16922 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16923 declarations.
16924 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16925 (Symbol::is_defined): Check is_ordinary.
16926 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16927 (Symbol::is_absolute, Symbol::is_common): Likewise.
16928 (class Sized_symbol): Update declarations.
16929 (class Symbol_table): Update declarations.
16930 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16931 parameters. Change all callers.
16932 (Sized_symbol::override): Likewise.
16933 (Symbol_table::override): Likewise.
16934 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16935 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16936 is_ordinary, and orig_st_shndx parameters. Change all callers.
16937 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16938 to be in an ordinary section.
16939 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16940 object and is_ordinary parameters. Change all callers.
16941 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16942 Change all callers. Don't add undefined or non-ordinary symbols
16943 to reloc_map_.
16944 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16945 Change all callers.
16946 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16947 declarations.
16948 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16949 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16950 (Sized_relobj::relocate_sections): Likewise.
16951 * target-reloc.h (scan_relocs): Adjust section symbol index.
16952 (scan_relocatable_relocs): Likewise.
16953 * i386.cc (Scan::local): Check for ordinary symbols.
16954 * sparc.cc (Scan::local): Likewise.
16955 * x86_64.cc (Scan::local): Likewise.
16956 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16957 to symbol_section_and_value.
16958 * testsuite/many_sections_test.cc: New file.
16959 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16960 (check_PROGRAMS): Add many_sections_test.
16961 (many_sections_test_SOURCES): Define.
16962 (many_sections_test_DEPENDENCIES): Define.
16963 (many_sections_test_LDFLAGS): Define.
16964 (BUILT_SOURCES): Add many_sections_define.h.
16965 (many_sections_define.h): New target.
16966 (BUILT_SOURCES): Add many_sections_check.h.
16967 (many_sections_check.h): New target.
16968 (check_PROGRAMS): Add many_sections_r_test.
16969 (many_sections_r_test_SOURCES): Define.
16970 (many_sections_r_test_DEPENDENCIES): Define.
16971 (many_sections_r_test_LDFLAGS): Define.
16972 (many_sections_r_test_LDADD): Define.
16973 (many_sections_r_test.o): New target.
16974 * testsuite/Makefile.in: Rebuild.
16975
16976 2008-04-17 Cary Coutant <ccoutant@google.com>
16977
16978 * errors.cc (Errors::info): New function.
16979 (gold_info): New function.
16980 * errors.h (Errors::info): New function.
16981 * gold.h (gold_info): New function.
16982 * object.cc (Input_objects::add_object): Print trace output.
16983 * options.cc (options::parse_set): New function.
16984 (General_options::parse_wrap): Deleted.
16985 (General_options::General_options): Deleted initializer.
16986 * options.h (options::String_set): New typedef.
16987 (options::parse_set): New function.
16988 (DEFINE_set): New macro.
16989 (General_options::wrap): Changed to use DEFINE_set. Changed
16990 callers of any_wrap_symbols and is_wrap_symbol.
16991 (General_options::trace, General_options::trace_symbol):
16992 New options.
16993 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16994 (General_options::wrap_symbols_): Deleted.
16995 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16996
16997 2008-04-17 David S. Miller <davem@davemloft.net>
16998
16999 * options.cc (General_options::parse_V): New function.
17000 * options.h: Add entries for -V and -Qy.
17001
17002 2008-04-17 Ian Lance Taylor <iant@google.com>
17003
17004 * common.cc (Symbol_table::allocate_commons): Remove options
17005 parameter. Change caller.
17006 (Symbol_table::do_allocate_commons): Remove options parameter.
17007 Change caller. Just call do_allocate_commons_list twice.
17008 (Symbol_table::do_allocate_commons_list): New function, broken out
17009 of do_allocate_commons.
17010 * common.h (class Allocate_commons_task): Remove options_ field.
17011 Update constructor.
17012 * symtab.cc (Symbol_table::Symbol_table): Initialize
17013 tls_commons_.
17014 (Symbol_table::add_from_object): Put TLS common symbols on
17015 tls_commons_ list.
17016 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17017 which are IN_OUTPUT_DATA.
17018 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17019 allocate_commons and do_allocate_commons declarations. Declare
17020 do_allocate_commons_list.
17021 * gold.cc (queue_middle_tasks): Update creation of
17022 Allocate_commons_task to not pass options.
17023 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17024 (TLS_TEST_C_FLAGS): New variable.
17025 (tls_test_c_pic.o): New target.
17026 (tls_test_shared.so): Link in tls_test_c_pic.o.
17027 (tls_test_c_pic_ie.o): New target.
17028 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17029 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17030 (tls_test_c.o): New target.
17031 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17032 (tls_pic_test_LDADD): Likewise.
17033 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17034 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17035 (tls_test_c_gnu2.o): New target.
17036 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17037 tls_test_c_gnu2.o.
17038 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17039 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17040 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17041 * testsuite/tls_test.cc: Include "config.h".
17042 (t_last): Call t11_last.
17043 * testsuite/tls_test.h (t11, t11_last): Declare.
17044 * testsuite/tls_test_c.c: New file.
17045 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17046 * configure.ac: Check for OpenMP support.
17047 * configure, config.in, Makefile.in: Rebuild.
17048 * testsuite/Makefile.in: Rebuild.
17049
17050 2008-04-16 Cary Coutant <ccoutant@google.com>
17051
17052 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17053 (Target_i386::tls_base_symbol_defined_): New field.
17054 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17055 (Target_i386::Scan::global): Likewise.
17056 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17057 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17058 (Target_x86_64::tls_base_symbol_defined_): New field.
17059 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17060 (Target_x86_64::Scan::global): Likewise.
17061
17062 2008-04-16 Cary Coutant <ccoutant@google.com>
17063
17064 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17065 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17066 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17067 building shared libraries.
17068 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17069 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17070 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17071 * testsuite/Makefile.in: Rebuild.
17072 * testsuite/weak_undef.h: New file.
17073 * testsuite/weak_undef_file1.cc: Add extra test cases.
17074 * testsuite/weak_undef_file2.cc: Likewise.
17075 * testsuite/weak_undef_test.cc: Likewise.
17076
17077 2008-04-16 David S. Miller <davem@davemloft.net>
17078
17079 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17080 Add issued_non_pic_error_ field. Declare check_non_pic.
17081 (Target_sparc::Scan::check_non_pic): New function.
17082 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17083 (Target_sparc::Scan::global): Likewise.
17084
17085 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17086 * configure: Rebuild.
17087
17088 * options.h (DEFINE_enable): New macro.
17089 (new_dtags): New enable option.
17090 (initfirst, interpose, loadfltr, nodefaultlib,
17091 nodelete, nodlopen, nodump): New -z options.
17092 * layout.cc (Layout:finish_dynamic_section): If new
17093 dtags enabled, emit DT_RUNPATH. Also, emit a
17094 DT_FLAGS_1 containing any specified -z flags.
17095
17096 2008-04-16 Ian Lance Taylor <iant@google.com>
17097
17098 * copy-relocs.cc: New file.
17099 * copy-relocs.h: New file.
17100 * reloc.cc: Remove Copy_relocs code.
17101 * reloc.h: Likewise.
17102 * reloc-types.h (struct Reloc_types) [both versions]: Add
17103 get_reloc_addend_noerror.
17104 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17105 variants of add_global which take an addend which must be zero.
17106 * i386.cc: Include "copy-relocs.h".
17107 (class Target_i386): Change type of copy_relocs_ to variable,
17108 update initializer.
17109 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17110 Change all callers.
17111 (Target_i386::do_finalize_sections): Change handling of
17112 copy_relocs_.
17113 * sparc.cc: Include "copy-relocs.h".
17114 (class Target_sparc): Change type of copy_relocs_ to variable,
17115 update initializer.
17116 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17117 Change all callers.
17118 (Target_sparc::do_finalize_sections): Change handling of
17119 copy_relocs_.
17120 * x86_64.cc: Include "copy-relocs.h".
17121 (class Target_x86_64): Change type of copy_relocs_ to variable,
17122 update initializer.
17123 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17124 class. Change all callers.
17125 (Target_x86_64::do_finalize_sections): Change handling of
17126 copy_relocs_.
17127 * Makefile.am (CCFILES): Add copy-relocs.cc.
17128 (HFILES): Add copy-relocs.h.
17129
17130 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17131
17132 * testsuite/script_test_4.sh: Permit leading zeroes.
17133
17134 2008-04-15 Ian Lance Taylor <iant@google.com>
17135
17136 * script-sections.cc (Script_sections::create_segments): Use
17137 header_size_adjustment even when there is enough room for the
17138 headers.
17139 * testsuite/script_test_4.sh: New file.
17140 * testsuite/script_test_4.t: New file.
17141 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17142 (check_DATA): Add script_test_4.stdout.
17143 (MOSTLYCLEANFILES): Likewise.
17144 (script_test_4): New target.
17145 (script_test_4.stdout): New target.
17146 * testsuite/Makefile.in: Rebuild.
17147
17148 * sparc.cc: Add definitions for Output_data_plt_sparc class
17149 constants.
17150
17151 2008-04-14 David S. Miller <davem@davemloft.net>
17152
17153 * sparc.cc: New file.
17154 * Makefile.am (TARGETSOURCES): Add sparc.cc
17155 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17156 * configure.tgt: Document targ_extra_size and
17157 targ_extra_big_endian. Add entries for sparc-* and
17158 sparc64-*.
17159 * configure.ac: Handle targ_extra_size and
17160 targ_extra_big_endian.
17161 * Makefile.in: Rebuild.
17162 * configure: Likewise.
17163 * po/POTFILES.in: Likewise.
17164 * po/gold.pot: Likewise.
17165
17166 2008-04-14 Ian Lance Taylor <iant@google.com>
17167
17168 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17169 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17170 in the name/type/flags to section mapping. Don't call
17171 allocate_output_section.
17172 (Layout::choose_output_section): Change parameter from adjust_name
17173 to is_input_section. Don't permit input sections after sections
17174 are attached to segments. Don't call allocate_output_section.
17175 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17176 not write_enable_output_section.
17177 (Layout::make_output_section): Don't push to
17178 unattached_section_list_ nor call attach_to_segment. Call
17179 attach_section_to_segment if sections are attached.
17180 (Layout::attach_sections_to_segments): New function.
17181 (Layout::attach_section_to_segment): New function.
17182 (Layout::attach_allocated_section_to_segment): Rename from
17183 attach_to_segment. Remove flags parameter.
17184 (Layout::allocate_output_section): Remove function.
17185 (Layout::write_enable_output_section): Remove function.
17186 * layout.h (class Layout): Update for above changes. Add new
17187 field sections_are_attached_.
17188 * output.h (Output_section::update_flags_for_input_section): New
17189 function.
17190 * output.cc (Output_section::add_input_section): Call
17191 update_flags_for_input_section.
17192 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17193
17194 2008-04-11 Cary Coutant <ccoutant@google.com>
17195
17196 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17197 thought unnecessary.
17198 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17199
17200 2008-04-11 Ian Lance Taylor <iant@google.com>
17201
17202 * output.h (class Output_section_data): Remove inline definition
17203 of set_addralign.
17204 * output.cc (Output_section_data::set_addralign): New function.
17205
17206 2008-04-11 Cary Coutant <ccoutant@google.com>
17207
17208 Add support for TLS descriptors for i386 and x86_64.
17209 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17210 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17211 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17212 GOT_TYPE_TLS_DESC.
17213 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17214 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17215 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17216 relocations.
17217 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17218 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17219 Fix problem with initial-exec relocations.
17220 (Target_i386::Relocate::relocate_tls): Likewise.
17221 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17222 relaxation.
17223 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17224 support for section-plus-offset dynamic table entries.
17225 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17226 (Output_data_dynamic::Dynamic_entry): Add support for
17227 section-plus-offset dynamic table entries.
17228 (Output_data_dynamic::Classification): Likewise.
17229 (Output_data_dynamic::classification_): Renamed offset_.
17230 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17231 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17232 (Target_x86_64::make_plt_section): New function.
17233 (Target_x86_64::reserve_tlsdesc_entries): New function.
17234 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17235 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17236 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17237 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17238 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17239 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17240 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17241 add extra PLT entry for TLS descriptors.
17242 (Output_data_plt_x86_64::got_): New field.
17243 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17244 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17245 fields.
17246 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17247 descriptors.
17248 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17249 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17250 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17251 R_386_TLS_DESC_CALL relocations.
17252 (Target_x86_64::Scan::global): Likewise.
17253 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17254 for TLS descriptors.
17255 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17256 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17257 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17258 GD-to-IE relaxation.
17259 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17260 and TLS_DESCRIPTORS.
17261 * Makefile.in: Rebuild.
17262 * configure: Rebuild.
17263 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17264 (tls_test_shared2.so): New target.
17265 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17266 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17267 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17268 (tls_shared_gd_to_ie_test_LDADD): New variable.
17269 (tls_shared_gnu2_gd_to_ie_test): New target.
17270 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17271 New targets.
17272 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17273 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17274 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17275 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17276 (tls_shared_gnu2_test): New target.
17277 (tls_test_gnu2_shared.so): New target.
17278 (tls_shared_gnu2_test_SOURCES): New variable.
17279 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17280 (tls_shared_gnu2_test_LDFLAGS): New variable.
17281 (tls_shared_gnu2_test_LDADD): New variable.
17282 * testsuite/Makefile.in: Rebuild.
17283 * testsuite/Makefile.
17284
17285 2008-04-11 Ian Lance Taylor <iant@google.com>
17286
17287 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17288 justsyms.t.
17289 * testsuite/Makefile.in: Rebuild.
17290
17291 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17292 long.
17293 * testsuite/script_test_2.cc (main): Adjust test.
17294
17295 2008-04-11 David S. Miller <davem@davemloft.net>
17296 Ian Lance Taylor <iant@google.com>
17297
17298 * options.h (General_options): Add entries for '-Y' and
17299 '-relax'.
17300 * options.cc (General_options:finalize): If -Y was used, add those
17301 entries to the library path instead of the default "/lib" and
17302 "/usr/lib".
17303
17304 2008-04-11 David S. Miller <davem@davemloft.net>
17305
17306 * testsuite/justsyms.t: Start at 0x100.
17307 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17308 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17309 long.
17310 * testsuite/script_test_2.cc: Adjust string and section length
17311 checks.
17312
17313 2008-04-09 Ian Lance Taylor <iant@google.com>
17314
17315 PR gold/5996
17316 * script-sections.cc (Sections_element::allocate_to_segment): Add
17317 orphan parameter.
17318 (Output_section_definition::allocate_to_segment): Likewise.
17319 (Orphan_output_section::allocate_to_segment): Likewise.
17320 (Script_sections::attach_sections_using_phdrs_clause): Don't
17321 propagate non-PT_LOAD segments to orphan sections.
17322 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17323 readelf rather than objdump.
17324 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17325 .interp section and PT_INTERP segment are the same size.
17326 * testsuite/Makefile.in: Rebuild.
17327
17328 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17329 aliases for symbols defined in the same object.
17330 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17331 (weak_alias_test_SOURCES): New variable.
17332 (weak_alias_test_DEPENDENCIES): New variable.
17333 (weak_alias_test_LDFLAGS): New variable.
17334 (weak_alias_test_LDADD): New variable.
17335 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17336 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17337 (weak_alias_test_3.o): New target.
17338 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17339 * testsuite/weak_alias_test_main.cc: New file.
17340 * testsuite/weak_alias_test_1.cc: New file.
17341 * testsuite/weak_alias_test_2.cc: New file.
17342 * testsuite/weak_alias_test_3.cc: New file.
17343
17344 2008-04-08 Ian Lance Taylor <iant@google.com>
17345
17346 * options.h (class General_options): Add --noinhibit-exec option.
17347 * main.cc (main): Check --noinhibit-exec.
17348
17349 * options.h (class General_options): Define --wrap as a special
17350 option. Add wrap_symbols_ field.
17351 (General_options::any_wrap_symbols): New function.
17352 (General_options::is_wrap_symbol): New function.
17353 * options.cc (General_options::parse_wrap): New function.
17354 (General_options::General_options): Initialize wrap_symbols_.
17355 * symtab.cc (Symbol_table::wrap_symbol): New function.
17356 (Symbol_table::add_from_object): Handle --wrap.
17357 * symtab.h (class Symbol_table): Declare wrap_symbol.
17358 * target.h (Target::wrap_char): New function.
17359 (Target::Target_info): Add wrap_char field.
17360 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17361 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17362 * testsuite/testfile.cc (Target_test::test_target_info):
17363 Likewise.
17364
17365 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17366 there is one.
17367
17368 * layout.h (class Layout): Add added_eh_frame_data_ field.
17369 * layout.cc (Layout::Layout): Initialize new field.
17370 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17371 output section until we find a section we merged successfully.
17372 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17373 that the size be non-zero.
17374
17375 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17376 qualifier.
17377
17378 2008-04-08 Craig Silverstein <csilvers@google.com>
17379
17380 * configure.ac: Export new conditional variable HAVE_ZLIB.
17381 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17382 on HAVE_ZLIB.
17383 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17384 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17385
17386 2008-04-07 Ian Lance Taylor <iant@google.com>
17387
17388 * version.cc (version_string): Set to "1.5".
17389
17390 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17391 Add issued_non_pic_error_ field. Declare check_non_pic.
17392 (Target_x86_64::Scan::check_non_pic): New function.
17393 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17394 (Target_x86_64::Scan::global): Likewise.
17395
17396 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17397 addend parameter. Change caller. Handle merge sections.
17398 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17399 Address to Addend. Don't add in the result of
17400 local_section_offset, pass down the addend and use the returned
17401 value.
17402 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17403 Update declarations of local_section_offset and symbol_value.
17404 * testsuite/two_file_test_1.cc (t18): New function.
17405 * testsuite/two_file_test_2.cc (f18): New function.
17406 * testsuite/two_file_test_main.cc (main): Call t18.
17407 * testsuite/two_file_test.h (t18, f18): Declare.
17408
17409 * configure.ac: Don't test for objdump, c++filt, or readelf.
17410 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17411 conditionals.
17412 (TEST_READELF): New variable.
17413 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17414 (check_PROGRAMS): Add two_file_strip_test.
17415 (two_file_strip_test): New target.
17416 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17417 (two_file_same_shared_strip_test_SOURCES): New variable.
17418 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17419 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17420 (two_file_same_shared_strip_test_LDADD): New variable.
17421 (two_file_shared_strip.so): New target.
17422 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17423 (ver_test_5.syms, ver_test_7.syms): Likewise.
17424 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17425 (strip_test_3.stdout): Use TEST_OBJDUMP.
17426 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17427
17428 2008-04-04 Cary Coutant <ccoutant@google.com>
17429
17430 * symtab.h (Symbol::is_weak_undefined): New function.
17431 (Symbol::is_strong_undefined): New function.
17432 (Symbol::is_absolute): New function.
17433 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17434 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17435 absolute symbols.
17436 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17437 (weak_undef_test): New target.
17438 * testsuite/Makefile.in: Rebuild.
17439 * testsuite/weak_undef_file1.cc: New file.
17440 * testsuite/weak_undef_file2.cc: New file.
17441 * testsuite/weak_undef_test.cc: New file.
17442
17443 2008-04-03 Craig Silverstein <csilvers@google.com>
17444
17445 * compressed_output.h (class Output_compressed_section): Use
17446 unsigned buffer.
17447 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17448 add zlib header.
17449 (zlib_compressed_suffix): Removed.
17450 (Output_compressed_section::set_final_data_size): Use unsigned
17451 buffers.
17452 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17453 Fix linker invocation.
17454 (flagstest_o_specialfile_and_compress_debug_sections):
17455 Likewise.
17456 * testsuite/Makefile.in: Regenerated.
17457
17458 2008-04-02 David S. Miller <davem@davemloft.net>
17459
17460 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17461 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17462
17463 2008-04-02 Craig Silverstein <csilvers@google.com>
17464
17465 * TODO: New file.
17466
17467 2008-04-02 Ian Lance Taylor <iant@google.com>
17468
17469 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17470 parameters. Update for new key type to views_. Change all
17471 callers.
17472 (File_read::read): Adjust for byteshift in returned view.
17473 (File_read::add_view): New function, broken out of
17474 find_and_make_view.
17475 (File_read::make_view): New function, broken out of
17476 find_and_make_view.
17477 (File_read::find_or_make_view): Add offset and aligned
17478 parameters. Rewrite accordingly. Change all callers.
17479 (File_read::get_view): Add offset and aligned parameters. Adjust
17480 for byteshift in return value.
17481 (File_read::get_lasting_view): Likewise.
17482 * fileread.h (class File_read): Update declarations.
17483 (class File_read::View): Add byteshift_ field. Add byteshift to
17484 constructor. Add byteshift method.
17485 * archive.h (Archive::clear_uncached_views): New function.
17486 (Archive::get_view): Add aligned parameter. Change all callers.
17487 * object.h (Object::get_view): Add aligned parameter. Change all
17488 callers.
17489 (Object::get_lasting_view): Likewise.
17490
17491 * fileread.cc (File_read::release): Don't call clear_views if
17492 there are multiple objects.
17493 * fileread.h (File_read::clear_uncached_views): New function.
17494 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17495 on the archive.
17496
17497 2008-03-31 Cary Coutant <ccoutant@google.com>
17498
17499 Add thin archive support.
17500 * archive.cc (Archive::armagt): New const.
17501 (Archive::setup): Remove task parameter and calls to unlock.
17502 (Archive::unlock_nested_archives): New function.
17503 (Archive::read_header): Add nested_off parameter. Change
17504 all callers.
17505 (Archive::interpret_header): Likewise.
17506 (Archive::include_all_members): Change to handle thin
17507 archives.
17508 (Archive::include_member): Likewise.
17509 * archive.h (Archive::Archive): Add new parameters and
17510 initializers.
17511 (Archive::armagt): New const.
17512 (Archive::setup): Remove task parameter.
17513 (Archive::unlock_nested_archives): New function.
17514 (Archive::read_header): Add nested_off parameter.
17515 (Archive::interpret_header): Likewise.
17516 (Archive::Nested_archive_table): New typedef.
17517 (Archive::is_thin_archive_): New field.
17518 (Archive::nested_archives_): New field.
17519 (Archive::options_): New field.
17520 (Archive::dirpath_): New field.
17521 (Archive::task_): New field.
17522 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17523 for thin archives. Pass additional parameters to
17524 Archive::Archive. Unlock the archive file after calling
17525 Archive::setup.
17526
17527 2008-03-29 Ian Lance Taylor <iant@google.com>
17528
17529 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17530 version symbol to be local.
17531 * testsuite/ver_test_4.sh: New file.
17532 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17533 (check_DATA): Add ver_test_4.syms.
17534 (ver_test_4.syms): New target.
17535 * testsuite/Makefile.in: Rebuild.
17536
17537 * output.cc
17538 (Output_section::Input_section_sort_entry::has_priority): New
17539 function.
17540 (Output_section::Input_section_sort_entry::match_file_name): New
17541 function.
17542 (Output_section::Input_section_sort_entry::match_section_name):
17543 Remove.
17544 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17545 Remove.
17546 (Output_section::Input_section_sort_entry::match_section_file):
17547 Remove.
17548 (Output_section::Input_section_sort_compare::operator()): Rewrite
17549 using new Input_section_sort_entry functions. Sort crtbegin and
17550 crtend first. Sort sections with no priority before sections with
17551 a priority.
17552 * testsuite/initpri1.c (d3): Check j != 4.
17553 (cd5): New constructor/destructor function.
17554 (main): Check j != 2.
17555
17556 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17557 new symbol when resolving, don't call set_is_default.
17558 * testsuite/ver_test_7.cc: New file.
17559 * testsuite/ver_test_7.sh: New file.
17560 * testsuite/Makefile.am (ver_test_7.so): New target.
17561 (ver_test_7.o): New target.
17562 (check_SCRIPTS): Add ver_test_7.sh.
17563 (check_DATA): Add ver_test_7.syms.
17564 (ver_test_7.syms): New target.
17565
17566 2008-03-28 Ian Lance Taylor <iant@google.com>
17567
17568 * layout.cc (Layout::layout): If we see an input section with a
17569 name that needs sorting, set the must_sort flag for the output
17570 section.
17571 (Layout::make_output_section): If the name of the output section
17572 indicates that it might require sorting, set the may_sort flag.
17573 * output.h (Output_section::may_sort_attached_input_sections): New
17574 function.
17575 (Output_section::set_may_sort_attached_input_sections): New
17576 function.
17577 (Output_section::must_sort_attached_input_sections): New
17578 function.
17579 (Output_section::set_must_sort_attached_input_sections): New
17580 function.
17581 (class Output_section): Declare Input_section_sort_entry. Define
17582 Input_section_sort_compare. Declare
17583 sort_attached_input_sections. Add new fields:
17584 may_sort_attached_input_sections_,
17585 must_sort_attached_input_sections_,
17586 attached_input_sections_are_sorted_.
17587 * output.cc (Output_section::Output_section): Initialize new
17588 fields.
17589 (Output_section::add_input_section): Add an entry to
17590 input_sections_ if may_sort or must_sort are true.
17591 (Output_section::set_final_data_size): Call
17592 sort_attached_input_sections if necessary.
17593 (Output_section::Input_section_sort_entry): Define new class.
17594 (Output_section::Input_section_sort_compare::operator()): New
17595 function.
17596 (Output_section::sort_attached_input_sections): New function.
17597 * configure.ac: Check whether the compiler supports constructor
17598 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17599 * testsuite/initpri1.c: New file.
17600 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17601 CONSTRUCTOR_PRIORITY.
17602 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17603 (initpri1_LDFLAGS): New variable.
17604 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17605
17606 2008-03-27 Ian Lance Taylor <iant@google.com>
17607
17608 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17609 * testsuite/common_test_1.c: New file.
17610 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17611 (common_test_1_SOURCES): New variable.
17612 (common_test_1_DEPENDENCIES): New variable.
17613 (common_test_1_LDFLAGS): New variable.
17614
17615 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17616 and commons_ correctly when NAME/VERSION does not override
17617 NAME/NULL.
17618 * testsuite/ver_test_6.c: New file.
17619 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17620 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17621 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17622
17623 2008-03-26 Ian Lance Taylor <iant@google.com>
17624
17625 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17626 of an undefined symbol from a version script.
17627 * testsuite/Makefile.am (ver_test_5.so): New target.
17628 (ver_test_5.o): New target.
17629 (check_SCRIPTS): Add ver_test_5.sh.
17630 (check_DATA): Add ver_test_5.syms.
17631 (ver_test_5.syms): New target.
17632 * testsuite/ver_test_5.cc: New file.
17633 * testsuite/ver_test_5.script: New file.
17634 * testsuite/ver_test_5.sh: New file.
17635 * Makefile.in, testsuite/Makefile.in: Rebuild.
17636
17637 PR gold/5986
17638 Fix problems building gold with gcc 4.3.0.
17639 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17640 (gold_error_at_location, gold_warning_at_location): Use it.
17641 * configure.ac: Check whether we can compile and use a template
17642 function with a printf attribute.
17643 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17644 when jumping over bytes.
17645 * object.cc: Instantiate Object::read_section_data.
17646 * debug.h: Include <cstring>
17647 * dwarf_reader.cc: Include <algorithm>
17648 * main.cc: Include <cstring>.
17649 * options.cc: Include <cstring>.
17650 * output.cc: Include <cstring>.
17651 * script.cc: Include <cstring>.
17652 * script.h: Include <string>.
17653 * symtab.cc: Include <cstring> and <algorithm>.
17654 * target-select.cc: Include <cstring>.
17655 * version.cc: Include <string>.
17656 * testsuite/testmain.cc: Include <cstdlib>.
17657 * configure, config.in: Rebuild.
17658
17659 2008-03-25 Ian Lance Taylor <iant@google.com>
17660
17661 * options.cc: Include "../bfd/bfdver.h".
17662 (options::help): Print bug reporting address.
17663
17664 * version.cc (print_version): Adjust output for current value of
17665 BFD_VERSION_STRING.
17666
17667 * NEWS: New file.
17668
17669 * options.cc (options::help): Print list of supported targets.
17670 * target-select.h: Include <vector>.
17671 (class Target_selector): Make machine_, size_, and is_big_endian_
17672 fields const. Add bfd_name_ and instantiated_target_ fields.
17673 (Target_selector::Target_selector): Add bfd_name parameter.
17674 (Target_selector::recognize): Make non-virtual, call
17675 do_recognize.
17676 (Target_selector::recognize_by_name): Make non-virtual, call
17677 do_recognize_by_name.
17678 (Target_selector::supported_names): New function.
17679 (Target_selector::bfd_name): New function.
17680 (Target_selector::do_instantiate_target): New pure virtual
17681 function.
17682 (Target_selector::do_recognize): New virtual function.
17683 (Target_selector::do_recognize_by_name): New virtual function.
17684 (Target_selector::instantiate_target): New private function.
17685 (supported_target_names): Declare.
17686 * target-select.cc (Target_selector::Target_selector): Update for
17687 new parameter and fields.
17688 (select_target_by_name): Check that the name matches before
17689 calling recognize_by_name.
17690 (supported_target_names): New function.
17691 * i386.cc (class Target_selector_i386): Update Target_selector
17692 constructor call. Remove recognize and recognize_by_name. Add
17693 do_instantiate_target.
17694 * x86_64.cc (class Target_selector_x86_64): Likewise.
17695 * testsuite/testfile.cc (class Target_selector_test): Update for
17696 changes to Target_selector.
17697
17698 * README: Rewrite, with some notes on unsupported features.
17699
17700 2008-03-24 Cary Coutant <ccoutant@google.com>
17701
17702 * i386.cc (Target_i386::Got_type): New enum declaration.
17703 (Target_i386::Scan::local): Updated callers of Output_data_got
17704 member functions.
17705 (Target_i386::Scan::global): Likewise.
17706 (Target_i386::Relocate::relocate): Likewise.
17707 (Target_i386::Relocate::relocate_tls): Likewise.
17708 * object.h (Got_offset_list): New class.
17709 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17710 (Sized_relobj::local_got_offset): Likewise.
17711 (Sized_relobj::set_local_got_offset): Likewise.
17712 (Sized_relobj::local_has_tls_got_offset): Removed.
17713 (Sized_relobj::local_tls_got_offset): Removed.
17714 (Sized_relobj::set_local_tls_got_offset): Removed.
17715 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17716 * output.cc (Output_data_got::add_global): Added got_type parameter.
17717 (Output_data_got::add_global_with_rel): Likewise.
17718 (Output_data_got::add_global_with_rela): Likewise.
17719 (Output_data_got::add_global_pair_with_rel): New function.
17720 (Output_data_got::add_global_pair_with_rela): New function.
17721 (Output_data_got::add_local): Added got_type parameter.
17722 (Output_data_got::add_local_with_rel): Likewise.
17723 (Output_data_got::add_local_with_rela): Likewise.
17724 (Output_data_got::add_local_pair_with_rel): New function.
17725 (Output_data_got::add_local_pair_with_rela): New function.
17726 (Output_data_got::add_global_tls): Removed.
17727 (Output_data_got::add_global_tls_with_rel): Removed.
17728 (Output_data_got::add_global_tls_with_rela): Removed.
17729 (Output_data_got::add_local_tls): Removed.
17730 (Output_data_got::add_local_tls_with_rel): Removed.
17731 (Output_data_got::add_local_tls_with_rela): Removed.
17732 * output.h (Output_data_got::add_global): Added got_type parameter.
17733 (Output_data_got::add_global_with_rel): Likewise.
17734 (Output_data_got::add_global_with_rela): Likewise.
17735 (Output_data_got::add_global_pair_with_rel): New function.
17736 (Output_data_got::add_global_pair_with_rela): New function.
17737 (Output_data_got::add_local): Added got_type parameter.
17738 (Output_data_got::add_local_with_rel): Likewise.
17739 (Output_data_got::add_local_with_rela): Likewise.
17740 (Output_data_got::add_local_pair_with_rel): New function.
17741 (Output_data_got::add_local_pair_with_rela): New function.
17742 (Output_data_got::add_global_tls): Removed.
17743 (Output_data_got::add_global_tls_with_rel): Removed.
17744 (Output_data_got::add_global_tls_with_rela): Removed.
17745 (Output_data_got::add_local_tls): Removed.
17746 (Output_data_got::add_local_tls_with_rel): Removed.
17747 (Output_data_got::add_local_tls_with_rela): Removed.
17748 * resolve.cc (Symbol::override_base_with_special): Removed
17749 reference to has_got_offset_ field.
17750 * symtab.cc (Symbol::init_fields): Replaced initialization
17751 of got_offset_ with got_offsets_. Removed initialization
17752 of has_got_offset_
17753 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17754 (Symbol::got_offset): Likewise.
17755 (Symbol::set_got_offset): Likewise.
17756 (Symbol::has_tls_got_offset): Removed.
17757 (Symbol::tls_got_offset): Removed.
17758 (Symbol::set_tls_got_offset): Removed.
17759 (Symbol::got_offset_): Removed.
17760 (Symbol::tls_mod_got_offset_): Removed.
17761 (Symbol::tls_pair_got_offset_): Removed.
17762 (Symbol::got_offsets_): New field.
17763 (Symbol::has_got_offset): Removed.
17764 (Symbol::has_tls_mod_got_offset): Removed.
17765 (Symbol::has_tls_pair_got_offset): Removed.
17766 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17767 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17768 member functions.
17769 (Target_x86_64::Scan::global): Likewise.
17770 (Target_x86_64::Relocate::relocate): Likewise.
17771 (Target_x86_64::Relocate::relocate_tls): Likewise.
17772
17773 2008-03-25 Ben Elliston <bje@au.ibm.com>
17774
17775 * yyscript.y: Fix spelling error in comment.
17776
17777 2008-03-24 Ian Lance Taylor <iant@google.com>
17778
17779 * options.h (class General_options): Define build_id option.
17780 * layout.h (class Layout): Declare write_build_id, create_note,
17781 create_build_id. Add build_id_note_ member.
17782 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17783 "libiberty.h", "md5.h", "sha1.h".
17784 (Layout::Layout): Initialize eh_frame_data_,
17785 eh_frame_hdr_section_, and build_id_note_.
17786 (Layout::finalize): Call create_build_id.
17787 (Layout::create_note): New function, broken out of
17788 Layout::create_gold_note.
17789 (Layout::create_gold_note): Call create_note.
17790 (Layout::create_build_id): New function.
17791 (Layout::write_build_id): New function.
17792 (Close_task_runner::run): Call write_build_id.
17793
17794 * x86_64.cc: Correct license to GPLv3.
17795
17796 2008-03-23 Ian Lance Taylor <iant@google.com>
17797
17798 * options.cc: Include "demangle.h".
17799 (parse_optional_string): New function.
17800 (parse_long_option): Handle takes_optional_argument.
17801 (parse_short_option): Update dash_z initializer. Handle
17802 takes_optional_argument.
17803 (General_options::General_options): Initialize do_demangle_.
17804 (General_options::finalize): Set do_demangle_. Handle demangling
17805 style.
17806 * options.h (parse_optional_string): Declare.
17807 (struct One_option): Add optional_arg field. Update constructor.
17808 Update call constructor calls. Add takes_optional_argument
17809 function.
17810 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17811 (DEFINE_optional_string): Define.
17812 (General_options::demangle): Change from DEFINE_bool to
17813 DEFINE_optional_string.
17814 (General_options::no_demangle): New function.
17815 (General_options::do_demangle): New function.
17816 (General_options::set_do_demangle): New function.
17817 (General_options::execstack_status_): Move definition to end of
17818 class definition.
17819 (General_options::static_): Likewise.
17820 (General_options::do_demangle_): New field.
17821 * object.cc (big_endian>::get_symbol_location_info): Call
17822 Options::do_demangle, not Options::demangle.
17823 * symtab.cc (demangle): Likewise.
17824
17825 2008-03-22 Ian Lance Taylor <iant@google.com>
17826
17827 * gold.h: Include <cstddef> and <sys/types.h>
17828 * options.h: Include <cstring>.
17829
17830 2008-03-21 Ian Lance Taylor <iant@google.com>
17831
17832 * Added source code to GNU binutils.
17833 \f
17834 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17835
17836 Copying and distribution of this file, with or without modification,
17837 are permitted in any medium without royalty provided the copyright
17838 notice and this notice are preserved.
17839
17840 Local Variables:
17841 mode: change-log
17842 left-margin: 8
17843 fill-column: 74
17844 version-control: never
17845 End:
This page took 0.431905 seconds and 5 git commands to generate.