1 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4 error for the deprecated relocations.
5 (Target_arm::Scan::global): Likewise.
6 (Target_arm::Relocate::relocate): Likewise.
8 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
10 * fileread.cc (Input_file::find_file): Initialize *found_name
11 and *namep when using the fallback search for case 4.
13 2010-10-11 Cary Coutant <ccoutant@google.com>
15 * options.h (class General_options): Redefine -z lazy as an alias for
16 the negation of -z now.
18 2010-10-11 Ian Lance Taylor <iant@google.com>
20 * resolve.cc (symbol_to_bits): Report the value of the unsupported
23 2010-10-06 Nick Clifton <nickc@redhat.com>
25 * script-sections.cc(class Memory_region): Remove
26 current_lma_offset_ field. Rename current_vma_offset_ to
27 current_offset_. Add last_section_ field.
28 (Memory_region::get_current_vma_address): Rename to
30 (Memory_region::get_current_lma_address): Delete.
31 (Memory_region::increment_vma_offset): Rename to
33 (Memory_region::increment_lma_offset): Delete.
34 (Memory_region::attributes_compatible): New method. Returns
35 true if the provided section is compatible with the region.
36 (Memory_region::get_last_section): New method. Returns the last
37 section to use the region.
38 (Memory_region::set_last_section): New method. Stores the last
39 section to use the region.
40 (Script_sections::block_in_region): New method. Returns true if
41 a block of memory is contained within a region.
42 (Script_sections::find_memory_region): New method. Locates a
43 memory region to be used to set a VMA or LMA address.
44 (Output_section_definition::set_section_addresses): Add code to
45 check for addresses set by memory regions.
46 (Output_segment::set_section_addresses): Remove memory region
48 (Script_sections::create_segment): Add a warning if a header
49 segment is created outside of any region.
50 * script-sections.h (class Script_sections): Add prototypes for
51 find_memory_region and block_in_region methods.
52 * testsuite/memory_test.s: Use .long instead of .word.
53 * testsuite/memory_test.t: Add some more output sections.
54 * testsuite/memory_test.sh: Update expected output.
56 2010-10-02 Doug Kwan <dougkwan@google.com>
58 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
60 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
61 declaration to defintion.
63 2010-10-01 Nick Clifton <nickc@redhat.com>
65 * expression.cc (eval): Replace dummy argument with NULL.
66 (eval_maybe_dot): Check for a NULL result section pointer.
67 (Symbol_expression::value): Likewise.
68 (Dot_expression::value): Likewise.
69 (BINARY_EXPRESSION): Likewise.
70 (Max_expression::value): Likewise.
71 (Min_expression::value): Likewise.
72 (Absolute_expression::value): Likewise.
73 (Addr_expression::value_from_output_section): Likewise.
74 (Loaddddr_expression::value_from_output_section): Likewise.
75 (Segment_start_expression::value): Likewise.
77 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
79 (Sections_elememt_dot_assignment::set_section_addresses):
81 (Output_data_expression::do_write_to_buffer): Likewise.
82 (Output_section_definition::finalize_symbols): Likewise.
83 (Output_section_definition::set_section_addresses): Likewise.
85 2010-09-30 Doug Kwan <dougkwan@google.com>
87 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
89 2010-09-28 Sriraman Tallam <tmsriram@google.com>
91 * target.h (Target::can_icf_inline_merge_sections): New virtual
93 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
95 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
97 * icf.cc (get_section_contents): Inline merge sections only when
100 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
102 * configure: Regenerate.
104 2010-09-17 Ian Lance Taylor <iant@google.com>
106 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
107 * testsuite/Makefile.am (memory_test.o): New target.
108 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
110 * testsuite/Makefile.in: Rebuild.
112 2010-09-17 Doug Kwan <dougkwan@google.com>
114 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
115 defintion if relocation uses GOT entries of the symbol.
116 * testsuite/icf_safe_test.sh: Fix test.
117 * testsuite/icf_safe_so_test.sh: Fix test.
119 2010-09-16 Cary Coutant <ccoutant@google.com>
121 * script_sections.cc (class Memory_region): Remove "NULL" from
122 vector initializations.
124 2010-09-15 Cary Coutant <ccoutant@google.com>
126 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
127 Resolve forwarding symbols.
129 2010-09-15 Doug Kwan <dougkwan@google.com>
131 * gold/testsuite/script_test_3.t: Add ARM special sections.
132 * gold/testsuite/script_test_4.t: Same.
133 * gold/testsuite/script_test_5.t: Same.
134 * gold/testsuite/script_test_6.t: Same.
135 * gold/testsuite/script_test_7.t: Same.
136 * gold/testsuite/script_test_7.t: Same.
137 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
139 2010-09-14 Cary Coutant <ccoutant@google.com>
141 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
142 (Target_x86_64::Relocate::relocate_tls): Replace check for
143 saw_tls_block_reloc_ with test for executable section.
145 2010-09-12 Cary Coutant <ccoutant@google.com>
147 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
148 position-independent executables to shared libraries need dynamic
150 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
151 position-independent executables.
152 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
153 * testsuite/Makefile.in: Regenerate.
155 2010-09-10 Nick Clifton <nickc@redhat.com>
158 * testsuite/memory_test.t: Discard any sections that are not
161 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
164 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
165 "This::" to work around a bug in gcc 4.2.
167 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
169 2010-09-09 Rafael Espindola <espindola@google.com>
171 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
172 sections with different PF_X flags in the same segment.
173 (Layout::find_first_load_seg): Search all segments to find the first
175 * options.h (rosegment): New.
177 2010-09-08 Rafael Espindola <espindola@google.com>
179 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
181 2010-09-08 Doug Kwan <dougkwan@google.com>
183 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
184 (Arm_relobj::do_relocate_sections): Add new parameter for output
185 file to match the parent.
186 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
187 of local symbols instead of input values. Update code to track
188 changes in gold::relocate_section.
189 * object.cc (Sized_relobj::compute_final_local_value): New methods.
190 (Sized_relobj::compute_final_local_value_internal): New methods.
191 (Sized_relobj::do_finalize_local_symbols): Move code from loop
192 body into private version of Sized_relobj::compute_final_local_value.
193 Call the inline method.
194 * object.h (Symbol_value::Symbol_value): Define destructor. Free
195 merged symbol value if there is one.
196 (Symbol_value::has_output_value): New method defintiion.
197 (Sized_relobj::Compute_final_local_value_status): New enum type.
198 (Sized_relobj::compute_final_local_value): New methods.
199 (Sized_relobj::compute_final_local_value_internal): New methods.
200 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
201 and arm_cortex_a8.sh.
202 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
203 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
205 * Makefile.in: Regenerate.
206 * testsuite/arm_bl_out_of_range.s: Update test.
207 * testsuite/thumb_bl_out_of_range.s: Ditto.
208 * testsuite/thumb_blx_out_of_range.s: Ditto.
209 * testsuite/arm_branch_out_of_range.sh: New file.
210 * testsuite/arm_cortex_a8.sh: Ditto.
211 * testsuite/arm_cortex_a8_b.s: Ditto.
212 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
213 * testsuite/arm_cortex_a8_b_local.s: Ditto.
214 * testsuite/arm_cortex_a8_bl.s: Ditto.
215 * testsuite/arm_cortex_a8_blx.s: Ditto.
216 * testsuite/arm_cortex_a8_local.s: Ditto.
217 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
218 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
220 2010-09-08 Rafael Espindola <espindola@google.com>
222 * Makefile.am (memory_test.stdout): Run readelf with -W.
223 * Makefile.in: Regenerate.
224 * testsuite/memory_test.sh: Make the regexps accept both 32 and
227 2010-09-08 Rafael Espindola <espindola@google.com>
229 * script-sections.cc (Script_sections::add_memory_region): Convert
230 field precision to int.
231 * script.cc (script_set_section_region, script_set_section_region):
232 Convert field precision to int.
234 2010-09-08 Rafael Espindola <espindola@google.com>
236 * arm.cc (do_finalize_sections): Create the __exidx_start and
237 __exdix_end symbols even when the section is missing.
239 2010-09-08 Nick Clifton <nickc@redhat.com>
241 * README: Remove claim that MEMORY is not supported.
242 * expression.cc (script_exp_function_origin)
243 (script_exp_function_length): Move from here to ...
244 * script.cc: ... here.
245 (script_set_section_region, script_add_memory)
246 (script_parse_memory_attr, script_include_directive): New
249 (class Memory_region): New class.
250 (class Output_section_definition): Add set_memory_region,
251 set_section_vma, set_section_lma and get_section_name methods.
252 (class Script_Sections): Add add_memory_region,
253 find_memory_region, find_memory_region_origin,
254 find_memory_region_length and set_memory_region methods.
255 Have set_section_addresses method walk the list of set memory
257 Extend the print methos to display memory regions.
258 * script-sections.h: Add prototypes for new methods.
259 Add enum for MEMORY region attributes.
260 * yyscript.y: Add support for parsing MEMORY regions.
261 * script-c.h: Add prototypes for new functions.
262 * testsuite/Makefile.am: Add test of MEMORY region functionality.
263 * testsuite/Makefile.in: Regenerate.
264 * testsuite/memory_test.sh: New script.
265 * testsuite/memory_test.s: New assembler source file.
266 * testsuite/memory_test.t: New linker script.
268 2010-08-27 Doug Kwan <dougkwan@google.com>
270 * gold/resolve.cc (Symbol_table::should_override): Let a weak
271 reference override an existing dynamic weak reference.
272 * testsuite/Makefile.am: Add new test dyn_weak_ref.
273 * testsuite/Makefile.in: Regenerate.
274 * testsuite/dyn_weak_ref.sh: New file.
275 * testsuite/dyn_weak_ref_1.c: Ditto.
276 * testsuite/dyn_weak_ref_2.c: Ditto.
278 2010-08-27 Ian Lance Taylor <iant@google.com>
280 * incremental.h (class Incremental_input_entry): Add virtual
283 2010-08-27 Ian Lance Taylor <iant@google.com>
285 * testsuite/start_lib_test_3.c: Mark t3 as used.
287 2010-08-27 Nick Clifton <nickc@redhat.com>
289 * options.cc (version_script): Fix small typo in previous
292 2010-08-25 Nick Clifton <nickc@redhat.com>
294 * archive.cc: Formatting fixes: Remove whitespace between
295 typename and following asterisk. Remove whitespace between
296 function name and opening parenthesis.
297 * archive.h: Likewise.
299 * attributes.cc: Likewise.
300 * attributes.h: Likewise.
301 * common.cc: Likewise.
302 * copy-relocs.cc: Likewise.
303 * dirsearch.h: Likewise.
304 * dynobj.cc: Likewise.
305 * ehframe.cc: Likewise.
306 * ehframe.h: Likewise.
307 * expression.cc: Likewise.
308 * fileread.cc: Likewise.
309 * fileread.h: Likewise.
311 * gold-threads.cc: Likewise.
315 * incremental-dump.cc: Likewise.
316 * incremental.cc: Likewise.
317 * layout.cc: Likewise.
318 * layout.h: Likewise.
320 * merge.cc: Likewise.
322 * object.cc: Likewise.
323 * object.h: Likewise.
324 * options.cc: Likewise.
325 * options.h: Likewise.
326 * output.cc: Likewise.
327 * output.h: Likewise.
328 * plugin.cc: Likewise.
329 * plugin.h: Likewise.
330 * powerpc.cc: Likewise.
331 * reloc.cc: Likewise.
332 * script-c.h: Likewise.
333 * script-sections.cc: Likewise.
334 * script.cc: Likewise.
335 * stringpool.cc: Likewise.
336 * symtab.cc: Likewise.
337 * symtab.h: Likewise.
338 * target.cc: Likewise.
339 * timer.cc: Likewise.
341 * version.cc: Likewise.
342 * x86_64.cc: Likewise.
344 2010-08-24 Nick Clifton <nickc@redhat.com>
347 * layout.cc (segment_precedes): Sort segments by their physical
348 addresses, if they have been set.
350 2010-08-23 Cary Coutant <ccoutant@google.com>
352 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
354 (Lib_group::include_member): Unlock object after deleting its
356 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
359 2010-08-19 Neil Vachharajani <nvachhar@google.com>
360 Cary Coutant <ccoutant@google.com>
362 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
363 constructor, and set_blocker.
364 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
366 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
367 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
368 * testsuite/Makefile.am (start_lib_test): New test case.
369 * testsuite/Makefile.in: Regenerate.
370 * testsuite/start_lib_test_main.c: New file.
371 * testsuite/start_lib_test_1.c: New file.
372 * testsuite/start_lib_test_2.c: New file.
373 * testsuite/start_lib_test_3.c: New file.
375 2010-08-19 Ian Lance Taylor <iant@google.com>
377 * Makefile.in: Rebuild with automake 1.11.1.
378 * aclocal.m4: Likewise.
379 * testsuite/Makefile.in: Likewise.
381 2010-08-19 Ian Lance Taylor <iant@google.com>
384 * i386.cc (class Output_data_plt_i386): Update declarations.
385 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
386 local_ifuncs_ fields.
387 (Target_i386::do_plt_section_for_global): New function.
388 (Target_i386::do_plt_section_for_local): New function.
389 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
390 parameter; change all callers. Initialize global_ifuncs_ and
391 local_ifuncs_. If doing a static link define __rel_iplt_start and
393 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
394 (Output_data_plt_i386::add_local_ifunc_entry): New function.
395 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
397 (Target_i386::make_plt_section): New function, broken out of
398 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
399 (Target_i386::make_plt_entry): Call make_plt_section.
400 (Target_i386::make_local_ifunc_plt_entry): New function.
401 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
402 (Target_i386::Scan::local): Handle IFUNC symbols. Add
403 R_386_IRELATIVE to switch.
404 (Target_i386::Scan::global): Likewise.
405 (Target_i386::Relocate::relocate): Likewise.
406 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
408 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
409 (Target_x86_64::do_plt_section_for_global): New function.
410 (Target_x86_64::do_plt_section_for_local): New function.
411 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
412 parameter; change all callers. If doing a static link define
413 __rela_iplt_start and __rela_iplt_end.
414 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
415 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
416 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
418 (Target_x86_64::make_local_ifunc_plt_entry): New function.
419 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
421 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
422 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
423 R_X86_64_IRELATIVE to switch.
424 (Target_x86_64::Scan::global): Likewise.
425 (Target_x86_64::Relocate::relocate): Likewise.
426 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
428 * target.h (class Target): Add plt_section_for_global and
429 plt_section_for_local functions. Add do_plt_section_for_global
430 and do_plt_section_for_local virtual functions.
431 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
433 (Symbol::use_plt_offset): Handle IFUNC symbol.
434 * object.cc (Sized_relobj::Sized_relobj): Initialize
436 (Sized_relobj::local_has_plt_offset): New function.
437 (Sized_relobj::local_plt_offset): New function.
438 (Sized_relobj::set_local_plt_offset): New function.
439 (Sized_relobj::do_count): Handle IFUNC symbol.
440 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
441 a bit away from input_shndx_ field. Add set_is_func_symbol and
442 is_ifunc_symbol functions.
443 (class Sized_relobj): Update declarations. Remove Tls_got_entry
444 and Local_tls_got_offsets. Define Local_plt_offsets. Add
445 local_plt_offsets_ field.
446 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
447 * output.h (class Output_section_data): Add non-const
448 output_section function.
449 (class Output_data_got): Update declarations.
450 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
451 Add use_plt_offset parameter to global and local constructors.
452 Change all callers. Change local_sym_index_ field to 31 bits.
453 Change GSYM_CODE and CONSTANT_CODE accordingly.
454 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
455 doing a static link don't set sh_link field.
456 (Output_data_got::Got_entry::write): Use PLT offset if
458 (Output_data_got::add_global_plt): New function.
459 (Output_data_got::add_local_plt): New function.
460 * target-reloc.h (relocate_section): Handle IFUNC symbol.
461 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
462 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
463 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
464 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
466 * testsuite/ifunc-sel.h: New file.
467 * testsuite/ifuncmain1.c: New file.
468 * testsuite/ifuncmain1vis.c: New file.
469 * testsuite/ifuncmod1.c: New file.
470 * testsuite/ifuncdep2.c: New file.
471 * testsuite/ifuncmain2.c: New file.
472 * testsuite/ifuncmain3.c: New file.
473 * testsuite/ifuncmod3.c: New file.
474 * testsuite/ifuncmain4.c: New file.
475 * testsuite/ifuncmain5.c: New file.
476 * testsuite/ifuncmod5.c: New file.
477 * testsuite/ifuncmain6pie.c: New file.
478 * testsuite/ifuncmod6.c: New file.
479 * testsuite/ifuncmain7.c: New file.
480 * configure, testsuite/Makefile.in: Rebuild.
482 2010-08-18 Ian Lance Taylor <iant@google.com>
485 (Output_section_incremental_inputs::write_input_files): Add cast
486 to avoid signed/unsigned comparison warning.
487 (Output_section_incremental_inputs::write_info_blocks): Likewise.
489 2010-08-12 Cary Coutant <ccoutant@google.com>
491 * common.cc (Sort_commons::operator()): Remove unnecessary code.
493 2010-08-13 Ian Lance Taylor <iant@google.com>
495 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
497 2010-08-12 Cary Coutant <ccoutant@google.com>
498 Doug Kwan <dougkwan@google.com>
500 * resolve.cc (Symbol_table::should_override): When a weak dynamic
501 defintion overrides non-weak undef, remember that the original undef
503 * symtab.cc (Symbol_table::sized_write_global): For undef without
504 an original weak binding, set binding to global in output.
505 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
506 * testsuite/Makefile.in: Regenerate.
507 * testsuite/strong_ref_weak_def.sh: New file.
508 * testsuite/strong_ref_weak_def_1.c: Ditto.
509 * testsuite/strong_ref_weak_def_2.c: Ditto.
511 2010-08-12 Cary Coutant <ccoutant@google.com>
513 * testsuite/incremental_test.sh: Rewrite.
514 * testsuite/incremental_test_1.c: Rewrite.
515 * testsuite/incremental_test_2.c: Rewrite.
517 2010-08-12 Cary Coutant <ccoutant@google.com>
519 * arm.cc (Target_arm::got_size): Add const.
520 (Target_arm::got_entry_count): New function.
521 (Target_arm::plt_entry_count): New function.
522 (Target_arm::first_plt_entry_offset): New function.
523 (Target_arm::plt_entry_size): New function.
524 (Output_data_plt_arm::entry_count): New function.
525 (Output_data_plt_arm::first_plt_entry_offset): New function.
526 (Output_data_plt_arm::get_plt_entry_size): New function.
527 * i386.cc (Target_i386::got_size): Add const.
528 (Target_i386::got_entry_count): New function.
529 (Target_i386::plt_entry_count): New function.
530 (Target_i386::first_plt_entry_offset): New function.
531 (Target_i386::plt_entry_size): New function.
532 (Output_data_plt_i386::entry_count): New function.
533 (Output_data_plt_i386::first_plt_entry_offset): New function.
534 (Output_data_plt_i386::get_plt_entry_size): New function.
535 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
536 find_incremental_inputs_sections. Dump incremental_got_plt section.
537 * incremental.cc: Include target.h.
538 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
539 parameter. Adjust all callers. Find incremental_got_plt section.
540 (Incremental_inputs::create_data_sections): Create incremental_got_plt
542 (Output_section_incremental_inputs::set_final_data_size): Calculate
543 size of incremental_got_plt section.
544 (Output_section_incremental_inputs::do_write): Write the
545 incremental_got_plt section.
546 (Got_plt_view_info): New struct.
547 (Local_got_offset_visitor): New class.
548 (Global_got_offset_visitor): New class.
549 (Global_symbol_visitor_got_plt): New class.
550 (Output_section_incremental_inputs::write_got_plt): New function.
551 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
552 Add parameter. Adjust all callers.
553 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
554 (Incremental_inputs::got_plt_section): New function.
555 (Incremental_inputs::got_plt_section_): New data member.
556 (Incremental_got_plt_reader): New class.
557 * layout.cc (Layout::create_incremental_info_sections): Add the
558 incremental_got_plt section.
559 * object.h (Got_offset_list::get_list): New function.
560 (Got offset_list::for_all_got_offsets): New function.
561 (Sized_relobj::local_got_offset_list): New function.
562 * powerpc.cc (Target_powerpc::got_size): Add const.
563 (Target_powerpc::got_entry_count): New function.
564 (Target_powerpc::plt_entry_count): New function.
565 (Target_powerpc::first_plt_entry_offset): New function.
566 (Target_powerpc::plt_entry_size): New function.
567 (Output_data_plt_powerpc::entry_count): New function.
568 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
569 (Output_data_plt_powerpc::get_plt_entry_size): New function.
570 * sparc.cc (Target_sparc::got_size): Add const.
571 (Target_sparc::got_entry_count): New function.
572 (Target_sparc::plt_entry_count): New function.
573 (Target_sparc::first_plt_entry_offset): New function.
574 (Target_sparc::plt_entry_size): New function.
575 (Output_data_plt_sparc::entry_count): New function.
576 (Output_data_plt_sparc::first_plt_entry_offset): New function.
577 (Output_data_plt_sparc::get_plt_entry_size): New function.
578 * symtab.h (Symbol::got_offset_list): New function.
579 (Symbol_table::for_all_symbols): New function.
580 * target.h (Sized_target::got_entry_count): New function.
581 (Sized_target::plt_entry_count): New function.
582 (Sized_target::plt_entry_size): New function.
583 * x86_64.cc (Target_x86_64::got_size): Add const.
584 (Target_x86_64::got_entry_count): New function.
585 (Target_x86_64::plt_entry_count): New function.
586 (Target_x86_64::first_plt_entry_offset): New function.
587 (Target_x86_64::plt_entry_size): New function.
588 (Output_data_plt_x86_64::entry_count): New function.
589 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
590 (Output_data_plt_x86_64::get_plt_entry_size): New function.
592 2010-08-12 Cary Coutant <ccoutant@google.com>
594 * archive.cc: Include incremental.h.
595 (Archive::Archive): Initialize incremental_info_.
596 (Archive::include_member): Record archive members in incremental info.
597 (Add_archive_symbols::run): Record begin and end of an archive in
599 (Lib_group::include_member): Record objects in incremental info.
600 * archive.h (Incremental_archive_entry): Forward declaration.
601 (Archive::set_incremental_info): New member function.
602 (Archive::incremental_info): New member function.
603 (Archive::Unused_symbol_iterator): New class.
604 (Archive::unused_symbols_begin): New member function.
605 (Archive::unused_symbols_end): New member function.
606 (Archive::incremental_info_): New data member.
607 * incremental-dump.cc (find_input_containing_global): New function.
608 (dump_incremental_inputs): Dump new incremental info sections.
609 * incremental.cc: Include symtab.h.
610 (Output_section_incremental_inputs): New class.
611 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
612 new incremental info sections.
613 (Sized_incremental_binary::do_check_inputs): Likewise.
614 (Incremental_inputs::report_archive): Remove.
615 (Incremental_inputs::report_archive_begin): New function.
616 (Incremental_inputs::report_archive_end): New function.
617 (Incremental_inputs::report_object): New function.
618 (Incremental_inputs::finalize_inputs): Remove.
619 (Incremental_inputs::report_input_section): New function.
620 (Incremental_inputs::report_script): Rewrite.
621 (Incremental_inputs::finalize): Do nothing but finalize string table.
622 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
623 (Incremental_inputs::sized_create_inputs_section_data): Remove.
624 (Incremental_inputs::create_data_sections): New function.
625 (Incremental_inputs::relocs_entsize): New function.
626 (Output_section_incremental_inputs::set_final_data_size): New function.
627 (Output_section_incremental_inputs::do_write): New function.
628 (Output_section_incremental_inputs::write_header): New function.
629 (Output_section_incremental_inputs::write_input_files): New function.
630 (Output_section_incremental_inputs::write_info_blocks): New function.
631 (Output_section_incremental_inputs::write_symtab): New function.
632 * incremental.h (Incremental_script_entry): Forward declaration.
633 (Incremental_object_entry): Forward declaration.
634 (Incremental_archive_entry): Forward declaration.
635 (Incremental_inputs): Forward declaration.
636 (Incremental_inputs_header_data): Remove.
637 (Incremental_inputs_header): Remove.
638 (Incremental_inputs_header_write): Remove.
639 (Incremental_inputs_entry_data): Remove.
640 (Incremental_inputs_entry): Remove.
641 (Incremental_inputs_entry_write): Remove.
642 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
643 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
644 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
645 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
647 (Incremental_input_entry): New class.
648 (Incremental_script_entry): New class.
649 (Incremental_object_entry): New class.
650 (Incremental_archive_entry): New class.
651 (Incremental_inputs::Incremental_inputs): Initialize new data members.
652 (Incremental_inputs::report_inputs): Remove.
653 (Incremental_inputs::report_archive): Remove.
654 (Incremental_inputs::report_archive_begin): New function.
655 (Incremental_inputs::report_archive_end): New function.
656 (Incremental_inputs::report_object): Change prototype.
657 (Incremental_inputs::report_input_section): New function.
658 (Incremental_inputs::report_script): Change prototype.
659 (Incremental_inputs::get_reloc_count): New function.
660 (Incremental_inputs::set_reloc_count): New function.
661 (Incremental_inputs::create_data_sections): New function.
662 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
663 (Incremental_inputs::inputs_section): New function.
664 (Incremental_inputs::symtab_section): New function.
665 (Incremental_inputs::relocs_section): New function.
666 (Incremental_inputs::get_stringpool): Add const.
667 (Incremental_inputs::command_line): Add const.
668 (Incremental_inputs::inputs): Remove.
669 (Incremental_inputs::command_line_key): New function.
670 (Incremental_inputs::input_file_count): New function.
671 (Incremental_inputs::input_files): New function.
672 (Incremental_inputs::relocs_entsize): New function.
673 (Incremental_inputs::sized_create_inputs_section_data): Remove.
674 (Incremental_inputs::finalize_inputs): Remove.
675 (Incremental_inputs::Input_info): Remove.
676 (Incremental_inputs::lock_): Remove.
677 (Incremental_inputs::inputs_): Change type.
678 (Incremental_inputs::inputs_map_): Remove.
679 (Incremental_inputs::current_object_entry_): New data member.
680 (Incremental_inputs::inputs_section_): New data member.
681 (Incremental_inputs::symtab_section_): New data member.
682 (Incremental_inputs::relocs_section_): New data member.
683 (Incremental_inputs::reloc_count_): New data member.
684 (Incremental_inputs_reader): New class.
685 (Incremental_symtab_reader): New class.
686 (Incremental_relocs_reader): New class.
687 * layout.cc (Layout::finalize): Move finalization of incremental info
688 and creation of incremental info sections to follow finalization of
689 symbol table. Set offsets for postprocessing sections.
690 (Layout::create_incremental_info_sections): Call
691 Incremental_inputs::create_data_sections. Add incremental symtab
692 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
693 sections to layout after input sections.
694 * layout.h (struct Timespec): Forward declaration.
695 (Layout::incremental_inputs): Add const.
696 (Layout::create_incremental_info_sections): Add parameter.
697 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
698 * object.cc: Include incremental.h.
699 (Relobj::finalize_incremental_relocs): New function.
700 (Sized_relobj::do_layout): Record input sections in incremental info.
701 * object.h (Object::output_section): New function.
702 (Object::output_section_offset): Moved from Relobj.
703 (Object::get_incremental_reloc_base): New function.
704 (Object::get_incremental_reloc_count): New function.
705 (Object::do_output_section): New function.
706 (Object::do_output_section_offset): Moved from Relobj.
707 (Object::do_get_incremental_reloc_base): New function.
708 (Object::do_get_incremental_reloc_count): New function.
709 (Object::Object): Initialize new data members.
710 (Relobj::output_section): Renamed do_output_section and moved to
712 (Relobj::output_section_offset): Moved to Object.
713 (Relobj::do_get_incremental_reloc_base): New function.
714 (Relobj::do_get_incremental_reloc_count): New function.
715 (Relobj::allocate_incremental_reloc_counts): New function.
716 (Relobj::count_incremental_reloc): New function.
717 (Relobj::finalize_incremental_relocs): New function.
718 (Relobj::next_incremental_reloc_index): New function.
719 (Relobj::reloc_counts_): New data member.
720 (Relobj::reloc_bases_): New data member.
721 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
722 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
723 (Sized_relobj::incremental_relocs_scan): New function.
724 (Sized_relobj::incremental_relocs_scan_reltype): New function.
725 (Sized_relobj::incremental_relocs_write): New function.
726 (Sized_relobj::incremental_relocs_write_reltype): New function.
727 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
729 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
730 archives and object files elsewhere.
731 (Add_symbols::run): Report object files here.
732 (Finish_group::run): Report end of archive at end of group.
733 * reloc.cc: Include layout.h, incremental.h.
734 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
735 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
736 (Sized_relobj::incremental_relocs_scan): New function.
737 (Sized_relobj::incremental_relocs_scan_reltype): New function.
738 (Sized_relobj::do_relocate_sections): Write incremental relocations.
739 (Sized_relobj::incremental_relocs_write): New function.
740 (Sized_relobj::incremental_relocs_write_reltype): New function.
741 * script.cc (read_input_script): Rewrite test for incremental link.
742 Change call to Incremental_inputs::report_script.
743 * symtab.h (Symbol_table::first_global_index): New function.
744 (Symbol_table::output_count): New function.
746 2010-08-12 Doug Kwan <dougkwan@google.com>
748 * arm.cc (Target_arm::merge_object_attributes): Check command line
749 options --no-wchar-size-warning and --no-enum-size-warning.
750 * options.h (General_options): Add ld-compatible options
751 --no-enum-size-warning and --no-wchar-size-warning.
753 2010-08-04 Ian Lance Taylor <iant@google.com>
755 * x86_64.cc (Target_x86_64::Scan::local): Use
756 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
757 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
758 (Target_x86_64::Scan::global): Likewise.
759 (Target_x86_64::Relocate::relocate): Likewise.
760 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
763 2010-08-03 Cary Coutant <ccoutant@google.com>
765 * merge.cc (Output_merge_string::do_add_input_section): Count strings
766 to reserve space in merged_strings vector. Keep total input size
768 (Output_merge_string::do_print_merge_stats): Print total input size.
769 * merge.h (Output_merge_string): Add input_size_ field.
770 * stringpool.cc (Stringpool_template::string_length): Move
771 implementations out of Stringpool_template class and place in
773 * stringpool.h (string_length): Move out of Stringpool_template.
775 2010-08-03 Ian Lance Taylor <iant@google.com>
778 * layout.cc (relaxation_loop_body): If address of load segment is
779 set, adjust address to include headers if possible.
781 2010-08-03 Ian Lance Taylor <iant@google.com>
783 * version.cc (version_string): Bump to 1.10.
785 2010-08-03 Ian Lance Taylor <iant@google.com>
788 * layout.h (enum Output_section_order): Define.
789 (class Layout): Update declarations.
790 * layout.cc (Layout::get_output_section): Add order parameter.
791 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
792 is_first_non_relro parameters. Change all callers.
793 (Layout::choose_output_section): Likewise.
794 (Layout::add_output_section_data): Likewise.
795 (Layout::make_output_section): Likewise. Set order.
796 (Layout::default_section_order): New function.
797 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
798 * output.cc (Output_section::Output_section): Initialize order_.
799 Don't initialize deleted fields.
800 (Output_segment::Output_segment): Don't initialize deleted
802 (Output_segment::add_output_section_to_load): New function
803 replacing add_output_section. Change all callers to call this or
804 add_output_section_to_nonload.
805 (Output_segment::add_output_section_to_nonload): New function.
806 (Output_segment::remove_output_section): Rewrite.
807 (Output_segment::add_initial_output_data): Likewise.
808 (Output_segment::has_any_data_sections): Likewise.
809 (Output_segment::is_first_section_relro): Likewise.
810 (Output_segment::maximum_alignment): Likewise.
811 (Output_segment::has_dynamic_reloc): New function replacing
812 dynamic_reloc_count. Change all callers.
813 (Output_segment::has_dynamic_reloc_list): New function replacing
814 dynamic_reloc_count_list. Change all callers.
815 (Output_segment::set_section_addresses): Rewrite.
816 (Output_segment::set_offset): Rewrite.
817 (Output_segment::find_first_and_last_list): Remove.
818 (Output_segment::set_tls_offsets): Rewrite.
819 (Output_segment::first_section_load_address): Likewise.
820 (Output_segment::output_section_count): Likewise.
821 (Output_segment::section_with_lowest_load_address): Likewise.
822 (Output_segment::write_section_headers): Likewise.
823 (Output_segment::print_sections_to_map): Likewise.
824 * output.h (class Output_data): Remove dynamic_reloc_count_
825 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
826 (Output_data::add_dynamic_reloc): Rewrite.
827 (Output_data::has_dynamic_reloc): New function.
828 (Output_data::dynamic_reloc_count): Remove.
829 (class Output_section): Add order_ field. Remvoe is_relro_local_,
830 is_last_relro_, is_first_non_relro_, is_interp_,
831 is_dynamic_linker_section_ fields. Add order and set_order
832 functions. Remove is_relro_local, set_is_relro_local,
833 is_last_relro, set_is_last_relro, is_first_non_relro,
834 set_is_first_non_relro functions, is_interp, set_is_interp,
835 is_dynamic_linker_section, and set_is_dynamic_linker_section
837 (class Output_segment): Change Output_data_list from std::list to
838 std:;vector. Add output_lists_ field. Remove output_data_ and
839 output_bss_ fields. Update declarations.
841 2010-08-02 Ian Lance Taylor <iant@google.com>
843 * arm.cc (Target_arm::gc_process_relocs): Use typename.
844 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
845 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
847 2010-08-02 Ian Lance Taylor <iant@google.com>
850 * script.cc (Script_options::Script_options): Initialize
851 symbol_definitions_ and symbol_references_.
852 (Script_options::add_symbol_assignment): Update
853 symbol_definitions_ and symbol_references_.
854 (Script_options::add_symbol_reference): New function.
855 (script_symbol): New function.
856 * script.h (class Script_options): Add symbol_definitions_ and
857 symbol_references_ fields.
858 (Script_options::referenced_const_iterator): New type.
859 (Script_options::referenced_begin): New function.
860 (Script_options::referenced_end): New function.
861 (Script_options::is_referenced): New function.
862 (Script_options::any_unreferenced): New function.
863 * script-c.h (script_symbol): Declare.
864 * yyscript.y (exp): Call script_symbol.
865 * symtab.cc: Include "script.h".
866 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
867 Change all callers. Check symbols referenced by scripts.
868 (Symbol_table::add_undefined_symbols_from_command_line): Add
869 layout parameter. Change all callers.
870 (Symbol_table::do_add_undefined_symbols_from_command_line):
871 Likewise. Break out loop body. Check symbols referenced by
873 (Symbol_table::add_undefined_symbol_from_command_line): New
874 function broken out of
875 do_add_undefined_symbols_from_command_line.
876 * symtab.h (class Symbol_table): Update declarations.
877 * archive.cc: Include "layout.h".
878 (Archive::should_include_member): Add layout parameter. Change
879 all callers. Check for symbol mentioned in expression.
880 * archive.h (class Archive): Update declaration.
881 * object.cc (Sized_relobj::do_should_include_member): Add layout
883 * object.h (Object::should_include_member): Add layout parameter.
885 (Object::do_should_include_member): Add layout parameter.
886 (class Sized_relobj): Update declaration.
887 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
889 * dynobj.h (class Sized_dynobj): Update declaration.
890 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
892 * plugin.h (class Sized_pluginobj): Update declaration.
894 2010-08-02 Ian Lance Taylor <iant@google.com>
897 * output.cc (Output_segment::set_offset): Search for the first and
898 last sections rather than assuming that the list is in order.
899 (Output_segment::find_first_and_last_list): New function.
900 * output.h (class Output_segment): Update declarations.
901 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
902 (relro_strip_test_SOURCES): New variable.
903 (relro_strip_test_DEPENDENCIES): New variable.
904 (relro_strip_test_LDFLAGS): New variable.
905 (relro_strip_test_LDADD): New variable.
906 (relro_strip_test.so): New target.
908 2010-08-02 Ian Lance Taylor <iant@google.com>
910 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
911 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
912 (Target_i386::got_tlsdesc_section): New function.
913 (Target_i386::got_section): Create space for GOT entries for
915 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
917 (Target_i386::Scan::global): Likewise.
918 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
920 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
921 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
922 (Target_x86_64::got_tlsdesc_section): New function.
923 (Target_x86_64::got_section): Create space for GOT entries for
925 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
927 (Target_x86_64::Scan::global): Likewise.
928 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
931 2010-08-02 Ian Lance Taylor <iant@google.com>
933 * testsuite/final_layout.sh: Use dc to convert from hex to
936 2010-07-29 Sriraman Tallam <tmsriram@google.com>
938 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
939 paramter to the call to gold::gc_process_relocs.
940 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
941 paramter to the call to gold::gc_process_relocs.
942 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
943 parameter to the call to gold::gc_process_relocs.
944 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
945 template parameter to the call to gold::gc_process_relocs.
946 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
947 paramter to the call to gold::gc_process_relocs.
948 * gc.h (get_embedded_addend_size): New function.
949 (gc_process_relocs): Save the size of the reloc for use by ICF.
950 * icf.cc (get_section_contents): Get the addend from the text section
951 for SHT_REL relocation sections.
952 * icf.h (Icf::Reloc_addend_size_info): New typedef.
953 (Icf::Reloc_info): Add new member reloc_addend_size_info.
954 * int_encoding.h (read_from_pointer): New overloaded function.
955 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
956 * testsuite/icf_sht_rel_addend_test.sh: New file.
957 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
958 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
960 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
962 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
963 * Makefile.in: Regenerate.
964 * testsuite/Makefile.in: Regenerate.
966 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
968 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
969 * gold/testsuite/debug_msg.cc: Likewise.
970 * gold/testsuite/odr_violation1.cc
971 * gold/testsuite/odr_violation2.cc
973 2010-07-21 Cary Coutant <ccoutant@google.com>
975 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
976 string, and length fields.
977 (Output_merge_string::Merged_strings_list): New type.
978 (Output_merge_string::Merged_strings_lists): New typedef.
979 (Output_merge_string): Replace merged_strings_ with
980 merged_strings_lists_.
981 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
982 Merged_strings_list per input object and section. Don't store pointer
983 to the string. Don't store length with each merged string entry.
984 (Output_merge_string::finalize_merged_data): Loop over list of merged
985 strings lists. Recompute length of each merged string.
987 2010-07-15 Cary Coutant <ccoutant@google.com>
989 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
992 2010-07-14 Ian Lance Taylor <iant@google.com>
994 * descriptors.cc (Descriptors::open): Report correct name in error
997 2010-07-13 Doug Kwan <dougkwan@google.com>
999 * arm.cc (Arm_input_section::Arm_input_section): For a
1000 SHT_ARM_EXIDX section, always keeps the input sections.
1001 (Arm_input_section::set_exidx_section_link): New method.
1002 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
1003 has_errors_ to false.
1004 (Arm_exidx_input_section::has_errors,
1005 Arm_exidx_input_section::set_has_errors): New methods.
1006 (Arm_exidx_input_section::has_errors_): New data member.
1007 (Arm_relobj::get_exidx_shndx_list): New method.
1008 (Arm_output_section::append_text_sections_to_list): Do not skip
1009 section without SHF_EXECINSTR.
1010 (Arm_output_section::fix_exidx_coverage): Skip input sections with
1012 (Arm_relobj::make_exidx_input_section): Add new parameter for text
1013 section header. Make error messages more verbose. Check for
1014 a non-executable section linked to an EXIDX section.
1015 (Arm_relobj::do_read_symbols): Remove error checking, which has been
1016 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
1017 check that there is no deferred EXIDX section if we exit early.
1018 Instead of not making an EXIDX section in case of an error, make one
1019 and set the has_errors flag of it.
1020 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
1021 in a relocatable link.
1022 (Target_arm::do_relax): Look for the EXIDX output section instead of
1023 assuming that it is called .ARM.exidx.
1024 (Target_arm::fix_exidx_coverage): Add a new parameter for input
1025 section list. Do not check for SHF_EXECINSTR section flags but
1026 skip any input section with errors.
1027 * output.cc (Output_section::Output_section): Initialize
1028 always_keeps_input_sections_ to false.
1029 (Output_section::add_input_section): Check for
1030 always_keeps_input_sections_.
1031 * output.h (Output_section::always_keeps_input_sections,
1032 Output_section::set_always_keeps_input_sections): New methods.
1033 (Output_section::always_keeps_input_sections): New data member.
1035 2010-07-13 Rafael Espindola <espindola@google.com>
1037 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
1038 * fileread.h (Input_file): Add try_extra_search_path and find_file.
1040 2010-07-13 Philip Herron <herron.philip@googlemail.com>
1041 Ian Lance Taylor <iant@google.com>
1043 * output.h (Output_section_lookup_maps::add_merge_section):
1044 Correct check of whether value was inserted.
1045 (Output_section_lookup_maps::add_merge_input_section): Likewise.
1046 (Output_section_lookup_maps::add_relaxed_input_section):
1048 * arm.cc (Target_arm::got_section): Remove used local os.
1049 * i386.cc (Target_i386::got_section): Likewise.
1050 * x86_64.cc (Target_x86_64::got_section): Likewise.
1051 * sparc.cc (Target_sparc::got_section): Likewise.
1052 (Target_sparc::relocate): Remove unused local have_got_offset.
1053 * powerpc.cc (Target_powerpc::relocate): Likewise.
1055 2010-07-13 Ian Lance Taylor <iant@google.com>
1057 * compressed_output.cc (zlib_decompress): Fix signature in
1060 * archive.cc (Archive::include_member): Unlock an external member
1061 of a thin archive. Don't bother to delete an object we know is
1064 2010-07-12 Cary Coutant <ccoutant@google.com>
1066 * compressed_output.cc (zlib_decompress): New function.
1067 (get_uncompressed_size): New function.
1068 (decompress_input_section): New function.
1069 * compressed_output.h (get_uncompressed_size): New function.
1070 (decompress_input_section): New function.
1071 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
1072 Handle compressed debug sections.
1073 * layout.cc (is_compressed_debug_section): New function.
1074 (Layout::output_section_name): Map compressed section names to
1076 * layout.h (is_compressed_debug_section): New function.
1077 (is_debug_info_section): Recognize compressed debug sections.
1078 * merge.cc: Include compressed_output.h.
1079 (Output_merge_data::do_add_input_section): Handle compressed
1081 (Output_merge_string::do_add_input_section): Handle compressed
1083 * object.cc: Include compressed_output.h.
1084 (Sized_relobj::Sized_relobj): Initialize new data members.
1085 (build_compressed_section_map): New function.
1086 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
1087 * object.h (Object::section_is_compressed): New method.
1088 (Object::do_section_is_compressed): New method.
1089 (Sized_relobj::Compressed_section_map): New type.
1090 (Sized_relobj::do_section_is_compressed): New method.
1091 (Sized_relobj::compressed_sections_): New data member.
1092 * output.cc (Output_section::add_input_section): Handle compressed
1094 * reloc.cc: Include compressed_output.h.
1095 (Sized_relobj::write_sections): Handle compressed debug sections.
1097 2010-07-08 Cary Coutant <ccoutant@google.com>
1099 * resolve.cc (Symbol_table::resolve): Remember whether undef was
1100 weak when resolving to a dynamic def.
1101 (Symbol_table::should_override): Add adjust_dyndef flag; set it
1102 for weak undef/dynamic def cases. Adjust callers.
1103 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
1104 undef_binding_weak_.
1105 (Symbol_table::sized_write_globals): Adjust symbol binding.
1106 (Symbol_table::sized_write_symbol): Add binding parameter.
1107 * symtab.h (Symbol::set_undef_binding): New method.
1108 (Symbol::is_undef_binding_weak): New method.
1109 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
1110 (Symbol_table::should_override): Add new parameter.
1111 (Symbol_table::sized_write_symbol): Add new parameter.
1113 * testsuite/weak_undef_file1.cc: Add new test case.
1114 * testsuite/weak_undef_file2.cc: Fix header comment.
1115 * testsuite/weak_undef_test.cc: Add new test case.
1117 2010-06-29 Doug Kwan <dougkwan@google.com>
1119 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
1120 Initialize USE_SYMBOL_.
1121 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
1123 (Arm_reloc_property::uses_symbol_): New data member declaration.
1124 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
1125 uses symbol value and symbol is undefined but not weakly undefined.
1127 2010-06-28 Rafael Espindola <espindola@google.com>
1129 * plugin.cc (Plugin::load): Use dlerror.
1131 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
1133 * symtab.cc (detect_odr_violations): When reporting an ODR
1134 violation, report an object where the symbol is defined.
1136 2010-06-25 Doug Kwan <dougkwan@google.com>
1138 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
1139 (Target_arm::section_may_have_icf_unsafe_pointers): New method
1141 (Target_arm::Scan::local_reloc_may_be_function_pointer,
1142 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
1143 target hook to detect function points.
1144 (Target_arm::Scan::possible_function_pointer_reloc): New method.
1145 * icf.h (Icf::check_section_for_function_pointers): Change type of
1146 parameter SECTION_NAME to const reference to std::string. Use
1147 target hook to determine if section may have unsafe pointers.
1148 * target.h (Target::section_may_have_icf_unsafe_pointers): New
1151 2010-06-21 Rafael Espindola <espindola@google.com>
1153 * fileread.cc (Input_file::find_fie): New
1154 (Input_file::open): Use Input_file::find_fie.
1155 * fileread.h (Input_file::find_fie): New
1156 * plugin.cc (set_extra_library_path): New.
1157 (Plugin::load): Add set_extra_library_path to the transfer vector.
1158 (Plugin_manager::set_extra_library_path): New.
1159 (Plugin_manager::add_input_file): Use the extra search path if set.
1160 (set_extra_library_path(): New.
1161 * plugin.h (Plugin_manager): Add set_extra_library_path and
1164 2010-06-19 Cary Coutant <ccoutant@google.com>
1166 * layout.cc (gdb_sections): Add .debug_types.
1167 (lines_only_debug_sections): Likewise.
1169 2010-06-18 Rafael Espindola <espindola@google.com>
1171 * plugin.cc (add_input_file,add_input_library)
1172 (Plugin_manager::add_input_file): Make filename arguments const.
1173 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
1176 2010-06-16 Doug Kwan <dougkwan@google.com>
1178 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
1179 .ARM.attributes section if we have not merged any input
1180 attributes sections.
1182 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1184 * arm.cc: Allow combining objects with no EABI version
1187 2010-06-15 Rafael Espindola <espindola@google.com>
1189 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
1191 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1193 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
1194 (struct iovec): Correct !HAVE_READV definition.
1196 2010-06-10 Cary Coutant <ccoutant@google.com>
1198 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
1199 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
1201 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
1204 * symtab.h (Symbol::is_placeholder): New member function.
1205 * target-reloc.h (relocate_section): Check for placeholder symbols.
1207 * testsuite/Makefile.am (plugin_test_8): New test.
1208 (plugin_test_9): New test.
1209 * testsuite/Makefile.in: Regenerate.
1211 2010-06-09 Nick Clifton <nickc@redhat.com>
1213 * yyscript.y (input_list_element): Allow strings prefixed with
1214 the '-' character. Treat these as libraries.
1215 * script.cc (script_add_library): New function. Adds a library
1216 specified by "-l<name>" found in an input script.
1217 * script-c.h: Add prototype for script_add_library.
1219 2010-06-07 Doug Kwan <dougkwan@google.com>
1221 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
1222 Restrict stub-group size to be within long conditional branch
1223 range when working around cortex-A8 erratum.
1225 2010-06-07 Damien Diederen <dd@crosstwine.com>
1227 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
1230 2010-06-03 Sriraman Tallam <tmsriram@google.com>
1234 (Output_section::Input_section_sort_entry::compare_section_ordering):
1235 Change to return non-zero correctly.
1236 (Output_section::Input_section_sort_section_order_index_compare
1237 ::operator()): Change to fix ambiguity in comparisons.
1239 2010-06-01 Sriraman Tallam <tmsriram@google.com>
1241 * gold.h (is_wildcard_string): New function.
1242 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
1243 (Layout::layout_eh_frame): Ditto.
1244 (Layout::find_section_order_index): New method.
1245 (Layout::read_layout_from_file): New method.
1246 * layout.h (Layout::find_section_order_index): New method.
1247 (Layout::read_layout_from_file): New method.
1248 (Layout::input_section_position_): New private member.
1249 (Layout::input_section_glob_): New private member.
1250 * main.cc (main): Call read_layout_from_file here.
1251 * options.h (--section-ordering-file): New option.
1252 * output.cc (Output_section::input_section_order_specified_): New
1254 (Output_section::Output_section): Initialize new member.
1255 (Output_section::add_input_section): Add new parameter.
1256 Keep input sections when --section-ordering-file is used.
1257 (Output_section::set_final_data_size): Sort input sections when
1258 section ordering file is specified.
1259 (Output_section::Input_section_sort_entry): Add new parameter.
1261 (Output_section::Input_section_sort_entry::compare_section_ordering):
1263 (Output_section::Input_section_sort_compare::operator()): Change to
1264 consider section_order_index.
1265 (Output_section::Input_section_sort_init_fini_compare::operator()):
1266 Change to consider section_order_index.
1267 (Output_section::Input_section_sort_section_order_index_compare
1268 ::operator()): New method.
1269 (Output_section::sort_attached_input_sections): Change to sort
1270 according to section order when specified.
1271 (Output_section::add_input_section<32, true>): Add new parameter.
1272 (Output_section::add_input_section<64, true>): Add new parameter.
1273 (Output_section::add_input_section<32, false>): Add new parameter.
1274 (Output_section::add_input_section<64, false>): Add new parameter.
1275 * output.h (Output_section::add_input_section): Add new parameter.
1276 (Output_section::input_section_order_specified): New
1278 (Output_section::set_input_section_order_specified): New method.
1279 (Input_section::Input_section): Initialize section_order_index_.
1280 (Input_section::section_order_index): New method.
1281 (Input_section::set_section_order_index): New method.
1282 (Input_section::section_order_index_): New member.
1283 (Input_section::Input_section_sort_section_order_index_compare): New
1285 (Output_section::input_section_order_specified_): New member.
1286 * script-sections.cc (is_wildcard_string): Delete and move modified
1288 (Output_section_element_input::Output_section_element_input): Modify
1289 call to is_wildcard_string.
1290 (Output_section_element_input::Input_section_pattern
1291 ::Input_section_pattern): Ditto.
1292 (Output_section_element_input::Output_section_element_input): Ditto.
1293 * testsuite/Makefile.am (final_layout): New test case.
1294 * testsuite/Makefile.in: Regenerate.
1295 * testsuite/final_layout.cc: New file.
1296 * testsuite/final_layout.sh: New file.
1298 2010-06-01 Rafael Espindola <espindola@google.com>
1300 * plugin.cc (Plugin::load): Pass the output name to the plugin.
1302 2010-06-01 Rafael Espindola <espindola@google.com>
1304 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
1305 visibility of symbols.
1307 2010-05-27 Doug Kwan <dougkwan@google.com>
1309 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
1310 from start of output section instead of address for a local symbol
1311 in a merged or relaxed section when doing a relocatable link.
1313 2010-05-26 Rafael Espindola <espindola@google.com>
1316 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
1317 adding sections the garbage collector removed.
1318 * gold/testsuite/Makefile.am: Add test.
1319 * gold/testsuite/Makefile.in: Regenerate.
1320 * gold/testsuite/plugin_test_7.sh: New.
1321 * gold/testsuite/plugin_test_7_1.c: New.
1322 * gold/testsuite/plugin_test_7_2.c: New.
1324 2010-05-26 Rafael Espindola <espindola@google.com>
1326 * script-sections.cc (Output_section_definition::set_section_addresses):
1327 Check for --section-start.
1329 2010-05-26 Doug Kwan <dougkwan@google.com>
1331 * arm.cc (Arm_scan_relocatable_relocs): New class.
1332 (Target_arm::relocate_special_relocatable): New method.
1333 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
1334 (Arm_relocate_functions::thumb_branch_common): Same.
1335 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
1336 instead of Default_scan_relocatable_relocs.
1337 * target-reloc.h (relocate_for_relocatable): Let target handle
1338 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
1339 * target.h (Sized_target::relocate_special_relocatable): New method.
1341 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1343 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
1345 2010-05-23 Doug Kwan <dougkwan@google.com>
1347 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
1349 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
1350 with a direct branch, not a conditional branch, to a stub.
1351 * merge.cc (Output_merge_base::record_input_section): New method
1353 (Output_merge_data::do_add_input_section): Record input section if
1354 keeps-input-sections flag is set.
1355 (Output_merge_string::do_add_input_section): Ditto.
1356 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
1357 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
1359 (Output_merge_base::keeps_input_sections,
1360 Output_merge_base::set_keeps_input_sections,
1361 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
1363 (Output_merge_base::Input_sections): New type declaration.
1364 (Output_merge_base::input_sections_begin,
1365 Output_merge_base::input_sections_end,
1366 Output_merge_base::do_set_keeps_input_sections): New method definitions.
1367 (Output_merge_base::bool keeps_input_sections_,
1368 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
1369 Output_merge_base::input_sections_): New data members.
1370 (Output_merge_data::do_set_keeps_input_sections): New method
1372 (Output_merge_string::do_set_keeps_input_sections): Ditto.
1373 * output.cc (Output_section::Input_section::relobj): Move method
1374 defintion from class declaration to here and handle merge sections.
1375 (Output_section::Input_section::shndx): Ditto.
1376 (Output_section::Output_section): Remove initializations of removed
1377 data members and initialize new data member LOOKUP_MAPS_.
1378 (Output_section::add_input_section): Set keeps-input-sections flag
1379 for a newly created merge output section as appropriate. Adjust code
1380 to use Output_section_lookup_maps class.
1381 (Output_section::add_relaxed_input_section): Adjst code for lookup
1382 maps code refactoring.
1383 (Output_section::add_merge_input_section): Add a new parameter
1384 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
1385 class. If adding input section to a newly created merge output
1386 section fails, remove the new merge section.
1387 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
1388 Adjust code for use of the Output_section_lookup_maps class.
1389 (Output_section::find_merge_section): Ditto.
1390 (Output_section::build_lookup_maps): New method defintion.
1391 (Output_section::find_relaxed_input_section): Adjust code to use
1392 Output_section_lookup_maps class.
1393 (Output_section::get_input_sections): Export merge sections. Adjust
1394 code to use Output_section_lookup_maps class.
1395 (Output_section:::add_script_input_section): Adjust code to use
1396 Output_section_lookup_maps class. Update lookup maps for merge
1398 (Output_section::discard_states): Use Output_section_lookup_maps.
1399 (Output_section::restore_states): Same.
1400 * output.h (Merge_section_properties): Move class defintion out of
1402 (Output_section_lookup_maps): New class.
1403 (Output_section::Input_section::is_merge_section): New method
1405 (Output_section::Input_section::relobj): Move defintion out of class
1406 defintion. Declare method only.
1407 (Output_section::Input_section::shndx): Ditto.
1408 (Output_section::Input_section::output_merge_base): New method defintion.
1409 (Output_section::Input_section::u2_.pomb): New union field.
1410 (Output_section::Merge_section_by_properties_map,
1411 Output_section::Output_section_data_by_input_section_map,
1412 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
1414 (Output_section::add_merge_input_section): Add new parameter
1415 KEEPS_INPUT_SECTIONS.
1416 (Output_section::build_lookup_maps): New method declaration.
1417 (Output_section::merge_section_map_,
1418 Output_section::merge_section_by_properties_map_,
1419 Output_section::relaxed_input_section_map_,
1420 Output_section::is_relaxed_input_section_map_valid_): Remove data
1422 (Output_section::lookup_maps_): New data member.
1424 2010-05-21 Doug Kwan <dougkwan@google.com>
1427 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
1428 avoid a compilation error.
1430 2010-05-19 Rafael Espindola <espindola@google.com>
1432 * script-sections.cc (Output_section_definition::allocate_to_segment):
1433 Update the phdrs_list even when the output section is NULL.
1434 * testsuite/Makefile.am: Add test.
1435 * testsuite/Makefile.in: Regenerate.
1436 * testsuite/script_test_9.cc: New.
1437 * testsuite/script_test_9.sh: New.
1438 * testsuite/script_test_9.t: New.
1440 2010-05-19 Doug Kwan <dougkwan@google.com>
1442 * arm.cc (Arm_input_section::original_size): New method.
1443 (Arm_input_section::do_addralign): Add a cast.
1444 (Arm_input_section::do_output_offset): Remove static cast.
1445 (Arm_input_section::original_addralign,
1446 Arm_input_section::original_size_): Change type to uint32_t.
1447 (Arm_input_section::init): Add safe casts for section alignment
1449 (Arm_input_section::set_final_data_size): Do not set address and
1450 offset of stub table.
1451 (Arm_output_section::fix_exidx_coverage): Change use of of
1452 Output_section::Simple_input_section to that of
1453 Output_section::Input_section.
1454 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
1455 except for the first pass.
1456 * output.cc (Output_section::get_input_sections): Change type of
1457 input_sections to std::list<Input_section>.
1458 (Output_section::add_script_input_section): Rename from
1459 Output_section::add_simple_input_section. Change type of SIS
1460 parameter from Simple_input_section to Input_section.
1461 * output.h (Output_section::Simple_input_section): Remove class.
1462 (Output_section::Input_section): Change class visibility to public.
1463 (Output_section::Input_section::addralign): Use stored alignments
1464 for special input sections if set.
1465 (Output_section::Input_section::set_addralign): New method.
1466 (Output_section::get_input_sections): Change parameter type from
1467 list of Simple_input_section to list of Input_section.
1468 (Output_section::add_script_input_section): Rename from
1469 Output_section::add_simple_input_section. Change first parameter's
1470 type from Simple_input_section to Input_section and remove the
1471 second and third parameters.
1472 * script-sections.cc (Input_section::Input_section_list): Change
1473 type to list of Output_section::Input_section/
1474 (Input_section_info::Input_section_info): Change parameter type of
1475 INPUT_SECTION to Output_section::Input_section.
1476 (Input_section_info::input_section): Change return type.
1477 (Input_section_info::input_section_): Change type to
1478 Output_section::Input_section.
1479 (Output_section_element_input::set_section_addresses): Adjust code
1480 to use Output_section::Input_section instead of
1481 Output_section::Simple_input_section. Adjust code for renaming
1482 of Output_section::add_simple_input_section.
1483 (Orphan_output_section::set_section_addresses): Ditto.
1485 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1487 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
1488 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
1490 2010-05-18 Rafael Espindola <espindola@google.com>
1492 * options.cc (General_options::finalize): Handle -nostdlib.
1493 * options.h (nostdlib): New option.
1494 * script.cc (script_add_search_dir): Handle -nostdlib.
1496 2010-05-12 Doug Kwan <dougkwan@google.com>
1498 * arm.cc (Target_arm::do_finalize_sections): Create an empty
1499 attributes section only if there no attributes section after merging.
1500 (Target_arm::merge_object_attributes): Move value of
1501 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
1502 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
1503 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
1504 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
1505 and arm_attr_merge_7.stdout.
1506 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
1507 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
1508 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
1509 arm_attr_merge_7b.o): New rules.
1510 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
1512 * testsuite/Makefile.in: Regenerate.
1513 * testsuite/arm_attr_merge.sh: New file.
1514 * testsuite/arm_attr_merge_[67][ab].s: Same.
1516 2010-05-05 Nick Clifton <nickc@redhat.com>
1518 * po/es.po: Updated Spanish translation.
1520 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
1522 * Makefile.am (install-exec-local): Properly install gold as
1523 default cross linker.
1524 * Makefile.in: Regenerated.
1526 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
1527 Nick Clifton <nickc@redhat.com>
1529 * configure.ac (install_as_default): Define and set to false
1530 unless --enable-gold or --enable-gold=both/gold has been
1532 * configure: Regenerate.
1534 * Makefile.am (install-exec-local): Install the executable as
1535 'ld.gold'. If install_as_default is true then also install it as
1537 * Makefile.in: Regenerated.
1539 2010-04-24 Ian Lance Taylor <iant@google.com>
1541 * layout.cc (Layout::layout_reloc): In relocatable link don't
1542 combine reloc sections for grouped sections.
1544 2010-04-23 Sriraman Tallam <tmsriram@google.com>
1546 * gc.h (gc_process_relocs): Pass information on relocs pointing to
1547 sections that are not ordinary to icf.
1548 * icf.cc (get_section_contents): Handle relocation pointing to section
1549 with no object or shndx information.
1550 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
1551 * testsuite/Makefile.in: Regenerate.
1552 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
1553 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
1555 2010-04-22 Ian Lance Taylor <iant@google.com>
1557 * expression.cc (Expression::Expression_eval_info): Add
1558 result_alignment_pointer field.
1559 (Expression::eval_with_dot): Add result_alignment_pointer
1560 parameter. Change all callers.
1561 (Expression::eval_maybe_dot): Likewise.
1562 (class Binary_expression): Add alignment_pointer parameter to
1563 left_value and right_value. Change all callers.
1564 (BINARY_EXPRESSION): Set result alignment.
1565 (class Trinary_expression): Add alignment_pointer parameter to
1566 arg2_value and arg3_value. Change all callers.
1567 (Trinary_cond::value): Set result alignment.
1568 (Max_expression::value, Min_expression::value): Likewise.
1569 (Align_expression::value): Likewise.
1570 * script-sections.cc (class Sections_element): Add dot_alignment
1571 parameter to set_section_addresses virtual function. Update
1573 (class Output_section_element): Likewise.
1574 (Script_sections::create_segments): Add dot_alignment parameter.
1576 (Script_sections::create_segments_from_phdrs_clause): Likewise.
1577 (Script_sections::set_phdrs_clause_addresses): Likewise.
1578 * script-sections.h: Update declarations.
1579 * script.h: Update declarations.
1580 * output.h (Output_segment::set_minimum_p_align): Don't decrease
1582 * testsuite/script_test_3.t: Set large alignment.
1583 * testsuite/script_test_3.sh: Make sure that at least one LOAD
1584 segment has expected alignment.
1586 2010-04-22 Nick Clifton <nickc@redhat.com>
1588 * po/gold.pot: Updated by the Translation project.
1589 * po/vi.po: Updated Vietnamese translation.
1591 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
1593 * testsuite/Makefile.am (check_PROGRAMS): Add
1594 icf_virtual_function_folding_test.
1595 * testsuite/Makefile.in: Regenerated.
1597 2010-04-15 Andrew Haley <aph@redhat.com>
1599 * options.h (merge_exidx_entries): New option.
1600 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
1601 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
1602 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
1603 (Target_arm::merge_exidx_entries): New function.
1604 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
1605 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
1606 to Arm_exidx_fixup constructor.
1607 Add new arg, merge_exidx_entries.
1608 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
1609 Arm_output_section::fix_exidx_coverage.
1611 2010-04-18 Sriraman Tallam <tmsriram@google.com>
1613 * icf.cc (get_section_contents): Check for preemptible functions.
1614 Ignore addend when appropriate.
1615 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
1617 (add_from_relobj): Check for section folded.
1618 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
1619 * symtab.h (should_add_dynsym_entry): Add new parameter.
1620 * target-reloc.h (scan_relocs): Check for section folded.
1621 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
1622 Check reloc types for function pointers in shared objects.
1623 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
1625 (icf_preemptible_functions_test): New test case.
1626 (icf_string_merge_test): New test case.
1627 * testsuite.Makefile.in: Regenerate.
1628 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
1629 bar_glob. Refactor code.
1630 * testsuite/icf_preemptible_functions_test.cc: New file.
1631 * testsuite/icf_preemptible_functions_test.sh: New file.
1632 * testsuite/icf_string_merge_test.cc: New file.
1633 * testsuite/icf_string_merge_test.sh: New file.
1634 * testsuite/icf_virtual_function_folding_test.cc: New file.
1635 * testsuite/icf_virtual_function_folding_test.sh: New file.
1637 2010-04-14 Doug Kwan <dougkwan@google.com>
1639 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
1640 for local symbol recounting if we remove a section due to ICF.
1641 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
1642 there are no regular objects in input.
1644 2010-04-13 Doug Kwan <dougkwan@google.com>
1646 * arm.cc (Arm_input_section::set_final_data_size): Compute
1647 accurate final data size instead of using current data size.
1649 2010-04-09 Doug Kwan <dougkwan@google.com>
1651 * layout.cc (Layout::choose_output_section): Handle script section
1653 (Layout::make_output_section_for_script): Add section type parameter.
1654 Handle script section types.
1655 * layout.h (Layout::make_output_section_for_script): Add section
1657 * output.cc (Output_section::Output_section): Initialize data member
1659 (Output_section::do_reset_address_and_file_offset): Do not set address
1660 to 0 if section is a NOLOAD section.
1661 * output.h (Output_section::is_noload): New method.
1662 (Output_section::set_is_noload): Ditto.
1663 (Output_section::is_noload_): New data member.
1664 * script-c.h (Script_section_type): New enum type.
1665 (struct Parser_output_section_header): Add new file section_type.
1666 * script-sections.cc (Sections_element::output_section_name): Add
1667 parameter for returning script section type.
1668 (Output_section_definition::output_section_name): Ditto.
1669 (Output_section_definition::section_type)P; New method.
1670 (Output_section_definiton::script_section_type_name): Ditto.
1671 (Output_section_definition::script_section_type_): New data member.
1672 (Output_section_definition::Output_section_definition): Initialize
1673 data member Output_section_definition::script_section_type_.
1674 (Output_section_definition::create_sections): Pass script section type
1675 to Layout::make_output_section_for_script.
1676 (Output_section_definition::output_section_name): Return script
1677 section type to caller.
1678 (Output_section_definition::set_section_address): Do not advance
1679 dot value and load address if section type is NOLOAD. Set address
1680 of NOLOAD sections regardless of section flags.
1681 (Output_section_definition::print): Print section type if it is
1682 not SCRIPT_SECTION_TYPE_NONE.
1683 (Output_section_definition::section_type): New method.
1684 (Output_section_definition::script_section_type_name): Ditto.
1685 (Script_sections::output_section_name): Add new parameter
1686 PSECTION_TYPE for returning script section type. Pass it to
1687 section elements. Handle discard sections.
1688 (Sort_output_sections::operator()): Handle NOLOAD sections.
1689 * script-sections.h (Script_sections::Section_type): New enum type.
1690 (Script_sections::output_section_name): Add a new parameter for
1691 returning script section type.
1692 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
1694 * yyscript.y (union): Add new field SECTION_TYPE.
1695 (COPY, DSECT, INFO, NOLOAD): New tokens.
1696 (opt_address_and_section_type): Change type to output_section_header.
1697 (section_type): New non-terminal
1698 (section_header): Handle section type.
1699 (opt_address_and_section_type): Return section type value.
1701 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
1703 * testsuite/plugin_common_test_1.c (foo): Add prototype.
1704 * testsuite/plugin_common_test_2.c (foo): Likewise.
1706 2010-04-08 Doug Kwan <dougkwan@google.com>
1708 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
1710 * output.cc (Output_section::add_merge_input_section): Simplify
1711 code and return status of Output_merge_base::add_input_section.
1712 Update merge section map only if Output_merge_base::add_input_section
1715 2010-04-07 Doug Kwan <dougkwan@google.com>
1717 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
1718 if section is marked as containing instructions but has no mapping
1720 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
1721 correct section index.
1722 (Arm_relobj::find_linked_text_section): Ditto.
1724 2010-04-07 Cary Coutant <ccoutant@google.com>
1726 * archive.cc (include_member): Destroy Read_symbols_data object before
1728 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
1729 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
1730 (Read_symbols_data::~Read_symbols_data) New destructor.
1731 (Section_relocs::Section_relocs) New constructor.
1732 (Section_relocs::~Section_relocs) New destructor.
1733 (Read_relocs_data::Read_relocs_data) New constructor.
1734 (Read_relocs_data::~Read_relocs_data) New destructor.
1735 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
1736 pointers to NULL after deleting.
1738 2010-04-07 Doug Kwan <dougkwan@google.com>
1740 * arm.cc: Replace "endianity" with "endianness" in comments.
1741 (Arm_exidx_cantunwind): Ditto.
1742 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
1743 (Arm_relobj::merge_flags_and_attributes): New method.
1744 (Arm_relobj::merge_flags_and_attributes_): New data member.
1745 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
1746 (Arm_relobj::scan_sections_for_stubs): Ditto.
1747 (Arm_relobj::do_read_symbols): Check to see if we really want to
1748 merge processor-specific flags and attributes. Exit early if
1749 an object is empty except for section names and the undefined symbol.
1750 (Target_arm::do_finalize_sections): Move check for ELF format to
1751 Arm_relobj::do_read_symbols. Merge processor specific flags and
1752 attributes from a regular object only when we have determined that
1753 it is aapropriate. Do not create an .ARM.attributes section in
1754 output if there is no regular input object.
1755 (Target_arm::merge_processor_specific_flags): Check
1756 --warn-mismatch before printing any error.
1757 (Target_arm::merge_object_attributes): Ditto.
1758 * gold.cc (queue_middle_tasks): Handle the case in which there is
1759 no regular object in input.
1760 * options.cc (General_options::parse_EB): New method.
1761 (General_options::parse_EL): Same.
1762 (General_options::General_options): Initialize endianness_.
1763 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
1765 (General_options::Endianness): New enum.
1766 (General_options::endianness): New method.
1767 (General_options::endianness_): New data member.
1768 * parameters.cc (Parameters::set_options): Check target endianness.
1769 (Parameters::set_target_once): Ditto.
1770 (Parameters::check_target_endianness): New method.
1771 (parameters_force_valid_target): If either -EL or -EB is specified,
1772 use it to define endianness of default target.
1773 * parameters.h (Parameters::check_target_endianness): New method
1775 * target.h (class Target): Change "endianity" to "endianness"
1778 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1780 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
1781 * configure: Regenerate.
1782 * Makefile.in: Regenerate.
1783 * testsuite/Makefile.in: Regenerate.
1785 2010-04-06 Cary Coutant <ccoutant@google.com>
1788 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
1789 prevailing definitions of common symbols.
1790 * testsuite/plugin_test_6.sh: New test case.
1791 * testsuite/plugin_common_test_1.c: New test case.
1792 * testsuite/plugin_common_test_2.c: New test case.
1793 * testsuite/Makefile.am (plugin_test_6): New test case.
1794 * testsuite/Makefile.in: Regenerate.
1796 2010-04-06 Nick Clifton <nickc@redhat.com>
1798 * po/vi.po: New Vietnamese translation.
1800 2010-03-30 Doug Kwan <dougkwan@google.com>
1802 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
1804 2010-03-25 Doug Kwan <dougkwan@google.com>
1806 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
1807 to avoid a conversion warning on a 32-bit host.
1809 2010-03-24 Ian Lance Taylor <iant@google.com>
1811 * testsuite/script_test_3.t: Add a TLS segment.
1812 * testsuite/Makefile.am (check_PROGRAMS): Add
1813 tls_phdrs_script_test.
1814 (tls_phdrs_script_test_SOURCES): Define.
1815 (tls_phdrs_script_test_DEPENDENCIES): Define.
1816 (tls_phdrs_script_test_LDFLAGS): Define.
1817 (tls_phdrs_script_test_LDADD): Define.
1818 * testsuite/Makefile.in: Rebuild.
1820 2010-03-23 Cary Coutant <ccoutant@google.com>
1822 * fileread.cc (find_or_make_view): Fix comment.
1824 2010-03-23 Ian Lance Taylor <iant@google.com>
1826 * script-sections.cc (class Orphan_section_placement): Define
1827 PLACE_TLS and PLACE_TLS_BSS.
1828 (Orphan_section_placement::Orphan_section_placement): Initialize
1830 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
1831 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
1832 (tls_script_test_SOURCES): Define.
1833 (tls_script_test_DEPENDENCIES): Define.
1834 (tls_script_test_LDFLAGS): Define.
1835 (tls_script_test_LDADD): Define.
1836 * testsuite/Makefile.in: Rebuild.
1838 2010-03-22 Doug Kwan <dougkwan@google.com>
1840 * arm.cc (Arm_relocate_functions::abs8,
1841 Arm_relocate_functions::abs16): Use correct check for overflow
1842 specified in the ARM ELF specs.
1843 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
1844 target of a BLX instruction specially.
1845 (Reloc_stub::stub_type_for_reloc): Ditto.
1846 (Relocate::relocate): Use symbolic names instead of numeric relocation
1847 codes to report error.
1848 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
1850 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
1851 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
1852 thumb2_blx_out_of_range.stdout
1853 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
1854 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
1855 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
1856 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
1857 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
1858 thumb2_blx_in_range, thumb2_blx_in_range.o,
1859 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
1860 thumb2_blx_out_of_range.o): New rules.
1861 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
1862 thumb2_blx_in_range and thumb2_blx_out_of_range.
1863 * testsuite/Makefile.in: Regenerate.
1864 * arm_branch_in_range.sh: Add tests for THUMB BLX.
1865 * testsuite/thumb_blx_in_range.s: New file.
1866 * testsuite/thumb_blx_out_of_range.s: New file.
1868 2010-03-22 Rafael Espindola <espindola@google.com>
1870 * archive.cc (Should_include): Move to archive.h.
1871 (should_include_member): Make it a member of Archive.
1873 (Add_lib_group_symbols): New.
1874 * archive.h: Include options.h.
1875 (Archive_member): Moved from Archive.
1876 (Should_include): Moved from archive.cc.
1878 (Add_lib_group_symbols): New.
1879 * dynobj.cc (do_should_include_member): New.
1880 * dynobj.h (do_should_include_member): New.
1881 * gold.cc (queue_initial_tasks): Update call to queue.
1882 * main.cc (main): Print lib group stats.
1883 * object.cc (do_should_include_member): New.
1884 * object.h: Include archive.h.
1885 (Object::should_include_member): New.
1886 (Object::do_should_include_member): New.
1887 (Sized_relobj::do_should_include_member): New.
1888 * options.cc (General_options::parse_start_lib): New.
1889 (General_options::parse_end_lib): New.
1890 (Input_arguments::add_file): Handle lib groups.
1891 (Input_arguments::start_group): Check we are not in a lib.
1892 (Input_arguments::start_lib): New.
1893 (Input_arguments::end_lib): New.
1894 * options.h (General_options): Add start_lib and end_lib.
1895 (Input_argument::lib_): New.
1896 (Input_argument::lib): New.
1897 (Input_argument::is_lib): New.
1898 (Input_file_lib): New.
1899 (Input_arguments::in_lib_): New.
1900 (Input_arguments::in_lib): New.
1901 (Input_arguments::start_lib): New.
1902 (Input_arguments::end_lib_): New.
1903 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
1904 in unused members as preempted.
1905 (Sized_pluginobj::do_should_include_member): New.
1906 * plugin.h (Sized_pluginobj::do_should_include_member): New.
1907 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
1909 (Read_symbols::do_whole_lib_group): New.
1910 (Read_symbols::do_lib_group): New.
1911 (Read_symbols::do_read_symbols): Handle lib groups.
1912 (Read_symbols::get_name): Handle lib groups.
1913 * readsyms.h (Read_symbols): Add an archive member pointer.
1914 (Read_symbols::do_whole_lib_group): New.
1915 (Read_symbols::do_lib_group): New.
1916 (Read_symbols::member_): New.
1917 * script.cc (read_input_script): Update call to queue_soon.
1919 2010-03-19 Doug Kwan <dougkwan@google.com>
1921 * arm.cc (Stub_table::Stub_table): Initialize new data members
1922 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
1923 (Stub_table::add_reloc_stub): Assign stub offset and update
1924 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
1925 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
1927 (Stub_table::update_data_size_and_addralign): Use
1928 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
1929 instead of going over all reloc stubs.
1930 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
1931 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
1932 Stringpool_template::offset_ to size of Stringpool_char.
1933 (Stringpool_template::new_key_offset): Remove code to initialize
1934 Stringpool_template::offset_.
1935 * stringpool.h (Stringpool_template::set_no_zero_null): Set
1936 Stringpool_template::offset_ to zero.
1938 2010-03-15 Doug Kwan <dougkwan@google.com>
1940 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
1942 (Stringpool_template::new_key_offset): New method.
1943 (Stringpool_template::add_string): Assign offsets when adding new
1945 (Stringpool_template::set_string_offsets): Do not set string offsets
1946 when not optimizing.
1947 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
1949 (Chunked_vector::clear): Clear size_.
1950 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
1951 (Chunked_vector::size): Return size_.
1952 (Chunked_vector::push_back): Use size_ to find insert position.
1953 (Chunked_vector::size_): New data member.
1954 (Stringpool_template::set_no_zero_null): Assert string set is empty.
1955 (Stringpool_template::new_key_offset): New method declaration.
1956 (Stringpool_template::offset_): New data member.
1958 2010-03-15 Rafael Espindola <espindola@google.com>
1960 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
1961 Add_symbols' constructor.
1962 * readsyms.h (Add_symbols): Remove the input_group member.
1964 2010-03-10 Ian Lance Taylor <iant@google.com>
1966 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
1967 target to ask whether a reference to a symbol requires a stack
1969 * target.h (Target::is_call_to_non_split): New function.
1970 (Target::do_is_call_to_non_split): Declare virtual function.
1971 * target.cc: Include "symtab.h".
1972 (Target::do_is_call_to_non_split): New function.
1973 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
1975 2010-03-10 Cary Coutant <ccoutant@google.com>
1977 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
1978 (File_read::open[1]): Remove initial mapping of whole_file_view_.
1979 (File_read::open[2]): Add whole_file_view_ to list of views.
1980 (File_read::make_view): Remove test of whole_file_view_.
1981 (File_read::find_or_make_view): Create whole_file_view_ if
1983 (File_read::clear_views): Replace bool parameter with enum;
1984 adjust all callers. Don't delete views with permanent data;
1985 do delete cached views and views from archives if
1986 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
1987 if clearing the corresponding view.
1988 * fileread.h (File_read::Clear_views_mode): New enum.
1989 (File_read::View::is_permanent_view): New method.
1990 (File_read::clear_views): Replace bool parameter
1991 with enum; adjust all callers.
1992 * options.h (General_options): Change keep_files_mapped option;
1993 add map_whole_files.
1994 * readsyms.cc (Add_symbols::run): Delete sd_ object before
1996 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
1999 2010-03-10 David S. Miller <davem@davemloft.net>
2001 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
2003 2010-03-09 Sriraman Tallam <tmsriram@google.com>
2005 * icf.cc (get_section_contents): Add '@' marker after processing the
2008 2010-03-08 Doug Kwan <dougkwan@google.com>
2010 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
2011 due to a conversion warning.
2012 (Arm_relobj::update_output_local_symbol_count): Check for local
2013 symbol with unset output index.
2015 2010-03-05 Ian Lance Taylor <iant@google.com>
2017 * options.h (class General_options): Add --spare-dynamic-tags.
2018 * output.cc (Output_data_dynamic::set_final_data_size): Implement
2019 --spare-dynamic-tags.
2021 2010-03-05 Ian Lance Taylor <iant@google.com>
2023 * incremental.cc: Include "libiberty.h".
2025 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2027 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
2028 function, is_info_ member.
2029 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
2030 (Versions::Versions): Update caller.
2031 (Versions::define_base_version): Likewise.
2032 (Versions::add_def): Likewise.
2034 2010-03-03 Sriraman Tallam <tmsriram@google.com>
2036 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
2037 (Scan::possible_function_pointer_reloc): New function.
2038 (Scan::local_reloc_may_be_function_pointer): Change to call
2039 possible_function_pointer_reloc.
2040 (Scan::global_reloc_may_be_function_pointer): Ditto.
2041 * icf.h (Icf::check_section_for_function_pointers): Change to reject
2042 relocations in ".data.rel.ro._ZTV" section.
2043 * testsuite/icf_safe_so_test.sh: Change to pass i386.
2044 * testsuite/icf_safe_so_test.cc: Ditto.
2045 * testsuite/icf_safe_test.cc: Ditto.
2046 * testsuite/icf_safe_test.sh: Ditto.
2048 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2049 Ian Lance Taylor <iant@google.com>
2051 * target-reloc.h (relocate_section): Check the symbol table index
2052 for -1U before setting the local symbol index.
2053 (scan_relocatable_relocs): If copying the relocation, record that
2054 the local symbol is required.
2055 * object.h (Symbol_value::is_output_symtab_index_set): New
2057 (Symbol_value::may_be_discarded_from_output_symtab): New
2059 (Symbol_value::has_output_symtab_entry): New function.
2060 (Symbol_value::needs_output_symtab_entry): Remove.
2061 (Symbol_value::output_symtab_index): Make sure the symbol index is
2063 (Symbol_value::set_output_symtab_index): Make sure the symbol
2064 index is not set. Make sure the new index is valid.
2065 (Symbol_value::set_must_have_output_symtab_entry): New function.
2066 (Symbol_value::has_output_dynsym_entry): New function.
2067 (Symbol_value::set_output_dynsym_index): Make sure the new index
2069 (Sized_relobj::set_must_have_output_symtab_entry): New function.
2070 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
2071 local symbol if permitted.
2072 (Sized_relobj::do_finalize_local_symbols): Call
2073 is_output_symtab_index_set rather than needs_output_symtab_entry.
2074 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
2075 rather than needs_output_symtab_entry. Call
2076 has_output_dynsym_entry rather than needs_output_dynsym_entry.
2077 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
2078 is_output_symtab_index_set rather than needs_output_symtab_entry.
2079 * testsuite/discard_locals_relocatable_test.c: New file.
2080 * testsuite/discard_locals_test.sh: Test -r.
2081 * testsuite/Makefile.am (check_DATA): Add
2082 discard_locals_relocatable_test1.syms,
2083 discard_local_relocatable_test2.syms.
2084 (MOSTLYCLEANFILES): Likewise. Also add
2085 discard_locals_relocatable_test1.lout and
2086 discard_locals_relocatable_test2.out.
2087 (discard_locals_relocatable_test1.syms): New target.
2088 (discard_locals_relocatable_test.o): New target.
2089 (discard_locals_relocatable_test1.out): New target.
2090 (discard_locals_relocatable_test2.syms): New target.
2091 (discard_locals_relocatable_test2.out): New target.
2092 (various): Add missing ../ld-new dependencies.
2093 * testsuite/Makefile.in: Rebuild.
2095 2010-03-03 Nick Clifton <nickc@redhat.com>
2097 * po/fi.po: New Finnish translation.
2099 2010-03-01 Doug Kwan <dougkwan@google.com>
2101 * layout.cc (Layout::Layout): Force section types of .init_array*,
2102 .preinit_array* and .fini_array* sections.
2103 * output.cc (Output_section::Input_section_sort_entry::has_priority):
2104 Fix check of return value of std::string::find.().
2105 (Output_section::Input_section_sort_compare::operator()): Remove
2106 comment about .init_array.
2107 (Output_section::Input_section_sort_init_fini_compare::operator()):
2109 (Output_section::sort_attached_input_sections): Handle .init_array
2110 and .fini_array specially.
2111 * output.h (Output_section::Inut_section_sort_compare): Update
2113 (Output_section::Input_section_sort_init_fini_compare): New struct.
2115 2010-02-26 Doug Kwan <dougkwan@google.com>
2117 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
2118 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
2119 * testsuite/debug_msg.sh: Avoid matching source line number for
2120 use of global variable undef_int.
2122 2010-02-26 Doug Kwan <dougkwan@google.com>
2124 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
2125 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
2126 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
2127 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
2128 * options.cc (General_options::General_options): Initialize member
2130 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
2131 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
2132 and rm_no_fix_v4bx.stdout
2133 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
2134 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
2135 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
2136 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
2137 and arm_no_fix_v4bx.
2138 * Makefile.in: Regenerate.
2139 * testsuite/arm_fix_v4bx.s: New file.
2140 * testsuite/arm_fix_v4bx.sh: Ditto.
2142 2010-02-24 Doug Kwan <dougkwan@google.com>
2144 * arm.cc (Target_arm::got_section): Make the .got section the first
2145 non RELRO section in the data segment.
2146 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
2147 suffixes of section names.
2149 2010-02-24 Doug Kwan <dougkwan@google.com>
2151 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
2152 flags and attributes merging if an input file is a binary file.
2153 * fileread.cc (Input_file::open): Record format of original file.
2154 * fileread.h (Input_file::Format): New enum type.
2155 (Input_file::Input_file): Initialize data member format_.
2156 (Input_file::format): New method definition.
2157 (Input_file::format_):: New data member.
2159 2010-02-24 Doug Kwan <dougkwan@google.com>
2161 * arm.cc (Arm_output_data_got): New class.
2162 (ARM_TCB_SIZE): New constant
2163 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
2164 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
2165 If user uses a script with a SECTIONS clause, issue only a warning
2166 for a misplaced EXIDX input section. Otherwise, issue an error.
2167 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
2169 (Target_arm::got_mode_index_entry): Handle static linking.
2170 (Target_arm::Scan::local): Ditto.
2171 (Target_arm::Scan::global): Ditto.
2172 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
2173 all incorrectly implemented relocations.
2174 (Target_arm::fix_exidx_coverage): Pass layout to
2175 Arm_output_section::fix_exidx_coverage.
2176 * layout.cc (Layout::section_name_mapping): Remove trailing dots
2177 from ".ARM.exidx." and ".ARM.extab.".
2179 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2181 * arm.cc (Target_arm::do_finalize_sections): Create attribute
2182 section if it does not already exist.
2183 * attributes.cc (Attributes_section_data::Attributes_section_data):
2184 Don't crash if size is zero.
2186 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2187 Ian Lance Taylor <iant@google.com>
2189 * gold.cc (queue_middle_tasks): If no input files were opened,
2191 * workqueue.h (Task_function::Task_function): Assert that there is
2194 2010-02-22 Doug Kwan <dougkwan@google.com>
2196 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
2197 * icf.cc (get_section_contents): Cast snprintf arguments to long long
2198 types to avoid warnings due to different uint64_t implementations
2201 2010-02-21 Doug Kwan <dougkwan@google.com>
2203 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
2204 handling of the maximum backward branch offset.
2205 (Arm_relocate_functions::thumb_branch_common): Ditto.
2206 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
2207 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
2208 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2209 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
2210 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
2211 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
2212 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
2213 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
2214 thumb_bl_out_of_range thumb_bl_out_of_range.o,
2215 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
2216 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
2217 thumb2_bl_out_of_range.o): New rules.
2218 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
2219 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
2220 thumb2_bl_out_of_range
2221 * testsuite/Makefile.in: Regenerate.
2222 * testsuite/arm_bl_in_range.s: New file.
2223 * testsuite/arm_bl_out_of_range.s: Ditto.
2224 * testsuite/arm_branch_in_range.sh: Ditto.
2225 * testsuite/arm_branch_range.t: Ditto.
2226 * testsuite/thumb2_branch_range.t: Ditto.
2227 * testsuite/thumb_bl_in_range.s: Ditto.
2228 * testsuite/thumb_bl_out_of_range.s: Ditto.
2229 * testsuite/thumb_branch_range.t: Ditto.
2231 2010-02-20 Sriraman Tallam <tmsriram@google.com>
2233 * gc.h (gc_process_relocs): Change vectors to point to the new list.
2234 Add reloc offset information.
2235 * icf.cc (get_section_contents): Change iterators to point to the new
2236 vectors. Add reloc offset information to the contents.
2237 * icf.h (Icf::Sections_reachable_info): New typedef.
2238 (Icf::Sections_reachable_list): New typedef.
2239 (Icf::Offset_info): New typedef.
2240 (Icf::Reloc_info): New struct typedef.
2241 (Icf::Reloc_info_list): New typedef.
2242 (Icf::symbol_reloc_list): Delete method.
2243 (Icf::addend_reloc_list): Delete method.
2244 (Icf::section_reloc_list): Delete method.
2245 (Icf::reloc_info_list): New method.
2246 (Icf::reloc_info_list_): New member.
2248 2010-02-19 Doug Kwan <dougkwan@google.com>
2250 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
2251 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
2252 * arm.cc (Arm_relocation_functions): New forward declaration.
2253 (Target_arm::Target_arm): Initialize new data members
2254 got_mod_index_offset_ and tls_base_symbol_defined_.
2255 (Target_arm::Relocate::relocate_tls): New method.
2256 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
2257 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
2259 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
2260 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
2261 (Target_arm::got_mod_index_offset_,
2262 Target_arm::tls_base_symbol_defined_): New data members.
2263 (Target_arm::Scan::local, Target::Scan::global,
2264 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
2267 2010-02-18 Doug Kwan <dougkwan@google.com>
2269 * arm.cc (Arm_relobj::find_linked_text_section): New method.
2270 (Arm_relobj::make_exidx_input_section): Pass section index of linked
2271 text section as a parameter becuase some broken tools may not set
2272 the link in section header.
2273 (Target_arm::has_got_section): New method.
2274 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
2275 without any mapping symbol as data only. Remove warning.
2276 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
2277 link in its section header, try to discover the link by inspecting the
2278 REL31 relocation at the beginning of the section.
2279 (Target_arm::Scan::check_non_pic): Report name of offending relocation
2281 (Target_arm::Scan::global): Treat any reference to the symbol
2282 _GLOBAL_OFFSET_TABLE_ as a GOT access.
2284 2010-02-12 Sriraman Tallam <tmsriram@google.com>
2286 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
2287 (Scan::global_reloc_may_be_function_pointer): New function.
2288 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2289 (Scan::global_reloc_may_be_function_pointer): New function.
2290 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2291 (Scan::global_reloc_may_be_function_pointer): New function.
2292 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
2293 (Scan::global_reloc_may_be_function_pointer): New function.
2294 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
2295 (Scan::global_reloc_may_be_function_pointer): New function.
2296 (Scan::possible_function_pointer_reloc): New function.
2297 (Target_x86_64::can_check_for_function_pointers): New function.
2298 * gc.h (gc_process_relocs): Scan relocation types to determine if
2299 function pointers were taken for targets that support it.
2300 * icf.cc (Icf::find_identical_sections): Include functions for
2301 folding in safe ICF whose pointer is not taken.
2302 * icf.h (Secn_fptr_taken_set): New typedef.
2303 (fptr_section_id_): New member.
2304 (section_has_function_pointers): New function.
2305 (set_section_has_function_pointers): New function.
2306 (check_section_for_function_pointers): New function.
2307 * options.h: Fix comment for safe ICF option.
2308 * target.h (can_check_for_function_pointers): New function.
2309 * testsuite/Makefile.am: Add icf_safe_so_test test case.
2310 Modify icf_safe_test for X86-64.
2311 * testsuite/Makefile.in: Regenerate.
2312 * testsuite/icf_safe_so_test.cc: New file.
2313 * testsuite/icf_safe_so_test.sh: New file.
2314 * testsuite/icf_safe_test.cc (kept_func_3): New function.
2315 (main): Change to take pointer to function kept_func_3.
2316 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
2317 folding is done correctly for X86-64.
2319 2010-02-12 David S. Miller <davem@davemloft.net>
2321 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
2322 is_symbolless parameter.
2323 (Output_reloc<SHT_REL>::is_symbolless): New.
2324 (Output_reloc<SHT_REL>::is_symbolless_): New.
2325 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
2326 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
2327 (Output_reloc<SHT_RELA>::is_symbolless): New.
2328 (Output_data_reloc::add_global): Handle is_symbolless.
2329 (Output_data_reloc::add_global_relative): Likewise.
2330 (Output_data_reloc::add_local): Likewise.
2331 (Output_data_reloc::add_local_relative): Likewise.
2332 (Output_data_reloc::add_symbolless_global_addend): New.
2333 (Output_data_reloc::add_symbolless_local_addend): New.
2334 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
2336 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
2337 instead of ->is_relative_
2338 (Output_reloc::write): Likewise.
2339 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
2340 (Output_reloc::write_rel): Simplify.
2342 * sparc.cc (Target_sparc::Scan::local): Use
2343 ->add_symbolless_local_addend as needed.
2344 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
2345 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
2346 based upon relocation offset.
2348 2010-02-11 Doug Kwan <dougkwan@google.com>
2350 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
2351 (Target_arm::Scan::global): Ditto. Also remove a comment before the
2352 beginning of function.
2353 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
2354 and MOVT_ABS relocations. Those are non issued in scanning. Fix
2355 parameter is_32bit in calls to should_apply_static_reloc.
2356 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
2357 (check_DATA): Add arm_abs_global.stdout.
2358 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
2359 arm_abs_global.stdout): New rules.
2360 (MOSTLLYCLEANFILES): Add arm_abs_global
2361 * Makefile.in: Regenerate.
2362 * testsuite/arm_abs_global.s: New file.
2363 * testsuite/arm_abs_global.sh: Ditto.
2364 * testsuite/arm_abs_lib.s: Ditto.
2366 2010-02-11 Ian Lance Taylor <iant@google.com>
2368 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
2370 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
2371 Allocate_commons_task first.
2372 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
2373 task, rather than symtab_lock_.
2374 (Gc_process_relocs::~Gc_process_relocs): New function.
2375 (Gc_process_relocs::is_runnable): Check this_blocker_.
2376 (Gc_process_relocs::locks): Use next_blocker_ rather than
2378 (Scan_relocs::~Scan_relocs): New function.
2379 (Scan_relocs::is_runnable): Check this_blocker_ rather than
2381 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
2383 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
2384 fields. Add this_blocker_ and next_blocker_ fields. Adjust
2385 constructor accordingly.
2386 (class Gc_process_relocs): Likewise.
2387 (class Scan_relocs): Likewise.
2388 * common.h (class Allocate_commons_task): Remove symtab_lock_
2389 field, and corresponding constructor parameter.
2390 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
2392 (Allocate_commons_task::locks): Likewise.
2394 2010-02-11 Ian Lance Taylor <iant@google.com>
2396 * gold-threads.h (class Once): Define.
2397 (class Initialize_lock): Rewrite as child of Once.
2398 * gold-threads.cc (class Once_initialize): Define.
2399 (once_pointer_control): New static variable.
2400 (once_pointer, once_arg): New static variables.
2401 (c_run_once): New static function.
2402 (Once::Once, Once::run_once, Once::internal_run): New functions.
2403 (class Initialize_lock_once): Remove.
2404 (initialize_lock_control): Remove.
2405 (initialize_lock_pointer): Remove.
2406 (initialize_lock_once): Remove.
2407 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
2408 (Initialize_lock::initialize): Rewrite.
2409 (Initialize_lock::do_run_once): New function.
2410 * archive.cc (Archive::interpret_header): Only clear name if it is
2412 * fileread.cc: Include "gold-threads.h"
2413 (file_counts_lock): New static variable.
2414 (file_counts_initialize_lock): Likewise.
2415 (File_read::release): Only increment counts when using --stats.
2416 Use a lock around the increment.
2417 * parameters.cc (class Set_parameters_target_once): Define.
2418 (set_parameters_target_once): New static variable.
2419 (Parameters::Parameters): Move here from parameters.h.
2420 (Parameters::set_target): Rewrite.
2421 (Parameters::set_target_once): New function.
2422 (Parameters::clear_target): Move here and rewrite.
2423 * parameters.h (class Parameters): Update declarations. Add
2424 set_parameters_target_once_ field.
2425 (Parameters::Parameters): Move to parameters.cc.
2426 (Parameters::clear_target): Likewise.
2427 * readsyms.cc (Read_symbols::do_group): Create a Start_group
2429 (Start_group::~Start_group): New function.
2430 (Start_group::is_runnable): New function.
2431 (Start_group::locks, Start_group::run): New functions.
2432 (Finish_group::run): Change saw_undefined to size_t.
2433 * readsyms.h (class Start_group): Define.
2434 (class Finish_group): Change saw_undefined_ field to size_t.
2435 (Finish_group::Finish_group): Remove saw_undefined and
2436 this_blocker parameters. Change all callers.
2437 (Finish_group::set_saw_undefined): New function.
2438 (Finish_group::set_blocker): New function.
2439 * symtab.h (class Symbol_table): Change saw_undefined to return
2440 size_t. Change saw_undefined_ field to size_t.
2441 * target-select.cc (Set_target_once::do_run_once): New function.
2442 (Target_selector::Target_selector): Initialize set_target_once_
2443 field. Don't initialize lock_ and initialize_lock_ fields.
2444 (Target_selector::instantiate_target): Rewrite.
2445 (Target_selector::set_target): New function.
2446 * target-select.h (class Set_target_once): Define.
2447 (class Target_selector): Update declarations. Make
2448 Set_target_once a friend. Remove lock_ and initialize_lock_
2449 fields. Add set_target_once_ field.
2451 2010-02-10 Ian Lance Taylor <iant@google.com>
2453 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
2455 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
2456 (queue_middle_tasks): Add all blockers before queueing any tasks.
2457 (queue_final_tasks): Likewise.
2458 * token.h (Task_token::add_blockers): New function.
2459 * object.h (Input_objects::number_of_relobjs): New function.
2461 2010-02-10 Ian Lance Taylor <iant@google.com>
2463 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
2464 shared, not if not position independent.
2465 * x86_64.cc (Relocate::relocate_tls): Likewise.
2466 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
2467 (tls_pie_pic_test): New target.
2468 * testsuite/Makefile.in: Rebuild.
2470 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
2471 (tls_test_main_pie.o, tls_test_pie.o): New targets.
2472 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
2473 * testsuite/Makefile.in: Rebuild.
2475 2010-02-09 David S. Miller <davem@davemloft.net>
2477 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
2478 R_SPARC_RELATIVE using ->add_local_relative().
2479 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
2481 * output.h (Output_data_dynamic::add_section_size): New method
2482 that takes two Output_data objects.
2483 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
2484 entry param. Handle it in initializers.
2485 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
2486 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
2487 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
2489 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
2490 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
2491 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
2492 for dynrel_includes_plt.
2493 * i386.cc (Target_i386::do_finalize_sections): Likewise.
2494 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2495 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
2497 (Target_sparc::do_finalize_sections): Update to pass true for
2498 dynrel_includes_plt.
2499 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
2500 output before .rela.plt
2501 (Target_powerpc::do_finalize_sections): Update to pass true for
2502 dynrel_includes_plt when 32-bit.
2504 2010-02-08 Doug Kwan <dougkwan@google.com>
2506 * arm.cc (Arm_relobj::simple_input_section_output_address): New
2508 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
2509 Arm_relobj::scan_section_for_cortex_a8_stubs,
2510 Arm_relobj::do_relocation_section): Instead of calling
2511 Output_section::output_address, use faster
2512 Arm_relobj::simple_input_section_output_address.
2514 2010-02-08 David S. Miller <davem@davemloft.net>
2516 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
2517 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
2518 relocation helper function.
2520 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
2521 just like R_SPARC_GOT{10,13,22}.
2522 (Target_sparc::Scan::local): Likewise.
2523 (Target_sparc::Relocate:relocate): Likewise.
2525 2010-02-06 Ian Lance Taylor <iant@google.com>
2527 * configure.ac: Rewrite targetobjs duplicate removal code to use
2528 only shell constructs.
2529 * configure: Rebuild.
2531 2010-02-05 Doug Kwan <dougkwan@google.com>
2534 * arm.cc (Arm_relobj::section_is_scannable): New method.
2535 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
2536 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
2538 2010-02-04 Doug Kwan <dougkwan@google.com>
2541 * arm-reloc-property.cc (cstdio): Include.
2542 * configure.ac (targetobjs): Remove duplicates.
2543 * configure: Regenerate.
2544 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
2545 big and little endian version for a given address size.
2547 2010-02-03 Doug Kwan <dougkwan@google.com>
2549 * arm-reloc-property.cc
2550 (Arm_reloc_property_table::reloc_name_in_error_message): New method
2552 * arm-reloc-property.h
2553 (Arm_reloc_property_table::get_implemented_static_reloc_property):
2554 New method definition.
2555 (Arm_reloc_property_table::reloc_name_in_error_message): New method
2557 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
2559 (GOT_PREL): Change implemented to Y.
2560 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
2561 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
2562 (Arm_relocate_functions::movw_abs_nc): Remove method.
2563 (Arm_relocate_functions::movt_abs): Ditto.
2564 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
2565 (Arm_relocate_functions::thm_movt_abs): Ditto.
2566 (Arm_relocate_functions::movw_rel_nc): Ditto.
2567 (Arm_relocate_functions::movw_rel): Ditto.
2568 (Arm_relocate_functions::movt_rel): Ditto.
2569 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
2570 (Arm_relocate_functions:thm_movw_rel): Ditto.
2571 (Arm_relocate_functions:thm_movt_rel): Ditto.
2572 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
2573 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
2574 New method definitions.
2575 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
2576 (Arm_relocation_functions::arm_grp_ldr): Ditto.
2577 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
2578 (Arm_relocation_functions::arm_grp_ldc): Ditto.
2579 (Target_arm::Relocate::relocate): Check for non-static or
2580 unimplemented relocation code and exit early. Change calls to
2581 Target_arm::reloc_uses_thumb_bit and
2582 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
2583 instead. Refactor code to handle similar relocations to increase
2584 code sharing. Remove check for unsupported relocation code in switch
2586 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
2587 relocation property table to find out size. Change error message to
2588 print out the name of a relocation code instead of the numeric value.
2589 (Target_arm::scan_reloc_for_stub): Use relocation property table
2590 instead of calling Target_arm::reloc_uses_thumb_bit().
2592 2010-02-02 Doug Kwan <dougkwan@google.com>
2594 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
2595 types of relaxed input section.
2597 2010-02-02 Doug Kwan <dougkwan@google.com>
2599 * Makefile.am (HFILES): Add arm-reloc-property.h.
2601 (TARGETSOURCES): Add arm-reloc-property.cc
2602 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
2603 (libgold_a_SOURCES): $(DEFFILES)
2604 * Makefile.in: Regenerate.
2605 * arm-reloc-property.cc: New file.
2606 * arm-reloc-property.h: New file.
2607 * arm-reloc.def: New file.
2608 * arm.cc: Update comments.
2609 (arm-reloc-property.h): New included header.
2610 (arm_reloc_property_table): New global variable.
2611 (Target_arm::do_select_as_default_target): New method definition.
2612 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
2613 arm-reloc-property to targ_extra_obj.
2614 * parameters.cc (set_parameters_target): Call
2615 Target::select_as_default_target().
2616 * target.h (Target::select_as_default_target): New method definition.
2617 (Target::do_select_as_default_target): Same.
2619 2010-02-01 Doug Kwan <dougkwan@google.com>
2621 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
2622 first_output_text_section_.
2623 (Arm_exidx_fixup::first_output_text_section): New method definition.
2624 (Arm_exidx_fixup::first_output_text_section_): New data member.
2625 (Arm_exidx_fixup::process_exidx_section): Record the first text
2626 output section seen.
2627 (Arm_output_section::fix_exidx_coverage): Set correct linked section
2628 and entsize in output section header.
2630 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2632 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
2633 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
2634 (Arm_relocate_functions::thm_alu11): New Method.
2635 (Arm_relocate_functions::thm_pc8): New Method.
2636 (Arm_relocate_functions::thm_pc12): New Method.
2637 (Target_arm::Scan::local): Handle the relocations.
2638 (Target_arm::Scan::global): Likewise.
2639 (Target_arm::Relocate::relocate): Likewise.
2640 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
2642 2010-01-29 Doug Kwan <dougkwan@google.com>
2644 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
2645 of relocation types as ld.
2647 2010-01-29 Doug Kwan <dougkwan@google.com>
2649 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
2651 (Arm_relocate_functions::thumb_branch_common): Ditto.
2652 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
2653 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
2654 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
2655 Arm_relocate_functions::jump24): Remove.
2656 (Target_arm::Relocate::relocate): Adjust code to call
2657 Arm_relocation_functions::arm_branch_common and
2658 Arm_relocation_functions::thumb_branch_common instead of their removed
2659 wrappers. Merge switch-cases together to reduce source code size.
2661 2010-01-29 Doug Kwan <dougkwan@google.com>
2663 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
2664 output_local_symbol_count_needs_update_.
2665 (Arm_relobj::output_local_symbol_count_needs_update,
2666 Arm_relobj::set_output_local_symbol_count_needs_update,
2667 Arm_relobj::update_output_local_symbol_count): New methods.
2668 (Arm_relobj::output_local_symbol_count_needs_update_): New data
2670 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
2671 of pointed function as in a R_ARM_PREL31 relocation.
2672 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
2673 for output local symbol count updating.
2674 (Target_arm::do_relax): Update output local symbol counts in objects
2676 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
2678 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2680 * arm.cc: Added support for the ARM relocations:
2681 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
2682 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
2683 (Arm_relocate_functions::movw_rel_nc): Renamed (was
2685 (Arm_relocate_functions::movw_rel): New method.
2686 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
2687 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
2689 (Arm_relocate_functions::thm_movw_rel): New method.
2690 (Arm_relocate_functions::thm_movt_rel): Renamed (was
2692 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
2694 (Target_arm::Scan::global): Likewise.
2695 (Target_arm::Relocate::relocate): Likewise.
2696 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2699 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2701 * arm.cc: Added support for ARM group relocations.
2702 (Target_arm::reloc_needs_sym_origin): New method.
2703 (Arm_relocate_functions::calc_grp_kn): New method.
2704 (Arm_relocate_functions::calc_grp_residual): New method.
2705 (Arm_relocate_functions::calc_grp_gn): New method.
2706 (Arm_relocate_functions::arm_grp_alu): New Method.
2707 (Arm_relocate_functions::arm_grp_ldr): New Method.
2708 (Arm_relocate_functions::arm_grp_ldrs): New Method.
2709 (Arm_relocate_functions::arm_grp_ldc): New Method.
2710 (Target_arm::Scan::local): Handle the ARM group relocations.
2711 (Target_arm::Scan::global): Likewise.
2712 (Target_arm::Relocate::relocate): Likewise.
2713 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2716 2010-01-26 Doug Kwan <dougkwan@google.com>
2718 * arm.cc (set): Include.
2719 (class Arm_exidx_fixup): Change type of last_input_section_ to const
2721 (Arm_output_section::Text_section_list): New type.
2722 (Arm_output_section::append_text_sections_to_list): New method.
2723 (Arm_output_section::fix_exidx_coverage): Ditto.
2724 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2725 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2726 Relobj::set_section_offset() instead of
2727 Sized_relobj::invalidate_section_offset().
2728 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2729 parameter for section headers. Ignore relocation sections for
2730 unallocated sections and EXIDX sections.
2731 (Target_arm::fix_exidx_coverage): New method.
2732 (Target_arm::output_section_address_less_than): New type.
2733 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
2734 linked text section instead of the EXIDX section.
2735 (Arm_output_section::create_stub_group): Add an assertion to check
2736 that this is not an EXIDX output section.
2737 (Arm_output_section::append_text_sections_to_list): New method.
2738 (Arm_output_section::fix_exidx_coverage): Ditto.
2739 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2740 Arm_relobj::section_needs_reloc_stub_scanning.
2741 (Target_arm::do_relax): Fix EXIDX output section coverage in the
2743 (Target_arm::fix_exidx_coverage): New method.
2744 * object.h (Relobj::set_output_section): New method.
2745 (Sized_relobj::invalidate_section_offset): Remove method.
2746 (Sized_relobj::do_invalidate_section_offset): Remove method.
2747 (Sized_relobj::do_set_section_offset): Handle offset value -1.
2749 2010-01-25 Doug Kwan <dougkwan@google.com>
2751 * arm.cc (Arm_exidx_merged_section::do_output_offset):
2752 Fix warning due to signed and unsigned comparison on a 32-bit host.
2754 2010-01-22 Doug Kwan <dougkwan@google.com>
2756 * arm.cc (Target_arm::do_relax): Record an output section for section
2757 offset adjustment it contains any stub table that has changed.
2758 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
2759 offsets in an output section if necessary.
2760 * output.cc (Output_section::Output_section): Initialize
2761 section_offsets_need_adjustments_.
2762 (Output_section::add_input_section_for_script): Renamed to
2763 Output_section::add_simple_input_section.
2764 (Output_section::save_states): Add a comment.
2765 (Output_section::discard_states): New method defintion.
2766 (Output_section::adjust_section_offsets): Same.
2767 * output.h (Output_section::add_input_section_for_script): Renamed to
2768 Output_section::add_simple_input_section.
2769 (Output_section::discard_states): New method declaration.
2770 (Output_section::adjust_section_offsets): Same.
2771 (Output_section::section_offsets_need_adjustment,
2772 Output_section::set_section_offsets_need_adjustment): New method
2774 (Output_section::section_offsets_need_adjustment_): New data member.
2775 * script-sections.cc
2776 (Output_section_element_input::set_section_address): Adjust code for
2777 renaming of Output_section::add_input_section_for_script.
2778 (Orphan_output_section::set_section_address): Same.
2780 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2782 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
2783 Fix_v4bx enum values .
2784 * gold/options.h (General_options): New option definitions.
2785 (General_options::fix_v4bx): New method.
2786 (General_options::Fix_v4bx): New enum.
2787 * gold/options.cc (General_options::parse_fix_v4bx): New method.
2788 (General_options::parse_fix_v4bx_interworking): New method.
2790 2010-01-22 Doug Kwan <dougkwan@google.com>
2792 * arm.cc (Arm_exidx_fixup): New class.
2794 2010-01-21 Doug Kwan <dougkwan@google.com>
2796 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
2798 (Arm_exidx_section_offset_map): New type.
2800 2010-01-21 Doug Kwan <dougkwan@google.com>
2802 * arm.cc (Arm_exidx_input_section): New class.
2803 (Arm_relobj::exidx_input_section_by_link,
2804 Arm_relobj::exidx_input_section_by_shndx,
2805 Arm_relobj::make_exidx_input_section): New methods.
2806 (read_arm_attributes_section): Remove.
2807 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
2808 information about them.
2809 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
2812 2010-01-20 Doug Kwan <dougkwan@google.com>
2814 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
2815 Input_section_specifier to Section_id.
2816 (Target_arm::new_arm_input_section: Adjust code for change of key
2818 (Target_arm::find_arm_input_section): Ditto.
2819 * gc.h (object.h): Include for Section_id nand Section_id_hash.
2820 (Section_id): Remove.
2821 (Garbage_collection::Section_id_hash): Remove.
2822 * icf.h (object.h): Include for Section_id nand Section_id_hash.
2823 (Section_id): Remove.
2824 (Icf::Section_id_hash): Remove.
2825 * object.h (Section_id, Const_section_id, Section_id_hash,
2826 Const_section_id_hash): New type definitions.
2827 * output.cc (Output_section::add_relaxed_input_section): Change to
2828 use Const_section_id instead of Input_section_specifier as key type.
2829 (Output_section::add_merge_input_section): Ditto.
2830 (Output_section::build_relaxation_map): Change to use Section_id
2831 instead of Input_section_specifier as key type.
2832 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
2834 (Output_section::convert_input_sections_to_relaxed_sections): Change
2835 to use Const_section_id instead of Input_section_specifier as key type.
2836 (Output_section::find_merge_section): Ditto.
2837 (Output_section::find_relaxed_input_section): Ditto.
2838 * output.h (Input_section_specifier): Remove class.
2839 (Output_section::Output_section_data_by_input_section_map): Change
2840 key type to Const_section_id.
2841 (Output_section::Output_relaxed_input_section_by_input_section_map):
2843 (Output_section::Relaxation_map): Change key type to Section_id.
2845 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2847 * gold/arm.cc: Added support for R_ARM_V4BX relocation
2848 (class Arm_v4bx_stub): New class.
2849 (DEF_STUBS): Updated definition to support v4_veneer_bx.
2850 (Stub_factory::make_arm_v4bx_stub): New method.
2851 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
2852 (Stub_table::empty): Handle v4bx stubs.
2853 (Stub_table::add_arm_v4bx_stub): New method.
2854 (Stub_table::find_arm_v4bx_stub): New method.
2855 (Arm_relocate_functions::v4bx): New method.
2856 (Target_arm::fix_v4bx): New method.
2857 (Target_arm::Target_arm): Handle R_ARM_V4BX.
2858 (Stub_table::relocate_stubs): Likewise.
2859 (Stub_table::do_write): Likewise.
2860 (Stub_table::update_data_size_and_addralign): Likewise.
2861 (Stub_table::finalize_stubs): Likewise.
2862 (Target_arm::Scan::local): Likewise.
2863 (Target_arm::Scan::global): Likewise.
2864 (Target_arm::do_finalize_sections): Likewise.
2865 (Target_arm::Relocate::relocate): Likewise.
2866 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2868 (Target_arm::scan_reloc_for_stub): Likewise.
2869 (Target_arm::scan_reloc_section_for_stubs): Likewise.
2871 2010-01-19 Ian Lance Taylor <iant@google.com>
2873 * output.cc (Output_section_headers::do_sized_write): Write large
2874 segment count to sh_info field.
2875 (Output_file_header::do_sized_write): For large segment count,
2876 write PN_XNUM to e_phnum field.
2878 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2880 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
2881 (Arm_relocate_functions::thm_jump8): New function.
2882 (Arm_relocate_functions::thm_jump11): New function.
2883 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
2885 (Target_arm::Scan::global): Likewise.
2886 (Target_arm::Relocate::relocate): Likewise.
2887 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
2890 2010-01-14 Doug Kwan <dougkwan@google.com>
2892 * arm.cc (map, utility): Include headers.
2893 (Target_arm::apply_cortex_a8_workaround): New method.
2894 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
2895 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
2896 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
2897 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
2898 the --[no-]fix-cortex-a8 command line options.
2899 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
2900 (Target_arm::relocate_stub): Use addend in instruction template.
2901 * options.h (DEFINE_bool): Set the user-set flag.
2902 (General_options): Add --[no-]-fix-cortex options.
2903 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
2904 : Update fast look-up map after conversion.
2906 2010-01-14 Sriraman Tallam <tmsriram@google.com>
2908 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
2909 in the first pass of do_layout.
2911 2010-01-13 Doug Kwan <dougkwan@google.com>
2913 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
2914 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
2915 apparent compiler problem of not folding static constant integral
2916 data members of elfcpp::Elf_sizes<32>.
2918 2010-01-13 Doug Kwan <dougkwan@google.com>
2920 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
2921 Arm_relobj::section_needs_cortex_a8_stub_scanning,
2922 Arm_relobj::scan_section_for_cortex_a8_erratum,
2923 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
2924 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
2925 sections to scan for relocation stubs into a new method
2926 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
2927 relocation and Cortex-A8 stub scanning.
2928 (Target_arm::do_relax): Force stubs to be after stubbed sections
2929 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
2930 the beginning of a new relaxation pass. Update a comment.
2931 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
2933 2010-01-12 Ian Lance Taylor <iant@google.com>
2935 * target-reloc.h (visibility_error): New inline function.
2936 (relocate_section): Call visibility_error.
2937 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
2938 (MOSTLYCLEANFILES): Likewise.
2939 (protected_4_pic.o, protected_3.err): New targets.
2940 * testsuite/protected_4.cc: New file.
2942 2010-01-12 Doug Kwan <dougkwan@google.com>
2944 * arm.cc (Cortex_a8_reloc): New class.
2945 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
2946 and cortex_a8_relocs_info_.
2947 (Target_arm::fix_cortex_a8): New method definition.
2948 (Target_arm::Cortex_a8_relocs_info): New type.
2949 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
2950 New data member declarations.
2951 (Target_arm::scan_reloc_for_stub): Record information about
2952 relocations for THUMB branches that might be exempted from the
2953 Cortex-A8 workaround.
2954 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
2955 at the beginning of a relaxation pass.
2957 2010-01-12 Doug Kwan <dougkwan@google.com>
2959 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
2960 (Arm_relobj::Mapping_symbol_position,
2961 Arm_reloj::Mapping_symbol_position_less,
2962 Arm_relobj::Mapping_symbols_info): New types.
2963 (Target_arm::is_mapping_symbol_name): New method definition.
2964 (Arm_relobj::do_count_local_symbols): Save information about mapping
2967 2010-01-11 Doug Kwan <dougkwan@google.com>
2969 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
2970 Arm_relocate_functions::thumb32_branch_upper,
2971 Arm_relocate_functions::thumb32_branch_lower,
2972 Arm_relocate_functions::thumb32_cond_branch_offset,
2973 Arm_relocate_functions::thumb32_cond_branch_upper,
2974 Arm_relocate_functions::thumb32_cond_branch_lower,
2975 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
2976 branch offset encoding.
2977 (Arm_relocate_functions::thumb_branch_common): Use new branch
2978 offset encoding methods to avoid code duplication.
2979 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
2980 (Stub_addend_reader::operator()): Use new branch encoding method
2981 to avoid code duplication.
2983 2010-01-11 Doug Kwan <dougkwan@google.com>
2985 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
2986 (Target_arm::do_finalize_sections): Define special EXIDX section
2987 symbols only if referenced.
2988 * gc.h (Garbage_collection::add_reference): New method.
2989 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
2992 2010-01-11 Ian Lance Taylor <iant@google.com>
2994 * script.cc (Version_script_info::build_expression_list_lookup):
2995 Change complaing about duplicate wildcard match from error to
2998 * script.cc (class Lazy_demangler): Recreate--revert part of patch
3000 (Version_script_info::Version_script_info): Initialize globs_,
3001 default_version_, default_is_global_, and exact_. Don't
3002 initialize globals_ or locals_.
3003 (Version_script_info::build_lookup_tables): Build local symbols
3005 (Version_script_info::unquote): New function.
3006 (Version_script_info::add_exact_match): New function.
3007 (Version_script_info::build_expression_list_lookup): Remove lookup
3008 parameter. Add is_global parameter. Change all callers. Handle
3009 wildcard pattern specially. Unquote pattern. Call
3011 (Version_script_info::get_name_to_match): New function.
3012 (Version_script_info::get_symbol_version): New function.
3013 (Version_script_info::get_symbol_version_helper): Remove.
3014 (Version_script_info::check_unmatched_names): Call unquote.
3015 * script.h (class Version_script_info): Change get_symbol_version
3016 to be non-inline and add is_global parameter; change all callers.
3017 Rewrite symbol_is_local. Update declarations. Define struct
3018 Version_tree_match, Exact, Globs. Don't define struct Lookup.
3019 Remove globals_ and locals_ members. Add exact_, globs_,
3020 default_version_, is_global_.
3021 (Version_script_info::Glob): Remove pattern, add expression and
3022 is_global. Update constructor. Change all callers.
3023 * dynobj.cc (Versions::finalize): Mark the version symbol as the
3025 (Versions::symbol_section_contents): If a symbol is undefined, or
3026 defined in a dynamic object, set the version index to
3028 * symtab.cc (Symbol_table::add_from_relobj): Don't call
3030 (Symbol_table::add_from_pluginobj): Likewise.
3031 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
3033 2010-01-11 Doug Kwan <dougkwan@google.com>
3035 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
3036 (incremental_dump_LDADD): Add linking option for libintl.
3037 * Makefile.in: Regenerate.
3039 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
3042 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
3044 * testsuite/Makefile.in: Regenerated.
3046 2010-01-10 Doug Kwan <dougkwan@google.com>
3048 * options.h (DEFINE_var): Use parentheses around argument varname__
3049 in macro body to avoid any unintended subsequent substitutions.
3051 2010-01-10 Ian Lance Taylor <iant@google.com>
3053 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
3054 candidates before doing symbol resolution.
3056 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
3057 ODR candidates if only one is weak.
3059 2010-01-08 Ian Lance Taylor <iant@google.com>
3061 * script.cc (Version_script_info::build_expression_list_lookup):
3062 Don't warn about ambiguous version, just record the ambiguity.
3063 (Version_script_info::get_symbol_version_helper): Give error if
3064 version is ambiguous.
3066 2010-01-08 Doug Kwan <dougkwan@google.com>
3068 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
3069 prev_data_size_ and prev_addralign_. Remove initializer for
3070 deleted data member has_been_changed_.
3071 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
3072 to determine if the table is empty.
3073 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
3075 (Stub_table::add_reloc_stub): Define method in class definition
3076 instead of just declaring it there.
3077 (Stub_table::add_cortex_a8_stub): New method definition.
3078 (Stub_table::update_data_size_and_addralign): Ditto.
3079 (Stub_table::finalize_stubs): Ditto.
3080 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
3081 (Stub_table::do_addralign_): Return address alignment in the
3082 (Stub_table::do_reset_address_and_file_offset): Define method in
3083 class definition instead of declaring it there. Set current data
3084 size to be the data size of the previous pass.
3085 (Stub_table::set_final_data_size): Use current data size as the
3087 (Stub_table::relocate_stub): Change parameter type of stub from
3088 Reloc_stub pointer to Stub pointer.
3089 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
3090 (Stub_table::Cortex_a8_stub_list): New typedef.
3091 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
3092 Stub_table::prev_addralign_): New data member.
3093 (Arm_relobj::Arm_relobj): Initialize data member
3094 section_has_cortex_a8_workaround_.
3095 (Arm_relobj::section_has_cortex_a8_workaround,
3096 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
3098 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
3100 (Target_arm::relocate_stub): Change parameter type of stub from
3101 Reloc_stub pointer to Stub pointer.
3102 (Insn_template::size, Insn_template::alignment): Handle
3103 THUMB16_SPECIAL_TYPE.
3104 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
3105 Stub_table::update_data_size_and_addralign,
3106 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
3108 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
3109 (Stub_table::do_write): Ditto.
3110 (Target_arm::do_relax): Adjust code for changes in Stub_table.
3112 2010-01-08 Ian Lance Taylor <iant@google.com>
3115 * symtab.h (class Symbol): Remove fields is_target_special_ and
3116 has_plt_offset_. Add field is_defined_in_discarded_section_.
3117 (Symbol::is_defined_in_discarded_section): New function.
3118 (Symbol::set_is_defined_in_discarded_section): New function.
3119 (Symbol::has_plt_offset): Rewrite.
3120 (Symbol::set_plt_offset): Verify that new offset is not -1U.
3121 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
3122 Don't initialize is_target_special_ or has_plt_offset_.
3123 Initialize is_defined_in_discarded_section_.
3124 (Symbol_table::add_from_relobj): If appropriate, set
3125 is_defined_in_discarded_section.
3126 * resolve.cc (Symbol::override_base_with_special): Don't test
3127 is_target_special_. Change has_plt_offset_ to has_plt_offset().
3128 * target-reloc.h (relocate_section): Do special handling for
3129 symbols defined in discarded sections for global symbols as well
3132 2010-01-08 Ian Lance Taylor <iant@google.com>
3134 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
3135 the SHT_SYMTAB case.
3137 2010-01-08 Ian Lance Taylor <iant@google.com>
3139 * object.cc (Sized_relobj::do_layout): Don't get confused if
3140 layout_eh_frame returns NULL.
3142 2010-01-08 Ian Lance Taylor <iant@google.com>
3145 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
3146 dynamic symbol table, use the normal symbol table.
3147 (Sized_dynobj::do_read_symbols): Remove assertion about type of
3150 2010-01-08 Ian Lance Taylor <iant@google.com>
3153 * layout.cc (Layout::include_section): Remove .gnu_debuglink
3156 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
3158 * version.cc (print_version): Change to "Copyright 2010".
3160 2010-01-08 Ian Lance Taylor <iant@google.com>
3164 * i386.cc (class Target_i386): Change return type of plt_section
3166 (class Output_data_plt_i386): Add tls_desc_rel_ field.
3167 (Output_data_plt_i386::Output_data_plt_i386): Initialize
3168 tls_desc_rel_ field.
3169 (Output_data_plt_i386::rel_tls_desc): New function.
3170 (Target_i386::rel_tls_desc_section): New function.
3171 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
3172 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
3173 R_386_TLS_DESC reloc in rel_tls_desc_section.
3174 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
3175 Define struct Tlsdesc_info.
3176 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
3177 (Target_x86_64::do_reloc_symbol_index): New function.
3178 (Target_x86_64::add_tlsdesc_info): New function.
3179 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
3180 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
3182 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
3184 (Output_data_plt_x86_64::rela_tlsdesc): New function.
3185 (Target_x86_64::rela_tlsdesc_section): New function.
3186 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
3188 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
3189 (Target_x86_64::do_reloc_addend): New function.
3190 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
3191 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
3192 declarations. Define TARGET_CODE. Add arg field to u1_ union.
3193 (Output_reloc::type): New function.
3194 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
3195 (Output_reloc::is_target_specific): New function.
3196 (Output_reloc::target_arg): New function.
3197 (class Output_reloc) [SHT_RELA]: Add four new constructors for
3198 absolute relocs and target specific relocs.
3199 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
3200 add_target_specific.
3201 (class Output_data_reloc) [SHT_RELA]: Likewise.
3202 * output.cc (Output_reloc::Output_reloc): Add four new versions
3203 for absolute relocs and target specific relocs.
3204 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
3205 (Output_reloc::get_symbol_index): Likewise.
3206 (Output_reloc::local_section_offset): Check that local_sym_index_
3207 is not TARGET_CODE or 0.
3208 (Output_reloc::symbol_value): Likewise.
3209 (Output_reloc::write) [SHT_RELA]: Call target for target specific
3211 * target.h (class Target): Add reloc_symbol_index and reloc_addend
3212 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
3214 * layout.cc (add_target_dynamic_tags): Use output section for
3215 DT_PLTRELSZ and DT_JMPREL.
3217 2010-01-07 Ian Lance Taylor <iant@google.com>
3220 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
3222 (class Output_data_reloc_generic): Define.
3223 (class Output_data_reloc_base): Change base class to
3224 Output_data_reloc_generic. Change add() method to call
3225 bump_relative_reloc_count for a relative reloc. Remove
3227 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
3229 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
3230 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
3232 * layout.h (class Layout): Update declaration.
3234 2010-01-07 Ian Lance Taylor <iant@google.com>
3236 * output.h (class Output_data): Add const version of
3237 output_section and do_output_section.
3238 (class Output_section_data): Add const version of
3240 (class Output_section): Likewise.
3241 * layout.cc (Layout::add_target_dynamic_tags): New function.
3242 * layout.h (class Layout): Update declarations.
3243 * arm.cc (Target_arm::do_finalize_sections): Use
3244 add_target_dynamic_tags.
3245 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3246 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
3247 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
3248 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3250 2010-01-07 Ian Lance Taylor <iant@google.com>
3253 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
3256 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
3257 Ian Lance Taylor <iant@google.com>
3260 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
3261 Xindex::read_symtab_xindex.
3263 2010-01-07 Doug Kwan <dougkwan@google.com>
3265 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
3266 (Insn_template::thumb16_bcond_insn): New method declaration.
3267 (Insn_template): Fix spelling.
3268 (Stub::thumb16_special): New method declaration.
3269 (Stub::do_write): Define virtual method which was previously pure
3271 (Stub::do_thumb16_special): New method declaration.
3272 (Stub::do_fixed_endian_write): New template member.
3273 (Reloc_stub::do_write): Remove.
3274 (Reloc_stub::do_fixed_endian_write): Remove.
3275 (Cortex_a8_stub): New class definition.
3276 (Stub_factory::make_cortex_a8_stub): New method definition.
3277 (Stub_factory::Stub_factory): Add missing static storage class
3278 qualifier for elf32_arm_stub_a8_veneer_blx.
3280 2010-01-07 Ian Lance Taylor <iant@google.com>
3283 * options.h (class General_options): Add --warn-unresolved-symbols
3284 and --error-unresolved-symbols.
3285 * errors.cc (Errors::undefined_symbol): Implement
3286 --warn-unresolved-symbols.
3288 * options.h (class General_options): Add -z text and -z textoff.
3289 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
3291 2010-01-06 Sriraman Tallam <tmsriram@google.com>
3293 * gc.h (Garbage_collection::Cident_section_map): New typedef.
3294 (Garbage_collection::cident_sections): New function.
3295 (Garbage_collection::add_cident_section): New function.
3296 (Garbage_collection::cident_sections_): New member.
3297 (gc_process_relocs): Add references to sections whose names are C
3299 * gold.h (cident_section_start_prefix): New constant.
3300 (cident_section_stop_prefix): New constant.
3301 (is_cident): New function.
3302 * layout.cc (Layout::define_section_symbols): Replace string constants
3303 with the newly defined constants.
3304 * object.cc (Sized_relobj::do_layout): Track sections whose names are
3306 * testsuite/Makefile.am: Add gc_orphan_section_test.
3307 * testsuite/Makefile.in: Regenerate.
3308 * testsuite/gc_orphan_section_test.cc: New file.
3309 * testsuite/gc_orphan_section_test.sh: New file.
3311 2010-01-06 Ian Lance Taylor <iant@google.com>
3314 * options.h (class General_options): Add --warn-shared-textrel.
3315 * layout.cc (Layout::finish_dynamic_section): Implement
3316 --warn-shared-textrel.
3319 * options.h (class General_options): Add --warn-multiple-gp.
3321 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3323 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
3324 $(THREADSLIB) and $(LIBDL).
3325 * Makefile.in: Rebuild.
3327 2010-01-06 Ian Lance Taylor <iant@google.com>
3330 * options.cc (General_options::parse_section_start): New function.
3331 (General_options::section_start): New function.
3332 (General_options::General_options): Initialize all members.
3333 * options.h: Include <map>
3334 (class General_options): Add --section-start. Add section_starts_
3336 * layout.cc (Layout::attach_allocated_section_to_segment): If
3337 --section-start was used, set the address of the segment. Remove
3338 local sort_sections.
3339 (Layout::relaxation_loop_body): If the address of the load segment
3340 has been set by --section-start, don't use it.
3341 * output.h (Output_segment::update_flags_for_output_section): New
3343 * output.cc (Output_segment::add_output_section): Call
3344 update_flags_for_output_section.
3346 2010-01-05 Ian Lance Taylor <iant@google.com>
3349 * options.h (class General_options): Add --undefined-version.
3350 * script.cc (struct Version_expression): Add was_matched_by_symbol
3352 (Version_script_info::matched_symbol): New function.
3353 (Version_script_info::get_symbol_version_helper): Call
3355 (Version_script_info::check_unmatched_names): New function.
3356 * script.h (class Version_script_info): Update declarations.
3357 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
3359 * options.h (class General_options): Use DEFINE_bool_alias for
3360 allow_multiple_definition.
3361 * resolve.cc (Symbol_table::should_override): Don't test
3362 allow_multiple_definition.
3365 * options.h (class General_options): Add --cref.
3366 * main.cc (main): Print cref table if --cref. Don't close mapfile
3367 until after printing cref table.
3368 * cref.cc: Include "symtab.h".
3369 (class Cref_inputs): Define Cref_table_compare and Cref_table.
3370 (Cref_table_compare::operator()): New function.
3371 (Cref_inputs::gather_cref): New function.
3372 (filecol): New static const.
3373 (Cref_inputs::print_cref): New function.
3374 (Cref::print_cref): New function.
3375 * cref.h: Include <cstdio>.
3376 (class Cref): Update declarations.
3377 * mapfile.h (Mapfile::file): New function.
3378 * object.h (class Object): Define Symbols. Declare virtual
3379 do_get_global_symbols.
3380 (Object::get_global_symbols): New function.
3381 * object.cc (Input_objects::add_object): Pass object to cref_ if
3383 (Input_objects::archive_start): Likewise.
3384 (Input_objects::archive_stop): Likewise.
3385 (Input_objects::print_cref): New function.
3386 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
3387 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
3389 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
3391 * plugin.h (class Sized_pluginobj): Update declarations.
3393 2010-01-05 Ian Lance Taylor <iant@google.com>
3395 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
3396 to is_default_version. Rename insdef to insdefault.
3397 (Symbol_table::add_from_relobj): Rename def to is_default_version
3398 and local to is_forced_local.
3399 (Symbol_table::add_from_pluginobj): Likewise.
3400 (Symbol_table::add_from_dynobj): Likewise.
3401 (Symbol_table::define_special_symbol): Rename insdef to
3404 2010-01-04 Ian Lance Taylor <iant@google.com>
3407 * options.h (class General_options): Add
3408 --allow-multiple-definition and -z muldefs.
3409 * resolve.cc (Symbol_table::should_override): Don't warn about a
3410 multiple symbol definition if --allow-multiple-definition or -z
3414 * options.h (class General_options): Add --add-needed and
3415 --copy-dt-needed-entries. Tweak --as-needed help entry.
3416 * object.cc (Input_objects::check_dynamic_dependencies): Give an
3417 error if --copy-dt-needed-entries aka --add-needed is used and
3418 would cause a change in behaviour.
3421 * options.h (class General_options): Add -G as a short version of
3422 --shared. Add no-op options -assert, -g, and -i.
3424 2010-01-04 Sriraman Tallam <tmsriram@google.com>
3426 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
3427 check for .text or .gnu.linkonce.t sections.
3428 * icf.cc (Icf::find_identical_sections): Ditto.
3429 Change the detection for mangled function name within the section
3431 * icf.h (is_section_foldable_candidate): New function.
3433 2009-12-30 Ian Lance Taylor <iant@google.com>
3436 * options.h (class General_options): Permit two dashes with
3437 --retain-symbols-file.
3439 2009-12-30 Ian Lance Taylor <iant@google.com>
3442 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
3443 don't put the file header and segment headers in the text
3447 * common.cc (Sort_commons::operator()): Stabilize sort when both
3449 (Symbol_table::do_allocate_commons_list): When allocating common
3450 symbols, skip a symbol which is no longer common.
3451 * symtab.h (Symbol::is_common): Test whether the symbol comes from
3452 an object before checking its type.
3453 * testsuite/common_test_2.c: New file.
3454 * testsuite/common_test_3.c: New file.
3455 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
3456 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
3457 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
3458 (common_test_2_pic.o, common_test_2.so): New targets.
3459 (common_test_3_pic.o, common_test_3.so): New targets.
3460 * testsuite/Makefile.in: Rebuild.
3463 * script.cc (read_input_script): If we see a new SECTIONS clause,
3464 and we have added an input section, give an error.
3465 * layout.h (class Layout): Add have_added_input_section function.
3466 Add have_added_input_section_ field.
3467 * layout.cc (Layout::Layout): Initialize
3468 have_added_input_section_.
3469 (Layout::layout): Set have_added_input_section_.
3470 (Layout::layout_eh_frame): Likewise.
3472 2009-12-30 Ian Lance Taylor <iant@google.com>
3475 * options.h (class General_options): Add --sort-common option.
3476 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
3477 * common.cc (Sort_common): Add sort_order parameter to
3478 constructor. Add sort_order_ field.
3479 (Sort_commons::operator): Check sort_order_.
3480 (Symbol_table::allocate_commons): Determine the sort order.
3481 (Symbol_table::do_allocate_commons): Add sort_order parameter.
3483 (Symbol_table::do_allocate_commons_list): Likewise.
3485 2009-12-30 Ian Lance Taylor <iant@google.com>
3488 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
3489 symbols from this object, don't change the visibility of an
3491 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
3493 2009-12-30 Ian Lance Taylor <iant@google.com>
3496 * script.h (class Version_script_info): Define Language enum.
3497 Update declarations. Define Glob, Exact, and Lookup types. Add
3498 new fields globals_, locals_, and is_finalized_.
3499 * script.cc: Various formatting fixes.
3500 (class Parser_closure): Change language_stack_ from a vector of
3501 std::string to one of Version_script_info::Language. Adjust all
3503 (class Lazy_demangler): Remove.
3504 (struct Version_expression): Change language from std::string to
3505 Version_script_info::Language.
3506 (Version_script_info::Version_script_info): New function.
3507 (Version_script_info::~Version_script_info): Don't call clear.
3508 (Version_script_info::finalize): New function.
3509 (Version_script_info::build_lookup_tables): New function.
3510 (Version_script_info::build_expression_list_lookup): New
3512 (Version_script_info::get_symbol_version_helper): Rewrite to use
3514 (Version_script_info::print_expression_list): Adjust to use
3515 Version_script_info::Language.
3516 (script_push_lex_into_version_mode): Check that the version script
3517 has not been finalized.
3518 (version_script_push_lang): Change language string to
3519 Version_script_info::Language.
3520 * options.cc (Command_line::version_script): New function.
3521 * options.h (class General_options): Add finalize_dynamic_list
3522 function. Change version_script from declaration to definition.
3523 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
3524 * testsuite/version_script.map: Remove duplicate def of foo.
3525 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
3527 * testsuite/Makefile.in: Rebuild.
3529 2009-12-30 Ian Lance Taylor <iant@google.com>
3532 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
3533 if the input symbol index is 0, make the output symbol index 0.
3535 2009-12-30 Ian Lance Taylor <iant@google.com>
3538 * options.h (class General_options): Add -x/--discard-all.
3539 * object.cc (Sized_relobj::do_count_local_symbols): Handle
3540 --discard-all. If the local symbol needs a dynamic entry, check
3541 that before handling --discard-locals.
3543 2009-12-30 Ian Lance Taylor <iant@google.com>
3546 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
3548 (Output_segment::add_output_section): Don't change the flags if
3552 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
3553 GNU hash table if they need a dynamic value. Otherwise, don't add
3554 them if they are defined in a dynamic object or are forced local.
3556 2009-12-29 Ian Lance Taylor <iant@google.com>
3559 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
3560 .gnu.hash table for a 32-bit target.
3563 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
3564 regular and a dynamic object only needs a dynamic symbol table
3565 entry if it is externally visible.
3568 * i386.cc (class Target_i386): Initialize global_offset_table_ in
3569 constructor. Add global_offset_table_ field.
3570 (Target_i386::got_section): Set global_offset_table_.
3571 (Target_i386::do_finalize_sections): Set global_offset_table_
3573 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
3574 in constructor. Add global_offset_table_ field.
3575 (Target_x86_64::got_section): Set global_offset_table_.
3576 (Target_x86_64::do_finalize_sections): Set global_offset_table_
3579 * layout.cc (Layout::Layout): Initialize increase_relro_.
3580 (Layout::get_output_section): Add is_relro, is_last_relro, and
3581 is_first_non_relro parameters. Change all callers.
3582 (Layout::choose_output_section): Likewise.
3583 (Layout::add_output_section_data): Likewise.
3584 (Layout::make_output_section): Likewise.
3585 (Layout::set_segment_offsets): Clear increase_relro when using a
3587 * layout.h (class Layout): Add increase_relro method. Add
3588 increase_relro_ field. Update declarations.
3589 * output.cc (Output_section::Output_section): Initialize
3590 is_last_relro_ and is_first_non_relro_.
3591 (Output_segment::add_output_section): Group relro sections is
3592 do_sort is true. Handle is_last_relro and is_first_non_relro.
3593 (Output_segment::maximum_alignment): Remove relro handling.
3594 (Output_segment::set_section_addresses): Add increase_relro
3595 parameter. Change all callers. Add initial alignment to align
3596 relro sections on separate page. Remove old relro handling.
3597 (Output_segment::set_section_list_addresses): Remove in_relro
3598 parameter. Change all callers.
3599 (Output_segment::set_offset): Add increase parameter. Change all
3600 callers. Remove old relro handling.
3601 * output.h (class Output_section): Add new methods: is_last_relro,
3602 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
3603 Add is_last_relro_ and is_first_non_relro_ fields.
3604 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
3605 Create separate .got.plt section. Call increase_relro.
3606 * x86_64.cc (Target_x86_64::got_section): Likewise.
3607 * testsuite/relro_script_test.t: Add .got.plt.
3610 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
3611 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
3612 (Layout::finalize): Call set_dynamic_symbol_size.
3613 (Layout::set_dynamic_symbol_size): New function.
3614 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
3615 set_dynamic_symbol_size.
3618 * output.h (class Output_section): Add is_entsize_zero_ field.
3619 * output.cc (Output_section::Output_section): Initialize
3621 (Output_section::set_entsize): If two different entsizes are
3622 requested, force it to zero.
3623 (Output_section::add_input_section): Set flags for .debug_str
3624 before updating section flags. Set entsize.
3625 (Output_section::update_flags_for_input_section): Set SHF_MERGE
3626 and SHF_STRING if all input sections have those flags.
3628 2009-12-29 Rafael Espindola <espindola@google.com>
3630 * main.cc (main): Fix the sys time reporting.
3631 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
3634 2009-12-29 Sriraman Tallam <tmsriram@google.com>
3636 * options.cc (General_options::parse_version): Allow -v to exit
3637 without an error if there is nothing to link.
3639 2009-12-29 Ian Lance Taylor <iant@google.com>
3641 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
3642 using a version of gcc before 4.1.
3643 * configure: Rebuild.
3645 2009-12-28 Chris Demetriou <cgd@google.com>
3647 * attributes.cc (Output_attributes_section_data::do_write): Use
3648 std::vector::front rather than std::vector::data.
3650 2009-12-28 Ian Lance Taylor <iant@google.com>
3652 * symtab.h (class Symbol_table): Add enum Defined.
3653 * resolve.cc (Symbol_table::should_override): Add defined
3654 parameter. Change all callers. Test whether object is NULL
3655 before calling a method on it.
3656 (Symbol_table::report_resolve_problem): Add defined parameter.
3658 (Symbol_table::should_override_with_special): Likewise.
3659 * symtab.cc (Symbol_table::define_in_output_data): Add defined
3660 parameter. Change all callers.
3661 (Symbol_table::do_define_in_output_data): Likewise.
3662 (Symbol_table::define_in_output_segment): Likewise.
3663 (Symbol_table::do_define_in_output_segment): Likewise.
3664 (Symbol_table::define_as_constant): Likewise.
3665 (Symbol_table::do_define_as_constant): Likewise.
3666 * script.h (class Symbol_assignment): Add is_defsym parameter to
3667 constructor; change all callers.
3668 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
3669 parameter. Change all callers. Add is_defsym_ field.
3670 (class Parser_closure): Add parsing_defsym parameter to
3671 constructor; change all callers. Add parsing_defsym accessor
3672 function. Add parsing_defsym_ field.
3674 2009-12-28 Ian Lance Taylor <iant@google.com>
3676 * gold.cc (queue_middle_tasks): Fix formatting.
3677 * object.cc (Relobj::is_section_name_included): Likewise.
3679 2009-12-23 Ian Lance Taylor <iant@google.com>
3681 * i386.cc (Target_i386::do_calls_non_split): Recognize
3682 -fsplit-stack prologue for a function with a static chain.
3683 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
3684 -fsplit-stack prologue when using %r11.
3686 2009-12-21 Sriraman Tallam <tmsriram@google.com>
3688 * options.cc (General_options::parse_version): Make -v continue and do
3689 the link like GNU ld does.
3691 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
3693 * Makefile.am (CCFILES): Add timer.cc.
3694 (HFILES): Add timer.h.
3695 * configure.ac: Check for sysconf and times.
3696 * main.cc: include timer.h.
3697 (main): Use Timer instead of get_run_time.
3700 * workqueue.cc: include timer.h.
3701 (Workqueue::find_and_run_task):
3702 Report user, sys and wall time.
3703 * Makefile.in: Regenerate.
3704 * config.in: Regenerate.
3705 * configure: Regenerate.
3707 2009-12-16 Doug Kwan <dougkwan@google.com>
3709 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
3711 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
3712 relaxed input sections.
3713 * output.cc (Output_section::find_relaxed_input_section): Change
3714 return type to Output_relaxed_input_section pointer. Adjust code
3715 for new type of relaxed_input_section_map_.
3716 * output.h (Output_section::find_relaxed_input_section): Change
3717 return type to Output_relaxed_input_section pointer.
3718 (Output_section::Output_relaxed_input_section_by_input_section_map):
3720 (Output_section::relaxed_input_section_map_): Change type to
3721 Output_section::Output_relaxed_input_section_by_input_section_map.
3722 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
3725 2009-12-15 Ian Lance Taylor <iant@google.com>
3727 * layout.cc (Layout::create_shstrtab): Only write out after input
3728 sections if we are compressing debug sections.
3730 2009-12-15 Ian Lance Taylor <iant@google.com>
3732 * archive.cc (Archive::add_symbols): Only look up a symbol without
3733 a version if there is, in fact, a version.
3735 2009-12-14 Ian Lance Taylor <iant@google.com>
3737 Revert -Wshadow changes, all changes from:
3738 2009-12-11 Doug Kwan <dougkwan@google.com>
3739 2009-12-11 Nick Clifton <nickc@redhat.com>
3740 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
3742 2009-12-11 Doug Kwan <dougkwan@google.com>
3744 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
3746 * attributes.cc (Object_attribute::size): Ditto.
3747 (Attributes_section_data::size): Ditto.
3748 (Attributes_section_data::Attributes_section_data): Ditto.
3749 (Output_attributes_section_data::do_write): Ditto.
3750 * attributes.h (Object_attribute::set_type): Ditto.
3751 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
3753 2009-12-11 Nick Clifton <nickc@redhat.com>
3755 * archive.cc: Fix shadowed variable warnings.
3757 * compressed_output.cc: Likewise.
3758 * compressed_output.h: Likewise.
3759 * configure: Likewise.
3760 * dwarf_reader.cc: Likewise.
3761 * dynobj.cc: Likewise.
3762 * dynobj.h: Likewise.
3763 * ehframe.cc: Likewise.
3764 * ehframe.h: Likewise.
3765 * errors.cc: Likewise.
3766 * expression.cc: Likewise.
3767 * fileread.cc: Likewise.
3768 * fileread.h: Likewise.
3769 * freebsd.h: Likewise.
3770 * i386.cc: Likewise.
3772 * incremental.h: Likewise.
3773 * layout.cc: Likewise.
3774 * layout.h: Likewise.
3775 * mapfile.cc: Likewise.
3776 * merge.cc: Likewise.
3777 * merge.h: Likewise.
3778 * object.cc: Likewise.
3779 * object.h: Likewise.
3780 * options.h: Likewise.
3781 * output.cc: Likewise.
3782 * output.h: Likewise.
3783 * parameters.cc: Likewise.
3784 * plugin.cc: Likewise.
3785 * powerpc.cc: Likewise.
3786 * reduced_debug_output.cc: Likewise.
3787 * reduced_debug_output.h: Likewise.
3788 * reloc.cc: Likewise.
3789 * reloc.h: Likewise.
3790 * resolve.cc: Likewise.
3791 * script-sections.cc: Likewise.
3792 * script.cc: Likewise.
3793 * script.h: Likewise.
3794 * sparc.cc: Likewise.
3795 * symtab.cc: Likewise.
3796 * symtab.h: Likewise.
3797 * target-select.cc: Likewise.
3798 * target-select.h: Likewise.
3799 * token.h: Likewise.
3800 * workqueue.cc: Likewise.
3801 * workqueue.h: Likewise.
3802 * x86_64.cc: Likewise.
3804 2009-12-10 Doug Kwan <dougkwan@google.com>
3806 * arm.cc (attributes.h): New include.
3807 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
3808 (Arm_relobj::~Arm_relobj): Delete object pointed by
3809 attributes_section_data_.
3810 (Arm_relobj::attributes_section_data): New method definition.
3811 (Arm_relobj::attributes_section_data_): New data member declaration.
3812 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
3813 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
3814 attributes_section_data_.
3815 (Arm_dynobj::attributes_section_data): New method definition.
3816 (Arm_dynobj::attributes_section_data_): New data member declaration.
3817 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
3818 initialization value of may_use_blx_ to false.
3819 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
3820 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
3821 object attributes to compute results instead of hard-coding.
3822 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
3823 Target_arm::get_secondary_compatible_arch,
3824 Target_arm::set_secondary_compatible_arch
3825 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
3826 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
3827 New method declarations.
3828 (Target_arm::get_aeabi_object_attribute): New method definition.
3829 (Target_arm::attributes_section_data_): New data member declaration.
3830 (read_arm_attributes_section): New template definition.
3831 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
3832 (Arm_dynobj::do_read_symbols): Ditto.
3833 (Target_arm::do_finalize_sections): Merge attributes sections from
3834 input. Check for BLX use after attributes section merging.
3835 Fix __exidx_start and __exidx_end visibility. Create an
3836 .ARM.attributes section if necessary.
3837 (Target_arm::get_secondary_compatible_arch,
3838 Target_arm::set_secondary_compatible_arch,
3839 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
3840 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
3841 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
3842 New method definitions.
3844 2009-12-09 Ian Lance Taylor <iant@google.com>
3846 * plugin.cc (Plugin::load): Don't cast from void* to a function
3849 2009-12-09 Ian Lance Taylor <iant@google.com>
3851 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
3854 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
3856 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
3857 Replace two_file_shared_1.so with two_file_shared_2.so.
3858 * testsuite/Makefile.in: Regenerated.
3860 2009-12-08 Doug Kwan <dougkwan@google.com>
3862 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
3863 (HFILES): Add attributes.h and int_encoding.h.
3864 * Makefile.in: Regenerate.
3865 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
3866 function definitions to int_encoding.cc
3867 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
3868 prototypes to int_encoding.h
3869 * reduced_debug_output.cc (int_encoding.h): New include.
3870 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
3871 function definitions to int_encoding.cc
3872 (insert_into_vector, read_from_pointer): Move template definitions to
3874 * attributes.cc: New file.
3875 * attributes.h: New file.
3876 * int_encoding.cc: New file.
3877 * int_encoding.h: New file.
3879 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
3882 * incremental-dump.cc (dump_incremental_inputs): New.
3883 (main): Use dump_incremental_inputs.
3885 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
3888 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
3889 checking elfcpp::STT_FUNC.
3890 (Target_i386::Relocate::relocate): Likewise.
3891 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3893 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
3894 symbols from shared libraries into normal FUNC symbols.
3896 * symtab.h (Symbol): Add is_func and use it.
3898 2009-12-05 Doug Kwan <dougkwan@google.com>
3900 * arm.cc (Target_arm::arm_info): Initialize new fields
3901 attributes_section and attributes_vendor.
3902 * i386.cc (Target_i386::i386_info): Same.
3903 * object.cc (Sized_relobj::do_layout): Skip attribute section.
3904 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
3905 fields attributes_section and attributes_vendor.
3906 * sparc.cc (Target_sparc::sparc_info): Same.
3907 * target.h (Target::attributes_section, Target::attributes_vendor,
3908 Target::is_attributes_section, Target::attribute_arg_type,
3909 Target::attributes_order): New method definitions.
3910 (Target::Target_info::attributes_section,
3911 Target::Target_info::attributes_vendor): New fields.
3912 (Target::do_attribute_arg_type, Target::do_attributes_order): New
3913 virtual method definitions.
3914 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
3915 attributes_section and attributes_vendor.
3916 * testsuite/testfile.cc (Target_test::test_target_info): Same.
3918 2009-12-05 Doug Kwan <dougkwan@google.com>
3920 * arm.cc: Update comments about interworking and stub generation.
3921 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
3922 considered as non-PIC.
3923 (Arm_relocate_functions::base_abs): Fix formatting.
3924 (Arm_relocate_functions::got_prel): Fix comment. Change interface
3925 of function to use GOT entry address instead of offset.
3926 (Target_arm::Scan::global): Issue an error if a symbol would need a
3927 PLT does not get one because it is untyped. Remove code to create
3928 dynamic symbols for relative branches.
3929 (Target_arm::Relocate::relocate: Use 0 instead of false since function
3930 takes unsigned integer instead of boolean.
3932 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
3934 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
3935 (two_file_test_LDADD): Likewise.
3936 (common_test_1_LDADD): Likewise.
3937 (exception_test_LDADD) Likewise.
3938 (weak_test_LDADD): Likewise.
3939 (many_sections_test_LDADD): Likewise.
3940 (initpri1_LDADD): Likewise.
3941 (script_test_1_LDADD): Likewise.
3942 (script_test_2_LDADD): Likewise.
3943 (justsyms_LDADD): Likewise.
3944 (binary_test_LDADD): Likewise.
3945 (large_LDADD): Likewise.
3946 * testsuite/Makefile.in: Regenerated.
3948 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
3950 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
3951 (Symbol_table::override_with_special): Likewise.
3952 (Symbol_table::add_from_object): Likewise.
3954 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
3956 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
3957 Don't set the data_offset twice.
3959 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
3961 * testsuite/Makefile.in: Regenerate.
3963 2009-12-03 Doug Kwan <dougkwan@google.com>
3965 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
3966 (Target_arm::do_finalize_sections): Add parameter for symbol table
3967 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
3968 * i386.cc (Target_i386::do_finalize_sections): Add an additional
3969 parameter for symbol table pointer.
3970 * layout.cc (Layout::finalize): Call Target::finalize_sections with
3971 an additional parameter for a pointer to symbol table.
3972 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
3973 parameter for a symbol table pointer.
3974 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
3975 * target.h (Target::finalize_sections, Target::do_finalize_sections):
3977 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
3978 parameter for a symbol table pointer.
3980 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
3982 * incremental.cc (Incremental_inputs_header)
3983 (Incremental_inputs_header_write, Incremental_inputs_entry)
3984 (Incremental_inputs_entry_write): Move ...
3985 * incremental.h (Incremental_inputs_header)
3986 (Incremental_inputs_header_write, Incremental_inputs_entry)
3987 (Incremental_inputs_entry_write): here.
3989 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
3991 * incremental.cc (make_sized_incremental_binary): Set the target.
3992 Error if it is incompatible.
3993 * output.h (Output_file): Add filename method.
3995 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
3997 * incremental.cc (Incremental_inputs_entry): Remove unused argument
3998 from the get_* methods.
4000 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4002 * incremental-dump.cc (main): Check that the offeset of a script is 0.
4003 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
4004 Write 0 for the data_offset of scripts.
4006 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4008 * testsuite/Makefile.am: Add the incremental_test.sh test.
4009 * testsuite/incremental_test.sh: New.
4010 * testsuite/incremental_test_1.c: New.
4011 * testsuite/incremental_test_2.c: New.
4013 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
4015 * incremental-dump.cc (main): Fix typos.
4017 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
4020 * incremental-dump.cc (main): Use llu to print 64 bit values.
4022 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
4023 H.J. Lu <hongjiu.lu@intel.com>
4025 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
4027 (incremental_dump_LDADD): Likewise.
4028 * Makefile.in: Regenerated.
4030 2009-11-25 Doug Kwan <dougkwan@google.com>
4034 2009-11-25 Doug Kwan <dougkwan@google.com>
4036 * arm.cc (Target_arm::Target_arm): Move method definition
4037 outside of class definition. Add code to handle
4038 --target1-rel, --target1-abs and --target2= options.
4039 (Target_arm::get_reloc_reloc_type): Change method to be
4040 non-static and const.
4041 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
4042 New data member declaration.
4043 (Target_arm::Scan::local, Target_arm::Scan::global,
4044 Target_arm::Relocate::relocate,
4045 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4046 Adjust call to Target_arm::get_real_reloc_type.
4047 (Target_arm::get_real_reloc_type): Use command line options
4048 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4049 * options.h (--target1-rel, --target1-abs, --target2): New
4052 2009-11-25 Doug Kwan <dougkwan@google.com>
4054 * arm.cc (Target_arm::Target_arm): Move method definition outside of
4055 class definition. Add code to handle --target1-rel, --target1-abs
4056 and --target2= options.
4057 (Target_arm::get_reloc_reloc_type): Change method to be non-static
4059 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
4061 (Target_arm::Scan::local, Target_arm::Scan::global,
4062 Target_arm::Relocate::relocate,
4063 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
4064 call to Target_arm::get_real_reloc_type.
4065 (Target_arm::get_real_reloc_type): Use command line options to
4066 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4067 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
4070 2009-11-25 Doug Kwan <dougkwan@google.com>
4072 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
4073 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
4074 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
4076 (Arm_relocate_functions::thm_call): Replace body with a call to
4077 Arm_relocate_functions::thumb_branch_common.
4078 (Arm_relocate_functions::thm_jump24,
4079 Arm_relocate_functions::thm_xpc22): New method definitions.
4080 (Arm_relocate_functions::thumb_branch_common): New method definition.
4081 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
4083 (Target_arm::Relocate::relocate): Adjust call to thm_call.
4084 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
4086 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
4088 * Makefile.am: Build incremental-dump
4089 * Makefile.in: Regenerate.
4090 * incremental-dump.cc: New.
4091 * incremental.cc (Incremental_inputs_header_data,
4092 Incremental_inputs_entry_data): Move to incremental.h
4093 * incremental.h: (Incremental_inputs_header_data,
4094 Incremental_inputs_entry_data): Move from incremental.cc
4096 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
4098 * incremental.cc (Incremental_inputs_header,
4099 Incremental_inputs_header_write, Incremental_inputs_entry,
4100 Incremental_inputs_entry_write): Add a typedef with the data type.
4102 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
4104 * incremental.cc (Incremental_inputs_header,
4105 Incremental_inputs_header_write, Incremental_inputs_entry,
4106 Incremental_inputs_entry_write): Update comment about which
4107 type has the filed descriptions.
4109 2009-11-15 Doug Kwan <dougkwan@google.com>
4111 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
4112 (Arm_relocate_functions::arm_branch_common): Change method defintion
4113 in class definition to a method declaration and update list of formal
4115 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
4116 Arm_relocation_functions::jump24): Adjust call to
4117 Arm_relocate_functions::arm_branch_common. Update list of formal
4119 (Arm_relocate_functions::xpc25): New method definition.
4120 (Arm_relocate_functions::arm_branch_common): Move method defintion
4121 out from class definition. Use stubs for mode-switching and extending
4123 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
4124 specially. Change code to enable use of stubs in ARM branches.
4126 2009-11-10 Doug Kwan <dougkwan@google.com>
4128 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
4129 in method declaration.
4130 (Target_arm::relocate_stub): New method declaration.
4131 (Target_arm::default_target): Change to return a pointer instead of
4133 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
4134 Target_arm::default_target.
4135 (Arm_Relobj::do_relocate_sections): Remove options paramater in
4137 (Target_arm::relocate_section): Adjust view.
4138 (Target_arm::relocate_stub): New method definition.
4140 2009-11-10 Doug Kwan <dougkwan@google.com>
4142 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
4144 * incremental.cc (open_incremental_binary): Initialized local
4145 variables to avoid warnings.
4146 * object.cc (make_elf_object): Ditto.
4147 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
4150 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
4153 * testsuite/plugin_test.c: Include "config.h".
4155 2009-11-09 Doug Kwan <dougkwan@google.com>
4157 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
4158 (arm_symbol_value): Remove.
4159 (Arm_relocate_functions::arm_branch_common,
4160 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
4161 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
4162 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
4163 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
4164 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
4165 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
4166 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
4167 Arm_relocate_functions::thm_mobw_abs_nc,
4168 Arm_relocate_functions::thm_mov_abs,
4169 Arm_relocate_functions::movw_prel_nc,
4170 Arm_relocate_functions::thm_movt_abs,
4171 Arm_relocate_functions::movt_prel,
4172 Arm_relocate_functions::thm_movw_prel_nc,
4173 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
4174 (Target_arm::Relocate::relocate): Only decompose address into two
4175 parts if relocation type uses the thumb-bit and pass the actual
4176 bit instead of a flag indicating that the thumb-bit is used. Adjust
4177 calls to methods in Arm_relocate_functions for this change.
4179 2009-11-08 Ian Lance Taylor <iant@google.com>
4182 * reloc.cc: Instantiate
4183 Sized_relobj::initialize_input_to_output_maps and
4184 Sized_relobj:free_input_to_output_maps.
4186 2009-11-06 Ian Lance Taylor <iant@google.com>
4189 * defstd.cc (in_segment): Set only_if_ref true for "end".
4191 2009-11-06 Doug Kwan <dougkwan@google.com>
4193 * arm.cc (class Reloc_stub): Correct a comment.
4194 (Target_arm::Target_arm): Initialize arm_input_section_map_.
4195 (Target_arm::scan_section_for_stubs): New method declaration.
4196 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
4197 Change methods from private to protected.
4198 (Target_arm::do_may_relax): New method definition.
4199 (Target_arm::do_relax, Target_arm::group_sections,
4200 Target_arm::scan_reloc_for_stub,
4201 Target_arm::scan_reloc_section_for_stubs): New method declarations.
4202 (Target_arm::arm_input_section_map_): New data member declaration.
4203 (Target_arm::scan_reloc_for_stub,
4204 Target_arm::scan_reloc_section_for_stubs,
4205 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
4206 Target_arm::do_relax): New method definitions.
4208 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
4210 * configure.ac: Check for (struct stat)::st_mtim
4211 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
4212 * config.in: Regenerate.
4213 * configure: Regenerate.
4215 2009-11-05 Ian Lance Taylor <iant@google.com>
4218 * output.cc (Output_segment::add_output_section): Add missing
4221 2009-11-04 Ian Lance Taylor <iant@google.com>
4224 * object.h (class Object): Add is_needed and set_is_needed
4225 methods. Add is_needed_ field. Make bool fields into bitfields.
4226 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
4227 defined in a dynamic object and referenced by a regular object,
4228 set is_needed for the dynamic object.
4229 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
4230 if the file is marked with as_needed and it is not needed.
4232 2009-11-04 Ian Lance Taylor <iant@google.com>
4235 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
4236 tags if data is discarded by linker script.
4237 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4238 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4239 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4240 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4242 2009-11-04 Ian Lance Taylor <iant@google.com>
4244 * layout.cc (Layout::get_output_section): Add is_interp and
4245 is_dynamic_linker_section parameters. Change all callers.
4246 (Layout::choose_output_section): Likewise.
4247 (Layout::make_output_section): Likewise.
4248 (Layout::add_output_section_data): Add is_dynamic_linker_section
4249 parameter. Change all callers.
4250 * layout.h (class Layout): Update declarations.
4251 * output.h (class Output_section): Add is_interp, set_is_interp,
4252 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
4253 Add is_interp_, is_dynamic_linker_section_ fields. Change
4254 generate_code_fills_at_write_ to a bitfield.
4255 * output.cc (Output_section::Output_sections): Initialize new
4257 (Output_segment::add_output_section): Add do_sort parameter.
4260 2009-11-03 Ian Lance Taylor <iant@google.com>
4263 * options.h (class General_options): Add --warn-common.
4264 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
4265 merging two common symbols.
4266 (Symbol_table::should_override): Handle --warn-common when merging
4267 a common symbol with a defined symbol. Use report_resolve_problem
4268 for multiple definitions.
4269 (Symbol_table::report_resolve_problem): New function.
4270 * symtab.h (class Symbol_table): Declare report_resolve_problem.
4272 2009-11-03 Doug Kwan <dougkwan@google.com>
4274 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
4276 (Target_arm::stub_factory): New method definition.
4277 (Target_arm::new_arm_input_section,
4278 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
4279 Target_arm::reloc_uses_thumb_bit): New method declarations.
4280 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
4281 New type definitions.
4282 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
4283 member declarations.
4284 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
4285 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
4286 New method definitions.
4288 2009-11-03 Ian Lance Taylor <iant@google.com>
4290 * options.h (class General_options): Add --warn_constructors.
4292 2009-11-03 Ian Lance Taylor <iant@google.com>
4295 * defstd.cc (in_section): Add entries for __rel_iplt_start,
4296 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
4298 2009-11-03 Ian Lance Taylor <iant@google.com>
4301 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
4302 --msgid-bugs-address.
4303 (install-pdf): New target.
4304 (install-data_yes): Look up one directory to find mkinstalldirs.
4306 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
4308 * po/Make-in (.po.gmo): Don't generate .gmo files in source
4311 2009-10-30 Doug Kwan <dougkwan@google.com>
4313 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
4315 2009-10-30 Doug Kwan <dougkwan@google.com>
4317 * arm.cc (Stub_addend_reader): New struct template definition
4318 and partial specializations.
4319 (Stub_addend_reader::operator()): New method definition for a
4320 partially specialized template.
4322 2009-10-30 Doug Kwan <dougkwan@google.com>
4324 * arm.cc (Arm_relobj::processor_specific_flags): New method
4326 (Arm_relobj::do_read_symbols): New method declaration.
4327 (Arm_relobj::processor_specific_flags_): New data member declaration.
4328 (Arm_dynobj): New class definition.
4329 (Target_arm::do_finalize_sections): Add input_objects parameter.
4330 (Target_arm::do_adjust_elf_header): New method declaration.
4331 (Target_arm::are_eabi_versions_compatible,
4332 (Target_arm::merge_processor_specific_flags): New method declaration.
4333 (Target_arm::do_make_elf_object): New overloaded method definitions
4335 (Arm_relobj::do_read_symbols): New method definition.
4336 (Arm_dynobj::do_read_symbols): Ditto.
4337 (Target_arm::do_finalize_sections): Add input_objects parameters.
4338 Merge processor-specific flags from all input objects.
4339 (Target_arm::are_eabi_versions_compatible,
4340 Target_arm::merge_processor_specific_flags,
4341 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
4342 New method definitions.
4343 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
4344 Input_objects pointer type parameter.
4345 * layout.cc (Layout::finalize): Pass input objects to target's.
4346 finalize_sections function.
4347 * output.cc (Output_file_header::do_sized_write): Set ELF file
4348 header's processor-specific flags.
4349 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
4350 Input_objects pointer type parameter.
4351 * sparc.cc (Target_sparc::do_finalize_sections): Same.
4352 * target.h (Input_objects): New forward class declaration.
4353 (Target::processor_specific_flags,
4354 Target::are_processor_specific_flags_sect): New method definitions.
4355 (Target::finalize_sections): Add input_objects parameter.
4356 (Target::Target): Initialize processor_specific_flags_ and
4357 are_processor_specific_flags_set_.
4358 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
4360 (Target::set_processor_specific_flags): New method definition.
4361 (Target::processor_specific_flags_,
4362 Target::are_processor_specific_flags_set_): New data member
4364 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
4365 Input_objects pointer type parameter.
4367 2009-10-30 Doug Kwan <dougkwan@google.com>
4369 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
4371 2009-10-28 Ian Lance Taylor <iant@google.com>
4373 * object.h (class Relobj): Drop options parameter from
4374 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
4375 do_scan_relocs, do_relocate. Change all callers.
4376 (class Sized_relobj): Drop options parameters from
4377 do_gc_process_relocs, do_scan_relocs, do_relocate,
4378 do_relocate_sections, relocate_sections, emit_relocs_scan,
4379 emit_relocs_scan_reltype. Change all callers.
4380 (struct Relocate_info): Remove options field and all references to
4382 * reloc.h (class Read_relocs): Remove options constructor
4383 parameter and options_ field. Change all callers.
4384 (class Gc_process_relocs, class Scan_relocs): Likewise.
4385 (class Relocate_task): Likewise.
4386 * target-reloc.h (scan_relocs): Remove options parameter. Change
4388 (scan_relocatable_relocs): Likewise.
4389 * target.h (class Sized_target): Remove options parameter from
4390 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
4392 * gc.h (gc_process_relocs): Remove options parameter. Change all
4394 * arm.cc: Update functions to remove options parameters.
4395 * i386.cc: Likewise.
4396 * powerpc.cc: Likewise.
4397 * sparc.cc: Likewise.
4398 * x86_64.cc: Likewise.
4399 * testsuite/testfile.cc: Likewise.
4401 2009-10-28 Doug Kwan <dougkwan@google.com>
4403 * arm.cc (Arm_relobj): New class definition.
4404 (Arm_relobj::scan_sections_for_stubs,
4405 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
4406 New method definitions.
4408 2009-10-28 Cary Coutant <ccoutant@google.com>
4410 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
4411 (Plugin::cleanup_done_): New member.
4412 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
4413 (Plugin_manager::cleanup_done_): Remove.
4414 (Plugin_manager::add_input_file): Edit error message.
4415 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
4416 (Plugin_manager::cleanup): Remove use of cleanup_done_.
4418 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
4420 * fileread.cc: (File_read::View::~View): Use the new
4421 data_ownership_ filed.
4422 (File_read::~File_read): Dispose the new whole_file_view_.
4423 (File_read::open): Mmap the whole file if needed.
4424 (File_read::open): Use whole_file_view_ instead of contents_.
4425 (File_read::find_view): Use whole_file_view_ if applicable.
4426 (File_read::do_read): Use whole_file_view_ instead of contents_.
4427 (File_read::make_view): Use whole_file_view_ instead of contents_,
4428 update File_read::View::View call.
4429 (File_read::find_or_make_view): Update File_read::View::View
4431 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
4433 (File_read::View::Data_ownership): New enum.
4434 (File_read::View::View): Replace bool mapped_ with Data_ownership
4436 (File_read::View::mapped_): Remove (replaced by data_ownership_).
4437 (File_read::View::data_ownership_): New field.
4438 (File_read::contents_): Remove (replaced by whole_file_view_).
4439 (File_read::whole_file_view_): New field.
4440 * options.h (class General_options): Add --keep-files-mapped.
4442 2009-10-27 Cary Coutant <ccoutant@google.com>
4444 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
4445 * testsuite/Makefile.am (plugin_test_5): New test case.
4446 * testsuite/Makefile.in: Regenerate.
4448 2009-10-25 Doug Kwan <dougkwan@google.com>
4450 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
4451 from private to protected to allow access by child class.
4452 (Sized_relobj::do_relocate_sections): New method declaration.
4453 (Sized_relobj::relocate_sections): Virtualize.
4454 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
4455 Sized_relobj::relocate_sections. Instantiate template explicitly
4456 for different target sizes and endianity.
4458 2009-10-24 Doug Kwan <dougkwan@google.com>
4460 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
4461 (Arm_input_section::as_arm_input_section): New method.
4462 (Arm_output_section): New class definition.
4463 (Arm_output_section::create_stub_group,
4464 Arm_output_section::group_sections): New method definitions.
4466 2009-10-22 Doug Kwan <dougkwan@google.com>
4468 * arm.cc (Arm_input_section): New class definition.
4469 (Arm_input_section::init, Arm_input_section:do_write,
4470 Arm_input_section::set_final_data_size,
4471 Arm_input_section::do_reset_address_and_file_offset): New method
4474 2009-10-21 Doug Kwan <dougkwan@google.com>
4476 * arm.cc (Stub_table, Arm_input_section): New forward class
4478 (Stub_table): New class defintion.
4479 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
4480 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
4481 New method definition.
4483 2009-10-21 Doug Kwan <dougkwan@google.com>
4485 * arm.cc: Update copyright comments.
4486 (Target_arm): New forward class template declaration.
4487 (Arm_address): New type.
4488 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
4489 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
4490 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
4492 (Insn_template): Same.
4493 (DEF_STUBS): New macro.
4494 (Stub_type): New enum type.
4495 (Stub_template): New class definition.
4498 (Stub_factory): Same.
4499 (Target_arm::Target_arm): Initialize may_use_blx_ and
4500 should_force_pic_veneer_.
4501 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
4502 Target_arm::should_force_pic_veneer,
4503 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
4504 Target_arm::using_thumb_only, Target_arm:;default_target): New
4506 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
4507 New data member declarations.
4508 (Insn_template::size, Insn_template::alignment): New method defintions.
4509 (Stub_template::Stub_template): New method definition.
4510 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
4511 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
4512 (Stub_factory::Stub_factory): New method definition.
4513 * gold.h (string_hash): New template.
4514 * output.h (Input_section_specifier::hash_value): Use
4516 (Input_section_specifier::string_hash): Remove.
4517 * stringpool.cc (Stringpool_template::string_hash): Use
4520 2009-10-20 Doug Kwan <dougkwan@google.com>
4522 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
4523 symbols of relaxed input sections.
4524 * output.h (Output_section::find_relaxed_input_section): Make
4527 2009-10-16 Doug Kwan <dougkwan@google.com>
4529 * dynobj.cc (Versions::Versions): Initialize version_script_.
4530 Only insert base version symbol definition for a shared object
4531 if version script defines any version versions.
4532 (Versions::define_base_version): New method definition.
4533 (Versions::add_def): Check that base version is not needed.
4534 (Versions::add_need): Define base version lazily.
4535 * dynobj.h (Versions::define_base_version): New method declaration.
4536 (Versions::needs_base_version_): New data member declaration.
4537 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
4538 (check_DATA): Add no_version_test.stdout.
4539 (libno_version_test.so, no_version_test.o no_version_test.stdout):
4541 * testsuite/Makefile.in: Regenerate.
4542 * testsuite/no_version_test.c: New file.
4543 * testsuite/no_version_test.sh: Ditto.
4545 2009-10-16 Doug Kwan <dougkwan@google.com>
4547 * expression.cc (class Segment_start_expression): New class definition.
4548 (Segment_start_expression::value): New method definition.
4549 (script_exp_function_segment_start): Return a new
4550 Segment_start_expression.
4551 * gold/script-c.h (script_saw_segment_start_expression): New function
4553 * script-sections.cc (Script_sections::Script_sections): Initialize
4554 SAW_SEGMENT_START_EXPRESSION_ to false.
4555 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
4556 and -Tbbs options to specify section addresses if given in
4557 command line and no SEGMENT_START expression is seen in a script.
4558 * script-sections.h (Script_sections::saw_segment_start_expression,
4559 Script_sections::set_saw_segment_start_expression): New method
4561 (Script_sections::saw_segment_start_expression_): New data member
4563 * script.cc (script_saw_segment_start_expression): New function.
4564 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
4565 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
4566 script_test_7.sh and script_test_8.sh.
4567 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
4568 script_test_8.stdout.
4569 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
4570 (script_test_6, script_test_6.stdout, script_test_7,
4571 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
4572 * Makefile.in: Regenerate.
4573 * testsuite/script_test_6.sh: New file.
4574 * testsuite/script_test_6.t: Same.
4575 * testsuite/script_test_7.sh: Same.
4576 * testsuite/script_test_7.t: Same.
4577 * testsuite/script_test_8.sh: Same.
4579 2009-10-16 Doug Kwan <dougkwan@google.com>
4581 * output.cc (Output_segment::set_section_list_address): Cast
4582 expressions to unsigned long long type to avoid format warnings.
4584 2009-10-15 Ian Lance Taylor <iant@google.com>
4586 * script.cc (Script_options::add_symbol_assignment): Always add a
4587 dot assignment to script_sections_.
4588 * script-sections.cc (Script_sections::add_dot_assignment):
4589 Initialize if necessary.
4591 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
4592 program headers with no load segment if there is a linker script.
4594 * layout.cc (Layout::set_segment_offsets): Align the file offset
4595 to the segment aligment for -N or -n with no load segment.
4596 * output.cc (Output_segment::add_output_section): Don't crash if
4597 the first section is a TLS section.
4598 (Output_segment::set_section_list_addresses): Print an error
4599 message if the address moves backward in a linker script.
4600 * script-sections.cc
4601 (Output_section_element_input::set_section_addresses): Don't
4602 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
4603 (Orphan_output_section::set_section_addresses): Likewise.
4605 2009-10-15 Doug Kwan <dougkwan@google.com>
4607 * layout.cc (Layout::finish_dynamic_section): Generate tags
4608 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
4609 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
4610 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
4612 2009-10-14 Ian Lance Taylor <iant@google.com>
4614 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
4616 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
4617 data_shdr fields of relinfo.
4618 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
4619 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
4620 R_386_TLS_LDO_32, adjust based on section flags.
4621 (Target_i386::Relocate::fix_up_ldo): Remove.
4623 2009-10-13 Ian Lance Taylor <iant@google.com>
4625 Add support for -pie.
4626 * options.h (class General_options): Add -pie and
4628 (General_options::output_is_position_independent): Test -pie.
4629 (General_options::output_is_executable): Return true if not shared
4630 and not relocatable.
4631 (General_options::output_is_pie): Remove.
4632 * options.cc (General_options::finalize): Reject incompatible uses
4634 * gold.cc (queue_middle_tasks): A -pie link is not static.
4635 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
4636 * symtab.cc (Symbol::final_value_is_known): Return false if
4637 output_is_position_independent.
4638 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
4639 output_is_position_independent.
4640 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
4641 output_is_position_independent.
4642 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
4643 output_is_position_independent.
4644 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
4646 (basic_pie_test.o, basic_pie_test): New targets.
4647 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
4648 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
4649 (two_file_pie_test): New target.
4650 * testsuite/Makefile.in: Rebuild.
4651 * README: Remove note saying that -pie is not supported.
4653 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
4655 * options.h (class General_options): Add -init and -fini.
4656 * layout.cc (Layout::finish_dynamic_section): Emit
4657 given init and fini functions.
4659 2009-10-13 Sriraman Tallam <tmsriram@google.com>
4661 * gc.h (gc_process_relocs): Check if icf is enabled using new
4663 * gold.cc (queue_initial_tasks): Likewise.
4664 (queue_middle_tasks): Likewise.
4665 * object.cc (do_layout): Likewise.
4666 * symtab.cc (is_section_folded): Likewise.
4667 * main.cc (main): Likewise.
4668 * reloc.cc (Read_relocs::run): Likewise.
4669 (Sized_relobj::do_scan_relocs): Likewise.
4670 * icf.cc (is_function_ctor_or_dtor): New function.
4671 (Icf::find_identical_sections): Check if function is ctor or dtor when
4673 * options.h (General_options::icf): Change option to be an enum.
4674 (Icf_status): New enum.
4675 (icf_enabled): New method.
4676 (icf_safe_folding): New method.
4677 (set_icf_status): New method.
4678 (icf_status_): New variable.
4679 * (options.cc) (General_options::finalize): Set icf_status_.
4680 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
4681 icf_test and icf_keep_unique_test to use the --icf enum flag.
4682 * testsuite/icf_safe_test.sh: New file.
4683 * testsuite/icf_safe_test.cc: New file.
4685 2009-10-12 Sriraman Tallam <tmsriram@google.com>
4687 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
4688 includes to gc.h and icf.h.
4689 * arm.cc: Include gc.h.
4690 * gold.cc: Likewise.
4691 * i386.cc: Likewise.
4692 * powerpc.cc: Likewise.
4693 * sparc.cc: Likewise.
4694 * x86_64.cc: Likewise.
4695 * gc.h: Include icf.h.
4697 2009-10-11 Ian Lance Taylor <iant@google.com>
4699 * plugin.cc: Include "gold.h" before other header files.
4701 2009-10-10 Chris Demetriou <cgd@google.com>
4703 * options.h (Input_file_argument::Input_file_type): New enum.
4704 (Input_file_argument::is_lib_): Replace with...
4705 (Input_file_argument::type_): New member.
4706 (Input_file_argument::Input_file_argument): Take Input_file_type
4707 'type' rather than boolean 'is_lib' as second argument.
4708 (Input_file_argument::is_lib): Use type_.
4709 (Input_file_argument::is_searched_file): New function.
4710 (Input_file_argument::may_need_search): Handle is_searched_file.
4711 * options.cc (General_options::parse_library): Support -l:filename.
4712 (General_options::parse_just_symbols): Update for Input_file_argument
4714 (Command_line::process): Likewise.
4715 * archive.cc (Archive::get_file_and_offset): Likewise.
4716 * plugin.cc (Plugin_manager::release_input_file): Likewise.
4717 * script.cc (read_script_file, script_add_file): Likewise.
4718 * fileread.cc (Input_file::Input_file): Likewise.
4719 (Input_file::will_search_for): Handle is_searched_file.
4720 (Input_file::open): Likewise.
4721 * readsyms.cc (Read_symbols::get_name): Likewise.
4722 * testsuite/Makefile.am (searched_file_test): New test.
4723 * testsuite/Makefile.in: Regenerate.
4724 * testsuite/searched_file_test.cc: New file.
4725 * testsuite/searched_file_test_lib.cc: New file.
4727 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4728 Ian Lance Taylor <iant@google.com>
4730 * descriptor.cc: Include <cstdio> and "binary-io.h".
4731 (Descriptors::open): Open the files in binary mode always.
4732 * script.cc (Lex::get_token): Treat \r as whitespace.
4734 2009-10-09 Ian Lance Taylor <iant@google.com>
4736 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
4738 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4739 Ian Lance Taylor <iant@google.com>
4741 * configure.ac: Check for readv function also.
4742 * fileread.cc (readv): Define if not HAVE_READV.
4743 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
4745 * config.in: Regenerate.
4746 * configure: Regenerate.
4748 2009-10-09 Doug Kwan <dougkwan@google.com>
4750 * layout.cc (Layout::make_output_section): Call target hook to make
4751 ordinary output section.
4752 (Layout::finalize): Adjust parameter list of call the
4753 Target::may_relax().
4754 * layout.h (class Layout::section_list): New method.
4755 * merge.h (Output_merge_base::entsize): Change visibility to public.
4756 (Output_merge_base::is_string, Output_merge_base::do_is_string):
4758 (Output_merge_string::do_is_string): New method.
4759 * object.cc (Sized_relobj::do_setup): renamed from
4760 Sized_relobj::set_up.
4761 * object.h (Sized_relobj::adjust_shndx,
4762 Sized_relobj::initializ_input_to_output_maps,
4763 Sized_relobj::free_input_to_output_maps): Change visibilities to
4765 (Sized_relobj::setup): Virtualize.
4766 (Sized_relobj::do_setup): New method declaration.
4767 (Sized_relobj::invalidate_section_offset,
4768 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
4769 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
4770 * options.cc (parse_int): New function.
4771 * options.h (parse_int): New declaration.
4772 (DEFINE_int): New macro.
4773 (stub_group_size): New option.
4774 * output.cc (Output_section::Output_section): Initialize memebers
4775 merge_section_map_, merge_section_by_properties_map_,
4776 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
4777 (Output_section::add_input_section): Handled deferred code-fill
4778 generation and remove an old comment.
4779 (Output_section::add_relaxed_input_section): New method definition.
4780 (Output_section::add_merge_input_section): Use merge section by
4781 properties map to speed to search. Update merge section maps
4783 (Output_section::build_relaxation_map): New method definition.
4784 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4786 (Output_section::relax_input_section): Renamed to
4787 Output_section::convert_input_sections_to_relaxed_sections and change
4788 interface to take a vector of pointers to relaxed sections.
4789 (Output_section::find_merge_section,
4790 Output_section::find_relaxed_input_section): New method definitions.
4791 (Output_section::is_input_address_mapped,
4792 Output_section::output_offset, Output_section::output_address):
4793 Use output section data maps to speed up searching.
4794 (Output_section::find_starting_output_address): Add comments.
4795 (Output_section::do_write,
4796 Output_section::write_to_postprocessing_buffer): Do code-fill
4797 generation as appropriate.
4798 (Output_section::get_input_sections): Invalidate relaxed input section
4800 (Output_section::restore_states): Adjust type of checkpoint .
4801 Invalidate relaxed input section map.
4802 * output.h (Output_merge_base): New class declaration.
4803 (Input_section_specifier): New class defintion.
4804 (class Output_relaxed_input_section) Change base class to
4805 Output_section_data_build.
4806 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
4807 base class initializer.
4808 (Output_section::add_relaxed_input_section): New method declaration.
4809 (Output_section::Input_section): Change visibility to protected.
4810 (Output_section::Input_section::relobj,
4811 Output_section::Input_section::shndx): Handle relaxed input sections.
4812 Output_section::input_sections) Change visibility to protected. Also
4813 define overload to return a non-const pointer.
4814 (Output_section::Merge_section_properties): New class defintion.
4815 (Output_section::Merge_section_by_properties_map,
4816 Output_section::Output_section_data_by_input_section_map,
4817 Output_section::Relaxation_map): New types.
4818 (Output_section::relax_input_section): Rename method to
4819 Output_section::convert_input_sections_to_relaxed_sections and change
4820 interface to take a vector of relaxed section pointers.
4821 (Output_section::find_merge_section,
4822 Output_section::find_relaxed_input_section,
4823 Output_section::build_relaxation_map,
4824 Output_section::convert_input_sections_in_list_to_relaxed_sections):
4825 New method declarations.
4826 (Output_section::merge_section_map_
4827 Output_section::merge_section_by_properties_map_,
4828 Output_section::relaxed_input_section_map_,
4829 Output_section::is_relaxed_input_section_map_valid_,
4830 Output_section::generate_code_fills_at_write_): New data members.
4831 * script-sections.cc
4832 (Output_section_element_input::set_section_addresses): Call
4833 current_data_size and addralign methods of relaxed input sections.
4834 (Orphan_output_section::set_section_addresses): Call current_data_size
4835 and addralign methods of relaxed input sections.
4836 * symtab.cc (Symbol_table::compute_final_value): Extract template
4837 from the body of Symbol_table::sized_finalize_symbol.
4838 (Symbol_table::sized_finalized_symbol): Call
4839 Symbol_table::compute_final_value.
4840 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
4841 (Symbol_table::compute_final_value): New templated method declaration.
4842 * target.cc (Target::do_make_output_section): New method defintion.
4843 * target.h (Target::make_output_section): New method declaration.
4844 (Target::relax): Add more parameters for input objects, symbol table
4845 and layout. Adjust call to do_relax.
4846 (Target::do_make_output_section): New method declaration.
4847 (Target::do_relax): Add parameters for input objects, symbol table
4850 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4852 * pread.c: Include stdio.h.
4854 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4856 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
4859 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
4861 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4862 Change read_shndx type to unsigned int.
4863 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
4865 (Sized_dwarf_line_info::read_line_mappings): Likewise.
4866 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
4867 Change read_shndx type to unsigned int.
4868 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
4870 (Sized_dwarf_line_info::read_line_mappings): Likewise.
4871 * layout.cc (Layout::create_symtab_sections): Cast the result of
4872 local_symcount * symsize to off_t in the gold_assert.
4874 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4876 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
4877 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
4879 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
4880 (Arm_relocate_functions::thm_abs5): New function.
4881 (Arm_relocate_functions::abs12): New function.
4882 (Arm_relocate_functions::abs16): New function.
4883 (Arm_relocate_functions::base_abs): New function.
4884 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
4885 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
4886 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
4888 (Scan::global): Likewise.
4889 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
4890 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
4891 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
4892 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
4895 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4897 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
4898 (Arm_relocate_functions::movt_prel): New function.
4899 (Arm_relocate_functions::thm_movw_prel_nc): New function.
4900 (Arm_relocate_functions::thm_movt_prel): New function.
4901 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
4902 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
4903 (Scan::global, Relocate::relocate): Likewise.
4904 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4906 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
4908 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
4909 Incremental_checker.
4910 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
4912 (class Incremental_inputs_header): New class.
4913 (Incremental_inputs_header_writer): Edit comment.
4914 (Incremental_inputs_entry): New class.
4915 (Incremental_inputs_entry_writer): Edit comment.
4916 (Sized_incremental_binary::do_find_incremental_inputs_section):
4917 Add *strtab_shndx parameter, fill it.
4918 (Sized_incremental_binary::do_check_inputs): New method.
4919 (Incremental_checker::can_incrementally_link_output_file): Use
4920 Sized_incremental_binary::check_inputs.
4921 (Incremental_inputs::report_command_line): Save command line in
4924 (Incremental_binary::find_incremental_inputs_section): New
4926 (Incremental_binary::do_find_incremental_inputs_section): Add
4927 strtab_shndx parameter.
4928 (Incremental_binary::do_check_inputs): New pure virtual method.
4929 (Sized_incremental_binary::do_check_inputs): Declare.
4930 (Incremental_checker::Incremental_checker): Add incremental_inputs
4931 parameter, use it to initialize incremental_inputs_.
4932 (Incremental_checker::incremental_inputs_): New field.
4933 (Incremental_checker::command_line): New method.
4934 (Incremental_checker::inputs): New method.
4935 (Incremental_checker::command_line_): New field.
4937 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
4939 * incremental.cc: Include <cstdarg> and "target-select.h".
4940 (vexplain_no_incremental): New function.
4941 (explain_no_incremental): New function.
4942 (Incremental_binary::error): New method.
4943 (Sized_incremental_binary::do_find_incremental_inputs_section): New
4945 (make_sized_incremental_binary): New function.
4946 (open_incremental_binary): New function.
4947 (can_incrementally_link_file): Add checks if output is ELF and has
4949 * incremental.h: Include "elfcpp_file.h" and "output.h".
4950 (Incremental_binary): New class.
4951 (Sized_incremental_binary): New class.
4952 (open_incremental_binary): Declare.
4953 * object.cc (is_elf_object): Use
4954 elfcpp::Elf_recognizer::is_elf_file.
4955 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
4956 * output.h (Output_file::filesize): New method.
4958 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4960 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
4962 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
4963 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
4965 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
4967 (Arm_relocate_functions::movw_abs_nc): New function.
4968 (Arm_relocate_functions::movt_abs): New function.
4969 (Arm_relocate_functions::thm_movw_abs_nc): New function.
4970 (Arm_relocate_functions::thm_movt_abs): New function.
4971 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
4972 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
4973 (Scan::global): Likewise.
4974 (Relocate::relocate): Likewise.
4975 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4977 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4979 * arm.cc (Arm_relocate_functions::got_prel) New function.
4980 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
4981 (Relocate::relocate): Likewise.
4982 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4984 2009-10-06 Ian Lance Taylor <iant@google.com>
4986 * options.h (class General_options): Define
4987 split_stack_adjust_size parameter.
4988 * object.h (class Object): Add uses_split_stack_ and
4989 has_no_split_stack_ fields. Add uses_split_stack and
4990 has_no_split_stack accessor functions. Declare
4991 handle_split_stack_section.
4992 (class Reloc_symbol_changes): Define.
4993 (class Sized_relobj): Define Function_offsets. Declare
4994 split_stack_adjust, split_stack_adjust_reltype, and
4996 * object.cc (Object::handle_split_stack_section): New function.
4997 (Sized_relobj::do_layout): Call handle_split_stack_section.
4998 * dynobj.cc (Sized_dynobj::do_layout): Call
4999 handle_split_stack_section.
5000 * reloc.cc (Sized_relobj::relocate_sections): Call
5001 split_stack_adjust for executable sections in split_stack
5002 objects. Pass reloc_map to relocate_section.
5003 (Sized_relobj::split_stack_adjust): New function.
5004 (Sized_relobj::split_stack_adjust_reltype): New function.
5005 (Sized_relobj::find_functions): New function.
5006 * target-reloc.h: Include "object.h".
5007 (relocate_section): Add reloc_symbol_changes parameter. Change
5009 * target.h (class Target): Add calls_non_split method. Declare
5010 do_calls_non_split virtual method. Declare match_view and
5012 * target.cc: Include "elfcpp.h".
5013 (Target::do_calls_non_split): New function.
5014 (Target::match_view): New function.
5015 (Target::set_view_to_nop): New function.
5016 * gold.cc (queue_middle_tasks): Give an error if mixing
5017 split-stack and non-split-stack objects with -r.
5018 * i386.cc (Target_i386::relocate_section): Add
5019 reloc_symbol_changes parameter.
5020 (Target_i386::do_calls_non_split): New function.
5021 * x86_64.cc (Target_x86_64::relocate_section): Add
5022 reloc_symbol_changes parameter.
5023 (Target_x86_64::do_calls_non_split): New function.
5024 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
5026 * powerpc.cc (Target_powerpc::relocate_section): Add
5027 reloc_symbol_changes parameter.
5028 * sparc.cc (Target_sparc::relocate_section): Add
5029 reloc_symbol_changes parameter.
5030 * configure.ac: Call AM_CONDITIONAL for the default target.
5031 * configure: Rebuild.
5032 * testsuite/Makefile.am (TEST_AS): New variable.
5033 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
5034 (check_DATA): Add split_i386 and split_x86_64 files.
5035 (SPLIT_DEFSYMS): Define.
5036 (split_i386_[1234n].o): New targets.
5037 (split_i386_[124]): New targets.
5038 (split_i386_[1234r].stdout): New targets.
5039 (split_x86_64_[1234n].o): New targets.
5040 (split_x86_64_[124]): New targets.
5041 (split_x86_64_[1234r].stdout): New targets.
5042 (MOSTLYCLEANFILES): Add new executables.
5043 * testsuite/split_i386.sh: New file.
5044 * testsuite/split_x86_64.sh: New file.
5045 * testsuite/split_i386_1.s: New file.
5046 * testsuite/split_i386_2.s: New file.
5047 * testsuite/split_i386_3.s: New file.
5048 * testsuite/split_i386_4.s: New file.
5049 * testsuite/split_i386_n.s: New file.
5050 * testsuite/split_x86_64_1.s: New file.
5051 * testsuite/split_x86_64_2.s: New file.
5052 * testsuite/split_x86_64_3.s: New file.
5053 * testsuite/split_x86_64_4.s: New file.
5054 * testsuite/split_x86_64_n.s: New file.
5055 * testsuite/testfile.cc (Target_test): Update relocation_section
5057 * testsuite/Makefile.in: Rebuild.
5059 2009-10-06 Ian Lance Taylor <iant@google.com>
5061 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
5062 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
5063 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
5064 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
5065 the address on ldo_addrs_.
5066 (Target_i386::Relocate::fix_up_ldo): New function.
5068 2009-10-06 Rafael Espindola <espindola@google.com>
5070 * plugin.cc (add_input_library): New.
5071 (Plugin::load): Add add_input_library to tv.
5072 (Plugin_manager::add_input_file): Add the is_lib argument.
5073 (add_input_file): Update call to Plugin_manager::add_input_file.
5074 (add_input_library): New.
5075 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
5077 2009-09-30 Doug Kwan <dougkwan@google.com>
5079 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
5080 symbol and call Symbol::may_need_copy_reloc to determine if
5081 a copy reloc is needed.
5082 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
5083 nocopyreloc is given in command line.
5084 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
5085 given in command line.
5086 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
5087 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
5088 of the removed Target_i386::may_need_copy_reloc.
5089 * options.h (copyreloc): New option with default value false.
5090 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5091 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
5092 instead of the removed Target_powerpc::may_need_copy_reloc.
5093 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5094 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
5095 instead of the removed Target_sparc::may_need_copy_reloc.
5096 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
5097 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
5098 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
5099 instead of the removed Target_x86_64::may_need_copy_reloc.
5101 2009-09-30 Ian Lance Taylor <iant@google.com>
5103 * object.h (class Object): Remove target_ field, and target,
5104 sized_target, and set_target methods.
5105 (Object::sized_target): Remove.
5106 (class Sized_relobj): Update declarations. Remove sized_target.
5107 * object.cc (Sized_relobj::setup): Remove target parameter.
5109 (Input_objects::add_object): Don't do anything with the target.
5110 (make_elf_sized_object): Add punconfigured parameter. Change all
5111 callers. Set or test parameter target.
5112 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
5114 * parameters.cc (Parameters::set_target): Change parameter type to
5116 (Parameters::default_target): Remove.
5117 (set_parameters_target): Change parameter type to be non-const.
5118 (parameters_force_valid_target): New function.
5119 (parameters_clear_target): New function.
5120 * parameters.h (class Parameters): Update declarations. Remove
5121 default_target method. Add sized_target and clear_target
5122 methods. Change target_ to be non-const.
5123 (set_parameters_target): Update declaration.
5124 (parameters_force_valid_target): Declare.
5125 (parameters_clear_target): Declare.
5126 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
5127 as NULL if we aren't searching.
5128 (Add_symbols::run): Don't check for compatible target.
5129 * fileread.cc (Input_file::open_binary): Call
5130 parameters_force_valid_target.
5131 * gold.cc (queue_middle_tasks): Likewise.
5132 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
5133 set_target on object.
5134 * dynobj.h (class Sized_dynobj): Update declarations.
5135 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
5136 make_elf_object returns NULL.
5137 (Archive::include_member): Don't check whether object target is
5139 * output.cc (Output_section::add_input_section): Get target from
5141 (Output_section::relax_input_section): Likewise.
5142 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
5144 (Sized_relobj::do_scan_relocs): Likewise.
5145 (Sized_relobj::relocate_sections): Likewise.
5146 * resolve.cc (Symbol_table::resolve): Likewise.
5147 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
5148 parameter. Change all callers.
5149 (Symbol_table::add_from_object): Get target from parameters.
5150 (Symbol_table::add_from_relobj): Don't check object target.
5151 (Symbol_table::add_from_dynobj): Likewise.
5152 (Symbol_table::define_special_symbol): Get target from
5154 * symtab.h (class Symbol_table): Update declaration.
5155 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
5156 parameter. Change all callers. Clear parameter target.
5157 (Binary_test): Test target here.
5158 * testsuite/object_unittest.cc (gold_testsuite): Remove
5159 target_test_pointer parameter. Change all callers.
5160 (Object_test): Test target here.
5162 2009-09-26 Ian Lance Taylor <iant@google.com>
5164 * testsuite/initpri1.c: Don't try to use constructor priorities if
5165 compiling with gcc before 4.3.
5167 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
5169 * testsuite/retain_symbols_file_test.sh (check_present): Change
5170 output file name to retain_symbols_file_test.stdout.
5171 (check_absent): Likewise.
5173 2009-09-18 Craig Silverstein <csilvers@google.com>
5175 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
5176 * options.cc: Include <cerrno> and <fstream>.
5177 (General_options::finalize): Parse -retain-symbols-file tag.
5178 * options.h: New flag.
5179 (General_options): New method should_retain_symbol, new
5180 variable symbols_to_retain.
5181 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
5182 should_retain_symbol map.
5183 * testsuite/Makefile.am (retain_symbols_file_test): New test.
5184 * testsuite/Makefile.in: Regenerate.
5185 * testsuite/retain_symbols_file_test.sh: New file.
5187 2009-09-18 Nick Clifton <nickc@redhat.com>
5189 * po/es.po: Updated Spanish translation.
5191 2009-09-17 Doug Kwan <dougkwan@google.com>
5193 * debug.h (DEBUG_RELAXATION): New constant.
5194 (DEBUG_ALL): Add DEBUG_RELAXATION.
5195 (debug_string_to_enum): Add relaxation debug option.
5197 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
5198 Layout::Relaxation_debug_check::read_sections,
5199 Layout::Relaxation_debug_check::read_sections): New method definitions.
5200 (Layout::Layout): Initialize data members
5201 record_output_section_data_from_scrips_,
5202 script_output_section_data_list_ and relaxation_debug_check_.
5203 (Layout::save_segments, Layout::restore_segments,
5204 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5205 Layout::relaxation_loop_body): New method definitions.
5206 (Layout::finalize): Support relaxation. Move section layout code to
5207 Layout::relaxation_loop_body.
5208 (Layout::set_asection_address_from_script): Move code for orphan
5209 section placement out.
5210 (Layout::place_orphan_sections_in_script): New method definition.
5211 * layout.h (Output_segment_headers, Output_file_header):
5212 New forward class declarations.
5213 (Layout::~Layout): Define.
5214 (Layout::new_output_section_data_from_script): New method definition.
5215 (Layout::place_orphan_sections_in_script): New method declaration.
5216 (Layout::Segment_states): New type declaration.
5217 (Layout::save_segments, Layout::restore_segments,
5218 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5219 Layout::relaxation_loop_body): New method declarations.
5220 (Layout::Output_section_data_list): New type declaration.
5221 (Layout::Relaxation_debug_check): New class definition.
5222 (Layout::record_output_section_data_from_script_,
5223 Layout::script_output_section_data_list_, Layout::segment_states_,
5224 Layout::relaxation_debug_check_): New data members.
5225 * output.cc: (Output_section_headers::do_size): New method definition.
5226 (Output_section_headers::Output_section_headers): Move size
5227 computation to Output_section_headers::do_size.
5228 (Output_segment_headers::do_size): New method definition.
5229 (Output_file_header::Output_file_header): Move size computation to
5230 Output_file_header::do_size and call it.
5231 (Output_file_header::do_size): New method definition.
5232 (Output_data_group::Output_data_group): Adjust call to
5233 Output_section_data.
5234 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
5235 (Output_symtab_xindex::do_write): Add array bound check.
5236 (Output_section::Input_section::print_to_mapfile): Handle
5237 RELAXED_INPUT_SECTION_CODE.
5238 (Output_section::Output_section): Initialize data member checkpoint_.
5239 (Output_section::~Output_section): Delete checkpoint object pointed
5241 (Output_section::add_input_section): Always add an Input_section if
5243 (Output_section::add_merge_input_section): Add assert.
5244 (Output_section::relax_input_section): New method definition.
5245 (Output_section::set_final_data_size): Set load address to zero for
5246 an unallocated section.
5247 (Output_section::do_address_and_file_offset_have_reset_values):
5248 New method definition.
5249 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
5250 Handle relaxed input section.
5251 (Output_section::sort_attached_input_sections): Checkpoint input
5252 section list lazily.
5253 (Output_section::get_input_sections): Change type of input_sections to
5254 list of Simple_input_section pointers. Checkpoint input section list
5255 lazily. Also handle relaxed input sections.
5256 (Output_section::add_input_section_for_script): Take a reference to
5257 a Simple_input_section object instead of Relobj pointer and section
5258 index as parameter. Handle relaxed input sections.
5259 (Output_section::save_states, Output_section::restore_states): New
5261 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
5262 (Output_data::is_data_size_fixed): New method definition.
5263 (Output_data::reset_addresss_and_file_offset): Do not reset data size
5265 (Output_data::address_and_file_offset_have_reset_values): New method
5267 (Output_data::do_address_and_file_offset_have_reset_values): New method
5269 (Output_data::set_data_size): Check that data size is not fixed.
5270 (Output_data::fix_data_size): New method definition.
5271 (Output_data::is_data_size_fixed_): New data member.
5272 (Output_section_headers::set_final_data_size): New method definition.
5273 (Output_section_headers::do_size): New method declaration.
5274 (Output_segment_headers::set_final_data_size): New method definition.
5275 (Output_segment_headers::do_size): New method declaration.
5276 (Output_file_header::set_final_data_size)::New method definition.
5277 (Output_file_header::do_size)::New method declaration.
5278 (Output_section_data::Output_section_data): Add new parameter
5279 is_data_size_fixed and use it to fix data size.
5280 (Output_data_const::Output_data_const): Adjust call to base class
5281 constructor and fix data size.
5282 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
5283 base class constructor and fix data size.
5284 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
5285 base class constructor and fix data size.
5286 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
5287 class constructor and fix data size.
5288 (Output_data_group::set_final_data_size): New method definition.
5289 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
5290 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
5291 class constructor and fix data size.
5292 (Output_relaxed_input_section): New class definition.
5293 (Output_section::Simple_input_section): New class definition.
5294 (Output_section::get_input_sections): Adjust parameter list.
5295 (Output_section::add_input_section_for_script): Same.
5296 (Output_section::save_states, Output_section::restore_states,
5297 Output_section::do_address_and_file_offset_have_reset_values,
5298 (Output_section::Input_section::Input_section): Handle
5299 RELAXED_INPUT_SECTION_CODE. Add new overload for
5300 Output_relaxed_input_section.
5301 (Output_section::Input_section::is_input_section,
5302 Output_section::Input_section::set_output_section): Handle relaxed
5304 (Output_section::Input_section::is_relaxed_input_section,
5305 Output_section::Input_section::output_section_data,
5306 Output_section::Input_section::relaxed_input_section): New method
5308 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
5310 (Output_section::Input_section::u1_): Update comments.
5311 (Output_section::Input_section::u2_): Add new union member poris.
5312 (Output_section::Checkpoint_output_section): New classs definition.
5313 (Output_section::relax_input_section): New method declaration.
5314 (Output_section::checkpoint_): New data member.
5315 (Output_segment): Update comments.
5316 (Output_segment::Output_segment): Un-privatize copy constructor.
5317 (Output_segment::operator=): Un-privatize.
5318 * script-sections.cc (Output_section_element::Input_section_list):
5319 Change element type to Output_section::Simple_input_section.
5320 (Output_section_element_dot_assignment::set_section_addresses):
5321 Register output section data for relaxation clean up.
5322 (Output_data_exression::Output_data_expression): Adjust call to base
5323 constructor to fix data size.
5324 (Output_section_element_data::set_section_addresses): Register
5325 Output_data_expression object for relaxation clean up.
5326 (struct Input_section_info): Replace Relobj pointer and section index
5327 pair with Output_section::Simple_input_section and Convert struct to a
5329 (Input_section_sorter::operator()): Adjust access to
5330 Input_section_info data member to use accessors.
5331 (Output_section_element_input::set_section_addresses): Use layout
5332 parameter. Adjust code to use Output_section::Simple_input_section
5333 and Input_secction_info classes. Register filler for relaxation
5335 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
5336 and section index pair with Output_section::Simple_input_section
5337 class. Adjust code accordingly.
5338 (Phdrs_element::release_segment): New method definition.
5339 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
5341 (Script_sections::release_segments): New method definition.
5342 * gold/script-sections.h (Script_sections::release_segments): New
5344 * gold/target.h (Target::may_relax, Target::relax,
5345 Target::do_may_relax, Target::do_relax): New method definitions.
5347 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5349 * arm.cc (has_signed_unsigned_overflow): New function.
5350 (Arm_relocate_functions::abs8): New function.
5351 (Target_arm::Scan::local): Handle R_ARM_ABS8.
5352 (Target_arm::Scan::global): Likewise.
5353 (Target_arm::relocate::relocate): Likewise.
5354 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5357 2009-09-16 Cary Coutant <ccoutant@google.com>
5359 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
5360 * testsuite/Makefile.in: Regenerate.
5362 2009-09-11 Nick Clifton <nickc@redhat.com>
5364 * po/gold.pot: Updated by the Translation project.
5366 2009-09-08 Cary Coutant <ccoutant@google.com>
5368 * output.cc (Output_file::open): Add execute permission to empty file.
5369 * testsuite/Makefile.am (permission_test): New test.
5370 * testsuite/Makefile.in: Regenerate.
5372 2009-09-02 Ian Lance Taylor <iant@google.com>
5374 * output.cc (Output_file::resize): Call map_no_anonymous rather
5377 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
5379 * gold.cc: Include "incremental.h".
5380 (queue_initial_tasks): Call Incremental_checker methods.
5381 * incremental.cc: Include "output.h".
5382 (Incremental_checker::can_incrementally_link_output_file): New
5384 * incremental.h (Incremental_checker): New class.
5386 * output.cc (Output_file::open_for_modification): New method.
5387 (Output_file::map_anonymous): Changed return type to bool. Record
5389 (Output_file::map_no_anonymous): New method, broken out of map.
5390 (Output_file::map): Use map_no_anonymous and map_anonymous.
5391 * output.h (class Output_file): Update declarations.
5393 2009-08-24 Cary Coutant <ccoutant@google.com>
5395 * options.h (Command_line::Pre_options): New class.
5396 (Command_line::pre_options): New member.
5397 * options.cc (gold::options::ready_to_register): New variable.
5398 (One_option::register_option): Do nothing if not registering options.
5399 Assert if same short option registered twice.
5400 (General_options::General_options): Turn off option registration when
5402 (Command_line::Pre_options::Pre_options): New constructor.
5404 2009-08-24 Cary Coutant <ccoutant@google.com>
5406 * options.h (General_options::no_keep_memory): Remove incorrect
5409 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5411 * Makefile.am (am__skiplex, am__skipyacc): New.
5412 * Makefile.in: Regenerate.
5414 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5416 * Makefile.am (AM_CPPFLAGS): Renamed from ...
5417 (INCLUDES): ... this.
5418 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
5419 (AM_CPPFLAGS): Renamed from ...
5420 (INCLUDE): ... this.
5421 * Makefile.in, testsuite/Makefile.in: Regenerate.
5423 * Makefile.in: Regenerate.
5424 * aclocal.m4: Likewise.
5425 * config.in: Likewise.
5426 * configure: Likewise.
5427 * testsuite/Makefile.in: Likewise.
5429 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5430 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5431 * Makefile.in: Regenerate.
5432 * testsuite/Makefile.in: Regenerate.
5434 2009-08-19 Cary Coutant <ccoutant@google.com>
5436 * resolve.cc (Symbol_table::resolve): Don't complain about defined
5437 symbols in shared libraries overridden by hidden or internal symbols
5438 in the main program.
5440 2009-08-19 Chris Demetriou <cgd@google.com>
5442 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
5443 checking source file names in error messages.
5445 2009-08-18 Doug Kwan <dougkwan@google.com>
5447 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
5448 an elcpp::Ehdr as parameter. Adjust call to set_target.
5449 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
5450 an elfcpp::Ehdr as parameter.
5451 * object.cc (Object::set_target): Remove the version that looks up
5452 a target and sets it.
5453 (Sized_relobj::setup): Take a Target object instead of
5454 an elfcpp::Ehdr as parameter. Adjust call to set_target.
5455 (make_elf_sized_object): Find target and ask target to
5457 * object.h: (Object::set_target): Remove the version that looks up
5458 a target and sets it.
5459 (Sized_relobj::setup): Take a Target object instead of
5460 an elfcpp:Ehdr as parameter.
5461 * target.cc: Include dynobj.h.
5462 (Target::do_make_elf_object_implementation): New.
5463 (Target::do_make_elf_object): New.
5464 * target.h (Target::make_elf_object): New template declaration.
5465 (Target::do_make_elf_object): New method declarations.
5466 (Target::do_make_elf_object_implementation): New template declaration.
5468 2009-08-14 Ian Lance Taylor <iant@google.com>
5470 * gold.h (FUNCTION_NAME): Define.
5471 (gold_unreachable): Use FUNCTION_NAME.
5473 2009-08-12 Sriraman Tallam <tmsriram@google.com>
5475 * icf.cc (Icf::find_identical_sections): Issue a warning when a
5476 symbol in the --keep-unique list is not found.
5478 2009-08-12 Sriraman Tallam <tmsriram@google.com>
5480 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
5481 been maked as --keep-unique.
5482 (Icf::unfold_section): New function.
5483 * icf.h (Icf::unfold_section): New function.
5484 * options.h (General_options::keep_unique): New option.
5485 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
5486 * testsuite/Makefile.in: Regenerate.
5487 * testsuite/icf_keep_unique_test.sh: New file.
5488 * testsuite/icf_keep_unique_test.cc: New file.
5490 2009-08-12 Cary Coutant <ccoutant@google.com>
5493 * resolve.cc (Symbol_table::resolve): Check for references from
5494 dynamic objects to hidden and internal symbols.
5495 * testsuite/Makefile.am (hidden_test.sh): New test.
5496 * testsuite/Makefile.in: Regenerate.
5497 * testsuite/hidden_test.sh: New script.
5498 * testsuite/hidden_test_1.c: New test source.
5499 * testsuite/hidden_test_main.c: New test source.
5501 2009-08-11 Doug Kwan <dougkwan@google.com>
5503 * arm.cc: Update comments.
5504 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
5505 segment to locate the .ARM.exidx section if present.
5507 2009-08-09 Doug Kwan <dougkwan@google.com>
5509 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
5512 2009-08-07 Sriraman Tallam <tmsriram@google.com>
5513 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
5516 2009-08-06 Sriraman Tallam <tmsriram@google.com>
5518 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
5519 valid tls_segment only for non-debug-section relocations.
5520 * testsuite/Makefile.am: Add gc_tls_test.
5521 * testsuite/Makefile.in: Regenerate.
5522 * testsuite/gc_tls_test.cc: New file.
5523 * testsuite/gc_tls_test.sh: New file.
5525 2009-08-05 Sriraman Tallam <tmsriram@google.com>
5529 * Makefile.am (CCFILES): Add icf.cc.
5531 * Makefile.in: Regenerate.
5532 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
5533 * gc.h (gc_process_relocs): Populate lists used by icf to contain
5534 section, symbol and addend information for the relocs.
5535 * gold.cc (queue_middle_tasks): Call identical code folding.
5536 * gold.h: Add defines for multimap.
5537 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
5538 to the call of finalize_local_symbols.
5539 * main.cc (main): Create object of class Icf.
5540 * object.cc (Sized_relobj::do_layout): Allow this function to be
5541 called twice during icf.
5542 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
5543 to sections marked as identical by icf.
5544 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
5546 (Sized_relobj::do_section_entsize): New function.
5547 * object.h (Object::section_entsize): New function.
5548 (Object::do_section_entsize): New pure virtual function.
5549 (Relobj::finalize_local_symbols): Add new parameter.
5550 (Relobj::do_section_entsize): New function.
5551 * options.h (General_options::icf): New option.
5552 (General_options::icf_iterations): New option.
5553 (General_options::print_icf_sections): New option.
5554 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
5555 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
5556 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
5558 * symtab.cc (Symbol_table::is_section_folded): New function.
5559 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
5560 to sections marked as identical by icf.
5561 * symtab.h (Symbol_table::set_icf): New function.
5562 (Symbol_table::icf): New function.
5563 (Symbol_table::is_section_folded): New function.
5564 (Symbol_table::icf_): New data member.
5565 * target-reloc.h (relocate_section): Ignore sections folded by icf.
5566 * testsuite/Makefile.am: Add commands to build icf_test.
5567 * testsuite/Makefile.in: Regenerate.
5568 * testsuite/icf_test.sh: New file.
5569 * testsuite/icf_test.cc: New file.
5571 2009-07-24 Chris Demetriou <cgd@google.com>
5573 * layout.cc (is_compressible_debug_section): Fix incorrect
5574 comment about compressed section names.
5576 2009-07-20 Ian Lance Taylor <ian@airs.com>
5579 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
5581 2009-07-16 Ian Lance Taylor <iant@google.com>
5584 * layout.h: #include <map>.
5585 (class Kept_section): Change from struct to class. Add accessors
5586 and setters. Add section size to Comdat_group mapping. Change
5587 Comdat_group to std::map. Add is_comdat_ field. Add
5588 linkonce_size field in union.
5589 (class Layout): Update declaration of find_or_add_kept_section.
5590 Don't declare find_kept_object.
5591 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
5592 parameter. Add object, shndx, is_comdat, and is_group_name
5593 parameters. Change all callers. Adjust for new Kept_section.
5594 (Layout::find_kept_object): Remove.
5595 * object.cc (Sized_relobj::include_section_group): Update use of
5596 Kept_section. Rename secnum to shndx. Only record
5597 Kept_comdat_section if sections are the same size.
5598 (Sized_relobj::include_linkonce_section): Update use of
5599 Kept_section. Only record Kept_comdat_section if sections are the
5600 same size. Set size of linkonce section.
5601 (Sized_relobj::map_to_kept_section): Update call to
5602 get_kept_comdat_section.
5603 * object.h (class Sized_relobj): Rename fields in
5604 Kept_comdat_section to drop trailing underscores; change object
5605 field to Relobj*. Change Kept_comdat_section_table to store
5606 struct rather than pointer.
5607 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
5608 Add kept_object and kept_shndx parameters. Change all callers.
5609 (Sized_relobj::get_kept_comdat_section): Change return type to
5610 bool. Add kept_object and kept_shndx parameters. Change all
5612 * plugin.cc (Pluginobj::include_comdat_group): Update call to
5613 Layout::find_or_add_kept_section.
5615 2009-07-09 Ian Lance Taylor <iant@google.com>
5617 * merge.cc (Object_merge_map::initialize_input_to_output_map):
5618 Reserve space in the hash table.
5620 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
5622 * fileread.cc (File_read::get_mtime): New method.
5623 * fileread.h (Timespec): New structure.
5624 (File_read::get_mtime): New method.
5625 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
5626 Renamed from timestamp_nsec.
5627 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
5629 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
5631 (Incremental_inputs::report_archive): Save mtime; style fix.
5632 (Incremental_inputs::report_obejct): Save mtime; style fix.
5633 (Incremental_inputs::report_script): Save mtime; style fix.
5634 (Incremental_inputs::finalize_inputs): Style fix.
5635 (Incremental_inputs::finalize): Style fix.
5636 (Incremental_inputs::create_input_section_data): Store inputs
5638 * incremental.h (Incremental_inputs::report_script): Add mtime
5640 (Incremental_inputs::Input_info::Input_info): Intialize only one
5642 (Incremental_inputs::Input_info::archive): Move to nameless
5644 (Incremental_inputs::Input_info::obejct): Move to nameless union.
5645 (Incremental_inputs::Input_info::script): Move to nameless union.
5646 (Incremental_inputs::mtime): New field.
5647 * script.cc (read_input_script): Pass file mtime to
5649 * script.h (Script_info::inputs): Style fix.
5651 2009-07-01 Ian Lance Taylor <ian@airs.com>
5653 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
5656 2009-06-24 Ian Lance Taylor <iant@google.com>
5659 * layout.cc (Layout::choose_output_section): If we find an
5660 existing section, update the flags.
5661 (Layout::create_notes): New function, broken out of
5663 (Layout::finalize): Don't create note sections.
5664 (Layout::create_note): Don't crash if linker script discards
5666 (Layout::create_gold_note): Likewise.
5667 (Layout::create_build_id): Likewise. Don't set
5668 after_input_sections on the section.
5669 (Layout::create_executable_stack_info): Remove target parameter.
5671 * layout.h (class Layout): Declare create_notes. Update
5672 declaration of create_executable_stack_info.
5673 * gold.cc (queue_middle_tasks): Call create_notes.
5674 * output.cc (Output_section::update_flags_for_input_section): Move
5675 here from output.h. If SHF_ALLOC flag is newly set, mark address
5677 * output.h (Output_data::mark_address_invalid): New function.
5678 (class Output_section): Only declare, not define,
5679 update_flags_for_input_section. Remove set_flags.
5681 2009-06-24 Ian Lance Taylor <iant@google.com>
5683 * script-sections.cc (Output_section_definition::
5684 set_section_addresses): Rename shadowing local load_address to
5687 2009-06-24 Ian Lance Taylor <iant@google.com>
5690 * reloc.cc (relocate_sections): Skip empty relocation sections.
5692 2009-06-23 Ian Lance Taylor <iant@google.com>
5695 * layout.cc (Layout::create_note): Use choose_output_section
5696 rather than make_output_section.
5698 2009-06-23 Ian Lance Taylor <iant@google.com>
5701 * options.cc (General_options::parse_V): Set printed_version_.
5702 (General_options::General_options): Initialize printed_version_.
5703 * options.h (class General_options): Add printed_version_ field.
5704 * gold.cc (queue_initial_tasks): If there are no input files,
5705 don't give a fatal error if we printed the version information.
5706 (queue_middle_tasks): If using -r with a shared object, give a
5707 fatal error rather than an ordinary error.
5709 2009-06-23 Ian Lance Taylor <iant@google.com>
5712 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
5713 (Layout::make_output_section): Set have_stabstr_section_ if we see
5714 a .stab*str section.
5715 (Layout::finalize): Call link_stabs_sections.
5716 (Layout::link_stabs_sections): New file.
5717 * layout.h (class Layout): Add have_stabstr_section_ field.
5718 Declare link_stabs_sections.
5720 2009-06-23 Doug Kwan <dougkwan@google.com>
5722 * Makefile.am (libgold_a_LIBADD): New.
5723 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
5724 * Makefile.in: Regenerate.
5725 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
5726 * configure: Regenerate.
5727 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
5728 * fileread.cc: Include sys/state.h
5729 * gold.h: Declare memmem and strndup if found missing.
5730 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
5732 2009-06-23 Ian Lance Taylor <iant@google.com>
5734 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
5735 * configure: Rebuild.
5737 2009-06-23 Ian Lance Taylor <iant@google.com>
5740 * object.cc (Object::section_contents): Don't try to get a view if
5741 the section has length zero.
5742 (Object::handle_gnu_warning_section): If the section is empty, use
5743 the name of the section as the warning.
5745 2009-06-23 Ian Lance Taylor <iant@google.com>
5748 * stringpool.h (class Stringpool_template): Add optimize_ field.
5749 (Stringpool_template::set_optimize): New function.
5750 * stringpool.cc (Stringpool_template::Stringpool_template):
5751 Initialize optimize_ field.
5752 (Stringpool_template::set_string_offsets): Test local optimize
5753 fild rather than parameter.
5754 * layout.cc (Layout::Layout): Call set_optimize on the section
5757 2009-06-22 Ian Lance Taylor <iant@google.com>
5760 * yyscript.y: Parse TARGET.
5761 * script.cc (script_set_target): New function.
5762 * script-c.h (script_set_target): Declare.
5763 * options.cc (General_options::string_to_object_format): Rename
5764 from string_to_object_format in anonymous namespace. Change
5766 * options.h (class General_options): Declare
5767 string_to_object_format.
5769 2009-06-22 Ian Lance Taylor <iant@google.com>
5771 * script-sections.cc (Script_sections::create_segments): Don't put
5772 program headers in a PT_LOAD segment if -n or -N.
5774 2009-06-22 Ian Lance Taylor <iant@google.com>
5777 * options.h (class General_options): Add -z lazy and -z now. Sort
5778 -z options into alphabetical order.
5779 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
5781 2009-06-21 Ian Lance Taylor <iant@google.com>
5783 * layout.cc (Layout::make_output_section): Call
5784 Target::new_output_section.
5785 (Layout::attach_allocated_section_to_segment): Put large section
5786 sections in a separate load segment with the large segment flag
5788 (Layout::segment_precedes): Sort large data segments after other
5790 (align_file_offset): New static function.
5791 (Layout::set_segment_offsets): Use align_file_offset.
5792 * output.h (class Output_section): Add is_small_section_ and
5793 is_large_section_ fields.
5794 (Output_section::is_small_section): New function.
5795 (Output_section::set_is_small_section): New function.
5796 (Output_section::is_large_section): New function.
5797 (Output_section::set_is_large_section): New function.
5798 (Output_section::is_large_data_section): New function.
5799 (class Output_segment): Add is_large_data_segment_ field.
5800 (Output_segment::is_large_data_segment): New function.
5801 (Output_segment::set_is_large_data_segment): New function.
5802 * output.cc (Output_section::Output_section): Initialize new
5804 (Output_segment::Output_segment): Likewise.
5805 (Output_segment::add_output_section): Add assertion that large
5806 data sections always go in large data segments. Force small data
5807 sections to the end of the list of data sections. Force small BSS
5808 sections to the start of the list of BSS sections. For large BSS
5809 sections to the end of the list of BSS sections.
5810 * symtab.h (class Symbol): Declare is_common_shndx.
5811 (Symbol::is_defined): Check Symbol::is_common_shndx.
5812 (Symbol::is_common): Likewise.
5813 (class Symbol_table): Define enum Commons_section_type. Update
5814 declarations. Add small_commons_ and large_commons_ fields.
5815 * symtab.cc (Symbol::is_common_shndx): New function.
5816 (Symbol_table::Symbol_table): Initialize new fields.
5817 (Symbol_table::add_from_object): Put small and large common
5818 symbols in the right list.
5819 (Symbol_table::sized_finalized_symbol): Check
5820 Symbol::is_common_shndx.
5821 (Symbol_table::sized_write_globals): Likewise.
5822 * common.cc (Symbol_table::do_allocate_commons): Allocate new
5823 common symbol lists. Don't call do_allocate_commons_list if the
5825 (Symbol_table::do_allocate_commons_list): Remove is_tls
5826 parameter. Add comons_section_type parameter. Change all
5827 callers. Handle small and large common symbols.
5828 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
5829 Symbol::is_common_shndx.
5830 * resolve.cc (symbol_to_bits): Likewise.
5831 * target.h (Target::small_common_shndx): New function.
5832 (Target::small_common_section_flags): New function.
5833 (Target::large_common_shndx): New function.
5834 (Target::large_common_section_flags): New function.
5835 (Target::new_output_section): New function.
5836 (Target::Target_info): Add small_common_shndx, large_common_shndx,
5837 small_common_section_flags, and large_common_section_flags
5839 (Target::do_new_output_section): New virtual function.
5840 * arm.cc (Target_arm::arm_info): Initialize new fields.
5841 * i386.cc (Target_i386::i386_info): Likewise.
5842 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5844 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
5845 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
5846 (Target_x86_64::do_new_output_section): New function.
5847 * configure.ac: Define conditional MCMODEL_MEDIUM.
5848 * testsuite/Makefile.am (check_PROGRAMS): Add large.
5849 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
5850 (large_LDFLAGS): Define.
5851 * testsuite/large.c: New file.
5852 * testsuite/testfile.cc (Target_test::test_target_info):
5853 Initialize new fields.
5854 * configure, testsuite/Makefile.in: Rebuild.
5856 2009-06-05 Doug Kwan <dougkwan@google.com>
5858 * Makefile.am (CCFILES): Add target.cc.
5859 * Makefile.in: Regenerate.
5860 * i386.cc (class Target_i386): Define new virtual method to
5861 override do_is_local_label_name in parent.
5862 * object.cc (Sized_relobj::do_count_local_symbols): Discard
5863 local symbols if --discard-locals or -X is given.
5864 * options.h (class General_options): Declare new options
5865 '--discard-locals' and '-X' for discarding locals.
5866 * target.h (class Target): Define new methods is_local_label_name.
5867 Declare new virtual method do_is_local_label_name.
5868 * target.cc: New file.
5869 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
5870 (check_SCRIPTS): Add discard_locals_test.sh.
5871 (check_DATA): Add discard_local_tests.syms.
5872 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
5873 (discard_local_tests.syms, discard_locals_test.o): New make rules.
5874 * testsuite/Makefile.in: Regenerate.
5875 * testsuite/discard_locals_test.c: New file.
5876 * testsuite/discard_locals_test.sh: Same.
5878 2009-06-05 Doug Kwan <dougkwan@google.com>
5880 * object.cc (Sized_relobj::Sized_relobj): Initialize
5881 discarded_eh_frame_shndx_ to -1U.
5882 (Sized_relobj::do_layout): Record index of a discard .eh_frame
5884 (Sized_relobj::do_count_local_symbols): Skip local symbols in
5885 a discarded .eh_frame section.
5886 (Sized_relobj::do_finalize_local_symbols): Ditto.
5887 * object.h (class Sized_relobj): Declare new member
5888 discarded_eh_frame_shndx_.
5889 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
5890 (local_labels_test.o, local_labels_test): New rules.
5891 * testsuite/Makefile.in: Regenerate.
5893 2009-06-04 Doug Kwan <dougkwan@google.com>
5895 * layout.cc (Layout::section_name_mapping): Add mapping for
5896 special ARM sections.
5898 2009-06-03 Doug Kwan <dougkwan@google.com>
5900 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
5901 (utils::has_overflow): Same.
5903 2009-06-03 Ian Lance Taylor <iant@google.com>
5905 * layout.cc (Layout::section_name_mapping): New array, replacing
5906 Layout::linkonce_mapping.
5907 (Layout::section_name_mapping_count): New variable, replacing
5908 Layout::linkonce_mapping_count.
5909 (Layout::linkonce_output_name): Remove.
5910 (Layout::output_section_name): Rewrite.
5911 * layout.h (class Layout): Rename Linkonce_mapping to
5912 Section_name_mapping, linkonce_mapping to section_name_mapping,
5913 linkonce_mapping_count to section_name_mapping_count. Don't
5914 declare linkonce_output_name.
5916 2009-06-03 Doug Kwan <dougkwan@google.com>
5918 * gold/arm.cc (namespace utils): New.
5919 (Target_arm::reloc_is_non_pic): Define new method.
5920 (class Arm_relocate_functions): New.
5921 (Target_arm::Relocate::relocate): Handle relocation types used by
5924 2009-06-03 Ian Lance Taylor <iant@google.com>
5926 * arm.cc (Target_arm::scan::global): Use || instead of |.
5928 2009-06-02 Doug Kwan <dougkwan@google.com>
5930 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
5931 issued_non_pic_error_.
5932 (class Target_arm::Scan): Declare new method check_non_pic.
5933 Define new method symbol_needs_plt_entry.
5934 Declare new data member issued_non_pic_error_.
5935 (class Target_arm::Relocate): Declare new method
5936 should_apply_static_reloc.
5937 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
5938 (Target_arm::Scan::check_non_pic): Define new method.
5939 (Target_arm::Scan::local): Handle a small subset of reloc types used
5941 (Target_arm::Scan::local): Same.
5942 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
5944 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
5946 * incremental.cc (Incremental_inputs::report_command_line): Filter
5947 out --incremental-* options.
5949 2009-05-29 Doug Kwan <dougkwan@google.com>
5951 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
5953 (class Target_arm): Update comment.
5954 (Target_arm::Target_arm): Initialize new data members GOT_,
5955 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
5956 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
5957 and Target_arm::rel_dyn_section.
5958 Declare new_enum Target_arm::Got_type.
5959 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
5961 Update commments for member do_dynsym_value.
5962 (Target_arm::got_size, Target_arm::plt_section,
5963 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
5964 new methods inside class defintion.
5965 (Target_arm::got_section): Define new method.
5966 (Target_arm::rel_dyn_section): Same.
5967 (Output_data_plt_arm): New template class.
5968 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
5969 (Output_data_plt_arm:do_adjust_output_section): Define new method.
5970 (Output_data_plt_arm::add_entry): Same.
5971 (Output_data_plt_arm::first_plt_entry): Define new
5972 static data member for PLT instruction template.
5973 (Output_data_plt_arm::plt_entry): Same.
5974 (Output_data_plt_arm::do_write): Define new method.
5975 (Target_arm::make_plt_entry): Same.
5976 (Target_arm::do_finalize_sections): Same.
5977 (Target_arm::do_dynsym_value): Same.
5979 2009-05-28 Doug Kwan <dougkwan@google.com>
5981 * Makefile.am (TARGETSOURCES): Add arm.cc.
5982 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
5983 * Makefile.in: Regenerate.
5985 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
5987 2009-05-26 Doug Kwan <dougkwan@google.com>
5989 * options.cc (General_options::parse_exclude_libs). Fix a comment.
5990 (General_options::check_excluded_libs): Strip off directories in
5991 archive name before matching like GNU ld does.
5992 * testsuite/Makefile.am (MOSTLYCLEANFILES,
5993 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
5994 (exclude_libs_test_LDFLAGS): Add linker option
5995 -Wl,--exclude-libs,libexclude_libs_test_3
5996 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
5997 an explicit archive without using -l.
5998 (alt/libexclude_libs_test_3.a): New make rule.
5999 * testsuite/Makefile.in: Regenerate.
6000 * testsuite/exclude_libs_test.c : Declare lib3_default().
6002 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
6003 * exclude_libs_test_3.c: New file.
6005 2009-05-26 Nick Clifton <nickc@redhat.com>
6007 * po/id.po: New Indonesian translation.
6008 * po/gold.pot: Updated template file.
6010 2009-05-22 Sriraman Tallam <tmsriram@google.com>
6012 * testsuite/Makefile.am: Add -ffunction-sections to compile
6013 gc_comdat_test files. Add -Wl,--gc-sections to build
6015 * testsuite/Makefile.in: Regenerate.
6016 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
6018 2009-05-21 Sriraman Tallam <tmsriram@google.com>
6020 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
6021 kept comdat section was garbage collected.
6022 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
6023 * testsuite/Makefile.in: Regenerate.
6024 * testsuite/gc_comdat_test.sh: New file.
6025 * testsuite/gc_comdat_test_1.cc: New file.
6026 * testsuite/gc_comdat_test_2.cc: New file.
6028 2009-05-19 Doug Kwan <dougkwan@google.com>
6030 * archive.cc (Archive::Archive): Move constructor from archive.h
6031 to here. Initialize no_export_.
6032 (Archive::get_elf_object_for_member): Set no_export flag of object.
6033 * archive.h (Archive::Archive): Move constructor body to
6035 (Archive::no_export): New method.
6036 (Archive::no_export_): New field.
6037 * object.h (Object::Object): Initialize no_export_ to false.
6038 (Object::no_export, Object::set_no_export): New methods.
6039 (Object::no_export_): New field.
6040 * options.cc (General_options::parse_exclude_libs): New method.
6041 (General_options::check_excluded_libs) Same.
6042 * options.h (exclude_libs): New option.
6043 (General_options::check_excluded_libs): New method declaration.
6044 (General_options::excluded_libs_): New field.
6045 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
6046 default or protected visibility if an object has no-export flag set.
6047 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
6048 (check_SCRIPTS): Add exclude_libs_test.sh.
6049 (check_DATA): Add exclude_libs_test.syms.
6050 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
6051 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
6052 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
6053 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
6054 (exclude_libs_test.syms, libexclude_libs_test_1.a,
6055 libexclude_libs_test_2.a): New rules.
6056 * testsuite/Makefile.in: Regenerate.
6057 * testsuite/exclude_libs_test.c: New file.
6058 * testsuite/exclude_libs_test.sh: Ditto.
6059 * testsuite/exclude_libs_test_1.c: Ditto.
6060 * testsuite/exclude_libs_test_2.c: Ditto.
6062 2009-05-15 Ian Lance Taylor <iant@google.com>
6064 * configure.ac: Check for declarations for cases where libiberty.h
6065 checks HAVE_DECL_xxx.
6066 * configure, config.in: Rebuild.
6068 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
6070 * gold.h (Incremental_argument_list): Remove (invalid) forward
6072 * incremental.cc (Incremental_inputs::report_achive): New method.
6073 (Incremental_inputs::report_object): New method.
6074 (Incremental_inputs::report_script): New method.
6075 (Incremental_inputs::finalize_inputs): New method.
6076 (Incremental_inputs::finalize): Call finalize_inputs().
6077 (Incremental_inputs::sized_create_incremental_inputs_section_data):
6078 Create inputs entries.
6079 * incremental.h (Incremental_input_type): New enum.
6080 (Incremental_inputs::Incremental_input): Initialize new fields.
6081 (Incremental_inputs::report_inputs): New method.
6082 (Incremental_inputs::report_achive): New method.
6083 (Incremental_inputs::report_object): New method.
6084 (Incremental_inputs::report_script): New method.
6085 (Incremental_inputs::finalize_inputs): New method.
6086 (Incremental_inputs::Input_info): New struct.
6087 (Incremental_inputs::Input_info_map): New typedef.
6088 (Incremental_inputs::lock_): New field.
6089 (Incremental_inputs::Inputs_): New field.
6090 (Incremental_inputs::Inputs_map): New field.
6091 * main.cc (main): Call Incremental_input::report_inputs.
6092 * options.h (Input_argument_list): Typedef moved from
6094 (Input_file_group::Files): Remove, use ::Input_argument_list.
6095 (Input_file_group::Input_argument_list): Remove, use
6096 ::Input_argument_list.
6097 * plugin.cc (Plugin_manager::add_input_file): Add error in
6099 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
6101 * script.cc (read_input_script): Call
6102 Incremental_input::report_script.
6103 * script.h (Script_info): New class.
6105 2009-04-27 Ian Lance Taylor <iant@google.com>
6107 * x86_64.cc (do_adjust_output_section): Set entsize to
6110 2009-04-23 Elliott Hughes <enh@google.com>
6112 * output.cc (Output_file::close): After short writes, continue
6113 writing from the correct offset in the buffer being written.
6115 2009-04-23 Chris Demetriou <cgd@google.com>
6117 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
6118 * configure: Regenerate.
6119 * config.in: Regenerate.
6120 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
6121 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
6123 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
6125 * incremental.cc (Incremental_inputs_header_data): Renamed from
6126 Incremental_input_header_data.
6127 (Incremental_inputs_header_data::data_size): New field.
6128 (Incremental_inputs_header_data::put_input_file_count): Renamed
6129 from input_file_count.
6130 (Incremental_inputs_header_data::put_command_line_offset): Renamed
6131 from command_line_offset.
6132 (Incremental_inputs_header_data::put_reserved): Renamed from
6134 (Incremental_inputs_entry_data): Renamed from
6135 Incremental_input_entry_data.
6136 (Incremental_inputs_entry_data::data_size): New field.
6137 (Incremental_inputs::report_command_line): New method.
6138 (Incremental_inputs::finalize): New method.
6139 (Incremental_inputs::create_incremental_inputs_data): New method.
6140 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
6141 * incremental.h: New file.
6142 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
6143 (Layout::finalize): Create incremental inputs section in
6145 (Layout::create_incremental_info_sections): New method.
6146 * layout.h (Layout::incremental_inputs): New method.
6147 (Layout::create_incremental_info_sections): New method.
6148 (Layout::incremental_inputs_): New field.
6149 * main.cc (main): Notify Incremental_input of the command line.
6151 2009-04-01 Ian Lance Taylor <iant@google.com>
6152 Mikolaj Zalewski <mikolajz@google.com>
6154 * gold.h (reserve_unordered_map): Define, three versions, one for
6155 each version of Unordered_map.
6156 * layout.cc (Layout::Layout): Remove options parameter. Add
6157 number_of_input_files parameter. Don't initialize options_.
6158 Initialize number_of_input_files_ and resized_signatures_. Move
6159 sections_are_attached_.
6160 (Layout::layout_group): Reserve space for group_signatures_.
6161 (Layout::find_or_add_kept_section): Change name parameter to be a
6162 reference. Resize signatures_ map when it gets large enough.
6163 (Layout::layout_eh_frame): Use parameters->options() instead of
6165 (Layout::make_output_section): Likewise.
6166 (Layout::attach_allocated_section_to_segment): Likewise.
6167 (Layout::finalize, Layout::create_executable_stack): Likewise.
6168 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
6169 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
6170 * layout.h (class Layout): Update declarations. Remove options_
6171 field. Add number_of_input_files_ and resized_signatures_
6172 fields. Move sections_are_attached_ field.
6173 * main.cc (main): Pass number of input files to Layout
6174 constructor. Don't pass options.
6176 2009-03-30 Ian Lance Taylor <iant@google.com>
6178 * ffsll.c (ffsll): Correct implementation.
6180 2009-03-27 Ian Lance Taylor <iant@google.com>
6182 * ffsll.c: New file.
6183 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
6184 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
6185 * ftruncate.c (ftruncate): Declare before definition.
6186 * mremap.c (mremap): Likewise.
6187 * pread.c (pread): Likewise.
6188 * configure, Makefile.in, config.in: Rebuild.
6190 * mremap.c: New file.
6191 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
6192 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
6193 (mremap): Declare if HAVE_MREMAP is not defined.
6194 * configure, Makefile.in, config.in: Rebuild.
6196 2009-03-27 Cary Coutant <ccoutant@google.com>
6198 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
6199 position independent.
6200 * sparc.cc (Target_sparc::check_non_pic): Likewise.
6201 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
6203 2009-03-24 Cary Coutant <ccoutant@google.com>
6205 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
6207 (needs_dynamic_reloc): Likewise.
6209 2009-03-24 Ian Lance Taylor <iant@google.com>
6211 * yyscript.y (file_cmd): Recognize EXTERN.
6212 (extern_name_list, extern_name_list_body): New nonterminals.
6213 * script.cc (script_add_extern): Define.
6214 * script-c.h (script_add_extern): Declare.
6216 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
6218 * object.cc (is_elf_object): Define.
6219 * object.h (is_elf_object): Declare.
6220 * archive.cc (Archive::get_elf_object_for_member): Call
6222 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
6224 2009-03-24 Elliott Hughes <enh@google.com>
6226 * output.cc (Output_file::map_anonymous): Define.
6227 (Output_file::map): Use map_anonymous. If the regular mmap fails,
6228 try an anonymous one. Report the size if the mmap fails.
6229 * output.h (class Output_file): Declare map_anonymous.
6231 2009-03-24 Ian Lance Taylor <iant@google.com>
6233 * target-select.cc (instantiate_target): Don't acquire the lock if
6234 the instantiated_target_ field has already been set.
6236 2009-03-23 Ian Lance Taylor <iant@google.com>
6238 * gold-threads.h (class Initialize_lock): Define.
6239 * gold-threads.cc (class Initialize_lock_once): Define.
6240 (initialize_lock_control): New static variable.
6241 (initialize_lock_pointer): New static variable.
6242 (initialize_lock_once): New static function.
6243 (Initialize_lock::Initialize_lock): Define.
6244 (Initialize_lock::initialize): Define.
6245 * target-select.h: Include "gold-threads.h".
6246 (class Target_selector): Add lock_ and initialize_lock_ fields.
6247 Don't define instantiate_target, just declare it.
6248 * target-select.cc (Target_selector::Target_selector): Initialize
6250 (Target_selector::instantiate_target): Define.
6251 * descriptors.h: Include "gold-threads.h".
6252 (class Descriptors): Add initialize_lock_ field.
6253 * descriptors.cc (Descriptors::Descriptors): Initialize new
6255 (Descriptors::open): Use initialize_lock_ field
6256 * errors.h (class Errors): Add initialize_lock_ field.
6257 * errors.cc (Errors::Errors): Initialize new field.
6258 (Errors::initialize_lock): Use initialize_lock_ field.
6259 * powerpc.cc (class Target_selector_powerpc): Remove
6260 instantiated_target_ field. In do_recognize call
6261 instantiate_target rather than do_instantiate_target. In
6262 do_instantiate_target just allocate a new target.
6263 * sparc.cc (class Target_selector_sparc): Likewise.
6265 * freebsd.h: New file.
6266 * i386.cc: Include "freebsd.h".
6267 (Target_i386): Derive from Target_freebsd rather than
6269 (Target_selector_i386): Derive from Target_selector_freebsd rather
6270 than Target_selector.
6271 * x86_64.cc: Include "freebsd.h".
6272 (Target_x86_64): Derive from Target_freebsd rather than
6274 (Target_selector_x86_64): Derive from Target_selector_freebsd
6275 rather than Target_selector.
6276 * target.h (class Target): Add adjust_elf_header and
6277 do_adjust_elf_header.
6278 * output.cc (Output_file_header:: do_sized_write): Call target
6279 adjust_elf_header routine.
6280 * configure.tgt: Set targ_osabi.
6281 * configure.ac: Define GOLD_DEFAULT_OSABI.
6282 * parameters.cc (Parameters::default_target): Pass
6283 GOLD_DEFAULT_OSABI to select_target.
6284 * target-select.h (class Target_selector): Make instantiate_target
6285 protected rather than private.
6286 * Makefile.am (HFILES): Add freebsd.h.
6287 * configure, Makefile.in, config.in: Rebuild.
6289 * merge.cc (do_add_input_section): Correct pend value. Change
6290 message about last entry not being null terminated from error to
6293 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
6295 * incremental.cc: New file.
6296 * Makefile.am (CCFILES): Add incremental.cc.
6297 * Makefile.in: Rebuild.
6299 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
6301 * layout.cc (Layout::output_section_name): Preserve names
6302 of '.note.' sections.
6304 2009-03-19 Ian Lance Taylor <iant@google.com>
6306 * descriptors.cc (Descriptors::open): Check that the options are
6307 valid before using them.
6309 2009-03-18 Ian Lance Taylor <iant@google.com>
6311 * script-sections.h: Include <list>.
6312 (class Script_sections): Change Sections_elements from std::vector
6313 to std::list. Typedef public Elements_iterator. Add
6314 orphan_section_placement_, data_segment_align_start_, and
6315 saw_data_segment_align_ fields. Remove data_segment_align_index_
6317 * script-sections.cc (class Orphan_section_placement): New class.
6318 (class Sections_element): Add virtual functions is_relro and
6319 orphan_section_init. Remove virtual function place_orphan_here.
6320 (class Output_section_definition): Add is_relro and
6321 orphan_section_init. Remove place_orphan_here.
6322 (class Orphan_output_section): Likewise.
6323 (Script_sections::Script_sections): Update for field changes.
6324 (Script_sections::data_segment_align): Set saw_data_segment_align_
6325 and data_segment_align_start_, not data_segment_align_index.
6326 (Script_sections::data_segment_relro_end): Check
6327 saw_data_segment_align_. Use data_segment_align_start_ rather
6328 than data_segment_align_index_.
6329 (Script_sections::place_orphan): Rewrite to use
6330 Orphan_section_placement.
6332 2009-03-17 Ian Lance Taylor <iant@google.com>
6334 * archive.cc (Archive::add_symbols): Check for a version attached
6335 to the symbol name in the archive map.
6336 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
6337 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
6338 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
6339 (ver_test_11.a): New target.
6340 * testsuite/Makefile.in: Rebuild.
6342 * configure.ac: Check for chsize and posix_fallocate. Replace
6344 * ftruncate.c: New file, from gnulib.
6345 * output.cc (posix_fallocate): Define dummy version if not
6346 HAVE_POSIX_FALLOCATE.
6347 (Output_file::map): Call posix_fallocate rather than lseek and
6349 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
6350 * configure, Makefile.in, config.in: Rebuild.
6352 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
6354 * layout.h (Layout::create_note): Add section_name parameter.
6355 * layout.cc (Layout::create_note): Likewise.
6356 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
6358 2009-03-17 Ian Lance Taylor <iant@google.com>
6360 * descriptors.cc: Include "options.h".
6361 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
6362 (Descriptors::open): Always use O_CLOEXEC when opening a new
6363 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
6364 then set FD_CLOEXEC.
6366 * sparc.cc (class Target_sparc): Add has_got_section.
6367 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
6368 make sure we have a GOT section.
6370 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
6371 (Target_sparc::Scan::local): Likewise.
6372 (Target_sparc::Scan::global): Likewise.
6373 (Target_sparc::Relocate::relocate): Likewise.
6374 (Target_sparc::Relocate::relocate_tls): Likewise.
6376 * symtab.cc (Symbol_table::define_default_version): New function,
6377 broken out of add_from_object.
6378 (Symbol_table::add_from_object): Call define_default_version.
6379 (Symbol_table::define_special_symbol): Add resolve_oldsym
6380 parameter. Change all callers. If the version for a symbol comes
6381 from a version script, resolve it with the symbol with the same
6382 name with no version. Also add the symbol without a version if
6384 (do_define_in_output_data): If resolving with oldsym, don't delete
6386 (do_define_in_output_segment): Likewise.
6387 (do_define_as_constant): Likewise.
6388 * symtab.h (class Symbol_table): Update declarations.
6390 2009-03-13 Ian Lance Taylor <iant@google.com>
6392 * readsyms.cc (Read_symbols::incompatible_warning): New function.
6393 (Read_symbols::requeue): New function.
6394 (Read_symbols::do_read_symbols): If make_elf_object fails because
6395 the target type is not configured, and the file was searched for,
6396 issue a warning and retry with the next directory.
6397 (Add_symbols::run): If the file has an incompatible format, and
6398 it was searched for, requeue the Read_symbols task. On error,
6400 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
6401 dirindex parameter to constructor. Change all callers. Declare
6402 incompatible_warning and requeue.
6403 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
6404 input_argument_ and input_group_ fields. Add them to
6405 constructor. Change all callers.
6406 (class Read_script): Add dirindex_ field. Add it to constructor.
6408 * archive.cc (Archive::setup): Remove input_objects parameter.
6410 (Archive::get_file_and_offset): Likewise.
6411 (Archive::read_all_symbols): Likewise.
6412 (Archive::read_symbols): Likewise.
6413 (Archive::get_elf_object_for_member): Remove input_objects
6414 parameter. Add punconfigured parameter. Change all callers.
6415 (Archive::add_symbols): Change return type to bool. Check return
6416 value of include_member.
6417 (Archive::include_all_members): Likewise.
6418 (Archive::include_member): Change return type to bool. Return
6419 false if first included object has incompatible target. Set
6420 included_member_ field.
6421 (Add_archive_symbols::run): If add_symbols returns false, requeue
6423 * archive.h (class Archive): Add included_member_ field.
6424 Initialize it in constructor. Add input_file and searched_for
6425 methods. Update declarations.
6426 (class Add_archive_symbols): Add dirpath_, dirindex_, and
6427 input_argument_ fields. Add them to constructor. Change all
6429 * script.cc: Include "target-select.h".
6430 (class Parser_closure): Add skip_on_incompatible_target_ and
6431 found_incompatible_target_ fields. Add
6432 skip_on_incompatible_target parameter to constructor. Change all
6433 callers. Add methods skip_on_incompatible_target,
6434 clear_skip_on_incompatible_target, found_incompatible_target, and
6435 set_found_incompatible_target.
6436 (read_input_script): Add dirindex parameter. Change all callers.
6437 If parser finds an incompatible target, requeue Read_symbols
6439 (script_set_symbol): Clear skip_on_incompatible_target in
6441 (script_add_assertion, script_parse_option): Likewise.
6442 (script_start_sections, script_add_phdr): Likewise.
6443 (script_check_output_format): New function.
6444 * script.h (read_input_script): Update declaration.
6445 * script-c.h (script_check_output_format): Declare.
6446 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
6447 (ignore_cmd): Remove OUTPUT_FORMAT.
6448 * fileread.cc (Input_file::Input_file): Add explicit this.
6449 (Input_file::will_search_for): New function.
6450 (Input_file::open): Add pindex parameter. Change all callers.
6451 * fileread.h (class Input_file): Add input_file_argument method.
6452 Declare will_search_for. Update declarations.
6453 * object.cc (make_elf_object): Add punconfigured parameter.
6455 * object.h (class Object): Make input_file public. Add
6456 searched_for method.
6457 (make_elf_object): Update declaration.
6458 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
6460 * dirsearch.h (class Dirsearch): Update declaration.
6461 * options.h (class General_options): Add --warn-search-mismatch.
6462 * parameters.cc (Parameters::is_compatible_target): New function.
6463 * parameters.h (class Parameters): Declare is_compatible_target.
6464 * workqueue.cc (Workqueue::add_blocker): New function.
6465 * workqueue.h (class Workqueue): Declare add_blocker.
6467 * fileread.cc (Input_file::open): Remove options parameter.
6469 (Input_file::open_binary): Likewise.
6470 * script.cc (read_input_script): Likewise.
6471 * readsyms.h (class Read_symbols): Remove options_ field. Remove
6472 options parameter from constructor. Change all callers.
6473 (class Read_script): Likewise.
6474 * fileread.h (class Input_file): Update declarations.
6475 * script.h (read_input_script): Update declaration.
6477 2009-03-10 Nick Clifton <nickc@redhat.com>
6479 * po/es.po: New Spanish translation.
6481 2009-03-06 Cary Coutant <ccoutant@google.com>
6483 * options.cc (parse_short_option): Keep dash_z from registering itself.
6485 2009-03-03 Ian Lance Taylor <iant@google.com>
6488 * target-reloc.h (relocate_section): Pass output_section to
6490 * i386.cc (Target_i386::should_apply_static_reloc): Add
6491 output_section parameter. Change all callers.
6492 (Target_i386::Relocate::relocate): Add output_section parameter.
6493 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
6494 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
6495 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
6496 * testsuite/two_file_shared.sh: New script.
6497 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
6498 (check_DATA): Add two_file_shared.dbg.
6499 (two_file_shared.dbg): New target.
6500 * testsuite/Makefile.in: Rebuild.
6502 2009-03-01 Ian Lance Taylor <iant@google.com>
6504 * configure.ac: Check for byteswap.h.
6505 * configure: Rebuild.
6506 * config.in: Rebuild.
6508 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
6510 * layout.cc (Layout::find_or_add_kept_section): New function.
6511 (Layout::add_comdat): Removed.
6512 * layout.h (struct Kept_section): Move out of class Layout.
6513 Remove trailing underscores from field names. Add group_sections
6514 field. Rename group_ field to is_group. Change all uses.
6515 (class Layout): Declare find_or_add_kept_section, not add_comdat.
6516 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
6517 comdat_groups_ field.
6518 (Sized_relobj::include_section_group): Use
6519 find_or_add_kept_section and Kept_section::group_sections.
6520 (Sized_relobj::include_linkonce_section): Likewise.
6521 * object.cc (class Sized_relobj): Don't define Comdat_group or
6522 Comdat_group_table. Remove find_comdat_group and
6523 add_comdat_group. Remove comdat_groups_ field.
6524 * plugin.cc (include_comdat_group): Use
6525 Layout::find_or_add_kept_section.
6527 2009-02-28 Ian Lance Taylor <iant@google.com>
6529 * README: --gc-sections and map files are now supported. Document
6530 some build requirements.
6533 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
6534 relocatable link set the value of the section symbol to zero.
6535 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
6536 relocatable link don't include the section address in the local
6539 2009-02-27 Ian Lance Taylor <iant@google.com>
6542 * options.h (class Search_directory): Add is_system_directory.
6543 (class General_options): Declare is_in_system_directory.
6544 * options.cc (get_relative_sysroot): Make static.
6545 (get_default_sysroot): Make static.
6546 (General_optoins::is_in_system_directory): New function.
6547 * fileread.cc (Input_file::is_in_system_directory): New function.
6548 * fileread.h (class Input_file): Declare is_in_system_directory.
6549 * object.h (class Object): Add is_in_system_directory.
6550 (class Input_objects): Remove system_library_directory_ field.
6551 * object.cc (Input_objects::add_object): Don't set
6552 system_library_directory_.
6553 (input_objects::found_in_system_library_directory): Remove.
6554 * symtab.cc (Symbol_table::write_globals): Remove input_objects
6555 parameter. Change all callers.
6556 (Symbol_table::sized_write_globals): Likewise.
6557 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
6558 Call Object::is_in_system_directory.
6559 * symtab.h (class Symbol_table): Update declarations.
6562 * descriptors.h (Open_descriptor): Add is_on_stack field.
6563 * descriptors.cc (Descriptors::open): If the descriptor is on the
6564 top of the stack, remove it. Initialize is_on_stack field.
6565 (Descriptors::release): Only add pod to stack if it is not on the
6567 (Descriptors::close_some_descriptor): Clear stack_next and
6571 * output.cc (Output_section::find_starting_output_address): Rename
6572 from starting_output_address; add PADDR parameter; change return
6574 * output.h (class Output_section): Declare
6575 find_starting_output_address instead of starting_output_address.
6576 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
6577 section symbol for which we can't find a merge section.
6580 * symtab.cc (Symbol_table::add_from_object): If the visibility is
6581 hidden or internal, force the symbol to be local.
6582 * resolve.cc (Symbol::override_visibility): Define.
6583 (Symbol::override_base): Use override_visibility.
6584 (Symbol_table::resolve): Likewise.
6585 (Symbol::override_base_with_special): Likewise.
6586 (Symbol_table::override_with_special): If the visibility is hidden
6587 or internal, force the symbol to be local.
6588 * symtab.h (class Symbol): Add set_visibility and
6589 override_visibility.
6590 * testsuite/ver_test_1.sh: New file.
6591 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
6592 (check_DATA): Add ver_test_1.syms.
6593 (ver_test_1.syms): New target.
6594 * testsuite/Makefile.in: Rebuild.
6596 2009-02-25 Cary Coutant <ccoutant@google.com>
6598 * layout.cc (Layout::choose_output_section): Don't rename sections
6599 when using a linker script that has a SECTIONS clause.
6600 * Makefile.in: Regenerate.
6602 * testsuite/Makefile.am (script_test_5.sh): New test case.
6603 * testsuite/Makefile.in: Regenerate.
6604 * testsuite/script_test_5.cc: New file.
6605 * testsuite/script_test_5.sh: New file.
6606 * testsuite/script_test_5.t: New file.
6608 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
6610 * archive.cc (Archive::include_member): Update calls to add_symbols.
6611 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
6612 the Layout argument.
6613 * dynobj.h (do_add_symbols): Add the Layout argument.
6614 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
6616 * object.h (Object::add_symbols): Add the Layout argument.
6617 (Object::do_add_symbols): Add the Layout argument.
6618 (Sized_relobj::do_add_symbols): Add the Layout argument.
6619 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
6620 Unify the two versions.
6621 (Add_plugin_symbols): Remove.
6622 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
6623 (Sized_pluginobj::do_add_symbols): Unify the two versions.
6624 (Add_plugin_symbols): Remove.
6625 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
6626 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
6627 (Add_symbols::run): Make it work with Pulginobj.
6629 2009-02-06 Ian Lance Taylor <iant@google.com>
6631 * object.cc (Sized_relobj::do_layout): Make info message start
6632 with lower case letter.
6634 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
6636 * binary.cc: Fix file comment.
6638 * options.h (enum Incremental_disposition): Define.
6639 (class General_options): Add new options: --incremental,
6640 --incremental_changed, --incremental_unchanged,
6641 --incremental_unknown. Add incremental_disposition_ and
6642 implicit_incremental_ fields.
6643 (General_options::incremental_disposition): New function.
6644 (class Position_dependent_options): Add incremental_disposition
6646 (Position_dependent_options::copy_from_options): Set incremental
6648 * options.cc (General_options::parse_incremental_changed): New
6650 (General_options::parse_incremental_unchanged): New function.
6651 (General_options::parse_incremental_unknown): New function.
6652 (General_options::General_options): Initialize new fields
6653 incremental_disposition_ and implicit_incremental_.
6654 (General_options::finalize): Check for uasge of --incremental-*
6655 without --incremental.
6657 2009-02-06 Chris Demetriou <cgd@google.com>
6659 * gold.h (gold_undefined_symbol): Change to take only a Symbol
6660 pointer and to report location as the file name associated with
6662 (gold_undefined_symbol_at_location): New function to replace the
6663 old gold_undefined_symbol functionality.
6664 * target-reloc.h (relocate_section): Update to use
6665 gold_undefined_symbol_at_location.
6666 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
6667 Call gold_undefined_symbol function rather than gold_error.
6668 * errors.h (Errors::undefined_symbol): Take location as a
6669 string, rather than calculating it from a relocation.
6670 * errors.cc (Errors::fatal): Print "fatal error:" before the
6672 (Errors::error, Errors::error_at_location): Print "error: "
6673 before the formatted message.
6674 (Errors::undefined_symbol): Take location as a string, rather
6675 than calculating it from a relocation.
6676 (gold_undefined_symbol_at_location): New function akin to
6677 old gold_undefined_symbol, calculates location from relocation.
6678 (gold_undefined_symbol): Change to take only a Symbol pointer
6679 and to report location as the file name associated with the symbol.
6680 * testsuite/debug_msg.sh: Update for changed error messages.
6681 * testsuite/undef_symbol.sh: Likewise.
6683 2009-02-04 Duncan Sands <baldrick@free.fr>
6686 * reduced_debug_output.h
6687 (Output_reduced_debug_abbrev_section::failed): Use format for
6689 (Output_reduced_debug_info_section::faild): Likewise.
6691 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
6693 * script.cc (Lazy_demangler): New class.
6694 (Version_script_info::get_symbol_version_helper): Demangle a
6697 2009-01-29 Cary Coutant <ccoutant@google.com>
6699 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
6701 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
6703 2009-01-28 Ian Lance Taylor <iant@google.com>
6705 * version.cc (version_string): Bump to 1.9.
6707 * gold.h: Include <cstring> and <stdint.h>.
6708 * version.cc: Include <cstdio>.
6709 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
6711 * reduced_debug_output.cc (insert_into_vector): Rename from
6712 Insert_into_vector; change all callers. Use Swap_unaligned to
6713 avoid aliasing issue; remove union since it is unnecessary.
6715 2009-01-27 Sriraman Tallam <tmsriram@google.com>
6717 * Makefile.am (CCFILES): Add gc.cc.
6719 * Makefile.in: Regenerate.
6720 * gold.cc (Gc_runner): New class.
6721 (queue_initial_tasks): Call garbage collection related tasks
6722 when corresponding options are invoked.
6723 (queue_middle_gc_tasks): New function.
6724 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
6725 processed early before laying out sections during garbage collection.
6726 * gold.h (queue_middle_gc_tasks): New function.
6727 (is_prefix_of): Move from "layout.cc".
6728 * i386.cc (Target_i386::gc_process_relocs): New function.
6729 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
6730 * main.cc (main): Create object of class "Garbage_collection".
6731 * object.cc (Relobj::copy_symbols_data): New function.
6732 (Relobj::is_section_name_included): New function.
6733 (Sized_relobj::do_layout): Allow this function to be called twice
6734 during garbage collection and defer layout of section during the
6736 * object.h (Relobj::get_symbols_data): New function.
6737 (Relobj::is_section_name_included): New function.
6738 (Relobj::copy_symbols_data): New function.
6739 (Relobj::set_symbols_data): New function.
6740 (Relobj::get_relocs_data): New function.
6741 (Relobj::set_relocs_data): New function.
6742 (Relobj::is_output_section_offset_invalid): New pure virtual function.
6743 (Relobj::gc_process_relocs): New function.
6744 (Relobj::do_gc_process_relocs): New pure virtual function.
6745 (Relobj::sd_): New data member.
6746 (Sized_relobj::is_output_section_offset_invalid): New function.
6747 (Sized_relobj::do_gc_process_relocs): New function.
6748 * options.h (General_options::gc_sections): Modify to not be a no-op.
6749 (General_options::print_gc_sections): New option.
6750 * plugin.cc (Plugin_finish::run): Remove function call to
6751 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
6752 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
6753 * reloc.cc (Read_relocs::run): Add task to process relocs and
6754 determine unreferenced sections when doing garbage collection.
6755 (Gc_process_relocs): New class.
6756 (Sized_relobj::do_gc_process_relocs): New function.
6757 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
6758 sections that are garbage collected.
6759 * reloc.h (Gc_process_relocs): New class.
6760 * sparc.cc (Target_sparc::gc_process_relocs): New function.
6761 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
6762 symbols whose corresponding sections are garbage collected.
6763 (Symbol_table::Symbol_table): Add new parameter for the garbage
6765 (Symbol_table::gc_mark_undef_symbols): New function.
6766 (Symbol_table::gc_mark_symbol_for_shlib): New function.
6767 (Symbol_table::gc_mark_dyn_syms): New function.
6768 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
6770 (Symbol_table::add_from_object): Likewise.
6771 (Symbol_table::add_from_relobj): When building shared objects, do not
6772 treat externally visible symbols as garbage.
6773 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
6774 table information for static and relocatable links.
6775 * symtab.h (Symbol_table::set_gc): New function.
6776 (Symbol_table::gc): New function.
6777 (Symbol_table::gc_mark_undef_symbols): New function.
6778 (Symbol_table::gc_mark_symbol_for_shlib): New function.
6779 (Symbol_table::gc_mark_dyn_syms): New function.
6780 (Symbol_table::gc_): New data member.
6781 * target.h (Sized_target::gc_process_relocs): New pure virtual
6783 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
6784 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
6786 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
6788 * options.h (General_options::gc_sections): Define as a no-op for now.
6789 (General_options::no_keep_memory): Ditto.
6790 (General_options::Bshareable): Define.
6791 * options.cc (General_options::finalize): Honor -Bshareable.
6793 2009-01-20 Andreas Schwab <schwab@suse.de>
6795 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
6796 read the value in the contents, since we don't use it. Use the
6797 template endianness when writing.
6798 (Relocate::relocate): Use it for R_PPC_REL16_HA.
6800 2009-01-19 Andreas Schwab <schwab@suse.de>
6802 * configure.tgt (powerpc64-*): Fix targ_obj.
6804 2009-01-15 Ian Lance Taylor <iant@google.com>
6806 * object.cc (Sized_relobj::write_local_symbols): Don't write out
6807 local symbols when stripping all symbols.
6809 2009-01-14 Cary Coutant <ccoutant@google.com>
6811 * output.cc (Output_reloc): Add explicit instantiations.
6813 2009-01-14 Cary Coutant <ccoutant@google.com>
6815 * archive.cc (Archive::get_elf_object_for_member): Remove call
6816 to File_read::claim_for_plugin.
6817 * descriptors.cc (Descriptors::open): Remove reference to
6819 (Descriptors::claim_for_plugin): Remove.
6820 * descriptors.h (Descriptors::claim_for_plugin): Remove.
6821 (Descriptors::is_claimed): Remove.
6822 (claim_descriptor_for_plugin): Remove.
6823 * fileread.cc (File_read::claim_for_plugin): Remove.
6824 * fileread.h (File_read::claim_for_plugin): Remove.
6825 (File_read::descriptor): Reopen descriptor if necessary.
6826 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
6827 (Plugin_manager::all_symbols_read): Add task parameter. Change
6829 (Plugin_manager::get_input_file): New function.
6830 (Plugin_manager::release_input_file): New function.
6831 (Pluginobj::Pluginobj): Add filesize parameter and initialize
6832 corresponding data member.
6833 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
6834 and pass to base constructor. Change all callers.
6835 (get_input_file, release_input_file): New functions.
6836 (make_sized_plugin_object): Add filesize parameter. Change all callers.
6837 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
6838 (Plugin_manager::all_symbols_read): Add task parameter.
6839 (Plugin_manager::get_input_file): New function.
6840 (Plugin_manager::release_input_file): New function.
6841 (Plugin_manager::task_): New data member.
6842 (Pluginobj::Pluginobj): Add filesize parameter.
6843 (Pluginobj::filename): New function.
6844 (Pluginobj::descriptor): New function.
6845 (Pluginobj::filesize): New function.
6846 (Pluginobj::filesize_): New data member.
6847 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
6848 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
6849 File_read::claim_for_plugin; use Object::unlock to unlock the file.
6851 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
6852 with archive libraries.
6853 * testsuite/Makefile.in: Regenerate.
6854 * testsuite/plugin_test.c (struct sym_info): New type.
6855 (get_input_file, release_input_file): New static variables.
6856 (onload): Capture new transfer vector entries.
6857 (claim_file_hook): Stop reading at end of file according to filesize.
6858 Factor out parsing of readelf output into separate function.
6859 (all_symbols_read_hook): Exercise get_input_file and release_input_file
6860 APIs and get the source file name from the symbol table. Convert
6861 source file name to corresponding object file name. Print info
6862 message when adding new input files.
6863 (parse_readelf_line): New function.
6864 * testsuite/plugin_test_1.sh: Add checks for new info messages.
6865 * testsuite/plugin_test_2.sh: Likewise.
6866 * testsuite/plugin_test_3.sh: Likewise.
6867 * testsuite/plugin_test_4.sh: New test case.
6869 2009-01-07 Ian Lance Taylor <iant@google.com>
6871 * version.cc (version_string): Bump to 1.8.
6873 2008-12-23 Cary Coutant <ccoutant@google.com>
6875 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
6876 * plugin.cc (Plugin_manager::finish): Rename as
6877 layout_deferred_objects. Move cleanup to separate function.
6878 (Plugin_manager::cleanup): New function.
6879 (Plugin_finish::run): Call layout_deferred_objects and cleanup
6881 * plugin.h (Plugin_manager::finish): Rename as
6882 layout_deferred_objects.
6883 (Plugin_manager::cleanup): New function.
6884 (Plugin_manager::cleanup_done): New field.
6886 2008-12-23 Cary Coutant <ccoutant@google.com>
6888 * plugin.cc (is_visible_from_outside): New function.
6889 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
6890 so we don't return "IR only" status for exported symbols or -r links.
6892 * testsuite/Makefile.am (plugin_test_3): New test case.
6893 * testsuite/Makefile.in: Regenerate.
6894 * testsuite/plugin_test_3.sh: New file.
6896 2008-12-22 Cary Coutant <ccoutant@google.com>
6898 * object.cc (Sized_relobj::layout_section): New function.
6899 (Sized_relobj::do_layout): Defer layout of input sections until after
6900 plugin has provided replacement files.
6901 (Sized_relobj::do_layout_deferred_sections): New function.
6902 * object.h (Relobj::set_section_offset): Remove virtual keyword.
6903 (Relobj::layout_deferred_sections): New function.
6904 (Relobj::do_layout_deferred_sections): New function.
6905 (Sized_relobj::do_layout_deferred_sections): New function.
6906 (Sized_relobj::layout_section): New function.
6907 (Sized_relobj::Deferred_layout): New structure.
6908 (Sized_relobj::deferred_layout_): New field.
6909 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
6910 Change all callers. Layout deferred sections.
6911 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
6913 (Plugin_hook::run): Move code from do_plugin_hook inline.
6914 (Plugin_hook::do_plugin_hook): Remove.
6915 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
6916 (Plugin_manager::finish): Renamed, was cleanup.
6917 (Plugin_manager::should_defer_layout): New function.
6918 (Plugin_manager::add_deferred_layout_object): New function.
6919 (Plugin_manager::Deferred_layout_list): New type.
6920 (Plugin_manager::deferred_layout_objects_): New field.
6921 (Plugin_hook::do_plugin_hook): Remove.
6923 2008-12-17 Ian Lance Taylor <iant@google.com>
6925 * options.h (class General_options): Add --no case for
6928 2008-12-16 Cary Coutant <ccoutant@google.com>
6930 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
6932 (Plugin_manager::claim_file): Create plugin object even if
6933 plugin did not call the add_symbols callback.
6934 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
6935 asking for more symbols than were added.
6936 * testsuite/Makefile.am (plugin_test_1): Add test case with
6938 (empty.syms): New target.
6939 * testsuite/Makefile.in: Regenerate.
6940 * testsuite/plugin_test.c (claim_file_hook): Add new debug
6941 message. Don't call add_symbols if no globals.
6942 (all_symbols_read_hook): Don't provide replacement for empty
6945 2008-12-12 Ian Lance Taylor <iant@google.com>
6947 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
6948 r_type == 0 for a local symbol with r_sym == 0.
6949 (scan_relocatable_relocs): Pass r_sym to
6950 local_non_section_strategy.
6951 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
6954 * configure.ac: Update test for TLS descriptors: they are
6955 supported as of glibc 2.9.
6956 * configure: Rebuild.
6958 2008-12-11 Ian Lance Taylor <iant@google.com>
6961 * target-reloc.h (Default_scan_relocatable_relocs): For each
6962 function, map r_type == 0 to RELOC_DISCARD.
6964 2008-12-10 Cary Coutant <ccoutant@google.com>
6966 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
6967 object to override a kept COMDAT group from a plugin object.
6969 2008-12-09 Ian Lance Taylor <iant@google.com>
6972 * yyscript.y (file_cmd): Handle INPUT.
6974 * testsuite/initpri1.c: Change all declarations to be full
6975 prototypes by adding void, to avoid compiler warnings.
6977 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
6979 * options.cc (General_options::parse_plugin_opt): New.
6980 (General_options::add_plugin): The argument now is just the filename.
6981 (General_options::add_plugin_option): New.
6982 * options.h (plugin_opt): New.
6983 (add_plugin): Change argument name.
6984 (add_plugin_option): New.
6985 * plugin.cc (Plugin::load): Don't parse the plugin option.
6986 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
6987 (Plugin::add_option): New.
6988 (Plugin::args_): Change type.
6989 (Plugin::filename_): New.
6990 (Plugin_manager::add_plugin_option): New.
6991 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
6992 * testsuite/Makefile.in: Regenerate.
6994 2008-12-05 Cary Coutant <ccoutant@google.com>
6996 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
6997 Handle --strip-lto-sections option.
6998 * options.h (strip_lto_sections): New option.
7000 2008-12-01 Cary Coutant <ccoutant@google.com>
7002 * plugin.cc (ld_plugin_message): Change format parameter to const.
7003 Fix mismatch between new[] and delete.
7005 2008-11-14 Cary Coutant <ccoutant@google.com>
7007 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
7010 2008-11-05 Craig Silverstein <csilvers@google.com>
7012 * options.cc (General_options::parse_dynamic_list): New function.
7013 * options.h (General_options): New flags dynamic_list,
7014 dynamic_list_data, dynamic_list_cpp_new, and
7015 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
7016 (General_options::in_dynamic_list): New function.
7017 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
7018 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
7019 (Lex::can_continue_name): Likewise.
7021 (read_script_file): New parameter script_options.
7022 (read_dynamic_list): New function.
7023 (Script_options::define_dynamic_list): New function.
7024 (dynamic_list_keyword_parsecodes): New variable.
7025 (dynamic_list_keywords): New variable.
7026 * script.h (Script_options::define_dynamic_list): New function
7028 (read_dynamic_list): New function prototype.
7029 * symtab.cc (strprefix): New macro.
7030 (Symbol::should_add_dynsym_entry): Support dynamic_list,
7031 dynamic_list_data, dynamic_list_cpp_new, and
7032 dynamic_list_cpp_typeinfo.
7033 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
7034 (dynamic_list_expr): New rule.
7035 (dynamic_list_nodes): Likewise.
7036 (dynamic_list_node): Likewise.
7037 * testsuite/Makefile.am (dynamic_list): New test.
7038 * testsuite/Makefile.in: Regenerated.
7039 * testsuite/dynamic_list.t: New file.
7040 * testsuite/dynamic_list.sh: New file.
7042 2008-11-05 Craig Silverstein <csilvers@google.com>
7044 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
7045 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
7046 (t11_last): Likewise.
7047 * testsuite/ver_test_6.c (main): Likewise.
7049 2008-10-07 Cary Coutant <ccoutant@google.com>
7051 * options.c (General_options::finalize): Add check for -static and
7053 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
7056 2008-10-02 Cary Coutant <ccoutant@google.com>
7058 * plugin.cc (make_sized_plugin_object): Fix conditional
7059 compilation to work when not all targets are enabled.
7061 2008-09-29 Cary Coutant <ccoutant@google.com>
7063 * archive.cc (Archive::get_file_and_offset): Use filename instead
7064 of name to get library path.
7065 (Archive::include_member): Unlock external member of a thin archive.
7067 * testsuite/Makefile.am (TEST_AR): New variable.
7068 (thin_archive_test_1): New test.
7069 (thin_archive_test_2): New test.
7070 * testsuite/Makefile.in: Regenerate.
7071 * testsuite/thin_archive_main.cc: New file.
7072 * testsuite/thin_archive_test_1.cc: New file.
7073 * testsuite/thin_archive_test_2.cc: New file.
7074 * testsuite/thin_archive_test_3.cc: New file.
7075 * testsuite/thin_archive_test_4.cc: New file.
7077 2008-09-29 Cary Coutant <ccoutant@google.com>
7079 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
7080 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
7082 (Sized_relobj::do_finalize_local_symbols): Likewise.
7083 (Sized_relobj::map_to_kept_section): Likewise.
7084 * object.h (Sized_relobj::invalid_address): New constant.
7085 (Sized_relobj::do_output_section_offset): Check for invalid_address
7087 * output.cc (Output_reloc::local_section_offset): Use constant
7088 invalid_address instead of -1U.
7089 (Output_reloc::get_address): Likewise.
7090 (Output_section::output_address): Change -1U to -1ULL.
7091 * output.h (Output_reloc::invalid_address): New constant.
7092 * reloc.cc (Sized_relobj::write_sections): Use constant
7093 invalid_address instead of -1U.
7094 (Sized_relobj::relocate_sections): Likewise.
7095 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
7096 values for merge sections.
7097 * target-reloc.h (relocate_for_relocatable): Use constant
7098 invalid_address instead of -1U.
7100 2008-09-19 Cary Coutant <ccoutant@google.com>
7102 Add plugin functionality for link-time optimization (LTO).
7103 * configure.ac (plugins): Add --enable-plugins option.
7104 * configure: Regenerate.
7105 * config.in: Regenerate.
7106 * Makefile.am (LIBDL): New variable.
7107 (CCFILES): Add plugin.cc.
7108 (HFILES): Add plugin.h.
7109 (ldadd_var): Add LIBDL.
7110 * Makefile.in: Regenerate.
7112 * archive.cc: Include "plugin.h".
7113 (Archive::setup): Don't preread archive symbols when using a plugin.
7114 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
7115 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
7117 (Archive::include_member): Add symbols from plugin objects.
7118 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
7119 * descriptors.cc (Descriptors::open): Check for file descriptors
7120 abandoned by plugins.
7121 (Descriptors::claim_for_plugin): New function.
7122 * descriptors.h (Descriptors::claim_for_plugin): New function.
7123 (Open_descriptor::is_claimed): New field.
7124 (claim_descriptor_for_plugin): New function.
7125 * fileread.cc (File_read::claim_for_plugin): New function.
7126 * fileread.h (File_read::claim_for_plugin): New function.
7127 (File_read::descriptor): New function.
7128 * gold.cc: Include "plugin.h".
7129 (queue_initial_tasks): Add task to call plugin hooks for generating
7131 * main.cc: Include "plugin.h".
7132 (main): Load plugin libraries.
7133 * object.h (Pluginobj): Declare.
7134 (Object::pluginobj): New function.
7135 (Object::do_pluginobj): New function.
7136 (Object::set_target): New function.
7137 * options.cc: Include "plugin.h".
7138 (General_options::parse_plugin): New function.
7139 (General_options::General_options): Initialize plugins_ field.
7140 (General_options::add_plugin): New function.
7141 * options.h (Plugin_manager): Declare.
7142 (General_options): Add --plugin option.
7143 (General_options::has_plugins): New function.
7144 (General_options::plugins): New function.
7145 (General_options::add_plugin): New function.
7146 (General_options::plugins_): New field.
7147 * plugin.cc: New file.
7148 * plugin.h: New file.
7149 * readsyms.cc: Include "plugin.h".
7150 (Read_symbols::do_read_symbols): Check for archive before checking
7151 for ELF file. Call plugin hooks to claim files.
7152 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
7153 from a real object file; force override when processing replacement
7155 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
7156 (Symbol::init_base_object): Likewise.
7157 (Symbol::init_base_output_data): Likewise.
7158 (Symbol::init_base_output_segment): Likewise.
7159 (Symbol::init_base_constant): Likewise.
7160 (Symbol::init_base_undefined): Likewise.
7161 (Symbol::output_section): Assert that object is not a plugin.
7162 (Symbol_table::add_from_pluginobj): New function.
7163 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
7165 (Symbol_table::sized_write_globals): Likewise.
7166 (Symbol_table::add_from_pluginobj): Instantiate template.
7167 * symtab.h (Sized_pluginobj): Declare.
7168 (Symbol::in_real_elf): New function.
7169 (Symbol::set_in_real_elf): New function.
7170 (Symbol::in_real_elf_): New field.
7171 (Symbol_table::add_from_pluginobj): New function.
7173 * testsuite/Makefile.am (AM_CFLAGS): New variable.
7174 (LIBDL): New variable.
7176 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
7177 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
7178 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
7179 (MOSTLYCLEANFILES): Likewise.
7180 * testsuite/Makefile.in: Regenerate.
7181 * testsuite/plugin_test.c: New file.
7182 * testsuite/plugin_test_1.sh: New file.
7183 * testsuite/plugin_test_2.sh: New file.
7185 2008-09-16 Ian Lance Taylor <iant@google.com>
7187 * target-reloc.h (relocate_section): Check whether a symbol is
7188 defined by the ABI before reporting an undefined symbol error.
7189 * target.h (Target::is_defined_by_abi): Make parameter const.
7190 (Target::do_is_defined_by_abi): Likewise.
7191 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
7192 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
7193 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
7194 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
7195 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
7196 * testsuite/Makefile.in: Rebuild.
7198 * fileread.cc (make_view): Add casts to avoid warning.
7200 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
7202 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
7203 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7205 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
7207 * options.h (General_options::output_is_executable): New.
7208 (General_options::output_is_pie): New.
7209 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
7210 for shared libraries.
7211 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7213 2008-09-11 Chris Demetriou <cgd@google.com>
7215 * options.h (origin): New -z option.
7216 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
7217 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
7220 2008-09-05 Cary Coutant <ccoutant@google.com>
7222 * fileread.cc (File_read::make_view): Add check for attempt to map
7225 2008-09-05 Cary Coutant <ccoutant@google.com>
7227 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
7228 explicit instantiations.
7230 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
7233 * options.cc (General_options::finalize): Allow undefined symbols
7234 in shlibs if linking -shared.
7237 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
7238 symbols as not needing a dynsym entry.
7240 2008-08-20 Craig Silverstein <csilvers@google.com>
7242 * fileread.cc (File_read::open): Do not lock the file unless it
7243 was successfully opened.
7245 2008-08-14 Cary Coutant <ccoutant@google.com>
7247 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
7248 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
7249 * testsuite/tls_test.cc (struct int128): 128-bit struct
7250 for testing TLS relocs with non-zero addend.
7251 (v12): New TLS variable.
7253 (t_last): Add check for v12.
7254 * testsuite/tls_test.h (t12): New function.
7255 * testsuite/tls_test_main.cc (thread_routine): Call new test.
7257 2008-08-13 Ian Lance Taylor <iant@google.com>
7259 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
7260 set tls_segment_ or relro_segment_.
7261 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
7263 * output.h (Output_section::clear_is_relro): New function.
7264 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
7265 sections specially even when output_data_ is empty.
7266 (Output_segment::maximum_alignment): When first section is relro,
7267 only force alignment for PT_LOAD segments.
7268 * script.cc (script_data_segment_align): New function.
7269 (script_data_segment_relro_end): New function.
7270 * script-c.h (script_data_segment_align): Declare.
7271 (script_data_segment_relro_end): Declare.
7272 * script-sections.h (class Script_sections): Declare
7273 data_segment_align and data_segment_relro_end. Add fields
7274 segment_align_index_ and saw_relro_end_.
7275 * script-sections.cc (class Sections_element): Add set_is_relro
7276 virtual function. Add new bool* parameter to place_orphan_here.
7277 Add get_output_section virtual function.
7278 (class Output_section_definition): Add set_is_relro. Add new
7279 bool* parameter to place_orphan_here. Add get_output_section.
7280 Add is_relro_ field.
7281 (Output_section_definition::Output_section_definition): Initialize
7282 evaluated_address_, evaluated_load_address, evaluated_addralign_,
7283 and is_relro_ fields.
7284 (Output_section_definition::place_orphan_here): Add is_relro
7286 (Output_section_definition::set_section_addresses): Set relro for
7288 (Output_section_definition::alternate_constraint): Likewise.
7289 (class Orphan_output_section): Add new bool* parameter to
7290 place_orphan_here. Add get_output_section.
7291 (Orphan_output_section::place_orphan_here): Add is_relro
7293 (Script_sections::Script_sections): Initialize
7294 data_segment_align_index_ and saw_relro_end_.
7295 (Script_sections::data_segment_align): New function.
7296 (Script_sections::data_segment_relro_end): New function.
7297 (Script_sections::place_orphan): Set or clear is_relro.
7298 (Script_sections::set_section_addresses): Force alignment of first
7300 * yyscript.y (exp): Call script_data_segment_align and
7301 script_data_segment_relro_end.
7302 * testsuite/relro_script_test.t: New file.
7303 * testsuite/relro_test.cc (using_script): Declare.
7304 (t1, t2): Test using_script.
7305 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
7306 (relro_script_test_SOURCES): Define.
7307 (relro_script_test_DEPENDENCIES): Define.
7308 (relro_script_test_LDFLAGS): Define.
7309 (relro_script_test_LDADD): Define.
7310 (relro_script_test.so): New target.
7311 * testsuite/Makefile.in: Rebuild.
7313 2008-08-06 Cary Coutant <ccoutant@google.com>
7315 * archive.cc (Archive::total_archives, Archive::total_members)
7316 (Archive::total_members_loaded): New variables.
7317 (Archive::setup): Add parameter. Add option to preread
7319 (Archive::read_armap): Add counter.
7320 (Archive::get_file_and_offset): New function.
7321 (Archive::get_elf_object_for_member): New function.
7322 (Archive::read_all_symbols): New function.
7323 (Archive::read_symbols): New function.
7324 (Archive::add_symbols): Add counters.
7325 (Archive::include_all_members): Use armap to find members if it's
7327 (Archive::include_member): Skip reading symbols if already read.
7328 Factored code into Archive::get_file_and_offset and
7329 Archive::get_elf_object_for_member. Changed call to
7330 Mapfile::report_include_archive_member.
7331 (Archive::print_stats): New function.
7332 * archive.h: Declare Object and Read_symbols_data classes.
7333 (Archive::Archive): Add initializers for new members.
7334 (Archive::setup): Add parameter.
7335 (Archive::print_stats): New function.
7336 (Archive::total_archives, Archive::total_members)
7337 (Archive::total_members_loaded): New variables.
7338 (Archive::get_file_and_offset): New function.
7339 (Archive::get_elf_object_for_member): New function.
7340 (Archive::read_all_symbols): New function.
7341 (Archive::read_symbols): New function.
7342 (Archive::Archive_member): New class.
7343 (Archive::members_): New member.
7344 (Archive::num_members_): New member.
7345 * main.cc: Include archive.h.
7346 (main): Call Archive::print_stats.
7347 * mapfile.cc (Mapfile::report_include_archive_member): Delete
7348 archive parameter; member_name is now the fully-decorated name.
7349 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
7350 * options.h: (General_options): Add --preread-archive-symbols option.
7351 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
7354 2008-08-04 Ian Lance Taylor <iant@google.com>
7356 * symtab.h (Symbol::use_plt_offset): New function.
7357 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
7358 * powerpc.cc (Relocate::relocate): Likewise.
7359 * sparc.cc (Relocate::relocate): Likewise.
7360 * x86_64.cc (Relocate::relocate): Likewise.
7361 * testsuite/weak_plt.sh: New test.
7362 * testsuite/weak_plt_main.cc: New test.
7363 * testsuite/weak_plt_shared.cc: New test.
7364 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
7365 (check_PROGRAMS): Add weak_plt.
7366 (check_DATA): Add weak_plt_shared.so.
7367 (weak_plt_main_pic.o, weak_plt): New targets.
7368 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
7369 * testsuite/Makefile.in: Rebuild.
7371 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
7373 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
7374 * testsuite/Makefile.in: Rebuild.
7376 2008-08-04 Alan Modra <amodra@bigpond.net.au>
7378 * Makefile.am (POTFILES.in): Set LC_ALL=C.
7379 * Makefile.in: Regenerate.
7380 * po/POTFILES.in: Regenerate.
7382 2008-07-29 Ian Lance Taylor <iant@google.com>
7384 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
7385 symbols before other symbols.
7386 * testsuite/script_test_2.cc (test_addr): Declare.
7387 (test_addr_alias): Declare.
7388 (main): Check that test_addr and test_addr_alias have the right
7390 * testsuite/script_test_2.t: Define test_addr_alias and
7393 2008-07-24 Ian Lance Taylor <iant@google.com>
7396 * descriptors.cc: New file.
7397 * descriptors.h: New file.
7398 * gold-threads.h (class Hold_optional_lock): New class.
7399 * fileread.cc: Include "descriptors.h".
7400 (File_read::~File_read): Release descriptor rather than closing
7402 (File_read::open) [file]: Call open_descriptor rather than open.
7403 Set is_descriptor_opened_.
7404 (File_read::open) [memory]: Assert that descriptor is not open.
7405 (File_read::reopen_descriptor): New function.
7406 (File_read::release): Release descriptor.
7407 (File_read::do_read): Make non-const. Reopen descriptor.
7408 (File_read::read): Make non-const.
7409 (File_read::make_view): Reopen descriptor.
7410 (File_read::do_readv): Likewise.
7411 * fileread.h (class File_read): Add is_descriptor_opened_ field.
7412 Update declarations.
7413 * layout.cc: Include "descriptors.h".
7414 (Layout::create_build_id): Use open_descriptor rather than open.
7415 * output.cc: Include "descriptors.h".
7416 (Output_file::open): Use open_descriptor rather than open.
7417 * archive.cc (Archive::const_iterator): Change Archive to be
7419 (Archive::begin, Archive::end): Make non-const.
7420 (Archive::count_members): Likewise.
7421 * archive.h (class Archive): Update declarations.
7422 * object.h (Object::read): Make non-const.
7423 * Makefile.am (CCFILES): Add descriptors.cc.
7424 (HFILES): Add descriptors.h.
7425 * Makefile.in: Rebuild.
7428 * gold.h: Always include <clocale>. Add Solaris workarounds
7429 following code in binutils/sysdep.h.
7432 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
7433 this->eh_frame_hdr_ is NULL before using it.
7435 * dynobj.cc (Versions::Versions): Update comment.
7437 * dynobj.cc (Versions::Versions): If there is an soname, use it as
7438 the base version name.
7440 * stringpool.cc (Stringpool_template::add_with_length): Set key to
7441 array size plus one.
7442 (Stringpool_template::set_string_offsets): Subtract one from key
7443 before using it as an array index.
7444 (Stringpool_template::get_offset_with_length): Likewise.
7445 (Stringpool_template::write_to_buffer): Likewise.
7446 * stringpool.h (Stringpool_template::get_offset_from_key):
7449 2008-07-23 Ian Lance Taylor <iant@google.com>
7452 * object.h (Merged_symbol_value::value): Do our best to handle a
7456 * script.cc (Version_script_info::get_versions): Don't add empty
7457 version tag to return value.
7458 (Version_script_info::get_symbol_version_helper): Change return
7459 type to bool. Add pversion parameter. Change all callers.
7460 (script_register_vers_node): Don't require a non-NULL tag.
7461 * script.h (class Version_script_info): Update declarations.
7462 (Version_script_info::get_symbol_version): Change return type to
7463 bool. Add version parameter. Change all callers.
7464 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
7465 handling. Handle an empty version from a version script.
7466 (Symbol_table::define_special_symbol): Likewise.
7467 * testsuite/ver_test_10.script: New file.
7468 * testsuite/ver_test_10.sh: New file.
7469 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
7470 (check_DATA): Add ver_test_10.syms.
7471 (ver_test_10.syms, ver_test_10.so): New target.
7472 * testsuite/Makefile.in: Rebuild.
7474 2008-07-23 Simon Baldwin <simonb@google.com>
7476 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
7477 to zero for undefined symbols from dynamic libraries.
7479 2008-07-23 Ian Lance Taylor <iant@google.com>
7481 * symtab.cc (Symbol_table::resolve): Remove version parameter.
7483 * symtab.h (class Symbol_table): Update declaration.
7484 * testsuite/ver_test_9.cc: New file.
7485 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
7486 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
7487 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
7488 (ver_test_9.so, ver_test_9.o): New targets.
7489 * testsuite/Makefile.in: Rebuild.
7491 2008-07-22 Ian Lance Taylor <iant@google.com>
7493 * options.h (class General_options): Define --check-sections.
7494 * layout.cc (Layout::set_segment_offsets): Handle
7497 * options.h (class General_options): Define -n/--nmagic and
7499 * options.cc (General_options::finalize): For -n/--nmagic or
7500 -N/--omagic, set -static.
7501 * layout.cc (Layout::attach_allocated_section_to_segment): If
7502 -N/--omagic, don't put read-only and read-write sections in
7504 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
7505 finding a read-only segment.
7506 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
7507 don't set the minimum segment alignment to the common page size,
7508 and don't set the file offset to the address modulo the page size.
7509 * script-sections.cc (Script_sections::create_segments): If
7510 -n/--omagic, don't put read-only and read-write sections in
7513 * cref.cc: New file.
7515 * options.h (class General_options): Add --print-symbol-counts.
7516 * main.cc (main): Issue defined symbol report if requested.
7517 * archive.cc (Archive::interpret_header): Make into a const member
7519 (Archive::add_symbols): Call Input_objects::archive_start and
7521 (Archive::const_iterator): Define new class.
7522 (Archive::begin, Archive::end): New functions.
7523 (Archive::include_all_members): Rewrite to use iterator.
7524 (Archive::count_members): New function.
7525 * archive.h (class Archive): Update declarations.
7526 (Archive::filename): New function.
7527 * object.cc: Include "cref.h".
7528 (Sized_relobj::Sized_relobj): Initialize defined_count_.
7529 (Sized_relobj::do_get_global_symbol_counts): New function.
7530 (Input_objects::add_object): Add object to cross-referencer.
7531 (Input_objects::archive_start): New function.
7532 (Input_objects::archive_stop): New function.
7533 (Input_objects::print_symbol_counts): New function.
7534 * object.h: Declare Cref and Archive.
7535 (Object::get_global_symbol_counts): New function.
7536 (Object::do_get_global_symbol_counts): New pure virtual function.
7537 (class Sized_relobj): Add defined_count_ field. Update
7539 (class Input_objects): Add cref_ field. Update constructor.
7540 Update declarations.
7541 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
7543 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
7545 (Sized_dynobj::do_get_global_symbol_counts): New function.
7546 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
7547 defined_count_. Update declarations. Define Symbols typedef.
7548 * symtab.cc (Symbol_table::add_from_relobj): Add defined
7549 parameter. Change all callers.
7550 (Symbol_table::add_from_dynobj): Add sympointers and defined
7551 parameters. Change all callers.
7552 * symtab.h (class Symbol_table): Update declarations.
7553 * Makefile.am (CCFILES): Add cref.cc.
7554 (HFILES): Add cref.h.
7555 * Makefile.in: Rebuild.
7557 2008-07-22 Simon Baldwin <simonb@google.com>
7559 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
7560 to zero when writing undefined symbols.
7562 2008-07-22 Ian Lance Taylor <iant@google.com>
7564 * output.cc (Output_section::add_input_section): Don't try to
7565 merge empty merge sections.
7567 2008-07-21 Craig Silverstein <csilvers@google.com>
7569 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7570 Include symbol version in error message.
7572 2008-07-20 Chris Demetriou <cgd@google.com>
7574 * configure.ac (gold_cv_c_random_seed): New configured variable.
7575 (RANDOM_SEED_CFLAGS): New substituted variable.
7576 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
7577 * configure: Rebuild.
7578 * Makefile.in: Likewise.
7579 * testsuite/Makefile.in: Likewise.
7581 2008-07-18 Ian Lance Taylor <iant@google.com>
7583 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
7584 where we see NAME/NULL and NAME/VERSION as separate symbols.
7585 * testsuite/ver_test_main.cc (main): Call t4.
7586 (t4, t4_2a): Define.
7587 * testsuite/ver_test_2.cc (t4_2): Define.
7588 * testsuite/ver_test_2.script: Put t4_2a in VER2.
7589 * testsuite/ver_test_4.cc (t4_2a): Define.
7590 * testsuite/ver_test_4.script: Put t4_2a in VER2.
7591 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
7593 2008-07-17 Ian Lance Taylor <iant@google.com>
7595 * dynobj.cc (Versions::add_def): If we give an error about a
7596 missing version, go ahead and create the version anyhow.
7598 2008-07-10 Ian Lance Taylor <iant@google.com>
7600 Handle output sections with more than 0x7fffffff bytes.
7601 * object.h (class Relobj): Change map_to_output_ to
7602 output_sections_, and just keep a section pointer. Change all
7603 uses. Move comdat group support to Sized_relobj.
7604 (Relobj::is_section_specially_mapped): Remove.
7605 (Relobj::output_section): Remove poff parameter. Change all
7607 (Relobj::output_section_offset): New function.
7608 (Relobj::set_section_offset): Rewrite.
7609 (Relobj::map_to_output): Remove.
7610 (Relobj::output_sections): New function.
7611 (Relobj::do_output_section_offset): New pure virtual function.
7612 (Relobj::do_set_section_offset): Likewise.
7613 (class Sized_relobj): Add section_offsets_ field. Add comdat
7614 group support from Relobj. Update declarations.
7615 (Sized_relobj::get_output_section_offset): New function.
7616 (Sized_relobj::do_output_section_offset): New function.
7617 (Sized_relobj::do_set_section_offset): New function.
7618 * object.cc (Relobj::output_section_address): Remove.
7619 (Sized_relobj::Sized_relobj): Initialize new fields.
7620 (Sized_relobj::include_section_group): Cast find_kept_object to
7622 (Sized_relobj::include_linkonce_section): Likewise.
7623 (Sized_relobj::do_layout): Use separate arrays for output section
7625 (Sized_relobj::do_count_local_symbols): Change map_to_output to
7627 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
7628 output_sections and section_offsets.
7629 (Sized_relobj::write_local_symbols): Likewise.
7630 (map_to_kept_section): Compute output address directly.
7631 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
7632 output_sections and section_offsets.
7633 (Sized_relobj::write_sections): Likewise.
7634 (Sized_relobj::relocate_sections): Likewise.
7635 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
7636 * output.h (class Output_reloc): Update declarations. Change
7637 u2_.relobj to Sized_relobj*.
7638 (class Output_data_reloc): Change add functions to use
7640 * output.cc (Output_reloc::Output_reloc): Change relobj to
7642 (Output_reloc::local_section_offset): Change return type to
7643 Elf_Addr. Use get_output_section_offset.
7644 (Output_reloc::get_address): Likewise.
7645 (Output_section::is_input_address_mapped): Don't call
7646 is_section_specially_mapped.
7647 (Output_section::output_offset): Likewise.
7648 (Output_section::output_address): Likewise.
7649 (Output_section::starting_output_address): Likewise.
7650 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
7651 parameter to Sized_relobj*.
7652 (Copy_relocs::need_copy_reloc): Likewise.
7653 (Copy_relocs::save): Likewise.
7654 * copy-relocs.h (class Copy_relocs): Update declarations.
7655 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
7656 Sized_relobj*. Change relobj_ field to Sized_relobj*.
7657 * target-reloc.h (relocate_for_relocatable): Change
7658 offset_in_output_section type to Elf_Addr. Change code that uses
7660 * layout.cc (Layout::layout): Always set *off.
7661 * mapfile.cc (Mapfile::print_input_section): Use
7662 output_section_offset.
7663 * i386.cc (Target_i386::copy_reloc): Change object parameter to
7665 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
7666 * sparc.cc (Target_sparc::copy_reloc): Likewise.
7667 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
7669 2008-07-03 Ian Lance Taylor <iant@google.com>
7671 * layout.cc (Layout::include_section): Do not discard unrecognized
7672 SHT_STRTAB sections.
7674 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
7676 * script.cc (Lex::can_continue_name): Make '?' allowable in
7677 version-script names.
7678 * testsuite/version_script.map: Change glob pattern to use '?'
7680 2008-06-30 Manish Singh <yosh@gimp.org>
7683 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
7686 2008-06-30 Ian Lance Taylor <iant@google.com>
7690 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
7691 versions]: Don't try to read the value in the contents, since we
7692 don't use it. Use the template endianness when writing.
7694 2008-06-25 Cary Coutant <ccoutant@google.com>
7696 * fileread.cc (File_read::make_view): Assert on zero-length view.
7697 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
7698 symbol table when there are no symbols to read.
7700 2008-06-23 Craig Silverstein <csilvers@google.com>
7702 * version.cc (version_string): Bump to 1.7
7704 2008-06-18 Craig Silverstein <csilvers@google.com>
7706 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
7707 constant 0xFFFF to type Valtype.
7708 (Powerpc_relocate_functions::rel16_ha): Likewise.
7710 2008-06-17 Ian Lance Taylor <iant@google.com>
7712 * output.h (Output_section::Input_section): Initialize p2align_ to
7713 zero for Output_section_data constructors.
7714 (Output_section::Input_section::addralign): If not an input
7715 section, return the alignment of the Output_section_data.
7716 * testsuite/copy_test.cc: New file.
7717 * testsuite/copy_test_1.cc: New file.
7718 * testsuite/copy_test_2.cc: New file.
7719 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
7720 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
7721 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
7722 (copy_test_1_pic.o, copy_test_1.so): New targets.
7723 (copy_test_2_pic.o, copy_test_2.so): New targets.
7724 * testsuite/Makefile.in: Rebuild.
7726 * script-sections.cc (Script_sections::place_orphan): Initialize
7727 local variable exact.
7729 2008-06-13 David Edelsohn <edelsohn@gnu.org>
7731 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
7733 2008-06-12 David Edelsohn <edelsohn@gnu.org>
7734 David S. Miller <davem@davemloft.net>
7736 * powerpc.cc: New file.
7737 * Makefile.am (TARGETSOURCES): Add powerpc.cc
7738 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
7739 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
7740 * Makefile.in: Rebuild.
7742 2008-06-09 Ian Lance Taylor <iant@google.com>
7744 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
7746 (throwing, orig_terminate): New static variables.
7747 (terminate_handler): New static function.
7748 (t2): Set terminate handler.
7750 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
7753 * binary.cc (Binary_to_elf::sized_convert): Fix .data
7756 2008-05-30 Cary Coutant <ccoutant@google.com>
7758 * archive.cc (Archive::include_all_members) Correct to step
7759 over symbol table and extended name table in thin archives.
7761 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
7764 * target-reloc.h (relocate_for_relocatable): Fix new_offset
7767 2008-05-28 Caleb Howe <cshowe@google.com>
7769 * reduced_debug_output.cc: New file.
7770 * reduced_debug_output.h: New file.
7771 * options.h (class General_options): Add --strip-debug-non-line.
7772 * options.cc (General_options::finalize): Add strip_debug_non_line
7773 to the strip heirarchy.
7774 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
7776 * layout.cc: Include "reduced_debug_output.h".
7777 (Layout::Layout): Initialize new fields.
7778 (line_only_debug_sections): New static array.
7779 (is_lines_only_debug_sections): New static inline function.
7780 (Layout::include_section): Handle --strip-debug-non-line.
7781 (Layout::make_output_section): If --strip-debug-non-line, build
7782 new output sections for .debug_abbrev and .debug_info.
7783 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
7784 gold. Warn about possible overflow.
7785 (read_signed_LEB_128): Likewise.
7786 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
7787 (read_signed_LEB_128): Declare.
7788 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
7789 (HFILES): Add reduced_debug_output.h.
7790 * Makefile.in: Rebuild.
7792 2008-05-21 Ian Lance Taylor <iant@google.com>
7794 * mapfile.cc: New file.
7795 * mapfile.h: New file.
7796 * options.h (class General_options): Add -M/--print-map and -Map.
7797 * options.cc (General_options::finalize): Make -M equivalent to
7799 * main.cc: Include <cstdio> and "mapfile.h".
7800 (main): Open mapfile if requested.
7801 * gold.cc (class Middle_runner): Add mapfile_ field. Update
7802 constructor. Change caller.
7803 (queue_initial_tasks): Add mapfile parameter. Change caller.
7804 (queue_middle_tasks): Likewise.
7805 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
7807 * archive.cc: Include "mapfile.h".
7808 (Archive::add_symbols): Add mapfile parameter. Change all
7809 callers. Pass mapfile, symbol, and reason to include_member.
7810 (Archive::include_all_members): Add mapfile parameter. Change all
7812 (Archive::include_member): Add mapfile, sym, and why parameters.
7813 Change all callers. Report inclusion to map file.
7814 * archive.h: Include "fileread.h".
7815 (class Archive): Update declarations.
7816 (Archive::file): New const method.
7817 (class Add_archive_symbols): Add mapfile_ field. Update
7818 constructor. Change all callers.
7819 * readsyms.h (class Read_symbols): Likewise.
7820 (class Finish_group): Likewise.
7821 (class Read_script): Likewise.
7822 * common.cc: Include "mapfile.h".
7823 (Symbol_table::allocate_commons): Add mapfile parameter. Change
7825 (Symbol_table::do_allocate_commons): Likewise.
7826 (Symbol_table::do_allocate_commons_list): Likewise. Report common
7827 symbol allocation to mapfile.
7828 * common.h (class Allocate_commons_task): Add mapfile_ field.
7829 Update constructor. Change all callers.
7830 * symtab.h (class Symbol_table): Update declarations.
7831 * layout.cc: Include "mapfile.h".
7832 (Layout_task_runner::run): Print information to mapfile.
7833 (Layout::create_gold_note): Change Output_data_fixed_space to
7834 Output_data_zero_fill.
7835 (Layout::create_build_id): Likewise.
7836 (Layout::print_to_mapfile): New function.
7837 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
7838 constructor. Change caller.
7839 (class Layout): Declare print_to_mapfile.
7840 * output.cc (Output_section::Input_section::print_to_mapfile): New
7842 (Output_section::add_input_section): If producing a map, always
7843 add to input_sections_ list.
7844 (Output_section::do_print_to_mapfile): New function.
7845 (Output_segment::print_sections_to_mapfile): New function.
7846 (Output_segment::print_section_list_to_mapfile): New function.
7847 * output.h: Include "mapfile.h".
7848 (Output_data::print_to_mapfile): New function.
7849 (Output_data::do_print_to_mapfile): New virtual function.
7850 (Output_segment_headers::do_print_to_mapfile): New function.
7851 (Output_file_header::do_print_to_mapfile): New function.
7852 (Output_data_const::do_print_to_mapfile): New function.
7853 (class Output_data_const_buffer): Add map_name_ field. Update
7854 constructor. Change all callers. Add do_print_to_mapfile
7856 (class Output_data_fixed_space): Likewise.
7857 (class Output_data_space): Likewise.
7858 (class Output_data_zero_fill): New class.
7859 (Output_data_strtab::do_print_to_mapfile): New function.
7860 (Output_data_reloc_base::do_print_to_mapfile): New function.
7861 (Output_relocatable_relocs::do_print_to_mapfile): New function.
7862 (Output_data_group::do_print_to_mapfile): New function.
7863 (Output_data_got::do_print_to_mapfile): New function.
7864 (Output_data_dynamic::do_print_to_mapfile): New function.
7865 (Output_symtab_xindex::do_print_to_mapfile): New function.
7866 (class Output_section): Declare do_print_to_mapflie. Declare
7867 print_to_mapfile in Input_section.
7868 (class Output_segment): Declare new functions.
7869 * object.h (Sized_relobj::symbol_count): New function.
7870 * script-sections.cc
7871 (Output_section_element_dot_assignment::set_section_addresses):
7872 Change Output_data_fixed_space to Output_data_zero_fill.
7873 (Output_data_expression::do_print_to_mapfile): New function.
7874 * script.cc (read_input_script): Add mapfile parameter. Change
7876 * script.h (read_input_script): Update declaration.
7877 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
7878 (Eh_frame::do_print_to_mapfile): New function.
7879 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
7880 (Output_merge_string::do_print_to_mapfile): New function.
7881 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
7883 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
7885 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
7887 * Makefile.am (CCFILES): Add mapfile.cc.
7888 (HFILES): Add mapfile.h.
7889 * Makefile.in: Rebuild.
7891 2008-05-19 Ian Lance Taylor <iant@google.com>
7893 * options.h (class General_options): Add -z relro.
7894 * layout.cc (Layout::Layout): Initialize relro_segment_.
7895 (Layout::add_output_section_data): Return the output section.
7896 (Layout::make_output_section): Rcognize relro sections and mark
7898 (Layout::attach_allocated_section_to_segment): Put relro sections
7899 in a PT_GNU_RELRO segment.
7900 (Layout::create_initial_dynamic_sections): Mark the .dynamic
7902 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
7904 (Layout::linkonce_mapping): Map d.rel.ro.local to
7906 (Layout::output_section_name): Us .data.rel.ro.local for any
7907 section which begins with that.
7908 * layout.h (class Layout): Update add_output_section_data
7909 declaration. Add relro_segment_ field.
7910 * output.cc (Output_section::Output_section): Initialize is_relro_
7911 and is_relro_local_ fields.
7912 (Output_segment::add_output_section): Group relro sections.
7913 (Output_segment::is_first_section_relro): New function.
7914 (Output_segment::maximum_alignment): If there is a relro section,
7915 align the segment to the common page size.
7916 (Output_segment::set_section_addresses): Track whether we are
7917 looking at relro sections. If the last section is a relro
7918 section, align to the common page size.
7919 (Output_segment::set_section_list_addresses): Add in_relro
7920 parameter. Change all callers. Align to the page size when
7921 moving from relro to non-relro section.
7922 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
7924 * output.h (class Output_section): Add is_relro_ and
7925 is_relro_local_ fields.
7926 (Output_section::is_relro): New function.
7927 (Output_section::set_is_relro): New function.
7928 (Output_section::is_relro_local): New function.
7929 (Output_section::set_is_relro_local): New function.
7930 (class Output_segment): Update declarations.
7931 * i386.cc (Target_i386::got_section): Mark .got section as relro.
7932 * sparc.cc (Target_sparc::got_section): Likewise.
7933 * x86_64.cc (Target_x86_64::got_section): Likewise.
7934 * testsuite/relro_test_main.cc: New file.
7935 * testsuite/relro_test.cc: New file.
7936 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
7937 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
7938 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
7939 (relro_test.so, relro_test_pic.o): New targets.
7940 * testsuite/Makefile.in: Rebuild.
7942 2008-05-16 Ian Lance Taylor <iant@google.com>
7944 * output.cc (Output_segment::add_output_section): Remove front
7946 * output.h (class Output_segment): Remove
7947 add_initial_output_section and overloaded add_output_section.
7948 Update declaration of remaining add_output_section.
7949 * layout.cc (Layout::create_interp): Call add_output_section
7950 rather than add_initial_output_section.
7951 (Layout::finish_dynamic_section): Likewise.
7953 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
7954 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
7955 know the dynamic type.
7956 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
7957 field. Initialize it in constructor.
7958 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
7959 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
7960 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
7963 * output.cc (Output_reloc::get_address): Change return type to
7965 * output.h (class Output_reloc): Update get_address declaration.
7966 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
7967 for section addresses.
7969 2008-05-09 Ian Lance Taylor <iant@google.com>
7972 * gold.cc (gold_nomem): Use return value of write.
7974 2008-05-08 Ian Lance Taylor <iant@google.com>
7976 * symtab.c (Symbol::init_base_output_data): Add version
7977 parameter. Change all callers.
7978 (Symbol::init_base_output_segment): Likewise.
7979 (Symbol::init_base_constant): Likewise.
7980 (Symbol::init_base_undefined): Likewise.
7981 (Sized_symbol::init_output_data): Likewise.
7982 (Sized_symbol::init_output_segment): Likewise.
7983 (Sized_symbol::init_constant): Likewise.
7984 (Sized_symbol::init_undefined): Likewise.
7985 (Symbol_table::do_define_in_output_data): If the new symbol has a
7986 version, mark it as the default.
7987 (Symbol_table::do_define_in_output_segment): Likewise.
7988 (Symbol_table::do_define_as_constant): Likewise.
7989 * symtab.h (class Symbol): Update declarations.
7990 (class Sized_symbol): Likewise.
7991 * resolve.cc (Symbol::override_version): New function.
7992 (Symbol::override_base): Call override_version.
7993 (Symbol::override_base_with_special): Likewise.
7994 * testsuite/ver_script_8.script: New file.
7995 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
7996 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
7997 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
7998 (ver_test_8_1.so, ver_test_8_2.so): New targets.
8000 2008-05-06 Ian Lance Taylor <iant@google.com>
8003 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
8005 (class General_options): Remove existing --undefined, and add
8006 --no-undefined instead. Add new --undefined as synonym for -u.
8007 * archive.cc (Archive::add_symbols): Check whether symbol was
8009 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
8010 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
8011 all uses. Add IS_UNDEFINED. Update declarations to split
8012 different versions of init_base. Declare init_base_undefined.
8013 (Symbol::is_defined): Handle IS_UNDEFINED.
8014 (Symbol::is_undefined): Likewise.
8015 (Symbol::is_weak_undefined): Call is_undefined.
8016 (Symbol::is_absolute): Handle IS_CONSTANT.
8017 (class Sized_symbol): Update declarations to split different
8018 versions of init. Declare init_undefined.
8019 (class Symbol_table): Declare new functions.
8020 * symtab.cc (Symbol::init_base_object): Rename from init_base.
8022 (Symbol::init_base_output_data): Likewise.
8023 (Symbol::init_base_output_segment): Likewise.
8024 (Symbol::init_base_constant): Likewise.
8025 (Symbol::init_base_undefined): New function.
8026 (Sized_symbol::init_object): Rename from init. Change all
8028 (Sized_symbol::init_output_data): Likewise.
8029 (Sized_symbol::init_output_segment): Likewise.
8030 (Sized_symbol::init_constant): Likewise.
8031 (Sized_symbol::init_undefined): New function.
8032 (Symbol_table::add_undefined_symbols_from_command_line): New
8034 (Symbol_table::do_add_undefined_symbols_from_command_line): New
8036 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
8037 (Symbol::output_section): Likewise.
8038 (Symbol::set_output_section): Likewise.
8039 (Symbol_table::sized_finalize_symbol): Likewise.
8040 (Symbol_table::sized_write_globals): Likewise.
8041 * resolve.cc (Symbol_table::should_override): Likewise.
8042 (Symbol::override_base_with_special): Likewise.
8044 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
8045 symbol, change it to have default visibility.
8046 * testsuite/protected_1.cc: New file.
8047 * testsuite/protected_2.cc: New file.
8048 * testsuite/protected_3.cc: New file.
8049 * testsuite/protected_main_1.cc: New file.
8050 * testsuite/protected_main_2.cc: New file.
8051 * testsuite/protected_main_3.cc: New file.
8052 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
8053 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
8054 (protected_1_LDFLAGS, protected_1_LDADD): Define.
8055 (protected_1.so): New target.
8056 (protected_1_pic.o, protected_2_pic.o): New targets.
8057 (protected_3_pic.o): New target.
8058 (check_PROGRAMS): Add protected_2.
8059 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
8060 (protected_2_LDFLAGS, protected_2_LDADD): Define.
8061 * testsuite/Makefile.in: Rebuild.
8063 * options.h (DEFINE_var): Add set_user_set_##varname__.
8064 (DEFINE_bool_alias): New macro.
8065 (class General_options): Define -Bstatic using DEFINE_bool_alias
8066 rather than DEFINE_special. Add --undefined as an alias for -z
8068 * options.cc (General_options::parse_Bstatic): Remove.
8070 * options.h (class General_options): Add --fatal-warnings.
8071 * main.cc (main): Implement --fatal-warnings.
8072 * errors.h (Errors::warning_count): New function.
8074 * options.h (class General_options): Add -Bsymbolic-functions.
8075 * symtab.h (Symbol::is_preemptible): Check for
8076 -Bsymbolic-functions.
8078 2008-05-05 Ian Lance Taylor <iant@google.com>
8080 * options.h (DEFINE_bool): For DASH_Z, create the negative option
8081 as noVARNAME rather than no-VARNAME.
8082 (class General_options): Add option -z combreloc.
8083 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
8085 (Output_reloc::sort_before) [SHT_REL]: New function.
8086 (Output_reloc::sort_before) [SHT_RELA]: New function.
8087 (class Output_data_reloc_base): Add sort_relocs_ field. Define
8088 Sort_relocs_comparison.
8089 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
8090 parameter. Change all callers.
8091 (Output_data_reloc::Output_data_reloc) [both versions]: Add
8092 sort_relocs parameter. Change all callers.
8093 * output.cc (Output_reloc::get_address): New function, broken out
8095 (Output_reloc::write_rel): Call it.
8096 (Output_reloc::compare): New function.
8097 (Output_data_reloc_base::do_write): Optionally sort relocs.
8099 * configure.ac: If targ_extra_obj is set, link it in.
8100 * configure.tgt: Initialize all variables.
8101 (x86_64*): Set targ_extra_obj and targ_extra_size.
8102 * configure: Rebuild.
8104 * object.cc (Sized_relobj::include_section_group): Adjust section
8105 indexes read from group data. Build vector to pass to
8107 * layout.cc (Layout::layout_group): Add flags and shndxes
8108 parameters. Remove contents parameter. Change caller. Update
8109 explicit instantiations.
8110 * layout.h (class Layout): Update layout_group declaration.
8111 * output.cc (Output_data_group::Output_data_group): Add flags and
8112 input_shndxes parameters. Remove contents parameter. Change
8114 (Output_data_group::do_write): Change input_sections_ to
8116 * output.h (class Output_data_group): Update constructor
8117 declaration. Rename input_sections_ to input_shndxes_.
8118 * testsuite/many_sections_test.cc: Add template.
8120 2008-04-30 Cary Coutant <ccoutant@google.com>
8122 * target-reloc.h (relocate_section): Fix dead-pointer bug.
8124 * layout.cc (Layout::include_section): Refactored check for debug
8126 (Layout::add_comdat): Add new parameters. Change type
8127 of signature parameter. Add object and shndx to signatures table.
8128 (Layout::find_kept_object): New function.
8129 * layout.h: Include <cstring>.
8130 (Layout::is_debug_info_section): New function.
8131 (Layout::add_comdat): Add new parameters.
8132 (Layout::find_kept_object): New function.
8133 (Layout::Kept_section): New struct.
8134 (Layout::Signatures): Change type of map range.
8135 * object.cc (Relobj::output_section_address): New function.
8136 (Sized_relobj::include_section_group): Add new parameters. Change
8137 calls to Layout::add_comdat. Change to build table of kept comdat
8138 groups and table mapping discarded sections to kept sections.
8139 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
8140 (Sized_relobj::do_layout): Change calls to include_section_group and
8141 include_linkonce_section.
8142 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
8143 value to zero when section is discarded.
8144 (Sized_relobj::map_to_kept_section): New function.
8145 * object.h (Relobj::output_section_address): New function.
8146 (Relobj::Comdat_group): New type.
8147 (Relobj::find_comdat_group): New function.
8148 (Relobj::Comdat_group_table): New type.
8149 (Relobj::Kept_comdat_section): New type.
8150 (Relobj::Kept_comdat_section_table): New type.
8151 (Relobj::add_comdat_group): New function.
8152 (Relobj::set_kept_comdat_section): New function.
8153 (Relobj::get_kept_comdat_section): New function.
8154 (Relobj::comdat_groups_): New field.
8155 (Relobj::kept_comdat_sections_): New field.
8156 (Symbol_value::input_value): Update comment.
8157 (Sized_relobj::map_to_kept_section) New function.
8158 (Sized_relobj::include_linkonce_section): Add new parameter.
8159 * target-reloc.h (Comdat_behavior): New type.
8160 (get_comdat_behavior): New function.
8161 (relocate_section): Add code to map a discarded section to the
8162 corresponding kept section when applying a relocation.
8164 2008-04-30 Craig Silverstein <csilvers@google.com>
8166 * dwarf_reader.cc (next_generation_count): New static var.
8167 (Addr2line_cache_entry): New struct.
8168 (addr2line_cache): New static var.
8169 (Dwarf_line_info::one_addr2line): Added caching.
8170 (Dwarf_line_info::clear_addr2line_cache): New function.
8171 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
8172 cache-size parameter.
8173 (Dwarf_line_info::one_addr2line_cache): New function.
8174 * symtab.cc (Symbol_table::detect_odr_violations): Pass
8175 new cache-size argument to one_addr2line(), and clear cache.
8177 2008-04-28 Cary Coutant <ccoutant@google.com>
8179 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
8180 R_386_PC8 relocations.
8182 2008-04-23 Ian Lance Taylor <iant@google.com>
8184 * object.cc (Sized_relobj::include_section_group): Check for
8185 invalid section group.
8187 * object.cc (make_elf_object): Correct test for 64-bit ELF file
8190 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
8191 than read for file header.
8192 * archive.cc (Archive::include_member): Likewise.
8194 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
8196 * aclocal.m4: Regenerate.
8197 * configure: Regenerate.
8199 2008-04-19 Ian Lance Taylor <iant@google.com>
8201 * version.cc (version_string): Bump to 1.6.
8203 * testsuite/Makefile.am (many_sections_r_test): New target.
8204 (many_sections_r_test_SOURCES): Remove.
8205 (many_sections_r_test_DEPENDENCIES): Remove.
8206 (many_sections_r_test_LDFLAGS): Remove.
8207 (many_sections_r_test_LDADD): Remove.
8209 * object.cc (Sized_relobj::do_add_symbols): Always pass
8210 local_symbol_count_ to add_from_relobj.
8212 * testsuite/Makefile.am (many_sections_check.h): Only check one in
8213 every thousand variables.
8214 * testsuite/Makefile.in: Rebuild.
8216 * object.cc (Xindex::initialize_symtab_xindex): New function.
8217 (Xindex::read_symtab_xindex): New function.
8218 (Xindex::sym_xindex_to_shndx): New function.
8219 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
8221 (Sized_relobj::do_initialize_xindex): New function.
8222 (Sized_relobj::do_read_symbols): Adjust section links.
8223 (Sized_relobj::symbol_section_and_value): Add is_ordinary
8224 parameter. Change all callers.
8225 (Sized_relobj::include_section_group): Adjust section links and
8226 symbol section indexes.
8227 (Sized_relobj::do_layout): Adjust section links.
8228 (Sized_relobj::do_count_local_symbols): Adjust section links and
8229 symbol section indexes.
8230 (Sized_relobj::do_finalize_local_symbols): Distinguish between
8231 ordinary and special symbols.
8232 (Sized_relobj::write_local_symbols): Add symtab_xindex and
8233 dynsym_xindex parameters. Change all callers. Adjust section
8234 links. Use SHN_XINDEX when needed.
8235 (Sized_relobj::get_symbol_location_info): Adjust section links.
8236 Don't get fooled by special symbols.
8237 * object.h (class Xindex): Define.
8238 (class Object): Add xindex_ parameter. Declare virtual functoin
8239 do_initialize_xindex.
8240 (Object::adjust_sym_shndx): New function.
8241 (Object::set_xindex): New protected function.
8242 (class Symbol_value): Add is_ordinary_shndx_ field.
8243 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
8244 (Symbol_value::value): Assert ordinary section.
8245 (Symbol_value::initialize_input_to_output_map): Likewise.
8246 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
8248 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
8250 (class Sized_relobj): Update declarations.
8251 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
8252 parameter. Change all callers.
8253 (Sized_relobj::adjust_shndx): New function.
8254 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
8256 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
8257 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
8258 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
8259 (Sized_dynobj::read_dynsym_section): Adjust section links.
8260 (Sized_dynobj::read_dynamic): Likewise.
8261 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
8263 (Sized_dynobj::do_initialize_xindex): New function.
8264 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
8265 do_initialize_xindex.
8266 (Sized_dynobj::adjust_shndx): New function.
8267 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
8268 dynsym_xindex_ fields.
8269 (Layout::finalize): Add a call to set_section_indexes before
8270 creating the symtab sections.
8271 (Layout::set_section_indexes): Don't do anything if the section
8272 already has a section index.
8273 (Layout::create_symtab_sections): Add shnum parameter. Change
8274 caller. Create .symtab_shndx section if needed.
8275 (Layout::create_shdrs): Add shstrtab_section parameter. Change
8277 (Layout::allocated_output_section_count): New function.
8278 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
8280 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
8281 fields. Update declarations.
8282 (Layout::symtab_xindex): New function.
8283 (Layout::dynsym_xindex): New function.
8284 (class Write_symbols_task): Add layout_ field.
8285 (Write_symbols_task::Write_symbols_task): Add layout parameter.
8287 * output.cc (Output_section_headers::Output_section_headers): Add
8288 shstrtab_section parameter. Change all callers.
8289 (Output_section_headers::do_sized_write): Store overflow values
8290 for section count and section string table section index in
8291 section header zero.
8292 (Output_file_header::do_sized_write): Check for overflow of
8293 section count and section string table section index.
8294 (Output_symtab_xindex::do_write): New function.
8295 (Output_symtab_xindex::endian_do_write): New function.
8296 * output.h (class Output_section_headers): Add shstrtab_section_.
8297 Update declarations.
8298 (class Output_symtab_xindex): Define.
8299 (Output_section::has_out_shndx): New function.
8300 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
8302 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
8304 (Sized_symbol::init): Likewise.
8305 (Symbol::output_section): Check for ordinary symbol.
8306 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
8307 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
8309 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
8310 Change all callers. Simplify handling of symbols from sections
8311 not included in the link.
8312 (Symbol_table::add_from_dynobj): Handle ordinary symbol
8314 (Weak_alias_sorter::operator()): Assert that symbols are
8316 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
8318 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
8319 parameters. Change all callers.
8320 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
8321 symbol distinction. Use SHN_XINDEX when needed.
8322 (Symbol_table::write_section_symbol): Add symtab_xindex
8323 parameter. Change all callers.
8324 (Symbol_table::sized_write_section_symbol): Likewise. Use
8325 SHN_XINDEX when needed.
8326 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
8328 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
8329 (Symbol::is_defined): Check is_ordinary.
8330 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
8331 (Symbol::is_absolute, Symbol::is_common): Likewise.
8332 (class Sized_symbol): Update declarations.
8333 (class Symbol_table): Update declarations.
8334 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
8335 parameters. Change all callers.
8336 (Sized_symbol::override): Likewise.
8337 (Symbol_table::override): Likewise.
8338 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
8339 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
8340 is_ordinary, and orig_st_shndx parameters. Change all callers.
8341 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
8342 to be in an ordinary section.
8343 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
8344 object and is_ordinary parameters. Change all callers.
8345 (Sized_dwarf_line_info::read_relocs): Add object parameter.
8346 Change all callers. Don't add undefined or non-ordinary symbols
8348 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
8350 * dwarf_reader.h (class Sized_dwarf_line_info): Update
8352 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
8353 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
8354 (Sized_relobj::relocate_sections): Likewise.
8355 * target-reloc.h (scan_relocs): Adjust section symbol index.
8356 (scan_relocatable_relocs): Likewise.
8357 * i386.cc (Scan::local): Check for ordinary symbols.
8358 * sparc.cc (Scan::local): Likewise.
8359 * x86_64.cc (Scan::local): Likewise.
8360 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
8361 to symbol_section_and_value.
8362 * testsuite/many_sections_test.cc: New file.
8363 * testsuite/Makefile.am (BUILT_SOURCES): Define.
8364 (check_PROGRAMS): Add many_sections_test.
8365 (many_sections_test_SOURCES): Define.
8366 (many_sections_test_DEPENDENCIES): Define.
8367 (many_sections_test_LDFLAGS): Define.
8368 (BUILT_SOURCES): Add many_sections_define.h.
8369 (many_sections_define.h): New target.
8370 (BUILT_SOURCES): Add many_sections_check.h.
8371 (many_sections_check.h): New target.
8372 (check_PROGRAMS): Add many_sections_r_test.
8373 (many_sections_r_test_SOURCES): Define.
8374 (many_sections_r_test_DEPENDENCIES): Define.
8375 (many_sections_r_test_LDFLAGS): Define.
8376 (many_sections_r_test_LDADD): Define.
8377 (many_sections_r_test.o): New target.
8378 * testsuite/Makefile.in: Rebuild.
8380 2008-04-17 Cary Coutant <ccoutant@google.com>
8382 * errors.cc (Errors::info): New function.
8383 (gold_info): New function.
8384 * errors.h (Errors::info): New function.
8385 * gold.h (gold_info): New function.
8386 * object.cc (Input_objects::add_object): Print trace output.
8387 * options.cc (options::parse_set): New function.
8388 (General_options::parse_wrap): Deleted.
8389 (General_options::General_options): Deleted initializer.
8390 * options.h (options::String_set): New typedef.
8391 (options::parse_set): New function.
8392 (DEFINE_set): New macro.
8393 (General_options::wrap): Changed to use DEFINE_set. Changed
8394 callers of any_wrap_symbols and is_wrap_symbol.
8395 (General_options::trace, General_options::trace_symbol):
8397 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
8398 (General_options::wrap_symbols_): Deleted.
8399 * symtab.cc (Symbol_table::add_from_object): Print trace output.
8401 2008-04-17 David S. Miller <davem@davemloft.net>
8403 * options.cc (General_options::parse_V): New function.
8404 * options.h: Add entries for -V and -Qy.
8406 2008-04-17 Ian Lance Taylor <iant@google.com>
8408 * common.cc (Symbol_table::allocate_commons): Remove options
8409 parameter. Change caller.
8410 (Symbol_table::do_allocate_commons): Remove options parameter.
8411 Change caller. Just call do_allocate_commons_list twice.
8412 (Symbol_table::do_allocate_commons_list): New function, broken out
8413 of do_allocate_commons.
8414 * common.h (class Allocate_commons_task): Remove options_ field.
8416 * symtab.cc (Symbol_table::Symbol_table): Initialize
8418 (Symbol_table::add_from_object): Put TLS common symbols on
8420 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
8421 which are IN_OUTPUT_DATA.
8422 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
8423 allocate_commons and do_allocate_commons declarations. Declare
8424 do_allocate_commons_list.
8425 * gold.cc (queue_middle_tasks): Update creation of
8426 Allocate_commons_task to not pass options.
8427 * testsuite/Makefile.am (INCLUDES): Add -I.. .
8428 (TLS_TEST_C_FLAGS): New variable.
8429 (tls_test_c_pic.o): New target.
8430 (tls_test_shared.so): Link in tls_test_c_pic.o.
8431 (tls_test_c_pic_ie.o): New target.
8432 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
8433 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
8434 (tls_test_c.o): New target.
8435 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
8436 (tls_pic_test_LDADD): Likewise.
8437 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
8438 (tls_shared_gd_to_ie_test_LDADD): Likewise.
8439 (tls_test_c_gnu2.o): New target.
8440 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
8442 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
8443 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
8444 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
8445 * testsuite/tls_test.cc: Include "config.h".
8446 (t_last): Call t11_last.
8447 * testsuite/tls_test.h (t11, t11_last): Declare.
8448 * testsuite/tls_test_c.c: New file.
8449 * testsuite/tls_test_main.cc (thread_routine): Call t11.
8450 * configure.ac: Check for OpenMP support.
8451 * configure, config.in, Makefile.in: Rebuild.
8452 * testsuite/Makefile.in: Rebuild.
8454 2008-04-16 Cary Coutant <ccoutant@google.com>
8456 * i386.cc (Target_i386::define_tls_base_symbol): New function.
8457 (Target_i386::tls_base_symbol_defined_): New field.
8458 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
8459 (Target_i386::Scan::global): Likewise.
8460 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
8461 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
8462 (Target_x86_64::tls_base_symbol_defined_): New field.
8463 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
8464 (Target_x86_64::Scan::global): Likewise.
8466 2008-04-16 Cary Coutant <ccoutant@google.com>
8468 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
8469 (Symbol::needs_plt_entry): Allow weak undefined symbols.
8470 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
8471 building shared libraries.
8472 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
8473 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
8474 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
8475 * testsuite/Makefile.in: Rebuild.
8476 * testsuite/weak_undef.h: New file.
8477 * testsuite/weak_undef_file1.cc: Add extra test cases.
8478 * testsuite/weak_undef_file2.cc: Likewise.
8479 * testsuite/weak_undef_test.cc: Likewise.
8481 2008-04-16 David S. Miller <davem@davemloft.net>
8483 * sparc.cc (Target_sparc::Scan): Change from struct to class.
8484 Add issued_non_pic_error_ field. Declare check_non_pic.
8485 (Target_sparc::Scan::check_non_pic): New function.
8486 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
8487 (Target_sparc::Scan::global): Likewise.
8489 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
8490 * configure: Rebuild.
8492 * options.h (DEFINE_enable): New macro.
8493 (new_dtags): New enable option.
8494 (initfirst, interpose, loadfltr, nodefaultlib,
8495 nodelete, nodlopen, nodump): New -z options.
8496 * layout.cc (Layout:finish_dynamic_section): If new
8497 dtags enabled, emit DT_RUNPATH. Also, emit a
8498 DT_FLAGS_1 containing any specified -z flags.
8500 2008-04-16 Ian Lance Taylor <iant@google.com>
8502 * copy-relocs.cc: New file.
8503 * copy-relocs.h: New file.
8504 * reloc.cc: Remove Copy_relocs code.
8505 * reloc.h: Likewise.
8506 * reloc-types.h (struct Reloc_types) [both versions]: Add
8507 get_reloc_addend_noerror.
8508 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
8509 variants of add_global which take an addend which must be zero.
8510 * i386.cc: Include "copy-relocs.h".
8511 (class Target_i386): Change type of copy_relocs_ to variable,
8513 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
8515 (Target_i386::do_finalize_sections): Change handling of
8517 * sparc.cc: Include "copy-relocs.h".
8518 (class Target_sparc): Change type of copy_relocs_ to variable,
8520 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
8522 (Target_sparc::do_finalize_sections): Change handling of
8524 * x86_64.cc: Include "copy-relocs.h".
8525 (class Target_x86_64): Change type of copy_relocs_ to variable,
8527 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
8528 class. Change all callers.
8529 (Target_x86_64::do_finalize_sections): Change handling of
8531 * Makefile.am (CCFILES): Add copy-relocs.cc.
8532 (HFILES): Add copy-relocs.h.
8534 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
8536 * testsuite/script_test_4.sh: Permit leading zeroes.
8538 2008-04-15 Ian Lance Taylor <iant@google.com>
8540 * script-sections.cc (Script_sections::create_segments): Use
8541 header_size_adjustment even when there is enough room for the
8543 * testsuite/script_test_4.sh: New file.
8544 * testsuite/script_test_4.t: New file.
8545 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
8546 (check_DATA): Add script_test_4.stdout.
8547 (MOSTLYCLEANFILES): Likewise.
8548 (script_test_4): New target.
8549 (script_test_4.stdout): New target.
8550 * testsuite/Makefile.in: Rebuild.
8552 * sparc.cc: Add definitions for Output_data_plt_sparc class
8555 2008-04-14 David S. Miller <davem@davemloft.net>
8557 * sparc.cc: New file.
8558 * Makefile.am (TARGETSOURCES): Add sparc.cc
8559 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
8560 * configure.tgt: Document targ_extra_size and
8561 targ_extra_big_endian. Add entries for sparc-* and
8563 * configure.ac: Handle targ_extra_size and
8564 targ_extra_big_endian.
8565 * Makefile.in: Rebuild.
8566 * configure: Likewise.
8567 * po/POTFILES.in: Likewise.
8568 * po/gold.pot: Likewise.
8570 2008-04-14 Ian Lance Taylor <iant@google.com>
8572 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
8573 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
8574 in the name/type/flags to section mapping. Don't call
8575 allocate_output_section.
8576 (Layout::choose_output_section): Change parameter from adjust_name
8577 to is_input_section. Don't permit input sections after sections
8578 are attached to segments. Don't call allocate_output_section.
8579 (Layout::layout_eh_frame): Call update_flags_for_input_section,
8580 not write_enable_output_section.
8581 (Layout::make_output_section): Don't push to
8582 unattached_section_list_ nor call attach_to_segment. Call
8583 attach_section_to_segment if sections are attached.
8584 (Layout::attach_sections_to_segments): New function.
8585 (Layout::attach_section_to_segment): New function.
8586 (Layout::attach_allocated_section_to_segment): Rename from
8587 attach_to_segment. Remove flags parameter.
8588 (Layout::allocate_output_section): Remove function.
8589 (Layout::write_enable_output_section): Remove function.
8590 * layout.h (class Layout): Update for above changes. Add new
8591 field sections_are_attached_.
8592 * output.h (Output_section::update_flags_for_input_section): New
8594 * output.cc (Output_section::add_input_section): Call
8595 update_flags_for_input_section.
8596 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
8598 2008-04-11 Cary Coutant <ccoutant@google.com>
8600 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
8601 thought unnecessary.
8602 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
8604 2008-04-11 Ian Lance Taylor <iant@google.com>
8606 * output.h (class Output_section_data): Remove inline definition
8608 * output.cc (Output_section_data::set_addralign): New function.
8610 2008-04-11 Cary Coutant <ccoutant@google.com>
8612 Add support for TLS descriptors for i386 and x86_64.
8613 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
8614 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
8615 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
8617 (Target_i386::got_mod_index_entry): Remove unnecessary code.
8618 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
8619 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
8621 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
8622 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
8623 Fix problem with initial-exec relocations.
8624 (Target_i386::Relocate::relocate_tls): Likewise.
8625 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
8627 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
8628 support for section-plus-offset dynamic table entries.
8629 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
8630 (Output_data_dynamic::Dynamic_entry): Add support for
8631 section-plus-offset dynamic table entries.
8632 (Output_data_dynamic::Classification): Likewise.
8633 (Output_data_dynamic::classification_): Renamed offset_.
8634 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
8635 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
8636 (Target_x86_64::make_plt_section): New function.
8637 (Target_x86_64::reserve_tlsdesc_entries): New function.
8638 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
8639 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
8640 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
8641 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
8642 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
8643 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
8644 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
8645 add extra PLT entry for TLS descriptors.
8646 (Output_data_plt_x86_64::got_): New field.
8647 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
8648 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
8650 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
8652 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
8653 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
8654 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
8655 R_386_TLS_DESC_CALL relocations.
8656 (Target_x86_64::Scan::global): Likewise.
8657 (Target_x86_64::do_finalize_sections): Add dynamic table entries
8658 for TLS descriptors.
8659 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
8660 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
8661 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
8662 GD-to-IE relaxation.
8663 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
8664 and TLS_DESCRIPTORS.
8665 * Makefile.in: Rebuild.
8666 * configure: Rebuild.
8667 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
8668 (tls_test_shared2.so): New target.
8669 (tls_shared_gd_to_ie_test_SOURCES): New variable.
8670 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
8671 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
8672 (tls_shared_gd_to_ie_test_LDADD): New variable.
8673 (tls_shared_gnu2_gd_to_ie_test): New target.
8674 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
8676 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
8677 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
8678 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
8679 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
8680 (tls_shared_gnu2_test): New target.
8681 (tls_test_gnu2_shared.so): New target.
8682 (tls_shared_gnu2_test_SOURCES): New variable.
8683 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
8684 (tls_shared_gnu2_test_LDFLAGS): New variable.
8685 (tls_shared_gnu2_test_LDADD): New variable.
8686 * testsuite/Makefile.in: Rebuild.
8687 * testsuite/Makefile.
8689 2008-04-11 Ian Lance Taylor <iant@google.com>
8691 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
8693 * testsuite/Makefile.in: Rebuild.
8695 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
8697 * testsuite/script_test_2.cc (main): Adjust test.
8699 2008-04-11 David S. Miller <davem@davemloft.net>
8700 Ian Lance Taylor <iant@google.com>
8702 * options.h (General_options): Add entries for '-Y' and
8704 * options.cc (General_options:finalize): If -Y was used, add those
8705 entries to the library path instead of the default "/lib" and
8708 2008-04-11 David S. Miller <davem@davemloft.net>
8710 * testsuite/justsyms.t: Start at 0x100.
8711 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
8712 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
8714 * testsuite/script_test_2.cc: Adjust string and section length
8717 2008-04-09 Ian Lance Taylor <iant@google.com>
8720 * script-sections.cc (Sections_element::allocate_to_segment): Add
8722 (Output_section_definition::allocate_to_segment): Likewise.
8723 (Orphan_output_section::allocate_to_segment): Likewise.
8724 (Script_sections::attach_sections_using_phdrs_clause): Don't
8725 propagate non-PT_LOAD segments to orphan sections.
8726 * testsuite/Makefile.am (script_test_3.stdout): Generate using
8727 readelf rather than objdump.
8728 * testsuite/script_test_3.sh: Adjust accordingly. Test that
8729 .interp section and PT_INTERP segment are the same size.
8730 * testsuite/Makefile.in: Rebuild.
8732 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
8733 aliases for symbols defined in the same object.
8734 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
8735 (weak_alias_test_SOURCES): New variable.
8736 (weak_alias_test_DEPENDENCIES): New variable.
8737 (weak_alias_test_LDFLAGS): New variable.
8738 (weak_alias_test_LDADD): New variable.
8739 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
8740 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
8741 (weak_alias_test_3.o): New target.
8742 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
8743 * testsuite/weak_alias_test_main.cc: New file.
8744 * testsuite/weak_alias_test_1.cc: New file.
8745 * testsuite/weak_alias_test_2.cc: New file.
8746 * testsuite/weak_alias_test_3.cc: New file.
8748 2008-04-08 Ian Lance Taylor <iant@google.com>
8750 * options.h (class General_options): Add --noinhibit-exec option.
8751 * main.cc (main): Check --noinhibit-exec.
8753 * options.h (class General_options): Define --wrap as a special
8754 option. Add wrap_symbols_ field.
8755 (General_options::any_wrap_symbols): New function.
8756 (General_options::is_wrap_symbol): New function.
8757 * options.cc (General_options::parse_wrap): New function.
8758 (General_options::General_options): Initialize wrap_symbols_.
8759 * symtab.cc (Symbol_table::wrap_symbol): New function.
8760 (Symbol_table::add_from_object): Handle --wrap.
8761 * symtab.h (class Symbol_table): Declare wrap_symbol.
8762 * target.h (Target::wrap_char): New function.
8763 (Target::Target_info): Add wrap_char field.
8764 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
8765 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
8766 * testsuite/testfile.cc (Target_test::test_target_info):
8769 * errors.cc (Errors::undefined_symbol): Mention symbol version if
8772 * layout.h (class Layout): Add added_eh_frame_data_ field.
8773 * layout.cc (Layout::Layout): Initialize new field.
8774 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
8775 output section until we find a section we merged successfully.
8776 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
8777 that the size be non-zero.
8779 * merge.cc (Object_merge_map::get_output_offset): Remove inline
8782 2008-04-08 Craig Silverstein <csilvers@google.com>
8784 * configure.ac: Export new conditional variable HAVE_ZLIB.
8785 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
8787 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
8788 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8790 2008-04-07 Ian Lance Taylor <iant@google.com>
8792 * version.cc (version_string): Set to "1.5".
8794 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
8795 Add issued_non_pic_error_ field. Declare check_non_pic.
8796 (Target_x86_64::Scan::check_non_pic): New function.
8797 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
8798 (Target_x86_64::Scan::global): Likewise.
8800 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
8801 addend parameter. Change caller. Handle merge sections.
8802 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
8803 Address to Addend. Don't add in the result of
8804 local_section_offset, pass down the addend and use the returned
8806 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
8807 Update declarations of local_section_offset and symbol_value.
8808 * testsuite/two_file_test_1.cc (t18): New function.
8809 * testsuite/two_file_test_2.cc (f18): New function.
8810 * testsuite/two_file_test_main.cc (main): Call t18.
8811 * testsuite/two_file_test.h (t18, f18): Declare.
8813 * configure.ac: Don't test for objdump, c++filt, or readelf.
8814 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
8816 (TEST_READELF): New variable.
8817 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
8818 (check_PROGRAMS): Add two_file_strip_test.
8819 (two_file_strip_test): New target.
8820 (check_PROGRAMS): Add two_file_same_shared_strip_test.
8821 (two_file_same_shared_strip_test_SOURCES): New variable.
8822 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
8823 (two_file_same_shared_strip_test_LDFLAGS): New variable.
8824 (two_file_same_shared_strip_test_LDADD): New variable.
8825 (two_file_shared_strip.so): New target.
8826 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
8827 (ver_test_5.syms, ver_test_7.syms): Likewise.
8828 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
8829 (strip_test_3.stdout): Use TEST_OBJDUMP.
8830 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
8832 2008-04-04 Cary Coutant <ccoutant@google.com>
8834 * symtab.h (Symbol::is_weak_undefined): New function.
8835 (Symbol::is_strong_undefined): New function.
8836 (Symbol::is_absolute): New function.
8837 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
8838 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
8840 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
8841 (weak_undef_test): New target.
8842 * testsuite/Makefile.in: Rebuild.
8843 * testsuite/weak_undef_file1.cc: New file.
8844 * testsuite/weak_undef_file2.cc: New file.
8845 * testsuite/weak_undef_test.cc: New file.
8847 2008-04-03 Craig Silverstein <csilvers@google.com>
8849 * compressed_output.h (class Output_compressed_section): Use
8851 * compressed_output.cc (zlib_compress): Use unsigned buffers,
8853 (zlib_compressed_suffix): Removed.
8854 (Output_compressed_section::set_final_data_size): Use unsigned
8856 * testsuite/Makefile.am (flagstest_compress_debug_sections):
8857 Fix linker invocation.
8858 (flagstest_o_specialfile_and_compress_debug_sections):
8860 * testsuite/Makefile.in: Regenerated.
8862 2008-04-02 David S. Miller <davem@davemloft.net>
8864 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
8865 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
8867 2008-04-02 Craig Silverstein <csilvers@google.com>
8871 2008-04-02 Ian Lance Taylor <iant@google.com>
8873 * fileread.cc (File_read::find_view): Add byteshift and vshifted
8874 parameters. Update for new key type to views_. Change all
8876 (File_read::read): Adjust for byteshift in returned view.
8877 (File_read::add_view): New function, broken out of
8879 (File_read::make_view): New function, broken out of
8881 (File_read::find_or_make_view): Add offset and aligned
8882 parameters. Rewrite accordingly. Change all callers.
8883 (File_read::get_view): Add offset and aligned parameters. Adjust
8884 for byteshift in return value.
8885 (File_read::get_lasting_view): Likewise.
8886 * fileread.h (class File_read): Update declarations.
8887 (class File_read::View): Add byteshift_ field. Add byteshift to
8888 constructor. Add byteshift method.
8889 * archive.h (Archive::clear_uncached_views): New function.
8890 (Archive::get_view): Add aligned parameter. Change all callers.
8891 * object.h (Object::get_view): Add aligned parameter. Change all
8893 (Object::get_lasting_view): Likewise.
8895 * fileread.cc (File_read::release): Don't call clear_views if
8896 there are multiple objects.
8897 * fileread.h (File_read::clear_uncached_views): New function.
8898 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
8901 2008-03-31 Cary Coutant <ccoutant@google.com>
8903 Add thin archive support.
8904 * archive.cc (Archive::armagt): New const.
8905 (Archive::setup): Remove task parameter and calls to unlock.
8906 (Archive::unlock_nested_archives): New function.
8907 (Archive::read_header): Add nested_off parameter. Change
8909 (Archive::interpret_header): Likewise.
8910 (Archive::include_all_members): Change to handle thin
8912 (Archive::include_member): Likewise.
8913 * archive.h (Archive::Archive): Add new parameters and
8915 (Archive::armagt): New const.
8916 (Archive::setup): Remove task parameter.
8917 (Archive::unlock_nested_archives): New function.
8918 (Archive::read_header): Add nested_off parameter.
8919 (Archive::interpret_header): Likewise.
8920 (Archive::Nested_archive_table): New typedef.
8921 (Archive::is_thin_archive_): New field.
8922 (Archive::nested_archives_): New field.
8923 (Archive::options_): New field.
8924 (Archive::dirpath_): New field.
8925 (Archive::task_): New field.
8926 * readsyms.cc (Read_symbols::do_read_symbols): Add check
8927 for thin archives. Pass additional parameters to
8928 Archive::Archive. Unlock the archive file after calling
8931 2008-03-29 Ian Lance Taylor <iant@google.com>
8933 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
8934 version symbol to be local.
8935 * testsuite/ver_test_4.sh: New file.
8936 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
8937 (check_DATA): Add ver_test_4.syms.
8938 (ver_test_4.syms): New target.
8939 * testsuite/Makefile.in: Rebuild.
8942 (Output_section::Input_section_sort_entry::has_priority): New
8944 (Output_section::Input_section_sort_entry::match_file_name): New
8946 (Output_section::Input_section_sort_entry::match_section_name):
8948 (Output_section::Input_section_sort_entry::match_section_name_prefix):
8950 (Output_section::Input_section_sort_entry::match_section_file):
8952 (Output_section::Input_section_sort_compare::operator()): Rewrite
8953 using new Input_section_sort_entry functions. Sort crtbegin and
8954 crtend first. Sort sections with no priority before sections with
8956 * testsuite/initpri1.c (d3): Check j != 4.
8957 (cd5): New constructor/destructor function.
8958 (main): Check j != 2.
8960 * symtab.cc (Symbol_table::add_from_object): If we don't use the
8961 new symbol when resolving, don't call set_is_default.
8962 * testsuite/ver_test_7.cc: New file.
8963 * testsuite/ver_test_7.sh: New file.
8964 * testsuite/Makefile.am (ver_test_7.so): New target.
8965 (ver_test_7.o): New target.
8966 (check_SCRIPTS): Add ver_test_7.sh.
8967 (check_DATA): Add ver_test_7.syms.
8968 (ver_test_7.syms): New target.
8970 2008-03-28 Ian Lance Taylor <iant@google.com>
8972 * layout.cc (Layout::layout): If we see an input section with a
8973 name that needs sorting, set the must_sort flag for the output
8975 (Layout::make_output_section): If the name of the output section
8976 indicates that it might require sorting, set the may_sort flag.
8977 * output.h (Output_section::may_sort_attached_input_sections): New
8979 (Output_section::set_may_sort_attached_input_sections): New
8981 (Output_section::must_sort_attached_input_sections): New
8983 (Output_section::set_must_sort_attached_input_sections): New
8985 (class Output_section): Declare Input_section_sort_entry. Define
8986 Input_section_sort_compare. Declare
8987 sort_attached_input_sections. Add new fields:
8988 may_sort_attached_input_sections_,
8989 must_sort_attached_input_sections_,
8990 attached_input_sections_are_sorted_.
8991 * output.cc (Output_section::Output_section): Initialize new
8993 (Output_section::add_input_section): Add an entry to
8994 input_sections_ if may_sort or must_sort are true.
8995 (Output_section::set_final_data_size): Call
8996 sort_attached_input_sections if necessary.
8997 (Output_section::Input_section_sort_entry): Define new class.
8998 (Output_section::Input_section_sort_compare::operator()): New
9000 (Output_section::sort_attached_input_sections): New function.
9001 * configure.ac: Check whether the compiler supports constructor
9002 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
9003 * testsuite/initpri1.c: New file.
9004 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
9005 CONSTRUCTOR_PRIORITY.
9006 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
9007 (initpri1_LDFLAGS): New variable.
9008 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9010 2008-03-27 Ian Lance Taylor <iant@google.com>
9012 * common.cc (Sort_commons::operator): Correct sorting algorithm.
9013 * testsuite/common_test_1.c: New file.
9014 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
9015 (common_test_1_SOURCES): New variable.
9016 (common_test_1_DEPENDENCIES): New variable.
9017 (common_test_1_LDFLAGS): New variable.
9019 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
9020 and commons_ correctly when NAME/VERSION does not override
9022 * testsuite/ver_test_6.c: New file.
9023 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
9024 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
9025 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
9027 2008-03-26 Ian Lance Taylor <iant@google.com>
9029 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
9030 of an undefined symbol from a version script.
9031 * testsuite/Makefile.am (ver_test_5.so): New target.
9032 (ver_test_5.o): New target.
9033 (check_SCRIPTS): Add ver_test_5.sh.
9034 (check_DATA): Add ver_test_5.syms.
9035 (ver_test_5.syms): New target.
9036 * testsuite/ver_test_5.cc: New file.
9037 * testsuite/ver_test_5.script: New file.
9038 * testsuite/ver_test_5.sh: New file.
9039 * Makefile.in, testsuite/Makefile.in: Rebuild.
9042 Fix problems building gold with gcc 4.3.0.
9043 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
9044 (gold_error_at_location, gold_warning_at_location): Use it.
9045 * configure.ac: Check whether we can compile and use a template
9046 function with a printf attribute.
9047 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
9048 when jumping over bytes.
9049 * object.cc: Instantiate Object::read_section_data.
9050 * debug.h: Include <cstring>
9051 * dwarf_reader.cc: Include <algorithm>
9052 * main.cc: Include <cstring>.
9053 * options.cc: Include <cstring>.
9054 * output.cc: Include <cstring>.
9055 * script.cc: Include <cstring>.
9056 * script.h: Include <string>.
9057 * symtab.cc: Include <cstring> and <algorithm>.
9058 * target-select.cc: Include <cstring>.
9059 * version.cc: Include <string>.
9060 * testsuite/testmain.cc: Include <cstdlib>.
9061 * configure, config.in: Rebuild.
9063 2008-03-25 Ian Lance Taylor <iant@google.com>
9065 * options.cc: Include "../bfd/bfdver.h".
9066 (options::help): Print bug reporting address.
9068 * version.cc (print_version): Adjust output for current value of
9073 * options.cc (options::help): Print list of supported targets.
9074 * target-select.h: Include <vector>.
9075 (class Target_selector): Make machine_, size_, and is_big_endian_
9076 fields const. Add bfd_name_ and instantiated_target_ fields.
9077 (Target_selector::Target_selector): Add bfd_name parameter.
9078 (Target_selector::recognize): Make non-virtual, call
9080 (Target_selector::recognize_by_name): Make non-virtual, call
9081 do_recognize_by_name.
9082 (Target_selector::supported_names): New function.
9083 (Target_selector::bfd_name): New function.
9084 (Target_selector::do_instantiate_target): New pure virtual
9086 (Target_selector::do_recognize): New virtual function.
9087 (Target_selector::do_recognize_by_name): New virtual function.
9088 (Target_selector::instantiate_target): New private function.
9089 (supported_target_names): Declare.
9090 * target-select.cc (Target_selector::Target_selector): Update for
9091 new parameter and fields.
9092 (select_target_by_name): Check that the name matches before
9093 calling recognize_by_name.
9094 (supported_target_names): New function.
9095 * i386.cc (class Target_selector_i386): Update Target_selector
9096 constructor call. Remove recognize and recognize_by_name. Add
9097 do_instantiate_target.
9098 * x86_64.cc (class Target_selector_x86_64): Likewise.
9099 * testsuite/testfile.cc (class Target_selector_test): Update for
9100 changes to Target_selector.
9102 * README: Rewrite, with some notes on unsupported features.
9104 2008-03-24 Cary Coutant <ccoutant@google.com>
9106 * i386.cc (Target_i386::Got_type): New enum declaration.
9107 (Target_i386::Scan::local): Updated callers of Output_data_got
9109 (Target_i386::Scan::global): Likewise.
9110 (Target_i386::Relocate::relocate): Likewise.
9111 (Target_i386::Relocate::relocate_tls): Likewise.
9112 * object.h (Got_offset_list): New class.
9113 (Sized_relobj::local_has_got_offset): Added got_type parameter.
9114 (Sized_relobj::local_got_offset): Likewise.
9115 (Sized_relobj::set_local_got_offset): Likewise.
9116 (Sized_relobj::local_has_tls_got_offset): Removed.
9117 (Sized_relobj::local_tls_got_offset): Removed.
9118 (Sized_relobj::set_local_tls_got_offset): Removed.
9119 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
9120 * output.cc (Output_data_got::add_global): Added got_type parameter.
9121 (Output_data_got::add_global_with_rel): Likewise.
9122 (Output_data_got::add_global_with_rela): Likewise.
9123 (Output_data_got::add_global_pair_with_rel): New function.
9124 (Output_data_got::add_global_pair_with_rela): New function.
9125 (Output_data_got::add_local): Added got_type parameter.
9126 (Output_data_got::add_local_with_rel): Likewise.
9127 (Output_data_got::add_local_with_rela): Likewise.
9128 (Output_data_got::add_local_pair_with_rel): New function.
9129 (Output_data_got::add_local_pair_with_rela): New function.
9130 (Output_data_got::add_global_tls): Removed.
9131 (Output_data_got::add_global_tls_with_rel): Removed.
9132 (Output_data_got::add_global_tls_with_rela): Removed.
9133 (Output_data_got::add_local_tls): Removed.
9134 (Output_data_got::add_local_tls_with_rel): Removed.
9135 (Output_data_got::add_local_tls_with_rela): Removed.
9136 * output.h (Output_data_got::add_global): Added got_type parameter.
9137 (Output_data_got::add_global_with_rel): Likewise.
9138 (Output_data_got::add_global_with_rela): Likewise.
9139 (Output_data_got::add_global_pair_with_rel): New function.
9140 (Output_data_got::add_global_pair_with_rela): New function.
9141 (Output_data_got::add_local): Added got_type parameter.
9142 (Output_data_got::add_local_with_rel): Likewise.
9143 (Output_data_got::add_local_with_rela): Likewise.
9144 (Output_data_got::add_local_pair_with_rel): New function.
9145 (Output_data_got::add_local_pair_with_rela): New function.
9146 (Output_data_got::add_global_tls): Removed.
9147 (Output_data_got::add_global_tls_with_rel): Removed.
9148 (Output_data_got::add_global_tls_with_rela): Removed.
9149 (Output_data_got::add_local_tls): Removed.
9150 (Output_data_got::add_local_tls_with_rel): Removed.
9151 (Output_data_got::add_local_tls_with_rela): Removed.
9152 * resolve.cc (Symbol::override_base_with_special): Removed
9153 reference to has_got_offset_ field.
9154 * symtab.cc (Symbol::init_fields): Replaced initialization
9155 of got_offset_ with got_offsets_. Removed initialization
9157 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
9158 (Symbol::got_offset): Likewise.
9159 (Symbol::set_got_offset): Likewise.
9160 (Symbol::has_tls_got_offset): Removed.
9161 (Symbol::tls_got_offset): Removed.
9162 (Symbol::set_tls_got_offset): Removed.
9163 (Symbol::got_offset_): Removed.
9164 (Symbol::tls_mod_got_offset_): Removed.
9165 (Symbol::tls_pair_got_offset_): Removed.
9166 (Symbol::got_offsets_): New field.
9167 (Symbol::has_got_offset): Removed.
9168 (Symbol::has_tls_mod_got_offset): Removed.
9169 (Symbol::has_tls_pair_got_offset): Removed.
9170 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
9171 (Target_x86_64::Scan::local): Updated callers of Output_data_got
9173 (Target_x86_64::Scan::global): Likewise.
9174 (Target_x86_64::Relocate::relocate): Likewise.
9175 (Target_x86_64::Relocate::relocate_tls): Likewise.
9177 2008-03-25 Ben Elliston <bje@au.ibm.com>
9179 * yyscript.y: Fix spelling error in comment.
9181 2008-03-24 Ian Lance Taylor <iant@google.com>
9183 * options.h (class General_options): Define build_id option.
9184 * layout.h (class Layout): Declare write_build_id, create_note,
9185 create_build_id. Add build_id_note_ member.
9186 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
9187 "libiberty.h", "md5.h", "sha1.h".
9188 (Layout::Layout): Initialize eh_frame_data_,
9189 eh_frame_hdr_section_, and build_id_note_.
9190 (Layout::finalize): Call create_build_id.
9191 (Layout::create_note): New function, broken out of
9192 Layout::create_gold_note.
9193 (Layout::create_gold_note): Call create_note.
9194 (Layout::create_build_id): New function.
9195 (Layout::write_build_id): New function.
9196 (Close_task_runner::run): Call write_build_id.
9198 * x86_64.cc: Correct license to GPLv3.
9200 2008-03-23 Ian Lance Taylor <iant@google.com>
9202 * options.cc: Include "demangle.h".
9203 (parse_optional_string): New function.
9204 (parse_long_option): Handle takes_optional_argument.
9205 (parse_short_option): Update dash_z initializer. Handle
9206 takes_optional_argument.
9207 (General_options::General_options): Initialize do_demangle_.
9208 (General_options::finalize): Set do_demangle_. Handle demangling
9210 * options.h (parse_optional_string): Declare.
9211 (struct One_option): Add optional_arg field. Update constructor.
9212 Update call constructor calls. Add takes_optional_argument
9214 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
9215 (DEFINE_optional_string): Define.
9216 (General_options::demangle): Change from DEFINE_bool to
9217 DEFINE_optional_string.
9218 (General_options::no_demangle): New function.
9219 (General_options::do_demangle): New function.
9220 (General_options::set_do_demangle): New function.
9221 (General_options::execstack_status_): Move definition to end of
9223 (General_options::static_): Likewise.
9224 (General_options::do_demangle_): New field.
9225 * object.cc (big_endian>::get_symbol_location_info): Call
9226 Options::do_demangle, not Options::demangle.
9227 * symtab.cc (demangle): Likewise.
9229 2008-03-22 Ian Lance Taylor <iant@google.com>
9231 * gold.h: Include <cstddef> and <sys/types.h>
9232 * options.h: Include <cstring>.
9234 2008-03-21 Ian Lance Taylor <iant@google.com>
9236 * Added source code to GNU binutils.