Add __attribute__((__aligned__(1))) to unaligned symbols from scripts (for s390).
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
2
3 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
4 * testsuite/script_test_12a.c: Likewise.
5 * testsuite/script_test_1a.cc: Likewise.
6 * testsuite/script_test_2.cc: Likewise.
7
8 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
9
10 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
11
12 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
13
14 PR gold/18959
15 * stringpool.cc (Stringpool_template::new_key_offset): Align all
16 strings, even zero-length.
17 (Stringpool_template::set_string_offsets): Likewise.
18
19 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
20
21 * s390.cc: New file.
22 * Makefile.am (TARGETSOURCES): Add s390.cc.
23 (ALL_TARGETOBJS): Add s390.o.
24 * Makefile.in: Regenerate.
25 * configure.ac: Add s390 support.
26 * configure: Regenerate.
27 * configure.tgt: Add s390-*-* and s390x-*-*.
28 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
29 support.
30
31 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
32
33 * archive.cc (Archive::sym64name): New const.
34 (Archive::setup): Add support for SYM64 armap.
35 (Archive::read_armap): Likewise.
36 (Archive::interpret_header): Likewise.
37 (Archive::const_iterator::read_next_header): Likewise.
38 * archive.h (Archive::sym64name): New const.
39 (Archive::read_armap): Add mapsize template parameter.
40
41 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
42
43 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
44 target-specific entry size.
45 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
46 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
47 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
48 hash_entry_size.
49 * target.h (Target::hash_entry_size): New method.
50 (Target::Target_info::hash_entry_size): New data member.
51
52 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
53 * arm.cc (Target_arm::arm_info): Likewise.
54 (Target_arm_nacl::arm_nacl_info): Likewise.
55 * i386.cc (Target_i386::i386_info): Likewise.
56 (Target_i386_nacl::i386_nacl_info): Likewise.
57 (Target_iamcu::iamcu_info): Likewise.
58 * mips.cc (Target_mips::mips_info): Likewise.
59 (Target_mips_nacl::mips_nacl_info): Likewise.
60 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
61 * sparc.cc (Target_sparc::sparc_info): Likewise.
62 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
63 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
64 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
65 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
66
67 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
68
69 PR gold/19177
70 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
71 and R_386_GOT32X relocations without base register.
72
73 2015-10.27 Han Shen <shenhan@google.com>
74
75 PR gold/19042 - unsupported reloc 311/312.
76
77 * aarch64.cc (Target_aarch64::Scan::local): Add support for
78 reloc 311/312.
79
80 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
81
82 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
83 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
84 as R_X86_64_GOTPCREL.
85 (Target_x86_64<size>::Scan::local): Likewise.
86 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
87 Likewise.
88 (Target_x86_64<size>::Scan::global): Likewise.
89 (Target_x86_64<size>::Relocate::relocate): Likewise.
90 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
91 Likewise.
92
93 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
94
95 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
96 R_386_GOT32X the same as R_386_GOT32.
97 (Target_i386::Scan::local): Likewise.
98 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
99 (Target_i386::Scan::global): Likewise.
100 (Target_i386::Relocate::relocate): Likewise.
101 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
102 Likewise.
103
104 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
105
106 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
107 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
108 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
109 x86_64_mov_to_lea1.o.
110 * testsuite/Makefile.in: Regenerated.
111
112 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
113
114 PR gold/19119
115 * options.h (General_options): Remove "obsolete" from -m.
116 * parameters.cc (set_parameters_target): Check if input target
117 is compatible with output emulation set by "-m emulation".
118
119 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
120
121 PR gold/19118
122 * i386.cc (Target_iamcu): New class.
123 (Target_selector_iamcu): Likewise.
124 (Target_iamcu::iamcu_info): New variable.
125 (target_selector_iamcu): Likewise.
126
127 2015-10-07 Andreas Schwab <schwab@suse.de>
128
129 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
130
131 2015-10-06 Cary Coutant <ccoutant@gmail.com>
132
133 PR gold/18855
134 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
135 parameter.
136 (Sparc_relocate_functions::gdop_lox10): Likewise.
137 (Target_sparc::Relocate::relocate): Use addend when computing
138 symbol value for R_SPARC_GOTDATA_OP*.
139
140 2015-09-07 Cary Coutant <ccoutant@gmail.com>
141
142 PR gold/18930
143 PR gold/18886
144 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
145 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
146
147 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
148
149 PR gold/18886
150 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
151 shared libraries into normal FUNC symbols.
152 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
153 symbols aren't from shared libraries.
154
155 2015-09-02 Alan Modra <amodra@gmail.com>
156
157 PR 18878
158 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
159 (Target_powerpc::Branch_info::make_stub): Determine whether long
160 branch stub is for save/restore function.
161 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
162 (Stub_table): Add need_save_res_.
163 (Stub_table:clear_stubs): Clear need_save_res_.
164 (Stub_table:set_address_and_size): Add save/restore section size.
165 (Stub_table::add_long_branch_entry): Add save_res param. Set
166 need_save_res_, but don't add space for save/restore stubs.
167 (Stub_table::find_long_branch_entry): Return offset to local copy
168 of save/restore func.
169 (Stub_table::do_write): Don't output save/restore stubs. Instead
170 copy the save/restore functions.
171 (Output_data_save_res:contents): New accessor.
172 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
173
174 2015-08-25 Cary Coutant <ccoutant@gmail.com>
175
176 PR gold/18847
177 * script-sections.cc (Memory_region::set_address): New method.
178 (Script_sections::find_memory_region): Add explicit_only parameter.
179 (Output_section_definition::set_section_addresses): Handle case where
180 script specifies both address and vma region.
181 * script-sections.h (Script_sections::find_memory_region): Add
182 explicit_only parameter.
183
184 2015-08-25 Cary Coutant <ccoutant@gmail.com>
185
186 PR gold/18859
187 * object.cc (Input_objects::add_object): Store objects in a map,
188 indexed by soname; update as-needed flag when necessary.
189 * object.h (Object::clear_as_needed): New method.
190 (Input_objects::so_names_): Change from set to map.
191
192 2015-08-25 Cary Coutant <ccoutant@gmail.com>
193
194 PR gold/14746
195 * expression.cc (Expression::Expression_eval_info): Add
196 is_valid_pointer field.
197 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
198 Adjust all callers.
199 (Addr_expression::value_from_output_section): Check whether address
200 is valid.
201 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
202 if evaluation failed due to address that is not yet valid.
203 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
204 parameter.
205
206 2015-08-25 Cary Coutant <ccoutant@gmail.com>
207
208 PR gold/18866
209 PR gold/18703
210 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
211
212 2015-08-20 Alan Modra <amodra@gmail.com>
213
214 PR gold/18846
215 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
216 Subtract os->address() from addend.
217 * powerpc.cc (relocate_relocs): Likewise.
218
219 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
220
221 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
222 lazy_stub_normal_1, lazy_stub_normal_1_n64,
223 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
224 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
225 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
226 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
227 of 'addu/daddu'.
228
229 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
230
231 * configure: Regenerated.
232
233 2015-07-26 Doug Kwan <dougkwan@google.com>
234
235 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
236 disassembler output format.
237
238 2015-07-23 Ian Coolidge <icoolidge@google.com>
239 Plumb --pic-veneer option for gold.
240
241 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
242 generation.
243 * options.h (General_options): Add --pic-veneer option.
244
245 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
246
247 PR gold/18663
248 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
249 script_test_1a.cc script_test_1b.cc.
250 (script_test_11_r.o): Replace script_test_11.o with
251 script_test_11a.o script_test_11b.o.
252 (script_test_11.o): Removed.
253 (script_test_11a.o): New.
254 (script_test_11b.o): Likewise.
255 * testsuite/Makefile.in: Regenerated.
256 * testsuite/script_test_1.h: New file.
257 * testsuite/script_test_1b.cc: Likewise.
258 * testsuite/script_test_11.h: Likewise.
259 * testsuite/script_test_11b.c: Likewise.
260 * testsuite/script_test_1.cc: Renamed to ...
261 * testsuite/script_test_1a.cc: This.
262 Include "script_test_1.h".
263 (main): Call check_int and check_ptr.
264 * testsuite/script_test_11.c: Renamed to ...
265 * testsuite/script_test_11a.c: This.
266 Include "script_test_11.h".
267 (main): Call ptr_equal.
268
269 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
270
271 PR gold/18628
272 * testsuite/ifuncdep2.c (global): Change protected to hidden.
273 * testsuite/ifuncmod1.c (global): Likewise.
274 * testsuite/ifuncmod5.c (global): Likewise.
275
276 2015-07-22 Alan Modra <amodra@gmail.com>
277
278 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
279
280 2015-07-21 Cary Coutant <ccoutant@gmail.com>
281
282 PR gold/18548
283 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
284 forced local symbol even when oldsym != NULL.
285 (Symbol_table::do_define_in_output_segment): Likewise.
286 (Symbol_table::do_define_as_constant): Likewise.
287
288 2015-07-21 Cary Coutant <ccoutant@gmail.com>
289
290 PR gold/18698
291 * archive.cc (Library_base::should_include_member): Don't use entry
292 point for relocatable links, or if target is not yet valid.
293 * parameters.cc (Parameters::entry): Check target_valid().
294
295 2015-07-20 Han Shen <shenhan@google.com>
296
297 Optimize erratum 843419 fix.
298
299 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
300 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
301 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
302 (E843419_stub): New sub-class of Erratum_stub.
303 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
304 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
305 (AArch64_relobj::create_erratum_stub): Add 1 argument.
306 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
307
308 2015-07-20 Han Shen <shenhan@google.com>
309
310 Fix arm elf header flags wrt hardfp bit.
311
312 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
313
314 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
315
316 PR gold/18689
317 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
318 from input group section for relocatable link.
319 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
320 (check_DATA): Add pr18689.stdout.
321 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
322 (pr18689.stdout): New rule.
323 (pr18689a.o): Likewise.
324 (pr18689b.o): Likewise.
325 (pr18689.o): Likewise.
326 * testsuite/pr18689.c: New file.
327 * testsuite/pr18689.sh: Likewise.
328 * testsuite/Makefile.in: Regenerated.
329
330 2015-07-20 Yiran Wang <yiran@google.com>
331 Cary Coutant <ccoutant@gmail.com>
332
333 PR gold/15574
334 * resolve.cc (Symbol_table): Remove warning about references
335 from shared objects to hidden symbols.
336 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
337 * testsuite/Makefile.in: Regenerate.
338 * testsuite/hidden_test.sh: Check dynamic symbol table; update
339 expected error messages.
340
341 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
342
343 * compressed_output.cc (Output_compressed_section::set_final_data_size):
344 Make --compress-debug-sections=zlib the same as
345 --compress-debug-sections=zlib-gabi.
346 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
347 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
348 ".zdebug_".
349 * testsuite/Makefile.in: Regenerated.
350
351 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
352
353 PR gold/18322
354 * compressed_output.cc (zlib_compress): Add argument for
355 compression header size. Set header size to compression header
356 size if it isn't 0. Don't write out the zlib header here.
357 (Output_compressed_section::set_final_data_size): Support
358 zlib-gnu and zlib-gabi compressions. Pass compression header
359 size to zlib_compress and write out compression header. Set
360 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
361 clear the SHF_COMPRESSED bit
362 * options.h (compress_debug_sections): Add zlib-gnu and
363 zlib-gabi.
364 * output.h (Output_section::set_flags): New.
365 * testsuite/Makefile.am (check_PROGRAMS): Add
366 flagstest_compress_debug_sections_none,
367 flagstest_compress_debug_sections_gnu and
368 flagstest_compress_debug_sections_gabi.
369 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
370 flagstest_compress_debug_sections.stdout,
371 flagstest_compress_debug_sections.cmp,
372 flagstest_compress_debug_sections.check,
373 flagstest_compress_debug_sections_gnu.stdout,
374 flagstest_compress_debug_sections_gnu.cmp,
375 flagstest_compress_debug_sections_gnu.check,
376 flagstest_compress_debug_sections_gabi.stdout,
377 flagstest_compress_debug_sections_gabi.cmp and
378 flagstest_compress_debug_sections_gabi.check.
379 (flagstest_compress_debug_sections_none): New.
380 (flagstest_compress_debug_sections_none.stdout): Likewise.
381 (flagstest_compress_debug_sections.stdout): Likewise.
382 (flagstest_compress_debug_sections.check): Likewise.
383 (flagstest_compress_debug_sections.cmp): Likewise.
384 (flagstest_compress_debug_sections_gnu): Likewise.
385 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
386 (flagstest_compress_debug_sections_gnu.check): Likewise.
387 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
388 (flagstest_compress_debug_sections_gabi): Likewise.
389 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
390 (flagstest_compress_debug_sections_gnu.check): Likewise.
391 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
392 * testsuite/Makefile.in: Regenerated.
393
394 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
395
396 PR gold/18321
397 * compressed_output.h (decompress_input_section): Add arguments
398 for ELF class, big endian and sh_flags.
399 * compressed_output.cc (decompress_input_section): Likewise.
400 Support the SHF_COMPRESSED section.
401 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
402 functions.
403 * plugin.h (Pluginobj): Likewise.
404 * layout.cc (Layout::get_output_section_flags): Also clear the
405 SHF_COMPRESSED bit.
406 * object.h (Compressed_section_info): Add flag to store sh_flags.
407 (Object): Add pure virtual elfsize and is_big_endian member
408 functions.
409 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
410 prefix here.
411 (build_compressed_section_map): Check SHF_COMPRESSED for
412 uncompressed size. Store sh_flags in Compressed_section_info.
413 Pass size, big_endian and sh_flags to decompress_input_section.
414 Skip the ".debug"/".zdebug" prefix when passing section name to
415 need_decompressed_section.
416 (Sized_relobj_file<size, big_endian>::do_find_special_section):
417 Don't check ".zdebug_*" sections.
418 (Object::decompressed_section_contents): Pass ELF class, big
419 endian and sh_flags to decompress_input_section.
420 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
421 Likewise.
422 * testsuite/Makefile.am (check_DATA): Add
423 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
424 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
425 gdb_index_test_2_gabi.stdout.
426 (debug_msg_cdebug_gabi.o): New.
427 (odr_violation1_cdebug_gabi.o): Likewise.
428 (odr_violation2_cdebug_gabi.o): Likewise.
429 (debug_msg_cdebug_gabi.err): Likewise.
430 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
431 (gdb_index_test_cdebug_gabi.o): Likewise.
432 (gdb_index_test_2_gabi): Likewise.
433 (gdb_index_test_2_gabi.stdout): Likewise.
434 * testsuite/gdb_index_test_2_gabi.sh: New file.
435 * testsuite/Makefile.in: Regenerated.
436
437 2015-07-09 Han Shen <shenhan@google.com>
438
439 Use "gold_info" instead of "gold_warning" for erratum fix.
440
441 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
442 'gold_info'.
443 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
444
445 2015-07-09 Han Shen <shenhan@google.com>
446
447 Drop missing symbol warning for arm/aarch64.
448
449 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
450 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
451 symbol warning.
452
453 2015-07-07 Han Shen <shenhan@google.com>
454
455 Make gold aarch64 accept long form of mapping symbols.
456
457 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
458 of mapping symbols.
459
460 2015-06-29 Doug Kwan <dougkwan@google.com>
461
462 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
463 at address expected by test.
464 * testsuite/arm_cortex_a8_b.s: Ditto.
465 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
466 * testsuite/arm_cortex_a8_bl.s: Ditto.
467 * testsuite/arm_cortex_a8_blx.s: Ditto.
468 * testsuite/arm_cortex_a8_local.s: Ditto.
469 * testsuite/arm_fix_v4bx.s: Ditto.
470 * testsuite/arm_unaligned_reloc.s: Ditto.
471 * testsuite/thumb_bl_out_of_range.s: Ditto.
472 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
473 * testsuite/thumb_blx_out_of_range.s: Ditto.
474
475 2015-06-29 Han Shen <shenhan@google.com>
476
477 Patch for erratum 843419 internal error.
478
479 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
480 (Erratum_stub::update_erratum_insn): New method.
481 (Stub_table::relocate_stubs): Modified to place relocated insn.
482 (AArch64_relobj::fix_errata): Modified gold_assert.
483
484 2015-06-12 Han Shen <shenhan@google.com>
485
486 Fix erratum 835769.
487
488 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
489 defintion outside class definition.
490 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
491 (AArch64_insn_utilities::aarch64_op31): New member.
492 (AArch64_insn_utilities::aarch64_ra): New member.
493 (AArch64_insn_utilities::aarch64_mac): New member.
494 (AArch64_insn_utilities::aarch64_mlxl): New member.
495 (ST_E_835769): New global enum member.
496 (Stub_table::relocate_stubs): Add 835769 handler.
497 (Stub_template_repertoire::Stub_template_repertoire): Install new
498 stub type.
499 (AArch64_relobj::scan_errata): This func is renamed from
500 scan_erratum_843419.
501 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
502 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
503 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
504 (Target_aarch64::scan_erratum_835769_span): New method.
505 (Target_aarch64::create_erratum_stub): New method.
506 (Target_aarch64::is_erratum_835769_sequence): New method.
507 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
508 code into create_erratum_stub.
509 * options.h (fix_cortex_a53_835769): New option.
510
511 2015-06-11 Cary Coutant <ccoutant@gmail.com>
512
513 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
514 outside class body.
515 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
516
517 2015-06-11 Cary Coutant <ccoutant@gmail.com>
518
519 PR gold/17731
520 * layout.cc (corresponding_uncompressed_section_name): New function.
521 (Layout::choose_output_section): Call it.
522 * layout.h (corresponding_uncompressed_section_name): New function.
523 * script-sections.cc (Input_section_info::set_section_name): Check
524 for compressed debug section (.zdebug style).
525
526 2015-06-11 Jing Yu <jingyu@google.com>
527
528 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
529 * testsuite/Makefile.in: Regenerate.
530
531 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
532
533 * gold.h (is_cident): Correct typo.
534
535 2015-06-10 Han Shen <shenhan@google.com>
536 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
537
538 Now fixing for 843419 is fully functional.
539
540 The first part of the erratum fix CL is here -
541 https://sourceware.org/ml/binutils/2015-04/msg00229.html
542
543 * aarch64.cc(global enum): New constants representing stub types.
544 (Stub_template): New POD struct.
545 (Stub_template_repertoire): New class.
546 (Stub_base): New class.
547 (Erratum_stub): New class.
548 (Reloc_stub): Refactored to be a subclass of Stub_base.
549 (Reloc_stub::Stub_type): Removed.
550 (Reloc_stub::offset): Moved to Stub_base.
551 (Reloc_stub::set_offset): Moved to Stub_base.
552 (Reloc_stub::destination_address): Moved to Stub_base.
553 (Reloc_stub::set_destination_address): Moved to Stub_base.
554 (Reloc_stub::reset_destination_address): Moved to Stub_base.
555 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
556 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
557 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
558 (Reloc_stub::write): Moved to Stub_base.
559 (Reloc_stub::invalid_offset): Moved to Stub_base.
560 (Reloc_stub::invalid_address): Moved to Stub_base.
561 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
562 (Reloc_stub::stub_insns_): Moved to Stub_base.
563 (Reloc_stub::offset_): Moved to Stub_base.
564 (Reloc_stub::destination_address_): Moved to Stub_base.
565 (Stub_table::The_aarch64_relobj): New typedef.
566 (Stub_table::The_erratum_stub): New typedef.
567 (Stub_table::The_erratum_stub_less): New typedef.
568 (Stub_table::The_erratum_stub_set): New typedef.
569 (Stub_table::The_erratum_stub_set_iter): New typedef.
570 (Stub_table::empty): Added emptiness testing for erratum stubs.
571 (Stub_table::add_erratum_stub): New method to add an erratum stub.
572 (Stub_table::find_erratum_stub): New method.
573 (Stub_table::find_erratum_stubs_for_input_section): New method.
574 (Stub_table::erratum_stub_address): New method.
575 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
576 (Stub_table::do_addralign): Modified to handle erratum stubs.
577 (Stub_table::erratum_stubs_): New member.
578 (Stub_table::erratum_stub_size_): New member.
579 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
580 (Stub_table::do_write): Modified to handle erratum stubs.
581 (AArch64_relobj::The_erratum_stub): New typedef.
582 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
583 (AArch64_relobj::fix_errata): New method.
584 (Target_aarch64::The_reloc_stub_type): Removed.
585 (Target_aarch64::The_erratum_stub): New typede.
586 (AArch64_relocate_functions::construct_b): New method.
587
588 2015-06-08 Nick Clifton <nickc@redhat.com>
589
590 * po/fr.po: New French Translation.
591
592 2015-06-07 Cary Coutant <ccoutant@gmail.com>
593
594 PR gold/18288
595 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
596 callers. Don't use STT_COMMON to check for common symbols.
597 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
598 symbol that's not in a common section.
599 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
600 common symbols.
601
602 2015-06-04 Cary Coutant <ccoutant@gmail.com>
603
604 PR gold/18200
605 * Makefile.am (diststuff): Add target.
606 * Makefile.in: Regenerate.
607
608 2015-06-04 Cary Coutant <ccoutant@gmail.com>
609
610 PR gold/17498
611 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
612 temporary locals in merge sections.
613 * options.cc (General_options::parse_discard_all): New method.
614 (General_options::parse_discard_locals): New method.
615 (General_options::parse_discard_none): New method.
616 (General_options::General_options): Initialize discard_locals_.
617 * options.h (--discard-all): Convert to special option.
618 (--discard-locals): Likewise.
619 (--discard-none): New option.
620 (General_options::discard_all): New method.
621 (General_options::discard_locals): New method.
622 (General_options::discard_sec_merge): New method.
623 (General_options::Discard_locals): New enum.
624 (General_options::discard_locals_): New data member.
625
626 2015-06-03 Cary Coutant <cary@google.com>
627
628 * script-sections.cc (Script_sections::Script_sections): Initialize
629 segments_created_.
630 (Script_sections::create_note_and_tls_segments): Set flag when
631 segments are created.
632 (Script_sections::expected_segment_count): Count PT_INTERP.
633 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
634 segments are created.
635 * script-sections.h (Script_sections::segments_created_): New data
636 member.
637
638 2015-06-03 Cary Coutant <ccoutant@gmail.com>
639
640 PR gold/15370
641 * script-sections.cc
642 (Output_section_element_input::set_section_addresses): When there
643 are several patterns with no sort spec, put all sections in the same
644 bin.
645 * testsuite/Makefile.am (script_test_12): New testcase.
646 (script_test_12i): New testcase.
647 * testsuite/Makefile.in: Regenerate.
648 * testsuite/script_test_12.t: New test linker script.
649 * testsuite/script_test_12i.t: New test linker script.
650 * testsuite/script_test_12a.c: New test source file.
651 * testsuite/script_test_12b.c: New test source file.
652
653 2015-06-02 Cary Coutant <ccoutant@gmail.com>
654
655 * nacl.h (Sniff_file): Switch parameters to get_view to get an
656 aligned view.
657
658 2015-06-03 Cary Coutant <ccoutant@gmail.com>
659
660 PR gold/17819
661 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
662 separate task to schedule the build id computation.
663 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
664 add Output_file and offset.
665 (Hash_task::run): Get and release the input views.
666 (Hash_task::is_runnable): Always return NULL (always runnable).
667 (Layout::queue_build_id_tasks): Remove.
668 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
669 parameters; use them instead of class members.
670 (Build_id_task_runner::run): New function.
671 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
672 to write_build_id.
673 * layout.h (Layout::queue_build_id_tasks): Remove.
674 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
675 parameters.
676 (Layout::array_of_hashes_): Remove.
677 (Layout::size_of_array_of_hashes_): Remove.
678 (Layout::input_view_): Remove.
679 (Build_id_task_runner): New class.
680 (Close_task_runner::Close_task_runner): Add array_of_hashes and
681 size_of_hashes parameters.
682 (Close_task_runner::array_of_hashes_): New data member.
683 (Close_task_runner::size_of_hashes_): New data member.
684 * testsuite/Makefile.am
685 (flagstest_compress_debug_sections_and_build_id_tree): New test.
686 * testsuite/Makefile.in: Regenerate.
687
688 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
689
690 * merge.cc (get_input_merge_map): Update for data structure change.
691 (get_or_make_input_merge_map): Update for data structure change.
692 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
693 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
694
695 2015-05-16 Alan Modra <amodra@gmail.com>
696
697 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
698 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
699 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
700 (lis_0): Rename from lis_0_0.
701
702 2015-04-29 Cary Coutant <cary@google.com>
703 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
704
705 * gc.h (Garbage_collection::is_section_garbage): Change Object*
706 to Relobj*.
707 (Garbage_collection::add_reference): Likewise.
708 (Garbage_collection::gc_process_relocs): Likewise. Don't push
709 object/shndx pair onto *secvec for dynamic objects. Don't follow
710 relocations pointing to dynamic objects for GC.
711 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
712 (Icf::unfold_section): Likewise.
713 (Icf::is_section_folded): Likewise.
714 (Icf::get_folded_section): Likewise.
715 * icf.h: (Icf::get_folded_section): Likewise.
716 (Icf::unfold_section): Likewise.
717 (Icf::is_section_folded): Likewise.
718 (Icf::section_has_function_pointers): Likewise.
719 (Icf::set_section_has_function_pointers): Likewise.
720 * object.h (Section_id): Likewise.
721 (Const_section_id): Likewise.
722 * output.cc (Output_section::update_section_layout): Likewise.
723 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
724 Likewise.
725 * plugin.cc (update_section_order): Likewise.
726 (unique_segment_for_sections): Likewise.
727 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
728 (Target_powerpc::do_gc_add_reference): Likewise.
729 (Target_powerpc::gc_process_relocs): Likewise.
730 (Target_powerpc::do_gc_add_reference): Likewise.
731 * symtab.cc (Symbol_table::is_section_folded): Likewise.
732 (Symbol_table::gc_mark_symbol): Likewise.
733 * symtab.h: (Symbol_table::is_section_folded): Likewise.
734 * target.h: (Sized_target::gc_add_reference): Likewise.
735 (Sized_target::do_gc_add_reference): Likewise.
736
737 2015-04-29 Nick Clifton <nickc@redhat.com>
738
739 * po/fi.po: Updated Finnish translation.
740
741 2015-04-28 Alan Modra <amodra@gmail.com>
742
743 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
744 than unsigned int for find_global_entry result temp. Compare
745 against invalid_address.
746 (Target_powerpc::do_plt_address_for_global): Likewise.
747 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
748 on plt call stub existence for debug info. Do assert for plt
749 and global entry stub existence if an alloc section.
750
751 2015-04-28 Alan Modra <amodra@gmail.com>
752
753 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
754 on missing global entry stub due to bogus debug info.
755
756 2015-04-27 Han Shen <shenhan@google.com>
757
758 * options.h (--fix-cortex-a53-843419): Rename option.
759 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
760 option.
761 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
762
763 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
764
765 PR gold/18327
766 * output.cc (Output_section::is_input_address_mapped): Assume a missing
767 entry is mapped.
768 * testsuite/Makefile.am: Add the eh_test test.
769 * testsuite/Makefile.in: Regenerate.
770 * testsuite/eh_test_a.cc: New test.
771 * testsuite/eh_test_b.cc: New test.
772
773 2015-04-23 Sriraman Tallam <tmsriram@google.com>
774
775 * options.h (--weak-unresolved-symbols): New option.
776 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
777 binding to weak with new option.
778 * symtab.h (is_weak_undefined): Check for new option.
779 (is_strong_undefined): Check for new option.
780 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
781 * testsuite/Makefile.in: Regenerate.
782 * testsuite/weak_unresolved_symbols_test.cc: New file.
783
784 2015-04-20 Ian Coolidge <icoolidge@google.com>
785
786 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
787 GNU_UNIQUE.
788
789 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
790
791 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
792 push_back.
793 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
794 * object.cc (Sized_relobj_file::do_layout): Use push_back.
795 * powerpc.cc (process_gc_mark): Use push_back.
796 (Target_powerpc::do_gc_mark_symbol): Use push_back.
797 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
798
799 2015-04-16 Han Shen <shenhan@google.com>
800
801 * aarch64.cc (AArch64_insn_utilities): New utility class.
802 (AArch64_relobj::Mapping_symbol_position): New struct.
803 (AArch64_relobj::Mapping_symbol_info): New typedef.
804 (AArch64_relobj::do_count_local_symbols): New function overriding
805 parent's implementation.
806 (AArch64_relobj::mapping_symbol_info_): New member
807 (AArch64_relobj::scan_erratum_843419): New method.
808 (Target_aarch64::scan_erratum_843419_span): New method.
809 (Target_aarch64::is_erratum_843419_sequence): New method.
810 * options.h (fix_cortex_a53): New option.
811
812 2015-04-09 Cary Coutant <ccoutant@google.com>
813
814 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
815 in a PIE link.
816 * testsuite/Makefile.am (tls_pie_test.sh): New test.
817 * testsuite/Makefile.in: Regenerate.
818 * testsuite/tls_pie_test.sh: New.
819
820 2015-04-09 Cary Coutant <ccoutant@google.com>
821
822 * debug.h (DEBUG_LOCATION): New.
823 (DEBUG_ALL): Include DEBUG_LOCATION.
824 (debug_string_to_enum): Add DEBUG_LOCATION.
825 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
826 output to print correct context.
827 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
828 up to 4 more locations at the beginning of the function.
829 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
830 result before sorting list of line numbers.
831 * testsuite/debug_msg.sh: Allow range of line numbers for
832 canonical results on optimized code.
833
834 2015-04-07 HC Yen <hc.yen@mediatek.com>
835
836 Add AArch32 support for gold linker.
837 gold/
838 * arm.cc: Add V8 arch combine table.
839
840 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
841
842 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
843
844 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
845
846 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
847 to find by using the return value of insert.
848
849 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
850
851 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
852 constructor call.
853
854 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
855
856 PR gold/17641
857 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
858 (Target_x86_64::Scan::local): Don't create GOT entry, when we
859 can convert mov to lea.
860 (Target_x86_64::Scan::global): Ditto.
861 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
862 %reg to lea foo(%rip), %reg if possible.
863 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
864 * testsuite/x86_64_mov_to_lea1.s: New.
865 * testsuite/x86_64_mov_to_lea2.s: Ditto.
866 * testsuite/x86_64_mov_to_lea3.s: Ditto.
867 * testsuite/x86_64_mov_to_lea4.s: Ditto.
868 * testsuite/x86_64_mov_to_lea.sh: Ditto.
869
870 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
871
872 * configure: Regenerated.
873
874 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
875
876 PR gold/17640
877 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
878 (Target_i386::Scan::local): Don't create GOT entry, when we
879 can convert GOT to GOTOFF.
880 (Target_i386::Scan::global): Ditto.
881 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
882 lea foo@GOTOFF(%reg), %reg if possible.
883 * testsuite/Makefile.am (i386_mov_to_lea): New test.
884 * testsuite/i386_mov_to_lea1.s: New.
885 * testsuite/i386_mov_to_lea2.s: Ditto.
886 * testsuite/i386_mov_to_lea3.s: Ditto.
887 * testsuite/i386_mov_to_lea4.s: Ditto.
888 * testsuite/i386_mov_to_lea5.s: Ditto.
889 * testsuite/i386_mov_to_lea.sh: Ditto.
890
891 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
892
893 * Makefile.am (ZLIB): New.
894 (ZLIBINC): Likewise.
895 (AM_CFLAGS): Add $(ZLIBINC).
896 (AM_CXXFLAGS): Likewise.
897 (ldadd_varldadd_var): Add $(ZLIB).
898 (incremental_dump_LDADD): Likewise.
899 (dwp_LDADD): Likewise.
900 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
901 <zlib.h>.
902 (zlib_compress): Don't check HAVE_ZLIB_H.
903 (zlib_decompress): Likewise.
904 * options.h (compress_debug_sections): Likewise.
905 * configure.ac (AM_CONDITIONAL): Removed.
906 * testsuite/Makefile.am (ZLIB): New.
907 (LDADD): Add $(ZLIB).
908 Don't check HAVE_ZLIB.
909 * Makefile.in: Regenerated.
910 * config.in: Likewise.
911 * configure: Likewise.
912 * testsuite/Makefile.in: Likewise.
913
914 2015-03-30 Jing Yu <jingyu@google.com>
915
916 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
917 TLSLD_ADD_DTPREL_LO12_NC.
918 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
919 _TLS_MODULE_BASE_ point to the start of tls segment.
920 (Target_aarch64::optimize_tls_reloc): Add cases for
921 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
922 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
923 (Target_aarch64::Scan::local): Likewise.
924 (Target_aarch64::Scan::global): Likewise.
925 (Target_aarch64::Relocate::relocate): Likewise.
926 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
927 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
928 relocations.
929
930 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
931
932 * merge.cc (Object_merge_map::add_mapping): call
933 Object_merge_map::Input_merge_map::add_mapping.
934 (Object_merge_map::Input_merge_map::add_mapping): New.
935 (Output_merge_data::do_add_input_section): Call
936 get_or_make_input_merge_map before a loop.
937 (Output_merge_string<Char_type>::finalize_merged_data): Call
938 get_or_make_input_merge_map before a loop.
939 * merge.h (Object_merge_map): Make Input_merge_map public.
940 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
941 (Relobj::get_or_create_merge_map): New.
942 * object.h (Relobj::get_or_create_merge_map): New.
943
944 2015-03-24 Alan Modra <amodra@gmail.com>
945
946 PR 18147
947 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
948 relocation errors for branches to strong undefined symbols.
949
950 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
951
952 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
953 (Object_merge_map::is_merge_section_for): Remove.
954 (Object_merge_map::find_merge_section): New.
955 * merge.h (Object_merge_map::is_merge_section_for): Remove.
956 (Object_merge_map::find_merge_section): New.
957 (Object_merge_map::get_input_merge_map): Add a const version.
958 * object.cc (Relobj::is_merge_section_for): Remove.
959 (Relobj::find_merge_section): New.
960 * object.h (Relobj::is_merge_section_for): Remove.
961 (Relobj::find_merge_section): New.
962 * output.cc
963 (Output_section::Input_section::is_merge_section_for): Remove.
964 (Output_section::add_merge_input_section): Don't call
965 add_merge_input_section.
966 (Output_section::find_merge_section): Return const. Use
967 object->find_merge_section.
968 (Output_section::build_lookup_maps): Don't build a map for
969 merge sections.
970 (Output_section::is_input_address_mapped): Return false if
971 section is not found.
972 (Output_section::find_starting_output_address): Use
973 find_merge_section instead of is_merge_section_for.
974 (Output_section::add_script_input_section): Don't build a map for
975 merge sections.
976 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
977 (Output_section_lookup_maps::find_merge_section): Remove.
978 (Output_section_lookup_maps::add_merge_input_section) Remove.
979 (Output_section::find_merge_section): Return const.
980
981 2015-03-22 Cary Coutant <cary@google.com>
982
983 PR gold/18106
984 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
985 non-SIB form of lea, with nop after the call.
986
987 2015-03-21 Cary Coutant <cary@google.com>
988
989 PR gold/14217
990 * output.cc (Output_segment::is_first_section_relro): Don't ignore
991 .tdata section.
992 (Output_segment::set_section_addresses): Don't align size of relro
993 segment for .tbss.
994
995 2015-03-21 Cary Coutant <cary@google.com>
996
997 PR gold/18010
998 * stringpool.cc (Stringpool_template): Don't optimize if section
999 alignment is greater than sizeof(char).
1000
1001 2015-03-21 Cary Coutant <cary@google.com>
1002
1003 PR gold/18048
1004 * script-c.h (script_include_directive): Add first_token parameter.
1005 * script.cc (script_include_directive): Add first_token parameter, and
1006 pass it to read_script_file.
1007 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1008 (PARSING_MEMORY_DEF): New tokens.
1009 (top): Add new productions for INCLUDE files.
1010 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1011 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1012 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1013 (section_cmd): Pass PARSING_SECTION_CMDS.
1014 (file_or_sections_cmd): Remove.
1015 (memory_def): Pass PARSING_MEMORY_DEF.
1016 * testsuite/Makefile.am (memory_test_2): New test.
1017 * testsuite/Makefile.in: Regenerate.
1018 * testsuite/memory_test_inc.t: New script file.
1019 * testsuite/memory_test_inc_1.t.src: New script file.
1020 * testsuite/memory_test_inc_2.t.src: New script file.
1021 * testsuite/memory_test_inc_3.t.src: New script file.
1022
1023 2015-03-21 Cary Coutant <cary@google.com>
1024
1025 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1026 (Sized_relobj_dwo::setup): Build compressed section map.
1027 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1028 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1029 section map.
1030 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1031 compressed_sections_ field.
1032 (build_compressed_section_map): Take Object instead of
1033 Sized_relobj_file parameter; add decompress_if_needed parameter.
1034 (Sized_relobj_file::do_find_special_sections): Store compressed
1035 section map in parent Object.
1036 (Sized_relobj_file::do_decompressed_section_contents): Move
1037 implementation to Object::decompressed_section_contents.
1038 (Sized_relobj_file::do_discard_decompressed_sections): Move
1039 implementation to Object::discard_decompressed_sections.
1040 * object.h (build_compressed_section_map): Declare.
1041 (Object::Object): Add compressed_sections_ field.
1042 (Object::section_is_compressed): Move implementation here.
1043 (Object::decompressed_section_contents): De-virtualize.
1044 (Object::discard_decompressed_sections): De-virtualize.
1045 (Object::do_section_is_compressed): Delete.
1046 (Object::do_decompressed_section_contents): Delete.
1047 (Object::set_compressed_sections): New method.
1048 (Object::compressed_sections): New method.
1049 (Object::compressed_sections_): New data member.
1050 (Compressed_section_info, Compressed_section_map): Move to top of file.
1051 (Sized_relobj_file::do_section_is_compressed): Delete.
1052 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1053 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1054 (Sized_relobj_file::compressed_sections_): Move to Object class.
1055
1056 2015-03-21 Cary Coutant <ccoutant@google.com>
1057
1058 PR gold/18152
1059 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1060 deferred objects.
1061
1062 2015-03-11 Cary Coutant <ccoutant@google.com>
1063
1064 * options.cc (General_options::finalize): Don't allow -z relro
1065 with incremental linking.
1066 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1067 (incremental_test_2): Likewise.
1068 (incremental_test_3): Likewise.
1069 (incremental_test_4): Likewise.
1070 (incremental_test_5): Likewise.
1071 (incremental_test_6): Likewise.
1072 (incremental_copy_test): Likewise.
1073 (incremental_common_test_1): Likewise.
1074 (incremental_comdat_test_1): Likewise.
1075 * testsuite/Makefile.in: Regenerate.
1076
1077 2015-03-09 Cary Coutant <ccoutant@google.com>
1078
1079 PR gold/14675
1080 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1081 return enum indicating whether .eh_frame section is empty, optimizable,
1082 unrecognized, or an end marker. Adjust explicit instantiations.
1083 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1084 (Eh_frame::add_ehframe_input_section): Change return type.
1085 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1086 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1087 to the .eh_frame output section until we see the end marker.
1088 (Layout::finalize_eh_frame_section): New.
1089 * layout.h: (Layout::finalize_eh_frame_section): New.
1090
1091 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1092
1093 * output.cc (Relobj::initialize_input_to_output_map<size>):
1094 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1095
1096 2015-03-04 Cary Coutant <ccoutant@google.com>
1097
1098 * parameters.cc (Parameters::set_target_once): Call
1099 Target::select_as_default_target just once from here...
1100 (set_parameters_target): ...instead of from here.
1101
1102 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1103
1104 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1105 Output_section_data instead of a Merge_map.
1106 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1107 (Eh_frame::read_cie): Use add_merge_mapping instead of
1108 Merge_map::add_mapping.
1109 (Eh_frame::read_fde): Ditto.
1110 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1111 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1112 merge_map_->get_output_offset.
1113 (Eh_frame::do_is_merge_section_for): Delete.
1114 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1115 instead of a Merge_map.
1116 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1117 Merge_map.
1118 (Eh_frame::do_is_merge_section_for): Delete.
1119 (Eh_frame::merge_map_): Delete.
1120 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1121 and use a Output_section_data instead of a Merge_map.
1122 (Object_merge_map::add_mapping): Ditto.
1123 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1124 (Object_merge_map::is_merge_section_for): Pass in and use a
1125 Output_section_data instead of a Merge_map.
1126 (Merge_map): Delete.
1127 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1128 of merge_map_.get_output_offset.
1129 (Output_merge_base::do_is_merge_section_for): Delete.
1130 (Output_merge_data::do_add_input_section): Use
1131 object->add_merge_mapping instead of add_mapping.
1132 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1133 * merge.h (Merge_map): Delete forward declaration.
1134 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1135 instead of a Merge_map.
1136 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1137 (Object_merge_map::is_merge_section_for): Pass in and use a
1138 Output_section_data instead of a Merge_map.
1139 (Input_merge_map::Object_merge_map::merge_map): Replace with
1140 output_data.
1141 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1142 Output_section_data instead of a Merge_map.
1143 (Merge_map): Delete.
1144 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1145 (Output_merge_base::do_is_merge_section_for): Delete.
1146 (Output_merge_base::add_mapping): Delete.
1147 (Output_merge_base::merge_map_): Delete.
1148 * object.cc (Relobj::initialize_input_to_output_map): New.
1149 (Relobj::initialize_input_to_output_map): New.
1150 (Relobj::merge_output_offset): New.
1151 (Relobj::is_merge_section_for): New.
1152 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1153 bits.
1154 * object.h (Relobj::merge_map): Delete.
1155 (initialize_input_to_output_map): New.
1156 (set_merge_map): Delete.
1157 (add_merge_mapping): New.
1158 (merge_output_offset): New.
1159 (is_merge_section_for): New.
1160 * output.cc (Output_section::Input_section::is_merge_section_for):
1161 Use object->is_merge_section_for.
1162 * output.h (Output_section_data::is_merge_section_for): Delete.
1163 (Output_section_data::do_is_merge_section_for): Delete.
1164 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1165 Use object->initialize_input_to_output_map.
1166 (Merged_symbol_value<size>::value_from_output_section): Use
1167 object->merge_output_offset.
1168
1169 2015-03-02 Peter Collingbourne <pcc@google.com>
1170 Cary Coutant <ccoutant@google.com>
1171
1172 * output.cc (Output_section::add_merge_input_section): Do not
1173 attempt to merge sections with an entsize of 0.
1174
1175 2015-03-02 Khem Raj <raj.khem@gmail.com>
1176
1177 * attributes.h (class Output_attributes_section_data ): Add
1178 do_print_to_mapfile function.
1179
1180 2015-02-24 Alan Modra <amodra@gmail.com>
1181
1182 PR 18010
1183 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1184 complain if value is not a multiple of four.
1185 (Target_powerpc::Relocate::relocate): Correct handling of
1186 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1187
1188 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1189
1190 * configure.ac (default_size): Set to 32 for x32.
1191 * configure: Regenerated.
1192
1193 2015-02-18 Alan Modra <amodra@gmail.com>
1194
1195 PR 17954
1196 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1197 visibility.
1198
1199 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1200
1201 * gc.h (Garbage_collection::add_reference): Don't use find.
1202
1203 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1204
1205 * object.cc (write_local_symbols): avoid std::vector copy.
1206
1207 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1208
1209 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1210
1211 2015-02-09 Mark Wielaard <mjw@redhat.com>
1212
1213 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1214 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1215
1216 2015-02-16 Cary Coutant <ccoutant@google.com>
1217
1218 PR gold/13577
1219 PR gold/16992
1220 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1221 DF_SYMBOLIC if --dynamic-list option is used.
1222 * options.cc (General_options::finalize): --dynamic-list is not
1223 mutually exclusive with -Bsymbolic.
1224 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1225 listed in --dynamic-list.
1226 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1227 -Bsymbolic-functions.
1228 * testsuite/Makefile.in: Regenerate.
1229
1230 2015-02-16 Cary Coutant <ccoutant@google.com>
1231
1232 PR gold/17971
1233 * incremental.cc: Remove redundant include of "output.h".
1234
1235 2015-02-12 Jing Yu <jingyu@google.com>
1236
1237 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1238 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1239 New relocation.
1240 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1241 TLSLE_MOVW_* relocations.
1242 (Target_aarch64::Scan::global): Likewise.
1243 (Target_aarch64::Relocate::relocate): Likewise.
1244 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1245 for new TLSLE_MOVW_* relocations.
1246
1247 2015-02-11 Will Newton <will.newton@linaro.org>
1248
1249 PR gold/13321
1250 * arm.cc (Target_arm::make_plt_section): Create an ARM
1251 state mapping symbol at the start of the PLT.
1252
1253 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1254
1255 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1256 Replace two_file_shared_2.so with two_file_shared_1.so.
1257 * testsuite/Makefile.in: Regenerated.
1258
1259 2015-02-09 Alan Modra <amodra@gmail.com>
1260
1261 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1262 plugin_test_thin.a and defsym_test.
1263 * testsuite/Makefile.in: Regenerate.
1264
1265 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1266
1267 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1268 body.
1269
1270 2015-02-04 Peter Collingbourne <pcc@google.com>
1271
1272 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1273 forwarding symbols when computing symbol resolution info for plugins.
1274 * plugin.h (Plugin_manager::symtab): New method.
1275 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1276
1277 2015-02-03 Cary Coutant <ccoutant@google.com>
1278 Peter Collingbourne <pcc@google.com>
1279
1280 PR gold/15660
1281 * archive.cc (Thin_archive_object_unlocker): New class.
1282 (Archive::include_member): Unlock external members of thin archives.
1283 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1284 (plugin_test_2): Likewise.
1285 (plugin_test_3): Likewise.
1286 (plugin_test_4): Likewise.
1287 (plugin_test_5): Likewise.
1288 (plugin_test_6): Likewise.
1289 (plugin_test_7): Likewise.
1290 (plugin_test_8): Likewise.
1291 (plugin_test_9): Likewise.
1292 (plugin_test_10): Likewise.
1293 (plugin_test_11): New test case.
1294 * testsuite/Makefile.in: Regenerate.
1295 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1296 file to decide whether to claim file.
1297 (all_symbols_read_hook): Likewise.
1298 * testsuite/plugin_test_1.sh: Adjust expected output.
1299 * testsuite/plugin_test_2.sh: Likewise.
1300 * testsuite/plugin_test_3.sh: Likewise.
1301 * testsuite/plugin_test_6.sh: Likewise.
1302 * testsuite/plugin_test_tls.sh: Likewise.
1303 * testsuite/plugin_test_11.sh: New testcase.
1304
1305 2015-02-03 Cary Coutant <ccoutant@google.com>
1306
1307 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1308 file descriptors when debugging enabled. Add debug output.
1309 (Descriptors::release): Add debug output.
1310 (Descriptors::close_some_descriptor): Likewise.
1311 (Descriptors::close_all): Likewise.
1312 * fileread.cc (File_read::lock): Likewise.
1313 (File_read::unlock): Likewise.
1314
1315 2015-02-02 Cary Coutant <ccoutant@google.com>
1316
1317 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1318 executable output file.
1319
1320 2015-01-22 Han Shen <shenhan@google.com>
1321
1322 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1323 (Target_arm::do_plt_address_for_global): New method.
1324 (Target_arm::do_plt_address_for_local): New method.
1325 (Target_arm::rel_irelative_section): New method.
1326 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1327 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1328 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1329 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1330 (Target_arm::Scan::check_non_pic): Add ifunc support.
1331 (Target_arm::Scan::local): Add ifunc support.
1332 (Target_arm::Scan::global): Add ifunc support.
1333 (Target_arm::make_plt_section): New method.
1334 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1335 (Target_arm::make_local_ifunc_plt_entry): New method.
1336 (Target_arm::got_irelative_): New member.
1337 (Target_arm::rel_irelative_): New member.
1338 (Target_arm::got_section): Add creation for got_irelative_.
1339 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1340 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1341 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1342 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1343 (Output_data_plt_arm::IRelative_data): New type.
1344 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1345 (Output_data_plt_arm::add_entry): Add more parameters.
1346 (Output_data_plt_arm::add_relocation): New method.
1347 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1348 (Output_data_plt_arm::rel_irelative): New method.
1349 (Output_data_plt_arm::entry_count): Modified.
1350 (Output_data_plt_arm::address_for_global): New method.
1351 (Output_data_plt_arm::address_for_local): New method.
1352 gold/
1353 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1354 (Output_data_plt_arm::insert_irelative_data): New method.
1355 (Output_data_plt_arm::irelative_rel_): New member.
1356 (Output_data_plt_arm::got_): New member.
1357 (Output_data_plt_arm::got_irelative_): New member.
1358 (Output_data_plt_arm::irelative_count_): New member.
1359 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1360 (Output_data_plt_arm::irelative_data_vec_): New member.
1361 (Output_data_plt_arm::do_write): Write out irelative entries.
1362 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1363 more parameters to ctor.
1364 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1365 more parameters to ctor.
1366 * output.h (Output_data_reloc::add_local_relative): New method.
1367 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1368
1369 2015-01-29 Alan Modra <amodra@gmail.com>
1370
1371 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1372 and GOT_TLSGD to LE optimization.
1373
1374 2015-01-28 Cary Coutant <ccoutant@google.com>
1375
1376 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1377 for undef TLS symbols.
1378 (Target_x86_64::Relocate::relocate_tls): Likewise.
1379 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1380
1381 2015-01-25 Cary Coutant <ccoutant@google.com>
1382
1383 * output.cc (Output_segment::set_section_addresses): Fix calculation
1384 of size of relro segment.
1385
1386 2015-01-22 Alan Modra <amodra@gmail.com>
1387
1388 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1389 condition for need of ifunc plt entry.
1390 (Target_powerpc::Scan::global <got relocs>): Likewise.
1391
1392 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1393
1394 * mips.cc (reloc_high): Add r_sym.
1395 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1396 reloc_high constructor.
1397 (Mips_relocate_functions::relgot16_local): Likewise.
1398 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1399 r_type to decide whether LO16 matches HI16.
1400 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1401 rello16 and relgot16_local.
1402
1403 2015-01-09 Cary Coutant <ccoutant@google.com>
1404
1405 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1406 unless alignment is larger than page size.
1407
1408 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1409 Cary Coutant <ccoutant@google.com>
1410
1411 PR gold/17729
1412 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1413 (DEFAULT_TARGET_X32): Set for x32.
1414 * x86_64.cc (cmp_insn_32): New.
1415 (lea_r10_insn_32): Likewise.
1416 (lea_r11_insn_32): Likewise.
1417 (cmp_insn_64): Likewise.
1418 (lea_r10_insn_64): Likewise.
1419 (lea_r11_insn_64): Likewise.
1420 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1421 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1422 (check_DATA): Add split_x32 files.
1423 (split_x32_[1234n].o): New targets.
1424 (split_x32_[124]): New targets.
1425 (split_x32_[1234r].stdout): New targets.
1426 * testsuite/split_x32.sh: New file.
1427 * testsuite/split_x32_1.s: Likewise.
1428 * testsuite/split_x32_2.s: Likewise.
1429 * testsuite/split_x32_3.s: Likewise.
1430 * testsuite/split_x32_4.s: Likewise.
1431 * testsuite/split_x32_n.s: Likewise.
1432 * configure: Regenerated.
1433 * testsuite/Makefile.in: Likewise.
1434
1435 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1436
1437 PR gold/17809
1438 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1439 x32.
1440
1441 2015-01-02 Alan Modra <amodra@gmail.com>
1442
1443 * version.cc (print_version): Just print current year.
1444 * dwp.cc (print_version): Likewise.
1445
1446 2015-01-01 Alan Modra <amodra@gmail.com>
1447
1448 Update year range in copyright notice of all files.
1449
1450 2014-12-25 Alan Modra <amodra@gmail.com>
1451
1452 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1453 new enums.
1454 (Target_arm::merge_object_attributes, ): Likewise.
1455
1456 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1457
1458 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1459 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1460 AEABI_VFP_args_vfp to check that.
1461 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1462 value and replace hardcoded values by enum values.
1463
1464 2014-12-22 Cary Coutant <ccoutant@google.com>
1465
1466 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1467
1468 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1469
1470 PR gold/14608
1471 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1472 to "return i * i * 3;".
1473
1474 2014-12-16 Cary Coutant <ccoutant@google.com>
1475
1476 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1477 (Mapfile::print_output_data): Use current_data_size() to avoid
1478 assert for sections requiring postprocessing; if address is not valid,
1479 print 0.
1480 (Mapfile::print_output_section): Use current_data_size(); print note
1481 that addresses and sizes are before compression.
1482
1483 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1484
1485 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1486 Cast current_group_size to unsigned long when reporting error.
1487
1488 2014-12-10 Jing Yu <jingyu@google.com>
1489
1490 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1491 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1492 Update error message.
1493 (Target_aarch64::do_relax): Use absolute value of option
1494 stub_group_size. Replace local variable with class member
1495 stub_group_size_.
1496
1497 2014-12-04 Alan Modra <amodra@gmail.com>
1498
1499 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1500 addend of PLTREL24 reloc when not generating a plt stub. Make
1501 max_branch_offset an "Address".
1502 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1503 (Target_powerpc::Relocate::relocate): Likewise.
1504
1505 2014-12-04 Alan Modra <amodra@gmail.com>
1506
1507 PR 17670
1508 * symtab.cc (Symbol::set_undefined): Remove assertion.
1509 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1510 on symbols defined in discarded sections, instead return false.
1511 Rearrange params, update all callers.
1512 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1513 branches to syms in discarded sections.
1514 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1515 undefined and flag as discarded.
1516 (Target_powerpc::Relocate::relocate): Localize variable.
1517
1518 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1519
1520 PR gold/17675
1521 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1522 * testsuite/Makefile.in: Regenerated.
1523
1524 2014-12-03 Alan Modra <amodra@gmail.com>
1525
1526 PR 17566
1527 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1528 when adding dynamic relocations against section symbols.
1529
1530 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1531
1532 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1533 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1534 * options.h (General_options): New -z option (global).
1535
1536 2014-12-01 Cary Coutant <ccoutant@google.com>
1537
1538 PR gold/17578
1539 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1540 is given.
1541 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1542 given but some inputs require executable stack.
1543
1544 2014-11-26 Cary Coutant <ccoutant@google.com>
1545
1546 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1547 .debug_str_offsets; strip .debug_gnu_pubnames and
1548 .debug_gnu_pubtypes.
1549 (lines_only_debug_sections): Strip all four new sections.
1550
1551 2014-11-26 Jing Yu <jingyu@google.com>
1552
1553 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1554 register to be x0 when to relax TLSDESC_LD64_LO12.
1555
1556 2014-11-26 Alan Modra <amodra@gmail.com>
1557
1558 * powerpc.cc (struct Stub_table_owner): New.
1559 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1560 unsigned int vector. Update all references.
1561 (powerpc_relobj::set_stub_table): Take an unsigned int param
1562 rather than a Stub_table. Update callers.
1563 (Powerpc_relobj::clear_stub_table): New function.
1564 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1565 stub_group_size_ vars.
1566 (Target_powerpc::new_stub_table): Delete.
1567 (max_branch_delta): New function, extracted from..
1568 (Target_powerpc::Relocate::relocate): ..here..
1569 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1570 status on whether stub created successfully.
1571 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1572 default sizing to..
1573 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1574 reduce on relax failure.
1575 (Target_powerpc::group_sections): Add "no_size_errors" param.
1576 Use stub_group_size_. Set up group info in a temp vector,
1577 before building Stub_table vector. Account for input sections
1578 possibly already converted to relaxed sections.
1579 (Stub_table::init): Delete. Merge into..
1580 (Stub_table::Stub_table): ..here.
1581 (Stub_table::can_reach_stub): New function.
1582 (Stub_table::add_plt_call_entry): Add "from" parameter and
1583 return true iff stub could be reached.
1584 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1585 param too.
1586 (Stub_table::clear_stubs): Add "all" param.
1587
1588 2014-11-26 Alan Modra <amodra@gmail.com>
1589
1590 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1591 (Target_powerpc::group_sections): Use it.
1592
1593 2014-11-25 Cary Coutant <ccoutant@google.com>
1594
1595 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1596 (Binary_to_elf::write_symbol): Add st_size parameter.
1597 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1598
1599 2014-11-25 Cary Coutant <ccoutant@google.com>
1600
1601 PR gold/17639
1602 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1603 (Sized_relobj_file::do_layout): Handle deferred sections properly
1604 during GC pass 1. Don't add reloc sections to deferred list twice.
1605 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1606 (Sized_relobj_file::is_deferred_layout_): New data member.
1607
1608 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1609
1610 PR gold/17619
1611 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1612 Check PC-relative offset overflow in PLT entry.
1613
1614 2014-11-21 Alan Modra <amodra@gmail.com>
1615
1616 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1617 for undefined weaks.
1618
1619 2014-11-20 Alan Modra <amodra@gmail.com>
1620
1621 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1622 from --stub-group-size parameter divided by 1024.
1623 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1624 template parameter. Update all uses.
1625 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1626 has_stub_value. Set for long branches. Don't report overflow for
1627 branch to undefined weak symbols. Print info message on
1628 overflowing branch to stub.
1629
1630 2014-11-20 Alan Modra <amodra@gmail.com>
1631
1632 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1633
1634 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1635
1636 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1637 entry for R_X86_64_GOTPLT64.
1638 (Target_x86_64<size>::Relocate::relocate): Update comments for
1639 R_X86_64_GOTPLT64.
1640
1641 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1642
1643 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1644 * plugin.h: add lock definition
1645
1646 2014-10-29 Han Shen <shenhan@google.com>
1647 Jing Yu <jingyu@google.com>
1648
1649 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1650 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1651 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1652 Symbol::TLS_REF.
1653 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1654 method.
1655 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1656 (Target_aarch64::tls_ld_to_le): New method.
1657 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1658 for 64bit targets.
1659 (Output_data_plt_aarch64::irelative_rel_): New data member.
1660 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1661 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1662 (Output_data_plt_aarch64::add_relocation): New method.
1663 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1664 offset. Add got_irelative size to got size.
1665 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1666 type string with the new typename.
1667 (AArch64_relocate_functions::update_adr): Replace parameter x with
1668 immed.
1669 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1670 (AArch64_relocate_functions::reloc_common): New method.
1671 (AArch64_relocate_funcsions::rela_general): Extract common part out
1672 into reloc_common method.
1673 (AArch64_relocate_functions::rela_general): Likewise.
1674 (AArch64_relocate_functions::pcrela_general): Likewise.
1675 (AArch64_relocate_functions::adr): New method.
1676 (AArch64_relocate_functions::adrp): Calculate immed before calling
1677 update_adr.
1678 (AArch64_relocate_functions::adrp): Likewise.
1679 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1680 comparing x to 0. Calculate immed from ~x when x < 0.
1681 (Target_aarch64::optimize_tls_reloc): Add new cases for
1682 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1683 TLSLD_MOVW_DTPREL_G0_NC.
1684 (Target_aarch64::possible_function_pointer_reloc): Implement this
1685 method.
1686 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1687 comment.
1688 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1689 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1690 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1691 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1692 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1693 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1694 (Target_aarch64::make_plt_entry): Call add_entry with two more
1695 parameters.
1696 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1697 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1698 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1699 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1700 (Target_aarch64::Relocate::relocate_tls): Add cases for
1701 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1702 TLSLD_MOVW_DTPREL_G0_NC.
1703 * testsuite/icf_safe_so_test.cc: Correct test comment.
1704 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1705
1706 2014-10-22 Alan Modra <amodra@gmail.com>
1707
1708 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1709 thread_starter.
1710
1711 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1712
1713 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1714
1715 2014-10-17 Cary Coutant <ccoutant@google.com>
1716
1717 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1718 Add "typename" keyword.
1719
1720 2014-10-15 Han Shen <shenhan@google.com>
1721 Jing Yu <jingyu@google.com>
1722
1723 Patch for gold aarch64 backend to support relaxation.
1724 * aarch64-reloc.def: Change format.
1725 * aarch64.cc (class Reloc_stub): New class.
1726 (class Stub_table): New class.
1727 (class AArch64_relobj): New class.
1728 (class AArch64_input_section): New class.
1729 (class AArch64_output_section): New class.
1730 (Target_aarch64::new_stub_table): New method.
1731 (Target_aarch64::new_aarch64_input_section): New method.
1732 (Target_aarch64::find_aarch64_input_section): New method.
1733 (Target_aarch64::scan_section_for_stubs): New method.
1734 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1735 (Target_aarch64::relocate_stub): New method.
1736 (Target_aarch64::current_target): New method.
1737 (Target_aarch64::do_make_elf_object): New method.
1738 (Target_aarch64::do_may_relax): New method.
1739 (Target_aarch64::do_relax): New method.
1740 (Target_aarch64::group_sections): New method.
1741 (Target_aarch64::scan_reloc_for_stub): New method.
1742 (Target_aarch64::do_make_output_section): New method.
1743 (Target_aarch64::stub_tables_): New data member.
1744 (Target_aarch64::aarch64_input_section_map_): New data member.
1745 (AArch64_relocate_functions::maybe_apply_stub): New method.
1746
1747 2014-09-30 Cary Coutant <ccoutant@google.com>
1748
1749 PR gold/17432
1750 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1751
1752 2014-09-30 Kito Cheng <kito@0xlab.org>
1753
1754 PR gold/13597
1755 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1756 hash table before sysv-style hash table.
1757
1758 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1759
1760 * options.h (--pic-executable): Add negative to alias to -no-pie.
1761
1762 2014-09-26 Cary Coutant <ccoutant@google.com>
1763
1764 PR gold/16773
1765 * object.cc (Sized_relobj_file): Compute value of section symbols
1766 for TLS sections the same as TLS symbols.
1767
1768 2014-09-25 Cary Coutant <ccoutant@google.com>
1769
1770 PR gold/17432
1771 * resolve.cc (Symbol_table::resolve): Override common placeholder
1772 symbols, but adjust sizes.
1773 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1774 symbols to common lists.
1775
1776 2014-09-24 Alan Modra <amodra@gmail.com>
1777
1778 * po/POTFILES.in: Regenerate.
1779
1780 2014-09-23 Taiju Tsuiki <tzik@google.com>
1781 Cary Coutant <ccoutant@google.com>
1782
1783 PR gold/14860
1784 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1785 on input_sections_blocker.
1786 * layout.cc (Write_sections_task::locks): Unblock
1787 input_sections_blocker_.
1788 * layout.h (Write_sections_task::Write_sections_task): Add
1789 input_sections_blocker.
1790 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1791 to DEPENDENCIES.
1792 * testsuite/Makefile.in: Regenerate.
1793
1794 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1795
1796 * testsuite/Makefile.am (plugin_test_10): New test.
1797 * testsuite/Makefile.in: Regenerate
1798 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1799 * testsuite/plugin_test_10.sh: New file.
1800
1801 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1802
1803 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1804 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1805 during the replacement phase.
1806
1807 2014-09-17 Han Shen <shenhan@google.com>
1808 Jing Yu <jingyu@google.com>
1809
1810 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1811 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1812 * aarch64.cc (Target_aarch64): Add data members
1813 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1814 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1815 constructor.
1816 (Target_aarch64::do_reloc_symbol_index): New method.
1817 (Target_aarch64::do_reloc_addend): New method.
1818 (Target_aarch64::add_tlsdesc_info): New method.
1819 (Target_aarch64::do_dynsym_value): New method.
1820 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1821 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1822 (Target_aarch64::make_data_plt): Add new parameters: got,
1823 got_irelative. Pass them to do_make_data_plt.
1824 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1825 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1826 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1827 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1828 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1829 (Target_aarch64::got_tlsdesc_section): New method.
1830 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1831 (Target_aarch64::define_tls_base_symbol): New method.
1832 (Target_aarch64::reserve_tlsdesc_entries): New method.
1833 (Target_aarch64::got_mod_index_entry): New method.
1834 (Target_aarch64::rela_tlsdesc_section): New method.
1835 (Target_aarch64::rela_irelative_section): New method.
1836 (Target_aarch64::Tlsdesc_info): New struct.
1837 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1838 relocations and tlsdesc relocations.
1839 (Target_aarch64::optimize_tls_reloc): Implement method.
1840 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1841 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1842 in constructor.
1843 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1844 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1845 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1846 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1847 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1848 (Output_data_plt_aarch64::rela_irelative): New method.
1849 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1850 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1851 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1852 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1853 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1854 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1855 (Output_data_plt_aarch64_standard): New member variables:
1856 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1857 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1858 New parameter: got, got_irelative.
1859 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1860 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1861 (Output_data_plt_aarch64::do_write): Replace got_address with
1862 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1863 (AArch64_relocate_functions::update_movnz): New method.
1864 (AArch64_relocate_functions): Correct format.
1865 (AArch64_relocate_functions::movnz): New method.
1866 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1867 before the switch. Add new cases to switch.
1868 Check ie_to_le relaxation on tlsie relocations. Add code handling
1869 tlsgd tlsdesc cases.
1870 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1871 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1872 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1873 Call reloc_name_in_error_message to print unsupported reloc.
1874 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1875 make_data_plt.
1876 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1877 relocs. Fill in some more dynamic tags.
1878 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1879 Skip call tls_get_addr when tlsgd is relaxed.
1880 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1881 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1882 tlsdesc->ie relaxation.
1883
1884 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1885
1886 * mips.cc (Target_mips_nacl): New class.
1887 (Target_selector_mips_nacl): New class.
1888 (target_selector_mips32): Rename from target_selector_mips32be and use
1889 Target_selector_mips_nacl instead of Target_selector_mips.
1890 (target_selector_mips32el): Rename from target_selector_mips32 and use
1891 Target_selector_mips_nacl instead of Target_selector_mips.
1892 (target_selector_mips64): Rename from target_selector_mips64be and use
1893 Target_selector_mips_nacl instead of Target_selector_mips.
1894 (target_selector_mips64el): Rename from target_selector_mips64 and use
1895 Target_selector_mips_nacl instead of Target_selector_mips.
1896 (Target_mips::mips_info): Add const attribute.
1897
1898 2014-09-02 Cary Coutant <ccoutant@google.com>
1899
1900 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1901 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1902 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1903 (Sized_incr_dynobj::do_section_name): Likewise.
1904 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1905 (Sized_incr_dynobj::do_section_name): Likewise.
1906 * object.h (Object::section_name): Likewise.
1907 (Object::do_section_name): Likewise.
1908 (Sized_relobj_file::do_section_name): Likewise.
1909 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1910 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1911
1912 2014-09-02 Cary Coutant <ccoutant@google.com>
1913
1914 PR gold/17005
1915 * ehframe.cc (Fde::write): Add output_offset parameter.
1916 (Cie::write): Likewise.
1917 (Eh_frame::set_final_data_size): Account for offset within output
1918 section.
1919 (Eh_frame::do_sized_write): Likewise.
1920 * ehframe.h (Fde::write): Add output_offset parameter.
1921 (Cie::write): Likewise.
1922 * output.cc (Output_section::Input_section_sort_entry): Remove
1923 section_has_name_; add output_section_name parameter. Use
1924 output section name for non-input sections.
1925 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1926 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1927 (Output_section::Input_section_sort_compare): Remove logic for
1928 sections without names.
1929 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1930 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1931 Likewise.
1932 (Output_section::Input_section_sort_section_name_compare): Likewise.
1933
1934 2014-08-29 Han Shen <shenhan@google.com>
1935 Jing Yu <jingyu@google.com>
1936
1937 * aarch64-reloc-property.cc
1938 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1939 reference reloc property in the table.
1940 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1941 3 other entries.
1942 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1943 2 new overloaded methods.
1944 (Output_data_got_aarch64::do_write): Add code to write out
1945 static relocs.
1946 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1947 static relocs.
1948 (Output_data_got_aarch64::static_relocs): New vector to
1949 hold static relocs.
1950 (Target_aarch64::TCB_SIZE): New const static memeber.
1951 (Target_aarch64::tcb_size): New method.
1952 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1953 (Target_aarch64::Relocate::relocate_tls): New method.
1954 (Target_aarch64::Scan::local): Add code handling new reloc types.
1955 (Target_aarch64::Scan::global): Add code handling new reloc types.
1956
1957 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1958
1959 * options.h (-no-pie): Add option.
1960
1961 2014-08-08 Jing Yu <jingyu@google.com>
1962 Han Shen <shenhan@google.com>
1963
1964 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1965 (DEFFILES): add aarch64-reloc.def.
1966 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1967 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1968 * Makefile.in: Regenerate.
1969 * aarch64-reloc-property.cc: New file.
1970 * aarch64-reloc-property.h: New file.
1971 * aarch64-reloc.def: New file.
1972 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1973 with tab to make the format consistent.
1974 (Output_data_got_aarch64::symbol_table_): New method.
1975 (Target_aarch64::do_plt_address_for_global): New method.
1976 (Target_aarch64::do_plt_address_for_local): New method.
1977 (Target_aarch64::do_select_as_default_target): New method.
1978 (Target_aarch64::do_make_data_plt): New method.
1979 (Target_aarch64::make_data_plt): New method.
1980 (Output_data_plt_aarch64::has_irelative_section): New method.
1981 (Output_data_plt_aarch64::address_for_global): New method.
1982 (Output_data_plt_aarch64::address_for_local): New method.
1983 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1984 (Output_data_plt_aarch64::add_entry): Implement contents.
1985 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1986 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1987 the got_pov entry to plt0.
1988 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1989 Implement contents.
1990 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1991 (AArch64_howto): New struct.
1992 (aarch64_howto[]): New static const array.
1993 (AArch64_relocate_functions): New class.
1994 (Target_aarch64::Scan::get_reference_flags): Remove method.
1995 (Target_aarch64::Scan::local): Implement to support a few relocations.
1996 (Target_aarch64::Scan::global): Implement to support a few relocations.
1997 (Target_aarch64::make_plt_section): Implement contents.
1998 (Target_aarch64::make_plt_entry): Implement contents.
1999 (Target_aarch64::do_finalize_sections): Implement contents.
2000 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2001 (Target_aarch64::relocate_section): Implement contents.
2002
2003 2014-08-06 Alan Modra <amodra@gmail.com>
2004
2005 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2006
2007 2014-08-06 Alan Modra <amodra@gmail.com>
2008
2009 PR 13227
2010 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2011
2012 2014-07-21 Sriraman Tallam <tmsriram@google.com>
2013
2014 * object.cc (Relobj::is_section_name_included): Add
2015 ".rodata.nptl_version" to not garbage collect this section.
2016
2017 2014-07-08 Cary Coutant <ccoutant@google.com>
2018
2019 * expression.cc (struct Expression::Expression_eval_info): Add
2020 new fields type_pointer, vis_pointer, and nonvis_pointer.
2021 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2022 nonvis_pointer parameters. Adjust all calls.
2023 (Symbol_expression::value): Update type, visibility, and nonvis bits
2024 in caller.
2025 * script.cc (Symbol_assignment::sized_finalize): Update type,
2026 visibility, and remaining st_other bits for new symbol.
2027 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2028 vis_pointer, and nonvis_pointer parameters.
2029 * symtab.h (Symbol::set_type): New method.
2030
2031 * testsuite/Makefile.am (defsym_test): New test.
2032 * testsuite/Makefile.in: Regenerate.
2033 * testsuite/defsym_test.c: New file.
2034 * testsuite/defsym_test.sh: New file.
2035
2036 2014-07-08 Cary Coutant <ccoutant@google.com>
2037
2038 PR gold/15639
2039 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2040 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2041 (Sized_dynobj::base_read_symbols): ...new method.
2042 * object.h (Sized_relobj_file::base_read_symbols): New method.
2043 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2044 (Sized_relobj_file::base_read_symbols): ...new method.
2045 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2046 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2047 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2048
2049 2014-07-04 Alan Modra <amodra@gmail.com>
2050
2051 * po/POTFILES.in: Regenerate.
2052
2053 2014-07-02 Jing Yu <jingyu@google.com>
2054
2055 * aarch64.cc: New file
2056 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2057 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2058 * Makefile.in: Regenerate.
2059 * configure.tgt: Add entries for aarch64*.
2060 * configure.ac: Likewise.
2061 * configure: Likewise.
2062
2063 2014-06-27 Alan Modra <amodra@gmail.com>
2064
2065 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2066
2067 2014-06-24 Cary Coutant <ccoutant@google.com>
2068
2069 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2070 sections.
2071 (Dwo_file::sized_read_unit_index): Likewise.
2072
2073 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2074
2075 * mips.cc: New file.
2076 * Makefile.am (TARGETSOURCES): Add mips.cc
2077 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2078 * configure.tgt: Add entries for mips*.
2079 * configure.ac: Likewise.
2080 * Makefile.in: Regenerate.
2081 * configure: Likewise.
2082
2083 2014-06-09 Cary Coutant <ccoutant@google.com>
2084
2085 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2086 unit_length is within section bounds.
2087
2088 2014-06-09 Cary Coutant <ccoutant@google.com>
2089
2090 PR gold/16980
2091 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2092 map.
2093
2094 2014-06-07 Alan Modra <amodra@gmail.com>
2095
2096 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2097
2098 2014-06-06 Cary Coutant <ccoutant@google.com>
2099
2100 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2101 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2102 (Dwarf_pubnames_table::read_header): Likewise.
2103 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2104 .debug_gnu_pubtypes.
2105
2106 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2107
2108 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2109 * Makefile.in, configure: Regenerate.
2110
2111 2014-06-03 Alan Modra <amodra@gmail.com>
2112
2113 * powerpc.cc (addis_12_2): Define.
2114 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2115
2116 2014-06-03 Alan Modra <amodra@gmail.com>
2117
2118 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2119 st_other output.
2120
2121 2014-06-02 Alan Modra <amodra@gmail.com>
2122
2123 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2124 Only ignore relocs on ELFv1.
2125 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2126
2127 2014-05-30 Cary Coutant <ccoutant@google.com>
2128
2129 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2130 * testsuite/Makefile.in: Regenerate.
2131 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2132
2133 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2134
2135 PR gold/16945
2136 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2137 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2138
2139 2014-05-15 Alan Modra <amodra@gmail.com>
2140
2141 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2142 Compare FDE contents with DW_CFA_nop rather than 0.
2143
2144 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2145
2146 * symtab.h (may_need_copy_reloc): Remove check for position independent
2147 code.
2148 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2149 position independence before pc absolute may_need_copy_reloc call.
2150 Add check for executable output befor pc relative may_need_copy_reloc
2151 call.
2152 * i386.cc: Ditto.
2153 * arm.cc: Ditto.
2154 * sparc.cc: Ditto.
2155 * tilegx.cc: Ditto.
2156 * powerpc.cc: Add check for no position independence before
2157 may_need_copy_reloc calls.
2158 * testsuite/pie_copyrelocs_test.cc: New file.
2159 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2160 * Makefile.am (pie_copyrelocs_test): New test.
2161 * Makefile.in: Regenerate.
2162
2163 2014-05-08 Martin Liška <mliska@suse.cz>
2164
2165 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2166
2167 2014-05-06 Cary Coutant <ccoutant@google.com>
2168
2169 PR gold/16900
2170 * i386.cc (Output_data_got_plt_i386): New class.
2171 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2172 parameter. Change all callers.
2173 (Output_data_plt_i386::layout_): Remove.
2174 (Output_data_plt_i386::got_plt_): Change type.
2175 (Target_i386::got_plt_): Change type. Change all references.
2176 (Target_i386::got_section): Create instance of new class.
2177 (Output_data_got_plt_i386::do_write): New function.
2178 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2179 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2180 parameter. Change all callers.
2181 (Output_data_plt_x86_64::layout_): Remove.
2182 (Output_data_plt_x86_64::got_plt_): Change type.
2183 (Target_x86_64::got_plt_): Change type. Change all references.
2184 (Target_x86_64::got_section): Create instance of new class.
2185 (Output_data_got_plt_x86_64::do_write): New function.
2186 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2187 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2188 class.
2189
2190 2014-05-05 Cary Coutant <ccoutant@google.com>
2191
2192 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2193 if we have pubnames/pubtypes.
2194
2195 2014-05-02 Cary Coutant <ccoutant@google.com>
2196
2197 * defstd.cc (in_segment): Define __ehdr_start here...
2198 * layout.cc (Layout::finalize): ...Instead of here. Set the
2199 output segment when known.
2200 * resolve.cc (Symbol::override_base_with_special): Remember
2201 the original binding.
2202 * symtab.cc (Symbol::set_output_segment): New function.
2203 (Symbol::set_undefined): New function.
2204 * symtab.h (Symbol::is_weak_undefined): Check original undef
2205 binding.
2206 (Symbol::is_strong_undefined): New function.
2207 (Symbol::set_output_segment): New function.
2208 (Symbol::set_undefined): New function.
2209 * target-reloc.h (is_strong_undefined): Remove.
2210 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2211 Check for hidden undefs.
2212 (relocate_section): Call Symbol::is_strong_undefined.
2213
2214 * testsuite/Makefile.am (ehdr_start_test_1)
2215 (ehdr_start_test_2, ehdr_start_test_3)
2216 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2217 * testsuite/Makefile.in: Regenerate.
2218 * testsuite/ehdr_start_def.cc: New source file.
2219 * testsuite/ehdr_start_test.cc: New source file.
2220 * testsuite/ehdr_start_test.t: New linker script.
2221 * testsuite/ehdr_start_test_4.sh: New shell script.
2222
2223 2014-04-23 Cary Coutant <ccoutant@google.com>
2224
2225 PR gold/16870
2226 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2227
2228 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2229
2230 * layout.cc (Layout::include_section): Allow a target to decide
2231 whether to include a section.
2232 * target.h (Target::should_include_section): New function.
2233 (Target::do_should_include_section): New function.
2234
2235 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2236
2237 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2238 inline into ...
2239 (Copy_relocs::emit): ... here.
2240 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2241 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2242 (Copy_reloc_entry::entries_): Change from private to protected.
2243
2244 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2245
2246 * icf.cc (get_section_contents): Replace copies of reloc
2247 vectors with const references.
2248
2249 2014-04-02 Cary Coutant <ccoutant@google.com>
2250
2251 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2252 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2253 * configure: Regenerate.
2254 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2255 -fno-use-linker-plugin.
2256 (LINK1, CXXLINK1): Add it to the link command.
2257 * testsuite/Makefile.in: Regenerate.
2258
2259 2014-03-12 Alan Modra <amodra@gmail.com>
2260
2261 * Makefile.in: Regenerate.
2262
2263 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2264
2265 * symtab.h (Symbol::set_nonvis): New function.
2266
2267 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2268
2269 * symtab.cc (Sized_symbol<32>::init_output_data):
2270 Instantiate the template.
2271 (Sized_symbol<64>::init_output_data): Likewise.
2272
2273 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2274
2275 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2276 adjust dynamic symbol value.
2277 * target.h (Target::adjust_dyn_symbol): New function.
2278 (Target::do_adjust_dyn_symbol): New function.
2279
2280 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2281
2282 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2283 Get the value of DYNAMIC_CUSTOM dynamic entry.
2284 * output.h (Output_data_dynamic::add_custom): New function.
2285 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2286 dynamic entry.
2287 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2288 * target.h (Target::dynamic_tag_custom_value): New function.
2289 (Target::do_dynamic_tag_custom_value): New function.
2290
2291 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2292
2293 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2294 dynsym indexes.
2295 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2296 (Target::do_has_custom_set_dynsym_indexes): New function.
2297 (Target::set_dynsym_indexes): New function.
2298 (Target::do_set_dynsym_indexes): New function.
2299
2300 2014-03-07 Alan Modra <amodra@gmail.com>
2301
2302 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2303 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2304 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2305 (Powerpc_relocate_functions::has_overflow_bitfield,
2306 overflowed): Use the above.
2307 (Target_powerpc::Relocate::relocate): Correct overflow checking
2308 for a number of relocations. Modify overflow test for 16-bit
2309 fields in instructions to signed/unsigned according to whether
2310 the field takes a signed or unsigned value.
2311
2312 2014-03-05 Alan Modra <amodra@gmail.com>
2313
2314 Update copyright years.
2315
2316 2014-03-05 Alan Modra <amodra@gmail.com>
2317
2318 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2319 R_PPC64_ADDR64_LOCAL.
2320 (Target_powerpc::Relocate::relocate): Likewise.
2321
2322 2014-03-03 Alan Modra <amodra@gmail.com>
2323
2324 * dwp.cc (print_version): Update copyright year to current.
2325
2326 2014-02-10 Alan Modra <amodra@gmail.com>
2327
2328 * po/gold.pot: Regenerate.
2329
2330 2014-02-06 Cary Coutant <ccoutant@google.com>
2331
2332 Fix problem where -u is ignored when a weak undef is seen.
2333
2334 * archive.cc (Library_base::should_include_member): Reorder
2335 code to check for -u option if a weak undef has already been seen.
2336 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2337 * testsuite/Makefile.in: Regenerate.
2338 * testsuite/weak_undef_file3.cc: New file.
2339 * testsuite/weak_undef_file4.cc: New file.
2340 * testsuite/weak_undef_test_2.cc: New file.
2341
2342 2014-02-05 Cary Coutant <ccoutant@google.com>
2343
2344 Fix issues with gold undefined symbol diagnostics.
2345
2346 PR binutils/15435
2347 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2348 check to here.
2349 * target-reloc.h (is_strong_undefined): New function.
2350 (relocate_section): Move undef vtable symbol check from here.
2351 Check for is_strong_undefined.
2352
2353 2014-02-05 Cary Coutant <ccoutant@google.com>
2354
2355 Fix problems with the --dynamic-list option.
2356
2357 PR gold/13577
2358 * options.cc (General_options::parse_dynamic_list):
2359 Set have_dynamic_list_.
2360 (General_options::General_options): Initialize have_dynamic_list_.
2361 (General_options::finalize): Turn off -Bsymbolic and
2362 -Bsymbolic-functions if --dynamic-list provided.
2363 * options.h (General_options::have_dynamic_list): New function.
2364 (General_options::have_dynamic_list_): New data member.
2365 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2366 correctly.
2367
2368 PR gold/16530
2369 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2370 in --dynamic-list, mark it.
2371
2372 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2373 (dynamic_list_2): New test case.
2374 * testsuite/Makefile.in: Regenerate.
2375 * testsuite/dynamic_list_2.cc: New file.
2376 * testsuite/dynamic_list_2.t: New file.
2377 * testsuite/dynamic_list_lib1.cc: New file.
2378 * testsuite/dynamic_list_lib2.cc: New file.
2379 * testsuite/gc_dynamic_list_test.c: New file.
2380 * testsuite/gc_dynamic_list_test.sh: New file.
2381 * testsuite/gc_dynamic_list_test.t: New file.
2382
2383 2014-01-28 Cary Coutant <ccoutant@google.com>
2384
2385 Add .gdb_index version 7 support.
2386
2387 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2388 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2389 debug sections.
2390 (Dwarf_ranges_table::read_ranges_table): Likewise.
2391 (Dwarf_pubnames_table::read_section): Check for GNU-style
2392 sections, and for compressed debug sections.
2393 (Dwarf_pubnames_table::read_header): Compute end address of table.
2394 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2395 for end of list by offset, not by offset == 0.
2396 (Dwarf_info_reader::do_read_string_table): Check for compressed
2397 debug sections.
2398 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2399 Initialize new data members.
2400 (Dwarf_pubnames_table::next_name): return flag_byte.
2401 (Dwarf_pubnames_table::end_of_table_): New data member.
2402 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2403 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2404 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2405 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2406 read skeleton type unit DIEs.
2407 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2408 (Gdb_index::do_write): Write flag_byte.
2409 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2410 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2411 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2412 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2413
2414 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2415
2416 * version.cc (print_version): Update copyright year to 2014.
2417
2418 2013-12-19 Dimitry Andric <dimitry@andric.com>
2419
2420 * stringpool.cc (Stringpool_template::reserve): Add
2421 HAVE_UNORDERED_MAP case.
2422 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2423
2424 2013-12-18 Cary Coutant <ccoutant@google.com>
2425
2426 * configure.ac: Check for <unordered_set> and <unordered_map>.
2427 * config.in: Regenerate.
2428 * configure: Regenerate.
2429 * system.h: Use <unordered_set> and <unordered_map> if available.
2430
2431 2013-12-10 Roland McGrath <mcgrathr@google.com>
2432
2433 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2434 with $(INSTALL_PROGRAM_ENV).
2435 * Makefile.in: Regenerate.
2436
2437 2013-11-22 Cary Coutant <ccoutant@google.com>
2438
2439 * configure.ac: Add check for which library is needed for
2440 dlopen.
2441 * configure: Regenerate.
2442
2443 2013-11-22 Cary Coutant <ccoutant@google.com>
2444
2445 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2446 assembler.
2447 * testsuite/Makefile.in: Regenerate.
2448
2449 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2450
2451 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2452 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2453 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2454 (Target_x86_64<size>::Scan::local): Likewise.
2455 (Target_x86_64<size>::Scan::global): Likewise.
2456 (Target_x86_64<size>::Relocate::relocate): Likewise.
2457 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2458 Likewise.
2459 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2460 R_X86_64_PC32_BND.
2461
2462 * testsuite/Makefile.am (check_PROGRAMS): Add
2463 exception_x86_64_bnd_test.
2464 (exception_x86_64_bnd_test_SOURCES): New macro.
2465 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2466 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2467 (exception_x86_64_bnd_test_LDADD): Likewise.
2468 (exception_x86_64_bnd_1.o): New rule.
2469 (exception_x86_64_bnd_2.o): Likewise.
2470 * testsuite/Makefile.in: Regenerated.
2471
2472 2013-11-15 Alan Modra <amodra@gmail.com>
2473
2474 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2475 accessor.
2476 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2477 Only call ppc64_local_entry_offset for 64-bit. Restrict
2478 symval_for_branch lookup to ELFv1.
2479 (Stub_table::add_plt_call_entry): Use unsigned int off.
2480 (Output_data_glink::Address, invalid_address): New.
2481 (Output_data_glink::add_eh_frame): Move out of line. Add
2482 support for ELFv2.
2483 (Output_data_glink::add_global_entry, find_global_entry,
2484 global_entry_address): New functions.
2485 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2486 ge_size): New variables.
2487 (Output_data_glink::set_final_data_size): Add global entry
2488 stub sizing.
2489 (Output_data_glink::do_write): Write global entry stubs.
2490 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2491 parameter. Return true for ELFv2. Adjust callers.
2492 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2493 ELFv1. Similarly for ifunc and dynamic relocation processing
2494 specific to ELFv1. Recognize that symbols are defined on
2495 their plt entries for ELFv2.
2496 (Target_powerpc::symval_for_branch): Assert if called for
2497 ELFv2 or ppc32.
2498 (Target_powerpc::Relocate::relocate): Use global entry plt
2499 stub for symbol value if such exists on ELFv2.
2500 (Target_powerpc::Relocate::relocate): Don't call
2501 symval_for_branch when ELFv2. Do adjust for local entry
2502 offset when ELFv2.
2503 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2504 plt stub for ELFv2.
2505 (Target_powerpc::do_plt_address_for_global): Similarly.
2506
2507 2013-11-14 Cary Coutant <ccoutant@google.com>
2508
2509 Revert patch -- this did not fix the problem, and there is
2510 no race there.
2511
2512 2013-11-14 Cary Coutant <ccoutant@google.com>
2513
2514 PR gold/14860
2515 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2516 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2517 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2518 updating fde_offsets_.
2519 (Eh_frame_hdr::lock_): New data member.
2520
2521 2013-11-14 Cary Coutant <ccoutant@google.com>
2522
2523 * dwp.cc (Dwo_file_entry): New type.
2524 (File_list): Use Dwo_file_entry.
2525 (Dwo_file::verify): New function.
2526 (Dwo_file::verify_dwo_list): New function.
2527 (Dwo_file::sized_verify_dwo_list): New function.
2528 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2529 list.
2530 (Dwp_options): New enum type.
2531 (dwp_options): Add --verify-only.
2532 (usage): Likewise.
2533 (main): Likewise.
2534 * dwp.h (gold_info): Add declaration.
2535
2536 2013-11-14 Cary Coutant <ccoutant@google.com>
2537
2538 PR gold/14860
2539 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2540 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2541 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2542 updating fde_offsets_.
2543 (Eh_frame_hdr::lock_): New data member.
2544
2545 2013-11-06 Cary Coutant <ccoutant@google.com>
2546
2547 PR gold/15758
2548 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2549 before reloc sections.
2550
2551 2013-11-04 Alan Modra <amodra@gmail.com>
2552
2553 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2554 (Symbol::needs_dynamic_reloc): Test new flag.
2555 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2556 (Target_powerpc::Scan::get_reference_flags): Add target param.
2557 Return FUNC_DESC_ABI for 64-bit ELFv1.
2558 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2559 call.
2560 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2561 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2562
2563 2013-10-31 Cary Coutant <ccoutant@google.com>
2564
2565 Restore support for dwp v2 DWARF package file format.
2566
2567 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2568 tu_length parameter. Adjust all callers.
2569 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2570 * dwp.cc: Include dwarf.h.
2571 (Section_bounds): New struct type.
2572 (Unit_set): New struct type.
2573 (Dwo_file::Dwo_file): Initialize new data member.
2574 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2575 Combine and rename to...
2576 (Dwo_file::read_unit_index): ...this.
2577 (Dwo_file::sized_read_compunit_index)
2578 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2579 (Dwo_file::sized_read_unit_index): ...this.
2580 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2581 parameters; add section_id parameter.
2582 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2583 (Dwo_file::add_unit_set): ...this.
2584 (Dwo_file::shndx_map_): Remove.
2585 (Dwo_file::sect_offsets_): New data member.
2586 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2587 (Dwp_output_file::add_section): Rename to...
2588 (Dwp_output_file::add_contribution): ...this.
2589 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2590 (Dwp_output_file::add_tu_set): Likewise.
2591 (Dwp_output_file::Contribution): New type.
2592 (Dwp_output_file::Section::contributions): New data member.
2593 (Dwp_output_file::Cu_or_tu_set): Remove.
2594 (Dwp_output_file::Section::Section): New ctor.
2595 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2596 (Dwp_output_file::Dwp_index::Section_table): New type.
2597 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2598 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2599 parameter.
2600 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2601 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2602 (Dwp_output_file::Dwp_index::section_table): New member function.
2603 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2604 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2605 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2606 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2607 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2608 (Dwp_output_file::Dwp_index::section_table_): New data member.
2609 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2610 (Dwp_output_file::add_output_section): New member function.
2611 (Dwp_output_file::write_new_section): New member function.
2612 (Dwp_output_file::write_contributions): New member function.
2613 (Dwp_output_file::section_id_map_): New data member.
2614 (class Dwo_id_info_reader): Remove.
2615 (class Unit_reader): New class.
2616 (get_dwarf_section_name): New function.
2617 (Dwo_file::read_executable): Adjust initializations of class data.
2618 (Dwo_file::read): Add support for v2 package file format.
2619 (Dwo_file::read_unit_index): Likewise.
2620 (Dwo_file::sized_read_unit_index): Likewise.
2621 (Dwo_file::copy_section): Likewise.
2622 (Dwo_file::add_unit_set): Likewise.
2623 (Dwp_output_file::add_output_section): Likewise.
2624 (Dwp_output_file::add_contribution): Likewise.
2625 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2626 for empty slot.
2627 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2628 file format.
2629 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2630 slot.
2631 (Dwp_output_file::initialize): Remove unused function.
2632 (Dwp_output_file::finalize): Add support for v2 package file format.
2633 (Dwp_output_file::write_index): Likewise.
2634 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2635 function prototype.
2636
2637 2013-10-31 Cary Coutant <ccoutant@google.com>
2638
2639 * configure.ac: Fix check for -fmerge-constants.
2640 * configure.ac: Regenerate.
2641
2642 2013-10-30 Roland McGrath <mcgrathr@google.com>
2643
2644 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2645 Correct 9-byte nop sequence to match what the assembler generates.
2646
2647 2013-10-30 Alan Modra <amodra@gmail.com>
2648
2649 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2650 ppc64_local_entry_offset, ppc64_local_entry_offset,
2651 do_read_symbols): New functions.
2652 (Powerpc_relobj::e_flags_, st_other_): New vars.
2653 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2654 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2655 (Powerpc_relobj::e_flags_): New var.
2656 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2657 and adjust for ELFv2.
2658 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2659 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2660 (Powerpc_dynobj::do_find_special_sections): Likewise.
2661 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2662 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2663 to ELFv2 local entry.
2664 (Target_powerpc::do_relax): No thread safe barriers needed for
2665 ELFv2.
2666 (Output_data_plt_powerpc::initial_plt_entry_size_,
2667 plt_entry_size): Delete. Replace all uses with
2668 first_plt_entry_offset() and plt_entry_size().
2669 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2670 reserved_size parm. Update callers.
2671 (Output_data_plt_powerpc::entry_count): Update.
2672 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2673 and use Target_powerpc::first_plt_entry_offset().
2674 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2675 rename to plt_entry_size.
2676 (Output_data_plt_powerpc::add_ifunc_entry,
2677 add_local_ifunc_entry): Adjust reloc for ELFv2.
2678 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2679 (glink_eh_frame_fde_64v2): New.
2680 (Stub_table::plt_call_size): Support ELFv2 sizing.
2681 (Output_data_glink::add_eh_frame): Use the new FDE.
2682 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2683 (Stub_table::do_write): Write ELFv2 stubs and glink.
2684 (Target_powerpc::Relocate::relocate): Replaces nop after call
2685 with ld 2,24(1) and adjust local offset destination for ELFv2.
2686
2687 2013-10-30 Alan Modra <amodra@gmail.com>
2688
2689 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2690 (Target_powerpc::Scan::global, local): Likewise.
2691 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2692 on all ppc64 @h and @ha relocs.
2693
2694 2013-10-14 Alan Modra <amodra@gmail.com>
2695
2696 * output.h (Output_data_got::add_constant): Tidy.
2697 (Output_data_got::add_constant_pair): New function.
2698 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2699 methods used so as to first call reserve_ent().
2700
2701 2013-10-11 Roland McGrath <mcgrathr@google.com>
2702
2703 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2704 add_got_entry and add_got_entry_pair.
2705
2706 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2707 (HAVE_PUBNAMES): Likewise.
2708 * configure: Regenerate.
2709
2710 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2711 * testsuite/Makefile.in: Regenerate.
2712
2713 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2714 Remove const from declaration.
2715 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2716 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2717 * output.h (Output_file_header): Remove const from member target_
2718 and corresponding constructor argument.
2719 * output.cc (Output_file_header::Output_file_header): Update prototype.
2720 (Output_file_header::do_sized_write): Use this->target_ in place
2721 of parameters()->target().
2722
2723 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2724
2725 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2726 * configure: Regenerate.
2727 * Makefile.in: Regenerate.
2728 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2729 * testsuite/merge_string_literals_2.c: Likewise.
2730 * testsuite/Makefile.am
2731 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2732 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2733 literal -fmerge-constants.
2734 * testsuite/Makefile.in: Regenerate.
2735
2736 * i386.cc (Target_i386): Remove unused member dynbss_.
2737 * arm.cc (Target_arm): Likewise.
2738 * powerpc.cc (Target_powerpc): Likewise.
2739 * sparc.cc (Target_sparc): Likewise.
2740 * tilegx.cc (Target_tilegx): Likewise.
2741 * x86_64.cc (Target_x86_64): Likewise.
2742 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2743 type_signature_, type_offset_.
2744 * plugin.h (Plugin_hook): Remove unused member layout_.
2745 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2746 mapfile_.
2747 (Read_member): Remove unused members input_objects_, symtab_,
2748 mapfile_, layout_.
2749 (Check_library): Remove unused member symtab_.
2750 * archive.h (Lib_group): Remove unused member lib_.
2751 * archive.cc (Lib_group::Lib_group): Update initializer.
2752 * incremental.h (Incremental_binary): Remove unused member target_.
2753 (Incremental_script_entry): Removed unused member script_.
2754 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2755 * icf.h (Icf): Remove unused member num_tracked_relocs.
2756
2757 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2758 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2759 its only use.
2760 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2761
2762 * archive.h: Use struct rather than class for forward declaration
2763 of Read_symbols_data.
2764
2765 2013-10-07 Cary Coutant <ccoutant@google.com>
2766
2767 PR gold/16010
2768 * testsuite/Makefile.am (icf_test): Fix dependencies.
2769 (icf_safe_test): Likewise.
2770 (icf_safe_so_test): Likewise.
2771 (large_symbol_alignment): Add empty _LDADD rule.
2772 * testsuite/Makefile.in: Regenerate.
2773
2774 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2775
2776 PR gold/15927
2777 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2778 relocation for R_X86_64_32 on x32.
2779
2780 2013-08-27 Roland McGrath <mcgrathr@google.com>
2781
2782 * output.cc (Output_segment::set_section_addresses): Take new
2783 Target* argument. If target->isolate_execinstr() and the segment
2784 is executable and starts at a target->abi_pagesize() boundary,
2785 pad its end out to a target->abi_pagesize() boundary with code fill.
2786 * output.h (Output_segment::set_section_addresses): Update decl.
2787 * layout.h (Layout::check_output_data_for_reset_values): Take new
2788 argument RELAX_OUTPUTS.
2789 (Layout): New member relax_output_list_.
2790 (Layout::add_relax_output): New method.
2791 * layout.cc (Layout::Layout): Update constructor.
2792 (Layout::reset_relax_output): New method.
2793 (Layout::clean_up_after_relaxation): Call it.
2794 (Layout::prepare_for_relaxation): Update caller.
2795 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2796 Call reset_relax_output before re-processing segments for
2797 isolate_execinstr case.
2798 (Layout::write_data): Handle relax_output_list_.
2799 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2800 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2801
2802 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2803
2804 PR binutils/15834
2805 * object.h: Fix typos.
2806
2807 2013-08-16 Roland McGrath <mcgrathr@google.com>
2808
2809 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2810 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2811
2812 2013-08-07 Cary Coutant <ccoutant@google.com>
2813
2814 Revert support for v2 DWP files:
2815
2816 2013-03-01 Cary Coutant <ccoutant@google.com>
2817
2818 Add dwp support for v2 DWARF package file format.
2819 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2820 tu_length parameter. Adjust all callers.
2821 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2822 * dwp.cc: Include dwarf.h.
2823 (Section_bounds): New struct type.
2824 (Unit_set): New struct type.
2825 (Dwo_file::Dwo_file): Initialize new data member.
2826 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2827 Combine and rename to...
2828 (Dwo_file::read_unit_index): ...this.
2829 (Dwo_file::sized_read_compunit_index)
2830 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2831 (Dwo_file::sized_read_unit_index): ...this.
2832 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2833 parameters; add section_id parameter.
2834 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2835 (Dwo_file::add_unit_set): ...this.
2836 (Dwo_file::shndx_map_): Remove.
2837 (Dwo_file::sect_offsets_): New data member.
2838 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2839 (Dwp_output_file::add_section): Rename to...
2840 (Dwp_output_file::add_contribution): ...this.
2841 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2842 (Dwp_output_file::add_tu_set): Likewise.
2843 (Dwp_output_file::Contribution): New type.
2844 (Dwp_output_file::Section::contributions): New data member.
2845 (Dwp_output_file::Cu_or_tu_set): Remove.
2846 (Dwp_output_file::Section::Section): New ctor.
2847 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2848 (Dwp_output_file::Dwp_index::Section_table): New type.
2849 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2850 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2851 parameter.
2852 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2853 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2854 (Dwp_output_file::Dwp_index::section_table): New member function.
2855 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2856 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2857 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2858 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2859 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2860 (Dwp_output_file::Dwp_index::section_table_): New data member.
2861 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2862 (Dwp_output_file::add_output_section): New member function.
2863 (Dwp_output_file::write_new_section): New member function.
2864 (Dwp_output_file::write_contributions): New member function.
2865 (Dwp_output_file::section_id_map_): New data member.
2866 (class Dwo_id_info_reader): Remove.
2867 (class Unit_reader): New class.
2868 (get_dwarf_section_name): New function.
2869 (Dwo_file::read_executable): Adjust initializations of class data.
2870 (Dwo_file::read): Add support for v2 package file format.
2871 (Dwo_file::read_unit_index): Likewise.
2872 (Dwo_file::sized_read_unit_index): Likewise.
2873 (Dwo_file::copy_section): Likewise.
2874 (Dwo_file::add_unit_set): Likewise.
2875 (Dwp_output_file::add_output_section): Likewise.
2876 (Dwp_output_file::add_contribution): Likewise.
2877 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2878 for empty slot.
2879 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2880 file format.
2881 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2882 slot.
2883 (Dwp_output_file::initialize): Remove unused function.
2884 (Dwp_output_file::finalize): Add support for v2 package file format.
2885 (Dwp_output_file::write_index): Likewise.
2886 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2887 function prototype.
2888
2889 2013-07-31 Cary Coutant <ccoutant@google.com>
2890
2891 * object.cc (Sized_relobj::do_output_section_address): New function.
2892 (Sized_relobj): Instantiate explicitly.
2893 * object.h (Object::output_section_address): New function.
2894 (Object::do_output_section_address): New function.
2895 (Sized_relobj::do_output_section_address): New function.
2896 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2897
2898 2013-07-30 Cary Coutant <ccoutant@google.com>
2899 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2900
2901 * parameters.cc (Parameters::entry): Return target-specific entry
2902 symbol name.
2903 * target.h (Target::entry_symbol_name): New function.
2904 (Target_info::entry_symbol_name): New data member.
2905
2906 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2907 * i386.cc (Target_i386::i386_info): Likewise.
2908 (Target_i386_nacl::i386_nacl_info): Likewise.
2909 * sparc.cc (Target_sparc::sparc_info): Likewise.
2910 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2911 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2912 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2913 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2914
2915 2013-07-22 Sterling Augustine <saugustine@google.com>
2916
2917 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2918 Convert parameter shndx to local variable. Add parameters symtab
2919 and symtab_size. Scan over section names. Find relocation
2920 section corresponding to current section. Create and initialize
2921 reloc_mapper_ and reloc_type_.
2922 (Dwarf_pubnames_table::read_header): Add assertion. Change
2923 unit_length to off_t. Initialize member unit_length_. Fill in field
2924 cu_offset_.
2925 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2926 Initialize new fields unit_length_ and cu_offset_.
2927 (Dwarf_pubnames_table::read_section): Update prototype.
2928 (Dwarf_pubnames_table::cu_offset): New member function.
2929 (Dwarf_pubnames_table::subsection_size): Likewise.
2930 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2931 New fields.
2932 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2933 member functions public.
2934 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2935 Update comment. Rework logic. Move repeated parts to...
2936 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2937 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2938 pubtypes_table_, and stmt_list_offset.
2939 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2940 Gdb_index::find_pubtype_offset,
2941 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2942 (Gdb_index::pubnames_read): Update prototype and rework logic.
2943 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2944 Forward declare.
2945 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2946 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2947 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2948 Gdb_index::map_pubtable_to_dies):
2949 Declare functions.
2950 (Gdb_index::pubnames_read): Update declaration.
2951 (Gdb_index::Pubname_offset_map): New type.
2952 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2953 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2954 Gdb_index::stmt_list_offset): Declare.
2955 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2956 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2957 Gdb_index::pubtypes_offset_): Remove.
2958
2959 2013-07-19 Roland McGrath <mcgrathr@google.com>
2960
2961 * options.h (General_options): Add -Trodata-segment option.
2962 * parameters.cc (Parameters::check_rodata_segment): New function.
2963 (Parameters::set_target_once): Call it.
2964 * parameters.h (Parameters): Declare it (private member function).
2965 * layout.cc (load_seg_unusable_for_headers): New function, broken
2966 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2967 then validate rodata segment rather than text segment.
2968 (relaxation_loop_body): Call that.
2969 (is_text_segment): New function. Don't admit a non-executable
2970 segment if TARGET->isolate_execinstr().
2971 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2972
2973 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2974
2975 PR gold/15070
2976 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2977 * nacl.h (Sniff_file::View::View): Request aligned view.
2978
2979 2013-07-11 Cary Coutant <ccoutant@google.com>
2980
2981 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2982 correct BRLT entry size.
2983
2984 2013-07-03 Alan Modra <amodra@gmail.com>
2985
2986 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2987 comment.
2988
2989 2013-07-01 Cary Coutant <ccoutant@google.com>
2990
2991 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2992 reloc_type_.
2993 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2994 (Dwarf_ranges_table::lookup_reloc): New function.
2995 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2996 reloc_type_.
2997 (Dwarf_ranges_table::lookup_reloc): New function.
2998 (Dwarf_ranges_table::reloc_type_): New data member.
2999
3000 2013-06-27 Jing Yu <jingyu@google.com>
3001
3002 PR gold/15662
3003 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3004 function.
3005 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3006 (Target_powerpc::do_relax): Call the above.
3007
3008 2013-06-27 Cary Coutant <ccoutant@google.com>
3009
3010 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3011 on garbage collected .opd section.
3012
3013 2013-06-27 Alan Modra <amodra@gmail.com>
3014
3015 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3016 is non-zero.
3017 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3018 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3019
3020 2013-06-14 Cary Coutant <ccoutant@google.com>
3021
3022 * resolve.cc (Symbol::override_base): Don't override st_type
3023 from plugin placeholder symbols.
3024 (Symbol_table::resolve): Likewise.
3025 (Symbol_table::should_override): Don't complain about TLS mismatch
3026 if the TO symbol is a plugin placeholder.
3027 * testsuite/Makefile.am (plugin_test_tls): New test.
3028 * testsuite/Makefile.in: Regenerate.
3029 * testsuite/plugin_test_tls.sh: New test script.
3030 * testsuite/two_file_test_2_tls.cc: New test source.
3031 * testsuite/two_file_test_tls.cc: New test source.
3032
3033 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3034
3035 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3036 the maximum segment alignment is larger than the page size.
3037 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3038 correctly aligns the symbols with large alignemnt.
3039 * testsuite/Makefile.in: Regenerate.
3040 * testsuite/large_symbol_alignment.cc: New file.
3041
3042 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3043 Sriraman Tallam <tmsriram@google.com>
3044
3045 * options.h (sort_section): New option.
3046 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3047 Rename from Input_section_sort_section_name_special_ordering_compare.
3048 (Input_section_sort_section_name_compare): New struct.
3049 * output.cc (Output_section::Input_section_sort_section_name_compare::
3050 operator()): New function.
3051 (Output_section::sort_attached_input_sections): Use new sort function
3052 for .text if --sort-section=name is specified.
3053 * layout.cc (Layout::make_output_section):
3054 Add sorting by name when --sort-section=name is specified.
3055 * testsuite/Makefile.am (text_section_grouping): Test option
3056 --sort-section=name.
3057 * testsuite/Makefile.in: Regenerate.
3058 * testsuite/section_sorting_name.cc: New file.
3059 * testsuite/section_sorting_name.sh: New file.
3060
3061 2013-05-21 Cary Coutant <ccoutant@google.com>
3062
3063 * symtab.h (Symbol::is_cxx_vtable): New function.
3064 * target-reloc.h (relocate_section): Check for vtable symbol.
3065 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3066 * testsuite/Makefile.in: Regenerate.
3067 * testsuite/missing_key_func.cc: New test source.
3068 * testsuite/missing_key_func.sh: New test script.
3069
3070 2013-05-21 Cary Coutant <ccoutant@google.com>
3071
3072 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3073 type of enclosing symbol.
3074 (Relocate_info::location): Check symbol type when describing symbol.
3075 * object.h (Symbol_location_info): Remove unused line_number;
3076 add enclosing_symbol_type.
3077 * testsuite/debug_msg.sh: Adjust expected output.
3078
3079 2013-05-13 Cary Coutant <ccoutant@google.com>
3080
3081 * configure.ac: Export DEFAULT_TARGET.
3082 * configure: Regenerate.
3083 * Makefile.in: Regenerate.
3084 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3085 * testsuite/Makefile.in: Regenerate.
3086 * testsuite/debug_msg.sh: Delete duplicate tests.
3087 Don't check undef_int error message match for powerpc where the
3088 source file and line number aren't available.
3089
3090 2013-05-10 Roland McGrath <mcgrathr@google.com>
3091
3092 * options.h (General_options): Add --rosegment-gap option.
3093 * options.cc (finalize): --rosegment-gap implies --rosegment.
3094 * layout.cc (set_segment_offsets): Let user option override
3095 target->rosegment_gap().
3096
3097 2013-05-10 Roland McGrath <mcgrathr@google.com>
3098
3099 * options.h (General_options): Remove leading space from help
3100 messages for -nostdlib and --rosegment.
3101
3102 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3103
3104 PR ld/15365
3105 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3106
3107 2013-05-03 Alan Modra <amodra@gmail.com>
3108
3109 * merge.cc (Output_merge_string::do_add_input_section): Correct
3110 scan for number of strings. Rename vars to avoid shadowing.
3111 Include missing terminator in input_size_.
3112
3113 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3114
3115 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3116 Restore empty string handling.
3117
3118 2013-05-01 Cary Coutant <ccoutant@google.com>
3119
3120 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3121 uninitialized warning.
3122
3123 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3124
3125 * output.cc (Output_section::add_merge_input_section): Allow
3126 to merge sections if the alignment is more than character size.
3127 * merge.h (Output_merge_string::Output_merge_string): Remove
3128 assert.
3129 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3130 only not-null strings. Check the alignment of strings.
3131 * stringpool.h
3132 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3133 alignment as the argument.
3134 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3135 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3136 Align non-zero length strings according to the addralign_.
3137 (Stringpool_template<Stringpool_char>::set_string_offsets):
3138 Updating offsets according to the given alignment.
3139 * testsuite/Makefile.am (text_section_grouping): Test if string
3140 literals are getting merged.
3141 * testsuite/Makefile.in: Regenerate.
3142 * testsuite/merge_string_literals_1.c: New file.
3143 * testsuite/merge_string_literals_2.c: Ditto.
3144 * testsuite/merge_string_literals.sh: Ditto.
3145
3146 2013-04-26 Ian Lance Taylor <iant@google.com>
3147
3148 * target-reloc.h (relocate_section): If the reloc offset is out of
3149 range, pass VIEW as NULL to relocate.relocate.
3150 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3151 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3152 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3153 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3154 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3155 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3156
3157 2013-04-26 Geoff Pike <gpike@chromium.org>
3158
3159 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3160 * layout.cc (Hash_task): New class.
3161 (Layout::queue_build_id_tasks): New function.
3162 (Layout::write_build_id): Handle single-thread portion of build ID
3163 computation. (In some cases, all of it is single-threaded.) Replace
3164 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3165 functionality in fewer lines of code.
3166 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3167 * options.h (General_options): make "--build-id" default to tree
3168 rather than sha1. Add two new options related to --build-id=tree:
3169 --build-id-chunk-size-for-treehash and
3170 --build-id-min-file-size-for-treehash.
3171 * Makefile.am: add testing of --build-id=tree and related new options
3172 (these tests will be invoked by "make check").
3173 * Makefile.in: Regenerate.
3174
3175 2013-04-25 Alan Modra <amodra@gmail.com>
3176
3177 * configure.tgt: Add powerpcle and powerpc64le.
3178
3179 2013-04-22 Alan Modra <amodra@gmail.com>
3180
3181 PR gold/15355
3182 * layout.cc (Layout::segment_precedes): Allow more than one
3183 segment with the same type and flags.
3184
3185 2013-04-15 Cary Coutant <ccoutant@google.com>
3186
3187 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3188 allocate space in file for BSS sections.
3189
3190 2013-04-15 Cary Coutant <ccoutant@google.com>
3191
3192 * script-sections.cc (Orphan_output_section): Reset address
3193 to zero after each orphaned section for relocatable links.
3194
3195 2013-04-15 Cary Coutant <ccoutant@google.com>
3196
3197 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3198 section starting address for relocatable link.
3199 * testsuite/Makefile.am (script_test_11): New test.
3200 * testsuite/Makefile.in: Regenerate.
3201 * testsuite/script_test_11.c: New source file.
3202 * testsuite/script_test_11.t: New linker script.
3203
3204 2013-04-13 Alan Modra <amodra@gmail.com>
3205
3206 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3207 owner when sections are not adjacent and exceed group size.
3208 (Target_powerpc::group_sections): Handle corner case.
3209 (Target_powerpc::Branch_info::make_stub): Handle case where
3210 stub table doesn't exist due to branches in non-exec sections.
3211 (Target_powerpc::Relocate::relocate): Likewise.
3212
3213 2013-04-11 Alan Modra <amodra@gmail.com>
3214
3215 PR gold/15354
3216 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3217 .branch_lt to match bfd ld. Adjust comments throughout file.
3218
3219 2013-04-04 Ian Lance Taylor <iant@google.com>
3220
3221 GCC PR c++/56840
3222 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3223 sections before checking whether they are included in the link.
3224
3225 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3226
3227 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3228 object before calling the plugin claim_file handler. Pass the elf
3229 object of the archive to the plugin. Delete the elf object if the
3230 plugin claims the file.
3231
3232 2013-03-21 Alan Modra <amodra@gmail.com>
3233
3234 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3235 segment when omagic.
3236
3237 2013-03-21 Alan Modra <amodra@gmail.com>
3238
3239 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3240 comparison warning.
3241 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3242 uninitialized" warning.
3243
3244 2013-03-20 Alan Modra <amodra@gmail.com>
3245
3246 * symtab.h (Symbol::clear_version): New function.
3247 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3248 is_needed by weak references. Clear version for symbols defined
3249 in as-needed objects that are not needed.
3250
3251 2013-03-15 Alan Modra <amodra@gmail.com>
3252
3253 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3254 static and public. Add report_err param. Return false for data refs.
3255 (Target_powerpc::rela_dyn_section): New overloaded function.
3256 (Target_powerpc::plt_, iplt_): Elucidate.
3257 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3258 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3259 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3260 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3261 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3262 push_branch and make_plt_entry for ifunc syms when
3263 reloc_needs_plt_for_ifunc.
3264 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3265 for ifunc unless reloc_needs_plt_for_ifunc.
3266
3267 2013-03-15 Alan Modra <amodra@gmail.com>
3268
3269 * gc.h (gc_process_relocs): Don't look through function descriptors.
3270 * icf.cc (get_section_contents): Do so here instead.
3271
3272 2013-03-13 Alan Modra <amodra@gmail.com>
3273
3274 * powerpc.cc (is_branch_reloc): Forward declare.
3275 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3276 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3277 false for 64-bit, true for 32-bit non-branch relocs.
3278 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3279 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3280 nm output.
3281 (icf_safe_test): Generate linker map file as well as nm output.
3282 (icf_safe_so_test): Likewise.
3283 * testsuite/Makefile.in: Regenerate.
3284 * testsuite/icf_test.sh: Parse linker map file to determine
3285 section folding.
3286 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3287 * testsuite/icf_safe_so_test.sh: Likewise.
3288 (X86_32_or_ARM_specific_safe_fold): Merge into..
3289 (arch_specific_safe_fold): ..this.
3290 (X86_64_specific_safe_fold): Delete unused function.
3291
3292 2013-03-12 Alan Modra <amodra@gmail.com>
3293
3294 * gc.h (gc_process_relocs): Look through function descriptors
3295 to determine shndx, symvalue and addend used by ICF. Tidy
3296 variable duplication.
3297
3298 2013-03-11 Alan Modra <amodra@gmail.com>
3299
3300 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3301 * layout.cc (Layout_task_runner::run): ..to here.
3302 * symtab.h (struct Symbol_location): Extract from..
3303 (class Symbol_table): ..here.
3304 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3305 * target.h (class Target): Add function_location and
3306 do_function_location functions.
3307 (class Sized_target): Add do_function_location.
3308 * object.h (class Sized_relobj_file): Move find_shdr..
3309 (class Object): ..to here.
3310 * object.cc: Likewise. Update to suit. Instantiate.
3311 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3312 * powerpc.cc (class Powerpc_dynobj): New.
3313 (Target_powerpc::do_function_location): New function.
3314 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3315 (Powerpc_dynobj::do_read_symbols): New function.
3316 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3317
3318 2013-03-08 Ian Lance Taylor <iant@google.com>
3319
3320 * options.cc (General_options::string_to_object_format): Accept
3321 "default".
3322
3323 2013-03-08 Alan Modra <amodra@gmail.com>
3324
3325 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3326 pointer to Post_fde.
3327 (struct Post_fde): Move definition to here..
3328 * ehframe.cc (struct Post_fde): ..from here.
3329 (Cie::write): Don't alloc Post_fde.
3330 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3331
3332 2013-03-07 Alan Modra <amodra@gmail.com>
3333
3334 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3335 relocation referencing .LC0.
3336 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3337
3338 2013-03-07 Alan Modra <amodra@gmail.com>
3339
3340 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3341 always_inline. Add assembly for powerpc to avoid GOT.
3342
3343 2013-03-07 Alan Modra <amodra@gmail.com>
3344
3345 * testsuite/script_test_10.sh: Don't test .bss section
3346 header number.
3347
3348 2013-03-06 Alan Modra <amodra@gmail.com>
3349
3350 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3351 (Target_powerpc::symval_for_branch): Add symtab param. Update
3352 all callers. Handle folded sections.
3353 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3354 to Powerpc_relobj.
3355 (Global_symbol_visitor_opd::operator()): Likewise.
3356
3357 2013-03-04 Alan Modra <amodra@gmail.com>
3358
3359 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3360 * testsuite/Makefile.in: Regenerate.
3361
3362 2013-03-01 Cary Coutant <ccoutant@google.com>
3363
3364 Add dwp support for v2 DWARF package file format.
3365 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3366 tu_length parameter. Adjust all callers.
3367 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3368 * dwp.cc: Include dwarf.h.
3369 (Section_bounds): New struct type.
3370 (Unit_set): New struct type.
3371 (Dwo_file::Dwo_file): Initialize new data member.
3372 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3373 Combine and rename to...
3374 (Dwo_file::read_unit_index): ...this.
3375 (Dwo_file::sized_read_compunit_index)
3376 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3377 (Dwo_file::sized_read_unit_index): ...this.
3378 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3379 parameters; add section_id parameter.
3380 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3381 (Dwo_file::add_unit_set): ...this.
3382 (Dwo_file::shndx_map_): Remove.
3383 (Dwo_file::sect_offsets_): New data member.
3384 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3385 (Dwp_output_file::add_section): Rename to...
3386 (Dwp_output_file::add_contribution): ...this.
3387 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3388 (Dwp_output_file::add_tu_set): Likewise.
3389 (Dwp_output_file::Contribution): New type.
3390 (Dwp_output_file::Section::contributions): New data member.
3391 (Dwp_output_file::Cu_or_tu_set): Remove.
3392 (Dwp_output_file::Section::Section): New ctor.
3393 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3394 (Dwp_output_file::Dwp_index::Section_table): New type.
3395 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3396 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3397 parameter.
3398 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3399 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3400 (Dwp_output_file::Dwp_index::section_table): New member function.
3401 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3402 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3403 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3404 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3405 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3406 (Dwp_output_file::Dwp_index::section_table_): New data member.
3407 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3408 (Dwp_output_file::add_output_section): New member function.
3409 (Dwp_output_file::write_new_section): New member function.
3410 (Dwp_output_file::write_contributions): New member function.
3411 (Dwp_output_file::section_id_map_): New data member.
3412 (class Dwo_id_info_reader): Remove.
3413 (class Unit_reader): New class.
3414 (get_dwarf_section_name): New function.
3415 (Dwo_file::read_executable): Adjust initializations of class data.
3416 (Dwo_file::read): Add support for v2 package file format.
3417 (Dwo_file::read_unit_index): Likewise.
3418 (Dwo_file::sized_read_unit_index): Likewise.
3419 (Dwo_file::copy_section): Likewise.
3420 (Dwo_file::add_unit_set): Likewise.
3421 (Dwp_output_file::add_output_section): Likewise.
3422 (Dwp_output_file::add_contribution): Likewise.
3423 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3424 for empty slot.
3425 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3426 file format.
3427 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3428 slot.
3429 (Dwp_output_file::initialize): Remove unused function.
3430 (Dwp_output_file::finalize): Add support for v2 package file format.
3431 (Dwp_output_file::write_index): Likewise.
3432 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3433 function prototype.
3434
3435 2013-03-01 Cary Coutant <ccoutant@google.com>
3436
3437 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3438 function into class definition in header file.
3439 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3440 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3441 New function.
3442 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3443
3444 2013-02-28 Alan Modra <amodra@gmail.com>
3445
3446 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3447 * target.cc (Target::do_plt_fde_location): New function.
3448 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3449 accessor function, and constructor param.
3450 (struct Post_fde, Post_fdes): Declare.
3451 (Cie::write): Add post_fdes param.
3452 * ehframe.cc (Fde::write): Use plt_fde_location.
3453 (struct Post_fde): Define.
3454 (Cie::write): Stash FDEs added post merge mapping.
3455 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3456 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3457 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3458 other FDEs.
3459 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3460 (Target_powerpc::has_glink): New function.
3461 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3462 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3463 glink_eh_frame_fde_32, default_fde): New data.
3464 (Stub_table::eh_frame_added_): New var.
3465 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3466 Make const.
3467 (Stub_table::add_eh_frame): New function.
3468 (Output_data_glink::add_eh_frame): New function.
3469 (Target_powerpc::make_glink_section): Call add_eh_frame.
3470
3471 2013-02-15 Ian Lance Taylor <iant@google.com>
3472
3473 * options.h (DEFINE_uint64_alias): Define.
3474 (class General_options): Add -Ttext-segment as an alias for
3475 -Ttext.
3476
3477 2013-02-15 Alan Modra <amodra@gmail.com>
3478
3479 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3480 (Stub_table::do_write): ..here, two places.
3481 (Stub_table::plt_call_size): Use it here too.
3482
3483 2013-02-11 Ian Lance Taylor <iant@google.com>
3484
3485 * descriptors.cc (Descriptors::close_all): New function.
3486 * descriptors.h (class Descriptors): Declare close_all.
3487 (close_all_descriptors): New inline function.
3488 * plugin.cc: Include "descriptors.h".
3489 (Plugin_manager::cleanup): Call close_all_descriptors.
3490
3491 2013-02-06 Alan Modra <amodra@gmail.com>
3492
3493 * README: Update coding style link.
3494
3495 2013-01-28 Cary Coutant <ccoutant@google.com>
3496
3497 * dwp.cc (File_list): New typedef.
3498 (Dwo_name_info_reader): New class.
3499 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3500 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3501 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3502 (Dwo_file::read_executable): New function.
3503 (Dwo_file::read): Move common setup code to ...
3504 (Dwo_file::make_object): ... here.
3505 (dwp_options): Add --exec/-e.
3506 (usage): Likewise.
3507 (main): Likewise.
3508
3509 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3510
3511 * layout.cc (Layout::layout): Check for option text_reorder.
3512 (Layout::make_output_section): Ditto.
3513 * options.h (text_reorder): New option.
3514 * output.cc (Input_section_sort_compare): Remove special ordering
3515 of section names.
3516 (Output_section::
3517 Input_section_sort_section_name_special_ordering_compare::
3518 operator()): New function.
3519 (Output_section::sort_attached_input_sections): Use new sort function
3520 for .text.
3521 * output.h (Input_section_sort_section_name_special_ordering_compare):
3522 New struct.
3523 * testsuite/Makefile.am (text_section_grouping): Test option
3524 --no-text-reorder
3525 * testsuite/Makefile.in: Regenerate.
3526 * testsuite/text_section_grouping.sh: Check order of functions without
3527 default text reordering.
3528
3529 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3530
3531 * options.h (General_options): Change default to true for new_dtags.
3532
3533 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3534
3535 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3536 when enable_new_dtags is false. Only add DT_RUNPATH when
3537 enable_new_dtags is true.
3538
3539 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3540
3541 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3542 used in declaration and definition consistent.
3543 (Target_powerpc::symval_for_branch): Ditto.
3544
3545 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3546
3547 * testsuite/plugin_final_layout.cc: Fix comment.
3548
3549 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3550
3551 * layout.cc (Layout::layout): Do not do default sorting for
3552 text sections when section ordering is specified.
3553 (make_output_section): Ditto.
3554 * testsuite/plugin_final_layout.cc: Name the function sections
3555 to catch reordering issues.
3556
3557 2013-01-15 Alan Modra <amodra@gmail.com>
3558
3559 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3560 plt-thread-safe.
3561
3562 2013-01-15 Alan Modra <amodra@gmail.com>
3563
3564 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3565 * testsuite/Makefile.in: Regenerate.
3566
3567 2013-01-14 Alan Modra <amodra@gmail.com>
3568
3569 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3570 * testsuite/Makefile.in: Regenerate.
3571
3572 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3573
3574 PR bfd/14430
3575 Fix mingw gold build with plugins enabled
3576 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3577 * configure.ac: Export DLOPEN_LIBS and add headers check.
3578 * plugin.cc: Handle non-dlfcn case.
3579 * Makefile.in: Regenerate.
3580 * config.in: Regenerate.
3581 * configure: Regenerate.
3582 * testsuite/Makefile.in: Regenerate.
3583
3584 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3585
3586 * output.h (sort_attached_input_sections): Change to be public.
3587 * script-sections.cc
3588 (Output_section_definition::set_section_addresses): Sort
3589 attached input sections according to section order before linker
3590 script assigns section addresses.
3591 (Orphan_output_section::set_section_addresses): Sort
3592 attached input sections according to section order before linker
3593 script assigns section addresses.
3594 * Makefile.am (final_layout.sh): Use a simple linker script to
3595 check if section ordering still works.
3596 * Makefile.in: Regenerate.
3597
3598 2013-01-09 Ben Cheng <bccheng@google.com>
3599
3600 * arm.cc (Target_arm::attributes_accept_div): New function.
3601 (Target_arm::attributes_forbid_div): New function.
3602 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3603 attribute using the same new functions as what bfd/elf32_arm.c
3604 does.
3605
3606 2013-01-07 Cary Coutant <ccoutant@google.com>
3607
3608 PR gold/14993
3609 * output.cc (Output_section::add_input_section): For incremental
3610 updates, don't track input sections that are allocated from patch
3611 space.
3612
3613 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3614 Ian Lance Taylor <iant@google.com>
3615
3616 PR gold/14897
3617 * configure.ac (--enable-ld): Removed.
3618 (install_as_default): Set to yes only for --enable-gold=default
3619 or --disable-ld.
3620 * configure: Regenerated.
3621
3622 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3623
3624 * options.h (General_options): Add -fuse-ld= for GCC linker
3625 option compatibility.
3626
3627 2013-01-04 Cary Coutant <ccoutant@google.com>
3628
3629 * configure.ac: Fix typo restoring CXXFLAGS.
3630 * configure: Regenerate.
3631
3632 2013-01-04 Cary Coutant <ccoutant@google.com>
3633
3634 * testsuite/Makefile.am (CXXLINK_S): New macro.
3635 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3636 * testsuite/Makefile.in: Regenerate.
3637
3638 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3639
3640 * version.cc (print_version): Update copyright year to 2013.
3641
3642 2012-12-20 Ian Lance Taylor <iant@google.com>
3643
3644 * layout.cc (Layout::special_ordering_of_input_section): New
3645 function.
3646 (Layout::layout): If input section requires special ordering, must
3647 sort input sections.
3648 (Layout::make_output_section): May sort .text input sections.
3649 (Layout::is_section_name_prefix_grouped): Remove.
3650 * layout.h (class Layout): Declare
3651 special_ordering_of_input_section. Don't declare
3652 is_section_name_prefix_grouped.
3653 * output.cc (Output_section::add_input_section): Revert last
3654 change.
3655 (Output_section::Input_section_sort::match_file_name): Don't crash
3656 if called on output section data.
3657 (Output_section::Input_section_sort_compare): Sort based on
3658 special ordering.
3659 (Output_section::Input_section_sort_section_order_index_compare):
3660 Revert last patch.
3661 (Output_section::sort_attached_input_sections): Likewise.
3662
3663 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3664
3665 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3666 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3667 * output.cc (Output_section::add_input_section): Check if section
3668 name contains special prefix. Keep input sections to sort such
3669 sections.
3670 (Output_section::Input_section_sort_section_order_index_compare
3671 ::operator()): Group sections according to prefixes.
3672 (Output_section::sort_attached_input_sections): Add condition to
3673 Input_section_entry constructor call.
3674 * testsuite/Makefile.am (text_section_grouping): New test.
3675 * testsuite/Makefile.in: Regenerate.
3676 * testsuite/text_section_grouping.cc: New file.
3677 * testsuite/text_section_grouping.sh: New file.
3678
3679 2012-12-17 Nick Clifton <nickc@redhat.com>
3680
3681 * Makefile.am: Add copyright notice.
3682 * NEWS: Likewise.
3683 * README: Likewise.
3684 * configure.ac: Likewise.
3685 * ftruncate.c: Likewise.
3686 * Makefile.in: Regenerate.
3687
3688 2012-12-14 Cary Coutant <ccoutant@google.com>
3689
3690 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3691 --no-as-needed flag.
3692 (exception_separate_shared_12_test): Likewise.
3693 (incremental_copy_test): Likewise.
3694 * testsuite/Makefile.in: Regenerate.
3695
3696 2012-12-14 Cary Coutant <ccoutant@google.com>
3697
3698 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3699 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3700
3701 2012-12-12 Alan Modra <amodra@gmail.com>
3702
3703 * powerpc.cc (class Track_tls): New.
3704 (class Relocate, class Scan): Inherit Track_tls.
3705 (Target_powerpc::Scan::local, global): Track tls optimization
3706 and avoid creating plt entry for __tls_get_addr if all uses
3707 are optimized away.
3708 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3709
3710 2012-12-12 Alan Modra <amodra@gmail.com>
3711
3712 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3713 Replace no_toc_optimize with toc_optimize.
3714 * output.h (Output_section::input_sections): Provide non-const variant.
3715 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3716 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3717 accessors.
3718 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3719 (class Sort_toc_sections): New.
3720 (Target_powerpc::do_finalize_sections): Sort toc sections.
3721 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3722
3723 2012-12-10 Roland McGrath <mcgrathr@google.com>
3724
3725 * testsuite/binary_unittest.cc (read_all): New function.
3726 (Sized_binary_test): Use it instead of ::read.
3727 * fileread.cc (do_read): Don't assume pread always reads the whole
3728 amount in a single call.
3729
3730 2012-12-10 Alan Modra <amodra@gmail.com>
3731
3732 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3733 Set EM_PPC64 or EM_PPC here.
3734 (Target_selector_powerpc::do_recognize): Delete.
3735
3736 2012-12-10 Alan Modra <amodra@gmail.com>
3737
3738 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3739 stub_table_.
3740 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3741
3742 2012-12-07 Roland McGrath <mcgrathr@google.com>
3743
3744 * testsuite/binary_unittest.cc (Sized_binary_test):
3745 Use open_descriptor rather than ::open.
3746
3747 2012-12-07 Alan Modra <amodra@gmail.com>
3748
3749 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3750 typedef and invalid_address constant.
3751 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3752 instantiate constants.
3753
3754 2012-12-06 Roland McGrath <mcgrathr@google.com>
3755
3756 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3757 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3758 * aclocal.m4: Regenerate.
3759 * configure: Regenerate.
3760 * Makefile.in: Regenerate.
3761 * testsuite/Makefile.in: Regenerate.
3762
3763 2012-12-07 Alan Modra <amodra@gmail.com>
3764
3765 * options.h (General_options): Add no_toc_optimize.
3766 * powerpc.cc (ok_lo_toc_insn): New function.
3767 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3768
3769 2012-12-06 Alan Modra <amodra@gmail.com>
3770
3771 * options.h (General_options): Add plt_align, plt_static_chain,
3772 plt_thread_safe. Update stub_group_size help text.
3773 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3774 for new plt_thread_safe_ var.
3775 (use_plt_offset): Correct comments.
3776 (Target_powerpc::do_relax): Look for thread creation symbols to
3777 determine default plt_thread_safe value. Clear plt call stubs
3778 as well as branch stubs each iteration.
3779 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3780 insn constants.
3781 (l, hi, ha, write_insn): Move earlier.
3782 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3783 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3784 plt stubs too.
3785 (Stub_table::update_size): Adjust.
3786 (Stub_table::prev_size, set_prev_size): Delete.
3787 (Stub_table::stub_align): Let --plt-align affect result.
3788 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3789 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3790 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3791 (Stub_table::do_write): Support more stub variants.
3792
3793 2012-12-04 Alan Modra <amodra@gmail.com>
3794
3795 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3796 (Target_powerpc::do_define_standard_symbols): New function.
3797
3798 2012-12-03 Alan Modra <amodra@gmail.com>
3799
3800 * output.h: Formatting, whitespace.
3801
3802 2012-12-03 Alan Modra <amodra@gmail.com>
3803
3804 * layout.h (Layout::get_executable_sections): Declare.
3805 * layout.cc (Layout::get_executable_sections): New function.
3806 * arm.cc (Target_arm::group_sections): Use it.
3807 (Arm_output_section::group_sections): Delete now redundant test.
3808 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3809 param to handle relative relocs.
3810 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3811 (Output_data_reloc::add_absolute): Adjust.
3812 (Output_data_reloc::add_relative): New function.
3813 (Output_data::reset_data_size): New function.
3814 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3815 (Output_section::set_addralign): New function.
3816 (Output_section::checkpoint_set_addralign): New function.
3817 (Output_section::clear_section_offsets_need_adjustment): New function.
3818 (Output_section::input_sections): Make public.
3819 * powerpc.cc (class Output_data_brlt_powerpc): New.
3820 (class Stub_table, class Stub_control): New.
3821 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3822 stub_table_, set_stub_table, stub_table): New vectors and accessor
3823 functions.
3824 (Target_powerpc::do_may_relax, do_relax, push_branch,
3825 new_stub_table, stub_tables, brlt_section, group_sections,
3826 add_branch_lookup_table, find_branch_lookup_table,
3827 write_branch_lookup_table, make_brlt_section): New functions.
3828 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3829 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3830 branch_info_): New vars.
3831 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3832 make call stubs here.
3833 (Output_data_glink): Remove all call stub handling from this class.
3834 (Target_powerpc::Scan::local, global): Save interesting branch
3835 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3836 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3837 functions on final link.
3838 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3839 Handle long branch destinations too.
3840 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3841 do_plt_address_for_local): Adjust lookup of plt call stubs.
3842
3843 2012-11-30 Alan Modra <amodra@gmail.com>
3844
3845 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3846 relocs against protected symbols when building 32-bit shared libs.
3847
3848 2012-11-30 Alan Modra <amodra@gmail.com>
3849
3850 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3851 param. Call got_section() to make .got. Update all callers
3852 and their callers and so on.
3853
3854 2012-11-30 Alan Modra <amodra@gmail.com>
3855
3856 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3857 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3858 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3859 value if it already exists.
3860
3861 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3862
3863 PR gold/14858
3864 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3865
3866 2012-11-14 Roland McGrath <mcgrathr@google.com>
3867
3868 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3869 than bfc instruction for data sandboxing.
3870
3871 2012-11-08 Alan Modra <amodra@gmail.com>
3872
3873 * po/POTFILES.in: Regenerate.
3874
3875 2012-11-05 Alan Modra <amodra@gmail.com>
3876
3877 * configure.ac: Apply 2012-09-10 change to config.in here.
3878 * configure: Regenerate.
3879
3880 2012-11-05 Alan Modra <amodra@gmail.com>
3881
3882 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3883 (struct Opd_ent): Use "Address" rather than "Offset".
3884 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3885 (Target_powerpc::got_section): Make public.
3886 (Target_powerpc::scan_relocs): Move code setting symbols..
3887 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3888 Create _SDA_BASE_ only when referenced.
3889
3890 2012-11-02 Roland McGrath <mcgrathr@google.com>
3891
3892 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3893 from last change.
3894
3895 2012-11-01 Roland McGrath <mcgrathr@google.com>
3896
3897 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3898 for offset_in_output_section parameter.
3899 (Sized_target::relocate_special_relocatable): Likewise.
3900 * arm.cc (Target_arm::relocate_relocs): Likewise.
3901 (Target_arm::relocate_special_relocatable): Likewise.
3902 * i386.cc (Target_i386::relocate_relocs): Likewise.
3903 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3904 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3905 * target-reloc.h (relocate_relocs): Likewise.
3906 * testsuite/testfile.cc (Target_test): Likewise.
3907 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3908 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3909
3910 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3911 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3912
3913 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3914 parameter, which is unused in the [!F_SETFD] case.
3915
3916 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3917 SYMNDX to off_t before comparing it to this->data_size().
3918 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3919 * incremental.cc (Output_section_incremental_inputs::do_write):
3920 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3921
3922 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3923
3924 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3925
3926 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3927 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3928 in EABI_VER5.
3929
3930 2012-10-29 Cary Coutant <ccoutant@google.com>
3931
3932 * dwp.cc (usage): Add file and exit status parameters;
3933 add --help and --version options.
3934 (print_version): New function.
3935 (main): Add --help and --version options.
3936
3937 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3938
3939 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3940 final_layout_sequence.txt.
3941 * testsuite/Makefile.in: Regenerated.
3942
3943 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3944
3945 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3946 COMPILE generated by automake.
3947 (LINK1): Likewise.
3948 (CXXCOMPILE1): Likewise.
3949 (CXXLINK1): Likewise.
3950 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3951 (LINK): Likewise.
3952 (CXXCOMPILE): Likewise.
3953 (CXXLINK): Likewise.
3954 * testsuite/Makefile.in: Regenerated.
3955
3956 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3957
3958 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3959 on bad fwrite return.
3960
3961 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3962
3963 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3964 on val.
3965
3966 2012-10-23 Cary Coutant <ccoutant@google.com>
3967
3968 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3969 * testsuite/Makefile.in: Regenerate.
3970 * testsuite/dwp_test.h: New source file.
3971 * testsuite/dwp_test_1.cc: New source file.
3972 * testsuite/dwp_test_1.s: New source file.
3973 * testsuite/dwp_test_1.sh: New source file.
3974 * testsuite/dwp_test_1b.cc: New source file.
3975 * testsuite/dwp_test_1b.s: New source file.
3976 * testsuite/dwp_test_2.cc: New source file.
3977 * testsuite/dwp_test_2.s: New source file.
3978 * testsuite/dwp_test_2.sh: New source file.
3979 * testsuite/dwp_test_main.cc: New source file.
3980 * testsuite/dwp_test_main.s: New source file.
3981
3982 2012-10-23 Cary Coutant <ccoutant@google.com>
3983
3984 * dwp.h: New header file.
3985 * dwp.cc: New source file.
3986 * gold.h: Move shared declarations to system.h.
3987 * system.h: New header file.
3988 * Makefile.am: Add dwp.
3989 * Makefile.in: Regenerate.
3990
3991 2012-10-23 Cary Coutant <ccoutant@google.com>
3992
3993 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3994 Dwarf_info_reader::read_from_pointer.
3995 (Dwarf_pubnames_table::read_header): Likewise.
3996 (Dwarf_pubnames_table::next_name): Likewise.
3997 (Dwarf_die::read_attributes): Likewise.
3998 (Dwarf_die::skip_attributes): Likewise.
3999 (Dwarf_info_reader::read_from_pointer): New function template.
4000 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4001 (Dwarf_pubnames_table): Likewise.
4002 (Dwarf_info_reader::read_from_pointer): New function template.
4003 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4004 Dwarf_pubnames_table ctor.
4005
4006 2012-10-23 Cary Coutant <ccoutant@google.com>
4007
4008 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4009 abbrev_shndx.
4010 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4011 abbrev_shndx_.
4012 (Dwarf_info_reader::set_abbrev_shndx): New method.
4013 (Dwarf_info_reader::abbrev_shndx_): New data member.
4014
4015 2012-10-23 Cary Coutant <ccoutant@google.com>
4016
4017 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4018 from object, not parameters.
4019 (Dwarf_info_reader::parse): Likewise.
4020 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4021 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4022 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4023 methods.
4024
4025 2012-10-23 Cary Coutant <ccoutant@google.com>
4026
4027 * fileread.cc (Input_file::Input_file): New constructor.
4028 * fileread.h (class Input_file): Add new constructor.
4029
4030 2012-10-18 Alan Modra <amodra@gmail.com>
4031
4032 PR gold/14727
4033 * object.cc (Relobj::is_section_name_included): Also match
4034 .sdata personality section.
4035
4036 2012-10-18 Alan Modra <amodra@gmail.com>
4037
4038 * target-reloc.h (class Default_comdat_behavior): New, package up..
4039 (get_comdat_behaviour): ..this.
4040 (relocate_section): Add Relocate_comdat_behavior template arg,
4041 adjust code to suit.
4042 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4043 (Target_arm::scan_reloc_section): Likewise.
4044 * i386.cc (Target_i386::relocate_section): Likewise.
4045 * sparc.cc (Target_sparc::relocate_section): Likewise.
4046 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4047 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4048 * powerpc.cc (class Relocate_comdat_behavior): New.
4049 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4050 gold::relocate_section with new template arg.
4051
4052 2012-10-18 Alan Modra <amodra@gmail.com>
4053
4054 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4055 dynamic relocs for GOT_TPREL got entries, without symbol if
4056 resolving locally.
4057 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4058 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4059 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4060
4061 2012-10-17 Alan Modra <amodra@gmail.com>
4062
4063 PR gold/14726
4064 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4065
4066 2012-10-16 Sriraman Tallam <tmsriram@google.com>
4067
4068 * layout.cc (Layout::include_section): Keep sections marked
4069 SHF_EXCLUDE when doing relocatable links.
4070
4071 2012-10-16 Alan Modra <amodra@gmail.com>
4072
4073 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4074 (Target_powerpc::do_finalize_sections): Call it.
4075 (Output_data_save_res): New class and supporting functions.
4076 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4077 normal symbols defined in object files.
4078
4079 2012-10-12 Alan Modra <amodra@gmail.com>
4080
4081 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4082 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4083 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4084 section if scan_opd_relocs not yet called.
4085 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4086
4087 2012-10-12 Alan Modra <amodra@gmail.com>
4088
4089 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4090 add_local_ifunc_entry): Revert last change.
4091 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4092
4093 2012-10-05 Alan Modra <amodra@gmail.com>
4094
4095 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4096 do_plt_address_for_global): New functions.
4097 (Output_data_got_powerpc::do_write): Don't segfault when linking
4098 statically.
4099 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4100 add_local_ifunc_entry): Return true on adding entry..
4101 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4102 glink->add_entry call. Remove unused symtab param. Adjust calls.
4103 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4104 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4105 set up symbols here.
4106 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4107 syms here. Do so even when no .iplt. Don't segfault when linking
4108 statically.
4109 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4110 new variants without reloc param.
4111 (Glink_sym_ent::Glink_sym_ent): Likewise.
4112 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4113 reloc when refs will resolve to plt call stub.
4114 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4115 R_PPC_PLTREL24 to resolve locally.
4116 (Target_powerpc::Scan::global): Correct ifunc handling.
4117 (Target_powerpc::Relocate::relocate): Correct local sym glink
4118 lookup. Don't destroy "value" when we have a plt call stub,
4119 and when checking plt call validity.
4120 (Target_powerpc::do_dynsym_value): Simplify.
4121
4122 2012-10-05 Alan Modra <amodra@gmail.com>
4123
4124 * i386.cc (Output_data_plt_i386::address_for_global,
4125 address_for_local): Add plt offset to returned value. Adjust uses.
4126 * sparc.cc (Output_data_plt_sparc::address_for_global,
4127 address_for_local): Likewise.
4128 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4129 address_for_local): Likewise.
4130 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4131 address_for_local): Likewise.
4132 * target.h (Target::plt_address_for_global, plt_address_for_local):
4133 Update comment.
4134 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4135 (Output_data_got::Got_entry::write): Nor here.
4136 * output.h: Comment fix.
4137
4138 2012-10-02 Jiong Wang <jiwang@tilera.com>
4139
4140 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4141 global_offset_table_ value for larget got.
4142 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4143
4144 2012-09-29 Alan Modra <amodra@gmail.com>
4145
4146 * powerpc.cc (Target_powerpc::iplt_): New output section.
4147 (Target_powerpc::iplt_section, make_iplt_section,
4148 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4149 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4150 Target_powerpc::plt_entry_count): Count iplt entries too.
4151 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4152 reloc section in constructor. New params.
4153 (Target_powerpc::make_plt_section): Create reloc section here instead.
4154 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4155 functions.
4156 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4157 (Output_data_glink::add_entry, find_entry): New functions to
4158 deal with local syms.
4159 (Glink_sym_ent): Add support for local syms.
4160 (Output_data_glink::do_write): Handle ifunc plt entries.
4161 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4162 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4163 (Target_powerpc::Relocate::relocate): Likewise.
4164 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4165
4166 2012-09-25 Alan Modra <amodra@gmail.com>
4167
4168 * object.h (Sized_relobj_file::adjust_local_symbol,
4169 do_adjust_local_symbol): New functions.
4170 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4171 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4172 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4173 and irregular opd entry spacing.
4174 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4175 (Global_symbol_visitor_opd): New functor.
4176 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4177 on deleted opd entries.
4178
4179 2012-09-15 Jiong Wang <jiwang@tilera.com>
4180
4181 * tilegx.cc: New file.
4182 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4183 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4184 * configure.tgt: Add entries for tilegx*.
4185 * configure.ac: Likewise.
4186 * Makefile.in: Rebuild.
4187 * configure: Likewise.
4188 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4189 tilegx.
4190
4191 2012-09-13 Alan Modra <amodra@gmail.com>
4192
4193 * target-reloc.h (scan_relocs): Call scan.local for relocs
4194 against symbols in discarded sections. Pass is_discarded
4195 param.
4196 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4197 Add is_discarded param.
4198 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4199 is_discarded to flag opd entry as discarded. Don't emit dyn
4200 relocs on such entries.
4201 (Target_powerpc::Scan::global): Similarly detect and handle
4202 such opd entries.
4203 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4204 opd_ent_. Update all uses.
4205 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4206 (Target_powerpc::relocate_section): Zero out discarded opd
4207 entry relocs.
4208
4209 2012-09-12 Ian Lance Taylor <iant@google.com>
4210
4211 PR gold/14570
4212 * output.cc: Rename Output_data_got template parameter from size
4213 to got_size for all functions. Compile all variants of
4214 Output_data_got.
4215 (Output_data_got::Got_entry::write): Correct use of size for
4216 symbol value. Use local_is_tls rather than casting to
4217 Sized_relobj_file.
4218 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4219 (class Sized_relobj_file): Add do_local_is_tls.
4220 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4221
4222 2012-09-11 Alan Modra <amodra@gmail.com>
4223
4224 PR gold/14566
4225 * layout.cc (Layout::set_segment_offsets): When using
4226 common-page-size alignment, ensure we are on a new max-page-size
4227 page.
4228 * output.cc (Output_segment::set_section_addresses): Use
4229 abi_pagesize, not common_pagesize for relro boundary.
4230 (Output_segment::set_offset): Likewise.
4231
4232 2012-09-11 Alan Modra <amodra@gmail.com>
4233
4234 * output.h (Output_data_got::add_global_tls, add_local_tls,
4235 add_local_tls_pair): New functions.
4236 (Output_data_got::add_local_pair_with_rel): Remove second
4237 reloc param. Expand comment.
4238 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4239 use_plt_or_tls_offset_, similarly for constructor param.
4240 (Output_data_got::Got_entry::write): Add got_index param.
4241 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4242 add_local_tls_pair): New functions.
4243 (Output_data_got::Got_entry::write): Handle tls symbols
4244 with use_plt_or_tls_offset_ set specially.
4245 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4246 (Output_data_got::do_write): Replace iterator with index, pass
4247 index to entry write function.
4248 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4249 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4250 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4251 call.
4252 * i386.cc (Target_i386::Scan::local): Likewise.
4253 * sparc.cc (Target_sparc::Scan::local): Likewise.
4254 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4255 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4256 do_tls_offset_for_global): New functions.
4257 (Target_powerpc::Scan::local): Correct TLS relocations and got
4258 entry values.
4259 (Target_powerpc::Scan::global): Don't emit unnecessary
4260 dynamic relocations on TLS GOT entries.
4261
4262 2012-09-10 Matthias Klose <doko@ubuntu.com>
4263
4264 * config.in: Disable sanity check for kfreebsd.
4265
4266 2012-09-10 Sterling Augustine <saugustine@google.com>
4267
4268 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4269 (Gdb_index::pubtypes_read): New parameter.
4270 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4271 to calls.
4272 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4273 pubtypes_object_.
4274
4275 2012-09-09 Alan Modra <amodra@gmail.com>
4276
4277 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4278 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4279 * gc.h (gc_process_relocs): Call target gc_add_reference.
4280 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4281 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4282 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4283 unnecessary cast.
4284 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4285 to cater for when we don't need code offset. Update use.
4286 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4287 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4288 set_opd_valid): New functions.
4289 (Target_powerpc::do_gc_add_reference): New function.
4290 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4291 stashed refs.
4292 (Target_powerpc::do_gc_mark_symbol): New function.
4293
4294 2012-09-06 Cary Coutant <ccoutant@google.com>
4295
4296 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4297 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4298 (Dwarf_die::skip_attributes): Likewise.
4299 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4300 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4301 (main): Call it.
4302 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4303
4304 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4305
4306 * testsuite/script_test_3.t: Add .got.plt output section
4307 statement.
4308 * testsuite/script_test_4.t: Likewise.
4309
4310 2012-09-05 Alan Modra <amodra@gmail.com>
4311
4312 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4313 update all uses and lose "enum" when using type.
4314
4315 2012-09-05 Alan Modra <amodra@gmail.com>
4316
4317 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4318 * configure: Regenerate.
4319 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4320 (plugin_final_layout.stdout): Likewise.
4321 (memory_test): Set page sizes to 0x1000.
4322 * testsuite/Makefile.in: Regenerate.
4323 * testsuite/discard_locals_test.sh: Add FIXME comment.
4324 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4325 * testsuite/pr14265.t: Add .got output section statement.
4326 * testsuite/script_test_2.t: Likewise.
4327 * testsuite/script_test_3.t: Likewise.
4328 * testsuite/script_test_4.t: Likewise.
4329 * testsuite/script_test_5.t: Likewise.
4330 * testsuite/script_test_6.t: Likewise.
4331 * testsuite/script_test_7.t: Likewise.
4332 * testsuite/script_test_9.t: Likewise.
4333
4334 2012-09-05 Alan Modra <amodra@gmail.com>
4335
4336 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4337 (Powerpc_relocate_functions::Status): New typedef.
4338 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4339 (Target_powerpc::Scan::local): Handle REL64.
4340 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4341 for REL32 and REL64.
4342 (Target_powerpc::symval_for_branch): New function, extracted from..
4343 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4344 checks. Report overflow errors.
4345
4346 2012-09-05 Alan Modra <amodra@gmail.com>
4347
4348 * object.h (Sized_relobj_file::emit_relocs): Delete.
4349 (Sized_relobj_file::emit_relocs_reltype): Delete.
4350 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4351 relocate_relocs for --emit-relocs.
4352 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4353 * output.h: Update comment.
4354 (Output_segment::first_section): New function.
4355 (Output_segment::first_section_load_address): Use first_section.
4356 * output.cc (Output_segment::first_section): New function extracted..
4357 (Output_segment::first_section_load_address): ..from here. Delete.
4358 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4359 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4360 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4361 adjust call to target.h function.
4362 * i386.cc (Target_i386): Likewise.
4363 * sparc.cc (Target_sparc): Likewise.
4364 * x86_64.cc (Target_x86_64): Likewise.
4365 * powerpc.cc (Target_powerpc): Likewise.
4366 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4367 first tls section has section symbol for optimised local dynamic
4368 output relocs.
4369 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4370 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4371 optimised tls code.
4372 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4373 Rename to relocate_relocs. Update error message.
4374
4375 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4376
4377 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4378 --just-symbols.
4379
4380 2012-08-31 Alan Modra <amodra@gmail.com>
4381
4382 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4383 (Powerpc_relobj::toc_base_offset): New stub function.
4384 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4385 got_mod_index_offset to tlsld_got_offset. Update all refs.
4386 (Target_powerpc::Relocate::enum skip_tls): New.
4387 (Target_powerpc::call_tls_get_addr_): New var.
4388 (Target_powerpc::is_branch_reloc): Move to file scope.
4389 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4390 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4391 New functions.
4392 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4393 (powerpc_info): Correct common_pagesize for ppc64.
4394 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4395 (Powerpc_relocate_functions): Add overflow check enums and functions.
4396 Add non-shift version of rela, rela_ua. Delete all rel public
4397 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4398 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4399 addr16_ha3, addr14 functions.
4400 (Output_data_got_powerpc::add_constant_pair): New function.
4401 (Output_data_got_powerpc::got_base_offset): Likewise.
4402 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4403 (instruction constants): Sort, add some more.
4404 (Output_data_glink::do_write): Add and use Address typedef. Use
4405 object->toc_base_offset() stub for 64-bit.
4406 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4407 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4408 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4409 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4410 Always treat .opd relocs as against locally defined symbol.
4411 Correct condition for RELATIVE relocs.
4412 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4413 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4414 for 32-bit syms with a plt entry. Correct ppc64 toc base
4415 calculations. Handle TLS relocs, and more. Add overflow
4416 checking and adjust for Powerpc_relocate_functions changes.
4417 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4418 Reinstate --emit-relocs code with FIXME.
4419
4420 2012-08-30 Alan Modra <amodra@gmail.com>
4421
4422 * layout.cc (Layout::set_segment_offsets): Set p_align to
4423 abi_pagesize, not common_pagesize.
4424 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4425 to determine whether file header can go in segment.
4426
4427 2012-08-30 Alan Modra <amodra@gmail.com>
4428
4429 * output.h (Output_reloc::Output_reloc <output section>): Add
4430 is_relative param. Adjust calls.
4431 (Output_reloc::add_output_section_relative): New functions.
4432 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4433 is_relative.
4434 (Output_reloc::symbol_value): Handle SECTION_CODE.
4435
4436 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4437
4438 * gold.cc (queue_middle_tasks): Call layout again when unique
4439 segments for sections is desired.
4440 * layout.cc (Layout::Layout): Initialize new members.
4441 (Layout::get_output_section_flags): New function.
4442 (Layout::choose_output_section): Call get_output_section_flags.
4443 (Layout::layout): Make output section for mapping to a unique segment.
4444 (Layout::insert_section_segment_map): New function.
4445 (Layout::attach_allocated_section_to_segment): Make unique segment for
4446 output sections marked so.
4447 (Layout::segment_precedes): Check for unique segments when sorting.
4448 * layout.h (Layout::Unique_segment_info): New struct.
4449 (Layout::Section_segment_map): New typedef.
4450 (Layout::insert_section_segment_map): New function.
4451 (Layout::get_output_section_flags): New function.
4452 (Layout::is_unique_segment_for_sections_specified): New function.
4453 (Layout::set_unique_segment_for_sections_specified): New function.
4454 (Layout::unique_segment_for_sections_specified_): New member.
4455 (Layout::section_segment_map_): New member.
4456 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4457 Rename is_gc_pass_one to is_pass_one.
4458 Rename is_gc_pass_two to is_pass_two.
4459 Rename is_gc_or_icf to is_two_pass.
4460 Check for which pass based on whether symbols data is present.
4461 Make it two pass when unique segments for sections is desired.
4462 * output.cc (Output_section::Output_section): Initialize new
4463 members.
4464 * output.h (Output_section::is_unique_segment): New function.
4465 (Output_section::set_is_unique_segment): New function.
4466 (Output_section::is_unique_segment_): New member.
4467 (Output_section::extra_segment_flags): New function.
4468 (Output_section::set_extra_segment_flags): New function.
4469 (Output_section::extra_segment_flags_): New member.
4470 (Output_section::segment_alignment): New function.
4471 (Output_section::set_segment_alignment): New function.
4472 (Output_section::segment_alignment_): New member.
4473 (Output_segment::Output_segment): Initialize is_unique_segment_.
4474 (Output_segment::is_unique_segment): New function.
4475 (Output_segment::set_is_unique_segment): New function.
4476 (Output_segment::is_unique_segment_): New member.
4477 * plugin.cc (allow_unique_segment_for_sections): New function.
4478 (unique_segment_for_sections): New function.
4479 (Plugin::load): Add new functions to transfer vector.
4480 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4481 * Makefile.in: Regenerate.
4482 * testsuite/plugin_final_layout.sh: Check if unique segment
4483 functionality works.
4484 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4485 are available.
4486 (allow_unique_segment_for_sections): New global.
4487 (unique_segment_for_sections): New global.
4488 (claim_file_hook): Call allow_unique_segment_for_sections.
4489 (all_symbols_read_hook): Call unique_segment_for_sections.
4490
4491 2012-08-22 Cary Coutant <ccoutant@google.com>
4492
4493 * layout.cc (Layout::include_section): Don't assert on GROUP
4494 sections with --emit-relocs.
4495
4496 2012-08-21 Cary Coutant <ccoutant@google.com>
4497
4498 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4499 if --export-dynamic-symbol names an undef symbol.
4500
4501 2012-08-18 Alan Modra <amodra@gmail.com>
4502
4503 * powerpc.cc: Formatting and white space.
4504 (Powerpc_relobj): Rename got2_section_ to special_.
4505 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4506 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4507 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4508 (Target_powerpc): Add Address typedef and invalid_address. Use
4509 throughout.
4510 (Target_powerpc::is_branch_reloc): New function.
4511 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4512 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4513 for dst_mask, value and addend.
4514 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4515 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4516 (Output_data_glink::do_write): Correct toc base. Don't try to use
4517 uint16_t for 24-bit offset. Use get_output_section_offset and
4518 check return.
4519 (Target_powerpc::Scan::local): Handle more relocs.
4520 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4521 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4522 Plug in toc restoring insn after plt calls. Translate branches
4523 to function descriptor symbols to corresponding entry point.
4524 (Target_powerpc::relocate_for_relocatable): Check return from
4525 get_output_section_offset.
4526 * symtab.h: Comment typo.
4527
4528 2012-08-14 Ian Lance Taylor <iant@google.com>
4529
4530 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4531 unsupported_relocal_local to call unsupported_reloc_global.
4532
4533 2012-08-14 Nick Clifton <nickc@redhat.com>
4534
4535 PR ld/14265
4536 * script-sections.cc (Sections_element::output_section_name): Add
4537 keep return parameter.
4538 (Output_section_element::match_name): Add keep return parameter.
4539 Return the value of the keep_ member.
4540 * script-sections.h (class Output_section): Update
4541 output_section_name prototype.
4542 * layout.cc (Layout::keep_input_section): New public member
4543 function.
4544 (Layout::choose_output_section): Pass keep parameter to
4545 output_section_name.
4546 * layout.h (class Layout): Add keep_input_section.
4547 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4548 sections.
4549 * testsuite/Makefile.am: Add a test.
4550 * testsuite/Makefile.in: Regenerate.
4551 * testsuite/pr14265.c: Source file for the test.
4552 * testsuite/pr14265.t: Linker script for the test.
4553 * testsuite/pr14265.sh: Shell script for the test.
4554
4555 2012-08-14 Alan Modra <amodra@gmail.com>
4556
4557 * target.h (Target::output_section_name): New function.
4558 (Target::do_output_section_name): New function.
4559 * layout.cc (Layout::choose_output_section): Call the above.
4560 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4561
4562 2012-08-14 Alan Modra <amodra@gmail.com>
4563
4564 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4565 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4566 for replace_constant call.
4567 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4568 (Output_data_glink::do_print_to_mapfile): New function.
4569 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4570 (Target_powerpc::Relocate::relocate): Likewise.
4571
4572 2012-08-14 Alan Modra <amodra@gmail.com>
4573
4574 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4575 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4576 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4577 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4578 all references to shndx_. Handle special case for R_PPC_PLTREL24
4579 here.
4580 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4581 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4582 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4583 here.
4584 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4585 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4586
4587 2012-08-12 Alan Modra <amodra@gmail.com>
4588
4589 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4590 (glink insn constants): Use uint32_t.
4591 (Output_data_glink::add_entry): Use insert, not [] operator.
4592
4593 2012-08-11 Alan Modra <amodra@gmail.com>
4594
4595 * object.h (Sized_relobj_file::find_shdr): New function.
4596 (Sized_relobj_file::find_special_sections): New function.
4597 * object.cc (Sized_relobj_file::find_shdr): New function.
4598 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4599 (Sized_relobj_file::find_special_sections): New function, split out..
4600 (Sized_relobj_file::do_read_symbols): ..from here.
4601 * output.h (Output_data_got::replace_constant): New function.
4602 (Output_data_got::num_entries): New function.
4603 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4604 (Output_data_got::got_offset): Protected rather than private.
4605 (Output_data_got::replace_got_entry): New function.
4606 * output.cc (Output_data_got::replace_got_entry): New function.
4607 * powerpc.cc (class Powerpc_relobj): New.
4608 (class Powerpc_relocate_functions): Delete all psymval variants or
4609 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4610 Implement _ha functions using corresponding _hi function.
4611 (Powerpc_relobj::find_special_sections): New function.
4612 (Target_powerpc::do_make_elf_object): New function.
4613 (class Output_data_got_powerpc): New.
4614 (class Output_data_glink): New.
4615 (class Powerpc_scan_relocatable_reloc): New.
4616 Many more changes througout file.
4617
4618 2012-08-09 Nick Clifton <nickc@redhat.com>
4619
4620 * po/vi.po: Updated Vietnamese translation.
4621
4622 2012-08-07 Ian Lance Taylor <iant@google.com>
4623
4624 * layout.cc (Layout::add_target_dynamic_tags): If
4625 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4626 plt_rel.
4627
4628 2012-07-30 Nick Clifton <nickc@redhat.com>
4629
4630 * po/gold.pot: Updated template.
4631 * po/es.po: Updated Spanish translation.
4632
4633 2012-07-18 Cary Coutant <ccoutant@google.com>
4634
4635 PR gold/14344
4636 * configure.ac: Add check for -gpubnames support.
4637 * configure: Regenerate.
4638 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4639 support; force -gno-pubnames.
4640 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4641 support.
4642 (gdb_index_test_4): New test.
4643 * testsuite/Makefile.in: Regenerate.
4644 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4645 * testsuite/gdb_index_test_2.sh: Likewise.
4646 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4647 * testsuite/gdb_index_test_4.sh: New script.
4648 * testsuite/gdb_index_test_comm.sh: New script with common code;
4649 don't look for space after colon.
4650
4651 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4652
4653 * gold.cc (queue_middle_tasks): Update function order only after
4654 deferred objects due to plugins are processed.
4655
4656 2012-07-11 Ian Lance Taylor <iant@google.com>
4657
4658 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4659 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4660 (Target_arm::scan_reloc_for_stub): Likewise.
4661 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4662 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4663 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4664 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4665 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4666
4667 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4668 Ian Lance Taylor <iant@google.com>
4669
4670 PR gold/14309
4671 * configure.ac: Test whether std::tr1::hash<off_t> works.
4672 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4673 needed.
4674 * output.h (class Output_fill): Add virtual destructor.
4675 * configure, config.in: Rebuild.
4676
4677 2012-06-22 Roland McGrath <mcgrathr@google.com>
4678
4679 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4680
4681 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4682
4683 * plugin.cc (Plugin::load): Handle position independent executables.
4684
4685 2012-06-06 Cary Coutant <ccoutant@google.com>
4686
4687 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4688 add .debug_macro.
4689 (lines_only_debug_sections): Likewise.
4690 (gdb_fast_lookup_sections): New static array.
4691 (is_gdb_debug_section): Rename formal parameter.
4692 (is_lines_only_debug_section): Likewise.
4693 (is_gdb_fast_lookup_section): New function.
4694 (Layout::include_section): Check for ".zdebug_" prefix; pass
4695 section name suffix to is_gdb_debug_section, et al.; check for
4696 fast-lookup sections when building .gdb_index.
4697 * options.h (--strip-debug-gdb): Update GDB version number.
4698
4699 2012-06-06 Cary Coutant <ccoutant@google.com>
4700
4701 * configure.ac: Add check for fallocate.
4702 * configure: Regenerate.
4703 * config.in: Regenerate.
4704
4705 * options.h (class General_options): Add --mmap-output-file and
4706 --posix-fallocate options.
4707 * output.cc: (posix_fallocate): Remove; replace with...
4708 (gold_fallocate): New function.
4709 (Output_file::map_no_anonymous): Call gold_fallocate.
4710 (Output_file::map): Check --mmap-output-file option.
4711
4712 2012-06-05 Jing Yu <jingyu@google.com>
4713
4714 * gold.h (textdomain): Add do {} to empty while(0).
4715 (bindtextdomain): Likewise.
4716
4717 2012-06-04 Cary Coutant <ccoutant@google.com>
4718
4719 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4720 has_dynsym_index.
4721
4722 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4723
4724 * symtab.cc (Symbol_table::define_special_symbol):
4725 Initialize *poldsym to prevent uninitialized variable errors.
4726
4727 2012-05-23 Cary Coutant <ccoutant@google.com>
4728
4729 * layout.cc (Layout::section_name_mapping): Add rules to handle
4730 exact match on .data.rel.ro.local or .data.rel.ro.
4731 (Layout::output_section_name): Check for exact matches.
4732
4733 2012-05-23 Cary Coutant <ccoutant@google.com>
4734
4735 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4736 more carefully.
4737
4738 2012-05-22 Cary Coutant <ccoutant@google.com>
4739
4740 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4741 object before exporting symbol.
4742
4743 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4744
4745 * testsuite/tls_test.cc: Include "config.h" first.
4746 * testsuite/tls_test_c.c: Likewise.
4747
4748 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4749 Nick Clifton <nickc@redhat.com>
4750
4751 PR 14072
4752 * configure.in: Add check that sysdep.h has been included before
4753 any system header files.
4754 * configure: Regenerate.
4755 * config.in: Regenerate.
4756
4757 2012-05-14 Cary Coutant <ccoutant@google.com>
4758
4759 * layout.cc (Layout::make_output_section): Mark .tdata section
4760 as RELRO.
4761 * testsuite/relro_test.cc: Add a TLS variable.
4762
4763 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4764
4765 PR gold/14091
4766 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4767 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4768 R_X86_64_64.
4769
4770 2012-05-08 Cary Coutant <ccoutant@google.com>
4771
4772 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4773 (lines_only_debug_sections): Likewise.
4774
4775 2012-05-02 Roland McGrath <mcgrathr@google.com>
4776
4777 * nacl.cc: New file.
4778 * nacl.h: New file.
4779 * Makefile.am (CCFILES, HFILES): Add them.
4780 * Makefile.in: Regenerate.
4781 * i386.cc (Output_data_plt_i386_nacl): New class.
4782 (Output_data_plt_i386_nacl_exec): New class.
4783 (Output_data_plt_i386_nacl_dyn): New class.
4784 (Target_i386_nacl): New class.
4785 (Target_selector_i386_nacl): New class.
4786 (target_selector_i386): Use it instead of Target_selector_i386.
4787 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4788 (Target_x86_64_nacl): New class.
4789 (Target_selector_x86_64_nacl): New class.
4790 (target_selector_x86_64, target_selector_x32): Use it instead of
4791 Target_selector_x86_64.
4792 * arm.cc (Output_data_plt_arm_nacl): New class.
4793 (Target_arm_nacl): New class.
4794 (Target_selector_arm_nacl): New class.
4795 (target_selector_arm, target_selector_armbe): Use it instead of
4796 Target_selector_arm.
4797
4798 * target-select.cc (select_target): Take new Input_file* and off_t
4799 arguments, pass them on to recognize method of selector.
4800 * object.cc (make_elf_sized_object): Update caller.
4801 * parameters.cc (parameters_force_valid_target): Likewise.
4802 * incremental.cc (make_sized_incremental_binary): Likewise.
4803 * target-select.h: Update decl.
4804 (Target_selector::recognize): Take new Input_file* argument,
4805 pass it on to do_recognize.
4806 (Target_selector::do_recognize): Take new Input_file* argument.
4807 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4808 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4809 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4810 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4811
4812 * target.h (Target::Target_info): New members isolate_execinstr
4813 and rosegment_gap.
4814 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4815 * arm.cc (Target_arm::arm_info): Update initializer.
4816 * i386.cc (Target_i386::i386_info): Likewise.
4817 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4818 * sparc.cc (Target_sparc::sparc_info): Likewise.
4819 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4820 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4821 * layout.cc (Layout::attach_allocated_section_to_segment):
4822 Take new const Target* argument. If target->isolate_execinstr(), act
4823 like --rosegment.
4824 (Layout::find_first_load_seg): Take new const Target* argument;
4825 if target->isolate_execinstr(), reject PF_X segments.
4826 (Layout::relaxation_loop_body): Update caller.
4827 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4828 reset file offset to zero when we hit LOAD_SEG, and then do a second
4829 loop over the segments before LOAD_SEG to reassign offsets after
4830 addresses have been determined. Handle target->rosegment_gap().
4831 (Layout::attach_section_to_segment): Take new const Target* argument;
4832 pass it to attach_allocated_section_to_segment.
4833 (Layout::make_output_section): Update caller.
4834 (Layout::attach_sections_to_segments): Take new const Target* argument;
4835 pass it to attach_section_to_segment.
4836 * gold.cc (queue_middle_tasks): Update caller.
4837 * layout.h (Layout): Update method decls with new arguments.
4838
4839 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4840 Target_info pointer to use.
4841 (Target_arm::do_make_data_plt): New virtual method.
4842 (Target_arm::make_data_plt): New method that calls it.
4843 (Target_arm::make_plt_entry): Use it.
4844 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4845 for the section alignment.
4846 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4847 method.
4848 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4849 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4850 method.
4851 (Output_data_plt_arm::get_plt_entry_size): Call it.
4852 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4853 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4854 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4855 method.
4856 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4857 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4858 method instead of sizeof(plt_entry).
4859 (Output_data_plt_arm::add_entry): Likewise.
4860 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4861 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4862 than static method.
4863 (Target_arm::plt_entry_size): Likewise.
4864 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4865 Move to ...
4866 (Output_data_plt_arm_standard): ... here, new class.
4867 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4868 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4869 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4870
4871 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4872 Take additional argument for the PLT entry size.
4873 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4874 Use get_plt_entry_size method rather than plt_entry_size variable.
4875 (Output_data_plt_x86_64::reserve_slot): Likewise.
4876 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4877 (Output_data_plt_x86_64::add_entry): Likewise.
4878 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4879 (Output_data_plt_x86_64::address_for_global): Likewise.
4880 (Output_data_plt_x86_64::address_for_local): Likewise.
4881 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4882 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4883 Make method non-static.
4884 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4885 method.
4886 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4887 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4888 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4889 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4890 virtual method.
4891 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4892 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4893 virtual method.
4894 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4895 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4896 virtual method.
4897 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4898 (Output_data_plt_x86_64::plt_entry_size)
4899 (Output_data_plt_x86_64::first_plt_entry)
4900 (Output_data_plt_x86_64::plt_entry)
4901 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4902 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4903 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4904 (Output_data_plt_x86_64_standard): ... here, new class.
4905 (Target_x86_64::Target_x86_64): Take optional argument for the
4906 Target_info pointer to use.
4907 (Target_x86_64::do_make_data_plt): New virtual method.
4908 (Target_x86_64::make_data_plt): New method to call it.
4909 (Target_x86_64::init_got_plt_for_update): Use that.
4910 Call this->plt_->add_eh_frame method here.
4911 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4912 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4913 rather than static method.
4914 (Target_x86_64::plt_entry_size): Likewise.
4915 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4916 rather than plt_entry_size variable. Move guts of PLT filling to...
4917 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4918 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4919 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4920
4921 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4922 additional argument for the section alignment.
4923 Don't do add_eh_frame_for_plt here.
4924 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4925 non-static. Use get_plt_entry_size method rather than plt_entry_size
4926 variable.
4927 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4928 method.
4929 (Output_data_plt_i386::get_plt_entry_size): Call it.
4930 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4931 (Output_data_plt_i386::add_eh_frame): New method to call it.
4932 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4933 method.
4934 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4935 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4936 method.
4937 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4938 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4939 method instead of plt_entry_size.
4940 (Output_data_plt_i386::plt_entry_size)
4941 (Output_data_plt_i386::plt_eh_frame_fde_size)
4942 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4943 (Output_data_plt_i386_standard): ... here, new class.
4944 (Output_data_plt_i386_exec): New class.
4945 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4946 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4947 (Output_data_plt_i386::exec_plt_entry): Move to ...
4948 (Output_data_plt_i386_exec::plt_entry): ... here.
4949 (Output_data_plt_i386_dyn): New class.
4950 (Output_data_plt_i386::first_plt_entry): Move to ...
4951 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4952 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4953 (Output_data_plt_i386_dyn::plt_entry): ... here.
4954 (Target_i386::Target_i386): Take optional argument for the Target_info
4955 pointer to use.
4956 (Target_i386::do_make_data_plt): New virtual method.
4957 (Target_i386::make_data_plt): New method to call it.
4958 (Target_i386::make_plt_section): Use that.
4959 Call this->plt_->add_eh_frame method here.
4960 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4961 rather than plt_entry_size variable.
4962 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4963 (Output_data_plt_i386::address_for_local): Likewise.
4964 (Output_data_plt_i386::do_write): Likewise.
4965 Move guts of PLT filling to...
4966 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4967 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4968 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4969 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4970
4971 2012-05-01 Cary Coutant <ccoutant@google.com>
4972
4973 * dwarf_reader.cc (Dwarf_die::read_attributes)
4974 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4975 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4976 * reduced_debug_output.cc
4977 (Output_reduced_debug_info_section::get_die_end): Remove
4978 DW_FORM_GNU_ref_index. Add default case.
4979
4980 2012-04-26 Mark Wielaard <mjw@redhat.com>
4981
4982 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4983 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4984 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4985 DW_AT_high_pc as offset from DW_AT_low_pc.
4986
4987 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4988 * testsuite/Makefile.in: Regenerate.
4989 * testsuite/gdb_index_test_3.c: New test source file.
4990 * testsuite/gdb_index_test_3.sh: New test source file.
4991
4992 2012-04-25 Ian Lance Taylor <iant@google.com>
4993
4994 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4995 pointer.
4996 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4997 as a class, not a struct.
4998 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4999 (Target_arm::apply_cortex_a8_workaround): Likewise.
5000 * gc.h: Declare Reloc_types as a struct, not a class.
5001 * object.h: Declare Symbols_data as a struct.
5002 * reloc.h: Declare Read_relocs_data as a struct.
5003 * target.h: Declare Relocate_info as a struct.
5004
5005 2012-04-24 David S. Miller <davem@davemloft.net>
5006
5007 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5008 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5009 and R_SPARC_WPLT30.
5010
5011 2012-04-24 Cary Coutant <ccoutant@google.com>
5012
5013 * incremental-dump.cc (find_input_containing_global): Replace
5014 magic number with symbolic constant.
5015 (dump_incremental_inputs): Update version number.
5016 * incremental.cc (Output_section_incremental_inputs): Update version
5017 number; import symbolic constants from Incremental_inputs_reader.
5018 (Incremental_inputs::create_data_sections): Align relocations
5019 section correctly for 64-bit targets.
5020 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5021 constants; add padding.
5022 (Output_section_incremental_inputs::write_header): Add assert for
5023 header_size.
5024 (Output_section_incremental_inputs::write_input_files): Add assert
5025 for input_entry_size.
5026 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5027 add assert for object_info_size, input_section_entry_size,
5028 global_sym_entry_size.
5029 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5030 for data structure sizes; use them.
5031 (Incremental_input_entry_reader): Import symbolic constants from
5032 Incremental_inputs_reader; use them.
5033
5034 2012-04-23 David S. Miller <davem@davemloft.net>
5035
5036 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5037 and elf_flags_set_.
5038 (Target_sparc::Target_sparc): Initialize new fields.
5039 (Target_sparc::do_make_elf_object): New function.
5040 (Target_sparc::do_adjust_elf_header): New function.
5041
5042 2012-04-23 Cary Coutant <ccoutant@google.com>
5043
5044 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5045 CU range table of gdb index.
5046
5047 2012-04-20 David S. Miller <davem@davemloft.net>
5048
5049 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5050 instead of false.
5051
5052 2012-04-16 David S. Miller <davem@davemloft.net>
5053
5054 * sparc.cc (Target_sparc::got_address): New function.
5055 (Sparc_relocate_functions::gdop_hix22): New function.
5056 (Sparc_relocate_functions::gdop_lox10): New function.
5057 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5058 relocs.
5059 (Target_sparc::Scan::local): Likewise if the global symbol is not
5060 preemptible and is not IFUNC.
5061 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5062 transformations for local and non-preemptible non-IFUNC global
5063 symbols.
5064
5065 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5066 writing out 64-bit part of ranges.
5067
5068 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5069 -fpic and -fpie respectively.
5070 * Makefile.in: Regenerate.
5071
5072 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5073 (Target_sparc::Target_sparc): Initialize new field.
5074 (Target_sparc::do_plt_section_for_global): New function.
5075 (Target_sparc::do_plt_section_for_local): New function.
5076 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5077 (Target_sparc::make_plt_section): New function, broken out of
5078 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5079 (Target_sparc::make_plt_entry): Call make_plt_section.
5080 (Target_sparc::make_local_ifunc_plt_entry): New function.
5081 (Target_sparc::rela_ifunc_section): New function.
5082 (Target_sparc::plt_section): Remove const.
5083 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5084 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5085 and ifunc_count_ fields.
5086 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5087 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5088 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5089 (Output_data_plt_sparc::rela_ifunc): New function.
5090 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5091 (Output_data_plt_sparc::has_ifunc_section): New function.
5092 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5093 (Output_data_plt_sparc::address_for_global): New function.
5094 (Output_data_plt_sparc::address_for_local): New function.
5095 (Output_data_plt_sparc::plt_index_to_offset): New function.
5096 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5097 and entry_count.
5098 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5099 entry_count.
5100 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5101 R_SPARC_JMP_IREL to switch.
5102 (Target_sparc::Scan::check_non_pic): Likewise.
5103 (Target_sparc::Scan::local): Handle IFUNC symbols.
5104 (Target_sparc::Scan::local): Likewise.
5105 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5106 and plt_address_for_local.
5107 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5108 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5109
5110 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5111 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5112 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5113 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5114 global relocs too.
5115 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5116 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5117 calls.
5118 * sparc.cc (Target_sparc::Scan::global): Likewise.
5119 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5120
5121 2012-04-16 Cary Coutant <ccoutant@google.com>
5122
5123 * archive.cc (Library_base::should_include_member): Check for
5124 --export-dynamic-symbol.
5125 * options.h (class General_options): Add --export-dynamic-symbol.
5126 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5127 --export-dynamic-symbol.
5128 (Symbol_table::gc_mark_undef_symbols): Likewise.
5129 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5130
5131 2012-04-12 David S. Miller <davem@davemloft.net>
5132
5133 * sparc.cc (Reloc::wdisp10): New relocation method.
5134 (Reloc::h34): Likewise.
5135 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5136 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5137 R_SPARC_WDISP10.
5138 (Target_sparc::Scan::local): Likewise.
5139 (Target_sparc::Scan::global): Likewise.
5140 (Target_sparc::Relocate::relocate): Likewise.
5141
5142 2012-04-09 Cary Coutant <ccoutant@google.com>
5143
5144 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5145 low_pc == 0.
5146
5147 2012-04-06 Ian Lance Taylor <iant@google.com>
5148
5149 * timer.cc: #include <unistd.h>.
5150
5151 2012-04-06 Roland McGrath <mcgrathr@google.com>
5152
5153 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5154 * config.in: Regenerate.
5155 * configure: Regenerate.
5156
5157 2012-04-05 Nick Clifton <nickc@redhat.com>
5158
5159 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5160 (AM_LC_MESSAGES): Add.
5161 * aclocal.m4: Regenerate.
5162 * config.in: Regenerate.
5163 * configure: Regenerate.
5164
5165 2012-03-21 Cary Coutant <ccoutant@google.com>
5166
5167 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5168 * Makefile.in: Regenerate.
5169 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5170 (Sized_elf_reloc_mapper::symbol_section): New function.
5171 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5172 (make_elf_reloc_mapper): New function.
5173 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5174 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5175 (Dwarf_abbrev_table::do_get_abbrev): New function.
5176 (Dwarf_ranges_table::read_ranges_table): New function.
5177 (Dwarf_ranges_table::read_range_list): New function.
5178 (Dwarf_pubnames_table::read_section): New function.
5179 (Dwarf_pubnames_table::read_header): New function.
5180 (Dwarf_pubnames_table::next_name): New function.
5181 (Dwarf_die::Dwarf_die): New function.
5182 (Dwarf_die::read_attributes): New function.
5183 (Dwarf_die::skip_attributes): New function.
5184 (Dwarf_die::set_name): New function.
5185 (Dwarf_die::set_linkage_name): New function.
5186 (Dwarf_die::attribute): New function.
5187 (Dwarf_die::string_attribute): New function.
5188 (Dwarf_die::int_attribute): New function.
5189 (Dwarf_die::uint_attribute): New function.
5190 (Dwarf_die::ref_attribute): New function.
5191 (Dwarf_die::child_offset): New function.
5192 (Dwarf_die::sibling_offset): New function.
5193 (Dwarf_info_reader::check_buffer): New function.
5194 (Dwarf_info_reader::parse): New function.
5195 (Dwarf_info_reader::do_parse): New function.
5196 (Dwarf_info_reader::do_read_string_table): New function.
5197 (Dwarf_info_reader::lookup_reloc): New function.
5198 (Dwarf_info_reader::get_string): New function.
5199 (Dwarf_info_reader::visit_compilation_unit): New function.
5200 (Dwarf_info_reader::visit_type_unit): New function.
5201 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5202 Sized_elf_reloc_mapper.
5203 (Sized_dwarf_line_info::symbol_section): Remove function.
5204 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5205 (Sized_dwarf_line_info::read_line_mappings): Remove object
5206 parameter, adjust callers.
5207 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5208 * dwarf_reader.h: Include <sys/types.h>.
5209 (class Track_relocs): Remove forward declaration.
5210 (class Elf_reloc_mapper): New class.
5211 (class Sized_elf_reloc_mapper): New class.
5212 (class Dwarf_abbrev_table): New class.
5213 (class Dwarf_range_list): New class.
5214 (class Dwarf_ranges_table): New class.
5215 (class Dwarf_pubnames_table): New class.
5216 (class Dwarf_die): New class.
5217 (class Dwarf_info_reader): New class.
5218 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5219 (Sized_dwarf_line_info::symbol_section): Remove member function.
5220 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5221 base class.
5222 * gdb-index.cc: New source file.
5223 * gdb-index.h: New source file.
5224 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5225 and .debug_types sections, call Layout::add_to_gdb_index.
5226 (Sized_relobj_incr::do_section_name): Implement.
5227 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5228 return type; Implement.
5229 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5230 return type.
5231 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5232 parameter list and return type.
5233 (Sized_incr_dynobj::do_section_contents): Likewise.
5234 * layout.cc: Include gdb-index.h.
5235 (Layout::Layout): Initialize gdb_index_data_.
5236 (Layout::init_fixed_output_section): Check for .gdb_index section.
5237 (Layout::add_to_gdb_index): New function. Instantiate.
5238 * layout.h: Add forward declaration for class Gdb_index.
5239 (Layout::add_to_gdb_index): New member function.
5240 (Layout::gdb_index_data_): New data member.
5241 * main.cc: Include gdb-index.h.
5242 (main): Print statistics for gdb index.
5243 * object.cc (Object::section_contents): Move code into
5244 do_section_contents.
5245 (need_decompressed_section): Check for sections needed when building
5246 gdb index.
5247 (build_compressed_section_map): Likewise.
5248 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5249 gdb index.
5250 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5251 sections; call Layout::add_to_gdb_index.
5252 (Sized_relobj_file::do_decompressed_section_contents): Call
5253 do_section_contents directly.
5254 * object.h (Object::do_section_contents): Adjust parameter list and
5255 return type.
5256 (Object::do_decompressed_section_contents): Call do_section_contents
5257 directly.
5258 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5259 return type.
5260 * options.h (class General_options): Add --gdb-index option.
5261 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5262 list and return type.
5263 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5264 * reloc.h (Track_relocs::checkpoint): New function.
5265 (Track_relocs::reset): New function.
5266
5267 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5268 New test cases.
5269 * testsuite/Makefile.in: Regenerate.
5270 * testsuite/gdb_index_test.cc: New test source file.
5271 * testsuite/gdb_index_test_1.sh: New test source file.
5272 * testsuite/gdb_index_test_2.sh: New test source file.
5273
5274 2012-03-19 Doug Kwan <dougkwan@google.com>
5275
5276 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5277 (Target_arm::do_finalize_sections): Remove code which defines
5278 __exidx_start and __exidx_end. Make symbol table parameter
5279 anonymous as it is not used.
5280 * gold.cc (queue_middle_tasks): Call target hook to define any
5281 target-specific symbols.
5282 * target.h (Target::define_standard_symbols): New method.
5283 (Target::do_define_standard_symbols): Same.
5284 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5285 * testsuite/Makefile.in: Regenerate.
5286 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5287 and __exidx_end.
5288 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5289 relocations are generated for __exidx_start and __exidx_end.
5290
5291 2012-03-16 Doug Kwan <dougkwan@google.com>
5292
5293 * testsuite/Makefile.am: Disable test initpri3b.
5294 * testsuite/Makefile.in: Regenerate.
5295
5296 2012-03-15 Doug Kwan <dougkwan@google.com>
5297
5298 * arm.cc (Target_arm::got_section): Make .got section read-only
5299 if -z now is given.
5300
5301 2012-03-15 Ian Lance Taylor <iant@google.com>
5302
5303 PR gold/13850
5304 * layout.cc (Layout::make_output_section): Correctly mark
5305 SHT_INIT_ARRAY, et. al., as relro.
5306
5307 2012-03-14 Doug Kwan <dougkwan@google.com>
5308
5309 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5310 dynamic relocations for protected symbols in shared objects.
5311
5312 2012-03-13 Ian Lance Taylor <iant@google.com>
5313
5314 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5315 keep the larger alignment.
5316
5317 2012-03-12 Cary Coutant <ccoutant@google.com>
5318
5319 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5320 handling of DW_LNE_define_file.
5321
5322 2012-03-12 Cary Coutant <ccoutant@google.com>
5323
5324 * reduced_debug_output.cc
5325 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5326 codes to switch.
5327
5328 2012-02-29 Cary Coutant <ccoutant@google.com>
5329
5330 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5331
5332 2012-02-29 Cary Coutant <ccoutant@google.com>
5333
5334 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5335 Call Object::decompressed_section_contents.
5336 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5337 New dtor.
5338 (Sized_dwarf_line_info::buffer_start_): New data member.
5339 * merge.cc (Output_merge_data::do_add_input_section): Call
5340 Object::decompressed_section_contents.
5341 (Output_merge_string::do_add_input_section): Likewise.
5342 * object.cc (need_decompressed_section): New function.
5343 (build_compressed_section_map): Decompress sections needed later.
5344 (Sized_relobj_file::do_decompressed_section_contents): New function.
5345 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5346 * object.h (Object::decompressed_section_contents): New function.
5347 (Object::discard_decompressed_sections): New function.
5348 (Object::do_decompressed_section_contents): New function.
5349 (Object::do_discard_decompressed_sections): New function.
5350 (Compressed_section_info): New type.
5351 (Compressed_section_map): Include decompressed section contents.
5352 (Sized_relobj_file::do_decompressed_section_contents): New function.
5353 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5354
5355 2012-02-16 Cary Coutant <ccoutant@google.com>
5356
5357 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5358 * testsuite/Makefile.in: Regenerate.
5359
5360 2012-02-14 Cary Coutant <ccoutant@google.com>
5361
5362 * options.cc (General_options::finalize): Disallow -pie and -static.
5363
5364 2012-02-03 Doug Kwan <dougkwan@google.com>
5365
5366 * arm.cc (Arm_relocate_functions::abs8,
5367 Arm_relocate_functions::abs16): Use
5368 Bits::has_signed_unsigned_overflow32.
5369 (Arm_relocate_functions::thm_abs8): Correct range of
5370 overflow check.
5371 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5372 in assertions.
5373
5374 2012-02-02 Doug Kwan <dougkwan@google.com>
5375
5376 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5377 position independent outputs, not just shared objects.
5378
5379 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5380
5381 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5382 * configure: Regenerated.
5383
5384 2012-01-27 Ian Lance Taylor <iant@google.com>
5385
5386 * reloc.h (Bits): New class with static functions, copied from
5387 namespace utils in arm.cc.
5388 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5389 instead.
5390
5391 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5392
5393 * incremental.cc (write_info_blocks): Correct relocation offset.
5394
5395 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5396
5397 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5398 (Relocate::tls_gd_to_le): Likewise.
5399
5400 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5401
5402 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5403
5404 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5405
5406 * configure.ac: Check if -mcmodel=medium works.
5407 * configure: Regenerated.
5408
5409 2012-01-24 Cary Coutant <ccoutant@google.com>
5410
5411 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5412 definition and ...
5413 (read_unsigned_LEB_128_x): ... this new function.
5414 (read_signed_LEB_128): Replaced with inline definition and ...
5415 (read_signed_LEB_128_x): ... this new function.
5416 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5417 (read_unsigned_LEB_128): Add inline definition.
5418 (read_signed_LEB_128_x): New function.
5419 (read_signed_LEB_128): Add inline definition.
5420 * testsuite/Makefile.am (leb128_unittest): New unit test.
5421 * testsuite/Makefile.in: Regenerate.
5422 * testsuite/leb128_unittest.cc: New unit test.
5423
5424 2012-01-23 Ian Lance Taylor <iant@google.com>
5425
5426 PR gold/13617
5427 * i386.cc (Target_i386::do_code_fill): When using a jmp
5428 instruction, pad with nop instructions.
5429 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5430
5431 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5432
5433 * x86_64.cc (gc_process_relocs): Add typename on types used in
5434 template.
5435 (scan_relocs): Likewise.
5436 (relocate_section): Likewise.
5437 (apply_relocation): Likewise.
5438
5439 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5440
5441 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5442 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5443 under x32.
5444
5445 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5446
5447 * x86_64.cc: Initial support for x32.
5448
5449 2012-01-03 Cary Coutant <ccoutant@google.com>
5450
5451 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5452 Use abstract base class for GOT.
5453 * gold/output.h (class Output_data_got_base): New abstract base class.
5454 (class Output_data_got): Derive from new base class, adjust ctors.
5455 (Output_data_got::reserve_slot): Make virtual; rename to
5456 do_reserve_slot; Adjust callers.
5457 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5458 pointer to abstract base class.
5459 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5460
5461 2011-12-18 Ian Lance Taylor <iant@google.com>
5462
5463 * object.h (Relobj::local_symbol_value): New function.
5464 (Relobj::local_plt_offset): New function.
5465 (Relobj::local_has_got_offset): New function.
5466 (Relobj::local_got_offset): New function.
5467 (Relobj::set_local_got_offset): New function.
5468 (Relobj::do_local_symbol_value): New pure virtual function.
5469 (Relobj::do_local_plt_offset): Likewise.
5470 (Relobj::do_local_has_got_offset): Likewise.
5471 (Relobj::do_local_got_offset): Likewise.
5472 (Relobj::do_set_local_got_offset): Likewise.
5473 (Sized_relobj::do_local_has_got_offset): Rename from
5474 local_has_got_offset.
5475 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5476 (Sized_relobj::do_set_local_got_offset): Rename from
5477 set_local_got_offset.
5478 (Sized_relobj_file::do_local_plt_offset): Rename from
5479 local_plt_offset.
5480 (Sized_relobj_file::do_local_symbol_value): New function.
5481 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5482 local_plt_offset.
5483 * output.cc (Output_data_got::Got_entry::write): Change object to
5484 Relobj. Use local_symbol_value.
5485 (Output_data_got::add_global_with_rel): Change rel_dyn to
5486 Output_data_reloc_generic*. Use add_global_generic.
5487 (Output_data_got::add_global_with_rela): Remove. Change all
5488 callers to use add_global_with_rel.
5489 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5490 Output_data_reloc_generic*. Use add_global_generic.
5491 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5492 callers to use add_global_pair_with_rel.
5493 (Output_data_got::add_local): Change object to Relobj*.
5494 (Output_data_got::add_local_plt): Likewise.
5495 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5496 change rel_dyn to Output_data_reloc_generic*. Use
5497 add_local_generic.
5498 (Output_data_got::add_local_with_rela): Remove. Change all
5499 callers to use all_local_with_rel.
5500 (Output_data_got::add_local_pair_with_rel): Change object to
5501 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5502 add_output_section_generic.
5503 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5504 callers to use add_local_pair_with_rel.
5505 (Output_data_got::reserve_local): Change object to Relobj*.
5506 * output.h: (class Output_data_reloc_generic): Add pure virtual
5507 declarations for add_global_generic, add_local_generic,
5508 add_output_section_generic.
5509 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5510 functions for Output_data_reloc_generic. Update declarations for
5511 changes listed in output.cc.
5512 (class Output_data_got): Change template parameter to got_size.
5513 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5514 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5515 function.
5516 (Sized_relobj_incr::do_local_plt_offset): New function.
5517 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5518 add_global_generic.
5519
5520 2011-12-17 Cary Coutant <ccoutant@google.com>
5521
5522 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5523 * resolve.cc (Symbol_table::resolve): Likewise.
5524 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5525 arrays.
5526 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5527
5528 2011-12-16 Ian Lance Taylor <iant@google.com>
5529
5530 * output.h (Output_data_reloc_generic::add): Only call
5531 add_dynamic_reloc if this is a dynamic reloc section.
5532
5533 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5534
5535 PR gold/13505
5536 * target-reloc.h (apply_relocation): Replace <64, false> with
5537 <size, big_endian>.
5538
5539 2011-11-25 Nick Clifton <nickc@redhat.com>
5540
5541 * po/it.po: New Italian translation.
5542
5543 2011-11-17 Sterling Augustine <saugustine@google.com>
5544
5545 * script.cc (script_include_directive): Implement.
5546 (read_script_file): New local variables name and search_path. Update
5547 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5548 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5549 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5550
5551 2011-11-11 Sterling Augustine <saugustine@google.com>
5552
5553 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5554 (file_or_sections_cmd): Likewise.
5555
5556 2011-11-11 Doug Kwan <dougkwan@google.com>
5557
5558 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5559 if --just-symbols is given.
5560
5561 2011-11-10 Doug Kwan <dougkwan@google.com>
5562
5563 PR gold/13362
5564 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5565 when processing data relocs.
5566 * reloc.h (Relocate_functions::rel_unaligned): New method.
5567 (Relocate_functions::pcrel_unaligned): Ditto.
5568 (Relocate_functions::rel32_unaligned): Ditto.
5569 (Relocate_functions::pcrel32_unaligned): Ditto.
5570
5571 2011-11-09 Doug Kwan <dougkwan@google.com>
5572
5573 PR gold/13362
5574 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5575 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5576 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5577 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5578 (Relocate_functions::rel_unaligned): New.
5579 (Relocate_functions::rel32_unaligned): New.
5580 * target-reloc.h (relocate_for_relocatable): Add code to handle
5581 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5582 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5583 arm_unaligned_reloc_r): New targets.
5584 * testsuite/Makefile.in: Regenerate.
5585 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5586 linking.
5587
5588 2011-11-02 Ian Lance Taylor <iant@google.com>
5589
5590 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5591 NATIVE_LINKER.
5592 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5593 * options.cc (General_options::finalize): Use library search path
5594 from configure script if specified. If not native and no sysroot,
5595 only search TOOLLIBDIR.
5596 * options.h (Search_directory::Search_directory): Change name to
5597 const std::string&.
5598 (General_options::add_to_library_path_with_sysroot): Change arg to
5599 const std::string&.
5600 * configure, Makefile.in, config.in: Rebuild.
5601
5602 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5603
5604 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5605 we are working around the ARM1176 Erratum.
5606 * options.h (General_options::fix_arm1176): Add option.
5607 * testsuite/Makefile.am: Add testcases, and keep current ones
5608 working.
5609 * testsuite/Makefile.in: Regenerate.
5610 * testsuite/arm_fix_1176.s: New file.
5611 * testsuite/arm_fix_1176.sh: Likewise.
5612
5613 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5614
5615 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5616 may_use_blx_.
5617 (Target_arm::may_use_blx): Remove method.
5618 (Target_arm::set_may_use_blx): Likewise.
5619 (Target_arm::may_use_v4t_interworking): New method.
5620 (Target_arm::may_use_v5t_interworking): Likewise.
5621 (Target_arm::may_use_blx_): Remove member variable.
5622 (Arm_relocate_functions::arm_branch_common): Check for v5T
5623 interworking.
5624 (Arm_relocate_functions::thumb_branch_common): Likewise.
5625 (Reloc_stub::stub_type_for_reloc): Likewise.
5626 (Target_arm::do_finalize_sections): Correct interworking checks.
5627 * testsuite/Makefile.am: Add new tests.
5628 * testsuite/Makefile.in: Regenerate.
5629 * testsuite/arm_farcall_arm_arm.s: New test.
5630 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5631 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5632 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5633 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5634 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5635 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5636 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5637
5638 2011-10-31 Cary Coutant <ccoutant@google.com>
5639
5640 PR gold/13023
5641 * expression.cc (Expression::eval_with_dot): Add
5642 is_section_dot_assignment parameter.
5643 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5644 absolute and assigning to dot within a section.
5645 * script-sections.cc
5646 (Output_section_element_assignment::set_section_addresses): Pass
5647 dot_section to set_if_absolute.
5648 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5649 as is_section_dot_assignment flag to eval_with_dot.
5650 (Output_section_element_dot_assignment::set_section_addresses):
5651 Likewise.
5652 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5653 parameter. Also set value if relative to dot_section; set the
5654 symbol's output_section.
5655 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5656 parameter. Adjust all callers.
5657 (Expression::eval_maybe_dot): Likewise.
5658 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5659 Adjust all callers.
5660 * testsuite/script_test_2.t: Test assignment of an absolute value
5661 to dot within an output section element.
5662
5663 2011-10-31 Cary Coutant <ccoutant@google.com>
5664
5665 * options.h (class General_options): Add --[no-]gnu-unique options.
5666 * symtab.cc (Symbol_table::sized_write_globals): Convert
5667 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5668
5669 2011-10-31 Cary Coutant <ccoutant@google.com>
5670
5671 PR gold/13359
5672 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5673 unnecessary assertion.
5674 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5675
5676 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5677
5678 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5679 gc_mark_symbol.
5680 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5681 gc_mark_symbol.
5682 Change to just keep the section associated with symbol.
5683 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5684 they are externally visible and --export-dynamic is turned on.
5685 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5686
5687 2011-10-19 Ian Lance Taylor <iant@google.com>
5688
5689 PR gold/13163
5690 * script-sections.cc
5691 (Output_section_element_dot_assignment::needs_output_section): New
5692 function.
5693
5694 2011-10-19 Ian Lance Taylor <iant@google.com>
5695
5696 PR gold/13204
5697 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5698 --section-start option was seen.
5699 * options.h (General_options::any_section_start): New function.
5700
5701 2011-10-18 David S. Miller <davem@davemloft.net>
5702
5703 PR binutils/13301
5704 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5705 member to track relocation locations that have moved during TLS
5706 reloc optimizations.
5707 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5708 (Target_sparc::Relocate::relocate): Adjust view down by 4
5709 bytes if it matches reloc_adjust_addr_.
5710 (Target_sparc::Relocate::relocate_tls): Always move the
5711 __tls_get_addr call delay slot instruction forward 4 bytes when
5712 performing relaxation.
5713
5714 2011-10-18 Cary Coutant <ccoutant@google.com>
5715
5716 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5717 (Output_file::map_no_anonymous): Check for non-zero
5718 return code from posix_fallocate.
5719
5720 2011-10-17 Cary Coutant <ccoutant@google.com>
5721
5722 PR gold/13245
5723 * plugin.cc (is_visible_from_outside): Check for symbols
5724 referenced from dynamic objects.
5725 * resolve.cc (Symbol_table::resolve): Don't count references
5726 from dynamic objects as references from real ELF files.
5727 * testsuite/plugin_test_2.sh: Adjust expected result.
5728
5729 2011-10-17 Cary Coutant <ccoutant@google.com>
5730
5731 * gold.cc: Include timer.h.
5732 (queue_middle_tasks): Stamp time.
5733 (queue_final_tasks): Likewise.
5734 * main.cc (main): Store timer in parameters. Print timers
5735 for each pass.
5736 * parameters.cc (Parameters::Parameters): Initialize timer_.
5737 (Parameters::set_timer): New function.
5738 (set_parameters_timer): New function.
5739 * parameters.h (Parameters::set_timer): New function.
5740 (Parameters::timer): New function.
5741 (Parameters::timer_): New data member.
5742 (set_parameters_timer): New function.
5743 * timer.cc (Timer::stamp): New function.
5744 (Timer::get_pass_time): New function.
5745 * timer.h (Timer::stamp): New function.
5746 (Timer::get_pass_time): New function.
5747 (Timer::pass_times_): New data member.
5748
5749 2011-10-17 Cary Coutant <ccoutant@google.com>
5750
5751 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5752 task for members of lib groups.
5753
5754 2011-10-17 Cary Coutant <ccoutant@google.com>
5755
5756 PR gold/13288
5757 * fileread.cc (File_read::find_view): Add assert.
5758 (File_read::make_view): Move bounds check (replace with assert)...
5759 (File_read::find_or_make_view): ... to here.
5760
5761 2011-10-12 Cary Coutant <ccoutant@google.com>
5762
5763 * output.cc (Output_file::open_base_file): Handle case where
5764 ::read returns less than requested size.
5765
5766 2011-10-10 Cary Coutant <ccoutant@google.com>
5767
5768 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5769 Initialize defined_count_.
5770 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5771 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5772 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5773 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5774 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5775 * incremental.h (Sized_relobj_incr::defined_count_): New data
5776 member.
5777 (Sized_incr_dynobj::defined_count_): New data member.
5778 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5779 Return zeroes instead of internal error.
5780
5781 2011-10-10 Cary Coutant <ccoutant@google.com>
5782
5783 PR gold/13249
5784 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5785 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5786 * output.h (class Output_reloc): Add use_plt_offset flag.
5787 (Output_reloc::type_): Adjust size of bit field.
5788 (Output_reloc::use_plt_offset_): New bit field.
5789 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5790 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5791 flag. Adjust all callers.
5792 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5793 creating RELATIVE relocations.
5794
5795 2011-10-10 Nick Clifton <nickc@redhat.com>
5796
5797 * po/es.po: Updated Spanish translation.
5798 * po/fi.po: Updated Finnish translation.
5799
5800 2011-10-03 Diego Novillo <dnovillo@google.com>
5801
5802 * options.cc (parse_uint): Fix dereference of RETVAL.
5803
5804 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5805
5806 * layout.h (section_order_map_): New member.
5807 (get_section_order_map): New member function.
5808 * output.cc (Output_section::add_input_section): Check for patterns
5809 only when --section-ordering-file is specified.
5810 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5811 output_sections have been formed.
5812 * layout.cc (Layout_Layout): Initialize section_order_map_.
5813 * plugin.cc (update_section_order): Store order in order_map. Do not
5814 update the order.
5815 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5816 * testsuite/Makefile.in: Regenerate.
5817 * testsuite/plugin_section_order.c: New file.
5818 * testsuite/plugin_final_layout.cc: New file.
5819 * testsuite/plugin_final_layout.sh: New file.
5820
5821 2011-09-29 Cary Coutant <ccoutant@google.com>
5822
5823 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5824 Check for NULL.
5825 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5826 symbols during incremental update.
5827 (Symbol_table::add_from_dynobj): Likewise.
5828
5829 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5830 Ian Lance Taylor <iant@google.com>
5831
5832 * symtab.cc (Symbol_table::define_special_symbol): Always
5833 canonicalize version string.
5834
5835 2011-09-26 Cary Coutant <ccoutant@google.com>
5836
5837 * gold.cc (queue_initial_tasks): Move option checks ...
5838 * options.cc (General_options::finalize): ... to here. Disable
5839 some options; make others fatal.
5840
5841 2011-09-26 Cary Coutant <ccoutant@google.com>
5842
5843 gcc PR lto/47247
5844 * plugin.cc (get_symbols_v2): New function.
5845 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5846 (is_referenced_from_outside): New function.
5847 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5848 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5849 (get_symbols): Pass version parameter.
5850 (get_symbols_v2): New function.
5851 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5852 parameter.
5853 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5854 (onload): Add LDPT_GET_SYMBOLS_V2.
5855 (all_symbols_read_hook): Use get_symbols_v2; check for
5856 LDPR_PREVAILING_DEF_IRONLY_EXP.
5857 * testsuite/plugin_test_3.sh: Update expected results.
5858
5859 2011-09-23 Simon Baldwin <simonb@google.com>
5860
5861 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5862 configuration options.
5863 * configure: Regenerate.
5864 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5865 * Makefile.in: Regenerate.
5866 * testsuite/Makefile.in: Regenerate.
5867
5868 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5869
5870 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5871
5872 2011-09-19 Cary Coutant <ccoutant@google.com>
5873
5874 * incremental.cc (can_incremental_update): Fix typo in comment.
5875 * incremental.h (can_incremental_update): Likewise.
5876
5877 2011-09-18 Cary Coutant <ccoutant@google.com>
5878
5879 * incremental.cc (can_incremental_update): New function.
5880 * incremental.h (can_incremental_update): New function.
5881 * layout.cc (Layout::init_fixed_output_section): Call it.
5882 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5883 * object.cc (Sized_relobj_file::do_layout): Call
5884 can_incremental_update.
5885
5886 2011-09-13 Cary Coutant <ccoutant@google.com>
5887
5888 * configure.ac: Check for glibc support for gnu_indirect_function
5889 support with static linking, setting automake conditional
5890 IFUNC_STATIC.
5891 * Makefile.in: Regenerate.
5892 * configure: Regenerate.
5893
5894 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5895 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5896 for IFUNC_STATIC.
5897 * testsuite/Makefile.in: Regenerate.
5898
5899 2011-09-13 Cary Coutant <ccoutant@google.com>
5900
5901 * incremental.cc (Sized_relobj_incr::do_layout): Call
5902 report_comdat_group for kept comdat sections.
5903 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5904 * testsuite/Makefile.in: Regenerate.
5905 * testsuite/incr_comdat_test_1.cc: New source file.
5906 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5907 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5908 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5909
5910 2011-09-13 Ian Lance Taylor <iant@google.com>
5911
5912 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5913 variable external_symbols_offset.
5914
5915 2011-09-12 Ian Lance Taylor <iant@google.com>
5916
5917 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5918 triggered if object has no symbols.
5919
5920 2011-09-09 David S. Miller <davem@davemloft.net>
5921
5922 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5923 (Output_fill_debug_line::do_write): Likewise.
5924
5925 2011-08-29 Cary Coutant <ccoutant@google.com>
5926
5927 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5928 casts to match formatting specs.
5929 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5930
5931 2011-08-26 Cary Coutant <ccoutant@google.com>
5932
5933 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5934 remaining hole size when allocating.
5935 (Layout::make_output_section): Set fill methods for debug sections.
5936 * layout.h (Free_list::Free_list_node): Move from private to
5937 public.
5938 (Free_list::set_min_hole_size): New function.
5939 (Free_list::begin, Free_list::end): New functions.
5940 (Free_list::min_hole_): New data member.
5941 * output.cc: Include dwarf.h.
5942 (Output_fill_debug_info::do_minimum_hole_size): New function.
5943 (Output_fill_debug_info::do_write): New function.
5944 (Output_fill_debug_line::do_minimum_hole_size): New function.
5945 (Output_fill_debug_line::do_write): New function.
5946 (Output_section::Output_section): Initialize new data member.
5947 (Output_section::set_final_data_size): Ensure patch space is larger
5948 than minimum hole size.
5949 (Output_section::do_write): Fill holes in debug sections.
5950 * output.h (Output_fill): New class.
5951 (Output_fill_debug_info): New class.
5952 (Output_fill_debug_line): New class.
5953 (Output_section::set_free_space_fill): New function.
5954 (Output_section::free_space_fill_): New data member.
5955 * testsuite/Makefile.am (incremental_test_3): Add
5956 --incremental-patch option.
5957 (incremental_test_4): Likewise.
5958 (incremental_test_5): Likewise.
5959 (incremental_test_6): Likewise.
5960 (incremental_copy_test): Likewise.
5961 (incremental_common_test_1): Likewise.
5962 * testsuite/Makefile.in: Regenerate.
5963
5964 2011-08-26 Nick Clifton <nickc@redhat.com>
5965
5966 * po/es.po: Updated Spanish translation.
5967
5968 2011-08-01 Cary Coutant <ccoutant@google.com>
5969
5970 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5971 * gold/testsuite/Makefile.in: Regenerate.
5972 * gold/testsuite/justsyms_exec.c: New source file.
5973 * gold/testsuite/justsyms_lib.c: New source file.
5974
5975 2011-08-01 Cary Coutant <ccoutant@google.com>
5976
5977 * layout.cc (Layout::set_segment_offsets): Don't realign text
5978 segment if -Ttext was specified.
5979 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5980 file type.
5981 * object.h (Sized_relobj_file::e_type): New function.
5982 (Sized_relobj_file::e_type_): New data member.
5983 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5984 base address for ET_EXEC files.
5985 * target.cc (Target::do_make_elf_object_implementation): Allow
5986 ET_EXEC files with --just-symbols option.
5987
5988 2011-07-28 Cary Coutant <ccoutant@google.com>
5989
5990 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5991 Add thread_number parameter.
5992 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5993 * workqueue-threads.cc
5994 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5995 current thread if its thread number is greater than desired thread
5996 count.
5997 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5998 Add thread_number parameter.
5999 (Workqueue::should_cancel_thread): Likewise.
6000 (Workqueue::find_runnable_or_wait): Pass thread_number to
6001 should_cancel_thread.
6002 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6003 parameter.
6004
6005 2011-07-22 Sriraman Tallam <tmsriram@google.com>
6006
6007 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6008 only after checking if it cannot be forced local.
6009 * symtab.h (is_externally_visible): Check if the symbol is not forced
6010 local.
6011
6012 2011-07-15 Ian Lance Taylor <iant@google.com>
6013
6014 * options.h (class General_options): Add --print-output-format.
6015 Move -EL next to -EB, for better --help output.
6016 * target-select.cc: Include <cstdio>, "options.h", and
6017 "parameters.h".
6018 (Target_selector::do_target_bfd_name): New function.
6019 (print_output_format): New function.
6020 * target-select.h (class Target_selector): Update declarations.
6021 (Target_selector::target_bfd_name): New function.
6022 (print_output_format): Declare.
6023 * main.cc: Include "target-select.h".
6024 (main): Handle --print-output-format.
6025 * gold.cc: Include "target-select.h".
6026 (queue_initial_tasks): Handle --print-output-format when there are
6027 no input files.
6028 * parameters.cc (parameters_force_valid_target): Give a better
6029 error message if -EB/-EL does not match target.
6030 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6031 function.
6032
6033 2011-07-15 Ian Lance Taylor <iant@google.com>
6034
6035 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6036 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6037 (Output_data_plt_i386::do_write): Write address of .dynamic
6038 section to first entry in .got.plt section.
6039 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6040 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6041 Initialize layout_.
6042 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6043 section to first entry in .got.plt section.
6044 * layout.h (Layout::dynamic_section): New function.
6045
6046 2011-07-13 Sriraman Tallam <tmsriram@google.com>
6047
6048 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6049 to claim_file call.
6050 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6051 input_section_position_, and input_section_glob_.
6052 (read_layout_from_file): Call function section_ordering_specified.
6053 * layout.h (is_section_ordering_specified): New function.
6054 (section_ordering_specified): New function.
6055 (section_ordering_specified_): New boolean member.
6056 * main.cc(main): Call load_plugins after layout object is defined.
6057 * output.cc (Output_section::add_input_section): Use
6058 function section_ordering_specified to check if section ordering is
6059 needed.
6060 * output.cc (Output_section::add_relaxed_input_section): Use
6061 function section_ordering_specified to check if section ordering is
6062 needed.
6063 (Output_section::update_section_layout): New function.
6064 (Output_section::sort_attached_input_sections): Check if input section
6065 must be reordered.
6066 * output.h (Output_section::update_section_layout): New function.
6067 * plugin.cc (get_section_count): New function.
6068 (get_section_type): New function.
6069 (get_section_name): New function.
6070 (get_section_contents): New function.
6071 (update_section_order): New function.
6072 (allow_section_ordering): New function.
6073 (Plugin::load): Add the new interfaces to the transfer vector.
6074 (Plugin_manager::load_plugins): New parameter.
6075 (Plugin_manager::all_symbols_read): New parameter.
6076 (Plugin_manager::claim_file): New parameter. Save the elf object for
6077 unclaimed objects.
6078 (Plugin_manager::get_elf_object): New function.
6079 (Plugin_manager::get_view): Change to directly use the bool to check
6080 if get_view is called from claim_file_hook.
6081 * plugin.h (input_objects): New function
6082 (Plugin__manager::load_plugins): New parameter.
6083 (Plugin_manager::claim_file): New parameter.
6084 (Plugin_manager::get_elf_object): New function.
6085 (Plugin_manager::in_claim_file_handler): New function.
6086 (Plugin_manager::in_claim_file_handler_): New member.
6087 (layout): New function.
6088 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6089 handler with an extra parameter. Make the elf object before calling
6090 claim_file handler.
6091 * testsuite/plugin_test.c (get_section_count): New function pointer.
6092 (get_section_type): New function pointer.
6093 (get_section_name): New function pointer.
6094 (get_section_contents): New function pointer.
6095 (update_section_order): New function pointer.
6096 (allow_section_ordering): New function pointer.
6097 (onload): Check if the new interfaces exist.
6098
6099 2011-07-13 Ian Lance Taylor <iant@google.com>
6100
6101 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6102 relro section.
6103 * x86_64.cc (Target_x86_64::got_section): Likewise.
6104 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6105 (relro_now_test_SOURCES): New variable.
6106 (relro_now_test_DEPENDENCIES): New variable.
6107 (relro_now_test_LDFLAGS): New variable.
6108 (relro_now_test_LDADD): New variable.
6109 (relro_now_test.so): New target.
6110 * testsuite/Makefile.in: Rebuild.
6111
6112 2011-07-12 Ian Lance Taylor <iant@google.com>
6113
6114 PR gold/12980
6115 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6116 GLOB_DAT relocation rather than a RELATIVE relocation for a
6117 protected symbol when creating a shared library.
6118 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6119 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6120 * testsuite/protected_main_1.cc (main): Test that protected
6121 function has same address.
6122
6123 2011-07-11 Ian Lance Taylor <iant@google.com>
6124
6125 PR gold/12979
6126 * options.h (class General_options): Add -Bgroup.
6127 * options.cc (General_options::finalize): If -Bgroup is set,
6128 default to --unresolved-symbols=report-all.
6129 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6130 * target-reloc.h (issue_undefined_symbol_error): Handle
6131 --unresolved-symbols=report-all.
6132
6133 2011-07-08 Ian Lance Taylor <iant@google.com>
6134
6135 PR gold/11985
6136 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6137 if linker script discards key sections.
6138 (Layout::create_dynamic_symtab): Likewise.
6139 (Layout::assign_local_dynsym_offsets): Likewise.
6140 (Layout::sized_create_version_sections): Likewise.
6141 (Layout::create_interp): Likewise.
6142 (Layout::finish_dynamic_section): Likewise.
6143 (Layout::set_dynamic_symbol_size): Likewise.
6144
6145 2011-07-08 Ian Lance Taylor <iant@google.com>
6146
6147 PR gold/12386
6148 * options.h (class General_options): Add --unresolved-symbols.
6149 * target-reloc.h (issue_undefined_symbol_error): Check
6150 --unresolved-symbols. Add comments.
6151
6152 2011-07-08 Ian Lance Taylor <iant@google.com>
6153
6154 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6155 expression more complex.
6156
6157 2011-07-08 Ian Lance Taylor <iant@google.com>
6158
6159 PR gold/11317
6160 * target-reloc.h (issue_undefined_symbol_error): New inline
6161 function, broken out of relocate_section.
6162 (relocate_section): Call issue_undefined_symbol_error.
6163 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6164 there is no TLS segment if we are about to issue an undefined
6165 symbol error.
6166 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6167
6168 2011-07-08 Ian Lance Taylor <iant@google.com>
6169
6170 PR gold/12279
6171 * resolve.cc (Symbol_table::should_override): Add fromtype
6172 parameter. Change all callers. Give error when linking together
6173 TLS and non-TLS symbol.
6174 (Symbol_table::should_override_with_special): Add fromtype
6175 parameter. Change all callers.
6176 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6177 there is no TLS segment if we have reported some errors.
6178 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6179
6180 2011-07-08 Ian Lance Taylor <iant@google.com>
6181
6182 PR gold/12372
6183 * target.h (Target::plt_address_for_global): New function.
6184 (Target::plt_address_for_local): New function.
6185 (Target::plt_section_for_global): Remove.
6186 (Target::plt_section_for_local): Remove.
6187 (Target::do_plt_address_for_global): New virtual function.
6188 (Target::do_plt_address_for_local): New virtual function.
6189 (Target::do_plt_section_for_global): Remove.
6190 (Target::do_plt_section_for_local): Remove.
6191 (Target::register_global_plt_entry): Add Symbol_table and Layout
6192 parameters.
6193 * output.cc (Output_data_got::Got_entry::write): Use
6194 plt_address_for_global and plt_address_for_local.
6195 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6196 address of output section.
6197 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6198 got_irelative_, and irelative_count_ fields. Update
6199 declarations.
6200 (Output_data_plt_i386::has_irelative_section): New function.
6201 (Output_data_plt_i386::entry_count): Add irelative_count_.
6202 (Output_data_plt_i386::set_final_data_size): Likewise.
6203 (class Target_i386): Add got_irelative_ and rel_irelative_
6204 fields. Update declarations.
6205 (Target_i386::Target_i386): Initialize new fields.
6206 (Target_i386::do_plt_address_for_global): New function replacing
6207 do_plt_section_for_global.
6208 (Target_i386::do_plt_address_for_local): New function replacing
6209 do_plt_section_for_local.
6210 (Target_i386::got_section): Create got_irelative_.
6211 (Target_i386::rel_irelative_section): New function.
6212 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6213 fields. Don't define __rel_iplt_{start,end}.
6214 (Output_data_plt_i386::add_entry): Add symtab and layout
6215 parameters. Change all callers. Use different PLT and GOT for
6216 IFUNC symbols.
6217 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6218 layout parameters. Change all callers. Use different PLT and
6219 GOT.
6220 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6221 (Output_data_plt_i386::rel_irelative): New function.
6222 (Output_data_plt_i386::address_for_global): New function.
6223 (Output_data_plt_i386::address_for_local): New function.
6224 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6225 IRELATIVE GOT when changing IFUNC GOT entries.
6226 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6227 reloc.
6228 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6229 if we didn't create an IRELATIVE GOT.
6230 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6231 plt_address_for_local.
6232 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6233 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6234 got_irelative_, and irelative_count_ fields. Update
6235 declarations.
6236 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6237 Initialize new fields. Remove symtab parameter. Change all
6238 callers.
6239 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6240 irelative_count_.
6241 (Output_data_plt_x86_64::has_irelative_section): New function.
6242 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6243 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6244 fields. Update declarations.
6245 (Target_x86_64::Target_x86_64): Initialize new fields.
6246 (Target_x86_64::do_plt_address_for_global): New function replacing
6247 do_plt_section_for_global.
6248 (Target_x86_64::do_plt_address_for_local): New function replacing
6249 do_plt_section_for_local.
6250 (Target_x86_64::got_section): Create got_irelative_.
6251 (Target_x86_64::rela_irelative_section): New function.
6252 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6253 all callers. Don't create __rel_iplt_{start,end}.
6254 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6255 parameters. Change all callers. Use different PLT and GOT for
6256 IFUNC symbols.
6257 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6258 layout parameters. Change all callers. Use different PLT and
6259 GOT.
6260 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6261 parameters. Change all callers. Use different PLT and GOT for
6262 IFUNC symbols.
6263 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6264 (Output_data_plt_x86_64::rela_irelative): New function.
6265 (Output_data_plt_x86_64::address_for_global): New function.
6266 (Output_data_plt_x86_64::address_for_local): New function.
6267 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6268 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6269 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6270 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6271 parameters.
6272 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6273 reloc.
6274 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6275 symbols if we didn't create an IRELATIVE GOT.
6276 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6277 plt_address_for_local.
6278 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6279 * testsuite/ifuncvar1.c: New test file.
6280 * testsuite/ifuncvar2.c: New test file.
6281 * testsuite/ifuncvar3.c: New test file.
6282 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6283 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6284 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6285 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6286 * testsuite/Makefile.in: Rebuild.
6287
6288 2011-07-07 Cary Coutant <ccoutant@google.com>
6289
6290 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6291 (two_file_test_1_ndebug.o): Likewise.
6292 (two_file_test_1b_ndebug.o): Likewise.
6293 (two_file_test_2_ndebug.o): Likewise.
6294 (two_file_test_main_ndebug.o): Likewise.
6295 (incremental_test_2): Link with no-debug versions.
6296
6297 2011-07-06 Cary Coutant <ccoutant@google.com>
6298
6299 * gold/incremental.cc
6300 (Output_section_incremental_inputs::write_info_blocks): Check for
6301 hidden and internal symbols.
6302
6303 2011-07-06 Cary Coutant <ccoutant@google.com>
6304
6305 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6306 Check disposition for startup file.
6307 (Incremental_inputs::report_command_line): Ignore
6308 --incremental-startup-unchanged option.
6309 * options.cc (General_options::parse_incremental_startup_unchanged):
6310 New function.
6311 (General_options::General_options): Initialize new data member.
6312 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6313 (General_options): Add --incremental-startup-unchanged option.
6314 (General_options::incremental_startup_disposition): New function.
6315 (General_options::incremental_startup_disposition_): New data member.
6316
6317 2011-07-06 Cary Coutant <ccoutant@google.com>
6318
6319 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6320 input file index to Script_info ctor.
6321 (Sized_incremental_binary::do_file_has_changed): Find the
6322 command-line argument for files named in scripts.
6323 * incremental.h (Script_info::Script_info): New ctor
6324 with input file index.
6325 (Script_info::input_file_index): New function.
6326 (Script_info::input_file_index_): New data member.
6327 (Incremental_binary::get_library): Add const.
6328 (Incremental_binary::get_script_info): Add const.
6329 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6330 * testsuite/Makefile.am (incremental_test_5): New test case.
6331 (incremental_test_6): New test case.
6332 * testsuite/Makefile.in: Regenerate.
6333
6334 2011-07-06 Cary Coutant <ccoutant@google.com>
6335
6336 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6337 debug output when command lines differ.
6338
6339 2011-07-06 Cary Coutant <ccoutant@google.com>
6340
6341 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6342 --incremental-patch option.
6343 * layout.cc (Free_list::allocate): Extend allocation beyond original
6344 end if enabled.
6345 (Layout::make_output_section): Mark sections that should get
6346 patch space.
6347 * options.cc (parse_percent): New function.
6348 * options.h (parse_percent): New function.
6349 (DEFINE_percent): New macro.
6350 (General_options): Add --incremental-patch option.
6351 * output.cc (Output_section::Output_section): Initialize new data
6352 members.
6353 (Output_section::add_input_section): Print section name when out
6354 of patch space.
6355 (Output_section::add_output_section_data): Likewise.
6356 (Output_section::set_final_data_size): Add patch space when
6357 doing --incremental-full.
6358 (Output_section::do_reset_address_and_file_offset): Remove patch
6359 space.
6360 (Output_segment::set_section_list_addresses): Print debug output
6361 only if --incremental-update.
6362 * output.h (Output_section::set_is_patch_space_allowed): New function.
6363 (Output_section::is_patch_space_allowed_): New data member.
6364 (Output_section::patch_space_): New data member.
6365 * parameters.cc (Parameters::incremental_full): New function.
6366 * parameters.h (Parameters::incremental_full): New function
6367 * testsuite/Makefile.am (incremental_test_2): Add test for
6368 --incremental-patch option.
6369 * testsuite/Makefile.in: Regenerate.
6370 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6371 (t18): Remove function body.
6372
6373 2011-07-05 Doug Kwan <dougkwan@google.com>
6374
6375 PR gold/12771
6376 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6377 Arm_Address type for relocation result.
6378 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6379 overflow check.
6380 (Arm_relocate_functions::abs32): Use unaligned access.
6381 (Arm_relocate_functions::rel32): Ditto.
6382 (Arm_relocate_functions::prel31): Ditto.
6383 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6384 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6385 static data relocations.
6386 * testsuite/Makefile.in: Regnerate.
6387 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6388
6389 2011-07-05 Ian Lance Taylor <iant@google.com>
6390
6391 PR gold/12392
6392 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6393 symbols if necessary.
6394 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6395
6396 2011-07-05 Ian Lance Taylor <iant@google.com>
6397
6398 PR gold/12952
6399 * resolve.cc (Symbol::override_base_with_special): Simply override
6400 version with special symbol version, ignoring previous version.
6401
6402 2011-07-05 Ian Lance Taylor <iant@google.com>
6403
6404 * object.cc (Sized_relobj_file::include_section_group): Add
6405 information to comment about signature location.
6406
6407 2011-07-02 Ian Lance Taylor <iant@google.com>
6408
6409 PR gold/12957
6410 * options.h (class General_options): Add -f and -F.
6411 * options.cc (General_options::finalize): Fatal error if -f/-F
6412 are used without -shared.
6413 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6414
6415 2011-07-02 Ian Lance Taylor <iant@google.com>
6416
6417 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6418
6419 2011-07-01 Ian Lance Taylor <iant@google.com>
6420
6421 PR gold/12525
6422 PR gold/12952
6423 * resolve.cc (Symbol::override_base_with_special): Don't override
6424 the version if the overriding symbol has a different name.
6425 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6426 all callers. If we give an error about an undefined version,
6427 define the base version if necessary.
6428 * dynobj.h (class Versions): Update declaration.
6429 * testsuite/weak_alias_test_5.cc: New file.
6430 * testsuite/weak_alias_test.script: New file.
6431 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6432 and versioned_alias have the right value, and call t2.
6433 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6434 weak_alias_test_5.so.
6435 (weak_alias_test_LDADD): Likewise.
6436 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6437 * testsuite/Makefile.in: Rebuild.
6438
6439 2011-07-01 Ian Lance Taylor <iant@google.com>
6440
6441 PR gold/12525
6442 * options.h (class General_options): Support -z notext.
6443 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6444 -Wl,-z,notext.
6445 (two_file_shared_nonpic.so): Likewise.
6446 (two_file_shared_mixed.so): Likewise.
6447 (two_file_shared_mixed_1.so): Likewise.
6448 (weak_undef_lib_nonpic.so): Likewise.
6449 (alt/weak_undef_lib_nonpic.so): Likewise.
6450 (tls_test_shared_nonpic.so): Likewise.
6451 * testsuite/Makefile.in: Rebuild.
6452
6453 2011-07-01 Ian Lance Taylor <iant@google.com>
6454
6455 PR gold/12525
6456 * configure.ac: Test whether static linking works, setting
6457 the automake conditional HAVE_STATIC.
6458 * testsuite/Makefile.am: Disable tests using -static if
6459 HAVE_STATIC is not true.
6460 * configure, testsuite/Makefile.in: Rebuild.
6461
6462 2011-07-01 Ian Lance Taylor <iant@google.com>
6463
6464 PR gold/12525
6465 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6466 Assert if we see DW_EH_PE_indirect.
6467 * target.h (Target::ehframe_datarel_base): New function.
6468 (Target::do_ehframe_datarel_base): New target function.
6469 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6470 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6471 function.
6472
6473 2011-07-01 Ian Lance Taylor <iant@google.com>
6474
6475 PR gold/12571
6476 * options.h (class General_options): Add
6477 --ld-generated-unwind-info.
6478 * ehframe.cc (Fde::write): Add address parameter. Change all
6479 callers. If associated with PLT, fill in address and size.
6480 (Cie::set_output_offset): Only add merge mapping if there is an
6481 object.
6482 (Cie::write): Add address parameter. Change all callers.
6483 (Eh_frame::add_ehframe_for_plt): New function.
6484 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6485 input_offset_ fields into union u_, with new plt field.
6486 (Fde::Fde): Adjust for new union field.
6487 (Fde::Fde) [Output_data version]: New constructor.
6488 (Fde::add_mapping): Only add merge mapping if there is an object.
6489 (class Cie): Update declarations.
6490 (class Eh_frame): Declare add_ehframe_for_plt.
6491 * layout.cc (Layout::layout_eh_frame): Break out code into
6492 make_eh_frame_section, and call it.
6493 (Layout::make_eh_frame_section): New function.
6494 (Layout::add_eh_frame_for_plt): New function.
6495 * layout.h (class Layout): Update declarations.
6496 * merge.cc (Merge_map::add_mapping): Add assertion.
6497 * i386.cc: Include "dwarf.h".
6498 (class Output_data_plt_i386): Make first_plt_entry,
6499 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6500 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6501 and plt_eh_frame_fde.
6502 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6503 boundary. Call add_eh_frame_for_plt if appropriate.
6504 * x86_64.cc: Include "dwarf.h".
6505 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6506 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6507 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6508 and plt_eh_frame_fde.
6509 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6510 appropriate.
6511
6512 2011-06-29 Ian Lance Taylor <iant@google.com>
6513
6514 PR gold/12629
6515 * object.cc (Sized_relobj_file::layout_section): Change shdr
6516 parameter to be const.
6517 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6518 out of do_layout.
6519 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6520 appropriate. Call layout_eh_frame_section.
6521 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6522 sections.
6523 * object.h (class Sized_relobj_file): Update declarations.
6524
6525 2011-06-29 Ian Lance Taylor <iant@google.com>
6526
6527 PR gold/12652
6528 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6529 modifier.
6530 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6531
6532 2011-06-29 Ian Lance Taylor <iant@google.com>
6533
6534 PR gold/12675
6535 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6536 SHT_X86_64_UNWIND.
6537 * layout.cc (Layout::layout_eh_frame): Likewise.
6538
6539 2011-06-29 Ian Lance Taylor <iant@google.com>
6540
6541 PR gold/12695
6542 * layout.cc (Layout::symtab_section_shndx): New function.
6543 * layout.h (class Layout): Declare symtab_section_shndx.
6544 * output.cc (Output_section::write_header): Call it.
6545
6546 2011-06-29 Ian Lance Taylor <iant@google.com>
6547
6548 PR gold/12818
6549 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6550 symbols which are not used in a relocation.
6551
6552 2011-06-28 Ian Lance Taylor <iant@google.com>
6553
6554 PR gold/12898
6555 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6556 script create indistinguishable segments.
6557 (Layout::set_segment_offsets): Use stable_sort when sorting
6558 segments. Pass this to Compare_segments constructor.
6559 * layout.h (class Layout): Make segment_precedes non-static.
6560 (class Compare_segments): Change from struct to class. Add
6561 layout_ field. Add constructor.
6562 * script-sections.cc
6563 (Script_sections::attach_sections_using_phdrs_clause): Rename
6564 local orphan to is_orphan. Don't report failure to put empty
6565 section in segment. On attachment failure, report name of
6566 section, and attach to first PT_LOAD segment.
6567
6568 2011-06-28 Ian Lance Taylor <iant@google.com>
6569
6570 PR gold/12934
6571 * target-select.cc (Target_selector::Target_selector): Add
6572 emulation parameter. Change all callers.
6573 (select_target_by_bfd_name): Rename from select_target_by_name.
6574 Change all callers.
6575 (select_target_by_emulation): New function.
6576 (supported_emulation_names): New function.
6577 * target-select.h (class Target_selector): Add emulation_ field.
6578 Update declarations.
6579 (Target_selector::recognize_by_bfd_name): Rename from
6580 recognize_by_name. Change all callers.
6581 (Target_selector::supported_bfd_names): Rename from
6582 supported_names. Change all callers.
6583 (Target_selector::recognize_by_emulation): New function.
6584 (Target_selector::supported_emulations): New function.
6585 (Target_selector::emulation): New function.
6586 (Target_selector::do_recognize_by_bfd_name): Rename from
6587 do_recognize_by_name. Change all callers.
6588 (Target_selector::do_supported_bfd_names): Rename from
6589 do_supported_names. Change all callers.
6590 (Target_selector::do_recognize_by_emulation): New function.
6591 (Target_selector::do_supported_emulations): New function.
6592 (select_target_by_bfd_name): Change name in declaration.
6593 (select_target_by_emulation): Declare.
6594 (supported_emulation_names): Declare.
6595 * parameters.cc (parameters_force_valid_target): Try to find
6596 target based on emulation from -m option.
6597 * options.h (class General_options): Change doc string for -m.
6598 * options.cc (help): Print emulations.
6599 (General_options::parse_V): Likewise.
6600 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6601 Add emulation parameter. Change all callers.
6602
6603 2011-06-28 Ian Lance Taylor <iant@google.com>
6604
6605 * target.h (class Target): Add osabi_ field.
6606 (Target::osabi): New function.
6607 (Target::set_osabi): New function.
6608 (Target::Target): Initialize osabi_.
6609 (Target::do_adjust_elf_header): Make pure virtual.
6610 (Sized_target::do_adjust_elf_header): Declare.
6611 * target.cc (Sized_target::do_adjust_elf_header): New function.
6612 (class Sized_target): Instantiate all versions.
6613 * freebsd.h (class Target_freebsd): Remove.
6614 (Target_selector_freebsd::do_recognize): Call set_osabi on
6615 Target.
6616 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6617 (Target_selector_freebsd::set_osabi): Remove.
6618 * i386.cc (class Target_i386): Inherit from Sized_target rather
6619 than Target_freebsd.
6620 * x86_64.cc (class Target_x86_64): Likewise.
6621
6622 2011-06-28 Ian Lance Taylor <iant@google.com>
6623
6624 * target.h (Target::can_check_for_function_pointers): Rewrite.
6625 Make non-virtual.
6626 (Target::can_icf_inline_merge_sections): Likewise.
6627 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6628 (Target::Target_info): Add can_icf_inline_merge_sections field.
6629 (Target::do_can_check_for_function_pointers): New virtual
6630 function.
6631 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6632 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6633 from can_check_for_function_pointers, move in file.
6634 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6635 section_may_have_icf_unsafe_poineters, move in file.
6636 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6637 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6638 Rename from can_check_for_function_pointers, move in file.
6639 (Target_i386::can_icf_inline_merge_sections): Remove.
6640 (Target_i386::i386_info): Initialize
6641 can_icf_inline_merge_sections.
6642 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6643 Initialize can_icf_inline_merge_sections.
6644 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6645 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6646 Rename from can_check_for_function_pointers, move in file.
6647 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6648 (Target_x86_64::x86_64_info): Initialize
6649 can_icf_inline_merge_sections.
6650 * testsuite/testfile.cc (Target_test::test_target_info):
6651 Likewise.
6652 * icf.cc (get_section_contents): Correct formatting.
6653
6654 2011-06-27 Ian Lance Taylor <iant@google.com>
6655
6656 * symtab.cc (Symbol::versioned_name): New function.
6657 (Symbol_table::add_to_final_symtab): Use versioned_name when
6658 appropriate.
6659 (Symbol_table::sized_write_symbol): Likewise.
6660 * symtab.h (class Symbol): Declare versioned_name.
6661 * stringpool.h (class Stringpool_template): Add variant of add
6662 which takes a std::basic_string.
6663 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6664 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6665 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6666 (ver_test_12.o): New target.
6667 * testsuite/Makefile.in: Rebuild.
6668
6669 2011-06-27 Doug Kwan <dougkwan@google.com>
6670
6671 * arm.cc (Arm_relocate_functions::thm_jump8,
6672 Arm_relocate_functions::thm_jump11): Use a wider signed
6673 type to compute offset.
6674 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6675 arm_thm_jump8.
6676 * testsuite/Makefile.in: Regenerate.
6677 * testsuite/arm_branch_in_range.sh: Check test results of
6678 arm_thm_jump11 and arm_thm_jump8.
6679 * testsuite/arm_thm_jump11.s: New test source file.
6680 * testsuite/arm_thm_jump11.t: New linker script.
6681 * testsuite/arm_thm_jump8.s: New test source file.
6682 * testsuite/arm_thm_jump8.t: New linker script.
6683
6684 2011-06-24 Ian Lance Taylor <iant@google.com>
6685
6686 * layout.cc: Include "object.h".
6687 (ctors_sections_in_init_array): New static variable.
6688 (Layout::is_ctors_in_init_array): New function.
6689 (Layout::layout): Add entry to ctors_sections_in_init_array if
6690 appropriate.
6691 * layout.h (class Layout): Declare is_ctors_in_init_array.
6692 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6693 is_ctors_reverse_view is set.
6694 (Sized_relobj_file::write_sections): Add layout parameter. Change
6695 all callers. Set is_ctors_reverse_view field of View_size.
6696 (Sized_relobj_file::reverse_words): New function.
6697 * object.h (Sized_relobj_file::View_size): Add
6698 is_ctors_reverse_view field.
6699 (class Sized_relobj_file): Update declarations.
6700 * testsuite/initpri3.c: New test.
6701 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6702 initpri3b.
6703 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6704 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6705 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6706 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6707 * testsuite/Makefile.in: Rebuild.
6708
6709 2011-06-24 Cary Coutant <ccoutant@google.com>
6710
6711 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6712 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6713 (debug_msg_cdebug.err): New targets.
6714 * testsuite/Makefile.in: Regenerate.
6715 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6716 Fix checks for link with shared library.
6717
6718 2011-06-24 Doug Kwan <dougkwan@google.com>
6719
6720 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6721 skip empty text sections.
6722 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6723
6724 2011-06-22 Ian Lance Taylor <iant@google.com>
6725
6726 PR gold/12910
6727 * options.h (class General_options): Add --ctors-in-init-array.
6728 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6729 friends as SHT_PROGBITS for merging sections.
6730 (Layout::layout): Remove special handling of .init_array and
6731 friends. Don't sort if doing relocatable link. Sort for .ctors
6732 and .dtors if ctors_in_init_array.
6733 (Layout::make_output_section): Force correct section types for
6734 .init_array and friends. Don't sort if doing relocatable link,
6735 Don't sort .ctors and .dtors if ctors_in_init_array.
6736 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6737 (Layout::output_section_name): Add relobj parameter. Change all
6738 callers. Handle .ctors. and .dtors. in code rather than table.
6739 Handle .ctors and .dtors if ctors_in_init_array.
6740 (Layout::match_file_name): New function, moved from output.cc.
6741 * layout.h (class Layout): Update declarations.
6742 * output.cc: Include "layout.h".
6743 (Input_section_sort_entry::get_priority): New function.
6744 (Input_section_sort_entry::match_file_name): Just call
6745 Layout::match_file_name.
6746 (Output_section::Input_section_sort_init_fini_compare::operator()):
6747 Handle .ctors and .dtors. Sort by explicit priority rather than
6748 by name.
6749 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6750 * testsuite/initpri2.c: New test.
6751 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6752 (check_PROGRAMS): Add initpri2.
6753 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6754 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6755 * configure, testsuite/Makefile.in: Rebuild.
6756
6757 2011-06-19 Ian Lance Taylor <iant@google.com>
6758
6759 PR gold/12880
6760 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6761 .interp section to a PT_INTERP segment even if we have seen a
6762 --dynamic-linker option. Don't do it if we have seen a PHDRS
6763 clause in a linker script.
6764 (Layout::finalize): Don't create a .interp section if we've
6765 already create a PT_INTERP segment.
6766 (Layout::create_interp): Always call choose_output_section (revert
6767 patch of 2011-06-17). Don't create PT_INTERP segment.
6768 * script-sections.cc
6769 (Script_sections::create_note_and_tls_segments): Add a .interp
6770 section to a PT_INTERP segment even if we have seen a
6771 --dynamic-linker option.
6772
6773 2011-06-18 Ian Lance Taylor <iant@google.com>
6774
6775 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6776 merely because a non-PT_LOAD segment has a dynamic reloc.
6777
6778 2011-06-18 Ian Lance Taylor <iant@google.com>
6779
6780 * layout.cc (Layout::finish_dynamic_section): Don't create
6781 DT_FLAGS entry if not needed.
6782
6783 2011-06-18 Ian Lance Taylor <iant@google.com>
6784
6785 PR gold/12745
6786 * layout.cc (Layout::layout_eh_frame): Correct handling of
6787 writable .eh_frame section.
6788
6789 2011-06-17 Ian Lance Taylor <iant@google.com>
6790
6791 PR gold/12893
6792 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6793 symbol is redefined with the exact same object and value.
6794
6795 2011-06-17 Ian Lance Taylor <iant@google.com>
6796
6797 PR gold/12880
6798 * layout.h (class Layout): Add interp_segment_ field.
6799 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6800 (Layout::attach_allocated_section_to_segment): If making shared
6801 library, put .interp section in PT_INTERP segment.
6802 (Layout::finalize): Also call create_interp if -dynamic-linker
6803 option was used.
6804 (Layout::create_interp): Assert that there is no PT_INTERP
6805 segment. If not using a SECTIONS clause, use make_output_section.
6806 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6807 * script-sections.cc
6808 (Script_sections::create_note_and_tls_segments): If making shared
6809 library, put .interp section in PT_INTERP segment.
6810
6811 2011-06-17 Ian Lance Taylor <iant@google.com>
6812
6813 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6814 when making a shared library.
6815
6816 2011-06-17 Ian Lance Taylor <iant@google.com>
6817
6818 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6819 parameter. Change all callers. Don't issue warning about PC32
6820 against locally defined symbol.
6821
6822 2011-06-16 Ian Lance Taylor <iant@google.com>
6823
6824 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6825 occurs in same object.
6826
6827 2011-06-14 Alan Modra <amodra@gmail.com>
6828
6829 * po/POTFILES.in: Regenerate.
6830
6831 2011-06-09 Ian Lance Taylor <iant@google.com>
6832
6833 * script-sections.cc
6834 (Orphan_output_section::set_section_addresses): For a relocatable
6835 link set address to 0.
6836
6837 2011-06-09 Cary Coutant <ccoutant@google.com>
6838
6839 PR gold/12804
6840 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6841 used with --compress-debug-sections.
6842 * gold/object.cc (Sized_relobj_file::do_layout): Report
6843 uncompressed size of compressed input sections.
6844
6845 2011-06-08 Cary Coutant <ccoutant@google.com>
6846
6847 PR gold/12804
6848 * testsuite/two_file_test_2_v1.cc: Change initialization of
6849 v2 to keep it in .data.
6850
6851 2011-06-07 Cary Coutant <ccoutant@google.com>
6852
6853 * common.cc (Symbol_table::do_allocate_commons_list): Call
6854 gold_fallback.
6855 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6856 (Errors::fallback): New function.
6857 (gold_fallback): New function.
6858 * errors.h (Errors::fallback): New function.
6859 * gold.cc (gold_exit): Change status parameter to enum; adjust
6860 all callers.
6861 (queue_initial_tasks): Call gold_fallback.
6862 * gold.h: Include cstdlib.
6863 (Exit_status): New enum type.
6864 (gold_exit): Change status parameter to enum.
6865 (gold_fallback): New function.
6866 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6867 (Layout::create_symtab_sections): Likewise.
6868 (Layout::create_shdrs): Likewise.
6869 * main.cc (main): Adjust call to gold_exit.
6870 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6871 (Output_data_got::add_got_entry_pair): Likewise.
6872 (Output_section::add_input_section): Likewise.
6873 (Output_section::add_output_section_data): Likewise.
6874 (Output_segment::set_section_list_addresses): Likewise.
6875 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6876
6877 2011-06-07 Cary Coutant <ccoutant@google.com>
6878
6879 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6880 for incremental links.
6881 * output.cc (Output_segment::set_section_list_addresses): Remove
6882 FIXME and test for TLS or BSS.
6883
6884 2011-06-07 Cary Coutant <ccoutant@google.com>
6885
6886 * testsuite/Makefile.am: Add incremental_copy_test,
6887 incremental_common_test_1.
6888 * testsuite/Makefile.in: Regenerate.
6889 * testsuite/common_test_1_v1.c: New source file.
6890 * testsuite/common_test_1_v2.c: New source file.
6891 * testsuite/copy_test_v1.cc: New source file.
6892
6893 2011-06-07 Cary Coutant <ccoutant@google.com>
6894
6895 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6896 update, allocate common from bss section's free list.
6897 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6898 linker-defined symbols.
6899 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6900 Skip GOT and PLT entries that are no longer referenced.
6901 (Output_section_incremental_inputs::write_info_blocks): Mark
6902 linker-defined symbols.
6903 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6904 * output.cc (Output_section::allocate): New function.
6905 * output.h (Output_section::allocate): New function.
6906 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6907 linker-defined symbols.
6908 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6909 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6910 (Symbol::init_base_output_data): Likewise.
6911 (Symbol::init_base_output_segment): Likewise.
6912 (Symbol::init_base_constant): Likewise.
6913 (Sized_symbol::init_output_data): Likewise.
6914 (Sized_symbol::init_output_segment): Likewise.
6915 (Sized_symbol::init_constant): Likewise.
6916 (Symbol_table::do_define_in_output_data): Likewise.
6917 (Symbol_table::do_define_in_output_segment): Likewise.
6918 (Symbol_table::do_define_as_constant): Likewise.
6919 * symtab.h (Symbol::is_predefined): New function.
6920 (Symbol::init_base_output_data): Add is_predefined parameter.
6921 (Symbol::init_base_output_segment): Likewise.
6922 (Symbol::init_base_constant): Likewise.
6923 (Symbol::is_predefined_): New data member.
6924 (Sized_symbol::init_output_data): Add is_predefined parameter.
6925 (Sized_symbol::init_output_segment): Likewise.
6926 (Sized_symbol::init_constant): Likewise.
6927 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6928
6929 2011-06-07 Cary Coutant <ccoutant@google.com>
6930
6931 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6932 instead of emit_copy_reloc.
6933 (Copy_relocs::emit_copy_reloc): Refactor.
6934 (Copy_relocs::make_copy_reloc): New function.
6935 (Copy_relocs::add_copy_reloc): Remove.
6936 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6937 section.
6938 (Copy_relocs::make_copy_reloc): New function.
6939 (Copy_relocs::add_copy_reloc): Remove.
6940 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6941 unchanged input files.
6942 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6943 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6944 Reserve BSS space for COPY relocations.
6945 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6946 (Output_section_incremental_inputs::write_info_blocks): Record
6947 whether a symbol is copied from a shared object.
6948 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6949 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6950 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6951 (Incremental_input_entry_reader::get_output_symbol_index): Add
6952 is_copy parameter.
6953 (Incremental_binary::emit_copy_relocs): New function.
6954 (Incremental_binary::do_emit_copy_relocs): New function.
6955 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6956 new data member.
6957 (Sized_incremental_binary::add_copy_reloc): New function.
6958 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6959 (Sized_incremental_binary::Copy_reloc): New struct.
6960 (Sized_incremental_binary::Copy_relocs): New typedef.
6961 (Sized_incremental_binary::copy_relocs_): New data member.
6962 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6963 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6964 * target.h (Sized_target::emit_copy_reloc): New function.
6965 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6966
6967 2011-06-02 Cary Coutant <ccoutant@google.com>
6968
6969 PR gold/12163
6970 * gold/archive.cc (Archive::Archive): Initialize new data member.
6971 (Archive::include_all_members): Return if archive has already been
6972 included.
6973 * gold/archive.h (Archive::include_all_members_): New data member.
6974
6975 2011-06-02 Nick Clifton <nickc@redhat.com>
6976
6977 * dynobj.h: Fix spelling mistake in comment.
6978 * output.cc: Likewise.
6979
6980 2011-05-31 Doug Kwan <dougkwan@google.com>
6981 Asier Llano
6982
6983 PR gold/12826
6984 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
6985 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6986 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6987 redundant arm_exidx_test.so.
6988 * testsuite/Makefile.in: Regenerate.
6989 (check_SCRIPTS): Add pr12826.sh
6990 (check_DATA): Add pr12826.stdout
6991 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6992 * testsuite/pr12826.sh: New file.
6993 * testsuite/pr12826_1.s: Ditto.
6994 * testsuite/pr12826_1.s: Ditto.
6995
6996 2011-05-30 Ian Lance Taylor <iant@google.com>
6997
6998 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6999 sections.
7000
7001 2011-05-29 Ian Lance Taylor <iant@google.com>
7002
7003 PR gold/12804
7004 * testsuite/Makefile.am: Use different file name for two_file_test
7005 temporary file for each incremental test.
7006 * testsuite/Makefile.in: Rebuild.
7007
7008 2011-05-29 Ian Lance Taylor <iant@google.com>
7009
7010 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7011 binary input file is empty.
7012
7013 2011-05-27 Ian Lance Taylor <iant@google.com>
7014
7015 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7016 (ver_test_9.so): Likewise.
7017 * testsuite/Makefile.in: Rebuild.
7018
7019 2011-05-26 Cary Coutant <ccoutant@google.com>
7020
7021 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7022 * incremental.cc (Incremental_inputs::report_input_section): Fix
7023 comment, indentation.
7024 (Incremental_inputs::report_comdat_group): New function.
7025 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7026 of data for incremental input file entry.
7027 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7028 group count, COMDAT group signatures.
7029 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7030 an unchanged input file.
7031 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7032 Initialize new data member.
7033 (Incremental_object_entry::add_comdat_group): New function.
7034 (Incremental_object_entry::get_comdat_group_count): New function.
7035 (Incremental_object_entry::get_comdat_signature_key): New function.
7036 (Incremental_object_entry::groups_): New data member.
7037 (Incremental_inputs::report_comdat_group): New function.
7038 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7039 data for incremental input file entry.
7040 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7041 (Incremental_input_entry_reader::get_input_section): Adjust size of
7042 data for incremental input file entry.
7043 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7044 (Incremental_input_entry_reader::get_comdat_group_signature): New
7045 function.
7046 * object.cc (Sized_relobj::include_section_group): Report kept
7047 COMDAT groups for incremental links.
7048
7049 2011-05-24 David Meyer <pdox@google.com>
7050
7051 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7052 with name parameter. Add found_name parameter.
7053 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7054 * dirsearch.h (class Dirsearch): Update declaration.
7055
7056 2011-05-24 Ian Lance Taylor <iant@google.com>
7057
7058 * archive.cc (Library_base::should_include_member): Pull in object
7059 from archive if it defines the entry symbol.
7060 * parameters.cc (Parameters::entry): New function.
7061 * parameters.h (class Parameters): Declare entry.
7062 * output.h (class Output_file_header): Remove entry_ field.
7063 * output.cc (Output_file_header::Output_file_header): Remove entry
7064 parameter. Change all callers.
7065 (Output_file_header::entry): Use parameters->entry.
7066 * gold.cc (queue_middle_tasks): Likewise.
7067 * plugin.cc (Plugin_hook::run): Likewise.
7068
7069 2011-05-24 Cary Coutant <ccoutant@google.com>
7070
7071 * gold.cc (queue_initial_tasks): Pass incremental base filename
7072 to Output_file::open_base_file; don't print error message.
7073 * incremental-dump.cc (main): Adjust call to
7074 Output_file::open_for_modification.
7075 * incremental-dump.cc (main): Likewise.
7076 * incremental.cc (Incremental_inputs::report_command_line):
7077 Ignore --incremental-base option when comparing command lines.
7078 Ignore parameter when given as separate argument.
7079 * options.h (class General_options): Add --incremental-base.
7080 * output.cc (Output_file::Output_file):
7081 (Output_file::open_base_file): Add base_name and writable parameters;
7082 read base file into new file; print error message here.
7083 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7084 callers.
7085 * output.h (Output_file::open_for_modification): Rename to...
7086 (Output_file::open_base_file): ...this; add base_name and
7087 writable parameters; adjust all callers.
7088 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7089 callers.
7090 * testsuite/Makefile.am (incremental_test_4): Test
7091 --incremental-base.
7092 * testsuite/Makefile.in: Regenerate.
7093
7094 2011-05-24 Cary Coutant <ccoutant@google.com>
7095
7096 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7097 incremental_test_4.
7098 * testsuite/Makefile.in: Regenerate.
7099 * testsuite/two_file_test_1_v1.cc: New test source file.
7100 * testsuite/two_file_test_1b_v1.cc: New test source file.
7101 * testsuite/two_file_test_2_v1.cc: New test source file.
7102
7103 2011-05-24 Cary Coutant <ccoutant@google.com>
7104
7105 * dynobj.h (Dynobj::do_dynobj): New function.
7106 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7107 flag and soname for shared objects.
7108 * incremental.cc (Incremental_inputs::report_object): Make
7109 either Incremental_object_entry or Incremental_dynobj_entry; add
7110 soname to string table.
7111 (Incremental_inputs::report_input_section): Add assertion.
7112 (Output_section_incremental_inputs::set_final_data_size): Adjust
7113 type of input file entry for shared libraries; adjust size of
7114 shared library info entry.
7115 (Output_section_incremental_inputs::write_input_files): Write
7116 as_needed flag for shared libraries.
7117 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7118 of input file entry for shared libraries; write soname.
7119 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7120 soname from incremental info.
7121 * incremental.h (enum Incremental_input_flags): Add
7122 INCREMENTAL_INPUT_AS_NEEDED.
7123 (Incremental_input_entry::Incremental_input_entry): Initialize new
7124 data member.
7125 (Incremental_input_entry::set_as_needed): New function.
7126 (Incremental_input_entry::as_needed): New function.
7127 (Incremental_input_entry::do_dynobj_entry): New function.
7128 (Incremental_input_entry::as_needed_): New data member.
7129 (Incremental_object_entry::Incremental_object_entry): Don't check
7130 for shared library.
7131 (Incremental_object_entry::do_type): Likewise.
7132 (class Incremental_dynobj_entry): New class.
7133 (Incremental_input_entry_reader::as_needed): New function.
7134 (Incremental_input_entry_reader::get_soname): New function.
7135 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7136 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7137 size of shared library info entry.
7138 * layout.cc (Layout::finish_dynamic_section): Don't test for
7139 incremental link when adding DT_NEEDED entries.
7140 * object.h (Object::Object): Initialize new data member.
7141 (Object::dynobj): New function.
7142 (Object::set_as_needed): New function.
7143 (Object::as_needed): New function.
7144 (Object::do_dynobj): New function.
7145 (Object::as_needed_): New data member.
7146
7147 2011-05-24 Cary Coutant <ccoutant@google.com>
7148
7149 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7150 info; adjust display of GOT entries.
7151 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7152 vector of input objects; remove file_status_.
7153 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7154 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7155 got_plt reader; call target hooks to reserve GOT entries.
7156 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7157 of input file info header and GOT info entry.
7158 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7159 relocation info.
7160 (Got_plt_view_info::got_descriptor): Remove.
7161 (Got_plt_view_info::sym_index): New data member.
7162 (Got_plt_view_info::input_index): New data member.
7163 (Local_got_offset_visitor::visit): Write input file index.
7164 (Global_got_offset_visitor::visit): Write 0 for input file index.
7165 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7166 with sym_index and input_index.
7167 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7168 incremental info GOT entry; replace got_descriptor with input_index.
7169 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7170 map from input file index to object.
7171 (Sized_relobj_incr::do_layout): Replace direct data member reference
7172 with accessor function.
7173 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7174 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7175 Adjust size of input file info header.
7176 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7177 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7178 (Incremental_input_entry_reader::get_input_section): Adjust size of
7179 input file info header.
7180 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7181 of incremental info GOT entry.
7182 (Incremental_got_plt_reader::get_got_desc): Remove.
7183 (Incremental_got_plt_reader::get_got_symndx): New function.
7184 (Incremental_got_plt_reader::get_got_input_index): New function.
7185 (Sized_incremental_binary::Sized_incremental_binary): Remove
7186 file_status_; add input_objects_.
7187 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7188 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7189 (Sized_incremental_binary::file_is_unchanged): Remove.
7190 (Sized_incremental_binary::set_input_object): New function.
7191 (Sized_incremental_binary::input_object): New function.
7192 (Sized_incremental_binary::file_status_): Remove.
7193 (Sized_incremental_binary::input_objects_): New data member.
7194 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7195 references.
7196 (Sized_relobj_incr::invalid_address): Move to base class.
7197 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7198 class.
7199 (Sized_relobj_incr::do_output_section_offset): Likewise.
7200 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7201 (Sized_relobj_incr::section_offsets_): Likewise.
7202 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7203 function.
7204 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7205 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7206 with accessor function.
7207 (Sized_relobj_file::do_layout): Likewise.
7208 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7209 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7210 (Sized_relobj_file::compute_final_local_value): Replace refs to
7211 section_offsets_ with accessor function.
7212 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7213 * object.h (Relobj::Relobj): Initialize new data members.
7214 (Relobj::add_dyn_reloc): New function.
7215 (Relobj::first_dyn_reloc): New function.
7216 (Relobj::dyn_reloc_count): New function.
7217 (Relobj::first_dyn_reloc_): New data member.
7218 (Relobj::dyn_reloc_count_): New data member.
7219 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7220 references.
7221 (Sized_relobj::Address): New typedef.
7222 (Sized_relobj::invalid_address): Move here from child class.
7223 (Sized_relobj::Sized_relobj): Initialize new data members.
7224 (Sized_relobj::sized_relobj): New function.
7225 (Sized_relobj::is_output_section_offset_invalid): Move here from
7226 child class.
7227 (Sized_relobj::get_output_section_offset): Likewise.
7228 (Sized_relobj::local_has_got_offset): Likewise.
7229 (Sized_relobj::local_got_offset): Likewise.
7230 (Sized_relobj::set_local_got_offset): Likewise.
7231 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7232 (Sized_relobj::clear_got_offsets): New function.
7233 (Sized_relobj::section_offsets): Move here from child class.
7234 (Sized_relobj::do_output_section_offset): Likewise.
7235 (Sized_relobj::do_set_section_offset): Likewise.
7236 (Sized_relobj::Local_got_offsets): Likewise.
7237 (Sized_relobj::local_got_offsets_): Likewise.
7238 (Sized_relobj::section_offsets_): Likewise.
7239 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7240 references.
7241 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7242 class.
7243 (Sized_relobj_file::sized_relobj): New function
7244 (Sized_relobj_file::local_has_got_offset): Move to base class.
7245 (Sized_relobj_file::local_got_offset): Likewise.
7246 (Sized_relobj_file::set_local_got_offset): Likewise.
7247 (Sized_relobj_file::get_output_section_offset): Likewise.
7248 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7249 (Sized_relobj_file::do_output_section_offset): Likewise.
7250 (Sized_relobj_file::do_set_section_offset): Likewise.
7251 (Sized_relobj_file::Local_got_offsets): Likewise.
7252 (Sized_relobj_file::local_got_offsets_): Likewise.
7253 (Sized_relobj_file::section_offsets_): Likewise.
7254 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7255 (all constructors).
7256 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7257 (Output_reloc::get_symbol_index): Likewise.
7258 (Output_reloc::local_section_offset): Likewise.
7259 (Output_reloc::get_address): Likewise.
7260 (Output_reloc::symbol_value): Likewise.
7261 (Output_data_got::reserve_slot): Move to class definition.
7262 (Output_data_got::reserve_local): New function.
7263 (Output_data_got::reserve_slot_for_global): Remove.
7264 (Output_data_got::reserve_global): New function.
7265 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7266 (all constructors, two instantiations).
7267 (Output_reloc::get_relobj): New function (two instantiations).
7268 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7269 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7270 (Output_data_reloc::add_global): Adjust type of relobj.
7271 (Output_data_reloc::add_global_relative): Likewise.
7272 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7273 (Output_data_reloc::add_local): Likewise.
7274 (Output_data_reloc::add_local_relative): Likewise.
7275 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7276 (Output_data_reloc::add_local_section): Likewise.
7277 (Output_data_reloc::add_output_section): Likewise.
7278 (Output_data_reloc::add_absolute): Likewise.
7279 (Output_data_reloc::add_target_specific): Likewise.
7280 (Output_data_got::reserve_slot): Move definition here.
7281 (Output_data_got::reserve_local): New function.
7282 (Output_data_got::reserve_global): New function.
7283 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7284 section_offsets_ with accessor function.
7285 (Sized_relobj_file::write_sections): Likewise.
7286 (Sized_relobj_file::do_relocate_sections): Likewise.
7287 * target.h (Sized_target::reserve_local_got_entry): New function.
7288 (Sized_target::reserve_global_got_entry): New function.
7289 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7290 (Target_x86_64::reserve_global_got_entry): New function.
7291 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7292
7293 2011-05-23 Cary Coutant <ccoutant@google.com>
7294
7295 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7296 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7297 bit when checking got_type.
7298 * incremental.cc (Sized_incremental_binary::setup_readers):
7299 Store symbol table and string table locations; initialize bit vector
7300 of file status flags.
7301 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7302 unchanged files.
7303 (Sized_incremental_binary::do_process_got_plt): New function.
7304 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7305 (Output_section_incremental_inputs::set_final_data_size): Record
7306 file index for each input file.
7307 (Output_section_incremental_inputs::write_got_plt): Store file index
7308 instead of input entry offset for each GOT entry.
7309 * incremental.h
7310 (Incremental_input_entry::Incremental_input_entry): Initialize new
7311 data member.
7312 (Incremental_input_entry::set_offset): Store file index.
7313 (Incremental_input_entry::get_file_index): New function.
7314 (Incremental_input_entry::file_index_): New data member.
7315 (Incremental_binary::process_got_plt): New function.
7316 (Incremental_binary::do_process_got_plt): New function.
7317 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7318 data members.
7319 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7320 (Sized_incremental_binary::set_file_is_unchanged): New function.
7321 (Sized_incremental_binary::file_is_unchanged): New function.
7322 (Sized_incremental_binary::do_process_got_plt): New function.
7323 (Sized_incremental_binary::file_status_): New data member.
7324 (Sized_incremental_binary::main_symtab_loc_): New data member.
7325 (Sized_incremental_binary::main_strtab_loc_): New data member.
7326 * output.cc (Output_data_got::Got_entry::write): Add case
7327 RESERVED_CODE.
7328 (Output_data_got::add_global): Call add_got_entry.
7329 (Output_data_got::add_global_plt): Likewise.
7330 (Output_data_got::add_global_with_rel): Likewise.
7331 (Output_data_got::add_global_with_rela): Likewise.
7332 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7333 (Output_data_got::add_global_pair_with_rela): Likewise.
7334 (Output_data_got::add_local): Call add_got_entry.
7335 (Output_data_got::add_local_plt): Likewise.
7336 (Output_data_got::add_local_with_rel): Likewise.
7337 (Output_data_got::add_local_with_rela): Likewise.
7338 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7339 (Output_data_got::add_local_pair_with_rela): Likewise.
7340 (Output_data_got::reserve_slot): New function.
7341 (Output_data_got::reserve_slot_for_global): New function.
7342 (Output_data_got::add_got_entry): New function.
7343 (Output_data_got::add_got_entry_pair): New function.
7344 (Output_section::add_output_section_data): Edit FIXME.
7345 * output.h
7346 (Output_section_data_build::Output_section_data_build): New
7347 constructor with size parameter.
7348 (Output_data_space::Output_data_space): Likewise.
7349 (Output_data_got::Output_data_got): Initialize new data member; new
7350 constructor with size parameter.
7351 (Output_data_got::add_constant): Call add_got_entry.
7352 (Output_data_got::reserve_slot): New function.
7353 (Output_data_got::reserve_slot_for_global): New function.
7354 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7355 (Output_data_got::add_got_entry): New function.
7356 (Output_data_got::add_got_entry_pair): New function.
7357 (Output_data_got::free_list_): New data member.
7358 * target.h (Sized_target::init_got_plt_for_update): New function.
7359 (Sized_target::register_global_plt_entry): New function.
7360 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7361 Initialize new data member; call init; add constructor with PLT count.
7362 (Output_data_plt_x86_64::init): New function.
7363 (Output_data_plt_x86_64::add_relocation): New function.
7364 (Output_data_plt_x86_64::reserve_slot): New function.
7365 (Output_data_plt_x86_64::free_list_): New data member.
7366 (Target_x86_64::init_got_plt_for_update): New function.
7367 (Target_x86_64::register_global_plt_entry): New function.
7368 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7369 incremental updates.
7370 (Output_data_plt_x86_64::add_relocation): New function.
7371 * testsuite/object_unittest.cc (Object_test): Set default options.
7372
7373 2011-05-16 Ian Lance Taylor <iant@google.com>
7374
7375 * options.h (class General_options): Make -i a synonym for -r.
7376
7377 2011-05-16 Ian Lance Taylor <iant@google.com>
7378
7379 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7380
7381 2011-05-10 Cary Coutant <ccoutant@google.com>
7382
7383 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7384 strip_all (-s).
7385
7386 2011-05-06 Ian Lance Taylor <iant@google.com>
7387
7388 * layout.cc (Layout::layout): If the output section flags change,
7389 update the ordering.
7390
7391 2011-04-25 Cary Coutant <ccoutant@google.com>
7392
7393 * incremental-dump.cc (dump_incremental_inputs): Print local
7394 symbol info for each input file.
7395 * incremental.cc
7396 (Output_section_incremental_inputs::set_final_data_size): Add local
7397 symbol info to input file entries in incremental info.
7398 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7399 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7400 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7401 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7402 implementation.
7403 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7404 (Sized_incr_relobj::do_relocate): Write the local symbols.
7405 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7406 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7407 Adjust size of input file header.
7408 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7409 (Incremental_inputs_reader::get_local_symbol_count): New function.
7410 (Incremental_inputs_reader::get_input_section): Adjust size of input
7411 file header.
7412 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7413 (Sized_incr_relobj::This): New typedef.
7414 (Sized_incr_relobj::sym_size): New const data member.
7415 (Sized_incr_relobj::Local_symbol): New struct.
7416 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7417 (Sized_incr_relobj::do_local_symbol_offset): New function.
7418 (Sized_incr_relobj::local_symbol_count_): New data member.
7419 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7420 (Sized_incr_relobj::local_symbol_index_): New data member.
7421 (Sized_incr_relobj::local_symbol_offset_): New data member.
7422 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7423 (Sized_incr_relobj::local_symbols_): New data member.
7424 * object.h (Relobj::output_local_symbol_count): New function.
7425 (Relobj::local_symbol_offset): New function.
7426 (Relobj::do_output_local_symbol_count): New function.
7427 (Relobj::do_local_symbol_offset): New function.
7428 (Sized_relobj::do_output_local_symbol_count): New function.
7429 (Sized_relobj::do_local_symbol_offset): New function.
7430
7431 2011-04-22 Vladimir Simonov <sv@sw.ru>
7432
7433 * descriptors.cc (set_close_on_exec): New function.
7434 (Descriptors::open): Use set_close_on_exec.
7435 * output.cc (S_ISLNK): Define if not defined.
7436
7437 2011-04-22 Cary Coutant <ccoutant@google.com>
7438
7439 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7440 global symbol map.
7441 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7442 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7443 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7444 relocations.
7445 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7446 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7447 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7448 * incremental.h
7449 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7450 function.
7451 (Incremental_binary::apply_incremental_relocs): New function.
7452 (Incremental_binary::do_apply_incremental_relocs): New function.
7453 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7454 data member.
7455 (Sized_incremental_binary::add_global_symbol): New function.
7456 (Sized_incremental_binary::global_symbol): New function.
7457 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7458 (Sized_incremental_binary::symbol_map_): New data member.
7459 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7460 * target.h (Sized_target::apply_relocation): New function.
7461 * target-reloc.h (apply_relocation): New function.
7462 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7463
7464 2011-04-22 Doug Kwan <dougkwan@google.com>
7465
7466 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7467 flag of a SHT_ARM_EXIDX section.
7468 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7469 * testsuite/Makefile.in: Regenerate.
7470 * testsuite/arm_exidx_test.s: New file.
7471 * testsuite/arm_exidx_test.sh: Same.
7472
7473 2011-04-20 Cary Coutant <ccoutant@google.com>
7474
7475 PR gold/12689
7476 * archive.h (Incremental_archive_entry::Archive_member):
7477 Initialize arg_serial_ (second constructor).
7478
7479 2011-04-17 Ian Lance Taylor <iant@google.com>
7480
7481 * object.cc (Relocate_info::location): Simplify location string.
7482 * errors.cc (Errors::error_at_location): Don't print program
7483 name.
7484 (Errors::warning_at_location): Likewise.
7485 (Errors::undefined_symbol): Likewise.
7486 * testsuite/debug_msg.sh: Update accordingly.
7487
7488 2011-04-14 Cary Coutant <ccoutant@google.com>
7489
7490 * gold/layout.cc (Layout::symtab_section_offset): New function.
7491 * gold/layout.h (Layout::symtab_section_offset): New function.
7492 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7493
7494 2011-04-12 Ian Lance Taylor <iant@google.com>
7495
7496 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7497 with MREMAP_MAYMOVE.
7498 * output.h (class Output_file): Add map_is_allocated_ field.
7499 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7500 not available, provide stubs. If mremap is not available, #define
7501 it to gold_mremap.
7502 (MREMAP_MAYMOVE): Define if not defined.
7503 (Output_file::Output_file): Initialize map_is_allocated_.
7504 (Output_file::resize): Check map_is_allocated_.
7505 (Output_file::map_anonymous): If mmap fails, use malloc.
7506 (Output_file::unmap): Don't do anything for an anonymous map.
7507 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7508 is not available, provide stubs.
7509 (File_read::View::~View): Use free rather than delete[].
7510 (File_read::make_view): Use malloc rather than new[]. If mmap
7511 fails, use malloc.
7512 (File_read::find_or_make_view): Use malloc rather than new[].
7513 * gold.h: Remove HAVE_REMAP code.
7514 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7515 exists. Rename mremap to gold_mremap. If mmap is not available
7516 don't do anything.
7517 * configure, config.in: Rebuild.
7518
7519 2011-04-11 Ian Lance Taylor <iant@google.com>
7520
7521 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7522 initialize local variable v.
7523
7524 2011-04-11 Cary Coutant <ccoutant@google.com>
7525
7526 * archive.cc (Archive::include_member): Adjust call to
7527 report_object.
7528 (Add_archive_symbols::run): Track argument serial numbers.
7529 (Lib_group::include_member): Likewise.
7530 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7531 * archive.h (Incremental_archive_entry::Archive_member):
7532 Initialize arg_serial_.
7533 (Archive_member::arg_serial_): New data member.
7534 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7535 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7536 incremental link.
7537 (Sized_dynobj::do_for_all_local_got_entries): New function.
7538 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7539 function.
7540 * fileread.cc (get_mtime): New function.
7541 * fileread.h (get_mtime): New function.
7542 * gold.cc (queue_initial_tasks): Check for incremental update.
7543 (process_incremental_input): New function.
7544 (queue_middle_tasks): Don't force valid target for incremental
7545 update.
7546 * incremental-dump.cc (find_input_containing_global): Adjust
7547 size of symbol info entry.
7548 (dump_incremental_inputs): Dump argument serial number and
7549 in_system_directory flag; bias shndx by 1; print symbol names
7550 when dumping per-file symbol lists; use new symbol info readers.
7551 * incremental.cc
7552 (Output_section_incremental_inputs:update_data_size): New function.
7553 (Sized_incremental_binary::setup_readers): Setup input readers
7554 for each input file; build maps for files added from libraries
7555 and scripts.
7556 (Sized_incremental_binary::check_input_args): New function.
7557 (Sized_incremental_binary::do_check_inputs): Build map of argument
7558 serial numbers to input arguments.
7559 (Sized_incremental_binary::do_file_has_changed): Rename
7560 do_file_is_unchanged to this; compare file modification times.
7561 (Sized_incremental_binary::do_init_layout): New function.
7562 (Sized_incremental_binary::do_reserve_layout): New function.
7563 (Sized_incremental_binary::do_get_input_reader): Remove.
7564 (Sized_incremental_binary::get_symtab_view): New function.
7565 (Incremental_checker::can_incrementally_link_output_file): Remove.
7566 (Incremental_inputs::report_command_line): Exclude --debug options.
7567 (Incremental_inputs::report_archive_begin): Add parameter; track
7568 argument serial numbers; don't put input file entry for archive
7569 before archive members.
7570 (Incremental_inputs::report_archive_end): Put input file entry
7571 for archive after archive members.
7572 (Incremental_inputs::report_object): Add parameter; track argument
7573 serial numbers and in_system_directory flag.
7574 (Incremental_inputs::report_script): Add parameter; track argument
7575 serial numbers.
7576 (Output_section_incremental_inputs::set_final_data_size): Adjust
7577 size of symbol info entry; check for forwarding symbols.
7578 (Output_section_incremental_inputs::write_input_files): Write
7579 in_system_directory flag and argument serial number.
7580 (Output_section_incremental_inputs::write_info_blocks): Map section
7581 indices between incremental info and original input file; store
7582 input section index for each symbol.
7583 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7584 change operator() to visit().
7585 (class Global_got_offset_visitor): Likewise.
7586 (class Global_symbol_visitor_got_plt):
7587 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7588 classes.
7589 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7590 (Sized_incr_relobj::do_read_symbols): New function.
7591 (Sized_incr_relobj::do_layout): New function.
7592 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7593 (Sized_incr_relobj::do_add_symbols): New function.
7594 (Sized_incr_relobj::do_should_include_member): New function.
7595 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7596 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7597 (Sized_incr_relobj::do_section_size): New function.
7598 (Sized_incr_relobj::do_section_name): New function.
7599 (Sized_incr_relobj::do_section_contents): New function.
7600 (Sized_incr_relobj::do_section_flags): New function.
7601 (Sized_incr_relobj::do_section_entsize): New function.
7602 (Sized_incr_relobj::do_section_address): New function.
7603 (Sized_incr_relobj::do_section_type): New function.
7604 (Sized_incr_relobj::do_section_link): New function.
7605 (Sized_incr_relobj::do_section_info): New function.
7606 (Sized_incr_relobj::do_section_addralign): New function.
7607 (Sized_incr_relobj::do_initialize_xindex): New function.
7608 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7609 (Sized_incr_relobj::do_read_relocs): New function.
7610 (Sized_incr_relobj::do_gc_process_relocs): New function.
7611 (Sized_incr_relobj::do_scan_relocs): New function.
7612 (Sized_incr_relobj::do_count_local_symbols): New function.
7613 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7614 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7615 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7616 (Sized_incr_relobj::do_relocate): New function.
7617 (Sized_incr_relobj::do_set_section_offset): New function.
7618 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7619 (Sized_incr_dynobj::do_read_symbols): New function.
7620 (Sized_incr_dynobj::do_layout): New function.
7621 (Sized_incr_dynobj::do_add_symbols): New function.
7622 (Sized_incr_dynobj::do_should_include_member): New function.
7623 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7624 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7625 (Sized_incr_dynobj::do_section_size): New function.
7626 (Sized_incr_dynobj::do_section_name): New function.
7627 (Sized_incr_dynobj::do_section_contents): New function.
7628 (Sized_incr_dynobj::do_section_flags): New function.
7629 (Sized_incr_dynobj::do_section_entsize): New function.
7630 (Sized_incr_dynobj::do_section_address): New function.
7631 (Sized_incr_dynobj::do_section_type): New function.
7632 (Sized_incr_dynobj::do_section_link): New function.
7633 (Sized_incr_dynobj::do_section_info): New function.
7634 (Sized_incr_dynobj::do_section_addralign): New function.
7635 (Sized_incr_dynobj::do_initialize_xindex): New function.
7636 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7637 (make_sized_incremental_object): New function.
7638 (Incremental_library::copy_unused_symbols): New function.
7639 (Incremental_library::do_for_all_unused_symbols): New function.
7640 * incremental.h (enum Incremental_input_flags): New type.
7641 (class Incremental_checker): Remove.
7642 (Incremental_input_entry::Incremental_input_entry): Add argument
7643 serial number.
7644 (Incremental_input_entry::arg_serial): New function.
7645 (Incremental_input_entry::set_is_in_system_directory): New function.
7646 (Incremental_input_entry::is_in_system_directory): New function.
7647 (Incremental_input_entry::arg_serial_): New data member.
7648 (Incremental_input_entry::is_in_system_directory_): New data member.
7649 (class Script_info): Move here from script.h.
7650 (Script_info::Script_info): Add filename parameter.
7651 (Script_info::filename): New function.
7652 (Script_info::filename_): New data member.
7653 (Incremental_script_entry::Incremental_script_entry): Add argument
7654 serial number.
7655 (Incremental_object_entry::Incremental_object_entry): Likewise.
7656 (Incremental_object_entry::add_input_section): Build list of input
7657 sections with map to original shndx.
7658 (Incremental_object_entry::get_input_section_index): New function.
7659 (Incremental_object_entry::shndx_): New data member.
7660 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7661 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7662 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7663 serial number.
7664 (Incremental_inputs::report_archive_begin): Likewise.
7665 (Incremental_inputs::report_object): Likewise.
7666 (Incremental_inputs::report_script): Likewise.
7667 (class Incremental_global_symbol_reader): New class.
7668 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7669 and store flags and input file type.
7670 (Incremental_input_entry_reader::arg_serial): New function.
7671 (Incremental_input_entry_reader::type): Extract type from flags.
7672 (Incremental_input_entry_reader::is_in_system_directory): New function.
7673 (Incremental_input_entry_reader::get_input_section_count): Call
7674 accessor function for type.
7675 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7676 function for type; adjust size of global symbol entry.
7677 (Incremental_input_entry_reader::get_global_symbol_count): Call
7678 accessor function for type.
7679 (Incremental_input_entry_reader::get_object_count): Likewise.
7680 (Incremental_input_entry_reader::get_object_offset): Likewise.
7681 (Incremental_input_entry_reader::get_member_count): Likewise.
7682 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7683 (Incremental_input_entry_reader::get_member_offset): Likewise.
7684 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7685 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7686 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7687 (Incremental_input_entry_reader::get_global_symbol_reader): New
7688 function.
7689 (Incremental_input_entry_reader::get_output_symbol_index): New
7690 function.
7691 (Incremental_input_entry_reader::type_): Remove.
7692 (Incremental_input_entry_reader::flags_): New data member.
7693 (Incremental_inputs_reader::input_file_offset): New function.
7694 (Incremental_inputs_reader::input_file_index): New function.
7695 (Incremental_inputs_reader::input_file): Call input_file_offset.
7696 (Incremental_inputs_reader::input_file_at_offset): New function.
7697 (Incremental_relocs_reader::get_r_type): Reformat.
7698 (Incremental_relocs_reader::get_r_shndx): Reformat.
7699 (Incremental_relocs_reader::get_r_offset): Reformat.
7700 (Incremental_relocs_reader::data): New function.
7701 (Incremental_binary::Incremental_binary): Initialize new data members.
7702 (Incremental_binary::check_inputs): Add cmdline parameter.
7703 (Incremental_binary::file_is_unchanged): Remove.
7704 (Input_reader::arg_serial): New function.
7705 (Input_reader::get_unused_symbol_count): New function.
7706 (Input_reader::get_unused_symbol): New function.
7707 (Input_reader::do_arg_serial): New function.
7708 (Input_reader::do_get_unused_symbol_count): New function.
7709 (Input_reader::do_get_unused_symbol): New function.
7710 (Incremental_binary::input_file_count): New function.
7711 (Incremental_binary::get_input_reader): Change signature to use
7712 index instead of filename.
7713 (Incremental_binary::file_has_changed): New function.
7714 (Incremental_binary::get_input_argument): New function.
7715 (Incremental_binary::get_library): New function.
7716 (Incremental_binary::get_script_info): New function.
7717 (Incremental_binary::init_layout): New function.
7718 (Incremental_binary::reserve_layout): New function.
7719 (Incremental_binary::output_file): New function.
7720 (Incremental_binary::do_check_inputs): New function.
7721 (Incremental_binary::do_file_is_unchanged): Remove.
7722 (Incremental_binary::do_file_has_changed): New function.
7723 (Incremental_binary::do_init_layout): New function.
7724 (Incremental_binary::do_reserve_layout): New function.
7725 (Incremental_binary::do_input_file_count): New function.
7726 (Incremental_binary::do_get_input_reader): Change signature.
7727 (Incremental_binary::input_args_map_): New data member.
7728 (Incremental_binary::library_map_): New data member.
7729 (Incremental_binary::script_map_): New data member.
7730 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7731 new data members.
7732 (Sized_incremental_binary::output_section): New function.
7733 (Sized_incremental_binary::inputs_reader): Add const.
7734 (Sized_incremental_binary::symtab_reader): Add const.
7735 (Sized_incremental_binary::relocs_reader): Add const.
7736 (Sized_incremental_binary::got_plt_reader): Add const.
7737 (Sized_incremental_binary::get_symtab_view): New function.
7738 (Sized_incremental_binary::Inputs_reader): New typedef.
7739 (Sized_incremental_binary::Input_entry_reader): New typedef.
7740 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7741 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7742 (Sized_incremental_binary::do_file_has_changed): New function.
7743 (Sized_incremental_binary::do_init_layout): New function.
7744 (Sized_incremental_binary::do_reserve_layout): New function.
7745 (Sized_input_reader::Inputs_reader): Remove.
7746 (Sized_input_reader::Input_entry_reader): Remove.
7747 (Sized_input_reader::do_arg_serial): New function.
7748 (Sized_input_reader::do_get_unused_symbol_count): New function.
7749 (Sized_input_reader::do_get_unused_symbol): New function.
7750 (Sized_incremental_binary::do_input_file_count): New function.
7751 (Sized_incremental_binary::do_get_input_reader): Change signature;
7752 use index instead of filename.
7753 (Sized_incremental_binary::section_map_): New data member.
7754 (Sized_incremental_binary::input_entry_readers_): New data member.
7755 (class Sized_incr_relobj): New class.
7756 (class Sized_incr_dynobj): New class.
7757 (make_sized_incremental_object): New function.
7758 (class Incremental_library): New class.
7759 * layout.cc (Free_list::num_lists): New static data member.
7760 (Free_list::num_nodes): New static data member.
7761 (Free_list::num_removes): New static data member.
7762 (Free_list::num_remove_visits): New static data member.
7763 (Free_list::num_allocates): New static data member.
7764 (Free_list::num_allocate_visits): New static data member.
7765 (Free_list::init): New function.
7766 (Free_list::remove): New function.
7767 (Free_list::allocate): New function.
7768 (Free_list::dump): New function.
7769 (Free_list::print_stats): New function.
7770 (Layout_task_runner::run): Resize output file for incremental updates.
7771 (Layout::Layout): Initialize new data members.
7772 (Layout::set_incremental_base): New function.
7773 (Layout::init_fixed_output_section): New function.
7774 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7775 incremental updates.
7776 (Layout::create_gold_note): Do not create gold note section for
7777 incremental updates.
7778 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7779 for incremental updates.
7780 (Layout::set_section_offsets): For incremental updates, allocate space
7781 from free list.
7782 (Layout::create_symtab_sections): Layout with offsets relative to
7783 start of section; for incremental updates, allocate space from free
7784 list.
7785 (Layout::create_shdrs): For incremental updates, allocate space from
7786 free list.
7787 (Layout::finish_dynamic_section): For incremental updates, do not
7788 check --as-needed (fixed in subsequent patch).
7789 * layout.h (class Free_list): New class.
7790 (Layout::set_incremental_base): New function.
7791 (Layout::incremental_base): New function.
7792 (Layout::init_fixed_output_section): New function.
7793 (Layout::allocate): New function.
7794 (Layout::incremental_base_): New data member.
7795 (Layout::free_list_): New data member.
7796 * main.cc (main): Print Free_list statistics.
7797 * object.cc (Relobj::finalize_incremental_relocs): Add
7798 clear_counts parameter; clear counts only when clear_counts is set.
7799 (Sized_relobj::Sized_relobj): Initialize new base class.
7800 (Sized_relobj::do_layout): Don't report special sections.
7801 (Sized_relobj::do_for_all_local_got_entries): New function.
7802 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7803 symtab_off to all symbol table offsets.
7804 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7805 * object.h (class Got_offset_list): Move to top of file.
7806 (Object::Object): Allow case where input_file == NULL.
7807 (Object::~Object): Likewise.
7808 (Object::input_file): Assert that input_file != NULL.
7809 (Object::lock): Allow case where input_file == NULL.
7810 (Object::unlock): Likewise.
7811 (Object::is_locked): Likewise.
7812 (Object::token): Likewise.
7813 (Object::release): Likewise.
7814 (Object::is_incremental): New function.
7815 (Object::get_mtime): New function.
7816 (Object::for_all_local_got_entries): New function.
7817 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7818 (Object::set_is_in_system_directory): New function.
7819 (Object::is_in_system_directory): New function.
7820 (Object::do_is_incremental): New function.
7821 (Object::do_get_mtime): New function.
7822 (Object::do_for_all_local_got_entries): New function.
7823 (Object::is_in_system_directory_): New data member.
7824 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7825 (class Sized_relobj_base): New class.
7826 (class Sized_relobj): Derive from Sized_relobj_base.
7827 (class Sized_relobj::Symbols): Redeclare from base class.
7828 (class Sized_relobj::local_got_offset_list): Remove.
7829 (class Sized_relobj::Output_sections): Redeclare from base class.
7830 (class Sized_relobj::do_for_all_local_got_entries): New function.
7831 (class Sized_relobj::write_local_symbols): Add offset parameter.
7832 (class Sized_relobj::local_symbol_offset_): Update comment.
7833 (class Sized_relobj::local_dynsym_offset_): Update comment.
7834 * options.cc (Input_arguments::add_file): Remove const.
7835 * options.h (Input_file_argument::Input_file_argument):
7836 Initialize arg_serial_ (all constructors).
7837 (Input_file_argument::set_arg_serial): New function.
7838 (Input_file_argument::arg_serial): New function.
7839 (Input_file_argument::arg_serial_): New data member.
7840 (Input_arguments::Input_arguments): Initialize file_count_.
7841 (Input_arguments::add_file): Remove const.
7842 (Input_arguments::number_of_input_files): New function.
7843 (Input_arguments::file_count_): New data member.
7844 (Command_line::number_of_input_files): Call
7845 Input_arguments::number_of_input_files.
7846 * output.cc (Output_segment_headers::Output_segment_headers):
7847 Set current size.
7848 (Output_section::Input_section::current_data_size): New function.
7849 (Output_section::Output_section): Initialize new data members.
7850 (Output_section::add_input_section): Don't do merge sections for
7851 an incremental link; allocate space from free list for an
7852 incremental update.
7853 (Output_section::add_output_section_data): Allocate space from
7854 free list for an incremental update.
7855 (Output_section::update_data_size): New function.
7856 (Output_section::set_fixed_layout): New function.
7857 (Output_section::reserve): New function.
7858 (Output_segment::set_section_addresses): Remove const.
7859 (Output_segment::set_section_list_addresses): Remove const; allocate
7860 space from free list for an incremental update.
7861 (Output_segment::set_offset): Adjust size of RELRO segment for an
7862 incremental update.
7863 * output.h (Output_data::current_data_size): Move here from
7864 child classes.
7865 (Output_data::pre_finalize_data_size): New function.
7866 (Output_data::update_data_size): New function.
7867 (Output_section_headers::update_data_size): new function.
7868 (Output_section_data_build::current_data_size): Move to Output_data.
7869 (Output_data_strtab::update_data_size): New function.
7870 (Output_section::current_data_size): Move to Output_data.
7871 (Output_section::set_fixed_layout): New function.
7872 (Output_section::has_fixed_layout): New function.
7873 (Output_section::reserve): New function.
7874 (Output_section::update_data_size): New function.
7875 (Output_section::has_fixed_layout_): New data member.
7876 (Output_section::free_list_): New data member.
7877 (Output_segment::set_section_addresses): Remove const.
7878 (Output_segment::set_section_list_addresses): Remove const.
7879 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7880 New function.
7881 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7882 New function.
7883 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7884 parameter when calling Add_symbols constructor; store argument
7885 serial number for members of a lib group.
7886 (Add_symbols::locks): Allow case where token == NULL.
7887 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7888 (Read_member::~Read_member): New function.
7889 (Read_member::is_runnable): New function.
7890 (Read_member::locks): New function.
7891 (Read_member::run): New function.
7892 (Check_script::~Check_script): New function.
7893 (Check_script::is_runnable): New function.
7894 (Check_script::locks): New function.
7895 (Check_script::run): New function.
7896 (Check_library::~Check_library): New function.
7897 (Check_library::is_runnable): New function.
7898 (Check_library::locks): New function.
7899 (Check_library::run): New function.
7900 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7901 (Add_symbols::library_): New data member.
7902 (class Read_member): New class.
7903 (class Check_script): New class.
7904 (class Check_library): New class.
7905 * reloc.cc (Read_relocs::is_runnable): Allow case where
7906 token == NULL.
7907 (Read_relocs::locks): Likewise.
7908 (Scan_relocs::locks): Likewise.
7909 (Relocate_task::locks): Likewise.
7910 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7911 to clear counters.
7912 (Sized_relobj::incremental_relocs_scan): Fix comment.
7913 (Sized_relobj::do_relocate): Pass output file offset to
7914 write_local_symbols.
7915 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7916 from class declaration.
7917 * script.cc (read_input_script): Allocate Script_info; pass
7918 argument serial number to report_script.
7919 * script.h (class Script_info): Move to incremental.h.
7920 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7921 * symtab.h (Symbol_table::add_from_incrobj): New function.
7922 (Symbol_table::set_file_offset): New function.
7923
7924 2011-04-05 Cary Coutant <ccoutant@google.com>
7925
7926 * incremental-dump.cc (dump_incremental_inputs): Change signature
7927 to take a Sized_incremental_binary; change caller. Use readers
7928 in Sized_incremental_binary.
7929 * incremental.cc
7930 (Sized_incremental_binary::find_incremental_inputs_sections):
7931 Rename do_find_incremental_inputs_sections to this.
7932 (Sized_incremental_binary::setup_readers): New function.
7933 (Sized_incremental_binary::do_check_inputs): Check
7934 has_incremental_info_ flag; move setup code to setup_readers;
7935 use input readers.
7936 (Sized_incremental_binary::do_file_is_unchanged): New function.
7937 (Sized_incremental_binary::do_get_input_reader): New function.
7938 * incremental.h (class Incremental_binary): Move to end of file.
7939 (Incremental_binary::file_is_unchanged): New function.
7940 (Incremental_binary::do_file_is_unchanged): New function.
7941 (Incremental_binary::Input_reader): New class.
7942 (Incremental_binary::get_input_reader): New function.
7943 (class Sized_incremental_binary): Move to end of file.
7944 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7945 input section reader classes.
7946 (Sized_incremental_binary::has_incremental_info): New function.
7947 (Sized_incremental_binary::inputs_reader): New function.
7948 (Sized_incremental_binary::symtab_reader): New function.
7949 (Sized_incremental_binary::relocs_reader): New function.
7950 (Sized_incremental_binary::got_plt_reader): New function.
7951 (Sized_incremental_binary::do_file_is_unchanged): New function.
7952 (Sized_incremental_binary::Sized_input_reader): New class.
7953 (Sized_incremental_binary::get_input_reader): New function.
7954 (Sized_incremental_binary::find_incremental_inputs_sections):
7955 Rename do_find_incremental_inputs_sections to this.
7956 (Sized_incremental_binary::setup_readers): New function.
7957 (Sized_incremental_binary::has_incremental_info_): New data member.
7958 (Sized_incremental_binary::inputs_reader_): New data member.
7959 (Sized_incremental_binary::symtab_reader_): New data member.
7960 (Sized_incremental_binary::relocs_reader_): New data member.
7961 (Sized_incremental_binary::got_plt_reader_): New data member.
7962 (Sized_incremental_binary::current_input_file_): New data member.
7963
7964 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7965
7966 PR gold/12640
7967 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7968 violation.
7969
7970 2011-03-30 Cary Coutant <ccoutant@google.com>
7971
7972 * archive.cc (Archive::include_member): Adjust call to report_object.
7973 (Add_archive_symbols::run): Add script_info to call to
7974 report_archive_begin.
7975 (Lib_group::include_member): Adjust call to report_object.
7976 (Add_lib_group_symbols::run): Adjust call to report_object.
7977 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7978 blocks. Add object count for script input files.
7979 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7980 script_info parameter; change all callers.
7981 (Incremental_inputs::report_object): Add script_info parameter;
7982 change all callers.
7983 (Incremental_inputs::report_script): Store backpointer to
7984 incremental info entry.
7985 (Output_section_incremental_inputs::set_final_data_size): Record
7986 additional information for scripts.
7987 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7988 * incremental.h (Incremental_script_entry::add_object): New function.
7989 (Incremental_script_entry::get_object_count): New function.
7990 (Incremental_script_entry::get_object): New function.
7991 (Incremental_script_entry::objects_): New data member; adjust
7992 constructor.
7993 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7994 (Incremental_inputs::report_object): Add script_info parameter.
7995 (Incremental_inputs_reader::get_object_count): New function.
7996 (Incremental_inputs_reader::get_object_offset): New function.
7997 * options.cc (Input_arguments::add_file): Return reference to
7998 new input argument.
7999 * options.h (Input_argument::set_script_info): New function.
8000 (Input_argument::script_info): New function.
8001 (Input_argument::script_info_): New data member; adjust all
8002 constructors.
8003 (Input_file_group::add_file): Return reference to new input argument.
8004 (Input_file_lib::add_file): Likewise.
8005 (Input_arguments::add_file): Likewise.
8006 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8007 * script.cc (Parser_closure::Parser_closure): Add script_info
8008 parameter; adjust all callers.
8009 (Parser_closure::script_info): New function.
8010 (Parser_closure::script_info_): New data member.
8011 (read_input_script): Report scripts earlier to incremental info.
8012 (script_add_file): Set script_info in Input_argument.
8013 (script_add_library): Likewise.
8014 * script.h (Script_options::Script_info): Rewrite class.
8015
8016 2011-03-29 Cary Coutant <ccoutant@google.com>
8017
8018 * archive.cc (Library_base::should_include_member): Move
8019 method here from class Archive.
8020 (Archive::Archive): Initialize base class.
8021 (Archive::should_include_member): Move to base class.
8022 (Archive::do_for_all_unused_symbols): New function.
8023 (Add_archive_symbols::run): Remove redundant access to
8024 incremental_inputs.
8025 (Lib_group::Lib_group): Initialize base class.
8026 (Lib_group::do_filename): New function.
8027 (Lib_group::include_member): Pass pointer to Lib_group to
8028 report_object.
8029 (Lib_group::do_for_all_unused_symbols): New function.
8030 (Add_lib_group_symbols::run): Report archive information for
8031 incremental links.
8032 * archive.h (class Library_base): New base class.
8033 (class Archive): Derive from Library_base.
8034 (Archive::filename): Move to base class.
8035 (Archive::set_incremental_info): Likewise.
8036 (Archive::incremental_info): Likewise.
8037 (Archive::Should_include): Likewise.
8038 (Archive::should_include_member): Likewise.
8039 (Archive::Armap_entry): Remove.
8040 (Archive::Unused_symbol_iterator): Remove.
8041 (Archive::unused_symbols_begin): Remove.
8042 (Archive::unused_symbols_end): Remove.
8043 (Archive::do_filename): New function.
8044 (Archive::do_get_mtime): New function.
8045 (Archive::do_for_all_unused_symbols): New function.
8046 (Archive::task_): Move to base class.
8047 (Archive::incremental_info_): Likewise.
8048 (class Lib_group): Derive from Library_base.
8049 (Lib_group::do_filename): New function.
8050 (Lib_group::do_get_mtime): New function.
8051 (Lib_group::do_for_all_unused_symbols): New function.
8052 (Lib_group::task_): Move to base class.
8053 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8054 function.
8055 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8056 function.
8057 * incremental.cc (Incremental_inputs::report_archive_begin):
8058 Use Library_base; call library's get_mtime; add incremental inputs
8059 entry before members.
8060 (class Unused_symbol_visitor): New class.
8061 (Incremental_inputs::report_archive_end): Use Library_base; use
8062 visitor class to record unused symbols; don't add incremental inputs
8063 entry after members.
8064 (Incremental_inputs::report_object): Use Library_base.
8065 * incremental.h
8066 (Incremental_archive_entry::Incremental_archive_entry): Remove
8067 unused Archive parameter.
8068 (Incremental_inputs::report_archive_begin): Use Library_base.
8069 (Incremental_inputs::report_archive_end): Likewise.
8070 (Incremental_inputs::report_object): Likewise.
8071 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8072 function.
8073 * object.h (Object::for_all_global_symbols): New function.
8074 (Object::do_for_all_global_symbols): New function.
8075 (Sized_relobj::do_for_all_global_symbols): New function.
8076 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8077 function.
8078 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8079 function.
8080
8081 2011-03-27 Ian Lance Taylor <iant@google.com>
8082
8083 * archive.cc (Archive::interpret_header): Return -1 if something
8084 goes wrong. Change callers accordingly.
8085
8086 2011-03-25 Cary Coutant <ccoutant@google.com>
8087
8088 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8089 * testsuite/Makefile.in: Regenerate.
8090
8091 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8092
8093 * plugin.cc (get_view): New.
8094 (Plugin::load): Pass get_view to the plugin.
8095 (Plugin_manager::get_view): New.
8096
8097 2011-03-21 Ian Lance Taylor <iant@google.com>
8098
8099 * testsuite/final_layout.sh: Rewrite to not use dc.
8100 * testsuite/relro_test.sh: Fail if dc is not present.
8101
8102 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8103
8104 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8105 Change == to -eq.
8106 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8107 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8108 Change == to -eq.
8109 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8110 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8111
8112 2011-03-14 Ian Lance Taylor <iant@google.com>
8113
8114 * script-sections.cc (Sort_output_sections::script_compare):
8115 Rename from is_before, change return type.
8116 (Sort_output_sections::operator()): Adjust accordingly.
8117
8118 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8119
8120 PR gold/12572
8121 * testsuite/odr_violation2.cc: Add comment to make all error line
8122 numbers double digits.
8123 * testsuite/debug_msg.sh: Adjust expected errors.
8124
8125 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8126
8127 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8128 but mark earlier ones as non-canonical
8129 (offset_to_iterator): Update search target and example
8130 (do_addr2line): Return extra lines in a vector*
8131 (format_file_lineno): Extract from do_addr2line
8132 (one_addr2line): Add vector* out-param
8133 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8134 when a lineno entry appeared last for its instruction
8135 (Dwarf_line_info): Add vector* out-param
8136 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8137 * symtab.cc (Odr_violation_compare): Include the lineno in the
8138 comparison again.
8139 (linenos_from_loc): New. Combine the canonical line for an
8140 address with its other lines.
8141 (True_if_intersect): New. Helper functor to make
8142 std::set_intersection a query.
8143 (detect_odr_violations): Compare sets of lines instead of just
8144 one line for each function. This became less deterministic, but
8145 has fewer false positives.
8146 * symtab.h: Declarations.
8147 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8148 mix an optimized and non-optimized object in the same binary
8149 (odr_violation2.so): Same.
8150 * testsuite/Makefile.in: Regenerate from Makefile.am.
8151 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8152 * testsuite/debug_msg.sh: Update line numbers and add
8153 assertions.
8154 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8155 non-optimized context.
8156 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8157 isn't inlined, and use OdrDerived in an optimized context.
8158 * testsuite/odr_header1.h: Defines OdrDerived, where
8159 optimization will change the
8160 first-instruction-in-the-destructor's file and line number.
8161 * testsuite/odr_header2.h: Defines OdrBase.
8162
8163 2011-03-09 Ian Lance Taylor <iant@google.com>
8164
8165 * fileread.cc (File_read::clear_views): Don't delete the whole
8166 file view.
8167
8168 2011-03-08 Ian Lance Taylor <iant@google.com>
8169
8170 PR gold/12525
8171 * fileread.cc: #include <climits>.
8172 (GOLD_IOV_MAX): Define.
8173 (File_read::read_multiple): Limit number of entries by iov_max.
8174 * fileread.h (class File_read): Always set max_readv_entries to
8175 128.
8176
8177 2011-03-07 Ian Lance Taylor <iant@google.com>
8178
8179 PR gold/12525
8180 * options.h (class General_options): Add -dy and -dn.
8181
8182 2011-03-02 Cary Coutant <ccoutant@google.com>
8183
8184 * testsuite/script_test_9.t: Add TLS segment.
8185
8186 2011-03-02 Simon Baldwin <simonb@google.com>
8187
8188 * configure.ac: Add check for gnu_indirect_function support in
8189 the toolchain building binutils.
8190 * configure: Rebuild.
8191
8192 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8193
8194 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8195 plugin only symbols.
8196 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8197 in plugin files as not needed in the symbol table.
8198
8199 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8200
8201 * output.cc (Output_section::add_input_section): Delay fill
8202 generation for section ordering.
8203
8204 2011-02-09 Ian Lance Taylor <iant@google.com>
8205
8206 PR gold/12316
8207 * object.h (class Sized_relobj): Remove clear_local_symbols.
8208 * reloc.cc (Sized_relobj::do_relocate): Don't call
8209 clear_local_symbols.
8210
8211 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8212
8213 * plugin.cc (is_visible_from_outside): Return true for symbols
8214 in the -u option.
8215
8216 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8217
8218 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8219 filename.
8220
8221 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8222
8223 * icf.h (is_section_foldable_candidate): Change type of parameter
8224 to std::string.
8225 * icf.cc (Icf::find_identical_sections): Change type of local variable
8226 section_name to be std::string.
8227 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8228
8229 2011-01-25 Ian Lance Taylor <iant@google.com>
8230
8231 * script.cc (script_add_extern): Rewrite to use
8232 add_symbol_reference.
8233
8234 2011-01-25 Doug Kwan <dougkwan@google.com>
8235
8236 * icf.cc (get_section_contents): Always lock section's object.
8237
8238 2011-01-24 Ian Lance Taylor <iant@google.com>
8239
8240 * options.h (class General_options): Accept
8241 --no-detect-odr-violations.
8242
8243 2011-01-24 Ian Lance Taylor <iant@google.com>
8244
8245 * version.cc (version_string): Bump to 1.11.
8246
8247 2011-01-24 Ian Lance Taylor <iant@google.com>
8248
8249 * plugin.cc (class Plugin_rescan): Define new class.
8250 (Plugin_manager::claim_file): Set any_claimed_.
8251 (Plugin_manager::save_archive): New function.
8252 (Plugin_manager::save_input_group): New function.
8253 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8254 necessary.
8255 (Plugin_manager::new_undefined_symbol): New function.
8256 (Plugin_manager::rescan): New function.
8257 (Plugin_manager::rescannable_defines): New function.
8258 (Plugin_manager::add_input_file): Set any_added_.
8259 * plugin.h (class Plugin_manager): define new fields rescannable_,
8260 undefined_symbols_, any_claimed_, and any_added_. Declare
8261 Plugin_rescan as friend. Declare new functions.
8262 (Plugin_manager::Rescannable): Define type.
8263 (Plugin_manager::Rescannable_list): Define type.
8264 (Plugin_manager::Undefined_symbol_list): Define type.
8265 (Plugin_manager::Plugin_manager): Initialize new fields.
8266 * archive.cc (Archive::defines_symbol): New function.
8267 (Add_archive_symbols::run): Pass archive to plugins if any.
8268 * archive.h (class Archive): Declare defines_symbol.
8269 * readsyms.cc (Input_group::~Input_group): New function.
8270 (Finish_group::run): Pass input_group to plugins if any.
8271 * readsyms.h (class Input_group): Declare destructor.
8272 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8273 any.
8274
8275 2011-01-10 Ian Lance Taylor <iant@google.com>
8276
8277 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8278 section as relro.
8279 (Layout::set_segment_offsets): Reset increase_relro before calling
8280 set_section_addresses a second time.
8281
8282 2011-01-04 Cary Coutant <ccoutant@google.com>
8283
8284 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8285 sections before NOBITS sections.
8286
8287 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8288
8289 * version.cc (print_version): Update copyright to 2011.
8290
8291 2010-12-23 Cary Coutant <ccoutant@google.com>
8292
8293 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8294 of OS to this->add. Add OD parameter to second form of the function.
8295
8296 2010-12-20 Ian Lance Taylor <iant@google.com>
8297
8298 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8299 second of two consecutive entries with same offset.
8300
8301 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8302
8303 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8304 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8305 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8306 to avoid unneeded links against $(LDADD).
8307 * testsuite/Makefile.in: Regenerate.
8308
8309 2010-12-15 Ian Lance Taylor <iant@google.com>
8310
8311 PR gold/12324
8312 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8313 for R_X86_64_32 and R_X86_64_PC32.
8314 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8315 ver_matching_def_pic.o.
8316 (ver_matching_def_pic.o): New target.
8317
8318 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8319
8320 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8321 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8322 Move definition before File_read::View member definitions.
8323 (File_read::View::~View): Initialize and hold lock before
8324 updating current_mapped_bytes.
8325
8326 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8327
8328 * dwarf_reader.cc: Remove outdated comment.
8329 * gold-threads.cc: Fix typo in error message.
8330 * archive.cc: Fix typos in comments.
8331 * archive.h: Likewise.
8332 * arm-reloc-property.cc: Likewise.
8333 * arm-reloc-property.h: Likewise.
8334 * arm-reloc.def: Likewise.
8335 * arm.cc: Likewise.
8336 * attributes.h: Likewise.
8337 * cref.cc: Likewise.
8338 * ehframe.cc: Likewise.
8339 * fileread.h: Likewise.
8340 * gold.h: Likewise.
8341 * i386.cc: Likewise.
8342 * icf.cc: Likewise.
8343 * incremental.h: Likewise.
8344 * int_encoding.cc: Likewise.
8345 * layout.h: Likewise.
8346 * main.cc: Likewise.
8347 * merge.h: Likewise.
8348 * object.cc: Likewise.
8349 * object.h: Likewise.
8350 * options.cc: Likewise.
8351 * readsyms.cc: Likewise.
8352 * reduced_debug_output.cc: Likewise.
8353 * reloc.cc: Likewise.
8354 * script-sections.cc: Likewise.
8355 * sparc.cc: Likewise.
8356 * symtab.h: Likewise.
8357 * target-reloc.h: Likewise.
8358 * target.cc: Likewise.
8359 * target.h: Likewise.
8360 * timer.cc: Likewise.
8361 * timer.h: Likewise.
8362 * x86_64.cc: Likewise.
8363
8364 2010-12-09 Cary Coutant <ccoutant@google.com>
8365
8366 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8367 stack.
8368 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8369 parameter; change all callers.
8370 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8371 * options.h (warn_execstack): New option.
8372
8373 2010-12-07 Doug Kwan <dougkwan@google.com>
8374
8375 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8376 like function call relocations.
8377
8378 2010-12-07 Ian Lance Taylor <iant@google.com>
8379
8380 * archive.cc (Archive::get_elf_object_for_member): Permit
8381 punconfigured to be NULL.
8382 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8383 (Archive::include_member): Pass NULL to get_elf_object_for_member
8384 if we searched for the archive and this is the first included
8385 object.
8386
8387 2010-12-01 Ian Lance Taylor <iant@google.com>
8388
8389 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8390 track_relocs_type_ field.
8391 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8392 Set track_relocs_type_.
8393 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8394 contents when using RELA relocs.
8395 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8396 reloc_map_.
8397 * reloc.cc (Track_relocs::next_addend): New function.
8398 * reloc.h (class Track_relocs): Declare next_addend.
8399
8400 2010-12-01 Ian Lance Taylor <iant@google.com>
8401
8402 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8403 virtual destructor.
8404
8405 2010-12-01 Ian Lance Taylor <iant@google.com>
8406
8407 * README: Update compilers known to work and fail.
8408
8409 2010-11-23 Matthias Klose <doko@ubuntu.com>
8410
8411 * configure.in: For --enable-gold, handle value `default' instead of
8412 `both*'. Always install ld as ld.bfd, install as ld if gold is
8413 not the default.
8414 * configure: Regenerate.
8415
8416 2010-11-18 Doug Kwan <dougkwan@google.com>
8417
8418 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8419 and right_alignment to be zero. Store result alignment only if it is
8420 greater than existing alignment.
8421
8422 2010-11-16 Cary Coutant <ccoutant@google.com>
8423
8424 PR gold/12220
8425 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8426 Check for ".zdebug_line".
8427
8428 2010-11-16 Doug Kwan <dougkwan@google.com>
8429 Cary Coutant <ccoutant@google.com>
8430
8431 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8432 by reference; adjust all callers.
8433 * output.cc (Output_segment::set_section_addresses): Adjust references
8434 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8435 list is empty.
8436 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8437 end at page boundary.
8438
8439 2010-11-16 Cary Coutant <ccoutant@google.com>
8440
8441 PR gold/12220
8442 * layout.cc (Layout::choose_output_section): Transform names of
8443 compressed sections even when using a script with a SECTIONS clause.
8444 (Layout::output_section_name): Remove code to transform
8445 compressed debug section names.
8446 * output.cc (Output_section::add_input_section): Use uncompressed
8447 section size when tracking input sections.
8448
8449 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8450
8451 * symtab.h (Symbol::NON_PIC_REF): Remove.
8452 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8453 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8454 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8455 (Symbol::use_plt_offset): Take a flags argument and pass it
8456 directly to needs_dynamic_reloc. Restrict check for undefined
8457 weak symbols to function calls.
8458 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8459 (Target_arm::Scan::global): Use it.
8460 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8461 (Target_arm::Relocate::relocate): Likewise.
8462 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8463 parameter with an r_type parameter. Use get_reference_flags
8464 to get the flags.
8465 (Target_arm::Relocate::relocate): Update accordingly.
8466 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8467 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8468 (Target_i386::Scan::global): Likewise.
8469 (Target_i386::Relocate::relocate): Likewise.
8470 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8471 parameter with an r_type parameter. Use get_reference_flags
8472 to get the flags.
8473 (Target_i386::Relocate::relocate): Update accordingly.
8474 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8475 (Target_powerpc::Scan::global): Use it.
8476 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8477 (Target_powerpc::Relocate::relocate): Likewise.
8478 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8479 (Target_sparc::Scan::global): Use it.
8480 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8481 (Target_sparc::Relocate::relocate): Likewise.
8482 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8483 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8484 (Target_x86_64::Scan::global): Likewise.
8485 (Target_x86_64::Relocate::relocate): Likewise.
8486
8487 2010-11-08 Doug Kwan <dougkwan@google.com>
8488 Cary Coutant <ccoutant@google.com>
8489
8490 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8491 (Arm_exidx_merge_section::section_contents_): New data member.
8492 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8493 (Arm_input_section::~Arm_input_section): De-allocate memory.
8494 (Arm_input_section::original_contents_): New data member.
8495 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8496 in parameters instead of calling Object::section_contents without
8497 locking.
8498 (Arm_output_section::group_section): New parameter TASK. Pass it
8499 to callees that need locking objects.
8500 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8501 to lock EXIDX input sections. Fix a formatting issue. Call
8502 Arm_exidx_merged_section::build_contents to create merged section
8503 contents.
8504 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8505 to lock object of stub table owner.
8506 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8507 TEXT_SIZE to initialize data member TEXT_SIZE_.
8508 (Arm_exidx_input_section::addralign): Fix typo in comment.
8509 (Arm_exidx_input_section::text_size): New method.
8510 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8511 that require locking objects. Lock objects before scanning for stubs
8512 and updating local symbols.
8513 (Arm_input_section<big_endian>::init): Copy contents of original
8514 input section.
8515 (Arm_input_section<big_endian>::do_write): Use saved contents of
8516 original input section instead of calling Object::section_contents
8517 without locking.
8518 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8519 size without calling Object::section_size().
8520 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8521 for size. Allocate a buffer for merged EXIDX entries.
8522 (Arm_exidx_merged_section::build_contents): New method.
8523 (Arm_exidx_merged_section::do_write): Move merge section contents
8524 building code to Arm_exidx_merged_section::build_contetns. Write
8525 out contetns in buffer instead of building it on the fly.
8526 (Arm_relobj::make_exidx_input_section): Also pass text section size
8527 to Arm_exidx_input_section constructor.
8528 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8529 (Arm_dynobj::do_read_symbols): Fix memory leak.
8530 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8531 * target.h: (class Task): Add forward declaration.
8532 (Target::relax): Add new parameter TASK and pass it to
8533 Target::do_relax().
8534 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8535
8536 2010-11-05 Cary Coutant <ccoutant@google.com>
8537
8538 PR gold/10708
8539 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8540 object when reading from the file.
8541 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8542 second layout pass.
8543 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8544 when reading section contents.
8545 (get_section_contents): Likewise.
8546 (icf::find_identical_sections): Likewise.
8547 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8548 object when reading from the file.
8549 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8550 the object when doing deferred section layout.
8551
8552 2010-11-03 Nick Clifton <nickc@redhat.com>
8553
8554 PR gold/12001
8555 * script.h (class Symbol_assignment: name): New member. Returns
8556 the name of the symbol.
8557 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8558 Returns true if the given symbol name is on the list of
8559 assignments wating to be processed.
8560 * archive.cc (should_incldue_member): If the symbol is undefined,
8561 check to see if it is on the list of symbols pending assignment.
8562
8563 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8564
8565 * script-sections.cc (Script_sections::find_memory_region): Check
8566 for a NULL output section pointer.
8567
8568 2010-10-29 Doug Kwan <dougkwan@google.com>
8569
8570 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8571 Output_section::add_relaxed_input_section.
8572 * output.cc (Output_section::add_relaxed_input_section): Add new
8573 arguments LAYOUT and NAME. Set section order index.
8574 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8575 Copy section order index.
8576 * output.h (Output_section::add_relaxed_input_section): Add new
8577 arguments LAYOUT and NAME.
8578
8579 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8580
8581 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8582 NATIVE_OR_CROSS_LINKER.
8583 * testsuite/Makefile.in: Regenerate.
8584
8585 2010-10-20 Doug Kwan <dougkwan@google.com>
8586
8587 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8588 without SHF_LINK_ORDER flags.
8589 * layout.cc (Layout::choose_output_section): Do not filter
8590 SHF_LINK_ORDER flag in a relocatable link.
8591
8592 2010-10-17 Cary Coutant <ccoutant@google.com>
8593
8594 * output.h (Output_segment::set_section_addresses): Change function
8595 signature. Update all callers.
8596 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8597 sections.
8598 (Output_segment::set_section_addresses): Align after last TLS
8599 section. Add padding before last relro section instead of after.
8600
8601 2010-10-17 Doug Kwan <dougkwan@google.com>
8602
8603 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8604 GOT output section to be writable.
8605
8606 2010-10-14 Cary Coutant <ccoutant@google.com>
8607
8608 * debug.h (DEBUG_INCREMENTAL): New flag.
8609 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8610 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8611 mode.
8612 * incremental.cc (report_command_line): Ignore all forms of
8613 --incremental.
8614 * layout.cc (Layout::Layout): Check parameters for incremental link
8615 mode.
8616 * options.cc (General_options::parse_incremental): New function.
8617 (General_options::parse_no_incremental): New function.
8618 (General_options::parse_incremental_full): New function.
8619 (General_options::parse_incremental_update): New function.
8620 (General_options::incremental_mode_): New data member.
8621 (General_options::finalize): Check incremental_mode_.
8622 * options.h (General_options): Update help text for --incremental.
8623 Add --no-incremental, --incremental-full, --incremental-update.
8624 (General_options::Incremental_mode): New enum type.
8625 (General_options::incremental_mode): New function.
8626 (General_options::incremental_mode_): New data member.
8627 * parameters.cc (Parameters::incremental_mode_): New data member.
8628 (Parameters::set_options): Set incremental_mode_.
8629 (Parameters::set_incremental_full): New function.
8630 (Parameters::incremental): New function.
8631 (Parameters::incremental_update): New function.
8632 (set_parameters_incremental_full): New function.
8633 * parameters.h (Parameters::set_incremental_full): New function.
8634 (Parameters::incremental): New function.
8635 (Parameters::incremental_update): New function.
8636 (Parameters::incremental_mode_): New data member.
8637 (set_parameters_incremental_full): New function.
8638 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8639 incremental link mode.
8640 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8641 (Sized_relobj::do_relocate_sections): Likewise.
8642 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8643 option.
8644 * testsuite/Makefile.in: Regenerate.
8645 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8646
8647 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8648
8649 * script-sections.h (class Script_sections): Make
8650 Sections_elements typedef public.
8651 * script-sections.cc (class Sort_output_sections): Add elements_
8652 field. Add constructor which sets it; change all callers.
8653 (Sort_output_sections::is_before): New function.
8654 (Sort_output_sections::operator()): Call is_before.
8655 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8656 conditional.
8657 * testsuite/script_test_10.sh: New test. Test script section
8658 order.
8659 * testsuite/script_test_10.t: Likewise.
8660 * testsuite/script_test_10.s: Likewise.
8661 * testsuite/Makefile.am: Wrap the cross linker tests and the
8662 common tests into NATIVE_OR_CROSS_LINKER.
8663 (check_SCRIPTS): Add script_test_10.sh.
8664 (check_DATA): Add script_test_10.stdout.
8665 (script_test_10.o, script_test_10): New targets.
8666 (script_test_10.stdout): New target.
8667 * configure, testsuite/Makefile.in: Regenerate.
8668
8669 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8670
8671 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8672 error for the deprecated relocations.
8673 (Target_arm::Scan::global): Likewise.
8674 (Target_arm::Relocate::relocate): Likewise.
8675
8676 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8677
8678 * fileread.cc (Input_file::find_file): Initialize *found_name
8679 and *namep when using the fallback search for case 4.
8680
8681 2010-10-11 Cary Coutant <ccoutant@google.com>
8682
8683 * options.h (class General_options): Redefine -z lazy as an alias for
8684 the negation of -z now.
8685
8686 2010-10-11 Ian Lance Taylor <iant@google.com>
8687
8688 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8689 binding.
8690
8691 2010-10-06 Nick Clifton <nickc@redhat.com>
8692
8693 * script-sections.cc(class Memory_region): Remove
8694 current_lma_offset_ field. Rename current_vma_offset_ to
8695 current_offset_. Add last_section_ field.
8696 (Memory_region::get_current_vma_address): Rename to
8697 get_current_address.
8698 (Memory_region::get_current_lma_address): Delete.
8699 (Memory_region::increment_vma_offset): Rename to
8700 increment_offset.
8701 (Memory_region::increment_lma_offset): Delete.
8702 (Memory_region::attributes_compatible): New method. Returns
8703 true if the provided section is compatible with the region.
8704 (Memory_region::get_last_section): New method. Returns the last
8705 section to use the region.
8706 (Memory_region::set_last_section): New method. Stores the last
8707 section to use the region.
8708 (Script_sections::block_in_region): New method. Returns true if
8709 a block of memory is contained within a region.
8710 (Script_sections::find_memory_region): New method. Locates a
8711 memory region to be used to set a VMA or LMA address.
8712 (Output_section_definition::set_section_addresses): Add code to
8713 check for addresses set by memory regions.
8714 (Output_segment::set_section_addresses): Remove memory region
8715 walking code.
8716 (Script_sections::create_segment): Add a warning if a header
8717 segment is created outside of any region.
8718 * script-sections.h (class Script_sections): Add prototypes for
8719 find_memory_region and block_in_region methods.
8720 * testsuite/memory_test.s: Use .long instead of .word.
8721 * testsuite/memory_test.t: Add some more output sections.
8722 * testsuite/memory_test.sh: Update expected output.
8723
8724 2010-10-02 Doug Kwan <dougkwan@google.com>
8725
8726 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8727 defintion to symtab.h
8728 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8729 declaration to defintion.
8730
8731 2010-10-01 Nick Clifton <nickc@redhat.com>
8732
8733 * expression.cc (eval): Replace dummy argument with NULL.
8734 (eval_maybe_dot): Check for a NULL result section pointer.
8735 (Symbol_expression::value): Likewise.
8736 (Dot_expression::value): Likewise.
8737 (BINARY_EXPRESSION): Likewise.
8738 (Max_expression::value): Likewise.
8739 (Min_expression::value): Likewise.
8740 (Absolute_expression::value): Likewise.
8741 (Addr_expression::value_from_output_section): Likewise.
8742 (Loaddddr_expression::value_from_output_section): Likewise.
8743 (Segment_start_expression::value): Likewise.
8744 * script-sections.cc
8745 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8746 argument with NULL.
8747 (Sections_elememt_dot_assignment::set_section_addresses):
8748 Likewise.
8749 (Output_data_expression::do_write_to_buffer): Likewise.
8750 (Output_section_definition::finalize_symbols): Likewise.
8751 (Output_section_definition::set_section_addresses): Likewise.
8752
8753 2010-09-30 Doug Kwan <dougkwan@google.com>
8754
8755 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8756
8757 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8758
8759 * target.h (Target::can_icf_inline_merge_sections): New virtual
8760 function.
8761 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8762 virtual function.
8763 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8764 virtual function.
8765 * icf.cc (get_section_contents): Inline merge sections only when
8766 target allows it.
8767
8768 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8769
8770 * configure: Regenerate.
8771
8772 2010-09-17 Ian Lance Taylor <iant@google.com>
8773
8774 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8775 * testsuite/Makefile.am (memory_test.o): New target.
8776 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8777 memory_test.t.
8778 * testsuite/Makefile.in: Rebuild.
8779
8780 2010-09-17 Doug Kwan <dougkwan@google.com>
8781
8782 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8783 defintion if relocation uses GOT entries of the symbol.
8784 * testsuite/icf_safe_test.sh: Fix test.
8785 * testsuite/icf_safe_so_test.sh: Fix test.
8786
8787 2010-09-16 Cary Coutant <ccoutant@google.com>
8788
8789 * script_sections.cc (class Memory_region): Remove "NULL" from
8790 vector initializations.
8791
8792 2010-09-15 Cary Coutant <ccoutant@google.com>
8793
8794 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8795 Resolve forwarding symbols.
8796
8797 2010-09-15 Doug Kwan <dougkwan@google.com>
8798
8799 * gold/testsuite/script_test_3.t: Add ARM special sections.
8800 * gold/testsuite/script_test_4.t: Same.
8801 * gold/testsuite/script_test_5.t: Same.
8802 * gold/testsuite/script_test_6.t: Same.
8803 * gold/testsuite/script_test_7.t: Same.
8804 * gold/testsuite/script_test_7.t: Same.
8805 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8806
8807 2010-09-14 Cary Coutant <ccoutant@google.com>
8808
8809 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8810 (Target_x86_64::Relocate::relocate_tls): Replace check for
8811 saw_tls_block_reloc_ with test for executable section.
8812
8813 2010-09-12 Cary Coutant <ccoutant@google.com>
8814
8815 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8816 position-independent executables to shared libraries need dynamic
8817 relocations.
8818 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8819 position-independent executables.
8820 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8821 * testsuite/Makefile.in: Regenerate.
8822
8823 2010-09-10 Nick Clifton <nickc@redhat.com>
8824
8825 PR gold/11997
8826 * testsuite/memory_test.t: Discard any sections that are not
8827 needed.
8828
8829 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8830
8831 PR gold/11996
8832 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8833 "This::" to work around a bug in gcc 4.2.
8834
8835 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8836
8837 2010-09-09 Rafael Espindola <espindola@google.com>
8838
8839 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8840 sections with different PF_X flags in the same segment.
8841 (Layout::find_first_load_seg): Search all segments to find the first
8842 one.
8843 * options.h (rosegment): New.
8844
8845 2010-09-08 Rafael Espindola <espindola@google.com>
8846
8847 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8848
8849 2010-09-08 Doug Kwan <dougkwan@google.com>
8850
8851 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8852 (Arm_relobj::do_relocate_sections): Add new parameter for output
8853 file to match the parent.
8854 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8855 of local symbols instead of input values. Update code to track
8856 changes in gold::relocate_section.
8857 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8858 (Sized_relobj::compute_final_local_value_internal): New methods.
8859 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8860 body into private version of Sized_relobj::compute_final_local_value.
8861 Call the inline method.
8862 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8863 merged symbol value if there is one.
8864 (Symbol_value::has_output_value): New method defintiion.
8865 (Sized_relobj::Compute_final_local_value_status): New enum type.
8866 (Sized_relobj::compute_final_local_value): New methods.
8867 (Sized_relobj::compute_final_local_value_internal): New methods.
8868 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8869 and arm_cortex_a8.sh.
8870 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8871 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8872 New tests.
8873 * Makefile.in: Regenerate.
8874 * testsuite/arm_bl_out_of_range.s: Update test.
8875 * testsuite/thumb_bl_out_of_range.s: Ditto.
8876 * testsuite/thumb_blx_out_of_range.s: Ditto.
8877 * testsuite/arm_branch_out_of_range.sh: New file.
8878 * testsuite/arm_cortex_a8.sh: Ditto.
8879 * testsuite/arm_cortex_a8_b.s: Ditto.
8880 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8881 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8882 * testsuite/arm_cortex_a8_bl.s: Ditto.
8883 * testsuite/arm_cortex_a8_blx.s: Ditto.
8884 * testsuite/arm_cortex_a8_local.s: Ditto.
8885 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8886 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8887
8888 2010-09-08 Rafael Espindola <espindola@google.com>
8889
8890 * Makefile.am (memory_test.stdout): Run readelf with -W.
8891 * Makefile.in: Regenerate.
8892 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8893 64 bit output.
8894
8895 2010-09-08 Rafael Espindola <espindola@google.com>
8896
8897 * script-sections.cc (Script_sections::add_memory_region): Convert
8898 field precision to int.
8899 * script.cc (script_set_section_region, script_set_section_region):
8900 Convert field precision to int.
8901
8902 2010-09-08 Rafael Espindola <espindola@google.com>
8903
8904 * arm.cc (do_finalize_sections): Create the __exidx_start and
8905 __exdix_end symbols even when the section is missing.
8906
8907 2010-09-08 Nick Clifton <nickc@redhat.com>
8908
8909 * README: Remove claim that MEMORY is not supported.
8910 * expression.cc (script_exp_function_origin)
8911 (script_exp_function_length): Move from here to ...
8912 * script.cc: ... here.
8913 (script_set_section_region, script_add_memory)
8914 (script_parse_memory_attr, script_include_directive): New
8915 functions.
8916 * script-sections.cc
8917 (class Memory_region): New class.
8918 (class Output_section_definition): Add set_memory_region,
8919 set_section_vma, set_section_lma and get_section_name methods.
8920 (class Script_Sections): Add add_memory_region,
8921 find_memory_region, find_memory_region_origin,
8922 find_memory_region_length and set_memory_region methods.
8923 Have set_section_addresses method walk the list of set memory
8924 regions.
8925 Extend the print methos to display memory regions.
8926 * script-sections.h: Add prototypes for new methods.
8927 Add enum for MEMORY region attributes.
8928 * yyscript.y: Add support for parsing MEMORY regions.
8929 * script-c.h: Add prototypes for new functions.
8930 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8931 * testsuite/Makefile.in: Regenerate.
8932 * testsuite/memory_test.sh: New script.
8933 * testsuite/memory_test.s: New assembler source file.
8934 * testsuite/memory_test.t: New linker script.
8935
8936 2010-08-27 Doug Kwan <dougkwan@google.com>
8937
8938 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8939 reference override an existing dynamic weak reference.
8940 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8941 * testsuite/Makefile.in: Regenerate.
8942 * testsuite/dyn_weak_ref.sh: New file.
8943 * testsuite/dyn_weak_ref_1.c: Ditto.
8944 * testsuite/dyn_weak_ref_2.c: Ditto.
8945
8946 2010-08-27 Ian Lance Taylor <iant@google.com>
8947
8948 * incremental.h (class Incremental_input_entry): Add virtual
8949 destructor.
8950
8951 2010-08-27 Ian Lance Taylor <iant@google.com>
8952
8953 * testsuite/start_lib_test_3.c: Mark t3 as used.
8954
8955 2010-08-27 Nick Clifton <nickc@redhat.com>
8956
8957 * options.cc (version_script): Fix small typo in previous
8958 whitespace tidyup.
8959
8960 2010-08-25 Nick Clifton <nickc@redhat.com>
8961
8962 * archive.cc: Formatting fixes: Remove whitespace between
8963 typename and following asterisk. Remove whitespace between
8964 function name and opening parenthesis.
8965 * archive.h: Likewise.
8966 * arm.cc: Likewise.
8967 * attributes.cc: Likewise.
8968 * attributes.h: Likewise.
8969 * common.cc: Likewise.
8970 * copy-relocs.cc: Likewise.
8971 * dirsearch.h: Likewise.
8972 * dynobj.cc: Likewise.
8973 * ehframe.cc: Likewise.
8974 * ehframe.h: Likewise.
8975 * expression.cc: Likewise.
8976 * fileread.cc: Likewise.
8977 * fileread.h: Likewise.
8978 * gc.h: Likewise.
8979 * gold-threads.cc: Likewise.
8980 * gold.cc: Likewise.
8981 * i386.cc: Likewise.
8982 * icf.h: Likewise.
8983 * incremental-dump.cc: Likewise.
8984 * incremental.cc: Likewise.
8985 * layout.cc: Likewise.
8986 * layout.h: Likewise.
8987 * main.cc: Likewise.
8988 * merge.cc: Likewise.
8989 * merge.h: Likewise.
8990 * object.cc: Likewise.
8991 * object.h: Likewise.
8992 * options.cc: Likewise.
8993 * options.h: Likewise.
8994 * output.cc: Likewise.
8995 * output.h: Likewise.
8996 * plugin.cc: Likewise.
8997 * plugin.h: Likewise.
8998 * powerpc.cc: Likewise.
8999 * reloc.cc: Likewise.
9000 * script-c.h: Likewise.
9001 * script-sections.cc: Likewise.
9002 * script.cc: Likewise.
9003 * stringpool.cc: Likewise.
9004 * symtab.cc: Likewise.
9005 * symtab.h: Likewise.
9006 * target.cc: Likewise.
9007 * timer.cc: Likewise.
9008 * timer.h: Likewise.
9009 * version.cc: Likewise.
9010 * x86_64.cc: Likewise.
9011
9012 2010-08-24 Nick Clifton <nickc@redhat.com>
9013
9014 PR 11899
9015 * layout.cc (segment_precedes): Sort segments by their physical
9016 addresses, if they have been set.
9017
9018 2010-08-23 Cary Coutant <ccoutant@google.com>
9019
9020 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9021 symbols data.
9022 (Lib_group::include_member): Unlock object after deleting its
9023 symbols data.
9024 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9025 the bug fixed here.
9026
9027 2010-08-19 Neil Vachharajani <nvachhar@google.com>
9028 Cary Coutant <ccoutant@google.com>
9029
9030 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9031 constructor, and set_blocker.
9032 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9033 readsyms_blocker_.
9034 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9035 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9036 * testsuite/Makefile.am (start_lib_test): New test case.
9037 * testsuite/Makefile.in: Regenerate.
9038 * testsuite/start_lib_test_main.c: New file.
9039 * testsuite/start_lib_test_1.c: New file.
9040 * testsuite/start_lib_test_2.c: New file.
9041 * testsuite/start_lib_test_3.c: New file.
9042
9043 2010-08-19 Ian Lance Taylor <iant@google.com>
9044
9045 * Makefile.in: Rebuild with automake 1.11.1.
9046 * aclocal.m4: Likewise.
9047 * testsuite/Makefile.in: Likewise.
9048
9049 2010-08-19 Ian Lance Taylor <iant@google.com>
9050
9051 PR 10893
9052 * i386.cc (class Output_data_plt_i386): Update declarations.
9053 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9054 local_ifuncs_ fields.
9055 (Target_i386::do_plt_section_for_global): New function.
9056 (Target_i386::do_plt_section_for_local): New function.
9057 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9058 parameter; change all callers. Initialize global_ifuncs_ and
9059 local_ifuncs_. If doing a static link define __rel_iplt_start and
9060 __rel_iplt_end.
9061 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9062 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9063 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9064 symbols.
9065 (Target_i386::make_plt_section): New function, broken out of
9066 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9067 (Target_i386::make_plt_entry): Call make_plt_section.
9068 (Target_i386::make_local_ifunc_plt_entry): New function.
9069 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9070 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9071 R_386_IRELATIVE to switch.
9072 (Target_i386::Scan::global): Likewise.
9073 (Target_i386::Relocate::relocate): Likewise.
9074 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9075 switch.
9076 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9077 (Target_x86_64::do_plt_section_for_global): New function.
9078 (Target_x86_64::do_plt_section_for_local): New function.
9079 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9080 parameter; change all callers. If doing a static link define
9081 __rela_iplt_start and __rela_iplt_end.
9082 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9083 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9084 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9085 to point to .plt.
9086 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9087 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9088 switch.
9089 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9090 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9091 R_X86_64_IRELATIVE to switch.
9092 (Target_x86_64::Scan::global): Likewise.
9093 (Target_x86_64::Relocate::relocate): Likewise.
9094 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9095 switch.
9096 * target.h (class Target): Add plt_section_for_global and
9097 plt_section_for_local functions. Add do_plt_section_for_global
9098 and do_plt_section_for_local virtual functions.
9099 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9100 clarifying comments.
9101 (Symbol::use_plt_offset): Handle IFUNC symbol.
9102 * object.cc (Sized_relobj::Sized_relobj): Initialize
9103 local_plt_offsets_.
9104 (Sized_relobj::local_has_plt_offset): New function.
9105 (Sized_relobj::local_plt_offset): New function.
9106 (Sized_relobj::set_local_plt_offset): New function.
9107 (Sized_relobj::do_count): Handle IFUNC symbol.
9108 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9109 a bit away from input_shndx_ field. Add set_is_func_symbol and
9110 is_ifunc_symbol functions.
9111 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9112 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9113 local_plt_offsets_ field.
9114 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9115 * output.h (class Output_section_data): Add non-const
9116 output_section function.
9117 (class Output_data_got): Update declarations.
9118 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9119 Add use_plt_offset parameter to global and local constructors.
9120 Change all callers. Change local_sym_index_ field to 31 bits.
9121 Change GSYM_CODE and CONSTANT_CODE accordingly.
9122 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9123 doing a static link don't set sh_link field.
9124 (Output_data_got::Got_entry::write): Use PLT offset if
9125 appropriate.
9126 (Output_data_got::add_global_plt): New function.
9127 (Output_data_got::add_local_plt): New function.
9128 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9129 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9130 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9131 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9132 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9133 IFUNC conditional.
9134 * testsuite/ifunc-sel.h: New file.
9135 * testsuite/ifuncmain1.c: New file.
9136 * testsuite/ifuncmain1vis.c: New file.
9137 * testsuite/ifuncmod1.c: New file.
9138 * testsuite/ifuncdep2.c: New file.
9139 * testsuite/ifuncmain2.c: New file.
9140 * testsuite/ifuncmain3.c: New file.
9141 * testsuite/ifuncmod3.c: New file.
9142 * testsuite/ifuncmain4.c: New file.
9143 * testsuite/ifuncmain5.c: New file.
9144 * testsuite/ifuncmod5.c: New file.
9145 * testsuite/ifuncmain6pie.c: New file.
9146 * testsuite/ifuncmod6.c: New file.
9147 * testsuite/ifuncmain7.c: New file.
9148 * configure, testsuite/Makefile.in: Rebuild.
9149
9150 2010-08-18 Ian Lance Taylor <iant@google.com>
9151
9152 * incremental.cc
9153 (Output_section_incremental_inputs::write_input_files): Add cast
9154 to avoid signed/unsigned comparison warning.
9155 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9156
9157 2010-08-12 Cary Coutant <ccoutant@google.com>
9158
9159 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9160
9161 2010-08-13 Ian Lance Taylor <iant@google.com>
9162
9163 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9164
9165 2010-08-12 Cary Coutant <ccoutant@google.com>
9166 Doug Kwan <dougkwan@google.com>
9167
9168 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9169 defintion overrides non-weak undef, remember that the original undef
9170 is not weak.
9171 * symtab.cc (Symbol_table::sized_write_global): For undef without
9172 an original weak binding, set binding to global in output.
9173 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9174 * testsuite/Makefile.in: Regenerate.
9175 * testsuite/strong_ref_weak_def.sh: New file.
9176 * testsuite/strong_ref_weak_def_1.c: Ditto.
9177 * testsuite/strong_ref_weak_def_2.c: Ditto.
9178
9179 2010-08-12 Cary Coutant <ccoutant@google.com>
9180
9181 * testsuite/incremental_test.sh: Rewrite.
9182 * testsuite/incremental_test_1.c: Rewrite.
9183 * testsuite/incremental_test_2.c: Rewrite.
9184
9185 2010-08-12 Cary Coutant <ccoutant@google.com>
9186
9187 * arm.cc (Target_arm::got_size): Add const.
9188 (Target_arm::got_entry_count): New function.
9189 (Target_arm::plt_entry_count): New function.
9190 (Target_arm::first_plt_entry_offset): New function.
9191 (Target_arm::plt_entry_size): New function.
9192 (Output_data_plt_arm::entry_count): New function.
9193 (Output_data_plt_arm::first_plt_entry_offset): New function.
9194 (Output_data_plt_arm::get_plt_entry_size): New function.
9195 * i386.cc (Target_i386::got_size): Add const.
9196 (Target_i386::got_entry_count): New function.
9197 (Target_i386::plt_entry_count): New function.
9198 (Target_i386::first_plt_entry_offset): New function.
9199 (Target_i386::plt_entry_size): New function.
9200 (Output_data_plt_i386::entry_count): New function.
9201 (Output_data_plt_i386::first_plt_entry_offset): New function.
9202 (Output_data_plt_i386::get_plt_entry_size): New function.
9203 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9204 find_incremental_inputs_sections. Dump incremental_got_plt section.
9205 * incremental.cc: Include target.h.
9206 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9207 parameter. Adjust all callers. Find incremental_got_plt section.
9208 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9209 section.
9210 (Output_section_incremental_inputs::set_final_data_size): Calculate
9211 size of incremental_got_plt section.
9212 (Output_section_incremental_inputs::do_write): Write the
9213 incremental_got_plt section.
9214 (Got_plt_view_info): New struct.
9215 (Local_got_offset_visitor): New class.
9216 (Global_got_offset_visitor): New class.
9217 (Global_symbol_visitor_got_plt): New class.
9218 (Output_section_incremental_inputs::write_got_plt): New function.
9219 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9220 Add parameter. Adjust all callers.
9221 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9222 (Incremental_inputs::got_plt_section): New function.
9223 (Incremental_inputs::got_plt_section_): New data member.
9224 (Incremental_got_plt_reader): New class.
9225 * layout.cc (Layout::create_incremental_info_sections): Add the
9226 incremental_got_plt section.
9227 * object.h (Got_offset_list::get_list): New function.
9228 (Got offset_list::for_all_got_offsets): New function.
9229 (Sized_relobj::local_got_offset_list): New function.
9230 * powerpc.cc (Target_powerpc::got_size): Add const.
9231 (Target_powerpc::got_entry_count): New function.
9232 (Target_powerpc::plt_entry_count): New function.
9233 (Target_powerpc::first_plt_entry_offset): New function.
9234 (Target_powerpc::plt_entry_size): New function.
9235 (Output_data_plt_powerpc::entry_count): New function.
9236 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9237 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9238 * sparc.cc (Target_sparc::got_size): Add const.
9239 (Target_sparc::got_entry_count): New function.
9240 (Target_sparc::plt_entry_count): New function.
9241 (Target_sparc::first_plt_entry_offset): New function.
9242 (Target_sparc::plt_entry_size): New function.
9243 (Output_data_plt_sparc::entry_count): New function.
9244 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9245 (Output_data_plt_sparc::get_plt_entry_size): New function.
9246 * symtab.h (Symbol::got_offset_list): New function.
9247 (Symbol_table::for_all_symbols): New function.
9248 * target.h (Sized_target::got_entry_count): New function.
9249 (Sized_target::plt_entry_count): New function.
9250 (Sized_target::plt_entry_size): New function.
9251 * x86_64.cc (Target_x86_64::got_size): Add const.
9252 (Target_x86_64::got_entry_count): New function.
9253 (Target_x86_64::plt_entry_count): New function.
9254 (Target_x86_64::first_plt_entry_offset): New function.
9255 (Target_x86_64::plt_entry_size): New function.
9256 (Output_data_plt_x86_64::entry_count): New function.
9257 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9258 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9259
9260 2010-08-12 Cary Coutant <ccoutant@google.com>
9261
9262 * archive.cc: Include incremental.h.
9263 (Archive::Archive): Initialize incremental_info_.
9264 (Archive::include_member): Record archive members in incremental info.
9265 (Add_archive_symbols::run): Record begin and end of an archive in
9266 incremental info.
9267 (Lib_group::include_member): Record objects in incremental info.
9268 * archive.h (Incremental_archive_entry): Forward declaration.
9269 (Archive::set_incremental_info): New member function.
9270 (Archive::incremental_info): New member function.
9271 (Archive::Unused_symbol_iterator): New class.
9272 (Archive::unused_symbols_begin): New member function.
9273 (Archive::unused_symbols_end): New member function.
9274 (Archive::incremental_info_): New data member.
9275 * incremental-dump.cc (find_input_containing_global): New function.
9276 (dump_incremental_inputs): Dump new incremental info sections.
9277 * incremental.cc: Include symtab.h.
9278 (Output_section_incremental_inputs): New class.
9279 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9280 new incremental info sections.
9281 (Sized_incremental_binary::do_check_inputs): Likewise.
9282 (Incremental_inputs::report_archive): Remove.
9283 (Incremental_inputs::report_archive_begin): New function.
9284 (Incremental_inputs::report_archive_end): New function.
9285 (Incremental_inputs::report_object): New function.
9286 (Incremental_inputs::finalize_inputs): Remove.
9287 (Incremental_inputs::report_input_section): New function.
9288 (Incremental_inputs::report_script): Rewrite.
9289 (Incremental_inputs::finalize): Do nothing but finalize string table.
9290 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9291 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9292 (Incremental_inputs::create_data_sections): New function.
9293 (Incremental_inputs::relocs_entsize): New function.
9294 (Output_section_incremental_inputs::set_final_data_size): New function.
9295 (Output_section_incremental_inputs::do_write): New function.
9296 (Output_section_incremental_inputs::write_header): New function.
9297 (Output_section_incremental_inputs::write_input_files): New function.
9298 (Output_section_incremental_inputs::write_info_blocks): New function.
9299 (Output_section_incremental_inputs::write_symtab): New function.
9300 * incremental.h (Incremental_script_entry): Forward declaration.
9301 (Incremental_object_entry): Forward declaration.
9302 (Incremental_archive_entry): Forward declaration.
9303 (Incremental_inputs): Forward declaration.
9304 (Incremental_inputs_header_data): Remove.
9305 (Incremental_inputs_header): Remove.
9306 (Incremental_inputs_header_write): Remove.
9307 (Incremental_inputs_entry_data): Remove.
9308 (Incremental_inputs_entry): Remove.
9309 (Incremental_inputs_entry_write): Remove.
9310 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9311 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9312 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9313 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9314 Likewise.
9315 (Incremental_input_entry): New class.
9316 (Incremental_script_entry): New class.
9317 (Incremental_object_entry): New class.
9318 (Incremental_archive_entry): New class.
9319 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9320 (Incremental_inputs::report_inputs): Remove.
9321 (Incremental_inputs::report_archive): Remove.
9322 (Incremental_inputs::report_archive_begin): New function.
9323 (Incremental_inputs::report_archive_end): New function.
9324 (Incremental_inputs::report_object): Change prototype.
9325 (Incremental_inputs::report_input_section): New function.
9326 (Incremental_inputs::report_script): Change prototype.
9327 (Incremental_inputs::get_reloc_count): New function.
9328 (Incremental_inputs::set_reloc_count): New function.
9329 (Incremental_inputs::create_data_sections): New function.
9330 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9331 (Incremental_inputs::inputs_section): New function.
9332 (Incremental_inputs::symtab_section): New function.
9333 (Incremental_inputs::relocs_section): New function.
9334 (Incremental_inputs::get_stringpool): Add const.
9335 (Incremental_inputs::command_line): Add const.
9336 (Incremental_inputs::inputs): Remove.
9337 (Incremental_inputs::command_line_key): New function.
9338 (Incremental_inputs::input_file_count): New function.
9339 (Incremental_inputs::input_files): New function.
9340 (Incremental_inputs::relocs_entsize): New function.
9341 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9342 (Incremental_inputs::finalize_inputs): Remove.
9343 (Incremental_inputs::Input_info): Remove.
9344 (Incremental_inputs::lock_): Remove.
9345 (Incremental_inputs::inputs_): Change type.
9346 (Incremental_inputs::inputs_map_): Remove.
9347 (Incremental_inputs::current_object_entry_): New data member.
9348 (Incremental_inputs::inputs_section_): New data member.
9349 (Incremental_inputs::symtab_section_): New data member.
9350 (Incremental_inputs::relocs_section_): New data member.
9351 (Incremental_inputs::reloc_count_): New data member.
9352 (Incremental_inputs_reader): New class.
9353 (Incremental_symtab_reader): New class.
9354 (Incremental_relocs_reader): New class.
9355 * layout.cc (Layout::finalize): Move finalization of incremental info
9356 and creation of incremental info sections to follow finalization of
9357 symbol table. Set offsets for postprocessing sections.
9358 (Layout::create_incremental_info_sections): Call
9359 Incremental_inputs::create_data_sections. Add incremental symtab
9360 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9361 sections to layout after input sections.
9362 * layout.h (struct Timespec): Forward declaration.
9363 (Layout::incremental_inputs): Add const.
9364 (Layout::create_incremental_info_sections): Add parameter.
9365 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9366 * object.cc: Include incremental.h.
9367 (Relobj::finalize_incremental_relocs): New function.
9368 (Sized_relobj::do_layout): Record input sections in incremental info.
9369 * object.h (Object::output_section): New function.
9370 (Object::output_section_offset): Moved from Relobj.
9371 (Object::get_incremental_reloc_base): New function.
9372 (Object::get_incremental_reloc_count): New function.
9373 (Object::do_output_section): New function.
9374 (Object::do_output_section_offset): Moved from Relobj.
9375 (Object::do_get_incremental_reloc_base): New function.
9376 (Object::do_get_incremental_reloc_count): New function.
9377 (Object::Object): Initialize new data members.
9378 (Relobj::output_section): Renamed do_output_section and moved to
9379 protected.
9380 (Relobj::output_section_offset): Moved to Object.
9381 (Relobj::do_get_incremental_reloc_base): New function.
9382 (Relobj::do_get_incremental_reloc_count): New function.
9383 (Relobj::allocate_incremental_reloc_counts): New function.
9384 (Relobj::count_incremental_reloc): New function.
9385 (Relobj::finalize_incremental_relocs): New function.
9386 (Relobj::next_incremental_reloc_index): New function.
9387 (Relobj::reloc_counts_): New data member.
9388 (Relobj::reloc_bases_): New data member.
9389 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9390 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9391 (Sized_relobj::incremental_relocs_scan): New function.
9392 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9393 (Sized_relobj::incremental_relocs_write): New function.
9394 (Sized_relobj::incremental_relocs_write_reltype): New function.
9395 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9396 incremental link.
9397 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9398 archives and object files elsewhere.
9399 (Add_symbols::run): Report object files here.
9400 (Finish_group::run): Report end of archive at end of group.
9401 * reloc.cc: Include layout.h, incremental.h.
9402 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9403 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9404 (Sized_relobj::incremental_relocs_scan): New function.
9405 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9406 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9407 (Sized_relobj::incremental_relocs_write): New function.
9408 (Sized_relobj::incremental_relocs_write_reltype): New function.
9409 * script.cc (read_input_script): Rewrite test for incremental link.
9410 Change call to Incremental_inputs::report_script.
9411 * symtab.h (Symbol_table::first_global_index): New function.
9412 (Symbol_table::output_count): New function.
9413
9414 2010-08-12 Doug Kwan <dougkwan@google.com>
9415
9416 * arm.cc (Target_arm::merge_object_attributes): Check command line
9417 options --no-wchar-size-warning and --no-enum-size-warning.
9418 * options.h (General_options): Add ld-compatible options
9419 --no-enum-size-warning and --no-wchar-size-warning.
9420
9421 2010-08-04 Ian Lance Taylor <iant@google.com>
9422
9423 * x86_64.cc (Target_x86_64::Scan::local): Use
9424 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9425 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9426 (Target_x86_64::Scan::global): Likewise.
9427 (Target_x86_64::Relocate::relocate): Likewise.
9428 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9429 Likewise.
9430
9431 2010-08-03 Cary Coutant <ccoutant@google.com>
9432
9433 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9434 to reserve space in merged_strings vector. Keep total input size
9435 for stats.
9436 (Output_merge_string::do_print_merge_stats): Print total input size.
9437 * merge.h (Output_merge_string): Add input_size_ field.
9438 * stringpool.cc (Stringpool_template::string_length): Move
9439 implementations out of Stringpool_template class and place in
9440 stringpool.h.
9441 * stringpool.h (string_length): Move out of Stringpool_template.
9442
9443 2010-08-03 Ian Lance Taylor <iant@google.com>
9444
9445 PR 11712
9446 * layout.cc (relaxation_loop_body): If address of load segment is
9447 set, adjust address to include headers if possible.
9448
9449 2010-08-03 Ian Lance Taylor <iant@google.com>
9450
9451 * version.cc (version_string): Bump to 1.10.
9452
9453 2010-08-03 Ian Lance Taylor <iant@google.com>
9454
9455 PR 11805
9456 * layout.h (enum Output_section_order): Define.
9457 (class Layout): Update declarations.
9458 * layout.cc (Layout::get_output_section): Add order parameter.
9459 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9460 is_first_non_relro parameters. Change all callers.
9461 (Layout::choose_output_section): Likewise.
9462 (Layout::add_output_section_data): Likewise.
9463 (Layout::make_output_section): Likewise. Set order.
9464 (Layout::default_section_order): New function.
9465 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9466 * output.cc (Output_section::Output_section): Initialize order_.
9467 Don't initialize deleted fields.
9468 (Output_segment::Output_segment): Don't initialize deleted
9469 fields.
9470 (Output_segment::add_output_section_to_load): New function
9471 replacing add_output_section. Change all callers to call this or
9472 add_output_section_to_nonload.
9473 (Output_segment::add_output_section_to_nonload): New function.
9474 (Output_segment::remove_output_section): Rewrite.
9475 (Output_segment::add_initial_output_data): Likewise.
9476 (Output_segment::has_any_data_sections): Likewise.
9477 (Output_segment::is_first_section_relro): Likewise.
9478 (Output_segment::maximum_alignment): Likewise.
9479 (Output_segment::has_dynamic_reloc): New function replacing
9480 dynamic_reloc_count. Change all callers.
9481 (Output_segment::has_dynamic_reloc_list): New function replacing
9482 dynamic_reloc_count_list. Change all callers.
9483 (Output_segment::set_section_addresses): Rewrite.
9484 (Output_segment::set_offset): Rewrite.
9485 (Output_segment::find_first_and_last_list): Remove.
9486 (Output_segment::set_tls_offsets): Rewrite.
9487 (Output_segment::first_section_load_address): Likewise.
9488 (Output_segment::output_section_count): Likewise.
9489 (Output_segment::section_with_lowest_load_address): Likewise.
9490 (Output_segment::write_section_headers): Likewise.
9491 (Output_segment::print_sections_to_map): Likewise.
9492 * output.h (class Output_data): Remove dynamic_reloc_count_
9493 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9494 (Output_data::add_dynamic_reloc): Rewrite.
9495 (Output_data::has_dynamic_reloc): New function.
9496 (Output_data::dynamic_reloc_count): Remove.
9497 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9498 is_last_relro_, is_first_non_relro_, is_interp_,
9499 is_dynamic_linker_section_ fields. Add order and set_order
9500 functions. Remove is_relro_local, set_is_relro_local,
9501 is_last_relro, set_is_last_relro, is_first_non_relro,
9502 set_is_first_non_relro functions, is_interp, set_is_interp,
9503 is_dynamic_linker_section, and set_is_dynamic_linker_section
9504 functions.
9505 (class Output_segment): Change Output_data_list from std::list to
9506 std:;vector. Add output_lists_ field. Remove output_data_ and
9507 output_bss_ fields. Update declarations.
9508
9509 2010-08-02 Ian Lance Taylor <iant@google.com>
9510
9511 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9512 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9513 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9514
9515 2010-08-02 Ian Lance Taylor <iant@google.com>
9516
9517 PR 11855
9518 * script.cc (Script_options::Script_options): Initialize
9519 symbol_definitions_ and symbol_references_.
9520 (Script_options::add_symbol_assignment): Update
9521 symbol_definitions_ and symbol_references_.
9522 (Script_options::add_symbol_reference): New function.
9523 (script_symbol): New function.
9524 * script.h (class Script_options): Add symbol_definitions_ and
9525 symbol_references_ fields.
9526 (Script_options::referenced_const_iterator): New type.
9527 (Script_options::referenced_begin): New function.
9528 (Script_options::referenced_end): New function.
9529 (Script_options::is_referenced): New function.
9530 (Script_options::any_unreferenced): New function.
9531 * script-c.h (script_symbol): Declare.
9532 * yyscript.y (exp): Call script_symbol.
9533 * symtab.cc: Include "script.h".
9534 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9535 Change all callers. Check symbols referenced by scripts.
9536 (Symbol_table::add_undefined_symbols_from_command_line): Add
9537 layout parameter. Change all callers.
9538 (Symbol_table::do_add_undefined_symbols_from_command_line):
9539 Likewise. Break out loop body. Check symbols referenced by
9540 scripts.
9541 (Symbol_table::add_undefined_symbol_from_command_line): New
9542 function broken out of
9543 do_add_undefined_symbols_from_command_line.
9544 * symtab.h (class Symbol_table): Update declarations.
9545 * archive.cc: Include "layout.h".
9546 (Archive::should_include_member): Add layout parameter. Change
9547 all callers. Check for symbol mentioned in expression.
9548 * archive.h (class Archive): Update declaration.
9549 * object.cc (Sized_relobj::do_should_include_member): Add layout
9550 parameter.
9551 * object.h (Object::should_include_member): Add layout parameter.
9552 Change all callers.
9553 (Object::do_should_include_member): Add layout parameter.
9554 (class Sized_relobj): Update declaration.
9555 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9556 parameter.
9557 * dynobj.h (class Sized_dynobj): Update declaration.
9558 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9559 layout parameter.
9560 * plugin.h (class Sized_pluginobj): Update declaration.
9561
9562 2010-08-02 Ian Lance Taylor <iant@google.com>
9563
9564 PR 11866
9565 * output.cc (Output_segment::set_offset): Search for the first and
9566 last sections rather than assuming that the list is in order.
9567 (Output_segment::find_first_and_last_list): New function.
9568 * output.h (class Output_segment): Update declarations.
9569 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9570 (relro_strip_test_SOURCES): New variable.
9571 (relro_strip_test_DEPENDENCIES): New variable.
9572 (relro_strip_test_LDFLAGS): New variable.
9573 (relro_strip_test_LDADD): New variable.
9574 (relro_strip_test.so): New target.
9575
9576 2010-08-02 Ian Lance Taylor <iant@google.com>
9577
9578 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9579 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9580 (Target_i386::got_tlsdesc_section): New function.
9581 (Target_i386::got_section): Create space for GOT entries for
9582 TLSDESC relocations.
9583 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9584 R_386_TLS_GOTDESC.
9585 (Target_i386::Scan::global): Likewise.
9586 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9587 using TLSDESC GOT.
9588 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9589 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9590 (Target_x86_64::got_tlsdesc_section): New function.
9591 (Target_x86_64::got_section): Create space for GOT entries for
9592 TLSDESC relocations.
9593 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9594 R_386_TLS_GOTDESC.
9595 (Target_x86_64::Scan::global): Likewise.
9596 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9597 using TLSDESC GOT.
9598
9599 2010-08-02 Ian Lance Taylor <iant@google.com>
9600
9601 * testsuite/final_layout.sh: Use dc to convert from hex to
9602 decimal.
9603
9604 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9605
9606 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9607 paramter to the call to gold::gc_process_relocs.
9608 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9609 paramter to the call to gold::gc_process_relocs.
9610 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9611 parameter to the call to gold::gc_process_relocs.
9612 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9613 template parameter to the call to gold::gc_process_relocs.
9614 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9615 paramter to the call to gold::gc_process_relocs.
9616 * gc.h (get_embedded_addend_size): New function.
9617 (gc_process_relocs): Save the size of the reloc for use by ICF.
9618 * icf.cc (get_section_contents): Get the addend from the text section
9619 for SHT_REL relocation sections.
9620 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9621 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9622 * int_encoding.h (read_from_pointer): New overloaded function.
9623 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9624 * testsuite/icf_sht_rel_addend_test.sh: New file.
9625 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9626 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9627
9628 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9629
9630 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9631 * Makefile.in: Regenerate.
9632 * testsuite/Makefile.in: Regenerate.
9633
9634 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9635
9636 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9637 * gold/testsuite/debug_msg.cc: Likewise.
9638 * gold/testsuite/odr_violation1.cc
9639 * gold/testsuite/odr_violation2.cc
9640
9641 2010-07-21 Cary Coutant <ccoutant@google.com>
9642
9643 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9644 string, and length fields.
9645 (Output_merge_string::Merged_strings_list): New type.
9646 (Output_merge_string::Merged_strings_lists): New typedef.
9647 (Output_merge_string): Replace merged_strings_ with
9648 merged_strings_lists_.
9649 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9650 Merged_strings_list per input object and section. Don't store pointer
9651 to the string. Don't store length with each merged string entry.
9652 (Output_merge_string::finalize_merged_data): Loop over list of merged
9653 strings lists. Recompute length of each merged string.
9654
9655 2010-07-15 Cary Coutant <ccoutant@google.com>
9656
9657 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9658 here.
9659
9660 2010-07-14 Ian Lance Taylor <iant@google.com>
9661
9662 * descriptors.cc (Descriptors::open): Report correct name in error
9663 message.
9664
9665 2010-07-13 Doug Kwan <dougkwan@google.com>
9666
9667 * arm.cc (Arm_input_section::Arm_input_section): For a
9668 SHT_ARM_EXIDX section, always keeps the input sections.
9669 (Arm_input_section::set_exidx_section_link): New method.
9670 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9671 has_errors_ to false.
9672 (Arm_exidx_input_section::has_errors,
9673 Arm_exidx_input_section::set_has_errors): New methods.
9674 (Arm_exidx_input_section::has_errors_): New data member.
9675 (Arm_relobj::get_exidx_shndx_list): New method.
9676 (Arm_output_section::append_text_sections_to_list): Do not skip
9677 section without SHF_EXECINSTR.
9678 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9679 errors.
9680 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9681 section header. Make error messages more verbose. Check for
9682 a non-executable section linked to an EXIDX section.
9683 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9684 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9685 check that there is no deferred EXIDX section if we exit early.
9686 Instead of not making an EXIDX section in case of an error, make one
9687 and set the has_errors flag of it.
9688 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9689 in a relocatable link.
9690 (Target_arm::do_relax): Look for the EXIDX output section instead of
9691 assuming that it is called .ARM.exidx.
9692 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9693 section list. Do not check for SHF_EXECINSTR section flags but
9694 skip any input section with errors.
9695 * output.cc (Output_section::Output_section): Initialize
9696 always_keeps_input_sections_ to false.
9697 (Output_section::add_input_section): Check for
9698 always_keeps_input_sections_.
9699 * output.h (Output_section::always_keeps_input_sections,
9700 Output_section::set_always_keeps_input_sections): New methods.
9701 (Output_section::always_keeps_input_sections): New data member.
9702
9703 2010-07-13 Rafael Espindola <espindola@google.com>
9704
9705 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9706 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9707
9708 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9709 Ian Lance Taylor <iant@google.com>
9710
9711 * output.h (Output_section_lookup_maps::add_merge_section):
9712 Correct check of whether value was inserted.
9713 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9714 (Output_section_lookup_maps::add_relaxed_input_section):
9715 Likewise.
9716 * arm.cc (Target_arm::got_section): Remove used local os.
9717 * i386.cc (Target_i386::got_section): Likewise.
9718 * x86_64.cc (Target_x86_64::got_section): Likewise.
9719 * sparc.cc (Target_sparc::got_section): Likewise.
9720 (Target_sparc::relocate): Remove unused local have_got_offset.
9721 * powerpc.cc (Target_powerpc::relocate): Likewise.
9722
9723 2010-07-13 Ian Lance Taylor <iant@google.com>
9724
9725 * compressed_output.cc (zlib_decompress): Fix signature in
9726 !HAVE_ZLIB_H case.
9727
9728 * archive.cc (Archive::include_member): Unlock an external member
9729 of a thin archive. Don't bother to delete an object we know is
9730 NULL.
9731
9732 2010-07-12 Cary Coutant <ccoutant@google.com>
9733
9734 * compressed_output.cc (zlib_decompress): New function.
9735 (get_uncompressed_size): New function.
9736 (decompress_input_section): New function.
9737 * compressed_output.h (get_uncompressed_size): New function.
9738 (decompress_input_section): New function.
9739 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9740 Handle compressed debug sections.
9741 * layout.cc (is_compressed_debug_section): New function.
9742 (Layout::output_section_name): Map compressed section names to
9743 canonical names.
9744 * layout.h (is_compressed_debug_section): New function.
9745 (is_debug_info_section): Recognize compressed debug sections.
9746 * merge.cc: Include compressed_output.h.
9747 (Output_merge_data::do_add_input_section): Handle compressed
9748 debug sections.
9749 (Output_merge_string::do_add_input_section): Handle compressed
9750 debug sections.
9751 * object.cc: Include compressed_output.h.
9752 (Sized_relobj::Sized_relobj): Initialize new data members.
9753 (build_compressed_section_map): New function.
9754 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9755 * object.h (Object::section_is_compressed): New method.
9756 (Object::do_section_is_compressed): New method.
9757 (Sized_relobj::Compressed_section_map): New type.
9758 (Sized_relobj::do_section_is_compressed): New method.
9759 (Sized_relobj::compressed_sections_): New data member.
9760 * output.cc (Output_section::add_input_section): Handle compressed
9761 debug sections.
9762 * reloc.cc: Include compressed_output.h.
9763 (Sized_relobj::write_sections): Handle compressed debug sections.
9764
9765 2010-07-08 Cary Coutant <ccoutant@google.com>
9766
9767 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9768 weak when resolving to a dynamic def.
9769 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9770 for weak undef/dynamic def cases. Adjust callers.
9771 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9772 undef_binding_weak_.
9773 (Symbol_table::sized_write_globals): Adjust symbol binding.
9774 (Symbol_table::sized_write_symbol): Add binding parameter.
9775 * symtab.h (Symbol::set_undef_binding): New method.
9776 (Symbol::is_undef_binding_weak): New method.
9777 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9778 (Symbol_table::should_override): Add new parameter.
9779 (Symbol_table::sized_write_symbol): Add new parameter.
9780
9781 * testsuite/weak_undef_file1.cc: Add new test case.
9782 * testsuite/weak_undef_file2.cc: Fix header comment.
9783 * testsuite/weak_undef_test.cc: Add new test case.
9784
9785 2010-06-29 Doug Kwan <dougkwan@google.com>
9786
9787 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9788 Initialize USE_SYMBOL_.
9789 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9790 definition.
9791 (Arm_reloc_property::uses_symbol_): New data member declaration.
9792 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9793 uses symbol value and symbol is undefined but not weakly undefined.
9794
9795 2010-06-28 Rafael Espindola <espindola@google.com>
9796
9797 * plugin.cc (Plugin::load): Use dlerror.
9798
9799 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9800
9801 * symtab.cc (detect_odr_violations): When reporting an ODR
9802 violation, report an object where the symbol is defined.
9803
9804 2010-06-25 Doug Kwan <dougkwan@google.com>
9805
9806 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9807 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9808 definition.
9809 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9810 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9811 target hook to detect function points.
9812 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9813 * icf.h (Icf::check_section_for_function_pointers): Change type of
9814 parameter SECTION_NAME to const reference to std::string. Use
9815 target hook to determine if section may have unsafe pointers.
9816 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9817 method definition.
9818
9819 2010-06-21 Rafael Espindola <espindola@google.com>
9820
9821 * fileread.cc (Input_file::find_fie): New
9822 (Input_file::open): Use Input_file::find_fie.
9823 * fileread.h (Input_file::find_fie): New
9824 * plugin.cc (set_extra_library_path): New.
9825 (Plugin::load): Add set_extra_library_path to the transfer vector.
9826 (Plugin_manager::set_extra_library_path): New.
9827 (Plugin_manager::add_input_file): Use the extra search path if set.
9828 (set_extra_library_path(): New.
9829 * plugin.h (Plugin_manager): Add set_extra_library_path and
9830 extra_search_path_.
9831
9832 2010-06-19 Cary Coutant <ccoutant@google.com>
9833
9834 * layout.cc (gdb_sections): Add .debug_types.
9835 (lines_only_debug_sections): Likewise.
9836
9837 2010-06-18 Rafael Espindola <espindola@google.com>
9838
9839 * plugin.cc (add_input_file,add_input_library)
9840 (Plugin_manager::add_input_file): Make filename arguments const.
9841 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9842 const.
9843
9844 2010-06-16 Doug Kwan <dougkwan@google.com>
9845
9846 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9847 .ARM.attributes section if we have not merged any input
9848 attributes sections.
9849
9850 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9851
9852 * arm.cc: Allow combining objects with no EABI version
9853 information.
9854
9855 2010-06-15 Rafael Espindola <espindola@google.com>
9856
9857 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9858
9859 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9860
9861 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9862 (struct iovec): Correct !HAVE_READV definition.
9863
9864 2010-06-10 Cary Coutant <ccoutant@google.com>
9865
9866 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9867 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9868 reloc sections.
9869 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9870
9871 PR 11683
9872 * symtab.h (Symbol::is_placeholder): New member function.
9873 * target-reloc.h (relocate_section): Check for placeholder symbols.
9874
9875 * testsuite/Makefile.am (plugin_test_8): New test.
9876 (plugin_test_9): New test.
9877 * testsuite/Makefile.in: Regenerate.
9878
9879 2010-06-09 Nick Clifton <nickc@redhat.com>
9880
9881 * yyscript.y (input_list_element): Allow strings prefixed with
9882 the '-' character. Treat these as libraries.
9883 * script.cc (script_add_library): New function. Adds a library
9884 specified by "-l<name>" found in an input script.
9885 * script-c.h: Add prototype for script_add_library.
9886
9887 2010-06-07 Doug Kwan <dougkwan@google.com>
9888
9889 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9890 Restrict stub-group size to be within long conditional branch
9891 range when working around cortex-A8 erratum.
9892
9893 2010-06-07 Damien Diederen <dd@crosstwine.com>
9894
9895 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9896 #ifdef typo.
9897
9898 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9899
9900 PR gold/11658
9901 * output.cc
9902 (Output_section::Input_section_sort_entry::compare_section_ordering):
9903 Change to return non-zero correctly.
9904 (Output_section::Input_section_sort_section_order_index_compare
9905 ::operator()): Change to fix ambiguity in comparisons.
9906
9907 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9908
9909 * gold.h (is_wildcard_string): New function.
9910 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9911 (Layout::layout_eh_frame): Ditto.
9912 (Layout::find_section_order_index): New method.
9913 (Layout::read_layout_from_file): New method.
9914 * layout.h (Layout::find_section_order_index): New method.
9915 (Layout::read_layout_from_file): New method.
9916 (Layout::input_section_position_): New private member.
9917 (Layout::input_section_glob_): New private member.
9918 * main.cc (main): Call read_layout_from_file here.
9919 * options.h (--section-ordering-file): New option.
9920 * output.cc (Output_section::input_section_order_specified_): New
9921 member.
9922 (Output_section::Output_section): Initialize new member.
9923 (Output_section::add_input_section): Add new parameter.
9924 Keep input sections when --section-ordering-file is used.
9925 (Output_section::set_final_data_size): Sort input sections when
9926 section ordering file is specified.
9927 (Output_section::Input_section_sort_entry): Add new parameter.
9928 Check sorting type.
9929 (Output_section::Input_section_sort_entry::compare_section_ordering):
9930 New method.
9931 (Output_section::Input_section_sort_compare::operator()): Change to
9932 consider section_order_index.
9933 (Output_section::Input_section_sort_init_fini_compare::operator()):
9934 Change to consider section_order_index.
9935 (Output_section::Input_section_sort_section_order_index_compare
9936 ::operator()): New method.
9937 (Output_section::sort_attached_input_sections): Change to sort
9938 according to section order when specified.
9939 (Output_section::add_input_section<32, true>): Add new parameter.
9940 (Output_section::add_input_section<64, true>): Add new parameter.
9941 (Output_section::add_input_section<32, false>): Add new parameter.
9942 (Output_section::add_input_section<64, false>): Add new parameter.
9943 * output.h (Output_section::add_input_section): Add new parameter.
9944 (Output_section::input_section_order_specified): New
9945 method.
9946 (Output_section::set_input_section_order_specified): New method.
9947 (Input_section::Input_section): Initialize section_order_index_.
9948 (Input_section::section_order_index): New method.
9949 (Input_section::set_section_order_index): New method.
9950 (Input_section::section_order_index_): New member.
9951 (Input_section::Input_section_sort_section_order_index_compare): New
9952 struct.
9953 (Output_section::input_section_order_specified_): New member.
9954 * script-sections.cc (is_wildcard_string): Delete and move modified
9955 method to gold.h.
9956 (Output_section_element_input::Output_section_element_input): Modify
9957 call to is_wildcard_string.
9958 (Output_section_element_input::Input_section_pattern
9959 ::Input_section_pattern): Ditto.
9960 (Output_section_element_input::Output_section_element_input): Ditto.
9961 * testsuite/Makefile.am (final_layout): New test case.
9962 * testsuite/Makefile.in: Regenerate.
9963 * testsuite/final_layout.cc: New file.
9964 * testsuite/final_layout.sh: New file.
9965
9966 2010-06-01 Rafael Espindola <espindola@google.com>
9967
9968 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9969
9970 2010-06-01 Rafael Espindola <espindola@google.com>
9971
9972 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9973 visibility of symbols.
9974
9975 2010-05-27 Doug Kwan <dougkwan@google.com>
9976
9977 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9978 from start of output section instead of address for a local symbol
9979 in a merged or relaxed section when doing a relocatable link.
9980
9981 2010-05-26 Rafael Espindola <espindola@google.com>
9982
9983 PR 11604
9984 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9985 adding sections the garbage collector removed.
9986 * gold/testsuite/Makefile.am: Add test.
9987 * gold/testsuite/Makefile.in: Regenerate.
9988 * gold/testsuite/plugin_test_7.sh: New.
9989 * gold/testsuite/plugin_test_7_1.c: New.
9990 * gold/testsuite/plugin_test_7_2.c: New.
9991
9992 2010-05-26 Rafael Espindola <espindola@google.com>
9993
9994 * script-sections.cc (Output_section_definition::set_section_addresses):
9995 Check for --section-start.
9996
9997 2010-05-26 Doug Kwan <dougkwan@google.com>
9998
9999 * arm.cc (Arm_scan_relocatable_relocs): New class.
10000 (Target_arm::relocate_special_relocatable): New method.
10001 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10002 (Arm_relocate_functions::thumb_branch_common): Same.
10003 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10004 instead of Default_scan_relocatable_relocs.
10005 * target-reloc.h (relocate_for_relocatable): Let target handle
10006 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10007 * target.h (Sized_target::relocate_special_relocatable): New method.
10008
10009 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10010
10011 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10012
10013 2010-05-23 Doug Kwan <dougkwan@google.com>
10014
10015 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10016 instead of a cast.
10017 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10018 with a direct branch, not a conditional branch, to a stub.
10019 * merge.cc (Output_merge_base::record_input_section): New method
10020 defintion.
10021 (Output_merge_data::do_add_input_section): Record input section if
10022 keeps-input-sections flag is set.
10023 (Output_merge_string::do_add_input_section): Ditto.
10024 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10025 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10026 INPUT_SECTIONS_.
10027 (Output_merge_base::keeps_input_sections,
10028 Output_merge_base::set_keeps_input_sections,
10029 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10030 method definitions.
10031 (Output_merge_base::Input_sections): New type declaration.
10032 (Output_merge_base::input_sections_begin,
10033 Output_merge_base::input_sections_end,
10034 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10035 (Output_merge_base::bool keeps_input_sections_,
10036 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10037 Output_merge_base::input_sections_): New data members.
10038 (Output_merge_data::do_set_keeps_input_sections): New method
10039 defintion.
10040 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10041 * output.cc (Output_section::Input_section::relobj): Move method
10042 defintion from class declaration to here and handle merge sections.
10043 (Output_section::Input_section::shndx): Ditto.
10044 (Output_section::Output_section): Remove initializations of removed
10045 data members and initialize new data member LOOKUP_MAPS_.
10046 (Output_section::add_input_section): Set keeps-input-sections flag
10047 for a newly created merge output section as appropriate. Adjust code
10048 to use Output_section_lookup_maps class.
10049 (Output_section::add_relaxed_input_section): Adjst code for lookup
10050 maps code refactoring.
10051 (Output_section::add_merge_input_section): Add a new parameter
10052 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10053 class. If adding input section to a newly created merge output
10054 section fails, remove the new merge section.
10055 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
10056 Adjust code for use of the Output_section_lookup_maps class.
10057 (Output_section::find_merge_section): Ditto.
10058 (Output_section::build_lookup_maps): New method defintion.
10059 (Output_section::find_relaxed_input_section): Adjust code to use
10060 Output_section_lookup_maps class.
10061 (Output_section::get_input_sections): Export merge sections. Adjust
10062 code to use Output_section_lookup_maps class.
10063 (Output_section:::add_script_input_section): Adjust code to use
10064 Output_section_lookup_maps class. Update lookup maps for merge
10065 sections also.
10066 (Output_section::discard_states): Use Output_section_lookup_maps.
10067 (Output_section::restore_states): Same.
10068 * output.h (Merge_section_properties): Move class defintion out of
10069 Output_section.
10070 (Output_section_lookup_maps): New class.
10071 (Output_section::Input_section::is_merge_section): New method
10072 defintion.
10073 (Output_section::Input_section::relobj): Move defintion out of class
10074 defintion. Declare method only.
10075 (Output_section::Input_section::shndx): Ditto.
10076 (Output_section::Input_section::output_merge_base): New method defintion.
10077 (Output_section::Input_section::u2_.pomb): New union field.
10078 (Output_section::Merge_section_by_properties_map,
10079 Output_section::Output_section_data_by_input_section_map,
10080 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10081 Remove types.
10082 (Output_section::add_merge_input_section): Add new parameter
10083 KEEPS_INPUT_SECTIONS.
10084 (Output_section::build_lookup_maps): New method declaration.
10085 (Output_section::merge_section_map_,
10086 Output_section::merge_section_by_properties_map_,
10087 Output_section::relaxed_input_section_map_,
10088 Output_section::is_relaxed_input_section_map_valid_): Remove data
10089 members.
10090 (Output_section::lookup_maps_): New data member.
10091
10092 2010-05-21 Doug Kwan <dougkwan@google.com>
10093
10094 PR gold/11619
10095 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10096 avoid a compilation error.
10097
10098 2010-05-19 Rafael Espindola <espindola@google.com>
10099
10100 * script-sections.cc (Output_section_definition::allocate_to_segment):
10101 Update the phdrs_list even when the output section is NULL.
10102 * testsuite/Makefile.am: Add test.
10103 * testsuite/Makefile.in: Regenerate.
10104 * testsuite/script_test_9.cc: New.
10105 * testsuite/script_test_9.sh: New.
10106 * testsuite/script_test_9.t: New.
10107
10108 2010-05-19 Doug Kwan <dougkwan@google.com>
10109
10110 * arm.cc (Arm_input_section::original_size): New method.
10111 (Arm_input_section::do_addralign): Add a cast.
10112 (Arm_input_section::do_output_offset): Remove static cast.
10113 (Arm_input_section::original_addralign,
10114 Arm_input_section::original_size_): Change type to uint32_t.
10115 (Arm_input_section::init): Add safe casts for section alignment
10116 and size.
10117 (Arm_input_section::set_final_data_size): Do not set address and
10118 offset of stub table.
10119 (Arm_output_section::fix_exidx_coverage): Change use of of
10120 Output_section::Simple_input_section to that of
10121 Output_section::Input_section.
10122 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10123 except for the first pass.
10124 * output.cc (Output_section::get_input_sections): Change type of
10125 input_sections to std::list<Input_section>.
10126 (Output_section::add_script_input_section): Rename from
10127 Output_section::add_simple_input_section. Change type of SIS
10128 parameter from Simple_input_section to Input_section.
10129 * output.h (Output_section::Simple_input_section): Remove class.
10130 (Output_section::Input_section): Change class visibility to public.
10131 (Output_section::Input_section::addralign): Use stored alignments
10132 for special input sections if set.
10133 (Output_section::Input_section::set_addralign): New method.
10134 (Output_section::get_input_sections): Change parameter type from
10135 list of Simple_input_section to list of Input_section.
10136 (Output_section::add_script_input_section): Rename from
10137 Output_section::add_simple_input_section. Change first parameter's
10138 type from Simple_input_section to Input_section and remove the
10139 second and third parameters.
10140 * script-sections.cc (Input_section::Input_section_list): Change
10141 type to list of Output_section::Input_section/
10142 (Input_section_info::Input_section_info): Change parameter type of
10143 INPUT_SECTION to Output_section::Input_section.
10144 (Input_section_info::input_section): Change return type.
10145 (Input_section_info::input_section_): Change type to
10146 Output_section::Input_section.
10147 (Output_section_element_input::set_section_addresses): Adjust code
10148 to use Output_section::Input_section instead of
10149 Output_section::Simple_input_section. Adjust code for renaming
10150 of Output_section::add_simple_input_section.
10151 (Orphan_output_section::set_section_addresses): Ditto.
10152
10153 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10154
10155 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10156 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10157
10158 2010-05-18 Rafael Espindola <espindola@google.com>
10159
10160 * options.cc (General_options::finalize): Handle -nostdlib.
10161 * options.h (nostdlib): New option.
10162 * script.cc (script_add_search_dir): Handle -nostdlib.
10163
10164 2010-05-12 Doug Kwan <dougkwan@google.com>
10165
10166 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10167 attributes section only if there no attributes section after merging.
10168 (Target_arm::merge_object_attributes): Move value of
10169 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10170 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10171 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10172 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10173 and arm_attr_merge_7.stdout.
10174 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10175 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10176 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10177 arm_attr_merge_7b.o): New rules.
10178 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10179 arm_attr_merge_7
10180 * testsuite/Makefile.in: Regenerate.
10181 * testsuite/arm_attr_merge.sh: New file.
10182 * testsuite/arm_attr_merge_[67][ab].s: Same.
10183
10184 2010-05-05 Nick Clifton <nickc@redhat.com>
10185
10186 * po/es.po: Updated Spanish translation.
10187
10188 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10189
10190 * Makefile.am (install-exec-local): Properly install gold as
10191 default cross linker.
10192 * Makefile.in: Regenerated.
10193
10194 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10195 Nick Clifton <nickc@redhat.com>
10196
10197 * configure.ac (install_as_default): Define and set to false
10198 unless --enable-gold or --enable-gold=both/gold has been
10199 specified.
10200 * configure: Regenerate.
10201
10202 * Makefile.am (install-exec-local): Install the executable as
10203 'ld.gold'. If install_as_default is true then also install it as
10204 'ld'.
10205 * Makefile.in: Regenerated.
10206
10207 2010-04-24 Ian Lance Taylor <iant@google.com>
10208
10209 * layout.cc (Layout::layout_reloc): In relocatable link don't
10210 combine reloc sections for grouped sections.
10211
10212 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10213
10214 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10215 sections that are not ordinary to icf.
10216 * icf.cc (get_section_contents): Handle relocation pointing to section
10217 with no object or shndx information.
10218 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10219 * testsuite/Makefile.in: Regenerate.
10220 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10221 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10222
10223 2010-04-22 Ian Lance Taylor <iant@google.com>
10224
10225 * expression.cc (Expression::Expression_eval_info): Add
10226 result_alignment_pointer field.
10227 (Expression::eval_with_dot): Add result_alignment_pointer
10228 parameter. Change all callers.
10229 (Expression::eval_maybe_dot): Likewise.
10230 (class Binary_expression): Add alignment_pointer parameter to
10231 left_value and right_value. Change all callers.
10232 (BINARY_EXPRESSION): Set result alignment.
10233 (class Trinary_expression): Add alignment_pointer parameter to
10234 arg2_value and arg3_value. Change all callers.
10235 (Trinary_cond::value): Set result alignment.
10236 (Max_expression::value, Min_expression::value): Likewise.
10237 (Align_expression::value): Likewise.
10238 * script-sections.cc (class Sections_element): Add dot_alignment
10239 parameter to set_section_addresses virtual function. Update
10240 instantiations.
10241 (class Output_section_element): Likewise.
10242 (Script_sections::create_segments): Add dot_alignment parameter.
10243 Change all callers.
10244 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10245 (Script_sections::set_phdrs_clause_addresses): Likewise.
10246 * script-sections.h: Update declarations.
10247 * script.h: Update declarations.
10248 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10249 min_p_align.
10250 * testsuite/script_test_3.t: Set large alignment.
10251 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10252 segment has expected alignment.
10253
10254 2010-04-22 Nick Clifton <nickc@redhat.com>
10255
10256 * po/gold.pot: Updated by the Translation project.
10257 * po/vi.po: Updated Vietnamese translation.
10258
10259 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10260
10261 * testsuite/Makefile.am (check_PROGRAMS): Add
10262 icf_virtual_function_folding_test.
10263 * testsuite/Makefile.in: Regenerated.
10264
10265 2010-04-15 Andrew Haley <aph@redhat.com>
10266
10267 * options.h (merge_exidx_entries): New option.
10268 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10269 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10270 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10271 (Target_arm::merge_exidx_entries): New function.
10272 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10273 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10274 to Arm_exidx_fixup constructor.
10275 Add new arg, merge_exidx_entries.
10276 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10277 Arm_output_section::fix_exidx_coverage.
10278
10279 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10280
10281 * icf.cc (get_section_contents): Check for preemptible functions.
10282 Ignore addend when appropriate.
10283 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10284 section folded.
10285 (add_from_relobj): Check for section folded.
10286 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10287 * symtab.h (should_add_dynsym_entry): Add new parameter.
10288 * target-reloc.h (scan_relocs): Check for section folded.
10289 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10290 Check reloc types for function pointers in shared objects.
10291 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10292 case.
10293 (icf_preemptible_functions_test): New test case.
10294 (icf_string_merge_test): New test case.
10295 * testsuite.Makefile.in: Regenerate.
10296 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10297 bar_glob. Refactor code.
10298 * testsuite/icf_preemptible_functions_test.cc: New file.
10299 * testsuite/icf_preemptible_functions_test.sh: New file.
10300 * testsuite/icf_string_merge_test.cc: New file.
10301 * testsuite/icf_string_merge_test.sh: New file.
10302 * testsuite/icf_virtual_function_folding_test.cc: New file.
10303 * testsuite/icf_virtual_function_folding_test.sh: New file.
10304
10305 2010-04-14 Doug Kwan <dougkwan@google.com>
10306
10307 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10308 for local symbol recounting if we remove a section due to ICF.
10309 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10310 there are no regular objects in input.
10311
10312 2010-04-13 Doug Kwan <dougkwan@google.com>
10313
10314 * arm.cc (Arm_input_section::set_final_data_size): Compute
10315 accurate final data size instead of using current data size.
10316
10317 2010-04-09 Doug Kwan <dougkwan@google.com>
10318
10319 * layout.cc (Layout::choose_output_section): Handle script section
10320 types.
10321 (Layout::make_output_section_for_script): Add section type parameter.
10322 Handle script section types.
10323 * layout.h (Layout::make_output_section_for_script): Add section
10324 type parameter.
10325 * output.cc (Output_section::Output_section): Initialize data member
10326 is_noload_.
10327 (Output_section::do_reset_address_and_file_offset): Do not set address
10328 to 0 if section is a NOLOAD section.
10329 * output.h (Output_section::is_noload): New method.
10330 (Output_section::set_is_noload): Ditto.
10331 (Output_section::is_noload_): New data member.
10332 * script-c.h (Script_section_type): New enum type.
10333 (struct Parser_output_section_header): Add new file section_type.
10334 * script-sections.cc (Sections_element::output_section_name): Add
10335 parameter for returning script section type.
10336 (Output_section_definition::output_section_name): Ditto.
10337 (Output_section_definition::section_type)P; New method.
10338 (Output_section_definiton::script_section_type_name): Ditto.
10339 (Output_section_definition::script_section_type_): New data member.
10340 (Output_section_definition::Output_section_definition): Initialize
10341 data member Output_section_definition::script_section_type_.
10342 (Output_section_definition::create_sections): Pass script section type
10343 to Layout::make_output_section_for_script.
10344 (Output_section_definition::output_section_name): Return script
10345 section type to caller.
10346 (Output_section_definition::set_section_address): Do not advance
10347 dot value and load address if section type is NOLOAD. Set address
10348 of NOLOAD sections regardless of section flags.
10349 (Output_section_definition::print): Print section type if it is
10350 not SCRIPT_SECTION_TYPE_NONE.
10351 (Output_section_definition::section_type): New method.
10352 (Output_section_definition::script_section_type_name): Ditto.
10353 (Script_sections::output_section_name): Add new parameter
10354 PSECTION_TYPE for returning script section type. Pass it to
10355 section elements. Handle discard sections.
10356 (Sort_output_sections::operator()): Handle NOLOAD sections.
10357 * script-sections.h (Script_sections::Section_type): New enum type.
10358 (Script_sections::output_section_name): Add a new parameter for
10359 returning script section type.
10360 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10361 INFO and NOLOAD.
10362 * yyscript.y (union): Add new field SECTION_TYPE.
10363 (COPY, DSECT, INFO, NOLOAD): New tokens.
10364 (opt_address_and_section_type): Change type to output_section_header.
10365 (section_type): New non-terminal
10366 (section_header): Handle section type.
10367 (opt_address_and_section_type): Return section type value.
10368
10369 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10370
10371 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10372 * testsuite/plugin_common_test_2.c (foo): Likewise.
10373
10374 2010-04-08 Doug Kwan <dougkwan@google.com>
10375
10376 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10377 Output_merge_data.
10378 * output.cc (Output_section::add_merge_input_section): Simplify
10379 code and return status of Output_merge_base::add_input_section.
10380 Update merge section map only if Output_merge_base::add_input_section
10381 returns true.
10382
10383 2010-04-07 Doug Kwan <dougkwan@google.com>
10384
10385 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10386 if section is marked as containing instructions but has no mapping
10387 symbols.
10388 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10389 correct section index.
10390 (Arm_relobj::find_linked_text_section): Ditto.
10391
10392 2010-04-07 Cary Coutant <ccoutant@google.com>
10393
10394 * archive.cc (include_member): Destroy Read_symbols_data object before
10395 releasing file.
10396 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10397 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10398 (Read_symbols_data::~Read_symbols_data) New destructor.
10399 (Section_relocs::Section_relocs) New constructor.
10400 (Section_relocs::~Section_relocs) New destructor.
10401 (Read_relocs_data::Read_relocs_data) New constructor.
10402 (Read_relocs_data::~Read_relocs_data) New destructor.
10403 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10404 pointers to NULL after deleting.
10405
10406 2010-04-07 Doug Kwan <dougkwan@google.com>
10407
10408 * arm.cc: Replace "endianity" with "endianness" in comments.
10409 (Arm_exidx_cantunwind): Ditto.
10410 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10411 (Arm_relobj::merge_flags_and_attributes): New method.
10412 (Arm_relobj::merge_flags_and_attributes_): New data member.
10413 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10414 (Arm_relobj::scan_sections_for_stubs): Ditto.
10415 (Arm_relobj::do_read_symbols): Check to see if we really want to
10416 merge processor-specific flags and attributes. Exit early if
10417 an object is empty except for section names and the undefined symbol.
10418 (Target_arm::do_finalize_sections): Move check for ELF format to
10419 Arm_relobj::do_read_symbols. Merge processor specific flags and
10420 attributes from a regular object only when we have determined that
10421 it is aapropriate. Do not create an .ARM.attributes section in
10422 output if there is no regular input object.
10423 (Target_arm::merge_processor_specific_flags): Check
10424 --warn-mismatch before printing any error.
10425 (Target_arm::merge_object_attributes): Ditto.
10426 * gold.cc (queue_middle_tasks): Handle the case in which there is
10427 no regular object in input.
10428 * options.cc (General_options::parse_EB): New method.
10429 (General_options::parse_EL): Same.
10430 (General_options::General_options): Initialize endianness_.
10431 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10432 New options.
10433 (General_options::Endianness): New enum.
10434 (General_options::endianness): New method.
10435 (General_options::endianness_): New data member.
10436 * parameters.cc (Parameters::set_options): Check target endianness.
10437 (Parameters::set_target_once): Ditto.
10438 (Parameters::check_target_endianness): New method.
10439 (parameters_force_valid_target): If either -EL or -EB is specified,
10440 use it to define endianness of default target.
10441 * parameters.h (Parameters::check_target_endianness): New method
10442 declaration.
10443 * target.h (class Target): Change "endianity" to "endianness"
10444 in comments.
10445
10446 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10447
10448 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10449 * configure: Regenerate.
10450 * Makefile.in: Regenerate.
10451 * testsuite/Makefile.in: Regenerate.
10452
10453 2010-04-06 Cary Coutant <ccoutant@google.com>
10454
10455 gcc PR lto/42757
10456 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10457 prevailing definitions of common symbols.
10458 * testsuite/plugin_test_6.sh: New test case.
10459 * testsuite/plugin_common_test_1.c: New test case.
10460 * testsuite/plugin_common_test_2.c: New test case.
10461 * testsuite/Makefile.am (plugin_test_6): New test case.
10462 * testsuite/Makefile.in: Regenerate.
10463
10464 2010-04-06 Nick Clifton <nickc@redhat.com>
10465
10466 * po/vi.po: New Vietnamese translation.
10467
10468 2010-03-30 Doug Kwan <dougkwan@google.com>
10469
10470 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10471
10472 2010-03-25 Doug Kwan <dougkwan@google.com>
10473
10474 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10475 to avoid a conversion warning on a 32-bit host.
10476
10477 2010-03-24 Ian Lance Taylor <iant@google.com>
10478
10479 * testsuite/script_test_3.t: Add a TLS segment.
10480 * testsuite/Makefile.am (check_PROGRAMS): Add
10481 tls_phdrs_script_test.
10482 (tls_phdrs_script_test_SOURCES): Define.
10483 (tls_phdrs_script_test_DEPENDENCIES): Define.
10484 (tls_phdrs_script_test_LDFLAGS): Define.
10485 (tls_phdrs_script_test_LDADD): Define.
10486 * testsuite/Makefile.in: Rebuild.
10487
10488 2010-03-23 Cary Coutant <ccoutant@google.com>
10489
10490 * fileread.cc (find_or_make_view): Fix comment.
10491
10492 2010-03-23 Ian Lance Taylor <iant@google.com>
10493
10494 * script-sections.cc (class Orphan_section_placement): Define
10495 PLACE_TLS and PLACE_TLS_BSS.
10496 (Orphan_section_placement::Orphan_section_placement): Initialize
10497 new places.
10498 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10499 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10500 (tls_script_test_SOURCES): Define.
10501 (tls_script_test_DEPENDENCIES): Define.
10502 (tls_script_test_LDFLAGS): Define.
10503 (tls_script_test_LDADD): Define.
10504 * testsuite/Makefile.in: Rebuild.
10505
10506 2010-03-22 Doug Kwan <dougkwan@google.com>
10507
10508 * arm.cc (Arm_relocate_functions::abs8,
10509 Arm_relocate_functions::abs16): Use correct check for overflow
10510 specified in the ARM ELF specs.
10511 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10512 target of a BLX instruction specially.
10513 (Reloc_stub::stub_type_for_reloc): Ditto.
10514 (Relocate::relocate): Use symbolic names instead of numeric relocation
10515 codes to report error.
10516 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10517 workaround.
10518 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10519 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10520 thumb2_blx_out_of_range.stdout
10521 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10522 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10523 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10524 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10525 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10526 thumb2_blx_in_range, thumb2_blx_in_range.o,
10527 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10528 thumb2_blx_out_of_range.o): New rules.
10529 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10530 thumb2_blx_in_range and thumb2_blx_out_of_range.
10531 * testsuite/Makefile.in: Regenerate.
10532 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10533 * testsuite/thumb_blx_in_range.s: New file.
10534 * testsuite/thumb_blx_out_of_range.s: New file.
10535
10536 2010-03-22 Rafael Espindola <espindola@google.com>
10537
10538 * archive.cc (Should_include): Move to archive.h.
10539 (should_include_member): Make it a member of Archive.
10540 (Lib_group): New.
10541 (Add_lib_group_symbols): New.
10542 * archive.h: Include options.h.
10543 (Archive_member): Moved from Archive.
10544 (Should_include): Moved from archive.cc.
10545 (Lib_group): New.
10546 (Add_lib_group_symbols): New.
10547 * dynobj.cc (do_should_include_member): New.
10548 * dynobj.h (do_should_include_member): New.
10549 * gold.cc (queue_initial_tasks): Update call to queue.
10550 * main.cc (main): Print lib group stats.
10551 * object.cc (do_should_include_member): New.
10552 * object.h: Include archive.h.
10553 (Object::should_include_member): New.
10554 (Object::do_should_include_member): New.
10555 (Sized_relobj::do_should_include_member): New.
10556 * options.cc (General_options::parse_start_lib): New.
10557 (General_options::parse_end_lib): New.
10558 (Input_arguments::add_file): Handle lib groups.
10559 (Input_arguments::start_group): Check we are not in a lib.
10560 (Input_arguments::start_lib): New.
10561 (Input_arguments::end_lib): New.
10562 * options.h (General_options): Add start_lib and end_lib.
10563 (Input_argument::lib_): New.
10564 (Input_argument::lib): New.
10565 (Input_argument::is_lib): New.
10566 (Input_file_lib): New.
10567 (Input_arguments::in_lib_): New.
10568 (Input_arguments::in_lib): New.
10569 (Input_arguments::start_lib): New.
10570 (Input_arguments::end_lib_): New.
10571 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10572 in unused members as preempted.
10573 (Sized_pluginobj::do_should_include_member): New.
10574 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10575 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10576 return the blocker.
10577 (Read_symbols::do_whole_lib_group): New.
10578 (Read_symbols::do_lib_group): New.
10579 (Read_symbols::do_read_symbols): Handle lib groups.
10580 (Read_symbols::get_name): Handle lib groups.
10581 * readsyms.h (Read_symbols): Add an archive member pointer.
10582 (Read_symbols::do_whole_lib_group): New.
10583 (Read_symbols::do_lib_group): New.
10584 (Read_symbols::member_): New.
10585 * script.cc (read_input_script): Update call to queue_soon.
10586
10587 2010-03-19 Doug Kwan <dougkwan@google.com>
10588
10589 * arm.cc (Stub_table::Stub_table): Initialize new data members
10590 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10591 (Stub_table::add_reloc_stub): Assign stub offset and update
10592 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10593 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10594 New data members.
10595 (Stub_table::update_data_size_and_addralign): Use
10596 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10597 instead of going over all reloc stubs.
10598 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10599 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10600 Stringpool_template::offset_ to size of Stringpool_char.
10601 (Stringpool_template::new_key_offset): Remove code to initialize
10602 Stringpool_template::offset_.
10603 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10604 Stringpool_template::offset_ to zero.
10605
10606 2010-03-15 Doug Kwan <dougkwan@google.com>
10607
10608 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10609 offset_.
10610 (Stringpool_template::new_key_offset): New method.
10611 (Stringpool_template::add_string): Assign offsets when adding new
10612 strings.
10613 (Stringpool_template::set_string_offsets): Do not set string offsets
10614 when not optimizing.
10615 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10616 member size_.
10617 (Chunked_vector::clear): Clear size_.
10618 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10619 (Chunked_vector::size): Return size_.
10620 (Chunked_vector::push_back): Use size_ to find insert position.
10621 (Chunked_vector::size_): New data member.
10622 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10623 (Stringpool_template::new_key_offset): New method declaration.
10624 (Stringpool_template::offset_): New data member.
10625
10626 2010-03-15 Rafael Espindola <espindola@google.com>
10627
10628 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10629 Add_symbols' constructor.
10630 * readsyms.h (Add_symbols): Remove the input_group member.
10631
10632 2010-03-10 Ian Lance Taylor <iant@google.com>
10633
10634 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10635 target to ask whether a reference to a symbol requires a stack
10636 split.
10637 * target.h (Target::is_call_to_non_split): New function.
10638 (Target::do_is_call_to_non_split): Declare virtual function.
10639 * target.cc: Include "symtab.h".
10640 (Target::do_is_call_to_non_split): New function.
10641 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10642
10643 2010-03-10 Cary Coutant <ccoutant@google.com>
10644
10645 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10646 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10647 (File_read::open[2]): Add whole_file_view_ to list of views.
10648 (File_read::make_view): Remove test of whole_file_view_.
10649 (File_read::find_or_make_view): Create whole_file_view_ if
10650 necessary.
10651 (File_read::clear_views): Replace bool parameter with enum;
10652 adjust all callers. Don't delete views with permanent data;
10653 do delete cached views and views from archives if
10654 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10655 if clearing the corresponding view.
10656 * fileread.h (File_read::Clear_views_mode): New enum.
10657 (File_read::View::is_permanent_view): New method.
10658 (File_read::clear_views): Replace bool parameter
10659 with enum; adjust all callers.
10660 * options.h (General_options): Change keep_files_mapped option;
10661 add map_whole_files.
10662 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10663 releasing the file.
10664 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10665 the file.
10666
10667 2010-03-10 David S. Miller <davem@davemloft.net>
10668
10669 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10670
10671 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10672
10673 * icf.cc (get_section_contents): Add '@' marker after processing the
10674 merge reloc.
10675
10676 2010-03-08 Doug Kwan <dougkwan@google.com>
10677
10678 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10679 due to a conversion warning.
10680 (Arm_relobj::update_output_local_symbol_count): Check for local
10681 symbol with unset output index.
10682
10683 2010-03-05 Ian Lance Taylor <iant@google.com>
10684
10685 * options.h (class General_options): Add --spare-dynamic-tags.
10686 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10687 --spare-dynamic-tags.
10688
10689 2010-03-05 Ian Lance Taylor <iant@google.com>
10690
10691 * incremental.cc: Include "libiberty.h".
10692
10693 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10694
10695 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10696 function, is_info_ member.
10697 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10698 (Versions::Versions): Update caller.
10699 (Versions::define_base_version): Likewise.
10700 (Versions::add_def): Likewise.
10701
10702 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10703
10704 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10705 (Scan::possible_function_pointer_reloc): New function.
10706 (Scan::local_reloc_may_be_function_pointer): Change to call
10707 possible_function_pointer_reloc.
10708 (Scan::global_reloc_may_be_function_pointer): Ditto.
10709 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10710 relocations in ".data.rel.ro._ZTV" section.
10711 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10712 * testsuite/icf_safe_so_test.cc: Ditto.
10713 * testsuite/icf_safe_test.cc: Ditto.
10714 * testsuite/icf_safe_test.sh: Ditto.
10715
10716 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10717 Ian Lance Taylor <iant@google.com>
10718
10719 * target-reloc.h (relocate_section): Check the symbol table index
10720 for -1U before setting the local symbol index.
10721 (scan_relocatable_relocs): If copying the relocation, record that
10722 the local symbol is required.
10723 * object.h (Symbol_value::is_output_symtab_index_set): New
10724 function.
10725 (Symbol_value::may_be_discarded_from_output_symtab): New
10726 function.
10727 (Symbol_value::has_output_symtab_entry): New function.
10728 (Symbol_value::needs_output_symtab_entry): Remove.
10729 (Symbol_value::output_symtab_index): Make sure the symbol index is
10730 set.
10731 (Symbol_value::set_output_symtab_index): Make sure the symbol
10732 index is not set. Make sure the new index is valid.
10733 (Symbol_value::set_must_have_output_symtab_entry): New function.
10734 (Symbol_value::has_output_dynsym_entry): New function.
10735 (Symbol_value::set_output_dynsym_index): Make sure the new index
10736 is valid.
10737 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10738 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10739 local symbol if permitted.
10740 (Sized_relobj::do_finalize_local_symbols): Call
10741 is_output_symtab_index_set rather than needs_output_symtab_entry.
10742 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10743 rather than needs_output_symtab_entry. Call
10744 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10745 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10746 is_output_symtab_index_set rather than needs_output_symtab_entry.
10747 * testsuite/discard_locals_relocatable_test.c: New file.
10748 * testsuite/discard_locals_test.sh: Test -r.
10749 * testsuite/Makefile.am (check_DATA): Add
10750 discard_locals_relocatable_test1.syms,
10751 discard_local_relocatable_test2.syms.
10752 (MOSTLYCLEANFILES): Likewise. Also add
10753 discard_locals_relocatable_test1.lout and
10754 discard_locals_relocatable_test2.out.
10755 (discard_locals_relocatable_test1.syms): New target.
10756 (discard_locals_relocatable_test.o): New target.
10757 (discard_locals_relocatable_test1.out): New target.
10758 (discard_locals_relocatable_test2.syms): New target.
10759 (discard_locals_relocatable_test2.out): New target.
10760 (various): Add missing ../ld-new dependencies.
10761 * testsuite/Makefile.in: Rebuild.
10762
10763 2010-03-03 Nick Clifton <nickc@redhat.com>
10764
10765 * po/fi.po: New Finnish translation.
10766
10767 2010-03-01 Doug Kwan <dougkwan@google.com>
10768
10769 * layout.cc (Layout::Layout): Force section types of .init_array*,
10770 .preinit_array* and .fini_array* sections.
10771 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10772 Fix check of return value of std::string::find.().
10773 (Output_section::Input_section_sort_compare::operator()): Remove
10774 comment about .init_array.
10775 (Output_section::Input_section_sort_init_fini_compare::operator()):
10776 New method.
10777 (Output_section::sort_attached_input_sections): Handle .init_array
10778 and .fini_array specially.
10779 * output.h (Output_section::Inut_section_sort_compare): Update
10780 comment.
10781 (Output_section::Input_section_sort_init_fini_compare): New struct.
10782
10783 2010-02-26 Doug Kwan <dougkwan@google.com>
10784
10785 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10786 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10787 * testsuite/debug_msg.sh: Avoid matching source line number for
10788 use of global variable undef_int.
10789
10790 2010-02-26 Doug Kwan <dougkwan@google.com>
10791
10792 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10793 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10794 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10795 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10796 * options.cc (General_options::General_options): Initialize member
10797 fix_v4bx_.
10798 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10799 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10800 and rm_no_fix_v4bx.stdout
10801 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10802 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10803 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10804 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10805 and arm_no_fix_v4bx.
10806 * Makefile.in: Regenerate.
10807 * testsuite/arm_fix_v4bx.s: New file.
10808 * testsuite/arm_fix_v4bx.sh: Ditto.
10809
10810 2010-02-24 Doug Kwan <dougkwan@google.com>
10811
10812 * arm.cc (Target_arm::got_section): Make the .got section the first
10813 non RELRO section in the data segment.
10814 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10815 suffixes of section names.
10816
10817 2010-02-24 Doug Kwan <dougkwan@google.com>
10818
10819 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10820 flags and attributes merging if an input file is a binary file.
10821 * fileread.cc (Input_file::open): Record format of original file.
10822 * fileread.h (Input_file::Format): New enum type.
10823 (Input_file::Input_file): Initialize data member format_.
10824 (Input_file::format): New method definition.
10825 (Input_file::format_):: New data member.
10826
10827 2010-02-24 Doug Kwan <dougkwan@google.com>
10828
10829 * arm.cc (Arm_output_data_got): New class.
10830 (ARM_TCB_SIZE): New constant
10831 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10832 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10833 If user uses a script with a SECTIONS clause, issue only a warning
10834 for a misplaced EXIDX input section. Otherwise, issue an error.
10835 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10836 garbage collection.
10837 (Target_arm::got_mode_index_entry): Handle static linking.
10838 (Target_arm::Scan::local): Ditto.
10839 (Target_arm::Scan::global): Ditto.
10840 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10841 all incorrectly implemented relocations.
10842 (Target_arm::fix_exidx_coverage): Pass layout to
10843 Arm_output_section::fix_exidx_coverage.
10844 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10845 from ".ARM.exidx." and ".ARM.extab.".
10846
10847 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10848
10849 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10850 section if it does not already exist.
10851 * attributes.cc (Attributes_section_data::Attributes_section_data):
10852 Don't crash if size is zero.
10853
10854 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10855 Ian Lance Taylor <iant@google.com>
10856
10857 * gold.cc (queue_middle_tasks): If no input files were opened,
10858 exit.
10859 * workqueue.h (Task_function::Task_function): Assert that there is
10860 a blocker.
10861
10862 2010-02-22 Doug Kwan <dougkwan@google.com>
10863
10864 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10865 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10866 types to avoid warnings due to different uint64_t implementations
10867 on different hosts.
10868
10869 2010-02-21 Doug Kwan <dougkwan@google.com>
10870
10871 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10872 handling of the maximum backward branch offset.
10873 (Arm_relocate_functions::thumb_branch_common): Ditto.
10874 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10875 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10876 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10877 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10878 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10879 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10880 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10881 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10882 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10883 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10884 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10885 thumb2_bl_out_of_range.o): New rules.
10886 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10887 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10888 thumb2_bl_out_of_range
10889 * testsuite/Makefile.in: Regenerate.
10890 * testsuite/arm_bl_in_range.s: New file.
10891 * testsuite/arm_bl_out_of_range.s: Ditto.
10892 * testsuite/arm_branch_in_range.sh: Ditto.
10893 * testsuite/arm_branch_range.t: Ditto.
10894 * testsuite/thumb2_branch_range.t: Ditto.
10895 * testsuite/thumb_bl_in_range.s: Ditto.
10896 * testsuite/thumb_bl_out_of_range.s: Ditto.
10897 * testsuite/thumb_branch_range.t: Ditto.
10898
10899 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10900
10901 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10902 Add reloc offset information.
10903 * icf.cc (get_section_contents): Change iterators to point to the new
10904 vectors. Add reloc offset information to the contents.
10905 * icf.h (Icf::Sections_reachable_info): New typedef.
10906 (Icf::Sections_reachable_list): New typedef.
10907 (Icf::Offset_info): New typedef.
10908 (Icf::Reloc_info): New struct typedef.
10909 (Icf::Reloc_info_list): New typedef.
10910 (Icf::symbol_reloc_list): Delete method.
10911 (Icf::addend_reloc_list): Delete method.
10912 (Icf::section_reloc_list): Delete method.
10913 (Icf::reloc_info_list): New method.
10914 (Icf::reloc_info_list_): New member.
10915
10916 2010-02-19 Doug Kwan <dougkwan@google.com>
10917
10918 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10919 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10920 * arm.cc (Arm_relocation_functions): New forward declaration.
10921 (Target_arm::Target_arm): Initialize new data members
10922 got_mod_index_offset_ and tls_base_symbol_defined_.
10923 (Target_arm::Relocate::relocate_tls): New method.
10924 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10925 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10926 New methods.
10927 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10928 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10929 (Target_arm::got_mod_index_offset_,
10930 Target_arm::tls_base_symbol_defined_): New data members.
10931 (Target_arm::Scan::local, Target::Scan::global,
10932 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10933 relocations.
10934
10935 2010-02-18 Doug Kwan <dougkwan@google.com>
10936
10937 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10938 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10939 text section as a parameter becuase some broken tools may not set
10940 the link in section header.
10941 (Target_arm::has_got_section): New method.
10942 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10943 without any mapping symbol as data only. Remove warning.
10944 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10945 link in its section header, try to discover the link by inspecting the
10946 REL31 relocation at the beginning of the section.
10947 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10948 in error message.
10949 (Target_arm::Scan::global): Treat any reference to the symbol
10950 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10951
10952 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10953
10954 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10955 (Scan::global_reloc_may_be_function_pointer): New function.
10956 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10957 (Scan::global_reloc_may_be_function_pointer): New function.
10958 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10959 (Scan::global_reloc_may_be_function_pointer): New function.
10960 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10961 (Scan::global_reloc_may_be_function_pointer): New function.
10962 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10963 (Scan::global_reloc_may_be_function_pointer): New function.
10964 (Scan::possible_function_pointer_reloc): New function.
10965 (Target_x86_64::can_check_for_function_pointers): New function.
10966 * gc.h (gc_process_relocs): Scan relocation types to determine if
10967 function pointers were taken for targets that support it.
10968 * icf.cc (Icf::find_identical_sections): Include functions for
10969 folding in safe ICF whose pointer is not taken.
10970 * icf.h (Secn_fptr_taken_set): New typedef.
10971 (fptr_section_id_): New member.
10972 (section_has_function_pointers): New function.
10973 (set_section_has_function_pointers): New function.
10974 (check_section_for_function_pointers): New function.
10975 * options.h: Fix comment for safe ICF option.
10976 * target.h (can_check_for_function_pointers): New function.
10977 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10978 Modify icf_safe_test for X86-64.
10979 * testsuite/Makefile.in: Regenerate.
10980 * testsuite/icf_safe_so_test.cc: New file.
10981 * testsuite/icf_safe_so_test.sh: New file.
10982 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10983 (main): Change to take pointer to function kept_func_3.
10984 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10985 folding is done correctly for X86-64.
10986
10987 2010-02-12 David S. Miller <davem@davemloft.net>
10988
10989 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10990 is_symbolless parameter.
10991 (Output_reloc<SHT_REL>::is_symbolless): New.
10992 (Output_reloc<SHT_REL>::is_symbolless_): New.
10993 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10994 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10995 (Output_reloc<SHT_RELA>::is_symbolless): New.
10996 (Output_data_reloc::add_global): Handle is_symbolless.
10997 (Output_data_reloc::add_global_relative): Likewise.
10998 (Output_data_reloc::add_local): Likewise.
10999 (Output_data_reloc::add_local_relative): Likewise.
11000 (Output_data_reloc::add_symbolless_global_addend): New.
11001 (Output_data_reloc::add_symbolless_local_addend): New.
11002 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11003 is_symbolless.
11004 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11005 instead of ->is_relative_
11006 (Output_reloc::write): Likewise.
11007 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11008 (Output_reloc::write_rel): Simplify.
11009
11010 * sparc.cc (Target_sparc::Scan::local): Use
11011 ->add_symbolless_local_addend as needed.
11012 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11013 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11014 based upon relocation offset.
11015
11016 2010-02-11 Doug Kwan <dougkwan@google.com>
11017
11018 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11019 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11020 beginning of function.
11021 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11022 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11023 parameter is_32bit in calls to should_apply_static_reloc.
11024 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11025 (check_DATA): Add arm_abs_global.stdout.
11026 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11027 arm_abs_global.stdout): New rules.
11028 (MOSTLLYCLEANFILES): Add arm_abs_global
11029 * Makefile.in: Regenerate.
11030 * testsuite/arm_abs_global.s: New file.
11031 * testsuite/arm_abs_global.sh: Ditto.
11032 * testsuite/arm_abs_lib.s: Ditto.
11033
11034 2010-02-11 Ian Lance Taylor <iant@google.com>
11035
11036 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11037 Read_relocs task.
11038 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11039 Allocate_commons_task first.
11040 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11041 task, rather than symtab_lock_.
11042 (Gc_process_relocs::~Gc_process_relocs): New function.
11043 (Gc_process_relocs::is_runnable): Check this_blocker_.
11044 (Gc_process_relocs::locks): Use next_blocker_ rather than
11045 blocker_.
11046 (Scan_relocs::~Scan_relocs): New function.
11047 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11048 symtab_lock_.
11049 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11050 next_blocker_.
11051 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11052 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11053 constructor accordingly.
11054 (class Gc_process_relocs): Likewise.
11055 (class Scan_relocs): Likewise.
11056 * common.h (class Allocate_commons_task): Remove symtab_lock_
11057 field, and corresponding constructor parameter.
11058 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11059 symtab_lock_.
11060 (Allocate_commons_task::locks): Likewise.
11061
11062 2010-02-11 Ian Lance Taylor <iant@google.com>
11063
11064 * gold-threads.h (class Once): Define.
11065 (class Initialize_lock): Rewrite as child of Once.
11066 * gold-threads.cc (class Once_initialize): Define.
11067 (once_pointer_control): New static variable.
11068 (once_pointer, once_arg): New static variables.
11069 (c_run_once): New static function.
11070 (Once::Once, Once::run_once, Once::internal_run): New functions.
11071 (class Initialize_lock_once): Remove.
11072 (initialize_lock_control): Remove.
11073 (initialize_lock_pointer): Remove.
11074 (initialize_lock_once): Remove.
11075 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11076 (Initialize_lock::initialize): Rewrite.
11077 (Initialize_lock::do_run_once): New function.
11078 * archive.cc (Archive::interpret_header): Only clear name if it is
11079 not already empty.
11080 * fileread.cc: Include "gold-threads.h"
11081 (file_counts_lock): New static variable.
11082 (file_counts_initialize_lock): Likewise.
11083 (File_read::release): Only increment counts when using --stats.
11084 Use a lock around the increment.
11085 * parameters.cc (class Set_parameters_target_once): Define.
11086 (set_parameters_target_once): New static variable.
11087 (Parameters::Parameters): Move here from parameters.h.
11088 (Parameters::set_target): Rewrite.
11089 (Parameters::set_target_once): New function.
11090 (Parameters::clear_target): Move here and rewrite.
11091 * parameters.h (class Parameters): Update declarations. Add
11092 set_parameters_target_once_ field.
11093 (Parameters::Parameters): Move to parameters.cc.
11094 (Parameters::clear_target): Likewise.
11095 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11096 task.
11097 (Start_group::~Start_group): New function.
11098 (Start_group::is_runnable): New function.
11099 (Start_group::locks, Start_group::run): New functions.
11100 (Finish_group::run): Change saw_undefined to size_t.
11101 * readsyms.h (class Start_group): Define.
11102 (class Finish_group): Change saw_undefined_ field to size_t.
11103 (Finish_group::Finish_group): Remove saw_undefined and
11104 this_blocker parameters. Change all callers.
11105 (Finish_group::set_saw_undefined): New function.
11106 (Finish_group::set_blocker): New function.
11107 * symtab.h (class Symbol_table): Change saw_undefined to return
11108 size_t. Change saw_undefined_ field to size_t.
11109 * target-select.cc (Set_target_once::do_run_once): New function.
11110 (Target_selector::Target_selector): Initialize set_target_once_
11111 field. Don't initialize lock_ and initialize_lock_ fields.
11112 (Target_selector::instantiate_target): Rewrite.
11113 (Target_selector::set_target): New function.
11114 * target-select.h (class Set_target_once): Define.
11115 (class Target_selector): Update declarations. Make
11116 Set_target_once a friend. Remove lock_ and initialize_lock_
11117 fields. Add set_target_once_ field.
11118
11119 2010-02-10 Ian Lance Taylor <iant@google.com>
11120
11121 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11122 queueing any tasks.
11123 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11124 (queue_middle_tasks): Add all blockers before queueing any tasks.
11125 (queue_final_tasks): Likewise.
11126 * token.h (Task_token::add_blockers): New function.
11127 * object.h (Input_objects::number_of_relobjs): New function.
11128
11129 2010-02-10 Ian Lance Taylor <iant@google.com>
11130
11131 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11132 shared, not if not position independent.
11133 * x86_64.cc (Relocate::relocate_tls): Likewise.
11134 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11135 (tls_pie_pic_test): New target.
11136 * testsuite/Makefile.in: Rebuild.
11137
11138 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11139 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11140 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11141 * testsuite/Makefile.in: Rebuild.
11142
11143 2010-02-09 David S. Miller <davem@davemloft.net>
11144
11145 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11146 R_SPARC_RELATIVE using ->add_local_relative().
11147 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11148
11149 * output.h (Output_data_dynamic::add_section_size): New method
11150 that takes two Output_data objects.
11151 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11152 entry param. Handle it in initializers.
11153 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11154 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11155 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11156 arg.
11157 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11158 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11159 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11160 for dynrel_includes_plt.
11161 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11162 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11163 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11164 before .rela.plt
11165 (Target_sparc::do_finalize_sections): Update to pass true for
11166 dynrel_includes_plt.
11167 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11168 output before .rela.plt
11169 (Target_powerpc::do_finalize_sections): Update to pass true for
11170 dynrel_includes_plt when 32-bit.
11171
11172 2010-02-08 Doug Kwan <dougkwan@google.com>
11173
11174 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11175 method.
11176 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11177 Arm_relobj::scan_section_for_cortex_a8_stubs,
11178 Arm_relobj::do_relocation_section): Instead of calling
11179 Output_section::output_address, use faster
11180 Arm_relobj::simple_input_section_output_address.
11181
11182 2010-02-08 David S. Miller <davem@davemloft.net>
11183
11184 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11185 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11186 relocation helper function.
11187
11188 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11189 just like R_SPARC_GOT{10,13,22}.
11190 (Target_sparc::Scan::local): Likewise.
11191 (Target_sparc::Relocate:relocate): Likewise.
11192
11193 2010-02-06 Ian Lance Taylor <iant@google.com>
11194
11195 * configure.ac: Rewrite targetobjs duplicate removal code to use
11196 only shell constructs.
11197 * configure: Rebuild.
11198
11199 2010-02-05 Doug Kwan <dougkwan@google.com>
11200
11201 PR 11247
11202 * arm.cc (Arm_relobj::section_is_scannable): New method.
11203 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11204 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11205
11206 2010-02-04 Doug Kwan <dougkwan@google.com>
11207
11208 PR 11247
11209 * arm-reloc-property.cc (cstdio): Include.
11210 * configure.ac (targetobjs): Remove duplicates.
11211 * configure: Regenerate.
11212 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11213 big and little endian version for a given address size.
11214
11215 2010-02-03 Doug Kwan <dougkwan@google.com>
11216
11217 * arm-reloc-property.cc
11218 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11219 definition.
11220 * arm-reloc-property.h
11221 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11222 New method definition.
11223 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11224 declaration.
11225 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11226 overflow to N.
11227 (GOT_PREL): Change implemented to Y.
11228 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11229 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11230 (Arm_relocate_functions::movw_abs_nc): Remove method.
11231 (Arm_relocate_functions::movt_abs): Ditto.
11232 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11233 (Arm_relocate_functions::thm_movt_abs): Ditto.
11234 (Arm_relocate_functions::movw_rel_nc): Ditto.
11235 (Arm_relocate_functions::movw_rel): Ditto.
11236 (Arm_relocate_functions::movt_rel): Ditto.
11237 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11238 (Arm_relocate_functions:thm_movw_rel): Ditto.
11239 (Arm_relocate_functions:thm_movt_rel): Ditto.
11240 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11241 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11242 New method definitions.
11243 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11244 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11245 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11246 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11247 (Target_arm::Relocate::relocate): Check for non-static or
11248 unimplemented relocation code and exit early. Change calls to
11249 Target_arm::reloc_uses_thumb_bit and
11250 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11251 instead. Refactor code to handle similar relocations to increase
11252 code sharing. Remove check for unsupported relocation code in switch
11253 statement.
11254 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11255 relocation property table to find out size. Change error message to
11256 print out the name of a relocation code instead of the numeric value.
11257 (Target_arm::scan_reloc_for_stub): Use relocation property table
11258 instead of calling Target_arm::reloc_uses_thumb_bit().
11259
11260 2010-02-02 Doug Kwan <dougkwan@google.com>
11261
11262 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11263 types of relaxed input section.
11264
11265 2010-02-02 Doug Kwan <dougkwan@google.com>
11266
11267 * Makefile.am (HFILES): Add arm-reloc-property.h.
11268 (DEFFILES): New.
11269 (TARGETSOURCES): Add arm-reloc-property.cc
11270 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11271 (libgold_a_SOURCES): $(DEFFILES)
11272 * Makefile.in: Regenerate.
11273 * arm-reloc-property.cc: New file.
11274 * arm-reloc-property.h: New file.
11275 * arm-reloc.def: New file.
11276 * arm.cc: Update comments.
11277 (arm-reloc-property.h): New included header.
11278 (arm_reloc_property_table): New global variable.
11279 (Target_arm::do_select_as_default_target): New method definition.
11280 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11281 arm-reloc-property to targ_extra_obj.
11282 * parameters.cc (set_parameters_target): Call
11283 Target::select_as_default_target().
11284 * target.h (Target::select_as_default_target): New method definition.
11285 (Target::do_select_as_default_target): Same.
11286
11287 2010-02-01 Doug Kwan <dougkwan@google.com>
11288
11289 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11290 first_output_text_section_.
11291 (Arm_exidx_fixup::first_output_text_section): New method definition.
11292 (Arm_exidx_fixup::first_output_text_section_): New data member.
11293 (Arm_exidx_fixup::process_exidx_section): Record the first text
11294 output section seen.
11295 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11296 and entsize in output section header.
11297
11298 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11299
11300 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11301 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11302 (Arm_relocate_functions::thm_alu11): New Method.
11303 (Arm_relocate_functions::thm_pc8): New Method.
11304 (Arm_relocate_functions::thm_pc12): New Method.
11305 (Target_arm::Scan::local): Handle the relocations.
11306 (Target_arm::Scan::global): Likewise.
11307 (Target_arm::Relocate::relocate): Likewise.
11308 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11309
11310 2010-01-29 Doug Kwan <dougkwan@google.com>
11311
11312 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11313 of relocation types as ld.
11314
11315 2010-01-29 Doug Kwan <dougkwan@google.com>
11316
11317 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11318 to public.
11319 (Arm_relocate_functions::thumb_branch_common): Ditto.
11320 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11321 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11322 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11323 Arm_relocate_functions::jump24): Remove.
11324 (Target_arm::Relocate::relocate): Adjust code to call
11325 Arm_relocation_functions::arm_branch_common and
11326 Arm_relocation_functions::thumb_branch_common instead of their removed
11327 wrappers. Merge switch-cases together to reduce source code size.
11328
11329 2010-01-29 Doug Kwan <dougkwan@google.com>
11330
11331 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11332 output_local_symbol_count_needs_update_.
11333 (Arm_relobj::output_local_symbol_count_needs_update,
11334 Arm_relobj::set_output_local_symbol_count_needs_update,
11335 Arm_relobj::update_output_local_symbol_count): New methods.
11336 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11337 member.
11338 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11339 of pointed function as in a R_ARM_PREL31 relocation.
11340 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11341 for output local symbol count updating.
11342 (Target_arm::do_relax): Update output local symbol counts in objects
11343 if necessary.
11344 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11345
11346 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11347
11348 * arm.cc: Added support for the ARM relocations:
11349 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11350 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11351 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11352 movw_prel_nc).
11353 (Arm_relocate_functions::movw_rel): New method.
11354 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11355 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11356 thm_movw_prel_nc).
11357 (Arm_relocate_functions::thm_movw_rel): New method.
11358 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11359 thm_movt_prel).
11360 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11361 relocations.
11362 (Target_arm::Scan::global): Likewise.
11363 (Target_arm::Relocate::relocate): Likewise.
11364 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11365 Likewise.
11366
11367 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11368
11369 * arm.cc: Added support for ARM group relocations.
11370 (Target_arm::reloc_needs_sym_origin): New method.
11371 (Arm_relocate_functions::calc_grp_kn): New method.
11372 (Arm_relocate_functions::calc_grp_residual): New method.
11373 (Arm_relocate_functions::calc_grp_gn): New method.
11374 (Arm_relocate_functions::arm_grp_alu): New Method.
11375 (Arm_relocate_functions::arm_grp_ldr): New Method.
11376 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11377 (Arm_relocate_functions::arm_grp_ldc): New Method.
11378 (Target_arm::Scan::local): Handle the ARM group relocations.
11379 (Target_arm::Scan::global): Likewise.
11380 (Target_arm::Relocate::relocate): Likewise.
11381 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11382 Likewise.
11383
11384 2010-01-26 Doug Kwan <dougkwan@google.com>
11385
11386 * arm.cc (set): Include.
11387 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11388 pointer type.
11389 (Arm_output_section::Text_section_list): New type.
11390 (Arm_output_section::append_text_sections_to_list): New method.
11391 (Arm_output_section::fix_exidx_coverage): Ditto.
11392 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11393 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11394 Relobj::set_section_offset() instead of
11395 Sized_relobj::invalidate_section_offset().
11396 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11397 parameter for section headers. Ignore relocation sections for
11398 unallocated sections and EXIDX sections.
11399 (Target_arm::fix_exidx_coverage): New method.
11400 (Target_arm::output_section_address_less_than): New type.
11401 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11402 linked text section instead of the EXIDX section.
11403 (Arm_output_section::create_stub_group): Add an assertion to check
11404 that this is not an EXIDX output section.
11405 (Arm_output_section::append_text_sections_to_list): New method.
11406 (Arm_output_section::fix_exidx_coverage): Ditto.
11407 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11408 Arm_relobj::section_needs_reloc_stub_scanning.
11409 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11410 first pass.
11411 (Target_arm::fix_exidx_coverage): New method.
11412 * object.h (Relobj::set_output_section): New method.
11413 (Sized_relobj::invalidate_section_offset): Remove method.
11414 (Sized_relobj::do_invalidate_section_offset): Remove method.
11415 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11416
11417 2010-01-25 Doug Kwan <dougkwan@google.com>
11418
11419 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11420 Fix warning due to signed and unsigned comparison on a 32-bit host.
11421
11422 2010-01-22 Doug Kwan <dougkwan@google.com>
11423
11424 * arm.cc (Target_arm::do_relax): Record an output section for section
11425 offset adjustment it contains any stub table that has changed.
11426 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11427 offsets in an output section if necessary.
11428 * output.cc (Output_section::Output_section): Initialize
11429 section_offsets_need_adjustments_.
11430 (Output_section::add_input_section_for_script): Renamed to
11431 Output_section::add_simple_input_section.
11432 (Output_section::save_states): Add a comment.
11433 (Output_section::discard_states): New method defintion.
11434 (Output_section::adjust_section_offsets): Same.
11435 * output.h (Output_section::add_input_section_for_script): Renamed to
11436 Output_section::add_simple_input_section.
11437 (Output_section::discard_states): New method declaration.
11438 (Output_section::adjust_section_offsets): Same.
11439 (Output_section::section_offsets_need_adjustment,
11440 Output_section::set_section_offsets_need_adjustment): New method
11441 definitions.
11442 (Output_section::section_offsets_need_adjustment_): New data member.
11443 * script-sections.cc
11444 (Output_section_element_input::set_section_address): Adjust code for
11445 renaming of Output_section::add_input_section_for_script.
11446 (Orphan_output_section::set_section_address): Same.
11447
11448 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11449
11450 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11451 Fix_v4bx enum values .
11452 * gold/options.h (General_options): New option definitions.
11453 (General_options::fix_v4bx): New method.
11454 (General_options::Fix_v4bx): New enum.
11455 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11456 (General_options::parse_fix_v4bx_interworking): New method.
11457
11458 2010-01-22 Doug Kwan <dougkwan@google.com>
11459
11460 * arm.cc (Arm_exidx_fixup): New class.
11461
11462 2010-01-21 Doug Kwan <dougkwan@google.com>
11463
11464 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11465 classes.
11466 (Arm_exidx_section_offset_map): New type.
11467
11468 2010-01-21 Doug Kwan <dougkwan@google.com>
11469
11470 * arm.cc (Arm_exidx_input_section): New class.
11471 (Arm_relobj::exidx_input_section_by_link,
11472 Arm_relobj::exidx_input_section_by_shndx,
11473 Arm_relobj::make_exidx_input_section): New methods.
11474 (read_arm_attributes_section): Remove.
11475 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11476 information about them.
11477 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11478 to here.
11479
11480 2010-01-20 Doug Kwan <dougkwan@google.com>
11481
11482 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11483 Input_section_specifier to Section_id.
11484 (Target_arm::new_arm_input_section: Adjust code for change of key
11485 type.
11486 (Target_arm::find_arm_input_section): Ditto.
11487 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11488 (Section_id): Remove.
11489 (Garbage_collection::Section_id_hash): Remove.
11490 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11491 (Section_id): Remove.
11492 (Icf::Section_id_hash): Remove.
11493 * object.h (Section_id, Const_section_id, Section_id_hash,
11494 Const_section_id_hash): New type definitions.
11495 * output.cc (Output_section::add_relaxed_input_section): Change to
11496 use Const_section_id instead of Input_section_specifier as key type.
11497 (Output_section::add_merge_input_section): Ditto.
11498 (Output_section::build_relaxation_map): Change to use Section_id
11499 instead of Input_section_specifier as key type.
11500 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11501 Ditto.
11502 (Output_section::convert_input_sections_to_relaxed_sections): Change
11503 to use Const_section_id instead of Input_section_specifier as key type.
11504 (Output_section::find_merge_section): Ditto.
11505 (Output_section::find_relaxed_input_section): Ditto.
11506 * output.h (Input_section_specifier): Remove class.
11507 (Output_section::Output_section_data_by_input_section_map): Change
11508 key type to Const_section_id.
11509 (Output_section::Output_relaxed_input_section_by_input_section_map):
11510 Ditto.
11511 (Output_section::Relaxation_map): Change key type to Section_id.
11512
11513 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11514
11515 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11516 (class Arm_v4bx_stub): New class.
11517 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11518 (Stub_factory::make_arm_v4bx_stub): New method.
11519 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11520 (Stub_table::empty): Handle v4bx stubs.
11521 (Stub_table::add_arm_v4bx_stub): New method.
11522 (Stub_table::find_arm_v4bx_stub): New method.
11523 (Arm_relocate_functions::v4bx): New method.
11524 (Target_arm::fix_v4bx): New method.
11525 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11526 (Stub_table::relocate_stubs): Likewise.
11527 (Stub_table::do_write): Likewise.
11528 (Stub_table::update_data_size_and_addralign): Likewise.
11529 (Stub_table::finalize_stubs): Likewise.
11530 (Target_arm::Scan::local): Likewise.
11531 (Target_arm::Scan::global): Likewise.
11532 (Target_arm::do_finalize_sections): Likewise.
11533 (Target_arm::Relocate::relocate): Likewise.
11534 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11535 Likewise.
11536 (Target_arm::scan_reloc_for_stub): Likewise.
11537 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11538
11539 2010-01-19 Ian Lance Taylor <iant@google.com>
11540
11541 * output.cc (Output_section_headers::do_sized_write): Write large
11542 segment count to sh_info field.
11543 (Output_file_header::do_sized_write): For large segment count,
11544 write PN_XNUM to e_phnum field.
11545
11546 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11547
11548 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11549 (Arm_relocate_functions::thm_jump8): New function.
11550 (Arm_relocate_functions::thm_jump11): New function.
11551 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11552 R_ARM_THM_JUMP11.
11553 (Target_arm::Scan::global): Likewise.
11554 (Target_arm::Relocate::relocate): Likewise.
11555 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11556 Likewise.
11557
11558 2010-01-14 Doug Kwan <dougkwan@google.com>
11559
11560 * arm.cc (map, utility): Include headers.
11561 (Target_arm::apply_cortex_a8_workaround): New method.
11562 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11563 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11564 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11565 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11566 the --[no-]fix-cortex-a8 command line options.
11567 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11568 (Target_arm::relocate_stub): Use addend in instruction template.
11569 * options.h (DEFINE_bool): Set the user-set flag.
11570 (General_options): Add --[no-]-fix-cortex options.
11571 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11572 : Update fast look-up map after conversion.
11573
11574 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11575
11576 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11577 in the first pass of do_layout.
11578
11579 2010-01-13 Doug Kwan <dougkwan@google.com>
11580
11581 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11582 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11583 apparent compiler problem of not folding static constant integral
11584 data members of elfcpp::Elf_sizes<32>.
11585
11586 2010-01-13 Doug Kwan <dougkwan@google.com>
11587
11588 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11589 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11590 Arm_relobj::scan_section_for_cortex_a8_erratum,
11591 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11592 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11593 sections to scan for relocation stubs into a new method
11594 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11595 relocation and Cortex-A8 stub scanning.
11596 (Target_arm::do_relax): Force stubs to be after stubbed sections
11597 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11598 the beginning of a new relaxation pass. Update a comment.
11599 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11600
11601 2010-01-12 Ian Lance Taylor <iant@google.com>
11602
11603 * target-reloc.h (visibility_error): New inline function.
11604 (relocate_section): Call visibility_error.
11605 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11606 (MOSTLYCLEANFILES): Likewise.
11607 (protected_4_pic.o, protected_3.err): New targets.
11608 * testsuite/protected_4.cc: New file.
11609
11610 2010-01-12 Doug Kwan <dougkwan@google.com>
11611
11612 * arm.cc (Cortex_a8_reloc): New class.
11613 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11614 and cortex_a8_relocs_info_.
11615 (Target_arm::fix_cortex_a8): New method definition.
11616 (Target_arm::Cortex_a8_relocs_info): New type.
11617 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11618 New data member declarations.
11619 (Target_arm::scan_reloc_for_stub): Record information about
11620 relocations for THUMB branches that might be exempted from the
11621 Cortex-A8 workaround.
11622 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11623 at the beginning of a relaxation pass.
11624
11625 2010-01-12 Doug Kwan <dougkwan@google.com>
11626
11627 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11628 (Arm_relobj::Mapping_symbol_position,
11629 Arm_reloj::Mapping_symbol_position_less,
11630 Arm_relobj::Mapping_symbols_info): New types.
11631 (Target_arm::is_mapping_symbol_name): New method definition.
11632 (Arm_relobj::do_count_local_symbols): Save information about mapping
11633 symbols.
11634
11635 2010-01-11 Doug Kwan <dougkwan@google.com>
11636
11637 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11638 Arm_relocate_functions::thumb32_branch_upper,
11639 Arm_relocate_functions::thumb32_branch_lower,
11640 Arm_relocate_functions::thumb32_cond_branch_offset,
11641 Arm_relocate_functions::thumb32_cond_branch_upper,
11642 Arm_relocate_functions::thumb32_cond_branch_lower,
11643 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11644 branch offset encoding.
11645 (Arm_relocate_functions::thumb_branch_common): Use new branch
11646 offset encoding methods to avoid code duplication.
11647 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11648 (Stub_addend_reader::operator()): Use new branch encoding method
11649 to avoid code duplication.
11650
11651 2010-01-11 Doug Kwan <dougkwan@google.com>
11652
11653 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11654 (Target_arm::do_finalize_sections): Define special EXIDX section
11655 symbols only if referenced.
11656 * gc.h (Garbage_collection::add_reference): New method.
11657 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11658 code duplication.
11659
11660 2010-01-11 Ian Lance Taylor <iant@google.com>
11661
11662 * script.cc (Version_script_info::build_expression_list_lookup):
11663 Change complaing about duplicate wildcard match from error to
11664 warning.
11665
11666 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11667 of 2009-12-30.
11668 (Version_script_info::Version_script_info): Initialize globs_,
11669 default_version_, default_is_global_, and exact_. Don't
11670 initialize globals_ or locals_.
11671 (Version_script_info::build_lookup_tables): Build local symbols
11672 first.
11673 (Version_script_info::unquote): New function.
11674 (Version_script_info::add_exact_match): New function.
11675 (Version_script_info::build_expression_list_lookup): Remove lookup
11676 parameter. Add is_global parameter. Change all callers. Handle
11677 wildcard pattern specially. Unquote pattern. Call
11678 add_exact_match.
11679 (Version_script_info::get_name_to_match): New function.
11680 (Version_script_info::get_symbol_version): New function.
11681 (Version_script_info::get_symbol_version_helper): Remove.
11682 (Version_script_info::check_unmatched_names): Call unquote.
11683 * script.h (class Version_script_info): Change get_symbol_version
11684 to be non-inline and add is_global parameter; change all callers.
11685 Rewrite symbol_is_local. Update declarations. Define struct
11686 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11687 Remove globals_ and locals_ members. Add exact_, globs_,
11688 default_version_, is_global_.
11689 (Version_script_info::Glob): Remove pattern, add expression and
11690 is_global. Update constructor. Change all callers.
11691 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11692 default version.
11693 (Versions::symbol_section_contents): If a symbol is undefined, or
11694 defined in a dynamic object, set the version index to
11695 VER_NDX_LOCAL.
11696 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11697 symbol_is_local.
11698 (Symbol_table::add_from_pluginobj): Likewise.
11699 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11700
11701 2010-01-11 Doug Kwan <dougkwan@google.com>
11702
11703 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11704 (incremental_dump_LDADD): Add linking option for libintl.
11705 * Makefile.in: Regenerate.
11706
11707 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11708
11709 PR gold/11144
11710 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11711 instead of -Ds.
11712 * testsuite/Makefile.in: Regenerated.
11713
11714 2010-01-10 Doug Kwan <dougkwan@google.com>
11715
11716 * options.h (DEFINE_var): Use parentheses around argument varname__
11717 in macro body to avoid any unintended subsequent substitutions.
11718
11719 2010-01-10 Ian Lance Taylor <iant@google.com>
11720
11721 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11722 candidates before doing symbol resolution.
11723
11724 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11725 ODR candidates if only one is weak.
11726
11727 2010-01-08 Ian Lance Taylor <iant@google.com>
11728
11729 * script.cc (Version_script_info::build_expression_list_lookup):
11730 Don't warn about ambiguous version, just record the ambiguity.
11731 (Version_script_info::get_symbol_version_helper): Give error if
11732 version is ambiguous.
11733
11734 2010-01-08 Doug Kwan <dougkwan@google.com>
11735
11736 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11737 prev_data_size_ and prev_addralign_. Remove initializer for
11738 deleted data member has_been_changed_.
11739 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11740 to determine if the table is empty.
11741 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11742 Remove.
11743 (Stub_table::add_reloc_stub): Define method in class definition
11744 instead of just declaring it there.
11745 (Stub_table::add_cortex_a8_stub): New method definition.
11746 (Stub_table::update_data_size_and_addralign): Ditto.
11747 (Stub_table::finalize_stubs): Ditto.
11748 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11749 (Stub_table::do_addralign_): Return address alignment in the
11750 (Stub_table::do_reset_address_and_file_offset): Define method in
11751 class definition instead of declaring it there. Set current data
11752 size to be the data size of the previous pass.
11753 (Stub_table::set_final_data_size): Use current data size as the
11754 final data size.
11755 (Stub_table::relocate_stub): Change parameter type of stub from
11756 Reloc_stub pointer to Stub pointer.
11757 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11758 (Stub_table::Cortex_a8_stub_list): New typedef.
11759 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11760 Stub_table::prev_addralign_): New data member.
11761 (Arm_relobj::Arm_relobj): Initialize data member
11762 section_has_cortex_a8_workaround_.
11763 (Arm_relobj::section_has_cortex_a8_workaround,
11764 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11765 definitions.
11766 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11767 declarations.
11768 (Target_arm::relocate_stub): Change parameter type of stub from
11769 Reloc_stub pointer to Stub pointer.
11770 (Insn_template::size, Insn_template::alignment): Handle
11771 THUMB16_SPECIAL_TYPE.
11772 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11773 Stub_table::update_data_size_and_addralign,
11774 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11775 definitions.
11776 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11777 (Stub_table::do_write): Ditto.
11778 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11779
11780 2010-01-08 Ian Lance Taylor <iant@google.com>
11781
11782 PR 11108
11783 * symtab.h (class Symbol): Remove fields is_target_special_ and
11784 has_plt_offset_. Add field is_defined_in_discarded_section_.
11785 (Symbol::is_defined_in_discarded_section): New function.
11786 (Symbol::set_is_defined_in_discarded_section): New function.
11787 (Symbol::has_plt_offset): Rewrite.
11788 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11789 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11790 Don't initialize is_target_special_ or has_plt_offset_.
11791 Initialize is_defined_in_discarded_section_.
11792 (Symbol_table::add_from_relobj): If appropriate, set
11793 is_defined_in_discarded_section.
11794 * resolve.cc (Symbol::override_base_with_special): Don't test
11795 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11796 * target-reloc.h (relocate_section): Do special handling for
11797 symbols defined in discarded sections for global symbols as well
11798 as local symbols.
11799
11800 2010-01-08 Ian Lance Taylor <iant@google.com>
11801
11802 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11803 the SHT_SYMTAB case.
11804
11805 2010-01-08 Ian Lance Taylor <iant@google.com>
11806
11807 * object.cc (Sized_relobj::do_layout): Don't get confused if
11808 layout_eh_frame returns NULL.
11809
11810 2010-01-08 Ian Lance Taylor <iant@google.com>
11811
11812 PR 11084
11813 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11814 dynamic symbol table, use the normal symbol table.
11815 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11816 symbol table.
11817
11818 2010-01-08 Ian Lance Taylor <iant@google.com>
11819
11820 PR 11072
11821 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11822 sections.
11823
11824 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11825
11826 * version.cc (print_version): Change to "Copyright 2010".
11827
11828 2010-01-08 Ian Lance Taylor <iant@google.com>
11829
11830 PR 10287
11831 PR 11063
11832 * i386.cc (class Target_i386): Change return type of plt_section
11833 to be non-const.
11834 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11835 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11836 tls_desc_rel_ field.
11837 (Output_data_plt_i386::rel_tls_desc): New function.
11838 (Target_i386::rel_tls_desc_section): New function.
11839 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11840 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11841 R_386_TLS_DESC reloc in rel_tls_desc_section.
11842 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11843 Define struct Tlsdesc_info.
11844 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11845 (Target_x86_64::do_reloc_symbol_index): New function.
11846 (Target_x86_64::add_tlsdesc_info): New function.
11847 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11848 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11849 tlsdesc_rel_ field.
11850 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11851 all callers.
11852 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11853 (Target_x86_64::rela_tlsdesc_section): New function.
11854 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11855 handling.
11856 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11857 (Target_x86_64::do_reloc_addend): New function.
11858 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11859 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11860 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11861 (Output_reloc::type): New function.
11862 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11863 (Output_reloc::is_target_specific): New function.
11864 (Output_reloc::target_arg): New function.
11865 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11866 absolute relocs and target specific relocs.
11867 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11868 add_target_specific.
11869 (class Output_data_reloc) [SHT_RELA]: Likewise.
11870 * output.cc (Output_reloc::Output_reloc): Add four new versions
11871 for absolute relocs and target specific relocs.
11872 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11873 (Output_reloc::get_symbol_index): Likewise.
11874 (Output_reloc::local_section_offset): Check that local_sym_index_
11875 is not TARGET_CODE or 0.
11876 (Output_reloc::symbol_value): Likewise.
11877 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11878 reloc.
11879 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11880 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11881 functions.
11882 * layout.cc (add_target_dynamic_tags): Use output section for
11883 DT_PLTRELSZ and DT_JMPREL.
11884
11885 2010-01-07 Ian Lance Taylor <iant@google.com>
11886
11887 PR 11061
11888 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11889 function.
11890 (class Output_data_reloc_generic): Define.
11891 (class Output_data_reloc_base): Change base class to
11892 Output_data_reloc_generic. Change add() method to call
11893 bump_relative_reloc_count for a relative reloc. Remove
11894 sort_relocs_ field.
11895 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11896 to sort_relocs().
11897 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11898 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11899 appropriate.
11900 * layout.h (class Layout): Update declaration.
11901
11902 2010-01-07 Ian Lance Taylor <iant@google.com>
11903
11904 * output.h (class Output_data): Add const version of
11905 output_section and do_output_section.
11906 (class Output_section_data): Add const version of
11907 do_output_section.
11908 (class Output_section): Likewise.
11909 * layout.cc (Layout::add_target_dynamic_tags): New function.
11910 * layout.h (class Layout): Update declarations.
11911 * arm.cc (Target_arm::do_finalize_sections): Use
11912 add_target_dynamic_tags.
11913 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11914 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11915 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11916 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11917
11918 2010-01-07 Ian Lance Taylor <iant@google.com>
11919
11920 PR 11042
11921 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11922 object as needed.
11923
11924 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11925 Ian Lance Taylor <iant@google.com>
11926
11927 PR 11019
11928 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11929 Xindex::read_symtab_xindex.
11930
11931 2010-01-07 Doug Kwan <dougkwan@google.com>
11932
11933 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11934 (Insn_template::thumb16_bcond_insn): New method declaration.
11935 (Insn_template): Fix spelling.
11936 (Stub::thumb16_special): New method declaration.
11937 (Stub::do_write): Define virtual method which was previously pure
11938 virtual.
11939 (Stub::do_thumb16_special): New method declaration.
11940 (Stub::do_fixed_endian_write): New template member.
11941 (Reloc_stub::do_write): Remove.
11942 (Reloc_stub::do_fixed_endian_write): Remove.
11943 (Cortex_a8_stub): New class definition.
11944 (Stub_factory::make_cortex_a8_stub): New method definition.
11945 (Stub_factory::Stub_factory): Add missing static storage class
11946 qualifier for elf32_arm_stub_a8_veneer_blx.
11947
11948 2010-01-07 Ian Lance Taylor <iant@google.com>
11949
11950 PR 10980
11951 * options.h (class General_options): Add --warn-unresolved-symbols
11952 and --error-unresolved-symbols.
11953 * errors.cc (Errors::undefined_symbol): Implement
11954 --warn-unresolved-symbols.
11955
11956 * options.h (class General_options): Add -z text and -z textoff.
11957 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11958
11959 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11960
11961 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11962 (Garbage_collection::cident_sections): New function.
11963 (Garbage_collection::add_cident_section): New function.
11964 (Garbage_collection::cident_sections_): New member.
11965 (gc_process_relocs): Add references to sections whose names are C
11966 identifiers.
11967 * gold.h (cident_section_start_prefix): New constant.
11968 (cident_section_stop_prefix): New constant.
11969 (is_cident): New function.
11970 * layout.cc (Layout::define_section_symbols): Replace string constants
11971 with the newly defined constants.
11972 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11973 C identifiers.
11974 * testsuite/Makefile.am: Add gc_orphan_section_test.
11975 * testsuite/Makefile.in: Regenerate.
11976 * testsuite/gc_orphan_section_test.cc: New file.
11977 * testsuite/gc_orphan_section_test.sh: New file.
11978
11979 2010-01-06 Ian Lance Taylor <iant@google.com>
11980
11981 PR 10980
11982 * options.h (class General_options): Add --warn-shared-textrel.
11983 * layout.cc (Layout::finish_dynamic_section): Implement
11984 --warn-shared-textrel.
11985
11986 PR 10980
11987 * options.h (class General_options): Add --warn-multiple-gp.
11988
11989 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11990
11991 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11992 $(THREADSLIB) and $(LIBDL).
11993 * Makefile.in: Rebuild.
11994
11995 2010-01-06 Ian Lance Taylor <iant@google.com>
11996
11997 PR 10980
11998 * options.cc (General_options::parse_section_start): New function.
11999 (General_options::section_start): New function.
12000 (General_options::General_options): Initialize all members.
12001 * options.h: Include <map>
12002 (class General_options): Add --section-start. Add section_starts_
12003 member.
12004 * layout.cc (Layout::attach_allocated_section_to_segment): If
12005 --section-start was used, set the address of the segment. Remove
12006 local sort_sections.
12007 (Layout::relaxation_loop_body): If the address of the load segment
12008 has been set by --section-start, don't use it.
12009 * output.h (Output_segment::update_flags_for_output_section): New
12010 function.
12011 * output.cc (Output_segment::add_output_section): Call
12012 update_flags_for_output_section.
12013
12014 2010-01-05 Ian Lance Taylor <iant@google.com>
12015
12016 PR 10980
12017 * options.h (class General_options): Add --undefined-version.
12018 * script.cc (struct Version_expression): Add was_matched_by_symbol
12019 field.
12020 (Version_script_info::matched_symbol): New function.
12021 (Version_script_info::get_symbol_version_helper): Call
12022 matched_symbol.
12023 (Version_script_info::check_unmatched_names): New function.
12024 * script.h (class Version_script_info): Update declarations.
12025 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12026
12027 * options.h (class General_options): Use DEFINE_bool_alias for
12028 allow_multiple_definition.
12029 * resolve.cc (Symbol_table::should_override): Don't test
12030 allow_multiple_definition.
12031
12032 PR 10980
12033 * options.h (class General_options): Add --cref.
12034 * main.cc (main): Print cref table if --cref. Don't close mapfile
12035 until after printing cref table.
12036 * cref.cc: Include "symtab.h".
12037 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12038 (Cref_table_compare::operator()): New function.
12039 (Cref_inputs::gather_cref): New function.
12040 (filecol): New static const.
12041 (Cref_inputs::print_cref): New function.
12042 (Cref::print_cref): New function.
12043 * cref.h: Include <cstdio>.
12044 (class Cref): Update declarations.
12045 * mapfile.h (Mapfile::file): New function.
12046 * object.h (class Object): Define Symbols. Declare virtual
12047 do_get_global_symbols.
12048 (Object::get_global_symbols): New function.
12049 * object.cc (Input_objects::add_object): Pass object to cref_ if
12050 --cref.
12051 (Input_objects::archive_start): Likewise.
12052 (Input_objects::archive_stop): Likewise.
12053 (Input_objects::print_cref): New function.
12054 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12055 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12056 --cref.
12057 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12058 function.
12059 * plugin.h (class Sized_pluginobj): Update declarations.
12060
12061 2010-01-05 Ian Lance Taylor <iant@google.com>
12062
12063 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12064 to is_default_version. Rename insdef to insdefault.
12065 (Symbol_table::add_from_relobj): Rename def to is_default_version
12066 and local to is_forced_local.
12067 (Symbol_table::add_from_pluginobj): Likewise.
12068 (Symbol_table::add_from_dynobj): Likewise.
12069 (Symbol_table::define_special_symbol): Rename insdef to
12070 insdefault.
12071
12072 2010-01-04 Ian Lance Taylor <iant@google.com>
12073
12074 PR 10980
12075 * options.h (class General_options): Add
12076 --allow-multiple-definition and -z muldefs.
12077 * resolve.cc (Symbol_table::should_override): Don't warn about a
12078 multiple symbol definition if --allow-multiple-definition or -z
12079 muldefs.
12080
12081 PR 10980
12082 * options.h (class General_options): Add --add-needed and
12083 --copy-dt-needed-entries. Tweak --as-needed help entry.
12084 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12085 error if --copy-dt-needed-entries aka --add-needed is used and
12086 would cause a change in behaviour.
12087
12088 PR 10980
12089 * options.h (class General_options): Add -G as a short version of
12090 --shared. Add no-op options -assert, -g, and -i.
12091
12092 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12093
12094 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12095 check for .text or .gnu.linkonce.t sections.
12096 * icf.cc (Icf::find_identical_sections): Ditto.
12097 Change the detection for mangled function name within the section
12098 name.
12099 * icf.h (is_section_foldable_candidate): New function.
12100
12101 2009-12-30 Ian Lance Taylor <iant@google.com>
12102
12103 PR 10980
12104 * options.h (class General_options): Permit two dashes with
12105 --retain-symbols-file.
12106
12107 2009-12-30 Ian Lance Taylor <iant@google.com>
12108
12109 PR 10979
12110 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12111 don't put the file header and segment headers in the text
12112 segment.
12113
12114 PR 10979
12115 * common.cc (Sort_commons::operator()): Stabilize sort when both
12116 entries are NULL.
12117 (Symbol_table::do_allocate_commons_list): When allocating common
12118 symbols, skip a symbol which is no longer common.
12119 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12120 an object before checking its type.
12121 * testsuite/common_test_2.c: New file.
12122 * testsuite/common_test_3.c: New file.
12123 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12124 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12125 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12126 (common_test_2_pic.o, common_test_2.so): New targets.
12127 (common_test_3_pic.o, common_test_3.so): New targets.
12128 * testsuite/Makefile.in: Rebuild.
12129
12130 PR 10979
12131 * script.cc (read_input_script): If we see a new SECTIONS clause,
12132 and we have added an input section, give an error.
12133 * layout.h (class Layout): Add have_added_input_section function.
12134 Add have_added_input_section_ field.
12135 * layout.cc (Layout::Layout): Initialize
12136 have_added_input_section_.
12137 (Layout::layout): Set have_added_input_section_.
12138 (Layout::layout_eh_frame): Likewise.
12139
12140 2009-12-30 Ian Lance Taylor <iant@google.com>
12141
12142 PR 10931
12143 * options.h (class General_options): Add --sort-common option.
12144 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12145 * common.cc (Sort_common): Add sort_order parameter to
12146 constructor. Add sort_order_ field.
12147 (Sort_commons::operator): Check sort_order_.
12148 (Symbol_table::allocate_commons): Determine the sort order.
12149 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12150 Change all callers.
12151 (Symbol_table::do_allocate_commons_list): Likewise.
12152
12153 2009-12-30 Ian Lance Taylor <iant@google.com>
12154
12155 PR 10916
12156 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12157 symbols from this object, don't change the visibility of an
12158 undefined symbol.
12159 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12160
12161 2009-12-30 Ian Lance Taylor <iant@google.com>
12162
12163 PR 10861
12164 * script.h (class Version_script_info): Define Language enum.
12165 Update declarations. Define Glob, Exact, and Lookup types. Add
12166 new fields globals_, locals_, and is_finalized_.
12167 * script.cc: Various formatting fixes.
12168 (class Parser_closure): Change language_stack_ from a vector of
12169 std::string to one of Version_script_info::Language. Adjust all
12170 uses accordingly.
12171 (class Lazy_demangler): Remove.
12172 (struct Version_expression): Change language from std::string to
12173 Version_script_info::Language.
12174 (Version_script_info::Version_script_info): New function.
12175 (Version_script_info::~Version_script_info): Don't call clear.
12176 (Version_script_info::finalize): New function.
12177 (Version_script_info::build_lookup_tables): New function.
12178 (Version_script_info::build_expression_list_lookup): New
12179 function.
12180 (Version_script_info::get_symbol_version_helper): Rewrite to use
12181 lookup tables.
12182 (Version_script_info::print_expression_list): Adjust to use
12183 Version_script_info::Language.
12184 (script_push_lex_into_version_mode): Check that the version script
12185 has not been finalized.
12186 (version_script_push_lang): Change language string to
12187 Version_script_info::Language.
12188 * options.cc (Command_line::version_script): New function.
12189 * options.h (class General_options): Add finalize_dynamic_list
12190 function. Change version_script from declaration to definition.
12191 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12192 * testsuite/version_script.map: Remove duplicate def of foo.
12193 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12194 version_script.map.
12195 * testsuite/Makefile.in: Rebuild.
12196
12197 2009-12-30 Ian Lance Taylor <iant@google.com>
12198
12199 PR 10843
12200 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12201 if the input symbol index is 0, make the output symbol index 0.
12202
12203 2009-12-30 Ian Lance Taylor <iant@google.com>
12204
12205 PR 10670
12206 * options.h (class General_options): Add -x/--discard-all.
12207 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12208 --discard-all. If the local symbol needs a dynamic entry, check
12209 that before handling --discard-locals.
12210
12211 2009-12-30 Ian Lance Taylor <iant@google.com>
12212
12213 PR 10450
12214 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12215 flags to PF_R.
12216 (Output_segment::add_output_section): Don't change the flags if
12217 the type is PT_TLS.
12218
12219 PR 10450
12220 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12221 GNU hash table if they need a dynamic value. Otherwise, don't add
12222 them if they are defined in a dynamic object or are forced local.
12223
12224 2009-12-29 Ian Lance Taylor <iant@google.com>
12225
12226 PR 10450
12227 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12228 .gnu.hash table for a 32-bit target.
12229
12230 PR 10450
12231 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12232 regular and a dynamic object only needs a dynamic symbol table
12233 entry if it is externally visible.
12234
12235 PR 10450
12236 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12237 constructor. Add global_offset_table_ field.
12238 (Target_i386::got_section): Set global_offset_table_.
12239 (Target_i386::do_finalize_sections): Set global_offset_table_
12240 size.
12241 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12242 in constructor. Add global_offset_table_ field.
12243 (Target_x86_64::got_section): Set global_offset_table_.
12244 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12245 size.
12246
12247 * layout.cc (Layout::Layout): Initialize increase_relro_.
12248 (Layout::get_output_section): Add is_relro, is_last_relro, and
12249 is_first_non_relro parameters. Change all callers.
12250 (Layout::choose_output_section): Likewise.
12251 (Layout::add_output_section_data): Likewise.
12252 (Layout::make_output_section): Likewise.
12253 (Layout::set_segment_offsets): Clear increase_relro when using a
12254 linker script.
12255 * layout.h (class Layout): Add increase_relro method. Add
12256 increase_relro_ field. Update declarations.
12257 * output.cc (Output_section::Output_section): Initialize
12258 is_last_relro_ and is_first_non_relro_.
12259 (Output_segment::add_output_section): Group relro sections is
12260 do_sort is true. Handle is_last_relro and is_first_non_relro.
12261 (Output_segment::maximum_alignment): Remove relro handling.
12262 (Output_segment::set_section_addresses): Add increase_relro
12263 parameter. Change all callers. Add initial alignment to align
12264 relro sections on separate page. Remove old relro handling.
12265 (Output_segment::set_section_list_addresses): Remove in_relro
12266 parameter. Change all callers.
12267 (Output_segment::set_offset): Add increase parameter. Change all
12268 callers. Remove old relro handling.
12269 * output.h (class Output_section): Add new methods: is_last_relro,
12270 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12271 Add is_last_relro_ and is_first_non_relro_ fields.
12272 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12273 Create separate .got.plt section. Call increase_relro.
12274 * x86_64.cc (Target_x86_64::got_section): Likewise.
12275 * testsuite/relro_script_test.t: Add .got.plt.
12276
12277 PR 10450
12278 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12279 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12280 (Layout::finalize): Call set_dynamic_symbol_size.
12281 (Layout::set_dynamic_symbol_size): New function.
12282 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12283 set_dynamic_symbol_size.
12284
12285 PR 10450
12286 * output.h (class Output_section): Add is_entsize_zero_ field.
12287 * output.cc (Output_section::Output_section): Initialize
12288 is_entsize_zero_.
12289 (Output_section::set_entsize): If two different entsizes are
12290 requested, force it to zero.
12291 (Output_section::add_input_section): Set flags for .debug_str
12292 before updating section flags. Set entsize.
12293 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12294 and SHF_STRING if all input sections have those flags.
12295
12296 2009-12-29 Rafael Espindola <espindola@google.com>
12297
12298 * main.cc (main): Fix the sys time reporting.
12299 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12300 reporting.
12301
12302 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12303
12304 * options.cc (General_options::parse_version): Allow -v to exit
12305 without an error if there is nothing to link.
12306
12307 2009-12-29 Ian Lance Taylor <iant@google.com>
12308
12309 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12310 using a version of gcc before 4.1.
12311 * configure: Rebuild.
12312
12313 2009-12-28 Chris Demetriou <cgd@google.com>
12314
12315 * attributes.cc (Output_attributes_section_data::do_write): Use
12316 std::vector::front rather than std::vector::data.
12317
12318 2009-12-28 Ian Lance Taylor <iant@google.com>
12319
12320 * symtab.h (class Symbol_table): Add enum Defined.
12321 * resolve.cc (Symbol_table::should_override): Add defined
12322 parameter. Change all callers. Test whether object is NULL
12323 before calling a method on it.
12324 (Symbol_table::report_resolve_problem): Add defined parameter.
12325 Change all callers.
12326 (Symbol_table::should_override_with_special): Likewise.
12327 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12328 parameter. Change all callers.
12329 (Symbol_table::do_define_in_output_data): Likewise.
12330 (Symbol_table::define_in_output_segment): Likewise.
12331 (Symbol_table::do_define_in_output_segment): Likewise.
12332 (Symbol_table::define_as_constant): Likewise.
12333 (Symbol_table::do_define_as_constant): Likewise.
12334 * script.h (class Symbol_assignment): Add is_defsym parameter to
12335 constructor; change all callers.
12336 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12337 parameter. Change all callers. Add is_defsym_ field.
12338 (class Parser_closure): Add parsing_defsym parameter to
12339 constructor; change all callers. Add parsing_defsym accessor
12340 function. Add parsing_defsym_ field.
12341
12342 2009-12-28 Ian Lance Taylor <iant@google.com>
12343
12344 * gold.cc (queue_middle_tasks): Fix formatting.
12345 * object.cc (Relobj::is_section_name_included): Likewise.
12346
12347 2009-12-23 Ian Lance Taylor <iant@google.com>
12348
12349 * i386.cc (Target_i386::do_calls_non_split): Recognize
12350 -fsplit-stack prologue for a function with a static chain.
12351 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12352 -fsplit-stack prologue when using %r11.
12353
12354 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12355
12356 * options.cc (General_options::parse_version): Make -v continue and do
12357 the link like GNU ld does.
12358
12359 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12360
12361 * Makefile.am (CCFILES): Add timer.cc.
12362 (HFILES): Add timer.h.
12363 * configure.ac: Check for sysconf and times.
12364 * main.cc: include timer.h.
12365 (main): Use Timer instead of get_run_time.
12366 * timer.cc: New.
12367 * timer.h: New.
12368 * workqueue.cc: include timer.h.
12369 (Workqueue::find_and_run_task):
12370 Report user, sys and wall time.
12371 * Makefile.in: Regenerate.
12372 * config.in: Regenerate.
12373 * configure: Regenerate.
12374
12375 2009-12-16 Doug Kwan <dougkwan@google.com>
12376
12377 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12378 sections.
12379 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12380 relaxed input sections.
12381 * output.cc (Output_section::find_relaxed_input_section): Change
12382 return type to Output_relaxed_input_section pointer. Adjust code
12383 for new type of relaxed_input_section_map_.
12384 * output.h (Output_section::find_relaxed_input_section): Change
12385 return type to Output_relaxed_input_section pointer.
12386 (Output_section::Output_relaxed_input_section_by_input_section_map):
12387 New type.
12388 (Output_section::relaxed_input_section_map_): Change type to
12389 Output_section::Output_relaxed_input_section_by_input_section_map.
12390 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12391 input section.
12392
12393 2009-12-15 Ian Lance Taylor <iant@google.com>
12394
12395 * layout.cc (Layout::create_shstrtab): Only write out after input
12396 sections if we are compressing debug sections.
12397
12398 2009-12-15 Ian Lance Taylor <iant@google.com>
12399
12400 * archive.cc (Archive::add_symbols): Only look up a symbol without
12401 a version if there is, in fact, a version.
12402
12403 2009-12-14 Ian Lance Taylor <iant@google.com>
12404
12405 Revert -Wshadow changes, all changes from:
12406 2009-12-11 Doug Kwan <dougkwan@google.com>
12407 2009-12-11 Nick Clifton <nickc@redhat.com>
12408 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12409
12410 2009-12-11 Doug Kwan <dougkwan@google.com>
12411
12412 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12413 due to -Wshadow.
12414 * attributes.cc (Object_attribute::size): Ditto.
12415 (Attributes_section_data::size): Ditto.
12416 (Attributes_section_data::Attributes_section_data): Ditto.
12417 (Output_attributes_section_data::do_write): Ditto.
12418 * attributes.h (Object_attribute::set_type): Ditto.
12419 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12420
12421 2009-12-11 Nick Clifton <nickc@redhat.com>
12422
12423 * archive.cc: Fix shadowed variable warnings.
12424 * arm.cc: Likewise.
12425 * compressed_output.cc: Likewise.
12426 * compressed_output.h: Likewise.
12427 * configure: Likewise.
12428 * dwarf_reader.cc: Likewise.
12429 * dynobj.cc: Likewise.
12430 * dynobj.h: Likewise.
12431 * ehframe.cc: Likewise.
12432 * ehframe.h: Likewise.
12433 * errors.cc: Likewise.
12434 * expression.cc: Likewise.
12435 * fileread.cc: Likewise.
12436 * fileread.h: Likewise.
12437 * freebsd.h: Likewise.
12438 * i386.cc: Likewise.
12439 * icf.cc: Likewise.
12440 * incremental.h: Likewise.
12441 * layout.cc: Likewise.
12442 * layout.h: Likewise.
12443 * mapfile.cc: Likewise.
12444 * merge.cc: Likewise.
12445 * merge.h: Likewise.
12446 * object.cc: Likewise.
12447 * object.h: Likewise.
12448 * options.h: Likewise.
12449 * output.cc: Likewise.
12450 * output.h: Likewise.
12451 * parameters.cc: Likewise.
12452 * plugin.cc: Likewise.
12453 * powerpc.cc: Likewise.
12454 * reduced_debug_output.cc: Likewise.
12455 * reduced_debug_output.h: Likewise.
12456 * reloc.cc: Likewise.
12457 * reloc.h: Likewise.
12458 * resolve.cc: Likewise.
12459 * script-sections.cc: Likewise.
12460 * script.cc: Likewise.
12461 * script.h: Likewise.
12462 * sparc.cc: Likewise.
12463 * symtab.cc: Likewise.
12464 * symtab.h: Likewise.
12465 * target-select.cc: Likewise.
12466 * target-select.h: Likewise.
12467 * token.h: Likewise.
12468 * workqueue.cc: Likewise.
12469 * workqueue.h: Likewise.
12470 * x86_64.cc: Likewise.
12471
12472 2009-12-10 Doug Kwan <dougkwan@google.com>
12473
12474 * arm.cc (attributes.h): New include.
12475 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12476 (Arm_relobj::~Arm_relobj): Delete object pointed by
12477 attributes_section_data_.
12478 (Arm_relobj::attributes_section_data): New method definition.
12479 (Arm_relobj::attributes_section_data_): New data member declaration.
12480 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12481 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12482 attributes_section_data_.
12483 (Arm_dynobj::attributes_section_data): New method definition.
12484 (Arm_dynobj::attributes_section_data_): New data member declaration.
12485 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12486 initialization value of may_use_blx_ to false.
12487 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12488 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12489 object attributes to compute results instead of hard-coding.
12490 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12491 Target_arm::get_secondary_compatible_arch,
12492 Target_arm::set_secondary_compatible_arch
12493 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12494 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12495 New method declarations.
12496 (Target_arm::get_aeabi_object_attribute): New method definition.
12497 (Target_arm::attributes_section_data_): New data member declaration.
12498 (read_arm_attributes_section): New template definition.
12499 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12500 (Arm_dynobj::do_read_symbols): Ditto.
12501 (Target_arm::do_finalize_sections): Merge attributes sections from
12502 input. Check for BLX use after attributes section merging.
12503 Fix __exidx_start and __exidx_end visibility. Create an
12504 .ARM.attributes section if necessary.
12505 (Target_arm::get_secondary_compatible_arch,
12506 Target_arm::set_secondary_compatible_arch,
12507 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12508 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12509 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12510 New method definitions.
12511
12512 2009-12-09 Ian Lance Taylor <iant@google.com>
12513
12514 * plugin.cc (Plugin::load): Don't cast from void* to a function
12515 pointer.
12516
12517 2009-12-09 Ian Lance Taylor <iant@google.com>
12518
12519 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12520 information fields.
12521
12522 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12523
12524 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12525 Replace two_file_shared_1.so with two_file_shared_2.so.
12526 * testsuite/Makefile.in: Regenerated.
12527
12528 2009-12-08 Doug Kwan <dougkwan@google.com>
12529
12530 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12531 (HFILES): Add attributes.h and int_encoding.h.
12532 * Makefile.in: Regenerate.
12533 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12534 function definitions to int_encoding.cc
12535 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12536 prototypes to int_encoding.h
12537 * reduced_debug_output.cc (int_encoding.h): New include.
12538 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12539 function definitions to int_encoding.cc
12540 (insert_into_vector, read_from_pointer): Move template definitions to
12541 int_encoding.h
12542 * attributes.cc: New file.
12543 * attributes.h: New file.
12544 * int_encoding.cc: New file.
12545 * int_encoding.h: New file.
12546
12547 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12548
12549 PR gold/11055
12550 * incremental-dump.cc (dump_incremental_inputs): New.
12551 (main): Use dump_incremental_inputs.
12552
12553 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12554
12555 PR gold/10893
12556 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12557 checking elfcpp::STT_FUNC.
12558 (Target_i386::Relocate::relocate): Likewise.
12559 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12560
12561 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12562 symbols from shared libraries into normal FUNC symbols.
12563
12564 * symtab.h (Symbol): Add is_func and use it.
12565
12566 2009-12-05 Doug Kwan <dougkwan@google.com>
12567
12568 * arm.cc (Target_arm::arm_info): Initialize new fields
12569 attributes_section and attributes_vendor.
12570 * i386.cc (Target_i386::i386_info): Same.
12571 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12572 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12573 fields attributes_section and attributes_vendor.
12574 * sparc.cc (Target_sparc::sparc_info): Same.
12575 * target.h (Target::attributes_section, Target::attributes_vendor,
12576 Target::is_attributes_section, Target::attribute_arg_type,
12577 Target::attributes_order): New method definitions.
12578 (Target::Target_info::attributes_section,
12579 Target::Target_info::attributes_vendor): New fields.
12580 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12581 virtual method definitions.
12582 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12583 attributes_section and attributes_vendor.
12584 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12585
12586 2009-12-05 Doug Kwan <dougkwan@google.com>
12587
12588 * arm.cc: Update comments about interworking and stub generation.
12589 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12590 considered as non-PIC.
12591 (Arm_relocate_functions::base_abs): Fix formatting.
12592 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12593 of function to use GOT entry address instead of offset.
12594 (Target_arm::Scan::global): Issue an error if a symbol would need a
12595 PLT does not get one because it is untyped. Remove code to create
12596 dynamic symbols for relative branches.
12597 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12598 takes unsigned integer instead of boolean.
12599
12600 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12601
12602 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12603 (two_file_test_LDADD): Likewise.
12604 (common_test_1_LDADD): Likewise.
12605 (exception_test_LDADD) Likewise.
12606 (weak_test_LDADD): Likewise.
12607 (many_sections_test_LDADD): Likewise.
12608 (initpri1_LDADD): Likewise.
12609 (script_test_1_LDADD): Likewise.
12610 (script_test_2_LDADD): Likewise.
12611 (justsyms_LDADD): Likewise.
12612 (binary_test_LDADD): Likewise.
12613 (large_LDADD): Likewise.
12614 * testsuite/Makefile.in: Regenerated.
12615
12616 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12617
12618 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12619 (Symbol_table::override_with_special): Likewise.
12620 (Symbol_table::add_from_object): Likewise.
12621
12622 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12623
12624 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12625 Don't set the data_offset twice.
12626
12627 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12628
12629 * testsuite/Makefile.in: Regenerate.
12630
12631 2009-12-03 Doug Kwan <dougkwan@google.com>
12632
12633 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12634 (Target_arm::do_finalize_sections): Add parameter for symbol table
12635 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12636 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12637 parameter for symbol table pointer.
12638 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12639 an additional parameter for a pointer to symbol table.
12640 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12641 parameter for a symbol table pointer.
12642 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12643 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12644 Ditto.
12645 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12646 parameter for a symbol table pointer.
12647
12648 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12649
12650 * incremental.cc (Incremental_inputs_header)
12651 (Incremental_inputs_header_write, Incremental_inputs_entry)
12652 (Incremental_inputs_entry_write): Move ...
12653 * incremental.h (Incremental_inputs_header)
12654 (Incremental_inputs_header_write, Incremental_inputs_entry)
12655 (Incremental_inputs_entry_write): here.
12656
12657 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12658
12659 * incremental.cc (make_sized_incremental_binary): Set the target.
12660 Error if it is incompatible.
12661 * output.h (Output_file): Add filename method.
12662
12663 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12664
12665 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12666 from the get_* methods.
12667
12668 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12669
12670 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12671 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12672 Write 0 for the data_offset of scripts.
12673
12674 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12675
12676 * testsuite/Makefile.am: Add the incremental_test.sh test.
12677 * testsuite/incremental_test.sh: New.
12678 * testsuite/incremental_test_1.c: New.
12679 * testsuite/incremental_test_2.c: New.
12680
12681 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12682
12683 * incremental-dump.cc (main): Fix typos.
12684
12685 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12686
12687 PR gold/11025
12688 * incremental-dump.cc (main): Use llu to print 64 bit values.
12689
12690 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12691 H.J. Lu <hongjiu.lu@intel.com>
12692
12693 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12694 $(LIBDL).
12695 (incremental_dump_LDADD): Likewise.
12696 * Makefile.in: Regenerated.
12697
12698 2009-11-25 Doug Kwan <dougkwan@google.com>
12699
12700 Revert:
12701
12702 2009-11-25 Doug Kwan <dougkwan@google.com>
12703
12704 * arm.cc (Target_arm::Target_arm): Move method definition
12705 outside of class definition. Add code to handle
12706 --target1-rel, --target1-abs and --target2= options.
12707 (Target_arm::get_reloc_reloc_type): Change method to be
12708 non-static and const.
12709 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12710 New data member declaration.
12711 (Target_arm::Scan::local, Target_arm::Scan::global,
12712 Target_arm::Relocate::relocate,
12713 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12714 Adjust call to Target_arm::get_real_reloc_type.
12715 (Target_arm::get_real_reloc_type): Use command line options
12716 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12717 * options.h (--target1-rel, --target1-abs, --target2): New
12718 ARM-only options.
12719
12720 2009-11-25 Doug Kwan <dougkwan@google.com>
12721
12722 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12723 class definition. Add code to handle --target1-rel, --target1-abs
12724 and --target2= options.
12725 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12726 and const.
12727 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12728 member declaration.
12729 (Target_arm::Scan::local, Target_arm::Scan::global,
12730 Target_arm::Relocate::relocate,
12731 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12732 call to Target_arm::get_real_reloc_type.
12733 (Target_arm::get_real_reloc_type): Use command line options to
12734 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12735 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12736 options.
12737
12738 2009-11-25 Doug Kwan <dougkwan@google.com>
12739
12740 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12741 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12742 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12743 formatting.
12744 (Arm_relocate_functions::thm_call): Replace body with a call to
12745 Arm_relocate_functions::thumb_branch_common.
12746 (Arm_relocate_functions::thm_jump24,
12747 Arm_relocate_functions::thm_xpc22): New method definitions.
12748 (Arm_relocate_functions::thumb_branch_common): New method definition.
12749 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12750 operator.
12751 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12752 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12753
12754 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12755
12756 * Makefile.am: Build incremental-dump
12757 * Makefile.in: Regenerate.
12758 * incremental-dump.cc: New.
12759 * incremental.cc (Incremental_inputs_header_data,
12760 Incremental_inputs_entry_data): Move to incremental.h
12761 * incremental.h: (Incremental_inputs_header_data,
12762 Incremental_inputs_entry_data): Move from incremental.cc
12763
12764 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12765
12766 * incremental.cc (Incremental_inputs_header,
12767 Incremental_inputs_header_write, Incremental_inputs_entry,
12768 Incremental_inputs_entry_write): Add a typedef with the data type.
12769
12770 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12771
12772 * incremental.cc (Incremental_inputs_header,
12773 Incremental_inputs_header_write, Incremental_inputs_entry,
12774 Incremental_inputs_entry_write): Update comment about which
12775 type has the filed descriptions.
12776
12777 2009-11-15 Doug Kwan <dougkwan@google.com>
12778
12779 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12780 (Arm_relocate_functions::arm_branch_common): Change method defintion
12781 in class definition to a method declaration and update list of formal
12782 parameters.
12783 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12784 Arm_relocation_functions::jump24): Adjust call to
12785 Arm_relocate_functions::arm_branch_common. Update list of formal
12786 parameters.
12787 (Arm_relocate_functions::xpc25): New method definition.
12788 (Arm_relocate_functions::arm_branch_common): Move method defintion
12789 out from class definition. Use stubs for mode-switching and extending
12790 branch ranges.
12791 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12792 specially. Change code to enable use of stubs in ARM branches.
12793
12794 2009-11-10 Doug Kwan <dougkwan@google.com>
12795
12796 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12797 in method declaration.
12798 (Target_arm::relocate_stub): New method declaration.
12799 (Target_arm::default_target): Change to return a pointer instead of
12800 a const reference.
12801 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12802 Target_arm::default_target.
12803 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12804 method definition.
12805 (Target_arm::relocate_section): Adjust view.
12806 (Target_arm::relocate_stub): New method definition.
12807
12808 2009-11-10 Doug Kwan <dougkwan@google.com>
12809
12810 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12811 a format warning.
12812 * incremental.cc (open_incremental_binary): Initialized local
12813 variables to avoid warnings.
12814 * object.cc (make_elf_object): Ditto.
12815 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12816 a format warning.
12817
12818 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12819
12820 PR gold/10930
12821 * testsuite/plugin_test.c: Include "config.h".
12822
12823 2009-11-09 Doug Kwan <dougkwan@google.com>
12824
12825 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12826 (arm_symbol_value): Remove.
12827 (Arm_relocate_functions::arm_branch_common,
12828 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12829 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12830 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12831 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12832 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12833 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12834 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12835 Arm_relocate_functions::thm_mobw_abs_nc,
12836 Arm_relocate_functions::thm_mov_abs,
12837 Arm_relocate_functions::movw_prel_nc,
12838 Arm_relocate_functions::thm_movt_abs,
12839 Arm_relocate_functions::movt_prel,
12840 Arm_relocate_functions::thm_movw_prel_nc,
12841 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12842 (Target_arm::Relocate::relocate): Only decompose address into two
12843 parts if relocation type uses the thumb-bit and pass the actual
12844 bit instead of a flag indicating that the thumb-bit is used. Adjust
12845 calls to methods in Arm_relocate_functions for this change.
12846
12847 2009-11-08 Ian Lance Taylor <iant@google.com>
12848
12849 PR 10925
12850 * reloc.cc: Instantiate
12851 Sized_relobj::initialize_input_to_output_maps and
12852 Sized_relobj:free_input_to_output_maps.
12853
12854 2009-11-06 Ian Lance Taylor <iant@google.com>
12855
12856 PR 10876
12857 * defstd.cc (in_segment): Set only_if_ref true for "end".
12858
12859 2009-11-06 Doug Kwan <dougkwan@google.com>
12860
12861 * arm.cc (class Reloc_stub): Correct a comment.
12862 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12863 (Target_arm::scan_section_for_stubs): New method declaration.
12864 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12865 Change methods from private to protected.
12866 (Target_arm::do_may_relax): New method definition.
12867 (Target_arm::do_relax, Target_arm::group_sections,
12868 Target_arm::scan_reloc_for_stub,
12869 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12870 (Target_arm::arm_input_section_map_): New data member declaration.
12871 (Target_arm::scan_reloc_for_stub,
12872 Target_arm::scan_reloc_section_for_stubs,
12873 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12874 Target_arm::do_relax): New method definitions.
12875
12876 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12877
12878 * configure.ac: Check for (struct stat)::st_mtim
12879 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12880 * config.in: Regenerate.
12881 * configure: Regenerate.
12882
12883 2009-11-05 Ian Lance Taylor <iant@google.com>
12884
12885 PR 10910
12886 * output.cc (Output_segment::add_output_section): Add missing
12887 return statement.
12888
12889 2009-11-04 Ian Lance Taylor <iant@google.com>
12890
12891 PR 10880
12892 * object.h (class Object): Add is_needed and set_is_needed
12893 methods. Add is_needed_ field. Make bool fields into bitfields.
12894 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12895 defined in a dynamic object and referenced by a regular object,
12896 set is_needed for the dynamic object.
12897 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12898 if the file is marked with as_needed and it is not needed.
12899
12900 2009-11-04 Ian Lance Taylor <iant@google.com>
12901
12902 PR 10887
12903 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12904 tags if data is discarded by linker script.
12905 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12906 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12907 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12908 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12909
12910 2009-11-04 Ian Lance Taylor <iant@google.com>
12911
12912 * layout.cc (Layout::get_output_section): Add is_interp and
12913 is_dynamic_linker_section parameters. Change all callers.
12914 (Layout::choose_output_section): Likewise.
12915 (Layout::make_output_section): Likewise.
12916 (Layout::add_output_section_data): Add is_dynamic_linker_section
12917 parameter. Change all callers.
12918 * layout.h (class Layout): Update declarations.
12919 * output.h (class Output_section): Add is_interp, set_is_interp,
12920 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12921 Add is_interp_, is_dynamic_linker_section_ fields. Change
12922 generate_code_fills_at_write_ to a bitfield.
12923 * output.cc (Output_section::Output_sections): Initialize new
12924 fields.
12925 (Output_segment::add_output_section): Add do_sort parameter.
12926 Change all callers.
12927
12928 2009-11-03 Ian Lance Taylor <iant@google.com>
12929
12930 PR 10860
12931 * options.h (class General_options): Add --warn-common.
12932 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12933 merging two common symbols.
12934 (Symbol_table::should_override): Handle --warn-common when merging
12935 a common symbol with a defined symbol. Use report_resolve_problem
12936 for multiple definitions.
12937 (Symbol_table::report_resolve_problem): New function.
12938 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12939
12940 2009-11-03 Doug Kwan <dougkwan@google.com>
12941
12942 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12943 stub_factory_.
12944 (Target_arm::stub_factory): New method definition.
12945 (Target_arm::new_arm_input_section,
12946 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12947 Target_arm::reloc_uses_thumb_bit): New method declarations.
12948 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12949 New type definitions.
12950 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12951 member declarations.
12952 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12953 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12954 New method definitions.
12955
12956 2009-11-03 Ian Lance Taylor <iant@google.com>
12957
12958 * options.h (class General_options): Add --warn_constructors.
12959
12960 2009-11-03 Ian Lance Taylor <iant@google.com>
12961
12962 PR 10893
12963 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12964 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12965
12966 2009-11-03 Ian Lance Taylor <iant@google.com>
12967
12968 PR 10895
12969 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12970 --msgid-bugs-address.
12971 (install-pdf): New target.
12972 (install-data_yes): Look up one directory to find mkinstalldirs.
12973
12974 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12975
12976 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12977 tree.
12978
12979 2009-10-30 Doug Kwan <dougkwan@google.com>
12980
12981 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12982
12983 2009-10-30 Doug Kwan <dougkwan@google.com>
12984
12985 * arm.cc (Stub_addend_reader): New struct template definition
12986 and partial specializations.
12987 (Stub_addend_reader::operator()): New method definition for a
12988 partially specialized template.
12989
12990 2009-10-30 Doug Kwan <dougkwan@google.com>
12991
12992 * arm.cc (Arm_relobj::processor_specific_flags): New method
12993 definition.
12994 (Arm_relobj::do_read_symbols): New method declaration.
12995 (Arm_relobj::processor_specific_flags_): New data member declaration.
12996 (Arm_dynobj): New class definition.
12997 (Target_arm::do_finalize_sections): Add input_objects parameter.
12998 (Target_arm::do_adjust_elf_header): New method declaration.
12999 (Target_arm::are_eabi_versions_compatible,
13000 (Target_arm::merge_processor_specific_flags): New method declaration.
13001 (Target_arm::do_make_elf_object): New overloaded method definitions
13002 and declaration.
13003 (Arm_relobj::do_read_symbols): New method definition.
13004 (Arm_dynobj::do_read_symbols): Ditto.
13005 (Target_arm::do_finalize_sections): Add input_objects parameters.
13006 Merge processor-specific flags from all input objects.
13007 (Target_arm::are_eabi_versions_compatible,
13008 Target_arm::merge_processor_specific_flags,
13009 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13010 New method definitions.
13011 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13012 Input_objects pointer type parameter.
13013 * layout.cc (Layout::finalize): Pass input objects to target's.
13014 finalize_sections function.
13015 * output.cc (Output_file_header::do_sized_write): Set ELF file
13016 header's processor-specific flags.
13017 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13018 Input_objects pointer type parameter.
13019 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13020 * target.h (Input_objects): New forward class declaration.
13021 (Target::processor_specific_flags,
13022 Target::are_processor_specific_flags_sect): New method definitions.
13023 (Target::finalize_sections): Add input_objects parameter.
13024 (Target::Target): Initialize processor_specific_flags_ and
13025 are_processor_specific_flags_set_.
13026 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13027 parameter.
13028 (Target::set_processor_specific_flags): New method definition.
13029 (Target::processor_specific_flags_,
13030 Target::are_processor_specific_flags_set_): New data member
13031 declarations.
13032 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13033 Input_objects pointer type parameter.
13034
13035 2009-10-30 Doug Kwan <dougkwan@google.com>
13036
13037 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13038
13039 2009-10-28 Ian Lance Taylor <iant@google.com>
13040
13041 * object.h (class Relobj): Drop options parameter from
13042 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13043 do_scan_relocs, do_relocate. Change all callers.
13044 (class Sized_relobj): Drop options parameters from
13045 do_gc_process_relocs, do_scan_relocs, do_relocate,
13046 do_relocate_sections, relocate_sections, emit_relocs_scan,
13047 emit_relocs_scan_reltype. Change all callers.
13048 (struct Relocate_info): Remove options field and all references to
13049 it.
13050 * reloc.h (class Read_relocs): Remove options constructor
13051 parameter and options_ field. Change all callers.
13052 (class Gc_process_relocs, class Scan_relocs): Likewise.
13053 (class Relocate_task): Likewise.
13054 * target-reloc.h (scan_relocs): Remove options parameter. Change
13055 all callers.
13056 (scan_relocatable_relocs): Likewise.
13057 * target.h (class Sized_target): Remove options parameter from
13058 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13059 all callers.
13060 * gc.h (gc_process_relocs): Remove options parameter. Change all
13061 callers.
13062 * arm.cc: Update functions to remove options parameters.
13063 * i386.cc: Likewise.
13064 * powerpc.cc: Likewise.
13065 * sparc.cc: Likewise.
13066 * x86_64.cc: Likewise.
13067 * testsuite/testfile.cc: Likewise.
13068
13069 2009-10-28 Doug Kwan <dougkwan@google.com>
13070
13071 * arm.cc (Arm_relobj): New class definition.
13072 (Arm_relobj::scan_sections_for_stubs,
13073 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13074 New method definitions.
13075
13076 2009-10-28 Cary Coutant <ccoutant@google.com>
13077
13078 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13079 (Plugin::cleanup_done_): New member.
13080 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13081 (Plugin_manager::cleanup_done_): Remove.
13082 (Plugin_manager::add_input_file): Edit error message.
13083 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13084 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13085
13086 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13087
13088 * fileread.cc: (File_read::View::~View): Use the new
13089 data_ownership_ filed.
13090 (File_read::~File_read): Dispose the new whole_file_view_.
13091 (File_read::open): Mmap the whole file if needed.
13092 (File_read::open): Use whole_file_view_ instead of contents_.
13093 (File_read::find_view): Use whole_file_view_ if applicable.
13094 (File_read::do_read): Use whole_file_view_ instead of contents_.
13095 (File_read::make_view): Use whole_file_view_ instead of contents_,
13096 update File_read::View::View call.
13097 (File_read::find_or_make_view): Update File_read::View::View
13098 call.
13099 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13100 remove contents_
13101 (File_read::View::Data_ownership): New enum.
13102 (File_read::View::View): Replace bool mapped_ with Data_ownership
13103 argument.
13104 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13105 (File_read::View::data_ownership_): New field.
13106 (File_read::contents_): Remove (replaced by whole_file_view_).
13107 (File_read::whole_file_view_): New field.
13108 * options.h (class General_options): Add --keep-files-mapped.
13109
13110 2009-10-27 Cary Coutant <ccoutant@google.com>
13111
13112 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13113 * testsuite/Makefile.am (plugin_test_5): New test case.
13114 * testsuite/Makefile.in: Regenerate.
13115
13116 2009-10-25 Doug Kwan <dougkwan@google.com>
13117
13118 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13119 from private to protected to allow access by child class.
13120 (Sized_relobj::do_relocate_sections): New method declaration.
13121 (Sized_relobj::relocate_sections): Virtualize.
13122 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13123 Sized_relobj::relocate_sections. Instantiate template explicitly
13124 for different target sizes and endianity.
13125
13126 2009-10-24 Doug Kwan <dougkwan@google.com>
13127
13128 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13129 (Arm_input_section::as_arm_input_section): New method.
13130 (Arm_output_section): New class definition.
13131 (Arm_output_section::create_stub_group,
13132 Arm_output_section::group_sections): New method definitions.
13133
13134 2009-10-22 Doug Kwan <dougkwan@google.com>
13135
13136 * arm.cc (Arm_input_section): New class definition.
13137 (Arm_input_section::init, Arm_input_section:do_write,
13138 Arm_input_section::set_final_data_size,
13139 Arm_input_section::do_reset_address_and_file_offset): New method
13140 definitions.
13141
13142 2009-10-21 Doug Kwan <dougkwan@google.com>
13143
13144 * arm.cc (Stub_table, Arm_input_section): New forward class
13145 declarations.
13146 (Stub_table): New class defintion.
13147 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13148 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13149 New method definition.
13150
13151 2009-10-21 Doug Kwan <dougkwan@google.com>
13152
13153 * arm.cc: Update copyright comments.
13154 (Target_arm): New forward class template declaration.
13155 (Arm_address): New type.
13156 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13157 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13158 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13159 constants.
13160 (Insn_template): Same.
13161 (DEF_STUBS): New macro.
13162 (Stub_type): New enum type.
13163 (Stub_template): New class definition.
13164 (Stub): Same.
13165 (Reloc_stub): Same.
13166 (Stub_factory): Same.
13167 (Target_arm::Target_arm): Initialize may_use_blx_ and
13168 should_force_pic_veneer_.
13169 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13170 Target_arm::should_force_pic_veneer,
13171 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13172 Target_arm::using_thumb_only, Target_arm:;default_target): New
13173 method defintions.
13174 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13175 New data member declarations.
13176 (Insn_template::size, Insn_template::alignment): New method defintions.
13177 (Stub_template::Stub_template): New method definition.
13178 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13179 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13180 (Stub_factory::Stub_factory): New method definition.
13181 * gold.h (string_hash): New template.
13182 * output.h (Input_section_specifier::hash_value): Use
13183 gold::string_hash.
13184 (Input_section_specifier::string_hash): Remove.
13185 * stringpool.cc (Stringpool_template::string_hash): Use
13186 gold::string_hash.
13187
13188 2009-10-20 Doug Kwan <dougkwan@google.com>
13189
13190 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13191 symbols of relaxed input sections.
13192 * output.h (Output_section::find_relaxed_input_section): Make
13193 method public.
13194
13195 2009-10-16 Doug Kwan <dougkwan@google.com>
13196
13197 * dynobj.cc (Versions::Versions): Initialize version_script_.
13198 Only insert base version symbol definition for a shared object
13199 if version script defines any version versions.
13200 (Versions::define_base_version): New method definition.
13201 (Versions::add_def): Check that base version is not needed.
13202 (Versions::add_need): Define base version lazily.
13203 * dynobj.h (Versions::define_base_version): New method declaration.
13204 (Versions::needs_base_version_): New data member declaration.
13205 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13206 (check_DATA): Add no_version_test.stdout.
13207 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13208 New make rules.
13209 * testsuite/Makefile.in: Regenerate.
13210 * testsuite/no_version_test.c: New file.
13211 * testsuite/no_version_test.sh: Ditto.
13212
13213 2009-10-16 Doug Kwan <dougkwan@google.com>
13214
13215 * expression.cc (class Segment_start_expression): New class definition.
13216 (Segment_start_expression::value): New method definition.
13217 (script_exp_function_segment_start): Return a new
13218 Segment_start_expression.
13219 * gold/script-c.h (script_saw_segment_start_expression): New function
13220 prototype.
13221 * script-sections.cc (Script_sections::Script_sections): Initialize
13222 SAW_SEGMENT_START_EXPRESSION_ to false.
13223 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13224 and -Tbbs options to specify section addresses if given in
13225 command line and no SEGMENT_START expression is seen in a script.
13226 * script-sections.h (Script_sections::saw_segment_start_expression,
13227 Script_sections::set_saw_segment_start_expression): New method
13228 definition.
13229 (Script_sections::saw_segment_start_expression_): New data member
13230 declaration.
13231 * script.cc (script_saw_segment_start_expression): New function.
13232 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13233 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13234 script_test_7.sh and script_test_8.sh.
13235 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13236 script_test_8.stdout.
13237 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13238 (script_test_6, script_test_6.stdout, script_test_7,
13239 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13240 * Makefile.in: Regenerate.
13241 * testsuite/script_test_6.sh: New file.
13242 * testsuite/script_test_6.t: Same.
13243 * testsuite/script_test_7.sh: Same.
13244 * testsuite/script_test_7.t: Same.
13245 * testsuite/script_test_8.sh: Same.
13246
13247 2009-10-16 Doug Kwan <dougkwan@google.com>
13248
13249 * output.cc (Output_segment::set_section_list_address): Cast
13250 expressions to unsigned long long type to avoid format warnings.
13251
13252 2009-10-15 Ian Lance Taylor <iant@google.com>
13253
13254 * script.cc (Script_options::add_symbol_assignment): Always add a
13255 dot assignment to script_sections_.
13256 * script-sections.cc (Script_sections::add_dot_assignment):
13257 Initialize if necessary.
13258
13259 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13260 program headers with no load segment if there is a linker script.
13261
13262 * layout.cc (Layout::set_segment_offsets): Align the file offset
13263 to the segment aligment for -N or -n with no load segment.
13264 * output.cc (Output_segment::add_output_section): Don't crash if
13265 the first section is a TLS section.
13266 (Output_segment::set_section_list_addresses): Print an error
13267 message if the address moves backward in a linker script.
13268 * script-sections.cc
13269 (Output_section_element_input::set_section_addresses): Don't
13270 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13271 (Orphan_output_section::set_section_addresses): Likewise.
13272
13273 2009-10-15 Doug Kwan <dougkwan@google.com>
13274
13275 * layout.cc (Layout::finish_dynamic_section): Generate tags
13276 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13277 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13278 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13279
13280 2009-10-14 Ian Lance Taylor <iant@google.com>
13281
13282 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13283 fields.
13284 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13285 data_shdr fields of relinfo.
13286 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13287 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13288 R_386_TLS_LDO_32, adjust based on section flags.
13289 (Target_i386::Relocate::fix_up_ldo): Remove.
13290
13291 2009-10-13 Ian Lance Taylor <iant@google.com>
13292
13293 Add support for -pie.
13294 * options.h (class General_options): Add -pie and
13295 --pic-executable.
13296 (General_options::output_is_position_independent): Test -pie.
13297 (General_options::output_is_executable): Return true if not shared
13298 and not relocatable.
13299 (General_options::output_is_pie): Remove.
13300 * options.cc (General_options::finalize): Reject incompatible uses
13301 of -pie.
13302 * gold.cc (queue_middle_tasks): A -pie link is not static.
13303 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13304 * symtab.cc (Symbol::final_value_is_known): Return false if
13305 output_is_position_independent.
13306 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13307 output_is_position_independent.
13308 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13309 output_is_position_independent.
13310 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13311 output_is_position_independent.
13312 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13313 two_file_pie_test.
13314 (basic_pie_test.o, basic_pie_test): New targets.
13315 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13316 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13317 (two_file_pie_test): New target.
13318 * testsuite/Makefile.in: Rebuild.
13319 * README: Remove note saying that -pie is not supported.
13320
13321 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13322
13323 * options.h (class General_options): Add -init and -fini.
13324 * layout.cc (Layout::finish_dynamic_section): Emit
13325 given init and fini functions.
13326
13327 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13328
13329 * gc.h (gc_process_relocs): Check if icf is enabled using new
13330 function.
13331 * gold.cc (queue_initial_tasks): Likewise.
13332 (queue_middle_tasks): Likewise.
13333 * object.cc (do_layout): Likewise.
13334 * symtab.cc (is_section_folded): Likewise.
13335 * main.cc (main): Likewise.
13336 * reloc.cc (Read_relocs::run): Likewise.
13337 (Sized_relobj::do_scan_relocs): Likewise.
13338 * icf.cc (is_function_ctor_or_dtor): New function.
13339 (Icf::find_identical_sections): Check if function is ctor or dtor when
13340 safe icf is chosen.
13341 * options.h (General_options::icf): Change option to be an enum.
13342 (Icf_status): New enum.
13343 (icf_enabled): New method.
13344 (icf_safe_folding): New method.
13345 (set_icf_status): New method.
13346 (icf_status_): New variable.
13347 * (options.cc) (General_options::finalize): Set icf_status_.
13348 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13349 icf_test and icf_keep_unique_test to use the --icf enum flag.
13350 * testsuite/icf_safe_test.sh: New file.
13351 * testsuite/icf_safe_test.cc: New file.
13352
13353 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13354
13355 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13356 includes to gc.h and icf.h.
13357 * arm.cc: Include gc.h.
13358 * gold.cc: Likewise.
13359 * i386.cc: Likewise.
13360 * powerpc.cc: Likewise.
13361 * sparc.cc: Likewise.
13362 * x86_64.cc: Likewise.
13363 * gc.h: Include icf.h.
13364
13365 2009-10-11 Ian Lance Taylor <iant@google.com>
13366
13367 * plugin.cc: Include "gold.h" before other header files.
13368
13369 2009-10-10 Chris Demetriou <cgd@google.com>
13370
13371 * options.h (Input_file_argument::Input_file_type): New enum.
13372 (Input_file_argument::is_lib_): Replace with...
13373 (Input_file_argument::type_): New member.
13374 (Input_file_argument::Input_file_argument): Take Input_file_type
13375 'type' rather than boolean 'is_lib' as second argument.
13376 (Input_file_argument::is_lib): Use type_.
13377 (Input_file_argument::is_searched_file): New function.
13378 (Input_file_argument::may_need_search): Handle is_searched_file.
13379 * options.cc (General_options::parse_library): Support -l:filename.
13380 (General_options::parse_just_symbols): Update for Input_file_argument
13381 changes.
13382 (Command_line::process): Likewise.
13383 * archive.cc (Archive::get_file_and_offset): Likewise.
13384 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13385 * script.cc (read_script_file, script_add_file): Likewise.
13386 * fileread.cc (Input_file::Input_file): Likewise.
13387 (Input_file::will_search_for): Handle is_searched_file.
13388 (Input_file::open): Likewise.
13389 * readsyms.cc (Read_symbols::get_name): Likewise.
13390 * testsuite/Makefile.am (searched_file_test): New test.
13391 * testsuite/Makefile.in: Regenerate.
13392 * testsuite/searched_file_test.cc: New file.
13393 * testsuite/searched_file_test_lib.cc: New file.
13394
13395 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13396 Ian Lance Taylor <iant@google.com>
13397
13398 * descriptor.cc: Include <cstdio> and "binary-io.h".
13399 (Descriptors::open): Open the files in binary mode always.
13400 * script.cc (Lex::get_token): Treat \r as whitespace.
13401
13402 2009-10-09 Ian Lance Taylor <iant@google.com>
13403
13404 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13405
13406 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13407 Ian Lance Taylor <iant@google.com>
13408
13409 * configure.ac: Check for readv function also.
13410 * fileread.cc (readv): Define if not HAVE_READV.
13411 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13412 does not exist.
13413 * config.in: Regenerate.
13414 * configure: Regenerate.
13415
13416 2009-10-09 Doug Kwan <dougkwan@google.com>
13417
13418 * layout.cc (Layout::make_output_section): Call target hook to make
13419 ordinary output section.
13420 (Layout::finalize): Adjust parameter list of call the
13421 Target::may_relax().
13422 * layout.h (class Layout::section_list): New method.
13423 * merge.h (Output_merge_base::entsize): Change visibility to public.
13424 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13425 New methods.
13426 (Output_merge_string::do_is_string): New method.
13427 * object.cc (Sized_relobj::do_setup): renamed from
13428 Sized_relobj::set_up.
13429 * object.h (Sized_relobj::adjust_shndx,
13430 Sized_relobj::initializ_input_to_output_maps,
13431 Sized_relobj::free_input_to_output_maps): Change visibilities to
13432 protected.
13433 (Sized_relobj::setup): Virtualize.
13434 (Sized_relobj::do_setup): New method declaration.
13435 (Sized_relobj::invalidate_section_offset,
13436 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13437 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13438 * options.cc (parse_int): New function.
13439 * options.h (parse_int): New declaration.
13440 (DEFINE_int): New macro.
13441 (stub_group_size): New option.
13442 * output.cc (Output_section::Output_section): Initialize memebers
13443 merge_section_map_, merge_section_by_properties_map_,
13444 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13445 (Output_section::add_input_section): Handled deferred code-fill
13446 generation and remove an old comment.
13447 (Output_section::add_relaxed_input_section): New method definition.
13448 (Output_section::add_merge_input_section): Use merge section by
13449 properties map to speed to search. Update merge section maps
13450 as appropriate.
13451 (Output_section::build_relaxation_map): New method definition.
13452 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13453 Same.
13454 (Output_section::relax_input_section): Renamed to
13455 Output_section::convert_input_sections_to_relaxed_sections and change
13456 interface to take a vector of pointers to relaxed sections.
13457 (Output_section::find_merge_section,
13458 Output_section::find_relaxed_input_section): New method definitions.
13459 (Output_section::is_input_address_mapped,
13460 Output_section::output_offset, Output_section::output_address):
13461 Use output section data maps to speed up searching.
13462 (Output_section::find_starting_output_address): Add comments.
13463 (Output_section::do_write,
13464 Output_section::write_to_postprocessing_buffer): Do code-fill
13465 generation as appropriate.
13466 (Output_section::get_input_sections): Invalidate relaxed input section
13467 map.
13468 (Output_section::restore_states): Adjust type of checkpoint .
13469 Invalidate relaxed input section map.
13470 * output.h (Output_merge_base): New class declaration.
13471 (Input_section_specifier): New class defintion.
13472 (class Output_relaxed_input_section) Change base class to
13473 Output_section_data_build.
13474 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13475 base class initializer.
13476 (Output_section::add_relaxed_input_section): New method declaration.
13477 (Output_section::Input_section): Change visibility to protected.
13478 (Output_section::Input_section::relobj,
13479 Output_section::Input_section::shndx): Handle relaxed input sections.
13480 Output_section::input_sections) Change visibility to protected. Also
13481 define overload to return a non-const pointer.
13482 (Output_section::Merge_section_properties): New class defintion.
13483 (Output_section::Merge_section_by_properties_map,
13484 Output_section::Output_section_data_by_input_section_map,
13485 Output_section::Relaxation_map): New types.
13486 (Output_section::relax_input_section): Rename method to
13487 Output_section::convert_input_sections_to_relaxed_sections and change
13488 interface to take a vector of relaxed section pointers.
13489 (Output_section::find_merge_section,
13490 Output_section::find_relaxed_input_section,
13491 Output_section::build_relaxation_map,
13492 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13493 New method declarations.
13494 (Output_section::merge_section_map_
13495 Output_section::merge_section_by_properties_map_,
13496 Output_section::relaxed_input_section_map_,
13497 Output_section::is_relaxed_input_section_map_valid_,
13498 Output_section::generate_code_fills_at_write_): New data members.
13499 * script-sections.cc
13500 (Output_section_element_input::set_section_addresses): Call
13501 current_data_size and addralign methods of relaxed input sections.
13502 (Orphan_output_section::set_section_addresses): Call current_data_size
13503 and addralign methods of relaxed input sections.
13504 * symtab.cc (Symbol_table::compute_final_value): Extract template
13505 from the body of Symbol_table::sized_finalize_symbol.
13506 (Symbol_table::sized_finalized_symbol): Call
13507 Symbol_table::compute_final_value.
13508 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13509 (Symbol_table::compute_final_value): New templated method declaration.
13510 * target.cc (Target::do_make_output_section): New method defintion.
13511 * target.h (Target::make_output_section): New method declaration.
13512 (Target::relax): Add more parameters for input objects, symbol table
13513 and layout. Adjust call to do_relax.
13514 (Target::do_make_output_section): New method declaration.
13515 (Target::do_relax): Add parameters for input objects, symbol table
13516 and layout.
13517
13518 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13519
13520 * pread.c: Include stdio.h.
13521
13522 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13523
13524 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13525 defined.
13526
13527 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13528
13529 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13530 Change read_shndx type to unsigned int.
13531 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13532 int.
13533 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13534 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13535 Change read_shndx type to unsigned int.
13536 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13537 int.
13538 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13539 * layout.cc (Layout::create_symtab_sections): Cast the result of
13540 local_symcount * symsize to off_t in the gold_assert.
13541
13542 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13543
13544 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13545 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13546 R_ARM_BASE_ABS.
13547 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13548 (Arm_relocate_functions::thm_abs5): New function.
13549 (Arm_relocate_functions::abs12): New function.
13550 (Arm_relocate_functions::abs16): New function.
13551 (Arm_relocate_functions::base_abs): New function.
13552 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13553 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13554 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13555 R_ARM_BASE_ABS.
13556 (Scan::global): Likewise.
13557 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13558 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13559 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13560 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13561 R_ARM_BASE_ABS.
13562
13563 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13564
13565 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13566 (Arm_relocate_functions::movt_prel): New function.
13567 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13568 (Arm_relocate_functions::thm_movt_prel): New function.
13569 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13570 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13571 (Scan::global, Relocate::relocate): Likewise.
13572 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13573
13574 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13575
13576 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13577 Incremental_checker.
13578 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13579 unsigned int.
13580 (class Incremental_inputs_header): New class.
13581 (Incremental_inputs_header_writer): Edit comment.
13582 (Incremental_inputs_entry): New class.
13583 (Incremental_inputs_entry_writer): Edit comment.
13584 (Sized_incremental_binary::do_find_incremental_inputs_section):
13585 Add *strtab_shndx parameter, fill it.
13586 (Sized_incremental_binary::do_check_inputs): New method.
13587 (Incremental_checker::can_incrementally_link_output_file): Use
13588 Sized_incremental_binary::check_inputs.
13589 (Incremental_inputs::report_command_line): Save command line in
13590 command_line_.
13591 * incremental.h:
13592 (Incremental_binary::find_incremental_inputs_section): New
13593 method.
13594 (Incremental_binary::do_find_incremental_inputs_section): Add
13595 strtab_shndx parameter.
13596 (Incremental_binary::do_check_inputs): New pure virtual method.
13597 (Sized_incremental_binary::do_check_inputs): Declare.
13598 (Incremental_checker::Incremental_checker): Add incremental_inputs
13599 parameter, use it to initialize incremental_inputs_.
13600 (Incremental_checker::incremental_inputs_): New field.
13601 (Incremental_checker::command_line): New method.
13602 (Incremental_checker::inputs): New method.
13603 (Incremental_checker::command_line_): New field.
13604
13605 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13606
13607 * incremental.cc: Include <cstdarg> and "target-select.h".
13608 (vexplain_no_incremental): New function.
13609 (explain_no_incremental): New function.
13610 (Incremental_binary::error): New method.
13611 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13612 method.
13613 (make_sized_incremental_binary): New function.
13614 (open_incremental_binary): New function.
13615 (can_incrementally_link_file): Add checks if output is ELF and has
13616 inputs section.
13617 * incremental.h: Include "elfcpp_file.h" and "output.h".
13618 (Incremental_binary): New class.
13619 (Sized_incremental_binary): New class.
13620 (open_incremental_binary): Declare.
13621 * object.cc (is_elf_object): Use
13622 elfcpp::Elf_recognizer::is_elf_file.
13623 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13624 * output.h (Output_file::filesize): New method.
13625
13626 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13627
13628 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13629 New function.
13630 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13631 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13632 function.
13633 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13634 function.
13635 (Arm_relocate_functions::movw_abs_nc): New function.
13636 (Arm_relocate_functions::movt_abs): New function.
13637 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13638 (Arm_relocate_functions::thm_movt_abs): New function.
13639 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13640 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13641 (Scan::global): Likewise.
13642 (Relocate::relocate): Likewise.
13643 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13644
13645 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13646
13647 * arm.cc (Arm_relocate_functions::got_prel) New function.
13648 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13649 (Relocate::relocate): Likewise.
13650 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13651
13652 2009-10-06 Ian Lance Taylor <iant@google.com>
13653
13654 * options.h (class General_options): Define
13655 split_stack_adjust_size parameter.
13656 * object.h (class Object): Add uses_split_stack_ and
13657 has_no_split_stack_ fields. Add uses_split_stack and
13658 has_no_split_stack accessor functions. Declare
13659 handle_split_stack_section.
13660 (class Reloc_symbol_changes): Define.
13661 (class Sized_relobj): Define Function_offsets. Declare
13662 split_stack_adjust, split_stack_adjust_reltype, and
13663 find_functions.
13664 * object.cc (Object::handle_split_stack_section): New function.
13665 (Sized_relobj::do_layout): Call handle_split_stack_section.
13666 * dynobj.cc (Sized_dynobj::do_layout): Call
13667 handle_split_stack_section.
13668 * reloc.cc (Sized_relobj::relocate_sections): Call
13669 split_stack_adjust for executable sections in split_stack
13670 objects. Pass reloc_map to relocate_section.
13671 (Sized_relobj::split_stack_adjust): New function.
13672 (Sized_relobj::split_stack_adjust_reltype): New function.
13673 (Sized_relobj::find_functions): New function.
13674 * target-reloc.h: Include "object.h".
13675 (relocate_section): Add reloc_symbol_changes parameter. Change
13676 all callers.
13677 * target.h (class Target): Add calls_non_split method. Declare
13678 do_calls_non_split virtual method. Declare match_view and
13679 set_view_to_nop.
13680 * target.cc: Include "elfcpp.h".
13681 (Target::do_calls_non_split): New function.
13682 (Target::match_view): New function.
13683 (Target::set_view_to_nop): New function.
13684 * gold.cc (queue_middle_tasks): Give an error if mixing
13685 split-stack and non-split-stack objects with -r.
13686 * i386.cc (Target_i386::relocate_section): Add
13687 reloc_symbol_changes parameter.
13688 (Target_i386::do_calls_non_split): New function.
13689 * x86_64.cc (Target_x86_64::relocate_section): Add
13690 reloc_symbol_changes parameter.
13691 (Target_x86_64::do_calls_non_split): New function.
13692 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13693 parameter.
13694 * powerpc.cc (Target_powerpc::relocate_section): Add
13695 reloc_symbol_changes parameter.
13696 * sparc.cc (Target_sparc::relocate_section): Add
13697 reloc_symbol_changes parameter.
13698 * configure.ac: Call AM_CONDITIONAL for the default target.
13699 * configure: Rebuild.
13700 * testsuite/Makefile.am (TEST_AS): New variable.
13701 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13702 (check_DATA): Add split_i386 and split_x86_64 files.
13703 (SPLIT_DEFSYMS): Define.
13704 (split_i386_[1234n].o): New targets.
13705 (split_i386_[124]): New targets.
13706 (split_i386_[1234r].stdout): New targets.
13707 (split_x86_64_[1234n].o): New targets.
13708 (split_x86_64_[124]): New targets.
13709 (split_x86_64_[1234r].stdout): New targets.
13710 (MOSTLYCLEANFILES): Add new executables.
13711 * testsuite/split_i386.sh: New file.
13712 * testsuite/split_x86_64.sh: New file.
13713 * testsuite/split_i386_1.s: New file.
13714 * testsuite/split_i386_2.s: New file.
13715 * testsuite/split_i386_3.s: New file.
13716 * testsuite/split_i386_4.s: New file.
13717 * testsuite/split_i386_n.s: New file.
13718 * testsuite/split_x86_64_1.s: New file.
13719 * testsuite/split_x86_64_2.s: New file.
13720 * testsuite/split_x86_64_3.s: New file.
13721 * testsuite/split_x86_64_4.s: New file.
13722 * testsuite/split_x86_64_n.s: New file.
13723 * testsuite/testfile.cc (Target_test): Update relocation_section
13724 function.
13725 * testsuite/Makefile.in: Rebuild.
13726
13727 2009-10-06 Ian Lance Taylor <iant@google.com>
13728
13729 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13730 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13731 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13732 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13733 the address on ldo_addrs_.
13734 (Target_i386::Relocate::fix_up_ldo): New function.
13735
13736 2009-10-06 Rafael Espindola <espindola@google.com>
13737
13738 * plugin.cc (add_input_library): New.
13739 (Plugin::load): Add add_input_library to tv.
13740 (Plugin_manager::add_input_file): Add the is_lib argument.
13741 (add_input_file): Update call to Plugin_manager::add_input_file.
13742 (add_input_library): New.
13743 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13744
13745 2009-09-30 Doug Kwan <dougkwan@google.com>
13746
13747 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13748 symbol and call Symbol::may_need_copy_reloc to determine if
13749 a copy reloc is needed.
13750 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13751 nocopyreloc is given in command line.
13752 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13753 given in command line.
13754 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13755 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13756 of the removed Target_i386::may_need_copy_reloc.
13757 * options.h (copyreloc): New option with default value false.
13758 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13759 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13760 instead of the removed Target_powerpc::may_need_copy_reloc.
13761 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13762 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13763 instead of the removed Target_sparc::may_need_copy_reloc.
13764 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13765 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13766 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13767 instead of the removed Target_x86_64::may_need_copy_reloc.
13768
13769 2009-09-30 Ian Lance Taylor <iant@google.com>
13770
13771 * object.h (class Object): Remove target_ field, and target,
13772 sized_target, and set_target methods.
13773 (Object::sized_target): Remove.
13774 (class Sized_relobj): Update declarations. Remove sized_target.
13775 * object.cc (Sized_relobj::setup): Remove target parameter.
13776 Change all callers.
13777 (Input_objects::add_object): Don't do anything with the target.
13778 (make_elf_sized_object): Add punconfigured parameter. Change all
13779 callers. Set or test parameter target.
13780 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13781 Change all callers.
13782 * parameters.cc (Parameters::set_target): Change parameter type to
13783 be non-const.
13784 (Parameters::default_target): Remove.
13785 (set_parameters_target): Change parameter type to be non-const.
13786 (parameters_force_valid_target): New function.
13787 (parameters_clear_target): New function.
13788 * parameters.h (class Parameters): Update declarations. Remove
13789 default_target method. Add sized_target and clear_target
13790 methods. Change target_ to be non-const.
13791 (set_parameters_target): Update declaration.
13792 (parameters_force_valid_target): Declare.
13793 (parameters_clear_target): Declare.
13794 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13795 as NULL if we aren't searching.
13796 (Add_symbols::run): Don't check for compatible target.
13797 * fileread.cc (Input_file::open_binary): Call
13798 parameters_force_valid_target.
13799 * gold.cc (queue_middle_tasks): Likewise.
13800 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13801 set_target on object.
13802 * dynobj.h (class Sized_dynobj): Update declarations.
13803 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13804 make_elf_object returns NULL.
13805 (Archive::include_member): Don't check whether object target is
13806 compatible.
13807 * output.cc (Output_section::add_input_section): Get target from
13808 parameters.
13809 (Output_section::relax_input_section): Likewise.
13810 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13811 parameters.
13812 (Sized_relobj::do_scan_relocs): Likewise.
13813 (Sized_relobj::relocate_sections): Likewise.
13814 * resolve.cc (Symbol_table::resolve): Likewise.
13815 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13816 parameter. Change all callers.
13817 (Symbol_table::add_from_object): Get target from parameters.
13818 (Symbol_table::add_from_relobj): Don't check object target.
13819 (Symbol_table::add_from_dynobj): Likewise.
13820 (Symbol_table::define_special_symbol): Get target from
13821 parameters.
13822 * symtab.h (class Symbol_table): Update declaration.
13823 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13824 parameter. Change all callers. Clear parameter target.
13825 (Binary_test): Test target here.
13826 * testsuite/object_unittest.cc (gold_testsuite): Remove
13827 target_test_pointer parameter. Change all callers.
13828 (Object_test): Test target here.
13829
13830 2009-09-26 Ian Lance Taylor <iant@google.com>
13831
13832 * testsuite/initpri1.c: Don't try to use constructor priorities if
13833 compiling with gcc before 4.3.
13834
13835 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13836
13837 * testsuite/retain_symbols_file_test.sh (check_present): Change
13838 output file name to retain_symbols_file_test.stdout.
13839 (check_absent): Likewise.
13840
13841 2009-09-18 Craig Silverstein <csilvers@google.com>
13842
13843 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13844 * options.cc: Include <cerrno> and <fstream>.
13845 (General_options::finalize): Parse -retain-symbols-file tag.
13846 * options.h: New flag.
13847 (General_options): New method should_retain_symbol, new
13848 variable symbols_to_retain.
13849 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13850 should_retain_symbol map.
13851 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13852 * testsuite/Makefile.in: Regenerate.
13853 * testsuite/retain_symbols_file_test.sh: New file.
13854
13855 2009-09-18 Nick Clifton <nickc@redhat.com>
13856
13857 * po/es.po: Updated Spanish translation.
13858
13859 2009-09-17 Doug Kwan <dougkwan@google.com>
13860
13861 * debug.h (DEBUG_RELAXATION): New constant.
13862 (DEBUG_ALL): Add DEBUG_RELAXATION.
13863 (debug_string_to_enum): Add relaxation debug option.
13864 * layout.cc
13865 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13866 Layout::Relaxation_debug_check::read_sections,
13867 Layout::Relaxation_debug_check::read_sections): New method definitions.
13868 (Layout::Layout): Initialize data members
13869 record_output_section_data_from_scrips_,
13870 script_output_section_data_list_ and relaxation_debug_check_.
13871 (Layout::save_segments, Layout::restore_segments,
13872 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13873 Layout::relaxation_loop_body): New method definitions.
13874 (Layout::finalize): Support relaxation. Move section layout code to
13875 Layout::relaxation_loop_body.
13876 (Layout::set_asection_address_from_script): Move code for orphan
13877 section placement out.
13878 (Layout::place_orphan_sections_in_script): New method definition.
13879 * layout.h (Output_segment_headers, Output_file_header):
13880 New forward class declarations.
13881 (Layout::~Layout): Define.
13882 (Layout::new_output_section_data_from_script): New method definition.
13883 (Layout::place_orphan_sections_in_script): New method declaration.
13884 (Layout::Segment_states): New type declaration.
13885 (Layout::save_segments, Layout::restore_segments,
13886 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13887 Layout::relaxation_loop_body): New method declarations.
13888 (Layout::Output_section_data_list): New type declaration.
13889 (Layout::Relaxation_debug_check): New class definition.
13890 (Layout::record_output_section_data_from_script_,
13891 Layout::script_output_section_data_list_, Layout::segment_states_,
13892 Layout::relaxation_debug_check_): New data members.
13893 * output.cc: (Output_section_headers::do_size): New method definition.
13894 (Output_section_headers::Output_section_headers): Move size
13895 computation to Output_section_headers::do_size.
13896 (Output_segment_headers::do_size): New method definition.
13897 (Output_file_header::Output_file_header): Move size computation to
13898 Output_file_header::do_size and call it.
13899 (Output_file_header::do_size): New method definition.
13900 (Output_data_group::Output_data_group): Adjust call to
13901 Output_section_data.
13902 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13903 (Output_symtab_xindex::do_write): Add array bound check.
13904 (Output_section::Input_section::print_to_mapfile): Handle
13905 RELAXED_INPUT_SECTION_CODE.
13906 (Output_section::Output_section): Initialize data member checkpoint_.
13907 (Output_section::~Output_section): Delete checkpoint object pointed
13908 by checkpoint_.
13909 (Output_section::add_input_section): Always add an Input_section if
13910 relaxing.
13911 (Output_section::add_merge_input_section): Add assert.
13912 (Output_section::relax_input_section): New method definition.
13913 (Output_section::set_final_data_size): Set load address to zero for
13914 an unallocated section.
13915 (Output_section::do_address_and_file_offset_have_reset_values):
13916 New method definition.
13917 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13918 Handle relaxed input section.
13919 (Output_section::sort_attached_input_sections): Checkpoint input
13920 section list lazily.
13921 (Output_section::get_input_sections): Change type of input_sections to
13922 list of Simple_input_section pointers. Checkpoint input section list
13923 lazily. Also handle relaxed input sections.
13924 (Output_section::add_input_section_for_script): Take a reference to
13925 a Simple_input_section object instead of Relobj pointer and section
13926 index as parameter. Handle relaxed input sections.
13927 (Output_section::save_states, Output_section::restore_states): New
13928 method definitions.
13929 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13930 (Output_data::is_data_size_fixed): New method definition.
13931 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13932 if it is fixed.
13933 (Output_data::address_and_file_offset_have_reset_values): New method
13934 definition.
13935 (Output_data::do_address_and_file_offset_have_reset_values): New method
13936 definition.
13937 (Output_data::set_data_size): Check that data size is not fixed.
13938 (Output_data::fix_data_size): New method definition.
13939 (Output_data::is_data_size_fixed_): New data member.
13940 (Output_section_headers::set_final_data_size): New method definition.
13941 (Output_section_headers::do_size): New method declaration.
13942 (Output_segment_headers::set_final_data_size): New method definition.
13943 (Output_segment_headers::do_size): New method declaration.
13944 (Output_file_header::set_final_data_size)::New method definition.
13945 (Output_file_header::do_size)::New method declaration.
13946 (Output_section_data::Output_section_data): Add new parameter
13947 is_data_size_fixed and use it to fix data size.
13948 (Output_data_const::Output_data_const): Adjust call to base class
13949 constructor and fix data size.
13950 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13951 base class constructor and fix data size.
13952 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13953 base class constructor and fix data size.
13954 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13955 class constructor and fix data size.
13956 (Output_data_group::set_final_data_size): New method definition.
13957 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13958 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13959 class constructor and fix data size.
13960 (Output_relaxed_input_section): New class definition.
13961 (Output_section::Simple_input_section): New class definition.
13962 (Output_section::get_input_sections): Adjust parameter list.
13963 (Output_section::add_input_section_for_script): Same.
13964 (Output_section::save_states, Output_section::restore_states,
13965 Output_section::do_address_and_file_offset_have_reset_values,
13966 (Output_section::Input_section::Input_section): Handle
13967 RELAXED_INPUT_SECTION_CODE. Add new overload for
13968 Output_relaxed_input_section.
13969 (Output_section::Input_section::is_input_section,
13970 Output_section::Input_section::set_output_section): Handle relaxed
13971 input section.
13972 (Output_section::Input_section::is_relaxed_input_section,
13973 Output_section::Input_section::output_section_data,
13974 Output_section::Input_section::relaxed_input_section): New method
13975 definitions.
13976 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13977 value.
13978 (Output_section::Input_section::u1_): Update comments.
13979 (Output_section::Input_section::u2_): Add new union member poris.
13980 (Output_section::Checkpoint_output_section): New classs definition.
13981 (Output_section::relax_input_section): New method declaration.
13982 (Output_section::checkpoint_): New data member.
13983 (Output_segment): Update comments.
13984 (Output_segment::Output_segment): Un-privatize copy constructor.
13985 (Output_segment::operator=): Un-privatize.
13986 * script-sections.cc (Output_section_element::Input_section_list):
13987 Change element type to Output_section::Simple_input_section.
13988 (Output_section_element_dot_assignment::set_section_addresses):
13989 Register output section data for relaxation clean up.
13990 (Output_data_exression::Output_data_expression): Adjust call to base
13991 constructor to fix data size.
13992 (Output_section_element_data::set_section_addresses): Register
13993 Output_data_expression object for relaxation clean up.
13994 (struct Input_section_info): Replace Relobj pointer and section index
13995 pair with Output_section::Simple_input_section and Convert struct to a
13996 class.
13997 (Input_section_sorter::operator()): Adjust access to
13998 Input_section_info data member to use accessors.
13999 (Output_section_element_input::set_section_addresses): Use layout
14000 parameter. Adjust code to use Output_section::Simple_input_section
14001 and Input_secction_info classes. Register filler for relaxation
14002 clean up.
14003 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14004 and section index pair with Output_section::Simple_input_section
14005 class. Adjust code accordingly.
14006 (Phdrs_element::release_segment): New method definition.
14007 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14008 segment list.
14009 (Script_sections::release_segments): New method definition.
14010 * gold/script-sections.h (Script_sections::release_segments): New
14011 method declaration.
14012 * gold/target.h (Target::may_relax, Target::relax,
14013 Target::do_may_relax, Target::do_relax): New method definitions.
14014
14015 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14016
14017 * arm.cc (has_signed_unsigned_overflow): New function.
14018 (Arm_relocate_functions::abs8): New function.
14019 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14020 (Target_arm::Scan::global): Likewise.
14021 (Target_arm::relocate::relocate): Likewise.
14022 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14023 Likewise.
14024
14025 2009-09-16 Cary Coutant <ccoutant@google.com>
14026
14027 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14028 * testsuite/Makefile.in: Regenerate.
14029
14030 2009-09-11 Nick Clifton <nickc@redhat.com>
14031
14032 * po/gold.pot: Updated by the Translation project.
14033
14034 2009-09-08 Cary Coutant <ccoutant@google.com>
14035
14036 * output.cc (Output_file::open): Add execute permission to empty file.
14037 * testsuite/Makefile.am (permission_test): New test.
14038 * testsuite/Makefile.in: Regenerate.
14039
14040 2009-09-02 Ian Lance Taylor <iant@google.com>
14041
14042 * output.cc (Output_file::resize): Call map_no_anonymous rather
14043 than map.
14044
14045 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14046
14047 * gold.cc: Include "incremental.h".
14048 (queue_initial_tasks): Call Incremental_checker methods.
14049 * incremental.cc: Include "output.h".
14050 (Incremental_checker::can_incrementally_link_output_file): New
14051 method.
14052 * incremental.h (Incremental_checker): New class.
14053
14054 * output.cc (Output_file::open_for_modification): New method.
14055 (Output_file::map_anonymous): Changed return type to bool. Record
14056 map in base_ field.
14057 (Output_file::map_no_anonymous): New method, broken out of map.
14058 (Output_file::map): Use map_no_anonymous and map_anonymous.
14059 * output.h (class Output_file): Update declarations.
14060
14061 2009-08-24 Cary Coutant <ccoutant@google.com>
14062
14063 * options.h (Command_line::Pre_options): New class.
14064 (Command_line::pre_options): New member.
14065 * options.cc (gold::options::ready_to_register): New variable.
14066 (One_option::register_option): Do nothing if not registering options.
14067 Assert if same short option registered twice.
14068 (General_options::General_options): Turn off option registration when
14069 done constructing.
14070 (Command_line::Pre_options::Pre_options): New constructor.
14071
14072 2009-08-24 Cary Coutant <ccoutant@google.com>
14073
14074 * options.h (General_options::no_keep_memory): Remove incorrect
14075 short option.
14076
14077 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14078
14079 * Makefile.am (am__skiplex, am__skipyacc): New.
14080 * Makefile.in: Regenerate.
14081
14082 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14083
14084 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14085 (INCLUDES): ... this.
14086 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14087 (AM_CPPFLAGS): Renamed from ...
14088 (INCLUDE): ... this.
14089 * Makefile.in, testsuite/Makefile.in: Regenerate.
14090
14091 * Makefile.in: Regenerate.
14092 * aclocal.m4: Likewise.
14093 * config.in: Likewise.
14094 * configure: Likewise.
14095 * testsuite/Makefile.in: Likewise.
14096
14097 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14098 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14099 * Makefile.in: Regenerate.
14100 * testsuite/Makefile.in: Regenerate.
14101
14102 2009-08-19 Cary Coutant <ccoutant@google.com>
14103
14104 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14105 symbols in shared libraries overridden by hidden or internal symbols
14106 in the main program.
14107
14108 2009-08-19 Chris Demetriou <cgd@google.com>
14109
14110 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14111 checking source file names in error messages.
14112
14113 2009-08-18 Doug Kwan <dougkwan@google.com>
14114
14115 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14116 an elcpp::Ehdr as parameter. Adjust call to set_target.
14117 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14118 an elfcpp::Ehdr as parameter.
14119 * object.cc (Object::set_target): Remove the version that looks up
14120 a target and sets it.
14121 (Sized_relobj::setup): Take a Target object instead of
14122 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14123 (make_elf_sized_object): Find target and ask target to
14124 make an ELF object.
14125 * object.h: (Object::set_target): Remove the version that looks up
14126 a target and sets it.
14127 (Sized_relobj::setup): Take a Target object instead of
14128 an elfcpp:Ehdr as parameter.
14129 * target.cc: Include dynobj.h.
14130 (Target::do_make_elf_object_implementation): New.
14131 (Target::do_make_elf_object): New.
14132 * target.h (Target::make_elf_object): New template declaration.
14133 (Target::do_make_elf_object): New method declarations.
14134 (Target::do_make_elf_object_implementation): New template declaration.
14135
14136 2009-08-14 Ian Lance Taylor <iant@google.com>
14137
14138 * gold.h (FUNCTION_NAME): Define.
14139 (gold_unreachable): Use FUNCTION_NAME.
14140
14141 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14142
14143 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14144 symbol in the --keep-unique list is not found.
14145
14146 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14147
14148 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14149 been maked as --keep-unique.
14150 (Icf::unfold_section): New function.
14151 * icf.h (Icf::unfold_section): New function.
14152 * options.h (General_options::keep_unique): New option.
14153 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14154 * testsuite/Makefile.in: Regenerate.
14155 * testsuite/icf_keep_unique_test.sh: New file.
14156 * testsuite/icf_keep_unique_test.cc: New file.
14157
14158 2009-08-12 Cary Coutant <ccoutant@google.com>
14159
14160 PR 10471
14161 * resolve.cc (Symbol_table::resolve): Check for references from
14162 dynamic objects to hidden and internal symbols.
14163 * testsuite/Makefile.am (hidden_test.sh): New test.
14164 * testsuite/Makefile.in: Regenerate.
14165 * testsuite/hidden_test.sh: New script.
14166 * testsuite/hidden_test_1.c: New test source.
14167 * testsuite/hidden_test_main.c: New test source.
14168
14169 2009-08-11 Doug Kwan <dougkwan@google.com>
14170
14171 * arm.cc: Update comments.
14172 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14173 segment to locate the .ARM.exidx section if present.
14174
14175 2009-08-09 Doug Kwan <dougkwan@google.com>
14176
14177 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14178 patch.
14179
14180 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14181 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14182 compiler warnings.
14183
14184 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14185
14186 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14187 valid tls_segment only for non-debug-section relocations.
14188 * testsuite/Makefile.am: Add gc_tls_test.
14189 * testsuite/Makefile.in: Regenerate.
14190 * testsuite/gc_tls_test.cc: New file.
14191 * testsuite/gc_tls_test.sh: New file.
14192
14193 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14194
14195 * icf.cc: New file.
14196 * icf.h: New file.
14197 * Makefile.am (CCFILES): Add icf.cc.
14198 (HFILES): Add icf.h
14199 * Makefile.in: Regenerate.
14200 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14201 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14202 section, symbol and addend information for the relocs.
14203 * gold.cc (queue_middle_tasks): Call identical code folding.
14204 * gold.h: Add defines for multimap.
14205 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14206 to the call of finalize_local_symbols.
14207 * main.cc (main): Create object of class Icf.
14208 * object.cc (Sized_relobj::do_layout): Allow this function to be
14209 called twice during icf.
14210 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14211 to sections marked as identical by icf.
14212 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14213 when available.
14214 (Sized_relobj::do_section_entsize): New function.
14215 * object.h (Object::section_entsize): New function.
14216 (Object::do_section_entsize): New pure virtual function.
14217 (Relobj::finalize_local_symbols): Add new parameter.
14218 (Relobj::do_section_entsize): New function.
14219 * options.h (General_options::icf): New option.
14220 (General_options::icf_iterations): New option.
14221 (General_options::print_icf_sections): New option.
14222 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14223 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14224 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14225 icf.
14226 * symtab.cc (Symbol_table::is_section_folded): New function.
14227 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14228 to sections marked as identical by icf.
14229 * symtab.h (Symbol_table::set_icf): New function.
14230 (Symbol_table::icf): New function.
14231 (Symbol_table::is_section_folded): New function.
14232 (Symbol_table::icf_): New data member.
14233 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14234 * testsuite/Makefile.am: Add commands to build icf_test.
14235 * testsuite/Makefile.in: Regenerate.
14236 * testsuite/icf_test.sh: New file.
14237 * testsuite/icf_test.cc: New file.
14238
14239 2009-07-24 Chris Demetriou <cgd@google.com>
14240
14241 * layout.cc (is_compressible_debug_section): Fix incorrect
14242 comment about compressed section names.
14243
14244 2009-07-20 Ian Lance Taylor <ian@airs.com>
14245
14246 PR 10419
14247 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14248
14249 2009-07-16 Ian Lance Taylor <iant@google.com>
14250
14251 PR 10400
14252 * layout.h: #include <map>.
14253 (class Kept_section): Change from struct to class. Add accessors
14254 and setters. Add section size to Comdat_group mapping. Change
14255 Comdat_group to std::map. Add is_comdat_ field. Add
14256 linkonce_size field in union.
14257 (class Layout): Update declaration of find_or_add_kept_section.
14258 Don't declare find_kept_object.
14259 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14260 parameter. Add object, shndx, is_comdat, and is_group_name
14261 parameters. Change all callers. Adjust for new Kept_section.
14262 (Layout::find_kept_object): Remove.
14263 * object.cc (Sized_relobj::include_section_group): Update use of
14264 Kept_section. Rename secnum to shndx. Only record
14265 Kept_comdat_section if sections are the same size.
14266 (Sized_relobj::include_linkonce_section): Update use of
14267 Kept_section. Only record Kept_comdat_section if sections are the
14268 same size. Set size of linkonce section.
14269 (Sized_relobj::map_to_kept_section): Update call to
14270 get_kept_comdat_section.
14271 * object.h (class Sized_relobj): Rename fields in
14272 Kept_comdat_section to drop trailing underscores; change object
14273 field to Relobj*. Change Kept_comdat_section_table to store
14274 struct rather than pointer.
14275 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14276 Add kept_object and kept_shndx parameters. Change all callers.
14277 (Sized_relobj::get_kept_comdat_section): Change return type to
14278 bool. Add kept_object and kept_shndx parameters. Change all
14279 callers.
14280 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14281 Layout::find_or_add_kept_section.
14282
14283 2009-07-09 Ian Lance Taylor <iant@google.com>
14284
14285 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14286 Reserve space in the hash table.
14287
14288 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14289
14290 * fileread.cc (File_read::get_mtime): New method.
14291 * fileread.h (Timespec): New structure.
14292 (File_read::get_mtime): New method.
14293 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14294 Renamed from timestamp_nsec.
14295 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14296 Elf_Xword.
14297 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14298 timestamp_nsec.
14299 (Incremental_inputs::report_archive): Save mtime; style fix.
14300 (Incremental_inputs::report_obejct): Save mtime; style fix.
14301 (Incremental_inputs::report_script): Save mtime; style fix.
14302 (Incremental_inputs::finalize_inputs): Style fix.
14303 (Incremental_inputs::finalize): Style fix.
14304 (Incremental_inputs::create_input_section_data): Store inputs
14305 mtime.
14306 * incremental.h (Incremental_inputs::report_script): Add mtime
14307 argument.
14308 (Incremental_inputs::Input_info::Input_info): Intialize only one
14309 union member.
14310 (Incremental_inputs::Input_info::archive): Move to nameless
14311 union.
14312 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14313 (Incremental_inputs::Input_info::script): Move to nameless union.
14314 (Incremental_inputs::mtime): New field.
14315 * script.cc (read_input_script): Pass file mtime to
14316 Incremental_input.
14317 * script.h (Script_info::inputs): Style fix.
14318
14319 2009-07-01 Ian Lance Taylor <ian@airs.com>
14320
14321 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14322 instead of 32.
14323
14324 2009-06-24 Ian Lance Taylor <iant@google.com>
14325
14326 PR 10156
14327 * layout.cc (Layout::choose_output_section): If we find an
14328 existing section, update the flags.
14329 (Layout::create_notes): New function, broken out of
14330 Layout::finalize.
14331 (Layout::finalize): Don't create note sections.
14332 (Layout::create_note): Don't crash if linker script discards
14333 section.
14334 (Layout::create_gold_note): Likewise.
14335 (Layout::create_build_id): Likewise. Don't set
14336 after_input_sections on the section.
14337 (Layout::create_executable_stack_info): Remove target parameter.
14338 Change caller.
14339 * layout.h (class Layout): Declare create_notes. Update
14340 declaration of create_executable_stack_info.
14341 * gold.cc (queue_middle_tasks): Call create_notes.
14342 * output.cc (Output_section::update_flags_for_input_section): Move
14343 here from output.h. If SHF_ALLOC flag is newly set, mark address
14344 invalid.
14345 * output.h (Output_data::mark_address_invalid): New function.
14346 (class Output_section): Only declare, not define,
14347 update_flags_for_input_section. Remove set_flags.
14348
14349 2009-06-24 Ian Lance Taylor <iant@google.com>
14350
14351 * script-sections.cc (Output_section_definition::
14352 set_section_addresses): Rename shadowing local load_address to
14353 laddr.
14354
14355 2009-06-24 Ian Lance Taylor <iant@google.com>
14356
14357 PR 10244
14358 * reloc.cc (relocate_sections): Skip empty relocation sections.
14359
14360 2009-06-23 Ian Lance Taylor <iant@google.com>
14361
14362 PR 10156
14363 * layout.cc (Layout::create_note): Use choose_output_section
14364 rather than make_output_section.
14365
14366 2009-06-23 Ian Lance Taylor <iant@google.com>
14367
14368 PR 10237
14369 * options.cc (General_options::parse_V): Set printed_version_.
14370 (General_options::General_options): Initialize printed_version_.
14371 * options.h (class General_options): Add printed_version_ field.
14372 * gold.cc (queue_initial_tasks): If there are no input files,
14373 don't give a fatal error if we printed the version information.
14374 (queue_middle_tasks): If using -r with a shared object, give a
14375 fatal error rather than an ordinary error.
14376
14377 2009-06-23 Ian Lance Taylor <iant@google.com>
14378
14379 PR 10219
14380 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14381 (Layout::make_output_section): Set have_stabstr_section_ if we see
14382 a .stab*str section.
14383 (Layout::finalize): Call link_stabs_sections.
14384 (Layout::link_stabs_sections): New file.
14385 * layout.h (class Layout): Add have_stabstr_section_ field.
14386 Declare link_stabs_sections.
14387
14388 2009-06-23 Doug Kwan <dougkwan@google.com>
14389
14390 * Makefile.am (libgold_a_LIBADD): New.
14391 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14392 * Makefile.in: Regenerate.
14393 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14394 * configure: Regenerate.
14395 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14396 * fileread.cc: Include sys/state.h
14397 * gold.h: Declare memmem and strndup if found missing.
14398 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14399
14400 2009-06-23 Ian Lance Taylor <iant@google.com>
14401
14402 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14403 * configure: Rebuild.
14404
14405 2009-06-23 Ian Lance Taylor <iant@google.com>
14406
14407 PR 10147
14408 * object.cc (Object::section_contents): Don't try to get a view if
14409 the section has length zero.
14410 (Object::handle_gnu_warning_section): If the section is empty, use
14411 the name of the section as the warning.
14412
14413 2009-06-23 Ian Lance Taylor <iant@google.com>
14414
14415 PR 10133
14416 * stringpool.h (class Stringpool_template): Add optimize_ field.
14417 (Stringpool_template::set_optimize): New function.
14418 * stringpool.cc (Stringpool_template::Stringpool_template):
14419 Initialize optimize_ field.
14420 (Stringpool_template::set_string_offsets): Test local optimize
14421 fild rather than parameter.
14422 * layout.cc (Layout::Layout): Call set_optimize on the section
14423 name stringpool.
14424
14425 2009-06-22 Ian Lance Taylor <iant@google.com>
14426
14427 PR 10030
14428 * yyscript.y: Parse TARGET.
14429 * script.cc (script_set_target): New function.
14430 * script-c.h (script_set_target): Declare.
14431 * options.cc (General_options::string_to_object_format): Rename
14432 from string_to_object_format in anonymous namespace. Change
14433 callers.
14434 * options.h (class General_options): Declare
14435 string_to_object_format.
14436
14437 2009-06-22 Ian Lance Taylor <iant@google.com>
14438
14439 * script-sections.cc (Script_sections::create_segments): Don't put
14440 program headers in a PT_LOAD segment if -n or -N.
14441
14442 2009-06-22 Ian Lance Taylor <iant@google.com>
14443
14444 PR 10141
14445 * options.h (class General_options): Add -z lazy and -z now. Sort
14446 -z options into alphabetical order.
14447 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14448
14449 2009-06-21 Ian Lance Taylor <iant@google.com>
14450
14451 * layout.cc (Layout::make_output_section): Call
14452 Target::new_output_section.
14453 (Layout::attach_allocated_section_to_segment): Put large section
14454 sections in a separate load segment with the large segment flag
14455 set.
14456 (Layout::segment_precedes): Sort large data segments after other
14457 load segments.
14458 (align_file_offset): New static function.
14459 (Layout::set_segment_offsets): Use align_file_offset.
14460 * output.h (class Output_section): Add is_small_section_ and
14461 is_large_section_ fields.
14462 (Output_section::is_small_section): New function.
14463 (Output_section::set_is_small_section): New function.
14464 (Output_section::is_large_section): New function.
14465 (Output_section::set_is_large_section): New function.
14466 (Output_section::is_large_data_section): New function.
14467 (class Output_segment): Add is_large_data_segment_ field.
14468 (Output_segment::is_large_data_segment): New function.
14469 (Output_segment::set_is_large_data_segment): New function.
14470 * output.cc (Output_section::Output_section): Initialize new
14471 fields.
14472 (Output_segment::Output_segment): Likewise.
14473 (Output_segment::add_output_section): Add assertion that large
14474 data sections always go in large data segments. Force small data
14475 sections to the end of the list of data sections. Force small BSS
14476 sections to the start of the list of BSS sections. For large BSS
14477 sections to the end of the list of BSS sections.
14478 * symtab.h (class Symbol): Declare is_common_shndx.
14479 (Symbol::is_defined): Check Symbol::is_common_shndx.
14480 (Symbol::is_common): Likewise.
14481 (class Symbol_table): Define enum Commons_section_type. Update
14482 declarations. Add small_commons_ and large_commons_ fields.
14483 * symtab.cc (Symbol::is_common_shndx): New function.
14484 (Symbol_table::Symbol_table): Initialize new fields.
14485 (Symbol_table::add_from_object): Put small and large common
14486 symbols in the right list.
14487 (Symbol_table::sized_finalized_symbol): Check
14488 Symbol::is_common_shndx.
14489 (Symbol_table::sized_write_globals): Likewise.
14490 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14491 common symbol lists. Don't call do_allocate_commons_list if the
14492 list is empty.
14493 (Symbol_table::do_allocate_commons_list): Remove is_tls
14494 parameter. Add comons_section_type parameter. Change all
14495 callers. Handle small and large common symbols.
14496 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14497 Symbol::is_common_shndx.
14498 * resolve.cc (symbol_to_bits): Likewise.
14499 * target.h (Target::small_common_shndx): New function.
14500 (Target::small_common_section_flags): New function.
14501 (Target::large_common_shndx): New function.
14502 (Target::large_common_section_flags): New function.
14503 (Target::new_output_section): New function.
14504 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14505 small_common_section_flags, and large_common_section_flags
14506 fields.
14507 (Target::do_new_output_section): New virtual function.
14508 * arm.cc (Target_arm::arm_info): Initialize new fields.
14509 * i386.cc (Target_i386::i386_info): Likewise.
14510 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14511 Likewise.
14512 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14513 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14514 (Target_x86_64::do_new_output_section): New function.
14515 * configure.ac: Define conditional MCMODEL_MEDIUM.
14516 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14517 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14518 (large_LDFLAGS): Define.
14519 * testsuite/large.c: New file.
14520 * testsuite/testfile.cc (Target_test::test_target_info):
14521 Initialize new fields.
14522 * configure, testsuite/Makefile.in: Rebuild.
14523
14524 2009-06-05 Doug Kwan <dougkwan@google.com>
14525
14526 * Makefile.am (CCFILES): Add target.cc.
14527 * Makefile.in: Regenerate.
14528 * i386.cc (class Target_i386): Define new virtual method to
14529 override do_is_local_label_name in parent.
14530 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14531 local symbols if --discard-locals or -X is given.
14532 * options.h (class General_options): Declare new options
14533 '--discard-locals' and '-X' for discarding locals.
14534 * target.h (class Target): Define new methods is_local_label_name.
14535 Declare new virtual method do_is_local_label_name.
14536 * target.cc: New file.
14537 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14538 (check_SCRIPTS): Add discard_locals_test.sh.
14539 (check_DATA): Add discard_local_tests.syms.
14540 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14541 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14542 * testsuite/Makefile.in: Regenerate.
14543 * testsuite/discard_locals_test.c: New file.
14544 * testsuite/discard_locals_test.sh: Same.
14545
14546 2009-06-05 Doug Kwan <dougkwan@google.com>
14547
14548 * object.cc (Sized_relobj::Sized_relobj): Initialize
14549 discarded_eh_frame_shndx_ to -1U.
14550 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14551 section.
14552 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14553 a discarded .eh_frame section.
14554 (Sized_relobj::do_finalize_local_symbols): Ditto.
14555 * object.h (class Sized_relobj): Declare new member
14556 discarded_eh_frame_shndx_.
14557 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14558 (local_labels_test.o, local_labels_test): New rules.
14559 * testsuite/Makefile.in: Regenerate.
14560
14561 2009-06-04 Doug Kwan <dougkwan@google.com>
14562
14563 * layout.cc (Layout::section_name_mapping): Add mapping for
14564 special ARM sections.
14565
14566 2009-06-03 Doug Kwan <dougkwan@google.com>
14567
14568 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14569 (utils::has_overflow): Same.
14570
14571 2009-06-03 Ian Lance Taylor <iant@google.com>
14572
14573 * layout.cc (Layout::section_name_mapping): New array, replacing
14574 Layout::linkonce_mapping.
14575 (Layout::section_name_mapping_count): New variable, replacing
14576 Layout::linkonce_mapping_count.
14577 (Layout::linkonce_output_name): Remove.
14578 (Layout::output_section_name): Rewrite.
14579 * layout.h (class Layout): Rename Linkonce_mapping to
14580 Section_name_mapping, linkonce_mapping to section_name_mapping,
14581 linkonce_mapping_count to section_name_mapping_count. Don't
14582 declare linkonce_output_name.
14583
14584 2009-06-03 Doug Kwan <dougkwan@google.com>
14585
14586 * gold/arm.cc (namespace utils): New.
14587 (Target_arm::reloc_is_non_pic): Define new method.
14588 (class Arm_relocate_functions): New.
14589 (Target_arm::Relocate::relocate): Handle relocation types used by
14590 Android.
14591
14592 2009-06-03 Ian Lance Taylor <iant@google.com>
14593
14594 * arm.cc (Target_arm::scan::global): Use || instead of |.
14595
14596 2009-06-02 Doug Kwan <dougkwan@google.com>
14597
14598 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14599 issued_non_pic_error_.
14600 (class Target_arm::Scan): Declare new method check_non_pic.
14601 Define new method symbol_needs_plt_entry.
14602 Declare new data member issued_non_pic_error_.
14603 (class Target_arm::Relocate): Declare new method
14604 should_apply_static_reloc.
14605 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14606 (Target_arm::Scan::check_non_pic): Define new method.
14607 (Target_arm::Scan::local): Handle a small subset of reloc types used
14608 by Android.
14609 (Target_arm::Scan::local): Same.
14610 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14611
14612 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14613
14614 * incremental.cc (Incremental_inputs::report_command_line): Filter
14615 out --incremental-* options.
14616
14617 2009-05-29 Doug Kwan <dougkwan@google.com>
14618
14619 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14620 template class.
14621 (class Target_arm): Update comment.
14622 (Target_arm::Target_arm): Initialize new data members GOT_,
14623 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14624 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14625 and Target_arm::rel_dyn_section.
14626 Declare new_enum Target_arm::Got_type.
14627 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14628 and DYNBSS_.
14629 Update commments for member do_dynsym_value.
14630 (Target_arm::got_size, Target_arm::plt_section,
14631 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14632 new methods inside class defintion.
14633 (Target_arm::got_section): Define new method.
14634 (Target_arm::rel_dyn_section): Same.
14635 (Output_data_plt_arm): New template class.
14636 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14637 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14638 (Output_data_plt_arm::add_entry): Same.
14639 (Output_data_plt_arm::first_plt_entry): Define new
14640 static data member for PLT instruction template.
14641 (Output_data_plt_arm::plt_entry): Same.
14642 (Output_data_plt_arm::do_write): Define new method.
14643 (Target_arm::make_plt_entry): Same.
14644 (Target_arm::do_finalize_sections): Same.
14645 (Target_arm::do_dynsym_value): Same.
14646
14647 2009-05-28 Doug Kwan <dougkwan@google.com>
14648
14649 * Makefile.am (TARGETSOURCES): Add arm.cc.
14650 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14651 * Makefile.in: Regenerate.
14652 * arm.cc: New file.
14653 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14654
14655 2009-05-26 Doug Kwan <dougkwan@google.com>
14656
14657 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14658 (General_options::check_excluded_libs): Strip off directories in
14659 archive name before matching like GNU ld does.
14660 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14661 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14662 (exclude_libs_test_LDFLAGS): Add linker option
14663 -Wl,--exclude-libs,libexclude_libs_test_3
14664 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14665 an explicit archive without using -l.
14666 (alt/libexclude_libs_test_3.a): New make rule.
14667 * testsuite/Makefile.in: Regenerate.
14668 * testsuite/exclude_libs_test.c : Declare lib3_default().
14669 (main): Call it.
14670 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14671 * exclude_libs_test_3.c: New file.
14672
14673 2009-05-26 Nick Clifton <nickc@redhat.com>
14674
14675 * po/id.po: New Indonesian translation.
14676 * po/gold.pot: Updated template file.
14677
14678 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14679
14680 * testsuite/Makefile.am: Add -ffunction-sections to compile
14681 gc_comdat_test files. Add -Wl,--gc-sections to build
14682 gc_comdat_test.
14683 * testsuite/Makefile.in: Regenerate.
14684 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14685
14686 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14687
14688 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14689 kept comdat section was garbage collected.
14690 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14691 * testsuite/Makefile.in: Regenerate.
14692 * testsuite/gc_comdat_test.sh: New file.
14693 * testsuite/gc_comdat_test_1.cc: New file.
14694 * testsuite/gc_comdat_test_2.cc: New file.
14695
14696 2009-05-19 Doug Kwan <dougkwan@google.com>
14697
14698 * archive.cc (Archive::Archive): Move constructor from archive.h
14699 to here. Initialize no_export_.
14700 (Archive::get_elf_object_for_member): Set no_export flag of object.
14701 * archive.h (Archive::Archive): Move constructor body to
14702 archive.cc.
14703 (Archive::no_export): New method.
14704 (Archive::no_export_): New field.
14705 * object.h (Object::Object): Initialize no_export_ to false.
14706 (Object::no_export, Object::set_no_export): New methods.
14707 (Object::no_export_): New field.
14708 * options.cc (General_options::parse_exclude_libs): New method.
14709 (General_options::check_excluded_libs) Same.
14710 * options.h (exclude_libs): New option.
14711 (General_options::check_excluded_libs): New method declaration.
14712 (General_options::excluded_libs_): New field.
14713 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14714 default or protected visibility if an object has no-export flag set.
14715 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14716 (check_SCRIPTS): Add exclude_libs_test.sh.
14717 (check_DATA): Add exclude_libs_test.syms.
14718 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14719 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14720 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14721 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14722 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14723 libexclude_libs_test_2.a): New rules.
14724 * testsuite/Makefile.in: Regenerate.
14725 * testsuite/exclude_libs_test.c: New file.
14726 * testsuite/exclude_libs_test.sh: Ditto.
14727 * testsuite/exclude_libs_test_1.c: Ditto.
14728 * testsuite/exclude_libs_test_2.c: Ditto.
14729
14730 2009-05-15 Ian Lance Taylor <iant@google.com>
14731
14732 * configure.ac: Check for declarations for cases where libiberty.h
14733 checks HAVE_DECL_xxx.
14734 * configure, config.in: Rebuild.
14735
14736 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14737
14738 * gold.h (Incremental_argument_list): Remove (invalid) forward
14739 declaration.
14740 * incremental.cc (Incremental_inputs::report_achive): New method.
14741 (Incremental_inputs::report_object): New method.
14742 (Incremental_inputs::report_script): New method.
14743 (Incremental_inputs::finalize_inputs): New method.
14744 (Incremental_inputs::finalize): Call finalize_inputs().
14745 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14746 Create inputs entries.
14747 * incremental.h (Incremental_input_type): New enum.
14748 (Incremental_inputs::Incremental_input): Initialize new fields.
14749 (Incremental_inputs::report_inputs): New method.
14750 (Incremental_inputs::report_achive): New method.
14751 (Incremental_inputs::report_object): New method.
14752 (Incremental_inputs::report_script): New method.
14753 (Incremental_inputs::finalize_inputs): New method.
14754 (Incremental_inputs::Input_info): New struct.
14755 (Incremental_inputs::Input_info_map): New typedef.
14756 (Incremental_inputs::lock_): New field.
14757 (Incremental_inputs::Inputs_): New field.
14758 (Incremental_inputs::Inputs_map): New field.
14759 * main.cc (main): Call Incremental_input::report_inputs.
14760 * options.h (Input_argument_list): Typedef moved from
14761 Input_arguments.
14762 (Input_file_group::Files): Remove, use ::Input_argument_list.
14763 (Input_file_group::Input_argument_list): Remove, use
14764 ::Input_argument_list.
14765 * plugin.cc (Plugin_manager::add_input_file): Add error in
14766 incremental build.
14767 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14768 functions.
14769 * script.cc (read_input_script): Call
14770 Incremental_input::report_script.
14771 * script.h (Script_info): New class.
14772
14773 2009-04-27 Ian Lance Taylor <iant@google.com>
14774
14775 * x86_64.cc (do_adjust_output_section): Set entsize to
14776 plt_entry_size.
14777
14778 2009-04-23 Elliott Hughes <enh@google.com>
14779
14780 * output.cc (Output_file::close): After short writes, continue
14781 writing from the correct offset in the buffer being written.
14782
14783 2009-04-23 Chris Demetriou <cgd@google.com>
14784
14785 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14786 * configure: Regenerate.
14787 * config.in: Regenerate.
14788 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14789 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14790
14791 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14792
14793 * incremental.cc (Incremental_inputs_header_data): Renamed from
14794 Incremental_input_header_data.
14795 (Incremental_inputs_header_data::data_size): New field.
14796 (Incremental_inputs_header_data::put_input_file_count): Renamed
14797 from input_file_count.
14798 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14799 from command_line_offset.
14800 (Incremental_inputs_header_data::put_reserved): Renamed from
14801 put_reserved.
14802 (Incremental_inputs_entry_data): Renamed from
14803 Incremental_input_entry_data.
14804 (Incremental_inputs_entry_data::data_size): New field.
14805 (Incremental_inputs::report_command_line): New method.
14806 (Incremental_inputs::finalize): New method.
14807 (Incremental_inputs::create_incremental_inputs_data): New method.
14808 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14809 * incremental.h: New file.
14810 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14811 (Layout::finalize): Create incremental inputs section in
14812 incremental builds.
14813 (Layout::create_incremental_info_sections): New method.
14814 * layout.h (Layout::incremental_inputs): New method.
14815 (Layout::create_incremental_info_sections): New method.
14816 (Layout::incremental_inputs_): New field.
14817 * main.cc (main): Notify Incremental_input of the command line.
14818
14819 2009-04-01 Ian Lance Taylor <iant@google.com>
14820 Mikolaj Zalewski <mikolajz@google.com>
14821
14822 * gold.h (reserve_unordered_map): Define, three versions, one for
14823 each version of Unordered_map.
14824 * layout.cc (Layout::Layout): Remove options parameter. Add
14825 number_of_input_files parameter. Don't initialize options_.
14826 Initialize number_of_input_files_ and resized_signatures_. Move
14827 sections_are_attached_.
14828 (Layout::layout_group): Reserve space for group_signatures_.
14829 (Layout::find_or_add_kept_section): Change name parameter to be a
14830 reference. Resize signatures_ map when it gets large enough.
14831 (Layout::layout_eh_frame): Use parameters->options() instead of
14832 this->options_.
14833 (Layout::make_output_section): Likewise.
14834 (Layout::attach_allocated_section_to_segment): Likewise.
14835 (Layout::finalize, Layout::create_executable_stack): Likewise.
14836 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14837 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14838 * layout.h (class Layout): Update declarations. Remove options_
14839 field. Add number_of_input_files_ and resized_signatures_
14840 fields. Move sections_are_attached_ field.
14841 * main.cc (main): Pass number of input files to Layout
14842 constructor. Don't pass options.
14843
14844 2009-03-30 Ian Lance Taylor <iant@google.com>
14845
14846 * ffsll.c (ffsll): Correct implementation.
14847
14848 2009-03-27 Ian Lance Taylor <iant@google.com>
14849
14850 * ffsll.c: New file.
14851 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14852 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14853 * ftruncate.c (ftruncate): Declare before definition.
14854 * mremap.c (mremap): Likewise.
14855 * pread.c (pread): Likewise.
14856 * configure, Makefile.in, config.in: Rebuild.
14857
14858 * mremap.c: New file.
14859 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14860 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14861 (mremap): Declare if HAVE_MREMAP is not defined.
14862 * configure, Makefile.in, config.in: Rebuild.
14863
14864 2009-03-27 Cary Coutant <ccoutant@google.com>
14865
14866 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14867 position independent.
14868 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14869 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14870
14871 2009-03-24 Cary Coutant <ccoutant@google.com>
14872
14873 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14874 an executable.
14875 (needs_dynamic_reloc): Likewise.
14876
14877 2009-03-24 Ian Lance Taylor <iant@google.com>
14878
14879 * yyscript.y (file_cmd): Recognize EXTERN.
14880 (extern_name_list, extern_name_list_body): New nonterminals.
14881 * script.cc (script_add_extern): Define.
14882 * script-c.h (script_add_extern): Declare.
14883
14884 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14885
14886 * object.cc (is_elf_object): Define.
14887 * object.h (is_elf_object): Declare.
14888 * archive.cc (Archive::get_elf_object_for_member): Call
14889 is_elf_object.
14890 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14891
14892 2009-03-24 Elliott Hughes <enh@google.com>
14893
14894 * output.cc (Output_file::map_anonymous): Define.
14895 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14896 try an anonymous one. Report the size if the mmap fails.
14897 * output.h (class Output_file): Declare map_anonymous.
14898
14899 2009-03-24 Ian Lance Taylor <iant@google.com>
14900
14901 * target-select.cc (instantiate_target): Don't acquire the lock if
14902 the instantiated_target_ field has already been set.
14903
14904 2009-03-23 Ian Lance Taylor <iant@google.com>
14905
14906 * gold-threads.h (class Initialize_lock): Define.
14907 * gold-threads.cc (class Initialize_lock_once): Define.
14908 (initialize_lock_control): New static variable.
14909 (initialize_lock_pointer): New static variable.
14910 (initialize_lock_once): New static function.
14911 (Initialize_lock::Initialize_lock): Define.
14912 (Initialize_lock::initialize): Define.
14913 * target-select.h: Include "gold-threads.h".
14914 (class Target_selector): Add lock_ and initialize_lock_ fields.
14915 Don't define instantiate_target, just declare it.
14916 * target-select.cc (Target_selector::Target_selector): Initialize
14917 new fields.
14918 (Target_selector::instantiate_target): Define.
14919 * descriptors.h: Include "gold-threads.h".
14920 (class Descriptors): Add initialize_lock_ field.
14921 * descriptors.cc (Descriptors::Descriptors): Initialize new
14922 field.
14923 (Descriptors::open): Use initialize_lock_ field
14924 * errors.h (class Errors): Add initialize_lock_ field.
14925 * errors.cc (Errors::Errors): Initialize new field.
14926 (Errors::initialize_lock): Use initialize_lock_ field.
14927 * powerpc.cc (class Target_selector_powerpc): Remove
14928 instantiated_target_ field. In do_recognize call
14929 instantiate_target rather than do_instantiate_target. In
14930 do_instantiate_target just allocate a new target.
14931 * sparc.cc (class Target_selector_sparc): Likewise.
14932
14933 * freebsd.h: New file.
14934 * i386.cc: Include "freebsd.h".
14935 (Target_i386): Derive from Target_freebsd rather than
14936 Sized_target.
14937 (Target_selector_i386): Derive from Target_selector_freebsd rather
14938 than Target_selector.
14939 * x86_64.cc: Include "freebsd.h".
14940 (Target_x86_64): Derive from Target_freebsd rather than
14941 Sized_target.
14942 (Target_selector_x86_64): Derive from Target_selector_freebsd
14943 rather than Target_selector.
14944 * target.h (class Target): Add adjust_elf_header and
14945 do_adjust_elf_header.
14946 * output.cc (Output_file_header:: do_sized_write): Call target
14947 adjust_elf_header routine.
14948 * configure.tgt: Set targ_osabi.
14949 * configure.ac: Define GOLD_DEFAULT_OSABI.
14950 * parameters.cc (Parameters::default_target): Pass
14951 GOLD_DEFAULT_OSABI to select_target.
14952 * target-select.h (class Target_selector): Make instantiate_target
14953 protected rather than private.
14954 * Makefile.am (HFILES): Add freebsd.h.
14955 * configure, Makefile.in, config.in: Rebuild.
14956
14957 * merge.cc (do_add_input_section): Correct pend value. Change
14958 message about last entry not being null terminated from error to
14959 warning.
14960
14961 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14962
14963 * incremental.cc: New file.
14964 * Makefile.am (CCFILES): Add incremental.cc.
14965 * Makefile.in: Rebuild.
14966
14967 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14968
14969 * layout.cc (Layout::output_section_name): Preserve names
14970 of '.note.' sections.
14971
14972 2009-03-19 Ian Lance Taylor <iant@google.com>
14973
14974 * descriptors.cc (Descriptors::open): Check that the options are
14975 valid before using them.
14976
14977 2009-03-18 Ian Lance Taylor <iant@google.com>
14978
14979 * script-sections.h: Include <list>.
14980 (class Script_sections): Change Sections_elements from std::vector
14981 to std::list. Typedef public Elements_iterator. Add
14982 orphan_section_placement_, data_segment_align_start_, and
14983 saw_data_segment_align_ fields. Remove data_segment_align_index_
14984 field.
14985 * script-sections.cc (class Orphan_section_placement): New class.
14986 (class Sections_element): Add virtual functions is_relro and
14987 orphan_section_init. Remove virtual function place_orphan_here.
14988 (class Output_section_definition): Add is_relro and
14989 orphan_section_init. Remove place_orphan_here.
14990 (class Orphan_output_section): Likewise.
14991 (Script_sections::Script_sections): Update for field changes.
14992 (Script_sections::data_segment_align): Set saw_data_segment_align_
14993 and data_segment_align_start_, not data_segment_align_index.
14994 (Script_sections::data_segment_relro_end): Check
14995 saw_data_segment_align_. Use data_segment_align_start_ rather
14996 than data_segment_align_index_.
14997 (Script_sections::place_orphan): Rewrite to use
14998 Orphan_section_placement.
14999
15000 2009-03-17 Ian Lance Taylor <iant@google.com>
15001
15002 * archive.cc (Archive::add_symbols): Check for a version attached
15003 to the symbol name in the archive map.
15004 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15005 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15006 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15007 (ver_test_11.a): New target.
15008 * testsuite/Makefile.in: Rebuild.
15009
15010 * configure.ac: Check for chsize and posix_fallocate. Replace
15011 ftruncate.
15012 * ftruncate.c: New file, from gnulib.
15013 * output.cc (posix_fallocate): Define dummy version if not
15014 HAVE_POSIX_FALLOCATE.
15015 (Output_file::map): Call posix_fallocate rather than lseek and
15016 write.
15017 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15018 * configure, Makefile.in, config.in: Rebuild.
15019
15020 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
15021
15022 * layout.h (Layout::create_note): Add section_name parameter.
15023 * layout.cc (Layout::create_note): Likewise.
15024 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
15025
15026 2009-03-17 Ian Lance Taylor <iant@google.com>
15027
15028 * descriptors.cc: Include "options.h".
15029 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15030 (Descriptors::open): Always use O_CLOEXEC when opening a new
15031 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15032 then set FD_CLOEXEC.
15033
15034 * sparc.cc (class Target_sparc): Add has_got_section.
15035 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15036 make sure we have a GOT section.
15037
15038 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15039 (Target_sparc::Scan::local): Likewise.
15040 (Target_sparc::Scan::global): Likewise.
15041 (Target_sparc::Relocate::relocate): Likewise.
15042 (Target_sparc::Relocate::relocate_tls): Likewise.
15043
15044 * symtab.cc (Symbol_table::define_default_version): New function,
15045 broken out of add_from_object.
15046 (Symbol_table::add_from_object): Call define_default_version.
15047 (Symbol_table::define_special_symbol): Add resolve_oldsym
15048 parameter. Change all callers. If the version for a symbol comes
15049 from a version script, resolve it with the symbol with the same
15050 name with no version. Also add the symbol without a version if
15051 appropriate.
15052 (do_define_in_output_data): If resolving with oldsym, don't delete
15053 sym.
15054 (do_define_in_output_segment): Likewise.
15055 (do_define_as_constant): Likewise.
15056 * symtab.h (class Symbol_table): Update declarations.
15057
15058 2009-03-13 Ian Lance Taylor <iant@google.com>
15059
15060 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15061 (Read_symbols::requeue): New function.
15062 (Read_symbols::do_read_symbols): If make_elf_object fails because
15063 the target type is not configured, and the file was searched for,
15064 issue a warning and retry with the next directory.
15065 (Add_symbols::run): If the file has an incompatible format, and
15066 it was searched for, requeue the Read_symbols task. On error,
15067 release the object.
15068 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15069 dirindex parameter to constructor. Change all callers. Declare
15070 incompatible_warning and requeue.
15071 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15072 input_argument_ and input_group_ fields. Add them to
15073 constructor. Change all callers.
15074 (class Read_script): Add dirindex_ field. Add it to constructor.
15075 Change all callers.
15076 * archive.cc (Archive::setup): Remove input_objects parameter.
15077 Change all callers.
15078 (Archive::get_file_and_offset): Likewise.
15079 (Archive::read_all_symbols): Likewise.
15080 (Archive::read_symbols): Likewise.
15081 (Archive::get_elf_object_for_member): Remove input_objects
15082 parameter. Add punconfigured parameter. Change all callers.
15083 (Archive::add_symbols): Change return type to bool. Check return
15084 value of include_member.
15085 (Archive::include_all_members): Likewise.
15086 (Archive::include_member): Change return type to bool. Return
15087 false if first included object has incompatible target. Set
15088 included_member_ field.
15089 (Add_archive_symbols::run): If add_symbols returns false, requeue
15090 Read_symbols task.
15091 * archive.h (class Archive): Add included_member_ field.
15092 Initialize it in constructor. Add input_file and searched_for
15093 methods. Update declarations.
15094 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15095 input_argument_ fields. Add them to constructor. Change all
15096 callers.
15097 * script.cc: Include "target-select.h".
15098 (class Parser_closure): Add skip_on_incompatible_target_ and
15099 found_incompatible_target_ fields. Add
15100 skip_on_incompatible_target parameter to constructor. Change all
15101 callers. Add methods skip_on_incompatible_target,
15102 clear_skip_on_incompatible_target, found_incompatible_target, and
15103 set_found_incompatible_target.
15104 (read_input_script): Add dirindex parameter. Change all callers.
15105 If parser finds an incompatible target, requeue Read_symbols
15106 task.
15107 (script_set_symbol): Clear skip_on_incompatible_target in
15108 closure.
15109 (script_add_assertion, script_parse_option): Likewise.
15110 (script_start_sections, script_add_phdr): Likewise.
15111 (script_check_output_format): New function.
15112 * script.h (read_input_script): Update declaration.
15113 * script-c.h (script_check_output_format): Declare.
15114 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15115 (ignore_cmd): Remove OUTPUT_FORMAT.
15116 * fileread.cc (Input_file::Input_file): Add explicit this.
15117 (Input_file::will_search_for): New function.
15118 (Input_file::open): Add pindex parameter. Change all callers.
15119 * fileread.h (class Input_file): Add input_file_argument method.
15120 Declare will_search_for. Update declarations.
15121 * object.cc (make_elf_object): Add punconfigured parameter.
15122 Change all callers.
15123 * object.h (class Object): Make input_file public. Add
15124 searched_for method.
15125 (make_elf_object): Update declaration.
15126 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15127 restart search.
15128 * dirsearch.h (class Dirsearch): Update declaration.
15129 * options.h (class General_options): Add --warn-search-mismatch.
15130 * parameters.cc (Parameters::is_compatible_target): New function.
15131 * parameters.h (class Parameters): Declare is_compatible_target.
15132 * workqueue.cc (Workqueue::add_blocker): New function.
15133 * workqueue.h (class Workqueue): Declare add_blocker.
15134
15135 * fileread.cc (Input_file::open): Remove options parameter.
15136 Change all callers.
15137 (Input_file::open_binary): Likewise.
15138 * script.cc (read_input_script): Likewise.
15139 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15140 options parameter from constructor. Change all callers.
15141 (class Read_script): Likewise.
15142 * fileread.h (class Input_file): Update declarations.
15143 * script.h (read_input_script): Update declaration.
15144
15145 2009-03-10 Nick Clifton <nickc@redhat.com>
15146
15147 * po/es.po: New Spanish translation.
15148
15149 2009-03-06 Cary Coutant <ccoutant@google.com>
15150
15151 * options.cc (parse_short_option): Keep dash_z from registering itself.
15152
15153 2009-03-03 Ian Lance Taylor <iant@google.com>
15154
15155 PR 9918
15156 * target-reloc.h (relocate_section): Pass output_section to
15157 relocate.
15158 * i386.cc (Target_i386::should_apply_static_reloc): Add
15159 output_section parameter. Change all callers.
15160 (Target_i386::Relocate::relocate): Add output_section parameter.
15161 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15162 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15163 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15164 * testsuite/two_file_shared.sh: New script.
15165 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15166 (check_DATA): Add two_file_shared.dbg.
15167 (two_file_shared.dbg): New target.
15168 * testsuite/Makefile.in: Rebuild.
15169
15170 2009-03-01 Ian Lance Taylor <iant@google.com>
15171
15172 * configure.ac: Check for byteswap.h.
15173 * configure: Rebuild.
15174 * config.in: Rebuild.
15175
15176 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15177
15178 * layout.cc (Layout::find_or_add_kept_section): New function.
15179 (Layout::add_comdat): Removed.
15180 * layout.h (struct Kept_section): Move out of class Layout.
15181 Remove trailing underscores from field names. Add group_sections
15182 field. Rename group_ field to is_group. Change all uses.
15183 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15184 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15185 comdat_groups_ field.
15186 (Sized_relobj::include_section_group): Use
15187 find_or_add_kept_section and Kept_section::group_sections.
15188 (Sized_relobj::include_linkonce_section): Likewise.
15189 * object.cc (class Sized_relobj): Don't define Comdat_group or
15190 Comdat_group_table. Remove find_comdat_group and
15191 add_comdat_group. Remove comdat_groups_ field.
15192 * plugin.cc (include_comdat_group): Use
15193 Layout::find_or_add_kept_section.
15194
15195 2009-02-28 Ian Lance Taylor <iant@google.com>
15196
15197 * README: --gc-sections and map files are now supported. Document
15198 some build requirements.
15199
15200 PR 6992
15201 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15202 relocatable link set the value of the section symbol to zero.
15203 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15204 relocatable link don't include the section address in the local
15205 symbol value.
15206
15207 2009-02-27 Ian Lance Taylor <iant@google.com>
15208
15209 PR 6811
15210 * options.h (class Search_directory): Add is_system_directory.
15211 (class General_options): Declare is_in_system_directory.
15212 * options.cc (get_relative_sysroot): Make static.
15213 (get_default_sysroot): Make static.
15214 (General_optoins::is_in_system_directory): New function.
15215 * fileread.cc (Input_file::is_in_system_directory): New function.
15216 * fileread.h (class Input_file): Declare is_in_system_directory.
15217 * object.h (class Object): Add is_in_system_directory.
15218 (class Input_objects): Remove system_library_directory_ field.
15219 * object.cc (Input_objects::add_object): Don't set
15220 system_library_directory_.
15221 (input_objects::found_in_system_library_directory): Remove.
15222 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15223 parameter. Change all callers.
15224 (Symbol_table::sized_write_globals): Likewise.
15225 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15226 Call Object::is_in_system_directory.
15227 * symtab.h (class Symbol_table): Update declarations.
15228
15229 PR 5990
15230 * descriptors.h (Open_descriptor): Add is_on_stack field.
15231 * descriptors.cc (Descriptors::open): If the descriptor is on the
15232 top of the stack, remove it. Initialize is_on_stack field.
15233 (Descriptors::release): Only add pod to stack if it is not on the
15234 stack already.
15235 (Descriptors::close_some_descriptor): Clear stack_next and
15236 is_on_stack fields.
15237
15238 PR 7091
15239 * output.cc (Output_section::find_starting_output_address): Rename
15240 from starting_output_address; add PADDR parameter; change return
15241 type.
15242 * output.h (class Output_section): Declare
15243 find_starting_output_address instead of starting_output_address.
15244 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15245 section symbol for which we can't find a merge section.
15246
15247 PR 9836
15248 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15249 hidden or internal, force the symbol to be local.
15250 * resolve.cc (Symbol::override_visibility): Define.
15251 (Symbol::override_base): Use override_visibility.
15252 (Symbol_table::resolve): Likewise.
15253 (Symbol::override_base_with_special): Likewise.
15254 (Symbol_table::override_with_special): If the visibility is hidden
15255 or internal, force the symbol to be local.
15256 * symtab.h (class Symbol): Add set_visibility and
15257 override_visibility.
15258 * testsuite/ver_test_1.sh: New file.
15259 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15260 (check_DATA): Add ver_test_1.syms.
15261 (ver_test_1.syms): New target.
15262 * testsuite/Makefile.in: Rebuild.
15263
15264 2009-02-25 Cary Coutant <ccoutant@google.com>
15265
15266 * layout.cc (Layout::choose_output_section): Don't rename sections
15267 when using a linker script that has a SECTIONS clause.
15268 * Makefile.in: Regenerate.
15269
15270 * testsuite/Makefile.am (script_test_5.sh): New test case.
15271 * testsuite/Makefile.in: Regenerate.
15272 * testsuite/script_test_5.cc: New file.
15273 * testsuite/script_test_5.sh: New file.
15274 * testsuite/script_test_5.t: New file.
15275
15276 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15277
15278 * archive.cc (Archive::include_member): Update calls to add_symbols.
15279 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15280 the Layout argument.
15281 * dynobj.h (do_add_symbols): Add the Layout argument.
15282 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15283 Layout argument.
15284 * object.h (Object::add_symbols): Add the Layout argument.
15285 (Object::do_add_symbols): Add the Layout argument.
15286 (Sized_relobj::do_add_symbols): Add the Layout argument.
15287 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15288 Unify the two versions.
15289 (Add_plugin_symbols): Remove.
15290 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15291 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15292 (Add_plugin_symbols): Remove.
15293 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15294 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15295 (Add_symbols::run): Make it work with Pulginobj.
15296
15297 2009-02-06 Ian Lance Taylor <iant@google.com>
15298
15299 * object.cc (Sized_relobj::do_layout): Make info message start
15300 with lower case letter.
15301
15302 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15303
15304 * binary.cc: Fix file comment.
15305
15306 * options.h (enum Incremental_disposition): Define.
15307 (class General_options): Add new options: --incremental,
15308 --incremental_changed, --incremental_unchanged,
15309 --incremental_unknown. Add incremental_disposition_ and
15310 implicit_incremental_ fields.
15311 (General_options::incremental_disposition): New function.
15312 (class Position_dependent_options): Add incremental_disposition
15313 option.
15314 (Position_dependent_options::copy_from_options): Set incremental
15315 dispositions.
15316 * options.cc (General_options::parse_incremental_changed): New
15317 function.
15318 (General_options::parse_incremental_unchanged): New function.
15319 (General_options::parse_incremental_unknown): New function.
15320 (General_options::General_options): Initialize new fields
15321 incremental_disposition_ and implicit_incremental_.
15322 (General_options::finalize): Check for uasge of --incremental-*
15323 without --incremental.
15324
15325 2009-02-06 Chris Demetriou <cgd@google.com>
15326
15327 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15328 pointer and to report location as the file name associated with
15329 the symbol.
15330 (gold_undefined_symbol_at_location): New function to replace the
15331 old gold_undefined_symbol functionality.
15332 * target-reloc.h (relocate_section): Update to use
15333 gold_undefined_symbol_at_location.
15334 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15335 Call gold_undefined_symbol function rather than gold_error.
15336 * errors.h (Errors::undefined_symbol): Take location as a
15337 string, rather than calculating it from a relocation.
15338 * errors.cc (Errors::fatal): Print "fatal error:" before the
15339 formatted message.
15340 (Errors::error, Errors::error_at_location): Print "error: "
15341 before the formatted message.
15342 (Errors::undefined_symbol): Take location as a string, rather
15343 than calculating it from a relocation.
15344 (gold_undefined_symbol_at_location): New function akin to
15345 old gold_undefined_symbol, calculates location from relocation.
15346 (gold_undefined_symbol): Change to take only a Symbol pointer
15347 and to report location as the file name associated with the symbol.
15348 * testsuite/debug_msg.sh: Update for changed error messages.
15349 * testsuite/undef_symbol.sh: Likewise.
15350
15351 2009-02-04 Duncan Sands <baldrick@free.fr>
15352
15353 PR 9812
15354 * reduced_debug_output.h
15355 (Output_reduced_debug_abbrev_section::failed): Use format for
15356 gold_warning.
15357 (Output_reduced_debug_info_section::faild): Likewise.
15358
15359 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15360
15361 * script.cc (Lazy_demangler): New class.
15362 (Version_script_info::get_symbol_version_helper): Demangle a
15363 symbol only once.
15364
15365 2009-01-29 Cary Coutant <ccoutant@google.com>
15366
15367 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15368 to __tls_get_addr.
15369 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15370
15371 2009-01-28 Ian Lance Taylor <iant@google.com>
15372
15373 * version.cc (version_string): Bump to 1.9.
15374
15375 * gold.h: Include <cstring> and <stdint.h>.
15376 * version.cc: Include <cstdio>.
15377 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15378 warning.
15379 * reduced_debug_output.cc (insert_into_vector): Rename from
15380 Insert_into_vector; change all callers. Use Swap_unaligned to
15381 avoid aliasing issue; remove union since it is unnecessary.
15382
15383 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15384
15385 * Makefile.am (CCFILES): Add gc.cc.
15386 (HFILES): Add gc.h.
15387 * Makefile.in: Regenerate.
15388 * gold.cc (Gc_runner): New class.
15389 (queue_initial_tasks): Call garbage collection related tasks
15390 when corresponding options are invoked.
15391 (queue_middle_gc_tasks): New function.
15392 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15393 processed early before laying out sections during garbage collection.
15394 * gold.h (queue_middle_gc_tasks): New function.
15395 (is_prefix_of): Move from "layout.cc".
15396 * i386.cc (Target_i386::gc_process_relocs): New function.
15397 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15398 * main.cc (main): Create object of class "Garbage_collection".
15399 * object.cc (Relobj::copy_symbols_data): New function.
15400 (Relobj::is_section_name_included): New function.
15401 (Sized_relobj::do_layout): Allow this function to be called twice
15402 during garbage collection and defer layout of section during the
15403 first call.
15404 * object.h (Relobj::get_symbols_data): New function.
15405 (Relobj::is_section_name_included): New function.
15406 (Relobj::copy_symbols_data): New function.
15407 (Relobj::set_symbols_data): New function.
15408 (Relobj::get_relocs_data): New function.
15409 (Relobj::set_relocs_data): New function.
15410 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15411 (Relobj::gc_process_relocs): New function.
15412 (Relobj::do_gc_process_relocs): New pure virtual function.
15413 (Relobj::sd_): New data member.
15414 (Sized_relobj::is_output_section_offset_invalid): New function.
15415 (Sized_relobj::do_gc_process_relocs): New function.
15416 * options.h (General_options::gc_sections): Modify to not be a no-op.
15417 (General_options::print_gc_sections): New option.
15418 * plugin.cc (Plugin_finish::run): Remove function call to
15419 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15420 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15421 * reloc.cc (Read_relocs::run): Add task to process relocs and
15422 determine unreferenced sections when doing garbage collection.
15423 (Gc_process_relocs): New class.
15424 (Sized_relobj::do_gc_process_relocs): New function.
15425 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15426 sections that are garbage collected.
15427 * reloc.h (Gc_process_relocs): New class.
15428 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15429 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15430 symbols whose corresponding sections are garbage collected.
15431 (Symbol_table::Symbol_table): Add new parameter for the garbage
15432 collection object.
15433 (Symbol_table::gc_mark_undef_symbols): New function.
15434 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15435 (Symbol_table::gc_mark_dyn_syms): New function.
15436 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15437 as garbage.
15438 (Symbol_table::add_from_object): Likewise.
15439 (Symbol_table::add_from_relobj): When building shared objects, do not
15440 treat externally visible symbols as garbage.
15441 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15442 table information for static and relocatable links.
15443 * symtab.h (Symbol_table::set_gc): New function.
15444 (Symbol_table::gc): New function.
15445 (Symbol_table::gc_mark_undef_symbols): New function.
15446 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15447 (Symbol_table::gc_mark_dyn_syms): New function.
15448 (Symbol_table::gc_): New data member.
15449 * target.h (Sized_target::gc_process_relocs): New pure virtual
15450 function.
15451 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15452 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15453
15454 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15455
15456 * options.h (General_options::gc_sections): Define as a no-op for now.
15457 (General_options::no_keep_memory): Ditto.
15458 (General_options::Bshareable): Define.
15459 * options.cc (General_options::finalize): Honor -Bshareable.
15460
15461 2009-01-20 Andreas Schwab <schwab@suse.de>
15462
15463 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15464 read the value in the contents, since we don't use it. Use the
15465 template endianness when writing.
15466 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15467
15468 2009-01-19 Andreas Schwab <schwab@suse.de>
15469
15470 * configure.tgt (powerpc64-*): Fix targ_obj.
15471
15472 2009-01-15 Ian Lance Taylor <iant@google.com>
15473
15474 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15475 local symbols when stripping all symbols.
15476
15477 2009-01-14 Cary Coutant <ccoutant@google.com>
15478
15479 * output.cc (Output_reloc): Add explicit instantiations.
15480
15481 2009-01-14 Cary Coutant <ccoutant@google.com>
15482
15483 * archive.cc (Archive::get_elf_object_for_member): Remove call
15484 to File_read::claim_for_plugin.
15485 * descriptors.cc (Descriptors::open): Remove reference to
15486 is_claimed.
15487 (Descriptors::claim_for_plugin): Remove.
15488 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15489 (Descriptors::is_claimed): Remove.
15490 (claim_descriptor_for_plugin): Remove.
15491 * fileread.cc (File_read::claim_for_plugin): Remove.
15492 * fileread.h (File_read::claim_for_plugin): Remove.
15493 (File_read::descriptor): Reopen descriptor if necessary.
15494 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15495 (Plugin_manager::all_symbols_read): Add task parameter. Change
15496 all callers.
15497 (Plugin_manager::get_input_file): New function.
15498 (Plugin_manager::release_input_file): New function.
15499 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15500 corresponding data member.
15501 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15502 and pass to base constructor. Change all callers.
15503 (get_input_file, release_input_file): New functions.
15504 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15505 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15506 (Plugin_manager::all_symbols_read): Add task parameter.
15507 (Plugin_manager::get_input_file): New function.
15508 (Plugin_manager::release_input_file): New function.
15509 (Plugin_manager::task_): New data member.
15510 (Pluginobj::Pluginobj): Add filesize parameter.
15511 (Pluginobj::filename): New function.
15512 (Pluginobj::descriptor): New function.
15513 (Pluginobj::filesize): New function.
15514 (Pluginobj::filesize_): New data member.
15515 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15516 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15517 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15518
15519 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15520 with archive libraries.
15521 * testsuite/Makefile.in: Regenerate.
15522 * testsuite/plugin_test.c (struct sym_info): New type.
15523 (get_input_file, release_input_file): New static variables.
15524 (onload): Capture new transfer vector entries.
15525 (claim_file_hook): Stop reading at end of file according to filesize.
15526 Factor out parsing of readelf output into separate function.
15527 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15528 APIs and get the source file name from the symbol table. Convert
15529 source file name to corresponding object file name. Print info
15530 message when adding new input files.
15531 (parse_readelf_line): New function.
15532 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15533 * testsuite/plugin_test_2.sh: Likewise.
15534 * testsuite/plugin_test_3.sh: Likewise.
15535 * testsuite/plugin_test_4.sh: New test case.
15536
15537 2009-01-07 Ian Lance Taylor <iant@google.com>
15538
15539 * version.cc (version_string): Bump to 1.8.
15540
15541 2008-12-23 Cary Coutant <ccoutant@google.com>
15542
15543 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15544 * plugin.cc (Plugin_manager::finish): Rename as
15545 layout_deferred_objects. Move cleanup to separate function.
15546 (Plugin_manager::cleanup): New function.
15547 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15548 separately.
15549 * plugin.h (Plugin_manager::finish): Rename as
15550 layout_deferred_objects.
15551 (Plugin_manager::cleanup): New function.
15552 (Plugin_manager::cleanup_done): New field.
15553
15554 2008-12-23 Cary Coutant <ccoutant@google.com>
15555
15556 * plugin.cc (is_visible_from_outside): New function.
15557 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15558 so we don't return "IR only" status for exported symbols or -r links.
15559
15560 * testsuite/Makefile.am (plugin_test_3): New test case.
15561 * testsuite/Makefile.in: Regenerate.
15562 * testsuite/plugin_test_3.sh: New file.
15563
15564 2008-12-22 Cary Coutant <ccoutant@google.com>
15565
15566 * object.cc (Sized_relobj::layout_section): New function.
15567 (Sized_relobj::do_layout): Defer layout of input sections until after
15568 plugin has provided replacement files.
15569 (Sized_relobj::do_layout_deferred_sections): New function.
15570 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15571 (Relobj::layout_deferred_sections): New function.
15572 (Relobj::do_layout_deferred_sections): New function.
15573 (Sized_relobj::do_layout_deferred_sections): New function.
15574 (Sized_relobj::layout_section): New function.
15575 (Sized_relobj::Deferred_layout): New structure.
15576 (Sized_relobj::deferred_layout_): New field.
15577 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15578 Change all callers. Layout deferred sections.
15579 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15580 references.
15581 (Plugin_hook::run): Move code from do_plugin_hook inline.
15582 (Plugin_hook::do_plugin_hook): Remove.
15583 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15584 (Plugin_manager::finish): Renamed, was cleanup.
15585 (Plugin_manager::should_defer_layout): New function.
15586 (Plugin_manager::add_deferred_layout_object): New function.
15587 (Plugin_manager::Deferred_layout_list): New type.
15588 (Plugin_manager::deferred_layout_objects_): New field.
15589 (Plugin_hook::do_plugin_hook): Remove.
15590
15591 2008-12-17 Ian Lance Taylor <iant@google.com>
15592
15593 * options.h (class General_options): Add --no case for
15594 --export-dynamic.
15595
15596 2008-12-16 Cary Coutant <ccoutant@google.com>
15597
15598 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15599 vector.
15600 (Plugin_manager::claim_file): Create plugin object even if
15601 plugin did not call the add_symbols callback.
15602 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15603 asking for more symbols than were added.
15604 * testsuite/Makefile.am (plugin_test_1): Add test case with
15605 no global symbols.
15606 (empty.syms): New target.
15607 * testsuite/Makefile.in: Regenerate.
15608 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15609 message. Don't call add_symbols if no globals.
15610 (all_symbols_read_hook): Don't provide replacement for empty
15611 claimed file.
15612
15613 2008-12-12 Ian Lance Taylor <iant@google.com>
15614
15615 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15616 r_type == 0 for a local symbol with r_sym == 0.
15617 (scan_relocatable_relocs): Pass r_sym to
15618 local_non_section_strategy.
15619 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15620 r_sym parameter.
15621
15622 * configure.ac: Update test for TLS descriptors: they are
15623 supported as of glibc 2.9.
15624 * configure: Rebuild.
15625
15626 2008-12-11 Ian Lance Taylor <iant@google.com>
15627
15628 PR 7091
15629 * target-reloc.h (Default_scan_relocatable_relocs): For each
15630 function, map r_type == 0 to RELOC_DISCARD.
15631
15632 2008-12-10 Cary Coutant <ccoutant@google.com>
15633
15634 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15635 object to override a kept COMDAT group from a plugin object.
15636
15637 2008-12-09 Ian Lance Taylor <iant@google.com>
15638
15639 PR 7088
15640 * yyscript.y (file_cmd): Handle INPUT.
15641
15642 * testsuite/initpri1.c: Change all declarations to be full
15643 prototypes by adding void, to avoid compiler warnings.
15644
15645 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15646
15647 * options.cc (General_options::parse_plugin_opt): New.
15648 (General_options::add_plugin): The argument now is just the filename.
15649 (General_options::add_plugin_option): New.
15650 * options.h (plugin_opt): New.
15651 (add_plugin): Change argument name.
15652 (add_plugin_option): New.
15653 * plugin.cc (Plugin::load): Don't parse the plugin option.
15654 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15655 (Plugin::add_option): New.
15656 (Plugin::args_): Change type.
15657 (Plugin::filename_): New.
15658 (Plugin_manager::add_plugin_option): New.
15659 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15660 * testsuite/Makefile.in: Regenerate.
15661
15662 2008-12-05 Cary Coutant <ccoutant@google.com>
15663
15664 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15665 Handle --strip-lto-sections option.
15666 * options.h (strip_lto_sections): New option.
15667
15668 2008-12-01 Cary Coutant <ccoutant@google.com>
15669
15670 * plugin.cc (ld_plugin_message): Change format parameter to const.
15671 Fix mismatch between new[] and delete.
15672
15673 2008-11-14 Cary Coutant <ccoutant@google.com>
15674
15675 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15676 instead of -1U.
15677
15678 2008-11-05 Craig Silverstein <csilvers@google.com>
15679
15680 * options.cc (General_options::parse_dynamic_list): New function.
15681 * options.h (General_options): New flags dynamic_list,
15682 dynamic_list_data, dynamic_list_cpp_new, and
15683 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15684 (General_options::in_dynamic_list): New function.
15685 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15686 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15687 (Lex::can_continue_name): Likewise.
15688 (yylex): Likewise.
15689 (read_script_file): New parameter script_options.
15690 (read_dynamic_list): New function.
15691 (Script_options::define_dynamic_list): New function.
15692 (dynamic_list_keyword_parsecodes): New variable.
15693 (dynamic_list_keywords): New variable.
15694 * script.h (Script_options::define_dynamic_list): New function
15695 prototype.
15696 (read_dynamic_list): New function prototype.
15697 * symtab.cc (strprefix): New macro.
15698 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15699 dynamic_list_data, dynamic_list_cpp_new, and
15700 dynamic_list_cpp_typeinfo.
15701 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15702 (dynamic_list_expr): New rule.
15703 (dynamic_list_nodes): Likewise.
15704 (dynamic_list_node): Likewise.
15705 * testsuite/Makefile.am (dynamic_list): New test.
15706 * testsuite/Makefile.in: Regenerated.
15707 * testsuite/dynamic_list.t: New file.
15708 * testsuite/dynamic_list.sh: New file.
15709
15710 2008-11-05 Craig Silverstein <csilvers@google.com>
15711
15712 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15713 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15714 (t11_last): Likewise.
15715 * testsuite/ver_test_6.c (main): Likewise.
15716
15717 2008-10-07 Cary Coutant <ccoutant@google.com>
15718
15719 * options.c (General_options::finalize): Add check for -static and
15720 -shared.
15721 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15722 is not empty.
15723
15724 2008-10-02 Cary Coutant <ccoutant@google.com>
15725
15726 * plugin.cc (make_sized_plugin_object): Fix conditional
15727 compilation to work when not all targets are enabled.
15728
15729 2008-09-29 Cary Coutant <ccoutant@google.com>
15730
15731 * archive.cc (Archive::get_file_and_offset): Use filename instead
15732 of name to get library path.
15733 (Archive::include_member): Unlock external member of a thin archive.
15734
15735 * testsuite/Makefile.am (TEST_AR): New variable.
15736 (thin_archive_test_1): New test.
15737 (thin_archive_test_2): New test.
15738 * testsuite/Makefile.in: Regenerate.
15739 * testsuite/thin_archive_main.cc: New file.
15740 * testsuite/thin_archive_test_1.cc: New file.
15741 * testsuite/thin_archive_test_2.cc: New file.
15742 * testsuite/thin_archive_test_3.cc: New file.
15743 * testsuite/thin_archive_test_4.cc: New file.
15744
15745 2008-09-29 Cary Coutant <ccoutant@google.com>
15746
15747 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15748 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15749 instead of -1U.
15750 (Sized_relobj::do_finalize_local_symbols): Likewise.
15751 (Sized_relobj::map_to_kept_section): Likewise.
15752 * object.h (Sized_relobj::invalid_address): New constant.
15753 (Sized_relobj::do_output_section_offset): Check for invalid_address
15754 and return -1ULL.
15755 * output.cc (Output_reloc::local_section_offset): Use constant
15756 invalid_address instead of -1U.
15757 (Output_reloc::get_address): Likewise.
15758 (Output_section::output_address): Change -1U to -1ULL.
15759 * output.h (Output_reloc::invalid_address): New constant.
15760 * reloc.cc (Sized_relobj::write_sections): Use constant
15761 invalid_address instead of -1U.
15762 (Sized_relobj::relocate_sections): Likewise.
15763 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15764 values for merge sections.
15765 * target-reloc.h (relocate_for_relocatable): Use constant
15766 invalid_address instead of -1U.
15767
15768 2008-09-19 Cary Coutant <ccoutant@google.com>
15769
15770 Add plugin functionality for link-time optimization (LTO).
15771 * configure.ac (plugins): Add --enable-plugins option.
15772 * configure: Regenerate.
15773 * config.in: Regenerate.
15774 * Makefile.am (LIBDL): New variable.
15775 (CCFILES): Add plugin.cc.
15776 (HFILES): Add plugin.h.
15777 (ldadd_var): Add LIBDL.
15778 * Makefile.in: Regenerate.
15779
15780 * archive.cc: Include "plugin.h".
15781 (Archive::setup): Don't preread archive symbols when using a plugin.
15782 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15783 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15784 files.
15785 (Archive::include_member): Add symbols from plugin objects.
15786 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15787 * descriptors.cc (Descriptors::open): Check for file descriptors
15788 abandoned by plugins.
15789 (Descriptors::claim_for_plugin): New function.
15790 * descriptors.h (Descriptors::claim_for_plugin): New function.
15791 (Open_descriptor::is_claimed): New field.
15792 (claim_descriptor_for_plugin): New function.
15793 * fileread.cc (File_read::claim_for_plugin): New function.
15794 * fileread.h (File_read::claim_for_plugin): New function.
15795 (File_read::descriptor): New function.
15796 * gold.cc: Include "plugin.h".
15797 (queue_initial_tasks): Add task to call plugin hooks for generating
15798 new object files.
15799 * main.cc: Include "plugin.h".
15800 (main): Load plugin libraries.
15801 * object.h (Pluginobj): Declare.
15802 (Object::pluginobj): New function.
15803 (Object::do_pluginobj): New function.
15804 (Object::set_target): New function.
15805 * options.cc: Include "plugin.h".
15806 (General_options::parse_plugin): New function.
15807 (General_options::General_options): Initialize plugins_ field.
15808 (General_options::add_plugin): New function.
15809 * options.h (Plugin_manager): Declare.
15810 (General_options): Add --plugin option.
15811 (General_options::has_plugins): New function.
15812 (General_options::plugins): New function.
15813 (General_options::add_plugin): New function.
15814 (General_options::plugins_): New field.
15815 * plugin.cc: New file.
15816 * plugin.h: New file.
15817 * readsyms.cc: Include "plugin.h".
15818 (Read_symbols::do_read_symbols): Check for archive before checking
15819 for ELF file. Call plugin hooks to claim files.
15820 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15821 from a real object file; force override when processing replacement
15822 files.
15823 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15824 (Symbol::init_base_object): Likewise.
15825 (Symbol::init_base_output_data): Likewise.
15826 (Symbol::init_base_output_segment): Likewise.
15827 (Symbol::init_base_constant): Likewise.
15828 (Symbol::init_base_undefined): Likewise.
15829 (Symbol::output_section): Assert that object is not a plugin.
15830 (Symbol_table::add_from_pluginobj): New function.
15831 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15832 undefined.
15833 (Symbol_table::sized_write_globals): Likewise.
15834 (Symbol_table::add_from_pluginobj): Instantiate template.
15835 * symtab.h (Sized_pluginobj): Declare.
15836 (Symbol::in_real_elf): New function.
15837 (Symbol::set_in_real_elf): New function.
15838 (Symbol::in_real_elf_): New field.
15839 (Symbol_table::add_from_pluginobj): New function.
15840
15841 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15842 (LIBDL): New variable.
15843 (LDADD): Add LIBDL.
15844 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15845 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15846 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15847 (MOSTLYCLEANFILES): Likewise.
15848 * testsuite/Makefile.in: Regenerate.
15849 * testsuite/plugin_test.c: New file.
15850 * testsuite/plugin_test_1.sh: New file.
15851 * testsuite/plugin_test_2.sh: New file.
15852
15853 2008-09-16 Ian Lance Taylor <iant@google.com>
15854
15855 * target-reloc.h (relocate_section): Check whether a symbol is
15856 defined by the ABI before reporting an undefined symbol error.
15857 * target.h (Target::is_defined_by_abi): Make parameter const.
15858 (Target::do_is_defined_by_abi): Likewise.
15859 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15860 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15861 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15862 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15863 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15864 * testsuite/Makefile.in: Rebuild.
15865
15866 * fileread.cc (make_view): Add casts to avoid warning.
15867
15868 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15869
15870 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15871 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15872
15873 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15874
15875 * options.h (General_options::output_is_executable): New.
15876 (General_options::output_is_pie): New.
15877 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15878 for shared libraries.
15879 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15880
15881 2008-09-11 Chris Demetriou <cgd@google.com>
15882
15883 * options.h (origin): New -z option.
15884 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15885 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15886 in DT_FLAGS_1.
15887
15888 2008-09-05 Cary Coutant <ccoutant@google.com>
15889
15890 * fileread.cc (File_read::make_view): Add check for attempt to map
15891 beyond end of file.
15892
15893 2008-09-05 Cary Coutant <ccoutant@google.com>
15894
15895 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15896 explicit instantiations.
15897
15898 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15899
15900 PR gold/6858
15901 * options.cc (General_options::finalize): Allow undefined symbols
15902 in shlibs if linking -shared.
15903
15904 PR gold/6859
15905 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15906 symbols as not needing a dynsym entry.
15907
15908 2008-08-20 Craig Silverstein <csilvers@google.com>
15909
15910 * fileread.cc (File_read::open): Do not lock the file unless it
15911 was successfully opened.
15912
15913 2008-08-14 Cary Coutant <ccoutant@google.com>
15914
15915 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15916 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15917 * testsuite/tls_test.cc (struct int128): 128-bit struct
15918 for testing TLS relocs with non-zero addend.
15919 (v12): New TLS variable.
15920 (t12): New test.
15921 (t_last): Add check for v12.
15922 * testsuite/tls_test.h (t12): New function.
15923 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15924
15925 2008-08-13 Ian Lance Taylor <iant@google.com>
15926
15927 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15928 set tls_segment_ or relro_segment_.
15929 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15930 when appropriate.
15931 * output.h (Output_section::clear_is_relro): New function.
15932 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15933 sections specially even when output_data_ is empty.
15934 (Output_segment::maximum_alignment): When first section is relro,
15935 only force alignment for PT_LOAD segments.
15936 * script.cc (script_data_segment_align): New function.
15937 (script_data_segment_relro_end): New function.
15938 * script-c.h (script_data_segment_align): Declare.
15939 (script_data_segment_relro_end): Declare.
15940 * script-sections.h (class Script_sections): Declare
15941 data_segment_align and data_segment_relro_end. Add fields
15942 segment_align_index_ and saw_relro_end_.
15943 * script-sections.cc (class Sections_element): Add set_is_relro
15944 virtual function. Add new bool* parameter to place_orphan_here.
15945 Add get_output_section virtual function.
15946 (class Output_section_definition): Add set_is_relro. Add new
15947 bool* parameter to place_orphan_here. Add get_output_section.
15948 Add is_relro_ field.
15949 (Output_section_definition::Output_section_definition): Initialize
15950 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15951 and is_relro_ fields.
15952 (Output_section_definition::place_orphan_here): Add is_relro
15953 parameter.
15954 (Output_section_definition::set_section_addresses): Set relro for
15955 output section.
15956 (Output_section_definition::alternate_constraint): Likewise.
15957 (class Orphan_output_section): Add new bool* parameter to
15958 place_orphan_here. Add get_output_section.
15959 (Orphan_output_section::place_orphan_here): Add is_relro
15960 parameter.
15961 (Script_sections::Script_sections): Initialize
15962 data_segment_align_index_ and saw_relro_end_.
15963 (Script_sections::data_segment_align): New function.
15964 (Script_sections::data_segment_relro_end): New function.
15965 (Script_sections::place_orphan): Set or clear is_relro.
15966 (Script_sections::set_section_addresses): Force alignment of first
15967 TLS section.
15968 * yyscript.y (exp): Call script_data_segment_align and
15969 script_data_segment_relro_end.
15970 * testsuite/relro_script_test.t: New file.
15971 * testsuite/relro_test.cc (using_script): Declare.
15972 (t1, t2): Test using_script.
15973 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15974 (relro_script_test_SOURCES): Define.
15975 (relro_script_test_DEPENDENCIES): Define.
15976 (relro_script_test_LDFLAGS): Define.
15977 (relro_script_test_LDADD): Define.
15978 (relro_script_test.so): New target.
15979 * testsuite/Makefile.in: Rebuild.
15980
15981 2008-08-06 Cary Coutant <ccoutant@google.com>
15982
15983 * archive.cc (Archive::total_archives, Archive::total_members)
15984 (Archive::total_members_loaded): New variables.
15985 (Archive::setup): Add parameter. Add option to preread
15986 archive symbols.
15987 (Archive::read_armap): Add counter.
15988 (Archive::get_file_and_offset): New function.
15989 (Archive::get_elf_object_for_member): New function.
15990 (Archive::read_all_symbols): New function.
15991 (Archive::read_symbols): New function.
15992 (Archive::add_symbols): Add counters.
15993 (Archive::include_all_members): Use armap to find members if it's
15994 already built.
15995 (Archive::include_member): Skip reading symbols if already read.
15996 Factored code into Archive::get_file_and_offset and
15997 Archive::get_elf_object_for_member. Changed call to
15998 Mapfile::report_include_archive_member.
15999 (Archive::print_stats): New function.
16000 * archive.h: Declare Object and Read_symbols_data classes.
16001 (Archive::Archive): Add initializers for new members.
16002 (Archive::setup): Add parameter.
16003 (Archive::print_stats): New function.
16004 (Archive::total_archives, Archive::total_members)
16005 (Archive::total_members_loaded): New variables.
16006 (Archive::get_file_and_offset): New function.
16007 (Archive::get_elf_object_for_member): New function.
16008 (Archive::read_all_symbols): New function.
16009 (Archive::read_symbols): New function.
16010 (Archive::Archive_member): New class.
16011 (Archive::members_): New member.
16012 (Archive::num_members_): New member.
16013 * main.cc: Include archive.h.
16014 (main): Call Archive::print_stats.
16015 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16016 archive parameter; member_name is now the fully-decorated name.
16017 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16018 * options.h: (General_options): Add --preread-archive-symbols option.
16019 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16020 Archive::setup.
16021
16022 2008-08-04 Ian Lance Taylor <iant@google.com>
16023
16024 * symtab.h (Symbol::use_plt_offset): New function.
16025 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16026 * powerpc.cc (Relocate::relocate): Likewise.
16027 * sparc.cc (Relocate::relocate): Likewise.
16028 * x86_64.cc (Relocate::relocate): Likewise.
16029 * testsuite/weak_plt.sh: New test.
16030 * testsuite/weak_plt_main.cc: New test.
16031 * testsuite/weak_plt_shared.cc: New test.
16032 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16033 (check_PROGRAMS): Add weak_plt.
16034 (check_DATA): Add weak_plt_shared.so.
16035 (weak_plt_main_pic.o, weak_plt): New targets.
16036 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16037 * testsuite/Makefile.in: Rebuild.
16038
16039 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16040 gcctestdir/ld.
16041 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16042 * testsuite/Makefile.in: Rebuild.
16043
16044 2008-08-04 Alan Modra <amodra@bigpond.net.au>
16045
16046 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16047 * Makefile.in: Regenerate.
16048 * po/POTFILES.in: Regenerate.
16049
16050 2008-07-29 Ian Lance Taylor <iant@google.com>
16051
16052 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16053 symbols before other symbols.
16054 * testsuite/script_test_2.cc (test_addr): Declare.
16055 (test_addr_alias): Declare.
16056 (main): Check that test_addr and test_addr_alias have the right
16057 values.
16058 * testsuite/script_test_2.t: Define test_addr_alias and
16059 test_addr.
16060
16061 2008-07-24 Ian Lance Taylor <iant@google.com>
16062
16063 PR 5990
16064 * descriptors.cc: New file.
16065 * descriptors.h: New file.
16066 * gold-threads.h (class Hold_optional_lock): New class.
16067 * fileread.cc: Include "descriptors.h".
16068 (File_read::~File_read): Release descriptor rather than closing
16069 it.
16070 (File_read::open) [file]: Call open_descriptor rather than open.
16071 Set is_descriptor_opened_.
16072 (File_read::open) [memory]: Assert that descriptor is not open.
16073 (File_read::reopen_descriptor): New function.
16074 (File_read::release): Release descriptor.
16075 (File_read::do_read): Make non-const. Reopen descriptor.
16076 (File_read::read): Make non-const.
16077 (File_read::make_view): Reopen descriptor.
16078 (File_read::do_readv): Likewise.
16079 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16080 Update declarations.
16081 * layout.cc: Include "descriptors.h".
16082 (Layout::create_build_id): Use open_descriptor rather than open.
16083 * output.cc: Include "descriptors.h".
16084 (Output_file::open): Use open_descriptor rather than open.
16085 * archive.cc (Archive::const_iterator): Change Archive to be
16086 non-const.
16087 (Archive::begin, Archive::end): Make non-const.
16088 (Archive::count_members): Likewise.
16089 * archive.h (class Archive): Update declarations.
16090 * object.h (Object::read): Make non-const.
16091 * Makefile.am (CCFILES): Add descriptors.cc.
16092 (HFILES): Add descriptors.h.
16093 * Makefile.in: Rebuild.
16094
16095 PR 6716
16096 * gold.h: Always include <clocale>. Add Solaris workarounds
16097 following code in binutils/sysdep.h.
16098
16099 PR 6048
16100 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16101 this->eh_frame_hdr_ is NULL before using it.
16102
16103 * dynobj.cc (Versions::Versions): Update comment.
16104
16105 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16106 the base version name.
16107
16108 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16109 array size plus one.
16110 (Stringpool_template::set_string_offsets): Subtract one from key
16111 before using it as an array index.
16112 (Stringpool_template::get_offset_with_length): Likewise.
16113 (Stringpool_template::write_to_buffer): Likewise.
16114 * stringpool.h (Stringpool_template::get_offset_from_key):
16115 Likewise.
16116
16117 2008-07-23 Ian Lance Taylor <iant@google.com>
16118
16119 PR 6658
16120 * object.h (Merged_symbol_value::value): Do our best to handle a
16121 negative addend.
16122
16123 PR 6647
16124 * script.cc (Version_script_info::get_versions): Don't add empty
16125 version tag to return value.
16126 (Version_script_info::get_symbol_version_helper): Change return
16127 type to bool. Add pversion parameter. Change all callers.
16128 (script_register_vers_node): Don't require a non-NULL tag.
16129 * script.h (class Version_script_info): Update declarations.
16130 (Version_script_info::get_symbol_version): Change return type to
16131 bool. Add version parameter. Change all callers.
16132 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16133 handling. Handle an empty version from a version script.
16134 (Symbol_table::define_special_symbol): Likewise.
16135 * testsuite/ver_test_10.script: New file.
16136 * testsuite/ver_test_10.sh: New file.
16137 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16138 (check_DATA): Add ver_test_10.syms.
16139 (ver_test_10.syms, ver_test_10.so): New target.
16140 * testsuite/Makefile.in: Rebuild.
16141
16142 2008-07-23 Simon Baldwin <simonb@google.com>
16143
16144 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16145 to zero for undefined symbols from dynamic libraries.
16146
16147 2008-07-23 Ian Lance Taylor <iant@google.com>
16148
16149 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16150 Change all callers.
16151 * symtab.h (class Symbol_table): Update declaration.
16152 * testsuite/ver_test_9.cc: New file.
16153 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16154 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16155 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16156 (ver_test_9.so, ver_test_9.o): New targets.
16157 * testsuite/Makefile.in: Rebuild.
16158
16159 2008-07-22 Ian Lance Taylor <iant@google.com>
16160
16161 * options.h (class General_options): Define --check-sections.
16162 * layout.cc (Layout::set_segment_offsets): Handle
16163 --check-sections.
16164
16165 * options.h (class General_options): Define -n/--nmagic and
16166 -N/--omagic.
16167 * options.cc (General_options::finalize): For -n/--nmagic or
16168 -N/--omagic, set -static.
16169 * layout.cc (Layout::attach_allocated_section_to_segment): If
16170 -N/--omagic, don't put read-only and read-write sections in
16171 different segments.
16172 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16173 finding a read-only segment.
16174 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16175 don't set the minimum segment alignment to the common page size,
16176 and don't set the file offset to the address modulo the page size.
16177 * script-sections.cc (Script_sections::create_segments): If
16178 -n/--omagic, don't put read-only and read-write sections in
16179 different segments.
16180
16181 * cref.cc: New file.
16182 * cref.h: New file.
16183 * options.h (class General_options): Add --print-symbol-counts.
16184 * main.cc (main): Issue defined symbol report if requested.
16185 * archive.cc (Archive::interpret_header): Make into a const member
16186 function.
16187 (Archive::add_symbols): Call Input_objects::archive_start and
16188 archive_stop.
16189 (Archive::const_iterator): Define new class.
16190 (Archive::begin, Archive::end): New functions.
16191 (Archive::include_all_members): Rewrite to use iterator.
16192 (Archive::count_members): New function.
16193 * archive.h (class Archive): Update declarations.
16194 (Archive::filename): New function.
16195 * object.cc: Include "cref.h".
16196 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16197 (Sized_relobj::do_get_global_symbol_counts): New function.
16198 (Input_objects::add_object): Add object to cross-referencer.
16199 (Input_objects::archive_start): New function.
16200 (Input_objects::archive_stop): New function.
16201 (Input_objects::print_symbol_counts): New function.
16202 * object.h: Declare Cref and Archive.
16203 (Object::get_global_symbol_counts): New function.
16204 (Object::do_get_global_symbol_counts): New pure virtual function.
16205 (class Sized_relobj): Add defined_count_ field. Update
16206 declarations.
16207 (class Input_objects): Add cref_ field. Update constructor.
16208 Update declarations.
16209 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16210 defined_count_.
16211 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16212 symbol counts.
16213 (Sized_dynobj::do_get_global_symbol_counts): New function.
16214 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16215 defined_count_. Update declarations. Define Symbols typedef.
16216 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16217 parameter. Change all callers.
16218 (Symbol_table::add_from_dynobj): Add sympointers and defined
16219 parameters. Change all callers.
16220 * symtab.h (class Symbol_table): Update declarations.
16221 * Makefile.am (CCFILES): Add cref.cc.
16222 (HFILES): Add cref.h.
16223 * Makefile.in: Rebuild.
16224
16225 2008-07-22 Simon Baldwin <simonb@google.com>
16226
16227 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16228 to zero when writing undefined symbols.
16229
16230 2008-07-22 Ian Lance Taylor <iant@google.com>
16231
16232 * output.cc (Output_section::add_input_section): Don't try to
16233 merge empty merge sections.
16234
16235 2008-07-21 Craig Silverstein <csilvers@google.com>
16236
16237 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16238 Include symbol version in error message.
16239
16240 2008-07-20 Chris Demetriou <cgd@google.com>
16241
16242 * configure.ac (gold_cv_c_random_seed): New configured variable.
16243 (RANDOM_SEED_CFLAGS): New substituted variable.
16244 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16245 * configure: Rebuild.
16246 * Makefile.in: Likewise.
16247 * testsuite/Makefile.in: Likewise.
16248
16249 2008-07-18 Ian Lance Taylor <iant@google.com>
16250
16251 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16252 where we see NAME/NULL and NAME/VERSION as separate symbols.
16253 * testsuite/ver_test_main.cc (main): Call t4.
16254 (t4, t4_2a): Define.
16255 * testsuite/ver_test_2.cc (t4_2): Define.
16256 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16257 * testsuite/ver_test_4.cc (t4_2a): Define.
16258 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16259 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16260
16261 2008-07-17 Ian Lance Taylor <iant@google.com>
16262
16263 * dynobj.cc (Versions::add_def): If we give an error about a
16264 missing version, go ahead and create the version anyhow.
16265
16266 2008-07-10 Ian Lance Taylor <iant@google.com>
16267
16268 Handle output sections with more than 0x7fffffff bytes.
16269 * object.h (class Relobj): Change map_to_output_ to
16270 output_sections_, and just keep a section pointer. Change all
16271 uses. Move comdat group support to Sized_relobj.
16272 (Relobj::is_section_specially_mapped): Remove.
16273 (Relobj::output_section): Remove poff parameter. Change all
16274 callers.
16275 (Relobj::output_section_offset): New function.
16276 (Relobj::set_section_offset): Rewrite.
16277 (Relobj::map_to_output): Remove.
16278 (Relobj::output_sections): New function.
16279 (Relobj::do_output_section_offset): New pure virtual function.
16280 (Relobj::do_set_section_offset): Likewise.
16281 (class Sized_relobj): Add section_offsets_ field. Add comdat
16282 group support from Relobj. Update declarations.
16283 (Sized_relobj::get_output_section_offset): New function.
16284 (Sized_relobj::do_output_section_offset): New function.
16285 (Sized_relobj::do_set_section_offset): New function.
16286 * object.cc (Relobj::output_section_address): Remove.
16287 (Sized_relobj::Sized_relobj): Initialize new fields.
16288 (Sized_relobj::include_section_group): Cast find_kept_object to
16289 Sized_relobj.
16290 (Sized_relobj::include_linkonce_section): Likewise.
16291 (Sized_relobj::do_layout): Use separate arrays for output section
16292 and output offset.
16293 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16294 output_sections.
16295 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16296 output_sections and section_offsets.
16297 (Sized_relobj::write_local_symbols): Likewise.
16298 (map_to_kept_section): Compute output address directly.
16299 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16300 output_sections and section_offsets.
16301 (Sized_relobj::write_sections): Likewise.
16302 (Sized_relobj::relocate_sections): Likewise.
16303 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16304 * output.h (class Output_reloc): Update declarations. Change
16305 u2_.relobj to Sized_relobj*.
16306 (class Output_data_reloc): Change add functions to use
16307 Sized_relobj*.
16308 * output.cc (Output_reloc::Output_reloc): Change relobj to
16309 Sized_relobj*.
16310 (Output_reloc::local_section_offset): Change return type to
16311 Elf_Addr. Use get_output_section_offset.
16312 (Output_reloc::get_address): Likewise.
16313 (Output_section::is_input_address_mapped): Don't call
16314 is_section_specially_mapped.
16315 (Output_section::output_offset): Likewise.
16316 (Output_section::output_address): Likewise.
16317 (Output_section::starting_output_address): Likewise.
16318 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16319 parameter to Sized_relobj*.
16320 (Copy_relocs::need_copy_reloc): Likewise.
16321 (Copy_relocs::save): Likewise.
16322 * copy-relocs.h (class Copy_relocs): Update declarations.
16323 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16324 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16325 * target-reloc.h (relocate_for_relocatable): Change
16326 offset_in_output_section type to Elf_Addr. Change code that uses
16327 it as well.
16328 * layout.cc (Layout::layout): Always set *off.
16329 * mapfile.cc (Mapfile::print_input_section): Use
16330 output_section_offset.
16331 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16332 Sized_relobj*.
16333 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16334 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16335 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16336
16337 2008-07-03 Ian Lance Taylor <iant@google.com>
16338
16339 * layout.cc (Layout::include_section): Do not discard unrecognized
16340 SHT_STRTAB sections.
16341
16342 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16343
16344 * script.cc (Lex::can_continue_name): Make '?' allowable in
16345 version-script names.
16346 * testsuite/version_script.map: Change glob pattern to use '?'
16347
16348 2008-06-30 Manish Singh <yosh@gimp.org>
16349
16350 PR 6585
16351 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16352 Correct typo.
16353
16354 2008-06-30 Ian Lance Taylor <iant@google.com>
16355
16356 PR 6660
16357 PR 6682
16358 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16359 versions]: Don't try to read the value in the contents, since we
16360 don't use it. Use the template endianness when writing.
16361
16362 2008-06-25 Cary Coutant <ccoutant@google.com>
16363
16364 * fileread.cc (File_read::make_view): Assert on zero-length view.
16365 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16366 symbol table when there are no symbols to read.
16367
16368 2008-06-23 Craig Silverstein <csilvers@google.com>
16369
16370 * version.cc (version_string): Bump to 1.7
16371
16372 2008-06-18 Craig Silverstein <csilvers@google.com>
16373
16374 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16375 constant 0xFFFF to type Valtype.
16376 (Powerpc_relocate_functions::rel16_ha): Likewise.
16377
16378 2008-06-17 Ian Lance Taylor <iant@google.com>
16379
16380 * output.h (Output_section::Input_section): Initialize p2align_ to
16381 zero for Output_section_data constructors.
16382 (Output_section::Input_section::addralign): If not an input
16383 section, return the alignment of the Output_section_data.
16384 * testsuite/copy_test.cc: New file.
16385 * testsuite/copy_test_1.cc: New file.
16386 * testsuite/copy_test_2.cc: New file.
16387 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16388 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16389 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16390 (copy_test_1_pic.o, copy_test_1.so): New targets.
16391 (copy_test_2_pic.o, copy_test_2.so): New targets.
16392 * testsuite/Makefile.in: Rebuild.
16393
16394 * script-sections.cc (Script_sections::place_orphan): Initialize
16395 local variable exact.
16396
16397 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16398
16399 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16400
16401 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16402 David S. Miller <davem@davemloft.net>
16403
16404 * powerpc.cc: New file.
16405 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16406 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16407 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16408 * Makefile.in: Rebuild.
16409
16410 2008-06-09 Ian Lance Taylor <iant@google.com>
16411
16412 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16413 <exception>.
16414 (throwing, orig_terminate): New static variables.
16415 (terminate_handler): New static function.
16416 (t2): Set terminate handler.
16417
16418 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16419
16420 PR 6584
16421 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16422 alignment.
16423
16424 2008-05-30 Cary Coutant <ccoutant@google.com>
16425
16426 * archive.cc (Archive::include_all_members) Correct to step
16427 over symbol table and extended name table in thin archives.
16428
16429 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16430
16431 PR 6407
16432 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16433 calculation.
16434
16435 2008-05-28 Caleb Howe <cshowe@google.com>
16436
16437 * reduced_debug_output.cc: New file.
16438 * reduced_debug_output.h: New file.
16439 * options.h (class General_options): Add --strip-debug-non-line.
16440 * options.cc (General_options::finalize): Add strip_debug_non_line
16441 to the strip heirarchy.
16442 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16443 fields.
16444 * layout.cc: Include "reduced_debug_output.h".
16445 (Layout::Layout): Initialize new fields.
16446 (line_only_debug_sections): New static array.
16447 (is_lines_only_debug_sections): New static inline function.
16448 (Layout::include_section): Handle --strip-debug-non-line.
16449 (Layout::make_output_section): If --strip-debug-non-line, build
16450 new output sections for .debug_abbrev and .debug_info.
16451 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16452 gold. Warn about possible overflow.
16453 (read_signed_LEB_128): Likewise.
16454 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16455 (read_signed_LEB_128): Declare.
16456 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16457 (HFILES): Add reduced_debug_output.h.
16458 * Makefile.in: Rebuild.
16459
16460 2008-05-21 Ian Lance Taylor <iant@google.com>
16461
16462 * mapfile.cc: New file.
16463 * mapfile.h: New file.
16464 * options.h (class General_options): Add -M/--print-map and -Map.
16465 * options.cc (General_options::finalize): Make -M equivalent to
16466 -Map -.
16467 * main.cc: Include <cstdio> and "mapfile.h".
16468 (main): Open mapfile if requested.
16469 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16470 constructor. Change caller.
16471 (queue_initial_tasks): Add mapfile parameter. Change caller.
16472 (queue_middle_tasks): Likewise.
16473 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16474 declarations.
16475 * archive.cc: Include "mapfile.h".
16476 (Archive::add_symbols): Add mapfile parameter. Change all
16477 callers. Pass mapfile, symbol, and reason to include_member.
16478 (Archive::include_all_members): Add mapfile parameter. Change all
16479 callers.
16480 (Archive::include_member): Add mapfile, sym, and why parameters.
16481 Change all callers. Report inclusion to map file.
16482 * archive.h: Include "fileread.h".
16483 (class Archive): Update declarations.
16484 (Archive::file): New const method.
16485 (class Add_archive_symbols): Add mapfile_ field. Update
16486 constructor. Change all callers.
16487 * readsyms.h (class Read_symbols): Likewise.
16488 (class Finish_group): Likewise.
16489 (class Read_script): Likewise.
16490 * common.cc: Include "mapfile.h".
16491 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16492 all callers.
16493 (Symbol_table::do_allocate_commons): Likewise.
16494 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16495 symbol allocation to mapfile.
16496 * common.h (class Allocate_commons_task): Add mapfile_ field.
16497 Update constructor. Change all callers.
16498 * symtab.h (class Symbol_table): Update declarations.
16499 * layout.cc: Include "mapfile.h".
16500 (Layout_task_runner::run): Print information to mapfile.
16501 (Layout::create_gold_note): Change Output_data_fixed_space to
16502 Output_data_zero_fill.
16503 (Layout::create_build_id): Likewise.
16504 (Layout::print_to_mapfile): New function.
16505 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16506 constructor. Change caller.
16507 (class Layout): Declare print_to_mapfile.
16508 * output.cc (Output_section::Input_section::print_to_mapfile): New
16509 function.
16510 (Output_section::add_input_section): If producing a map, always
16511 add to input_sections_ list.
16512 (Output_section::do_print_to_mapfile): New function.
16513 (Output_segment::print_sections_to_mapfile): New function.
16514 (Output_segment::print_section_list_to_mapfile): New function.
16515 * output.h: Include "mapfile.h".
16516 (Output_data::print_to_mapfile): New function.
16517 (Output_data::do_print_to_mapfile): New virtual function.
16518 (Output_segment_headers::do_print_to_mapfile): New function.
16519 (Output_file_header::do_print_to_mapfile): New function.
16520 (Output_data_const::do_print_to_mapfile): New function.
16521 (class Output_data_const_buffer): Add map_name_ field. Update
16522 constructor. Change all callers. Add do_print_to_mapfile
16523 function.
16524 (class Output_data_fixed_space): Likewise.
16525 (class Output_data_space): Likewise.
16526 (class Output_data_zero_fill): New class.
16527 (Output_data_strtab::do_print_to_mapfile): New function.
16528 (Output_data_reloc_base::do_print_to_mapfile): New function.
16529 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16530 (Output_data_group::do_print_to_mapfile): New function.
16531 (Output_data_got::do_print_to_mapfile): New function.
16532 (Output_data_dynamic::do_print_to_mapfile): New function.
16533 (Output_symtab_xindex::do_print_to_mapfile): New function.
16534 (class Output_section): Declare do_print_to_mapflie. Declare
16535 print_to_mapfile in Input_section.
16536 (class Output_segment): Declare new functions.
16537 * object.h (Sized_relobj::symbol_count): New function.
16538 * script-sections.cc
16539 (Output_section_element_dot_assignment::set_section_addresses):
16540 Change Output_data_fixed_space to Output_data_zero_fill.
16541 (Output_data_expression::do_print_to_mapfile): New function.
16542 * script.cc (read_input_script): Add mapfile parameter. Change
16543 all callers.
16544 * script.h (read_input_script): Update declaration.
16545 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16546 (Eh_frame::do_print_to_mapfile): New function.
16547 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16548 (Output_merge_string::do_print_to_mapfile): New function.
16549 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16550 function.
16551 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16552 function.
16553 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16554 function.
16555 * Makefile.am (CCFILES): Add mapfile.cc.
16556 (HFILES): Add mapfile.h.
16557 * Makefile.in: Rebuild.
16558
16559 2008-05-19 Ian Lance Taylor <iant@google.com>
16560
16561 * options.h (class General_options): Add -z relro.
16562 * layout.cc (Layout::Layout): Initialize relro_segment_.
16563 (Layout::add_output_section_data): Return the output section.
16564 (Layout::make_output_section): Rcognize relro sections and mark
16565 them appropriately.
16566 (Layout::attach_allocated_section_to_segment): Put relro sections
16567 in a PT_GNU_RELRO segment.
16568 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16569 section as relro.
16570 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16571 PT_TLS segments.
16572 (Layout::linkonce_mapping): Map d.rel.ro.local to
16573 .data.rel.ro.local.
16574 (Layout::output_section_name): Us .data.rel.ro.local for any
16575 section which begins with that.
16576 * layout.h (class Layout): Update add_output_section_data
16577 declaration. Add relro_segment_ field.
16578 * output.cc (Output_section::Output_section): Initialize is_relro_
16579 and is_relro_local_ fields.
16580 (Output_segment::add_output_section): Group relro sections.
16581 (Output_segment::is_first_section_relro): New function.
16582 (Output_segment::maximum_alignment): If there is a relro section,
16583 align the segment to the common page size.
16584 (Output_segment::set_section_addresses): Track whether we are
16585 looking at relro sections. If the last section is a relro
16586 section, align to the common page size.
16587 (Output_segment::set_section_list_addresses): Add in_relro
16588 parameter. Change all callers. Align to the page size when
16589 moving from relro to non-relro section.
16590 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16591 segment.
16592 * output.h (class Output_section): Add is_relro_ and
16593 is_relro_local_ fields.
16594 (Output_section::is_relro): New function.
16595 (Output_section::set_is_relro): New function.
16596 (Output_section::is_relro_local): New function.
16597 (Output_section::set_is_relro_local): New function.
16598 (class Output_segment): Update declarations.
16599 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16600 * sparc.cc (Target_sparc::got_section): Likewise.
16601 * x86_64.cc (Target_x86_64::got_section): Likewise.
16602 * testsuite/relro_test_main.cc: New file.
16603 * testsuite/relro_test.cc: New file.
16604 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16605 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16606 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16607 (relro_test.so, relro_test_pic.o): New targets.
16608 * testsuite/Makefile.in: Rebuild.
16609
16610 2008-05-16 Ian Lance Taylor <iant@google.com>
16611
16612 * output.cc (Output_segment::add_output_section): Remove front
16613 parameter.
16614 * output.h (class Output_segment): Remove
16615 add_initial_output_section and overloaded add_output_section.
16616 Update declaration of remaining add_output_section.
16617 * layout.cc (Layout::create_interp): Call add_output_section
16618 rather than add_initial_output_section.
16619 (Layout::finish_dynamic_section): Likewise.
16620
16621 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16622 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16623 know the dynamic type.
16624 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16625 field. Initialize it in constructor.
16626 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16627 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16628 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16629 reloc.
16630
16631 * output.cc (Output_reloc::get_address): Change return type to
16632 Elf_Addr.
16633 * output.h (class Output_reloc): Update get_address declaration.
16634 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16635 for section addresses.
16636
16637 2008-05-09 Ian Lance Taylor <iant@google.com>
16638
16639 PR 6493
16640 * gold.cc (gold_nomem): Use return value of write.
16641
16642 2008-05-08 Ian Lance Taylor <iant@google.com>
16643
16644 * symtab.c (Symbol::init_base_output_data): Add version
16645 parameter. Change all callers.
16646 (Symbol::init_base_output_segment): Likewise.
16647 (Symbol::init_base_constant): Likewise.
16648 (Symbol::init_base_undefined): Likewise.
16649 (Sized_symbol::init_output_data): Likewise.
16650 (Sized_symbol::init_output_segment): Likewise.
16651 (Sized_symbol::init_constant): Likewise.
16652 (Sized_symbol::init_undefined): Likewise.
16653 (Symbol_table::do_define_in_output_data): If the new symbol has a
16654 version, mark it as the default.
16655 (Symbol_table::do_define_in_output_segment): Likewise.
16656 (Symbol_table::do_define_as_constant): Likewise.
16657 * symtab.h (class Symbol): Update declarations.
16658 (class Sized_symbol): Likewise.
16659 * resolve.cc (Symbol::override_version): New function.
16660 (Symbol::override_base): Call override_version.
16661 (Symbol::override_base_with_special): Likewise.
16662 * testsuite/ver_script_8.script: New file.
16663 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16664 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16665 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16666 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16667
16668 2008-05-06 Ian Lance Taylor <iant@google.com>
16669
16670 PR 6049
16671 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16672 functions.
16673 (class General_options): Remove existing --undefined, and add
16674 --no-undefined instead. Add new --undefined as synonym for -u.
16675 * archive.cc (Archive::add_symbols): Check whether symbol was
16676 named with -u.
16677 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16678 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16679 all uses. Add IS_UNDEFINED. Update declarations to split
16680 different versions of init_base. Declare init_base_undefined.
16681 (Symbol::is_defined): Handle IS_UNDEFINED.
16682 (Symbol::is_undefined): Likewise.
16683 (Symbol::is_weak_undefined): Call is_undefined.
16684 (Symbol::is_absolute): Handle IS_CONSTANT.
16685 (class Sized_symbol): Update declarations to split different
16686 versions of init. Declare init_undefined.
16687 (class Symbol_table): Declare new functions.
16688 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16689 Change all callers.
16690 (Symbol::init_base_output_data): Likewise.
16691 (Symbol::init_base_output_segment): Likewise.
16692 (Symbol::init_base_constant): Likewise.
16693 (Symbol::init_base_undefined): New function.
16694 (Sized_symbol::init_object): Rename from init. Change all
16695 callers.
16696 (Sized_symbol::init_output_data): Likewise.
16697 (Sized_symbol::init_output_segment): Likewise.
16698 (Sized_symbol::init_constant): Likewise.
16699 (Sized_symbol::init_undefined): New function.
16700 (Symbol_table::add_undefined_symbols_from_command_line): New
16701 function.
16702 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16703 function.
16704 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16705 (Symbol::output_section): Likewise.
16706 (Symbol::set_output_section): Likewise.
16707 (Symbol_table::sized_finalize_symbol): Likewise.
16708 (Symbol_table::sized_write_globals): Likewise.
16709 * resolve.cc (Symbol_table::should_override): Likewise.
16710 (Symbol::override_base_with_special): Likewise.
16711
16712 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16713 symbol, change it to have default visibility.
16714 * testsuite/protected_1.cc: New file.
16715 * testsuite/protected_2.cc: New file.
16716 * testsuite/protected_3.cc: New file.
16717 * testsuite/protected_main_1.cc: New file.
16718 * testsuite/protected_main_2.cc: New file.
16719 * testsuite/protected_main_3.cc: New file.
16720 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16721 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16722 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16723 (protected_1.so): New target.
16724 (protected_1_pic.o, protected_2_pic.o): New targets.
16725 (protected_3_pic.o): New target.
16726 (check_PROGRAMS): Add protected_2.
16727 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16728 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16729 * testsuite/Makefile.in: Rebuild.
16730
16731 * options.h (DEFINE_var): Add set_user_set_##varname__.
16732 (DEFINE_bool_alias): New macro.
16733 (class General_options): Define -Bstatic using DEFINE_bool_alias
16734 rather than DEFINE_special. Add --undefined as an alias for -z
16735 defs.
16736 * options.cc (General_options::parse_Bstatic): Remove.
16737
16738 * options.h (class General_options): Add --fatal-warnings.
16739 * main.cc (main): Implement --fatal-warnings.
16740 * errors.h (Errors::warning_count): New function.
16741
16742 * options.h (class General_options): Add -Bsymbolic-functions.
16743 * symtab.h (Symbol::is_preemptible): Check for
16744 -Bsymbolic-functions.
16745
16746 2008-05-05 Ian Lance Taylor <iant@google.com>
16747
16748 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16749 as noVARNAME rather than no-VARNAME.
16750 (class General_options): Add option -z combreloc.
16751 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16752 get_address.
16753 (Output_reloc::sort_before) [SHT_REL]: New function.
16754 (Output_reloc::sort_before) [SHT_RELA]: New function.
16755 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16756 Sort_relocs_comparison.
16757 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16758 parameter. Change all callers.
16759 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16760 sort_relocs parameter. Change all callers.
16761 * output.cc (Output_reloc::get_address): New function, broken out
16762 of write_rel.
16763 (Output_reloc::write_rel): Call it.
16764 (Output_reloc::compare): New function.
16765 (Output_data_reloc_base::do_write): Optionally sort relocs.
16766
16767 * configure.ac: If targ_extra_obj is set, link it in.
16768 * configure.tgt: Initialize all variables.
16769 (x86_64*): Set targ_extra_obj and targ_extra_size.
16770 * configure: Rebuild.
16771
16772 * object.cc (Sized_relobj::include_section_group): Adjust section
16773 indexes read from group data. Build vector to pass to
16774 layout_group.
16775 * layout.cc (Layout::layout_group): Add flags and shndxes
16776 parameters. Remove contents parameter. Change caller. Update
16777 explicit instantiations.
16778 * layout.h (class Layout): Update layout_group declaration.
16779 * output.cc (Output_data_group::Output_data_group): Add flags and
16780 input_shndxes parameters. Remove contents parameter. Change
16781 caller.
16782 (Output_data_group::do_write): Change input_sections_ to
16783 input_shndxes_.
16784 * output.h (class Output_data_group): Update constructor
16785 declaration. Rename input_sections_ to input_shndxes_.
16786 * testsuite/many_sections_test.cc: Add template.
16787
16788 2008-04-30 Cary Coutant <ccoutant@google.com>
16789
16790 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16791
16792 * layout.cc (Layout::include_section): Refactored check for debug
16793 info section.
16794 (Layout::add_comdat): Add new parameters. Change type
16795 of signature parameter. Add object and shndx to signatures table.
16796 (Layout::find_kept_object): New function.
16797 * layout.h: Include <cstring>.
16798 (Layout::is_debug_info_section): New function.
16799 (Layout::add_comdat): Add new parameters.
16800 (Layout::find_kept_object): New function.
16801 (Layout::Kept_section): New struct.
16802 (Layout::Signatures): Change type of map range.
16803 * object.cc (Relobj::output_section_address): New function.
16804 (Sized_relobj::include_section_group): Add new parameters. Change
16805 calls to Layout::add_comdat. Change to build table of kept comdat
16806 groups and table mapping discarded sections to kept sections.
16807 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16808 (Sized_relobj::do_layout): Change calls to include_section_group and
16809 include_linkonce_section.
16810 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16811 value to zero when section is discarded.
16812 (Sized_relobj::map_to_kept_section): New function.
16813 * object.h (Relobj::output_section_address): New function.
16814 (Relobj::Comdat_group): New type.
16815 (Relobj::find_comdat_group): New function.
16816 (Relobj::Comdat_group_table): New type.
16817 (Relobj::Kept_comdat_section): New type.
16818 (Relobj::Kept_comdat_section_table): New type.
16819 (Relobj::add_comdat_group): New function.
16820 (Relobj::set_kept_comdat_section): New function.
16821 (Relobj::get_kept_comdat_section): New function.
16822 (Relobj::comdat_groups_): New field.
16823 (Relobj::kept_comdat_sections_): New field.
16824 (Symbol_value::input_value): Update comment.
16825 (Sized_relobj::map_to_kept_section) New function.
16826 (Sized_relobj::include_linkonce_section): Add new parameter.
16827 * target-reloc.h (Comdat_behavior): New type.
16828 (get_comdat_behavior): New function.
16829 (relocate_section): Add code to map a discarded section to the
16830 corresponding kept section when applying a relocation.
16831
16832 2008-04-30 Craig Silverstein <csilvers@google.com>
16833
16834 * dwarf_reader.cc (next_generation_count): New static var.
16835 (Addr2line_cache_entry): New struct.
16836 (addr2line_cache): New static var.
16837 (Dwarf_line_info::one_addr2line): Added caching.
16838 (Dwarf_line_info::clear_addr2line_cache): New function.
16839 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16840 cache-size parameter.
16841 (Dwarf_line_info::one_addr2line_cache): New function.
16842 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16843 new cache-size argument to one_addr2line(), and clear cache.
16844
16845 2008-04-28 Cary Coutant <ccoutant@google.com>
16846
16847 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16848 R_386_PC8 relocations.
16849
16850 2008-04-23 Ian Lance Taylor <iant@google.com>
16851
16852 * object.cc (Sized_relobj::include_section_group): Check for
16853 invalid section group.
16854
16855 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16856 header size.
16857
16858 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16859 than read for file header.
16860 * archive.cc (Archive::include_member): Likewise.
16861
16862 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16863
16864 * aclocal.m4: Regenerate.
16865 * configure: Regenerate.
16866
16867 2008-04-19 Ian Lance Taylor <iant@google.com>
16868
16869 * version.cc (version_string): Bump to 1.6.
16870
16871 * testsuite/Makefile.am (many_sections_r_test): New target.
16872 (many_sections_r_test_SOURCES): Remove.
16873 (many_sections_r_test_DEPENDENCIES): Remove.
16874 (many_sections_r_test_LDFLAGS): Remove.
16875 (many_sections_r_test_LDADD): Remove.
16876
16877 * object.cc (Sized_relobj::do_add_symbols): Always pass
16878 local_symbol_count_ to add_from_relobj.
16879
16880 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16881 every thousand variables.
16882 * testsuite/Makefile.in: Rebuild.
16883
16884 * object.cc (Xindex::initialize_symtab_xindex): New function.
16885 (Xindex::read_symtab_xindex): New function.
16886 (Xindex::sym_xindex_to_shndx): New function.
16887 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16888 available.
16889 (Sized_relobj::do_initialize_xindex): New function.
16890 (Sized_relobj::do_read_symbols): Adjust section links.
16891 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16892 parameter. Change all callers.
16893 (Sized_relobj::include_section_group): Adjust section links and
16894 symbol section indexes.
16895 (Sized_relobj::do_layout): Adjust section links.
16896 (Sized_relobj::do_count_local_symbols): Adjust section links and
16897 symbol section indexes.
16898 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16899 ordinary and special symbols.
16900 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16901 dynsym_xindex parameters. Change all callers. Adjust section
16902 links. Use SHN_XINDEX when needed.
16903 (Sized_relobj::get_symbol_location_info): Adjust section links.
16904 Don't get fooled by special symbols.
16905 * object.h (class Xindex): Define.
16906 (class Object): Add xindex_ parameter. Declare virtual functoin
16907 do_initialize_xindex.
16908 (Object::adjust_sym_shndx): New function.
16909 (Object::set_xindex): New protected function.
16910 (class Symbol_value): Add is_ordinary_shndx_ field.
16911 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16912 (Symbol_value::value): Assert ordinary section.
16913 (Symbol_value::initialize_input_to_output_map): Likewise.
16914 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16915 Change all callers.
16916 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16917 all callers.
16918 (class Sized_relobj): Update declarations.
16919 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16920 parameter. Change all callers.
16921 (Sized_relobj::adjust_shndx): New function.
16922 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16923 field.
16924 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16925 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16926 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16927 (Sized_dynobj::read_dynsym_section): Adjust section links.
16928 (Sized_dynobj::read_dynamic): Likewise.
16929 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16930 section links.
16931 (Sized_dynobj::do_initialize_xindex): New function.
16932 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16933 do_initialize_xindex.
16934 (Sized_dynobj::adjust_shndx): New function.
16935 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16936 dynsym_xindex_ fields.
16937 (Layout::finalize): Add a call to set_section_indexes before
16938 creating the symtab sections.
16939 (Layout::set_section_indexes): Don't do anything if the section
16940 already has a section index.
16941 (Layout::create_symtab_sections): Add shnum parameter. Change
16942 caller. Create .symtab_shndx section if needed.
16943 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16944 caller.
16945 (Layout::allocated_output_section_count): New function.
16946 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16947 needed.
16948 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16949 fields. Update declarations.
16950 (Layout::symtab_xindex): New function.
16951 (Layout::dynsym_xindex): New function.
16952 (class Write_symbols_task): Add layout_ field.
16953 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16954 Change caller.
16955 * output.cc (Output_section_headers::Output_section_headers): Add
16956 shstrtab_section parameter. Change all callers.
16957 (Output_section_headers::do_sized_write): Store overflow values
16958 for section count and section string table section index in
16959 section header zero.
16960 (Output_file_header::do_sized_write): Check for overflow of
16961 section count and section string table section index.
16962 (Output_symtab_xindex::do_write): New function.
16963 (Output_symtab_xindex::endian_do_write): New function.
16964 * output.h (class Output_section_headers): Add shstrtab_section_.
16965 Update declarations.
16966 (class Output_symtab_xindex): Define.
16967 (Output_section::has_out_shndx): New function.
16968 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16969 field.
16970 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16971 Change all callers.
16972 (Sized_symbol::init): Likewise.
16973 (Symbol::output_section): Check for ordinary symbol.
16974 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16975 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16976 callers.
16977 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16978 Change all callers. Simplify handling of symbols from sections
16979 not included in the link.
16980 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16981 distinction.
16982 (Weak_alias_sorter::operator()): Assert that symbols are
16983 ordinary.
16984 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16985 distinction.
16986 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16987 parameters. Change all callers.
16988 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16989 symbol distinction. Use SHN_XINDEX when needed.
16990 (Symbol_table::write_section_symbol): Add symtab_xindex
16991 parameter. Change all callers.
16992 (Symbol_table::sized_write_section_symbol): Likewise. Use
16993 SHN_XINDEX when needed.
16994 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16995 declarations.
16996 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16997 (Symbol::is_defined): Check is_ordinary.
16998 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16999 (Symbol::is_absolute, Symbol::is_common): Likewise.
17000 (class Sized_symbol): Update declarations.
17001 (class Symbol_table): Update declarations.
17002 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17003 parameters. Change all callers.
17004 (Sized_symbol::override): Likewise.
17005 (Symbol_table::override): Likewise.
17006 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17007 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17008 is_ordinary, and orig_st_shndx parameters. Change all callers.
17009 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17010 to be in an ordinary section.
17011 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17012 object and is_ordinary parameters. Change all callers.
17013 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17014 Change all callers. Don't add undefined or non-ordinary symbols
17015 to reloc_map_.
17016 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17017 Change all callers.
17018 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17019 declarations.
17020 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17021 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17022 (Sized_relobj::relocate_sections): Likewise.
17023 * target-reloc.h (scan_relocs): Adjust section symbol index.
17024 (scan_relocatable_relocs): Likewise.
17025 * i386.cc (Scan::local): Check for ordinary symbols.
17026 * sparc.cc (Scan::local): Likewise.
17027 * x86_64.cc (Scan::local): Likewise.
17028 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17029 to symbol_section_and_value.
17030 * testsuite/many_sections_test.cc: New file.
17031 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17032 (check_PROGRAMS): Add many_sections_test.
17033 (many_sections_test_SOURCES): Define.
17034 (many_sections_test_DEPENDENCIES): Define.
17035 (many_sections_test_LDFLAGS): Define.
17036 (BUILT_SOURCES): Add many_sections_define.h.
17037 (many_sections_define.h): New target.
17038 (BUILT_SOURCES): Add many_sections_check.h.
17039 (many_sections_check.h): New target.
17040 (check_PROGRAMS): Add many_sections_r_test.
17041 (many_sections_r_test_SOURCES): Define.
17042 (many_sections_r_test_DEPENDENCIES): Define.
17043 (many_sections_r_test_LDFLAGS): Define.
17044 (many_sections_r_test_LDADD): Define.
17045 (many_sections_r_test.o): New target.
17046 * testsuite/Makefile.in: Rebuild.
17047
17048 2008-04-17 Cary Coutant <ccoutant@google.com>
17049
17050 * errors.cc (Errors::info): New function.
17051 (gold_info): New function.
17052 * errors.h (Errors::info): New function.
17053 * gold.h (gold_info): New function.
17054 * object.cc (Input_objects::add_object): Print trace output.
17055 * options.cc (options::parse_set): New function.
17056 (General_options::parse_wrap): Deleted.
17057 (General_options::General_options): Deleted initializer.
17058 * options.h (options::String_set): New typedef.
17059 (options::parse_set): New function.
17060 (DEFINE_set): New macro.
17061 (General_options::wrap): Changed to use DEFINE_set. Changed
17062 callers of any_wrap_symbols and is_wrap_symbol.
17063 (General_options::trace, General_options::trace_symbol):
17064 New options.
17065 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17066 (General_options::wrap_symbols_): Deleted.
17067 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17068
17069 2008-04-17 David S. Miller <davem@davemloft.net>
17070
17071 * options.cc (General_options::parse_V): New function.
17072 * options.h: Add entries for -V and -Qy.
17073
17074 2008-04-17 Ian Lance Taylor <iant@google.com>
17075
17076 * common.cc (Symbol_table::allocate_commons): Remove options
17077 parameter. Change caller.
17078 (Symbol_table::do_allocate_commons): Remove options parameter.
17079 Change caller. Just call do_allocate_commons_list twice.
17080 (Symbol_table::do_allocate_commons_list): New function, broken out
17081 of do_allocate_commons.
17082 * common.h (class Allocate_commons_task): Remove options_ field.
17083 Update constructor.
17084 * symtab.cc (Symbol_table::Symbol_table): Initialize
17085 tls_commons_.
17086 (Symbol_table::add_from_object): Put TLS common symbols on
17087 tls_commons_ list.
17088 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17089 which are IN_OUTPUT_DATA.
17090 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17091 allocate_commons and do_allocate_commons declarations. Declare
17092 do_allocate_commons_list.
17093 * gold.cc (queue_middle_tasks): Update creation of
17094 Allocate_commons_task to not pass options.
17095 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17096 (TLS_TEST_C_FLAGS): New variable.
17097 (tls_test_c_pic.o): New target.
17098 (tls_test_shared.so): Link in tls_test_c_pic.o.
17099 (tls_test_c_pic_ie.o): New target.
17100 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17101 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17102 (tls_test_c.o): New target.
17103 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17104 (tls_pic_test_LDADD): Likewise.
17105 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17106 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17107 (tls_test_c_gnu2.o): New target.
17108 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17109 tls_test_c_gnu2.o.
17110 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17111 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17112 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17113 * testsuite/tls_test.cc: Include "config.h".
17114 (t_last): Call t11_last.
17115 * testsuite/tls_test.h (t11, t11_last): Declare.
17116 * testsuite/tls_test_c.c: New file.
17117 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17118 * configure.ac: Check for OpenMP support.
17119 * configure, config.in, Makefile.in: Rebuild.
17120 * testsuite/Makefile.in: Rebuild.
17121
17122 2008-04-16 Cary Coutant <ccoutant@google.com>
17123
17124 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17125 (Target_i386::tls_base_symbol_defined_): New field.
17126 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17127 (Target_i386::Scan::global): Likewise.
17128 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17129 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17130 (Target_x86_64::tls_base_symbol_defined_): New field.
17131 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17132 (Target_x86_64::Scan::global): Likewise.
17133
17134 2008-04-16 Cary Coutant <ccoutant@google.com>
17135
17136 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17137 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17138 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17139 building shared libraries.
17140 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17141 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17142 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17143 * testsuite/Makefile.in: Rebuild.
17144 * testsuite/weak_undef.h: New file.
17145 * testsuite/weak_undef_file1.cc: Add extra test cases.
17146 * testsuite/weak_undef_file2.cc: Likewise.
17147 * testsuite/weak_undef_test.cc: Likewise.
17148
17149 2008-04-16 David S. Miller <davem@davemloft.net>
17150
17151 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17152 Add issued_non_pic_error_ field. Declare check_non_pic.
17153 (Target_sparc::Scan::check_non_pic): New function.
17154 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17155 (Target_sparc::Scan::global): Likewise.
17156
17157 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17158 * configure: Rebuild.
17159
17160 * options.h (DEFINE_enable): New macro.
17161 (new_dtags): New enable option.
17162 (initfirst, interpose, loadfltr, nodefaultlib,
17163 nodelete, nodlopen, nodump): New -z options.
17164 * layout.cc (Layout:finish_dynamic_section): If new
17165 dtags enabled, emit DT_RUNPATH. Also, emit a
17166 DT_FLAGS_1 containing any specified -z flags.
17167
17168 2008-04-16 Ian Lance Taylor <iant@google.com>
17169
17170 * copy-relocs.cc: New file.
17171 * copy-relocs.h: New file.
17172 * reloc.cc: Remove Copy_relocs code.
17173 * reloc.h: Likewise.
17174 * reloc-types.h (struct Reloc_types) [both versions]: Add
17175 get_reloc_addend_noerror.
17176 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17177 variants of add_global which take an addend which must be zero.
17178 * i386.cc: Include "copy-relocs.h".
17179 (class Target_i386): Change type of copy_relocs_ to variable,
17180 update initializer.
17181 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17182 Change all callers.
17183 (Target_i386::do_finalize_sections): Change handling of
17184 copy_relocs_.
17185 * sparc.cc: Include "copy-relocs.h".
17186 (class Target_sparc): Change type of copy_relocs_ to variable,
17187 update initializer.
17188 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17189 Change all callers.
17190 (Target_sparc::do_finalize_sections): Change handling of
17191 copy_relocs_.
17192 * x86_64.cc: Include "copy-relocs.h".
17193 (class Target_x86_64): Change type of copy_relocs_ to variable,
17194 update initializer.
17195 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17196 class. Change all callers.
17197 (Target_x86_64::do_finalize_sections): Change handling of
17198 copy_relocs_.
17199 * Makefile.am (CCFILES): Add copy-relocs.cc.
17200 (HFILES): Add copy-relocs.h.
17201
17202 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17203
17204 * testsuite/script_test_4.sh: Permit leading zeroes.
17205
17206 2008-04-15 Ian Lance Taylor <iant@google.com>
17207
17208 * script-sections.cc (Script_sections::create_segments): Use
17209 header_size_adjustment even when there is enough room for the
17210 headers.
17211 * testsuite/script_test_4.sh: New file.
17212 * testsuite/script_test_4.t: New file.
17213 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17214 (check_DATA): Add script_test_4.stdout.
17215 (MOSTLYCLEANFILES): Likewise.
17216 (script_test_4): New target.
17217 (script_test_4.stdout): New target.
17218 * testsuite/Makefile.in: Rebuild.
17219
17220 * sparc.cc: Add definitions for Output_data_plt_sparc class
17221 constants.
17222
17223 2008-04-14 David S. Miller <davem@davemloft.net>
17224
17225 * sparc.cc: New file.
17226 * Makefile.am (TARGETSOURCES): Add sparc.cc
17227 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17228 * configure.tgt: Document targ_extra_size and
17229 targ_extra_big_endian. Add entries for sparc-* and
17230 sparc64-*.
17231 * configure.ac: Handle targ_extra_size and
17232 targ_extra_big_endian.
17233 * Makefile.in: Rebuild.
17234 * configure: Likewise.
17235 * po/POTFILES.in: Likewise.
17236 * po/gold.pot: Likewise.
17237
17238 2008-04-14 Ian Lance Taylor <iant@google.com>
17239
17240 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17241 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17242 in the name/type/flags to section mapping. Don't call
17243 allocate_output_section.
17244 (Layout::choose_output_section): Change parameter from adjust_name
17245 to is_input_section. Don't permit input sections after sections
17246 are attached to segments. Don't call allocate_output_section.
17247 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17248 not write_enable_output_section.
17249 (Layout::make_output_section): Don't push to
17250 unattached_section_list_ nor call attach_to_segment. Call
17251 attach_section_to_segment if sections are attached.
17252 (Layout::attach_sections_to_segments): New function.
17253 (Layout::attach_section_to_segment): New function.
17254 (Layout::attach_allocated_section_to_segment): Rename from
17255 attach_to_segment. Remove flags parameter.
17256 (Layout::allocate_output_section): Remove function.
17257 (Layout::write_enable_output_section): Remove function.
17258 * layout.h (class Layout): Update for above changes. Add new
17259 field sections_are_attached_.
17260 * output.h (Output_section::update_flags_for_input_section): New
17261 function.
17262 * output.cc (Output_section::add_input_section): Call
17263 update_flags_for_input_section.
17264 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17265
17266 2008-04-11 Cary Coutant <ccoutant@google.com>
17267
17268 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17269 thought unnecessary.
17270 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17271
17272 2008-04-11 Ian Lance Taylor <iant@google.com>
17273
17274 * output.h (class Output_section_data): Remove inline definition
17275 of set_addralign.
17276 * output.cc (Output_section_data::set_addralign): New function.
17277
17278 2008-04-11 Cary Coutant <ccoutant@google.com>
17279
17280 Add support for TLS descriptors for i386 and x86_64.
17281 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17282 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17283 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17284 GOT_TYPE_TLS_DESC.
17285 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17286 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17287 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17288 relocations.
17289 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17290 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17291 Fix problem with initial-exec relocations.
17292 (Target_i386::Relocate::relocate_tls): Likewise.
17293 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17294 relaxation.
17295 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17296 support for section-plus-offset dynamic table entries.
17297 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17298 (Output_data_dynamic::Dynamic_entry): Add support for
17299 section-plus-offset dynamic table entries.
17300 (Output_data_dynamic::Classification): Likewise.
17301 (Output_data_dynamic::classification_): Renamed offset_.
17302 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17303 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17304 (Target_x86_64::make_plt_section): New function.
17305 (Target_x86_64::reserve_tlsdesc_entries): New function.
17306 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17307 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17308 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17309 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17310 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17311 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17312 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17313 add extra PLT entry for TLS descriptors.
17314 (Output_data_plt_x86_64::got_): New field.
17315 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17316 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17317 fields.
17318 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17319 descriptors.
17320 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17321 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17322 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17323 R_386_TLS_DESC_CALL relocations.
17324 (Target_x86_64::Scan::global): Likewise.
17325 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17326 for TLS descriptors.
17327 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17328 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17329 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17330 GD-to-IE relaxation.
17331 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17332 and TLS_DESCRIPTORS.
17333 * Makefile.in: Rebuild.
17334 * configure: Rebuild.
17335 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17336 (tls_test_shared2.so): New target.
17337 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17338 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17339 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17340 (tls_shared_gd_to_ie_test_LDADD): New variable.
17341 (tls_shared_gnu2_gd_to_ie_test): New target.
17342 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17343 New targets.
17344 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17345 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17346 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17347 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17348 (tls_shared_gnu2_test): New target.
17349 (tls_test_gnu2_shared.so): New target.
17350 (tls_shared_gnu2_test_SOURCES): New variable.
17351 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17352 (tls_shared_gnu2_test_LDFLAGS): New variable.
17353 (tls_shared_gnu2_test_LDADD): New variable.
17354 * testsuite/Makefile.in: Rebuild.
17355 * testsuite/Makefile.
17356
17357 2008-04-11 Ian Lance Taylor <iant@google.com>
17358
17359 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17360 justsyms.t.
17361 * testsuite/Makefile.in: Rebuild.
17362
17363 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17364 long.
17365 * testsuite/script_test_2.cc (main): Adjust test.
17366
17367 2008-04-11 David S. Miller <davem@davemloft.net>
17368 Ian Lance Taylor <iant@google.com>
17369
17370 * options.h (General_options): Add entries for '-Y' and
17371 '-relax'.
17372 * options.cc (General_options:finalize): If -Y was used, add those
17373 entries to the library path instead of the default "/lib" and
17374 "/usr/lib".
17375
17376 2008-04-11 David S. Miller <davem@davemloft.net>
17377
17378 * testsuite/justsyms.t: Start at 0x100.
17379 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17380 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17381 long.
17382 * testsuite/script_test_2.cc: Adjust string and section length
17383 checks.
17384
17385 2008-04-09 Ian Lance Taylor <iant@google.com>
17386
17387 PR gold/5996
17388 * script-sections.cc (Sections_element::allocate_to_segment): Add
17389 orphan parameter.
17390 (Output_section_definition::allocate_to_segment): Likewise.
17391 (Orphan_output_section::allocate_to_segment): Likewise.
17392 (Script_sections::attach_sections_using_phdrs_clause): Don't
17393 propagate non-PT_LOAD segments to orphan sections.
17394 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17395 readelf rather than objdump.
17396 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17397 .interp section and PT_INTERP segment are the same size.
17398 * testsuite/Makefile.in: Rebuild.
17399
17400 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17401 aliases for symbols defined in the same object.
17402 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17403 (weak_alias_test_SOURCES): New variable.
17404 (weak_alias_test_DEPENDENCIES): New variable.
17405 (weak_alias_test_LDFLAGS): New variable.
17406 (weak_alias_test_LDADD): New variable.
17407 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17408 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17409 (weak_alias_test_3.o): New target.
17410 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17411 * testsuite/weak_alias_test_main.cc: New file.
17412 * testsuite/weak_alias_test_1.cc: New file.
17413 * testsuite/weak_alias_test_2.cc: New file.
17414 * testsuite/weak_alias_test_3.cc: New file.
17415
17416 2008-04-08 Ian Lance Taylor <iant@google.com>
17417
17418 * options.h (class General_options): Add --noinhibit-exec option.
17419 * main.cc (main): Check --noinhibit-exec.
17420
17421 * options.h (class General_options): Define --wrap as a special
17422 option. Add wrap_symbols_ field.
17423 (General_options::any_wrap_symbols): New function.
17424 (General_options::is_wrap_symbol): New function.
17425 * options.cc (General_options::parse_wrap): New function.
17426 (General_options::General_options): Initialize wrap_symbols_.
17427 * symtab.cc (Symbol_table::wrap_symbol): New function.
17428 (Symbol_table::add_from_object): Handle --wrap.
17429 * symtab.h (class Symbol_table): Declare wrap_symbol.
17430 * target.h (Target::wrap_char): New function.
17431 (Target::Target_info): Add wrap_char field.
17432 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17433 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17434 * testsuite/testfile.cc (Target_test::test_target_info):
17435 Likewise.
17436
17437 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17438 there is one.
17439
17440 * layout.h (class Layout): Add added_eh_frame_data_ field.
17441 * layout.cc (Layout::Layout): Initialize new field.
17442 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17443 output section until we find a section we merged successfully.
17444 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17445 that the size be non-zero.
17446
17447 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17448 qualifier.
17449
17450 2008-04-08 Craig Silverstein <csilvers@google.com>
17451
17452 * configure.ac: Export new conditional variable HAVE_ZLIB.
17453 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17454 on HAVE_ZLIB.
17455 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17456 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17457
17458 2008-04-07 Ian Lance Taylor <iant@google.com>
17459
17460 * version.cc (version_string): Set to "1.5".
17461
17462 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17463 Add issued_non_pic_error_ field. Declare check_non_pic.
17464 (Target_x86_64::Scan::check_non_pic): New function.
17465 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17466 (Target_x86_64::Scan::global): Likewise.
17467
17468 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17469 addend parameter. Change caller. Handle merge sections.
17470 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17471 Address to Addend. Don't add in the result of
17472 local_section_offset, pass down the addend and use the returned
17473 value.
17474 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17475 Update declarations of local_section_offset and symbol_value.
17476 * testsuite/two_file_test_1.cc (t18): New function.
17477 * testsuite/two_file_test_2.cc (f18): New function.
17478 * testsuite/two_file_test_main.cc (main): Call t18.
17479 * testsuite/two_file_test.h (t18, f18): Declare.
17480
17481 * configure.ac: Don't test for objdump, c++filt, or readelf.
17482 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17483 conditionals.
17484 (TEST_READELF): New variable.
17485 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17486 (check_PROGRAMS): Add two_file_strip_test.
17487 (two_file_strip_test): New target.
17488 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17489 (two_file_same_shared_strip_test_SOURCES): New variable.
17490 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17491 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17492 (two_file_same_shared_strip_test_LDADD): New variable.
17493 (two_file_shared_strip.so): New target.
17494 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17495 (ver_test_5.syms, ver_test_7.syms): Likewise.
17496 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17497 (strip_test_3.stdout): Use TEST_OBJDUMP.
17498 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17499
17500 2008-04-04 Cary Coutant <ccoutant@google.com>
17501
17502 * symtab.h (Symbol::is_weak_undefined): New function.
17503 (Symbol::is_strong_undefined): New function.
17504 (Symbol::is_absolute): New function.
17505 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17506 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17507 absolute symbols.
17508 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17509 (weak_undef_test): New target.
17510 * testsuite/Makefile.in: Rebuild.
17511 * testsuite/weak_undef_file1.cc: New file.
17512 * testsuite/weak_undef_file2.cc: New file.
17513 * testsuite/weak_undef_test.cc: New file.
17514
17515 2008-04-03 Craig Silverstein <csilvers@google.com>
17516
17517 * compressed_output.h (class Output_compressed_section): Use
17518 unsigned buffer.
17519 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17520 add zlib header.
17521 (zlib_compressed_suffix): Removed.
17522 (Output_compressed_section::set_final_data_size): Use unsigned
17523 buffers.
17524 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17525 Fix linker invocation.
17526 (flagstest_o_specialfile_and_compress_debug_sections):
17527 Likewise.
17528 * testsuite/Makefile.in: Regenerated.
17529
17530 2008-04-02 David S. Miller <davem@davemloft.net>
17531
17532 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17533 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17534
17535 2008-04-02 Craig Silverstein <csilvers@google.com>
17536
17537 * TODO: New file.
17538
17539 2008-04-02 Ian Lance Taylor <iant@google.com>
17540
17541 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17542 parameters. Update for new key type to views_. Change all
17543 callers.
17544 (File_read::read): Adjust for byteshift in returned view.
17545 (File_read::add_view): New function, broken out of
17546 find_and_make_view.
17547 (File_read::make_view): New function, broken out of
17548 find_and_make_view.
17549 (File_read::find_or_make_view): Add offset and aligned
17550 parameters. Rewrite accordingly. Change all callers.
17551 (File_read::get_view): Add offset and aligned parameters. Adjust
17552 for byteshift in return value.
17553 (File_read::get_lasting_view): Likewise.
17554 * fileread.h (class File_read): Update declarations.
17555 (class File_read::View): Add byteshift_ field. Add byteshift to
17556 constructor. Add byteshift method.
17557 * archive.h (Archive::clear_uncached_views): New function.
17558 (Archive::get_view): Add aligned parameter. Change all callers.
17559 * object.h (Object::get_view): Add aligned parameter. Change all
17560 callers.
17561 (Object::get_lasting_view): Likewise.
17562
17563 * fileread.cc (File_read::release): Don't call clear_views if
17564 there are multiple objects.
17565 * fileread.h (File_read::clear_uncached_views): New function.
17566 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17567 on the archive.
17568
17569 2008-03-31 Cary Coutant <ccoutant@google.com>
17570
17571 Add thin archive support.
17572 * archive.cc (Archive::armagt): New const.
17573 (Archive::setup): Remove task parameter and calls to unlock.
17574 (Archive::unlock_nested_archives): New function.
17575 (Archive::read_header): Add nested_off parameter. Change
17576 all callers.
17577 (Archive::interpret_header): Likewise.
17578 (Archive::include_all_members): Change to handle thin
17579 archives.
17580 (Archive::include_member): Likewise.
17581 * archive.h (Archive::Archive): Add new parameters and
17582 initializers.
17583 (Archive::armagt): New const.
17584 (Archive::setup): Remove task parameter.
17585 (Archive::unlock_nested_archives): New function.
17586 (Archive::read_header): Add nested_off parameter.
17587 (Archive::interpret_header): Likewise.
17588 (Archive::Nested_archive_table): New typedef.
17589 (Archive::is_thin_archive_): New field.
17590 (Archive::nested_archives_): New field.
17591 (Archive::options_): New field.
17592 (Archive::dirpath_): New field.
17593 (Archive::task_): New field.
17594 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17595 for thin archives. Pass additional parameters to
17596 Archive::Archive. Unlock the archive file after calling
17597 Archive::setup.
17598
17599 2008-03-29 Ian Lance Taylor <iant@google.com>
17600
17601 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17602 version symbol to be local.
17603 * testsuite/ver_test_4.sh: New file.
17604 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17605 (check_DATA): Add ver_test_4.syms.
17606 (ver_test_4.syms): New target.
17607 * testsuite/Makefile.in: Rebuild.
17608
17609 * output.cc
17610 (Output_section::Input_section_sort_entry::has_priority): New
17611 function.
17612 (Output_section::Input_section_sort_entry::match_file_name): New
17613 function.
17614 (Output_section::Input_section_sort_entry::match_section_name):
17615 Remove.
17616 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17617 Remove.
17618 (Output_section::Input_section_sort_entry::match_section_file):
17619 Remove.
17620 (Output_section::Input_section_sort_compare::operator()): Rewrite
17621 using new Input_section_sort_entry functions. Sort crtbegin and
17622 crtend first. Sort sections with no priority before sections with
17623 a priority.
17624 * testsuite/initpri1.c (d3): Check j != 4.
17625 (cd5): New constructor/destructor function.
17626 (main): Check j != 2.
17627
17628 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17629 new symbol when resolving, don't call set_is_default.
17630 * testsuite/ver_test_7.cc: New file.
17631 * testsuite/ver_test_7.sh: New file.
17632 * testsuite/Makefile.am (ver_test_7.so): New target.
17633 (ver_test_7.o): New target.
17634 (check_SCRIPTS): Add ver_test_7.sh.
17635 (check_DATA): Add ver_test_7.syms.
17636 (ver_test_7.syms): New target.
17637
17638 2008-03-28 Ian Lance Taylor <iant@google.com>
17639
17640 * layout.cc (Layout::layout): If we see an input section with a
17641 name that needs sorting, set the must_sort flag for the output
17642 section.
17643 (Layout::make_output_section): If the name of the output section
17644 indicates that it might require sorting, set the may_sort flag.
17645 * output.h (Output_section::may_sort_attached_input_sections): New
17646 function.
17647 (Output_section::set_may_sort_attached_input_sections): New
17648 function.
17649 (Output_section::must_sort_attached_input_sections): New
17650 function.
17651 (Output_section::set_must_sort_attached_input_sections): New
17652 function.
17653 (class Output_section): Declare Input_section_sort_entry. Define
17654 Input_section_sort_compare. Declare
17655 sort_attached_input_sections. Add new fields:
17656 may_sort_attached_input_sections_,
17657 must_sort_attached_input_sections_,
17658 attached_input_sections_are_sorted_.
17659 * output.cc (Output_section::Output_section): Initialize new
17660 fields.
17661 (Output_section::add_input_section): Add an entry to
17662 input_sections_ if may_sort or must_sort are true.
17663 (Output_section::set_final_data_size): Call
17664 sort_attached_input_sections if necessary.
17665 (Output_section::Input_section_sort_entry): Define new class.
17666 (Output_section::Input_section_sort_compare::operator()): New
17667 function.
17668 (Output_section::sort_attached_input_sections): New function.
17669 * configure.ac: Check whether the compiler supports constructor
17670 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17671 * testsuite/initpri1.c: New file.
17672 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17673 CONSTRUCTOR_PRIORITY.
17674 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17675 (initpri1_LDFLAGS): New variable.
17676 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17677
17678 2008-03-27 Ian Lance Taylor <iant@google.com>
17679
17680 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17681 * testsuite/common_test_1.c: New file.
17682 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17683 (common_test_1_SOURCES): New variable.
17684 (common_test_1_DEPENDENCIES): New variable.
17685 (common_test_1_LDFLAGS): New variable.
17686
17687 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17688 and commons_ correctly when NAME/VERSION does not override
17689 NAME/NULL.
17690 * testsuite/ver_test_6.c: New file.
17691 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17692 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17693 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17694
17695 2008-03-26 Ian Lance Taylor <iant@google.com>
17696
17697 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17698 of an undefined symbol from a version script.
17699 * testsuite/Makefile.am (ver_test_5.so): New target.
17700 (ver_test_5.o): New target.
17701 (check_SCRIPTS): Add ver_test_5.sh.
17702 (check_DATA): Add ver_test_5.syms.
17703 (ver_test_5.syms): New target.
17704 * testsuite/ver_test_5.cc: New file.
17705 * testsuite/ver_test_5.script: New file.
17706 * testsuite/ver_test_5.sh: New file.
17707 * Makefile.in, testsuite/Makefile.in: Rebuild.
17708
17709 PR gold/5986
17710 Fix problems building gold with gcc 4.3.0.
17711 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17712 (gold_error_at_location, gold_warning_at_location): Use it.
17713 * configure.ac: Check whether we can compile and use a template
17714 function with a printf attribute.
17715 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17716 when jumping over bytes.
17717 * object.cc: Instantiate Object::read_section_data.
17718 * debug.h: Include <cstring>
17719 * dwarf_reader.cc: Include <algorithm>
17720 * main.cc: Include <cstring>.
17721 * options.cc: Include <cstring>.
17722 * output.cc: Include <cstring>.
17723 * script.cc: Include <cstring>.
17724 * script.h: Include <string>.
17725 * symtab.cc: Include <cstring> and <algorithm>.
17726 * target-select.cc: Include <cstring>.
17727 * version.cc: Include <string>.
17728 * testsuite/testmain.cc: Include <cstdlib>.
17729 * configure, config.in: Rebuild.
17730
17731 2008-03-25 Ian Lance Taylor <iant@google.com>
17732
17733 * options.cc: Include "../bfd/bfdver.h".
17734 (options::help): Print bug reporting address.
17735
17736 * version.cc (print_version): Adjust output for current value of
17737 BFD_VERSION_STRING.
17738
17739 * NEWS: New file.
17740
17741 * options.cc (options::help): Print list of supported targets.
17742 * target-select.h: Include <vector>.
17743 (class Target_selector): Make machine_, size_, and is_big_endian_
17744 fields const. Add bfd_name_ and instantiated_target_ fields.
17745 (Target_selector::Target_selector): Add bfd_name parameter.
17746 (Target_selector::recognize): Make non-virtual, call
17747 do_recognize.
17748 (Target_selector::recognize_by_name): Make non-virtual, call
17749 do_recognize_by_name.
17750 (Target_selector::supported_names): New function.
17751 (Target_selector::bfd_name): New function.
17752 (Target_selector::do_instantiate_target): New pure virtual
17753 function.
17754 (Target_selector::do_recognize): New virtual function.
17755 (Target_selector::do_recognize_by_name): New virtual function.
17756 (Target_selector::instantiate_target): New private function.
17757 (supported_target_names): Declare.
17758 * target-select.cc (Target_selector::Target_selector): Update for
17759 new parameter and fields.
17760 (select_target_by_name): Check that the name matches before
17761 calling recognize_by_name.
17762 (supported_target_names): New function.
17763 * i386.cc (class Target_selector_i386): Update Target_selector
17764 constructor call. Remove recognize and recognize_by_name. Add
17765 do_instantiate_target.
17766 * x86_64.cc (class Target_selector_x86_64): Likewise.
17767 * testsuite/testfile.cc (class Target_selector_test): Update for
17768 changes to Target_selector.
17769
17770 * README: Rewrite, with some notes on unsupported features.
17771
17772 2008-03-24 Cary Coutant <ccoutant@google.com>
17773
17774 * i386.cc (Target_i386::Got_type): New enum declaration.
17775 (Target_i386::Scan::local): Updated callers of Output_data_got
17776 member functions.
17777 (Target_i386::Scan::global): Likewise.
17778 (Target_i386::Relocate::relocate): Likewise.
17779 (Target_i386::Relocate::relocate_tls): Likewise.
17780 * object.h (Got_offset_list): New class.
17781 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17782 (Sized_relobj::local_got_offset): Likewise.
17783 (Sized_relobj::set_local_got_offset): Likewise.
17784 (Sized_relobj::local_has_tls_got_offset): Removed.
17785 (Sized_relobj::local_tls_got_offset): Removed.
17786 (Sized_relobj::set_local_tls_got_offset): Removed.
17787 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17788 * output.cc (Output_data_got::add_global): Added got_type parameter.
17789 (Output_data_got::add_global_with_rel): Likewise.
17790 (Output_data_got::add_global_with_rela): Likewise.
17791 (Output_data_got::add_global_pair_with_rel): New function.
17792 (Output_data_got::add_global_pair_with_rela): New function.
17793 (Output_data_got::add_local): Added got_type parameter.
17794 (Output_data_got::add_local_with_rel): Likewise.
17795 (Output_data_got::add_local_with_rela): Likewise.
17796 (Output_data_got::add_local_pair_with_rel): New function.
17797 (Output_data_got::add_local_pair_with_rela): New function.
17798 (Output_data_got::add_global_tls): Removed.
17799 (Output_data_got::add_global_tls_with_rel): Removed.
17800 (Output_data_got::add_global_tls_with_rela): Removed.
17801 (Output_data_got::add_local_tls): Removed.
17802 (Output_data_got::add_local_tls_with_rel): Removed.
17803 (Output_data_got::add_local_tls_with_rela): Removed.
17804 * output.h (Output_data_got::add_global): Added got_type parameter.
17805 (Output_data_got::add_global_with_rel): Likewise.
17806 (Output_data_got::add_global_with_rela): Likewise.
17807 (Output_data_got::add_global_pair_with_rel): New function.
17808 (Output_data_got::add_global_pair_with_rela): New function.
17809 (Output_data_got::add_local): Added got_type parameter.
17810 (Output_data_got::add_local_with_rel): Likewise.
17811 (Output_data_got::add_local_with_rela): Likewise.
17812 (Output_data_got::add_local_pair_with_rel): New function.
17813 (Output_data_got::add_local_pair_with_rela): New function.
17814 (Output_data_got::add_global_tls): Removed.
17815 (Output_data_got::add_global_tls_with_rel): Removed.
17816 (Output_data_got::add_global_tls_with_rela): Removed.
17817 (Output_data_got::add_local_tls): Removed.
17818 (Output_data_got::add_local_tls_with_rel): Removed.
17819 (Output_data_got::add_local_tls_with_rela): Removed.
17820 * resolve.cc (Symbol::override_base_with_special): Removed
17821 reference to has_got_offset_ field.
17822 * symtab.cc (Symbol::init_fields): Replaced initialization
17823 of got_offset_ with got_offsets_. Removed initialization
17824 of has_got_offset_
17825 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17826 (Symbol::got_offset): Likewise.
17827 (Symbol::set_got_offset): Likewise.
17828 (Symbol::has_tls_got_offset): Removed.
17829 (Symbol::tls_got_offset): Removed.
17830 (Symbol::set_tls_got_offset): Removed.
17831 (Symbol::got_offset_): Removed.
17832 (Symbol::tls_mod_got_offset_): Removed.
17833 (Symbol::tls_pair_got_offset_): Removed.
17834 (Symbol::got_offsets_): New field.
17835 (Symbol::has_got_offset): Removed.
17836 (Symbol::has_tls_mod_got_offset): Removed.
17837 (Symbol::has_tls_pair_got_offset): Removed.
17838 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17839 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17840 member functions.
17841 (Target_x86_64::Scan::global): Likewise.
17842 (Target_x86_64::Relocate::relocate): Likewise.
17843 (Target_x86_64::Relocate::relocate_tls): Likewise.
17844
17845 2008-03-25 Ben Elliston <bje@au.ibm.com>
17846
17847 * yyscript.y: Fix spelling error in comment.
17848
17849 2008-03-24 Ian Lance Taylor <iant@google.com>
17850
17851 * options.h (class General_options): Define build_id option.
17852 * layout.h (class Layout): Declare write_build_id, create_note,
17853 create_build_id. Add build_id_note_ member.
17854 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17855 "libiberty.h", "md5.h", "sha1.h".
17856 (Layout::Layout): Initialize eh_frame_data_,
17857 eh_frame_hdr_section_, and build_id_note_.
17858 (Layout::finalize): Call create_build_id.
17859 (Layout::create_note): New function, broken out of
17860 Layout::create_gold_note.
17861 (Layout::create_gold_note): Call create_note.
17862 (Layout::create_build_id): New function.
17863 (Layout::write_build_id): New function.
17864 (Close_task_runner::run): Call write_build_id.
17865
17866 * x86_64.cc: Correct license to GPLv3.
17867
17868 2008-03-23 Ian Lance Taylor <iant@google.com>
17869
17870 * options.cc: Include "demangle.h".
17871 (parse_optional_string): New function.
17872 (parse_long_option): Handle takes_optional_argument.
17873 (parse_short_option): Update dash_z initializer. Handle
17874 takes_optional_argument.
17875 (General_options::General_options): Initialize do_demangle_.
17876 (General_options::finalize): Set do_demangle_. Handle demangling
17877 style.
17878 * options.h (parse_optional_string): Declare.
17879 (struct One_option): Add optional_arg field. Update constructor.
17880 Update call constructor calls. Add takes_optional_argument
17881 function.
17882 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17883 (DEFINE_optional_string): Define.
17884 (General_options::demangle): Change from DEFINE_bool to
17885 DEFINE_optional_string.
17886 (General_options::no_demangle): New function.
17887 (General_options::do_demangle): New function.
17888 (General_options::set_do_demangle): New function.
17889 (General_options::execstack_status_): Move definition to end of
17890 class definition.
17891 (General_options::static_): Likewise.
17892 (General_options::do_demangle_): New field.
17893 * object.cc (big_endian>::get_symbol_location_info): Call
17894 Options::do_demangle, not Options::demangle.
17895 * symtab.cc (demangle): Likewise.
17896
17897 2008-03-22 Ian Lance Taylor <iant@google.com>
17898
17899 * gold.h: Include <cstddef> and <sys/types.h>
17900 * options.h: Include <cstring>.
17901
17902 2008-03-21 Ian Lance Taylor <iant@google.com>
17903
17904 * Added source code to GNU binutils.
17905 \f
17906 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17907
17908 Copying and distribution of this file, with or without modification,
17909 are permitted in any medium without royalty provided the copyright
17910 notice and this notice are preserved.
17911
17912 Local Variables:
17913 mode: change-log
17914 left-margin: 8
17915 fill-column: 74
17916 version-control: never
17917 End:
This page took 0.420334 seconds and 5 git commands to generate.