Add assembler, disassembler and linker support for power9.
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-11-11 Alan Modra <amodra@gmail.com>
2 Peter Bergner <bergner@vnet.ibm.com>
3
4 * gold/powerpc.cc (Powerpc_relocate_functions::addr16_dq): New function.
5 (Powerpc_relocate_functions::addr16dx_ha): Likewise.
6 (Target_powerpc::Scan::local): Handle R_POWERPC_REL16DX_HA.
7 (Target_powerpc::Scan::global): Likewise.
8 (Target_powerpc::Relocate::relocate): Likewise.
9
10 2015-11-09 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
11
12 * layout.h (Layout::is_debug_info_section): Recognize .pdr debug
13 sections.
14
15 2015-11-09 Cary Coutant <ccoutant@gmail.com>
16 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
17
18 * copy-relocs.h (Copy_relocs::copy_reloc): Replace reloc parameter
19 with type, offset, addend.
20 (Copy_relocs::save): Likewise.
21 * copy-relocs.cc (Copy_relocs::copy_reloc): Likewise.
22 (Copy_relocs::save): Likewise.
23 * aarch64.cc (Target_aarch64::copy_reloc): Pass r_type, r_offset,
24 and r_addend to Copy_relocs::copy_reloc.
25 * arm.cc (Target_arm::copy_reloc): Likewise.
26 * i386.cc (Target_i386::copy_reloc): Likewise.
27 * mips.cc (Target_mips::copy_reloc): Likewise.
28 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
29 * s390.cc (Target_s390::copy_reloc): Likewise.
30 * sparc.cc (Target_sparc::copy_reloc): Likewise.
31 * tilegx.cc (Target_tilegx::copy_reloc): Likewise.
32 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
33
34 2015-11-05 Cary Coutant <ccoutant@gmail.com>
35
36 PR gold/19119
37 PR gold/19172
38 PR gold/19197
39 Revert commit 6457197210144f50a696097c0d308d81d46d5510:
40 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
41 * options.h (General_options): Remove "obsolete" from -m.
42 * parameters.cc (set_parameters_target): Check if input target
43 is compatible with output emulation set by "-m emulation".
44
45 2015-11-05 Cary Coutant <ccoutant@gmail.com>
46
47 PR gold/19163
48 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
49 certain relocations if --no-apply-dynamic-relocs is set.
50 * options.h (--apply-dynamic-relocs): New aarch64-specific option.
51
52 2015-11-03 Alan Modra <amodra@gmail.com>
53
54 * po/POTFILES.in: Regenerate.
55
56 2015-10-30 Nick Clifton <nickc@redhat.com>
57
58 * po/zh_CN.po: New (simplified) Chinese translation.
59
60 2015-10-29 H.J. Lu <hongjiu.lu@intel.com>
61
62 PR gold/19184
63 * incremental.cc (Got_plt_view_info): Add got_entry_size.
64 (Local_got_offset_visitor::visit): Replace got_entry_size_
65 with info_.got_entry_size.
66 (Local_got_offset_visitor::got_entry_size_): Removed.
67 (Global_got_offset_visitor::visit): Replace got_entry_size_
68 with info_.got_entry_size.
69 (Global_got_offset_visitor::got_entry_size_): Removed.
70 (Output_section_incremental_inputs::write_got_plt): Initialize
71 view_info.got_entry_size.
72 * target.h (Sized_target::got_entry_size): New virtual function.
73 * x86_64.cc (Target_x86_64::got_entry_size): New function.
74
75 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
76
77 * testsuite/binary_test.cc: Add __attribute__((aligned(1))).
78 * testsuite/script_test_12a.c: Likewise.
79 * testsuite/script_test_1a.cc: Likewise.
80 * testsuite/script_test_2.cc: Likewise.
81
82 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
83
84 * testsuite/debug_msg.sh: Accept more fuzz in line numbers.
85
86 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
87
88 PR gold/18959
89 * stringpool.cc (Stringpool_template::new_key_offset): Align all
90 strings, even zero-length.
91 (Stringpool_template::set_string_offsets): Likewise.
92
93 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
94
95 * s390.cc: New file.
96 * Makefile.am (TARGETSOURCES): Add s390.cc.
97 (ALL_TARGETOBJS): Add s390.o.
98 * Makefile.in: Regenerate.
99 * configure.ac: Add s390 support.
100 * configure: Regenerate.
101 * configure.tgt: Add s390-*-* and s390x-*-*.
102 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Add s390
103 support.
104
105 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
106
107 * archive.cc (Archive::sym64name): New const.
108 (Archive::setup): Add support for SYM64 armap.
109 (Archive::read_armap): Likewise.
110 (Archive::interpret_header): Likewise.
111 (Archive::const_iterator::read_next_header): Likewise.
112 * archive.h (Archive::sym64name): New const.
113 (Archive::read_armap): Add mapsize template parameter.
114
115 2015-10-28 Marcin Kościelnicki <koriakin@0x04.net>
116
117 * dynobj.cc (Dynobj::create_elf_hash_table): Create hash table with
118 target-specific entry size.
119 (Dynobj::sized_create_elf_hash_table): Add size template parameter.
120 * dynobj.h (Dynobj::sized_create_elf_hash_table): Likewise.
121 * layout.cc (Layout::create_dynamic_symtab): Set entsize to
122 hash_entry_size.
123 * target.h (Target::hash_entry_size): New method.
124 (Target::Target_info::hash_entry_size): New data member.
125
126 * aarch64.cc (Target_aarch64::aarch64_info): Add hash_entry_size.
127 * arm.cc (Target_arm::arm_info): Likewise.
128 (Target_arm_nacl::arm_nacl_info): Likewise.
129 * i386.cc (Target_i386::i386_info): Likewise.
130 (Target_i386_nacl::i386_nacl_info): Likewise.
131 (Target_iamcu::iamcu_info): Likewise.
132 * mips.cc (Target_mips::mips_info): Likewise.
133 (Target_mips_nacl::mips_nacl_info): Likewise.
134 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
135 * sparc.cc (Target_sparc::sparc_info): Likewise.
136 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
137 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
138 (Target_x86_64_nacl::x86_64_nacl_info): Likewise.
139 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
140
141 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
142
143 PR gold/19177
144 * i386.cc (Target_i386::Relocate::relocate): Check R_386_GOT32
145 and R_386_GOT32X relocations without base register.
146
147 2015-10.27 Han Shen <shenhan@google.com>
148
149 PR gold/19042 - unsupported reloc 311/312.
150
151 * aarch64.cc (Target_aarch64::Scan::local): Add support for
152 reloc 311/312.
153
154 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
155
156 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
157 Treat R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX the same
158 as R_X86_64_GOTPCREL.
159 (Target_x86_64<size>::Scan::local): Likewise.
160 (Target_x86_64<size>::Scan::possible_function_pointer_reloc):
161 Likewise.
162 (Target_x86_64<size>::Scan::global): Likewise.
163 (Target_x86_64<size>::Relocate::relocate): Likewise.
164 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
165 Likewise.
166
167 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
168
169 * i386.cc (Target_i386::Scan::get_reference_flags(): Treat
170 R_386_GOT32X the same as R_386_GOT32.
171 (Target_i386::Scan::local): Likewise.
172 (Target_i386::Scan::possible_function_pointer_reloc): Likewise.
173 (Target_i386::Scan::global): Likewise.
174 (Target_i386::Relocate::relocate): Likewise.
175 (Target_i386::Relocatable_size_for_reloc::get_size_for_reloc):
176 Likewise.
177
178 2015-10-20 H.J. Lu <hongjiu.lu@intel.com>
179
180 * testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
181 x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
182 (x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
183 x86_64_mov_to_lea1.o.
184 * testsuite/Makefile.in: Regenerated.
185
186 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
187
188 PR gold/19119
189 * options.h (General_options): Remove "obsolete" from -m.
190 * parameters.cc (set_parameters_target): Check if input target
191 is compatible with output emulation set by "-m emulation".
192
193 2015-10-13 H.J. Lu <hongjiu.lu@intel.com>
194
195 PR gold/19118
196 * i386.cc (Target_iamcu): New class.
197 (Target_selector_iamcu): Likewise.
198 (Target_iamcu::iamcu_info): New variable.
199 (target_selector_iamcu): Likewise.
200
201 2015-10-07 Andreas Schwab <schwab@suse.de>
202
203 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
204
205 2015-10-06 Cary Coutant <ccoutant@gmail.com>
206
207 PR gold/18855
208 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
209 parameter.
210 (Sparc_relocate_functions::gdop_lox10): Likewise.
211 (Target_sparc::Relocate::relocate): Use addend when computing
212 symbol value for R_SPARC_GOTDATA_OP*.
213
214 2015-09-07 Cary Coutant <ccoutant@gmail.com>
215
216 PR gold/18930
217 PR gold/18886
218 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
219 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
220
221 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
222
223 PR gold/18886
224 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
225 shared libraries into normal FUNC symbols.
226 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
227 symbols aren't from shared libraries.
228
229 2015-09-02 Alan Modra <amodra@gmail.com>
230
231 PR 18878
232 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
233 (Target_powerpc::Branch_info::make_stub): Determine whether long
234 branch stub is for save/restore function.
235 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
236 (Stub_table): Add need_save_res_.
237 (Stub_table:clear_stubs): Clear need_save_res_.
238 (Stub_table:set_address_and_size): Add save/restore section size.
239 (Stub_table::add_long_branch_entry): Add save_res param. Set
240 need_save_res_, but don't add space for save/restore stubs.
241 (Stub_table::find_long_branch_entry): Return offset to local copy
242 of save/restore func.
243 (Stub_table::do_write): Don't output save/restore stubs. Instead
244 copy the save/restore functions.
245 (Output_data_save_res:contents): New accessor.
246 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
247
248 2015-08-25 Cary Coutant <ccoutant@gmail.com>
249
250 PR gold/18847
251 * script-sections.cc (Memory_region::set_address): New method.
252 (Script_sections::find_memory_region): Add explicit_only parameter.
253 (Output_section_definition::set_section_addresses): Handle case where
254 script specifies both address and vma region.
255 * script-sections.h (Script_sections::find_memory_region): Add
256 explicit_only parameter.
257
258 2015-08-25 Cary Coutant <ccoutant@gmail.com>
259
260 PR gold/18859
261 * object.cc (Input_objects::add_object): Store objects in a map,
262 indexed by soname; update as-needed flag when necessary.
263 * object.h (Object::clear_as_needed): New method.
264 (Input_objects::so_names_): Change from set to map.
265
266 2015-08-25 Cary Coutant <ccoutant@gmail.com>
267
268 PR gold/14746
269 * expression.cc (Expression::Expression_eval_info): Add
270 is_valid_pointer field.
271 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
272 Adjust all callers.
273 (Addr_expression::value_from_output_section): Check whether address
274 is valid.
275 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
276 if evaluation failed due to address that is not yet valid.
277 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
278 parameter.
279
280 2015-08-25 Cary Coutant <ccoutant@gmail.com>
281
282 PR gold/18866
283 PR gold/18703
284 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
285
286 2015-08-20 Alan Modra <amodra@gmail.com>
287
288 PR gold/18846
289 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
290 Subtract os->address() from addend.
291 * powerpc.cc (relocate_relocs): Likewise.
292
293 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
294
295 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
296 lazy_stub_normal_1, lazy_stub_normal_1_n64,
297 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
298 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
299 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
300 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
301 of 'addu/daddu'.
302
303 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
304
305 * configure: Regenerated.
306
307 2015-07-26 Doug Kwan <dougkwan@google.com>
308
309 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
310 disassembler output format.
311
312 2015-07-23 Ian Coolidge <icoolidge@google.com>
313 Plumb --pic-veneer option for gold.
314
315 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
316 generation.
317 * options.h (General_options): Add --pic-veneer option.
318
319 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
320
321 PR gold/18663
322 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
323 script_test_1a.cc script_test_1b.cc.
324 (script_test_11_r.o): Replace script_test_11.o with
325 script_test_11a.o script_test_11b.o.
326 (script_test_11.o): Removed.
327 (script_test_11a.o): New.
328 (script_test_11b.o): Likewise.
329 * testsuite/Makefile.in: Regenerated.
330 * testsuite/script_test_1.h: New file.
331 * testsuite/script_test_1b.cc: Likewise.
332 * testsuite/script_test_11.h: Likewise.
333 * testsuite/script_test_11b.c: Likewise.
334 * testsuite/script_test_1.cc: Renamed to ...
335 * testsuite/script_test_1a.cc: This.
336 Include "script_test_1.h".
337 (main): Call check_int and check_ptr.
338 * testsuite/script_test_11.c: Renamed to ...
339 * testsuite/script_test_11a.c: This.
340 Include "script_test_11.h".
341 (main): Call ptr_equal.
342
343 2015-07-22 H.J. Lu <hongjiu.lu@intel.com>
344
345 PR gold/18628
346 * testsuite/ifuncdep2.c (global): Change protected to hidden.
347 * testsuite/ifuncmod1.c (global): Likewise.
348 * testsuite/ifuncmod5.c (global): Likewise.
349
350 2015-07-22 Alan Modra <amodra@gmail.com>
351
352 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
353
354 2015-07-21 Cary Coutant <ccoutant@gmail.com>
355
356 PR gold/18548
357 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
358 forced local symbol even when oldsym != NULL.
359 (Symbol_table::do_define_in_output_segment): Likewise.
360 (Symbol_table::do_define_as_constant): Likewise.
361
362 2015-07-21 Cary Coutant <ccoutant@gmail.com>
363
364 PR gold/18698
365 * archive.cc (Library_base::should_include_member): Don't use entry
366 point for relocatable links, or if target is not yet valid.
367 * parameters.cc (Parameters::entry): Check target_valid().
368
369 2015-07-20 Han Shen <shenhan@google.com>
370
371 Optimize erratum 843419 fix.
372
373 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
374 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
375 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
376 (E843419_stub): New sub-class of Erratum_stub.
377 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
378 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
379 (AArch64_relobj::create_erratum_stub): Add 1 argument.
380 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
381
382 2015-07-20 Han Shen <shenhan@google.com>
383
384 Fix arm elf header flags wrt hardfp bit.
385
386 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
387
388 2015-07-20 H.J. Lu <hongjiu.lu@intel.com>
389
390 PR gold/18689
391 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
392 from input group section for relocatable link.
393 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
394 (check_DATA): Add pr18689.stdout.
395 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
396 (pr18689.stdout): New rule.
397 (pr18689a.o): Likewise.
398 (pr18689b.o): Likewise.
399 (pr18689.o): Likewise.
400 * testsuite/pr18689.c: New file.
401 * testsuite/pr18689.sh: Likewise.
402 * testsuite/Makefile.in: Regenerated.
403
404 2015-07-20 Yiran Wang <yiran@google.com>
405 Cary Coutant <ccoutant@gmail.com>
406
407 PR gold/15574
408 * resolve.cc (Symbol_table): Remove warning about references
409 from shared objects to hidden symbols.
410 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
411 * testsuite/Makefile.in: Regenerate.
412 * testsuite/hidden_test.sh: Check dynamic symbol table; update
413 expected error messages.
414
415 2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
416
417 * compressed_output.cc (Output_compressed_section::set_final_data_size):
418 Make --compress-debug-sections=zlib the same as
419 --compress-debug-sections=zlib-gabi.
420 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
421 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
422 ".zdebug_".
423 * testsuite/Makefile.in: Regenerated.
424
425 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
426
427 PR gold/18322
428 * compressed_output.cc (zlib_compress): Add argument for
429 compression header size. Set header size to compression header
430 size if it isn't 0. Don't write out the zlib header here.
431 (Output_compressed_section::set_final_data_size): Support
432 zlib-gnu and zlib-gabi compressions. Pass compression header
433 size to zlib_compress and write out compression header. Set
434 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
435 clear the SHF_COMPRESSED bit
436 * options.h (compress_debug_sections): Add zlib-gnu and
437 zlib-gabi.
438 * output.h (Output_section::set_flags): New.
439 * testsuite/Makefile.am (check_PROGRAMS): Add
440 flagstest_compress_debug_sections_none,
441 flagstest_compress_debug_sections_gnu and
442 flagstest_compress_debug_sections_gabi.
443 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
444 flagstest_compress_debug_sections.stdout,
445 flagstest_compress_debug_sections.cmp,
446 flagstest_compress_debug_sections.check,
447 flagstest_compress_debug_sections_gnu.stdout,
448 flagstest_compress_debug_sections_gnu.cmp,
449 flagstest_compress_debug_sections_gnu.check,
450 flagstest_compress_debug_sections_gabi.stdout,
451 flagstest_compress_debug_sections_gabi.cmp and
452 flagstest_compress_debug_sections_gabi.check.
453 (flagstest_compress_debug_sections_none): New.
454 (flagstest_compress_debug_sections_none.stdout): Likewise.
455 (flagstest_compress_debug_sections.stdout): Likewise.
456 (flagstest_compress_debug_sections.check): Likewise.
457 (flagstest_compress_debug_sections.cmp): Likewise.
458 (flagstest_compress_debug_sections_gnu): Likewise.
459 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
460 (flagstest_compress_debug_sections_gnu.check): Likewise.
461 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
462 (flagstest_compress_debug_sections_gabi): Likewise.
463 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
464 (flagstest_compress_debug_sections_gnu.check): Likewise.
465 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
466 * testsuite/Makefile.in: Regenerated.
467
468 2015-07-12 H.J. Lu <hongjiu.lu@intel.com>
469
470 PR gold/18321
471 * compressed_output.h (decompress_input_section): Add arguments
472 for ELF class, big endian and sh_flags.
473 * compressed_output.cc (decompress_input_section): Likewise.
474 Support the SHF_COMPRESSED section.
475 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
476 functions.
477 * plugin.h (Pluginobj): Likewise.
478 * layout.cc (Layout::get_output_section_flags): Also clear the
479 SHF_COMPRESSED bit.
480 * object.h (Compressed_section_info): Add flag to store sh_flags.
481 (Object): Add pure virtual elfsize and is_big_endian member
482 functions.
483 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
484 prefix here.
485 (build_compressed_section_map): Check SHF_COMPRESSED for
486 uncompressed size. Store sh_flags in Compressed_section_info.
487 Pass size, big_endian and sh_flags to decompress_input_section.
488 Skip the ".debug"/".zdebug" prefix when passing section name to
489 need_decompressed_section.
490 (Sized_relobj_file<size, big_endian>::do_find_special_section):
491 Don't check ".zdebug_*" sections.
492 (Object::decompressed_section_contents): Pass ELF class, big
493 endian and sh_flags to decompress_input_section.
494 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
495 Likewise.
496 * testsuite/Makefile.am (check_DATA): Add
497 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
498 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
499 gdb_index_test_2_gabi.stdout.
500 (debug_msg_cdebug_gabi.o): New.
501 (odr_violation1_cdebug_gabi.o): Likewise.
502 (odr_violation2_cdebug_gabi.o): Likewise.
503 (debug_msg_cdebug_gabi.err): Likewise.
504 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
505 (gdb_index_test_cdebug_gabi.o): Likewise.
506 (gdb_index_test_2_gabi): Likewise.
507 (gdb_index_test_2_gabi.stdout): Likewise.
508 * testsuite/gdb_index_test_2_gabi.sh: New file.
509 * testsuite/Makefile.in: Regenerated.
510
511 2015-07-09 Han Shen <shenhan@google.com>
512
513 Use "gold_info" instead of "gold_warning" for erratum fix.
514
515 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
516 'gold_info'.
517 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
518
519 2015-07-09 Han Shen <shenhan@google.com>
520
521 Drop missing symbol warning for arm/aarch64.
522
523 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
524 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
525 symbol warning.
526
527 2015-07-07 Han Shen <shenhan@google.com>
528
529 Make gold aarch64 accept long form of mapping symbols.
530
531 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
532 of mapping symbols.
533
534 2015-06-29 Doug Kwan <dougkwan@google.com>
535
536 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
537 at address expected by test.
538 * testsuite/arm_cortex_a8_b.s: Ditto.
539 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
540 * testsuite/arm_cortex_a8_bl.s: Ditto.
541 * testsuite/arm_cortex_a8_blx.s: Ditto.
542 * testsuite/arm_cortex_a8_local.s: Ditto.
543 * testsuite/arm_fix_v4bx.s: Ditto.
544 * testsuite/arm_unaligned_reloc.s: Ditto.
545 * testsuite/thumb_bl_out_of_range.s: Ditto.
546 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
547 * testsuite/thumb_blx_out_of_range.s: Ditto.
548
549 2015-06-29 Han Shen <shenhan@google.com>
550
551 Patch for erratum 843419 internal error.
552
553 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
554 (Erratum_stub::update_erratum_insn): New method.
555 (Stub_table::relocate_stubs): Modified to place relocated insn.
556 (AArch64_relobj::fix_errata): Modified gold_assert.
557
558 2015-06-12 Han Shen <shenhan@google.com>
559
560 Fix erratum 835769.
561
562 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
563 defintion outside class definition.
564 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
565 (AArch64_insn_utilities::aarch64_op31): New member.
566 (AArch64_insn_utilities::aarch64_ra): New member.
567 (AArch64_insn_utilities::aarch64_mac): New member.
568 (AArch64_insn_utilities::aarch64_mlxl): New member.
569 (ST_E_835769): New global enum member.
570 (Stub_table::relocate_stubs): Add 835769 handler.
571 (Stub_template_repertoire::Stub_template_repertoire): Install new
572 stub type.
573 (AArch64_relobj::scan_errata): This func is renamed from
574 scan_erratum_843419.
575 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
576 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
577 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
578 (Target_aarch64::scan_erratum_835769_span): New method.
579 (Target_aarch64::create_erratum_stub): New method.
580 (Target_aarch64::is_erratum_835769_sequence): New method.
581 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
582 code into create_erratum_stub.
583 * options.h (fix_cortex_a53_835769): New option.
584
585 2015-06-11 Cary Coutant <ccoutant@gmail.com>
586
587 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
588 outside class body.
589 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
590
591 2015-06-11 Cary Coutant <ccoutant@gmail.com>
592
593 PR gold/17731
594 * layout.cc (corresponding_uncompressed_section_name): New function.
595 (Layout::choose_output_section): Call it.
596 * layout.h (corresponding_uncompressed_section_name): New function.
597 * script-sections.cc (Input_section_info::set_section_name): Check
598 for compressed debug section (.zdebug style).
599
600 2015-06-11 Jing Yu <jingyu@google.com>
601
602 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
603 * testsuite/Makefile.in: Regenerate.
604
605 2015-06-11 Davide Italiano <dccitaliano@gmail.com>
606
607 * gold.h (is_cident): Correct typo.
608
609 2015-06-10 Han Shen <shenhan@google.com>
610 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
611
612 Now fixing for 843419 is fully functional.
613
614 The first part of the erratum fix CL is here -
615 https://sourceware.org/ml/binutils/2015-04/msg00229.html
616
617 * aarch64.cc(global enum): New constants representing stub types.
618 (Stub_template): New POD struct.
619 (Stub_template_repertoire): New class.
620 (Stub_base): New class.
621 (Erratum_stub): New class.
622 (Reloc_stub): Refactored to be a subclass of Stub_base.
623 (Reloc_stub::Stub_type): Removed.
624 (Reloc_stub::offset): Moved to Stub_base.
625 (Reloc_stub::set_offset): Moved to Stub_base.
626 (Reloc_stub::destination_address): Moved to Stub_base.
627 (Reloc_stub::set_destination_address): Moved to Stub_base.
628 (Reloc_stub::reset_destination_address): Moved to Stub_base.
629 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
630 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
631 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
632 (Reloc_stub::write): Moved to Stub_base.
633 (Reloc_stub::invalid_offset): Moved to Stub_base.
634 (Reloc_stub::invalid_address): Moved to Stub_base.
635 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
636 (Reloc_stub::stub_insns_): Moved to Stub_base.
637 (Reloc_stub::offset_): Moved to Stub_base.
638 (Reloc_stub::destination_address_): Moved to Stub_base.
639 (Stub_table::The_aarch64_relobj): New typedef.
640 (Stub_table::The_erratum_stub): New typedef.
641 (Stub_table::The_erratum_stub_less): New typedef.
642 (Stub_table::The_erratum_stub_set): New typedef.
643 (Stub_table::The_erratum_stub_set_iter): New typedef.
644 (Stub_table::empty): Added emptiness testing for erratum stubs.
645 (Stub_table::add_erratum_stub): New method to add an erratum stub.
646 (Stub_table::find_erratum_stub): New method.
647 (Stub_table::find_erratum_stubs_for_input_section): New method.
648 (Stub_table::erratum_stub_address): New method.
649 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
650 (Stub_table::do_addralign): Modified to handle erratum stubs.
651 (Stub_table::erratum_stubs_): New member.
652 (Stub_table::erratum_stub_size_): New member.
653 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
654 (Stub_table::do_write): Modified to handle erratum stubs.
655 (AArch64_relobj::The_erratum_stub): New typedef.
656 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
657 (AArch64_relobj::fix_errata): New method.
658 (Target_aarch64::The_reloc_stub_type): Removed.
659 (Target_aarch64::The_erratum_stub): New typede.
660 (AArch64_relocate_functions::construct_b): New method.
661
662 2015-06-08 Nick Clifton <nickc@redhat.com>
663
664 * po/fr.po: New French Translation.
665
666 2015-06-07 Cary Coutant <ccoutant@gmail.com>
667
668 PR gold/18288
669 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
670 callers. Don't use STT_COMMON to check for common symbols.
671 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
672 symbol that's not in a common section.
673 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
674 common symbols.
675
676 2015-06-04 Cary Coutant <ccoutant@gmail.com>
677
678 PR gold/18200
679 * Makefile.am (diststuff): Add target.
680 * Makefile.in: Regenerate.
681
682 2015-06-04 Cary Coutant <ccoutant@gmail.com>
683
684 PR gold/17498
685 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
686 temporary locals in merge sections.
687 * options.cc (General_options::parse_discard_all): New method.
688 (General_options::parse_discard_locals): New method.
689 (General_options::parse_discard_none): New method.
690 (General_options::General_options): Initialize discard_locals_.
691 * options.h (--discard-all): Convert to special option.
692 (--discard-locals): Likewise.
693 (--discard-none): New option.
694 (General_options::discard_all): New method.
695 (General_options::discard_locals): New method.
696 (General_options::discard_sec_merge): New method.
697 (General_options::Discard_locals): New enum.
698 (General_options::discard_locals_): New data member.
699
700 2015-06-03 Cary Coutant <cary@google.com>
701
702 * script-sections.cc (Script_sections::Script_sections): Initialize
703 segments_created_.
704 (Script_sections::create_note_and_tls_segments): Set flag when
705 segments are created.
706 (Script_sections::expected_segment_count): Count PT_INTERP.
707 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
708 segments are created.
709 * script-sections.h (Script_sections::segments_created_): New data
710 member.
711
712 2015-06-03 Cary Coutant <ccoutant@gmail.com>
713
714 PR gold/15370
715 * script-sections.cc
716 (Output_section_element_input::set_section_addresses): When there
717 are several patterns with no sort spec, put all sections in the same
718 bin.
719 * testsuite/Makefile.am (script_test_12): New testcase.
720 (script_test_12i): New testcase.
721 * testsuite/Makefile.in: Regenerate.
722 * testsuite/script_test_12.t: New test linker script.
723 * testsuite/script_test_12i.t: New test linker script.
724 * testsuite/script_test_12a.c: New test source file.
725 * testsuite/script_test_12b.c: New test source file.
726
727 2015-06-02 Cary Coutant <ccoutant@gmail.com>
728
729 * nacl.h (Sniff_file): Switch parameters to get_view to get an
730 aligned view.
731
732 2015-06-03 Cary Coutant <ccoutant@gmail.com>
733
734 PR gold/17819
735 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
736 separate task to schedule the build id computation.
737 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
738 add Output_file and offset.
739 (Hash_task::run): Get and release the input views.
740 (Hash_task::is_runnable): Always return NULL (always runnable).
741 (Layout::queue_build_id_tasks): Remove.
742 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
743 parameters; use them instead of class members.
744 (Build_id_task_runner::run): New function.
745 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
746 to write_build_id.
747 * layout.h (Layout::queue_build_id_tasks): Remove.
748 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
749 parameters.
750 (Layout::array_of_hashes_): Remove.
751 (Layout::size_of_array_of_hashes_): Remove.
752 (Layout::input_view_): Remove.
753 (Build_id_task_runner): New class.
754 (Close_task_runner::Close_task_runner): Add array_of_hashes and
755 size_of_hashes parameters.
756 (Close_task_runner::array_of_hashes_): New data member.
757 (Close_task_runner::size_of_hashes_): New data member.
758 * testsuite/Makefile.am
759 (flagstest_compress_debug_sections_and_build_id_tree): New test.
760 * testsuite/Makefile.in: Regenerate.
761
762 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
763
764 * merge.cc (get_input_merge_map): Update for data structure change.
765 (get_or_make_input_merge_map): Update for data structure change.
766 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
767 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
768
769 2015-05-16 Alan Modra <amodra@gmail.com>
770
771 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
772 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
773 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
774 (lis_0): Rename from lis_0_0.
775
776 2015-04-29 Cary Coutant <cary@google.com>
777 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
778
779 * gc.h (Garbage_collection::is_section_garbage): Change Object*
780 to Relobj*.
781 (Garbage_collection::add_reference): Likewise.
782 (Garbage_collection::gc_process_relocs): Likewise. Don't push
783 object/shndx pair onto *secvec for dynamic objects. Don't follow
784 relocations pointing to dynamic objects for GC.
785 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
786 (Icf::unfold_section): Likewise.
787 (Icf::is_section_folded): Likewise.
788 (Icf::get_folded_section): Likewise.
789 * icf.h: (Icf::get_folded_section): Likewise.
790 (Icf::unfold_section): Likewise.
791 (Icf::is_section_folded): Likewise.
792 (Icf::section_has_function_pointers): Likewise.
793 (Icf::set_section_has_function_pointers): Likewise.
794 * object.h (Section_id): Likewise.
795 (Const_section_id): Likewise.
796 * output.cc (Output_section::update_section_layout): Likewise.
797 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
798 Likewise.
799 * plugin.cc (update_section_order): Likewise.
800 (unique_segment_for_sections): Likewise.
801 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
802 (Target_powerpc::do_gc_add_reference): Likewise.
803 (Target_powerpc::gc_process_relocs): Likewise.
804 (Target_powerpc::do_gc_add_reference): Likewise.
805 * symtab.cc (Symbol_table::is_section_folded): Likewise.
806 (Symbol_table::gc_mark_symbol): Likewise.
807 * symtab.h: (Symbol_table::is_section_folded): Likewise.
808 * target.h: (Sized_target::gc_add_reference): Likewise.
809 (Sized_target::do_gc_add_reference): Likewise.
810
811 2015-04-29 Nick Clifton <nickc@redhat.com>
812
813 * po/fi.po: Updated Finnish translation.
814
815 2015-04-28 Alan Modra <amodra@gmail.com>
816
817 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
818 than unsigned int for find_global_entry result temp. Compare
819 against invalid_address.
820 (Target_powerpc::do_plt_address_for_global): Likewise.
821 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
822 on plt call stub existence for debug info. Do assert for plt
823 and global entry stub existence if an alloc section.
824
825 2015-04-28 Alan Modra <amodra@gmail.com>
826
827 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
828 on missing global entry stub due to bogus debug info.
829
830 2015-04-27 Han Shen <shenhan@google.com>
831
832 * options.h (--fix-cortex-a53-843419): Rename option.
833 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
834 option.
835 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
836
837 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
838
839 PR gold/18327
840 * output.cc (Output_section::is_input_address_mapped): Assume a missing
841 entry is mapped.
842 * testsuite/Makefile.am: Add the eh_test test.
843 * testsuite/Makefile.in: Regenerate.
844 * testsuite/eh_test_a.cc: New test.
845 * testsuite/eh_test_b.cc: New test.
846
847 2015-04-23 Sriraman Tallam <tmsriram@google.com>
848
849 * options.h (--weak-unresolved-symbols): New option.
850 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
851 binding to weak with new option.
852 * symtab.h (is_weak_undefined): Check for new option.
853 (is_strong_undefined): Check for new option.
854 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
855 * testsuite/Makefile.in: Regenerate.
856 * testsuite/weak_unresolved_symbols_test.cc: New file.
857
858 2015-04-20 Ian Coolidge <icoolidge@google.com>
859
860 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
861 GNU_UNIQUE.
862
863 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
864
865 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
866 push_back.
867 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
868 * object.cc (Sized_relobj_file::do_layout): Use push_back.
869 * powerpc.cc (process_gc_mark): Use push_back.
870 (Target_powerpc::do_gc_mark_symbol): Use push_back.
871 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
872
873 2015-04-16 Han Shen <shenhan@google.com>
874
875 * aarch64.cc (AArch64_insn_utilities): New utility class.
876 (AArch64_relobj::Mapping_symbol_position): New struct.
877 (AArch64_relobj::Mapping_symbol_info): New typedef.
878 (AArch64_relobj::do_count_local_symbols): New function overriding
879 parent's implementation.
880 (AArch64_relobj::mapping_symbol_info_): New member
881 (AArch64_relobj::scan_erratum_843419): New method.
882 (Target_aarch64::scan_erratum_843419_span): New method.
883 (Target_aarch64::is_erratum_843419_sequence): New method.
884 * options.h (fix_cortex_a53): New option.
885
886 2015-04-09 Cary Coutant <ccoutant@google.com>
887
888 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
889 in a PIE link.
890 * testsuite/Makefile.am (tls_pie_test.sh): New test.
891 * testsuite/Makefile.in: Regenerate.
892 * testsuite/tls_pie_test.sh: New.
893
894 2015-04-09 Cary Coutant <ccoutant@google.com>
895
896 * debug.h (DEBUG_LOCATION): New.
897 (DEBUG_ALL): Include DEBUG_LOCATION.
898 (debug_string_to_enum): Add DEBUG_LOCATION.
899 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
900 output to print correct context.
901 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
902 up to 4 more locations at the beginning of the function.
903 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
904 result before sorting list of line numbers.
905 * testsuite/debug_msg.sh: Allow range of line numbers for
906 canonical results on optimized code.
907
908 2015-04-07 HC Yen <hc.yen@mediatek.com>
909
910 Add AArch32 support for gold linker.
911 gold/
912 * arm.cc: Add V8 arch combine table.
913
914 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
915
916 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
917
918 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
919
920 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
921 to find by using the return value of insert.
922
923 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
924
925 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
926 constructor call.
927
928 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
929
930 PR gold/17641
931 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
932 (Target_x86_64::Scan::local): Don't create GOT entry, when we
933 can convert mov to lea.
934 (Target_x86_64::Scan::global): Ditto.
935 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
936 %reg to lea foo(%rip), %reg if possible.
937 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
938 * testsuite/x86_64_mov_to_lea1.s: New.
939 * testsuite/x86_64_mov_to_lea2.s: Ditto.
940 * testsuite/x86_64_mov_to_lea3.s: Ditto.
941 * testsuite/x86_64_mov_to_lea4.s: Ditto.
942 * testsuite/x86_64_mov_to_lea.sh: Ditto.
943
944 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
945
946 * configure: Regenerated.
947
948 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
949
950 PR gold/17640
951 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
952 (Target_i386::Scan::local): Don't create GOT entry, when we
953 can convert GOT to GOTOFF.
954 (Target_i386::Scan::global): Ditto.
955 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
956 lea foo@GOTOFF(%reg), %reg if possible.
957 * testsuite/Makefile.am (i386_mov_to_lea): New test.
958 * testsuite/i386_mov_to_lea1.s: New.
959 * testsuite/i386_mov_to_lea2.s: Ditto.
960 * testsuite/i386_mov_to_lea3.s: Ditto.
961 * testsuite/i386_mov_to_lea4.s: Ditto.
962 * testsuite/i386_mov_to_lea5.s: Ditto.
963 * testsuite/i386_mov_to_lea.sh: Ditto.
964
965 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
966
967 * Makefile.am (ZLIB): New.
968 (ZLIBINC): Likewise.
969 (AM_CFLAGS): Add $(ZLIBINC).
970 (AM_CXXFLAGS): Likewise.
971 (ldadd_varldadd_var): Add $(ZLIB).
972 (incremental_dump_LDADD): Likewise.
973 (dwp_LDADD): Likewise.
974 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
975 <zlib.h>.
976 (zlib_compress): Don't check HAVE_ZLIB_H.
977 (zlib_decompress): Likewise.
978 * options.h (compress_debug_sections): Likewise.
979 * configure.ac (AM_CONDITIONAL): Removed.
980 * testsuite/Makefile.am (ZLIB): New.
981 (LDADD): Add $(ZLIB).
982 Don't check HAVE_ZLIB.
983 * Makefile.in: Regenerated.
984 * config.in: Likewise.
985 * configure: Likewise.
986 * testsuite/Makefile.in: Likewise.
987
988 2015-03-30 Jing Yu <jingyu@google.com>
989
990 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
991 TLSLD_ADD_DTPREL_LO12_NC.
992 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
993 _TLS_MODULE_BASE_ point to the start of tls segment.
994 (Target_aarch64::optimize_tls_reloc): Add cases for
995 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
996 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
997 (Target_aarch64::Scan::local): Likewise.
998 (Target_aarch64::Scan::global): Likewise.
999 (Target_aarch64::Relocate::relocate): Likewise.
1000 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
1001 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
1002 relocations.
1003
1004 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1005
1006 * merge.cc (Object_merge_map::add_mapping): call
1007 Object_merge_map::Input_merge_map::add_mapping.
1008 (Object_merge_map::Input_merge_map::add_mapping): New.
1009 (Output_merge_data::do_add_input_section): Call
1010 get_or_make_input_merge_map before a loop.
1011 (Output_merge_string<Char_type>::finalize_merged_data): Call
1012 get_or_make_input_merge_map before a loop.
1013 * merge.h (Object_merge_map): Make Input_merge_map public.
1014 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
1015 (Relobj::get_or_create_merge_map): New.
1016 * object.h (Relobj::get_or_create_merge_map): New.
1017
1018 2015-03-24 Alan Modra <amodra@gmail.com>
1019
1020 PR 18147
1021 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
1022 relocation errors for branches to strong undefined symbols.
1023
1024 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1025
1026 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
1027 (Object_merge_map::is_merge_section_for): Remove.
1028 (Object_merge_map::find_merge_section): New.
1029 * merge.h (Object_merge_map::is_merge_section_for): Remove.
1030 (Object_merge_map::find_merge_section): New.
1031 (Object_merge_map::get_input_merge_map): Add a const version.
1032 * object.cc (Relobj::is_merge_section_for): Remove.
1033 (Relobj::find_merge_section): New.
1034 * object.h (Relobj::is_merge_section_for): Remove.
1035 (Relobj::find_merge_section): New.
1036 * output.cc
1037 (Output_section::Input_section::is_merge_section_for): Remove.
1038 (Output_section::add_merge_input_section): Don't call
1039 add_merge_input_section.
1040 (Output_section::find_merge_section): Return const. Use
1041 object->find_merge_section.
1042 (Output_section::build_lookup_maps): Don't build a map for
1043 merge sections.
1044 (Output_section::is_input_address_mapped): Return false if
1045 section is not found.
1046 (Output_section::find_starting_output_address): Use
1047 find_merge_section instead of is_merge_section_for.
1048 (Output_section::add_script_input_section): Don't build a map for
1049 merge sections.
1050 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
1051 (Output_section_lookup_maps::find_merge_section): Remove.
1052 (Output_section_lookup_maps::add_merge_input_section) Remove.
1053 (Output_section::find_merge_section): Return const.
1054
1055 2015-03-22 Cary Coutant <cary@google.com>
1056
1057 PR gold/18106
1058 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
1059 non-SIB form of lea, with nop after the call.
1060
1061 2015-03-21 Cary Coutant <cary@google.com>
1062
1063 PR gold/14217
1064 * output.cc (Output_segment::is_first_section_relro): Don't ignore
1065 .tdata section.
1066 (Output_segment::set_section_addresses): Don't align size of relro
1067 segment for .tbss.
1068
1069 2015-03-21 Cary Coutant <cary@google.com>
1070
1071 PR gold/18010
1072 * stringpool.cc (Stringpool_template): Don't optimize if section
1073 alignment is greater than sizeof(char).
1074
1075 2015-03-21 Cary Coutant <cary@google.com>
1076
1077 PR gold/18048
1078 * script-c.h (script_include_directive): Add first_token parameter.
1079 * script.cc (script_include_directive): Add first_token parameter, and
1080 pass it to read_script_file.
1081 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
1082 (PARSING_MEMORY_DEF): New tokens.
1083 (top): Add new productions for INCLUDE files.
1084 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
1085 Pass PARSING_LINKER_SCRIPT to script_include_directive.
1086 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
1087 (section_cmd): Pass PARSING_SECTION_CMDS.
1088 (file_or_sections_cmd): Remove.
1089 (memory_def): Pass PARSING_MEMORY_DEF.
1090 * testsuite/Makefile.am (memory_test_2): New test.
1091 * testsuite/Makefile.in: Regenerate.
1092 * testsuite/memory_test_inc.t: New script file.
1093 * testsuite/memory_test_inc_1.t.src: New script file.
1094 * testsuite/memory_test_inc_2.t.src: New script file.
1095 * testsuite/memory_test_inc_3.t.src: New script file.
1096
1097 2015-03-21 Cary Coutant <cary@google.com>
1098
1099 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
1100 (Sized_relobj_dwo::setup): Build compressed section map.
1101 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
1102 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
1103 section map.
1104 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
1105 compressed_sections_ field.
1106 (build_compressed_section_map): Take Object instead of
1107 Sized_relobj_file parameter; add decompress_if_needed parameter.
1108 (Sized_relobj_file::do_find_special_sections): Store compressed
1109 section map in parent Object.
1110 (Sized_relobj_file::do_decompressed_section_contents): Move
1111 implementation to Object::decompressed_section_contents.
1112 (Sized_relobj_file::do_discard_decompressed_sections): Move
1113 implementation to Object::discard_decompressed_sections.
1114 * object.h (build_compressed_section_map): Declare.
1115 (Object::Object): Add compressed_sections_ field.
1116 (Object::section_is_compressed): Move implementation here.
1117 (Object::decompressed_section_contents): De-virtualize.
1118 (Object::discard_decompressed_sections): De-virtualize.
1119 (Object::do_section_is_compressed): Delete.
1120 (Object::do_decompressed_section_contents): Delete.
1121 (Object::set_compressed_sections): New method.
1122 (Object::compressed_sections): New method.
1123 (Object::compressed_sections_): New data member.
1124 (Compressed_section_info, Compressed_section_map): Move to top of file.
1125 (Sized_relobj_file::do_section_is_compressed): Delete.
1126 (Sized_relobj_file::do_decompressed_section_contents): Delete.
1127 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
1128 (Sized_relobj_file::compressed_sections_): Move to Object class.
1129
1130 2015-03-21 Cary Coutant <ccoutant@google.com>
1131
1132 PR gold/18152
1133 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
1134 deferred objects.
1135
1136 2015-03-11 Cary Coutant <ccoutant@google.com>
1137
1138 * options.cc (General_options::finalize): Don't allow -z relro
1139 with incremental linking.
1140 * testsuite/Makefile.am (incremental_test): Add -z norelro.
1141 (incremental_test_2): Likewise.
1142 (incremental_test_3): Likewise.
1143 (incremental_test_4): Likewise.
1144 (incremental_test_5): Likewise.
1145 (incremental_test_6): Likewise.
1146 (incremental_copy_test): Likewise.
1147 (incremental_common_test_1): Likewise.
1148 (incremental_comdat_test_1): Likewise.
1149 * testsuite/Makefile.in: Regenerate.
1150
1151 2015-03-09 Cary Coutant <ccoutant@google.com>
1152
1153 PR gold/14675
1154 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
1155 return enum indicating whether .eh_frame section is empty, optimizable,
1156 unrecognized, or an end marker. Adjust explicit instantiations.
1157 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
1158 (Eh_frame::add_ehframe_input_section): Change return type.
1159 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
1160 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
1161 to the .eh_frame output section until we see the end marker.
1162 (Layout::finalize_eh_frame_section): New.
1163 * layout.h: (Layout::finalize_eh_frame_section): New.
1164
1165 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
1166
1167 * output.cc (Relobj::initialize_input_to_output_map<size>):
1168 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
1169
1170 2015-03-04 Cary Coutant <ccoutant@google.com>
1171
1172 * parameters.cc (Parameters::set_target_once): Call
1173 Target::select_as_default_target just once from here...
1174 (set_parameters_target): ...instead of from here.
1175
1176 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1177
1178 * ehframe.cc (Cie::set_output_offset): Pass in and use a
1179 Output_section_data instead of a Merge_map.
1180 (Eh_frame::Eh_frame): Don't initialize merge_map_.
1181 (Eh_frame::read_cie): Use add_merge_mapping instead of
1182 Merge_map::add_mapping.
1183 (Eh_frame::read_fde): Ditto.
1184 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1185 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1186 merge_map_->get_output_offset.
1187 (Eh_frame::do_is_merge_section_for): Delete.
1188 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1189 instead of a Merge_map.
1190 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1191 Merge_map.
1192 (Eh_frame::do_is_merge_section_for): Delete.
1193 (Eh_frame::merge_map_): Delete.
1194 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1195 and use a Output_section_data instead of a Merge_map.
1196 (Object_merge_map::add_mapping): Ditto.
1197 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1198 (Object_merge_map::is_merge_section_for): Pass in and use a
1199 Output_section_data instead of a Merge_map.
1200 (Merge_map): Delete.
1201 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1202 of merge_map_.get_output_offset.
1203 (Output_merge_base::do_is_merge_section_for): Delete.
1204 (Output_merge_data::do_add_input_section): Use
1205 object->add_merge_mapping instead of add_mapping.
1206 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1207 * merge.h (Merge_map): Delete forward declaration.
1208 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1209 instead of a Merge_map.
1210 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1211 (Object_merge_map::is_merge_section_for): Pass in and use a
1212 Output_section_data instead of a Merge_map.
1213 (Input_merge_map::Object_merge_map::merge_map): Replace with
1214 output_data.
1215 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1216 Output_section_data instead of a Merge_map.
1217 (Merge_map): Delete.
1218 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1219 (Output_merge_base::do_is_merge_section_for): Delete.
1220 (Output_merge_base::add_mapping): Delete.
1221 (Output_merge_base::merge_map_): Delete.
1222 * object.cc (Relobj::initialize_input_to_output_map): New.
1223 (Relobj::initialize_input_to_output_map): New.
1224 (Relobj::merge_output_offset): New.
1225 (Relobj::is_merge_section_for): New.
1226 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1227 bits.
1228 * object.h (Relobj::merge_map): Delete.
1229 (initialize_input_to_output_map): New.
1230 (set_merge_map): Delete.
1231 (add_merge_mapping): New.
1232 (merge_output_offset): New.
1233 (is_merge_section_for): New.
1234 * output.cc (Output_section::Input_section::is_merge_section_for):
1235 Use object->is_merge_section_for.
1236 * output.h (Output_section_data::is_merge_section_for): Delete.
1237 (Output_section_data::do_is_merge_section_for): Delete.
1238 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1239 Use object->initialize_input_to_output_map.
1240 (Merged_symbol_value<size>::value_from_output_section): Use
1241 object->merge_output_offset.
1242
1243 2015-03-02 Peter Collingbourne <pcc@google.com>
1244 Cary Coutant <ccoutant@google.com>
1245
1246 * output.cc (Output_section::add_merge_input_section): Do not
1247 attempt to merge sections with an entsize of 0.
1248
1249 2015-03-02 Khem Raj <raj.khem@gmail.com>
1250
1251 * attributes.h (class Output_attributes_section_data ): Add
1252 do_print_to_mapfile function.
1253
1254 2015-02-24 Alan Modra <amodra@gmail.com>
1255
1256 PR 18010
1257 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1258 complain if value is not a multiple of four.
1259 (Target_powerpc::Relocate::relocate): Correct handling of
1260 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1261
1262 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1263
1264 * configure.ac (default_size): Set to 32 for x32.
1265 * configure: Regenerated.
1266
1267 2015-02-18 Alan Modra <amodra@gmail.com>
1268
1269 PR 17954
1270 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1271 visibility.
1272
1273 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1274
1275 * gc.h (Garbage_collection::add_reference): Don't use find.
1276
1277 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1278
1279 * object.cc (write_local_symbols): avoid std::vector copy.
1280
1281 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1282
1283 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1284
1285 2015-02-09 Mark Wielaard <mjw@redhat.com>
1286
1287 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1288 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1289
1290 2015-02-16 Cary Coutant <ccoutant@google.com>
1291
1292 PR gold/13577
1293 PR gold/16992
1294 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1295 DF_SYMBOLIC if --dynamic-list option is used.
1296 * options.cc (General_options::finalize): --dynamic-list is not
1297 mutually exclusive with -Bsymbolic.
1298 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1299 listed in --dynamic-list.
1300 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1301 -Bsymbolic-functions.
1302 * testsuite/Makefile.in: Regenerate.
1303
1304 2015-02-16 Cary Coutant <ccoutant@google.com>
1305
1306 PR gold/17971
1307 * incremental.cc: Remove redundant include of "output.h".
1308
1309 2015-02-12 Jing Yu <jingyu@google.com>
1310
1311 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1312 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1313 New relocation.
1314 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1315 TLSLE_MOVW_* relocations.
1316 (Target_aarch64::Scan::global): Likewise.
1317 (Target_aarch64::Relocate::relocate): Likewise.
1318 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1319 for new TLSLE_MOVW_* relocations.
1320
1321 2015-02-11 Will Newton <will.newton@linaro.org>
1322
1323 PR gold/13321
1324 * arm.cc (Target_arm::make_plt_section): Create an ARM
1325 state mapping symbol at the start of the PLT.
1326
1327 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1328
1329 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1330 Replace two_file_shared_2.so with two_file_shared_1.so.
1331 * testsuite/Makefile.in: Regenerated.
1332
1333 2015-02-09 Alan Modra <amodra@gmail.com>
1334
1335 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1336 plugin_test_thin.a and defsym_test.
1337 * testsuite/Makefile.in: Regenerate.
1338
1339 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1340
1341 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1342 body.
1343
1344 2015-02-04 Peter Collingbourne <pcc@google.com>
1345
1346 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1347 forwarding symbols when computing symbol resolution info for plugins.
1348 * plugin.h (Plugin_manager::symtab): New method.
1349 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1350
1351 2015-02-03 Cary Coutant <ccoutant@google.com>
1352 Peter Collingbourne <pcc@google.com>
1353
1354 PR gold/15660
1355 * archive.cc (Thin_archive_object_unlocker): New class.
1356 (Archive::include_member): Unlock external members of thin archives.
1357 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1358 (plugin_test_2): Likewise.
1359 (plugin_test_3): Likewise.
1360 (plugin_test_4): Likewise.
1361 (plugin_test_5): Likewise.
1362 (plugin_test_6): Likewise.
1363 (plugin_test_7): Likewise.
1364 (plugin_test_8): Likewise.
1365 (plugin_test_9): Likewise.
1366 (plugin_test_10): Likewise.
1367 (plugin_test_11): New test case.
1368 * testsuite/Makefile.in: Regenerate.
1369 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1370 file to decide whether to claim file.
1371 (all_symbols_read_hook): Likewise.
1372 * testsuite/plugin_test_1.sh: Adjust expected output.
1373 * testsuite/plugin_test_2.sh: Likewise.
1374 * testsuite/plugin_test_3.sh: Likewise.
1375 * testsuite/plugin_test_6.sh: Likewise.
1376 * testsuite/plugin_test_tls.sh: Likewise.
1377 * testsuite/plugin_test_11.sh: New testcase.
1378
1379 2015-02-03 Cary Coutant <ccoutant@google.com>
1380
1381 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1382 file descriptors when debugging enabled. Add debug output.
1383 (Descriptors::release): Add debug output.
1384 (Descriptors::close_some_descriptor): Likewise.
1385 (Descriptors::close_all): Likewise.
1386 * fileread.cc (File_read::lock): Likewise.
1387 (File_read::unlock): Likewise.
1388
1389 2015-02-02 Cary Coutant <ccoutant@google.com>
1390
1391 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1392 executable output file.
1393
1394 2015-01-22 Han Shen <shenhan@google.com>
1395
1396 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1397 (Target_arm::do_plt_address_for_global): New method.
1398 (Target_arm::do_plt_address_for_local): New method.
1399 (Target_arm::rel_irelative_section): New method.
1400 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1401 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1402 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1403 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1404 (Target_arm::Scan::check_non_pic): Add ifunc support.
1405 (Target_arm::Scan::local): Add ifunc support.
1406 (Target_arm::Scan::global): Add ifunc support.
1407 (Target_arm::make_plt_section): New method.
1408 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1409 (Target_arm::make_local_ifunc_plt_entry): New method.
1410 (Target_arm::got_irelative_): New member.
1411 (Target_arm::rel_irelative_): New member.
1412 (Target_arm::got_section): Add creation for got_irelative_.
1413 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1414 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1415 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1416 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1417 (Output_data_plt_arm::IRelative_data): New type.
1418 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1419 (Output_data_plt_arm::add_entry): Add more parameters.
1420 (Output_data_plt_arm::add_relocation): New method.
1421 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1422 (Output_data_plt_arm::rel_irelative): New method.
1423 (Output_data_plt_arm::entry_count): Modified.
1424 (Output_data_plt_arm::address_for_global): New method.
1425 (Output_data_plt_arm::address_for_local): New method.
1426 gold/
1427 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1428 (Output_data_plt_arm::insert_irelative_data): New method.
1429 (Output_data_plt_arm::irelative_rel_): New member.
1430 (Output_data_plt_arm::got_): New member.
1431 (Output_data_plt_arm::got_irelative_): New member.
1432 (Output_data_plt_arm::irelative_count_): New member.
1433 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1434 (Output_data_plt_arm::irelative_data_vec_): New member.
1435 (Output_data_plt_arm::do_write): Write out irelative entries.
1436 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1437 more parameters to ctor.
1438 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1439 more parameters to ctor.
1440 * output.h (Output_data_reloc::add_local_relative): New method.
1441 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1442
1443 2015-01-29 Alan Modra <amodra@gmail.com>
1444
1445 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1446 and GOT_TLSGD to LE optimization.
1447
1448 2015-01-28 Cary Coutant <ccoutant@google.com>
1449
1450 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1451 for undef TLS symbols.
1452 (Target_x86_64::Relocate::relocate_tls): Likewise.
1453 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1454
1455 2015-01-25 Cary Coutant <ccoutant@google.com>
1456
1457 * output.cc (Output_segment::set_section_addresses): Fix calculation
1458 of size of relro segment.
1459
1460 2015-01-22 Alan Modra <amodra@gmail.com>
1461
1462 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1463 condition for need of ifunc plt entry.
1464 (Target_powerpc::Scan::global <got relocs>): Likewise.
1465
1466 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1467
1468 * mips.cc (reloc_high): Add r_sym.
1469 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1470 reloc_high constructor.
1471 (Mips_relocate_functions::relgot16_local): Likewise.
1472 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1473 r_type to decide whether LO16 matches HI16.
1474 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1475 rello16 and relgot16_local.
1476
1477 2015-01-09 Cary Coutant <ccoutant@google.com>
1478
1479 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1480 unless alignment is larger than page size.
1481
1482 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1483 Cary Coutant <ccoutant@google.com>
1484
1485 PR gold/17729
1486 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1487 (DEFAULT_TARGET_X32): Set for x32.
1488 * x86_64.cc (cmp_insn_32): New.
1489 (lea_r10_insn_32): Likewise.
1490 (lea_r11_insn_32): Likewise.
1491 (cmp_insn_64): Likewise.
1492 (lea_r10_insn_64): Likewise.
1493 (lea_r11_insn_64): Likewise.
1494 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1495 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1496 (check_DATA): Add split_x32 files.
1497 (split_x32_[1234n].o): New targets.
1498 (split_x32_[124]): New targets.
1499 (split_x32_[1234r].stdout): New targets.
1500 * testsuite/split_x32.sh: New file.
1501 * testsuite/split_x32_1.s: Likewise.
1502 * testsuite/split_x32_2.s: Likewise.
1503 * testsuite/split_x32_3.s: Likewise.
1504 * testsuite/split_x32_4.s: Likewise.
1505 * testsuite/split_x32_n.s: Likewise.
1506 * configure: Regenerated.
1507 * testsuite/Makefile.in: Likewise.
1508
1509 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1510
1511 PR gold/17809
1512 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1513 x32.
1514
1515 2015-01-02 Alan Modra <amodra@gmail.com>
1516
1517 * version.cc (print_version): Just print current year.
1518 * dwp.cc (print_version): Likewise.
1519
1520 2015-01-01 Alan Modra <amodra@gmail.com>
1521
1522 Update year range in copyright notice of all files.
1523
1524 2014-12-25 Alan Modra <amodra@gmail.com>
1525
1526 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1527 new enums.
1528 (Target_arm::merge_object_attributes, ): Likewise.
1529
1530 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1531
1532 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1533 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1534 AEABI_VFP_args_vfp to check that.
1535 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1536 value and replace hardcoded values by enum values.
1537
1538 2014-12-22 Cary Coutant <ccoutant@google.com>
1539
1540 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1541
1542 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1543
1544 PR gold/14608
1545 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1546 to "return i * i * 3;".
1547
1548 2014-12-16 Cary Coutant <ccoutant@google.com>
1549
1550 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1551 (Mapfile::print_output_data): Use current_data_size() to avoid
1552 assert for sections requiring postprocessing; if address is not valid,
1553 print 0.
1554 (Mapfile::print_output_section): Use current_data_size(); print note
1555 that addresses and sizes are before compression.
1556
1557 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1558
1559 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1560 Cast current_group_size to unsigned long when reporting error.
1561
1562 2014-12-10 Jing Yu <jingyu@google.com>
1563
1564 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1565 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1566 Update error message.
1567 (Target_aarch64::do_relax): Use absolute value of option
1568 stub_group_size. Replace local variable with class member
1569 stub_group_size_.
1570
1571 2014-12-04 Alan Modra <amodra@gmail.com>
1572
1573 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1574 addend of PLTREL24 reloc when not generating a plt stub. Make
1575 max_branch_offset an "Address".
1576 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
1577 (Target_powerpc::Relocate::relocate): Likewise.
1578
1579 2014-12-04 Alan Modra <amodra@gmail.com>
1580
1581 PR 17670
1582 * symtab.cc (Symbol::set_undefined): Remove assertion.
1583 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1584 on symbols defined in discarded sections, instead return false.
1585 Rearrange params, update all callers.
1586 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1587 branches to syms in discarded sections.
1588 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1589 undefined and flag as discarded.
1590 (Target_powerpc::Relocate::relocate): Localize variable.
1591
1592 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1593
1594 PR gold/17675
1595 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1596 * testsuite/Makefile.in: Regenerated.
1597
1598 2014-12-03 Alan Modra <amodra@gmail.com>
1599
1600 PR 17566
1601 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1602 when adding dynamic relocations against section symbols.
1603
1604 2014-12-01 Dimitry Ivanov <dimitry@google.com>
1605
1606 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1607 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1608 * options.h (General_options): New -z option (global).
1609
1610 2014-12-01 Cary Coutant <ccoutant@google.com>
1611
1612 PR gold/17578
1613 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1614 is given.
1615 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1616 given but some inputs require executable stack.
1617
1618 2014-11-26 Cary Coutant <ccoutant@google.com>
1619
1620 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1621 .debug_str_offsets; strip .debug_gnu_pubnames and
1622 .debug_gnu_pubtypes.
1623 (lines_only_debug_sections): Strip all four new sections.
1624
1625 2014-11-26 Jing Yu <jingyu@google.com>
1626
1627 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1628 register to be x0 when to relax TLSDESC_LD64_LO12.
1629
1630 2014-11-26 Alan Modra <amodra@gmail.com>
1631
1632 * powerpc.cc (struct Stub_table_owner): New.
1633 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1634 unsigned int vector. Update all references.
1635 (powerpc_relobj::set_stub_table): Take an unsigned int param
1636 rather than a Stub_table. Update callers.
1637 (Powerpc_relobj::clear_stub_table): New function.
1638 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1639 stub_group_size_ vars.
1640 (Target_powerpc::new_stub_table): Delete.
1641 (max_branch_delta): New function, extracted from..
1642 (Target_powerpc::Relocate::relocate): ..here..
1643 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1644 status on whether stub created successfully.
1645 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1646 default sizing to..
1647 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1648 reduce on relax failure.
1649 (Target_powerpc::group_sections): Add "no_size_errors" param.
1650 Use stub_group_size_. Set up group info in a temp vector,
1651 before building Stub_table vector. Account for input sections
1652 possibly already converted to relaxed sections.
1653 (Stub_table::init): Delete. Merge into..
1654 (Stub_table::Stub_table): ..here.
1655 (Stub_table::can_reach_stub): New function.
1656 (Stub_table::add_plt_call_entry): Add "from" parameter and
1657 return true iff stub could be reached.
1658 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1659 param too.
1660 (Stub_table::clear_stubs): Add "all" param.
1661
1662 2014-11-26 Alan Modra <amodra@gmail.com>
1663
1664 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1665 (Target_powerpc::group_sections): Use it.
1666
1667 2014-11-25 Cary Coutant <ccoutant@google.com>
1668
1669 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1670 (Binary_to_elf::write_symbol): Add st_size parameter.
1671 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1672
1673 2014-11-25 Cary Coutant <ccoutant@google.com>
1674
1675 PR gold/17639
1676 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1677 (Sized_relobj_file::do_layout): Handle deferred sections properly
1678 during GC pass 1. Don't add reloc sections to deferred list twice.
1679 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1680 (Sized_relobj_file::is_deferred_layout_): New data member.
1681
1682 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1683
1684 PR gold/17619
1685 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1686 Check PC-relative offset overflow in PLT entry.
1687
1688 2014-11-21 Alan Modra <amodra@gmail.com>
1689
1690 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1691 for undefined weaks.
1692
1693 2014-11-20 Alan Modra <amodra@gmail.com>
1694
1695 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1696 from --stub-group-size parameter divided by 1024.
1697 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1698 template parameter. Update all uses.
1699 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1700 has_stub_value. Set for long branches. Don't report overflow for
1701 branch to undefined weak symbols. Print info message on
1702 overflowing branch to stub.
1703
1704 2014-11-20 Alan Modra <amodra@gmail.com>
1705
1706 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1707
1708 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1709
1710 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1711 entry for R_X86_64_GOTPLT64.
1712 (Target_x86_64<size>::Relocate::relocate): Update comments for
1713 R_X86_64_GOTPLT64.
1714
1715 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1716
1717 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1718 * plugin.h: add lock definition
1719
1720 2014-10-29 Han Shen <shenhan@google.com>
1721 Jing Yu <jingyu@google.com>
1722
1723 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1724 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1725 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1726 Symbol::TLS_REF.
1727 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1728 method.
1729 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1730 (Target_aarch64::tls_ld_to_le): New method.
1731 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1732 for 64bit targets.
1733 (Output_data_plt_aarch64::irelative_rel_): New data member.
1734 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1735 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1736 (Output_data_plt_aarch64::add_relocation): New method.
1737 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1738 offset. Add got_irelative size to got size.
1739 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1740 type string with the new typename.
1741 (AArch64_relocate_functions::update_adr): Replace parameter x with
1742 immed.
1743 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1744 (AArch64_relocate_functions::reloc_common): New method.
1745 (AArch64_relocate_funcsions::rela_general): Extract common part out
1746 into reloc_common method.
1747 (AArch64_relocate_functions::rela_general): Likewise.
1748 (AArch64_relocate_functions::pcrela_general): Likewise.
1749 (AArch64_relocate_functions::adr): New method.
1750 (AArch64_relocate_functions::adrp): Calculate immed before calling
1751 update_adr.
1752 (AArch64_relocate_functions::adrp): Likewise.
1753 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1754 comparing x to 0. Calculate immed from ~x when x < 0.
1755 (Target_aarch64::optimize_tls_reloc): Add new cases for
1756 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1757 TLSLD_MOVW_DTPREL_G0_NC.
1758 (Target_aarch64::possible_function_pointer_reloc): Implement this
1759 method.
1760 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1761 comment.
1762 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1763 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1764 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1765 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1766 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1767 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1768 (Target_aarch64::make_plt_entry): Call add_entry with two more
1769 parameters.
1770 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1771 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1772 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1773 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1774 (Target_aarch64::Relocate::relocate_tls): Add cases for
1775 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1776 TLSLD_MOVW_DTPREL_G0_NC.
1777 * testsuite/icf_safe_so_test.cc: Correct test comment.
1778 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1779
1780 2014-10-22 Alan Modra <amodra@gmail.com>
1781
1782 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1783 thread_starter.
1784
1785 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1786
1787 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1788
1789 2014-10-17 Cary Coutant <ccoutant@google.com>
1790
1791 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1792 Add "typename" keyword.
1793
1794 2014-10-15 Han Shen <shenhan@google.com>
1795 Jing Yu <jingyu@google.com>
1796
1797 Patch for gold aarch64 backend to support relaxation.
1798 * aarch64-reloc.def: Change format.
1799 * aarch64.cc (class Reloc_stub): New class.
1800 (class Stub_table): New class.
1801 (class AArch64_relobj): New class.
1802 (class AArch64_input_section): New class.
1803 (class AArch64_output_section): New class.
1804 (Target_aarch64::new_stub_table): New method.
1805 (Target_aarch64::new_aarch64_input_section): New method.
1806 (Target_aarch64::find_aarch64_input_section): New method.
1807 (Target_aarch64::scan_section_for_stubs): New method.
1808 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1809 (Target_aarch64::relocate_stub): New method.
1810 (Target_aarch64::current_target): New method.
1811 (Target_aarch64::do_make_elf_object): New method.
1812 (Target_aarch64::do_may_relax): New method.
1813 (Target_aarch64::do_relax): New method.
1814 (Target_aarch64::group_sections): New method.
1815 (Target_aarch64::scan_reloc_for_stub): New method.
1816 (Target_aarch64::do_make_output_section): New method.
1817 (Target_aarch64::stub_tables_): New data member.
1818 (Target_aarch64::aarch64_input_section_map_): New data member.
1819 (AArch64_relocate_functions::maybe_apply_stub): New method.
1820
1821 2014-09-30 Cary Coutant <ccoutant@google.com>
1822
1823 PR gold/17432
1824 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1825
1826 2014-09-30 Kito Cheng <kito@0xlab.org>
1827
1828 PR gold/13597
1829 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1830 hash table before sysv-style hash table.
1831
1832 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1833
1834 * options.h (--pic-executable): Add negative to alias to -no-pie.
1835
1836 2014-09-26 Cary Coutant <ccoutant@google.com>
1837
1838 PR gold/16773
1839 * object.cc (Sized_relobj_file): Compute value of section symbols
1840 for TLS sections the same as TLS symbols.
1841
1842 2014-09-25 Cary Coutant <ccoutant@google.com>
1843
1844 PR gold/17432
1845 * resolve.cc (Symbol_table::resolve): Override common placeholder
1846 symbols, but adjust sizes.
1847 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1848 symbols to common lists.
1849
1850 2014-09-24 Alan Modra <amodra@gmail.com>
1851
1852 * po/POTFILES.in: Regenerate.
1853
1854 2014-09-23 Taiju Tsuiki <tzik@google.com>
1855 Cary Coutant <ccoutant@google.com>
1856
1857 PR gold/14860
1858 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1859 on input_sections_blocker.
1860 * layout.cc (Write_sections_task::locks): Unblock
1861 input_sections_blocker_.
1862 * layout.h (Write_sections_task::Write_sections_task): Add
1863 input_sections_blocker.
1864 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1865 to DEPENDENCIES.
1866 * testsuite/Makefile.in: Regenerate.
1867
1868 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1869
1870 * testsuite/Makefile.am (plugin_test_10): New test.
1871 * testsuite/Makefile.in: Regenerate
1872 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1873 * testsuite/plugin_test_10.sh: New file.
1874
1875 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1876
1877 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1878 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1879 during the replacement phase.
1880
1881 2014-09-17 Han Shen <shenhan@google.com>
1882 Jing Yu <jingyu@google.com>
1883
1884 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1885 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1886 * aarch64.cc (Target_aarch64): Add data members
1887 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1888 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1889 constructor.
1890 (Target_aarch64::do_reloc_symbol_index): New method.
1891 (Target_aarch64::do_reloc_addend): New method.
1892 (Target_aarch64::add_tlsdesc_info): New method.
1893 (Target_aarch64::do_dynsym_value): New method.
1894 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1895 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1896 (Target_aarch64::make_data_plt): Add new parameters: got,
1897 got_irelative. Pass them to do_make_data_plt.
1898 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1899 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1900 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1901 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1902 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1903 (Target_aarch64::got_tlsdesc_section): New method.
1904 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1905 (Target_aarch64::define_tls_base_symbol): New method.
1906 (Target_aarch64::reserve_tlsdesc_entries): New method.
1907 (Target_aarch64::got_mod_index_entry): New method.
1908 (Target_aarch64::rela_tlsdesc_section): New method.
1909 (Target_aarch64::rela_irelative_section): New method.
1910 (Target_aarch64::Tlsdesc_info): New struct.
1911 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1912 relocations and tlsdesc relocations.
1913 (Target_aarch64::optimize_tls_reloc): Implement method.
1914 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1915 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1916 in constructor.
1917 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1918 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1919 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1920 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1921 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1922 (Output_data_plt_aarch64::rela_irelative): New method.
1923 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1924 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1925 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1926 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1927 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1928 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1929 (Output_data_plt_aarch64_standard): New member variables:
1930 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1931 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1932 New parameter: got, got_irelative.
1933 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1934 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1935 (Output_data_plt_aarch64::do_write): Replace got_address with
1936 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1937 (AArch64_relocate_functions::update_movnz): New method.
1938 (AArch64_relocate_functions): Correct format.
1939 (AArch64_relocate_functions::movnz): New method.
1940 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1941 before the switch. Add new cases to switch.
1942 Check ie_to_le relaxation on tlsie relocations. Add code handling
1943 tlsgd tlsdesc cases.
1944 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1945 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1946 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1947 Call reloc_name_in_error_message to print unsupported reloc.
1948 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1949 make_data_plt.
1950 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1951 relocs. Fill in some more dynamic tags.
1952 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1953 Skip call tls_get_addr when tlsgd is relaxed.
1954 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1955 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1956 tlsdesc->ie relaxation.
1957
1958 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1959
1960 * mips.cc (Target_mips_nacl): New class.
1961 (Target_selector_mips_nacl): New class.
1962 (target_selector_mips32): Rename from target_selector_mips32be and use
1963 Target_selector_mips_nacl instead of Target_selector_mips.
1964 (target_selector_mips32el): Rename from target_selector_mips32 and use
1965 Target_selector_mips_nacl instead of Target_selector_mips.
1966 (target_selector_mips64): Rename from target_selector_mips64be and use
1967 Target_selector_mips_nacl instead of Target_selector_mips.
1968 (target_selector_mips64el): Rename from target_selector_mips64 and use
1969 Target_selector_mips_nacl instead of Target_selector_mips.
1970 (Target_mips::mips_info): Add const attribute.
1971
1972 2014-09-02 Cary Coutant <ccoutant@google.com>
1973
1974 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1975 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1976 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1977 (Sized_incr_dynobj::do_section_name): Likewise.
1978 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1979 (Sized_incr_dynobj::do_section_name): Likewise.
1980 * object.h (Object::section_name): Likewise.
1981 (Object::do_section_name): Likewise.
1982 (Sized_relobj_file::do_section_name): Likewise.
1983 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1984 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1985
1986 2014-09-02 Cary Coutant <ccoutant@google.com>
1987
1988 PR gold/17005
1989 * ehframe.cc (Fde::write): Add output_offset parameter.
1990 (Cie::write): Likewise.
1991 (Eh_frame::set_final_data_size): Account for offset within output
1992 section.
1993 (Eh_frame::do_sized_write): Likewise.
1994 * ehframe.h (Fde::write): Add output_offset parameter.
1995 (Cie::write): Likewise.
1996 * output.cc (Output_section::Input_section_sort_entry): Remove
1997 section_has_name_; add output_section_name parameter. Use
1998 output section name for non-input sections.
1999 (Output_section::Input_section_sort_entry::section_has_name): Remove.
2000 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
2001 (Output_section::Input_section_sort_compare): Remove logic for
2002 sections without names.
2003 (Output_section::Input_section_sort_init_fini_compare): Likewise.
2004 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
2005 Likewise.
2006 (Output_section::Input_section_sort_section_name_compare): Likewise.
2007
2008 2014-08-29 Han Shen <shenhan@google.com>
2009 Jing Yu <jingyu@google.com>
2010
2011 * aarch64-reloc-property.cc
2012 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
2013 reference reloc property in the table.
2014 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
2015 3 other entries.
2016 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
2017 2 new overloaded methods.
2018 (Output_data_got_aarch64::do_write): Add code to write out
2019 static relocs.
2020 (class Output_data_got_aarch64::Static_reloc): New class to wrap
2021 static relocs.
2022 (Output_data_got_aarch64::static_relocs): New vector to
2023 hold static relocs.
2024 (Target_aarch64::TCB_SIZE): New const static memeber.
2025 (Target_aarch64::tcb_size): New method.
2026 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
2027 (Target_aarch64::Relocate::relocate_tls): New method.
2028 (Target_aarch64::Scan::local): Add code handling new reloc types.
2029 (Target_aarch64::Scan::global): Add code handling new reloc types.
2030
2031 2014-08-13 Sriraman Tallam <tmsriram@google.com>
2032
2033 * options.h (-no-pie): Add option.
2034
2035 2014-08-08 Jing Yu <jingyu@google.com>
2036 Han Shen <shenhan@google.com>
2037
2038 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
2039 (DEFFILES): add aarch64-reloc.def.
2040 (TARGETSOURCES): Add aarch64-reloc-property.cc.
2041 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
2042 * Makefile.in: Regenerate.
2043 * aarch64-reloc-property.cc: New file.
2044 * aarch64-reloc-property.h: New file.
2045 * aarch64-reloc.def: New file.
2046 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
2047 with tab to make the format consistent.
2048 (Output_data_got_aarch64::symbol_table_): New method.
2049 (Target_aarch64::do_plt_address_for_global): New method.
2050 (Target_aarch64::do_plt_address_for_local): New method.
2051 (Target_aarch64::do_select_as_default_target): New method.
2052 (Target_aarch64::do_make_data_plt): New method.
2053 (Target_aarch64::make_data_plt): New method.
2054 (Output_data_plt_aarch64::has_irelative_section): New method.
2055 (Output_data_plt_aarch64::address_for_global): New method.
2056 (Output_data_plt_aarch64::address_for_local): New method.
2057 (Output_data_plt_aarch64::irelative_rel_): New parameter.
2058 (Output_data_plt_aarch64::add_entry): Implement contents.
2059 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
2060 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
2061 the got_pov entry to plt0.
2062 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
2063 Implement contents.
2064 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
2065 (AArch64_howto): New struct.
2066 (aarch64_howto[]): New static const array.
2067 (AArch64_relocate_functions): New class.
2068 (Target_aarch64::Scan::get_reference_flags): Remove method.
2069 (Target_aarch64::Scan::local): Implement to support a few relocations.
2070 (Target_aarch64::Scan::global): Implement to support a few relocations.
2071 (Target_aarch64::make_plt_section): Implement contents.
2072 (Target_aarch64::make_plt_entry): Implement contents.
2073 (Target_aarch64::do_finalize_sections): Implement contents.
2074 (Target_aarch64::Relocate::relocate): Implement a few relocations.
2075 (Target_aarch64::relocate_section): Implement contents.
2076
2077 2014-08-06 Alan Modra <amodra@gmail.com>
2078
2079 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
2080
2081 2014-08-06 Alan Modra <amodra@gmail.com>
2082
2083 PR 13227
2084 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
2085
2086 2014-07-21 Sriraman Tallam <tmsriram@google.com>
2087
2088 * object.cc (Relobj::is_section_name_included): Add
2089 ".rodata.nptl_version" to not garbage collect this section.
2090
2091 2014-07-08 Cary Coutant <ccoutant@google.com>
2092
2093 * expression.cc (struct Expression::Expression_eval_info): Add
2094 new fields type_pointer, vis_pointer, and nonvis_pointer.
2095 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
2096 nonvis_pointer parameters. Adjust all calls.
2097 (Symbol_expression::value): Update type, visibility, and nonvis bits
2098 in caller.
2099 * script.cc (Symbol_assignment::sized_finalize): Update type,
2100 visibility, and remaining st_other bits for new symbol.
2101 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
2102 vis_pointer, and nonvis_pointer parameters.
2103 * symtab.h (Symbol::set_type): New method.
2104
2105 * testsuite/Makefile.am (defsym_test): New test.
2106 * testsuite/Makefile.in: Regenerate.
2107 * testsuite/defsym_test.c: New file.
2108 * testsuite/defsym_test.sh: New file.
2109
2110 2014-07-08 Cary Coutant <ccoutant@google.com>
2111
2112 PR gold/15639
2113 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
2114 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
2115 (Sized_dynobj::base_read_symbols): ...new method.
2116 * object.h (Sized_relobj_file::base_read_symbols): New method.
2117 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
2118 (Sized_relobj_file::base_read_symbols): ...new method.
2119 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
2120 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
2121 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
2122
2123 2014-07-04 Alan Modra <amodra@gmail.com>
2124
2125 * po/POTFILES.in: Regenerate.
2126
2127 2014-07-02 Jing Yu <jingyu@google.com>
2128
2129 * aarch64.cc: New file
2130 * Makefile.am (TARGETSOURCES): Add aarch64.cc
2131 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
2132 * Makefile.in: Regenerate.
2133 * configure.tgt: Add entries for aarch64*.
2134 * configure.ac: Likewise.
2135 * configure: Likewise.
2136
2137 2014-06-27 Alan Modra <amodra@gmail.com>
2138
2139 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
2140
2141 2014-06-24 Cary Coutant <ccoutant@google.com>
2142
2143 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
2144 sections.
2145 (Dwo_file::sized_read_unit_index): Likewise.
2146
2147 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2148
2149 * mips.cc: New file.
2150 * Makefile.am (TARGETSOURCES): Add mips.cc
2151 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
2152 * configure.tgt: Add entries for mips*.
2153 * configure.ac: Likewise.
2154 * Makefile.in: Regenerate.
2155 * configure: Likewise.
2156
2157 2014-06-09 Cary Coutant <ccoutant@google.com>
2158
2159 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
2160 unit_length is within section bounds.
2161
2162 2014-06-09 Cary Coutant <ccoutant@google.com>
2163
2164 PR gold/16980
2165 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
2166 map.
2167
2168 2014-06-07 Alan Modra <amodra@gmail.com>
2169
2170 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2171
2172 2014-06-06 Cary Coutant <ccoutant@google.com>
2173
2174 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
2175 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
2176 (Dwarf_pubnames_table::read_header): Likewise.
2177 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
2178 .debug_gnu_pubtypes.
2179
2180 2014-06-05 Joel Brobecker <brobecker@adacore.com>
2181
2182 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
2183 * Makefile.in, configure: Regenerate.
2184
2185 2014-06-03 Alan Modra <amodra@gmail.com>
2186
2187 * powerpc.cc (addis_12_2): Define.
2188 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2189
2190 2014-06-03 Alan Modra <amodra@gmail.com>
2191
2192 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2193 st_other output.
2194
2195 2014-06-02 Alan Modra <amodra@gmail.com>
2196
2197 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2198 Only ignore relocs on ELFv1.
2199 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2200
2201 2014-05-30 Cary Coutant <ccoutant@google.com>
2202
2203 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2204 * testsuite/Makefile.in: Regenerate.
2205 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2206
2207 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2208
2209 PR gold/16945
2210 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2211 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2212
2213 2014-05-15 Alan Modra <amodra@gmail.com>
2214
2215 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2216 Compare FDE contents with DW_CFA_nop rather than 0.
2217
2218 2014-05-13 Sriraman Tallam <tmsriram@google.com>
2219
2220 * symtab.h (may_need_copy_reloc): Remove check for position independent
2221 code.
2222 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2223 position independence before pc absolute may_need_copy_reloc call.
2224 Add check for executable output befor pc relative may_need_copy_reloc
2225 call.
2226 * i386.cc: Ditto.
2227 * arm.cc: Ditto.
2228 * sparc.cc: Ditto.
2229 * tilegx.cc: Ditto.
2230 * powerpc.cc: Add check for no position independence before
2231 may_need_copy_reloc calls.
2232 * testsuite/pie_copyrelocs_test.cc: New file.
2233 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2234 * Makefile.am (pie_copyrelocs_test): New test.
2235 * Makefile.in: Regenerate.
2236
2237 2014-05-08 Martin Liška <mliska@suse.cz>
2238
2239 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2240
2241 2014-05-06 Cary Coutant <ccoutant@google.com>
2242
2243 PR gold/16900
2244 * i386.cc (Output_data_got_plt_i386): New class.
2245 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2246 parameter. Change all callers.
2247 (Output_data_plt_i386::layout_): Remove.
2248 (Output_data_plt_i386::got_plt_): Change type.
2249 (Target_i386::got_plt_): Change type. Change all references.
2250 (Target_i386::got_section): Create instance of new class.
2251 (Output_data_got_plt_i386::do_write): New function.
2252 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2253 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2254 parameter. Change all callers.
2255 (Output_data_plt_x86_64::layout_): Remove.
2256 (Output_data_plt_x86_64::got_plt_): Change type.
2257 (Target_x86_64::got_plt_): Change type. Change all references.
2258 (Target_x86_64::got_section): Create instance of new class.
2259 (Output_data_got_plt_x86_64::do_write): New function.
2260 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2261 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2262 class.
2263
2264 2014-05-05 Cary Coutant <ccoutant@google.com>
2265
2266 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2267 if we have pubnames/pubtypes.
2268
2269 2014-05-02 Cary Coutant <ccoutant@google.com>
2270
2271 * defstd.cc (in_segment): Define __ehdr_start here...
2272 * layout.cc (Layout::finalize): ...Instead of here. Set the
2273 output segment when known.
2274 * resolve.cc (Symbol::override_base_with_special): Remember
2275 the original binding.
2276 * symtab.cc (Symbol::set_output_segment): New function.
2277 (Symbol::set_undefined): New function.
2278 * symtab.h (Symbol::is_weak_undefined): Check original undef
2279 binding.
2280 (Symbol::is_strong_undefined): New function.
2281 (Symbol::set_output_segment): New function.
2282 (Symbol::set_undefined): New function.
2283 * target-reloc.h (is_strong_undefined): Remove.
2284 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2285 Check for hidden undefs.
2286 (relocate_section): Call Symbol::is_strong_undefined.
2287
2288 * testsuite/Makefile.am (ehdr_start_test_1)
2289 (ehdr_start_test_2, ehdr_start_test_3)
2290 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2291 * testsuite/Makefile.in: Regenerate.
2292 * testsuite/ehdr_start_def.cc: New source file.
2293 * testsuite/ehdr_start_test.cc: New source file.
2294 * testsuite/ehdr_start_test.t: New linker script.
2295 * testsuite/ehdr_start_test_4.sh: New shell script.
2296
2297 2014-04-23 Cary Coutant <ccoutant@google.com>
2298
2299 PR gold/16870
2300 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2301
2302 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2303
2304 * layout.cc (Layout::include_section): Allow a target to decide
2305 whether to include a section.
2306 * target.h (Target::should_include_section): New function.
2307 (Target::do_should_include_section): New function.
2308
2309 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2310
2311 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2312 inline into ...
2313 (Copy_relocs::emit): ... here.
2314 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2315 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2316 (Copy_reloc_entry::entries_): Change from private to protected.
2317
2318 2014-04-02 Sriraman Tallam <tmsriram@google.com>
2319
2320 * icf.cc (get_section_contents): Replace copies of reloc
2321 vectors with const references.
2322
2323 2014-04-02 Cary Coutant <ccoutant@google.com>
2324
2325 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2326 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2327 * configure: Regenerate.
2328 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2329 -fno-use-linker-plugin.
2330 (LINK1, CXXLINK1): Add it to the link command.
2331 * testsuite/Makefile.in: Regenerate.
2332
2333 2014-03-12 Alan Modra <amodra@gmail.com>
2334
2335 * Makefile.in: Regenerate.
2336
2337 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2338
2339 * symtab.h (Symbol::set_nonvis): New function.
2340
2341 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2342
2343 * symtab.cc (Sized_symbol<32>::init_output_data):
2344 Instantiate the template.
2345 (Sized_symbol<64>::init_output_data): Likewise.
2346
2347 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2348
2349 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2350 adjust dynamic symbol value.
2351 * target.h (Target::adjust_dyn_symbol): New function.
2352 (Target::do_adjust_dyn_symbol): New function.
2353
2354 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2355
2356 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2357 Get the value of DYNAMIC_CUSTOM dynamic entry.
2358 * output.h (Output_data_dynamic::add_custom): New function.
2359 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2360 dynamic entry.
2361 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2362 * target.h (Target::dynamic_tag_custom_value): New function.
2363 (Target::do_dynamic_tag_custom_value): New function.
2364
2365 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2366
2367 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2368 dynsym indexes.
2369 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2370 (Target::do_has_custom_set_dynsym_indexes): New function.
2371 (Target::set_dynsym_indexes): New function.
2372 (Target::do_set_dynsym_indexes): New function.
2373
2374 2014-03-07 Alan Modra <amodra@gmail.com>
2375
2376 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2377 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2378 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2379 (Powerpc_relocate_functions::has_overflow_bitfield,
2380 overflowed): Use the above.
2381 (Target_powerpc::Relocate::relocate): Correct overflow checking
2382 for a number of relocations. Modify overflow test for 16-bit
2383 fields in instructions to signed/unsigned according to whether
2384 the field takes a signed or unsigned value.
2385
2386 2014-03-05 Alan Modra <amodra@gmail.com>
2387
2388 Update copyright years.
2389
2390 2014-03-05 Alan Modra <amodra@gmail.com>
2391
2392 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2393 R_PPC64_ADDR64_LOCAL.
2394 (Target_powerpc::Relocate::relocate): Likewise.
2395
2396 2014-03-03 Alan Modra <amodra@gmail.com>
2397
2398 * dwp.cc (print_version): Update copyright year to current.
2399
2400 2014-02-10 Alan Modra <amodra@gmail.com>
2401
2402 * po/gold.pot: Regenerate.
2403
2404 2014-02-06 Cary Coutant <ccoutant@google.com>
2405
2406 Fix problem where -u is ignored when a weak undef is seen.
2407
2408 * archive.cc (Library_base::should_include_member): Reorder
2409 code to check for -u option if a weak undef has already been seen.
2410 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2411 * testsuite/Makefile.in: Regenerate.
2412 * testsuite/weak_undef_file3.cc: New file.
2413 * testsuite/weak_undef_file4.cc: New file.
2414 * testsuite/weak_undef_test_2.cc: New file.
2415
2416 2014-02-05 Cary Coutant <ccoutant@google.com>
2417
2418 Fix issues with gold undefined symbol diagnostics.
2419
2420 PR binutils/15435
2421 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2422 check to here.
2423 * target-reloc.h (is_strong_undefined): New function.
2424 (relocate_section): Move undef vtable symbol check from here.
2425 Check for is_strong_undefined.
2426
2427 2014-02-05 Cary Coutant <ccoutant@google.com>
2428
2429 Fix problems with the --dynamic-list option.
2430
2431 PR gold/13577
2432 * options.cc (General_options::parse_dynamic_list):
2433 Set have_dynamic_list_.
2434 (General_options::General_options): Initialize have_dynamic_list_.
2435 (General_options::finalize): Turn off -Bsymbolic and
2436 -Bsymbolic-functions if --dynamic-list provided.
2437 * options.h (General_options::have_dynamic_list): New function.
2438 (General_options::have_dynamic_list_): New data member.
2439 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2440 correctly.
2441
2442 PR gold/16530
2443 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2444 in --dynamic-list, mark it.
2445
2446 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2447 (dynamic_list_2): New test case.
2448 * testsuite/Makefile.in: Regenerate.
2449 * testsuite/dynamic_list_2.cc: New file.
2450 * testsuite/dynamic_list_2.t: New file.
2451 * testsuite/dynamic_list_lib1.cc: New file.
2452 * testsuite/dynamic_list_lib2.cc: New file.
2453 * testsuite/gc_dynamic_list_test.c: New file.
2454 * testsuite/gc_dynamic_list_test.sh: New file.
2455 * testsuite/gc_dynamic_list_test.t: New file.
2456
2457 2014-01-28 Cary Coutant <ccoutant@google.com>
2458
2459 Add .gdb_index version 7 support.
2460
2461 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2462 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2463 debug sections.
2464 (Dwarf_ranges_table::read_ranges_table): Likewise.
2465 (Dwarf_pubnames_table::read_section): Check for GNU-style
2466 sections, and for compressed debug sections.
2467 (Dwarf_pubnames_table::read_header): Compute end address of table.
2468 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2469 for end of list by offset, not by offset == 0.
2470 (Dwarf_info_reader::do_read_string_table): Check for compressed
2471 debug sections.
2472 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2473 Initialize new data members.
2474 (Dwarf_pubnames_table::next_name): return flag_byte.
2475 (Dwarf_pubnames_table::end_of_table_): New data member.
2476 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2477 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2478 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2479 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2480 read skeleton type unit DIEs.
2481 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2482 (Gdb_index::do_write): Write flag_byte.
2483 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2484 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2485 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2486 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2487
2488 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2489
2490 * version.cc (print_version): Update copyright year to 2014.
2491
2492 2013-12-19 Dimitry Andric <dimitry@andric.com>
2493
2494 * stringpool.cc (Stringpool_template::reserve): Add
2495 HAVE_UNORDERED_MAP case.
2496 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2497
2498 2013-12-18 Cary Coutant <ccoutant@google.com>
2499
2500 * configure.ac: Check for <unordered_set> and <unordered_map>.
2501 * config.in: Regenerate.
2502 * configure: Regenerate.
2503 * system.h: Use <unordered_set> and <unordered_map> if available.
2504
2505 2013-12-10 Roland McGrath <mcgrathr@google.com>
2506
2507 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2508 with $(INSTALL_PROGRAM_ENV).
2509 * Makefile.in: Regenerate.
2510
2511 2013-11-22 Cary Coutant <ccoutant@google.com>
2512
2513 * configure.ac: Add check for which library is needed for
2514 dlopen.
2515 * configure: Regenerate.
2516
2517 2013-11-22 Cary Coutant <ccoutant@google.com>
2518
2519 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2520 assembler.
2521 * testsuite/Makefile.in: Regenerate.
2522
2523 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2524
2525 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2526 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2527 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2528 (Target_x86_64<size>::Scan::local): Likewise.
2529 (Target_x86_64<size>::Scan::global): Likewise.
2530 (Target_x86_64<size>::Relocate::relocate): Likewise.
2531 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2532 Likewise.
2533 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2534 R_X86_64_PC32_BND.
2535
2536 * testsuite/Makefile.am (check_PROGRAMS): Add
2537 exception_x86_64_bnd_test.
2538 (exception_x86_64_bnd_test_SOURCES): New macro.
2539 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2540 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2541 (exception_x86_64_bnd_test_LDADD): Likewise.
2542 (exception_x86_64_bnd_1.o): New rule.
2543 (exception_x86_64_bnd_2.o): Likewise.
2544 * testsuite/Makefile.in: Regenerated.
2545
2546 2013-11-15 Alan Modra <amodra@gmail.com>
2547
2548 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2549 accessor.
2550 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2551 Only call ppc64_local_entry_offset for 64-bit. Restrict
2552 symval_for_branch lookup to ELFv1.
2553 (Stub_table::add_plt_call_entry): Use unsigned int off.
2554 (Output_data_glink::Address, invalid_address): New.
2555 (Output_data_glink::add_eh_frame): Move out of line. Add
2556 support for ELFv2.
2557 (Output_data_glink::add_global_entry, find_global_entry,
2558 global_entry_address): New functions.
2559 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2560 ge_size): New variables.
2561 (Output_data_glink::set_final_data_size): Add global entry
2562 stub sizing.
2563 (Output_data_glink::do_write): Write global entry stubs.
2564 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2565 parameter. Return true for ELFv2. Adjust callers.
2566 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2567 ELFv1. Similarly for ifunc and dynamic relocation processing
2568 specific to ELFv1. Recognize that symbols are defined on
2569 their plt entries for ELFv2.
2570 (Target_powerpc::symval_for_branch): Assert if called for
2571 ELFv2 or ppc32.
2572 (Target_powerpc::Relocate::relocate): Use global entry plt
2573 stub for symbol value if such exists on ELFv2.
2574 (Target_powerpc::Relocate::relocate): Don't call
2575 symval_for_branch when ELFv2. Do adjust for local entry
2576 offset when ELFv2.
2577 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2578 plt stub for ELFv2.
2579 (Target_powerpc::do_plt_address_for_global): Similarly.
2580
2581 2013-11-14 Cary Coutant <ccoutant@google.com>
2582
2583 Revert patch -- this did not fix the problem, and there is
2584 no race there.
2585
2586 2013-11-14 Cary Coutant <ccoutant@google.com>
2587
2588 PR gold/14860
2589 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2590 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2591 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2592 updating fde_offsets_.
2593 (Eh_frame_hdr::lock_): New data member.
2594
2595 2013-11-14 Cary Coutant <ccoutant@google.com>
2596
2597 * dwp.cc (Dwo_file_entry): New type.
2598 (File_list): Use Dwo_file_entry.
2599 (Dwo_file::verify): New function.
2600 (Dwo_file::verify_dwo_list): New function.
2601 (Dwo_file::sized_verify_dwo_list): New function.
2602 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2603 list.
2604 (Dwp_options): New enum type.
2605 (dwp_options): Add --verify-only.
2606 (usage): Likewise.
2607 (main): Likewise.
2608 * dwp.h (gold_info): Add declaration.
2609
2610 2013-11-14 Cary Coutant <ccoutant@google.com>
2611
2612 PR gold/14860
2613 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2614 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2615 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2616 updating fde_offsets_.
2617 (Eh_frame_hdr::lock_): New data member.
2618
2619 2013-11-06 Cary Coutant <ccoutant@google.com>
2620
2621 PR gold/15758
2622 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2623 before reloc sections.
2624
2625 2013-11-04 Alan Modra <amodra@gmail.com>
2626
2627 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2628 (Symbol::needs_dynamic_reloc): Test new flag.
2629 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2630 (Target_powerpc::Scan::get_reference_flags): Add target param.
2631 Return FUNC_DESC_ABI for 64-bit ELFv1.
2632 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2633 call.
2634 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2635 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2636
2637 2013-10-31 Cary Coutant <ccoutant@google.com>
2638
2639 Restore support for dwp v2 DWARF package file format.
2640
2641 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2642 tu_length parameter. Adjust all callers.
2643 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2644 * dwp.cc: Include dwarf.h.
2645 (Section_bounds): New struct type.
2646 (Unit_set): New struct type.
2647 (Dwo_file::Dwo_file): Initialize new data member.
2648 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2649 Combine and rename to...
2650 (Dwo_file::read_unit_index): ...this.
2651 (Dwo_file::sized_read_compunit_index)
2652 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2653 (Dwo_file::sized_read_unit_index): ...this.
2654 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2655 parameters; add section_id parameter.
2656 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2657 (Dwo_file::add_unit_set): ...this.
2658 (Dwo_file::shndx_map_): Remove.
2659 (Dwo_file::sect_offsets_): New data member.
2660 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2661 (Dwp_output_file::add_section): Rename to...
2662 (Dwp_output_file::add_contribution): ...this.
2663 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2664 (Dwp_output_file::add_tu_set): Likewise.
2665 (Dwp_output_file::Contribution): New type.
2666 (Dwp_output_file::Section::contributions): New data member.
2667 (Dwp_output_file::Cu_or_tu_set): Remove.
2668 (Dwp_output_file::Section::Section): New ctor.
2669 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2670 (Dwp_output_file::Dwp_index::Section_table): New type.
2671 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2672 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2673 parameter.
2674 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2675 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2676 (Dwp_output_file::Dwp_index::section_table): New member function.
2677 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2678 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2679 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2680 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2681 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2682 (Dwp_output_file::Dwp_index::section_table_): New data member.
2683 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2684 (Dwp_output_file::add_output_section): New member function.
2685 (Dwp_output_file::write_new_section): New member function.
2686 (Dwp_output_file::write_contributions): New member function.
2687 (Dwp_output_file::section_id_map_): New data member.
2688 (class Dwo_id_info_reader): Remove.
2689 (class Unit_reader): New class.
2690 (get_dwarf_section_name): New function.
2691 (Dwo_file::read_executable): Adjust initializations of class data.
2692 (Dwo_file::read): Add support for v2 package file format.
2693 (Dwo_file::read_unit_index): Likewise.
2694 (Dwo_file::sized_read_unit_index): Likewise.
2695 (Dwo_file::copy_section): Likewise.
2696 (Dwo_file::add_unit_set): Likewise.
2697 (Dwp_output_file::add_output_section): Likewise.
2698 (Dwp_output_file::add_contribution): Likewise.
2699 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2700 for empty slot.
2701 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2702 file format.
2703 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2704 slot.
2705 (Dwp_output_file::initialize): Remove unused function.
2706 (Dwp_output_file::finalize): Add support for v2 package file format.
2707 (Dwp_output_file::write_index): Likewise.
2708 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2709 function prototype.
2710
2711 2013-10-31 Cary Coutant <ccoutant@google.com>
2712
2713 * configure.ac: Fix check for -fmerge-constants.
2714 * configure.ac: Regenerate.
2715
2716 2013-10-30 Roland McGrath <mcgrathr@google.com>
2717
2718 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2719 Correct 9-byte nop sequence to match what the assembler generates.
2720
2721 2013-10-30 Alan Modra <amodra@gmail.com>
2722
2723 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2724 ppc64_local_entry_offset, ppc64_local_entry_offset,
2725 do_read_symbols): New functions.
2726 (Powerpc_relobj::e_flags_, st_other_): New vars.
2727 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2728 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2729 (Powerpc_relobj::e_flags_): New var.
2730 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2731 and adjust for ELFv2.
2732 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2733 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2734 (Powerpc_dynobj::do_find_special_sections): Likewise.
2735 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2736 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2737 to ELFv2 local entry.
2738 (Target_powerpc::do_relax): No thread safe barriers needed for
2739 ELFv2.
2740 (Output_data_plt_powerpc::initial_plt_entry_size_,
2741 plt_entry_size): Delete. Replace all uses with
2742 first_plt_entry_offset() and plt_entry_size().
2743 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2744 reserved_size parm. Update callers.
2745 (Output_data_plt_powerpc::entry_count): Update.
2746 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2747 and use Target_powerpc::first_plt_entry_offset().
2748 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2749 rename to plt_entry_size.
2750 (Output_data_plt_powerpc::add_ifunc_entry,
2751 add_local_ifunc_entry): Adjust reloc for ELFv2.
2752 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2753 (glink_eh_frame_fde_64v2): New.
2754 (Stub_table::plt_call_size): Support ELFv2 sizing.
2755 (Output_data_glink::add_eh_frame): Use the new FDE.
2756 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2757 (Stub_table::do_write): Write ELFv2 stubs and glink.
2758 (Target_powerpc::Relocate::relocate): Replaces nop after call
2759 with ld 2,24(1) and adjust local offset destination for ELFv2.
2760
2761 2013-10-30 Alan Modra <amodra@gmail.com>
2762
2763 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2764 (Target_powerpc::Scan::global, local): Likewise.
2765 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2766 on all ppc64 @h and @ha relocs.
2767
2768 2013-10-14 Alan Modra <amodra@gmail.com>
2769
2770 * output.h (Output_data_got::add_constant): Tidy.
2771 (Output_data_got::add_constant_pair): New function.
2772 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2773 methods used so as to first call reserve_ent().
2774
2775 2013-10-11 Roland McGrath <mcgrathr@google.com>
2776
2777 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2778 add_got_entry and add_got_entry_pair.
2779
2780 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2781 (HAVE_PUBNAMES): Likewise.
2782 * configure: Regenerate.
2783
2784 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2785 * testsuite/Makefile.in: Regenerate.
2786
2787 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2788 Remove const from declaration.
2789 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2790 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2791 * output.h (Output_file_header): Remove const from member target_
2792 and corresponding constructor argument.
2793 * output.cc (Output_file_header::Output_file_header): Update prototype.
2794 (Output_file_header::do_sized_write): Use this->target_ in place
2795 of parameters()->target().
2796
2797 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2798
2799 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2800 * configure: Regenerate.
2801 * Makefile.in: Regenerate.
2802 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2803 * testsuite/merge_string_literals_2.c: Likewise.
2804 * testsuite/Makefile.am
2805 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2806 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2807 literal -fmerge-constants.
2808 * testsuite/Makefile.in: Regenerate.
2809
2810 * i386.cc (Target_i386): Remove unused member dynbss_.
2811 * arm.cc (Target_arm): Likewise.
2812 * powerpc.cc (Target_powerpc): Likewise.
2813 * sparc.cc (Target_sparc): Likewise.
2814 * tilegx.cc (Target_tilegx): Likewise.
2815 * x86_64.cc (Target_x86_64): Likewise.
2816 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2817 type_signature_, type_offset_.
2818 * plugin.h (Plugin_hook): Remove unused member layout_.
2819 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2820 mapfile_.
2821 (Read_member): Remove unused members input_objects_, symtab_,
2822 mapfile_, layout_.
2823 (Check_library): Remove unused member symtab_.
2824 * archive.h (Lib_group): Remove unused member lib_.
2825 * archive.cc (Lib_group::Lib_group): Update initializer.
2826 * incremental.h (Incremental_binary): Remove unused member target_.
2827 (Incremental_script_entry): Removed unused member script_.
2828 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2829 * icf.h (Icf): Remove unused member num_tracked_relocs.
2830
2831 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2832 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2833 its only use.
2834 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2835
2836 * archive.h: Use struct rather than class for forward declaration
2837 of Read_symbols_data.
2838
2839 2013-10-07 Cary Coutant <ccoutant@google.com>
2840
2841 PR gold/16010
2842 * testsuite/Makefile.am (icf_test): Fix dependencies.
2843 (icf_safe_test): Likewise.
2844 (icf_safe_so_test): Likewise.
2845 (large_symbol_alignment): Add empty _LDADD rule.
2846 * testsuite/Makefile.in: Regenerate.
2847
2848 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2849
2850 PR gold/15927
2851 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2852 relocation for R_X86_64_32 on x32.
2853
2854 2013-08-27 Roland McGrath <mcgrathr@google.com>
2855
2856 * output.cc (Output_segment::set_section_addresses): Take new
2857 Target* argument. If target->isolate_execinstr() and the segment
2858 is executable and starts at a target->abi_pagesize() boundary,
2859 pad its end out to a target->abi_pagesize() boundary with code fill.
2860 * output.h (Output_segment::set_section_addresses): Update decl.
2861 * layout.h (Layout::check_output_data_for_reset_values): Take new
2862 argument RELAX_OUTPUTS.
2863 (Layout): New member relax_output_list_.
2864 (Layout::add_relax_output): New method.
2865 * layout.cc (Layout::Layout): Update constructor.
2866 (Layout::reset_relax_output): New method.
2867 (Layout::clean_up_after_relaxation): Call it.
2868 (Layout::prepare_for_relaxation): Update caller.
2869 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2870 Call reset_relax_output before re-processing segments for
2871 isolate_execinstr case.
2872 (Layout::write_data): Handle relax_output_list_.
2873 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2874 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2875
2876 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2877
2878 PR binutils/15834
2879 * object.h: Fix typos.
2880
2881 2013-08-16 Roland McGrath <mcgrathr@google.com>
2882
2883 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2884 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2885
2886 2013-08-07 Cary Coutant <ccoutant@google.com>
2887
2888 Revert support for v2 DWP files:
2889
2890 2013-03-01 Cary Coutant <ccoutant@google.com>
2891
2892 Add dwp support for v2 DWARF package file format.
2893 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2894 tu_length parameter. Adjust all callers.
2895 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2896 * dwp.cc: Include dwarf.h.
2897 (Section_bounds): New struct type.
2898 (Unit_set): New struct type.
2899 (Dwo_file::Dwo_file): Initialize new data member.
2900 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2901 Combine and rename to...
2902 (Dwo_file::read_unit_index): ...this.
2903 (Dwo_file::sized_read_compunit_index)
2904 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2905 (Dwo_file::sized_read_unit_index): ...this.
2906 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2907 parameters; add section_id parameter.
2908 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2909 (Dwo_file::add_unit_set): ...this.
2910 (Dwo_file::shndx_map_): Remove.
2911 (Dwo_file::sect_offsets_): New data member.
2912 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2913 (Dwp_output_file::add_section): Rename to...
2914 (Dwp_output_file::add_contribution): ...this.
2915 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2916 (Dwp_output_file::add_tu_set): Likewise.
2917 (Dwp_output_file::Contribution): New type.
2918 (Dwp_output_file::Section::contributions): New data member.
2919 (Dwp_output_file::Cu_or_tu_set): Remove.
2920 (Dwp_output_file::Section::Section): New ctor.
2921 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2922 (Dwp_output_file::Dwp_index::Section_table): New type.
2923 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2924 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2925 parameter.
2926 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2927 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2928 (Dwp_output_file::Dwp_index::section_table): New member function.
2929 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2930 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2931 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2932 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2933 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2934 (Dwp_output_file::Dwp_index::section_table_): New data member.
2935 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2936 (Dwp_output_file::add_output_section): New member function.
2937 (Dwp_output_file::write_new_section): New member function.
2938 (Dwp_output_file::write_contributions): New member function.
2939 (Dwp_output_file::section_id_map_): New data member.
2940 (class Dwo_id_info_reader): Remove.
2941 (class Unit_reader): New class.
2942 (get_dwarf_section_name): New function.
2943 (Dwo_file::read_executable): Adjust initializations of class data.
2944 (Dwo_file::read): Add support for v2 package file format.
2945 (Dwo_file::read_unit_index): Likewise.
2946 (Dwo_file::sized_read_unit_index): Likewise.
2947 (Dwo_file::copy_section): Likewise.
2948 (Dwo_file::add_unit_set): Likewise.
2949 (Dwp_output_file::add_output_section): Likewise.
2950 (Dwp_output_file::add_contribution): Likewise.
2951 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2952 for empty slot.
2953 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2954 file format.
2955 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2956 slot.
2957 (Dwp_output_file::initialize): Remove unused function.
2958 (Dwp_output_file::finalize): Add support for v2 package file format.
2959 (Dwp_output_file::write_index): Likewise.
2960 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2961 function prototype.
2962
2963 2013-07-31 Cary Coutant <ccoutant@google.com>
2964
2965 * object.cc (Sized_relobj::do_output_section_address): New function.
2966 (Sized_relobj): Instantiate explicitly.
2967 * object.h (Object::output_section_address): New function.
2968 (Object::do_output_section_address): New function.
2969 (Sized_relobj::do_output_section_address): New function.
2970 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2971
2972 2013-07-30 Cary Coutant <ccoutant@google.com>
2973 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2974
2975 * parameters.cc (Parameters::entry): Return target-specific entry
2976 symbol name.
2977 * target.h (Target::entry_symbol_name): New function.
2978 (Target_info::entry_symbol_name): New data member.
2979
2980 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2981 * i386.cc (Target_i386::i386_info): Likewise.
2982 (Target_i386_nacl::i386_nacl_info): Likewise.
2983 * sparc.cc (Target_sparc::sparc_info): Likewise.
2984 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2985 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2986 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2987 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2988
2989 2013-07-22 Sterling Augustine <saugustine@google.com>
2990
2991 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2992 Convert parameter shndx to local variable. Add parameters symtab
2993 and symtab_size. Scan over section names. Find relocation
2994 section corresponding to current section. Create and initialize
2995 reloc_mapper_ and reloc_type_.
2996 (Dwarf_pubnames_table::read_header): Add assertion. Change
2997 unit_length to off_t. Initialize member unit_length_. Fill in field
2998 cu_offset_.
2999 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
3000 Initialize new fields unit_length_ and cu_offset_.
3001 (Dwarf_pubnames_table::read_section): Update prototype.
3002 (Dwarf_pubnames_table::cu_offset): New member function.
3003 (Dwarf_pubnames_table::subsection_size): Likewise.
3004 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
3005 New fields.
3006 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
3007 member functions public.
3008 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
3009 Update comment. Rework logic. Move repeated parts to...
3010 (Gdb_index_info_reader::read_pubtable): ...here. New function.
3011 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
3012 pubtypes_table_, and stmt_list_offset.
3013 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3014 Gdb_index::find_pubtype_offset,
3015 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
3016 (Gdb_index::pubnames_read): Update prototype and rework logic.
3017 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
3018 Forward declare.
3019 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
3020 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
3021 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
3022 Gdb_index::map_pubtable_to_dies):
3023 Declare functions.
3024 (Gdb_index::pubnames_read): Update declaration.
3025 (Gdb_index::Pubname_offset_map): New type.
3026 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
3027 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
3028 Gdb_index::stmt_list_offset): Declare.
3029 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
3030 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
3031 Gdb_index::pubtypes_offset_): Remove.
3032
3033 2013-07-19 Roland McGrath <mcgrathr@google.com>
3034
3035 * options.h (General_options): Add -Trodata-segment option.
3036 * parameters.cc (Parameters::check_rodata_segment): New function.
3037 (Parameters::set_target_once): Call it.
3038 * parameters.h (Parameters): Declare it (private member function).
3039 * layout.cc (load_seg_unusable_for_headers): New function, broken
3040 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
3041 then validate rodata segment rather than text segment.
3042 (relaxation_loop_body): Call that.
3043 (is_text_segment): New function. Don't admit a non-executable
3044 segment if TARGET->isolate_execinstr().
3045 (set_segment_offsets): Call it. Honor -Trodata-segment option.
3046
3047 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
3048
3049 PR gold/15070
3050 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
3051 * nacl.h (Sniff_file::View::View): Request aligned view.
3052
3053 2013-07-11 Cary Coutant <ccoutant@google.com>
3054
3055 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
3056 correct BRLT entry size.
3057
3058 2013-07-03 Alan Modra <amodra@gmail.com>
3059
3060 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
3061 comment.
3062
3063 2013-07-01 Cary Coutant <ccoutant@google.com>
3064
3065 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
3066 reloc_type_.
3067 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
3068 (Dwarf_ranges_table::lookup_reloc): New function.
3069 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
3070 reloc_type_.
3071 (Dwarf_ranges_table::lookup_reloc): New function.
3072 (Dwarf_ranges_table::reloc_type_): New data member.
3073
3074 2013-06-27 Jing Yu <jingyu@google.com>
3075
3076 PR gold/15662
3077 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
3078 function.
3079 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
3080 (Target_powerpc::do_relax): Call the above.
3081
3082 2013-06-27 Cary Coutant <ccoutant@google.com>
3083
3084 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
3085 on garbage collected .opd section.
3086
3087 2013-06-27 Alan Modra <amodra@gmail.com>
3088
3089 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
3090 is non-zero.
3091 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
3092 (Target_powerpc::do_function_location): Likewise for loc->shndx.
3093
3094 2013-06-14 Cary Coutant <ccoutant@google.com>
3095
3096 * resolve.cc (Symbol::override_base): Don't override st_type
3097 from plugin placeholder symbols.
3098 (Symbol_table::resolve): Likewise.
3099 (Symbol_table::should_override): Don't complain about TLS mismatch
3100 if the TO symbol is a plugin placeholder.
3101 * testsuite/Makefile.am (plugin_test_tls): New test.
3102 * testsuite/Makefile.in: Regenerate.
3103 * testsuite/plugin_test_tls.sh: New test script.
3104 * testsuite/two_file_test_2_tls.cc: New test source.
3105 * testsuite/two_file_test_tls.cc: New test source.
3106
3107 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
3108
3109 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
3110 the maximum segment alignment is larger than the page size.
3111 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
3112 correctly aligns the symbols with large alignemnt.
3113 * testsuite/Makefile.in: Regenerate.
3114 * testsuite/large_symbol_alignment.cc: New file.
3115
3116 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
3117 Sriraman Tallam <tmsriram@google.com>
3118
3119 * options.h (sort_section): New option.
3120 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
3121 Rename from Input_section_sort_section_name_special_ordering_compare.
3122 (Input_section_sort_section_name_compare): New struct.
3123 * output.cc (Output_section::Input_section_sort_section_name_compare::
3124 operator()): New function.
3125 (Output_section::sort_attached_input_sections): Use new sort function
3126 for .text if --sort-section=name is specified.
3127 * layout.cc (Layout::make_output_section):
3128 Add sorting by name when --sort-section=name is specified.
3129 * testsuite/Makefile.am (text_section_grouping): Test option
3130 --sort-section=name.
3131 * testsuite/Makefile.in: Regenerate.
3132 * testsuite/section_sorting_name.cc: New file.
3133 * testsuite/section_sorting_name.sh: New file.
3134
3135 2013-05-21 Cary Coutant <ccoutant@google.com>
3136
3137 * symtab.h (Symbol::is_cxx_vtable): New function.
3138 * target-reloc.h (relocate_section): Check for vtable symbol.
3139 * testsuite/Makefile.am (missing_key_func.sh): New test case.
3140 * testsuite/Makefile.in: Regenerate.
3141 * testsuite/missing_key_func.cc: New test source.
3142 * testsuite/missing_key_func.sh: New test script.
3143
3144 2013-05-21 Cary Coutant <ccoutant@google.com>
3145
3146 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
3147 type of enclosing symbol.
3148 (Relocate_info::location): Check symbol type when describing symbol.
3149 * object.h (Symbol_location_info): Remove unused line_number;
3150 add enclosing_symbol_type.
3151 * testsuite/debug_msg.sh: Adjust expected output.
3152
3153 2013-05-13 Cary Coutant <ccoutant@google.com>
3154
3155 * configure.ac: Export DEFAULT_TARGET.
3156 * configure: Regenerate.
3157 * Makefile.in: Regenerate.
3158 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
3159 * testsuite/Makefile.in: Regenerate.
3160 * testsuite/debug_msg.sh: Delete duplicate tests.
3161 Don't check undef_int error message match for powerpc where the
3162 source file and line number aren't available.
3163
3164 2013-05-10 Roland McGrath <mcgrathr@google.com>
3165
3166 * options.h (General_options): Add --rosegment-gap option.
3167 * options.cc (finalize): --rosegment-gap implies --rosegment.
3168 * layout.cc (set_segment_offsets): Let user option override
3169 target->rosegment_gap().
3170
3171 2013-05-10 Roland McGrath <mcgrathr@google.com>
3172
3173 * options.h (General_options): Remove leading space from help
3174 messages for -nostdlib and --rosegment.
3175
3176 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
3177
3178 PR ld/15365
3179 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
3180
3181 2013-05-03 Alan Modra <amodra@gmail.com>
3182
3183 * merge.cc (Output_merge_string::do_add_input_section): Correct
3184 scan for number of strings. Rename vars to avoid shadowing.
3185 Include missing terminator in input_size_.
3186
3187 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3188
3189 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3190 Restore empty string handling.
3191
3192 2013-05-01 Cary Coutant <ccoutant@google.com>
3193
3194 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3195 uninitialized warning.
3196
3197 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3198
3199 * output.cc (Output_section::add_merge_input_section): Allow
3200 to merge sections if the alignment is more than character size.
3201 * merge.h (Output_merge_string::Output_merge_string): Remove
3202 assert.
3203 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3204 only not-null strings. Check the alignment of strings.
3205 * stringpool.h
3206 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3207 alignment as the argument.
3208 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3209 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3210 Align non-zero length strings according to the addralign_.
3211 (Stringpool_template<Stringpool_char>::set_string_offsets):
3212 Updating offsets according to the given alignment.
3213 * testsuite/Makefile.am (text_section_grouping): Test if string
3214 literals are getting merged.
3215 * testsuite/Makefile.in: Regenerate.
3216 * testsuite/merge_string_literals_1.c: New file.
3217 * testsuite/merge_string_literals_2.c: Ditto.
3218 * testsuite/merge_string_literals.sh: Ditto.
3219
3220 2013-04-26 Ian Lance Taylor <iant@google.com>
3221
3222 * target-reloc.h (relocate_section): If the reloc offset is out of
3223 range, pass VIEW as NULL to relocate.relocate.
3224 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3225 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3226 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3227 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3228 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3229 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3230
3231 2013-04-26 Geoff Pike <gpike@chromium.org>
3232
3233 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3234 * layout.cc (Hash_task): New class.
3235 (Layout::queue_build_id_tasks): New function.
3236 (Layout::write_build_id): Handle single-thread portion of build ID
3237 computation. (In some cases, all of it is single-threaded.) Replace
3238 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3239 functionality in fewer lines of code.
3240 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3241 * options.h (General_options): make "--build-id" default to tree
3242 rather than sha1. Add two new options related to --build-id=tree:
3243 --build-id-chunk-size-for-treehash and
3244 --build-id-min-file-size-for-treehash.
3245 * Makefile.am: add testing of --build-id=tree and related new options
3246 (these tests will be invoked by "make check").
3247 * Makefile.in: Regenerate.
3248
3249 2013-04-25 Alan Modra <amodra@gmail.com>
3250
3251 * configure.tgt: Add powerpcle and powerpc64le.
3252
3253 2013-04-22 Alan Modra <amodra@gmail.com>
3254
3255 PR gold/15355
3256 * layout.cc (Layout::segment_precedes): Allow more than one
3257 segment with the same type and flags.
3258
3259 2013-04-15 Cary Coutant <ccoutant@google.com>
3260
3261 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3262 allocate space in file for BSS sections.
3263
3264 2013-04-15 Cary Coutant <ccoutant@google.com>
3265
3266 * script-sections.cc (Orphan_output_section): Reset address
3267 to zero after each orphaned section for relocatable links.
3268
3269 2013-04-15 Cary Coutant <ccoutant@google.com>
3270
3271 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3272 section starting address for relocatable link.
3273 * testsuite/Makefile.am (script_test_11): New test.
3274 * testsuite/Makefile.in: Regenerate.
3275 * testsuite/script_test_11.c: New source file.
3276 * testsuite/script_test_11.t: New linker script.
3277
3278 2013-04-13 Alan Modra <amodra@gmail.com>
3279
3280 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3281 owner when sections are not adjacent and exceed group size.
3282 (Target_powerpc::group_sections): Handle corner case.
3283 (Target_powerpc::Branch_info::make_stub): Handle case where
3284 stub table doesn't exist due to branches in non-exec sections.
3285 (Target_powerpc::Relocate::relocate): Likewise.
3286
3287 2013-04-11 Alan Modra <amodra@gmail.com>
3288
3289 PR gold/15354
3290 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3291 .branch_lt to match bfd ld. Adjust comments throughout file.
3292
3293 2013-04-04 Ian Lance Taylor <iant@google.com>
3294
3295 GCC PR c++/56840
3296 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3297 sections before checking whether they are included in the link.
3298
3299 2013-03-29 Sriraman Tallam <tmsriram@google.com>
3300
3301 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3302 object before calling the plugin claim_file handler. Pass the elf
3303 object of the archive to the plugin. Delete the elf object if the
3304 plugin claims the file.
3305
3306 2013-03-21 Alan Modra <amodra@gmail.com>
3307
3308 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3309 segment when omagic.
3310
3311 2013-03-21 Alan Modra <amodra@gmail.com>
3312
3313 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3314 comparison warning.
3315 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3316 uninitialized" warning.
3317
3318 2013-03-20 Alan Modra <amodra@gmail.com>
3319
3320 * symtab.h (Symbol::clear_version): New function.
3321 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3322 is_needed by weak references. Clear version for symbols defined
3323 in as-needed objects that are not needed.
3324
3325 2013-03-15 Alan Modra <amodra@gmail.com>
3326
3327 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3328 static and public. Add report_err param. Return false for data refs.
3329 (Target_powerpc::rela_dyn_section): New overloaded function.
3330 (Target_powerpc::plt_, iplt_): Elucidate.
3331 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3332 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3333 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3334 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3335 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3336 push_branch and make_plt_entry for ifunc syms when
3337 reloc_needs_plt_for_ifunc.
3338 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3339 for ifunc unless reloc_needs_plt_for_ifunc.
3340
3341 2013-03-15 Alan Modra <amodra@gmail.com>
3342
3343 * gc.h (gc_process_relocs): Don't look through function descriptors.
3344 * icf.cc (get_section_contents): Do so here instead.
3345
3346 2013-03-13 Alan Modra <amodra@gmail.com>
3347
3348 * powerpc.cc (is_branch_reloc): Forward declare.
3349 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3350 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3351 false for 64-bit, true for 32-bit non-branch relocs.
3352 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3353 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3354 nm output.
3355 (icf_safe_test): Generate linker map file as well as nm output.
3356 (icf_safe_so_test): Likewise.
3357 * testsuite/Makefile.in: Regenerate.
3358 * testsuite/icf_test.sh: Parse linker map file to determine
3359 section folding.
3360 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3361 * testsuite/icf_safe_so_test.sh: Likewise.
3362 (X86_32_or_ARM_specific_safe_fold): Merge into..
3363 (arch_specific_safe_fold): ..this.
3364 (X86_64_specific_safe_fold): Delete unused function.
3365
3366 2013-03-12 Alan Modra <amodra@gmail.com>
3367
3368 * gc.h (gc_process_relocs): Look through function descriptors
3369 to determine shndx, symvalue and addend used by ICF. Tidy
3370 variable duplication.
3371
3372 2013-03-11 Alan Modra <amodra@gmail.com>
3373
3374 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3375 * layout.cc (Layout_task_runner::run): ..to here.
3376 * symtab.h (struct Symbol_location): Extract from..
3377 (class Symbol_table): ..here.
3378 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3379 * target.h (class Target): Add function_location and
3380 do_function_location functions.
3381 (class Sized_target): Add do_function_location.
3382 * object.h (class Sized_relobj_file): Move find_shdr..
3383 (class Object): ..to here.
3384 * object.cc: Likewise. Update to suit. Instantiate.
3385 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3386 * powerpc.cc (class Powerpc_dynobj): New.
3387 (Target_powerpc::do_function_location): New function.
3388 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3389 (Powerpc_dynobj::do_read_symbols): New function.
3390 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3391
3392 2013-03-08 Ian Lance Taylor <iant@google.com>
3393
3394 * options.cc (General_options::string_to_object_format): Accept
3395 "default".
3396
3397 2013-03-08 Alan Modra <amodra@gmail.com>
3398
3399 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3400 pointer to Post_fde.
3401 (struct Post_fde): Move definition to here..
3402 * ehframe.cc (struct Post_fde): ..from here.
3403 (Cie::write): Don't alloc Post_fde.
3404 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3405
3406 2013-03-07 Alan Modra <amodra@gmail.com>
3407
3408 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3409 relocation referencing .LC0.
3410 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3411
3412 2013-03-07 Alan Modra <amodra@gmail.com>
3413
3414 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3415 always_inline. Add assembly for powerpc to avoid GOT.
3416
3417 2013-03-07 Alan Modra <amodra@gmail.com>
3418
3419 * testsuite/script_test_10.sh: Don't test .bss section
3420 header number.
3421
3422 2013-03-06 Alan Modra <amodra@gmail.com>
3423
3424 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3425 (Target_powerpc::symval_for_branch): Add symtab param. Update
3426 all callers. Handle folded sections.
3427 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3428 to Powerpc_relobj.
3429 (Global_symbol_visitor_opd::operator()): Likewise.
3430
3431 2013-03-04 Alan Modra <amodra@gmail.com>
3432
3433 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3434 * testsuite/Makefile.in: Regenerate.
3435
3436 2013-03-01 Cary Coutant <ccoutant@google.com>
3437
3438 Add dwp support for v2 DWARF package file format.
3439 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3440 tu_length parameter. Adjust all callers.
3441 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3442 * dwp.cc: Include dwarf.h.
3443 (Section_bounds): New struct type.
3444 (Unit_set): New struct type.
3445 (Dwo_file::Dwo_file): Initialize new data member.
3446 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3447 Combine and rename to...
3448 (Dwo_file::read_unit_index): ...this.
3449 (Dwo_file::sized_read_compunit_index)
3450 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3451 (Dwo_file::sized_read_unit_index): ...this.
3452 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3453 parameters; add section_id parameter.
3454 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3455 (Dwo_file::add_unit_set): ...this.
3456 (Dwo_file::shndx_map_): Remove.
3457 (Dwo_file::sect_offsets_): New data member.
3458 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3459 (Dwp_output_file::add_section): Rename to...
3460 (Dwp_output_file::add_contribution): ...this.
3461 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3462 (Dwp_output_file::add_tu_set): Likewise.
3463 (Dwp_output_file::Contribution): New type.
3464 (Dwp_output_file::Section::contributions): New data member.
3465 (Dwp_output_file::Cu_or_tu_set): Remove.
3466 (Dwp_output_file::Section::Section): New ctor.
3467 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3468 (Dwp_output_file::Dwp_index::Section_table): New type.
3469 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3470 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3471 parameter.
3472 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3473 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3474 (Dwp_output_file::Dwp_index::section_table): New member function.
3475 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3476 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3477 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3478 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3479 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3480 (Dwp_output_file::Dwp_index::section_table_): New data member.
3481 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3482 (Dwp_output_file::add_output_section): New member function.
3483 (Dwp_output_file::write_new_section): New member function.
3484 (Dwp_output_file::write_contributions): New member function.
3485 (Dwp_output_file::section_id_map_): New data member.
3486 (class Dwo_id_info_reader): Remove.
3487 (class Unit_reader): New class.
3488 (get_dwarf_section_name): New function.
3489 (Dwo_file::read_executable): Adjust initializations of class data.
3490 (Dwo_file::read): Add support for v2 package file format.
3491 (Dwo_file::read_unit_index): Likewise.
3492 (Dwo_file::sized_read_unit_index): Likewise.
3493 (Dwo_file::copy_section): Likewise.
3494 (Dwo_file::add_unit_set): Likewise.
3495 (Dwp_output_file::add_output_section): Likewise.
3496 (Dwp_output_file::add_contribution): Likewise.
3497 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3498 for empty slot.
3499 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3500 file format.
3501 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3502 slot.
3503 (Dwp_output_file::initialize): Remove unused function.
3504 (Dwp_output_file::finalize): Add support for v2 package file format.
3505 (Dwp_output_file::write_index): Likewise.
3506 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3507 function prototype.
3508
3509 2013-03-01 Cary Coutant <ccoutant@google.com>
3510
3511 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3512 function into class definition in header file.
3513 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3514 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3515 New function.
3516 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3517
3518 2013-02-28 Alan Modra <amodra@gmail.com>
3519
3520 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3521 * target.cc (Target::do_plt_fde_location): New function.
3522 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3523 accessor function, and constructor param.
3524 (struct Post_fde, Post_fdes): Declare.
3525 (Cie::write): Add post_fdes param.
3526 * ehframe.cc (Fde::write): Use plt_fde_location.
3527 (struct Post_fde): Define.
3528 (Cie::write): Stash FDEs added post merge mapping.
3529 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3530 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3531 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3532 other FDEs.
3533 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3534 (Target_powerpc::has_glink): New function.
3535 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3536 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3537 glink_eh_frame_fde_32, default_fde): New data.
3538 (Stub_table::eh_frame_added_): New var.
3539 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3540 Make const.
3541 (Stub_table::add_eh_frame): New function.
3542 (Output_data_glink::add_eh_frame): New function.
3543 (Target_powerpc::make_glink_section): Call add_eh_frame.
3544
3545 2013-02-15 Ian Lance Taylor <iant@google.com>
3546
3547 * options.h (DEFINE_uint64_alias): Define.
3548 (class General_options): Add -Ttext-segment as an alias for
3549 -Ttext.
3550
3551 2013-02-15 Alan Modra <amodra@gmail.com>
3552
3553 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3554 (Stub_table::do_write): ..here, two places.
3555 (Stub_table::plt_call_size): Use it here too.
3556
3557 2013-02-11 Ian Lance Taylor <iant@google.com>
3558
3559 * descriptors.cc (Descriptors::close_all): New function.
3560 * descriptors.h (class Descriptors): Declare close_all.
3561 (close_all_descriptors): New inline function.
3562 * plugin.cc: Include "descriptors.h".
3563 (Plugin_manager::cleanup): Call close_all_descriptors.
3564
3565 2013-02-06 Alan Modra <amodra@gmail.com>
3566
3567 * README: Update coding style link.
3568
3569 2013-01-28 Cary Coutant <ccoutant@google.com>
3570
3571 * dwp.cc (File_list): New typedef.
3572 (Dwo_name_info_reader): New class.
3573 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3574 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3575 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3576 (Dwo_file::read_executable): New function.
3577 (Dwo_file::read): Move common setup code to ...
3578 (Dwo_file::make_object): ... here.
3579 (dwp_options): Add --exec/-e.
3580 (usage): Likewise.
3581 (main): Likewise.
3582
3583 2013-01-24 Sriraman Tallam <tmsriram@google.com>
3584
3585 * layout.cc (Layout::layout): Check for option text_reorder.
3586 (Layout::make_output_section): Ditto.
3587 * options.h (text_reorder): New option.
3588 * output.cc (Input_section_sort_compare): Remove special ordering
3589 of section names.
3590 (Output_section::
3591 Input_section_sort_section_name_special_ordering_compare::
3592 operator()): New function.
3593 (Output_section::sort_attached_input_sections): Use new sort function
3594 for .text.
3595 * output.h (Input_section_sort_section_name_special_ordering_compare):
3596 New struct.
3597 * testsuite/Makefile.am (text_section_grouping): Test option
3598 --no-text-reorder
3599 * testsuite/Makefile.in: Regenerate.
3600 * testsuite/text_section_grouping.sh: Check order of functions without
3601 default text reordering.
3602
3603 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3604
3605 * options.h (General_options): Change default to true for new_dtags.
3606
3607 2013-01-18 Mike Frysinger <vapier@gentoo.org>
3608
3609 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3610 when enable_new_dtags is false. Only add DT_RUNPATH when
3611 enable_new_dtags is true.
3612
3613 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3614
3615 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3616 used in declaration and definition consistent.
3617 (Target_powerpc::symval_for_branch): Ditto.
3618
3619 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3620
3621 * testsuite/plugin_final_layout.cc: Fix comment.
3622
3623 2013-01-16 Sriraman Tallam <tmsriram@google.com>
3624
3625 * layout.cc (Layout::layout): Do not do default sorting for
3626 text sections when section ordering is specified.
3627 (make_output_section): Ditto.
3628 * testsuite/plugin_final_layout.cc: Name the function sections
3629 to catch reordering issues.
3630
3631 2013-01-15 Alan Modra <amodra@gmail.com>
3632
3633 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3634 plt-thread-safe.
3635
3636 2013-01-15 Alan Modra <amodra@gmail.com>
3637
3638 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3639 * testsuite/Makefile.in: Regenerate.
3640
3641 2013-01-14 Alan Modra <amodra@gmail.com>
3642
3643 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3644 * testsuite/Makefile.in: Regenerate.
3645
3646 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3647
3648 PR bfd/14430
3649 Fix mingw gold build with plugins enabled
3650 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3651 * configure.ac: Export DLOPEN_LIBS and add headers check.
3652 * plugin.cc: Handle non-dlfcn case.
3653 * Makefile.in: Regenerate.
3654 * config.in: Regenerate.
3655 * configure: Regenerate.
3656 * testsuite/Makefile.in: Regenerate.
3657
3658 2013-01-09 Sriraman Tallam <tmsriram@google.com>
3659
3660 * output.h (sort_attached_input_sections): Change to be public.
3661 * script-sections.cc
3662 (Output_section_definition::set_section_addresses): Sort
3663 attached input sections according to section order before linker
3664 script assigns section addresses.
3665 (Orphan_output_section::set_section_addresses): Sort
3666 attached input sections according to section order before linker
3667 script assigns section addresses.
3668 * Makefile.am (final_layout.sh): Use a simple linker script to
3669 check if section ordering still works.
3670 * Makefile.in: Regenerate.
3671
3672 2013-01-09 Ben Cheng <bccheng@google.com>
3673
3674 * arm.cc (Target_arm::attributes_accept_div): New function.
3675 (Target_arm::attributes_forbid_div): New function.
3676 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3677 attribute using the same new functions as what bfd/elf32_arm.c
3678 does.
3679
3680 2013-01-07 Cary Coutant <ccoutant@google.com>
3681
3682 PR gold/14993
3683 * output.cc (Output_section::add_input_section): For incremental
3684 updates, don't track input sections that are allocated from patch
3685 space.
3686
3687 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3688 Ian Lance Taylor <iant@google.com>
3689
3690 PR gold/14897
3691 * configure.ac (--enable-ld): Removed.
3692 (install_as_default): Set to yes only for --enable-gold=default
3693 or --disable-ld.
3694 * configure: Regenerated.
3695
3696 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3697
3698 * options.h (General_options): Add -fuse-ld= for GCC linker
3699 option compatibility.
3700
3701 2013-01-04 Cary Coutant <ccoutant@google.com>
3702
3703 * configure.ac: Fix typo restoring CXXFLAGS.
3704 * configure: Regenerate.
3705
3706 2013-01-04 Cary Coutant <ccoutant@google.com>
3707
3708 * testsuite/Makefile.am (CXXLINK_S): New macro.
3709 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3710 * testsuite/Makefile.in: Regenerate.
3711
3712 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3713
3714 * version.cc (print_version): Update copyright year to 2013.
3715
3716 2012-12-20 Ian Lance Taylor <iant@google.com>
3717
3718 * layout.cc (Layout::special_ordering_of_input_section): New
3719 function.
3720 (Layout::layout): If input section requires special ordering, must
3721 sort input sections.
3722 (Layout::make_output_section): May sort .text input sections.
3723 (Layout::is_section_name_prefix_grouped): Remove.
3724 * layout.h (class Layout): Declare
3725 special_ordering_of_input_section. Don't declare
3726 is_section_name_prefix_grouped.
3727 * output.cc (Output_section::add_input_section): Revert last
3728 change.
3729 (Output_section::Input_section_sort::match_file_name): Don't crash
3730 if called on output section data.
3731 (Output_section::Input_section_sort_compare): Sort based on
3732 special ordering.
3733 (Output_section::Input_section_sort_section_order_index_compare):
3734 Revert last patch.
3735 (Output_section::sort_attached_input_sections): Likewise.
3736
3737 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3738
3739 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3740 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3741 * output.cc (Output_section::add_input_section): Check if section
3742 name contains special prefix. Keep input sections to sort such
3743 sections.
3744 (Output_section::Input_section_sort_section_order_index_compare
3745 ::operator()): Group sections according to prefixes.
3746 (Output_section::sort_attached_input_sections): Add condition to
3747 Input_section_entry constructor call.
3748 * testsuite/Makefile.am (text_section_grouping): New test.
3749 * testsuite/Makefile.in: Regenerate.
3750 * testsuite/text_section_grouping.cc: New file.
3751 * testsuite/text_section_grouping.sh: New file.
3752
3753 2012-12-17 Nick Clifton <nickc@redhat.com>
3754
3755 * Makefile.am: Add copyright notice.
3756 * NEWS: Likewise.
3757 * README: Likewise.
3758 * configure.ac: Likewise.
3759 * ftruncate.c: Likewise.
3760 * Makefile.in: Regenerate.
3761
3762 2012-12-14 Cary Coutant <ccoutant@google.com>
3763
3764 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3765 --no-as-needed flag.
3766 (exception_separate_shared_12_test): Likewise.
3767 (incremental_copy_test): Likewise.
3768 * testsuite/Makefile.in: Regenerate.
3769
3770 2012-12-14 Cary Coutant <ccoutant@google.com>
3771
3772 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3773 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3774
3775 2012-12-12 Alan Modra <amodra@gmail.com>
3776
3777 * powerpc.cc (class Track_tls): New.
3778 (class Relocate, class Scan): Inherit Track_tls.
3779 (Target_powerpc::Scan::local, global): Track tls optimization
3780 and avoid creating plt entry for __tls_get_addr if all uses
3781 are optimized away.
3782 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3783
3784 2012-12-12 Alan Modra <amodra@gmail.com>
3785
3786 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3787 Replace no_toc_optimize with toc_optimize.
3788 * output.h (Output_section::input_sections): Provide non-const variant.
3789 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3790 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3791 accessors.
3792 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3793 (class Sort_toc_sections): New.
3794 (Target_powerpc::do_finalize_sections): Sort toc sections.
3795 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3796
3797 2012-12-10 Roland McGrath <mcgrathr@google.com>
3798
3799 * testsuite/binary_unittest.cc (read_all): New function.
3800 (Sized_binary_test): Use it instead of ::read.
3801 * fileread.cc (do_read): Don't assume pread always reads the whole
3802 amount in a single call.
3803
3804 2012-12-10 Alan Modra <amodra@gmail.com>
3805
3806 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3807 Set EM_PPC64 or EM_PPC here.
3808 (Target_selector_powerpc::do_recognize): Delete.
3809
3810 2012-12-10 Alan Modra <amodra@gmail.com>
3811
3812 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3813 stub_table_.
3814 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3815
3816 2012-12-07 Roland McGrath <mcgrathr@google.com>
3817
3818 * testsuite/binary_unittest.cc (Sized_binary_test):
3819 Use open_descriptor rather than ::open.
3820
3821 2012-12-07 Alan Modra <amodra@gmail.com>
3822
3823 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3824 typedef and invalid_address constant.
3825 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3826 instantiate constants.
3827
3828 2012-12-06 Roland McGrath <mcgrathr@google.com>
3829
3830 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3831 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3832 * aclocal.m4: Regenerate.
3833 * configure: Regenerate.
3834 * Makefile.in: Regenerate.
3835 * testsuite/Makefile.in: Regenerate.
3836
3837 2012-12-07 Alan Modra <amodra@gmail.com>
3838
3839 * options.h (General_options): Add no_toc_optimize.
3840 * powerpc.cc (ok_lo_toc_insn): New function.
3841 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3842
3843 2012-12-06 Alan Modra <amodra@gmail.com>
3844
3845 * options.h (General_options): Add plt_align, plt_static_chain,
3846 plt_thread_safe. Update stub_group_size help text.
3847 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3848 for new plt_thread_safe_ var.
3849 (use_plt_offset): Correct comments.
3850 (Target_powerpc::do_relax): Look for thread creation symbols to
3851 determine default plt_thread_safe value. Clear plt call stubs
3852 as well as branch stubs each iteration.
3853 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3854 insn constants.
3855 (l, hi, ha, write_insn): Move earlier.
3856 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3857 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3858 plt stubs too.
3859 (Stub_table::update_size): Adjust.
3860 (Stub_table::prev_size, set_prev_size): Delete.
3861 (Stub_table::stub_align): Let --plt-align affect result.
3862 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3863 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3864 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3865 (Stub_table::do_write): Support more stub variants.
3866
3867 2012-12-04 Alan Modra <amodra@gmail.com>
3868
3869 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3870 (Target_powerpc::do_define_standard_symbols): New function.
3871
3872 2012-12-03 Alan Modra <amodra@gmail.com>
3873
3874 * output.h: Formatting, whitespace.
3875
3876 2012-12-03 Alan Modra <amodra@gmail.com>
3877
3878 * layout.h (Layout::get_executable_sections): Declare.
3879 * layout.cc (Layout::get_executable_sections): New function.
3880 * arm.cc (Target_arm::group_sections): Use it.
3881 (Arm_output_section::group_sections): Delete now redundant test.
3882 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3883 param to handle relative relocs.
3884 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3885 (Output_data_reloc::add_absolute): Adjust.
3886 (Output_data_reloc::add_relative): New function.
3887 (Output_data::reset_data_size): New function.
3888 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3889 (Output_section::set_addralign): New function.
3890 (Output_section::checkpoint_set_addralign): New function.
3891 (Output_section::clear_section_offsets_need_adjustment): New function.
3892 (Output_section::input_sections): Make public.
3893 * powerpc.cc (class Output_data_brlt_powerpc): New.
3894 (class Stub_table, class Stub_control): New.
3895 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3896 stub_table_, set_stub_table, stub_table): New vectors and accessor
3897 functions.
3898 (Target_powerpc::do_may_relax, do_relax, push_branch,
3899 new_stub_table, stub_tables, brlt_section, group_sections,
3900 add_branch_lookup_table, find_branch_lookup_table,
3901 write_branch_lookup_table, make_brlt_section): New functions.
3902 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3903 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3904 branch_info_): New vars.
3905 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3906 make call stubs here.
3907 (Output_data_glink): Remove all call stub handling from this class.
3908 (Target_powerpc::Scan::local, global): Save interesting branch
3909 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3910 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3911 functions on final link.
3912 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3913 Handle long branch destinations too.
3914 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3915 do_plt_address_for_local): Adjust lookup of plt call stubs.
3916
3917 2012-11-30 Alan Modra <amodra@gmail.com>
3918
3919 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3920 relocs against protected symbols when building 32-bit shared libs.
3921
3922 2012-11-30 Alan Modra <amodra@gmail.com>
3923
3924 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3925 param. Call got_section() to make .got. Update all callers
3926 and their callers and so on.
3927
3928 2012-11-30 Alan Modra <amodra@gmail.com>
3929
3930 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3931 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3932 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3933 value if it already exists.
3934
3935 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3936
3937 PR gold/14858
3938 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3939
3940 2012-11-14 Roland McGrath <mcgrathr@google.com>
3941
3942 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3943 than bfc instruction for data sandboxing.
3944
3945 2012-11-08 Alan Modra <amodra@gmail.com>
3946
3947 * po/POTFILES.in: Regenerate.
3948
3949 2012-11-05 Alan Modra <amodra@gmail.com>
3950
3951 * configure.ac: Apply 2012-09-10 change to config.in here.
3952 * configure: Regenerate.
3953
3954 2012-11-05 Alan Modra <amodra@gmail.com>
3955
3956 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3957 (struct Opd_ent): Use "Address" rather than "Offset".
3958 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3959 (Target_powerpc::got_section): Make public.
3960 (Target_powerpc::scan_relocs): Move code setting symbols..
3961 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3962 Create _SDA_BASE_ only when referenced.
3963
3964 2012-11-02 Roland McGrath <mcgrathr@google.com>
3965
3966 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3967 from last change.
3968
3969 2012-11-01 Roland McGrath <mcgrathr@google.com>
3970
3971 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3972 for offset_in_output_section parameter.
3973 (Sized_target::relocate_special_relocatable): Likewise.
3974 * arm.cc (Target_arm::relocate_relocs): Likewise.
3975 (Target_arm::relocate_special_relocatable): Likewise.
3976 * i386.cc (Target_i386::relocate_relocs): Likewise.
3977 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3978 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3979 * target-reloc.h (relocate_relocs): Likewise.
3980 * testsuite/testfile.cc (Target_test): Likewise.
3981 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3982 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3983
3984 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3985 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3986
3987 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3988 parameter, which is unused in the [!F_SETFD] case.
3989
3990 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3991 SYMNDX to off_t before comparing it to this->data_size().
3992 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3993 * incremental.cc (Output_section_incremental_inputs::do_write):
3994 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3995
3996 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3997
3998 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3999
4000 * gold.cc (Target_arm::do_adjust_elf_header): Add the
4001 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
4002 in EABI_VER5.
4003
4004 2012-10-29 Cary Coutant <ccoutant@google.com>
4005
4006 * dwp.cc (usage): Add file and exit status parameters;
4007 add --help and --version options.
4008 (print_version): New function.
4009 (main): Add --help and --version options.
4010
4011 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4012
4013 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
4014 final_layout_sequence.txt.
4015 * testsuite/Makefile.in: Regenerated.
4016
4017 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4018
4019 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
4020 COMPILE generated by automake.
4021 (LINK1): Likewise.
4022 (CXXCOMPILE1): Likewise.
4023 (CXXLINK1): Likewise.
4024 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
4025 (LINK): Likewise.
4026 (CXXCOMPILE): Likewise.
4027 (CXXLINK): Likewise.
4028 * testsuite/Makefile.in: Regenerated.
4029
4030 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4031
4032 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
4033 on bad fwrite return.
4034
4035 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
4036
4037 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
4038 on val.
4039
4040 2012-10-23 Cary Coutant <ccoutant@google.com>
4041
4042 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
4043 * testsuite/Makefile.in: Regenerate.
4044 * testsuite/dwp_test.h: New source file.
4045 * testsuite/dwp_test_1.cc: New source file.
4046 * testsuite/dwp_test_1.s: New source file.
4047 * testsuite/dwp_test_1.sh: New source file.
4048 * testsuite/dwp_test_1b.cc: New source file.
4049 * testsuite/dwp_test_1b.s: New source file.
4050 * testsuite/dwp_test_2.cc: New source file.
4051 * testsuite/dwp_test_2.s: New source file.
4052 * testsuite/dwp_test_2.sh: New source file.
4053 * testsuite/dwp_test_main.cc: New source file.
4054 * testsuite/dwp_test_main.s: New source file.
4055
4056 2012-10-23 Cary Coutant <ccoutant@google.com>
4057
4058 * dwp.h: New header file.
4059 * dwp.cc: New source file.
4060 * gold.h: Move shared declarations to system.h.
4061 * system.h: New header file.
4062 * Makefile.am: Add dwp.
4063 * Makefile.in: Regenerate.
4064
4065 2012-10-23 Cary Coutant <ccoutant@google.com>
4066
4067 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
4068 Dwarf_info_reader::read_from_pointer.
4069 (Dwarf_pubnames_table::read_header): Likewise.
4070 (Dwarf_pubnames_table::next_name): Likewise.
4071 (Dwarf_die::read_attributes): Likewise.
4072 (Dwarf_die::skip_attributes): Likewise.
4073 (Dwarf_info_reader::read_from_pointer): New function template.
4074 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
4075 (Dwarf_pubnames_table): Likewise.
4076 (Dwarf_info_reader::read_from_pointer): New function template.
4077 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
4078 Dwarf_pubnames_table ctor.
4079
4080 2012-10-23 Cary Coutant <ccoutant@google.com>
4081
4082 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
4083 abbrev_shndx.
4084 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
4085 abbrev_shndx_.
4086 (Dwarf_info_reader::set_abbrev_shndx): New method.
4087 (Dwarf_info_reader::abbrev_shndx_): New data member.
4088
4089 2012-10-23 Cary Coutant <ccoutant@google.com>
4090
4091 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
4092 from object, not parameters.
4093 (Dwarf_info_reader::parse): Likewise.
4094 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
4095 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
4096 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
4097 methods.
4098
4099 2012-10-23 Cary Coutant <ccoutant@google.com>
4100
4101 * fileread.cc (Input_file::Input_file): New constructor.
4102 * fileread.h (class Input_file): Add new constructor.
4103
4104 2012-10-18 Alan Modra <amodra@gmail.com>
4105
4106 PR gold/14727
4107 * object.cc (Relobj::is_section_name_included): Also match
4108 .sdata personality section.
4109
4110 2012-10-18 Alan Modra <amodra@gmail.com>
4111
4112 * target-reloc.h (class Default_comdat_behavior): New, package up..
4113 (get_comdat_behaviour): ..this.
4114 (relocate_section): Add Relocate_comdat_behavior template arg,
4115 adjust code to suit.
4116 * arm.cc (Target_arm::relocate_section): Adjust to suit.
4117 (Target_arm::scan_reloc_section): Likewise.
4118 * i386.cc (Target_i386::relocate_section): Likewise.
4119 * sparc.cc (Target_sparc::relocate_section): Likewise.
4120 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
4121 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
4122 * powerpc.cc (class Relocate_comdat_behavior): New.
4123 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
4124 gold::relocate_section with new template arg.
4125
4126 2012-10-18 Alan Modra <amodra@gmail.com>
4127
4128 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
4129 dynamic relocs for GOT_TPREL got entries, without symbol if
4130 resolving locally.
4131 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
4132 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
4133 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
4134
4135 2012-10-17 Alan Modra <amodra@gmail.com>
4136
4137 PR gold/14726
4138 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
4139
4140 2012-10-16 Sriraman Tallam <tmsriram@google.com>
4141
4142 * layout.cc (Layout::include_section): Keep sections marked
4143 SHF_EXCLUDE when doing relocatable links.
4144
4145 2012-10-16 Alan Modra <amodra@gmail.com>
4146
4147 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
4148 (Target_powerpc::do_finalize_sections): Call it.
4149 (Output_data_save_res): New class and supporting functions.
4150 (Target_powerpc::symval_for_branch): Only look up .opd entry for
4151 normal symbols defined in object files.
4152
4153 2012-10-12 Alan Modra <amodra@gmail.com>
4154
4155 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
4156 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
4157 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
4158 section if scan_opd_relocs not yet called.
4159 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
4160
4161 2012-10-12 Alan Modra <amodra@gmail.com>
4162
4163 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4164 add_local_ifunc_entry): Revert last change.
4165 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
4166
4167 2012-10-05 Alan Modra <amodra@gmail.com>
4168
4169 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4170 do_plt_address_for_global): New functions.
4171 (Output_data_got_powerpc::do_write): Don't segfault when linking
4172 statically.
4173 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
4174 add_local_ifunc_entry): Return true on adding entry..
4175 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
4176 glink->add_entry call. Remove unused symtab param. Adjust calls.
4177 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
4178 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
4179 set up symbols here.
4180 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
4181 syms here. Do so even when no .iplt. Don't segfault when linking
4182 statically.
4183 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
4184 new variants without reloc param.
4185 (Glink_sym_ent::Glink_sym_ent): Likewise.
4186 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4187 reloc when refs will resolve to plt call stub.
4188 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4189 R_PPC_PLTREL24 to resolve locally.
4190 (Target_powerpc::Scan::global): Correct ifunc handling.
4191 (Target_powerpc::Relocate::relocate): Correct local sym glink
4192 lookup. Don't destroy "value" when we have a plt call stub,
4193 and when checking plt call validity.
4194 (Target_powerpc::do_dynsym_value): Simplify.
4195
4196 2012-10-05 Alan Modra <amodra@gmail.com>
4197
4198 * i386.cc (Output_data_plt_i386::address_for_global,
4199 address_for_local): Add plt offset to returned value. Adjust uses.
4200 * sparc.cc (Output_data_plt_sparc::address_for_global,
4201 address_for_local): Likewise.
4202 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4203 address_for_local): Likewise.
4204 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4205 address_for_local): Likewise.
4206 * target.h (Target::plt_address_for_global, plt_address_for_local):
4207 Update comment.
4208 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4209 (Output_data_got::Got_entry::write): Nor here.
4210 * output.h: Comment fix.
4211
4212 2012-10-02 Jiong Wang <jiwang@tilera.com>
4213
4214 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4215 global_offset_table_ value for larget got.
4216 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4217
4218 2012-09-29 Alan Modra <amodra@gmail.com>
4219
4220 * powerpc.cc (Target_powerpc::iplt_): New output section.
4221 (Target_powerpc::iplt_section, make_iplt_section,
4222 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4223 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4224 Target_powerpc::plt_entry_count): Count iplt entries too.
4225 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4226 reloc section in constructor. New params.
4227 (Target_powerpc::make_plt_section): Create reloc section here instead.
4228 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4229 functions.
4230 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4231 (Output_data_glink::add_entry, find_entry): New functions to
4232 deal with local syms.
4233 (Glink_sym_ent): Add support for local syms.
4234 (Output_data_glink::do_write): Handle ifunc plt entries.
4235 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4236 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4237 (Target_powerpc::Relocate::relocate): Likewise.
4238 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4239
4240 2012-09-25 Alan Modra <amodra@gmail.com>
4241
4242 * object.h (Sized_relobj_file::adjust_local_symbol,
4243 do_adjust_local_symbol): New functions.
4244 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4245 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4246 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4247 and irregular opd entry spacing.
4248 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4249 (Global_symbol_visitor_opd): New functor.
4250 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4251 on deleted opd entries.
4252
4253 2012-09-15 Jiong Wang <jiwang@tilera.com>
4254
4255 * tilegx.cc: New file.
4256 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4257 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4258 * configure.tgt: Add entries for tilegx*.
4259 * configure.ac: Likewise.
4260 * Makefile.in: Rebuild.
4261 * configure: Likewise.
4262 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4263 tilegx.
4264
4265 2012-09-13 Alan Modra <amodra@gmail.com>
4266
4267 * target-reloc.h (scan_relocs): Call scan.local for relocs
4268 against symbols in discarded sections. Pass is_discarded
4269 param.
4270 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4271 Add is_discarded param.
4272 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4273 is_discarded to flag opd entry as discarded. Don't emit dyn
4274 relocs on such entries.
4275 (Target_powerpc::Scan::global): Similarly detect and handle
4276 such opd entries.
4277 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4278 opd_ent_. Update all uses.
4279 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4280 (Target_powerpc::relocate_section): Zero out discarded opd
4281 entry relocs.
4282
4283 2012-09-12 Ian Lance Taylor <iant@google.com>
4284
4285 PR gold/14570
4286 * output.cc: Rename Output_data_got template parameter from size
4287 to got_size for all functions. Compile all variants of
4288 Output_data_got.
4289 (Output_data_got::Got_entry::write): Correct use of size for
4290 symbol value. Use local_is_tls rather than casting to
4291 Sized_relobj_file.
4292 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4293 (class Sized_relobj_file): Add do_local_is_tls.
4294 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4295
4296 2012-09-11 Alan Modra <amodra@gmail.com>
4297
4298 PR gold/14566
4299 * layout.cc (Layout::set_segment_offsets): When using
4300 common-page-size alignment, ensure we are on a new max-page-size
4301 page.
4302 * output.cc (Output_segment::set_section_addresses): Use
4303 abi_pagesize, not common_pagesize for relro boundary.
4304 (Output_segment::set_offset): Likewise.
4305
4306 2012-09-11 Alan Modra <amodra@gmail.com>
4307
4308 * output.h (Output_data_got::add_global_tls, add_local_tls,
4309 add_local_tls_pair): New functions.
4310 (Output_data_got::add_local_pair_with_rel): Remove second
4311 reloc param. Expand comment.
4312 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4313 use_plt_or_tls_offset_, similarly for constructor param.
4314 (Output_data_got::Got_entry::write): Add got_index param.
4315 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4316 add_local_tls_pair): New functions.
4317 (Output_data_got::Got_entry::write): Handle tls symbols
4318 with use_plt_or_tls_offset_ set specially.
4319 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4320 (Output_data_got::do_write): Replace iterator with index, pass
4321 index to entry write function.
4322 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4323 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4324 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4325 call.
4326 * i386.cc (Target_i386::Scan::local): Likewise.
4327 * sparc.cc (Target_sparc::Scan::local): Likewise.
4328 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4329 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4330 do_tls_offset_for_global): New functions.
4331 (Target_powerpc::Scan::local): Correct TLS relocations and got
4332 entry values.
4333 (Target_powerpc::Scan::global): Don't emit unnecessary
4334 dynamic relocations on TLS GOT entries.
4335
4336 2012-09-10 Matthias Klose <doko@ubuntu.com>
4337
4338 * config.in: Disable sanity check for kfreebsd.
4339
4340 2012-09-10 Sterling Augustine <saugustine@google.com>
4341
4342 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4343 (Gdb_index::pubtypes_read): New parameter.
4344 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4345 to calls.
4346 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4347 pubtypes_object_.
4348
4349 2012-09-09 Alan Modra <amodra@gmail.com>
4350
4351 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4352 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4353 * gc.h (gc_process_relocs): Call target gc_add_reference.
4354 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4355 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4356 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4357 unnecessary cast.
4358 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4359 to cater for when we don't need code offset. Update use.
4360 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4361 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4362 set_opd_valid): New functions.
4363 (Target_powerpc::do_gc_add_reference): New function.
4364 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4365 stashed refs.
4366 (Target_powerpc::do_gc_mark_symbol): New function.
4367
4368 2012-09-06 Cary Coutant <ccoutant@google.com>
4369
4370 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4371 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4372 (Dwarf_die::skip_attributes): Likewise.
4373 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4374 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4375 (main): Call it.
4376 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4377
4378 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4379
4380 * testsuite/script_test_3.t: Add .got.plt output section
4381 statement.
4382 * testsuite/script_test_4.t: Likewise.
4383
4384 2012-09-05 Alan Modra <amodra@gmail.com>
4385
4386 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4387 update all uses and lose "enum" when using type.
4388
4389 2012-09-05 Alan Modra <amodra@gmail.com>
4390
4391 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4392 * configure: Regenerate.
4393 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4394 (plugin_final_layout.stdout): Likewise.
4395 (memory_test): Set page sizes to 0x1000.
4396 * testsuite/Makefile.in: Regenerate.
4397 * testsuite/discard_locals_test.sh: Add FIXME comment.
4398 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4399 * testsuite/pr14265.t: Add .got output section statement.
4400 * testsuite/script_test_2.t: Likewise.
4401 * testsuite/script_test_3.t: Likewise.
4402 * testsuite/script_test_4.t: Likewise.
4403 * testsuite/script_test_5.t: Likewise.
4404 * testsuite/script_test_6.t: Likewise.
4405 * testsuite/script_test_7.t: Likewise.
4406 * testsuite/script_test_9.t: Likewise.
4407
4408 2012-09-05 Alan Modra <amodra@gmail.com>
4409
4410 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4411 (Powerpc_relocate_functions::Status): New typedef.
4412 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4413 (Target_powerpc::Scan::local): Handle REL64.
4414 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4415 for REL32 and REL64.
4416 (Target_powerpc::symval_for_branch): New function, extracted from..
4417 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4418 checks. Report overflow errors.
4419
4420 2012-09-05 Alan Modra <amodra@gmail.com>
4421
4422 * object.h (Sized_relobj_file::emit_relocs): Delete.
4423 (Sized_relobj_file::emit_relocs_reltype): Delete.
4424 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4425 relocate_relocs for --emit-relocs.
4426 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4427 * output.h: Update comment.
4428 (Output_segment::first_section): New function.
4429 (Output_segment::first_section_load_address): Use first_section.
4430 * output.cc (Output_segment::first_section): New function extracted..
4431 (Output_segment::first_section_load_address): ..from here. Delete.
4432 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4433 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4434 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4435 adjust call to target.h function.
4436 * i386.cc (Target_i386): Likewise.
4437 * sparc.cc (Target_sparc): Likewise.
4438 * x86_64.cc (Target_x86_64): Likewise.
4439 * powerpc.cc (Target_powerpc): Likewise.
4440 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4441 first tls section has section symbol for optimised local dynamic
4442 output relocs.
4443 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4444 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4445 optimised tls code.
4446 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4447 Rename to relocate_relocs. Update error message.
4448
4449 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4450
4451 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4452 --just-symbols.
4453
4454 2012-08-31 Alan Modra <amodra@gmail.com>
4455
4456 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4457 (Powerpc_relobj::toc_base_offset): New stub function.
4458 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4459 got_mod_index_offset to tlsld_got_offset. Update all refs.
4460 (Target_powerpc::Relocate::enum skip_tls): New.
4461 (Target_powerpc::call_tls_get_addr_): New var.
4462 (Target_powerpc::is_branch_reloc): Move to file scope.
4463 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4464 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4465 New functions.
4466 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4467 (powerpc_info): Correct common_pagesize for ppc64.
4468 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4469 (Powerpc_relocate_functions): Add overflow check enums and functions.
4470 Add non-shift version of rela, rela_ua. Delete all rel public
4471 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4472 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4473 addr16_ha3, addr14 functions.
4474 (Output_data_got_powerpc::add_constant_pair): New function.
4475 (Output_data_got_powerpc::got_base_offset): Likewise.
4476 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4477 (instruction constants): Sort, add some more.
4478 (Output_data_glink::do_write): Add and use Address typedef. Use
4479 object->toc_base_offset() stub for 64-bit.
4480 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4481 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4482 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4483 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4484 Always treat .opd relocs as against locally defined symbol.
4485 Correct condition for RELATIVE relocs.
4486 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4487 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4488 for 32-bit syms with a plt entry. Correct ppc64 toc base
4489 calculations. Handle TLS relocs, and more. Add overflow
4490 checking and adjust for Powerpc_relocate_functions changes.
4491 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4492 Reinstate --emit-relocs code with FIXME.
4493
4494 2012-08-30 Alan Modra <amodra@gmail.com>
4495
4496 * layout.cc (Layout::set_segment_offsets): Set p_align to
4497 abi_pagesize, not common_pagesize.
4498 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4499 to determine whether file header can go in segment.
4500
4501 2012-08-30 Alan Modra <amodra@gmail.com>
4502
4503 * output.h (Output_reloc::Output_reloc <output section>): Add
4504 is_relative param. Adjust calls.
4505 (Output_reloc::add_output_section_relative): New functions.
4506 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4507 is_relative.
4508 (Output_reloc::symbol_value): Handle SECTION_CODE.
4509
4510 2012-08-24 Sriraman Tallam <tmsriram@google.com>
4511
4512 * gold.cc (queue_middle_tasks): Call layout again when unique
4513 segments for sections is desired.
4514 * layout.cc (Layout::Layout): Initialize new members.
4515 (Layout::get_output_section_flags): New function.
4516 (Layout::choose_output_section): Call get_output_section_flags.
4517 (Layout::layout): Make output section for mapping to a unique segment.
4518 (Layout::insert_section_segment_map): New function.
4519 (Layout::attach_allocated_section_to_segment): Make unique segment for
4520 output sections marked so.
4521 (Layout::segment_precedes): Check for unique segments when sorting.
4522 * layout.h (Layout::Unique_segment_info): New struct.
4523 (Layout::Section_segment_map): New typedef.
4524 (Layout::insert_section_segment_map): New function.
4525 (Layout::get_output_section_flags): New function.
4526 (Layout::is_unique_segment_for_sections_specified): New function.
4527 (Layout::set_unique_segment_for_sections_specified): New function.
4528 (Layout::unique_segment_for_sections_specified_): New member.
4529 (Layout::section_segment_map_): New member.
4530 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4531 Rename is_gc_pass_one to is_pass_one.
4532 Rename is_gc_pass_two to is_pass_two.
4533 Rename is_gc_or_icf to is_two_pass.
4534 Check for which pass based on whether symbols data is present.
4535 Make it two pass when unique segments for sections is desired.
4536 * output.cc (Output_section::Output_section): Initialize new
4537 members.
4538 * output.h (Output_section::is_unique_segment): New function.
4539 (Output_section::set_is_unique_segment): New function.
4540 (Output_section::is_unique_segment_): New member.
4541 (Output_section::extra_segment_flags): New function.
4542 (Output_section::set_extra_segment_flags): New function.
4543 (Output_section::extra_segment_flags_): New member.
4544 (Output_section::segment_alignment): New function.
4545 (Output_section::set_segment_alignment): New function.
4546 (Output_section::segment_alignment_): New member.
4547 (Output_segment::Output_segment): Initialize is_unique_segment_.
4548 (Output_segment::is_unique_segment): New function.
4549 (Output_segment::set_is_unique_segment): New function.
4550 (Output_segment::is_unique_segment_): New member.
4551 * plugin.cc (allow_unique_segment_for_sections): New function.
4552 (unique_segment_for_sections): New function.
4553 (Plugin::load): Add new functions to transfer vector.
4554 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4555 * Makefile.in: Regenerate.
4556 * testsuite/plugin_final_layout.sh: Check if unique segment
4557 functionality works.
4558 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4559 are available.
4560 (allow_unique_segment_for_sections): New global.
4561 (unique_segment_for_sections): New global.
4562 (claim_file_hook): Call allow_unique_segment_for_sections.
4563 (all_symbols_read_hook): Call unique_segment_for_sections.
4564
4565 2012-08-22 Cary Coutant <ccoutant@google.com>
4566
4567 * layout.cc (Layout::include_section): Don't assert on GROUP
4568 sections with --emit-relocs.
4569
4570 2012-08-21 Cary Coutant <ccoutant@google.com>
4571
4572 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4573 if --export-dynamic-symbol names an undef symbol.
4574
4575 2012-08-18 Alan Modra <amodra@gmail.com>
4576
4577 * powerpc.cc: Formatting and white space.
4578 (Powerpc_relobj): Rename got2_section_ to special_.
4579 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4580 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4581 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4582 (Target_powerpc): Add Address typedef and invalid_address. Use
4583 throughout.
4584 (Target_powerpc::is_branch_reloc): New function.
4585 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4586 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4587 for dst_mask, value and addend.
4588 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4589 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4590 (Output_data_glink::do_write): Correct toc base. Don't try to use
4591 uint16_t for 24-bit offset. Use get_output_section_offset and
4592 check return.
4593 (Target_powerpc::Scan::local): Handle more relocs.
4594 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4595 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4596 Plug in toc restoring insn after plt calls. Translate branches
4597 to function descriptor symbols to corresponding entry point.
4598 (Target_powerpc::relocate_for_relocatable): Check return from
4599 get_output_section_offset.
4600 * symtab.h: Comment typo.
4601
4602 2012-08-14 Ian Lance Taylor <iant@google.com>
4603
4604 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4605 unsupported_relocal_local to call unsupported_reloc_global.
4606
4607 2012-08-14 Nick Clifton <nickc@redhat.com>
4608
4609 PR ld/14265
4610 * script-sections.cc (Sections_element::output_section_name): Add
4611 keep return parameter.
4612 (Output_section_element::match_name): Add keep return parameter.
4613 Return the value of the keep_ member.
4614 * script-sections.h (class Output_section): Update
4615 output_section_name prototype.
4616 * layout.cc (Layout::keep_input_section): New public member
4617 function.
4618 (Layout::choose_output_section): Pass keep parameter to
4619 output_section_name.
4620 * layout.h (class Layout): Add keep_input_section.
4621 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4622 sections.
4623 * testsuite/Makefile.am: Add a test.
4624 * testsuite/Makefile.in: Regenerate.
4625 * testsuite/pr14265.c: Source file for the test.
4626 * testsuite/pr14265.t: Linker script for the test.
4627 * testsuite/pr14265.sh: Shell script for the test.
4628
4629 2012-08-14 Alan Modra <amodra@gmail.com>
4630
4631 * target.h (Target::output_section_name): New function.
4632 (Target::do_output_section_name): New function.
4633 * layout.cc (Layout::choose_output_section): Call the above.
4634 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4635
4636 2012-08-14 Alan Modra <amodra@gmail.com>
4637
4638 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4639 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4640 for replace_constant call.
4641 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4642 (Output_data_glink::do_print_to_mapfile): New function.
4643 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4644 (Target_powerpc::Relocate::relocate): Likewise.
4645
4646 2012-08-14 Alan Modra <amodra@gmail.com>
4647
4648 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4649 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4650 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4651 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4652 all references to shndx_. Handle special case for R_PPC_PLTREL24
4653 here.
4654 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4655 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4656 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4657 here.
4658 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4659 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4660
4661 2012-08-12 Alan Modra <amodra@gmail.com>
4662
4663 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4664 (glink insn constants): Use uint32_t.
4665 (Output_data_glink::add_entry): Use insert, not [] operator.
4666
4667 2012-08-11 Alan Modra <amodra@gmail.com>
4668
4669 * object.h (Sized_relobj_file::find_shdr): New function.
4670 (Sized_relobj_file::find_special_sections): New function.
4671 * object.cc (Sized_relobj_file::find_shdr): New function.
4672 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4673 (Sized_relobj_file::find_special_sections): New function, split out..
4674 (Sized_relobj_file::do_read_symbols): ..from here.
4675 * output.h (Output_data_got::replace_constant): New function.
4676 (Output_data_got::num_entries): New function.
4677 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4678 (Output_data_got::got_offset): Protected rather than private.
4679 (Output_data_got::replace_got_entry): New function.
4680 * output.cc (Output_data_got::replace_got_entry): New function.
4681 * powerpc.cc (class Powerpc_relobj): New.
4682 (class Powerpc_relocate_functions): Delete all psymval variants or
4683 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4684 Implement _ha functions using corresponding _hi function.
4685 (Powerpc_relobj::find_special_sections): New function.
4686 (Target_powerpc::do_make_elf_object): New function.
4687 (class Output_data_got_powerpc): New.
4688 (class Output_data_glink): New.
4689 (class Powerpc_scan_relocatable_reloc): New.
4690 Many more changes througout file.
4691
4692 2012-08-09 Nick Clifton <nickc@redhat.com>
4693
4694 * po/vi.po: Updated Vietnamese translation.
4695
4696 2012-08-07 Ian Lance Taylor <iant@google.com>
4697
4698 * layout.cc (Layout::add_target_dynamic_tags): If
4699 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4700 plt_rel.
4701
4702 2012-07-30 Nick Clifton <nickc@redhat.com>
4703
4704 * po/gold.pot: Updated template.
4705 * po/es.po: Updated Spanish translation.
4706
4707 2012-07-18 Cary Coutant <ccoutant@google.com>
4708
4709 PR gold/14344
4710 * configure.ac: Add check for -gpubnames support.
4711 * configure: Regenerate.
4712 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4713 support; force -gno-pubnames.
4714 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4715 support.
4716 (gdb_index_test_4): New test.
4717 * testsuite/Makefile.in: Regenerate.
4718 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4719 * testsuite/gdb_index_test_2.sh: Likewise.
4720 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4721 * testsuite/gdb_index_test_4.sh: New script.
4722 * testsuite/gdb_index_test_comm.sh: New script with common code;
4723 don't look for space after colon.
4724
4725 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4726
4727 * gold.cc (queue_middle_tasks): Update function order only after
4728 deferred objects due to plugins are processed.
4729
4730 2012-07-11 Ian Lance Taylor <iant@google.com>
4731
4732 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4733 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4734 (Target_arm::scan_reloc_for_stub): Likewise.
4735 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4736 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4737 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4738 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4739 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4740
4741 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4742 Ian Lance Taylor <iant@google.com>
4743
4744 PR gold/14309
4745 * configure.ac: Test whether std::tr1::hash<off_t> works.
4746 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4747 needed.
4748 * output.h (class Output_fill): Add virtual destructor.
4749 * configure, config.in: Rebuild.
4750
4751 2012-06-22 Roland McGrath <mcgrathr@google.com>
4752
4753 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4754
4755 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4756
4757 * plugin.cc (Plugin::load): Handle position independent executables.
4758
4759 2012-06-06 Cary Coutant <ccoutant@google.com>
4760
4761 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4762 add .debug_macro.
4763 (lines_only_debug_sections): Likewise.
4764 (gdb_fast_lookup_sections): New static array.
4765 (is_gdb_debug_section): Rename formal parameter.
4766 (is_lines_only_debug_section): Likewise.
4767 (is_gdb_fast_lookup_section): New function.
4768 (Layout::include_section): Check for ".zdebug_" prefix; pass
4769 section name suffix to is_gdb_debug_section, et al.; check for
4770 fast-lookup sections when building .gdb_index.
4771 * options.h (--strip-debug-gdb): Update GDB version number.
4772
4773 2012-06-06 Cary Coutant <ccoutant@google.com>
4774
4775 * configure.ac: Add check for fallocate.
4776 * configure: Regenerate.
4777 * config.in: Regenerate.
4778
4779 * options.h (class General_options): Add --mmap-output-file and
4780 --posix-fallocate options.
4781 * output.cc: (posix_fallocate): Remove; replace with...
4782 (gold_fallocate): New function.
4783 (Output_file::map_no_anonymous): Call gold_fallocate.
4784 (Output_file::map): Check --mmap-output-file option.
4785
4786 2012-06-05 Jing Yu <jingyu@google.com>
4787
4788 * gold.h (textdomain): Add do {} to empty while(0).
4789 (bindtextdomain): Likewise.
4790
4791 2012-06-04 Cary Coutant <ccoutant@google.com>
4792
4793 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4794 has_dynsym_index.
4795
4796 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4797
4798 * symtab.cc (Symbol_table::define_special_symbol):
4799 Initialize *poldsym to prevent uninitialized variable errors.
4800
4801 2012-05-23 Cary Coutant <ccoutant@google.com>
4802
4803 * layout.cc (Layout::section_name_mapping): Add rules to handle
4804 exact match on .data.rel.ro.local or .data.rel.ro.
4805 (Layout::output_section_name): Check for exact matches.
4806
4807 2012-05-23 Cary Coutant <ccoutant@google.com>
4808
4809 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4810 more carefully.
4811
4812 2012-05-22 Cary Coutant <ccoutant@google.com>
4813
4814 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4815 object before exporting symbol.
4816
4817 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4818
4819 * testsuite/tls_test.cc: Include "config.h" first.
4820 * testsuite/tls_test_c.c: Likewise.
4821
4822 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4823 Nick Clifton <nickc@redhat.com>
4824
4825 PR 14072
4826 * configure.in: Add check that sysdep.h has been included before
4827 any system header files.
4828 * configure: Regenerate.
4829 * config.in: Regenerate.
4830
4831 2012-05-14 Cary Coutant <ccoutant@google.com>
4832
4833 * layout.cc (Layout::make_output_section): Mark .tdata section
4834 as RELRO.
4835 * testsuite/relro_test.cc: Add a TLS variable.
4836
4837 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4838
4839 PR gold/14091
4840 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4841 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4842 R_X86_64_64.
4843
4844 2012-05-08 Cary Coutant <ccoutant@google.com>
4845
4846 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4847 (lines_only_debug_sections): Likewise.
4848
4849 2012-05-02 Roland McGrath <mcgrathr@google.com>
4850
4851 * nacl.cc: New file.
4852 * nacl.h: New file.
4853 * Makefile.am (CCFILES, HFILES): Add them.
4854 * Makefile.in: Regenerate.
4855 * i386.cc (Output_data_plt_i386_nacl): New class.
4856 (Output_data_plt_i386_nacl_exec): New class.
4857 (Output_data_plt_i386_nacl_dyn): New class.
4858 (Target_i386_nacl): New class.
4859 (Target_selector_i386_nacl): New class.
4860 (target_selector_i386): Use it instead of Target_selector_i386.
4861 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4862 (Target_x86_64_nacl): New class.
4863 (Target_selector_x86_64_nacl): New class.
4864 (target_selector_x86_64, target_selector_x32): Use it instead of
4865 Target_selector_x86_64.
4866 * arm.cc (Output_data_plt_arm_nacl): New class.
4867 (Target_arm_nacl): New class.
4868 (Target_selector_arm_nacl): New class.
4869 (target_selector_arm, target_selector_armbe): Use it instead of
4870 Target_selector_arm.
4871
4872 * target-select.cc (select_target): Take new Input_file* and off_t
4873 arguments, pass them on to recognize method of selector.
4874 * object.cc (make_elf_sized_object): Update caller.
4875 * parameters.cc (parameters_force_valid_target): Likewise.
4876 * incremental.cc (make_sized_incremental_binary): Likewise.
4877 * target-select.h: Update decl.
4878 (Target_selector::recognize): Take new Input_file* argument,
4879 pass it on to do_recognize.
4880 (Target_selector::do_recognize): Take new Input_file* argument.
4881 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4882 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4883 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4884 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4885
4886 * target.h (Target::Target_info): New members isolate_execinstr
4887 and rosegment_gap.
4888 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4889 * arm.cc (Target_arm::arm_info): Update initializer.
4890 * i386.cc (Target_i386::i386_info): Likewise.
4891 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4892 * sparc.cc (Target_sparc::sparc_info): Likewise.
4893 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4894 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4895 * layout.cc (Layout::attach_allocated_section_to_segment):
4896 Take new const Target* argument. If target->isolate_execinstr(), act
4897 like --rosegment.
4898 (Layout::find_first_load_seg): Take new const Target* argument;
4899 if target->isolate_execinstr(), reject PF_X segments.
4900 (Layout::relaxation_loop_body): Update caller.
4901 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4902 reset file offset to zero when we hit LOAD_SEG, and then do a second
4903 loop over the segments before LOAD_SEG to reassign offsets after
4904 addresses have been determined. Handle target->rosegment_gap().
4905 (Layout::attach_section_to_segment): Take new const Target* argument;
4906 pass it to attach_allocated_section_to_segment.
4907 (Layout::make_output_section): Update caller.
4908 (Layout::attach_sections_to_segments): Take new const Target* argument;
4909 pass it to attach_section_to_segment.
4910 * gold.cc (queue_middle_tasks): Update caller.
4911 * layout.h (Layout): Update method decls with new arguments.
4912
4913 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4914 Target_info pointer to use.
4915 (Target_arm::do_make_data_plt): New virtual method.
4916 (Target_arm::make_data_plt): New method that calls it.
4917 (Target_arm::make_plt_entry): Use it.
4918 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4919 for the section alignment.
4920 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4921 method.
4922 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4923 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4924 method.
4925 (Output_data_plt_arm::get_plt_entry_size): Call it.
4926 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4927 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4928 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4929 method.
4930 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4931 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4932 method instead of sizeof(plt_entry).
4933 (Output_data_plt_arm::add_entry): Likewise.
4934 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4935 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4936 than static method.
4937 (Target_arm::plt_entry_size): Likewise.
4938 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4939 Move to ...
4940 (Output_data_plt_arm_standard): ... here, new class.
4941 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4942 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4943 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4944
4945 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4946 Take additional argument for the PLT entry size.
4947 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4948 Use get_plt_entry_size method rather than plt_entry_size variable.
4949 (Output_data_plt_x86_64::reserve_slot): Likewise.
4950 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4951 (Output_data_plt_x86_64::add_entry): Likewise.
4952 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4953 (Output_data_plt_x86_64::address_for_global): Likewise.
4954 (Output_data_plt_x86_64::address_for_local): Likewise.
4955 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4956 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4957 Make method non-static.
4958 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4959 method.
4960 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4961 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4962 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4963 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4964 virtual method.
4965 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4966 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4967 virtual method.
4968 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4969 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4970 virtual method.
4971 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4972 (Output_data_plt_x86_64::plt_entry_size)
4973 (Output_data_plt_x86_64::first_plt_entry)
4974 (Output_data_plt_x86_64::plt_entry)
4975 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4976 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4977 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4978 (Output_data_plt_x86_64_standard): ... here, new class.
4979 (Target_x86_64::Target_x86_64): Take optional argument for the
4980 Target_info pointer to use.
4981 (Target_x86_64::do_make_data_plt): New virtual method.
4982 (Target_x86_64::make_data_plt): New method to call it.
4983 (Target_x86_64::init_got_plt_for_update): Use that.
4984 Call this->plt_->add_eh_frame method here.
4985 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4986 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4987 rather than static method.
4988 (Target_x86_64::plt_entry_size): Likewise.
4989 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4990 rather than plt_entry_size variable. Move guts of PLT filling to...
4991 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4992 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4993 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4994
4995 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4996 additional argument for the section alignment.
4997 Don't do add_eh_frame_for_plt here.
4998 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4999 non-static. Use get_plt_entry_size method rather than plt_entry_size
5000 variable.
5001 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
5002 method.
5003 (Output_data_plt_i386::get_plt_entry_size): Call it.
5004 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
5005 (Output_data_plt_i386::add_eh_frame): New method to call it.
5006 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
5007 method.
5008 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
5009 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
5010 method.
5011 (Output_data_plt_i386::fill_plt_entry): New method to call it.
5012 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
5013 method instead of plt_entry_size.
5014 (Output_data_plt_i386::plt_entry_size)
5015 (Output_data_plt_i386::plt_eh_frame_fde_size)
5016 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
5017 (Output_data_plt_i386_standard): ... here, new class.
5018 (Output_data_plt_i386_exec): New class.
5019 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
5020 (Output_data_plt_i386_exec::first_plt_entry): ... here.
5021 (Output_data_plt_i386::exec_plt_entry): Move to ...
5022 (Output_data_plt_i386_exec::plt_entry): ... here.
5023 (Output_data_plt_i386_dyn): New class.
5024 (Output_data_plt_i386::first_plt_entry): Move to ...
5025 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
5026 (Output_data_plt_i386::dyn_plt_entry): Move to ...
5027 (Output_data_plt_i386_dyn::plt_entry): ... here.
5028 (Target_i386::Target_i386): Take optional argument for the Target_info
5029 pointer to use.
5030 (Target_i386::do_make_data_plt): New virtual method.
5031 (Target_i386::make_data_plt): New method to call it.
5032 (Target_i386::make_plt_section): Use that.
5033 Call this->plt_->add_eh_frame method here.
5034 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
5035 rather than plt_entry_size variable.
5036 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
5037 (Output_data_plt_i386::address_for_local): Likewise.
5038 (Output_data_plt_i386::do_write): Likewise.
5039 Move guts of PLT filling to...
5040 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
5041 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
5042 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
5043 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
5044
5045 2012-05-01 Cary Coutant <ccoutant@google.com>
5046
5047 * dwarf_reader.cc (Dwarf_die::read_attributes)
5048 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
5049 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
5050 * reduced_debug_output.cc
5051 (Output_reduced_debug_info_section::get_die_end): Remove
5052 DW_FORM_GNU_ref_index. Add default case.
5053
5054 2012-04-26 Mark Wielaard <mjw@redhat.com>
5055
5056 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
5057 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
5058 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
5059 DW_AT_high_pc as offset from DW_AT_low_pc.
5060
5061 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
5062 * testsuite/Makefile.in: Regenerate.
5063 * testsuite/gdb_index_test_3.c: New test source file.
5064 * testsuite/gdb_index_test_3.sh: New test source file.
5065
5066 2012-04-25 Ian Lance Taylor <iant@google.com>
5067
5068 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
5069 pointer.
5070 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
5071 as a class, not a struct.
5072 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
5073 (Target_arm::apply_cortex_a8_workaround): Likewise.
5074 * gc.h: Declare Reloc_types as a struct, not a class.
5075 * object.h: Declare Symbols_data as a struct.
5076 * reloc.h: Declare Read_relocs_data as a struct.
5077 * target.h: Declare Relocate_info as a struct.
5078
5079 2012-04-24 David S. Miller <davem@davemloft.net>
5080
5081 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
5082 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
5083 and R_SPARC_WPLT30.
5084
5085 2012-04-24 Cary Coutant <ccoutant@google.com>
5086
5087 * incremental-dump.cc (find_input_containing_global): Replace
5088 magic number with symbolic constant.
5089 (dump_incremental_inputs): Update version number.
5090 * incremental.cc (Output_section_incremental_inputs): Update version
5091 number; import symbolic constants from Incremental_inputs_reader.
5092 (Incremental_inputs::create_data_sections): Align relocations
5093 section correctly for 64-bit targets.
5094 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
5095 constants; add padding.
5096 (Output_section_incremental_inputs::write_header): Add assert for
5097 header_size.
5098 (Output_section_incremental_inputs::write_input_files): Add assert
5099 for input_entry_size.
5100 (Output_section_incremental_inputs::write_info_blocks): Add padding;
5101 add assert for object_info_size, input_section_entry_size,
5102 global_sym_entry_size.
5103 * incremental.h (Incremental_inputs_reader): Add symbolic constants
5104 for data structure sizes; use them.
5105 (Incremental_input_entry_reader): Import symbolic constants from
5106 Incremental_inputs_reader; use them.
5107
5108 2012-04-23 David S. Miller <davem@davemloft.net>
5109
5110 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
5111 and elf_flags_set_.
5112 (Target_sparc::Target_sparc): Initialize new fields.
5113 (Target_sparc::do_make_elf_object): New function.
5114 (Target_sparc::do_adjust_elf_header): New function.
5115
5116 2012-04-23 Cary Coutant <ccoutant@google.com>
5117
5118 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
5119 CU range table of gdb index.
5120
5121 2012-04-20 David S. Miller <davem@davemloft.net>
5122
5123 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
5124 instead of false.
5125
5126 2012-04-16 David S. Miller <davem@davemloft.net>
5127
5128 * sparc.cc (Target_sparc::got_address): New function.
5129 (Sparc_relocate_functions::gdop_hix22): New function.
5130 (Sparc_relocate_functions::gdop_lox10): New function.
5131 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
5132 relocs.
5133 (Target_sparc::Scan::local): Likewise if the global symbol is not
5134 preemptible and is not IFUNC.
5135 (Target_sparc::Relocate::relocate): Perform GOTDATA code
5136 transformations for local and non-preemptible non-IFUNC global
5137 symbols.
5138
5139 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
5140 writing out 64-bit part of ranges.
5141
5142 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
5143 -fpic and -fpie respectively.
5144 * Makefile.in: Regenerate.
5145
5146 * sparc.cc (class Target_sparc): Add rela_ifunc_.
5147 (Target_sparc::Target_sparc): Initialize new field.
5148 (Target_sparc::do_plt_section_for_global): New function.
5149 (Target_sparc::do_plt_section_for_local): New function.
5150 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
5151 (Target_sparc::make_plt_section): New function, broken out of
5152 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
5153 (Target_sparc::make_plt_entry): Call make_plt_section.
5154 (Target_sparc::make_local_ifunc_plt_entry): New function.
5155 (Target_sparc::rela_ifunc_section): New function.
5156 (Target_sparc::plt_section): Remove const.
5157 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
5158 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
5159 and ifunc_count_ fields.
5160 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
5161 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
5162 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
5163 (Output_data_plt_sparc::rela_ifunc): New function.
5164 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
5165 (Output_data_plt_sparc::has_ifunc_section): New function.
5166 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
5167 (Output_data_plt_sparc::address_for_global): New function.
5168 (Output_data_plt_sparc::address_for_local): New function.
5169 (Output_data_plt_sparc::plt_index_to_offset): New function.
5170 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
5171 and entry_count.
5172 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
5173 entry_count.
5174 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
5175 R_SPARC_JMP_IREL to switch.
5176 (Target_sparc::Scan::check_non_pic): Likewise.
5177 (Target_sparc::Scan::local): Handle IFUNC symbols.
5178 (Target_sparc::Scan::local): Likewise.
5179 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
5180 and plt_address_for_local.
5181 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
5182 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
5183
5184 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5185 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5186 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5187 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5188 global relocs too.
5189 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5190 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5191 calls.
5192 * sparc.cc (Target_sparc::Scan::global): Likewise.
5193 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5194
5195 2012-04-16 Cary Coutant <ccoutant@google.com>
5196
5197 * archive.cc (Library_base::should_include_member): Check for
5198 --export-dynamic-symbol.
5199 * options.h (class General_options): Add --export-dynamic-symbol.
5200 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5201 --export-dynamic-symbol.
5202 (Symbol_table::gc_mark_undef_symbols): Likewise.
5203 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5204
5205 2012-04-12 David S. Miller <davem@davemloft.net>
5206
5207 * sparc.cc (Reloc::wdisp10): New relocation method.
5208 (Reloc::h34): Likewise.
5209 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5210 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5211 R_SPARC_WDISP10.
5212 (Target_sparc::Scan::local): Likewise.
5213 (Target_sparc::Scan::global): Likewise.
5214 (Target_sparc::Relocate::relocate): Likewise.
5215
5216 2012-04-09 Cary Coutant <ccoutant@google.com>
5217
5218 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5219 low_pc == 0.
5220
5221 2012-04-06 Ian Lance Taylor <iant@google.com>
5222
5223 * timer.cc: #include <unistd.h>.
5224
5225 2012-04-06 Roland McGrath <mcgrathr@google.com>
5226
5227 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5228 * config.in: Regenerate.
5229 * configure: Regenerate.
5230
5231 2012-04-05 Nick Clifton <nickc@redhat.com>
5232
5233 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5234 (AM_LC_MESSAGES): Add.
5235 * aclocal.m4: Regenerate.
5236 * config.in: Regenerate.
5237 * configure: Regenerate.
5238
5239 2012-03-21 Cary Coutant <ccoutant@google.com>
5240
5241 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5242 * Makefile.in: Regenerate.
5243 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5244 (Sized_elf_reloc_mapper::symbol_section): New function.
5245 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5246 (make_elf_reloc_mapper): New function.
5247 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5248 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5249 (Dwarf_abbrev_table::do_get_abbrev): New function.
5250 (Dwarf_ranges_table::read_ranges_table): New function.
5251 (Dwarf_ranges_table::read_range_list): New function.
5252 (Dwarf_pubnames_table::read_section): New function.
5253 (Dwarf_pubnames_table::read_header): New function.
5254 (Dwarf_pubnames_table::next_name): New function.
5255 (Dwarf_die::Dwarf_die): New function.
5256 (Dwarf_die::read_attributes): New function.
5257 (Dwarf_die::skip_attributes): New function.
5258 (Dwarf_die::set_name): New function.
5259 (Dwarf_die::set_linkage_name): New function.
5260 (Dwarf_die::attribute): New function.
5261 (Dwarf_die::string_attribute): New function.
5262 (Dwarf_die::int_attribute): New function.
5263 (Dwarf_die::uint_attribute): New function.
5264 (Dwarf_die::ref_attribute): New function.
5265 (Dwarf_die::child_offset): New function.
5266 (Dwarf_die::sibling_offset): New function.
5267 (Dwarf_info_reader::check_buffer): New function.
5268 (Dwarf_info_reader::parse): New function.
5269 (Dwarf_info_reader::do_parse): New function.
5270 (Dwarf_info_reader::do_read_string_table): New function.
5271 (Dwarf_info_reader::lookup_reloc): New function.
5272 (Dwarf_info_reader::get_string): New function.
5273 (Dwarf_info_reader::visit_compilation_unit): New function.
5274 (Dwarf_info_reader::visit_type_unit): New function.
5275 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5276 Sized_elf_reloc_mapper.
5277 (Sized_dwarf_line_info::symbol_section): Remove function.
5278 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5279 (Sized_dwarf_line_info::read_line_mappings): Remove object
5280 parameter, adjust callers.
5281 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5282 * dwarf_reader.h: Include <sys/types.h>.
5283 (class Track_relocs): Remove forward declaration.
5284 (class Elf_reloc_mapper): New class.
5285 (class Sized_elf_reloc_mapper): New class.
5286 (class Dwarf_abbrev_table): New class.
5287 (class Dwarf_range_list): New class.
5288 (class Dwarf_ranges_table): New class.
5289 (class Dwarf_pubnames_table): New class.
5290 (class Dwarf_die): New class.
5291 (class Dwarf_info_reader): New class.
5292 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5293 (Sized_dwarf_line_info::symbol_section): Remove member function.
5294 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5295 base class.
5296 * gdb-index.cc: New source file.
5297 * gdb-index.h: New source file.
5298 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5299 and .debug_types sections, call Layout::add_to_gdb_index.
5300 (Sized_relobj_incr::do_section_name): Implement.
5301 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5302 return type; Implement.
5303 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5304 return type.
5305 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5306 parameter list and return type.
5307 (Sized_incr_dynobj::do_section_contents): Likewise.
5308 * layout.cc: Include gdb-index.h.
5309 (Layout::Layout): Initialize gdb_index_data_.
5310 (Layout::init_fixed_output_section): Check for .gdb_index section.
5311 (Layout::add_to_gdb_index): New function. Instantiate.
5312 * layout.h: Add forward declaration for class Gdb_index.
5313 (Layout::add_to_gdb_index): New member function.
5314 (Layout::gdb_index_data_): New data member.
5315 * main.cc: Include gdb-index.h.
5316 (main): Print statistics for gdb index.
5317 * object.cc (Object::section_contents): Move code into
5318 do_section_contents.
5319 (need_decompressed_section): Check for sections needed when building
5320 gdb index.
5321 (build_compressed_section_map): Likewise.
5322 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5323 gdb index.
5324 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5325 sections; call Layout::add_to_gdb_index.
5326 (Sized_relobj_file::do_decompressed_section_contents): Call
5327 do_section_contents directly.
5328 * object.h (Object::do_section_contents): Adjust parameter list and
5329 return type.
5330 (Object::do_decompressed_section_contents): Call do_section_contents
5331 directly.
5332 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5333 return type.
5334 * options.h (class General_options): Add --gdb-index option.
5335 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5336 list and return type.
5337 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5338 * reloc.h (Track_relocs::checkpoint): New function.
5339 (Track_relocs::reset): New function.
5340
5341 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5342 New test cases.
5343 * testsuite/Makefile.in: Regenerate.
5344 * testsuite/gdb_index_test.cc: New test source file.
5345 * testsuite/gdb_index_test_1.sh: New test source file.
5346 * testsuite/gdb_index_test_2.sh: New test source file.
5347
5348 2012-03-19 Doug Kwan <dougkwan@google.com>
5349
5350 * arm.cc (Target_arm::do_define_standard_symbols): New method.
5351 (Target_arm::do_finalize_sections): Remove code which defines
5352 __exidx_start and __exidx_end. Make symbol table parameter
5353 anonymous as it is not used.
5354 * gold.cc (queue_middle_tasks): Call target hook to define any
5355 target-specific symbols.
5356 * target.h (Target::define_standard_symbols): New method.
5357 (Target::do_define_standard_symbols): Same.
5358 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5359 * testsuite/Makefile.in: Regenerate.
5360 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5361 and __exidx_end.
5362 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5363 relocations are generated for __exidx_start and __exidx_end.
5364
5365 2012-03-16 Doug Kwan <dougkwan@google.com>
5366
5367 * testsuite/Makefile.am: Disable test initpri3b.
5368 * testsuite/Makefile.in: Regenerate.
5369
5370 2012-03-15 Doug Kwan <dougkwan@google.com>
5371
5372 * arm.cc (Target_arm::got_section): Make .got section read-only
5373 if -z now is given.
5374
5375 2012-03-15 Ian Lance Taylor <iant@google.com>
5376
5377 PR gold/13850
5378 * layout.cc (Layout::make_output_section): Correctly mark
5379 SHT_INIT_ARRAY, et. al., as relro.
5380
5381 2012-03-14 Doug Kwan <dougkwan@google.com>
5382
5383 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5384 dynamic relocations for protected symbols in shared objects.
5385
5386 2012-03-13 Ian Lance Taylor <iant@google.com>
5387
5388 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5389 keep the larger alignment.
5390
5391 2012-03-12 Cary Coutant <ccoutant@google.com>
5392
5393 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5394 handling of DW_LNE_define_file.
5395
5396 2012-03-12 Cary Coutant <ccoutant@google.com>
5397
5398 * reduced_debug_output.cc
5399 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5400 codes to switch.
5401
5402 2012-02-29 Cary Coutant <ccoutant@google.com>
5403
5404 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5405
5406 2012-02-29 Cary Coutant <ccoutant@google.com>
5407
5408 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5409 Call Object::decompressed_section_contents.
5410 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5411 New dtor.
5412 (Sized_dwarf_line_info::buffer_start_): New data member.
5413 * merge.cc (Output_merge_data::do_add_input_section): Call
5414 Object::decompressed_section_contents.
5415 (Output_merge_string::do_add_input_section): Likewise.
5416 * object.cc (need_decompressed_section): New function.
5417 (build_compressed_section_map): Decompress sections needed later.
5418 (Sized_relobj_file::do_decompressed_section_contents): New function.
5419 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5420 * object.h (Object::decompressed_section_contents): New function.
5421 (Object::discard_decompressed_sections): New function.
5422 (Object::do_decompressed_section_contents): New function.
5423 (Object::do_discard_decompressed_sections): New function.
5424 (Compressed_section_info): New type.
5425 (Compressed_section_map): Include decompressed section contents.
5426 (Sized_relobj_file::do_decompressed_section_contents): New function.
5427 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5428
5429 2012-02-16 Cary Coutant <ccoutant@google.com>
5430
5431 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5432 * testsuite/Makefile.in: Regenerate.
5433
5434 2012-02-14 Cary Coutant <ccoutant@google.com>
5435
5436 * options.cc (General_options::finalize): Disallow -pie and -static.
5437
5438 2012-02-03 Doug Kwan <dougkwan@google.com>
5439
5440 * arm.cc (Arm_relocate_functions::abs8,
5441 Arm_relocate_functions::abs16): Use
5442 Bits::has_signed_unsigned_overflow32.
5443 (Arm_relocate_functions::thm_abs8): Correct range of
5444 overflow check.
5445 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5446 in assertions.
5447
5448 2012-02-02 Doug Kwan <dougkwan@google.com>
5449
5450 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5451 position independent outputs, not just shared objects.
5452
5453 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5454
5455 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5456 * configure: Regenerated.
5457
5458 2012-01-27 Ian Lance Taylor <iant@google.com>
5459
5460 * reloc.h (Bits): New class with static functions, copied from
5461 namespace utils in arm.cc.
5462 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5463 instead.
5464
5465 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5466
5467 * incremental.cc (write_info_blocks): Correct relocation offset.
5468
5469 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5470
5471 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5472 (Relocate::tls_gd_to_le): Likewise.
5473
5474 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5475
5476 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5477
5478 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5479
5480 * configure.ac: Check if -mcmodel=medium works.
5481 * configure: Regenerated.
5482
5483 2012-01-24 Cary Coutant <ccoutant@google.com>
5484
5485 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5486 definition and ...
5487 (read_unsigned_LEB_128_x): ... this new function.
5488 (read_signed_LEB_128): Replaced with inline definition and ...
5489 (read_signed_LEB_128_x): ... this new function.
5490 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5491 (read_unsigned_LEB_128): Add inline definition.
5492 (read_signed_LEB_128_x): New function.
5493 (read_signed_LEB_128): Add inline definition.
5494 * testsuite/Makefile.am (leb128_unittest): New unit test.
5495 * testsuite/Makefile.in: Regenerate.
5496 * testsuite/leb128_unittest.cc: New unit test.
5497
5498 2012-01-23 Ian Lance Taylor <iant@google.com>
5499
5500 PR gold/13617
5501 * i386.cc (Target_i386::do_code_fill): When using a jmp
5502 instruction, pad with nop instructions.
5503 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5504
5505 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5506
5507 * x86_64.cc (gc_process_relocs): Add typename on types used in
5508 template.
5509 (scan_relocs): Likewise.
5510 (relocate_section): Likewise.
5511 (apply_relocation): Likewise.
5512
5513 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5514
5515 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5516 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5517 under x32.
5518
5519 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5520
5521 * x86_64.cc: Initial support for x32.
5522
5523 2012-01-03 Cary Coutant <ccoutant@google.com>
5524
5525 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5526 Use abstract base class for GOT.
5527 * gold/output.h (class Output_data_got_base): New abstract base class.
5528 (class Output_data_got): Derive from new base class, adjust ctors.
5529 (Output_data_got::reserve_slot): Make virtual; rename to
5530 do_reserve_slot; Adjust callers.
5531 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5532 pointer to abstract base class.
5533 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5534
5535 2011-12-18 Ian Lance Taylor <iant@google.com>
5536
5537 * object.h (Relobj::local_symbol_value): New function.
5538 (Relobj::local_plt_offset): New function.
5539 (Relobj::local_has_got_offset): New function.
5540 (Relobj::local_got_offset): New function.
5541 (Relobj::set_local_got_offset): New function.
5542 (Relobj::do_local_symbol_value): New pure virtual function.
5543 (Relobj::do_local_plt_offset): Likewise.
5544 (Relobj::do_local_has_got_offset): Likewise.
5545 (Relobj::do_local_got_offset): Likewise.
5546 (Relobj::do_set_local_got_offset): Likewise.
5547 (Sized_relobj::do_local_has_got_offset): Rename from
5548 local_has_got_offset.
5549 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5550 (Sized_relobj::do_set_local_got_offset): Rename from
5551 set_local_got_offset.
5552 (Sized_relobj_file::do_local_plt_offset): Rename from
5553 local_plt_offset.
5554 (Sized_relobj_file::do_local_symbol_value): New function.
5555 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5556 local_plt_offset.
5557 * output.cc (Output_data_got::Got_entry::write): Change object to
5558 Relobj. Use local_symbol_value.
5559 (Output_data_got::add_global_with_rel): Change rel_dyn to
5560 Output_data_reloc_generic*. Use add_global_generic.
5561 (Output_data_got::add_global_with_rela): Remove. Change all
5562 callers to use add_global_with_rel.
5563 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5564 Output_data_reloc_generic*. Use add_global_generic.
5565 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5566 callers to use add_global_pair_with_rel.
5567 (Output_data_got::add_local): Change object to Relobj*.
5568 (Output_data_got::add_local_plt): Likewise.
5569 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5570 change rel_dyn to Output_data_reloc_generic*. Use
5571 add_local_generic.
5572 (Output_data_got::add_local_with_rela): Remove. Change all
5573 callers to use all_local_with_rel.
5574 (Output_data_got::add_local_pair_with_rel): Change object to
5575 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5576 add_output_section_generic.
5577 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5578 callers to use add_local_pair_with_rel.
5579 (Output_data_got::reserve_local): Change object to Relobj*.
5580 * output.h: (class Output_data_reloc_generic): Add pure virtual
5581 declarations for add_global_generic, add_local_generic,
5582 add_output_section_generic.
5583 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5584 functions for Output_data_reloc_generic. Update declarations for
5585 changes listed in output.cc.
5586 (class Output_data_got): Change template parameter to got_size.
5587 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5588 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5589 function.
5590 (Sized_relobj_incr::do_local_plt_offset): New function.
5591 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5592 add_global_generic.
5593
5594 2011-12-17 Cary Coutant <ccoutant@google.com>
5595
5596 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5597 * resolve.cc (Symbol_table::resolve): Likewise.
5598 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5599 arrays.
5600 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5601
5602 2011-12-16 Ian Lance Taylor <iant@google.com>
5603
5604 * output.h (Output_data_reloc_generic::add): Only call
5605 add_dynamic_reloc if this is a dynamic reloc section.
5606
5607 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5608
5609 PR gold/13505
5610 * target-reloc.h (apply_relocation): Replace <64, false> with
5611 <size, big_endian>.
5612
5613 2011-11-25 Nick Clifton <nickc@redhat.com>
5614
5615 * po/it.po: New Italian translation.
5616
5617 2011-11-17 Sterling Augustine <saugustine@google.com>
5618
5619 * script.cc (script_include_directive): Implement.
5620 (read_script_file): New local variables name and search_path. Update
5621 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5622 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5623 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5624
5625 2011-11-11 Sterling Augustine <saugustine@google.com>
5626
5627 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5628 (file_or_sections_cmd): Likewise.
5629
5630 2011-11-11 Doug Kwan <dougkwan@google.com>
5631
5632 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5633 if --just-symbols is given.
5634
5635 2011-11-10 Doug Kwan <dougkwan@google.com>
5636
5637 PR gold/13362
5638 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5639 when processing data relocs.
5640 * reloc.h (Relocate_functions::rel_unaligned): New method.
5641 (Relocate_functions::pcrel_unaligned): Ditto.
5642 (Relocate_functions::rel32_unaligned): Ditto.
5643 (Relocate_functions::pcrel32_unaligned): Ditto.
5644
5645 2011-11-09 Doug Kwan <dougkwan@google.com>
5646
5647 PR gold/13362
5648 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5649 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5650 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5651 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5652 (Relocate_functions::rel_unaligned): New.
5653 (Relocate_functions::rel32_unaligned): New.
5654 * target-reloc.h (relocate_for_relocatable): Add code to handle
5655 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5656 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5657 arm_unaligned_reloc_r): New targets.
5658 * testsuite/Makefile.in: Regenerate.
5659 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5660 linking.
5661
5662 2011-11-02 Ian Lance Taylor <iant@google.com>
5663
5664 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5665 NATIVE_LINKER.
5666 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5667 * options.cc (General_options::finalize): Use library search path
5668 from configure script if specified. If not native and no sysroot,
5669 only search TOOLLIBDIR.
5670 * options.h (Search_directory::Search_directory): Change name to
5671 const std::string&.
5672 (General_options::add_to_library_path_with_sysroot): Change arg to
5673 const std::string&.
5674 * configure, Makefile.in, config.in: Rebuild.
5675
5676 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5677
5678 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5679 we are working around the ARM1176 Erratum.
5680 * options.h (General_options::fix_arm1176): Add option.
5681 * testsuite/Makefile.am: Add testcases, and keep current ones
5682 working.
5683 * testsuite/Makefile.in: Regenerate.
5684 * testsuite/arm_fix_1176.s: New file.
5685 * testsuite/arm_fix_1176.sh: Likewise.
5686
5687 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5688
5689 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5690 may_use_blx_.
5691 (Target_arm::may_use_blx): Remove method.
5692 (Target_arm::set_may_use_blx): Likewise.
5693 (Target_arm::may_use_v4t_interworking): New method.
5694 (Target_arm::may_use_v5t_interworking): Likewise.
5695 (Target_arm::may_use_blx_): Remove member variable.
5696 (Arm_relocate_functions::arm_branch_common): Check for v5T
5697 interworking.
5698 (Arm_relocate_functions::thumb_branch_common): Likewise.
5699 (Reloc_stub::stub_type_for_reloc): Likewise.
5700 (Target_arm::do_finalize_sections): Correct interworking checks.
5701 * testsuite/Makefile.am: Add new tests.
5702 * testsuite/Makefile.in: Regenerate.
5703 * testsuite/arm_farcall_arm_arm.s: New test.
5704 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5705 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5706 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5707 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5708 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5709 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5710 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5711
5712 2011-10-31 Cary Coutant <ccoutant@google.com>
5713
5714 PR gold/13023
5715 * expression.cc (Expression::eval_with_dot): Add
5716 is_section_dot_assignment parameter.
5717 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5718 absolute and assigning to dot within a section.
5719 * script-sections.cc
5720 (Output_section_element_assignment::set_section_addresses): Pass
5721 dot_section to set_if_absolute.
5722 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5723 as is_section_dot_assignment flag to eval_with_dot.
5724 (Output_section_element_dot_assignment::set_section_addresses):
5725 Likewise.
5726 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5727 parameter. Also set value if relative to dot_section; set the
5728 symbol's output_section.
5729 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5730 parameter. Adjust all callers.
5731 (Expression::eval_maybe_dot): Likewise.
5732 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5733 Adjust all callers.
5734 * testsuite/script_test_2.t: Test assignment of an absolute value
5735 to dot within an output section element.
5736
5737 2011-10-31 Cary Coutant <ccoutant@google.com>
5738
5739 * options.h (class General_options): Add --[no-]gnu-unique options.
5740 * symtab.cc (Symbol_table::sized_write_globals): Convert
5741 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5742
5743 2011-10-31 Cary Coutant <ccoutant@google.com>
5744
5745 PR gold/13359
5746 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5747 unnecessary assertion.
5748 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5749
5750 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5751
5752 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5753 gc_mark_symbol.
5754 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5755 gc_mark_symbol.
5756 Change to just keep the section associated with symbol.
5757 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5758 they are externally visible and --export-dynamic is turned on.
5759 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5760
5761 2011-10-19 Ian Lance Taylor <iant@google.com>
5762
5763 PR gold/13163
5764 * script-sections.cc
5765 (Output_section_element_dot_assignment::needs_output_section): New
5766 function.
5767
5768 2011-10-19 Ian Lance Taylor <iant@google.com>
5769
5770 PR gold/13204
5771 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5772 --section-start option was seen.
5773 * options.h (General_options::any_section_start): New function.
5774
5775 2011-10-18 David S. Miller <davem@davemloft.net>
5776
5777 PR binutils/13301
5778 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5779 member to track relocation locations that have moved during TLS
5780 reloc optimizations.
5781 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5782 (Target_sparc::Relocate::relocate): Adjust view down by 4
5783 bytes if it matches reloc_adjust_addr_.
5784 (Target_sparc::Relocate::relocate_tls): Always move the
5785 __tls_get_addr call delay slot instruction forward 4 bytes when
5786 performing relaxation.
5787
5788 2011-10-18 Cary Coutant <ccoutant@google.com>
5789
5790 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5791 (Output_file::map_no_anonymous): Check for non-zero
5792 return code from posix_fallocate.
5793
5794 2011-10-17 Cary Coutant <ccoutant@google.com>
5795
5796 PR gold/13245
5797 * plugin.cc (is_visible_from_outside): Check for symbols
5798 referenced from dynamic objects.
5799 * resolve.cc (Symbol_table::resolve): Don't count references
5800 from dynamic objects as references from real ELF files.
5801 * testsuite/plugin_test_2.sh: Adjust expected result.
5802
5803 2011-10-17 Cary Coutant <ccoutant@google.com>
5804
5805 * gold.cc: Include timer.h.
5806 (queue_middle_tasks): Stamp time.
5807 (queue_final_tasks): Likewise.
5808 * main.cc (main): Store timer in parameters. Print timers
5809 for each pass.
5810 * parameters.cc (Parameters::Parameters): Initialize timer_.
5811 (Parameters::set_timer): New function.
5812 (set_parameters_timer): New function.
5813 * parameters.h (Parameters::set_timer): New function.
5814 (Parameters::timer): New function.
5815 (Parameters::timer_): New data member.
5816 (set_parameters_timer): New function.
5817 * timer.cc (Timer::stamp): New function.
5818 (Timer::get_pass_time): New function.
5819 * timer.h (Timer::stamp): New function.
5820 (Timer::get_pass_time): New function.
5821 (Timer::pass_times_): New data member.
5822
5823 2011-10-17 Cary Coutant <ccoutant@google.com>
5824
5825 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5826 task for members of lib groups.
5827
5828 2011-10-17 Cary Coutant <ccoutant@google.com>
5829
5830 PR gold/13288
5831 * fileread.cc (File_read::find_view): Add assert.
5832 (File_read::make_view): Move bounds check (replace with assert)...
5833 (File_read::find_or_make_view): ... to here.
5834
5835 2011-10-12 Cary Coutant <ccoutant@google.com>
5836
5837 * output.cc (Output_file::open_base_file): Handle case where
5838 ::read returns less than requested size.
5839
5840 2011-10-10 Cary Coutant <ccoutant@google.com>
5841
5842 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5843 Initialize defined_count_.
5844 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5845 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5846 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5847 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5848 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5849 * incremental.h (Sized_relobj_incr::defined_count_): New data
5850 member.
5851 (Sized_incr_dynobj::defined_count_): New data member.
5852 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5853 Return zeroes instead of internal error.
5854
5855 2011-10-10 Cary Coutant <ccoutant@google.com>
5856
5857 PR gold/13249
5858 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5859 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5860 * output.h (class Output_reloc): Add use_plt_offset flag.
5861 (Output_reloc::type_): Adjust size of bit field.
5862 (Output_reloc::use_plt_offset_): New bit field.
5863 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5864 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5865 flag. Adjust all callers.
5866 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5867 creating RELATIVE relocations.
5868
5869 2011-10-10 Nick Clifton <nickc@redhat.com>
5870
5871 * po/es.po: Updated Spanish translation.
5872 * po/fi.po: Updated Finnish translation.
5873
5874 2011-10-03 Diego Novillo <dnovillo@google.com>
5875
5876 * options.cc (parse_uint): Fix dereference of RETVAL.
5877
5878 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5879
5880 * layout.h (section_order_map_): New member.
5881 (get_section_order_map): New member function.
5882 * output.cc (Output_section::add_input_section): Check for patterns
5883 only when --section-ordering-file is specified.
5884 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5885 output_sections have been formed.
5886 * layout.cc (Layout_Layout): Initialize section_order_map_.
5887 * plugin.cc (update_section_order): Store order in order_map. Do not
5888 update the order.
5889 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5890 * testsuite/Makefile.in: Regenerate.
5891 * testsuite/plugin_section_order.c: New file.
5892 * testsuite/plugin_final_layout.cc: New file.
5893 * testsuite/plugin_final_layout.sh: New file.
5894
5895 2011-09-29 Cary Coutant <ccoutant@google.com>
5896
5897 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5898 Check for NULL.
5899 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5900 symbols during incremental update.
5901 (Symbol_table::add_from_dynobj): Likewise.
5902
5903 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5904 Ian Lance Taylor <iant@google.com>
5905
5906 * symtab.cc (Symbol_table::define_special_symbol): Always
5907 canonicalize version string.
5908
5909 2011-09-26 Cary Coutant <ccoutant@google.com>
5910
5911 * gold.cc (queue_initial_tasks): Move option checks ...
5912 * options.cc (General_options::finalize): ... to here. Disable
5913 some options; make others fatal.
5914
5915 2011-09-26 Cary Coutant <ccoutant@google.com>
5916
5917 gcc PR lto/47247
5918 * plugin.cc (get_symbols_v2): New function.
5919 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5920 (is_referenced_from_outside): New function.
5921 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5922 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5923 (get_symbols): Pass version parameter.
5924 (get_symbols_v2): New function.
5925 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5926 parameter.
5927 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5928 (onload): Add LDPT_GET_SYMBOLS_V2.
5929 (all_symbols_read_hook): Use get_symbols_v2; check for
5930 LDPR_PREVAILING_DEF_IRONLY_EXP.
5931 * testsuite/plugin_test_3.sh: Update expected results.
5932
5933 2011-09-23 Simon Baldwin <simonb@google.com>
5934
5935 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5936 configuration options.
5937 * configure: Regenerate.
5938 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5939 * Makefile.in: Regenerate.
5940 * testsuite/Makefile.in: Regenerate.
5941
5942 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5943
5944 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5945
5946 2011-09-19 Cary Coutant <ccoutant@google.com>
5947
5948 * incremental.cc (can_incremental_update): Fix typo in comment.
5949 * incremental.h (can_incremental_update): Likewise.
5950
5951 2011-09-18 Cary Coutant <ccoutant@google.com>
5952
5953 * incremental.cc (can_incremental_update): New function.
5954 * incremental.h (can_incremental_update): New function.
5955 * layout.cc (Layout::init_fixed_output_section): Call it.
5956 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5957 * object.cc (Sized_relobj_file::do_layout): Call
5958 can_incremental_update.
5959
5960 2011-09-13 Cary Coutant <ccoutant@google.com>
5961
5962 * configure.ac: Check for glibc support for gnu_indirect_function
5963 support with static linking, setting automake conditional
5964 IFUNC_STATIC.
5965 * Makefile.in: Regenerate.
5966 * configure: Regenerate.
5967
5968 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5969 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5970 for IFUNC_STATIC.
5971 * testsuite/Makefile.in: Regenerate.
5972
5973 2011-09-13 Cary Coutant <ccoutant@google.com>
5974
5975 * incremental.cc (Sized_relobj_incr::do_layout): Call
5976 report_comdat_group for kept comdat sections.
5977 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5978 * testsuite/Makefile.in: Regenerate.
5979 * testsuite/incr_comdat_test_1.cc: New source file.
5980 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5981 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5982 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5983
5984 2011-09-13 Ian Lance Taylor <iant@google.com>
5985
5986 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5987 variable external_symbols_offset.
5988
5989 2011-09-12 Ian Lance Taylor <iant@google.com>
5990
5991 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5992 triggered if object has no symbols.
5993
5994 2011-09-09 David S. Miller <davem@davemloft.net>
5995
5996 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5997 (Output_fill_debug_line::do_write): Likewise.
5998
5999 2011-08-29 Cary Coutant <ccoutant@google.com>
6000
6001 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
6002 casts to match formatting specs.
6003 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
6004
6005 2011-08-26 Cary Coutant <ccoutant@google.com>
6006
6007 * layout.cc (Free_list::allocate): Provide guarantee of minimum
6008 remaining hole size when allocating.
6009 (Layout::make_output_section): Set fill methods for debug sections.
6010 * layout.h (Free_list::Free_list_node): Move from private to
6011 public.
6012 (Free_list::set_min_hole_size): New function.
6013 (Free_list::begin, Free_list::end): New functions.
6014 (Free_list::min_hole_): New data member.
6015 * output.cc: Include dwarf.h.
6016 (Output_fill_debug_info::do_minimum_hole_size): New function.
6017 (Output_fill_debug_info::do_write): New function.
6018 (Output_fill_debug_line::do_minimum_hole_size): New function.
6019 (Output_fill_debug_line::do_write): New function.
6020 (Output_section::Output_section): Initialize new data member.
6021 (Output_section::set_final_data_size): Ensure patch space is larger
6022 than minimum hole size.
6023 (Output_section::do_write): Fill holes in debug sections.
6024 * output.h (Output_fill): New class.
6025 (Output_fill_debug_info): New class.
6026 (Output_fill_debug_line): New class.
6027 (Output_section::set_free_space_fill): New function.
6028 (Output_section::free_space_fill_): New data member.
6029 * testsuite/Makefile.am (incremental_test_3): Add
6030 --incremental-patch option.
6031 (incremental_test_4): Likewise.
6032 (incremental_test_5): Likewise.
6033 (incremental_test_6): Likewise.
6034 (incremental_copy_test): Likewise.
6035 (incremental_common_test_1): Likewise.
6036 * testsuite/Makefile.in: Regenerate.
6037
6038 2011-08-26 Nick Clifton <nickc@redhat.com>
6039
6040 * po/es.po: Updated Spanish translation.
6041
6042 2011-08-01 Cary Coutant <ccoutant@google.com>
6043
6044 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
6045 * gold/testsuite/Makefile.in: Regenerate.
6046 * gold/testsuite/justsyms_exec.c: New source file.
6047 * gold/testsuite/justsyms_lib.c: New source file.
6048
6049 2011-08-01 Cary Coutant <ccoutant@google.com>
6050
6051 * layout.cc (Layout::set_segment_offsets): Don't realign text
6052 segment if -Ttext was specified.
6053 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
6054 file type.
6055 * object.h (Sized_relobj_file::e_type): New function.
6056 (Sized_relobj_file::e_type_): New data member.
6057 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
6058 base address for ET_EXEC files.
6059 * target.cc (Target::do_make_elf_object_implementation): Allow
6060 ET_EXEC files with --just-symbols option.
6061
6062 2011-07-28 Cary Coutant <ccoutant@google.com>
6063
6064 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
6065 Add thread_number parameter.
6066 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
6067 * workqueue-threads.cc
6068 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
6069 current thread if its thread number is greater than desired thread
6070 count.
6071 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
6072 Add thread_number parameter.
6073 (Workqueue::should_cancel_thread): Likewise.
6074 (Workqueue::find_runnable_or_wait): Pass thread_number to
6075 should_cancel_thread.
6076 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
6077 parameter.
6078
6079 2011-07-22 Sriraman Tallam <tmsriram@google.com>
6080
6081 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
6082 only after checking if it cannot be forced local.
6083 * symtab.h (is_externally_visible): Check if the symbol is not forced
6084 local.
6085
6086 2011-07-15 Ian Lance Taylor <iant@google.com>
6087
6088 * options.h (class General_options): Add --print-output-format.
6089 Move -EL next to -EB, for better --help output.
6090 * target-select.cc: Include <cstdio>, "options.h", and
6091 "parameters.h".
6092 (Target_selector::do_target_bfd_name): New function.
6093 (print_output_format): New function.
6094 * target-select.h (class Target_selector): Update declarations.
6095 (Target_selector::target_bfd_name): New function.
6096 (print_output_format): Declare.
6097 * main.cc: Include "target-select.h".
6098 (main): Handle --print-output-format.
6099 * gold.cc: Include "target-select.h".
6100 (queue_initial_tasks): Handle --print-output-format when there are
6101 no input files.
6102 * parameters.cc (parameters_force_valid_target): Give a better
6103 error message if -EB/-EL does not match target.
6104 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
6105 function.
6106
6107 2011-07-15 Ian Lance Taylor <iant@google.com>
6108
6109 * i386.cc (class Output_data_plt_i386): Add layout_ field.
6110 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
6111 (Output_data_plt_i386::do_write): Write address of .dynamic
6112 section to first entry in .got.plt section.
6113 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
6114 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6115 Initialize layout_.
6116 (Output_data_plt_x86_64::do_write): Write address of .dynamic
6117 section to first entry in .got.plt section.
6118 * layout.h (Layout::dynamic_section): New function.
6119
6120 2011-07-13 Sriraman Tallam <tmsriram@google.com>
6121
6122 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
6123 to claim_file call.
6124 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
6125 input_section_position_, and input_section_glob_.
6126 (read_layout_from_file): Call function section_ordering_specified.
6127 * layout.h (is_section_ordering_specified): New function.
6128 (section_ordering_specified): New function.
6129 (section_ordering_specified_): New boolean member.
6130 * main.cc(main): Call load_plugins after layout object is defined.
6131 * output.cc (Output_section::add_input_section): Use
6132 function section_ordering_specified to check if section ordering is
6133 needed.
6134 * output.cc (Output_section::add_relaxed_input_section): Use
6135 function section_ordering_specified to check if section ordering is
6136 needed.
6137 (Output_section::update_section_layout): New function.
6138 (Output_section::sort_attached_input_sections): Check if input section
6139 must be reordered.
6140 * output.h (Output_section::update_section_layout): New function.
6141 * plugin.cc (get_section_count): New function.
6142 (get_section_type): New function.
6143 (get_section_name): New function.
6144 (get_section_contents): New function.
6145 (update_section_order): New function.
6146 (allow_section_ordering): New function.
6147 (Plugin::load): Add the new interfaces to the transfer vector.
6148 (Plugin_manager::load_plugins): New parameter.
6149 (Plugin_manager::all_symbols_read): New parameter.
6150 (Plugin_manager::claim_file): New parameter. Save the elf object for
6151 unclaimed objects.
6152 (Plugin_manager::get_elf_object): New function.
6153 (Plugin_manager::get_view): Change to directly use the bool to check
6154 if get_view is called from claim_file_hook.
6155 * plugin.h (input_objects): New function
6156 (Plugin__manager::load_plugins): New parameter.
6157 (Plugin_manager::claim_file): New parameter.
6158 (Plugin_manager::get_elf_object): New function.
6159 (Plugin_manager::in_claim_file_handler): New function.
6160 (Plugin_manager::in_claim_file_handler_): New member.
6161 (layout): New function.
6162 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
6163 handler with an extra parameter. Make the elf object before calling
6164 claim_file handler.
6165 * testsuite/plugin_test.c (get_section_count): New function pointer.
6166 (get_section_type): New function pointer.
6167 (get_section_name): New function pointer.
6168 (get_section_contents): New function pointer.
6169 (update_section_order): New function pointer.
6170 (allow_section_ordering): New function pointer.
6171 (onload): Check if the new interfaces exist.
6172
6173 2011-07-13 Ian Lance Taylor <iant@google.com>
6174
6175 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
6176 relro section.
6177 * x86_64.cc (Target_x86_64::got_section): Likewise.
6178 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
6179 (relro_now_test_SOURCES): New variable.
6180 (relro_now_test_DEPENDENCIES): New variable.
6181 (relro_now_test_LDFLAGS): New variable.
6182 (relro_now_test_LDADD): New variable.
6183 (relro_now_test.so): New target.
6184 * testsuite/Makefile.in: Rebuild.
6185
6186 2011-07-12 Ian Lance Taylor <iant@google.com>
6187
6188 PR gold/12980
6189 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6190 GLOB_DAT relocation rather than a RELATIVE relocation for a
6191 protected symbol when creating a shared library.
6192 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6193 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6194 * testsuite/protected_main_1.cc (main): Test that protected
6195 function has same address.
6196
6197 2011-07-11 Ian Lance Taylor <iant@google.com>
6198
6199 PR gold/12979
6200 * options.h (class General_options): Add -Bgroup.
6201 * options.cc (General_options::finalize): If -Bgroup is set,
6202 default to --unresolved-symbols=report-all.
6203 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6204 * target-reloc.h (issue_undefined_symbol_error): Handle
6205 --unresolved-symbols=report-all.
6206
6207 2011-07-08 Ian Lance Taylor <iant@google.com>
6208
6209 PR gold/11985
6210 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6211 if linker script discards key sections.
6212 (Layout::create_dynamic_symtab): Likewise.
6213 (Layout::assign_local_dynsym_offsets): Likewise.
6214 (Layout::sized_create_version_sections): Likewise.
6215 (Layout::create_interp): Likewise.
6216 (Layout::finish_dynamic_section): Likewise.
6217 (Layout::set_dynamic_symbol_size): Likewise.
6218
6219 2011-07-08 Ian Lance Taylor <iant@google.com>
6220
6221 PR gold/12386
6222 * options.h (class General_options): Add --unresolved-symbols.
6223 * target-reloc.h (issue_undefined_symbol_error): Check
6224 --unresolved-symbols. Add comments.
6225
6226 2011-07-08 Ian Lance Taylor <iant@google.com>
6227
6228 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6229 expression more complex.
6230
6231 2011-07-08 Ian Lance Taylor <iant@google.com>
6232
6233 PR gold/11317
6234 * target-reloc.h (issue_undefined_symbol_error): New inline
6235 function, broken out of relocate_section.
6236 (relocate_section): Call issue_undefined_symbol_error.
6237 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6238 there is no TLS segment if we are about to issue an undefined
6239 symbol error.
6240 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6241
6242 2011-07-08 Ian Lance Taylor <iant@google.com>
6243
6244 PR gold/12279
6245 * resolve.cc (Symbol_table::should_override): Add fromtype
6246 parameter. Change all callers. Give error when linking together
6247 TLS and non-TLS symbol.
6248 (Symbol_table::should_override_with_special): Add fromtype
6249 parameter. Change all callers.
6250 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6251 there is no TLS segment if we have reported some errors.
6252 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6253
6254 2011-07-08 Ian Lance Taylor <iant@google.com>
6255
6256 PR gold/12372
6257 * target.h (Target::plt_address_for_global): New function.
6258 (Target::plt_address_for_local): New function.
6259 (Target::plt_section_for_global): Remove.
6260 (Target::plt_section_for_local): Remove.
6261 (Target::do_plt_address_for_global): New virtual function.
6262 (Target::do_plt_address_for_local): New virtual function.
6263 (Target::do_plt_section_for_global): Remove.
6264 (Target::do_plt_section_for_local): Remove.
6265 (Target::register_global_plt_entry): Add Symbol_table and Layout
6266 parameters.
6267 * output.cc (Output_data_got::Got_entry::write): Use
6268 plt_address_for_global and plt_address_for_local.
6269 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6270 address of output section.
6271 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6272 got_irelative_, and irelative_count_ fields. Update
6273 declarations.
6274 (Output_data_plt_i386::has_irelative_section): New function.
6275 (Output_data_plt_i386::entry_count): Add irelative_count_.
6276 (Output_data_plt_i386::set_final_data_size): Likewise.
6277 (class Target_i386): Add got_irelative_ and rel_irelative_
6278 fields. Update declarations.
6279 (Target_i386::Target_i386): Initialize new fields.
6280 (Target_i386::do_plt_address_for_global): New function replacing
6281 do_plt_section_for_global.
6282 (Target_i386::do_plt_address_for_local): New function replacing
6283 do_plt_section_for_local.
6284 (Target_i386::got_section): Create got_irelative_.
6285 (Target_i386::rel_irelative_section): New function.
6286 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6287 fields. Don't define __rel_iplt_{start,end}.
6288 (Output_data_plt_i386::add_entry): Add symtab and layout
6289 parameters. Change all callers. Use different PLT and GOT for
6290 IFUNC symbols.
6291 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6292 layout parameters. Change all callers. Use different PLT and
6293 GOT.
6294 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6295 (Output_data_plt_i386::rel_irelative): New function.
6296 (Output_data_plt_i386::address_for_global): New function.
6297 (Output_data_plt_i386::address_for_local): New function.
6298 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6299 IRELATIVE GOT when changing IFUNC GOT entries.
6300 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6301 reloc.
6302 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6303 if we didn't create an IRELATIVE GOT.
6304 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6305 plt_address_for_local.
6306 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6307 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6308 got_irelative_, and irelative_count_ fields. Update
6309 declarations.
6310 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6311 Initialize new fields. Remove symtab parameter. Change all
6312 callers.
6313 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6314 irelative_count_.
6315 (Output_data_plt_x86_64::has_irelative_section): New function.
6316 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6317 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6318 fields. Update declarations.
6319 (Target_x86_64::Target_x86_64): Initialize new fields.
6320 (Target_x86_64::do_plt_address_for_global): New function replacing
6321 do_plt_section_for_global.
6322 (Target_x86_64::do_plt_address_for_local): New function replacing
6323 do_plt_section_for_local.
6324 (Target_x86_64::got_section): Create got_irelative_.
6325 (Target_x86_64::rela_irelative_section): New function.
6326 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6327 all callers. Don't create __rel_iplt_{start,end}.
6328 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6329 parameters. Change all callers. Use different PLT and GOT for
6330 IFUNC symbols.
6331 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6332 layout parameters. Change all callers. Use different PLT and
6333 GOT.
6334 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6335 parameters. Change all callers. Use different PLT and GOT for
6336 IFUNC symbols.
6337 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6338 (Output_data_plt_x86_64::rela_irelative): New function.
6339 (Output_data_plt_x86_64::address_for_global): New function.
6340 (Output_data_plt_x86_64::address_for_local): New function.
6341 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6342 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6343 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6344 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6345 parameters.
6346 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6347 reloc.
6348 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6349 symbols if we didn't create an IRELATIVE GOT.
6350 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6351 plt_address_for_local.
6352 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6353 * testsuite/ifuncvar1.c: New test file.
6354 * testsuite/ifuncvar2.c: New test file.
6355 * testsuite/ifuncvar3.c: New test file.
6356 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6357 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6358 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6359 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6360 * testsuite/Makefile.in: Rebuild.
6361
6362 2011-07-07 Cary Coutant <ccoutant@google.com>
6363
6364 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6365 (two_file_test_1_ndebug.o): Likewise.
6366 (two_file_test_1b_ndebug.o): Likewise.
6367 (two_file_test_2_ndebug.o): Likewise.
6368 (two_file_test_main_ndebug.o): Likewise.
6369 (incremental_test_2): Link with no-debug versions.
6370
6371 2011-07-06 Cary Coutant <ccoutant@google.com>
6372
6373 * gold/incremental.cc
6374 (Output_section_incremental_inputs::write_info_blocks): Check for
6375 hidden and internal symbols.
6376
6377 2011-07-06 Cary Coutant <ccoutant@google.com>
6378
6379 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6380 Check disposition for startup file.
6381 (Incremental_inputs::report_command_line): Ignore
6382 --incremental-startup-unchanged option.
6383 * options.cc (General_options::parse_incremental_startup_unchanged):
6384 New function.
6385 (General_options::General_options): Initialize new data member.
6386 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6387 (General_options): Add --incremental-startup-unchanged option.
6388 (General_options::incremental_startup_disposition): New function.
6389 (General_options::incremental_startup_disposition_): New data member.
6390
6391 2011-07-06 Cary Coutant <ccoutant@google.com>
6392
6393 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6394 input file index to Script_info ctor.
6395 (Sized_incremental_binary::do_file_has_changed): Find the
6396 command-line argument for files named in scripts.
6397 * incremental.h (Script_info::Script_info): New ctor
6398 with input file index.
6399 (Script_info::input_file_index): New function.
6400 (Script_info::input_file_index_): New data member.
6401 (Incremental_binary::get_library): Add const.
6402 (Incremental_binary::get_script_info): Add const.
6403 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6404 * testsuite/Makefile.am (incremental_test_5): New test case.
6405 (incremental_test_6): New test case.
6406 * testsuite/Makefile.in: Regenerate.
6407
6408 2011-07-06 Cary Coutant <ccoutant@google.com>
6409
6410 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6411 debug output when command lines differ.
6412
6413 2011-07-06 Cary Coutant <ccoutant@google.com>
6414
6415 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6416 --incremental-patch option.
6417 * layout.cc (Free_list::allocate): Extend allocation beyond original
6418 end if enabled.
6419 (Layout::make_output_section): Mark sections that should get
6420 patch space.
6421 * options.cc (parse_percent): New function.
6422 * options.h (parse_percent): New function.
6423 (DEFINE_percent): New macro.
6424 (General_options): Add --incremental-patch option.
6425 * output.cc (Output_section::Output_section): Initialize new data
6426 members.
6427 (Output_section::add_input_section): Print section name when out
6428 of patch space.
6429 (Output_section::add_output_section_data): Likewise.
6430 (Output_section::set_final_data_size): Add patch space when
6431 doing --incremental-full.
6432 (Output_section::do_reset_address_and_file_offset): Remove patch
6433 space.
6434 (Output_segment::set_section_list_addresses): Print debug output
6435 only if --incremental-update.
6436 * output.h (Output_section::set_is_patch_space_allowed): New function.
6437 (Output_section::is_patch_space_allowed_): New data member.
6438 (Output_section::patch_space_): New data member.
6439 * parameters.cc (Parameters::incremental_full): New function.
6440 * parameters.h (Parameters::incremental_full): New function
6441 * testsuite/Makefile.am (incremental_test_2): Add test for
6442 --incremental-patch option.
6443 * testsuite/Makefile.in: Regenerate.
6444 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6445 (t18): Remove function body.
6446
6447 2011-07-05 Doug Kwan <dougkwan@google.com>
6448
6449 PR gold/12771
6450 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6451 Arm_Address type for relocation result.
6452 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6453 overflow check.
6454 (Arm_relocate_functions::abs32): Use unaligned access.
6455 (Arm_relocate_functions::rel32): Ditto.
6456 (Arm_relocate_functions::prel31): Ditto.
6457 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6458 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6459 static data relocations.
6460 * testsuite/Makefile.in: Regnerate.
6461 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6462
6463 2011-07-05 Ian Lance Taylor <iant@google.com>
6464
6465 PR gold/12392
6466 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6467 symbols if necessary.
6468 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6469
6470 2011-07-05 Ian Lance Taylor <iant@google.com>
6471
6472 PR gold/12952
6473 * resolve.cc (Symbol::override_base_with_special): Simply override
6474 version with special symbol version, ignoring previous version.
6475
6476 2011-07-05 Ian Lance Taylor <iant@google.com>
6477
6478 * object.cc (Sized_relobj_file::include_section_group): Add
6479 information to comment about signature location.
6480
6481 2011-07-02 Ian Lance Taylor <iant@google.com>
6482
6483 PR gold/12957
6484 * options.h (class General_options): Add -f and -F.
6485 * options.cc (General_options::finalize): Fatal error if -f/-F
6486 are used without -shared.
6487 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6488
6489 2011-07-02 Ian Lance Taylor <iant@google.com>
6490
6491 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6492
6493 2011-07-01 Ian Lance Taylor <iant@google.com>
6494
6495 PR gold/12525
6496 PR gold/12952
6497 * resolve.cc (Symbol::override_base_with_special): Don't override
6498 the version if the overriding symbol has a different name.
6499 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6500 all callers. If we give an error about an undefined version,
6501 define the base version if necessary.
6502 * dynobj.h (class Versions): Update declaration.
6503 * testsuite/weak_alias_test_5.cc: New file.
6504 * testsuite/weak_alias_test.script: New file.
6505 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6506 and versioned_alias have the right value, and call t2.
6507 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6508 weak_alias_test_5.so.
6509 (weak_alias_test_LDADD): Likewise.
6510 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6511 * testsuite/Makefile.in: Rebuild.
6512
6513 2011-07-01 Ian Lance Taylor <iant@google.com>
6514
6515 PR gold/12525
6516 * options.h (class General_options): Support -z notext.
6517 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6518 -Wl,-z,notext.
6519 (two_file_shared_nonpic.so): Likewise.
6520 (two_file_shared_mixed.so): Likewise.
6521 (two_file_shared_mixed_1.so): Likewise.
6522 (weak_undef_lib_nonpic.so): Likewise.
6523 (alt/weak_undef_lib_nonpic.so): Likewise.
6524 (tls_test_shared_nonpic.so): Likewise.
6525 * testsuite/Makefile.in: Rebuild.
6526
6527 2011-07-01 Ian Lance Taylor <iant@google.com>
6528
6529 PR gold/12525
6530 * configure.ac: Test whether static linking works, setting
6531 the automake conditional HAVE_STATIC.
6532 * testsuite/Makefile.am: Disable tests using -static if
6533 HAVE_STATIC is not true.
6534 * configure, testsuite/Makefile.in: Rebuild.
6535
6536 2011-07-01 Ian Lance Taylor <iant@google.com>
6537
6538 PR gold/12525
6539 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6540 Assert if we see DW_EH_PE_indirect.
6541 * target.h (Target::ehframe_datarel_base): New function.
6542 (Target::do_ehframe_datarel_base): New target function.
6543 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6544 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6545 function.
6546
6547 2011-07-01 Ian Lance Taylor <iant@google.com>
6548
6549 PR gold/12571
6550 * options.h (class General_options): Add
6551 --ld-generated-unwind-info.
6552 * ehframe.cc (Fde::write): Add address parameter. Change all
6553 callers. If associated with PLT, fill in address and size.
6554 (Cie::set_output_offset): Only add merge mapping if there is an
6555 object.
6556 (Cie::write): Add address parameter. Change all callers.
6557 (Eh_frame::add_ehframe_for_plt): New function.
6558 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6559 input_offset_ fields into union u_, with new plt field.
6560 (Fde::Fde): Adjust for new union field.
6561 (Fde::Fde) [Output_data version]: New constructor.
6562 (Fde::add_mapping): Only add merge mapping if there is an object.
6563 (class Cie): Update declarations.
6564 (class Eh_frame): Declare add_ehframe_for_plt.
6565 * layout.cc (Layout::layout_eh_frame): Break out code into
6566 make_eh_frame_section, and call it.
6567 (Layout::make_eh_frame_section): New function.
6568 (Layout::add_eh_frame_for_plt): New function.
6569 * layout.h (class Layout): Update declarations.
6570 * merge.cc (Merge_map::add_mapping): Add assertion.
6571 * i386.cc: Include "dwarf.h".
6572 (class Output_data_plt_i386): Make first_plt_entry,
6573 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6574 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6575 and plt_eh_frame_fde.
6576 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6577 boundary. Call add_eh_frame_for_plt if appropriate.
6578 * x86_64.cc: Include "dwarf.h".
6579 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6580 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6581 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6582 and plt_eh_frame_fde.
6583 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6584 appropriate.
6585
6586 2011-06-29 Ian Lance Taylor <iant@google.com>
6587
6588 PR gold/12629
6589 * object.cc (Sized_relobj_file::layout_section): Change shdr
6590 parameter to be const.
6591 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6592 out of do_layout.
6593 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6594 appropriate. Call layout_eh_frame_section.
6595 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6596 sections.
6597 * object.h (class Sized_relobj_file): Update declarations.
6598
6599 2011-06-29 Ian Lance Taylor <iant@google.com>
6600
6601 PR gold/12652
6602 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6603 modifier.
6604 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6605
6606 2011-06-29 Ian Lance Taylor <iant@google.com>
6607
6608 PR gold/12675
6609 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6610 SHT_X86_64_UNWIND.
6611 * layout.cc (Layout::layout_eh_frame): Likewise.
6612
6613 2011-06-29 Ian Lance Taylor <iant@google.com>
6614
6615 PR gold/12695
6616 * layout.cc (Layout::symtab_section_shndx): New function.
6617 * layout.h (class Layout): Declare symtab_section_shndx.
6618 * output.cc (Output_section::write_header): Call it.
6619
6620 2011-06-29 Ian Lance Taylor <iant@google.com>
6621
6622 PR gold/12818
6623 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6624 symbols which are not used in a relocation.
6625
6626 2011-06-28 Ian Lance Taylor <iant@google.com>
6627
6628 PR gold/12898
6629 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6630 script create indistinguishable segments.
6631 (Layout::set_segment_offsets): Use stable_sort when sorting
6632 segments. Pass this to Compare_segments constructor.
6633 * layout.h (class Layout): Make segment_precedes non-static.
6634 (class Compare_segments): Change from struct to class. Add
6635 layout_ field. Add constructor.
6636 * script-sections.cc
6637 (Script_sections::attach_sections_using_phdrs_clause): Rename
6638 local orphan to is_orphan. Don't report failure to put empty
6639 section in segment. On attachment failure, report name of
6640 section, and attach to first PT_LOAD segment.
6641
6642 2011-06-28 Ian Lance Taylor <iant@google.com>
6643
6644 PR gold/12934
6645 * target-select.cc (Target_selector::Target_selector): Add
6646 emulation parameter. Change all callers.
6647 (select_target_by_bfd_name): Rename from select_target_by_name.
6648 Change all callers.
6649 (select_target_by_emulation): New function.
6650 (supported_emulation_names): New function.
6651 * target-select.h (class Target_selector): Add emulation_ field.
6652 Update declarations.
6653 (Target_selector::recognize_by_bfd_name): Rename from
6654 recognize_by_name. Change all callers.
6655 (Target_selector::supported_bfd_names): Rename from
6656 supported_names. Change all callers.
6657 (Target_selector::recognize_by_emulation): New function.
6658 (Target_selector::supported_emulations): New function.
6659 (Target_selector::emulation): New function.
6660 (Target_selector::do_recognize_by_bfd_name): Rename from
6661 do_recognize_by_name. Change all callers.
6662 (Target_selector::do_supported_bfd_names): Rename from
6663 do_supported_names. Change all callers.
6664 (Target_selector::do_recognize_by_emulation): New function.
6665 (Target_selector::do_supported_emulations): New function.
6666 (select_target_by_bfd_name): Change name in declaration.
6667 (select_target_by_emulation): Declare.
6668 (supported_emulation_names): Declare.
6669 * parameters.cc (parameters_force_valid_target): Try to find
6670 target based on emulation from -m option.
6671 * options.h (class General_options): Change doc string for -m.
6672 * options.cc (help): Print emulations.
6673 (General_options::parse_V): Likewise.
6674 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6675 Add emulation parameter. Change all callers.
6676
6677 2011-06-28 Ian Lance Taylor <iant@google.com>
6678
6679 * target.h (class Target): Add osabi_ field.
6680 (Target::osabi): New function.
6681 (Target::set_osabi): New function.
6682 (Target::Target): Initialize osabi_.
6683 (Target::do_adjust_elf_header): Make pure virtual.
6684 (Sized_target::do_adjust_elf_header): Declare.
6685 * target.cc (Sized_target::do_adjust_elf_header): New function.
6686 (class Sized_target): Instantiate all versions.
6687 * freebsd.h (class Target_freebsd): Remove.
6688 (Target_selector_freebsd::do_recognize): Call set_osabi on
6689 Target.
6690 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6691 (Target_selector_freebsd::set_osabi): Remove.
6692 * i386.cc (class Target_i386): Inherit from Sized_target rather
6693 than Target_freebsd.
6694 * x86_64.cc (class Target_x86_64): Likewise.
6695
6696 2011-06-28 Ian Lance Taylor <iant@google.com>
6697
6698 * target.h (Target::can_check_for_function_pointers): Rewrite.
6699 Make non-virtual.
6700 (Target::can_icf_inline_merge_sections): Likewise.
6701 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6702 (Target::Target_info): Add can_icf_inline_merge_sections field.
6703 (Target::do_can_check_for_function_pointers): New virtual
6704 function.
6705 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6706 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6707 from can_check_for_function_pointers, move in file.
6708 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6709 section_may_have_icf_unsafe_poineters, move in file.
6710 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6711 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6712 Rename from can_check_for_function_pointers, move in file.
6713 (Target_i386::can_icf_inline_merge_sections): Remove.
6714 (Target_i386::i386_info): Initialize
6715 can_icf_inline_merge_sections.
6716 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6717 Initialize can_icf_inline_merge_sections.
6718 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6719 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6720 Rename from can_check_for_function_pointers, move in file.
6721 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6722 (Target_x86_64::x86_64_info): Initialize
6723 can_icf_inline_merge_sections.
6724 * testsuite/testfile.cc (Target_test::test_target_info):
6725 Likewise.
6726 * icf.cc (get_section_contents): Correct formatting.
6727
6728 2011-06-27 Ian Lance Taylor <iant@google.com>
6729
6730 * symtab.cc (Symbol::versioned_name): New function.
6731 (Symbol_table::add_to_final_symtab): Use versioned_name when
6732 appropriate.
6733 (Symbol_table::sized_write_symbol): Likewise.
6734 * symtab.h (class Symbol): Declare versioned_name.
6735 * stringpool.h (class Stringpool_template): Add variant of add
6736 which takes a std::basic_string.
6737 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6738 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6739 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6740 (ver_test_12.o): New target.
6741 * testsuite/Makefile.in: Rebuild.
6742
6743 2011-06-27 Doug Kwan <dougkwan@google.com>
6744
6745 * arm.cc (Arm_relocate_functions::thm_jump8,
6746 Arm_relocate_functions::thm_jump11): Use a wider signed
6747 type to compute offset.
6748 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6749 arm_thm_jump8.
6750 * testsuite/Makefile.in: Regenerate.
6751 * testsuite/arm_branch_in_range.sh: Check test results of
6752 arm_thm_jump11 and arm_thm_jump8.
6753 * testsuite/arm_thm_jump11.s: New test source file.
6754 * testsuite/arm_thm_jump11.t: New linker script.
6755 * testsuite/arm_thm_jump8.s: New test source file.
6756 * testsuite/arm_thm_jump8.t: New linker script.
6757
6758 2011-06-24 Ian Lance Taylor <iant@google.com>
6759
6760 * layout.cc: Include "object.h".
6761 (ctors_sections_in_init_array): New static variable.
6762 (Layout::is_ctors_in_init_array): New function.
6763 (Layout::layout): Add entry to ctors_sections_in_init_array if
6764 appropriate.
6765 * layout.h (class Layout): Declare is_ctors_in_init_array.
6766 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6767 is_ctors_reverse_view is set.
6768 (Sized_relobj_file::write_sections): Add layout parameter. Change
6769 all callers. Set is_ctors_reverse_view field of View_size.
6770 (Sized_relobj_file::reverse_words): New function.
6771 * object.h (Sized_relobj_file::View_size): Add
6772 is_ctors_reverse_view field.
6773 (class Sized_relobj_file): Update declarations.
6774 * testsuite/initpri3.c: New test.
6775 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6776 initpri3b.
6777 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6778 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6779 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6780 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6781 * testsuite/Makefile.in: Rebuild.
6782
6783 2011-06-24 Cary Coutant <ccoutant@google.com>
6784
6785 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6786 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6787 (debug_msg_cdebug.err): New targets.
6788 * testsuite/Makefile.in: Regenerate.
6789 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6790 Fix checks for link with shared library.
6791
6792 2011-06-24 Doug Kwan <dougkwan@google.com>
6793
6794 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6795 skip empty text sections.
6796 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6797
6798 2011-06-22 Ian Lance Taylor <iant@google.com>
6799
6800 PR gold/12910
6801 * options.h (class General_options): Add --ctors-in-init-array.
6802 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6803 friends as SHT_PROGBITS for merging sections.
6804 (Layout::layout): Remove special handling of .init_array and
6805 friends. Don't sort if doing relocatable link. Sort for .ctors
6806 and .dtors if ctors_in_init_array.
6807 (Layout::make_output_section): Force correct section types for
6808 .init_array and friends. Don't sort if doing relocatable link,
6809 Don't sort .ctors and .dtors if ctors_in_init_array.
6810 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6811 (Layout::output_section_name): Add relobj parameter. Change all
6812 callers. Handle .ctors. and .dtors. in code rather than table.
6813 Handle .ctors and .dtors if ctors_in_init_array.
6814 (Layout::match_file_name): New function, moved from output.cc.
6815 * layout.h (class Layout): Update declarations.
6816 * output.cc: Include "layout.h".
6817 (Input_section_sort_entry::get_priority): New function.
6818 (Input_section_sort_entry::match_file_name): Just call
6819 Layout::match_file_name.
6820 (Output_section::Input_section_sort_init_fini_compare::operator()):
6821 Handle .ctors and .dtors. Sort by explicit priority rather than
6822 by name.
6823 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6824 * testsuite/initpri2.c: New test.
6825 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6826 (check_PROGRAMS): Add initpri2.
6827 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6828 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6829 * configure, testsuite/Makefile.in: Rebuild.
6830
6831 2011-06-19 Ian Lance Taylor <iant@google.com>
6832
6833 PR gold/12880
6834 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6835 .interp section to a PT_INTERP segment even if we have seen a
6836 --dynamic-linker option. Don't do it if we have seen a PHDRS
6837 clause in a linker script.
6838 (Layout::finalize): Don't create a .interp section if we've
6839 already create a PT_INTERP segment.
6840 (Layout::create_interp): Always call choose_output_section (revert
6841 patch of 2011-06-17). Don't create PT_INTERP segment.
6842 * script-sections.cc
6843 (Script_sections::create_note_and_tls_segments): Add a .interp
6844 section to a PT_INTERP segment even if we have seen a
6845 --dynamic-linker option.
6846
6847 2011-06-18 Ian Lance Taylor <iant@google.com>
6848
6849 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6850 merely because a non-PT_LOAD segment has a dynamic reloc.
6851
6852 2011-06-18 Ian Lance Taylor <iant@google.com>
6853
6854 * layout.cc (Layout::finish_dynamic_section): Don't create
6855 DT_FLAGS entry if not needed.
6856
6857 2011-06-18 Ian Lance Taylor <iant@google.com>
6858
6859 PR gold/12745
6860 * layout.cc (Layout::layout_eh_frame): Correct handling of
6861 writable .eh_frame section.
6862
6863 2011-06-17 Ian Lance Taylor <iant@google.com>
6864
6865 PR gold/12893
6866 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6867 symbol is redefined with the exact same object and value.
6868
6869 2011-06-17 Ian Lance Taylor <iant@google.com>
6870
6871 PR gold/12880
6872 * layout.h (class Layout): Add interp_segment_ field.
6873 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6874 (Layout::attach_allocated_section_to_segment): If making shared
6875 library, put .interp section in PT_INTERP segment.
6876 (Layout::finalize): Also call create_interp if -dynamic-linker
6877 option was used.
6878 (Layout::create_interp): Assert that there is no PT_INTERP
6879 segment. If not using a SECTIONS clause, use make_output_section.
6880 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6881 * script-sections.cc
6882 (Script_sections::create_note_and_tls_segments): If making shared
6883 library, put .interp section in PT_INTERP segment.
6884
6885 2011-06-17 Ian Lance Taylor <iant@google.com>
6886
6887 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6888 when making a shared library.
6889
6890 2011-06-17 Ian Lance Taylor <iant@google.com>
6891
6892 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6893 parameter. Change all callers. Don't issue warning about PC32
6894 against locally defined symbol.
6895
6896 2011-06-16 Ian Lance Taylor <iant@google.com>
6897
6898 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6899 occurs in same object.
6900
6901 2011-06-14 Alan Modra <amodra@gmail.com>
6902
6903 * po/POTFILES.in: Regenerate.
6904
6905 2011-06-09 Ian Lance Taylor <iant@google.com>
6906
6907 * script-sections.cc
6908 (Orphan_output_section::set_section_addresses): For a relocatable
6909 link set address to 0.
6910
6911 2011-06-09 Cary Coutant <ccoutant@google.com>
6912
6913 PR gold/12804
6914 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6915 used with --compress-debug-sections.
6916 * gold/object.cc (Sized_relobj_file::do_layout): Report
6917 uncompressed size of compressed input sections.
6918
6919 2011-06-08 Cary Coutant <ccoutant@google.com>
6920
6921 PR gold/12804
6922 * testsuite/two_file_test_2_v1.cc: Change initialization of
6923 v2 to keep it in .data.
6924
6925 2011-06-07 Cary Coutant <ccoutant@google.com>
6926
6927 * common.cc (Symbol_table::do_allocate_commons_list): Call
6928 gold_fallback.
6929 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6930 (Errors::fallback): New function.
6931 (gold_fallback): New function.
6932 * errors.h (Errors::fallback): New function.
6933 * gold.cc (gold_exit): Change status parameter to enum; adjust
6934 all callers.
6935 (queue_initial_tasks): Call gold_fallback.
6936 * gold.h: Include cstdlib.
6937 (Exit_status): New enum type.
6938 (gold_exit): Change status parameter to enum.
6939 (gold_fallback): New function.
6940 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6941 (Layout::create_symtab_sections): Likewise.
6942 (Layout::create_shdrs): Likewise.
6943 * main.cc (main): Adjust call to gold_exit.
6944 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6945 (Output_data_got::add_got_entry_pair): Likewise.
6946 (Output_section::add_input_section): Likewise.
6947 (Output_section::add_output_section_data): Likewise.
6948 (Output_segment::set_section_list_addresses): Likewise.
6949 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6950
6951 2011-06-07 Cary Coutant <ccoutant@google.com>
6952
6953 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6954 for incremental links.
6955 * output.cc (Output_segment::set_section_list_addresses): Remove
6956 FIXME and test for TLS or BSS.
6957
6958 2011-06-07 Cary Coutant <ccoutant@google.com>
6959
6960 * testsuite/Makefile.am: Add incremental_copy_test,
6961 incremental_common_test_1.
6962 * testsuite/Makefile.in: Regenerate.
6963 * testsuite/common_test_1_v1.c: New source file.
6964 * testsuite/common_test_1_v2.c: New source file.
6965 * testsuite/copy_test_v1.cc: New source file.
6966
6967 2011-06-07 Cary Coutant <ccoutant@google.com>
6968
6969 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6970 update, allocate common from bss section's free list.
6971 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6972 linker-defined symbols.
6973 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6974 Skip GOT and PLT entries that are no longer referenced.
6975 (Output_section_incremental_inputs::write_info_blocks): Mark
6976 linker-defined symbols.
6977 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6978 * output.cc (Output_section::allocate): New function.
6979 * output.h (Output_section::allocate): New function.
6980 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6981 linker-defined symbols.
6982 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6983 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6984 (Symbol::init_base_output_data): Likewise.
6985 (Symbol::init_base_output_segment): Likewise.
6986 (Symbol::init_base_constant): Likewise.
6987 (Sized_symbol::init_output_data): Likewise.
6988 (Sized_symbol::init_output_segment): Likewise.
6989 (Sized_symbol::init_constant): Likewise.
6990 (Symbol_table::do_define_in_output_data): Likewise.
6991 (Symbol_table::do_define_in_output_segment): Likewise.
6992 (Symbol_table::do_define_as_constant): Likewise.
6993 * symtab.h (Symbol::is_predefined): New function.
6994 (Symbol::init_base_output_data): Add is_predefined parameter.
6995 (Symbol::init_base_output_segment): Likewise.
6996 (Symbol::init_base_constant): Likewise.
6997 (Symbol::is_predefined_): New data member.
6998 (Sized_symbol::init_output_data): Add is_predefined parameter.
6999 (Sized_symbol::init_output_segment): Likewise.
7000 (Sized_symbol::init_constant): Likewise.
7001 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
7002
7003 2011-06-07 Cary Coutant <ccoutant@google.com>
7004
7005 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
7006 instead of emit_copy_reloc.
7007 (Copy_relocs::emit_copy_reloc): Refactor.
7008 (Copy_relocs::make_copy_reloc): New function.
7009 (Copy_relocs::add_copy_reloc): Remove.
7010 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
7011 section.
7012 (Copy_relocs::make_copy_reloc): New function.
7013 (Copy_relocs::add_copy_reloc): Remove.
7014 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
7015 unchanged input files.
7016 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
7017 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
7018 Reserve BSS space for COPY relocations.
7019 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7020 (Output_section_incremental_inputs::write_info_blocks): Record
7021 whether a symbol is copied from a shared object.
7022 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
7023 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
7024 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
7025 (Incremental_input_entry_reader::get_output_symbol_index): Add
7026 is_copy parameter.
7027 (Incremental_binary::emit_copy_relocs): New function.
7028 (Incremental_binary::do_emit_copy_relocs): New function.
7029 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7030 new data member.
7031 (Sized_incremental_binary::add_copy_reloc): New function.
7032 (Sized_incremental_binary::do_emit_copy_relocs): New function.
7033 (Sized_incremental_binary::Copy_reloc): New struct.
7034 (Sized_incremental_binary::Copy_relocs): New typedef.
7035 (Sized_incremental_binary::copy_relocs_): New data member.
7036 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
7037 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
7038 * target.h (Sized_target::emit_copy_reloc): New function.
7039 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
7040
7041 2011-06-02 Cary Coutant <ccoutant@google.com>
7042
7043 PR gold/12163
7044 * gold/archive.cc (Archive::Archive): Initialize new data member.
7045 (Archive::include_all_members): Return if archive has already been
7046 included.
7047 * gold/archive.h (Archive::include_all_members_): New data member.
7048
7049 2011-06-02 Nick Clifton <nickc@redhat.com>
7050
7051 * dynobj.h: Fix spelling mistake in comment.
7052 * output.cc: Likewise.
7053
7054 2011-05-31 Doug Kwan <dougkwan@google.com>
7055 Asier Llano
7056
7057 PR gold/12826
7058 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
7059 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
7060 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
7061 redundant arm_exidx_test.so.
7062 * testsuite/Makefile.in: Regenerate.
7063 (check_SCRIPTS): Add pr12826.sh
7064 (check_DATA): Add pr12826.stdout
7065 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
7066 * testsuite/pr12826.sh: New file.
7067 * testsuite/pr12826_1.s: Ditto.
7068 * testsuite/pr12826_1.s: Ditto.
7069
7070 2011-05-30 Ian Lance Taylor <iant@google.com>
7071
7072 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
7073 sections.
7074
7075 2011-05-29 Ian Lance Taylor <iant@google.com>
7076
7077 PR gold/12804
7078 * testsuite/Makefile.am: Use different file name for two_file_test
7079 temporary file for each incremental test.
7080 * testsuite/Makefile.in: Rebuild.
7081
7082 2011-05-29 Ian Lance Taylor <iant@google.com>
7083
7084 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
7085 binary input file is empty.
7086
7087 2011-05-27 Ian Lance Taylor <iant@google.com>
7088
7089 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
7090 (ver_test_9.so): Likewise.
7091 * testsuite/Makefile.in: Rebuild.
7092
7093 2011-05-26 Cary Coutant <ccoutant@google.com>
7094
7095 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
7096 * incremental.cc (Incremental_inputs::report_input_section): Fix
7097 comment, indentation.
7098 (Incremental_inputs::report_comdat_group): New function.
7099 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7100 of data for incremental input file entry.
7101 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
7102 group count, COMDAT group signatures.
7103 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
7104 an unchanged input file.
7105 * incremental.h (Incremental_object_entry::Incremental_object_entry):
7106 Initialize new data member.
7107 (Incremental_object_entry::add_comdat_group): New function.
7108 (Incremental_object_entry::get_comdat_group_count): New function.
7109 (Incremental_object_entry::get_comdat_signature_key): New function.
7110 (Incremental_object_entry::groups_): New data member.
7111 (Incremental_inputs::report_comdat_group): New function.
7112 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
7113 data for incremental input file entry.
7114 (Incremental_input_entry_reader::get_comdat_group_count): New function.
7115 (Incremental_input_entry_reader::get_input_section): Adjust size of
7116 data for incremental input file entry.
7117 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
7118 (Incremental_input_entry_reader::get_comdat_group_signature): New
7119 function.
7120 * object.cc (Sized_relobj::include_section_group): Report kept
7121 COMDAT groups for incremental links.
7122
7123 2011-05-24 David Meyer <pdox@google.com>
7124
7125 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
7126 with name parameter. Add found_name parameter.
7127 * fileread.cc (Input_file::find_file): Adjust code accordingly.
7128 * dirsearch.h (class Dirsearch): Update declaration.
7129
7130 2011-05-24 Ian Lance Taylor <iant@google.com>
7131
7132 * archive.cc (Library_base::should_include_member): Pull in object
7133 from archive if it defines the entry symbol.
7134 * parameters.cc (Parameters::entry): New function.
7135 * parameters.h (class Parameters): Declare entry.
7136 * output.h (class Output_file_header): Remove entry_ field.
7137 * output.cc (Output_file_header::Output_file_header): Remove entry
7138 parameter. Change all callers.
7139 (Output_file_header::entry): Use parameters->entry.
7140 * gold.cc (queue_middle_tasks): Likewise.
7141 * plugin.cc (Plugin_hook::run): Likewise.
7142
7143 2011-05-24 Cary Coutant <ccoutant@google.com>
7144
7145 * gold.cc (queue_initial_tasks): Pass incremental base filename
7146 to Output_file::open_base_file; don't print error message.
7147 * incremental-dump.cc (main): Adjust call to
7148 Output_file::open_for_modification.
7149 * incremental-dump.cc (main): Likewise.
7150 * incremental.cc (Incremental_inputs::report_command_line):
7151 Ignore --incremental-base option when comparing command lines.
7152 Ignore parameter when given as separate argument.
7153 * options.h (class General_options): Add --incremental-base.
7154 * output.cc (Output_file::Output_file):
7155 (Output_file::open_base_file): Add base_name and writable parameters;
7156 read base file into new file; print error message here.
7157 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7158 callers.
7159 * output.h (Output_file::open_for_modification): Rename to...
7160 (Output_file::open_base_file): ...this; add base_name and
7161 writable parameters; adjust all callers.
7162 (Output_file::map_no_anonymous): Add writable parameter; adjust all
7163 callers.
7164 * testsuite/Makefile.am (incremental_test_4): Test
7165 --incremental-base.
7166 * testsuite/Makefile.in: Regenerate.
7167
7168 2011-05-24 Cary Coutant <ccoutant@google.com>
7169
7170 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
7171 incremental_test_4.
7172 * testsuite/Makefile.in: Regenerate.
7173 * testsuite/two_file_test_1_v1.cc: New test source file.
7174 * testsuite/two_file_test_1b_v1.cc: New test source file.
7175 * testsuite/two_file_test_2_v1.cc: New test source file.
7176
7177 2011-05-24 Cary Coutant <ccoutant@google.com>
7178
7179 * dynobj.h (Dynobj::do_dynobj): New function.
7180 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
7181 flag and soname for shared objects.
7182 * incremental.cc (Incremental_inputs::report_object): Make
7183 either Incremental_object_entry or Incremental_dynobj_entry; add
7184 soname to string table.
7185 (Incremental_inputs::report_input_section): Add assertion.
7186 (Output_section_incremental_inputs::set_final_data_size): Adjust
7187 type of input file entry for shared libraries; adjust size of
7188 shared library info entry.
7189 (Output_section_incremental_inputs::write_input_files): Write
7190 as_needed flag for shared libraries.
7191 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7192 of input file entry for shared libraries; write soname.
7193 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7194 soname from incremental info.
7195 * incremental.h (enum Incremental_input_flags): Add
7196 INCREMENTAL_INPUT_AS_NEEDED.
7197 (Incremental_input_entry::Incremental_input_entry): Initialize new
7198 data member.
7199 (Incremental_input_entry::set_as_needed): New function.
7200 (Incremental_input_entry::as_needed): New function.
7201 (Incremental_input_entry::do_dynobj_entry): New function.
7202 (Incremental_input_entry::as_needed_): New data member.
7203 (Incremental_object_entry::Incremental_object_entry): Don't check
7204 for shared library.
7205 (Incremental_object_entry::do_type): Likewise.
7206 (class Incremental_dynobj_entry): New class.
7207 (Incremental_input_entry_reader::as_needed): New function.
7208 (Incremental_input_entry_reader::get_soname): New function.
7209 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7210 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7211 size of shared library info entry.
7212 * layout.cc (Layout::finish_dynamic_section): Don't test for
7213 incremental link when adding DT_NEEDED entries.
7214 * object.h (Object::Object): Initialize new data member.
7215 (Object::dynobj): New function.
7216 (Object::set_as_needed): New function.
7217 (Object::as_needed): New function.
7218 (Object::do_dynobj): New function.
7219 (Object::as_needed_): New data member.
7220
7221 2011-05-24 Cary Coutant <ccoutant@google.com>
7222
7223 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7224 info; adjust display of GOT entries.
7225 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7226 vector of input objects; remove file_status_.
7227 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7228 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7229 got_plt reader; call target hooks to reserve GOT entries.
7230 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7231 of input file info header and GOT info entry.
7232 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7233 relocation info.
7234 (Got_plt_view_info::got_descriptor): Remove.
7235 (Got_plt_view_info::sym_index): New data member.
7236 (Got_plt_view_info::input_index): New data member.
7237 (Local_got_offset_visitor::visit): Write input file index.
7238 (Global_got_offset_visitor::visit): Write 0 for input file index.
7239 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7240 with sym_index and input_index.
7241 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7242 incremental info GOT entry; replace got_descriptor with input_index.
7243 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7244 map from input file index to object.
7245 (Sized_relobj_incr::do_layout): Replace direct data member reference
7246 with accessor function.
7247 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7248 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7249 Adjust size of input file info header.
7250 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7251 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7252 (Incremental_input_entry_reader::get_input_section): Adjust size of
7253 input file info header.
7254 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7255 of incremental info GOT entry.
7256 (Incremental_got_plt_reader::get_got_desc): Remove.
7257 (Incremental_got_plt_reader::get_got_symndx): New function.
7258 (Incremental_got_plt_reader::get_got_input_index): New function.
7259 (Sized_incremental_binary::Sized_incremental_binary): Remove
7260 file_status_; add input_objects_.
7261 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7262 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7263 (Sized_incremental_binary::file_is_unchanged): Remove.
7264 (Sized_incremental_binary::set_input_object): New function.
7265 (Sized_incremental_binary::input_object): New function.
7266 (Sized_incremental_binary::file_status_): Remove.
7267 (Sized_incremental_binary::input_objects_): New data member.
7268 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7269 references.
7270 (Sized_relobj_incr::invalid_address): Move to base class.
7271 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7272 class.
7273 (Sized_relobj_incr::do_output_section_offset): Likewise.
7274 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7275 (Sized_relobj_incr::section_offsets_): Likewise.
7276 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7277 function.
7278 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7279 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7280 with accessor function.
7281 (Sized_relobj_file::do_layout): Likewise.
7282 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7283 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7284 (Sized_relobj_file::compute_final_local_value): Replace refs to
7285 section_offsets_ with accessor function.
7286 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7287 * object.h (Relobj::Relobj): Initialize new data members.
7288 (Relobj::add_dyn_reloc): New function.
7289 (Relobj::first_dyn_reloc): New function.
7290 (Relobj::dyn_reloc_count): New function.
7291 (Relobj::first_dyn_reloc_): New data member.
7292 (Relobj::dyn_reloc_count_): New data member.
7293 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7294 references.
7295 (Sized_relobj::Address): New typedef.
7296 (Sized_relobj::invalid_address): Move here from child class.
7297 (Sized_relobj::Sized_relobj): Initialize new data members.
7298 (Sized_relobj::sized_relobj): New function.
7299 (Sized_relobj::is_output_section_offset_invalid): Move here from
7300 child class.
7301 (Sized_relobj::get_output_section_offset): Likewise.
7302 (Sized_relobj::local_has_got_offset): Likewise.
7303 (Sized_relobj::local_got_offset): Likewise.
7304 (Sized_relobj::set_local_got_offset): Likewise.
7305 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7306 (Sized_relobj::clear_got_offsets): New function.
7307 (Sized_relobj::section_offsets): Move here from child class.
7308 (Sized_relobj::do_output_section_offset): Likewise.
7309 (Sized_relobj::do_set_section_offset): Likewise.
7310 (Sized_relobj::Local_got_offsets): Likewise.
7311 (Sized_relobj::local_got_offsets_): Likewise.
7312 (Sized_relobj::section_offsets_): Likewise.
7313 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7314 references.
7315 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7316 class.
7317 (Sized_relobj_file::sized_relobj): New function
7318 (Sized_relobj_file::local_has_got_offset): Move to base class.
7319 (Sized_relobj_file::local_got_offset): Likewise.
7320 (Sized_relobj_file::set_local_got_offset): Likewise.
7321 (Sized_relobj_file::get_output_section_offset): Likewise.
7322 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7323 (Sized_relobj_file::do_output_section_offset): Likewise.
7324 (Sized_relobj_file::do_set_section_offset): Likewise.
7325 (Sized_relobj_file::Local_got_offsets): Likewise.
7326 (Sized_relobj_file::local_got_offsets_): Likewise.
7327 (Sized_relobj_file::section_offsets_): Likewise.
7328 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7329 (all constructors).
7330 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7331 (Output_reloc::get_symbol_index): Likewise.
7332 (Output_reloc::local_section_offset): Likewise.
7333 (Output_reloc::get_address): Likewise.
7334 (Output_reloc::symbol_value): Likewise.
7335 (Output_data_got::reserve_slot): Move to class definition.
7336 (Output_data_got::reserve_local): New function.
7337 (Output_data_got::reserve_slot_for_global): Remove.
7338 (Output_data_got::reserve_global): New function.
7339 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7340 (all constructors, two instantiations).
7341 (Output_reloc::get_relobj): New function (two instantiations).
7342 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7343 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7344 (Output_data_reloc::add_global): Adjust type of relobj.
7345 (Output_data_reloc::add_global_relative): Likewise.
7346 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7347 (Output_data_reloc::add_local): Likewise.
7348 (Output_data_reloc::add_local_relative): Likewise.
7349 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7350 (Output_data_reloc::add_local_section): Likewise.
7351 (Output_data_reloc::add_output_section): Likewise.
7352 (Output_data_reloc::add_absolute): Likewise.
7353 (Output_data_reloc::add_target_specific): Likewise.
7354 (Output_data_got::reserve_slot): Move definition here.
7355 (Output_data_got::reserve_local): New function.
7356 (Output_data_got::reserve_global): New function.
7357 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7358 section_offsets_ with accessor function.
7359 (Sized_relobj_file::write_sections): Likewise.
7360 (Sized_relobj_file::do_relocate_sections): Likewise.
7361 * target.h (Sized_target::reserve_local_got_entry): New function.
7362 (Sized_target::reserve_global_got_entry): New function.
7363 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7364 (Target_x86_64::reserve_global_got_entry): New function.
7365 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7366
7367 2011-05-23 Cary Coutant <ccoutant@google.com>
7368
7369 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7370 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7371 bit when checking got_type.
7372 * incremental.cc (Sized_incremental_binary::setup_readers):
7373 Store symbol table and string table locations; initialize bit vector
7374 of file status flags.
7375 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7376 unchanged files.
7377 (Sized_incremental_binary::do_process_got_plt): New function.
7378 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7379 (Output_section_incremental_inputs::set_final_data_size): Record
7380 file index for each input file.
7381 (Output_section_incremental_inputs::write_got_plt): Store file index
7382 instead of input entry offset for each GOT entry.
7383 * incremental.h
7384 (Incremental_input_entry::Incremental_input_entry): Initialize new
7385 data member.
7386 (Incremental_input_entry::set_offset): Store file index.
7387 (Incremental_input_entry::get_file_index): New function.
7388 (Incremental_input_entry::file_index_): New data member.
7389 (Incremental_binary::process_got_plt): New function.
7390 (Incremental_binary::do_process_got_plt): New function.
7391 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7392 data members.
7393 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7394 (Sized_incremental_binary::set_file_is_unchanged): New function.
7395 (Sized_incremental_binary::file_is_unchanged): New function.
7396 (Sized_incremental_binary::do_process_got_plt): New function.
7397 (Sized_incremental_binary::file_status_): New data member.
7398 (Sized_incremental_binary::main_symtab_loc_): New data member.
7399 (Sized_incremental_binary::main_strtab_loc_): New data member.
7400 * output.cc (Output_data_got::Got_entry::write): Add case
7401 RESERVED_CODE.
7402 (Output_data_got::add_global): Call add_got_entry.
7403 (Output_data_got::add_global_plt): Likewise.
7404 (Output_data_got::add_global_with_rel): Likewise.
7405 (Output_data_got::add_global_with_rela): Likewise.
7406 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7407 (Output_data_got::add_global_pair_with_rela): Likewise.
7408 (Output_data_got::add_local): Call add_got_entry.
7409 (Output_data_got::add_local_plt): Likewise.
7410 (Output_data_got::add_local_with_rel): Likewise.
7411 (Output_data_got::add_local_with_rela): Likewise.
7412 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7413 (Output_data_got::add_local_pair_with_rela): Likewise.
7414 (Output_data_got::reserve_slot): New function.
7415 (Output_data_got::reserve_slot_for_global): New function.
7416 (Output_data_got::add_got_entry): New function.
7417 (Output_data_got::add_got_entry_pair): New function.
7418 (Output_section::add_output_section_data): Edit FIXME.
7419 * output.h
7420 (Output_section_data_build::Output_section_data_build): New
7421 constructor with size parameter.
7422 (Output_data_space::Output_data_space): Likewise.
7423 (Output_data_got::Output_data_got): Initialize new data member; new
7424 constructor with size parameter.
7425 (Output_data_got::add_constant): Call add_got_entry.
7426 (Output_data_got::reserve_slot): New function.
7427 (Output_data_got::reserve_slot_for_global): New function.
7428 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7429 (Output_data_got::add_got_entry): New function.
7430 (Output_data_got::add_got_entry_pair): New function.
7431 (Output_data_got::free_list_): New data member.
7432 * target.h (Sized_target::init_got_plt_for_update): New function.
7433 (Sized_target::register_global_plt_entry): New function.
7434 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7435 Initialize new data member; call init; add constructor with PLT count.
7436 (Output_data_plt_x86_64::init): New function.
7437 (Output_data_plt_x86_64::add_relocation): New function.
7438 (Output_data_plt_x86_64::reserve_slot): New function.
7439 (Output_data_plt_x86_64::free_list_): New data member.
7440 (Target_x86_64::init_got_plt_for_update): New function.
7441 (Target_x86_64::register_global_plt_entry): New function.
7442 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7443 incremental updates.
7444 (Output_data_plt_x86_64::add_relocation): New function.
7445 * testsuite/object_unittest.cc (Object_test): Set default options.
7446
7447 2011-05-16 Ian Lance Taylor <iant@google.com>
7448
7449 * options.h (class General_options): Make -i a synonym for -r.
7450
7451 2011-05-16 Ian Lance Taylor <iant@google.com>
7452
7453 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7454
7455 2011-05-10 Cary Coutant <ccoutant@google.com>
7456
7457 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7458 strip_all (-s).
7459
7460 2011-05-06 Ian Lance Taylor <iant@google.com>
7461
7462 * layout.cc (Layout::layout): If the output section flags change,
7463 update the ordering.
7464
7465 2011-04-25 Cary Coutant <ccoutant@google.com>
7466
7467 * incremental-dump.cc (dump_incremental_inputs): Print local
7468 symbol info for each input file.
7469 * incremental.cc
7470 (Output_section_incremental_inputs::set_final_data_size): Add local
7471 symbol info to input file entries in incremental info.
7472 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7473 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7474 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7475 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7476 implementation.
7477 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7478 (Sized_incr_relobj::do_relocate): Write the local symbols.
7479 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7480 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7481 Adjust size of input file header.
7482 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7483 (Incremental_inputs_reader::get_local_symbol_count): New function.
7484 (Incremental_inputs_reader::get_input_section): Adjust size of input
7485 file header.
7486 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7487 (Sized_incr_relobj::This): New typedef.
7488 (Sized_incr_relobj::sym_size): New const data member.
7489 (Sized_incr_relobj::Local_symbol): New struct.
7490 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7491 (Sized_incr_relobj::do_local_symbol_offset): New function.
7492 (Sized_incr_relobj::local_symbol_count_): New data member.
7493 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7494 (Sized_incr_relobj::local_symbol_index_): New data member.
7495 (Sized_incr_relobj::local_symbol_offset_): New data member.
7496 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7497 (Sized_incr_relobj::local_symbols_): New data member.
7498 * object.h (Relobj::output_local_symbol_count): New function.
7499 (Relobj::local_symbol_offset): New function.
7500 (Relobj::do_output_local_symbol_count): New function.
7501 (Relobj::do_local_symbol_offset): New function.
7502 (Sized_relobj::do_output_local_symbol_count): New function.
7503 (Sized_relobj::do_local_symbol_offset): New function.
7504
7505 2011-04-22 Vladimir Simonov <sv@sw.ru>
7506
7507 * descriptors.cc (set_close_on_exec): New function.
7508 (Descriptors::open): Use set_close_on_exec.
7509 * output.cc (S_ISLNK): Define if not defined.
7510
7511 2011-04-22 Cary Coutant <ccoutant@google.com>
7512
7513 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7514 global symbol map.
7515 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7516 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7517 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7518 relocations.
7519 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7520 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7521 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7522 * incremental.h
7523 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7524 function.
7525 (Incremental_binary::apply_incremental_relocs): New function.
7526 (Incremental_binary::do_apply_incremental_relocs): New function.
7527 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7528 data member.
7529 (Sized_incremental_binary::add_global_symbol): New function.
7530 (Sized_incremental_binary::global_symbol): New function.
7531 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7532 (Sized_incremental_binary::symbol_map_): New data member.
7533 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7534 * target.h (Sized_target::apply_relocation): New function.
7535 * target-reloc.h (apply_relocation): New function.
7536 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7537
7538 2011-04-22 Doug Kwan <dougkwan@google.com>
7539
7540 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7541 flag of a SHT_ARM_EXIDX section.
7542 * testsuite/Makefile.am (arm_exidx_test): New test rules.
7543 * testsuite/Makefile.in: Regenerate.
7544 * testsuite/arm_exidx_test.s: New file.
7545 * testsuite/arm_exidx_test.sh: Same.
7546
7547 2011-04-20 Cary Coutant <ccoutant@google.com>
7548
7549 PR gold/12689
7550 * archive.h (Incremental_archive_entry::Archive_member):
7551 Initialize arg_serial_ (second constructor).
7552
7553 2011-04-17 Ian Lance Taylor <iant@google.com>
7554
7555 * object.cc (Relocate_info::location): Simplify location string.
7556 * errors.cc (Errors::error_at_location): Don't print program
7557 name.
7558 (Errors::warning_at_location): Likewise.
7559 (Errors::undefined_symbol): Likewise.
7560 * testsuite/debug_msg.sh: Update accordingly.
7561
7562 2011-04-14 Cary Coutant <ccoutant@google.com>
7563
7564 * gold/layout.cc (Layout::symtab_section_offset): New function.
7565 * gold/layout.h (Layout::symtab_section_offset): New function.
7566 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7567
7568 2011-04-12 Ian Lance Taylor <iant@google.com>
7569
7570 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7571 with MREMAP_MAYMOVE.
7572 * output.h (class Output_file): Add map_is_allocated_ field.
7573 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7574 not available, provide stubs. If mremap is not available, #define
7575 it to gold_mremap.
7576 (MREMAP_MAYMOVE): Define if not defined.
7577 (Output_file::Output_file): Initialize map_is_allocated_.
7578 (Output_file::resize): Check map_is_allocated_.
7579 (Output_file::map_anonymous): If mmap fails, use malloc.
7580 (Output_file::unmap): Don't do anything for an anonymous map.
7581 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7582 is not available, provide stubs.
7583 (File_read::View::~View): Use free rather than delete[].
7584 (File_read::make_view): Use malloc rather than new[]. If mmap
7585 fails, use malloc.
7586 (File_read::find_or_make_view): Use malloc rather than new[].
7587 * gold.h: Remove HAVE_REMAP code.
7588 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7589 exists. Rename mremap to gold_mremap. If mmap is not available
7590 don't do anything.
7591 * configure, config.in: Rebuild.
7592
7593 2011-04-11 Ian Lance Taylor <iant@google.com>
7594
7595 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7596 initialize local variable v.
7597
7598 2011-04-11 Cary Coutant <ccoutant@google.com>
7599
7600 * archive.cc (Archive::include_member): Adjust call to
7601 report_object.
7602 (Add_archive_symbols::run): Track argument serial numbers.
7603 (Lib_group::include_member): Likewise.
7604 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7605 * archive.h (Incremental_archive_entry::Archive_member):
7606 Initialize arg_serial_.
7607 (Archive_member::arg_serial_): New data member.
7608 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7609 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7610 incremental link.
7611 (Sized_dynobj::do_for_all_local_got_entries): New function.
7612 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7613 function.
7614 * fileread.cc (get_mtime): New function.
7615 * fileread.h (get_mtime): New function.
7616 * gold.cc (queue_initial_tasks): Check for incremental update.
7617 (process_incremental_input): New function.
7618 (queue_middle_tasks): Don't force valid target for incremental
7619 update.
7620 * incremental-dump.cc (find_input_containing_global): Adjust
7621 size of symbol info entry.
7622 (dump_incremental_inputs): Dump argument serial number and
7623 in_system_directory flag; bias shndx by 1; print symbol names
7624 when dumping per-file symbol lists; use new symbol info readers.
7625 * incremental.cc
7626 (Output_section_incremental_inputs:update_data_size): New function.
7627 (Sized_incremental_binary::setup_readers): Setup input readers
7628 for each input file; build maps for files added from libraries
7629 and scripts.
7630 (Sized_incremental_binary::check_input_args): New function.
7631 (Sized_incremental_binary::do_check_inputs): Build map of argument
7632 serial numbers to input arguments.
7633 (Sized_incremental_binary::do_file_has_changed): Rename
7634 do_file_is_unchanged to this; compare file modification times.
7635 (Sized_incremental_binary::do_init_layout): New function.
7636 (Sized_incremental_binary::do_reserve_layout): New function.
7637 (Sized_incremental_binary::do_get_input_reader): Remove.
7638 (Sized_incremental_binary::get_symtab_view): New function.
7639 (Incremental_checker::can_incrementally_link_output_file): Remove.
7640 (Incremental_inputs::report_command_line): Exclude --debug options.
7641 (Incremental_inputs::report_archive_begin): Add parameter; track
7642 argument serial numbers; don't put input file entry for archive
7643 before archive members.
7644 (Incremental_inputs::report_archive_end): Put input file entry
7645 for archive after archive members.
7646 (Incremental_inputs::report_object): Add parameter; track argument
7647 serial numbers and in_system_directory flag.
7648 (Incremental_inputs::report_script): Add parameter; track argument
7649 serial numbers.
7650 (Output_section_incremental_inputs::set_final_data_size): Adjust
7651 size of symbol info entry; check for forwarding symbols.
7652 (Output_section_incremental_inputs::write_input_files): Write
7653 in_system_directory flag and argument serial number.
7654 (Output_section_incremental_inputs::write_info_blocks): Map section
7655 indices between incremental info and original input file; store
7656 input section index for each symbol.
7657 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7658 change operator() to visit().
7659 (class Global_got_offset_visitor): Likewise.
7660 (class Global_symbol_visitor_got_plt):
7661 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7662 classes.
7663 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7664 (Sized_incr_relobj::do_read_symbols): New function.
7665 (Sized_incr_relobj::do_layout): New function.
7666 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7667 (Sized_incr_relobj::do_add_symbols): New function.
7668 (Sized_incr_relobj::do_should_include_member): New function.
7669 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7670 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7671 (Sized_incr_relobj::do_section_size): New function.
7672 (Sized_incr_relobj::do_section_name): New function.
7673 (Sized_incr_relobj::do_section_contents): New function.
7674 (Sized_incr_relobj::do_section_flags): New function.
7675 (Sized_incr_relobj::do_section_entsize): New function.
7676 (Sized_incr_relobj::do_section_address): New function.
7677 (Sized_incr_relobj::do_section_type): New function.
7678 (Sized_incr_relobj::do_section_link): New function.
7679 (Sized_incr_relobj::do_section_info): New function.
7680 (Sized_incr_relobj::do_section_addralign): New function.
7681 (Sized_incr_relobj::do_initialize_xindex): New function.
7682 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7683 (Sized_incr_relobj::do_read_relocs): New function.
7684 (Sized_incr_relobj::do_gc_process_relocs): New function.
7685 (Sized_incr_relobj::do_scan_relocs): New function.
7686 (Sized_incr_relobj::do_count_local_symbols): New function.
7687 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7688 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7689 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7690 (Sized_incr_relobj::do_relocate): New function.
7691 (Sized_incr_relobj::do_set_section_offset): New function.
7692 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7693 (Sized_incr_dynobj::do_read_symbols): New function.
7694 (Sized_incr_dynobj::do_layout): New function.
7695 (Sized_incr_dynobj::do_add_symbols): New function.
7696 (Sized_incr_dynobj::do_should_include_member): New function.
7697 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7698 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7699 (Sized_incr_dynobj::do_section_size): New function.
7700 (Sized_incr_dynobj::do_section_name): New function.
7701 (Sized_incr_dynobj::do_section_contents): New function.
7702 (Sized_incr_dynobj::do_section_flags): New function.
7703 (Sized_incr_dynobj::do_section_entsize): New function.
7704 (Sized_incr_dynobj::do_section_address): New function.
7705 (Sized_incr_dynobj::do_section_type): New function.
7706 (Sized_incr_dynobj::do_section_link): New function.
7707 (Sized_incr_dynobj::do_section_info): New function.
7708 (Sized_incr_dynobj::do_section_addralign): New function.
7709 (Sized_incr_dynobj::do_initialize_xindex): New function.
7710 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7711 (make_sized_incremental_object): New function.
7712 (Incremental_library::copy_unused_symbols): New function.
7713 (Incremental_library::do_for_all_unused_symbols): New function.
7714 * incremental.h (enum Incremental_input_flags): New type.
7715 (class Incremental_checker): Remove.
7716 (Incremental_input_entry::Incremental_input_entry): Add argument
7717 serial number.
7718 (Incremental_input_entry::arg_serial): New function.
7719 (Incremental_input_entry::set_is_in_system_directory): New function.
7720 (Incremental_input_entry::is_in_system_directory): New function.
7721 (Incremental_input_entry::arg_serial_): New data member.
7722 (Incremental_input_entry::is_in_system_directory_): New data member.
7723 (class Script_info): Move here from script.h.
7724 (Script_info::Script_info): Add filename parameter.
7725 (Script_info::filename): New function.
7726 (Script_info::filename_): New data member.
7727 (Incremental_script_entry::Incremental_script_entry): Add argument
7728 serial number.
7729 (Incremental_object_entry::Incremental_object_entry): Likewise.
7730 (Incremental_object_entry::add_input_section): Build list of input
7731 sections with map to original shndx.
7732 (Incremental_object_entry::get_input_section_index): New function.
7733 (Incremental_object_entry::shndx_): New data member.
7734 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7735 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7736 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7737 serial number.
7738 (Incremental_inputs::report_archive_begin): Likewise.
7739 (Incremental_inputs::report_object): Likewise.
7740 (Incremental_inputs::report_script): Likewise.
7741 (class Incremental_global_symbol_reader): New class.
7742 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7743 and store flags and input file type.
7744 (Incremental_input_entry_reader::arg_serial): New function.
7745 (Incremental_input_entry_reader::type): Extract type from flags.
7746 (Incremental_input_entry_reader::is_in_system_directory): New function.
7747 (Incremental_input_entry_reader::get_input_section_count): Call
7748 accessor function for type.
7749 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7750 function for type; adjust size of global symbol entry.
7751 (Incremental_input_entry_reader::get_global_symbol_count): Call
7752 accessor function for type.
7753 (Incremental_input_entry_reader::get_object_count): Likewise.
7754 (Incremental_input_entry_reader::get_object_offset): Likewise.
7755 (Incremental_input_entry_reader::get_member_count): Likewise.
7756 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7757 (Incremental_input_entry_reader::get_member_offset): Likewise.
7758 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7759 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7760 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7761 (Incremental_input_entry_reader::get_global_symbol_reader): New
7762 function.
7763 (Incremental_input_entry_reader::get_output_symbol_index): New
7764 function.
7765 (Incremental_input_entry_reader::type_): Remove.
7766 (Incremental_input_entry_reader::flags_): New data member.
7767 (Incremental_inputs_reader::input_file_offset): New function.
7768 (Incremental_inputs_reader::input_file_index): New function.
7769 (Incremental_inputs_reader::input_file): Call input_file_offset.
7770 (Incremental_inputs_reader::input_file_at_offset): New function.
7771 (Incremental_relocs_reader::get_r_type): Reformat.
7772 (Incremental_relocs_reader::get_r_shndx): Reformat.
7773 (Incremental_relocs_reader::get_r_offset): Reformat.
7774 (Incremental_relocs_reader::data): New function.
7775 (Incremental_binary::Incremental_binary): Initialize new data members.
7776 (Incremental_binary::check_inputs): Add cmdline parameter.
7777 (Incremental_binary::file_is_unchanged): Remove.
7778 (Input_reader::arg_serial): New function.
7779 (Input_reader::get_unused_symbol_count): New function.
7780 (Input_reader::get_unused_symbol): New function.
7781 (Input_reader::do_arg_serial): New function.
7782 (Input_reader::do_get_unused_symbol_count): New function.
7783 (Input_reader::do_get_unused_symbol): New function.
7784 (Incremental_binary::input_file_count): New function.
7785 (Incremental_binary::get_input_reader): Change signature to use
7786 index instead of filename.
7787 (Incremental_binary::file_has_changed): New function.
7788 (Incremental_binary::get_input_argument): New function.
7789 (Incremental_binary::get_library): New function.
7790 (Incremental_binary::get_script_info): New function.
7791 (Incremental_binary::init_layout): New function.
7792 (Incremental_binary::reserve_layout): New function.
7793 (Incremental_binary::output_file): New function.
7794 (Incremental_binary::do_check_inputs): New function.
7795 (Incremental_binary::do_file_is_unchanged): Remove.
7796 (Incremental_binary::do_file_has_changed): New function.
7797 (Incremental_binary::do_init_layout): New function.
7798 (Incremental_binary::do_reserve_layout): New function.
7799 (Incremental_binary::do_input_file_count): New function.
7800 (Incremental_binary::do_get_input_reader): Change signature.
7801 (Incremental_binary::input_args_map_): New data member.
7802 (Incremental_binary::library_map_): New data member.
7803 (Incremental_binary::script_map_): New data member.
7804 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7805 new data members.
7806 (Sized_incremental_binary::output_section): New function.
7807 (Sized_incremental_binary::inputs_reader): Add const.
7808 (Sized_incremental_binary::symtab_reader): Add const.
7809 (Sized_incremental_binary::relocs_reader): Add const.
7810 (Sized_incremental_binary::got_plt_reader): Add const.
7811 (Sized_incremental_binary::get_symtab_view): New function.
7812 (Sized_incremental_binary::Inputs_reader): New typedef.
7813 (Sized_incremental_binary::Input_entry_reader): New typedef.
7814 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7815 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7816 (Sized_incremental_binary::do_file_has_changed): New function.
7817 (Sized_incremental_binary::do_init_layout): New function.
7818 (Sized_incremental_binary::do_reserve_layout): New function.
7819 (Sized_input_reader::Inputs_reader): Remove.
7820 (Sized_input_reader::Input_entry_reader): Remove.
7821 (Sized_input_reader::do_arg_serial): New function.
7822 (Sized_input_reader::do_get_unused_symbol_count): New function.
7823 (Sized_input_reader::do_get_unused_symbol): New function.
7824 (Sized_incremental_binary::do_input_file_count): New function.
7825 (Sized_incremental_binary::do_get_input_reader): Change signature;
7826 use index instead of filename.
7827 (Sized_incremental_binary::section_map_): New data member.
7828 (Sized_incremental_binary::input_entry_readers_): New data member.
7829 (class Sized_incr_relobj): New class.
7830 (class Sized_incr_dynobj): New class.
7831 (make_sized_incremental_object): New function.
7832 (class Incremental_library): New class.
7833 * layout.cc (Free_list::num_lists): New static data member.
7834 (Free_list::num_nodes): New static data member.
7835 (Free_list::num_removes): New static data member.
7836 (Free_list::num_remove_visits): New static data member.
7837 (Free_list::num_allocates): New static data member.
7838 (Free_list::num_allocate_visits): New static data member.
7839 (Free_list::init): New function.
7840 (Free_list::remove): New function.
7841 (Free_list::allocate): New function.
7842 (Free_list::dump): New function.
7843 (Free_list::print_stats): New function.
7844 (Layout_task_runner::run): Resize output file for incremental updates.
7845 (Layout::Layout): Initialize new data members.
7846 (Layout::set_incremental_base): New function.
7847 (Layout::init_fixed_output_section): New function.
7848 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7849 incremental updates.
7850 (Layout::create_gold_note): Do not create gold note section for
7851 incremental updates.
7852 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7853 for incremental updates.
7854 (Layout::set_section_offsets): For incremental updates, allocate space
7855 from free list.
7856 (Layout::create_symtab_sections): Layout with offsets relative to
7857 start of section; for incremental updates, allocate space from free
7858 list.
7859 (Layout::create_shdrs): For incremental updates, allocate space from
7860 free list.
7861 (Layout::finish_dynamic_section): For incremental updates, do not
7862 check --as-needed (fixed in subsequent patch).
7863 * layout.h (class Free_list): New class.
7864 (Layout::set_incremental_base): New function.
7865 (Layout::incremental_base): New function.
7866 (Layout::init_fixed_output_section): New function.
7867 (Layout::allocate): New function.
7868 (Layout::incremental_base_): New data member.
7869 (Layout::free_list_): New data member.
7870 * main.cc (main): Print Free_list statistics.
7871 * object.cc (Relobj::finalize_incremental_relocs): Add
7872 clear_counts parameter; clear counts only when clear_counts is set.
7873 (Sized_relobj::Sized_relobj): Initialize new base class.
7874 (Sized_relobj::do_layout): Don't report special sections.
7875 (Sized_relobj::do_for_all_local_got_entries): New function.
7876 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7877 symtab_off to all symbol table offsets.
7878 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7879 * object.h (class Got_offset_list): Move to top of file.
7880 (Object::Object): Allow case where input_file == NULL.
7881 (Object::~Object): Likewise.
7882 (Object::input_file): Assert that input_file != NULL.
7883 (Object::lock): Allow case where input_file == NULL.
7884 (Object::unlock): Likewise.
7885 (Object::is_locked): Likewise.
7886 (Object::token): Likewise.
7887 (Object::release): Likewise.
7888 (Object::is_incremental): New function.
7889 (Object::get_mtime): New function.
7890 (Object::for_all_local_got_entries): New function.
7891 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7892 (Object::set_is_in_system_directory): New function.
7893 (Object::is_in_system_directory): New function.
7894 (Object::do_is_incremental): New function.
7895 (Object::do_get_mtime): New function.
7896 (Object::do_for_all_local_got_entries): New function.
7897 (Object::is_in_system_directory_): New data member.
7898 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7899 (class Sized_relobj_base): New class.
7900 (class Sized_relobj): Derive from Sized_relobj_base.
7901 (class Sized_relobj::Symbols): Redeclare from base class.
7902 (class Sized_relobj::local_got_offset_list): Remove.
7903 (class Sized_relobj::Output_sections): Redeclare from base class.
7904 (class Sized_relobj::do_for_all_local_got_entries): New function.
7905 (class Sized_relobj::write_local_symbols): Add offset parameter.
7906 (class Sized_relobj::local_symbol_offset_): Update comment.
7907 (class Sized_relobj::local_dynsym_offset_): Update comment.
7908 * options.cc (Input_arguments::add_file): Remove const.
7909 * options.h (Input_file_argument::Input_file_argument):
7910 Initialize arg_serial_ (all constructors).
7911 (Input_file_argument::set_arg_serial): New function.
7912 (Input_file_argument::arg_serial): New function.
7913 (Input_file_argument::arg_serial_): New data member.
7914 (Input_arguments::Input_arguments): Initialize file_count_.
7915 (Input_arguments::add_file): Remove const.
7916 (Input_arguments::number_of_input_files): New function.
7917 (Input_arguments::file_count_): New data member.
7918 (Command_line::number_of_input_files): Call
7919 Input_arguments::number_of_input_files.
7920 * output.cc (Output_segment_headers::Output_segment_headers):
7921 Set current size.
7922 (Output_section::Input_section::current_data_size): New function.
7923 (Output_section::Output_section): Initialize new data members.
7924 (Output_section::add_input_section): Don't do merge sections for
7925 an incremental link; allocate space from free list for an
7926 incremental update.
7927 (Output_section::add_output_section_data): Allocate space from
7928 free list for an incremental update.
7929 (Output_section::update_data_size): New function.
7930 (Output_section::set_fixed_layout): New function.
7931 (Output_section::reserve): New function.
7932 (Output_segment::set_section_addresses): Remove const.
7933 (Output_segment::set_section_list_addresses): Remove const; allocate
7934 space from free list for an incremental update.
7935 (Output_segment::set_offset): Adjust size of RELRO segment for an
7936 incremental update.
7937 * output.h (Output_data::current_data_size): Move here from
7938 child classes.
7939 (Output_data::pre_finalize_data_size): New function.
7940 (Output_data::update_data_size): New function.
7941 (Output_section_headers::update_data_size): new function.
7942 (Output_section_data_build::current_data_size): Move to Output_data.
7943 (Output_data_strtab::update_data_size): New function.
7944 (Output_section::current_data_size): Move to Output_data.
7945 (Output_section::set_fixed_layout): New function.
7946 (Output_section::has_fixed_layout): New function.
7947 (Output_section::reserve): New function.
7948 (Output_section::update_data_size): New function.
7949 (Output_section::has_fixed_layout_): New data member.
7950 (Output_section::free_list_): New data member.
7951 (Output_segment::set_section_addresses): Remove const.
7952 (Output_segment::set_section_list_addresses): Remove const.
7953 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7954 New function.
7955 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7956 New function.
7957 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7958 parameter when calling Add_symbols constructor; store argument
7959 serial number for members of a lib group.
7960 (Add_symbols::locks): Allow case where token == NULL.
7961 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7962 (Read_member::~Read_member): New function.
7963 (Read_member::is_runnable): New function.
7964 (Read_member::locks): New function.
7965 (Read_member::run): New function.
7966 (Check_script::~Check_script): New function.
7967 (Check_script::is_runnable): New function.
7968 (Check_script::locks): New function.
7969 (Check_script::run): New function.
7970 (Check_library::~Check_library): New function.
7971 (Check_library::is_runnable): New function.
7972 (Check_library::locks): New function.
7973 (Check_library::run): New function.
7974 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7975 (Add_symbols::library_): New data member.
7976 (class Read_member): New class.
7977 (class Check_script): New class.
7978 (class Check_library): New class.
7979 * reloc.cc (Read_relocs::is_runnable): Allow case where
7980 token == NULL.
7981 (Read_relocs::locks): Likewise.
7982 (Scan_relocs::locks): Likewise.
7983 (Relocate_task::locks): Likewise.
7984 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7985 to clear counters.
7986 (Sized_relobj::incremental_relocs_scan): Fix comment.
7987 (Sized_relobj::do_relocate): Pass output file offset to
7988 write_local_symbols.
7989 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7990 from class declaration.
7991 * script.cc (read_input_script): Allocate Script_info; pass
7992 argument serial number to report_script.
7993 * script.h (class Script_info): Move to incremental.h.
7994 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7995 * symtab.h (Symbol_table::add_from_incrobj): New function.
7996 (Symbol_table::set_file_offset): New function.
7997
7998 2011-04-05 Cary Coutant <ccoutant@google.com>
7999
8000 * incremental-dump.cc (dump_incremental_inputs): Change signature
8001 to take a Sized_incremental_binary; change caller. Use readers
8002 in Sized_incremental_binary.
8003 * incremental.cc
8004 (Sized_incremental_binary::find_incremental_inputs_sections):
8005 Rename do_find_incremental_inputs_sections to this.
8006 (Sized_incremental_binary::setup_readers): New function.
8007 (Sized_incremental_binary::do_check_inputs): Check
8008 has_incremental_info_ flag; move setup code to setup_readers;
8009 use input readers.
8010 (Sized_incremental_binary::do_file_is_unchanged): New function.
8011 (Sized_incremental_binary::do_get_input_reader): New function.
8012 * incremental.h (class Incremental_binary): Move to end of file.
8013 (Incremental_binary::file_is_unchanged): New function.
8014 (Incremental_binary::do_file_is_unchanged): New function.
8015 (Incremental_binary::Input_reader): New class.
8016 (Incremental_binary::get_input_reader): New function.
8017 (class Sized_incremental_binary): Move to end of file.
8018 (Sized_incremental_binary::Sized_incremental_binary): Setup the
8019 input section reader classes.
8020 (Sized_incremental_binary::has_incremental_info): New function.
8021 (Sized_incremental_binary::inputs_reader): New function.
8022 (Sized_incremental_binary::symtab_reader): New function.
8023 (Sized_incremental_binary::relocs_reader): New function.
8024 (Sized_incremental_binary::got_plt_reader): New function.
8025 (Sized_incremental_binary::do_file_is_unchanged): New function.
8026 (Sized_incremental_binary::Sized_input_reader): New class.
8027 (Sized_incremental_binary::get_input_reader): New function.
8028 (Sized_incremental_binary::find_incremental_inputs_sections):
8029 Rename do_find_incremental_inputs_sections to this.
8030 (Sized_incremental_binary::setup_readers): New function.
8031 (Sized_incremental_binary::has_incremental_info_): New data member.
8032 (Sized_incremental_binary::inputs_reader_): New data member.
8033 (Sized_incremental_binary::symtab_reader_): New data member.
8034 (Sized_incremental_binary::relocs_reader_): New data member.
8035 (Sized_incremental_binary::got_plt_reader_): New data member.
8036 (Sized_incremental_binary::current_input_file_): New data member.
8037
8038 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
8039
8040 PR gold/12640
8041 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
8042 violation.
8043
8044 2011-03-30 Cary Coutant <ccoutant@google.com>
8045
8046 * archive.cc (Archive::include_member): Adjust call to report_object.
8047 (Add_archive_symbols::run): Add script_info to call to
8048 report_archive_begin.
8049 (Lib_group::include_member): Adjust call to report_object.
8050 (Add_lib_group_symbols::run): Adjust call to report_object.
8051 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
8052 blocks. Add object count for script input files.
8053 * incremental.cc (Incremental_inputs::report_archive_begin): Add
8054 script_info parameter; change all callers.
8055 (Incremental_inputs::report_object): Add script_info parameter;
8056 change all callers.
8057 (Incremental_inputs::report_script): Store backpointer to
8058 incremental info entry.
8059 (Output_section_incremental_inputs::set_final_data_size): Record
8060 additional information for scripts.
8061 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8062 * incremental.h (Incremental_script_entry::add_object): New function.
8063 (Incremental_script_entry::get_object_count): New function.
8064 (Incremental_script_entry::get_object): New function.
8065 (Incremental_script_entry::objects_): New data member; adjust
8066 constructor.
8067 (Incremental_inputs::report_archive_begin): Add script_info parameter.
8068 (Incremental_inputs::report_object): Add script_info parameter.
8069 (Incremental_inputs_reader::get_object_count): New function.
8070 (Incremental_inputs_reader::get_object_offset): New function.
8071 * options.cc (Input_arguments::add_file): Return reference to
8072 new input argument.
8073 * options.h (Input_argument::set_script_info): New function.
8074 (Input_argument::script_info): New function.
8075 (Input_argument::script_info_): New data member; adjust all
8076 constructors.
8077 (Input_file_group::add_file): Return reference to new input argument.
8078 (Input_file_lib::add_file): Likewise.
8079 (Input_arguments::add_file): Likewise.
8080 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
8081 * script.cc (Parser_closure::Parser_closure): Add script_info
8082 parameter; adjust all callers.
8083 (Parser_closure::script_info): New function.
8084 (Parser_closure::script_info_): New data member.
8085 (read_input_script): Report scripts earlier to incremental info.
8086 (script_add_file): Set script_info in Input_argument.
8087 (script_add_library): Likewise.
8088 * script.h (Script_options::Script_info): Rewrite class.
8089
8090 2011-03-29 Cary Coutant <ccoutant@google.com>
8091
8092 * archive.cc (Library_base::should_include_member): Move
8093 method here from class Archive.
8094 (Archive::Archive): Initialize base class.
8095 (Archive::should_include_member): Move to base class.
8096 (Archive::do_for_all_unused_symbols): New function.
8097 (Add_archive_symbols::run): Remove redundant access to
8098 incremental_inputs.
8099 (Lib_group::Lib_group): Initialize base class.
8100 (Lib_group::do_filename): New function.
8101 (Lib_group::include_member): Pass pointer to Lib_group to
8102 report_object.
8103 (Lib_group::do_for_all_unused_symbols): New function.
8104 (Add_lib_group_symbols::run): Report archive information for
8105 incremental links.
8106 * archive.h (class Library_base): New base class.
8107 (class Archive): Derive from Library_base.
8108 (Archive::filename): Move to base class.
8109 (Archive::set_incremental_info): Likewise.
8110 (Archive::incremental_info): Likewise.
8111 (Archive::Should_include): Likewise.
8112 (Archive::should_include_member): Likewise.
8113 (Archive::Armap_entry): Remove.
8114 (Archive::Unused_symbol_iterator): Remove.
8115 (Archive::unused_symbols_begin): Remove.
8116 (Archive::unused_symbols_end): Remove.
8117 (Archive::do_filename): New function.
8118 (Archive::do_get_mtime): New function.
8119 (Archive::do_for_all_unused_symbols): New function.
8120 (Archive::task_): Move to base class.
8121 (Archive::incremental_info_): Likewise.
8122 (class Lib_group): Derive from Library_base.
8123 (Lib_group::do_filename): New function.
8124 (Lib_group::do_get_mtime): New function.
8125 (Lib_group::do_for_all_unused_symbols): New function.
8126 (Lib_group::task_): Move to base class.
8127 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
8128 function.
8129 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
8130 function.
8131 * incremental.cc (Incremental_inputs::report_archive_begin):
8132 Use Library_base; call library's get_mtime; add incremental inputs
8133 entry before members.
8134 (class Unused_symbol_visitor): New class.
8135 (Incremental_inputs::report_archive_end): Use Library_base; use
8136 visitor class to record unused symbols; don't add incremental inputs
8137 entry after members.
8138 (Incremental_inputs::report_object): Use Library_base.
8139 * incremental.h
8140 (Incremental_archive_entry::Incremental_archive_entry): Remove
8141 unused Archive parameter.
8142 (Incremental_inputs::report_archive_begin): Use Library_base.
8143 (Incremental_inputs::report_archive_end): Likewise.
8144 (Incremental_inputs::report_object): Likewise.
8145 * object.cc (Sized_relobj::do_for_all_global_symbols): New
8146 function.
8147 * object.h (Object::for_all_global_symbols): New function.
8148 (Object::do_for_all_global_symbols): New function.
8149 (Sized_relobj::do_for_all_global_symbols): New function.
8150 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
8151 function.
8152 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
8153 function.
8154
8155 2011-03-27 Ian Lance Taylor <iant@google.com>
8156
8157 * archive.cc (Archive::interpret_header): Return -1 if something
8158 goes wrong. Change callers accordingly.
8159
8160 2011-03-25 Cary Coutant <ccoutant@google.com>
8161
8162 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
8163 * testsuite/Makefile.in: Regenerate.
8164
8165 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
8166
8167 * plugin.cc (get_view): New.
8168 (Plugin::load): Pass get_view to the plugin.
8169 (Plugin_manager::get_view): New.
8170
8171 2011-03-21 Ian Lance Taylor <iant@google.com>
8172
8173 * testsuite/final_layout.sh: Rewrite to not use dc.
8174 * testsuite/relro_test.sh: Fail if dc is not present.
8175
8176 2011-03-21 Sriraman Tallam <tmsriram@google.com>
8177
8178 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
8179 Change == to -eq.
8180 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
8181 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
8182 Change == to -eq.
8183 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
8184 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8185
8186 2011-03-14 Ian Lance Taylor <iant@google.com>
8187
8188 * script-sections.cc (Sort_output_sections::script_compare):
8189 Rename from is_before, change return type.
8190 (Sort_output_sections::operator()): Adjust accordingly.
8191
8192 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8193
8194 PR gold/12572
8195 * testsuite/odr_violation2.cc: Add comment to make all error line
8196 numbers double digits.
8197 * testsuite/debug_msg.sh: Adjust expected errors.
8198
8199 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8200
8201 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8202 but mark earlier ones as non-canonical
8203 (offset_to_iterator): Update search target and example
8204 (do_addr2line): Return extra lines in a vector*
8205 (format_file_lineno): Extract from do_addr2line
8206 (one_addr2line): Add vector* out-param
8207 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8208 when a lineno entry appeared last for its instruction
8209 (Dwarf_line_info): Add vector* out-param
8210 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8211 * symtab.cc (Odr_violation_compare): Include the lineno in the
8212 comparison again.
8213 (linenos_from_loc): New. Combine the canonical line for an
8214 address with its other lines.
8215 (True_if_intersect): New. Helper functor to make
8216 std::set_intersection a query.
8217 (detect_odr_violations): Compare sets of lines instead of just
8218 one line for each function. This became less deterministic, but
8219 has fewer false positives.
8220 * symtab.h: Declarations.
8221 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8222 mix an optimized and non-optimized object in the same binary
8223 (odr_violation2.so): Same.
8224 * testsuite/Makefile.in: Regenerate from Makefile.am.
8225 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8226 * testsuite/debug_msg.sh: Update line numbers and add
8227 assertions.
8228 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8229 non-optimized context.
8230 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8231 isn't inlined, and use OdrDerived in an optimized context.
8232 * testsuite/odr_header1.h: Defines OdrDerived, where
8233 optimization will change the
8234 first-instruction-in-the-destructor's file and line number.
8235 * testsuite/odr_header2.h: Defines OdrBase.
8236
8237 2011-03-09 Ian Lance Taylor <iant@google.com>
8238
8239 * fileread.cc (File_read::clear_views): Don't delete the whole
8240 file view.
8241
8242 2011-03-08 Ian Lance Taylor <iant@google.com>
8243
8244 PR gold/12525
8245 * fileread.cc: #include <climits>.
8246 (GOLD_IOV_MAX): Define.
8247 (File_read::read_multiple): Limit number of entries by iov_max.
8248 * fileread.h (class File_read): Always set max_readv_entries to
8249 128.
8250
8251 2011-03-07 Ian Lance Taylor <iant@google.com>
8252
8253 PR gold/12525
8254 * options.h (class General_options): Add -dy and -dn.
8255
8256 2011-03-02 Cary Coutant <ccoutant@google.com>
8257
8258 * testsuite/script_test_9.t: Add TLS segment.
8259
8260 2011-03-02 Simon Baldwin <simonb@google.com>
8261
8262 * configure.ac: Add check for gnu_indirect_function support in
8263 the toolchain building binutils.
8264 * configure: Rebuild.
8265
8266 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
8267
8268 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8269 plugin only symbols.
8270 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8271 in plugin files as not needed in the symbol table.
8272
8273 2011-02-11 Sriraman Tallam <tmsriram@google.com>
8274
8275 * output.cc (Output_section::add_input_section): Delay fill
8276 generation for section ordering.
8277
8278 2011-02-09 Ian Lance Taylor <iant@google.com>
8279
8280 PR gold/12316
8281 * object.h (class Sized_relobj): Remove clear_local_symbols.
8282 * reloc.cc (Sized_relobj::do_relocate): Don't call
8283 clear_local_symbols.
8284
8285 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
8286
8287 * plugin.cc (is_visible_from_outside): Return true for symbols
8288 in the -u option.
8289
8290 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8291
8292 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8293 filename.
8294
8295 2011-02-02 Sriraman Tallam <tmsriram@google.com>
8296
8297 * icf.h (is_section_foldable_candidate): Change type of parameter
8298 to std::string.
8299 * icf.cc (Icf::find_identical_sections): Change type of local variable
8300 section_name to be std::string.
8301 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8302
8303 2011-01-25 Ian Lance Taylor <iant@google.com>
8304
8305 * script.cc (script_add_extern): Rewrite to use
8306 add_symbol_reference.
8307
8308 2011-01-25 Doug Kwan <dougkwan@google.com>
8309
8310 * icf.cc (get_section_contents): Always lock section's object.
8311
8312 2011-01-24 Ian Lance Taylor <iant@google.com>
8313
8314 * options.h (class General_options): Accept
8315 --no-detect-odr-violations.
8316
8317 2011-01-24 Ian Lance Taylor <iant@google.com>
8318
8319 * version.cc (version_string): Bump to 1.11.
8320
8321 2011-01-24 Ian Lance Taylor <iant@google.com>
8322
8323 * plugin.cc (class Plugin_rescan): Define new class.
8324 (Plugin_manager::claim_file): Set any_claimed_.
8325 (Plugin_manager::save_archive): New function.
8326 (Plugin_manager::save_input_group): New function.
8327 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8328 necessary.
8329 (Plugin_manager::new_undefined_symbol): New function.
8330 (Plugin_manager::rescan): New function.
8331 (Plugin_manager::rescannable_defines): New function.
8332 (Plugin_manager::add_input_file): Set any_added_.
8333 * plugin.h (class Plugin_manager): define new fields rescannable_,
8334 undefined_symbols_, any_claimed_, and any_added_. Declare
8335 Plugin_rescan as friend. Declare new functions.
8336 (Plugin_manager::Rescannable): Define type.
8337 (Plugin_manager::Rescannable_list): Define type.
8338 (Plugin_manager::Undefined_symbol_list): Define type.
8339 (Plugin_manager::Plugin_manager): Initialize new fields.
8340 * archive.cc (Archive::defines_symbol): New function.
8341 (Add_archive_symbols::run): Pass archive to plugins if any.
8342 * archive.h (class Archive): Declare defines_symbol.
8343 * readsyms.cc (Input_group::~Input_group): New function.
8344 (Finish_group::run): Pass input_group to plugins if any.
8345 * readsyms.h (class Input_group): Declare destructor.
8346 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8347 any.
8348
8349 2011-01-10 Ian Lance Taylor <iant@google.com>
8350
8351 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8352 section as relro.
8353 (Layout::set_segment_offsets): Reset increase_relro before calling
8354 set_section_addresses a second time.
8355
8356 2011-01-04 Cary Coutant <ccoutant@google.com>
8357
8358 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8359 sections before NOBITS sections.
8360
8361 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8362
8363 * version.cc (print_version): Update copyright to 2011.
8364
8365 2010-12-23 Cary Coutant <ccoutant@google.com>
8366
8367 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8368 of OS to this->add. Add OD parameter to second form of the function.
8369
8370 2010-12-20 Ian Lance Taylor <iant@google.com>
8371
8372 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8373 second of two consecutive entries with same offset.
8374
8375 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8376
8377 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8378 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8379 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8380 to avoid unneeded links against $(LDADD).
8381 * testsuite/Makefile.in: Regenerate.
8382
8383 2010-12-15 Ian Lance Taylor <iant@google.com>
8384
8385 PR gold/12324
8386 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8387 for R_X86_64_32 and R_X86_64_PC32.
8388 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8389 ver_matching_def_pic.o.
8390 (ver_matching_def_pic.o): New target.
8391
8392 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8393
8394 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8395 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8396 Move definition before File_read::View member definitions.
8397 (File_read::View::~View): Initialize and hold lock before
8398 updating current_mapped_bytes.
8399
8400 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8401
8402 * dwarf_reader.cc: Remove outdated comment.
8403 * gold-threads.cc: Fix typo in error message.
8404 * archive.cc: Fix typos in comments.
8405 * archive.h: Likewise.
8406 * arm-reloc-property.cc: Likewise.
8407 * arm-reloc-property.h: Likewise.
8408 * arm-reloc.def: Likewise.
8409 * arm.cc: Likewise.
8410 * attributes.h: Likewise.
8411 * cref.cc: Likewise.
8412 * ehframe.cc: Likewise.
8413 * fileread.h: Likewise.
8414 * gold.h: Likewise.
8415 * i386.cc: Likewise.
8416 * icf.cc: Likewise.
8417 * incremental.h: Likewise.
8418 * int_encoding.cc: Likewise.
8419 * layout.h: Likewise.
8420 * main.cc: Likewise.
8421 * merge.h: Likewise.
8422 * object.cc: Likewise.
8423 * object.h: Likewise.
8424 * options.cc: Likewise.
8425 * readsyms.cc: Likewise.
8426 * reduced_debug_output.cc: Likewise.
8427 * reloc.cc: Likewise.
8428 * script-sections.cc: Likewise.
8429 * sparc.cc: Likewise.
8430 * symtab.h: Likewise.
8431 * target-reloc.h: Likewise.
8432 * target.cc: Likewise.
8433 * target.h: Likewise.
8434 * timer.cc: Likewise.
8435 * timer.h: Likewise.
8436 * x86_64.cc: Likewise.
8437
8438 2010-12-09 Cary Coutant <ccoutant@google.com>
8439
8440 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8441 stack.
8442 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8443 parameter; change all callers.
8444 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8445 * options.h (warn_execstack): New option.
8446
8447 2010-12-07 Doug Kwan <dougkwan@google.com>
8448
8449 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8450 like function call relocations.
8451
8452 2010-12-07 Ian Lance Taylor <iant@google.com>
8453
8454 * archive.cc (Archive::get_elf_object_for_member): Permit
8455 punconfigured to be NULL.
8456 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8457 (Archive::include_member): Pass NULL to get_elf_object_for_member
8458 if we searched for the archive and this is the first included
8459 object.
8460
8461 2010-12-01 Ian Lance Taylor <iant@google.com>
8462
8463 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8464 track_relocs_type_ field.
8465 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8466 Set track_relocs_type_.
8467 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8468 contents when using RELA relocs.
8469 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8470 reloc_map_.
8471 * reloc.cc (Track_relocs::next_addend): New function.
8472 * reloc.h (class Track_relocs): Declare next_addend.
8473
8474 2010-12-01 Ian Lance Taylor <iant@google.com>
8475
8476 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8477 virtual destructor.
8478
8479 2010-12-01 Ian Lance Taylor <iant@google.com>
8480
8481 * README: Update compilers known to work and fail.
8482
8483 2010-11-23 Matthias Klose <doko@ubuntu.com>
8484
8485 * configure.in: For --enable-gold, handle value `default' instead of
8486 `both*'. Always install ld as ld.bfd, install as ld if gold is
8487 not the default.
8488 * configure: Regenerate.
8489
8490 2010-11-18 Doug Kwan <dougkwan@google.com>
8491
8492 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8493 and right_alignment to be zero. Store result alignment only if it is
8494 greater than existing alignment.
8495
8496 2010-11-16 Cary Coutant <ccoutant@google.com>
8497
8498 PR gold/12220
8499 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8500 Check for ".zdebug_line".
8501
8502 2010-11-16 Doug Kwan <dougkwan@google.com>
8503 Cary Coutant <ccoutant@google.com>
8504
8505 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8506 by reference; adjust all callers.
8507 * output.cc (Output_segment::set_section_addresses): Adjust references
8508 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8509 list is empty.
8510 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8511 end at page boundary.
8512
8513 2010-11-16 Cary Coutant <ccoutant@google.com>
8514
8515 PR gold/12220
8516 * layout.cc (Layout::choose_output_section): Transform names of
8517 compressed sections even when using a script with a SECTIONS clause.
8518 (Layout::output_section_name): Remove code to transform
8519 compressed debug section names.
8520 * output.cc (Output_section::add_input_section): Use uncompressed
8521 section size when tracking input sections.
8522
8523 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8524
8525 * symtab.h (Symbol::NON_PIC_REF): Remove.
8526 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8527 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8528 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8529 (Symbol::use_plt_offset): Take a flags argument and pass it
8530 directly to needs_dynamic_reloc. Restrict check for undefined
8531 weak symbols to function calls.
8532 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8533 (Target_arm::Scan::global): Use it.
8534 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8535 (Target_arm::Relocate::relocate): Likewise.
8536 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8537 parameter with an r_type parameter. Use get_reference_flags
8538 to get the flags.
8539 (Target_arm::Relocate::relocate): Update accordingly.
8540 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8541 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8542 (Target_i386::Scan::global): Likewise.
8543 (Target_i386::Relocate::relocate): Likewise.
8544 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8545 parameter with an r_type parameter. Use get_reference_flags
8546 to get the flags.
8547 (Target_i386::Relocate::relocate): Update accordingly.
8548 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8549 (Target_powerpc::Scan::global): Use it.
8550 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8551 (Target_powerpc::Relocate::relocate): Likewise.
8552 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8553 (Target_sparc::Scan::global): Use it.
8554 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8555 (Target_sparc::Relocate::relocate): Likewise.
8556 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8557 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8558 (Target_x86_64::Scan::global): Likewise.
8559 (Target_x86_64::Relocate::relocate): Likewise.
8560
8561 2010-11-08 Doug Kwan <dougkwan@google.com>
8562 Cary Coutant <ccoutant@google.com>
8563
8564 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8565 (Arm_exidx_merge_section::section_contents_): New data member.
8566 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8567 (Arm_input_section::~Arm_input_section): De-allocate memory.
8568 (Arm_input_section::original_contents_): New data member.
8569 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8570 in parameters instead of calling Object::section_contents without
8571 locking.
8572 (Arm_output_section::group_section): New parameter TASK. Pass it
8573 to callees that need locking objects.
8574 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8575 to lock EXIDX input sections. Fix a formatting issue. Call
8576 Arm_exidx_merged_section::build_contents to create merged section
8577 contents.
8578 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8579 to lock object of stub table owner.
8580 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8581 TEXT_SIZE to initialize data member TEXT_SIZE_.
8582 (Arm_exidx_input_section::addralign): Fix typo in comment.
8583 (Arm_exidx_input_section::text_size): New method.
8584 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8585 that require locking objects. Lock objects before scanning for stubs
8586 and updating local symbols.
8587 (Arm_input_section<big_endian>::init): Copy contents of original
8588 input section.
8589 (Arm_input_section<big_endian>::do_write): Use saved contents of
8590 original input section instead of calling Object::section_contents
8591 without locking.
8592 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8593 size without calling Object::section_size().
8594 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8595 for size. Allocate a buffer for merged EXIDX entries.
8596 (Arm_exidx_merged_section::build_contents): New method.
8597 (Arm_exidx_merged_section::do_write): Move merge section contents
8598 building code to Arm_exidx_merged_section::build_contetns. Write
8599 out contetns in buffer instead of building it on the fly.
8600 (Arm_relobj::make_exidx_input_section): Also pass text section size
8601 to Arm_exidx_input_section constructor.
8602 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8603 (Arm_dynobj::do_read_symbols): Fix memory leak.
8604 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8605 * target.h: (class Task): Add forward declaration.
8606 (Target::relax): Add new parameter TASK and pass it to
8607 Target::do_relax().
8608 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8609
8610 2010-11-05 Cary Coutant <ccoutant@google.com>
8611
8612 PR gold/10708
8613 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8614 object when reading from the file.
8615 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8616 second layout pass.
8617 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8618 when reading section contents.
8619 (get_section_contents): Likewise.
8620 (icf::find_identical_sections): Likewise.
8621 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8622 object when reading from the file.
8623 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8624 the object when doing deferred section layout.
8625
8626 2010-11-03 Nick Clifton <nickc@redhat.com>
8627
8628 PR gold/12001
8629 * script.h (class Symbol_assignment: name): New member. Returns
8630 the name of the symbol.
8631 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8632 Returns true if the given symbol name is on the list of
8633 assignments wating to be processed.
8634 * archive.cc (should_incldue_member): If the symbol is undefined,
8635 check to see if it is on the list of symbols pending assignment.
8636
8637 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8638
8639 * script-sections.cc (Script_sections::find_memory_region): Check
8640 for a NULL output section pointer.
8641
8642 2010-10-29 Doug Kwan <dougkwan@google.com>
8643
8644 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8645 Output_section::add_relaxed_input_section.
8646 * output.cc (Output_section::add_relaxed_input_section): Add new
8647 arguments LAYOUT and NAME. Set section order index.
8648 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8649 Copy section order index.
8650 * output.h (Output_section::add_relaxed_input_section): Add new
8651 arguments LAYOUT and NAME.
8652
8653 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8654
8655 * testsuite/Makefile.am: Move gcctestdir/ld rule to
8656 NATIVE_OR_CROSS_LINKER.
8657 * testsuite/Makefile.in: Regenerate.
8658
8659 2010-10-20 Doug Kwan <dougkwan@google.com>
8660
8661 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8662 without SHF_LINK_ORDER flags.
8663 * layout.cc (Layout::choose_output_section): Do not filter
8664 SHF_LINK_ORDER flag in a relocatable link.
8665
8666 2010-10-17 Cary Coutant <ccoutant@google.com>
8667
8668 * output.h (Output_segment::set_section_addresses): Change function
8669 signature. Update all callers.
8670 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8671 sections.
8672 (Output_segment::set_section_addresses): Align after last TLS
8673 section. Add padding before last relro section instead of after.
8674
8675 2010-10-17 Doug Kwan <dougkwan@google.com>
8676
8677 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8678 GOT output section to be writable.
8679
8680 2010-10-14 Cary Coutant <ccoutant@google.com>
8681
8682 * debug.h (DEBUG_INCREMENTAL): New flag.
8683 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8684 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8685 mode.
8686 * incremental.cc (report_command_line): Ignore all forms of
8687 --incremental.
8688 * layout.cc (Layout::Layout): Check parameters for incremental link
8689 mode.
8690 * options.cc (General_options::parse_incremental): New function.
8691 (General_options::parse_no_incremental): New function.
8692 (General_options::parse_incremental_full): New function.
8693 (General_options::parse_incremental_update): New function.
8694 (General_options::incremental_mode_): New data member.
8695 (General_options::finalize): Check incremental_mode_.
8696 * options.h (General_options): Update help text for --incremental.
8697 Add --no-incremental, --incremental-full, --incremental-update.
8698 (General_options::Incremental_mode): New enum type.
8699 (General_options::incremental_mode): New function.
8700 (General_options::incremental_mode_): New data member.
8701 * parameters.cc (Parameters::incremental_mode_): New data member.
8702 (Parameters::set_options): Set incremental_mode_.
8703 (Parameters::set_incremental_full): New function.
8704 (Parameters::incremental): New function.
8705 (Parameters::incremental_update): New function.
8706 (set_parameters_incremental_full): New function.
8707 * parameters.h (Parameters::set_incremental_full): New function.
8708 (Parameters::incremental): New function.
8709 (Parameters::incremental_update): New function.
8710 (Parameters::incremental_mode_): New data member.
8711 (set_parameters_incremental_full): New function.
8712 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8713 incremental link mode.
8714 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8715 (Sized_relobj::do_relocate_sections): Likewise.
8716 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8717 option.
8718 * testsuite/Makefile.in: Regenerate.
8719 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8720
8721 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8722
8723 * script-sections.h (class Script_sections): Make
8724 Sections_elements typedef public.
8725 * script-sections.cc (class Sort_output_sections): Add elements_
8726 field. Add constructor which sets it; change all callers.
8727 (Sort_output_sections::is_before): New function.
8728 (Sort_output_sections::operator()): Call is_before.
8729 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8730 conditional.
8731 * testsuite/script_test_10.sh: New test. Test script section
8732 order.
8733 * testsuite/script_test_10.t: Likewise.
8734 * testsuite/script_test_10.s: Likewise.
8735 * testsuite/Makefile.am: Wrap the cross linker tests and the
8736 common tests into NATIVE_OR_CROSS_LINKER.
8737 (check_SCRIPTS): Add script_test_10.sh.
8738 (check_DATA): Add script_test_10.stdout.
8739 (script_test_10.o, script_test_10): New targets.
8740 (script_test_10.stdout): New target.
8741 * configure, testsuite/Makefile.in: Regenerate.
8742
8743 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8744
8745 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8746 error for the deprecated relocations.
8747 (Target_arm::Scan::global): Likewise.
8748 (Target_arm::Relocate::relocate): Likewise.
8749
8750 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8751
8752 * fileread.cc (Input_file::find_file): Initialize *found_name
8753 and *namep when using the fallback search for case 4.
8754
8755 2010-10-11 Cary Coutant <ccoutant@google.com>
8756
8757 * options.h (class General_options): Redefine -z lazy as an alias for
8758 the negation of -z now.
8759
8760 2010-10-11 Ian Lance Taylor <iant@google.com>
8761
8762 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8763 binding.
8764
8765 2010-10-06 Nick Clifton <nickc@redhat.com>
8766
8767 * script-sections.cc(class Memory_region): Remove
8768 current_lma_offset_ field. Rename current_vma_offset_ to
8769 current_offset_. Add last_section_ field.
8770 (Memory_region::get_current_vma_address): Rename to
8771 get_current_address.
8772 (Memory_region::get_current_lma_address): Delete.
8773 (Memory_region::increment_vma_offset): Rename to
8774 increment_offset.
8775 (Memory_region::increment_lma_offset): Delete.
8776 (Memory_region::attributes_compatible): New method. Returns
8777 true if the provided section is compatible with the region.
8778 (Memory_region::get_last_section): New method. Returns the last
8779 section to use the region.
8780 (Memory_region::set_last_section): New method. Stores the last
8781 section to use the region.
8782 (Script_sections::block_in_region): New method. Returns true if
8783 a block of memory is contained within a region.
8784 (Script_sections::find_memory_region): New method. Locates a
8785 memory region to be used to set a VMA or LMA address.
8786 (Output_section_definition::set_section_addresses): Add code to
8787 check for addresses set by memory regions.
8788 (Output_segment::set_section_addresses): Remove memory region
8789 walking code.
8790 (Script_sections::create_segment): Add a warning if a header
8791 segment is created outside of any region.
8792 * script-sections.h (class Script_sections): Add prototypes for
8793 find_memory_region and block_in_region methods.
8794 * testsuite/memory_test.s: Use .long instead of .word.
8795 * testsuite/memory_test.t: Add some more output sections.
8796 * testsuite/memory_test.sh: Update expected output.
8797
8798 2010-10-02 Doug Kwan <dougkwan@google.com>
8799
8800 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8801 defintion to symtab.h
8802 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8803 declaration to defintion.
8804
8805 2010-10-01 Nick Clifton <nickc@redhat.com>
8806
8807 * expression.cc (eval): Replace dummy argument with NULL.
8808 (eval_maybe_dot): Check for a NULL result section pointer.
8809 (Symbol_expression::value): Likewise.
8810 (Dot_expression::value): Likewise.
8811 (BINARY_EXPRESSION): Likewise.
8812 (Max_expression::value): Likewise.
8813 (Min_expression::value): Likewise.
8814 (Absolute_expression::value): Likewise.
8815 (Addr_expression::value_from_output_section): Likewise.
8816 (Loaddddr_expression::value_from_output_section): Likewise.
8817 (Segment_start_expression::value): Likewise.
8818 * script-sections.cc
8819 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8820 argument with NULL.
8821 (Sections_elememt_dot_assignment::set_section_addresses):
8822 Likewise.
8823 (Output_data_expression::do_write_to_buffer): Likewise.
8824 (Output_section_definition::finalize_symbols): Likewise.
8825 (Output_section_definition::set_section_addresses): Likewise.
8826
8827 2010-09-30 Doug Kwan <dougkwan@google.com>
8828
8829 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8830
8831 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8832
8833 * target.h (Target::can_icf_inline_merge_sections): New virtual
8834 function.
8835 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8836 virtual function.
8837 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8838 virtual function.
8839 * icf.cc (get_section_contents): Inline merge sections only when
8840 target allows it.
8841
8842 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8843
8844 * configure: Regenerate.
8845
8846 2010-09-17 Ian Lance Taylor <iant@google.com>
8847
8848 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8849 * testsuite/Makefile.am (memory_test.o): New target.
8850 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8851 memory_test.t.
8852 * testsuite/Makefile.in: Rebuild.
8853
8854 2010-09-17 Doug Kwan <dougkwan@google.com>
8855
8856 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8857 defintion if relocation uses GOT entries of the symbol.
8858 * testsuite/icf_safe_test.sh: Fix test.
8859 * testsuite/icf_safe_so_test.sh: Fix test.
8860
8861 2010-09-16 Cary Coutant <ccoutant@google.com>
8862
8863 * script_sections.cc (class Memory_region): Remove "NULL" from
8864 vector initializations.
8865
8866 2010-09-15 Cary Coutant <ccoutant@google.com>
8867
8868 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8869 Resolve forwarding symbols.
8870
8871 2010-09-15 Doug Kwan <dougkwan@google.com>
8872
8873 * gold/testsuite/script_test_3.t: Add ARM special sections.
8874 * gold/testsuite/script_test_4.t: Same.
8875 * gold/testsuite/script_test_5.t: Same.
8876 * gold/testsuite/script_test_6.t: Same.
8877 * gold/testsuite/script_test_7.t: Same.
8878 * gold/testsuite/script_test_7.t: Same.
8879 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8880
8881 2010-09-14 Cary Coutant <ccoutant@google.com>
8882
8883 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8884 (Target_x86_64::Relocate::relocate_tls): Replace check for
8885 saw_tls_block_reloc_ with test for executable section.
8886
8887 2010-09-12 Cary Coutant <ccoutant@google.com>
8888
8889 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8890 position-independent executables to shared libraries need dynamic
8891 relocations.
8892 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8893 position-independent executables.
8894 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8895 * testsuite/Makefile.in: Regenerate.
8896
8897 2010-09-10 Nick Clifton <nickc@redhat.com>
8898
8899 PR gold/11997
8900 * testsuite/memory_test.t: Discard any sections that are not
8901 needed.
8902
8903 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8904
8905 PR gold/11996
8906 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8907 "This::" to work around a bug in gcc 4.2.
8908
8909 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8910
8911 2010-09-09 Rafael Espindola <espindola@google.com>
8912
8913 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8914 sections with different PF_X flags in the same segment.
8915 (Layout::find_first_load_seg): Search all segments to find the first
8916 one.
8917 * options.h (rosegment): New.
8918
8919 2010-09-08 Rafael Espindola <espindola@google.com>
8920
8921 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8922
8923 2010-09-08 Doug Kwan <dougkwan@google.com>
8924
8925 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8926 (Arm_relobj::do_relocate_sections): Add new parameter for output
8927 file to match the parent.
8928 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8929 of local symbols instead of input values. Update code to track
8930 changes in gold::relocate_section.
8931 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8932 (Sized_relobj::compute_final_local_value_internal): New methods.
8933 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8934 body into private version of Sized_relobj::compute_final_local_value.
8935 Call the inline method.
8936 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8937 merged symbol value if there is one.
8938 (Symbol_value::has_output_value): New method defintiion.
8939 (Sized_relobj::Compute_final_local_value_status): New enum type.
8940 (Sized_relobj::compute_final_local_value): New methods.
8941 (Sized_relobj::compute_final_local_value_internal): New methods.
8942 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8943 and arm_cortex_a8.sh.
8944 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8945 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8946 New tests.
8947 * Makefile.in: Regenerate.
8948 * testsuite/arm_bl_out_of_range.s: Update test.
8949 * testsuite/thumb_bl_out_of_range.s: Ditto.
8950 * testsuite/thumb_blx_out_of_range.s: Ditto.
8951 * testsuite/arm_branch_out_of_range.sh: New file.
8952 * testsuite/arm_cortex_a8.sh: Ditto.
8953 * testsuite/arm_cortex_a8_b.s: Ditto.
8954 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8955 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8956 * testsuite/arm_cortex_a8_bl.s: Ditto.
8957 * testsuite/arm_cortex_a8_blx.s: Ditto.
8958 * testsuite/arm_cortex_a8_local.s: Ditto.
8959 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8960 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8961
8962 2010-09-08 Rafael Espindola <espindola@google.com>
8963
8964 * Makefile.am (memory_test.stdout): Run readelf with -W.
8965 * Makefile.in: Regenerate.
8966 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8967 64 bit output.
8968
8969 2010-09-08 Rafael Espindola <espindola@google.com>
8970
8971 * script-sections.cc (Script_sections::add_memory_region): Convert
8972 field precision to int.
8973 * script.cc (script_set_section_region, script_set_section_region):
8974 Convert field precision to int.
8975
8976 2010-09-08 Rafael Espindola <espindola@google.com>
8977
8978 * arm.cc (do_finalize_sections): Create the __exidx_start and
8979 __exdix_end symbols even when the section is missing.
8980
8981 2010-09-08 Nick Clifton <nickc@redhat.com>
8982
8983 * README: Remove claim that MEMORY is not supported.
8984 * expression.cc (script_exp_function_origin)
8985 (script_exp_function_length): Move from here to ...
8986 * script.cc: ... here.
8987 (script_set_section_region, script_add_memory)
8988 (script_parse_memory_attr, script_include_directive): New
8989 functions.
8990 * script-sections.cc
8991 (class Memory_region): New class.
8992 (class Output_section_definition): Add set_memory_region,
8993 set_section_vma, set_section_lma and get_section_name methods.
8994 (class Script_Sections): Add add_memory_region,
8995 find_memory_region, find_memory_region_origin,
8996 find_memory_region_length and set_memory_region methods.
8997 Have set_section_addresses method walk the list of set memory
8998 regions.
8999 Extend the print methos to display memory regions.
9000 * script-sections.h: Add prototypes for new methods.
9001 Add enum for MEMORY region attributes.
9002 * yyscript.y: Add support for parsing MEMORY regions.
9003 * script-c.h: Add prototypes for new functions.
9004 * testsuite/Makefile.am: Add test of MEMORY region functionality.
9005 * testsuite/Makefile.in: Regenerate.
9006 * testsuite/memory_test.sh: New script.
9007 * testsuite/memory_test.s: New assembler source file.
9008 * testsuite/memory_test.t: New linker script.
9009
9010 2010-08-27 Doug Kwan <dougkwan@google.com>
9011
9012 * gold/resolve.cc (Symbol_table::should_override): Let a weak
9013 reference override an existing dynamic weak reference.
9014 * testsuite/Makefile.am: Add new test dyn_weak_ref.
9015 * testsuite/Makefile.in: Regenerate.
9016 * testsuite/dyn_weak_ref.sh: New file.
9017 * testsuite/dyn_weak_ref_1.c: Ditto.
9018 * testsuite/dyn_weak_ref_2.c: Ditto.
9019
9020 2010-08-27 Ian Lance Taylor <iant@google.com>
9021
9022 * incremental.h (class Incremental_input_entry): Add virtual
9023 destructor.
9024
9025 2010-08-27 Ian Lance Taylor <iant@google.com>
9026
9027 * testsuite/start_lib_test_3.c: Mark t3 as used.
9028
9029 2010-08-27 Nick Clifton <nickc@redhat.com>
9030
9031 * options.cc (version_script): Fix small typo in previous
9032 whitespace tidyup.
9033
9034 2010-08-25 Nick Clifton <nickc@redhat.com>
9035
9036 * archive.cc: Formatting fixes: Remove whitespace between
9037 typename and following asterisk. Remove whitespace between
9038 function name and opening parenthesis.
9039 * archive.h: Likewise.
9040 * arm.cc: Likewise.
9041 * attributes.cc: Likewise.
9042 * attributes.h: Likewise.
9043 * common.cc: Likewise.
9044 * copy-relocs.cc: Likewise.
9045 * dirsearch.h: Likewise.
9046 * dynobj.cc: Likewise.
9047 * ehframe.cc: Likewise.
9048 * ehframe.h: Likewise.
9049 * expression.cc: Likewise.
9050 * fileread.cc: Likewise.
9051 * fileread.h: Likewise.
9052 * gc.h: Likewise.
9053 * gold-threads.cc: Likewise.
9054 * gold.cc: Likewise.
9055 * i386.cc: Likewise.
9056 * icf.h: Likewise.
9057 * incremental-dump.cc: Likewise.
9058 * incremental.cc: Likewise.
9059 * layout.cc: Likewise.
9060 * layout.h: Likewise.
9061 * main.cc: Likewise.
9062 * merge.cc: Likewise.
9063 * merge.h: Likewise.
9064 * object.cc: Likewise.
9065 * object.h: Likewise.
9066 * options.cc: Likewise.
9067 * options.h: Likewise.
9068 * output.cc: Likewise.
9069 * output.h: Likewise.
9070 * plugin.cc: Likewise.
9071 * plugin.h: Likewise.
9072 * powerpc.cc: Likewise.
9073 * reloc.cc: Likewise.
9074 * script-c.h: Likewise.
9075 * script-sections.cc: Likewise.
9076 * script.cc: Likewise.
9077 * stringpool.cc: Likewise.
9078 * symtab.cc: Likewise.
9079 * symtab.h: Likewise.
9080 * target.cc: Likewise.
9081 * timer.cc: Likewise.
9082 * timer.h: Likewise.
9083 * version.cc: Likewise.
9084 * x86_64.cc: Likewise.
9085
9086 2010-08-24 Nick Clifton <nickc@redhat.com>
9087
9088 PR 11899
9089 * layout.cc (segment_precedes): Sort segments by their physical
9090 addresses, if they have been set.
9091
9092 2010-08-23 Cary Coutant <ccoutant@google.com>
9093
9094 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
9095 symbols data.
9096 (Lib_group::include_member): Unlock object after deleting its
9097 symbols data.
9098 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
9099 the bug fixed here.
9100
9101 2010-08-19 Neil Vachharajani <nvachhar@google.com>
9102 Cary Coutant <ccoutant@google.com>
9103
9104 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
9105 constructor, and set_blocker.
9106 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
9107 readsyms_blocker_.
9108 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
9109 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
9110 * testsuite/Makefile.am (start_lib_test): New test case.
9111 * testsuite/Makefile.in: Regenerate.
9112 * testsuite/start_lib_test_main.c: New file.
9113 * testsuite/start_lib_test_1.c: New file.
9114 * testsuite/start_lib_test_2.c: New file.
9115 * testsuite/start_lib_test_3.c: New file.
9116
9117 2010-08-19 Ian Lance Taylor <iant@google.com>
9118
9119 * Makefile.in: Rebuild with automake 1.11.1.
9120 * aclocal.m4: Likewise.
9121 * testsuite/Makefile.in: Likewise.
9122
9123 2010-08-19 Ian Lance Taylor <iant@google.com>
9124
9125 PR 10893
9126 * i386.cc (class Output_data_plt_i386): Update declarations.
9127 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
9128 local_ifuncs_ fields.
9129 (Target_i386::do_plt_section_for_global): New function.
9130 (Target_i386::do_plt_section_for_local): New function.
9131 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
9132 parameter; change all callers. Initialize global_ifuncs_ and
9133 local_ifuncs_. If doing a static link define __rel_iplt_start and
9134 __rel_iplt_end.
9135 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
9136 (Output_data_plt_i386::add_local_ifunc_entry): New function.
9137 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
9138 symbols.
9139 (Target_i386::make_plt_section): New function, broken out of
9140 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
9141 (Target_i386::make_plt_entry): Call make_plt_section.
9142 (Target_i386::make_local_ifunc_plt_entry): New function.
9143 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
9144 (Target_i386::Scan::local): Handle IFUNC symbols. Add
9145 R_386_IRELATIVE to switch.
9146 (Target_i386::Scan::global): Likewise.
9147 (Target_i386::Relocate::relocate): Likewise.
9148 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
9149 switch.
9150 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
9151 (Target_x86_64::do_plt_section_for_global): New function.
9152 (Target_x86_64::do_plt_section_for_local): New function.
9153 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
9154 parameter; change all callers. If doing a static link define
9155 __rela_iplt_start and __rela_iplt_end.
9156 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
9157 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
9158 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
9159 to point to .plt.
9160 (Target_x86_64::make_local_ifunc_plt_entry): New function.
9161 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
9162 switch.
9163 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
9164 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
9165 R_X86_64_IRELATIVE to switch.
9166 (Target_x86_64::Scan::global): Likewise.
9167 (Target_x86_64::Relocate::relocate): Likewise.
9168 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
9169 switch.
9170 * target.h (class Target): Add plt_section_for_global and
9171 plt_section_for_local functions. Add do_plt_section_for_global
9172 and do_plt_section_for_local virtual functions.
9173 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
9174 clarifying comments.
9175 (Symbol::use_plt_offset): Handle IFUNC symbol.
9176 * object.cc (Sized_relobj::Sized_relobj): Initialize
9177 local_plt_offsets_.
9178 (Sized_relobj::local_has_plt_offset): New function.
9179 (Sized_relobj::local_plt_offset): New function.
9180 (Sized_relobj::set_local_plt_offset): New function.
9181 (Sized_relobj::do_count): Handle IFUNC symbol.
9182 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
9183 a bit away from input_shndx_ field. Add set_is_func_symbol and
9184 is_ifunc_symbol functions.
9185 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9186 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9187 local_plt_offsets_ field.
9188 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9189 * output.h (class Output_section_data): Add non-const
9190 output_section function.
9191 (class Output_data_got): Update declarations.
9192 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9193 Add use_plt_offset parameter to global and local constructors.
9194 Change all callers. Change local_sym_index_ field to 31 bits.
9195 Change GSYM_CODE and CONSTANT_CODE accordingly.
9196 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9197 doing a static link don't set sh_link field.
9198 (Output_data_got::Got_entry::write): Use PLT offset if
9199 appropriate.
9200 (Output_data_got::add_global_plt): New function.
9201 (Output_data_got::add_local_plt): New function.
9202 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9203 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9204 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9205 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9206 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9207 IFUNC conditional.
9208 * testsuite/ifunc-sel.h: New file.
9209 * testsuite/ifuncmain1.c: New file.
9210 * testsuite/ifuncmain1vis.c: New file.
9211 * testsuite/ifuncmod1.c: New file.
9212 * testsuite/ifuncdep2.c: New file.
9213 * testsuite/ifuncmain2.c: New file.
9214 * testsuite/ifuncmain3.c: New file.
9215 * testsuite/ifuncmod3.c: New file.
9216 * testsuite/ifuncmain4.c: New file.
9217 * testsuite/ifuncmain5.c: New file.
9218 * testsuite/ifuncmod5.c: New file.
9219 * testsuite/ifuncmain6pie.c: New file.
9220 * testsuite/ifuncmod6.c: New file.
9221 * testsuite/ifuncmain7.c: New file.
9222 * configure, testsuite/Makefile.in: Rebuild.
9223
9224 2010-08-18 Ian Lance Taylor <iant@google.com>
9225
9226 * incremental.cc
9227 (Output_section_incremental_inputs::write_input_files): Add cast
9228 to avoid signed/unsigned comparison warning.
9229 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9230
9231 2010-08-12 Cary Coutant <ccoutant@google.com>
9232
9233 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9234
9235 2010-08-13 Ian Lance Taylor <iant@google.com>
9236
9237 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9238
9239 2010-08-12 Cary Coutant <ccoutant@google.com>
9240 Doug Kwan <dougkwan@google.com>
9241
9242 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9243 defintion overrides non-weak undef, remember that the original undef
9244 is not weak.
9245 * symtab.cc (Symbol_table::sized_write_global): For undef without
9246 an original weak binding, set binding to global in output.
9247 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9248 * testsuite/Makefile.in: Regenerate.
9249 * testsuite/strong_ref_weak_def.sh: New file.
9250 * testsuite/strong_ref_weak_def_1.c: Ditto.
9251 * testsuite/strong_ref_weak_def_2.c: Ditto.
9252
9253 2010-08-12 Cary Coutant <ccoutant@google.com>
9254
9255 * testsuite/incremental_test.sh: Rewrite.
9256 * testsuite/incremental_test_1.c: Rewrite.
9257 * testsuite/incremental_test_2.c: Rewrite.
9258
9259 2010-08-12 Cary Coutant <ccoutant@google.com>
9260
9261 * arm.cc (Target_arm::got_size): Add const.
9262 (Target_arm::got_entry_count): New function.
9263 (Target_arm::plt_entry_count): New function.
9264 (Target_arm::first_plt_entry_offset): New function.
9265 (Target_arm::plt_entry_size): New function.
9266 (Output_data_plt_arm::entry_count): New function.
9267 (Output_data_plt_arm::first_plt_entry_offset): New function.
9268 (Output_data_plt_arm::get_plt_entry_size): New function.
9269 * i386.cc (Target_i386::got_size): Add const.
9270 (Target_i386::got_entry_count): New function.
9271 (Target_i386::plt_entry_count): New function.
9272 (Target_i386::first_plt_entry_offset): New function.
9273 (Target_i386::plt_entry_size): New function.
9274 (Output_data_plt_i386::entry_count): New function.
9275 (Output_data_plt_i386::first_plt_entry_offset): New function.
9276 (Output_data_plt_i386::get_plt_entry_size): New function.
9277 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9278 find_incremental_inputs_sections. Dump incremental_got_plt section.
9279 * incremental.cc: Include target.h.
9280 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9281 parameter. Adjust all callers. Find incremental_got_plt section.
9282 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9283 section.
9284 (Output_section_incremental_inputs::set_final_data_size): Calculate
9285 size of incremental_got_plt section.
9286 (Output_section_incremental_inputs::do_write): Write the
9287 incremental_got_plt section.
9288 (Got_plt_view_info): New struct.
9289 (Local_got_offset_visitor): New class.
9290 (Global_got_offset_visitor): New class.
9291 (Global_symbol_visitor_got_plt): New class.
9292 (Output_section_incremental_inputs::write_got_plt): New function.
9293 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9294 Add parameter. Adjust all callers.
9295 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9296 (Incremental_inputs::got_plt_section): New function.
9297 (Incremental_inputs::got_plt_section_): New data member.
9298 (Incremental_got_plt_reader): New class.
9299 * layout.cc (Layout::create_incremental_info_sections): Add the
9300 incremental_got_plt section.
9301 * object.h (Got_offset_list::get_list): New function.
9302 (Got offset_list::for_all_got_offsets): New function.
9303 (Sized_relobj::local_got_offset_list): New function.
9304 * powerpc.cc (Target_powerpc::got_size): Add const.
9305 (Target_powerpc::got_entry_count): New function.
9306 (Target_powerpc::plt_entry_count): New function.
9307 (Target_powerpc::first_plt_entry_offset): New function.
9308 (Target_powerpc::plt_entry_size): New function.
9309 (Output_data_plt_powerpc::entry_count): New function.
9310 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9311 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9312 * sparc.cc (Target_sparc::got_size): Add const.
9313 (Target_sparc::got_entry_count): New function.
9314 (Target_sparc::plt_entry_count): New function.
9315 (Target_sparc::first_plt_entry_offset): New function.
9316 (Target_sparc::plt_entry_size): New function.
9317 (Output_data_plt_sparc::entry_count): New function.
9318 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9319 (Output_data_plt_sparc::get_plt_entry_size): New function.
9320 * symtab.h (Symbol::got_offset_list): New function.
9321 (Symbol_table::for_all_symbols): New function.
9322 * target.h (Sized_target::got_entry_count): New function.
9323 (Sized_target::plt_entry_count): New function.
9324 (Sized_target::plt_entry_size): New function.
9325 * x86_64.cc (Target_x86_64::got_size): Add const.
9326 (Target_x86_64::got_entry_count): New function.
9327 (Target_x86_64::plt_entry_count): New function.
9328 (Target_x86_64::first_plt_entry_offset): New function.
9329 (Target_x86_64::plt_entry_size): New function.
9330 (Output_data_plt_x86_64::entry_count): New function.
9331 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9332 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9333
9334 2010-08-12 Cary Coutant <ccoutant@google.com>
9335
9336 * archive.cc: Include incremental.h.
9337 (Archive::Archive): Initialize incremental_info_.
9338 (Archive::include_member): Record archive members in incremental info.
9339 (Add_archive_symbols::run): Record begin and end of an archive in
9340 incremental info.
9341 (Lib_group::include_member): Record objects in incremental info.
9342 * archive.h (Incremental_archive_entry): Forward declaration.
9343 (Archive::set_incremental_info): New member function.
9344 (Archive::incremental_info): New member function.
9345 (Archive::Unused_symbol_iterator): New class.
9346 (Archive::unused_symbols_begin): New member function.
9347 (Archive::unused_symbols_end): New member function.
9348 (Archive::incremental_info_): New data member.
9349 * incremental-dump.cc (find_input_containing_global): New function.
9350 (dump_incremental_inputs): Dump new incremental info sections.
9351 * incremental.cc: Include symtab.h.
9352 (Output_section_incremental_inputs): New class.
9353 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9354 new incremental info sections.
9355 (Sized_incremental_binary::do_check_inputs): Likewise.
9356 (Incremental_inputs::report_archive): Remove.
9357 (Incremental_inputs::report_archive_begin): New function.
9358 (Incremental_inputs::report_archive_end): New function.
9359 (Incremental_inputs::report_object): New function.
9360 (Incremental_inputs::finalize_inputs): Remove.
9361 (Incremental_inputs::report_input_section): New function.
9362 (Incremental_inputs::report_script): Rewrite.
9363 (Incremental_inputs::finalize): Do nothing but finalize string table.
9364 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9365 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9366 (Incremental_inputs::create_data_sections): New function.
9367 (Incremental_inputs::relocs_entsize): New function.
9368 (Output_section_incremental_inputs::set_final_data_size): New function.
9369 (Output_section_incremental_inputs::do_write): New function.
9370 (Output_section_incremental_inputs::write_header): New function.
9371 (Output_section_incremental_inputs::write_input_files): New function.
9372 (Output_section_incremental_inputs::write_info_blocks): New function.
9373 (Output_section_incremental_inputs::write_symtab): New function.
9374 * incremental.h (Incremental_script_entry): Forward declaration.
9375 (Incremental_object_entry): Forward declaration.
9376 (Incremental_archive_entry): Forward declaration.
9377 (Incremental_inputs): Forward declaration.
9378 (Incremental_inputs_header_data): Remove.
9379 (Incremental_inputs_header): Remove.
9380 (Incremental_inputs_header_write): Remove.
9381 (Incremental_inputs_entry_data): Remove.
9382 (Incremental_inputs_entry): Remove.
9383 (Incremental_inputs_entry_write): Remove.
9384 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9385 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9386 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9387 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9388 Likewise.
9389 (Incremental_input_entry): New class.
9390 (Incremental_script_entry): New class.
9391 (Incremental_object_entry): New class.
9392 (Incremental_archive_entry): New class.
9393 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9394 (Incremental_inputs::report_inputs): Remove.
9395 (Incremental_inputs::report_archive): Remove.
9396 (Incremental_inputs::report_archive_begin): New function.
9397 (Incremental_inputs::report_archive_end): New function.
9398 (Incremental_inputs::report_object): Change prototype.
9399 (Incremental_inputs::report_input_section): New function.
9400 (Incremental_inputs::report_script): Change prototype.
9401 (Incremental_inputs::get_reloc_count): New function.
9402 (Incremental_inputs::set_reloc_count): New function.
9403 (Incremental_inputs::create_data_sections): New function.
9404 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9405 (Incremental_inputs::inputs_section): New function.
9406 (Incremental_inputs::symtab_section): New function.
9407 (Incremental_inputs::relocs_section): New function.
9408 (Incremental_inputs::get_stringpool): Add const.
9409 (Incremental_inputs::command_line): Add const.
9410 (Incremental_inputs::inputs): Remove.
9411 (Incremental_inputs::command_line_key): New function.
9412 (Incremental_inputs::input_file_count): New function.
9413 (Incremental_inputs::input_files): New function.
9414 (Incremental_inputs::relocs_entsize): New function.
9415 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9416 (Incremental_inputs::finalize_inputs): Remove.
9417 (Incremental_inputs::Input_info): Remove.
9418 (Incremental_inputs::lock_): Remove.
9419 (Incremental_inputs::inputs_): Change type.
9420 (Incremental_inputs::inputs_map_): Remove.
9421 (Incremental_inputs::current_object_entry_): New data member.
9422 (Incremental_inputs::inputs_section_): New data member.
9423 (Incremental_inputs::symtab_section_): New data member.
9424 (Incremental_inputs::relocs_section_): New data member.
9425 (Incremental_inputs::reloc_count_): New data member.
9426 (Incremental_inputs_reader): New class.
9427 (Incremental_symtab_reader): New class.
9428 (Incremental_relocs_reader): New class.
9429 * layout.cc (Layout::finalize): Move finalization of incremental info
9430 and creation of incremental info sections to follow finalization of
9431 symbol table. Set offsets for postprocessing sections.
9432 (Layout::create_incremental_info_sections): Call
9433 Incremental_inputs::create_data_sections. Add incremental symtab
9434 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9435 sections to layout after input sections.
9436 * layout.h (struct Timespec): Forward declaration.
9437 (Layout::incremental_inputs): Add const.
9438 (Layout::create_incremental_info_sections): Add parameter.
9439 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9440 * object.cc: Include incremental.h.
9441 (Relobj::finalize_incremental_relocs): New function.
9442 (Sized_relobj::do_layout): Record input sections in incremental info.
9443 * object.h (Object::output_section): New function.
9444 (Object::output_section_offset): Moved from Relobj.
9445 (Object::get_incremental_reloc_base): New function.
9446 (Object::get_incremental_reloc_count): New function.
9447 (Object::do_output_section): New function.
9448 (Object::do_output_section_offset): Moved from Relobj.
9449 (Object::do_get_incremental_reloc_base): New function.
9450 (Object::do_get_incremental_reloc_count): New function.
9451 (Object::Object): Initialize new data members.
9452 (Relobj::output_section): Renamed do_output_section and moved to
9453 protected.
9454 (Relobj::output_section_offset): Moved to Object.
9455 (Relobj::do_get_incremental_reloc_base): New function.
9456 (Relobj::do_get_incremental_reloc_count): New function.
9457 (Relobj::allocate_incremental_reloc_counts): New function.
9458 (Relobj::count_incremental_reloc): New function.
9459 (Relobj::finalize_incremental_relocs): New function.
9460 (Relobj::next_incremental_reloc_index): New function.
9461 (Relobj::reloc_counts_): New data member.
9462 (Relobj::reloc_bases_): New data member.
9463 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9464 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9465 (Sized_relobj::incremental_relocs_scan): New function.
9466 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9467 (Sized_relobj::incremental_relocs_write): New function.
9468 (Sized_relobj::incremental_relocs_write_reltype): New function.
9469 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9470 incremental link.
9471 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9472 archives and object files elsewhere.
9473 (Add_symbols::run): Report object files here.
9474 (Finish_group::run): Report end of archive at end of group.
9475 * reloc.cc: Include layout.h, incremental.h.
9476 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9477 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9478 (Sized_relobj::incremental_relocs_scan): New function.
9479 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9480 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9481 (Sized_relobj::incremental_relocs_write): New function.
9482 (Sized_relobj::incremental_relocs_write_reltype): New function.
9483 * script.cc (read_input_script): Rewrite test for incremental link.
9484 Change call to Incremental_inputs::report_script.
9485 * symtab.h (Symbol_table::first_global_index): New function.
9486 (Symbol_table::output_count): New function.
9487
9488 2010-08-12 Doug Kwan <dougkwan@google.com>
9489
9490 * arm.cc (Target_arm::merge_object_attributes): Check command line
9491 options --no-wchar-size-warning and --no-enum-size-warning.
9492 * options.h (General_options): Add ld-compatible options
9493 --no-enum-size-warning and --no-wchar-size-warning.
9494
9495 2010-08-04 Ian Lance Taylor <iant@google.com>
9496
9497 * x86_64.cc (Target_x86_64::Scan::local): Use
9498 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9499 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9500 (Target_x86_64::Scan::global): Likewise.
9501 (Target_x86_64::Relocate::relocate): Likewise.
9502 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9503 Likewise.
9504
9505 2010-08-03 Cary Coutant <ccoutant@google.com>
9506
9507 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9508 to reserve space in merged_strings vector. Keep total input size
9509 for stats.
9510 (Output_merge_string::do_print_merge_stats): Print total input size.
9511 * merge.h (Output_merge_string): Add input_size_ field.
9512 * stringpool.cc (Stringpool_template::string_length): Move
9513 implementations out of Stringpool_template class and place in
9514 stringpool.h.
9515 * stringpool.h (string_length): Move out of Stringpool_template.
9516
9517 2010-08-03 Ian Lance Taylor <iant@google.com>
9518
9519 PR 11712
9520 * layout.cc (relaxation_loop_body): If address of load segment is
9521 set, adjust address to include headers if possible.
9522
9523 2010-08-03 Ian Lance Taylor <iant@google.com>
9524
9525 * version.cc (version_string): Bump to 1.10.
9526
9527 2010-08-03 Ian Lance Taylor <iant@google.com>
9528
9529 PR 11805
9530 * layout.h (enum Output_section_order): Define.
9531 (class Layout): Update declarations.
9532 * layout.cc (Layout::get_output_section): Add order parameter.
9533 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9534 is_first_non_relro parameters. Change all callers.
9535 (Layout::choose_output_section): Likewise.
9536 (Layout::add_output_section_data): Likewise.
9537 (Layout::make_output_section): Likewise. Set order.
9538 (Layout::default_section_order): New function.
9539 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9540 * output.cc (Output_section::Output_section): Initialize order_.
9541 Don't initialize deleted fields.
9542 (Output_segment::Output_segment): Don't initialize deleted
9543 fields.
9544 (Output_segment::add_output_section_to_load): New function
9545 replacing add_output_section. Change all callers to call this or
9546 add_output_section_to_nonload.
9547 (Output_segment::add_output_section_to_nonload): New function.
9548 (Output_segment::remove_output_section): Rewrite.
9549 (Output_segment::add_initial_output_data): Likewise.
9550 (Output_segment::has_any_data_sections): Likewise.
9551 (Output_segment::is_first_section_relro): Likewise.
9552 (Output_segment::maximum_alignment): Likewise.
9553 (Output_segment::has_dynamic_reloc): New function replacing
9554 dynamic_reloc_count. Change all callers.
9555 (Output_segment::has_dynamic_reloc_list): New function replacing
9556 dynamic_reloc_count_list. Change all callers.
9557 (Output_segment::set_section_addresses): Rewrite.
9558 (Output_segment::set_offset): Rewrite.
9559 (Output_segment::find_first_and_last_list): Remove.
9560 (Output_segment::set_tls_offsets): Rewrite.
9561 (Output_segment::first_section_load_address): Likewise.
9562 (Output_segment::output_section_count): Likewise.
9563 (Output_segment::section_with_lowest_load_address): Likewise.
9564 (Output_segment::write_section_headers): Likewise.
9565 (Output_segment::print_sections_to_map): Likewise.
9566 * output.h (class Output_data): Remove dynamic_reloc_count_
9567 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9568 (Output_data::add_dynamic_reloc): Rewrite.
9569 (Output_data::has_dynamic_reloc): New function.
9570 (Output_data::dynamic_reloc_count): Remove.
9571 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9572 is_last_relro_, is_first_non_relro_, is_interp_,
9573 is_dynamic_linker_section_ fields. Add order and set_order
9574 functions. Remove is_relro_local, set_is_relro_local,
9575 is_last_relro, set_is_last_relro, is_first_non_relro,
9576 set_is_first_non_relro functions, is_interp, set_is_interp,
9577 is_dynamic_linker_section, and set_is_dynamic_linker_section
9578 functions.
9579 (class Output_segment): Change Output_data_list from std::list to
9580 std:;vector. Add output_lists_ field. Remove output_data_ and
9581 output_bss_ fields. Update declarations.
9582
9583 2010-08-02 Ian Lance Taylor <iant@google.com>
9584
9585 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9586 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9587 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9588
9589 2010-08-02 Ian Lance Taylor <iant@google.com>
9590
9591 PR 11855
9592 * script.cc (Script_options::Script_options): Initialize
9593 symbol_definitions_ and symbol_references_.
9594 (Script_options::add_symbol_assignment): Update
9595 symbol_definitions_ and symbol_references_.
9596 (Script_options::add_symbol_reference): New function.
9597 (script_symbol): New function.
9598 * script.h (class Script_options): Add symbol_definitions_ and
9599 symbol_references_ fields.
9600 (Script_options::referenced_const_iterator): New type.
9601 (Script_options::referenced_begin): New function.
9602 (Script_options::referenced_end): New function.
9603 (Script_options::is_referenced): New function.
9604 (Script_options::any_unreferenced): New function.
9605 * script-c.h (script_symbol): Declare.
9606 * yyscript.y (exp): Call script_symbol.
9607 * symtab.cc: Include "script.h".
9608 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9609 Change all callers. Check symbols referenced by scripts.
9610 (Symbol_table::add_undefined_symbols_from_command_line): Add
9611 layout parameter. Change all callers.
9612 (Symbol_table::do_add_undefined_symbols_from_command_line):
9613 Likewise. Break out loop body. Check symbols referenced by
9614 scripts.
9615 (Symbol_table::add_undefined_symbol_from_command_line): New
9616 function broken out of
9617 do_add_undefined_symbols_from_command_line.
9618 * symtab.h (class Symbol_table): Update declarations.
9619 * archive.cc: Include "layout.h".
9620 (Archive::should_include_member): Add layout parameter. Change
9621 all callers. Check for symbol mentioned in expression.
9622 * archive.h (class Archive): Update declaration.
9623 * object.cc (Sized_relobj::do_should_include_member): Add layout
9624 parameter.
9625 * object.h (Object::should_include_member): Add layout parameter.
9626 Change all callers.
9627 (Object::do_should_include_member): Add layout parameter.
9628 (class Sized_relobj): Update declaration.
9629 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9630 parameter.
9631 * dynobj.h (class Sized_dynobj): Update declaration.
9632 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9633 layout parameter.
9634 * plugin.h (class Sized_pluginobj): Update declaration.
9635
9636 2010-08-02 Ian Lance Taylor <iant@google.com>
9637
9638 PR 11866
9639 * output.cc (Output_segment::set_offset): Search for the first and
9640 last sections rather than assuming that the list is in order.
9641 (Output_segment::find_first_and_last_list): New function.
9642 * output.h (class Output_segment): Update declarations.
9643 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9644 (relro_strip_test_SOURCES): New variable.
9645 (relro_strip_test_DEPENDENCIES): New variable.
9646 (relro_strip_test_LDFLAGS): New variable.
9647 (relro_strip_test_LDADD): New variable.
9648 (relro_strip_test.so): New target.
9649
9650 2010-08-02 Ian Lance Taylor <iant@google.com>
9651
9652 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9653 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9654 (Target_i386::got_tlsdesc_section): New function.
9655 (Target_i386::got_section): Create space for GOT entries for
9656 TLSDESC relocations.
9657 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9658 R_386_TLS_GOTDESC.
9659 (Target_i386::Scan::global): Likewise.
9660 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9661 using TLSDESC GOT.
9662 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9663 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9664 (Target_x86_64::got_tlsdesc_section): New function.
9665 (Target_x86_64::got_section): Create space for GOT entries for
9666 TLSDESC relocations.
9667 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9668 R_386_TLS_GOTDESC.
9669 (Target_x86_64::Scan::global): Likewise.
9670 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9671 using TLSDESC GOT.
9672
9673 2010-08-02 Ian Lance Taylor <iant@google.com>
9674
9675 * testsuite/final_layout.sh: Use dc to convert from hex to
9676 decimal.
9677
9678 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9679
9680 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9681 paramter to the call to gold::gc_process_relocs.
9682 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9683 paramter to the call to gold::gc_process_relocs.
9684 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9685 parameter to the call to gold::gc_process_relocs.
9686 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9687 template parameter to the call to gold::gc_process_relocs.
9688 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9689 paramter to the call to gold::gc_process_relocs.
9690 * gc.h (get_embedded_addend_size): New function.
9691 (gc_process_relocs): Save the size of the reloc for use by ICF.
9692 * icf.cc (get_section_contents): Get the addend from the text section
9693 for SHT_REL relocation sections.
9694 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9695 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9696 * int_encoding.h (read_from_pointer): New overloaded function.
9697 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9698 * testsuite/icf_sht_rel_addend_test.sh: New file.
9699 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9700 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9701
9702 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9703
9704 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9705 * Makefile.in: Regenerate.
9706 * testsuite/Makefile.in: Regenerate.
9707
9708 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9709
9710 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9711 * gold/testsuite/debug_msg.cc: Likewise.
9712 * gold/testsuite/odr_violation1.cc
9713 * gold/testsuite/odr_violation2.cc
9714
9715 2010-07-21 Cary Coutant <ccoutant@google.com>
9716
9717 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9718 string, and length fields.
9719 (Output_merge_string::Merged_strings_list): New type.
9720 (Output_merge_string::Merged_strings_lists): New typedef.
9721 (Output_merge_string): Replace merged_strings_ with
9722 merged_strings_lists_.
9723 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9724 Merged_strings_list per input object and section. Don't store pointer
9725 to the string. Don't store length with each merged string entry.
9726 (Output_merge_string::finalize_merged_data): Loop over list of merged
9727 strings lists. Recompute length of each merged string.
9728
9729 2010-07-15 Cary Coutant <ccoutant@google.com>
9730
9731 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9732 here.
9733
9734 2010-07-14 Ian Lance Taylor <iant@google.com>
9735
9736 * descriptors.cc (Descriptors::open): Report correct name in error
9737 message.
9738
9739 2010-07-13 Doug Kwan <dougkwan@google.com>
9740
9741 * arm.cc (Arm_input_section::Arm_input_section): For a
9742 SHT_ARM_EXIDX section, always keeps the input sections.
9743 (Arm_input_section::set_exidx_section_link): New method.
9744 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9745 has_errors_ to false.
9746 (Arm_exidx_input_section::has_errors,
9747 Arm_exidx_input_section::set_has_errors): New methods.
9748 (Arm_exidx_input_section::has_errors_): New data member.
9749 (Arm_relobj::get_exidx_shndx_list): New method.
9750 (Arm_output_section::append_text_sections_to_list): Do not skip
9751 section without SHF_EXECINSTR.
9752 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9753 errors.
9754 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9755 section header. Make error messages more verbose. Check for
9756 a non-executable section linked to an EXIDX section.
9757 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9758 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9759 check that there is no deferred EXIDX section if we exit early.
9760 Instead of not making an EXIDX section in case of an error, make one
9761 and set the has_errors flag of it.
9762 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9763 in a relocatable link.
9764 (Target_arm::do_relax): Look for the EXIDX output section instead of
9765 assuming that it is called .ARM.exidx.
9766 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9767 section list. Do not check for SHF_EXECINSTR section flags but
9768 skip any input section with errors.
9769 * output.cc (Output_section::Output_section): Initialize
9770 always_keeps_input_sections_ to false.
9771 (Output_section::add_input_section): Check for
9772 always_keeps_input_sections_.
9773 * output.h (Output_section::always_keeps_input_sections,
9774 Output_section::set_always_keeps_input_sections): New methods.
9775 (Output_section::always_keeps_input_sections): New data member.
9776
9777 2010-07-13 Rafael Espindola <espindola@google.com>
9778
9779 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9780 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9781
9782 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9783 Ian Lance Taylor <iant@google.com>
9784
9785 * output.h (Output_section_lookup_maps::add_merge_section):
9786 Correct check of whether value was inserted.
9787 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9788 (Output_section_lookup_maps::add_relaxed_input_section):
9789 Likewise.
9790 * arm.cc (Target_arm::got_section): Remove used local os.
9791 * i386.cc (Target_i386::got_section): Likewise.
9792 * x86_64.cc (Target_x86_64::got_section): Likewise.
9793 * sparc.cc (Target_sparc::got_section): Likewise.
9794 (Target_sparc::relocate): Remove unused local have_got_offset.
9795 * powerpc.cc (Target_powerpc::relocate): Likewise.
9796
9797 2010-07-13 Ian Lance Taylor <iant@google.com>
9798
9799 * compressed_output.cc (zlib_decompress): Fix signature in
9800 !HAVE_ZLIB_H case.
9801
9802 * archive.cc (Archive::include_member): Unlock an external member
9803 of a thin archive. Don't bother to delete an object we know is
9804 NULL.
9805
9806 2010-07-12 Cary Coutant <ccoutant@google.com>
9807
9808 * compressed_output.cc (zlib_decompress): New function.
9809 (get_uncompressed_size): New function.
9810 (decompress_input_section): New function.
9811 * compressed_output.h (get_uncompressed_size): New function.
9812 (decompress_input_section): New function.
9813 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9814 Handle compressed debug sections.
9815 * layout.cc (is_compressed_debug_section): New function.
9816 (Layout::output_section_name): Map compressed section names to
9817 canonical names.
9818 * layout.h (is_compressed_debug_section): New function.
9819 (is_debug_info_section): Recognize compressed debug sections.
9820 * merge.cc: Include compressed_output.h.
9821 (Output_merge_data::do_add_input_section): Handle compressed
9822 debug sections.
9823 (Output_merge_string::do_add_input_section): Handle compressed
9824 debug sections.
9825 * object.cc: Include compressed_output.h.
9826 (Sized_relobj::Sized_relobj): Initialize new data members.
9827 (build_compressed_section_map): New function.
9828 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9829 * object.h (Object::section_is_compressed): New method.
9830 (Object::do_section_is_compressed): New method.
9831 (Sized_relobj::Compressed_section_map): New type.
9832 (Sized_relobj::do_section_is_compressed): New method.
9833 (Sized_relobj::compressed_sections_): New data member.
9834 * output.cc (Output_section::add_input_section): Handle compressed
9835 debug sections.
9836 * reloc.cc: Include compressed_output.h.
9837 (Sized_relobj::write_sections): Handle compressed debug sections.
9838
9839 2010-07-08 Cary Coutant <ccoutant@google.com>
9840
9841 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9842 weak when resolving to a dynamic def.
9843 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9844 for weak undef/dynamic def cases. Adjust callers.
9845 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9846 undef_binding_weak_.
9847 (Symbol_table::sized_write_globals): Adjust symbol binding.
9848 (Symbol_table::sized_write_symbol): Add binding parameter.
9849 * symtab.h (Symbol::set_undef_binding): New method.
9850 (Symbol::is_undef_binding_weak): New method.
9851 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9852 (Symbol_table::should_override): Add new parameter.
9853 (Symbol_table::sized_write_symbol): Add new parameter.
9854
9855 * testsuite/weak_undef_file1.cc: Add new test case.
9856 * testsuite/weak_undef_file2.cc: Fix header comment.
9857 * testsuite/weak_undef_test.cc: Add new test case.
9858
9859 2010-06-29 Doug Kwan <dougkwan@google.com>
9860
9861 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9862 Initialize USE_SYMBOL_.
9863 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9864 definition.
9865 (Arm_reloc_property::uses_symbol_): New data member declaration.
9866 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9867 uses symbol value and symbol is undefined but not weakly undefined.
9868
9869 2010-06-28 Rafael Espindola <espindola@google.com>
9870
9871 * plugin.cc (Plugin::load): Use dlerror.
9872
9873 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9874
9875 * symtab.cc (detect_odr_violations): When reporting an ODR
9876 violation, report an object where the symbol is defined.
9877
9878 2010-06-25 Doug Kwan <dougkwan@google.com>
9879
9880 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9881 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9882 definition.
9883 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9884 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9885 target hook to detect function points.
9886 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9887 * icf.h (Icf::check_section_for_function_pointers): Change type of
9888 parameter SECTION_NAME to const reference to std::string. Use
9889 target hook to determine if section may have unsafe pointers.
9890 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9891 method definition.
9892
9893 2010-06-21 Rafael Espindola <espindola@google.com>
9894
9895 * fileread.cc (Input_file::find_fie): New
9896 (Input_file::open): Use Input_file::find_fie.
9897 * fileread.h (Input_file::find_fie): New
9898 * plugin.cc (set_extra_library_path): New.
9899 (Plugin::load): Add set_extra_library_path to the transfer vector.
9900 (Plugin_manager::set_extra_library_path): New.
9901 (Plugin_manager::add_input_file): Use the extra search path if set.
9902 (set_extra_library_path(): New.
9903 * plugin.h (Plugin_manager): Add set_extra_library_path and
9904 extra_search_path_.
9905
9906 2010-06-19 Cary Coutant <ccoutant@google.com>
9907
9908 * layout.cc (gdb_sections): Add .debug_types.
9909 (lines_only_debug_sections): Likewise.
9910
9911 2010-06-18 Rafael Espindola <espindola@google.com>
9912
9913 * plugin.cc (add_input_file,add_input_library)
9914 (Plugin_manager::add_input_file): Make filename arguments const.
9915 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9916 const.
9917
9918 2010-06-16 Doug Kwan <dougkwan@google.com>
9919
9920 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9921 .ARM.attributes section if we have not merged any input
9922 attributes sections.
9923
9924 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9925
9926 * arm.cc: Allow combining objects with no EABI version
9927 information.
9928
9929 2010-06-15 Rafael Espindola <espindola@google.com>
9930
9931 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9932
9933 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9934
9935 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9936 (struct iovec): Correct !HAVE_READV definition.
9937
9938 2010-06-10 Cary Coutant <ccoutant@google.com>
9939
9940 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9941 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9942 reloc sections.
9943 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9944
9945 PR 11683
9946 * symtab.h (Symbol::is_placeholder): New member function.
9947 * target-reloc.h (relocate_section): Check for placeholder symbols.
9948
9949 * testsuite/Makefile.am (plugin_test_8): New test.
9950 (plugin_test_9): New test.
9951 * testsuite/Makefile.in: Regenerate.
9952
9953 2010-06-09 Nick Clifton <nickc@redhat.com>
9954
9955 * yyscript.y (input_list_element): Allow strings prefixed with
9956 the '-' character. Treat these as libraries.
9957 * script.cc (script_add_library): New function. Adds a library
9958 specified by "-l<name>" found in an input script.
9959 * script-c.h: Add prototype for script_add_library.
9960
9961 2010-06-07 Doug Kwan <dougkwan@google.com>
9962
9963 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9964 Restrict stub-group size to be within long conditional branch
9965 range when working around cortex-A8 erratum.
9966
9967 2010-06-07 Damien Diederen <dd@crosstwine.com>
9968
9969 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9970 #ifdef typo.
9971
9972 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9973
9974 PR gold/11658
9975 * output.cc
9976 (Output_section::Input_section_sort_entry::compare_section_ordering):
9977 Change to return non-zero correctly.
9978 (Output_section::Input_section_sort_section_order_index_compare
9979 ::operator()): Change to fix ambiguity in comparisons.
9980
9981 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9982
9983 * gold.h (is_wildcard_string): New function.
9984 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9985 (Layout::layout_eh_frame): Ditto.
9986 (Layout::find_section_order_index): New method.
9987 (Layout::read_layout_from_file): New method.
9988 * layout.h (Layout::find_section_order_index): New method.
9989 (Layout::read_layout_from_file): New method.
9990 (Layout::input_section_position_): New private member.
9991 (Layout::input_section_glob_): New private member.
9992 * main.cc (main): Call read_layout_from_file here.
9993 * options.h (--section-ordering-file): New option.
9994 * output.cc (Output_section::input_section_order_specified_): New
9995 member.
9996 (Output_section::Output_section): Initialize new member.
9997 (Output_section::add_input_section): Add new parameter.
9998 Keep input sections when --section-ordering-file is used.
9999 (Output_section::set_final_data_size): Sort input sections when
10000 section ordering file is specified.
10001 (Output_section::Input_section_sort_entry): Add new parameter.
10002 Check sorting type.
10003 (Output_section::Input_section_sort_entry::compare_section_ordering):
10004 New method.
10005 (Output_section::Input_section_sort_compare::operator()): Change to
10006 consider section_order_index.
10007 (Output_section::Input_section_sort_init_fini_compare::operator()):
10008 Change to consider section_order_index.
10009 (Output_section::Input_section_sort_section_order_index_compare
10010 ::operator()): New method.
10011 (Output_section::sort_attached_input_sections): Change to sort
10012 according to section order when specified.
10013 (Output_section::add_input_section<32, true>): Add new parameter.
10014 (Output_section::add_input_section<64, true>): Add new parameter.
10015 (Output_section::add_input_section<32, false>): Add new parameter.
10016 (Output_section::add_input_section<64, false>): Add new parameter.
10017 * output.h (Output_section::add_input_section): Add new parameter.
10018 (Output_section::input_section_order_specified): New
10019 method.
10020 (Output_section::set_input_section_order_specified): New method.
10021 (Input_section::Input_section): Initialize section_order_index_.
10022 (Input_section::section_order_index): New method.
10023 (Input_section::set_section_order_index): New method.
10024 (Input_section::section_order_index_): New member.
10025 (Input_section::Input_section_sort_section_order_index_compare): New
10026 struct.
10027 (Output_section::input_section_order_specified_): New member.
10028 * script-sections.cc (is_wildcard_string): Delete and move modified
10029 method to gold.h.
10030 (Output_section_element_input::Output_section_element_input): Modify
10031 call to is_wildcard_string.
10032 (Output_section_element_input::Input_section_pattern
10033 ::Input_section_pattern): Ditto.
10034 (Output_section_element_input::Output_section_element_input): Ditto.
10035 * testsuite/Makefile.am (final_layout): New test case.
10036 * testsuite/Makefile.in: Regenerate.
10037 * testsuite/final_layout.cc: New file.
10038 * testsuite/final_layout.sh: New file.
10039
10040 2010-06-01 Rafael Espindola <espindola@google.com>
10041
10042 * plugin.cc (Plugin::load): Pass the output name to the plugin.
10043
10044 2010-06-01 Rafael Espindola <espindola@google.com>
10045
10046 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
10047 visibility of symbols.
10048
10049 2010-05-27 Doug Kwan <dougkwan@google.com>
10050
10051 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
10052 from start of output section instead of address for a local symbol
10053 in a merged or relaxed section when doing a relocatable link.
10054
10055 2010-05-26 Rafael Espindola <espindola@google.com>
10056
10057 PR 11604
10058 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
10059 adding sections the garbage collector removed.
10060 * gold/testsuite/Makefile.am: Add test.
10061 * gold/testsuite/Makefile.in: Regenerate.
10062 * gold/testsuite/plugin_test_7.sh: New.
10063 * gold/testsuite/plugin_test_7_1.c: New.
10064 * gold/testsuite/plugin_test_7_2.c: New.
10065
10066 2010-05-26 Rafael Espindola <espindola@google.com>
10067
10068 * script-sections.cc (Output_section_definition::set_section_addresses):
10069 Check for --section-start.
10070
10071 2010-05-26 Doug Kwan <dougkwan@google.com>
10072
10073 * arm.cc (Arm_scan_relocatable_relocs): New class.
10074 (Target_arm::relocate_special_relocatable): New method.
10075 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
10076 (Arm_relocate_functions::thumb_branch_common): Same.
10077 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
10078 instead of Default_scan_relocatable_relocs.
10079 * target-reloc.h (relocate_for_relocatable): Let target handle
10080 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
10081 * target.h (Sized_target::relocate_special_relocatable): New method.
10082
10083 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10084
10085 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
10086
10087 2010-05-23 Doug Kwan <dougkwan@google.com>
10088
10089 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
10090 instead of a cast.
10091 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
10092 with a direct branch, not a conditional branch, to a stub.
10093 * merge.cc (Output_merge_base::record_input_section): New method
10094 defintion.
10095 (Output_merge_data::do_add_input_section): Record input section if
10096 keeps-input-sections flag is set.
10097 (Output_merge_string::do_add_input_section): Ditto.
10098 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
10099 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
10100 INPUT_SECTIONS_.
10101 (Output_merge_base::keeps_input_sections,
10102 Output_merge_base::set_keeps_input_sections,
10103 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
10104 method definitions.
10105 (Output_merge_base::Input_sections): New type declaration.
10106 (Output_merge_base::input_sections_begin,
10107 Output_merge_base::input_sections_end,
10108 Output_merge_base::do_set_keeps_input_sections): New method definitions.
10109 (Output_merge_base::bool keeps_input_sections_,
10110 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
10111 Output_merge_base::input_sections_): New data members.
10112 (Output_merge_data::do_set_keeps_input_sections): New method
10113 defintion.
10114 (Output_merge_string::do_set_keeps_input_sections): Ditto.
10115 * output.cc (Output_section::Input_section::relobj): Move method
10116 defintion from class declaration to here and handle merge sections.
10117 (Output_section::Input_section::shndx): Ditto.
10118 (Output_section::Output_section): Remove initializations of removed
10119 data members and initialize new data member LOOKUP_MAPS_.
10120 (Output_section::add_input_section): Set keeps-input-sections flag
10121 for a newly created merge output section as appropriate. Adjust code
10122 to use Output_section_lookup_maps class.
10123 (Output_section::add_relaxed_input_section): Adjst code for lookup
10124 maps code refactoring.
10125 (Output_section::add_merge_input_section): Add a new parameter
10126 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
10127 class. If adding input section to a newly created merge output
10128 section fails, remove the new merge section.
10129 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
10130 Adjust code for use of the Output_section_lookup_maps class.
10131 (Output_section::find_merge_section): Ditto.
10132 (Output_section::build_lookup_maps): New method defintion.
10133 (Output_section::find_relaxed_input_section): Adjust code to use
10134 Output_section_lookup_maps class.
10135 (Output_section::get_input_sections): Export merge sections. Adjust
10136 code to use Output_section_lookup_maps class.
10137 (Output_section:::add_script_input_section): Adjust code to use
10138 Output_section_lookup_maps class. Update lookup maps for merge
10139 sections also.
10140 (Output_section::discard_states): Use Output_section_lookup_maps.
10141 (Output_section::restore_states): Same.
10142 * output.h (Merge_section_properties): Move class defintion out of
10143 Output_section.
10144 (Output_section_lookup_maps): New class.
10145 (Output_section::Input_section::is_merge_section): New method
10146 defintion.
10147 (Output_section::Input_section::relobj): Move defintion out of class
10148 defintion. Declare method only.
10149 (Output_section::Input_section::shndx): Ditto.
10150 (Output_section::Input_section::output_merge_base): New method defintion.
10151 (Output_section::Input_section::u2_.pomb): New union field.
10152 (Output_section::Merge_section_by_properties_map,
10153 Output_section::Output_section_data_by_input_section_map,
10154 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
10155 Remove types.
10156 (Output_section::add_merge_input_section): Add new parameter
10157 KEEPS_INPUT_SECTIONS.
10158 (Output_section::build_lookup_maps): New method declaration.
10159 (Output_section::merge_section_map_,
10160 Output_section::merge_section_by_properties_map_,
10161 Output_section::relaxed_input_section_map_,
10162 Output_section::is_relaxed_input_section_map_valid_): Remove data
10163 members.
10164 (Output_section::lookup_maps_): New data member.
10165
10166 2010-05-21 Doug Kwan <dougkwan@google.com>
10167
10168 PR gold/11619
10169 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
10170 avoid a compilation error.
10171
10172 2010-05-19 Rafael Espindola <espindola@google.com>
10173
10174 * script-sections.cc (Output_section_definition::allocate_to_segment):
10175 Update the phdrs_list even when the output section is NULL.
10176 * testsuite/Makefile.am: Add test.
10177 * testsuite/Makefile.in: Regenerate.
10178 * testsuite/script_test_9.cc: New.
10179 * testsuite/script_test_9.sh: New.
10180 * testsuite/script_test_9.t: New.
10181
10182 2010-05-19 Doug Kwan <dougkwan@google.com>
10183
10184 * arm.cc (Arm_input_section::original_size): New method.
10185 (Arm_input_section::do_addralign): Add a cast.
10186 (Arm_input_section::do_output_offset): Remove static cast.
10187 (Arm_input_section::original_addralign,
10188 Arm_input_section::original_size_): Change type to uint32_t.
10189 (Arm_input_section::init): Add safe casts for section alignment
10190 and size.
10191 (Arm_input_section::set_final_data_size): Do not set address and
10192 offset of stub table.
10193 (Arm_output_section::fix_exidx_coverage): Change use of of
10194 Output_section::Simple_input_section to that of
10195 Output_section::Input_section.
10196 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10197 except for the first pass.
10198 * output.cc (Output_section::get_input_sections): Change type of
10199 input_sections to std::list<Input_section>.
10200 (Output_section::add_script_input_section): Rename from
10201 Output_section::add_simple_input_section. Change type of SIS
10202 parameter from Simple_input_section to Input_section.
10203 * output.h (Output_section::Simple_input_section): Remove class.
10204 (Output_section::Input_section): Change class visibility to public.
10205 (Output_section::Input_section::addralign): Use stored alignments
10206 for special input sections if set.
10207 (Output_section::Input_section::set_addralign): New method.
10208 (Output_section::get_input_sections): Change parameter type from
10209 list of Simple_input_section to list of Input_section.
10210 (Output_section::add_script_input_section): Rename from
10211 Output_section::add_simple_input_section. Change first parameter's
10212 type from Simple_input_section to Input_section and remove the
10213 second and third parameters.
10214 * script-sections.cc (Input_section::Input_section_list): Change
10215 type to list of Output_section::Input_section/
10216 (Input_section_info::Input_section_info): Change parameter type of
10217 INPUT_SECTION to Output_section::Input_section.
10218 (Input_section_info::input_section): Change return type.
10219 (Input_section_info::input_section_): Change type to
10220 Output_section::Input_section.
10221 (Output_section_element_input::set_section_addresses): Adjust code
10222 to use Output_section::Input_section instead of
10223 Output_section::Simple_input_section. Adjust code for renaming
10224 of Output_section::add_simple_input_section.
10225 (Orphan_output_section::set_section_addresses): Ditto.
10226
10227 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10228
10229 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10230 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10231
10232 2010-05-18 Rafael Espindola <espindola@google.com>
10233
10234 * options.cc (General_options::finalize): Handle -nostdlib.
10235 * options.h (nostdlib): New option.
10236 * script.cc (script_add_search_dir): Handle -nostdlib.
10237
10238 2010-05-12 Doug Kwan <dougkwan@google.com>
10239
10240 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10241 attributes section only if there no attributes section after merging.
10242 (Target_arm::merge_object_attributes): Move value of
10243 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
10244 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10245 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10246 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10247 and arm_attr_merge_7.stdout.
10248 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10249 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10250 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10251 arm_attr_merge_7b.o): New rules.
10252 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10253 arm_attr_merge_7
10254 * testsuite/Makefile.in: Regenerate.
10255 * testsuite/arm_attr_merge.sh: New file.
10256 * testsuite/arm_attr_merge_[67][ab].s: Same.
10257
10258 2010-05-05 Nick Clifton <nickc@redhat.com>
10259
10260 * po/es.po: Updated Spanish translation.
10261
10262 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10263
10264 * Makefile.am (install-exec-local): Properly install gold as
10265 default cross linker.
10266 * Makefile.in: Regenerated.
10267
10268 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10269 Nick Clifton <nickc@redhat.com>
10270
10271 * configure.ac (install_as_default): Define and set to false
10272 unless --enable-gold or --enable-gold=both/gold has been
10273 specified.
10274 * configure: Regenerate.
10275
10276 * Makefile.am (install-exec-local): Install the executable as
10277 'ld.gold'. If install_as_default is true then also install it as
10278 'ld'.
10279 * Makefile.in: Regenerated.
10280
10281 2010-04-24 Ian Lance Taylor <iant@google.com>
10282
10283 * layout.cc (Layout::layout_reloc): In relocatable link don't
10284 combine reloc sections for grouped sections.
10285
10286 2010-04-23 Sriraman Tallam <tmsriram@google.com>
10287
10288 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10289 sections that are not ordinary to icf.
10290 * icf.cc (get_section_contents): Handle relocation pointing to section
10291 with no object or shndx information.
10292 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10293 * testsuite/Makefile.in: Regenerate.
10294 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10295 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10296
10297 2010-04-22 Ian Lance Taylor <iant@google.com>
10298
10299 * expression.cc (Expression::Expression_eval_info): Add
10300 result_alignment_pointer field.
10301 (Expression::eval_with_dot): Add result_alignment_pointer
10302 parameter. Change all callers.
10303 (Expression::eval_maybe_dot): Likewise.
10304 (class Binary_expression): Add alignment_pointer parameter to
10305 left_value and right_value. Change all callers.
10306 (BINARY_EXPRESSION): Set result alignment.
10307 (class Trinary_expression): Add alignment_pointer parameter to
10308 arg2_value and arg3_value. Change all callers.
10309 (Trinary_cond::value): Set result alignment.
10310 (Max_expression::value, Min_expression::value): Likewise.
10311 (Align_expression::value): Likewise.
10312 * script-sections.cc (class Sections_element): Add dot_alignment
10313 parameter to set_section_addresses virtual function. Update
10314 instantiations.
10315 (class Output_section_element): Likewise.
10316 (Script_sections::create_segments): Add dot_alignment parameter.
10317 Change all callers.
10318 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10319 (Script_sections::set_phdrs_clause_addresses): Likewise.
10320 * script-sections.h: Update declarations.
10321 * script.h: Update declarations.
10322 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10323 min_p_align.
10324 * testsuite/script_test_3.t: Set large alignment.
10325 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10326 segment has expected alignment.
10327
10328 2010-04-22 Nick Clifton <nickc@redhat.com>
10329
10330 * po/gold.pot: Updated by the Translation project.
10331 * po/vi.po: Updated Vietnamese translation.
10332
10333 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10334
10335 * testsuite/Makefile.am (check_PROGRAMS): Add
10336 icf_virtual_function_folding_test.
10337 * testsuite/Makefile.in: Regenerated.
10338
10339 2010-04-15 Andrew Haley <aph@redhat.com>
10340
10341 * options.h (merge_exidx_entries): New option.
10342 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10343 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10344 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10345 (Target_arm::merge_exidx_entries): New function.
10346 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10347 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10348 to Arm_exidx_fixup constructor.
10349 Add new arg, merge_exidx_entries.
10350 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10351 Arm_output_section::fix_exidx_coverage.
10352
10353 2010-04-18 Sriraman Tallam <tmsriram@google.com>
10354
10355 * icf.cc (get_section_contents): Check for preemptible functions.
10356 Ignore addend when appropriate.
10357 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10358 section folded.
10359 (add_from_relobj): Check for section folded.
10360 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10361 * symtab.h (should_add_dynsym_entry): Add new parameter.
10362 * target-reloc.h (scan_relocs): Check for section folded.
10363 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10364 Check reloc types for function pointers in shared objects.
10365 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10366 case.
10367 (icf_preemptible_functions_test): New test case.
10368 (icf_string_merge_test): New test case.
10369 * testsuite.Makefile.in: Regenerate.
10370 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10371 bar_glob. Refactor code.
10372 * testsuite/icf_preemptible_functions_test.cc: New file.
10373 * testsuite/icf_preemptible_functions_test.sh: New file.
10374 * testsuite/icf_string_merge_test.cc: New file.
10375 * testsuite/icf_string_merge_test.sh: New file.
10376 * testsuite/icf_virtual_function_folding_test.cc: New file.
10377 * testsuite/icf_virtual_function_folding_test.sh: New file.
10378
10379 2010-04-14 Doug Kwan <dougkwan@google.com>
10380
10381 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10382 for local symbol recounting if we remove a section due to ICF.
10383 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10384 there are no regular objects in input.
10385
10386 2010-04-13 Doug Kwan <dougkwan@google.com>
10387
10388 * arm.cc (Arm_input_section::set_final_data_size): Compute
10389 accurate final data size instead of using current data size.
10390
10391 2010-04-09 Doug Kwan <dougkwan@google.com>
10392
10393 * layout.cc (Layout::choose_output_section): Handle script section
10394 types.
10395 (Layout::make_output_section_for_script): Add section type parameter.
10396 Handle script section types.
10397 * layout.h (Layout::make_output_section_for_script): Add section
10398 type parameter.
10399 * output.cc (Output_section::Output_section): Initialize data member
10400 is_noload_.
10401 (Output_section::do_reset_address_and_file_offset): Do not set address
10402 to 0 if section is a NOLOAD section.
10403 * output.h (Output_section::is_noload): New method.
10404 (Output_section::set_is_noload): Ditto.
10405 (Output_section::is_noload_): New data member.
10406 * script-c.h (Script_section_type): New enum type.
10407 (struct Parser_output_section_header): Add new file section_type.
10408 * script-sections.cc (Sections_element::output_section_name): Add
10409 parameter for returning script section type.
10410 (Output_section_definition::output_section_name): Ditto.
10411 (Output_section_definition::section_type)P; New method.
10412 (Output_section_definiton::script_section_type_name): Ditto.
10413 (Output_section_definition::script_section_type_): New data member.
10414 (Output_section_definition::Output_section_definition): Initialize
10415 data member Output_section_definition::script_section_type_.
10416 (Output_section_definition::create_sections): Pass script section type
10417 to Layout::make_output_section_for_script.
10418 (Output_section_definition::output_section_name): Return script
10419 section type to caller.
10420 (Output_section_definition::set_section_address): Do not advance
10421 dot value and load address if section type is NOLOAD. Set address
10422 of NOLOAD sections regardless of section flags.
10423 (Output_section_definition::print): Print section type if it is
10424 not SCRIPT_SECTION_TYPE_NONE.
10425 (Output_section_definition::section_type): New method.
10426 (Output_section_definition::script_section_type_name): Ditto.
10427 (Script_sections::output_section_name): Add new parameter
10428 PSECTION_TYPE for returning script section type. Pass it to
10429 section elements. Handle discard sections.
10430 (Sort_output_sections::operator()): Handle NOLOAD sections.
10431 * script-sections.h (Script_sections::Section_type): New enum type.
10432 (Script_sections::output_section_name): Add a new parameter for
10433 returning script section type.
10434 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10435 INFO and NOLOAD.
10436 * yyscript.y (union): Add new field SECTION_TYPE.
10437 (COPY, DSECT, INFO, NOLOAD): New tokens.
10438 (opt_address_and_section_type): Change type to output_section_header.
10439 (section_type): New non-terminal
10440 (section_header): Handle section type.
10441 (opt_address_and_section_type): Return section type value.
10442
10443 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10444
10445 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10446 * testsuite/plugin_common_test_2.c (foo): Likewise.
10447
10448 2010-04-08 Doug Kwan <dougkwan@google.com>
10449
10450 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10451 Output_merge_data.
10452 * output.cc (Output_section::add_merge_input_section): Simplify
10453 code and return status of Output_merge_base::add_input_section.
10454 Update merge section map only if Output_merge_base::add_input_section
10455 returns true.
10456
10457 2010-04-07 Doug Kwan <dougkwan@google.com>
10458
10459 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10460 if section is marked as containing instructions but has no mapping
10461 symbols.
10462 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10463 correct section index.
10464 (Arm_relobj::find_linked_text_section): Ditto.
10465
10466 2010-04-07 Cary Coutant <ccoutant@google.com>
10467
10468 * archive.cc (include_member): Destroy Read_symbols_data object before
10469 releasing file.
10470 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10471 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10472 (Read_symbols_data::~Read_symbols_data) New destructor.
10473 (Section_relocs::Section_relocs) New constructor.
10474 (Section_relocs::~Section_relocs) New destructor.
10475 (Read_relocs_data::Read_relocs_data) New constructor.
10476 (Read_relocs_data::~Read_relocs_data) New destructor.
10477 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10478 pointers to NULL after deleting.
10479
10480 2010-04-07 Doug Kwan <dougkwan@google.com>
10481
10482 * arm.cc: Replace "endianity" with "endianness" in comments.
10483 (Arm_exidx_cantunwind): Ditto.
10484 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10485 (Arm_relobj::merge_flags_and_attributes): New method.
10486 (Arm_relobj::merge_flags_and_attributes_): New data member.
10487 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10488 (Arm_relobj::scan_sections_for_stubs): Ditto.
10489 (Arm_relobj::do_read_symbols): Check to see if we really want to
10490 merge processor-specific flags and attributes. Exit early if
10491 an object is empty except for section names and the undefined symbol.
10492 (Target_arm::do_finalize_sections): Move check for ELF format to
10493 Arm_relobj::do_read_symbols. Merge processor specific flags and
10494 attributes from a regular object only when we have determined that
10495 it is aapropriate. Do not create an .ARM.attributes section in
10496 output if there is no regular input object.
10497 (Target_arm::merge_processor_specific_flags): Check
10498 --warn-mismatch before printing any error.
10499 (Target_arm::merge_object_attributes): Ditto.
10500 * gold.cc (queue_middle_tasks): Handle the case in which there is
10501 no regular object in input.
10502 * options.cc (General_options::parse_EB): New method.
10503 (General_options::parse_EL): Same.
10504 (General_options::General_options): Initialize endianness_.
10505 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10506 New options.
10507 (General_options::Endianness): New enum.
10508 (General_options::endianness): New method.
10509 (General_options::endianness_): New data member.
10510 * parameters.cc (Parameters::set_options): Check target endianness.
10511 (Parameters::set_target_once): Ditto.
10512 (Parameters::check_target_endianness): New method.
10513 (parameters_force_valid_target): If either -EL or -EB is specified,
10514 use it to define endianness of default target.
10515 * parameters.h (Parameters::check_target_endianness): New method
10516 declaration.
10517 * target.h (class Target): Change "endianity" to "endianness"
10518 in comments.
10519
10520 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10521
10522 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10523 * configure: Regenerate.
10524 * Makefile.in: Regenerate.
10525 * testsuite/Makefile.in: Regenerate.
10526
10527 2010-04-06 Cary Coutant <ccoutant@google.com>
10528
10529 gcc PR lto/42757
10530 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10531 prevailing definitions of common symbols.
10532 * testsuite/plugin_test_6.sh: New test case.
10533 * testsuite/plugin_common_test_1.c: New test case.
10534 * testsuite/plugin_common_test_2.c: New test case.
10535 * testsuite/Makefile.am (plugin_test_6): New test case.
10536 * testsuite/Makefile.in: Regenerate.
10537
10538 2010-04-06 Nick Clifton <nickc@redhat.com>
10539
10540 * po/vi.po: New Vietnamese translation.
10541
10542 2010-03-30 Doug Kwan <dougkwan@google.com>
10543
10544 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10545
10546 2010-03-25 Doug Kwan <dougkwan@google.com>
10547
10548 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10549 to avoid a conversion warning on a 32-bit host.
10550
10551 2010-03-24 Ian Lance Taylor <iant@google.com>
10552
10553 * testsuite/script_test_3.t: Add a TLS segment.
10554 * testsuite/Makefile.am (check_PROGRAMS): Add
10555 tls_phdrs_script_test.
10556 (tls_phdrs_script_test_SOURCES): Define.
10557 (tls_phdrs_script_test_DEPENDENCIES): Define.
10558 (tls_phdrs_script_test_LDFLAGS): Define.
10559 (tls_phdrs_script_test_LDADD): Define.
10560 * testsuite/Makefile.in: Rebuild.
10561
10562 2010-03-23 Cary Coutant <ccoutant@google.com>
10563
10564 * fileread.cc (find_or_make_view): Fix comment.
10565
10566 2010-03-23 Ian Lance Taylor <iant@google.com>
10567
10568 * script-sections.cc (class Orphan_section_placement): Define
10569 PLACE_TLS and PLACE_TLS_BSS.
10570 (Orphan_section_placement::Orphan_section_placement): Initialize
10571 new places.
10572 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10573 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10574 (tls_script_test_SOURCES): Define.
10575 (tls_script_test_DEPENDENCIES): Define.
10576 (tls_script_test_LDFLAGS): Define.
10577 (tls_script_test_LDADD): Define.
10578 * testsuite/Makefile.in: Rebuild.
10579
10580 2010-03-22 Doug Kwan <dougkwan@google.com>
10581
10582 * arm.cc (Arm_relocate_functions::abs8,
10583 Arm_relocate_functions::abs16): Use correct check for overflow
10584 specified in the ARM ELF specs.
10585 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10586 target of a BLX instruction specially.
10587 (Reloc_stub::stub_type_for_reloc): Ditto.
10588 (Relocate::relocate): Use symbolic names instead of numeric relocation
10589 codes to report error.
10590 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10591 workaround.
10592 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10593 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10594 thumb2_blx_out_of_range.stdout
10595 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10596 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10597 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10598 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10599 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10600 thumb2_blx_in_range, thumb2_blx_in_range.o,
10601 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10602 thumb2_blx_out_of_range.o): New rules.
10603 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
10604 thumb2_blx_in_range and thumb2_blx_out_of_range.
10605 * testsuite/Makefile.in: Regenerate.
10606 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10607 * testsuite/thumb_blx_in_range.s: New file.
10608 * testsuite/thumb_blx_out_of_range.s: New file.
10609
10610 2010-03-22 Rafael Espindola <espindola@google.com>
10611
10612 * archive.cc (Should_include): Move to archive.h.
10613 (should_include_member): Make it a member of Archive.
10614 (Lib_group): New.
10615 (Add_lib_group_symbols): New.
10616 * archive.h: Include options.h.
10617 (Archive_member): Moved from Archive.
10618 (Should_include): Moved from archive.cc.
10619 (Lib_group): New.
10620 (Add_lib_group_symbols): New.
10621 * dynobj.cc (do_should_include_member): New.
10622 * dynobj.h (do_should_include_member): New.
10623 * gold.cc (queue_initial_tasks): Update call to queue.
10624 * main.cc (main): Print lib group stats.
10625 * object.cc (do_should_include_member): New.
10626 * object.h: Include archive.h.
10627 (Object::should_include_member): New.
10628 (Object::do_should_include_member): New.
10629 (Sized_relobj::do_should_include_member): New.
10630 * options.cc (General_options::parse_start_lib): New.
10631 (General_options::parse_end_lib): New.
10632 (Input_arguments::add_file): Handle lib groups.
10633 (Input_arguments::start_group): Check we are not in a lib.
10634 (Input_arguments::start_lib): New.
10635 (Input_arguments::end_lib): New.
10636 * options.h (General_options): Add start_lib and end_lib.
10637 (Input_argument::lib_): New.
10638 (Input_argument::lib): New.
10639 (Input_argument::is_lib): New.
10640 (Input_file_lib): New.
10641 (Input_arguments::in_lib_): New.
10642 (Input_arguments::in_lib): New.
10643 (Input_arguments::start_lib): New.
10644 (Input_arguments::end_lib_): New.
10645 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10646 in unused members as preempted.
10647 (Sized_pluginobj::do_should_include_member): New.
10648 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10649 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10650 return the blocker.
10651 (Read_symbols::do_whole_lib_group): New.
10652 (Read_symbols::do_lib_group): New.
10653 (Read_symbols::do_read_symbols): Handle lib groups.
10654 (Read_symbols::get_name): Handle lib groups.
10655 * readsyms.h (Read_symbols): Add an archive member pointer.
10656 (Read_symbols::do_whole_lib_group): New.
10657 (Read_symbols::do_lib_group): New.
10658 (Read_symbols::member_): New.
10659 * script.cc (read_input_script): Update call to queue_soon.
10660
10661 2010-03-19 Doug Kwan <dougkwan@google.com>
10662
10663 * arm.cc (Stub_table::Stub_table): Initialize new data members
10664 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10665 (Stub_table::add_reloc_stub): Assign stub offset and update
10666 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10667 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10668 New data members.
10669 (Stub_table::update_data_size_and_addralign): Use
10670 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10671 instead of going over all reloc stubs.
10672 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10673 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10674 Stringpool_template::offset_ to size of Stringpool_char.
10675 (Stringpool_template::new_key_offset): Remove code to initialize
10676 Stringpool_template::offset_.
10677 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10678 Stringpool_template::offset_ to zero.
10679
10680 2010-03-15 Doug Kwan <dougkwan@google.com>
10681
10682 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10683 offset_.
10684 (Stringpool_template::new_key_offset): New method.
10685 (Stringpool_template::add_string): Assign offsets when adding new
10686 strings.
10687 (Stringpool_template::set_string_offsets): Do not set string offsets
10688 when not optimizing.
10689 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10690 member size_.
10691 (Chunked_vector::clear): Clear size_.
10692 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10693 (Chunked_vector::size): Return size_.
10694 (Chunked_vector::push_back): Use size_ to find insert position.
10695 (Chunked_vector::size_): New data member.
10696 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10697 (Stringpool_template::new_key_offset): New method declaration.
10698 (Stringpool_template::offset_): New data member.
10699
10700 2010-03-15 Rafael Espindola <espindola@google.com>
10701
10702 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10703 Add_symbols' constructor.
10704 * readsyms.h (Add_symbols): Remove the input_group member.
10705
10706 2010-03-10 Ian Lance Taylor <iant@google.com>
10707
10708 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10709 target to ask whether a reference to a symbol requires a stack
10710 split.
10711 * target.h (Target::is_call_to_non_split): New function.
10712 (Target::do_is_call_to_non_split): Declare virtual function.
10713 * target.cc: Include "symtab.h".
10714 (Target::do_is_call_to_non_split): New function.
10715 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10716
10717 2010-03-10 Cary Coutant <ccoutant@google.com>
10718
10719 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10720 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10721 (File_read::open[2]): Add whole_file_view_ to list of views.
10722 (File_read::make_view): Remove test of whole_file_view_.
10723 (File_read::find_or_make_view): Create whole_file_view_ if
10724 necessary.
10725 (File_read::clear_views): Replace bool parameter with enum;
10726 adjust all callers. Don't delete views with permanent data;
10727 do delete cached views and views from archives if
10728 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10729 if clearing the corresponding view.
10730 * fileread.h (File_read::Clear_views_mode): New enum.
10731 (File_read::View::is_permanent_view): New method.
10732 (File_read::clear_views): Replace bool parameter
10733 with enum; adjust all callers.
10734 * options.h (General_options): Change keep_files_mapped option;
10735 add map_whole_files.
10736 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10737 releasing the file.
10738 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10739 the file.
10740
10741 2010-03-10 David S. Miller <davem@davemloft.net>
10742
10743 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10744
10745 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10746
10747 * icf.cc (get_section_contents): Add '@' marker after processing the
10748 merge reloc.
10749
10750 2010-03-08 Doug Kwan <dougkwan@google.com>
10751
10752 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10753 due to a conversion warning.
10754 (Arm_relobj::update_output_local_symbol_count): Check for local
10755 symbol with unset output index.
10756
10757 2010-03-05 Ian Lance Taylor <iant@google.com>
10758
10759 * options.h (class General_options): Add --spare-dynamic-tags.
10760 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10761 --spare-dynamic-tags.
10762
10763 2010-03-05 Ian Lance Taylor <iant@google.com>
10764
10765 * incremental.cc: Include "libiberty.h".
10766
10767 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10768
10769 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10770 function, is_info_ member.
10771 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10772 (Versions::Versions): Update caller.
10773 (Versions::define_base_version): Likewise.
10774 (Versions::add_def): Likewise.
10775
10776 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10777
10778 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10779 (Scan::possible_function_pointer_reloc): New function.
10780 (Scan::local_reloc_may_be_function_pointer): Change to call
10781 possible_function_pointer_reloc.
10782 (Scan::global_reloc_may_be_function_pointer): Ditto.
10783 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10784 relocations in ".data.rel.ro._ZTV" section.
10785 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10786 * testsuite/icf_safe_so_test.cc: Ditto.
10787 * testsuite/icf_safe_test.cc: Ditto.
10788 * testsuite/icf_safe_test.sh: Ditto.
10789
10790 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10791 Ian Lance Taylor <iant@google.com>
10792
10793 * target-reloc.h (relocate_section): Check the symbol table index
10794 for -1U before setting the local symbol index.
10795 (scan_relocatable_relocs): If copying the relocation, record that
10796 the local symbol is required.
10797 * object.h (Symbol_value::is_output_symtab_index_set): New
10798 function.
10799 (Symbol_value::may_be_discarded_from_output_symtab): New
10800 function.
10801 (Symbol_value::has_output_symtab_entry): New function.
10802 (Symbol_value::needs_output_symtab_entry): Remove.
10803 (Symbol_value::output_symtab_index): Make sure the symbol index is
10804 set.
10805 (Symbol_value::set_output_symtab_index): Make sure the symbol
10806 index is not set. Make sure the new index is valid.
10807 (Symbol_value::set_must_have_output_symtab_entry): New function.
10808 (Symbol_value::has_output_dynsym_entry): New function.
10809 (Symbol_value::set_output_dynsym_index): Make sure the new index
10810 is valid.
10811 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10812 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10813 local symbol if permitted.
10814 (Sized_relobj::do_finalize_local_symbols): Call
10815 is_output_symtab_index_set rather than needs_output_symtab_entry.
10816 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10817 rather than needs_output_symtab_entry. Call
10818 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10819 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10820 is_output_symtab_index_set rather than needs_output_symtab_entry.
10821 * testsuite/discard_locals_relocatable_test.c: New file.
10822 * testsuite/discard_locals_test.sh: Test -r.
10823 * testsuite/Makefile.am (check_DATA): Add
10824 discard_locals_relocatable_test1.syms,
10825 discard_local_relocatable_test2.syms.
10826 (MOSTLYCLEANFILES): Likewise. Also add
10827 discard_locals_relocatable_test1.lout and
10828 discard_locals_relocatable_test2.out.
10829 (discard_locals_relocatable_test1.syms): New target.
10830 (discard_locals_relocatable_test.o): New target.
10831 (discard_locals_relocatable_test1.out): New target.
10832 (discard_locals_relocatable_test2.syms): New target.
10833 (discard_locals_relocatable_test2.out): New target.
10834 (various): Add missing ../ld-new dependencies.
10835 * testsuite/Makefile.in: Rebuild.
10836
10837 2010-03-03 Nick Clifton <nickc@redhat.com>
10838
10839 * po/fi.po: New Finnish translation.
10840
10841 2010-03-01 Doug Kwan <dougkwan@google.com>
10842
10843 * layout.cc (Layout::Layout): Force section types of .init_array*,
10844 .preinit_array* and .fini_array* sections.
10845 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10846 Fix check of return value of std::string::find.().
10847 (Output_section::Input_section_sort_compare::operator()): Remove
10848 comment about .init_array.
10849 (Output_section::Input_section_sort_init_fini_compare::operator()):
10850 New method.
10851 (Output_section::sort_attached_input_sections): Handle .init_array
10852 and .fini_array specially.
10853 * output.h (Output_section::Inut_section_sort_compare): Update
10854 comment.
10855 (Output_section::Input_section_sort_init_fini_compare): New struct.
10856
10857 2010-02-26 Doug Kwan <dougkwan@google.com>
10858
10859 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10860 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10861 * testsuite/debug_msg.sh: Avoid matching source line number for
10862 use of global variable undef_int.
10863
10864 2010-02-26 Doug Kwan <dougkwan@google.com>
10865
10866 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10867 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10868 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10869 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10870 * options.cc (General_options::General_options): Initialize member
10871 fix_v4bx_.
10872 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10873 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10874 and rm_no_fix_v4bx.stdout
10875 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10876 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10877 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10878 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10879 and arm_no_fix_v4bx.
10880 * Makefile.in: Regenerate.
10881 * testsuite/arm_fix_v4bx.s: New file.
10882 * testsuite/arm_fix_v4bx.sh: Ditto.
10883
10884 2010-02-24 Doug Kwan <dougkwan@google.com>
10885
10886 * arm.cc (Target_arm::got_section): Make the .got section the first
10887 non RELRO section in the data segment.
10888 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10889 suffixes of section names.
10890
10891 2010-02-24 Doug Kwan <dougkwan@google.com>
10892
10893 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10894 flags and attributes merging if an input file is a binary file.
10895 * fileread.cc (Input_file::open): Record format of original file.
10896 * fileread.h (Input_file::Format): New enum type.
10897 (Input_file::Input_file): Initialize data member format_.
10898 (Input_file::format): New method definition.
10899 (Input_file::format_):: New data member.
10900
10901 2010-02-24 Doug Kwan <dougkwan@google.com>
10902
10903 * arm.cc (Arm_output_data_got): New class.
10904 (ARM_TCB_SIZE): New constant
10905 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10906 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10907 If user uses a script with a SECTIONS clause, issue only a warning
10908 for a misplaced EXIDX input section. Otherwise, issue an error.
10909 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10910 garbage collection.
10911 (Target_arm::got_mode_index_entry): Handle static linking.
10912 (Target_arm::Scan::local): Ditto.
10913 (Target_arm::Scan::global): Ditto.
10914 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10915 all incorrectly implemented relocations.
10916 (Target_arm::fix_exidx_coverage): Pass layout to
10917 Arm_output_section::fix_exidx_coverage.
10918 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10919 from ".ARM.exidx." and ".ARM.extab.".
10920
10921 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10922
10923 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10924 section if it does not already exist.
10925 * attributes.cc (Attributes_section_data::Attributes_section_data):
10926 Don't crash if size is zero.
10927
10928 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10929 Ian Lance Taylor <iant@google.com>
10930
10931 * gold.cc (queue_middle_tasks): If no input files were opened,
10932 exit.
10933 * workqueue.h (Task_function::Task_function): Assert that there is
10934 a blocker.
10935
10936 2010-02-22 Doug Kwan <dougkwan@google.com>
10937
10938 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10939 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10940 types to avoid warnings due to different uint64_t implementations
10941 on different hosts.
10942
10943 2010-02-21 Doug Kwan <dougkwan@google.com>
10944
10945 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10946 handling of the maximum backward branch offset.
10947 (Arm_relocate_functions::thumb_branch_common): Ditto.
10948 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10949 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10950 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10951 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10952 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10953 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10954 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10955 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10956 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10957 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10958 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10959 thumb2_bl_out_of_range.o): New rules.
10960 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10961 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10962 thumb2_bl_out_of_range
10963 * testsuite/Makefile.in: Regenerate.
10964 * testsuite/arm_bl_in_range.s: New file.
10965 * testsuite/arm_bl_out_of_range.s: Ditto.
10966 * testsuite/arm_branch_in_range.sh: Ditto.
10967 * testsuite/arm_branch_range.t: Ditto.
10968 * testsuite/thumb2_branch_range.t: Ditto.
10969 * testsuite/thumb_bl_in_range.s: Ditto.
10970 * testsuite/thumb_bl_out_of_range.s: Ditto.
10971 * testsuite/thumb_branch_range.t: Ditto.
10972
10973 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10974
10975 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10976 Add reloc offset information.
10977 * icf.cc (get_section_contents): Change iterators to point to the new
10978 vectors. Add reloc offset information to the contents.
10979 * icf.h (Icf::Sections_reachable_info): New typedef.
10980 (Icf::Sections_reachable_list): New typedef.
10981 (Icf::Offset_info): New typedef.
10982 (Icf::Reloc_info): New struct typedef.
10983 (Icf::Reloc_info_list): New typedef.
10984 (Icf::symbol_reloc_list): Delete method.
10985 (Icf::addend_reloc_list): Delete method.
10986 (Icf::section_reloc_list): Delete method.
10987 (Icf::reloc_info_list): New method.
10988 (Icf::reloc_info_list_): New member.
10989
10990 2010-02-19 Doug Kwan <dougkwan@google.com>
10991
10992 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10993 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10994 * arm.cc (Arm_relocation_functions): New forward declaration.
10995 (Target_arm::Target_arm): Initialize new data members
10996 got_mod_index_offset_ and tls_base_symbol_defined_.
10997 (Target_arm::Relocate::relocate_tls): New method.
10998 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10999 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
11000 New methods.
11001 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
11002 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
11003 (Target_arm::got_mod_index_offset_,
11004 Target_arm::tls_base_symbol_defined_): New data members.
11005 (Target_arm::Scan::local, Target::Scan::global,
11006 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
11007 relocations.
11008
11009 2010-02-18 Doug Kwan <dougkwan@google.com>
11010
11011 * arm.cc (Arm_relobj::find_linked_text_section): New method.
11012 (Arm_relobj::make_exidx_input_section): Pass section index of linked
11013 text section as a parameter becuase some broken tools may not set
11014 the link in section header.
11015 (Target_arm::has_got_section): New method.
11016 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
11017 without any mapping symbol as data only. Remove warning.
11018 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
11019 link in its section header, try to discover the link by inspecting the
11020 REL31 relocation at the beginning of the section.
11021 (Target_arm::Scan::check_non_pic): Report name of offending relocation
11022 in error message.
11023 (Target_arm::Scan::global): Treat any reference to the symbol
11024 _GLOBAL_OFFSET_TABLE_ as a GOT access.
11025
11026 2010-02-12 Sriraman Tallam <tmsriram@google.com>
11027
11028 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
11029 (Scan::global_reloc_may_be_function_pointer): New function.
11030 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11031 (Scan::global_reloc_may_be_function_pointer): New function.
11032 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
11033 (Scan::global_reloc_may_be_function_pointer): New function.
11034 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
11035 (Scan::global_reloc_may_be_function_pointer): New function.
11036 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
11037 (Scan::global_reloc_may_be_function_pointer): New function.
11038 (Scan::possible_function_pointer_reloc): New function.
11039 (Target_x86_64::can_check_for_function_pointers): New function.
11040 * gc.h (gc_process_relocs): Scan relocation types to determine if
11041 function pointers were taken for targets that support it.
11042 * icf.cc (Icf::find_identical_sections): Include functions for
11043 folding in safe ICF whose pointer is not taken.
11044 * icf.h (Secn_fptr_taken_set): New typedef.
11045 (fptr_section_id_): New member.
11046 (section_has_function_pointers): New function.
11047 (set_section_has_function_pointers): New function.
11048 (check_section_for_function_pointers): New function.
11049 * options.h: Fix comment for safe ICF option.
11050 * target.h (can_check_for_function_pointers): New function.
11051 * testsuite/Makefile.am: Add icf_safe_so_test test case.
11052 Modify icf_safe_test for X86-64.
11053 * testsuite/Makefile.in: Regenerate.
11054 * testsuite/icf_safe_so_test.cc: New file.
11055 * testsuite/icf_safe_so_test.sh: New file.
11056 * testsuite/icf_safe_test.cc (kept_func_3): New function.
11057 (main): Change to take pointer to function kept_func_3.
11058 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
11059 folding is done correctly for X86-64.
11060
11061 2010-02-12 David S. Miller <davem@davemloft.net>
11062
11063 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
11064 is_symbolless parameter.
11065 (Output_reloc<SHT_REL>::is_symbolless): New.
11066 (Output_reloc<SHT_REL>::is_symbolless_): New.
11067 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
11068 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
11069 (Output_reloc<SHT_RELA>::is_symbolless): New.
11070 (Output_data_reloc::add_global): Handle is_symbolless.
11071 (Output_data_reloc::add_global_relative): Likewise.
11072 (Output_data_reloc::add_local): Likewise.
11073 (Output_data_reloc::add_local_relative): Likewise.
11074 (Output_data_reloc::add_symbolless_global_addend): New.
11075 (Output_data_reloc::add_symbolless_local_addend): New.
11076 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
11077 is_symbolless.
11078 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
11079 instead of ->is_relative_
11080 (Output_reloc::write): Likewise.
11081 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
11082 (Output_reloc::write_rel): Simplify.
11083
11084 * sparc.cc (Target_sparc::Scan::local): Use
11085 ->add_symbolless_local_addend as needed.
11086 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
11087 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
11088 based upon relocation offset.
11089
11090 2010-02-11 Doug Kwan <dougkwan@google.com>
11091
11092 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
11093 (Target_arm::Scan::global): Ditto. Also remove a comment before the
11094 beginning of function.
11095 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
11096 and MOVT_ABS relocations. Those are non issued in scanning. Fix
11097 parameter is_32bit in calls to should_apply_static_reloc.
11098 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
11099 (check_DATA): Add arm_abs_global.stdout.
11100 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
11101 arm_abs_global.stdout): New rules.
11102 (MOSTLLYCLEANFILES): Add arm_abs_global
11103 * Makefile.in: Regenerate.
11104 * testsuite/arm_abs_global.s: New file.
11105 * testsuite/arm_abs_global.sh: Ditto.
11106 * testsuite/arm_abs_lib.s: Ditto.
11107
11108 2010-02-11 Ian Lance Taylor <iant@google.com>
11109
11110 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
11111 Read_relocs task.
11112 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
11113 Allocate_commons_task first.
11114 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
11115 task, rather than symtab_lock_.
11116 (Gc_process_relocs::~Gc_process_relocs): New function.
11117 (Gc_process_relocs::is_runnable): Check this_blocker_.
11118 (Gc_process_relocs::locks): Use next_blocker_ rather than
11119 blocker_.
11120 (Scan_relocs::~Scan_relocs): New function.
11121 (Scan_relocs::is_runnable): Check this_blocker_ rather than
11122 symtab_lock_.
11123 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
11124 next_blocker_.
11125 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
11126 fields. Add this_blocker_ and next_blocker_ fields. Adjust
11127 constructor accordingly.
11128 (class Gc_process_relocs): Likewise.
11129 (class Scan_relocs): Likewise.
11130 * common.h (class Allocate_commons_task): Remove symtab_lock_
11131 field, and corresponding constructor parameter.
11132 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
11133 symtab_lock_.
11134 (Allocate_commons_task::locks): Likewise.
11135
11136 2010-02-11 Ian Lance Taylor <iant@google.com>
11137
11138 * gold-threads.h (class Once): Define.
11139 (class Initialize_lock): Rewrite as child of Once.
11140 * gold-threads.cc (class Once_initialize): Define.
11141 (once_pointer_control): New static variable.
11142 (once_pointer, once_arg): New static variables.
11143 (c_run_once): New static function.
11144 (Once::Once, Once::run_once, Once::internal_run): New functions.
11145 (class Initialize_lock_once): Remove.
11146 (initialize_lock_control): Remove.
11147 (initialize_lock_pointer): Remove.
11148 (initialize_lock_once): Remove.
11149 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
11150 (Initialize_lock::initialize): Rewrite.
11151 (Initialize_lock::do_run_once): New function.
11152 * archive.cc (Archive::interpret_header): Only clear name if it is
11153 not already empty.
11154 * fileread.cc: Include "gold-threads.h"
11155 (file_counts_lock): New static variable.
11156 (file_counts_initialize_lock): Likewise.
11157 (File_read::release): Only increment counts when using --stats.
11158 Use a lock around the increment.
11159 * parameters.cc (class Set_parameters_target_once): Define.
11160 (set_parameters_target_once): New static variable.
11161 (Parameters::Parameters): Move here from parameters.h.
11162 (Parameters::set_target): Rewrite.
11163 (Parameters::set_target_once): New function.
11164 (Parameters::clear_target): Move here and rewrite.
11165 * parameters.h (class Parameters): Update declarations. Add
11166 set_parameters_target_once_ field.
11167 (Parameters::Parameters): Move to parameters.cc.
11168 (Parameters::clear_target): Likewise.
11169 * readsyms.cc (Read_symbols::do_group): Create a Start_group
11170 task.
11171 (Start_group::~Start_group): New function.
11172 (Start_group::is_runnable): New function.
11173 (Start_group::locks, Start_group::run): New functions.
11174 (Finish_group::run): Change saw_undefined to size_t.
11175 * readsyms.h (class Start_group): Define.
11176 (class Finish_group): Change saw_undefined_ field to size_t.
11177 (Finish_group::Finish_group): Remove saw_undefined and
11178 this_blocker parameters. Change all callers.
11179 (Finish_group::set_saw_undefined): New function.
11180 (Finish_group::set_blocker): New function.
11181 * symtab.h (class Symbol_table): Change saw_undefined to return
11182 size_t. Change saw_undefined_ field to size_t.
11183 * target-select.cc (Set_target_once::do_run_once): New function.
11184 (Target_selector::Target_selector): Initialize set_target_once_
11185 field. Don't initialize lock_ and initialize_lock_ fields.
11186 (Target_selector::instantiate_target): Rewrite.
11187 (Target_selector::set_target): New function.
11188 * target-select.h (class Set_target_once): Define.
11189 (class Target_selector): Update declarations. Make
11190 Set_target_once a friend. Remove lock_ and initialize_lock_
11191 fields. Add set_target_once_ field.
11192
11193 2010-02-10 Ian Lance Taylor <iant@google.com>
11194
11195 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11196 queueing any tasks.
11197 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11198 (queue_middle_tasks): Add all blockers before queueing any tasks.
11199 (queue_final_tasks): Likewise.
11200 * token.h (Task_token::add_blockers): New function.
11201 * object.h (Input_objects::number_of_relobjs): New function.
11202
11203 2010-02-10 Ian Lance Taylor <iant@google.com>
11204
11205 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11206 shared, not if not position independent.
11207 * x86_64.cc (Relocate::relocate_tls): Likewise.
11208 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11209 (tls_pie_pic_test): New target.
11210 * testsuite/Makefile.in: Rebuild.
11211
11212 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11213 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11214 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11215 * testsuite/Makefile.in: Rebuild.
11216
11217 2010-02-09 David S. Miller <davem@davemloft.net>
11218
11219 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11220 R_SPARC_RELATIVE using ->add_local_relative().
11221 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11222
11223 * output.h (Output_data_dynamic::add_section_size): New method
11224 that takes two Output_data objects.
11225 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11226 entry param. Handle it in initializers.
11227 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11228 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11229 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11230 arg.
11231 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11232 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11233 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11234 for dynrel_includes_plt.
11235 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11236 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11237 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11238 before .rela.plt
11239 (Target_sparc::do_finalize_sections): Update to pass true for
11240 dynrel_includes_plt.
11241 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11242 output before .rela.plt
11243 (Target_powerpc::do_finalize_sections): Update to pass true for
11244 dynrel_includes_plt when 32-bit.
11245
11246 2010-02-08 Doug Kwan <dougkwan@google.com>
11247
11248 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11249 method.
11250 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11251 Arm_relobj::scan_section_for_cortex_a8_stubs,
11252 Arm_relobj::do_relocation_section): Instead of calling
11253 Output_section::output_address, use faster
11254 Arm_relobj::simple_input_section_output_address.
11255
11256 2010-02-08 David S. Miller <davem@davemloft.net>
11257
11258 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11259 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11260 relocation helper function.
11261
11262 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11263 just like R_SPARC_GOT{10,13,22}.
11264 (Target_sparc::Scan::local): Likewise.
11265 (Target_sparc::Relocate:relocate): Likewise.
11266
11267 2010-02-06 Ian Lance Taylor <iant@google.com>
11268
11269 * configure.ac: Rewrite targetobjs duplicate removal code to use
11270 only shell constructs.
11271 * configure: Rebuild.
11272
11273 2010-02-05 Doug Kwan <dougkwan@google.com>
11274
11275 PR 11247
11276 * arm.cc (Arm_relobj::section_is_scannable): New method.
11277 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11278 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11279
11280 2010-02-04 Doug Kwan <dougkwan@google.com>
11281
11282 PR 11247
11283 * arm-reloc-property.cc (cstdio): Include.
11284 * configure.ac (targetobjs): Remove duplicates.
11285 * configure: Regenerate.
11286 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11287 big and little endian version for a given address size.
11288
11289 2010-02-03 Doug Kwan <dougkwan@google.com>
11290
11291 * arm-reloc-property.cc
11292 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11293 definition.
11294 * arm-reloc-property.h
11295 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11296 New method definition.
11297 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11298 declaration.
11299 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11300 overflow to N.
11301 (GOT_PREL): Change implemented to Y.
11302 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11303 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11304 (Arm_relocate_functions::movw_abs_nc): Remove method.
11305 (Arm_relocate_functions::movt_abs): Ditto.
11306 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11307 (Arm_relocate_functions::thm_movt_abs): Ditto.
11308 (Arm_relocate_functions::movw_rel_nc): Ditto.
11309 (Arm_relocate_functions::movw_rel): Ditto.
11310 (Arm_relocate_functions::movt_rel): Ditto.
11311 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11312 (Arm_relocate_functions:thm_movw_rel): Ditto.
11313 (Arm_relocate_functions:thm_movt_rel): Ditto.
11314 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11315 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11316 New method definitions.
11317 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11318 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11319 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11320 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11321 (Target_arm::Relocate::relocate): Check for non-static or
11322 unimplemented relocation code and exit early. Change calls to
11323 Target_arm::reloc_uses_thumb_bit and
11324 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11325 instead. Refactor code to handle similar relocations to increase
11326 code sharing. Remove check for unsupported relocation code in switch
11327 statement.
11328 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11329 relocation property table to find out size. Change error message to
11330 print out the name of a relocation code instead of the numeric value.
11331 (Target_arm::scan_reloc_for_stub): Use relocation property table
11332 instead of calling Target_arm::reloc_uses_thumb_bit().
11333
11334 2010-02-02 Doug Kwan <dougkwan@google.com>
11335
11336 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11337 types of relaxed input section.
11338
11339 2010-02-02 Doug Kwan <dougkwan@google.com>
11340
11341 * Makefile.am (HFILES): Add arm-reloc-property.h.
11342 (DEFFILES): New.
11343 (TARGETSOURCES): Add arm-reloc-property.cc
11344 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
11345 (libgold_a_SOURCES): $(DEFFILES)
11346 * Makefile.in: Regenerate.
11347 * arm-reloc-property.cc: New file.
11348 * arm-reloc-property.h: New file.
11349 * arm-reloc.def: New file.
11350 * arm.cc: Update comments.
11351 (arm-reloc-property.h): New included header.
11352 (arm_reloc_property_table): New global variable.
11353 (Target_arm::do_select_as_default_target): New method definition.
11354 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11355 arm-reloc-property to targ_extra_obj.
11356 * parameters.cc (set_parameters_target): Call
11357 Target::select_as_default_target().
11358 * target.h (Target::select_as_default_target): New method definition.
11359 (Target::do_select_as_default_target): Same.
11360
11361 2010-02-01 Doug Kwan <dougkwan@google.com>
11362
11363 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11364 first_output_text_section_.
11365 (Arm_exidx_fixup::first_output_text_section): New method definition.
11366 (Arm_exidx_fixup::first_output_text_section_): New data member.
11367 (Arm_exidx_fixup::process_exidx_section): Record the first text
11368 output section seen.
11369 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11370 and entsize in output section header.
11371
11372 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11373
11374 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11375 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11376 (Arm_relocate_functions::thm_alu11): New Method.
11377 (Arm_relocate_functions::thm_pc8): New Method.
11378 (Arm_relocate_functions::thm_pc12): New Method.
11379 (Target_arm::Scan::local): Handle the relocations.
11380 (Target_arm::Scan::global): Likewise.
11381 (Target_arm::Relocate::relocate): Likewise.
11382 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11383
11384 2010-01-29 Doug Kwan <dougkwan@google.com>
11385
11386 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11387 of relocation types as ld.
11388
11389 2010-01-29 Doug Kwan <dougkwan@google.com>
11390
11391 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11392 to public.
11393 (Arm_relocate_functions::thumb_branch_common): Ditto.
11394 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11395 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11396 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11397 Arm_relocate_functions::jump24): Remove.
11398 (Target_arm::Relocate::relocate): Adjust code to call
11399 Arm_relocation_functions::arm_branch_common and
11400 Arm_relocation_functions::thumb_branch_common instead of their removed
11401 wrappers. Merge switch-cases together to reduce source code size.
11402
11403 2010-01-29 Doug Kwan <dougkwan@google.com>
11404
11405 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11406 output_local_symbol_count_needs_update_.
11407 (Arm_relobj::output_local_symbol_count_needs_update,
11408 Arm_relobj::set_output_local_symbol_count_needs_update,
11409 Arm_relobj::update_output_local_symbol_count): New methods.
11410 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11411 member.
11412 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11413 of pointed function as in a R_ARM_PREL31 relocation.
11414 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11415 for output local symbol count updating.
11416 (Target_arm::do_relax): Update output local symbol counts in objects
11417 if necessary.
11418 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11419
11420 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11421
11422 * arm.cc: Added support for the ARM relocations:
11423 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11424 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11425 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11426 movw_prel_nc).
11427 (Arm_relocate_functions::movw_rel): New method.
11428 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11429 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11430 thm_movw_prel_nc).
11431 (Arm_relocate_functions::thm_movw_rel): New method.
11432 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11433 thm_movt_prel).
11434 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11435 relocations.
11436 (Target_arm::Scan::global): Likewise.
11437 (Target_arm::Relocate::relocate): Likewise.
11438 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11439 Likewise.
11440
11441 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11442
11443 * arm.cc: Added support for ARM group relocations.
11444 (Target_arm::reloc_needs_sym_origin): New method.
11445 (Arm_relocate_functions::calc_grp_kn): New method.
11446 (Arm_relocate_functions::calc_grp_residual): New method.
11447 (Arm_relocate_functions::calc_grp_gn): New method.
11448 (Arm_relocate_functions::arm_grp_alu): New Method.
11449 (Arm_relocate_functions::arm_grp_ldr): New Method.
11450 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11451 (Arm_relocate_functions::arm_grp_ldc): New Method.
11452 (Target_arm::Scan::local): Handle the ARM group relocations.
11453 (Target_arm::Scan::global): Likewise.
11454 (Target_arm::Relocate::relocate): Likewise.
11455 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11456 Likewise.
11457
11458 2010-01-26 Doug Kwan <dougkwan@google.com>
11459
11460 * arm.cc (set): Include.
11461 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11462 pointer type.
11463 (Arm_output_section::Text_section_list): New type.
11464 (Arm_output_section::append_text_sections_to_list): New method.
11465 (Arm_output_section::fix_exidx_coverage): Ditto.
11466 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
11467 (Arm_relobj::convert_input_section_to_relaxed_section): Use
11468 Relobj::set_section_offset() instead of
11469 Sized_relobj::invalidate_section_offset().
11470 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
11471 parameter for section headers. Ignore relocation sections for
11472 unallocated sections and EXIDX sections.
11473 (Target_arm::fix_exidx_coverage): New method.
11474 (Target_arm::output_section_address_less_than): New type.
11475 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11476 linked text section instead of the EXIDX section.
11477 (Arm_output_section::create_stub_group): Add an assertion to check
11478 that this is not an EXIDX output section.
11479 (Arm_output_section::append_text_sections_to_list): New method.
11480 (Arm_output_section::fix_exidx_coverage): Ditto.
11481 (Arm_relobj::scan_sections_for_stubs): Adjust call to
11482 Arm_relobj::section_needs_reloc_stub_scanning.
11483 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11484 first pass.
11485 (Target_arm::fix_exidx_coverage): New method.
11486 * object.h (Relobj::set_output_section): New method.
11487 (Sized_relobj::invalidate_section_offset): Remove method.
11488 (Sized_relobj::do_invalidate_section_offset): Remove method.
11489 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11490
11491 2010-01-25 Doug Kwan <dougkwan@google.com>
11492
11493 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11494 Fix warning due to signed and unsigned comparison on a 32-bit host.
11495
11496 2010-01-22 Doug Kwan <dougkwan@google.com>
11497
11498 * arm.cc (Target_arm::do_relax): Record an output section for section
11499 offset adjustment it contains any stub table that has changed.
11500 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11501 offsets in an output section if necessary.
11502 * output.cc (Output_section::Output_section): Initialize
11503 section_offsets_need_adjustments_.
11504 (Output_section::add_input_section_for_script): Renamed to
11505 Output_section::add_simple_input_section.
11506 (Output_section::save_states): Add a comment.
11507 (Output_section::discard_states): New method defintion.
11508 (Output_section::adjust_section_offsets): Same.
11509 * output.h (Output_section::add_input_section_for_script): Renamed to
11510 Output_section::add_simple_input_section.
11511 (Output_section::discard_states): New method declaration.
11512 (Output_section::adjust_section_offsets): Same.
11513 (Output_section::section_offsets_need_adjustment,
11514 Output_section::set_section_offsets_need_adjustment): New method
11515 definitions.
11516 (Output_section::section_offsets_need_adjustment_): New data member.
11517 * script-sections.cc
11518 (Output_section_element_input::set_section_address): Adjust code for
11519 renaming of Output_section::add_input_section_for_script.
11520 (Orphan_output_section::set_section_address): Same.
11521
11522 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11523
11524 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11525 Fix_v4bx enum values .
11526 * gold/options.h (General_options): New option definitions.
11527 (General_options::fix_v4bx): New method.
11528 (General_options::Fix_v4bx): New enum.
11529 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11530 (General_options::parse_fix_v4bx_interworking): New method.
11531
11532 2010-01-22 Doug Kwan <dougkwan@google.com>
11533
11534 * arm.cc (Arm_exidx_fixup): New class.
11535
11536 2010-01-21 Doug Kwan <dougkwan@google.com>
11537
11538 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11539 classes.
11540 (Arm_exidx_section_offset_map): New type.
11541
11542 2010-01-21 Doug Kwan <dougkwan@google.com>
11543
11544 * arm.cc (Arm_exidx_input_section): New class.
11545 (Arm_relobj::exidx_input_section_by_link,
11546 Arm_relobj::exidx_input_section_by_shndx,
11547 Arm_relobj::make_exidx_input_section): New methods.
11548 (read_arm_attributes_section): Remove.
11549 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11550 information about them.
11551 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11552 to here.
11553
11554 2010-01-20 Doug Kwan <dougkwan@google.com>
11555
11556 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11557 Input_section_specifier to Section_id.
11558 (Target_arm::new_arm_input_section: Adjust code for change of key
11559 type.
11560 (Target_arm::find_arm_input_section): Ditto.
11561 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11562 (Section_id): Remove.
11563 (Garbage_collection::Section_id_hash): Remove.
11564 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11565 (Section_id): Remove.
11566 (Icf::Section_id_hash): Remove.
11567 * object.h (Section_id, Const_section_id, Section_id_hash,
11568 Const_section_id_hash): New type definitions.
11569 * output.cc (Output_section::add_relaxed_input_section): Change to
11570 use Const_section_id instead of Input_section_specifier as key type.
11571 (Output_section::add_merge_input_section): Ditto.
11572 (Output_section::build_relaxation_map): Change to use Section_id
11573 instead of Input_section_specifier as key type.
11574 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11575 Ditto.
11576 (Output_section::convert_input_sections_to_relaxed_sections): Change
11577 to use Const_section_id instead of Input_section_specifier as key type.
11578 (Output_section::find_merge_section): Ditto.
11579 (Output_section::find_relaxed_input_section): Ditto.
11580 * output.h (Input_section_specifier): Remove class.
11581 (Output_section::Output_section_data_by_input_section_map): Change
11582 key type to Const_section_id.
11583 (Output_section::Output_relaxed_input_section_by_input_section_map):
11584 Ditto.
11585 (Output_section::Relaxation_map): Change key type to Section_id.
11586
11587 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11588
11589 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11590 (class Arm_v4bx_stub): New class.
11591 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11592 (Stub_factory::make_arm_v4bx_stub): New method.
11593 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11594 (Stub_table::empty): Handle v4bx stubs.
11595 (Stub_table::add_arm_v4bx_stub): New method.
11596 (Stub_table::find_arm_v4bx_stub): New method.
11597 (Arm_relocate_functions::v4bx): New method.
11598 (Target_arm::fix_v4bx): New method.
11599 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11600 (Stub_table::relocate_stubs): Likewise.
11601 (Stub_table::do_write): Likewise.
11602 (Stub_table::update_data_size_and_addralign): Likewise.
11603 (Stub_table::finalize_stubs): Likewise.
11604 (Target_arm::Scan::local): Likewise.
11605 (Target_arm::Scan::global): Likewise.
11606 (Target_arm::do_finalize_sections): Likewise.
11607 (Target_arm::Relocate::relocate): Likewise.
11608 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11609 Likewise.
11610 (Target_arm::scan_reloc_for_stub): Likewise.
11611 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11612
11613 2010-01-19 Ian Lance Taylor <iant@google.com>
11614
11615 * output.cc (Output_section_headers::do_sized_write): Write large
11616 segment count to sh_info field.
11617 (Output_file_header::do_sized_write): For large segment count,
11618 write PN_XNUM to e_phnum field.
11619
11620 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11621
11622 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11623 (Arm_relocate_functions::thm_jump8): New function.
11624 (Arm_relocate_functions::thm_jump11): New function.
11625 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11626 R_ARM_THM_JUMP11.
11627 (Target_arm::Scan::global): Likewise.
11628 (Target_arm::Relocate::relocate): Likewise.
11629 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11630 Likewise.
11631
11632 2010-01-14 Doug Kwan <dougkwan@google.com>
11633
11634 * arm.cc (map, utility): Include headers.
11635 (Target_arm::apply_cortex_a8_workaround): New method.
11636 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11637 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11638 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11639 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11640 the --[no-]fix-cortex-a8 command line options.
11641 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11642 (Target_arm::relocate_stub): Use addend in instruction template.
11643 * options.h (DEFINE_bool): Set the user-set flag.
11644 (General_options): Add --[no-]-fix-cortex options.
11645 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
11646 : Update fast look-up map after conversion.
11647
11648 2010-01-14 Sriraman Tallam <tmsriram@google.com>
11649
11650 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11651 in the first pass of do_layout.
11652
11653 2010-01-13 Doug Kwan <dougkwan@google.com>
11654
11655 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11656 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11657 apparent compiler problem of not folding static constant integral
11658 data members of elfcpp::Elf_sizes<32>.
11659
11660 2010-01-13 Doug Kwan <dougkwan@google.com>
11661
11662 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11663 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11664 Arm_relobj::scan_section_for_cortex_a8_erratum,
11665 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11666 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11667 sections to scan for relocation stubs into a new method
11668 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11669 relocation and Cortex-A8 stub scanning.
11670 (Target_arm::do_relax): Force stubs to be after stubbed sections
11671 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11672 the beginning of a new relaxation pass. Update a comment.
11673 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11674
11675 2010-01-12 Ian Lance Taylor <iant@google.com>
11676
11677 * target-reloc.h (visibility_error): New inline function.
11678 (relocate_section): Call visibility_error.
11679 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11680 (MOSTLYCLEANFILES): Likewise.
11681 (protected_4_pic.o, protected_3.err): New targets.
11682 * testsuite/protected_4.cc: New file.
11683
11684 2010-01-12 Doug Kwan <dougkwan@google.com>
11685
11686 * arm.cc (Cortex_a8_reloc): New class.
11687 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11688 and cortex_a8_relocs_info_.
11689 (Target_arm::fix_cortex_a8): New method definition.
11690 (Target_arm::Cortex_a8_relocs_info): New type.
11691 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11692 New data member declarations.
11693 (Target_arm::scan_reloc_for_stub): Record information about
11694 relocations for THUMB branches that might be exempted from the
11695 Cortex-A8 workaround.
11696 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11697 at the beginning of a relaxation pass.
11698
11699 2010-01-12 Doug Kwan <dougkwan@google.com>
11700
11701 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11702 (Arm_relobj::Mapping_symbol_position,
11703 Arm_reloj::Mapping_symbol_position_less,
11704 Arm_relobj::Mapping_symbols_info): New types.
11705 (Target_arm::is_mapping_symbol_name): New method definition.
11706 (Arm_relobj::do_count_local_symbols): Save information about mapping
11707 symbols.
11708
11709 2010-01-11 Doug Kwan <dougkwan@google.com>
11710
11711 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11712 Arm_relocate_functions::thumb32_branch_upper,
11713 Arm_relocate_functions::thumb32_branch_lower,
11714 Arm_relocate_functions::thumb32_cond_branch_offset,
11715 Arm_relocate_functions::thumb32_cond_branch_upper,
11716 Arm_relocate_functions::thumb32_cond_branch_lower,
11717 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11718 branch offset encoding.
11719 (Arm_relocate_functions::thumb_branch_common): Use new branch
11720 offset encoding methods to avoid code duplication.
11721 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11722 (Stub_addend_reader::operator()): Use new branch encoding method
11723 to avoid code duplication.
11724
11725 2010-01-11 Doug Kwan <dougkwan@google.com>
11726
11727 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11728 (Target_arm::do_finalize_sections): Define special EXIDX section
11729 symbols only if referenced.
11730 * gc.h (Garbage_collection::add_reference): New method.
11731 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11732 code duplication.
11733
11734 2010-01-11 Ian Lance Taylor <iant@google.com>
11735
11736 * script.cc (Version_script_info::build_expression_list_lookup):
11737 Change complaing about duplicate wildcard match from error to
11738 warning.
11739
11740 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11741 of 2009-12-30.
11742 (Version_script_info::Version_script_info): Initialize globs_,
11743 default_version_, default_is_global_, and exact_. Don't
11744 initialize globals_ or locals_.
11745 (Version_script_info::build_lookup_tables): Build local symbols
11746 first.
11747 (Version_script_info::unquote): New function.
11748 (Version_script_info::add_exact_match): New function.
11749 (Version_script_info::build_expression_list_lookup): Remove lookup
11750 parameter. Add is_global parameter. Change all callers. Handle
11751 wildcard pattern specially. Unquote pattern. Call
11752 add_exact_match.
11753 (Version_script_info::get_name_to_match): New function.
11754 (Version_script_info::get_symbol_version): New function.
11755 (Version_script_info::get_symbol_version_helper): Remove.
11756 (Version_script_info::check_unmatched_names): Call unquote.
11757 * script.h (class Version_script_info): Change get_symbol_version
11758 to be non-inline and add is_global parameter; change all callers.
11759 Rewrite symbol_is_local. Update declarations. Define struct
11760 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11761 Remove globals_ and locals_ members. Add exact_, globs_,
11762 default_version_, is_global_.
11763 (Version_script_info::Glob): Remove pattern, add expression and
11764 is_global. Update constructor. Change all callers.
11765 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11766 default version.
11767 (Versions::symbol_section_contents): If a symbol is undefined, or
11768 defined in a dynamic object, set the version index to
11769 VER_NDX_LOCAL.
11770 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11771 symbol_is_local.
11772 (Symbol_table::add_from_pluginobj): Likewise.
11773 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11774
11775 2010-01-11 Doug Kwan <dougkwan@google.com>
11776
11777 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11778 (incremental_dump_LDADD): Add linking option for libintl.
11779 * Makefile.in: Regenerate.
11780
11781 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11782
11783 PR gold/11144
11784 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11785 instead of -Ds.
11786 * testsuite/Makefile.in: Regenerated.
11787
11788 2010-01-10 Doug Kwan <dougkwan@google.com>
11789
11790 * options.h (DEFINE_var): Use parentheses around argument varname__
11791 in macro body to avoid any unintended subsequent substitutions.
11792
11793 2010-01-10 Ian Lance Taylor <iant@google.com>
11794
11795 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11796 candidates before doing symbol resolution.
11797
11798 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11799 ODR candidates if only one is weak.
11800
11801 2010-01-08 Ian Lance Taylor <iant@google.com>
11802
11803 * script.cc (Version_script_info::build_expression_list_lookup):
11804 Don't warn about ambiguous version, just record the ambiguity.
11805 (Version_script_info::get_symbol_version_helper): Give error if
11806 version is ambiguous.
11807
11808 2010-01-08 Doug Kwan <dougkwan@google.com>
11809
11810 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11811 prev_data_size_ and prev_addralign_. Remove initializer for
11812 deleted data member has_been_changed_.
11813 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11814 to determine if the table is empty.
11815 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11816 Remove.
11817 (Stub_table::add_reloc_stub): Define method in class definition
11818 instead of just declaring it there.
11819 (Stub_table::add_cortex_a8_stub): New method definition.
11820 (Stub_table::update_data_size_and_addralign): Ditto.
11821 (Stub_table::finalize_stubs): Ditto.
11822 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11823 (Stub_table::do_addralign_): Return address alignment in the
11824 (Stub_table::do_reset_address_and_file_offset): Define method in
11825 class definition instead of declaring it there. Set current data
11826 size to be the data size of the previous pass.
11827 (Stub_table::set_final_data_size): Use current data size as the
11828 final data size.
11829 (Stub_table::relocate_stub): Change parameter type of stub from
11830 Reloc_stub pointer to Stub pointer.
11831 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11832 (Stub_table::Cortex_a8_stub_list): New typedef.
11833 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11834 Stub_table::prev_addralign_): New data member.
11835 (Arm_relobj::Arm_relobj): Initialize data member
11836 section_has_cortex_a8_workaround_.
11837 (Arm_relobj::section_has_cortex_a8_workaround,
11838 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11839 definitions.
11840 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11841 declarations.
11842 (Target_arm::relocate_stub): Change parameter type of stub from
11843 Reloc_stub pointer to Stub pointer.
11844 (Insn_template::size, Insn_template::alignment): Handle
11845 THUMB16_SPECIAL_TYPE.
11846 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11847 Stub_table::update_data_size_and_addralign,
11848 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11849 definitions.
11850 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11851 (Stub_table::do_write): Ditto.
11852 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11853
11854 2010-01-08 Ian Lance Taylor <iant@google.com>
11855
11856 PR 11108
11857 * symtab.h (class Symbol): Remove fields is_target_special_ and
11858 has_plt_offset_. Add field is_defined_in_discarded_section_.
11859 (Symbol::is_defined_in_discarded_section): New function.
11860 (Symbol::set_is_defined_in_discarded_section): New function.
11861 (Symbol::has_plt_offset): Rewrite.
11862 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11863 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11864 Don't initialize is_target_special_ or has_plt_offset_.
11865 Initialize is_defined_in_discarded_section_.
11866 (Symbol_table::add_from_relobj): If appropriate, set
11867 is_defined_in_discarded_section.
11868 * resolve.cc (Symbol::override_base_with_special): Don't test
11869 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11870 * target-reloc.h (relocate_section): Do special handling for
11871 symbols defined in discarded sections for global symbols as well
11872 as local symbols.
11873
11874 2010-01-08 Ian Lance Taylor <iant@google.com>
11875
11876 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11877 the SHT_SYMTAB case.
11878
11879 2010-01-08 Ian Lance Taylor <iant@google.com>
11880
11881 * object.cc (Sized_relobj::do_layout): Don't get confused if
11882 layout_eh_frame returns NULL.
11883
11884 2010-01-08 Ian Lance Taylor <iant@google.com>
11885
11886 PR 11084
11887 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11888 dynamic symbol table, use the normal symbol table.
11889 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11890 symbol table.
11891
11892 2010-01-08 Ian Lance Taylor <iant@google.com>
11893
11894 PR 11072
11895 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11896 sections.
11897
11898 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11899
11900 * version.cc (print_version): Change to "Copyright 2010".
11901
11902 2010-01-08 Ian Lance Taylor <iant@google.com>
11903
11904 PR 10287
11905 PR 11063
11906 * i386.cc (class Target_i386): Change return type of plt_section
11907 to be non-const.
11908 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11909 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11910 tls_desc_rel_ field.
11911 (Output_data_plt_i386::rel_tls_desc): New function.
11912 (Target_i386::rel_tls_desc_section): New function.
11913 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11914 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11915 R_386_TLS_DESC reloc in rel_tls_desc_section.
11916 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11917 Define struct Tlsdesc_info.
11918 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11919 (Target_x86_64::do_reloc_symbol_index): New function.
11920 (Target_x86_64::add_tlsdesc_info): New function.
11921 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11922 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11923 tlsdesc_rel_ field.
11924 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11925 all callers.
11926 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11927 (Target_x86_64::rela_tlsdesc_section): New function.
11928 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11929 handling.
11930 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11931 (Target_x86_64::do_reloc_addend): New function.
11932 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11933 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11934 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11935 (Output_reloc::type): New function.
11936 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11937 (Output_reloc::is_target_specific): New function.
11938 (Output_reloc::target_arg): New function.
11939 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11940 absolute relocs and target specific relocs.
11941 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11942 add_target_specific.
11943 (class Output_data_reloc) [SHT_RELA]: Likewise.
11944 * output.cc (Output_reloc::Output_reloc): Add four new versions
11945 for absolute relocs and target specific relocs.
11946 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11947 (Output_reloc::get_symbol_index): Likewise.
11948 (Output_reloc::local_section_offset): Check that local_sym_index_
11949 is not TARGET_CODE or 0.
11950 (Output_reloc::symbol_value): Likewise.
11951 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11952 reloc.
11953 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11954 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11955 functions.
11956 * layout.cc (add_target_dynamic_tags): Use output section for
11957 DT_PLTRELSZ and DT_JMPREL.
11958
11959 2010-01-07 Ian Lance Taylor <iant@google.com>
11960
11961 PR 11061
11962 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11963 function.
11964 (class Output_data_reloc_generic): Define.
11965 (class Output_data_reloc_base): Change base class to
11966 Output_data_reloc_generic. Change add() method to call
11967 bump_relative_reloc_count for a relative reloc. Remove
11968 sort_relocs_ field.
11969 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11970 to sort_relocs().
11971 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11972 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11973 appropriate.
11974 * layout.h (class Layout): Update declaration.
11975
11976 2010-01-07 Ian Lance Taylor <iant@google.com>
11977
11978 * output.h (class Output_data): Add const version of
11979 output_section and do_output_section.
11980 (class Output_section_data): Add const version of
11981 do_output_section.
11982 (class Output_section): Likewise.
11983 * layout.cc (Layout::add_target_dynamic_tags): New function.
11984 * layout.h (class Layout): Update declarations.
11985 * arm.cc (Target_arm::do_finalize_sections): Use
11986 add_target_dynamic_tags.
11987 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11988 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11989 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11990 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11991
11992 2010-01-07 Ian Lance Taylor <iant@google.com>
11993
11994 PR 11042
11995 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11996 object as needed.
11997
11998 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11999 Ian Lance Taylor <iant@google.com>
12000
12001 PR 11019
12002 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
12003 Xindex::read_symtab_xindex.
12004
12005 2010-01-07 Doug Kwan <dougkwan@google.com>
12006
12007 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
12008 (Insn_template::thumb16_bcond_insn): New method declaration.
12009 (Insn_template): Fix spelling.
12010 (Stub::thumb16_special): New method declaration.
12011 (Stub::do_write): Define virtual method which was previously pure
12012 virtual.
12013 (Stub::do_thumb16_special): New method declaration.
12014 (Stub::do_fixed_endian_write): New template member.
12015 (Reloc_stub::do_write): Remove.
12016 (Reloc_stub::do_fixed_endian_write): Remove.
12017 (Cortex_a8_stub): New class definition.
12018 (Stub_factory::make_cortex_a8_stub): New method definition.
12019 (Stub_factory::Stub_factory): Add missing static storage class
12020 qualifier for elf32_arm_stub_a8_veneer_blx.
12021
12022 2010-01-07 Ian Lance Taylor <iant@google.com>
12023
12024 PR 10980
12025 * options.h (class General_options): Add --warn-unresolved-symbols
12026 and --error-unresolved-symbols.
12027 * errors.cc (Errors::undefined_symbol): Implement
12028 --warn-unresolved-symbols.
12029
12030 * options.h (class General_options): Add -z text and -z textoff.
12031 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
12032
12033 2010-01-06 Sriraman Tallam <tmsriram@google.com>
12034
12035 * gc.h (Garbage_collection::Cident_section_map): New typedef.
12036 (Garbage_collection::cident_sections): New function.
12037 (Garbage_collection::add_cident_section): New function.
12038 (Garbage_collection::cident_sections_): New member.
12039 (gc_process_relocs): Add references to sections whose names are C
12040 identifiers.
12041 * gold.h (cident_section_start_prefix): New constant.
12042 (cident_section_stop_prefix): New constant.
12043 (is_cident): New function.
12044 * layout.cc (Layout::define_section_symbols): Replace string constants
12045 with the newly defined constants.
12046 * object.cc (Sized_relobj::do_layout): Track sections whose names are
12047 C identifiers.
12048 * testsuite/Makefile.am: Add gc_orphan_section_test.
12049 * testsuite/Makefile.in: Regenerate.
12050 * testsuite/gc_orphan_section_test.cc: New file.
12051 * testsuite/gc_orphan_section_test.sh: New file.
12052
12053 2010-01-06 Ian Lance Taylor <iant@google.com>
12054
12055 PR 10980
12056 * options.h (class General_options): Add --warn-shared-textrel.
12057 * layout.cc (Layout::finish_dynamic_section): Implement
12058 --warn-shared-textrel.
12059
12060 PR 10980
12061 * options.h (class General_options): Add --warn-multiple-gp.
12062
12063 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12064
12065 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
12066 $(THREADSLIB) and $(LIBDL).
12067 * Makefile.in: Rebuild.
12068
12069 2010-01-06 Ian Lance Taylor <iant@google.com>
12070
12071 PR 10980
12072 * options.cc (General_options::parse_section_start): New function.
12073 (General_options::section_start): New function.
12074 (General_options::General_options): Initialize all members.
12075 * options.h: Include <map>
12076 (class General_options): Add --section-start. Add section_starts_
12077 member.
12078 * layout.cc (Layout::attach_allocated_section_to_segment): If
12079 --section-start was used, set the address of the segment. Remove
12080 local sort_sections.
12081 (Layout::relaxation_loop_body): If the address of the load segment
12082 has been set by --section-start, don't use it.
12083 * output.h (Output_segment::update_flags_for_output_section): New
12084 function.
12085 * output.cc (Output_segment::add_output_section): Call
12086 update_flags_for_output_section.
12087
12088 2010-01-05 Ian Lance Taylor <iant@google.com>
12089
12090 PR 10980
12091 * options.h (class General_options): Add --undefined-version.
12092 * script.cc (struct Version_expression): Add was_matched_by_symbol
12093 field.
12094 (Version_script_info::matched_symbol): New function.
12095 (Version_script_info::get_symbol_version_helper): Call
12096 matched_symbol.
12097 (Version_script_info::check_unmatched_names): New function.
12098 * script.h (class Version_script_info): Update declarations.
12099 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
12100
12101 * options.h (class General_options): Use DEFINE_bool_alias for
12102 allow_multiple_definition.
12103 * resolve.cc (Symbol_table::should_override): Don't test
12104 allow_multiple_definition.
12105
12106 PR 10980
12107 * options.h (class General_options): Add --cref.
12108 * main.cc (main): Print cref table if --cref. Don't close mapfile
12109 until after printing cref table.
12110 * cref.cc: Include "symtab.h".
12111 (class Cref_inputs): Define Cref_table_compare and Cref_table.
12112 (Cref_table_compare::operator()): New function.
12113 (Cref_inputs::gather_cref): New function.
12114 (filecol): New static const.
12115 (Cref_inputs::print_cref): New function.
12116 (Cref::print_cref): New function.
12117 * cref.h: Include <cstdio>.
12118 (class Cref): Update declarations.
12119 * mapfile.h (Mapfile::file): New function.
12120 * object.h (class Object): Define Symbols. Declare virtual
12121 do_get_global_symbols.
12122 (Object::get_global_symbols): New function.
12123 * object.cc (Input_objects::add_object): Pass object to cref_ if
12124 --cref.
12125 (Input_objects::archive_start): Likewise.
12126 (Input_objects::archive_stop): Likewise.
12127 (Input_objects::print_cref): New function.
12128 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
12129 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
12130 --cref.
12131 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
12132 function.
12133 * plugin.h (class Sized_pluginobj): Update declarations.
12134
12135 2010-01-05 Ian Lance Taylor <iant@google.com>
12136
12137 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
12138 to is_default_version. Rename insdef to insdefault.
12139 (Symbol_table::add_from_relobj): Rename def to is_default_version
12140 and local to is_forced_local.
12141 (Symbol_table::add_from_pluginobj): Likewise.
12142 (Symbol_table::add_from_dynobj): Likewise.
12143 (Symbol_table::define_special_symbol): Rename insdef to
12144 insdefault.
12145
12146 2010-01-04 Ian Lance Taylor <iant@google.com>
12147
12148 PR 10980
12149 * options.h (class General_options): Add
12150 --allow-multiple-definition and -z muldefs.
12151 * resolve.cc (Symbol_table::should_override): Don't warn about a
12152 multiple symbol definition if --allow-multiple-definition or -z
12153 muldefs.
12154
12155 PR 10980
12156 * options.h (class General_options): Add --add-needed and
12157 --copy-dt-needed-entries. Tweak --as-needed help entry.
12158 * object.cc (Input_objects::check_dynamic_dependencies): Give an
12159 error if --copy-dt-needed-entries aka --add-needed is used and
12160 would cause a change in behaviour.
12161
12162 PR 10980
12163 * options.h (class General_options): Add -G as a short version of
12164 --shared. Add no-op options -assert, -g, and -i.
12165
12166 2010-01-04 Sriraman Tallam <tmsriram@google.com>
12167
12168 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
12169 check for .text or .gnu.linkonce.t sections.
12170 * icf.cc (Icf::find_identical_sections): Ditto.
12171 Change the detection for mangled function name within the section
12172 name.
12173 * icf.h (is_section_foldable_candidate): New function.
12174
12175 2009-12-30 Ian Lance Taylor <iant@google.com>
12176
12177 PR 10980
12178 * options.h (class General_options): Permit two dashes with
12179 --retain-symbols-file.
12180
12181 2009-12-30 Ian Lance Taylor <iant@google.com>
12182
12183 PR 10979
12184 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12185 don't put the file header and segment headers in the text
12186 segment.
12187
12188 PR 10979
12189 * common.cc (Sort_commons::operator()): Stabilize sort when both
12190 entries are NULL.
12191 (Symbol_table::do_allocate_commons_list): When allocating common
12192 symbols, skip a symbol which is no longer common.
12193 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12194 an object before checking its type.
12195 * testsuite/common_test_2.c: New file.
12196 * testsuite/common_test_3.c: New file.
12197 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12198 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12199 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12200 (common_test_2_pic.o, common_test_2.so): New targets.
12201 (common_test_3_pic.o, common_test_3.so): New targets.
12202 * testsuite/Makefile.in: Rebuild.
12203
12204 PR 10979
12205 * script.cc (read_input_script): If we see a new SECTIONS clause,
12206 and we have added an input section, give an error.
12207 * layout.h (class Layout): Add have_added_input_section function.
12208 Add have_added_input_section_ field.
12209 * layout.cc (Layout::Layout): Initialize
12210 have_added_input_section_.
12211 (Layout::layout): Set have_added_input_section_.
12212 (Layout::layout_eh_frame): Likewise.
12213
12214 2009-12-30 Ian Lance Taylor <iant@google.com>
12215
12216 PR 10931
12217 * options.h (class General_options): Add --sort-common option.
12218 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12219 * common.cc (Sort_common): Add sort_order parameter to
12220 constructor. Add sort_order_ field.
12221 (Sort_commons::operator): Check sort_order_.
12222 (Symbol_table::allocate_commons): Determine the sort order.
12223 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12224 Change all callers.
12225 (Symbol_table::do_allocate_commons_list): Likewise.
12226
12227 2009-12-30 Ian Lance Taylor <iant@google.com>
12228
12229 PR 10916
12230 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12231 symbols from this object, don't change the visibility of an
12232 undefined symbol.
12233 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12234
12235 2009-12-30 Ian Lance Taylor <iant@google.com>
12236
12237 PR 10861
12238 * script.h (class Version_script_info): Define Language enum.
12239 Update declarations. Define Glob, Exact, and Lookup types. Add
12240 new fields globals_, locals_, and is_finalized_.
12241 * script.cc: Various formatting fixes.
12242 (class Parser_closure): Change language_stack_ from a vector of
12243 std::string to one of Version_script_info::Language. Adjust all
12244 uses accordingly.
12245 (class Lazy_demangler): Remove.
12246 (struct Version_expression): Change language from std::string to
12247 Version_script_info::Language.
12248 (Version_script_info::Version_script_info): New function.
12249 (Version_script_info::~Version_script_info): Don't call clear.
12250 (Version_script_info::finalize): New function.
12251 (Version_script_info::build_lookup_tables): New function.
12252 (Version_script_info::build_expression_list_lookup): New
12253 function.
12254 (Version_script_info::get_symbol_version_helper): Rewrite to use
12255 lookup tables.
12256 (Version_script_info::print_expression_list): Adjust to use
12257 Version_script_info::Language.
12258 (script_push_lex_into_version_mode): Check that the version script
12259 has not been finalized.
12260 (version_script_push_lang): Change language string to
12261 Version_script_info::Language.
12262 * options.cc (Command_line::version_script): New function.
12263 * options.h (class General_options): Add finalize_dynamic_list
12264 function. Change version_script from declaration to definition.
12265 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12266 * testsuite/version_script.map: Remove duplicate def of foo.
12267 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12268 version_script.map.
12269 * testsuite/Makefile.in: Rebuild.
12270
12271 2009-12-30 Ian Lance Taylor <iant@google.com>
12272
12273 PR 10843
12274 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12275 if the input symbol index is 0, make the output symbol index 0.
12276
12277 2009-12-30 Ian Lance Taylor <iant@google.com>
12278
12279 PR 10670
12280 * options.h (class General_options): Add -x/--discard-all.
12281 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12282 --discard-all. If the local symbol needs a dynamic entry, check
12283 that before handling --discard-locals.
12284
12285 2009-12-30 Ian Lance Taylor <iant@google.com>
12286
12287 PR 10450
12288 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12289 flags to PF_R.
12290 (Output_segment::add_output_section): Don't change the flags if
12291 the type is PT_TLS.
12292
12293 PR 10450
12294 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12295 GNU hash table if they need a dynamic value. Otherwise, don't add
12296 them if they are defined in a dynamic object or are forced local.
12297
12298 2009-12-29 Ian Lance Taylor <iant@google.com>
12299
12300 PR 10450
12301 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12302 .gnu.hash table for a 32-bit target.
12303
12304 PR 10450
12305 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12306 regular and a dynamic object only needs a dynamic symbol table
12307 entry if it is externally visible.
12308
12309 PR 10450
12310 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12311 constructor. Add global_offset_table_ field.
12312 (Target_i386::got_section): Set global_offset_table_.
12313 (Target_i386::do_finalize_sections): Set global_offset_table_
12314 size.
12315 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12316 in constructor. Add global_offset_table_ field.
12317 (Target_x86_64::got_section): Set global_offset_table_.
12318 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12319 size.
12320
12321 * layout.cc (Layout::Layout): Initialize increase_relro_.
12322 (Layout::get_output_section): Add is_relro, is_last_relro, and
12323 is_first_non_relro parameters. Change all callers.
12324 (Layout::choose_output_section): Likewise.
12325 (Layout::add_output_section_data): Likewise.
12326 (Layout::make_output_section): Likewise.
12327 (Layout::set_segment_offsets): Clear increase_relro when using a
12328 linker script.
12329 * layout.h (class Layout): Add increase_relro method. Add
12330 increase_relro_ field. Update declarations.
12331 * output.cc (Output_section::Output_section): Initialize
12332 is_last_relro_ and is_first_non_relro_.
12333 (Output_segment::add_output_section): Group relro sections is
12334 do_sort is true. Handle is_last_relro and is_first_non_relro.
12335 (Output_segment::maximum_alignment): Remove relro handling.
12336 (Output_segment::set_section_addresses): Add increase_relro
12337 parameter. Change all callers. Add initial alignment to align
12338 relro sections on separate page. Remove old relro handling.
12339 (Output_segment::set_section_list_addresses): Remove in_relro
12340 parameter. Change all callers.
12341 (Output_segment::set_offset): Add increase parameter. Change all
12342 callers. Remove old relro handling.
12343 * output.h (class Output_section): Add new methods: is_last_relro,
12344 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12345 Add is_last_relro_ and is_first_non_relro_ fields.
12346 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12347 Create separate .got.plt section. Call increase_relro.
12348 * x86_64.cc (Target_x86_64::got_section): Likewise.
12349 * testsuite/relro_script_test.t: Add .got.plt.
12350
12351 PR 10450
12352 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12353 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12354 (Layout::finalize): Call set_dynamic_symbol_size.
12355 (Layout::set_dynamic_symbol_size): New function.
12356 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12357 set_dynamic_symbol_size.
12358
12359 PR 10450
12360 * output.h (class Output_section): Add is_entsize_zero_ field.
12361 * output.cc (Output_section::Output_section): Initialize
12362 is_entsize_zero_.
12363 (Output_section::set_entsize): If two different entsizes are
12364 requested, force it to zero.
12365 (Output_section::add_input_section): Set flags for .debug_str
12366 before updating section flags. Set entsize.
12367 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12368 and SHF_STRING if all input sections have those flags.
12369
12370 2009-12-29 Rafael Espindola <espindola@google.com>
12371
12372 * main.cc (main): Fix the sys time reporting.
12373 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12374 reporting.
12375
12376 2009-12-29 Sriraman Tallam <tmsriram@google.com>
12377
12378 * options.cc (General_options::parse_version): Allow -v to exit
12379 without an error if there is nothing to link.
12380
12381 2009-12-29 Ian Lance Taylor <iant@google.com>
12382
12383 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12384 using a version of gcc before 4.1.
12385 * configure: Rebuild.
12386
12387 2009-12-28 Chris Demetriou <cgd@google.com>
12388
12389 * attributes.cc (Output_attributes_section_data::do_write): Use
12390 std::vector::front rather than std::vector::data.
12391
12392 2009-12-28 Ian Lance Taylor <iant@google.com>
12393
12394 * symtab.h (class Symbol_table): Add enum Defined.
12395 * resolve.cc (Symbol_table::should_override): Add defined
12396 parameter. Change all callers. Test whether object is NULL
12397 before calling a method on it.
12398 (Symbol_table::report_resolve_problem): Add defined parameter.
12399 Change all callers.
12400 (Symbol_table::should_override_with_special): Likewise.
12401 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12402 parameter. Change all callers.
12403 (Symbol_table::do_define_in_output_data): Likewise.
12404 (Symbol_table::define_in_output_segment): Likewise.
12405 (Symbol_table::do_define_in_output_segment): Likewise.
12406 (Symbol_table::define_as_constant): Likewise.
12407 (Symbol_table::do_define_as_constant): Likewise.
12408 * script.h (class Symbol_assignment): Add is_defsym parameter to
12409 constructor; change all callers.
12410 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12411 parameter. Change all callers. Add is_defsym_ field.
12412 (class Parser_closure): Add parsing_defsym parameter to
12413 constructor; change all callers. Add parsing_defsym accessor
12414 function. Add parsing_defsym_ field.
12415
12416 2009-12-28 Ian Lance Taylor <iant@google.com>
12417
12418 * gold.cc (queue_middle_tasks): Fix formatting.
12419 * object.cc (Relobj::is_section_name_included): Likewise.
12420
12421 2009-12-23 Ian Lance Taylor <iant@google.com>
12422
12423 * i386.cc (Target_i386::do_calls_non_split): Recognize
12424 -fsplit-stack prologue for a function with a static chain.
12425 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12426 -fsplit-stack prologue when using %r11.
12427
12428 2009-12-21 Sriraman Tallam <tmsriram@google.com>
12429
12430 * options.cc (General_options::parse_version): Make -v continue and do
12431 the link like GNU ld does.
12432
12433 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
12434
12435 * Makefile.am (CCFILES): Add timer.cc.
12436 (HFILES): Add timer.h.
12437 * configure.ac: Check for sysconf and times.
12438 * main.cc: include timer.h.
12439 (main): Use Timer instead of get_run_time.
12440 * timer.cc: New.
12441 * timer.h: New.
12442 * workqueue.cc: include timer.h.
12443 (Workqueue::find_and_run_task):
12444 Report user, sys and wall time.
12445 * Makefile.in: Regenerate.
12446 * config.in: Regenerate.
12447 * configure: Regenerate.
12448
12449 2009-12-16 Doug Kwan <dougkwan@google.com>
12450
12451 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12452 sections.
12453 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12454 relaxed input sections.
12455 * output.cc (Output_section::find_relaxed_input_section): Change
12456 return type to Output_relaxed_input_section pointer. Adjust code
12457 for new type of relaxed_input_section_map_.
12458 * output.h (Output_section::find_relaxed_input_section): Change
12459 return type to Output_relaxed_input_section pointer.
12460 (Output_section::Output_relaxed_input_section_by_input_section_map):
12461 New type.
12462 (Output_section::relaxed_input_section_map_): Change type to
12463 Output_section::Output_relaxed_input_section_by_input_section_map.
12464 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12465 input section.
12466
12467 2009-12-15 Ian Lance Taylor <iant@google.com>
12468
12469 * layout.cc (Layout::create_shstrtab): Only write out after input
12470 sections if we are compressing debug sections.
12471
12472 2009-12-15 Ian Lance Taylor <iant@google.com>
12473
12474 * archive.cc (Archive::add_symbols): Only look up a symbol without
12475 a version if there is, in fact, a version.
12476
12477 2009-12-14 Ian Lance Taylor <iant@google.com>
12478
12479 Revert -Wshadow changes, all changes from:
12480 2009-12-11 Doug Kwan <dougkwan@google.com>
12481 2009-12-11 Nick Clifton <nickc@redhat.com>
12482 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12483
12484 2009-12-11 Doug Kwan <dougkwan@google.com>
12485
12486 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12487 due to -Wshadow.
12488 * attributes.cc (Object_attribute::size): Ditto.
12489 (Attributes_section_data::size): Ditto.
12490 (Attributes_section_data::Attributes_section_data): Ditto.
12491 (Output_attributes_section_data::do_write): Ditto.
12492 * attributes.h (Object_attribute::set_type): Ditto.
12493 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12494
12495 2009-12-11 Nick Clifton <nickc@redhat.com>
12496
12497 * archive.cc: Fix shadowed variable warnings.
12498 * arm.cc: Likewise.
12499 * compressed_output.cc: Likewise.
12500 * compressed_output.h: Likewise.
12501 * configure: Likewise.
12502 * dwarf_reader.cc: Likewise.
12503 * dynobj.cc: Likewise.
12504 * dynobj.h: Likewise.
12505 * ehframe.cc: Likewise.
12506 * ehframe.h: Likewise.
12507 * errors.cc: Likewise.
12508 * expression.cc: Likewise.
12509 * fileread.cc: Likewise.
12510 * fileread.h: Likewise.
12511 * freebsd.h: Likewise.
12512 * i386.cc: Likewise.
12513 * icf.cc: Likewise.
12514 * incremental.h: Likewise.
12515 * layout.cc: Likewise.
12516 * layout.h: Likewise.
12517 * mapfile.cc: Likewise.
12518 * merge.cc: Likewise.
12519 * merge.h: Likewise.
12520 * object.cc: Likewise.
12521 * object.h: Likewise.
12522 * options.h: Likewise.
12523 * output.cc: Likewise.
12524 * output.h: Likewise.
12525 * parameters.cc: Likewise.
12526 * plugin.cc: Likewise.
12527 * powerpc.cc: Likewise.
12528 * reduced_debug_output.cc: Likewise.
12529 * reduced_debug_output.h: Likewise.
12530 * reloc.cc: Likewise.
12531 * reloc.h: Likewise.
12532 * resolve.cc: Likewise.
12533 * script-sections.cc: Likewise.
12534 * script.cc: Likewise.
12535 * script.h: Likewise.
12536 * sparc.cc: Likewise.
12537 * symtab.cc: Likewise.
12538 * symtab.h: Likewise.
12539 * target-select.cc: Likewise.
12540 * target-select.h: Likewise.
12541 * token.h: Likewise.
12542 * workqueue.cc: Likewise.
12543 * workqueue.h: Likewise.
12544 * x86_64.cc: Likewise.
12545
12546 2009-12-10 Doug Kwan <dougkwan@google.com>
12547
12548 * arm.cc (attributes.h): New include.
12549 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12550 (Arm_relobj::~Arm_relobj): Delete object pointed by
12551 attributes_section_data_.
12552 (Arm_relobj::attributes_section_data): New method definition.
12553 (Arm_relobj::attributes_section_data_): New data member declaration.
12554 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12555 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12556 attributes_section_data_.
12557 (Arm_dynobj::attributes_section_data): New method definition.
12558 (Arm_dynobj::attributes_section_data_): New data member declaration.
12559 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12560 initialization value of may_use_blx_ to false.
12561 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
12562 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12563 object attributes to compute results instead of hard-coding.
12564 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12565 Target_arm::get_secondary_compatible_arch,
12566 Target_arm::set_secondary_compatible_arch
12567 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12568 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12569 New method declarations.
12570 (Target_arm::get_aeabi_object_attribute): New method definition.
12571 (Target_arm::attributes_section_data_): New data member declaration.
12572 (read_arm_attributes_section): New template definition.
12573 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12574 (Arm_dynobj::do_read_symbols): Ditto.
12575 (Target_arm::do_finalize_sections): Merge attributes sections from
12576 input. Check for BLX use after attributes section merging.
12577 Fix __exidx_start and __exidx_end visibility. Create an
12578 .ARM.attributes section if necessary.
12579 (Target_arm::get_secondary_compatible_arch,
12580 Target_arm::set_secondary_compatible_arch,
12581 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12582 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
12583 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
12584 New method definitions.
12585
12586 2009-12-09 Ian Lance Taylor <iant@google.com>
12587
12588 * plugin.cc (Plugin::load): Don't cast from void* to a function
12589 pointer.
12590
12591 2009-12-09 Ian Lance Taylor <iant@google.com>
12592
12593 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12594 information fields.
12595
12596 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12597
12598 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12599 Replace two_file_shared_1.so with two_file_shared_2.so.
12600 * testsuite/Makefile.in: Regenerated.
12601
12602 2009-12-08 Doug Kwan <dougkwan@google.com>
12603
12604 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12605 (HFILES): Add attributes.h and int_encoding.h.
12606 * Makefile.in: Regenerate.
12607 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12608 function definitions to int_encoding.cc
12609 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12610 prototypes to int_encoding.h
12611 * reduced_debug_output.cc (int_encoding.h): New include.
12612 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12613 function definitions to int_encoding.cc
12614 (insert_into_vector, read_from_pointer): Move template definitions to
12615 int_encoding.h
12616 * attributes.cc: New file.
12617 * attributes.h: New file.
12618 * int_encoding.cc: New file.
12619 * int_encoding.h: New file.
12620
12621 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
12622
12623 PR gold/11055
12624 * incremental-dump.cc (dump_incremental_inputs): New.
12625 (main): Use dump_incremental_inputs.
12626
12627 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12628
12629 PR gold/10893
12630 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12631 checking elfcpp::STT_FUNC.
12632 (Target_i386::Relocate::relocate): Likewise.
12633 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12634
12635 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12636 symbols from shared libraries into normal FUNC symbols.
12637
12638 * symtab.h (Symbol): Add is_func and use it.
12639
12640 2009-12-05 Doug Kwan <dougkwan@google.com>
12641
12642 * arm.cc (Target_arm::arm_info): Initialize new fields
12643 attributes_section and attributes_vendor.
12644 * i386.cc (Target_i386::i386_info): Same.
12645 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12646 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12647 fields attributes_section and attributes_vendor.
12648 * sparc.cc (Target_sparc::sparc_info): Same.
12649 * target.h (Target::attributes_section, Target::attributes_vendor,
12650 Target::is_attributes_section, Target::attribute_arg_type,
12651 Target::attributes_order): New method definitions.
12652 (Target::Target_info::attributes_section,
12653 Target::Target_info::attributes_vendor): New fields.
12654 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12655 virtual method definitions.
12656 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12657 attributes_section and attributes_vendor.
12658 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12659
12660 2009-12-05 Doug Kwan <dougkwan@google.com>
12661
12662 * arm.cc: Update comments about interworking and stub generation.
12663 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12664 considered as non-PIC.
12665 (Arm_relocate_functions::base_abs): Fix formatting.
12666 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12667 of function to use GOT entry address instead of offset.
12668 (Target_arm::Scan::global): Issue an error if a symbol would need a
12669 PLT does not get one because it is untyped. Remove code to create
12670 dynamic symbols for relative branches.
12671 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12672 takes unsigned integer instead of boolean.
12673
12674 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12675
12676 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12677 (two_file_test_LDADD): Likewise.
12678 (common_test_1_LDADD): Likewise.
12679 (exception_test_LDADD) Likewise.
12680 (weak_test_LDADD): Likewise.
12681 (many_sections_test_LDADD): Likewise.
12682 (initpri1_LDADD): Likewise.
12683 (script_test_1_LDADD): Likewise.
12684 (script_test_2_LDADD): Likewise.
12685 (justsyms_LDADD): Likewise.
12686 (binary_test_LDADD): Likewise.
12687 (large_LDADD): Likewise.
12688 * testsuite/Makefile.in: Regenerated.
12689
12690 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12691
12692 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12693 (Symbol_table::override_with_special): Likewise.
12694 (Symbol_table::add_from_object): Likewise.
12695
12696 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12697
12698 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12699 Don't set the data_offset twice.
12700
12701 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12702
12703 * testsuite/Makefile.in: Regenerate.
12704
12705 2009-12-03 Doug Kwan <dougkwan@google.com>
12706
12707 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12708 (Target_arm::do_finalize_sections): Add parameter for symbol table
12709 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12710 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12711 parameter for symbol table pointer.
12712 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12713 an additional parameter for a pointer to symbol table.
12714 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12715 parameter for a symbol table pointer.
12716 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12717 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12718 Ditto.
12719 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12720 parameter for a symbol table pointer.
12721
12722 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12723
12724 * incremental.cc (Incremental_inputs_header)
12725 (Incremental_inputs_header_write, Incremental_inputs_entry)
12726 (Incremental_inputs_entry_write): Move ...
12727 * incremental.h (Incremental_inputs_header)
12728 (Incremental_inputs_header_write, Incremental_inputs_entry)
12729 (Incremental_inputs_entry_write): here.
12730
12731 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12732
12733 * incremental.cc (make_sized_incremental_binary): Set the target.
12734 Error if it is incompatible.
12735 * output.h (Output_file): Add filename method.
12736
12737 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12738
12739 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12740 from the get_* methods.
12741
12742 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12743
12744 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12745 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12746 Write 0 for the data_offset of scripts.
12747
12748 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12749
12750 * testsuite/Makefile.am: Add the incremental_test.sh test.
12751 * testsuite/incremental_test.sh: New.
12752 * testsuite/incremental_test_1.c: New.
12753 * testsuite/incremental_test_2.c: New.
12754
12755 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12756
12757 * incremental-dump.cc (main): Fix typos.
12758
12759 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12760
12761 PR gold/11025
12762 * incremental-dump.cc (main): Use llu to print 64 bit values.
12763
12764 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12765 H.J. Lu <hongjiu.lu@intel.com>
12766
12767 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12768 $(LIBDL).
12769 (incremental_dump_LDADD): Likewise.
12770 * Makefile.in: Regenerated.
12771
12772 2009-11-25 Doug Kwan <dougkwan@google.com>
12773
12774 Revert:
12775
12776 2009-11-25 Doug Kwan <dougkwan@google.com>
12777
12778 * arm.cc (Target_arm::Target_arm): Move method definition
12779 outside of class definition. Add code to handle
12780 --target1-rel, --target1-abs and --target2= options.
12781 (Target_arm::get_reloc_reloc_type): Change method to be
12782 non-static and const.
12783 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12784 New data member declaration.
12785 (Target_arm::Scan::local, Target_arm::Scan::global,
12786 Target_arm::Relocate::relocate,
12787 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12788 Adjust call to Target_arm::get_real_reloc_type.
12789 (Target_arm::get_real_reloc_type): Use command line options
12790 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12791 * options.h (--target1-rel, --target1-abs, --target2): New
12792 ARM-only options.
12793
12794 2009-11-25 Doug Kwan <dougkwan@google.com>
12795
12796 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12797 class definition. Add code to handle --target1-rel, --target1-abs
12798 and --target2= options.
12799 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12800 and const.
12801 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12802 member declaration.
12803 (Target_arm::Scan::local, Target_arm::Scan::global,
12804 Target_arm::Relocate::relocate,
12805 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12806 call to Target_arm::get_real_reloc_type.
12807 (Target_arm::get_real_reloc_type): Use command line options to
12808 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12809 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12810 options.
12811
12812 2009-11-25 Doug Kwan <dougkwan@google.com>
12813
12814 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12815 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12816 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12817 formatting.
12818 (Arm_relocate_functions::thm_call): Replace body with a call to
12819 Arm_relocate_functions::thumb_branch_common.
12820 (Arm_relocate_functions::thm_jump24,
12821 Arm_relocate_functions::thm_xpc22): New method definitions.
12822 (Arm_relocate_functions::thumb_branch_common): New method definition.
12823 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12824 operator.
12825 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12826 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12827
12828 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12829
12830 * Makefile.am: Build incremental-dump
12831 * Makefile.in: Regenerate.
12832 * incremental-dump.cc: New.
12833 * incremental.cc (Incremental_inputs_header_data,
12834 Incremental_inputs_entry_data): Move to incremental.h
12835 * incremental.h: (Incremental_inputs_header_data,
12836 Incremental_inputs_entry_data): Move from incremental.cc
12837
12838 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12839
12840 * incremental.cc (Incremental_inputs_header,
12841 Incremental_inputs_header_write, Incremental_inputs_entry,
12842 Incremental_inputs_entry_write): Add a typedef with the data type.
12843
12844 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12845
12846 * incremental.cc (Incremental_inputs_header,
12847 Incremental_inputs_header_write, Incremental_inputs_entry,
12848 Incremental_inputs_entry_write): Update comment about which
12849 type has the filed descriptions.
12850
12851 2009-11-15 Doug Kwan <dougkwan@google.com>
12852
12853 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12854 (Arm_relocate_functions::arm_branch_common): Change method defintion
12855 in class definition to a method declaration and update list of formal
12856 parameters.
12857 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12858 Arm_relocation_functions::jump24): Adjust call to
12859 Arm_relocate_functions::arm_branch_common. Update list of formal
12860 parameters.
12861 (Arm_relocate_functions::xpc25): New method definition.
12862 (Arm_relocate_functions::arm_branch_common): Move method defintion
12863 out from class definition. Use stubs for mode-switching and extending
12864 branch ranges.
12865 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12866 specially. Change code to enable use of stubs in ARM branches.
12867
12868 2009-11-10 Doug Kwan <dougkwan@google.com>
12869
12870 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12871 in method declaration.
12872 (Target_arm::relocate_stub): New method declaration.
12873 (Target_arm::default_target): Change to return a pointer instead of
12874 a const reference.
12875 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12876 Target_arm::default_target.
12877 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12878 method definition.
12879 (Target_arm::relocate_section): Adjust view.
12880 (Target_arm::relocate_stub): New method definition.
12881
12882 2009-11-10 Doug Kwan <dougkwan@google.com>
12883
12884 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12885 a format warning.
12886 * incremental.cc (open_incremental_binary): Initialized local
12887 variables to avoid warnings.
12888 * object.cc (make_elf_object): Ditto.
12889 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12890 a format warning.
12891
12892 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12893
12894 PR gold/10930
12895 * testsuite/plugin_test.c: Include "config.h".
12896
12897 2009-11-09 Doug Kwan <dougkwan@google.com>
12898
12899 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12900 (arm_symbol_value): Remove.
12901 (Arm_relocate_functions::arm_branch_common,
12902 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12903 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12904 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12905 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12906 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12907 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12908 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12909 Arm_relocate_functions::thm_mobw_abs_nc,
12910 Arm_relocate_functions::thm_mov_abs,
12911 Arm_relocate_functions::movw_prel_nc,
12912 Arm_relocate_functions::thm_movt_abs,
12913 Arm_relocate_functions::movt_prel,
12914 Arm_relocate_functions::thm_movw_prel_nc,
12915 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12916 (Target_arm::Relocate::relocate): Only decompose address into two
12917 parts if relocation type uses the thumb-bit and pass the actual
12918 bit instead of a flag indicating that the thumb-bit is used. Adjust
12919 calls to methods in Arm_relocate_functions for this change.
12920
12921 2009-11-08 Ian Lance Taylor <iant@google.com>
12922
12923 PR 10925
12924 * reloc.cc: Instantiate
12925 Sized_relobj::initialize_input_to_output_maps and
12926 Sized_relobj:free_input_to_output_maps.
12927
12928 2009-11-06 Ian Lance Taylor <iant@google.com>
12929
12930 PR 10876
12931 * defstd.cc (in_segment): Set only_if_ref true for "end".
12932
12933 2009-11-06 Doug Kwan <dougkwan@google.com>
12934
12935 * arm.cc (class Reloc_stub): Correct a comment.
12936 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12937 (Target_arm::scan_section_for_stubs): New method declaration.
12938 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12939 Change methods from private to protected.
12940 (Target_arm::do_may_relax): New method definition.
12941 (Target_arm::do_relax, Target_arm::group_sections,
12942 Target_arm::scan_reloc_for_stub,
12943 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12944 (Target_arm::arm_input_section_map_): New data member declaration.
12945 (Target_arm::scan_reloc_for_stub,
12946 Target_arm::scan_reloc_section_for_stubs,
12947 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12948 Target_arm::do_relax): New method definitions.
12949
12950 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12951
12952 * configure.ac: Check for (struct stat)::st_mtim
12953 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12954 * config.in: Regenerate.
12955 * configure: Regenerate.
12956
12957 2009-11-05 Ian Lance Taylor <iant@google.com>
12958
12959 PR 10910
12960 * output.cc (Output_segment::add_output_section): Add missing
12961 return statement.
12962
12963 2009-11-04 Ian Lance Taylor <iant@google.com>
12964
12965 PR 10880
12966 * object.h (class Object): Add is_needed and set_is_needed
12967 methods. Add is_needed_ field. Make bool fields into bitfields.
12968 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12969 defined in a dynamic object and referenced by a regular object,
12970 set is_needed for the dynamic object.
12971 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12972 if the file is marked with as_needed and it is not needed.
12973
12974 2009-11-04 Ian Lance Taylor <iant@google.com>
12975
12976 PR 10887
12977 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12978 tags if data is discarded by linker script.
12979 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12980 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12981 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12982 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12983
12984 2009-11-04 Ian Lance Taylor <iant@google.com>
12985
12986 * layout.cc (Layout::get_output_section): Add is_interp and
12987 is_dynamic_linker_section parameters. Change all callers.
12988 (Layout::choose_output_section): Likewise.
12989 (Layout::make_output_section): Likewise.
12990 (Layout::add_output_section_data): Add is_dynamic_linker_section
12991 parameter. Change all callers.
12992 * layout.h (class Layout): Update declarations.
12993 * output.h (class Output_section): Add is_interp, set_is_interp,
12994 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12995 Add is_interp_, is_dynamic_linker_section_ fields. Change
12996 generate_code_fills_at_write_ to a bitfield.
12997 * output.cc (Output_section::Output_sections): Initialize new
12998 fields.
12999 (Output_segment::add_output_section): Add do_sort parameter.
13000 Change all callers.
13001
13002 2009-11-03 Ian Lance Taylor <iant@google.com>
13003
13004 PR 10860
13005 * options.h (class General_options): Add --warn-common.
13006 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
13007 merging two common symbols.
13008 (Symbol_table::should_override): Handle --warn-common when merging
13009 a common symbol with a defined symbol. Use report_resolve_problem
13010 for multiple definitions.
13011 (Symbol_table::report_resolve_problem): New function.
13012 * symtab.h (class Symbol_table): Declare report_resolve_problem.
13013
13014 2009-11-03 Doug Kwan <dougkwan@google.com>
13015
13016 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
13017 stub_factory_.
13018 (Target_arm::stub_factory): New method definition.
13019 (Target_arm::new_arm_input_section,
13020 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
13021 Target_arm::reloc_uses_thumb_bit): New method declarations.
13022 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
13023 New type definitions.
13024 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
13025 member declarations.
13026 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
13027 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
13028 New method definitions.
13029
13030 2009-11-03 Ian Lance Taylor <iant@google.com>
13031
13032 * options.h (class General_options): Add --warn_constructors.
13033
13034 2009-11-03 Ian Lance Taylor <iant@google.com>
13035
13036 PR 10893
13037 * defstd.cc (in_section): Add entries for __rel_iplt_start,
13038 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
13039
13040 2009-11-03 Ian Lance Taylor <iant@google.com>
13041
13042 PR 10895
13043 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
13044 --msgid-bugs-address.
13045 (install-pdf): New target.
13046 (install-data_yes): Look up one directory to find mkinstalldirs.
13047
13048 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
13049
13050 * po/Make-in (.po.gmo): Don't generate .gmo files in source
13051 tree.
13052
13053 2009-10-30 Doug Kwan <dougkwan@google.com>
13054
13055 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
13056
13057 2009-10-30 Doug Kwan <dougkwan@google.com>
13058
13059 * arm.cc (Stub_addend_reader): New struct template definition
13060 and partial specializations.
13061 (Stub_addend_reader::operator()): New method definition for a
13062 partially specialized template.
13063
13064 2009-10-30 Doug Kwan <dougkwan@google.com>
13065
13066 * arm.cc (Arm_relobj::processor_specific_flags): New method
13067 definition.
13068 (Arm_relobj::do_read_symbols): New method declaration.
13069 (Arm_relobj::processor_specific_flags_): New data member declaration.
13070 (Arm_dynobj): New class definition.
13071 (Target_arm::do_finalize_sections): Add input_objects parameter.
13072 (Target_arm::do_adjust_elf_header): New method declaration.
13073 (Target_arm::are_eabi_versions_compatible,
13074 (Target_arm::merge_processor_specific_flags): New method declaration.
13075 (Target_arm::do_make_elf_object): New overloaded method definitions
13076 and declaration.
13077 (Arm_relobj::do_read_symbols): New method definition.
13078 (Arm_dynobj::do_read_symbols): Ditto.
13079 (Target_arm::do_finalize_sections): Add input_objects parameters.
13080 Merge processor-specific flags from all input objects.
13081 (Target_arm::are_eabi_versions_compatible,
13082 Target_arm::merge_processor_specific_flags,
13083 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
13084 New method definitions.
13085 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
13086 Input_objects pointer type parameter.
13087 * layout.cc (Layout::finalize): Pass input objects to target's.
13088 finalize_sections function.
13089 * output.cc (Output_file_header::do_sized_write): Set ELF file
13090 header's processor-specific flags.
13091 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
13092 Input_objects pointer type parameter.
13093 * sparc.cc (Target_sparc::do_finalize_sections): Same.
13094 * target.h (Input_objects): New forward class declaration.
13095 (Target::processor_specific_flags,
13096 Target::are_processor_specific_flags_sect): New method definitions.
13097 (Target::finalize_sections): Add input_objects parameter.
13098 (Target::Target): Initialize processor_specific_flags_ and
13099 are_processor_specific_flags_set_.
13100 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
13101 parameter.
13102 (Target::set_processor_specific_flags): New method definition.
13103 (Target::processor_specific_flags_,
13104 Target::are_processor_specific_flags_set_): New data member
13105 declarations.
13106 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
13107 Input_objects pointer type parameter.
13108
13109 2009-10-30 Doug Kwan <dougkwan@google.com>
13110
13111 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
13112
13113 2009-10-28 Ian Lance Taylor <iant@google.com>
13114
13115 * object.h (class Relobj): Drop options parameter from
13116 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
13117 do_scan_relocs, do_relocate. Change all callers.
13118 (class Sized_relobj): Drop options parameters from
13119 do_gc_process_relocs, do_scan_relocs, do_relocate,
13120 do_relocate_sections, relocate_sections, emit_relocs_scan,
13121 emit_relocs_scan_reltype. Change all callers.
13122 (struct Relocate_info): Remove options field and all references to
13123 it.
13124 * reloc.h (class Read_relocs): Remove options constructor
13125 parameter and options_ field. Change all callers.
13126 (class Gc_process_relocs, class Scan_relocs): Likewise.
13127 (class Relocate_task): Likewise.
13128 * target-reloc.h (scan_relocs): Remove options parameter. Change
13129 all callers.
13130 (scan_relocatable_relocs): Likewise.
13131 * target.h (class Sized_target): Remove options parameter from
13132 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
13133 all callers.
13134 * gc.h (gc_process_relocs): Remove options parameter. Change all
13135 callers.
13136 * arm.cc: Update functions to remove options parameters.
13137 * i386.cc: Likewise.
13138 * powerpc.cc: Likewise.
13139 * sparc.cc: Likewise.
13140 * x86_64.cc: Likewise.
13141 * testsuite/testfile.cc: Likewise.
13142
13143 2009-10-28 Doug Kwan <dougkwan@google.com>
13144
13145 * arm.cc (Arm_relobj): New class definition.
13146 (Arm_relobj::scan_sections_for_stubs,
13147 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
13148 New method definitions.
13149
13150 2009-10-28 Cary Coutant <ccoutant@google.com>
13151
13152 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
13153 (Plugin::cleanup_done_): New member.
13154 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
13155 (Plugin_manager::cleanup_done_): Remove.
13156 (Plugin_manager::add_input_file): Edit error message.
13157 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
13158 (Plugin_manager::cleanup): Remove use of cleanup_done_.
13159
13160 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
13161
13162 * fileread.cc: (File_read::View::~View): Use the new
13163 data_ownership_ filed.
13164 (File_read::~File_read): Dispose the new whole_file_view_.
13165 (File_read::open): Mmap the whole file if needed.
13166 (File_read::open): Use whole_file_view_ instead of contents_.
13167 (File_read::find_view): Use whole_file_view_ if applicable.
13168 (File_read::do_read): Use whole_file_view_ instead of contents_.
13169 (File_read::make_view): Use whole_file_view_ instead of contents_,
13170 update File_read::View::View call.
13171 (File_read::find_or_make_view): Update File_read::View::View
13172 call.
13173 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
13174 remove contents_
13175 (File_read::View::Data_ownership): New enum.
13176 (File_read::View::View): Replace bool mapped_ with Data_ownership
13177 argument.
13178 (File_read::View::mapped_): Remove (replaced by data_ownership_).
13179 (File_read::View::data_ownership_): New field.
13180 (File_read::contents_): Remove (replaced by whole_file_view_).
13181 (File_read::whole_file_view_): New field.
13182 * options.h (class General_options): Add --keep-files-mapped.
13183
13184 2009-10-27 Cary Coutant <ccoutant@google.com>
13185
13186 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13187 * testsuite/Makefile.am (plugin_test_5): New test case.
13188 * testsuite/Makefile.in: Regenerate.
13189
13190 2009-10-25 Doug Kwan <dougkwan@google.com>
13191
13192 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13193 from private to protected to allow access by child class.
13194 (Sized_relobj::do_relocate_sections): New method declaration.
13195 (Sized_relobj::relocate_sections): Virtualize.
13196 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
13197 Sized_relobj::relocate_sections. Instantiate template explicitly
13198 for different target sizes and endianity.
13199
13200 2009-10-24 Doug Kwan <dougkwan@google.com>
13201
13202 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13203 (Arm_input_section::as_arm_input_section): New method.
13204 (Arm_output_section): New class definition.
13205 (Arm_output_section::create_stub_group,
13206 Arm_output_section::group_sections): New method definitions.
13207
13208 2009-10-22 Doug Kwan <dougkwan@google.com>
13209
13210 * arm.cc (Arm_input_section): New class definition.
13211 (Arm_input_section::init, Arm_input_section:do_write,
13212 Arm_input_section::set_final_data_size,
13213 Arm_input_section::do_reset_address_and_file_offset): New method
13214 definitions.
13215
13216 2009-10-21 Doug Kwan <dougkwan@google.com>
13217
13218 * arm.cc (Stub_table, Arm_input_section): New forward class
13219 declarations.
13220 (Stub_table): New class defintion.
13221 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13222 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13223 New method definition.
13224
13225 2009-10-21 Doug Kwan <dougkwan@google.com>
13226
13227 * arm.cc: Update copyright comments.
13228 (Target_arm): New forward class template declaration.
13229 (Arm_address): New type.
13230 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13231 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13232 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13233 constants.
13234 (Insn_template): Same.
13235 (DEF_STUBS): New macro.
13236 (Stub_type): New enum type.
13237 (Stub_template): New class definition.
13238 (Stub): Same.
13239 (Reloc_stub): Same.
13240 (Stub_factory): Same.
13241 (Target_arm::Target_arm): Initialize may_use_blx_ and
13242 should_force_pic_veneer_.
13243 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13244 Target_arm::should_force_pic_veneer,
13245 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13246 Target_arm::using_thumb_only, Target_arm:;default_target): New
13247 method defintions.
13248 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13249 New data member declarations.
13250 (Insn_template::size, Insn_template::alignment): New method defintions.
13251 (Stub_template::Stub_template): New method definition.
13252 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13253 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13254 (Stub_factory::Stub_factory): New method definition.
13255 * gold.h (string_hash): New template.
13256 * output.h (Input_section_specifier::hash_value): Use
13257 gold::string_hash.
13258 (Input_section_specifier::string_hash): Remove.
13259 * stringpool.cc (Stringpool_template::string_hash): Use
13260 gold::string_hash.
13261
13262 2009-10-20 Doug Kwan <dougkwan@google.com>
13263
13264 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13265 symbols of relaxed input sections.
13266 * output.h (Output_section::find_relaxed_input_section): Make
13267 method public.
13268
13269 2009-10-16 Doug Kwan <dougkwan@google.com>
13270
13271 * dynobj.cc (Versions::Versions): Initialize version_script_.
13272 Only insert base version symbol definition for a shared object
13273 if version script defines any version versions.
13274 (Versions::define_base_version): New method definition.
13275 (Versions::add_def): Check that base version is not needed.
13276 (Versions::add_need): Define base version lazily.
13277 * dynobj.h (Versions::define_base_version): New method declaration.
13278 (Versions::needs_base_version_): New data member declaration.
13279 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13280 (check_DATA): Add no_version_test.stdout.
13281 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13282 New make rules.
13283 * testsuite/Makefile.in: Regenerate.
13284 * testsuite/no_version_test.c: New file.
13285 * testsuite/no_version_test.sh: Ditto.
13286
13287 2009-10-16 Doug Kwan <dougkwan@google.com>
13288
13289 * expression.cc (class Segment_start_expression): New class definition.
13290 (Segment_start_expression::value): New method definition.
13291 (script_exp_function_segment_start): Return a new
13292 Segment_start_expression.
13293 * gold/script-c.h (script_saw_segment_start_expression): New function
13294 prototype.
13295 * script-sections.cc (Script_sections::Script_sections): Initialize
13296 SAW_SEGMENT_START_EXPRESSION_ to false.
13297 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13298 and -Tbbs options to specify section addresses if given in
13299 command line and no SEGMENT_START expression is seen in a script.
13300 * script-sections.h (Script_sections::saw_segment_start_expression,
13301 Script_sections::set_saw_segment_start_expression): New method
13302 definition.
13303 (Script_sections::saw_segment_start_expression_): New data member
13304 declaration.
13305 * script.cc (script_saw_segment_start_expression): New function.
13306 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13307 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13308 script_test_7.sh and script_test_8.sh.
13309 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13310 script_test_8.stdout.
13311 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13312 (script_test_6, script_test_6.stdout, script_test_7,
13313 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13314 * Makefile.in: Regenerate.
13315 * testsuite/script_test_6.sh: New file.
13316 * testsuite/script_test_6.t: Same.
13317 * testsuite/script_test_7.sh: Same.
13318 * testsuite/script_test_7.t: Same.
13319 * testsuite/script_test_8.sh: Same.
13320
13321 2009-10-16 Doug Kwan <dougkwan@google.com>
13322
13323 * output.cc (Output_segment::set_section_list_address): Cast
13324 expressions to unsigned long long type to avoid format warnings.
13325
13326 2009-10-15 Ian Lance Taylor <iant@google.com>
13327
13328 * script.cc (Script_options::add_symbol_assignment): Always add a
13329 dot assignment to script_sections_.
13330 * script-sections.cc (Script_sections::add_dot_assignment):
13331 Initialize if necessary.
13332
13333 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13334 program headers with no load segment if there is a linker script.
13335
13336 * layout.cc (Layout::set_segment_offsets): Align the file offset
13337 to the segment aligment for -N or -n with no load segment.
13338 * output.cc (Output_segment::add_output_section): Don't crash if
13339 the first section is a TLS section.
13340 (Output_segment::set_section_list_addresses): Print an error
13341 message if the address moves backward in a linker script.
13342 * script-sections.cc
13343 (Output_section_element_input::set_section_addresses): Don't
13344 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13345 (Orphan_output_section::set_section_addresses): Likewise.
13346
13347 2009-10-15 Doug Kwan <dougkwan@google.com>
13348
13349 * layout.cc (Layout::finish_dynamic_section): Generate tags
13350 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13351 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13352 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13353
13354 2009-10-14 Ian Lance Taylor <iant@google.com>
13355
13356 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13357 fields.
13358 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13359 data_shdr fields of relinfo.
13360 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13361 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13362 R_386_TLS_LDO_32, adjust based on section flags.
13363 (Target_i386::Relocate::fix_up_ldo): Remove.
13364
13365 2009-10-13 Ian Lance Taylor <iant@google.com>
13366
13367 Add support for -pie.
13368 * options.h (class General_options): Add -pie and
13369 --pic-executable.
13370 (General_options::output_is_position_independent): Test -pie.
13371 (General_options::output_is_executable): Return true if not shared
13372 and not relocatable.
13373 (General_options::output_is_pie): Remove.
13374 * options.cc (General_options::finalize): Reject incompatible uses
13375 of -pie.
13376 * gold.cc (queue_middle_tasks): A -pie link is not static.
13377 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13378 * symtab.cc (Symbol::final_value_is_known): Return false if
13379 output_is_position_independent.
13380 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13381 output_is_position_independent.
13382 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13383 output_is_position_independent.
13384 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13385 output_is_position_independent.
13386 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13387 two_file_pie_test.
13388 (basic_pie_test.o, basic_pie_test): New targets.
13389 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13390 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13391 (two_file_pie_test): New target.
13392 * testsuite/Makefile.in: Rebuild.
13393 * README: Remove note saying that -pie is not supported.
13394
13395 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13396
13397 * options.h (class General_options): Add -init and -fini.
13398 * layout.cc (Layout::finish_dynamic_section): Emit
13399 given init and fini functions.
13400
13401 2009-10-13 Sriraman Tallam <tmsriram@google.com>
13402
13403 * gc.h (gc_process_relocs): Check if icf is enabled using new
13404 function.
13405 * gold.cc (queue_initial_tasks): Likewise.
13406 (queue_middle_tasks): Likewise.
13407 * object.cc (do_layout): Likewise.
13408 * symtab.cc (is_section_folded): Likewise.
13409 * main.cc (main): Likewise.
13410 * reloc.cc (Read_relocs::run): Likewise.
13411 (Sized_relobj::do_scan_relocs): Likewise.
13412 * icf.cc (is_function_ctor_or_dtor): New function.
13413 (Icf::find_identical_sections): Check if function is ctor or dtor when
13414 safe icf is chosen.
13415 * options.h (General_options::icf): Change option to be an enum.
13416 (Icf_status): New enum.
13417 (icf_enabled): New method.
13418 (icf_safe_folding): New method.
13419 (set_icf_status): New method.
13420 (icf_status_): New variable.
13421 * (options.cc) (General_options::finalize): Set icf_status_.
13422 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13423 icf_test and icf_keep_unique_test to use the --icf enum flag.
13424 * testsuite/icf_safe_test.sh: New file.
13425 * testsuite/icf_safe_test.cc: New file.
13426
13427 2009-10-12 Sriraman Tallam <tmsriram@google.com>
13428
13429 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13430 includes to gc.h and icf.h.
13431 * arm.cc: Include gc.h.
13432 * gold.cc: Likewise.
13433 * i386.cc: Likewise.
13434 * powerpc.cc: Likewise.
13435 * sparc.cc: Likewise.
13436 * x86_64.cc: Likewise.
13437 * gc.h: Include icf.h.
13438
13439 2009-10-11 Ian Lance Taylor <iant@google.com>
13440
13441 * plugin.cc: Include "gold.h" before other header files.
13442
13443 2009-10-10 Chris Demetriou <cgd@google.com>
13444
13445 * options.h (Input_file_argument::Input_file_type): New enum.
13446 (Input_file_argument::is_lib_): Replace with...
13447 (Input_file_argument::type_): New member.
13448 (Input_file_argument::Input_file_argument): Take Input_file_type
13449 'type' rather than boolean 'is_lib' as second argument.
13450 (Input_file_argument::is_lib): Use type_.
13451 (Input_file_argument::is_searched_file): New function.
13452 (Input_file_argument::may_need_search): Handle is_searched_file.
13453 * options.cc (General_options::parse_library): Support -l:filename.
13454 (General_options::parse_just_symbols): Update for Input_file_argument
13455 changes.
13456 (Command_line::process): Likewise.
13457 * archive.cc (Archive::get_file_and_offset): Likewise.
13458 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13459 * script.cc (read_script_file, script_add_file): Likewise.
13460 * fileread.cc (Input_file::Input_file): Likewise.
13461 (Input_file::will_search_for): Handle is_searched_file.
13462 (Input_file::open): Likewise.
13463 * readsyms.cc (Read_symbols::get_name): Likewise.
13464 * testsuite/Makefile.am (searched_file_test): New test.
13465 * testsuite/Makefile.in: Regenerate.
13466 * testsuite/searched_file_test.cc: New file.
13467 * testsuite/searched_file_test_lib.cc: New file.
13468
13469 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13470 Ian Lance Taylor <iant@google.com>
13471
13472 * descriptor.cc: Include <cstdio> and "binary-io.h".
13473 (Descriptors::open): Open the files in binary mode always.
13474 * script.cc (Lex::get_token): Treat \r as whitespace.
13475
13476 2009-10-09 Ian Lance Taylor <iant@google.com>
13477
13478 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13479
13480 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13481 Ian Lance Taylor <iant@google.com>
13482
13483 * configure.ac: Check for readv function also.
13484 * fileread.cc (readv): Define if not HAVE_READV.
13485 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13486 does not exist.
13487 * config.in: Regenerate.
13488 * configure: Regenerate.
13489
13490 2009-10-09 Doug Kwan <dougkwan@google.com>
13491
13492 * layout.cc (Layout::make_output_section): Call target hook to make
13493 ordinary output section.
13494 (Layout::finalize): Adjust parameter list of call the
13495 Target::may_relax().
13496 * layout.h (class Layout::section_list): New method.
13497 * merge.h (Output_merge_base::entsize): Change visibility to public.
13498 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13499 New methods.
13500 (Output_merge_string::do_is_string): New method.
13501 * object.cc (Sized_relobj::do_setup): renamed from
13502 Sized_relobj::set_up.
13503 * object.h (Sized_relobj::adjust_shndx,
13504 Sized_relobj::initializ_input_to_output_maps,
13505 Sized_relobj::free_input_to_output_maps): Change visibilities to
13506 protected.
13507 (Sized_relobj::setup): Virtualize.
13508 (Sized_relobj::do_setup): New method declaration.
13509 (Sized_relobj::invalidate_section_offset,
13510 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13511 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13512 * options.cc (parse_int): New function.
13513 * options.h (parse_int): New declaration.
13514 (DEFINE_int): New macro.
13515 (stub_group_size): New option.
13516 * output.cc (Output_section::Output_section): Initialize memebers
13517 merge_section_map_, merge_section_by_properties_map_,
13518 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13519 (Output_section::add_input_section): Handled deferred code-fill
13520 generation and remove an old comment.
13521 (Output_section::add_relaxed_input_section): New method definition.
13522 (Output_section::add_merge_input_section): Use merge section by
13523 properties map to speed to search. Update merge section maps
13524 as appropriate.
13525 (Output_section::build_relaxation_map): New method definition.
13526 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13527 Same.
13528 (Output_section::relax_input_section): Renamed to
13529 Output_section::convert_input_sections_to_relaxed_sections and change
13530 interface to take a vector of pointers to relaxed sections.
13531 (Output_section::find_merge_section,
13532 Output_section::find_relaxed_input_section): New method definitions.
13533 (Output_section::is_input_address_mapped,
13534 Output_section::output_offset, Output_section::output_address):
13535 Use output section data maps to speed up searching.
13536 (Output_section::find_starting_output_address): Add comments.
13537 (Output_section::do_write,
13538 Output_section::write_to_postprocessing_buffer): Do code-fill
13539 generation as appropriate.
13540 (Output_section::get_input_sections): Invalidate relaxed input section
13541 map.
13542 (Output_section::restore_states): Adjust type of checkpoint .
13543 Invalidate relaxed input section map.
13544 * output.h (Output_merge_base): New class declaration.
13545 (Input_section_specifier): New class defintion.
13546 (class Output_relaxed_input_section) Change base class to
13547 Output_section_data_build.
13548 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13549 base class initializer.
13550 (Output_section::add_relaxed_input_section): New method declaration.
13551 (Output_section::Input_section): Change visibility to protected.
13552 (Output_section::Input_section::relobj,
13553 Output_section::Input_section::shndx): Handle relaxed input sections.
13554 Output_section::input_sections) Change visibility to protected. Also
13555 define overload to return a non-const pointer.
13556 (Output_section::Merge_section_properties): New class defintion.
13557 (Output_section::Merge_section_by_properties_map,
13558 Output_section::Output_section_data_by_input_section_map,
13559 Output_section::Relaxation_map): New types.
13560 (Output_section::relax_input_section): Rename method to
13561 Output_section::convert_input_sections_to_relaxed_sections and change
13562 interface to take a vector of relaxed section pointers.
13563 (Output_section::find_merge_section,
13564 Output_section::find_relaxed_input_section,
13565 Output_section::build_relaxation_map,
13566 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13567 New method declarations.
13568 (Output_section::merge_section_map_
13569 Output_section::merge_section_by_properties_map_,
13570 Output_section::relaxed_input_section_map_,
13571 Output_section::is_relaxed_input_section_map_valid_,
13572 Output_section::generate_code_fills_at_write_): New data members.
13573 * script-sections.cc
13574 (Output_section_element_input::set_section_addresses): Call
13575 current_data_size and addralign methods of relaxed input sections.
13576 (Orphan_output_section::set_section_addresses): Call current_data_size
13577 and addralign methods of relaxed input sections.
13578 * symtab.cc (Symbol_table::compute_final_value): Extract template
13579 from the body of Symbol_table::sized_finalize_symbol.
13580 (Symbol_table::sized_finalized_symbol): Call
13581 Symbol_table::compute_final_value.
13582 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13583 (Symbol_table::compute_final_value): New templated method declaration.
13584 * target.cc (Target::do_make_output_section): New method defintion.
13585 * target.h (Target::make_output_section): New method declaration.
13586 (Target::relax): Add more parameters for input objects, symbol table
13587 and layout. Adjust call to do_relax.
13588 (Target::do_make_output_section): New method declaration.
13589 (Target::do_relax): Add parameters for input objects, symbol table
13590 and layout.
13591
13592 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13593
13594 * pread.c: Include stdio.h.
13595
13596 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13597
13598 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13599 defined.
13600
13601 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13602
13603 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13604 Change read_shndx type to unsigned int.
13605 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13606 int.
13607 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13608 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13609 Change read_shndx type to unsigned int.
13610 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13611 int.
13612 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13613 * layout.cc (Layout::create_symtab_sections): Cast the result of
13614 local_symcount * symsize to off_t in the gold_assert.
13615
13616 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13617
13618 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13619 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13620 R_ARM_BASE_ABS.
13621 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13622 (Arm_relocate_functions::thm_abs5): New function.
13623 (Arm_relocate_functions::abs12): New function.
13624 (Arm_relocate_functions::abs16): New function.
13625 (Arm_relocate_functions::base_abs): New function.
13626 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13627 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13628 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13629 R_ARM_BASE_ABS.
13630 (Scan::global): Likewise.
13631 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13632 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13633 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13634 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13635 R_ARM_BASE_ABS.
13636
13637 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13638
13639 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13640 (Arm_relocate_functions::movt_prel): New function.
13641 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13642 (Arm_relocate_functions::thm_movt_prel): New function.
13643 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13644 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13645 (Scan::global, Relocate::relocate): Likewise.
13646 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13647
13648 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13649
13650 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13651 Incremental_checker.
13652 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13653 unsigned int.
13654 (class Incremental_inputs_header): New class.
13655 (Incremental_inputs_header_writer): Edit comment.
13656 (Incremental_inputs_entry): New class.
13657 (Incremental_inputs_entry_writer): Edit comment.
13658 (Sized_incremental_binary::do_find_incremental_inputs_section):
13659 Add *strtab_shndx parameter, fill it.
13660 (Sized_incremental_binary::do_check_inputs): New method.
13661 (Incremental_checker::can_incrementally_link_output_file): Use
13662 Sized_incremental_binary::check_inputs.
13663 (Incremental_inputs::report_command_line): Save command line in
13664 command_line_.
13665 * incremental.h:
13666 (Incremental_binary::find_incremental_inputs_section): New
13667 method.
13668 (Incremental_binary::do_find_incremental_inputs_section): Add
13669 strtab_shndx parameter.
13670 (Incremental_binary::do_check_inputs): New pure virtual method.
13671 (Sized_incremental_binary::do_check_inputs): Declare.
13672 (Incremental_checker::Incremental_checker): Add incremental_inputs
13673 parameter, use it to initialize incremental_inputs_.
13674 (Incremental_checker::incremental_inputs_): New field.
13675 (Incremental_checker::command_line): New method.
13676 (Incremental_checker::inputs): New method.
13677 (Incremental_checker::command_line_): New field.
13678
13679 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13680
13681 * incremental.cc: Include <cstdarg> and "target-select.h".
13682 (vexplain_no_incremental): New function.
13683 (explain_no_incremental): New function.
13684 (Incremental_binary::error): New method.
13685 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13686 method.
13687 (make_sized_incremental_binary): New function.
13688 (open_incremental_binary): New function.
13689 (can_incrementally_link_file): Add checks if output is ELF and has
13690 inputs section.
13691 * incremental.h: Include "elfcpp_file.h" and "output.h".
13692 (Incremental_binary): New class.
13693 (Sized_incremental_binary): New class.
13694 (open_incremental_binary): Declare.
13695 * object.cc (is_elf_object): Use
13696 elfcpp::Elf_recognizer::is_elf_file.
13697 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13698 * output.h (Output_file::filesize): New method.
13699
13700 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13701
13702 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13703 New function.
13704 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13705 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13706 function.
13707 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13708 function.
13709 (Arm_relocate_functions::movw_abs_nc): New function.
13710 (Arm_relocate_functions::movt_abs): New function.
13711 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13712 (Arm_relocate_functions::thm_movt_abs): New function.
13713 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13714 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13715 (Scan::global): Likewise.
13716 (Relocate::relocate): Likewise.
13717 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13718
13719 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13720
13721 * arm.cc (Arm_relocate_functions::got_prel) New function.
13722 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13723 (Relocate::relocate): Likewise.
13724 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13725
13726 2009-10-06 Ian Lance Taylor <iant@google.com>
13727
13728 * options.h (class General_options): Define
13729 split_stack_adjust_size parameter.
13730 * object.h (class Object): Add uses_split_stack_ and
13731 has_no_split_stack_ fields. Add uses_split_stack and
13732 has_no_split_stack accessor functions. Declare
13733 handle_split_stack_section.
13734 (class Reloc_symbol_changes): Define.
13735 (class Sized_relobj): Define Function_offsets. Declare
13736 split_stack_adjust, split_stack_adjust_reltype, and
13737 find_functions.
13738 * object.cc (Object::handle_split_stack_section): New function.
13739 (Sized_relobj::do_layout): Call handle_split_stack_section.
13740 * dynobj.cc (Sized_dynobj::do_layout): Call
13741 handle_split_stack_section.
13742 * reloc.cc (Sized_relobj::relocate_sections): Call
13743 split_stack_adjust for executable sections in split_stack
13744 objects. Pass reloc_map to relocate_section.
13745 (Sized_relobj::split_stack_adjust): New function.
13746 (Sized_relobj::split_stack_adjust_reltype): New function.
13747 (Sized_relobj::find_functions): New function.
13748 * target-reloc.h: Include "object.h".
13749 (relocate_section): Add reloc_symbol_changes parameter. Change
13750 all callers.
13751 * target.h (class Target): Add calls_non_split method. Declare
13752 do_calls_non_split virtual method. Declare match_view and
13753 set_view_to_nop.
13754 * target.cc: Include "elfcpp.h".
13755 (Target::do_calls_non_split): New function.
13756 (Target::match_view): New function.
13757 (Target::set_view_to_nop): New function.
13758 * gold.cc (queue_middle_tasks): Give an error if mixing
13759 split-stack and non-split-stack objects with -r.
13760 * i386.cc (Target_i386::relocate_section): Add
13761 reloc_symbol_changes parameter.
13762 (Target_i386::do_calls_non_split): New function.
13763 * x86_64.cc (Target_x86_64::relocate_section): Add
13764 reloc_symbol_changes parameter.
13765 (Target_x86_64::do_calls_non_split): New function.
13766 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13767 parameter.
13768 * powerpc.cc (Target_powerpc::relocate_section): Add
13769 reloc_symbol_changes parameter.
13770 * sparc.cc (Target_sparc::relocate_section): Add
13771 reloc_symbol_changes parameter.
13772 * configure.ac: Call AM_CONDITIONAL for the default target.
13773 * configure: Rebuild.
13774 * testsuite/Makefile.am (TEST_AS): New variable.
13775 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13776 (check_DATA): Add split_i386 and split_x86_64 files.
13777 (SPLIT_DEFSYMS): Define.
13778 (split_i386_[1234n].o): New targets.
13779 (split_i386_[124]): New targets.
13780 (split_i386_[1234r].stdout): New targets.
13781 (split_x86_64_[1234n].o): New targets.
13782 (split_x86_64_[124]): New targets.
13783 (split_x86_64_[1234r].stdout): New targets.
13784 (MOSTLYCLEANFILES): Add new executables.
13785 * testsuite/split_i386.sh: New file.
13786 * testsuite/split_x86_64.sh: New file.
13787 * testsuite/split_i386_1.s: New file.
13788 * testsuite/split_i386_2.s: New file.
13789 * testsuite/split_i386_3.s: New file.
13790 * testsuite/split_i386_4.s: New file.
13791 * testsuite/split_i386_n.s: New file.
13792 * testsuite/split_x86_64_1.s: New file.
13793 * testsuite/split_x86_64_2.s: New file.
13794 * testsuite/split_x86_64_3.s: New file.
13795 * testsuite/split_x86_64_4.s: New file.
13796 * testsuite/split_x86_64_n.s: New file.
13797 * testsuite/testfile.cc (Target_test): Update relocation_section
13798 function.
13799 * testsuite/Makefile.in: Rebuild.
13800
13801 2009-10-06 Ian Lance Taylor <iant@google.com>
13802
13803 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13804 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13805 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13806 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13807 the address on ldo_addrs_.
13808 (Target_i386::Relocate::fix_up_ldo): New function.
13809
13810 2009-10-06 Rafael Espindola <espindola@google.com>
13811
13812 * plugin.cc (add_input_library): New.
13813 (Plugin::load): Add add_input_library to tv.
13814 (Plugin_manager::add_input_file): Add the is_lib argument.
13815 (add_input_file): Update call to Plugin_manager::add_input_file.
13816 (add_input_library): New.
13817 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13818
13819 2009-09-30 Doug Kwan <dougkwan@google.com>
13820
13821 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13822 symbol and call Symbol::may_need_copy_reloc to determine if
13823 a copy reloc is needed.
13824 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13825 nocopyreloc is given in command line.
13826 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13827 given in command line.
13828 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13829 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13830 of the removed Target_i386::may_need_copy_reloc.
13831 * options.h (copyreloc): New option with default value false.
13832 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13833 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13834 instead of the removed Target_powerpc::may_need_copy_reloc.
13835 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13836 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13837 instead of the removed Target_sparc::may_need_copy_reloc.
13838 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13839 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13840 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13841 instead of the removed Target_x86_64::may_need_copy_reloc.
13842
13843 2009-09-30 Ian Lance Taylor <iant@google.com>
13844
13845 * object.h (class Object): Remove target_ field, and target,
13846 sized_target, and set_target methods.
13847 (Object::sized_target): Remove.
13848 (class Sized_relobj): Update declarations. Remove sized_target.
13849 * object.cc (Sized_relobj::setup): Remove target parameter.
13850 Change all callers.
13851 (Input_objects::add_object): Don't do anything with the target.
13852 (make_elf_sized_object): Add punconfigured parameter. Change all
13853 callers. Set or test parameter target.
13854 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13855 Change all callers.
13856 * parameters.cc (Parameters::set_target): Change parameter type to
13857 be non-const.
13858 (Parameters::default_target): Remove.
13859 (set_parameters_target): Change parameter type to be non-const.
13860 (parameters_force_valid_target): New function.
13861 (parameters_clear_target): New function.
13862 * parameters.h (class Parameters): Update declarations. Remove
13863 default_target method. Add sized_target and clear_target
13864 methods. Change target_ to be non-const.
13865 (set_parameters_target): Update declaration.
13866 (parameters_force_valid_target): Declare.
13867 (parameters_clear_target): Declare.
13868 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13869 as NULL if we aren't searching.
13870 (Add_symbols::run): Don't check for compatible target.
13871 * fileread.cc (Input_file::open_binary): Call
13872 parameters_force_valid_target.
13873 * gold.cc (queue_middle_tasks): Likewise.
13874 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13875 set_target on object.
13876 * dynobj.h (class Sized_dynobj): Update declarations.
13877 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13878 make_elf_object returns NULL.
13879 (Archive::include_member): Don't check whether object target is
13880 compatible.
13881 * output.cc (Output_section::add_input_section): Get target from
13882 parameters.
13883 (Output_section::relax_input_section): Likewise.
13884 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13885 parameters.
13886 (Sized_relobj::do_scan_relocs): Likewise.
13887 (Sized_relobj::relocate_sections): Likewise.
13888 * resolve.cc (Symbol_table::resolve): Likewise.
13889 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13890 parameter. Change all callers.
13891 (Symbol_table::add_from_object): Get target from parameters.
13892 (Symbol_table::add_from_relobj): Don't check object target.
13893 (Symbol_table::add_from_dynobj): Likewise.
13894 (Symbol_table::define_special_symbol): Get target from
13895 parameters.
13896 * symtab.h (class Symbol_table): Update declaration.
13897 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13898 parameter. Change all callers. Clear parameter target.
13899 (Binary_test): Test target here.
13900 * testsuite/object_unittest.cc (gold_testsuite): Remove
13901 target_test_pointer parameter. Change all callers.
13902 (Object_test): Test target here.
13903
13904 2009-09-26 Ian Lance Taylor <iant@google.com>
13905
13906 * testsuite/initpri1.c: Don't try to use constructor priorities if
13907 compiling with gcc before 4.3.
13908
13909 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13910
13911 * testsuite/retain_symbols_file_test.sh (check_present): Change
13912 output file name to retain_symbols_file_test.stdout.
13913 (check_absent): Likewise.
13914
13915 2009-09-18 Craig Silverstein <csilvers@google.com>
13916
13917 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13918 * options.cc: Include <cerrno> and <fstream>.
13919 (General_options::finalize): Parse -retain-symbols-file tag.
13920 * options.h: New flag.
13921 (General_options): New method should_retain_symbol, new
13922 variable symbols_to_retain.
13923 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13924 should_retain_symbol map.
13925 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13926 * testsuite/Makefile.in: Regenerate.
13927 * testsuite/retain_symbols_file_test.sh: New file.
13928
13929 2009-09-18 Nick Clifton <nickc@redhat.com>
13930
13931 * po/es.po: Updated Spanish translation.
13932
13933 2009-09-17 Doug Kwan <dougkwan@google.com>
13934
13935 * debug.h (DEBUG_RELAXATION): New constant.
13936 (DEBUG_ALL): Add DEBUG_RELAXATION.
13937 (debug_string_to_enum): Add relaxation debug option.
13938 * layout.cc
13939 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13940 Layout::Relaxation_debug_check::read_sections,
13941 Layout::Relaxation_debug_check::read_sections): New method definitions.
13942 (Layout::Layout): Initialize data members
13943 record_output_section_data_from_scrips_,
13944 script_output_section_data_list_ and relaxation_debug_check_.
13945 (Layout::save_segments, Layout::restore_segments,
13946 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13947 Layout::relaxation_loop_body): New method definitions.
13948 (Layout::finalize): Support relaxation. Move section layout code to
13949 Layout::relaxation_loop_body.
13950 (Layout::set_asection_address_from_script): Move code for orphan
13951 section placement out.
13952 (Layout::place_orphan_sections_in_script): New method definition.
13953 * layout.h (Output_segment_headers, Output_file_header):
13954 New forward class declarations.
13955 (Layout::~Layout): Define.
13956 (Layout::new_output_section_data_from_script): New method definition.
13957 (Layout::place_orphan_sections_in_script): New method declaration.
13958 (Layout::Segment_states): New type declaration.
13959 (Layout::save_segments, Layout::restore_segments,
13960 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13961 Layout::relaxation_loop_body): New method declarations.
13962 (Layout::Output_section_data_list): New type declaration.
13963 (Layout::Relaxation_debug_check): New class definition.
13964 (Layout::record_output_section_data_from_script_,
13965 Layout::script_output_section_data_list_, Layout::segment_states_,
13966 Layout::relaxation_debug_check_): New data members.
13967 * output.cc: (Output_section_headers::do_size): New method definition.
13968 (Output_section_headers::Output_section_headers): Move size
13969 computation to Output_section_headers::do_size.
13970 (Output_segment_headers::do_size): New method definition.
13971 (Output_file_header::Output_file_header): Move size computation to
13972 Output_file_header::do_size and call it.
13973 (Output_file_header::do_size): New method definition.
13974 (Output_data_group::Output_data_group): Adjust call to
13975 Output_section_data.
13976 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13977 (Output_symtab_xindex::do_write): Add array bound check.
13978 (Output_section::Input_section::print_to_mapfile): Handle
13979 RELAXED_INPUT_SECTION_CODE.
13980 (Output_section::Output_section): Initialize data member checkpoint_.
13981 (Output_section::~Output_section): Delete checkpoint object pointed
13982 by checkpoint_.
13983 (Output_section::add_input_section): Always add an Input_section if
13984 relaxing.
13985 (Output_section::add_merge_input_section): Add assert.
13986 (Output_section::relax_input_section): New method definition.
13987 (Output_section::set_final_data_size): Set load address to zero for
13988 an unallocated section.
13989 (Output_section::do_address_and_file_offset_have_reset_values):
13990 New method definition.
13991 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13992 Handle relaxed input section.
13993 (Output_section::sort_attached_input_sections): Checkpoint input
13994 section list lazily.
13995 (Output_section::get_input_sections): Change type of input_sections to
13996 list of Simple_input_section pointers. Checkpoint input section list
13997 lazily. Also handle relaxed input sections.
13998 (Output_section::add_input_section_for_script): Take a reference to
13999 a Simple_input_section object instead of Relobj pointer and section
14000 index as parameter. Handle relaxed input sections.
14001 (Output_section::save_states, Output_section::restore_states): New
14002 method definitions.
14003 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
14004 (Output_data::is_data_size_fixed): New method definition.
14005 (Output_data::reset_addresss_and_file_offset): Do not reset data size
14006 if it is fixed.
14007 (Output_data::address_and_file_offset_have_reset_values): New method
14008 definition.
14009 (Output_data::do_address_and_file_offset_have_reset_values): New method
14010 definition.
14011 (Output_data::set_data_size): Check that data size is not fixed.
14012 (Output_data::fix_data_size): New method definition.
14013 (Output_data::is_data_size_fixed_): New data member.
14014 (Output_section_headers::set_final_data_size): New method definition.
14015 (Output_section_headers::do_size): New method declaration.
14016 (Output_segment_headers::set_final_data_size): New method definition.
14017 (Output_segment_headers::do_size): New method declaration.
14018 (Output_file_header::set_final_data_size)::New method definition.
14019 (Output_file_header::do_size)::New method declaration.
14020 (Output_section_data::Output_section_data): Add new parameter
14021 is_data_size_fixed and use it to fix data size.
14022 (Output_data_const::Output_data_const): Adjust call to base class
14023 constructor and fix data size.
14024 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
14025 base class constructor and fix data size.
14026 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
14027 base class constructor and fix data size.
14028 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
14029 class constructor and fix data size.
14030 (Output_data_group::set_final_data_size): New method definition.
14031 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
14032 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
14033 class constructor and fix data size.
14034 (Output_relaxed_input_section): New class definition.
14035 (Output_section::Simple_input_section): New class definition.
14036 (Output_section::get_input_sections): Adjust parameter list.
14037 (Output_section::add_input_section_for_script): Same.
14038 (Output_section::save_states, Output_section::restore_states,
14039 Output_section::do_address_and_file_offset_have_reset_values,
14040 (Output_section::Input_section::Input_section): Handle
14041 RELAXED_INPUT_SECTION_CODE. Add new overload for
14042 Output_relaxed_input_section.
14043 (Output_section::Input_section::is_input_section,
14044 Output_section::Input_section::set_output_section): Handle relaxed
14045 input section.
14046 (Output_section::Input_section::is_relaxed_input_section,
14047 Output_section::Input_section::output_section_data,
14048 Output_section::Input_section::relaxed_input_section): New method
14049 definitions.
14050 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
14051 value.
14052 (Output_section::Input_section::u1_): Update comments.
14053 (Output_section::Input_section::u2_): Add new union member poris.
14054 (Output_section::Checkpoint_output_section): New classs definition.
14055 (Output_section::relax_input_section): New method declaration.
14056 (Output_section::checkpoint_): New data member.
14057 (Output_segment): Update comments.
14058 (Output_segment::Output_segment): Un-privatize copy constructor.
14059 (Output_segment::operator=): Un-privatize.
14060 * script-sections.cc (Output_section_element::Input_section_list):
14061 Change element type to Output_section::Simple_input_section.
14062 (Output_section_element_dot_assignment::set_section_addresses):
14063 Register output section data for relaxation clean up.
14064 (Output_data_exression::Output_data_expression): Adjust call to base
14065 constructor to fix data size.
14066 (Output_section_element_data::set_section_addresses): Register
14067 Output_data_expression object for relaxation clean up.
14068 (struct Input_section_info): Replace Relobj pointer and section index
14069 pair with Output_section::Simple_input_section and Convert struct to a
14070 class.
14071 (Input_section_sorter::operator()): Adjust access to
14072 Input_section_info data member to use accessors.
14073 (Output_section_element_input::set_section_addresses): Use layout
14074 parameter. Adjust code to use Output_section::Simple_input_section
14075 and Input_secction_info classes. Register filler for relaxation
14076 clean up.
14077 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
14078 and section index pair with Output_section::Simple_input_section
14079 class. Adjust code accordingly.
14080 (Phdrs_element::release_segment): New method definition.
14081 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
14082 segment list.
14083 (Script_sections::release_segments): New method definition.
14084 * gold/script-sections.h (Script_sections::release_segments): New
14085 method declaration.
14086 * gold/target.h (Target::may_relax, Target::relax,
14087 Target::do_may_relax, Target::do_relax): New method definitions.
14088
14089 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
14090
14091 * arm.cc (has_signed_unsigned_overflow): New function.
14092 (Arm_relocate_functions::abs8): New function.
14093 (Target_arm::Scan::local): Handle R_ARM_ABS8.
14094 (Target_arm::Scan::global): Likewise.
14095 (Target_arm::relocate::relocate): Likewise.
14096 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
14097 Likewise.
14098
14099 2009-09-16 Cary Coutant <ccoutant@google.com>
14100
14101 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
14102 * testsuite/Makefile.in: Regenerate.
14103
14104 2009-09-11 Nick Clifton <nickc@redhat.com>
14105
14106 * po/gold.pot: Updated by the Translation project.
14107
14108 2009-09-08 Cary Coutant <ccoutant@google.com>
14109
14110 * output.cc (Output_file::open): Add execute permission to empty file.
14111 * testsuite/Makefile.am (permission_test): New test.
14112 * testsuite/Makefile.in: Regenerate.
14113
14114 2009-09-02 Ian Lance Taylor <iant@google.com>
14115
14116 * output.cc (Output_file::resize): Call map_no_anonymous rather
14117 than map.
14118
14119 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
14120
14121 * gold.cc: Include "incremental.h".
14122 (queue_initial_tasks): Call Incremental_checker methods.
14123 * incremental.cc: Include "output.h".
14124 (Incremental_checker::can_incrementally_link_output_file): New
14125 method.
14126 * incremental.h (Incremental_checker): New class.
14127
14128 * output.cc (Output_file::open_for_modification): New method.
14129 (Output_file::map_anonymous): Changed return type to bool. Record
14130 map in base_ field.
14131 (Output_file::map_no_anonymous): New method, broken out of map.
14132 (Output_file::map): Use map_no_anonymous and map_anonymous.
14133 * output.h (class Output_file): Update declarations.
14134
14135 2009-08-24 Cary Coutant <ccoutant@google.com>
14136
14137 * options.h (Command_line::Pre_options): New class.
14138 (Command_line::pre_options): New member.
14139 * options.cc (gold::options::ready_to_register): New variable.
14140 (One_option::register_option): Do nothing if not registering options.
14141 Assert if same short option registered twice.
14142 (General_options::General_options): Turn off option registration when
14143 done constructing.
14144 (Command_line::Pre_options::Pre_options): New constructor.
14145
14146 2009-08-24 Cary Coutant <ccoutant@google.com>
14147
14148 * options.h (General_options::no_keep_memory): Remove incorrect
14149 short option.
14150
14151 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14152
14153 * Makefile.am (am__skiplex, am__skipyacc): New.
14154 * Makefile.in: Regenerate.
14155
14156 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
14157
14158 * Makefile.am (AM_CPPFLAGS): Renamed from ...
14159 (INCLUDES): ... this.
14160 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
14161 (AM_CPPFLAGS): Renamed from ...
14162 (INCLUDE): ... this.
14163 * Makefile.in, testsuite/Makefile.in: Regenerate.
14164
14165 * Makefile.in: Regenerate.
14166 * aclocal.m4: Likewise.
14167 * config.in: Likewise.
14168 * configure: Likewise.
14169 * testsuite/Makefile.in: Likewise.
14170
14171 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14172 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
14173 * Makefile.in: Regenerate.
14174 * testsuite/Makefile.in: Regenerate.
14175
14176 2009-08-19 Cary Coutant <ccoutant@google.com>
14177
14178 * resolve.cc (Symbol_table::resolve): Don't complain about defined
14179 symbols in shared libraries overridden by hidden or internal symbols
14180 in the main program.
14181
14182 2009-08-19 Chris Demetriou <cgd@google.com>
14183
14184 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14185 checking source file names in error messages.
14186
14187 2009-08-18 Doug Kwan <dougkwan@google.com>
14188
14189 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14190 an elcpp::Ehdr as parameter. Adjust call to set_target.
14191 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14192 an elfcpp::Ehdr as parameter.
14193 * object.cc (Object::set_target): Remove the version that looks up
14194 a target and sets it.
14195 (Sized_relobj::setup): Take a Target object instead of
14196 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14197 (make_elf_sized_object): Find target and ask target to
14198 make an ELF object.
14199 * object.h: (Object::set_target): Remove the version that looks up
14200 a target and sets it.
14201 (Sized_relobj::setup): Take a Target object instead of
14202 an elfcpp:Ehdr as parameter.
14203 * target.cc: Include dynobj.h.
14204 (Target::do_make_elf_object_implementation): New.
14205 (Target::do_make_elf_object): New.
14206 * target.h (Target::make_elf_object): New template declaration.
14207 (Target::do_make_elf_object): New method declarations.
14208 (Target::do_make_elf_object_implementation): New template declaration.
14209
14210 2009-08-14 Ian Lance Taylor <iant@google.com>
14211
14212 * gold.h (FUNCTION_NAME): Define.
14213 (gold_unreachable): Use FUNCTION_NAME.
14214
14215 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14216
14217 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14218 symbol in the --keep-unique list is not found.
14219
14220 2009-08-12 Sriraman Tallam <tmsriram@google.com>
14221
14222 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14223 been maked as --keep-unique.
14224 (Icf::unfold_section): New function.
14225 * icf.h (Icf::unfold_section): New function.
14226 * options.h (General_options::keep_unique): New option.
14227 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14228 * testsuite/Makefile.in: Regenerate.
14229 * testsuite/icf_keep_unique_test.sh: New file.
14230 * testsuite/icf_keep_unique_test.cc: New file.
14231
14232 2009-08-12 Cary Coutant <ccoutant@google.com>
14233
14234 PR 10471
14235 * resolve.cc (Symbol_table::resolve): Check for references from
14236 dynamic objects to hidden and internal symbols.
14237 * testsuite/Makefile.am (hidden_test.sh): New test.
14238 * testsuite/Makefile.in: Regenerate.
14239 * testsuite/hidden_test.sh: New script.
14240 * testsuite/hidden_test_1.c: New test source.
14241 * testsuite/hidden_test_main.c: New test source.
14242
14243 2009-08-11 Doug Kwan <dougkwan@google.com>
14244
14245 * arm.cc: Update comments.
14246 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14247 segment to locate the .ARM.exidx section if present.
14248
14249 2009-08-09 Doug Kwan <dougkwan@google.com>
14250
14251 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14252 patch.
14253
14254 2009-08-07 Sriraman Tallam <tmsriram@google.com>
14255 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14256 compiler warnings.
14257
14258 2009-08-06 Sriraman Tallam <tmsriram@google.com>
14259
14260 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14261 valid tls_segment only for non-debug-section relocations.
14262 * testsuite/Makefile.am: Add gc_tls_test.
14263 * testsuite/Makefile.in: Regenerate.
14264 * testsuite/gc_tls_test.cc: New file.
14265 * testsuite/gc_tls_test.sh: New file.
14266
14267 2009-08-05 Sriraman Tallam <tmsriram@google.com>
14268
14269 * icf.cc: New file.
14270 * icf.h: New file.
14271 * Makefile.am (CCFILES): Add icf.cc.
14272 (HFILES): Add icf.h
14273 * Makefile.in: Regenerate.
14274 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14275 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14276 section, symbol and addend information for the relocs.
14277 * gold.cc (queue_middle_tasks): Call identical code folding.
14278 * gold.h: Add defines for multimap.
14279 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14280 to the call of finalize_local_symbols.
14281 * main.cc (main): Create object of class Icf.
14282 * object.cc (Sized_relobj::do_layout): Allow this function to be
14283 called twice during icf.
14284 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14285 to sections marked as identical by icf.
14286 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14287 when available.
14288 (Sized_relobj::do_section_entsize): New function.
14289 * object.h (Object::section_entsize): New function.
14290 (Object::do_section_entsize): New pure virtual function.
14291 (Relobj::finalize_local_symbols): Add new parameter.
14292 (Relobj::do_section_entsize): New function.
14293 * options.h (General_options::icf): New option.
14294 (General_options::icf_iterations): New option.
14295 (General_options::print_icf_sections): New option.
14296 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14297 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14298 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14299 icf.
14300 * symtab.cc (Symbol_table::is_section_folded): New function.
14301 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14302 to sections marked as identical by icf.
14303 * symtab.h (Symbol_table::set_icf): New function.
14304 (Symbol_table::icf): New function.
14305 (Symbol_table::is_section_folded): New function.
14306 (Symbol_table::icf_): New data member.
14307 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14308 * testsuite/Makefile.am: Add commands to build icf_test.
14309 * testsuite/Makefile.in: Regenerate.
14310 * testsuite/icf_test.sh: New file.
14311 * testsuite/icf_test.cc: New file.
14312
14313 2009-07-24 Chris Demetriou <cgd@google.com>
14314
14315 * layout.cc (is_compressible_debug_section): Fix incorrect
14316 comment about compressed section names.
14317
14318 2009-07-20 Ian Lance Taylor <ian@airs.com>
14319
14320 PR 10419
14321 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14322
14323 2009-07-16 Ian Lance Taylor <iant@google.com>
14324
14325 PR 10400
14326 * layout.h: #include <map>.
14327 (class Kept_section): Change from struct to class. Add accessors
14328 and setters. Add section size to Comdat_group mapping. Change
14329 Comdat_group to std::map. Add is_comdat_ field. Add
14330 linkonce_size field in union.
14331 (class Layout): Update declaration of find_or_add_kept_section.
14332 Don't declare find_kept_object.
14333 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14334 parameter. Add object, shndx, is_comdat, and is_group_name
14335 parameters. Change all callers. Adjust for new Kept_section.
14336 (Layout::find_kept_object): Remove.
14337 * object.cc (Sized_relobj::include_section_group): Update use of
14338 Kept_section. Rename secnum to shndx. Only record
14339 Kept_comdat_section if sections are the same size.
14340 (Sized_relobj::include_linkonce_section): Update use of
14341 Kept_section. Only record Kept_comdat_section if sections are the
14342 same size. Set size of linkonce section.
14343 (Sized_relobj::map_to_kept_section): Update call to
14344 get_kept_comdat_section.
14345 * object.h (class Sized_relobj): Rename fields in
14346 Kept_comdat_section to drop trailing underscores; change object
14347 field to Relobj*. Change Kept_comdat_section_table to store
14348 struct rather than pointer.
14349 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14350 Add kept_object and kept_shndx parameters. Change all callers.
14351 (Sized_relobj::get_kept_comdat_section): Change return type to
14352 bool. Add kept_object and kept_shndx parameters. Change all
14353 callers.
14354 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14355 Layout::find_or_add_kept_section.
14356
14357 2009-07-09 Ian Lance Taylor <iant@google.com>
14358
14359 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14360 Reserve space in the hash table.
14361
14362 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14363
14364 * fileread.cc (File_read::get_mtime): New method.
14365 * fileread.h (Timespec): New structure.
14366 (File_read::get_mtime): New method.
14367 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14368 Renamed from timestamp_nsec.
14369 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14370 Elf_Xword.
14371 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
14372 timestamp_nsec.
14373 (Incremental_inputs::report_archive): Save mtime; style fix.
14374 (Incremental_inputs::report_obejct): Save mtime; style fix.
14375 (Incremental_inputs::report_script): Save mtime; style fix.
14376 (Incremental_inputs::finalize_inputs): Style fix.
14377 (Incremental_inputs::finalize): Style fix.
14378 (Incremental_inputs::create_input_section_data): Store inputs
14379 mtime.
14380 * incremental.h (Incremental_inputs::report_script): Add mtime
14381 argument.
14382 (Incremental_inputs::Input_info::Input_info): Intialize only one
14383 union member.
14384 (Incremental_inputs::Input_info::archive): Move to nameless
14385 union.
14386 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14387 (Incremental_inputs::Input_info::script): Move to nameless union.
14388 (Incremental_inputs::mtime): New field.
14389 * script.cc (read_input_script): Pass file mtime to
14390 Incremental_input.
14391 * script.h (Script_info::inputs): Style fix.
14392
14393 2009-07-01 Ian Lance Taylor <ian@airs.com>
14394
14395 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14396 instead of 32.
14397
14398 2009-06-24 Ian Lance Taylor <iant@google.com>
14399
14400 PR 10156
14401 * layout.cc (Layout::choose_output_section): If we find an
14402 existing section, update the flags.
14403 (Layout::create_notes): New function, broken out of
14404 Layout::finalize.
14405 (Layout::finalize): Don't create note sections.
14406 (Layout::create_note): Don't crash if linker script discards
14407 section.
14408 (Layout::create_gold_note): Likewise.
14409 (Layout::create_build_id): Likewise. Don't set
14410 after_input_sections on the section.
14411 (Layout::create_executable_stack_info): Remove target parameter.
14412 Change caller.
14413 * layout.h (class Layout): Declare create_notes. Update
14414 declaration of create_executable_stack_info.
14415 * gold.cc (queue_middle_tasks): Call create_notes.
14416 * output.cc (Output_section::update_flags_for_input_section): Move
14417 here from output.h. If SHF_ALLOC flag is newly set, mark address
14418 invalid.
14419 * output.h (Output_data::mark_address_invalid): New function.
14420 (class Output_section): Only declare, not define,
14421 update_flags_for_input_section. Remove set_flags.
14422
14423 2009-06-24 Ian Lance Taylor <iant@google.com>
14424
14425 * script-sections.cc (Output_section_definition::
14426 set_section_addresses): Rename shadowing local load_address to
14427 laddr.
14428
14429 2009-06-24 Ian Lance Taylor <iant@google.com>
14430
14431 PR 10244
14432 * reloc.cc (relocate_sections): Skip empty relocation sections.
14433
14434 2009-06-23 Ian Lance Taylor <iant@google.com>
14435
14436 PR 10156
14437 * layout.cc (Layout::create_note): Use choose_output_section
14438 rather than make_output_section.
14439
14440 2009-06-23 Ian Lance Taylor <iant@google.com>
14441
14442 PR 10237
14443 * options.cc (General_options::parse_V): Set printed_version_.
14444 (General_options::General_options): Initialize printed_version_.
14445 * options.h (class General_options): Add printed_version_ field.
14446 * gold.cc (queue_initial_tasks): If there are no input files,
14447 don't give a fatal error if we printed the version information.
14448 (queue_middle_tasks): If using -r with a shared object, give a
14449 fatal error rather than an ordinary error.
14450
14451 2009-06-23 Ian Lance Taylor <iant@google.com>
14452
14453 PR 10219
14454 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14455 (Layout::make_output_section): Set have_stabstr_section_ if we see
14456 a .stab*str section.
14457 (Layout::finalize): Call link_stabs_sections.
14458 (Layout::link_stabs_sections): New file.
14459 * layout.h (class Layout): Add have_stabstr_section_ field.
14460 Declare link_stabs_sections.
14461
14462 2009-06-23 Doug Kwan <dougkwan@google.com>
14463
14464 * Makefile.am (libgold_a_LIBADD): New.
14465 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
14466 * Makefile.in: Regenerate.
14467 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14468 * configure: Regenerate.
14469 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14470 * fileread.cc: Include sys/state.h
14471 * gold.h: Declare memmem and strndup if found missing.
14472 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14473
14474 2009-06-23 Ian Lance Taylor <iant@google.com>
14475
14476 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14477 * configure: Rebuild.
14478
14479 2009-06-23 Ian Lance Taylor <iant@google.com>
14480
14481 PR 10147
14482 * object.cc (Object::section_contents): Don't try to get a view if
14483 the section has length zero.
14484 (Object::handle_gnu_warning_section): If the section is empty, use
14485 the name of the section as the warning.
14486
14487 2009-06-23 Ian Lance Taylor <iant@google.com>
14488
14489 PR 10133
14490 * stringpool.h (class Stringpool_template): Add optimize_ field.
14491 (Stringpool_template::set_optimize): New function.
14492 * stringpool.cc (Stringpool_template::Stringpool_template):
14493 Initialize optimize_ field.
14494 (Stringpool_template::set_string_offsets): Test local optimize
14495 fild rather than parameter.
14496 * layout.cc (Layout::Layout): Call set_optimize on the section
14497 name stringpool.
14498
14499 2009-06-22 Ian Lance Taylor <iant@google.com>
14500
14501 PR 10030
14502 * yyscript.y: Parse TARGET.
14503 * script.cc (script_set_target): New function.
14504 * script-c.h (script_set_target): Declare.
14505 * options.cc (General_options::string_to_object_format): Rename
14506 from string_to_object_format in anonymous namespace. Change
14507 callers.
14508 * options.h (class General_options): Declare
14509 string_to_object_format.
14510
14511 2009-06-22 Ian Lance Taylor <iant@google.com>
14512
14513 * script-sections.cc (Script_sections::create_segments): Don't put
14514 program headers in a PT_LOAD segment if -n or -N.
14515
14516 2009-06-22 Ian Lance Taylor <iant@google.com>
14517
14518 PR 10141
14519 * options.h (class General_options): Add -z lazy and -z now. Sort
14520 -z options into alphabetical order.
14521 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14522
14523 2009-06-21 Ian Lance Taylor <iant@google.com>
14524
14525 * layout.cc (Layout::make_output_section): Call
14526 Target::new_output_section.
14527 (Layout::attach_allocated_section_to_segment): Put large section
14528 sections in a separate load segment with the large segment flag
14529 set.
14530 (Layout::segment_precedes): Sort large data segments after other
14531 load segments.
14532 (align_file_offset): New static function.
14533 (Layout::set_segment_offsets): Use align_file_offset.
14534 * output.h (class Output_section): Add is_small_section_ and
14535 is_large_section_ fields.
14536 (Output_section::is_small_section): New function.
14537 (Output_section::set_is_small_section): New function.
14538 (Output_section::is_large_section): New function.
14539 (Output_section::set_is_large_section): New function.
14540 (Output_section::is_large_data_section): New function.
14541 (class Output_segment): Add is_large_data_segment_ field.
14542 (Output_segment::is_large_data_segment): New function.
14543 (Output_segment::set_is_large_data_segment): New function.
14544 * output.cc (Output_section::Output_section): Initialize new
14545 fields.
14546 (Output_segment::Output_segment): Likewise.
14547 (Output_segment::add_output_section): Add assertion that large
14548 data sections always go in large data segments. Force small data
14549 sections to the end of the list of data sections. Force small BSS
14550 sections to the start of the list of BSS sections. For large BSS
14551 sections to the end of the list of BSS sections.
14552 * symtab.h (class Symbol): Declare is_common_shndx.
14553 (Symbol::is_defined): Check Symbol::is_common_shndx.
14554 (Symbol::is_common): Likewise.
14555 (class Symbol_table): Define enum Commons_section_type. Update
14556 declarations. Add small_commons_ and large_commons_ fields.
14557 * symtab.cc (Symbol::is_common_shndx): New function.
14558 (Symbol_table::Symbol_table): Initialize new fields.
14559 (Symbol_table::add_from_object): Put small and large common
14560 symbols in the right list.
14561 (Symbol_table::sized_finalized_symbol): Check
14562 Symbol::is_common_shndx.
14563 (Symbol_table::sized_write_globals): Likewise.
14564 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14565 common symbol lists. Don't call do_allocate_commons_list if the
14566 list is empty.
14567 (Symbol_table::do_allocate_commons_list): Remove is_tls
14568 parameter. Add comons_section_type parameter. Change all
14569 callers. Handle small and large common symbols.
14570 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14571 Symbol::is_common_shndx.
14572 * resolve.cc (symbol_to_bits): Likewise.
14573 * target.h (Target::small_common_shndx): New function.
14574 (Target::small_common_section_flags): New function.
14575 (Target::large_common_shndx): New function.
14576 (Target::large_common_section_flags): New function.
14577 (Target::new_output_section): New function.
14578 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14579 small_common_section_flags, and large_common_section_flags
14580 fields.
14581 (Target::do_new_output_section): New virtual function.
14582 * arm.cc (Target_arm::arm_info): Initialize new fields.
14583 * i386.cc (Target_i386::i386_info): Likewise.
14584 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14585 Likewise.
14586 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14587 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14588 (Target_x86_64::do_new_output_section): New function.
14589 * configure.ac: Define conditional MCMODEL_MEDIUM.
14590 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14591 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14592 (large_LDFLAGS): Define.
14593 * testsuite/large.c: New file.
14594 * testsuite/testfile.cc (Target_test::test_target_info):
14595 Initialize new fields.
14596 * configure, testsuite/Makefile.in: Rebuild.
14597
14598 2009-06-05 Doug Kwan <dougkwan@google.com>
14599
14600 * Makefile.am (CCFILES): Add target.cc.
14601 * Makefile.in: Regenerate.
14602 * i386.cc (class Target_i386): Define new virtual method to
14603 override do_is_local_label_name in parent.
14604 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14605 local symbols if --discard-locals or -X is given.
14606 * options.h (class General_options): Declare new options
14607 '--discard-locals' and '-X' for discarding locals.
14608 * target.h (class Target): Define new methods is_local_label_name.
14609 Declare new virtual method do_is_local_label_name.
14610 * target.cc: New file.
14611 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14612 (check_SCRIPTS): Add discard_locals_test.sh.
14613 (check_DATA): Add discard_local_tests.syms.
14614 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14615 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14616 * testsuite/Makefile.in: Regenerate.
14617 * testsuite/discard_locals_test.c: New file.
14618 * testsuite/discard_locals_test.sh: Same.
14619
14620 2009-06-05 Doug Kwan <dougkwan@google.com>
14621
14622 * object.cc (Sized_relobj::Sized_relobj): Initialize
14623 discarded_eh_frame_shndx_ to -1U.
14624 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14625 section.
14626 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14627 a discarded .eh_frame section.
14628 (Sized_relobj::do_finalize_local_symbols): Ditto.
14629 * object.h (class Sized_relobj): Declare new member
14630 discarded_eh_frame_shndx_.
14631 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14632 (local_labels_test.o, local_labels_test): New rules.
14633 * testsuite/Makefile.in: Regenerate.
14634
14635 2009-06-04 Doug Kwan <dougkwan@google.com>
14636
14637 * layout.cc (Layout::section_name_mapping): Add mapping for
14638 special ARM sections.
14639
14640 2009-06-03 Doug Kwan <dougkwan@google.com>
14641
14642 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14643 (utils::has_overflow): Same.
14644
14645 2009-06-03 Ian Lance Taylor <iant@google.com>
14646
14647 * layout.cc (Layout::section_name_mapping): New array, replacing
14648 Layout::linkonce_mapping.
14649 (Layout::section_name_mapping_count): New variable, replacing
14650 Layout::linkonce_mapping_count.
14651 (Layout::linkonce_output_name): Remove.
14652 (Layout::output_section_name): Rewrite.
14653 * layout.h (class Layout): Rename Linkonce_mapping to
14654 Section_name_mapping, linkonce_mapping to section_name_mapping,
14655 linkonce_mapping_count to section_name_mapping_count. Don't
14656 declare linkonce_output_name.
14657
14658 2009-06-03 Doug Kwan <dougkwan@google.com>
14659
14660 * gold/arm.cc (namespace utils): New.
14661 (Target_arm::reloc_is_non_pic): Define new method.
14662 (class Arm_relocate_functions): New.
14663 (Target_arm::Relocate::relocate): Handle relocation types used by
14664 Android.
14665
14666 2009-06-03 Ian Lance Taylor <iant@google.com>
14667
14668 * arm.cc (Target_arm::scan::global): Use || instead of |.
14669
14670 2009-06-02 Doug Kwan <dougkwan@google.com>
14671
14672 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14673 issued_non_pic_error_.
14674 (class Target_arm::Scan): Declare new method check_non_pic.
14675 Define new method symbol_needs_plt_entry.
14676 Declare new data member issued_non_pic_error_.
14677 (class Target_arm::Relocate): Declare new method
14678 should_apply_static_reloc.
14679 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14680 (Target_arm::Scan::check_non_pic): Define new method.
14681 (Target_arm::Scan::local): Handle a small subset of reloc types used
14682 by Android.
14683 (Target_arm::Scan::local): Same.
14684 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14685
14686 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14687
14688 * incremental.cc (Incremental_inputs::report_command_line): Filter
14689 out --incremental-* options.
14690
14691 2009-05-29 Doug Kwan <dougkwan@google.com>
14692
14693 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14694 template class.
14695 (class Target_arm): Update comment.
14696 (Target_arm::Target_arm): Initialize new data members GOT_,
14697 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14698 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14699 and Target_arm::rel_dyn_section.
14700 Declare new_enum Target_arm::Got_type.
14701 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14702 and DYNBSS_.
14703 Update commments for member do_dynsym_value.
14704 (Target_arm::got_size, Target_arm::plt_section,
14705 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14706 new methods inside class defintion.
14707 (Target_arm::got_section): Define new method.
14708 (Target_arm::rel_dyn_section): Same.
14709 (Output_data_plt_arm): New template class.
14710 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14711 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14712 (Output_data_plt_arm::add_entry): Same.
14713 (Output_data_plt_arm::first_plt_entry): Define new
14714 static data member for PLT instruction template.
14715 (Output_data_plt_arm::plt_entry): Same.
14716 (Output_data_plt_arm::do_write): Define new method.
14717 (Target_arm::make_plt_entry): Same.
14718 (Target_arm::do_finalize_sections): Same.
14719 (Target_arm::do_dynsym_value): Same.
14720
14721 2009-05-28 Doug Kwan <dougkwan@google.com>
14722
14723 * Makefile.am (TARGETSOURCES): Add arm.cc.
14724 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14725 * Makefile.in: Regenerate.
14726 * arm.cc: New file.
14727 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14728
14729 2009-05-26 Doug Kwan <dougkwan@google.com>
14730
14731 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14732 (General_options::check_excluded_libs): Strip off directories in
14733 archive name before matching like GNU ld does.
14734 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14735 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14736 (exclude_libs_test_LDFLAGS): Add linker option
14737 -Wl,--exclude-libs,libexclude_libs_test_3
14738 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14739 an explicit archive without using -l.
14740 (alt/libexclude_libs_test_3.a): New make rule.
14741 * testsuite/Makefile.in: Regenerate.
14742 * testsuite/exclude_libs_test.c : Declare lib3_default().
14743 (main): Call it.
14744 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14745 * exclude_libs_test_3.c: New file.
14746
14747 2009-05-26 Nick Clifton <nickc@redhat.com>
14748
14749 * po/id.po: New Indonesian translation.
14750 * po/gold.pot: Updated template file.
14751
14752 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14753
14754 * testsuite/Makefile.am: Add -ffunction-sections to compile
14755 gc_comdat_test files. Add -Wl,--gc-sections to build
14756 gc_comdat_test.
14757 * testsuite/Makefile.in: Regenerate.
14758 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14759
14760 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14761
14762 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14763 kept comdat section was garbage collected.
14764 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14765 * testsuite/Makefile.in: Regenerate.
14766 * testsuite/gc_comdat_test.sh: New file.
14767 * testsuite/gc_comdat_test_1.cc: New file.
14768 * testsuite/gc_comdat_test_2.cc: New file.
14769
14770 2009-05-19 Doug Kwan <dougkwan@google.com>
14771
14772 * archive.cc (Archive::Archive): Move constructor from archive.h
14773 to here. Initialize no_export_.
14774 (Archive::get_elf_object_for_member): Set no_export flag of object.
14775 * archive.h (Archive::Archive): Move constructor body to
14776 archive.cc.
14777 (Archive::no_export): New method.
14778 (Archive::no_export_): New field.
14779 * object.h (Object::Object): Initialize no_export_ to false.
14780 (Object::no_export, Object::set_no_export): New methods.
14781 (Object::no_export_): New field.
14782 * options.cc (General_options::parse_exclude_libs): New method.
14783 (General_options::check_excluded_libs) Same.
14784 * options.h (exclude_libs): New option.
14785 (General_options::check_excluded_libs): New method declaration.
14786 (General_options::excluded_libs_): New field.
14787 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14788 default or protected visibility if an object has no-export flag set.
14789 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14790 (check_SCRIPTS): Add exclude_libs_test.sh.
14791 (check_DATA): Add exclude_libs_test.syms.
14792 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14793 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14794 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14795 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14796 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14797 libexclude_libs_test_2.a): New rules.
14798 * testsuite/Makefile.in: Regenerate.
14799 * testsuite/exclude_libs_test.c: New file.
14800 * testsuite/exclude_libs_test.sh: Ditto.
14801 * testsuite/exclude_libs_test_1.c: Ditto.
14802 * testsuite/exclude_libs_test_2.c: Ditto.
14803
14804 2009-05-15 Ian Lance Taylor <iant@google.com>
14805
14806 * configure.ac: Check for declarations for cases where libiberty.h
14807 checks HAVE_DECL_xxx.
14808 * configure, config.in: Rebuild.
14809
14810 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14811
14812 * gold.h (Incremental_argument_list): Remove (invalid) forward
14813 declaration.
14814 * incremental.cc (Incremental_inputs::report_achive): New method.
14815 (Incremental_inputs::report_object): New method.
14816 (Incremental_inputs::report_script): New method.
14817 (Incremental_inputs::finalize_inputs): New method.
14818 (Incremental_inputs::finalize): Call finalize_inputs().
14819 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14820 Create inputs entries.
14821 * incremental.h (Incremental_input_type): New enum.
14822 (Incremental_inputs::Incremental_input): Initialize new fields.
14823 (Incremental_inputs::report_inputs): New method.
14824 (Incremental_inputs::report_achive): New method.
14825 (Incremental_inputs::report_object): New method.
14826 (Incremental_inputs::report_script): New method.
14827 (Incremental_inputs::finalize_inputs): New method.
14828 (Incremental_inputs::Input_info): New struct.
14829 (Incremental_inputs::Input_info_map): New typedef.
14830 (Incremental_inputs::lock_): New field.
14831 (Incremental_inputs::Inputs_): New field.
14832 (Incremental_inputs::Inputs_map): New field.
14833 * main.cc (main): Call Incremental_input::report_inputs.
14834 * options.h (Input_argument_list): Typedef moved from
14835 Input_arguments.
14836 (Input_file_group::Files): Remove, use ::Input_argument_list.
14837 (Input_file_group::Input_argument_list): Remove, use
14838 ::Input_argument_list.
14839 * plugin.cc (Plugin_manager::add_input_file): Add error in
14840 incremental build.
14841 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14842 functions.
14843 * script.cc (read_input_script): Call
14844 Incremental_input::report_script.
14845 * script.h (Script_info): New class.
14846
14847 2009-04-27 Ian Lance Taylor <iant@google.com>
14848
14849 * x86_64.cc (do_adjust_output_section): Set entsize to
14850 plt_entry_size.
14851
14852 2009-04-23 Elliott Hughes <enh@google.com>
14853
14854 * output.cc (Output_file::close): After short writes, continue
14855 writing from the correct offset in the buffer being written.
14856
14857 2009-04-23 Chris Demetriou <cgd@google.com>
14858
14859 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14860 * configure: Regenerate.
14861 * config.in: Regenerate.
14862 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14863 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14864
14865 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14866
14867 * incremental.cc (Incremental_inputs_header_data): Renamed from
14868 Incremental_input_header_data.
14869 (Incremental_inputs_header_data::data_size): New field.
14870 (Incremental_inputs_header_data::put_input_file_count): Renamed
14871 from input_file_count.
14872 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14873 from command_line_offset.
14874 (Incremental_inputs_header_data::put_reserved): Renamed from
14875 put_reserved.
14876 (Incremental_inputs_entry_data): Renamed from
14877 Incremental_input_entry_data.
14878 (Incremental_inputs_entry_data::data_size): New field.
14879 (Incremental_inputs::report_command_line): New method.
14880 (Incremental_inputs::finalize): New method.
14881 (Incremental_inputs::create_incremental_inputs_data): New method.
14882 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14883 * incremental.h: New file.
14884 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14885 (Layout::finalize): Create incremental inputs section in
14886 incremental builds.
14887 (Layout::create_incremental_info_sections): New method.
14888 * layout.h (Layout::incremental_inputs): New method.
14889 (Layout::create_incremental_info_sections): New method.
14890 (Layout::incremental_inputs_): New field.
14891 * main.cc (main): Notify Incremental_input of the command line.
14892
14893 2009-04-01 Ian Lance Taylor <iant@google.com>
14894 Mikolaj Zalewski <mikolajz@google.com>
14895
14896 * gold.h (reserve_unordered_map): Define, three versions, one for
14897 each version of Unordered_map.
14898 * layout.cc (Layout::Layout): Remove options parameter. Add
14899 number_of_input_files parameter. Don't initialize options_.
14900 Initialize number_of_input_files_ and resized_signatures_. Move
14901 sections_are_attached_.
14902 (Layout::layout_group): Reserve space for group_signatures_.
14903 (Layout::find_or_add_kept_section): Change name parameter to be a
14904 reference. Resize signatures_ map when it gets large enough.
14905 (Layout::layout_eh_frame): Use parameters->options() instead of
14906 this->options_.
14907 (Layout::make_output_section): Likewise.
14908 (Layout::attach_allocated_section_to_segment): Likewise.
14909 (Layout::finalize, Layout::create_executable_stack): Likewise.
14910 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14911 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14912 * layout.h (class Layout): Update declarations. Remove options_
14913 field. Add number_of_input_files_ and resized_signatures_
14914 fields. Move sections_are_attached_ field.
14915 * main.cc (main): Pass number of input files to Layout
14916 constructor. Don't pass options.
14917
14918 2009-03-30 Ian Lance Taylor <iant@google.com>
14919
14920 * ffsll.c (ffsll): Correct implementation.
14921
14922 2009-03-27 Ian Lance Taylor <iant@google.com>
14923
14924 * ffsll.c: New file.
14925 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14926 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14927 * ftruncate.c (ftruncate): Declare before definition.
14928 * mremap.c (mremap): Likewise.
14929 * pread.c (pread): Likewise.
14930 * configure, Makefile.in, config.in: Rebuild.
14931
14932 * mremap.c: New file.
14933 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14934 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14935 (mremap): Declare if HAVE_MREMAP is not defined.
14936 * configure, Makefile.in, config.in: Rebuild.
14937
14938 2009-03-27 Cary Coutant <ccoutant@google.com>
14939
14940 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14941 position independent.
14942 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14943 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14944
14945 2009-03-24 Cary Coutant <ccoutant@google.com>
14946
14947 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14948 an executable.
14949 (needs_dynamic_reloc): Likewise.
14950
14951 2009-03-24 Ian Lance Taylor <iant@google.com>
14952
14953 * yyscript.y (file_cmd): Recognize EXTERN.
14954 (extern_name_list, extern_name_list_body): New nonterminals.
14955 * script.cc (script_add_extern): Define.
14956 * script-c.h (script_add_extern): Declare.
14957
14958 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14959
14960 * object.cc (is_elf_object): Define.
14961 * object.h (is_elf_object): Declare.
14962 * archive.cc (Archive::get_elf_object_for_member): Call
14963 is_elf_object.
14964 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14965
14966 2009-03-24 Elliott Hughes <enh@google.com>
14967
14968 * output.cc (Output_file::map_anonymous): Define.
14969 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14970 try an anonymous one. Report the size if the mmap fails.
14971 * output.h (class Output_file): Declare map_anonymous.
14972
14973 2009-03-24 Ian Lance Taylor <iant@google.com>
14974
14975 * target-select.cc (instantiate_target): Don't acquire the lock if
14976 the instantiated_target_ field has already been set.
14977
14978 2009-03-23 Ian Lance Taylor <iant@google.com>
14979
14980 * gold-threads.h (class Initialize_lock): Define.
14981 * gold-threads.cc (class Initialize_lock_once): Define.
14982 (initialize_lock_control): New static variable.
14983 (initialize_lock_pointer): New static variable.
14984 (initialize_lock_once): New static function.
14985 (Initialize_lock::Initialize_lock): Define.
14986 (Initialize_lock::initialize): Define.
14987 * target-select.h: Include "gold-threads.h".
14988 (class Target_selector): Add lock_ and initialize_lock_ fields.
14989 Don't define instantiate_target, just declare it.
14990 * target-select.cc (Target_selector::Target_selector): Initialize
14991 new fields.
14992 (Target_selector::instantiate_target): Define.
14993 * descriptors.h: Include "gold-threads.h".
14994 (class Descriptors): Add initialize_lock_ field.
14995 * descriptors.cc (Descriptors::Descriptors): Initialize new
14996 field.
14997 (Descriptors::open): Use initialize_lock_ field
14998 * errors.h (class Errors): Add initialize_lock_ field.
14999 * errors.cc (Errors::Errors): Initialize new field.
15000 (Errors::initialize_lock): Use initialize_lock_ field.
15001 * powerpc.cc (class Target_selector_powerpc): Remove
15002 instantiated_target_ field. In do_recognize call
15003 instantiate_target rather than do_instantiate_target. In
15004 do_instantiate_target just allocate a new target.
15005 * sparc.cc (class Target_selector_sparc): Likewise.
15006
15007 * freebsd.h: New file.
15008 * i386.cc: Include "freebsd.h".
15009 (Target_i386): Derive from Target_freebsd rather than
15010 Sized_target.
15011 (Target_selector_i386): Derive from Target_selector_freebsd rather
15012 than Target_selector.
15013 * x86_64.cc: Include "freebsd.h".
15014 (Target_x86_64): Derive from Target_freebsd rather than
15015 Sized_target.
15016 (Target_selector_x86_64): Derive from Target_selector_freebsd
15017 rather than Target_selector.
15018 * target.h (class Target): Add adjust_elf_header and
15019 do_adjust_elf_header.
15020 * output.cc (Output_file_header:: do_sized_write): Call target
15021 adjust_elf_header routine.
15022 * configure.tgt: Set targ_osabi.
15023 * configure.ac: Define GOLD_DEFAULT_OSABI.
15024 * parameters.cc (Parameters::default_target): Pass
15025 GOLD_DEFAULT_OSABI to select_target.
15026 * target-select.h (class Target_selector): Make instantiate_target
15027 protected rather than private.
15028 * Makefile.am (HFILES): Add freebsd.h.
15029 * configure, Makefile.in, config.in: Rebuild.
15030
15031 * merge.cc (do_add_input_section): Correct pend value. Change
15032 message about last entry not being null terminated from error to
15033 warning.
15034
15035 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
15036
15037 * incremental.cc: New file.
15038 * Makefile.am (CCFILES): Add incremental.cc.
15039 * Makefile.in: Rebuild.
15040
15041 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
15042
15043 * layout.cc (Layout::output_section_name): Preserve names
15044 of '.note.' sections.
15045
15046 2009-03-19 Ian Lance Taylor <iant@google.com>
15047
15048 * descriptors.cc (Descriptors::open): Check that the options are
15049 valid before using them.
15050
15051 2009-03-18 Ian Lance Taylor <iant@google.com>
15052
15053 * script-sections.h: Include <list>.
15054 (class Script_sections): Change Sections_elements from std::vector
15055 to std::list. Typedef public Elements_iterator. Add
15056 orphan_section_placement_, data_segment_align_start_, and
15057 saw_data_segment_align_ fields. Remove data_segment_align_index_
15058 field.
15059 * script-sections.cc (class Orphan_section_placement): New class.
15060 (class Sections_element): Add virtual functions is_relro and
15061 orphan_section_init. Remove virtual function place_orphan_here.
15062 (class Output_section_definition): Add is_relro and
15063 orphan_section_init. Remove place_orphan_here.
15064 (class Orphan_output_section): Likewise.
15065 (Script_sections::Script_sections): Update for field changes.
15066 (Script_sections::data_segment_align): Set saw_data_segment_align_
15067 and data_segment_align_start_, not data_segment_align_index.
15068 (Script_sections::data_segment_relro_end): Check
15069 saw_data_segment_align_. Use data_segment_align_start_ rather
15070 than data_segment_align_index_.
15071 (Script_sections::place_orphan): Rewrite to use
15072 Orphan_section_placement.
15073
15074 2009-03-17 Ian Lance Taylor <iant@google.com>
15075
15076 * archive.cc (Archive::add_symbols): Check for a version attached
15077 to the symbol name in the archive map.
15078 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
15079 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
15080 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
15081 (ver_test_11.a): New target.
15082 * testsuite/Makefile.in: Rebuild.
15083
15084 * configure.ac: Check for chsize and posix_fallocate. Replace
15085 ftruncate.
15086 * ftruncate.c: New file, from gnulib.
15087 * output.cc (posix_fallocate): Define dummy version if not
15088 HAVE_POSIX_FALLOCATE.
15089 (Output_file::map): Call posix_fallocate rather than lseek and
15090 write.
15091 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
15092 * configure, Makefile.in, config.in: Rebuild.
15093
15094 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
15095
15096 * layout.h (Layout::create_note): Add section_name parameter.
15097 * layout.cc (Layout::create_note): Likewise.
15098 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
15099
15100 2009-03-17 Ian Lance Taylor <iant@google.com>
15101
15102 * descriptors.cc: Include "options.h".
15103 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
15104 (Descriptors::open): Always use O_CLOEXEC when opening a new
15105 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
15106 then set FD_CLOEXEC.
15107
15108 * sparc.cc (class Target_sparc): Add has_got_section.
15109 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
15110 make sure we have a GOT section.
15111
15112 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
15113 (Target_sparc::Scan::local): Likewise.
15114 (Target_sparc::Scan::global): Likewise.
15115 (Target_sparc::Relocate::relocate): Likewise.
15116 (Target_sparc::Relocate::relocate_tls): Likewise.
15117
15118 * symtab.cc (Symbol_table::define_default_version): New function,
15119 broken out of add_from_object.
15120 (Symbol_table::add_from_object): Call define_default_version.
15121 (Symbol_table::define_special_symbol): Add resolve_oldsym
15122 parameter. Change all callers. If the version for a symbol comes
15123 from a version script, resolve it with the symbol with the same
15124 name with no version. Also add the symbol without a version if
15125 appropriate.
15126 (do_define_in_output_data): If resolving with oldsym, don't delete
15127 sym.
15128 (do_define_in_output_segment): Likewise.
15129 (do_define_as_constant): Likewise.
15130 * symtab.h (class Symbol_table): Update declarations.
15131
15132 2009-03-13 Ian Lance Taylor <iant@google.com>
15133
15134 * readsyms.cc (Read_symbols::incompatible_warning): New function.
15135 (Read_symbols::requeue): New function.
15136 (Read_symbols::do_read_symbols): If make_elf_object fails because
15137 the target type is not configured, and the file was searched for,
15138 issue a warning and retry with the next directory.
15139 (Add_symbols::run): If the file has an incompatible format, and
15140 it was searched for, requeue the Read_symbols task. On error,
15141 release the object.
15142 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
15143 dirindex parameter to constructor. Change all callers. Declare
15144 incompatible_warning and requeue.
15145 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
15146 input_argument_ and input_group_ fields. Add them to
15147 constructor. Change all callers.
15148 (class Read_script): Add dirindex_ field. Add it to constructor.
15149 Change all callers.
15150 * archive.cc (Archive::setup): Remove input_objects parameter.
15151 Change all callers.
15152 (Archive::get_file_and_offset): Likewise.
15153 (Archive::read_all_symbols): Likewise.
15154 (Archive::read_symbols): Likewise.
15155 (Archive::get_elf_object_for_member): Remove input_objects
15156 parameter. Add punconfigured parameter. Change all callers.
15157 (Archive::add_symbols): Change return type to bool. Check return
15158 value of include_member.
15159 (Archive::include_all_members): Likewise.
15160 (Archive::include_member): Change return type to bool. Return
15161 false if first included object has incompatible target. Set
15162 included_member_ field.
15163 (Add_archive_symbols::run): If add_symbols returns false, requeue
15164 Read_symbols task.
15165 * archive.h (class Archive): Add included_member_ field.
15166 Initialize it in constructor. Add input_file and searched_for
15167 methods. Update declarations.
15168 (class Add_archive_symbols): Add dirpath_, dirindex_, and
15169 input_argument_ fields. Add them to constructor. Change all
15170 callers.
15171 * script.cc: Include "target-select.h".
15172 (class Parser_closure): Add skip_on_incompatible_target_ and
15173 found_incompatible_target_ fields. Add
15174 skip_on_incompatible_target parameter to constructor. Change all
15175 callers. Add methods skip_on_incompatible_target,
15176 clear_skip_on_incompatible_target, found_incompatible_target, and
15177 set_found_incompatible_target.
15178 (read_input_script): Add dirindex parameter. Change all callers.
15179 If parser finds an incompatible target, requeue Read_symbols
15180 task.
15181 (script_set_symbol): Clear skip_on_incompatible_target in
15182 closure.
15183 (script_add_assertion, script_parse_option): Likewise.
15184 (script_start_sections, script_add_phdr): Likewise.
15185 (script_check_output_format): New function.
15186 * script.h (read_input_script): Update declaration.
15187 * script-c.h (script_check_output_format): Declare.
15188 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15189 (ignore_cmd): Remove OUTPUT_FORMAT.
15190 * fileread.cc (Input_file::Input_file): Add explicit this.
15191 (Input_file::will_search_for): New function.
15192 (Input_file::open): Add pindex parameter. Change all callers.
15193 * fileread.h (class Input_file): Add input_file_argument method.
15194 Declare will_search_for. Update declarations.
15195 * object.cc (make_elf_object): Add punconfigured parameter.
15196 Change all callers.
15197 * object.h (class Object): Make input_file public. Add
15198 searched_for method.
15199 (make_elf_object): Update declaration.
15200 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15201 restart search.
15202 * dirsearch.h (class Dirsearch): Update declaration.
15203 * options.h (class General_options): Add --warn-search-mismatch.
15204 * parameters.cc (Parameters::is_compatible_target): New function.
15205 * parameters.h (class Parameters): Declare is_compatible_target.
15206 * workqueue.cc (Workqueue::add_blocker): New function.
15207 * workqueue.h (class Workqueue): Declare add_blocker.
15208
15209 * fileread.cc (Input_file::open): Remove options parameter.
15210 Change all callers.
15211 (Input_file::open_binary): Likewise.
15212 * script.cc (read_input_script): Likewise.
15213 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15214 options parameter from constructor. Change all callers.
15215 (class Read_script): Likewise.
15216 * fileread.h (class Input_file): Update declarations.
15217 * script.h (read_input_script): Update declaration.
15218
15219 2009-03-10 Nick Clifton <nickc@redhat.com>
15220
15221 * po/es.po: New Spanish translation.
15222
15223 2009-03-06 Cary Coutant <ccoutant@google.com>
15224
15225 * options.cc (parse_short_option): Keep dash_z from registering itself.
15226
15227 2009-03-03 Ian Lance Taylor <iant@google.com>
15228
15229 PR 9918
15230 * target-reloc.h (relocate_section): Pass output_section to
15231 relocate.
15232 * i386.cc (Target_i386::should_apply_static_reloc): Add
15233 output_section parameter. Change all callers.
15234 (Target_i386::Relocate::relocate): Add output_section parameter.
15235 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15236 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15237 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15238 * testsuite/two_file_shared.sh: New script.
15239 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15240 (check_DATA): Add two_file_shared.dbg.
15241 (two_file_shared.dbg): New target.
15242 * testsuite/Makefile.in: Rebuild.
15243
15244 2009-03-01 Ian Lance Taylor <iant@google.com>
15245
15246 * configure.ac: Check for byteswap.h.
15247 * configure: Rebuild.
15248 * config.in: Rebuild.
15249
15250 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15251
15252 * layout.cc (Layout::find_or_add_kept_section): New function.
15253 (Layout::add_comdat): Removed.
15254 * layout.h (struct Kept_section): Move out of class Layout.
15255 Remove trailing underscores from field names. Add group_sections
15256 field. Rename group_ field to is_group. Change all uses.
15257 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15258 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15259 comdat_groups_ field.
15260 (Sized_relobj::include_section_group): Use
15261 find_or_add_kept_section and Kept_section::group_sections.
15262 (Sized_relobj::include_linkonce_section): Likewise.
15263 * object.cc (class Sized_relobj): Don't define Comdat_group or
15264 Comdat_group_table. Remove find_comdat_group and
15265 add_comdat_group. Remove comdat_groups_ field.
15266 * plugin.cc (include_comdat_group): Use
15267 Layout::find_or_add_kept_section.
15268
15269 2009-02-28 Ian Lance Taylor <iant@google.com>
15270
15271 * README: --gc-sections and map files are now supported. Document
15272 some build requirements.
15273
15274 PR 6992
15275 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15276 relocatable link set the value of the section symbol to zero.
15277 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15278 relocatable link don't include the section address in the local
15279 symbol value.
15280
15281 2009-02-27 Ian Lance Taylor <iant@google.com>
15282
15283 PR 6811
15284 * options.h (class Search_directory): Add is_system_directory.
15285 (class General_options): Declare is_in_system_directory.
15286 * options.cc (get_relative_sysroot): Make static.
15287 (get_default_sysroot): Make static.
15288 (General_optoins::is_in_system_directory): New function.
15289 * fileread.cc (Input_file::is_in_system_directory): New function.
15290 * fileread.h (class Input_file): Declare is_in_system_directory.
15291 * object.h (class Object): Add is_in_system_directory.
15292 (class Input_objects): Remove system_library_directory_ field.
15293 * object.cc (Input_objects::add_object): Don't set
15294 system_library_directory_.
15295 (input_objects::found_in_system_library_directory): Remove.
15296 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15297 parameter. Change all callers.
15298 (Symbol_table::sized_write_globals): Likewise.
15299 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15300 Call Object::is_in_system_directory.
15301 * symtab.h (class Symbol_table): Update declarations.
15302
15303 PR 5990
15304 * descriptors.h (Open_descriptor): Add is_on_stack field.
15305 * descriptors.cc (Descriptors::open): If the descriptor is on the
15306 top of the stack, remove it. Initialize is_on_stack field.
15307 (Descriptors::release): Only add pod to stack if it is not on the
15308 stack already.
15309 (Descriptors::close_some_descriptor): Clear stack_next and
15310 is_on_stack fields.
15311
15312 PR 7091
15313 * output.cc (Output_section::find_starting_output_address): Rename
15314 from starting_output_address; add PADDR parameter; change return
15315 type.
15316 * output.h (class Output_section): Declare
15317 find_starting_output_address instead of starting_output_address.
15318 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15319 section symbol for which we can't find a merge section.
15320
15321 PR 9836
15322 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15323 hidden or internal, force the symbol to be local.
15324 * resolve.cc (Symbol::override_visibility): Define.
15325 (Symbol::override_base): Use override_visibility.
15326 (Symbol_table::resolve): Likewise.
15327 (Symbol::override_base_with_special): Likewise.
15328 (Symbol_table::override_with_special): If the visibility is hidden
15329 or internal, force the symbol to be local.
15330 * symtab.h (class Symbol): Add set_visibility and
15331 override_visibility.
15332 * testsuite/ver_test_1.sh: New file.
15333 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15334 (check_DATA): Add ver_test_1.syms.
15335 (ver_test_1.syms): New target.
15336 * testsuite/Makefile.in: Rebuild.
15337
15338 2009-02-25 Cary Coutant <ccoutant@google.com>
15339
15340 * layout.cc (Layout::choose_output_section): Don't rename sections
15341 when using a linker script that has a SECTIONS clause.
15342 * Makefile.in: Regenerate.
15343
15344 * testsuite/Makefile.am (script_test_5.sh): New test case.
15345 * testsuite/Makefile.in: Regenerate.
15346 * testsuite/script_test_5.cc: New file.
15347 * testsuite/script_test_5.sh: New file.
15348 * testsuite/script_test_5.t: New file.
15349
15350 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
15351
15352 * archive.cc (Archive::include_member): Update calls to add_symbols.
15353 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15354 the Layout argument.
15355 * dynobj.h (do_add_symbols): Add the Layout argument.
15356 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15357 Layout argument.
15358 * object.h (Object::add_symbols): Add the Layout argument.
15359 (Object::do_add_symbols): Add the Layout argument.
15360 (Sized_relobj::do_add_symbols): Add the Layout argument.
15361 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15362 Unify the two versions.
15363 (Add_plugin_symbols): Remove.
15364 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15365 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15366 (Add_plugin_symbols): Remove.
15367 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15368 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15369 (Add_symbols::run): Make it work with Pulginobj.
15370
15371 2009-02-06 Ian Lance Taylor <iant@google.com>
15372
15373 * object.cc (Sized_relobj::do_layout): Make info message start
15374 with lower case letter.
15375
15376 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15377
15378 * binary.cc: Fix file comment.
15379
15380 * options.h (enum Incremental_disposition): Define.
15381 (class General_options): Add new options: --incremental,
15382 --incremental_changed, --incremental_unchanged,
15383 --incremental_unknown. Add incremental_disposition_ and
15384 implicit_incremental_ fields.
15385 (General_options::incremental_disposition): New function.
15386 (class Position_dependent_options): Add incremental_disposition
15387 option.
15388 (Position_dependent_options::copy_from_options): Set incremental
15389 dispositions.
15390 * options.cc (General_options::parse_incremental_changed): New
15391 function.
15392 (General_options::parse_incremental_unchanged): New function.
15393 (General_options::parse_incremental_unknown): New function.
15394 (General_options::General_options): Initialize new fields
15395 incremental_disposition_ and implicit_incremental_.
15396 (General_options::finalize): Check for uasge of --incremental-*
15397 without --incremental.
15398
15399 2009-02-06 Chris Demetriou <cgd@google.com>
15400
15401 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15402 pointer and to report location as the file name associated with
15403 the symbol.
15404 (gold_undefined_symbol_at_location): New function to replace the
15405 old gold_undefined_symbol functionality.
15406 * target-reloc.h (relocate_section): Update to use
15407 gold_undefined_symbol_at_location.
15408 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15409 Call gold_undefined_symbol function rather than gold_error.
15410 * errors.h (Errors::undefined_symbol): Take location as a
15411 string, rather than calculating it from a relocation.
15412 * errors.cc (Errors::fatal): Print "fatal error:" before the
15413 formatted message.
15414 (Errors::error, Errors::error_at_location): Print "error: "
15415 before the formatted message.
15416 (Errors::undefined_symbol): Take location as a string, rather
15417 than calculating it from a relocation.
15418 (gold_undefined_symbol_at_location): New function akin to
15419 old gold_undefined_symbol, calculates location from relocation.
15420 (gold_undefined_symbol): Change to take only a Symbol pointer
15421 and to report location as the file name associated with the symbol.
15422 * testsuite/debug_msg.sh: Update for changed error messages.
15423 * testsuite/undef_symbol.sh: Likewise.
15424
15425 2009-02-04 Duncan Sands <baldrick@free.fr>
15426
15427 PR 9812
15428 * reduced_debug_output.h
15429 (Output_reduced_debug_abbrev_section::failed): Use format for
15430 gold_warning.
15431 (Output_reduced_debug_info_section::faild): Likewise.
15432
15433 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15434
15435 * script.cc (Lazy_demangler): New class.
15436 (Version_script_info::get_symbol_version_helper): Demangle a
15437 symbol only once.
15438
15439 2009-01-29 Cary Coutant <ccoutant@google.com>
15440
15441 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15442 to __tls_get_addr.
15443 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15444
15445 2009-01-28 Ian Lance Taylor <iant@google.com>
15446
15447 * version.cc (version_string): Bump to 1.9.
15448
15449 * gold.h: Include <cstring> and <stdint.h>.
15450 * version.cc: Include <cstdio>.
15451 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15452 warning.
15453 * reduced_debug_output.cc (insert_into_vector): Rename from
15454 Insert_into_vector; change all callers. Use Swap_unaligned to
15455 avoid aliasing issue; remove union since it is unnecessary.
15456
15457 2009-01-27 Sriraman Tallam <tmsriram@google.com>
15458
15459 * Makefile.am (CCFILES): Add gc.cc.
15460 (HFILES): Add gc.h.
15461 * Makefile.in: Regenerate.
15462 * gold.cc (Gc_runner): New class.
15463 (queue_initial_tasks): Call garbage collection related tasks
15464 when corresponding options are invoked.
15465 (queue_middle_gc_tasks): New function.
15466 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15467 processed early before laying out sections during garbage collection.
15468 * gold.h (queue_middle_gc_tasks): New function.
15469 (is_prefix_of): Move from "layout.cc".
15470 * i386.cc (Target_i386::gc_process_relocs): New function.
15471 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15472 * main.cc (main): Create object of class "Garbage_collection".
15473 * object.cc (Relobj::copy_symbols_data): New function.
15474 (Relobj::is_section_name_included): New function.
15475 (Sized_relobj::do_layout): Allow this function to be called twice
15476 during garbage collection and defer layout of section during the
15477 first call.
15478 * object.h (Relobj::get_symbols_data): New function.
15479 (Relobj::is_section_name_included): New function.
15480 (Relobj::copy_symbols_data): New function.
15481 (Relobj::set_symbols_data): New function.
15482 (Relobj::get_relocs_data): New function.
15483 (Relobj::set_relocs_data): New function.
15484 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15485 (Relobj::gc_process_relocs): New function.
15486 (Relobj::do_gc_process_relocs): New pure virtual function.
15487 (Relobj::sd_): New data member.
15488 (Sized_relobj::is_output_section_offset_invalid): New function.
15489 (Sized_relobj::do_gc_process_relocs): New function.
15490 * options.h (General_options::gc_sections): Modify to not be a no-op.
15491 (General_options::print_gc_sections): New option.
15492 * plugin.cc (Plugin_finish::run): Remove function call to
15493 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15494 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15495 * reloc.cc (Read_relocs::run): Add task to process relocs and
15496 determine unreferenced sections when doing garbage collection.
15497 (Gc_process_relocs): New class.
15498 (Sized_relobj::do_gc_process_relocs): New function.
15499 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15500 sections that are garbage collected.
15501 * reloc.h (Gc_process_relocs): New class.
15502 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15503 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15504 symbols whose corresponding sections are garbage collected.
15505 (Symbol_table::Symbol_table): Add new parameter for the garbage
15506 collection object.
15507 (Symbol_table::gc_mark_undef_symbols): New function.
15508 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15509 (Symbol_table::gc_mark_dyn_syms): New function.
15510 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15511 as garbage.
15512 (Symbol_table::add_from_object): Likewise.
15513 (Symbol_table::add_from_relobj): When building shared objects, do not
15514 treat externally visible symbols as garbage.
15515 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15516 table information for static and relocatable links.
15517 * symtab.h (Symbol_table::set_gc): New function.
15518 (Symbol_table::gc): New function.
15519 (Symbol_table::gc_mark_undef_symbols): New function.
15520 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15521 (Symbol_table::gc_mark_dyn_syms): New function.
15522 (Symbol_table::gc_): New data member.
15523 * target.h (Sized_target::gc_process_relocs): New pure virtual
15524 function.
15525 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15526 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15527
15528 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15529
15530 * options.h (General_options::gc_sections): Define as a no-op for now.
15531 (General_options::no_keep_memory): Ditto.
15532 (General_options::Bshareable): Define.
15533 * options.cc (General_options::finalize): Honor -Bshareable.
15534
15535 2009-01-20 Andreas Schwab <schwab@suse.de>
15536
15537 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15538 read the value in the contents, since we don't use it. Use the
15539 template endianness when writing.
15540 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15541
15542 2009-01-19 Andreas Schwab <schwab@suse.de>
15543
15544 * configure.tgt (powerpc64-*): Fix targ_obj.
15545
15546 2009-01-15 Ian Lance Taylor <iant@google.com>
15547
15548 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15549 local symbols when stripping all symbols.
15550
15551 2009-01-14 Cary Coutant <ccoutant@google.com>
15552
15553 * output.cc (Output_reloc): Add explicit instantiations.
15554
15555 2009-01-14 Cary Coutant <ccoutant@google.com>
15556
15557 * archive.cc (Archive::get_elf_object_for_member): Remove call
15558 to File_read::claim_for_plugin.
15559 * descriptors.cc (Descriptors::open): Remove reference to
15560 is_claimed.
15561 (Descriptors::claim_for_plugin): Remove.
15562 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15563 (Descriptors::is_claimed): Remove.
15564 (claim_descriptor_for_plugin): Remove.
15565 * fileread.cc (File_read::claim_for_plugin): Remove.
15566 * fileread.h (File_read::claim_for_plugin): Remove.
15567 (File_read::descriptor): Reopen descriptor if necessary.
15568 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15569 (Plugin_manager::all_symbols_read): Add task parameter. Change
15570 all callers.
15571 (Plugin_manager::get_input_file): New function.
15572 (Plugin_manager::release_input_file): New function.
15573 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15574 corresponding data member.
15575 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15576 and pass to base constructor. Change all callers.
15577 (get_input_file, release_input_file): New functions.
15578 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15579 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15580 (Plugin_manager::all_symbols_read): Add task parameter.
15581 (Plugin_manager::get_input_file): New function.
15582 (Plugin_manager::release_input_file): New function.
15583 (Plugin_manager::task_): New data member.
15584 (Pluginobj::Pluginobj): Add filesize parameter.
15585 (Pluginobj::filename): New function.
15586 (Pluginobj::descriptor): New function.
15587 (Pluginobj::filesize): New function.
15588 (Pluginobj::filesize_): New data member.
15589 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15590 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15591 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15592
15593 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15594 with archive libraries.
15595 * testsuite/Makefile.in: Regenerate.
15596 * testsuite/plugin_test.c (struct sym_info): New type.
15597 (get_input_file, release_input_file): New static variables.
15598 (onload): Capture new transfer vector entries.
15599 (claim_file_hook): Stop reading at end of file according to filesize.
15600 Factor out parsing of readelf output into separate function.
15601 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15602 APIs and get the source file name from the symbol table. Convert
15603 source file name to corresponding object file name. Print info
15604 message when adding new input files.
15605 (parse_readelf_line): New function.
15606 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15607 * testsuite/plugin_test_2.sh: Likewise.
15608 * testsuite/plugin_test_3.sh: Likewise.
15609 * testsuite/plugin_test_4.sh: New test case.
15610
15611 2009-01-07 Ian Lance Taylor <iant@google.com>
15612
15613 * version.cc (version_string): Bump to 1.8.
15614
15615 2008-12-23 Cary Coutant <ccoutant@google.com>
15616
15617 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15618 * plugin.cc (Plugin_manager::finish): Rename as
15619 layout_deferred_objects. Move cleanup to separate function.
15620 (Plugin_manager::cleanup): New function.
15621 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15622 separately.
15623 * plugin.h (Plugin_manager::finish): Rename as
15624 layout_deferred_objects.
15625 (Plugin_manager::cleanup): New function.
15626 (Plugin_manager::cleanup_done): New field.
15627
15628 2008-12-23 Cary Coutant <ccoutant@google.com>
15629
15630 * plugin.cc (is_visible_from_outside): New function.
15631 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15632 so we don't return "IR only" status for exported symbols or -r links.
15633
15634 * testsuite/Makefile.am (plugin_test_3): New test case.
15635 * testsuite/Makefile.in: Regenerate.
15636 * testsuite/plugin_test_3.sh: New file.
15637
15638 2008-12-22 Cary Coutant <ccoutant@google.com>
15639
15640 * object.cc (Sized_relobj::layout_section): New function.
15641 (Sized_relobj::do_layout): Defer layout of input sections until after
15642 plugin has provided replacement files.
15643 (Sized_relobj::do_layout_deferred_sections): New function.
15644 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15645 (Relobj::layout_deferred_sections): New function.
15646 (Relobj::do_layout_deferred_sections): New function.
15647 (Sized_relobj::do_layout_deferred_sections): New function.
15648 (Sized_relobj::layout_section): New function.
15649 (Sized_relobj::Deferred_layout): New structure.
15650 (Sized_relobj::deferred_layout_): New field.
15651 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15652 Change all callers. Layout deferred sections.
15653 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15654 references.
15655 (Plugin_hook::run): Move code from do_plugin_hook inline.
15656 (Plugin_hook::do_plugin_hook): Remove.
15657 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15658 (Plugin_manager::finish): Renamed, was cleanup.
15659 (Plugin_manager::should_defer_layout): New function.
15660 (Plugin_manager::add_deferred_layout_object): New function.
15661 (Plugin_manager::Deferred_layout_list): New type.
15662 (Plugin_manager::deferred_layout_objects_): New field.
15663 (Plugin_hook::do_plugin_hook): Remove.
15664
15665 2008-12-17 Ian Lance Taylor <iant@google.com>
15666
15667 * options.h (class General_options): Add --no case for
15668 --export-dynamic.
15669
15670 2008-12-16 Cary Coutant <ccoutant@google.com>
15671
15672 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15673 vector.
15674 (Plugin_manager::claim_file): Create plugin object even if
15675 plugin did not call the add_symbols callback.
15676 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15677 asking for more symbols than were added.
15678 * testsuite/Makefile.am (plugin_test_1): Add test case with
15679 no global symbols.
15680 (empty.syms): New target.
15681 * testsuite/Makefile.in: Regenerate.
15682 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15683 message. Don't call add_symbols if no globals.
15684 (all_symbols_read_hook): Don't provide replacement for empty
15685 claimed file.
15686
15687 2008-12-12 Ian Lance Taylor <iant@google.com>
15688
15689 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15690 r_type == 0 for a local symbol with r_sym == 0.
15691 (scan_relocatable_relocs): Pass r_sym to
15692 local_non_section_strategy.
15693 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15694 r_sym parameter.
15695
15696 * configure.ac: Update test for TLS descriptors: they are
15697 supported as of glibc 2.9.
15698 * configure: Rebuild.
15699
15700 2008-12-11 Ian Lance Taylor <iant@google.com>
15701
15702 PR 7091
15703 * target-reloc.h (Default_scan_relocatable_relocs): For each
15704 function, map r_type == 0 to RELOC_DISCARD.
15705
15706 2008-12-10 Cary Coutant <ccoutant@google.com>
15707
15708 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15709 object to override a kept COMDAT group from a plugin object.
15710
15711 2008-12-09 Ian Lance Taylor <iant@google.com>
15712
15713 PR 7088
15714 * yyscript.y (file_cmd): Handle INPUT.
15715
15716 * testsuite/initpri1.c: Change all declarations to be full
15717 prototypes by adding void, to avoid compiler warnings.
15718
15719 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15720
15721 * options.cc (General_options::parse_plugin_opt): New.
15722 (General_options::add_plugin): The argument now is just the filename.
15723 (General_options::add_plugin_option): New.
15724 * options.h (plugin_opt): New.
15725 (add_plugin): Change argument name.
15726 (add_plugin_option): New.
15727 * plugin.cc (Plugin::load): Don't parse the plugin option.
15728 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15729 (Plugin::add_option): New.
15730 (Plugin::args_): Change type.
15731 (Plugin::filename_): New.
15732 (Plugin_manager::add_plugin_option): New.
15733 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15734 * testsuite/Makefile.in: Regenerate.
15735
15736 2008-12-05 Cary Coutant <ccoutant@google.com>
15737
15738 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15739 Handle --strip-lto-sections option.
15740 * options.h (strip_lto_sections): New option.
15741
15742 2008-12-01 Cary Coutant <ccoutant@google.com>
15743
15744 * plugin.cc (ld_plugin_message): Change format parameter to const.
15745 Fix mismatch between new[] and delete.
15746
15747 2008-11-14 Cary Coutant <ccoutant@google.com>
15748
15749 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15750 instead of -1U.
15751
15752 2008-11-05 Craig Silverstein <csilvers@google.com>
15753
15754 * options.cc (General_options::parse_dynamic_list): New function.
15755 * options.h (General_options): New flags dynamic_list,
15756 dynamic_list_data, dynamic_list_cpp_new, and
15757 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15758 (General_options::in_dynamic_list): New function.
15759 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15760 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15761 (Lex::can_continue_name): Likewise.
15762 (yylex): Likewise.
15763 (read_script_file): New parameter script_options.
15764 (read_dynamic_list): New function.
15765 (Script_options::define_dynamic_list): New function.
15766 (dynamic_list_keyword_parsecodes): New variable.
15767 (dynamic_list_keywords): New variable.
15768 * script.h (Script_options::define_dynamic_list): New function
15769 prototype.
15770 (read_dynamic_list): New function prototype.
15771 * symtab.cc (strprefix): New macro.
15772 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15773 dynamic_list_data, dynamic_list_cpp_new, and
15774 dynamic_list_cpp_typeinfo.
15775 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15776 (dynamic_list_expr): New rule.
15777 (dynamic_list_nodes): Likewise.
15778 (dynamic_list_node): Likewise.
15779 * testsuite/Makefile.am (dynamic_list): New test.
15780 * testsuite/Makefile.in: Regenerated.
15781 * testsuite/dynamic_list.t: New file.
15782 * testsuite/dynamic_list.sh: New file.
15783
15784 2008-11-05 Craig Silverstein <csilvers@google.com>
15785
15786 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15787 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15788 (t11_last): Likewise.
15789 * testsuite/ver_test_6.c (main): Likewise.
15790
15791 2008-10-07 Cary Coutant <ccoutant@google.com>
15792
15793 * options.c (General_options::finalize): Add check for -static and
15794 -shared.
15795 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15796 is not empty.
15797
15798 2008-10-02 Cary Coutant <ccoutant@google.com>
15799
15800 * plugin.cc (make_sized_plugin_object): Fix conditional
15801 compilation to work when not all targets are enabled.
15802
15803 2008-09-29 Cary Coutant <ccoutant@google.com>
15804
15805 * archive.cc (Archive::get_file_and_offset): Use filename instead
15806 of name to get library path.
15807 (Archive::include_member): Unlock external member of a thin archive.
15808
15809 * testsuite/Makefile.am (TEST_AR): New variable.
15810 (thin_archive_test_1): New test.
15811 (thin_archive_test_2): New test.
15812 * testsuite/Makefile.in: Regenerate.
15813 * testsuite/thin_archive_main.cc: New file.
15814 * testsuite/thin_archive_test_1.cc: New file.
15815 * testsuite/thin_archive_test_2.cc: New file.
15816 * testsuite/thin_archive_test_3.cc: New file.
15817 * testsuite/thin_archive_test_4.cc: New file.
15818
15819 2008-09-29 Cary Coutant <ccoutant@google.com>
15820
15821 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15822 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15823 instead of -1U.
15824 (Sized_relobj::do_finalize_local_symbols): Likewise.
15825 (Sized_relobj::map_to_kept_section): Likewise.
15826 * object.h (Sized_relobj::invalid_address): New constant.
15827 (Sized_relobj::do_output_section_offset): Check for invalid_address
15828 and return -1ULL.
15829 * output.cc (Output_reloc::local_section_offset): Use constant
15830 invalid_address instead of -1U.
15831 (Output_reloc::get_address): Likewise.
15832 (Output_section::output_address): Change -1U to -1ULL.
15833 * output.h (Output_reloc::invalid_address): New constant.
15834 * reloc.cc (Sized_relobj::write_sections): Use constant
15835 invalid_address instead of -1U.
15836 (Sized_relobj::relocate_sections): Likewise.
15837 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15838 values for merge sections.
15839 * target-reloc.h (relocate_for_relocatable): Use constant
15840 invalid_address instead of -1U.
15841
15842 2008-09-19 Cary Coutant <ccoutant@google.com>
15843
15844 Add plugin functionality for link-time optimization (LTO).
15845 * configure.ac (plugins): Add --enable-plugins option.
15846 * configure: Regenerate.
15847 * config.in: Regenerate.
15848 * Makefile.am (LIBDL): New variable.
15849 (CCFILES): Add plugin.cc.
15850 (HFILES): Add plugin.h.
15851 (ldadd_var): Add LIBDL.
15852 * Makefile.in: Regenerate.
15853
15854 * archive.cc: Include "plugin.h".
15855 (Archive::setup): Don't preread archive symbols when using a plugin.
15856 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15857 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15858 files.
15859 (Archive::include_member): Add symbols from plugin objects.
15860 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15861 * descriptors.cc (Descriptors::open): Check for file descriptors
15862 abandoned by plugins.
15863 (Descriptors::claim_for_plugin): New function.
15864 * descriptors.h (Descriptors::claim_for_plugin): New function.
15865 (Open_descriptor::is_claimed): New field.
15866 (claim_descriptor_for_plugin): New function.
15867 * fileread.cc (File_read::claim_for_plugin): New function.
15868 * fileread.h (File_read::claim_for_plugin): New function.
15869 (File_read::descriptor): New function.
15870 * gold.cc: Include "plugin.h".
15871 (queue_initial_tasks): Add task to call plugin hooks for generating
15872 new object files.
15873 * main.cc: Include "plugin.h".
15874 (main): Load plugin libraries.
15875 * object.h (Pluginobj): Declare.
15876 (Object::pluginobj): New function.
15877 (Object::do_pluginobj): New function.
15878 (Object::set_target): New function.
15879 * options.cc: Include "plugin.h".
15880 (General_options::parse_plugin): New function.
15881 (General_options::General_options): Initialize plugins_ field.
15882 (General_options::add_plugin): New function.
15883 * options.h (Plugin_manager): Declare.
15884 (General_options): Add --plugin option.
15885 (General_options::has_plugins): New function.
15886 (General_options::plugins): New function.
15887 (General_options::add_plugin): New function.
15888 (General_options::plugins_): New field.
15889 * plugin.cc: New file.
15890 * plugin.h: New file.
15891 * readsyms.cc: Include "plugin.h".
15892 (Read_symbols::do_read_symbols): Check for archive before checking
15893 for ELF file. Call plugin hooks to claim files.
15894 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15895 from a real object file; force override when processing replacement
15896 files.
15897 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15898 (Symbol::init_base_object): Likewise.
15899 (Symbol::init_base_output_data): Likewise.
15900 (Symbol::init_base_output_segment): Likewise.
15901 (Symbol::init_base_constant): Likewise.
15902 (Symbol::init_base_undefined): Likewise.
15903 (Symbol::output_section): Assert that object is not a plugin.
15904 (Symbol_table::add_from_pluginobj): New function.
15905 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15906 undefined.
15907 (Symbol_table::sized_write_globals): Likewise.
15908 (Symbol_table::add_from_pluginobj): Instantiate template.
15909 * symtab.h (Sized_pluginobj): Declare.
15910 (Symbol::in_real_elf): New function.
15911 (Symbol::set_in_real_elf): New function.
15912 (Symbol::in_real_elf_): New field.
15913 (Symbol_table::add_from_pluginobj): New function.
15914
15915 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15916 (LIBDL): New variable.
15917 (LDADD): Add LIBDL.
15918 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15919 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15920 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15921 (MOSTLYCLEANFILES): Likewise.
15922 * testsuite/Makefile.in: Regenerate.
15923 * testsuite/plugin_test.c: New file.
15924 * testsuite/plugin_test_1.sh: New file.
15925 * testsuite/plugin_test_2.sh: New file.
15926
15927 2008-09-16 Ian Lance Taylor <iant@google.com>
15928
15929 * target-reloc.h (relocate_section): Check whether a symbol is
15930 defined by the ABI before reporting an undefined symbol error.
15931 * target.h (Target::is_defined_by_abi): Make parameter const.
15932 (Target::do_is_defined_by_abi): Likewise.
15933 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15934 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15935 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15936 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15937 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15938 * testsuite/Makefile.in: Rebuild.
15939
15940 * fileread.cc (make_view): Add casts to avoid warning.
15941
15942 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15943
15944 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15945 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15946
15947 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15948
15949 * options.h (General_options::output_is_executable): New.
15950 (General_options::output_is_pie): New.
15951 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15952 for shared libraries.
15953 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15954
15955 2008-09-11 Chris Demetriou <cgd@google.com>
15956
15957 * options.h (origin): New -z option.
15958 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15959 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15960 in DT_FLAGS_1.
15961
15962 2008-09-05 Cary Coutant <ccoutant@google.com>
15963
15964 * fileread.cc (File_read::make_view): Add check for attempt to map
15965 beyond end of file.
15966
15967 2008-09-05 Cary Coutant <ccoutant@google.com>
15968
15969 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15970 explicit instantiations.
15971
15972 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15973
15974 PR gold/6858
15975 * options.cc (General_options::finalize): Allow undefined symbols
15976 in shlibs if linking -shared.
15977
15978 PR gold/6859
15979 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15980 symbols as not needing a dynsym entry.
15981
15982 2008-08-20 Craig Silverstein <csilvers@google.com>
15983
15984 * fileread.cc (File_read::open): Do not lock the file unless it
15985 was successfully opened.
15986
15987 2008-08-14 Cary Coutant <ccoutant@google.com>
15988
15989 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15990 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15991 * testsuite/tls_test.cc (struct int128): 128-bit struct
15992 for testing TLS relocs with non-zero addend.
15993 (v12): New TLS variable.
15994 (t12): New test.
15995 (t_last): Add check for v12.
15996 * testsuite/tls_test.h (t12): New function.
15997 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15998
15999 2008-08-13 Ian Lance Taylor <iant@google.com>
16000
16001 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
16002 set tls_segment_ or relro_segment_.
16003 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
16004 when appropriate.
16005 * output.h (Output_section::clear_is_relro): New function.
16006 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
16007 sections specially even when output_data_ is empty.
16008 (Output_segment::maximum_alignment): When first section is relro,
16009 only force alignment for PT_LOAD segments.
16010 * script.cc (script_data_segment_align): New function.
16011 (script_data_segment_relro_end): New function.
16012 * script-c.h (script_data_segment_align): Declare.
16013 (script_data_segment_relro_end): Declare.
16014 * script-sections.h (class Script_sections): Declare
16015 data_segment_align and data_segment_relro_end. Add fields
16016 segment_align_index_ and saw_relro_end_.
16017 * script-sections.cc (class Sections_element): Add set_is_relro
16018 virtual function. Add new bool* parameter to place_orphan_here.
16019 Add get_output_section virtual function.
16020 (class Output_section_definition): Add set_is_relro. Add new
16021 bool* parameter to place_orphan_here. Add get_output_section.
16022 Add is_relro_ field.
16023 (Output_section_definition::Output_section_definition): Initialize
16024 evaluated_address_, evaluated_load_address, evaluated_addralign_,
16025 and is_relro_ fields.
16026 (Output_section_definition::place_orphan_here): Add is_relro
16027 parameter.
16028 (Output_section_definition::set_section_addresses): Set relro for
16029 output section.
16030 (Output_section_definition::alternate_constraint): Likewise.
16031 (class Orphan_output_section): Add new bool* parameter to
16032 place_orphan_here. Add get_output_section.
16033 (Orphan_output_section::place_orphan_here): Add is_relro
16034 parameter.
16035 (Script_sections::Script_sections): Initialize
16036 data_segment_align_index_ and saw_relro_end_.
16037 (Script_sections::data_segment_align): New function.
16038 (Script_sections::data_segment_relro_end): New function.
16039 (Script_sections::place_orphan): Set or clear is_relro.
16040 (Script_sections::set_section_addresses): Force alignment of first
16041 TLS section.
16042 * yyscript.y (exp): Call script_data_segment_align and
16043 script_data_segment_relro_end.
16044 * testsuite/relro_script_test.t: New file.
16045 * testsuite/relro_test.cc (using_script): Declare.
16046 (t1, t2): Test using_script.
16047 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
16048 (relro_script_test_SOURCES): Define.
16049 (relro_script_test_DEPENDENCIES): Define.
16050 (relro_script_test_LDFLAGS): Define.
16051 (relro_script_test_LDADD): Define.
16052 (relro_script_test.so): New target.
16053 * testsuite/Makefile.in: Rebuild.
16054
16055 2008-08-06 Cary Coutant <ccoutant@google.com>
16056
16057 * archive.cc (Archive::total_archives, Archive::total_members)
16058 (Archive::total_members_loaded): New variables.
16059 (Archive::setup): Add parameter. Add option to preread
16060 archive symbols.
16061 (Archive::read_armap): Add counter.
16062 (Archive::get_file_and_offset): New function.
16063 (Archive::get_elf_object_for_member): New function.
16064 (Archive::read_all_symbols): New function.
16065 (Archive::read_symbols): New function.
16066 (Archive::add_symbols): Add counters.
16067 (Archive::include_all_members): Use armap to find members if it's
16068 already built.
16069 (Archive::include_member): Skip reading symbols if already read.
16070 Factored code into Archive::get_file_and_offset and
16071 Archive::get_elf_object_for_member. Changed call to
16072 Mapfile::report_include_archive_member.
16073 (Archive::print_stats): New function.
16074 * archive.h: Declare Object and Read_symbols_data classes.
16075 (Archive::Archive): Add initializers for new members.
16076 (Archive::setup): Add parameter.
16077 (Archive::print_stats): New function.
16078 (Archive::total_archives, Archive::total_members)
16079 (Archive::total_members_loaded): New variables.
16080 (Archive::get_file_and_offset): New function.
16081 (Archive::get_elf_object_for_member): New function.
16082 (Archive::read_all_symbols): New function.
16083 (Archive::read_symbols): New function.
16084 (Archive::Archive_member): New class.
16085 (Archive::members_): New member.
16086 (Archive::num_members_): New member.
16087 * main.cc: Include archive.h.
16088 (main): Call Archive::print_stats.
16089 * mapfile.cc (Mapfile::report_include_archive_member): Delete
16090 archive parameter; member_name is now the fully-decorated name.
16091 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
16092 * options.h: (General_options): Add --preread-archive-symbols option.
16093 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
16094 Archive::setup.
16095
16096 2008-08-04 Ian Lance Taylor <iant@google.com>
16097
16098 * symtab.h (Symbol::use_plt_offset): New function.
16099 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
16100 * powerpc.cc (Relocate::relocate): Likewise.
16101 * sparc.cc (Relocate::relocate): Likewise.
16102 * x86_64.cc (Relocate::relocate): Likewise.
16103 * testsuite/weak_plt.sh: New test.
16104 * testsuite/weak_plt_main.cc: New test.
16105 * testsuite/weak_plt_shared.cc: New test.
16106 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
16107 (check_PROGRAMS): Add weak_plt.
16108 (check_DATA): Add weak_plt_shared.so.
16109 (weak_plt_main_pic.o, weak_plt): New targets.
16110 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
16111 * testsuite/Makefile.in: Rebuild.
16112
16113 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
16114 gcctestdir/ld.
16115 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
16116 * testsuite/Makefile.in: Rebuild.
16117
16118 2008-08-04 Alan Modra <amodra@bigpond.net.au>
16119
16120 * Makefile.am (POTFILES.in): Set LC_ALL=C.
16121 * Makefile.in: Regenerate.
16122 * po/POTFILES.in: Regenerate.
16123
16124 2008-07-29 Ian Lance Taylor <iant@google.com>
16125
16126 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
16127 symbols before other symbols.
16128 * testsuite/script_test_2.cc (test_addr): Declare.
16129 (test_addr_alias): Declare.
16130 (main): Check that test_addr and test_addr_alias have the right
16131 values.
16132 * testsuite/script_test_2.t: Define test_addr_alias and
16133 test_addr.
16134
16135 2008-07-24 Ian Lance Taylor <iant@google.com>
16136
16137 PR 5990
16138 * descriptors.cc: New file.
16139 * descriptors.h: New file.
16140 * gold-threads.h (class Hold_optional_lock): New class.
16141 * fileread.cc: Include "descriptors.h".
16142 (File_read::~File_read): Release descriptor rather than closing
16143 it.
16144 (File_read::open) [file]: Call open_descriptor rather than open.
16145 Set is_descriptor_opened_.
16146 (File_read::open) [memory]: Assert that descriptor is not open.
16147 (File_read::reopen_descriptor): New function.
16148 (File_read::release): Release descriptor.
16149 (File_read::do_read): Make non-const. Reopen descriptor.
16150 (File_read::read): Make non-const.
16151 (File_read::make_view): Reopen descriptor.
16152 (File_read::do_readv): Likewise.
16153 * fileread.h (class File_read): Add is_descriptor_opened_ field.
16154 Update declarations.
16155 * layout.cc: Include "descriptors.h".
16156 (Layout::create_build_id): Use open_descriptor rather than open.
16157 * output.cc: Include "descriptors.h".
16158 (Output_file::open): Use open_descriptor rather than open.
16159 * archive.cc (Archive::const_iterator): Change Archive to be
16160 non-const.
16161 (Archive::begin, Archive::end): Make non-const.
16162 (Archive::count_members): Likewise.
16163 * archive.h (class Archive): Update declarations.
16164 * object.h (Object::read): Make non-const.
16165 * Makefile.am (CCFILES): Add descriptors.cc.
16166 (HFILES): Add descriptors.h.
16167 * Makefile.in: Rebuild.
16168
16169 PR 6716
16170 * gold.h: Always include <clocale>. Add Solaris workarounds
16171 following code in binutils/sysdep.h.
16172
16173 PR 6048
16174 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
16175 this->eh_frame_hdr_ is NULL before using it.
16176
16177 * dynobj.cc (Versions::Versions): Update comment.
16178
16179 * dynobj.cc (Versions::Versions): If there is an soname, use it as
16180 the base version name.
16181
16182 * stringpool.cc (Stringpool_template::add_with_length): Set key to
16183 array size plus one.
16184 (Stringpool_template::set_string_offsets): Subtract one from key
16185 before using it as an array index.
16186 (Stringpool_template::get_offset_with_length): Likewise.
16187 (Stringpool_template::write_to_buffer): Likewise.
16188 * stringpool.h (Stringpool_template::get_offset_from_key):
16189 Likewise.
16190
16191 2008-07-23 Ian Lance Taylor <iant@google.com>
16192
16193 PR 6658
16194 * object.h (Merged_symbol_value::value): Do our best to handle a
16195 negative addend.
16196
16197 PR 6647
16198 * script.cc (Version_script_info::get_versions): Don't add empty
16199 version tag to return value.
16200 (Version_script_info::get_symbol_version_helper): Change return
16201 type to bool. Add pversion parameter. Change all callers.
16202 (script_register_vers_node): Don't require a non-NULL tag.
16203 * script.h (class Version_script_info): Update declarations.
16204 (Version_script_info::get_symbol_version): Change return type to
16205 bool. Add version parameter. Change all callers.
16206 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16207 handling. Handle an empty version from a version script.
16208 (Symbol_table::define_special_symbol): Likewise.
16209 * testsuite/ver_test_10.script: New file.
16210 * testsuite/ver_test_10.sh: New file.
16211 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16212 (check_DATA): Add ver_test_10.syms.
16213 (ver_test_10.syms, ver_test_10.so): New target.
16214 * testsuite/Makefile.in: Rebuild.
16215
16216 2008-07-23 Simon Baldwin <simonb@google.com>
16217
16218 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16219 to zero for undefined symbols from dynamic libraries.
16220
16221 2008-07-23 Ian Lance Taylor <iant@google.com>
16222
16223 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16224 Change all callers.
16225 * symtab.h (class Symbol_table): Update declaration.
16226 * testsuite/ver_test_9.cc: New file.
16227 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16228 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16229 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16230 (ver_test_9.so, ver_test_9.o): New targets.
16231 * testsuite/Makefile.in: Rebuild.
16232
16233 2008-07-22 Ian Lance Taylor <iant@google.com>
16234
16235 * options.h (class General_options): Define --check-sections.
16236 * layout.cc (Layout::set_segment_offsets): Handle
16237 --check-sections.
16238
16239 * options.h (class General_options): Define -n/--nmagic and
16240 -N/--omagic.
16241 * options.cc (General_options::finalize): For -n/--nmagic or
16242 -N/--omagic, set -static.
16243 * layout.cc (Layout::attach_allocated_section_to_segment): If
16244 -N/--omagic, don't put read-only and read-write sections in
16245 different segments.
16246 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16247 finding a read-only segment.
16248 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16249 don't set the minimum segment alignment to the common page size,
16250 and don't set the file offset to the address modulo the page size.
16251 * script-sections.cc (Script_sections::create_segments): If
16252 -n/--omagic, don't put read-only and read-write sections in
16253 different segments.
16254
16255 * cref.cc: New file.
16256 * cref.h: New file.
16257 * options.h (class General_options): Add --print-symbol-counts.
16258 * main.cc (main): Issue defined symbol report if requested.
16259 * archive.cc (Archive::interpret_header): Make into a const member
16260 function.
16261 (Archive::add_symbols): Call Input_objects::archive_start and
16262 archive_stop.
16263 (Archive::const_iterator): Define new class.
16264 (Archive::begin, Archive::end): New functions.
16265 (Archive::include_all_members): Rewrite to use iterator.
16266 (Archive::count_members): New function.
16267 * archive.h (class Archive): Update declarations.
16268 (Archive::filename): New function.
16269 * object.cc: Include "cref.h".
16270 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16271 (Sized_relobj::do_get_global_symbol_counts): New function.
16272 (Input_objects::add_object): Add object to cross-referencer.
16273 (Input_objects::archive_start): New function.
16274 (Input_objects::archive_stop): New function.
16275 (Input_objects::print_symbol_counts): New function.
16276 * object.h: Declare Cref and Archive.
16277 (Object::get_global_symbol_counts): New function.
16278 (Object::do_get_global_symbol_counts): New pure virtual function.
16279 (class Sized_relobj): Add defined_count_ field. Update
16280 declarations.
16281 (class Input_objects): Add cref_ field. Update constructor.
16282 Update declarations.
16283 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16284 defined_count_.
16285 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16286 symbol counts.
16287 (Sized_dynobj::do_get_global_symbol_counts): New function.
16288 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16289 defined_count_. Update declarations. Define Symbols typedef.
16290 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16291 parameter. Change all callers.
16292 (Symbol_table::add_from_dynobj): Add sympointers and defined
16293 parameters. Change all callers.
16294 * symtab.h (class Symbol_table): Update declarations.
16295 * Makefile.am (CCFILES): Add cref.cc.
16296 (HFILES): Add cref.h.
16297 * Makefile.in: Rebuild.
16298
16299 2008-07-22 Simon Baldwin <simonb@google.com>
16300
16301 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16302 to zero when writing undefined symbols.
16303
16304 2008-07-22 Ian Lance Taylor <iant@google.com>
16305
16306 * output.cc (Output_section::add_input_section): Don't try to
16307 merge empty merge sections.
16308
16309 2008-07-21 Craig Silverstein <csilvers@google.com>
16310
16311 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16312 Include symbol version in error message.
16313
16314 2008-07-20 Chris Demetriou <cgd@google.com>
16315
16316 * configure.ac (gold_cv_c_random_seed): New configured variable.
16317 (RANDOM_SEED_CFLAGS): New substituted variable.
16318 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16319 * configure: Rebuild.
16320 * Makefile.in: Likewise.
16321 * testsuite/Makefile.in: Likewise.
16322
16323 2008-07-18 Ian Lance Taylor <iant@google.com>
16324
16325 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16326 where we see NAME/NULL and NAME/VERSION as separate symbols.
16327 * testsuite/ver_test_main.cc (main): Call t4.
16328 (t4, t4_2a): Define.
16329 * testsuite/ver_test_2.cc (t4_2): Define.
16330 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16331 * testsuite/ver_test_4.cc (t4_2a): Define.
16332 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16333 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16334
16335 2008-07-17 Ian Lance Taylor <iant@google.com>
16336
16337 * dynobj.cc (Versions::add_def): If we give an error about a
16338 missing version, go ahead and create the version anyhow.
16339
16340 2008-07-10 Ian Lance Taylor <iant@google.com>
16341
16342 Handle output sections with more than 0x7fffffff bytes.
16343 * object.h (class Relobj): Change map_to_output_ to
16344 output_sections_, and just keep a section pointer. Change all
16345 uses. Move comdat group support to Sized_relobj.
16346 (Relobj::is_section_specially_mapped): Remove.
16347 (Relobj::output_section): Remove poff parameter. Change all
16348 callers.
16349 (Relobj::output_section_offset): New function.
16350 (Relobj::set_section_offset): Rewrite.
16351 (Relobj::map_to_output): Remove.
16352 (Relobj::output_sections): New function.
16353 (Relobj::do_output_section_offset): New pure virtual function.
16354 (Relobj::do_set_section_offset): Likewise.
16355 (class Sized_relobj): Add section_offsets_ field. Add comdat
16356 group support from Relobj. Update declarations.
16357 (Sized_relobj::get_output_section_offset): New function.
16358 (Sized_relobj::do_output_section_offset): New function.
16359 (Sized_relobj::do_set_section_offset): New function.
16360 * object.cc (Relobj::output_section_address): Remove.
16361 (Sized_relobj::Sized_relobj): Initialize new fields.
16362 (Sized_relobj::include_section_group): Cast find_kept_object to
16363 Sized_relobj.
16364 (Sized_relobj::include_linkonce_section): Likewise.
16365 (Sized_relobj::do_layout): Use separate arrays for output section
16366 and output offset.
16367 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16368 output_sections.
16369 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16370 output_sections and section_offsets.
16371 (Sized_relobj::write_local_symbols): Likewise.
16372 (map_to_kept_section): Compute output address directly.
16373 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16374 output_sections and section_offsets.
16375 (Sized_relobj::write_sections): Likewise.
16376 (Sized_relobj::relocate_sections): Likewise.
16377 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16378 * output.h (class Output_reloc): Update declarations. Change
16379 u2_.relobj to Sized_relobj*.
16380 (class Output_data_reloc): Change add functions to use
16381 Sized_relobj*.
16382 * output.cc (Output_reloc::Output_reloc): Change relobj to
16383 Sized_relobj*.
16384 (Output_reloc::local_section_offset): Change return type to
16385 Elf_Addr. Use get_output_section_offset.
16386 (Output_reloc::get_address): Likewise.
16387 (Output_section::is_input_address_mapped): Don't call
16388 is_section_specially_mapped.
16389 (Output_section::output_offset): Likewise.
16390 (Output_section::output_address): Likewise.
16391 (Output_section::starting_output_address): Likewise.
16392 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16393 parameter to Sized_relobj*.
16394 (Copy_relocs::need_copy_reloc): Likewise.
16395 (Copy_relocs::save): Likewise.
16396 * copy-relocs.h (class Copy_relocs): Update declarations.
16397 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16398 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16399 * target-reloc.h (relocate_for_relocatable): Change
16400 offset_in_output_section type to Elf_Addr. Change code that uses
16401 it as well.
16402 * layout.cc (Layout::layout): Always set *off.
16403 * mapfile.cc (Mapfile::print_input_section): Use
16404 output_section_offset.
16405 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16406 Sized_relobj*.
16407 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16408 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16409 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16410
16411 2008-07-03 Ian Lance Taylor <iant@google.com>
16412
16413 * layout.cc (Layout::include_section): Do not discard unrecognized
16414 SHT_STRTAB sections.
16415
16416 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16417
16418 * script.cc (Lex::can_continue_name): Make '?' allowable in
16419 version-script names.
16420 * testsuite/version_script.map: Change glob pattern to use '?'
16421
16422 2008-06-30 Manish Singh <yosh@gimp.org>
16423
16424 PR 6585
16425 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16426 Correct typo.
16427
16428 2008-06-30 Ian Lance Taylor <iant@google.com>
16429
16430 PR 6660
16431 PR 6682
16432 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16433 versions]: Don't try to read the value in the contents, since we
16434 don't use it. Use the template endianness when writing.
16435
16436 2008-06-25 Cary Coutant <ccoutant@google.com>
16437
16438 * fileread.cc (File_read::make_view): Assert on zero-length view.
16439 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16440 symbol table when there are no symbols to read.
16441
16442 2008-06-23 Craig Silverstein <csilvers@google.com>
16443
16444 * version.cc (version_string): Bump to 1.7
16445
16446 2008-06-18 Craig Silverstein <csilvers@google.com>
16447
16448 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16449 constant 0xFFFF to type Valtype.
16450 (Powerpc_relocate_functions::rel16_ha): Likewise.
16451
16452 2008-06-17 Ian Lance Taylor <iant@google.com>
16453
16454 * output.h (Output_section::Input_section): Initialize p2align_ to
16455 zero for Output_section_data constructors.
16456 (Output_section::Input_section::addralign): If not an input
16457 section, return the alignment of the Output_section_data.
16458 * testsuite/copy_test.cc: New file.
16459 * testsuite/copy_test_1.cc: New file.
16460 * testsuite/copy_test_2.cc: New file.
16461 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16462 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16463 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16464 (copy_test_1_pic.o, copy_test_1.so): New targets.
16465 (copy_test_2_pic.o, copy_test_2.so): New targets.
16466 * testsuite/Makefile.in: Rebuild.
16467
16468 * script-sections.cc (Script_sections::place_orphan): Initialize
16469 local variable exact.
16470
16471 2008-06-13 David Edelsohn <edelsohn@gnu.org>
16472
16473 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16474
16475 2008-06-12 David Edelsohn <edelsohn@gnu.org>
16476 David S. Miller <davem@davemloft.net>
16477
16478 * powerpc.cc: New file.
16479 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16480 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16481 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16482 * Makefile.in: Rebuild.
16483
16484 2008-06-09 Ian Lance Taylor <iant@google.com>
16485
16486 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16487 <exception>.
16488 (throwing, orig_terminate): New static variables.
16489 (terminate_handler): New static function.
16490 (t2): Set terminate handler.
16491
16492 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16493
16494 PR 6584
16495 * binary.cc (Binary_to_elf::sized_convert): Fix .data
16496 alignment.
16497
16498 2008-05-30 Cary Coutant <ccoutant@google.com>
16499
16500 * archive.cc (Archive::include_all_members) Correct to step
16501 over symbol table and extended name table in thin archives.
16502
16503 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16504
16505 PR 6407
16506 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16507 calculation.
16508
16509 2008-05-28 Caleb Howe <cshowe@google.com>
16510
16511 * reduced_debug_output.cc: New file.
16512 * reduced_debug_output.h: New file.
16513 * options.h (class General_options): Add --strip-debug-non-line.
16514 * options.cc (General_options::finalize): Add strip_debug_non_line
16515 to the strip heirarchy.
16516 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16517 fields.
16518 * layout.cc: Include "reduced_debug_output.h".
16519 (Layout::Layout): Initialize new fields.
16520 (line_only_debug_sections): New static array.
16521 (is_lines_only_debug_sections): New static inline function.
16522 (Layout::include_section): Handle --strip-debug-non-line.
16523 (Layout::make_output_section): If --strip-debug-non-line, build
16524 new output sections for .debug_abbrev and .debug_info.
16525 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16526 gold. Warn about possible overflow.
16527 (read_signed_LEB_128): Likewise.
16528 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16529 (read_signed_LEB_128): Declare.
16530 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16531 (HFILES): Add reduced_debug_output.h.
16532 * Makefile.in: Rebuild.
16533
16534 2008-05-21 Ian Lance Taylor <iant@google.com>
16535
16536 * mapfile.cc: New file.
16537 * mapfile.h: New file.
16538 * options.h (class General_options): Add -M/--print-map and -Map.
16539 * options.cc (General_options::finalize): Make -M equivalent to
16540 -Map -.
16541 * main.cc: Include <cstdio> and "mapfile.h".
16542 (main): Open mapfile if requested.
16543 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16544 constructor. Change caller.
16545 (queue_initial_tasks): Add mapfile parameter. Change caller.
16546 (queue_middle_tasks): Likewise.
16547 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16548 declarations.
16549 * archive.cc: Include "mapfile.h".
16550 (Archive::add_symbols): Add mapfile parameter. Change all
16551 callers. Pass mapfile, symbol, and reason to include_member.
16552 (Archive::include_all_members): Add mapfile parameter. Change all
16553 callers.
16554 (Archive::include_member): Add mapfile, sym, and why parameters.
16555 Change all callers. Report inclusion to map file.
16556 * archive.h: Include "fileread.h".
16557 (class Archive): Update declarations.
16558 (Archive::file): New const method.
16559 (class Add_archive_symbols): Add mapfile_ field. Update
16560 constructor. Change all callers.
16561 * readsyms.h (class Read_symbols): Likewise.
16562 (class Finish_group): Likewise.
16563 (class Read_script): Likewise.
16564 * common.cc: Include "mapfile.h".
16565 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16566 all callers.
16567 (Symbol_table::do_allocate_commons): Likewise.
16568 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16569 symbol allocation to mapfile.
16570 * common.h (class Allocate_commons_task): Add mapfile_ field.
16571 Update constructor. Change all callers.
16572 * symtab.h (class Symbol_table): Update declarations.
16573 * layout.cc: Include "mapfile.h".
16574 (Layout_task_runner::run): Print information to mapfile.
16575 (Layout::create_gold_note): Change Output_data_fixed_space to
16576 Output_data_zero_fill.
16577 (Layout::create_build_id): Likewise.
16578 (Layout::print_to_mapfile): New function.
16579 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16580 constructor. Change caller.
16581 (class Layout): Declare print_to_mapfile.
16582 * output.cc (Output_section::Input_section::print_to_mapfile): New
16583 function.
16584 (Output_section::add_input_section): If producing a map, always
16585 add to input_sections_ list.
16586 (Output_section::do_print_to_mapfile): New function.
16587 (Output_segment::print_sections_to_mapfile): New function.
16588 (Output_segment::print_section_list_to_mapfile): New function.
16589 * output.h: Include "mapfile.h".
16590 (Output_data::print_to_mapfile): New function.
16591 (Output_data::do_print_to_mapfile): New virtual function.
16592 (Output_segment_headers::do_print_to_mapfile): New function.
16593 (Output_file_header::do_print_to_mapfile): New function.
16594 (Output_data_const::do_print_to_mapfile): New function.
16595 (class Output_data_const_buffer): Add map_name_ field. Update
16596 constructor. Change all callers. Add do_print_to_mapfile
16597 function.
16598 (class Output_data_fixed_space): Likewise.
16599 (class Output_data_space): Likewise.
16600 (class Output_data_zero_fill): New class.
16601 (Output_data_strtab::do_print_to_mapfile): New function.
16602 (Output_data_reloc_base::do_print_to_mapfile): New function.
16603 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16604 (Output_data_group::do_print_to_mapfile): New function.
16605 (Output_data_got::do_print_to_mapfile): New function.
16606 (Output_data_dynamic::do_print_to_mapfile): New function.
16607 (Output_symtab_xindex::do_print_to_mapfile): New function.
16608 (class Output_section): Declare do_print_to_mapflie. Declare
16609 print_to_mapfile in Input_section.
16610 (class Output_segment): Declare new functions.
16611 * object.h (Sized_relobj::symbol_count): New function.
16612 * script-sections.cc
16613 (Output_section_element_dot_assignment::set_section_addresses):
16614 Change Output_data_fixed_space to Output_data_zero_fill.
16615 (Output_data_expression::do_print_to_mapfile): New function.
16616 * script.cc (read_input_script): Add mapfile parameter. Change
16617 all callers.
16618 * script.h (read_input_script): Update declaration.
16619 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16620 (Eh_frame::do_print_to_mapfile): New function.
16621 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16622 (Output_merge_string::do_print_to_mapfile): New function.
16623 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16624 function.
16625 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16626 function.
16627 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16628 function.
16629 * Makefile.am (CCFILES): Add mapfile.cc.
16630 (HFILES): Add mapfile.h.
16631 * Makefile.in: Rebuild.
16632
16633 2008-05-19 Ian Lance Taylor <iant@google.com>
16634
16635 * options.h (class General_options): Add -z relro.
16636 * layout.cc (Layout::Layout): Initialize relro_segment_.
16637 (Layout::add_output_section_data): Return the output section.
16638 (Layout::make_output_section): Rcognize relro sections and mark
16639 them appropriately.
16640 (Layout::attach_allocated_section_to_segment): Put relro sections
16641 in a PT_GNU_RELRO segment.
16642 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16643 section as relro.
16644 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16645 PT_TLS segments.
16646 (Layout::linkonce_mapping): Map d.rel.ro.local to
16647 .data.rel.ro.local.
16648 (Layout::output_section_name): Us .data.rel.ro.local for any
16649 section which begins with that.
16650 * layout.h (class Layout): Update add_output_section_data
16651 declaration. Add relro_segment_ field.
16652 * output.cc (Output_section::Output_section): Initialize is_relro_
16653 and is_relro_local_ fields.
16654 (Output_segment::add_output_section): Group relro sections.
16655 (Output_segment::is_first_section_relro): New function.
16656 (Output_segment::maximum_alignment): If there is a relro section,
16657 align the segment to the common page size.
16658 (Output_segment::set_section_addresses): Track whether we are
16659 looking at relro sections. If the last section is a relro
16660 section, align to the common page size.
16661 (Output_segment::set_section_list_addresses): Add in_relro
16662 parameter. Change all callers. Align to the page size when
16663 moving from relro to non-relro section.
16664 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16665 segment.
16666 * output.h (class Output_section): Add is_relro_ and
16667 is_relro_local_ fields.
16668 (Output_section::is_relro): New function.
16669 (Output_section::set_is_relro): New function.
16670 (Output_section::is_relro_local): New function.
16671 (Output_section::set_is_relro_local): New function.
16672 (class Output_segment): Update declarations.
16673 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16674 * sparc.cc (Target_sparc::got_section): Likewise.
16675 * x86_64.cc (Target_x86_64::got_section): Likewise.
16676 * testsuite/relro_test_main.cc: New file.
16677 * testsuite/relro_test.cc: New file.
16678 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16679 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16680 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16681 (relro_test.so, relro_test_pic.o): New targets.
16682 * testsuite/Makefile.in: Rebuild.
16683
16684 2008-05-16 Ian Lance Taylor <iant@google.com>
16685
16686 * output.cc (Output_segment::add_output_section): Remove front
16687 parameter.
16688 * output.h (class Output_segment): Remove
16689 add_initial_output_section and overloaded add_output_section.
16690 Update declaration of remaining add_output_section.
16691 * layout.cc (Layout::create_interp): Call add_output_section
16692 rather than add_initial_output_section.
16693 (Layout::finish_dynamic_section): Likewise.
16694
16695 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16696 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16697 know the dynamic type.
16698 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16699 field. Initialize it in constructor.
16700 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16701 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16702 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16703 reloc.
16704
16705 * output.cc (Output_reloc::get_address): Change return type to
16706 Elf_Addr.
16707 * output.h (class Output_reloc): Update get_address declaration.
16708 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16709 for section addresses.
16710
16711 2008-05-09 Ian Lance Taylor <iant@google.com>
16712
16713 PR 6493
16714 * gold.cc (gold_nomem): Use return value of write.
16715
16716 2008-05-08 Ian Lance Taylor <iant@google.com>
16717
16718 * symtab.c (Symbol::init_base_output_data): Add version
16719 parameter. Change all callers.
16720 (Symbol::init_base_output_segment): Likewise.
16721 (Symbol::init_base_constant): Likewise.
16722 (Symbol::init_base_undefined): Likewise.
16723 (Sized_symbol::init_output_data): Likewise.
16724 (Sized_symbol::init_output_segment): Likewise.
16725 (Sized_symbol::init_constant): Likewise.
16726 (Sized_symbol::init_undefined): Likewise.
16727 (Symbol_table::do_define_in_output_data): If the new symbol has a
16728 version, mark it as the default.
16729 (Symbol_table::do_define_in_output_segment): Likewise.
16730 (Symbol_table::do_define_as_constant): Likewise.
16731 * symtab.h (class Symbol): Update declarations.
16732 (class Sized_symbol): Likewise.
16733 * resolve.cc (Symbol::override_version): New function.
16734 (Symbol::override_base): Call override_version.
16735 (Symbol::override_base_with_special): Likewise.
16736 * testsuite/ver_script_8.script: New file.
16737 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16738 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16739 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16740 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16741
16742 2008-05-06 Ian Lance Taylor <iant@google.com>
16743
16744 PR 6049
16745 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16746 functions.
16747 (class General_options): Remove existing --undefined, and add
16748 --no-undefined instead. Add new --undefined as synonym for -u.
16749 * archive.cc (Archive::add_symbols): Check whether symbol was
16750 named with -u.
16751 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16752 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16753 all uses. Add IS_UNDEFINED. Update declarations to split
16754 different versions of init_base. Declare init_base_undefined.
16755 (Symbol::is_defined): Handle IS_UNDEFINED.
16756 (Symbol::is_undefined): Likewise.
16757 (Symbol::is_weak_undefined): Call is_undefined.
16758 (Symbol::is_absolute): Handle IS_CONSTANT.
16759 (class Sized_symbol): Update declarations to split different
16760 versions of init. Declare init_undefined.
16761 (class Symbol_table): Declare new functions.
16762 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16763 Change all callers.
16764 (Symbol::init_base_output_data): Likewise.
16765 (Symbol::init_base_output_segment): Likewise.
16766 (Symbol::init_base_constant): Likewise.
16767 (Symbol::init_base_undefined): New function.
16768 (Sized_symbol::init_object): Rename from init. Change all
16769 callers.
16770 (Sized_symbol::init_output_data): Likewise.
16771 (Sized_symbol::init_output_segment): Likewise.
16772 (Sized_symbol::init_constant): Likewise.
16773 (Sized_symbol::init_undefined): New function.
16774 (Symbol_table::add_undefined_symbols_from_command_line): New
16775 function.
16776 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16777 function.
16778 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16779 (Symbol::output_section): Likewise.
16780 (Symbol::set_output_section): Likewise.
16781 (Symbol_table::sized_finalize_symbol): Likewise.
16782 (Symbol_table::sized_write_globals): Likewise.
16783 * resolve.cc (Symbol_table::should_override): Likewise.
16784 (Symbol::override_base_with_special): Likewise.
16785
16786 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16787 symbol, change it to have default visibility.
16788 * testsuite/protected_1.cc: New file.
16789 * testsuite/protected_2.cc: New file.
16790 * testsuite/protected_3.cc: New file.
16791 * testsuite/protected_main_1.cc: New file.
16792 * testsuite/protected_main_2.cc: New file.
16793 * testsuite/protected_main_3.cc: New file.
16794 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16795 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16796 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16797 (protected_1.so): New target.
16798 (protected_1_pic.o, protected_2_pic.o): New targets.
16799 (protected_3_pic.o): New target.
16800 (check_PROGRAMS): Add protected_2.
16801 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16802 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16803 * testsuite/Makefile.in: Rebuild.
16804
16805 * options.h (DEFINE_var): Add set_user_set_##varname__.
16806 (DEFINE_bool_alias): New macro.
16807 (class General_options): Define -Bstatic using DEFINE_bool_alias
16808 rather than DEFINE_special. Add --undefined as an alias for -z
16809 defs.
16810 * options.cc (General_options::parse_Bstatic): Remove.
16811
16812 * options.h (class General_options): Add --fatal-warnings.
16813 * main.cc (main): Implement --fatal-warnings.
16814 * errors.h (Errors::warning_count): New function.
16815
16816 * options.h (class General_options): Add -Bsymbolic-functions.
16817 * symtab.h (Symbol::is_preemptible): Check for
16818 -Bsymbolic-functions.
16819
16820 2008-05-05 Ian Lance Taylor <iant@google.com>
16821
16822 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16823 as noVARNAME rather than no-VARNAME.
16824 (class General_options): Add option -z combreloc.
16825 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16826 get_address.
16827 (Output_reloc::sort_before) [SHT_REL]: New function.
16828 (Output_reloc::sort_before) [SHT_RELA]: New function.
16829 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16830 Sort_relocs_comparison.
16831 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16832 parameter. Change all callers.
16833 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16834 sort_relocs parameter. Change all callers.
16835 * output.cc (Output_reloc::get_address): New function, broken out
16836 of write_rel.
16837 (Output_reloc::write_rel): Call it.
16838 (Output_reloc::compare): New function.
16839 (Output_data_reloc_base::do_write): Optionally sort relocs.
16840
16841 * configure.ac: If targ_extra_obj is set, link it in.
16842 * configure.tgt: Initialize all variables.
16843 (x86_64*): Set targ_extra_obj and targ_extra_size.
16844 * configure: Rebuild.
16845
16846 * object.cc (Sized_relobj::include_section_group): Adjust section
16847 indexes read from group data. Build vector to pass to
16848 layout_group.
16849 * layout.cc (Layout::layout_group): Add flags and shndxes
16850 parameters. Remove contents parameter. Change caller. Update
16851 explicit instantiations.
16852 * layout.h (class Layout): Update layout_group declaration.
16853 * output.cc (Output_data_group::Output_data_group): Add flags and
16854 input_shndxes parameters. Remove contents parameter. Change
16855 caller.
16856 (Output_data_group::do_write): Change input_sections_ to
16857 input_shndxes_.
16858 * output.h (class Output_data_group): Update constructor
16859 declaration. Rename input_sections_ to input_shndxes_.
16860 * testsuite/many_sections_test.cc: Add template.
16861
16862 2008-04-30 Cary Coutant <ccoutant@google.com>
16863
16864 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16865
16866 * layout.cc (Layout::include_section): Refactored check for debug
16867 info section.
16868 (Layout::add_comdat): Add new parameters. Change type
16869 of signature parameter. Add object and shndx to signatures table.
16870 (Layout::find_kept_object): New function.
16871 * layout.h: Include <cstring>.
16872 (Layout::is_debug_info_section): New function.
16873 (Layout::add_comdat): Add new parameters.
16874 (Layout::find_kept_object): New function.
16875 (Layout::Kept_section): New struct.
16876 (Layout::Signatures): Change type of map range.
16877 * object.cc (Relobj::output_section_address): New function.
16878 (Sized_relobj::include_section_group): Add new parameters. Change
16879 calls to Layout::add_comdat. Change to build table of kept comdat
16880 groups and table mapping discarded sections to kept sections.
16881 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16882 (Sized_relobj::do_layout): Change calls to include_section_group and
16883 include_linkonce_section.
16884 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16885 value to zero when section is discarded.
16886 (Sized_relobj::map_to_kept_section): New function.
16887 * object.h (Relobj::output_section_address): New function.
16888 (Relobj::Comdat_group): New type.
16889 (Relobj::find_comdat_group): New function.
16890 (Relobj::Comdat_group_table): New type.
16891 (Relobj::Kept_comdat_section): New type.
16892 (Relobj::Kept_comdat_section_table): New type.
16893 (Relobj::add_comdat_group): New function.
16894 (Relobj::set_kept_comdat_section): New function.
16895 (Relobj::get_kept_comdat_section): New function.
16896 (Relobj::comdat_groups_): New field.
16897 (Relobj::kept_comdat_sections_): New field.
16898 (Symbol_value::input_value): Update comment.
16899 (Sized_relobj::map_to_kept_section) New function.
16900 (Sized_relobj::include_linkonce_section): Add new parameter.
16901 * target-reloc.h (Comdat_behavior): New type.
16902 (get_comdat_behavior): New function.
16903 (relocate_section): Add code to map a discarded section to the
16904 corresponding kept section when applying a relocation.
16905
16906 2008-04-30 Craig Silverstein <csilvers@google.com>
16907
16908 * dwarf_reader.cc (next_generation_count): New static var.
16909 (Addr2line_cache_entry): New struct.
16910 (addr2line_cache): New static var.
16911 (Dwarf_line_info::one_addr2line): Added caching.
16912 (Dwarf_line_info::clear_addr2line_cache): New function.
16913 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16914 cache-size parameter.
16915 (Dwarf_line_info::one_addr2line_cache): New function.
16916 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16917 new cache-size argument to one_addr2line(), and clear cache.
16918
16919 2008-04-28 Cary Coutant <ccoutant@google.com>
16920
16921 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16922 R_386_PC8 relocations.
16923
16924 2008-04-23 Ian Lance Taylor <iant@google.com>
16925
16926 * object.cc (Sized_relobj::include_section_group): Check for
16927 invalid section group.
16928
16929 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16930 header size.
16931
16932 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16933 than read for file header.
16934 * archive.cc (Archive::include_member): Likewise.
16935
16936 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16937
16938 * aclocal.m4: Regenerate.
16939 * configure: Regenerate.
16940
16941 2008-04-19 Ian Lance Taylor <iant@google.com>
16942
16943 * version.cc (version_string): Bump to 1.6.
16944
16945 * testsuite/Makefile.am (many_sections_r_test): New target.
16946 (many_sections_r_test_SOURCES): Remove.
16947 (many_sections_r_test_DEPENDENCIES): Remove.
16948 (many_sections_r_test_LDFLAGS): Remove.
16949 (many_sections_r_test_LDADD): Remove.
16950
16951 * object.cc (Sized_relobj::do_add_symbols): Always pass
16952 local_symbol_count_ to add_from_relobj.
16953
16954 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16955 every thousand variables.
16956 * testsuite/Makefile.in: Rebuild.
16957
16958 * object.cc (Xindex::initialize_symtab_xindex): New function.
16959 (Xindex::read_symtab_xindex): New function.
16960 (Xindex::sym_xindex_to_shndx): New function.
16961 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16962 available.
16963 (Sized_relobj::do_initialize_xindex): New function.
16964 (Sized_relobj::do_read_symbols): Adjust section links.
16965 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16966 parameter. Change all callers.
16967 (Sized_relobj::include_section_group): Adjust section links and
16968 symbol section indexes.
16969 (Sized_relobj::do_layout): Adjust section links.
16970 (Sized_relobj::do_count_local_symbols): Adjust section links and
16971 symbol section indexes.
16972 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16973 ordinary and special symbols.
16974 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16975 dynsym_xindex parameters. Change all callers. Adjust section
16976 links. Use SHN_XINDEX when needed.
16977 (Sized_relobj::get_symbol_location_info): Adjust section links.
16978 Don't get fooled by special symbols.
16979 * object.h (class Xindex): Define.
16980 (class Object): Add xindex_ parameter. Declare virtual functoin
16981 do_initialize_xindex.
16982 (Object::adjust_sym_shndx): New function.
16983 (Object::set_xindex): New protected function.
16984 (class Symbol_value): Add is_ordinary_shndx_ field.
16985 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16986 (Symbol_value::value): Assert ordinary section.
16987 (Symbol_value::initialize_input_to_output_map): Likewise.
16988 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16989 Change all callers.
16990 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16991 all callers.
16992 (class Sized_relobj): Update declarations.
16993 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16994 parameter. Change all callers.
16995 (Sized_relobj::adjust_shndx): New function.
16996 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16997 field.
16998 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16999 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
17000 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
17001 (Sized_dynobj::read_dynsym_section): Adjust section links.
17002 (Sized_dynobj::read_dynamic): Likewise.
17003 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
17004 section links.
17005 (Sized_dynobj::do_initialize_xindex): New function.
17006 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
17007 do_initialize_xindex.
17008 (Sized_dynobj::adjust_shndx): New function.
17009 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
17010 dynsym_xindex_ fields.
17011 (Layout::finalize): Add a call to set_section_indexes before
17012 creating the symtab sections.
17013 (Layout::set_section_indexes): Don't do anything if the section
17014 already has a section index.
17015 (Layout::create_symtab_sections): Add shnum parameter. Change
17016 caller. Create .symtab_shndx section if needed.
17017 (Layout::create_shdrs): Add shstrtab_section parameter. Change
17018 caller.
17019 (Layout::allocated_output_section_count): New function.
17020 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
17021 needed.
17022 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
17023 fields. Update declarations.
17024 (Layout::symtab_xindex): New function.
17025 (Layout::dynsym_xindex): New function.
17026 (class Write_symbols_task): Add layout_ field.
17027 (Write_symbols_task::Write_symbols_task): Add layout parameter.
17028 Change caller.
17029 * output.cc (Output_section_headers::Output_section_headers): Add
17030 shstrtab_section parameter. Change all callers.
17031 (Output_section_headers::do_sized_write): Store overflow values
17032 for section count and section string table section index in
17033 section header zero.
17034 (Output_file_header::do_sized_write): Check for overflow of
17035 section count and section string table section index.
17036 (Output_symtab_xindex::do_write): New function.
17037 (Output_symtab_xindex::endian_do_write): New function.
17038 * output.h (class Output_section_headers): Add shstrtab_section_.
17039 Update declarations.
17040 (class Output_symtab_xindex): Define.
17041 (Output_section::has_out_shndx): New function.
17042 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
17043 field.
17044 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
17045 Change all callers.
17046 (Sized_symbol::init): Likewise.
17047 (Symbol::output_section): Check for ordinary symbol.
17048 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
17049 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
17050 callers.
17051 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
17052 Change all callers. Simplify handling of symbols from sections
17053 not included in the link.
17054 (Symbol_table::add_from_dynobj): Handle ordinary symbol
17055 distinction.
17056 (Weak_alias_sorter::operator()): Assert that symbols are
17057 ordinary.
17058 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
17059 distinction.
17060 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
17061 parameters. Change all callers.
17062 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
17063 symbol distinction. Use SHN_XINDEX when needed.
17064 (Symbol_table::write_section_symbol): Add symtab_xindex
17065 parameter. Change all callers.
17066 (Symbol_table::sized_write_section_symbol): Likewise. Use
17067 SHN_XINDEX when needed.
17068 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
17069 declarations.
17070 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
17071 (Symbol::is_defined): Check is_ordinary.
17072 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
17073 (Symbol::is_absolute, Symbol::is_common): Likewise.
17074 (class Sized_symbol): Update declarations.
17075 (class Symbol_table): Update declarations.
17076 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
17077 parameters. Change all callers.
17078 (Sized_symbol::override): Likewise.
17079 (Symbol_table::override): Likewise.
17080 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
17081 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
17082 is_ordinary, and orig_st_shndx parameters. Change all callers.
17083 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
17084 to be in an ordinary section.
17085 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
17086 object and is_ordinary parameters. Change all callers.
17087 (Sized_dwarf_line_info::read_relocs): Add object parameter.
17088 Change all callers. Don't add undefined or non-ordinary symbols
17089 to reloc_map_.
17090 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
17091 Change all callers.
17092 * dwarf_reader.h (class Sized_dwarf_line_info): Update
17093 declarations.
17094 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
17095 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
17096 (Sized_relobj::relocate_sections): Likewise.
17097 * target-reloc.h (scan_relocs): Adjust section symbol index.
17098 (scan_relocatable_relocs): Likewise.
17099 * i386.cc (Scan::local): Check for ordinary symbols.
17100 * sparc.cc (Scan::local): Likewise.
17101 * x86_64.cc (Scan::local): Likewise.
17102 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
17103 to symbol_section_and_value.
17104 * testsuite/many_sections_test.cc: New file.
17105 * testsuite/Makefile.am (BUILT_SOURCES): Define.
17106 (check_PROGRAMS): Add many_sections_test.
17107 (many_sections_test_SOURCES): Define.
17108 (many_sections_test_DEPENDENCIES): Define.
17109 (many_sections_test_LDFLAGS): Define.
17110 (BUILT_SOURCES): Add many_sections_define.h.
17111 (many_sections_define.h): New target.
17112 (BUILT_SOURCES): Add many_sections_check.h.
17113 (many_sections_check.h): New target.
17114 (check_PROGRAMS): Add many_sections_r_test.
17115 (many_sections_r_test_SOURCES): Define.
17116 (many_sections_r_test_DEPENDENCIES): Define.
17117 (many_sections_r_test_LDFLAGS): Define.
17118 (many_sections_r_test_LDADD): Define.
17119 (many_sections_r_test.o): New target.
17120 * testsuite/Makefile.in: Rebuild.
17121
17122 2008-04-17 Cary Coutant <ccoutant@google.com>
17123
17124 * errors.cc (Errors::info): New function.
17125 (gold_info): New function.
17126 * errors.h (Errors::info): New function.
17127 * gold.h (gold_info): New function.
17128 * object.cc (Input_objects::add_object): Print trace output.
17129 * options.cc (options::parse_set): New function.
17130 (General_options::parse_wrap): Deleted.
17131 (General_options::General_options): Deleted initializer.
17132 * options.h (options::String_set): New typedef.
17133 (options::parse_set): New function.
17134 (DEFINE_set): New macro.
17135 (General_options::wrap): Changed to use DEFINE_set. Changed
17136 callers of any_wrap_symbols and is_wrap_symbol.
17137 (General_options::trace, General_options::trace_symbol):
17138 New options.
17139 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
17140 (General_options::wrap_symbols_): Deleted.
17141 * symtab.cc (Symbol_table::add_from_object): Print trace output.
17142
17143 2008-04-17 David S. Miller <davem@davemloft.net>
17144
17145 * options.cc (General_options::parse_V): New function.
17146 * options.h: Add entries for -V and -Qy.
17147
17148 2008-04-17 Ian Lance Taylor <iant@google.com>
17149
17150 * common.cc (Symbol_table::allocate_commons): Remove options
17151 parameter. Change caller.
17152 (Symbol_table::do_allocate_commons): Remove options parameter.
17153 Change caller. Just call do_allocate_commons_list twice.
17154 (Symbol_table::do_allocate_commons_list): New function, broken out
17155 of do_allocate_commons.
17156 * common.h (class Allocate_commons_task): Remove options_ field.
17157 Update constructor.
17158 * symtab.cc (Symbol_table::Symbol_table): Initialize
17159 tls_commons_.
17160 (Symbol_table::add_from_object): Put TLS common symbols on
17161 tls_commons_ list.
17162 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
17163 which are IN_OUTPUT_DATA.
17164 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
17165 allocate_commons and do_allocate_commons declarations. Declare
17166 do_allocate_commons_list.
17167 * gold.cc (queue_middle_tasks): Update creation of
17168 Allocate_commons_task to not pass options.
17169 * testsuite/Makefile.am (INCLUDES): Add -I.. .
17170 (TLS_TEST_C_FLAGS): New variable.
17171 (tls_test_c_pic.o): New target.
17172 (tls_test_shared.so): Link in tls_test_c_pic.o.
17173 (tls_test_c_pic_ie.o): New target.
17174 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
17175 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
17176 (tls_test_c.o): New target.
17177 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
17178 (tls_pic_test_LDADD): Likewise.
17179 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
17180 (tls_shared_gd_to_ie_test_LDADD): Likewise.
17181 (tls_test_c_gnu2.o): New target.
17182 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
17183 tls_test_c_gnu2.o.
17184 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17185 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17186 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17187 * testsuite/tls_test.cc: Include "config.h".
17188 (t_last): Call t11_last.
17189 * testsuite/tls_test.h (t11, t11_last): Declare.
17190 * testsuite/tls_test_c.c: New file.
17191 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17192 * configure.ac: Check for OpenMP support.
17193 * configure, config.in, Makefile.in: Rebuild.
17194 * testsuite/Makefile.in: Rebuild.
17195
17196 2008-04-16 Cary Coutant <ccoutant@google.com>
17197
17198 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17199 (Target_i386::tls_base_symbol_defined_): New field.
17200 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17201 (Target_i386::Scan::global): Likewise.
17202 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17203 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17204 (Target_x86_64::tls_base_symbol_defined_): New field.
17205 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17206 (Target_x86_64::Scan::global): Likewise.
17207
17208 2008-04-16 Cary Coutant <ccoutant@google.com>
17209
17210 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17211 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17212 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17213 building shared libraries.
17214 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17215 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17216 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17217 * testsuite/Makefile.in: Rebuild.
17218 * testsuite/weak_undef.h: New file.
17219 * testsuite/weak_undef_file1.cc: Add extra test cases.
17220 * testsuite/weak_undef_file2.cc: Likewise.
17221 * testsuite/weak_undef_test.cc: Likewise.
17222
17223 2008-04-16 David S. Miller <davem@davemloft.net>
17224
17225 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17226 Add issued_non_pic_error_ field. Declare check_non_pic.
17227 (Target_sparc::Scan::check_non_pic): New function.
17228 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17229 (Target_sparc::Scan::global): Likewise.
17230
17231 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17232 * configure: Rebuild.
17233
17234 * options.h (DEFINE_enable): New macro.
17235 (new_dtags): New enable option.
17236 (initfirst, interpose, loadfltr, nodefaultlib,
17237 nodelete, nodlopen, nodump): New -z options.
17238 * layout.cc (Layout:finish_dynamic_section): If new
17239 dtags enabled, emit DT_RUNPATH. Also, emit a
17240 DT_FLAGS_1 containing any specified -z flags.
17241
17242 2008-04-16 Ian Lance Taylor <iant@google.com>
17243
17244 * copy-relocs.cc: New file.
17245 * copy-relocs.h: New file.
17246 * reloc.cc: Remove Copy_relocs code.
17247 * reloc.h: Likewise.
17248 * reloc-types.h (struct Reloc_types) [both versions]: Add
17249 get_reloc_addend_noerror.
17250 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17251 variants of add_global which take an addend which must be zero.
17252 * i386.cc: Include "copy-relocs.h".
17253 (class Target_i386): Change type of copy_relocs_ to variable,
17254 update initializer.
17255 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17256 Change all callers.
17257 (Target_i386::do_finalize_sections): Change handling of
17258 copy_relocs_.
17259 * sparc.cc: Include "copy-relocs.h".
17260 (class Target_sparc): Change type of copy_relocs_ to variable,
17261 update initializer.
17262 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17263 Change all callers.
17264 (Target_sparc::do_finalize_sections): Change handling of
17265 copy_relocs_.
17266 * x86_64.cc: Include "copy-relocs.h".
17267 (class Target_x86_64): Change type of copy_relocs_ to variable,
17268 update initializer.
17269 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17270 class. Change all callers.
17271 (Target_x86_64::do_finalize_sections): Change handling of
17272 copy_relocs_.
17273 * Makefile.am (CCFILES): Add copy-relocs.cc.
17274 (HFILES): Add copy-relocs.h.
17275
17276 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17277
17278 * testsuite/script_test_4.sh: Permit leading zeroes.
17279
17280 2008-04-15 Ian Lance Taylor <iant@google.com>
17281
17282 * script-sections.cc (Script_sections::create_segments): Use
17283 header_size_adjustment even when there is enough room for the
17284 headers.
17285 * testsuite/script_test_4.sh: New file.
17286 * testsuite/script_test_4.t: New file.
17287 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17288 (check_DATA): Add script_test_4.stdout.
17289 (MOSTLYCLEANFILES): Likewise.
17290 (script_test_4): New target.
17291 (script_test_4.stdout): New target.
17292 * testsuite/Makefile.in: Rebuild.
17293
17294 * sparc.cc: Add definitions for Output_data_plt_sparc class
17295 constants.
17296
17297 2008-04-14 David S. Miller <davem@davemloft.net>
17298
17299 * sparc.cc: New file.
17300 * Makefile.am (TARGETSOURCES): Add sparc.cc
17301 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17302 * configure.tgt: Document targ_extra_size and
17303 targ_extra_big_endian. Add entries for sparc-* and
17304 sparc64-*.
17305 * configure.ac: Handle targ_extra_size and
17306 targ_extra_big_endian.
17307 * Makefile.in: Rebuild.
17308 * configure: Likewise.
17309 * po/POTFILES.in: Likewise.
17310 * po/gold.pot: Likewise.
17311
17312 2008-04-14 Ian Lance Taylor <iant@google.com>
17313
17314 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17315 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17316 in the name/type/flags to section mapping. Don't call
17317 allocate_output_section.
17318 (Layout::choose_output_section): Change parameter from adjust_name
17319 to is_input_section. Don't permit input sections after sections
17320 are attached to segments. Don't call allocate_output_section.
17321 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17322 not write_enable_output_section.
17323 (Layout::make_output_section): Don't push to
17324 unattached_section_list_ nor call attach_to_segment. Call
17325 attach_section_to_segment if sections are attached.
17326 (Layout::attach_sections_to_segments): New function.
17327 (Layout::attach_section_to_segment): New function.
17328 (Layout::attach_allocated_section_to_segment): Rename from
17329 attach_to_segment. Remove flags parameter.
17330 (Layout::allocate_output_section): Remove function.
17331 (Layout::write_enable_output_section): Remove function.
17332 * layout.h (class Layout): Update for above changes. Add new
17333 field sections_are_attached_.
17334 * output.h (Output_section::update_flags_for_input_section): New
17335 function.
17336 * output.cc (Output_section::add_input_section): Call
17337 update_flags_for_input_section.
17338 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17339
17340 2008-04-11 Cary Coutant <ccoutant@google.com>
17341
17342 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17343 thought unnecessary.
17344 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17345
17346 2008-04-11 Ian Lance Taylor <iant@google.com>
17347
17348 * output.h (class Output_section_data): Remove inline definition
17349 of set_addralign.
17350 * output.cc (Output_section_data::set_addralign): New function.
17351
17352 2008-04-11 Cary Coutant <ccoutant@google.com>
17353
17354 Add support for TLS descriptors for i386 and x86_64.
17355 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17356 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17357 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17358 GOT_TYPE_TLS_DESC.
17359 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17360 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17361 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17362 relocations.
17363 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17364 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17365 Fix problem with initial-exec relocations.
17366 (Target_i386::Relocate::relocate_tls): Likewise.
17367 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17368 relaxation.
17369 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17370 support for section-plus-offset dynamic table entries.
17371 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17372 (Output_data_dynamic::Dynamic_entry): Add support for
17373 section-plus-offset dynamic table entries.
17374 (Output_data_dynamic::Classification): Likewise.
17375 (Output_data_dynamic::classification_): Renamed offset_.
17376 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17377 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17378 (Target_x86_64::make_plt_section): New function.
17379 (Target_x86_64::reserve_tlsdesc_entries): New function.
17380 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17381 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17382 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17383 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17384 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17385 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17386 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17387 add extra PLT entry for TLS descriptors.
17388 (Output_data_plt_x86_64::got_): New field.
17389 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17390 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17391 fields.
17392 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17393 descriptors.
17394 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17395 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17396 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17397 R_386_TLS_DESC_CALL relocations.
17398 (Target_x86_64::Scan::global): Likewise.
17399 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17400 for TLS descriptors.
17401 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17402 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17403 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17404 GD-to-IE relaxation.
17405 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17406 and TLS_DESCRIPTORS.
17407 * Makefile.in: Rebuild.
17408 * configure: Rebuild.
17409 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17410 (tls_test_shared2.so): New target.
17411 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17412 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17413 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17414 (tls_shared_gd_to_ie_test_LDADD): New variable.
17415 (tls_shared_gnu2_gd_to_ie_test): New target.
17416 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17417 New targets.
17418 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17419 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17420 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17421 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17422 (tls_shared_gnu2_test): New target.
17423 (tls_test_gnu2_shared.so): New target.
17424 (tls_shared_gnu2_test_SOURCES): New variable.
17425 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17426 (tls_shared_gnu2_test_LDFLAGS): New variable.
17427 (tls_shared_gnu2_test_LDADD): New variable.
17428 * testsuite/Makefile.in: Rebuild.
17429 * testsuite/Makefile.
17430
17431 2008-04-11 Ian Lance Taylor <iant@google.com>
17432
17433 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17434 justsyms.t.
17435 * testsuite/Makefile.in: Rebuild.
17436
17437 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17438 long.
17439 * testsuite/script_test_2.cc (main): Adjust test.
17440
17441 2008-04-11 David S. Miller <davem@davemloft.net>
17442 Ian Lance Taylor <iant@google.com>
17443
17444 * options.h (General_options): Add entries for '-Y' and
17445 '-relax'.
17446 * options.cc (General_options:finalize): If -Y was used, add those
17447 entries to the library path instead of the default "/lib" and
17448 "/usr/lib".
17449
17450 2008-04-11 David S. Miller <davem@davemloft.net>
17451
17452 * testsuite/justsyms.t: Start at 0x100.
17453 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
17454 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17455 long.
17456 * testsuite/script_test_2.cc: Adjust string and section length
17457 checks.
17458
17459 2008-04-09 Ian Lance Taylor <iant@google.com>
17460
17461 PR gold/5996
17462 * script-sections.cc (Sections_element::allocate_to_segment): Add
17463 orphan parameter.
17464 (Output_section_definition::allocate_to_segment): Likewise.
17465 (Orphan_output_section::allocate_to_segment): Likewise.
17466 (Script_sections::attach_sections_using_phdrs_clause): Don't
17467 propagate non-PT_LOAD segments to orphan sections.
17468 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17469 readelf rather than objdump.
17470 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17471 .interp section and PT_INTERP segment are the same size.
17472 * testsuite/Makefile.in: Rebuild.
17473
17474 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17475 aliases for symbols defined in the same object.
17476 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17477 (weak_alias_test_SOURCES): New variable.
17478 (weak_alias_test_DEPENDENCIES): New variable.
17479 (weak_alias_test_LDFLAGS): New variable.
17480 (weak_alias_test_LDADD): New variable.
17481 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17482 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17483 (weak_alias_test_3.o): New target.
17484 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17485 * testsuite/weak_alias_test_main.cc: New file.
17486 * testsuite/weak_alias_test_1.cc: New file.
17487 * testsuite/weak_alias_test_2.cc: New file.
17488 * testsuite/weak_alias_test_3.cc: New file.
17489
17490 2008-04-08 Ian Lance Taylor <iant@google.com>
17491
17492 * options.h (class General_options): Add --noinhibit-exec option.
17493 * main.cc (main): Check --noinhibit-exec.
17494
17495 * options.h (class General_options): Define --wrap as a special
17496 option. Add wrap_symbols_ field.
17497 (General_options::any_wrap_symbols): New function.
17498 (General_options::is_wrap_symbol): New function.
17499 * options.cc (General_options::parse_wrap): New function.
17500 (General_options::General_options): Initialize wrap_symbols_.
17501 * symtab.cc (Symbol_table::wrap_symbol): New function.
17502 (Symbol_table::add_from_object): Handle --wrap.
17503 * symtab.h (class Symbol_table): Declare wrap_symbol.
17504 * target.h (Target::wrap_char): New function.
17505 (Target::Target_info): Add wrap_char field.
17506 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17507 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17508 * testsuite/testfile.cc (Target_test::test_target_info):
17509 Likewise.
17510
17511 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17512 there is one.
17513
17514 * layout.h (class Layout): Add added_eh_frame_data_ field.
17515 * layout.cc (Layout::Layout): Initialize new field.
17516 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17517 output section until we find a section we merged successfully.
17518 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17519 that the size be non-zero.
17520
17521 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17522 qualifier.
17523
17524 2008-04-08 Craig Silverstein <csilvers@google.com>
17525
17526 * configure.ac: Export new conditional variable HAVE_ZLIB.
17527 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17528 on HAVE_ZLIB.
17529 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17530 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17531
17532 2008-04-07 Ian Lance Taylor <iant@google.com>
17533
17534 * version.cc (version_string): Set to "1.5".
17535
17536 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17537 Add issued_non_pic_error_ field. Declare check_non_pic.
17538 (Target_x86_64::Scan::check_non_pic): New function.
17539 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17540 (Target_x86_64::Scan::global): Likewise.
17541
17542 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17543 addend parameter. Change caller. Handle merge sections.
17544 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17545 Address to Addend. Don't add in the result of
17546 local_section_offset, pass down the addend and use the returned
17547 value.
17548 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17549 Update declarations of local_section_offset and symbol_value.
17550 * testsuite/two_file_test_1.cc (t18): New function.
17551 * testsuite/two_file_test_2.cc (f18): New function.
17552 * testsuite/two_file_test_main.cc (main): Call t18.
17553 * testsuite/two_file_test.h (t18, f18): Declare.
17554
17555 * configure.ac: Don't test for objdump, c++filt, or readelf.
17556 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17557 conditionals.
17558 (TEST_READELF): New variable.
17559 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17560 (check_PROGRAMS): Add two_file_strip_test.
17561 (two_file_strip_test): New target.
17562 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17563 (two_file_same_shared_strip_test_SOURCES): New variable.
17564 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17565 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17566 (two_file_same_shared_strip_test_LDADD): New variable.
17567 (two_file_shared_strip.so): New target.
17568 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17569 (ver_test_5.syms, ver_test_7.syms): Likewise.
17570 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17571 (strip_test_3.stdout): Use TEST_OBJDUMP.
17572 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17573
17574 2008-04-04 Cary Coutant <ccoutant@google.com>
17575
17576 * symtab.h (Symbol::is_weak_undefined): New function.
17577 (Symbol::is_strong_undefined): New function.
17578 (Symbol::is_absolute): New function.
17579 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17580 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17581 absolute symbols.
17582 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17583 (weak_undef_test): New target.
17584 * testsuite/Makefile.in: Rebuild.
17585 * testsuite/weak_undef_file1.cc: New file.
17586 * testsuite/weak_undef_file2.cc: New file.
17587 * testsuite/weak_undef_test.cc: New file.
17588
17589 2008-04-03 Craig Silverstein <csilvers@google.com>
17590
17591 * compressed_output.h (class Output_compressed_section): Use
17592 unsigned buffer.
17593 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17594 add zlib header.
17595 (zlib_compressed_suffix): Removed.
17596 (Output_compressed_section::set_final_data_size): Use unsigned
17597 buffers.
17598 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17599 Fix linker invocation.
17600 (flagstest_o_specialfile_and_compress_debug_sections):
17601 Likewise.
17602 * testsuite/Makefile.in: Regenerated.
17603
17604 2008-04-02 David S. Miller <davem@davemloft.net>
17605
17606 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17607 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17608
17609 2008-04-02 Craig Silverstein <csilvers@google.com>
17610
17611 * TODO: New file.
17612
17613 2008-04-02 Ian Lance Taylor <iant@google.com>
17614
17615 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17616 parameters. Update for new key type to views_. Change all
17617 callers.
17618 (File_read::read): Adjust for byteshift in returned view.
17619 (File_read::add_view): New function, broken out of
17620 find_and_make_view.
17621 (File_read::make_view): New function, broken out of
17622 find_and_make_view.
17623 (File_read::find_or_make_view): Add offset and aligned
17624 parameters. Rewrite accordingly. Change all callers.
17625 (File_read::get_view): Add offset and aligned parameters. Adjust
17626 for byteshift in return value.
17627 (File_read::get_lasting_view): Likewise.
17628 * fileread.h (class File_read): Update declarations.
17629 (class File_read::View): Add byteshift_ field. Add byteshift to
17630 constructor. Add byteshift method.
17631 * archive.h (Archive::clear_uncached_views): New function.
17632 (Archive::get_view): Add aligned parameter. Change all callers.
17633 * object.h (Object::get_view): Add aligned parameter. Change all
17634 callers.
17635 (Object::get_lasting_view): Likewise.
17636
17637 * fileread.cc (File_read::release): Don't call clear_views if
17638 there are multiple objects.
17639 * fileread.h (File_read::clear_uncached_views): New function.
17640 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17641 on the archive.
17642
17643 2008-03-31 Cary Coutant <ccoutant@google.com>
17644
17645 Add thin archive support.
17646 * archive.cc (Archive::armagt): New const.
17647 (Archive::setup): Remove task parameter and calls to unlock.
17648 (Archive::unlock_nested_archives): New function.
17649 (Archive::read_header): Add nested_off parameter. Change
17650 all callers.
17651 (Archive::interpret_header): Likewise.
17652 (Archive::include_all_members): Change to handle thin
17653 archives.
17654 (Archive::include_member): Likewise.
17655 * archive.h (Archive::Archive): Add new parameters and
17656 initializers.
17657 (Archive::armagt): New const.
17658 (Archive::setup): Remove task parameter.
17659 (Archive::unlock_nested_archives): New function.
17660 (Archive::read_header): Add nested_off parameter.
17661 (Archive::interpret_header): Likewise.
17662 (Archive::Nested_archive_table): New typedef.
17663 (Archive::is_thin_archive_): New field.
17664 (Archive::nested_archives_): New field.
17665 (Archive::options_): New field.
17666 (Archive::dirpath_): New field.
17667 (Archive::task_): New field.
17668 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17669 for thin archives. Pass additional parameters to
17670 Archive::Archive. Unlock the archive file after calling
17671 Archive::setup.
17672
17673 2008-03-29 Ian Lance Taylor <iant@google.com>
17674
17675 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17676 version symbol to be local.
17677 * testsuite/ver_test_4.sh: New file.
17678 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17679 (check_DATA): Add ver_test_4.syms.
17680 (ver_test_4.syms): New target.
17681 * testsuite/Makefile.in: Rebuild.
17682
17683 * output.cc
17684 (Output_section::Input_section_sort_entry::has_priority): New
17685 function.
17686 (Output_section::Input_section_sort_entry::match_file_name): New
17687 function.
17688 (Output_section::Input_section_sort_entry::match_section_name):
17689 Remove.
17690 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17691 Remove.
17692 (Output_section::Input_section_sort_entry::match_section_file):
17693 Remove.
17694 (Output_section::Input_section_sort_compare::operator()): Rewrite
17695 using new Input_section_sort_entry functions. Sort crtbegin and
17696 crtend first. Sort sections with no priority before sections with
17697 a priority.
17698 * testsuite/initpri1.c (d3): Check j != 4.
17699 (cd5): New constructor/destructor function.
17700 (main): Check j != 2.
17701
17702 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17703 new symbol when resolving, don't call set_is_default.
17704 * testsuite/ver_test_7.cc: New file.
17705 * testsuite/ver_test_7.sh: New file.
17706 * testsuite/Makefile.am (ver_test_7.so): New target.
17707 (ver_test_7.o): New target.
17708 (check_SCRIPTS): Add ver_test_7.sh.
17709 (check_DATA): Add ver_test_7.syms.
17710 (ver_test_7.syms): New target.
17711
17712 2008-03-28 Ian Lance Taylor <iant@google.com>
17713
17714 * layout.cc (Layout::layout): If we see an input section with a
17715 name that needs sorting, set the must_sort flag for the output
17716 section.
17717 (Layout::make_output_section): If the name of the output section
17718 indicates that it might require sorting, set the may_sort flag.
17719 * output.h (Output_section::may_sort_attached_input_sections): New
17720 function.
17721 (Output_section::set_may_sort_attached_input_sections): New
17722 function.
17723 (Output_section::must_sort_attached_input_sections): New
17724 function.
17725 (Output_section::set_must_sort_attached_input_sections): New
17726 function.
17727 (class Output_section): Declare Input_section_sort_entry. Define
17728 Input_section_sort_compare. Declare
17729 sort_attached_input_sections. Add new fields:
17730 may_sort_attached_input_sections_,
17731 must_sort_attached_input_sections_,
17732 attached_input_sections_are_sorted_.
17733 * output.cc (Output_section::Output_section): Initialize new
17734 fields.
17735 (Output_section::add_input_section): Add an entry to
17736 input_sections_ if may_sort or must_sort are true.
17737 (Output_section::set_final_data_size): Call
17738 sort_attached_input_sections if necessary.
17739 (Output_section::Input_section_sort_entry): Define new class.
17740 (Output_section::Input_section_sort_compare::operator()): New
17741 function.
17742 (Output_section::sort_attached_input_sections): New function.
17743 * configure.ac: Check whether the compiler supports constructor
17744 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17745 * testsuite/initpri1.c: New file.
17746 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17747 CONSTRUCTOR_PRIORITY.
17748 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17749 (initpri1_LDFLAGS): New variable.
17750 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17751
17752 2008-03-27 Ian Lance Taylor <iant@google.com>
17753
17754 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17755 * testsuite/common_test_1.c: New file.
17756 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17757 (common_test_1_SOURCES): New variable.
17758 (common_test_1_DEPENDENCIES): New variable.
17759 (common_test_1_LDFLAGS): New variable.
17760
17761 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17762 and commons_ correctly when NAME/VERSION does not override
17763 NAME/NULL.
17764 * testsuite/ver_test_6.c: New file.
17765 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17766 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17767 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17768
17769 2008-03-26 Ian Lance Taylor <iant@google.com>
17770
17771 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17772 of an undefined symbol from a version script.
17773 * testsuite/Makefile.am (ver_test_5.so): New target.
17774 (ver_test_5.o): New target.
17775 (check_SCRIPTS): Add ver_test_5.sh.
17776 (check_DATA): Add ver_test_5.syms.
17777 (ver_test_5.syms): New target.
17778 * testsuite/ver_test_5.cc: New file.
17779 * testsuite/ver_test_5.script: New file.
17780 * testsuite/ver_test_5.sh: New file.
17781 * Makefile.in, testsuite/Makefile.in: Rebuild.
17782
17783 PR gold/5986
17784 Fix problems building gold with gcc 4.3.0.
17785 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17786 (gold_error_at_location, gold_warning_at_location): Use it.
17787 * configure.ac: Check whether we can compile and use a template
17788 function with a printf attribute.
17789 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17790 when jumping over bytes.
17791 * object.cc: Instantiate Object::read_section_data.
17792 * debug.h: Include <cstring>
17793 * dwarf_reader.cc: Include <algorithm>
17794 * main.cc: Include <cstring>.
17795 * options.cc: Include <cstring>.
17796 * output.cc: Include <cstring>.
17797 * script.cc: Include <cstring>.
17798 * script.h: Include <string>.
17799 * symtab.cc: Include <cstring> and <algorithm>.
17800 * target-select.cc: Include <cstring>.
17801 * version.cc: Include <string>.
17802 * testsuite/testmain.cc: Include <cstdlib>.
17803 * configure, config.in: Rebuild.
17804
17805 2008-03-25 Ian Lance Taylor <iant@google.com>
17806
17807 * options.cc: Include "../bfd/bfdver.h".
17808 (options::help): Print bug reporting address.
17809
17810 * version.cc (print_version): Adjust output for current value of
17811 BFD_VERSION_STRING.
17812
17813 * NEWS: New file.
17814
17815 * options.cc (options::help): Print list of supported targets.
17816 * target-select.h: Include <vector>.
17817 (class Target_selector): Make machine_, size_, and is_big_endian_
17818 fields const. Add bfd_name_ and instantiated_target_ fields.
17819 (Target_selector::Target_selector): Add bfd_name parameter.
17820 (Target_selector::recognize): Make non-virtual, call
17821 do_recognize.
17822 (Target_selector::recognize_by_name): Make non-virtual, call
17823 do_recognize_by_name.
17824 (Target_selector::supported_names): New function.
17825 (Target_selector::bfd_name): New function.
17826 (Target_selector::do_instantiate_target): New pure virtual
17827 function.
17828 (Target_selector::do_recognize): New virtual function.
17829 (Target_selector::do_recognize_by_name): New virtual function.
17830 (Target_selector::instantiate_target): New private function.
17831 (supported_target_names): Declare.
17832 * target-select.cc (Target_selector::Target_selector): Update for
17833 new parameter and fields.
17834 (select_target_by_name): Check that the name matches before
17835 calling recognize_by_name.
17836 (supported_target_names): New function.
17837 * i386.cc (class Target_selector_i386): Update Target_selector
17838 constructor call. Remove recognize and recognize_by_name. Add
17839 do_instantiate_target.
17840 * x86_64.cc (class Target_selector_x86_64): Likewise.
17841 * testsuite/testfile.cc (class Target_selector_test): Update for
17842 changes to Target_selector.
17843
17844 * README: Rewrite, with some notes on unsupported features.
17845
17846 2008-03-24 Cary Coutant <ccoutant@google.com>
17847
17848 * i386.cc (Target_i386::Got_type): New enum declaration.
17849 (Target_i386::Scan::local): Updated callers of Output_data_got
17850 member functions.
17851 (Target_i386::Scan::global): Likewise.
17852 (Target_i386::Relocate::relocate): Likewise.
17853 (Target_i386::Relocate::relocate_tls): Likewise.
17854 * object.h (Got_offset_list): New class.
17855 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17856 (Sized_relobj::local_got_offset): Likewise.
17857 (Sized_relobj::set_local_got_offset): Likewise.
17858 (Sized_relobj::local_has_tls_got_offset): Removed.
17859 (Sized_relobj::local_tls_got_offset): Removed.
17860 (Sized_relobj::set_local_tls_got_offset): Removed.
17861 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17862 * output.cc (Output_data_got::add_global): Added got_type parameter.
17863 (Output_data_got::add_global_with_rel): Likewise.
17864 (Output_data_got::add_global_with_rela): Likewise.
17865 (Output_data_got::add_global_pair_with_rel): New function.
17866 (Output_data_got::add_global_pair_with_rela): New function.
17867 (Output_data_got::add_local): Added got_type parameter.
17868 (Output_data_got::add_local_with_rel): Likewise.
17869 (Output_data_got::add_local_with_rela): Likewise.
17870 (Output_data_got::add_local_pair_with_rel): New function.
17871 (Output_data_got::add_local_pair_with_rela): New function.
17872 (Output_data_got::add_global_tls): Removed.
17873 (Output_data_got::add_global_tls_with_rel): Removed.
17874 (Output_data_got::add_global_tls_with_rela): Removed.
17875 (Output_data_got::add_local_tls): Removed.
17876 (Output_data_got::add_local_tls_with_rel): Removed.
17877 (Output_data_got::add_local_tls_with_rela): Removed.
17878 * output.h (Output_data_got::add_global): Added got_type parameter.
17879 (Output_data_got::add_global_with_rel): Likewise.
17880 (Output_data_got::add_global_with_rela): Likewise.
17881 (Output_data_got::add_global_pair_with_rel): New function.
17882 (Output_data_got::add_global_pair_with_rela): New function.
17883 (Output_data_got::add_local): Added got_type parameter.
17884 (Output_data_got::add_local_with_rel): Likewise.
17885 (Output_data_got::add_local_with_rela): Likewise.
17886 (Output_data_got::add_local_pair_with_rel): New function.
17887 (Output_data_got::add_local_pair_with_rela): New function.
17888 (Output_data_got::add_global_tls): Removed.
17889 (Output_data_got::add_global_tls_with_rel): Removed.
17890 (Output_data_got::add_global_tls_with_rela): Removed.
17891 (Output_data_got::add_local_tls): Removed.
17892 (Output_data_got::add_local_tls_with_rel): Removed.
17893 (Output_data_got::add_local_tls_with_rela): Removed.
17894 * resolve.cc (Symbol::override_base_with_special): Removed
17895 reference to has_got_offset_ field.
17896 * symtab.cc (Symbol::init_fields): Replaced initialization
17897 of got_offset_ with got_offsets_. Removed initialization
17898 of has_got_offset_
17899 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17900 (Symbol::got_offset): Likewise.
17901 (Symbol::set_got_offset): Likewise.
17902 (Symbol::has_tls_got_offset): Removed.
17903 (Symbol::tls_got_offset): Removed.
17904 (Symbol::set_tls_got_offset): Removed.
17905 (Symbol::got_offset_): Removed.
17906 (Symbol::tls_mod_got_offset_): Removed.
17907 (Symbol::tls_pair_got_offset_): Removed.
17908 (Symbol::got_offsets_): New field.
17909 (Symbol::has_got_offset): Removed.
17910 (Symbol::has_tls_mod_got_offset): Removed.
17911 (Symbol::has_tls_pair_got_offset): Removed.
17912 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17913 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17914 member functions.
17915 (Target_x86_64::Scan::global): Likewise.
17916 (Target_x86_64::Relocate::relocate): Likewise.
17917 (Target_x86_64::Relocate::relocate_tls): Likewise.
17918
17919 2008-03-25 Ben Elliston <bje@au.ibm.com>
17920
17921 * yyscript.y: Fix spelling error in comment.
17922
17923 2008-03-24 Ian Lance Taylor <iant@google.com>
17924
17925 * options.h (class General_options): Define build_id option.
17926 * layout.h (class Layout): Declare write_build_id, create_note,
17927 create_build_id. Add build_id_note_ member.
17928 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17929 "libiberty.h", "md5.h", "sha1.h".
17930 (Layout::Layout): Initialize eh_frame_data_,
17931 eh_frame_hdr_section_, and build_id_note_.
17932 (Layout::finalize): Call create_build_id.
17933 (Layout::create_note): New function, broken out of
17934 Layout::create_gold_note.
17935 (Layout::create_gold_note): Call create_note.
17936 (Layout::create_build_id): New function.
17937 (Layout::write_build_id): New function.
17938 (Close_task_runner::run): Call write_build_id.
17939
17940 * x86_64.cc: Correct license to GPLv3.
17941
17942 2008-03-23 Ian Lance Taylor <iant@google.com>
17943
17944 * options.cc: Include "demangle.h".
17945 (parse_optional_string): New function.
17946 (parse_long_option): Handle takes_optional_argument.
17947 (parse_short_option): Update dash_z initializer. Handle
17948 takes_optional_argument.
17949 (General_options::General_options): Initialize do_demangle_.
17950 (General_options::finalize): Set do_demangle_. Handle demangling
17951 style.
17952 * options.h (parse_optional_string): Declare.
17953 (struct One_option): Add optional_arg field. Update constructor.
17954 Update call constructor calls. Add takes_optional_argument
17955 function.
17956 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17957 (DEFINE_optional_string): Define.
17958 (General_options::demangle): Change from DEFINE_bool to
17959 DEFINE_optional_string.
17960 (General_options::no_demangle): New function.
17961 (General_options::do_demangle): New function.
17962 (General_options::set_do_demangle): New function.
17963 (General_options::execstack_status_): Move definition to end of
17964 class definition.
17965 (General_options::static_): Likewise.
17966 (General_options::do_demangle_): New field.
17967 * object.cc (big_endian>::get_symbol_location_info): Call
17968 Options::do_demangle, not Options::demangle.
17969 * symtab.cc (demangle): Likewise.
17970
17971 2008-03-22 Ian Lance Taylor <iant@google.com>
17972
17973 * gold.h: Include <cstddef> and <sys/types.h>
17974 * options.h: Include <cstring>.
17975
17976 2008-03-21 Ian Lance Taylor <iant@google.com>
17977
17978 * Added source code to GNU binutils.
17979 \f
17980 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17981
17982 Copying and distribution of this file, with or without modification,
17983 are permitted in any medium without royalty provided the copyright
17984 notice and this notice are preserved.
17985
17986 Local Variables:
17987 mode: change-log
17988 left-margin: 8
17989 fill-column: 74
17990 version-control: never
17991 End:
This page took 0.424765 seconds and 4 git commands to generate.